Commit c0b675c8 authored by Sergey.Konovalov's avatar Sergey.Konovalov Committed by Alexander Trofimov

Bug 26079 - Теряются ссылки в автофигурах при переоткрытии документа.

git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@59062 954022d7-b5bf-4e40-9824-e11837661b57
parent 3c341675
...@@ -120,6 +120,8 @@ namespace PPTX ...@@ -120,6 +120,8 @@ namespace PPTX
{ {
return smart_ptr<PPTX::File>(new PPTX::Image(filename)); return smart_ptr<PPTX::File>(new PPTX::Image(filename));
} }
else if(strT == PPTX::FileTypes::HyperLink)
return smart_ptr<PPTX::File>(new PPTX::HyperLink(relation.target()));
return smart_ptr<PPTX::File>(new PPTX::UnknowTypeFile()); return smart_ptr<PPTX::File>(new PPTX::UnknowTypeFile());
} }
......
...@@ -10,21 +10,30 @@ namespace PPTX ...@@ -10,21 +10,30 @@ namespace PPTX
{ {
namespace Logic namespace Logic
{ {
CString Hyperlink::GetFullHyperlinkName()const CString Hyperlink::GetFullHyperlinkName(FileContainer* pRels)const
{ {
if(id.IsInit() && *id != _T("")) if(id.IsInit() && *id != _T(""))
{ {
PPTX::RId rid(*id); PPTX::RId rid(*id);
CString sLink = _T(""); CString sLink = _T("");
if(parentFileIs<Slide>()) if (pRels != NULL)
sLink = parentFileAs<Slide>().GetFullHyperlinkNameFromRId(rid); {
else if(parentFileIs<SlideLayout>()) smart_ptr<PPTX::HyperLink> p = pRels->hyperlink(rid);
sLink = parentFileAs<SlideLayout>().GetFullHyperlinkNameFromRId(rid); if (p.is_init())
else if(parentFileIs<SlideMaster>()) sLink = p->Uri().m_strFilename;
sLink = parentFileAs<SlideMaster>().GetFullHyperlinkNameFromRId(rid); }
else if(parentFileIs<Theme>()) if(sLink.IsEmpty())
sLink = parentFileAs<Theme>().GetFullHyperlinkNameFromRId(rid); {
if(parentFileIs<Slide>())
sLink = parentFileAs<Slide>().GetFullHyperlinkNameFromRId(rid);
else if(parentFileIs<SlideLayout>())
sLink = parentFileAs<SlideLayout>().GetFullHyperlinkNameFromRId(rid);
else if(parentFileIs<SlideMaster>())
sLink = parentFileAs<SlideMaster>().GetFullHyperlinkNameFromRId(rid);
else if(parentFileIs<Theme>())
sLink = parentFileAs<Theme>().GetFullHyperlinkNameFromRId(rid);
}
sLink.Replace(TCHAR('\\'), TCHAR('/')); sLink.Replace(TCHAR('\\'), TCHAR('/'));
sLink.Replace(_T("//"), _T("/")); sLink.Replace(_T("//"), _T("/"));
......
...@@ -57,7 +57,11 @@ namespace PPTX ...@@ -57,7 +57,11 @@ namespace PPTX
if (id.is_init()) if (id.is_init())
{ {
CString str = GetFullHyperlinkName(); FileContainer* pRels = NULL;
if (pWriter->m_pCommonRels->is_init())
pRels = pWriter->m_pCommonRels->operator ->();
CString str = GetFullHyperlinkName(pRels);
pWriter->WriteString1(0, str); pWriter->WriteString1(0, str);
} }
...@@ -195,7 +199,7 @@ namespace PPTX ...@@ -195,7 +199,7 @@ namespace PPTX
snd->SetParentPointer(this); snd->SetParentPointer(this);
} }
virtual CString GetFullHyperlinkName()const; virtual CString GetFullHyperlinkName(FileContainer* pRels)const;
}; };
} // namespace Logic } // namespace Logic
} // namespace PPTX } // namespace PPTX
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment