Commit 92cda5bc authored by ElenaSubbotina's avatar ElenaSubbotina

fix bug #35146

parent 1a377d87
...@@ -1209,10 +1209,14 @@ namespace NSBinPptxRW ...@@ -1209,10 +1209,14 @@ namespace NSBinPptxRW
m_pWriter->WriteString(strRels); m_pWriter->WriteString(strRels);
} }
void CRelsGenerator::EndPresentationRels(const bool& bIsCommentsAuthors = false) void CRelsGenerator::EndPresentationRels(const bool& bIsCommentsAuthors = false, const bool& bIsNotesMaster = false)
{
if (bIsNotesMaster)
{ {
std::wstring strRels0 = L"<Relationship Id=\"rId" + std::to_wstring(m_lNextRelsID++) + std::wstring strRels0 = L"<Relationship Id=\"rId" + std::to_wstring(m_lNextRelsID++) +
L"\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/notesMaster\" Target=\"notesMasters/notesMaster1.xml\"/>"; L"\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/notesMaster\" Target=\"notesMasters/notesMaster1.xml\"/>";
m_pWriter->WriteString(strRels0);
}
std::wstring strRels1 = L"<Relationship Id=\"rId" + std::to_wstring(m_lNextRelsID++) + std::wstring strRels1 = L"<Relationship Id=\"rId" + std::to_wstring(m_lNextRelsID++) +
L"\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/presProps\" Target=\"presProps.xml\" />"; L"\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/presProps\" Target=\"presProps.xml\" />";
std::wstring strRels2 = L"<Relationship Id=\"rId" + std::to_wstring(m_lNextRelsID++) + std::wstring strRels2 = L"<Relationship Id=\"rId" + std::to_wstring(m_lNextRelsID++) +
...@@ -1220,7 +1224,6 @@ namespace NSBinPptxRW ...@@ -1220,7 +1224,6 @@ namespace NSBinPptxRW
std::wstring strRels3 = L"<Relationship Id=\"rId" + std::to_wstring(m_lNextRelsID++) + std::wstring strRels3 = L"<Relationship Id=\"rId" + std::to_wstring(m_lNextRelsID++) +
L"\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/viewProps\" Target=\"viewProps.xml\" />"; L"\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/viewProps\" Target=\"viewProps.xml\" />";
m_pWriter->WriteString(strRels0);
m_pWriter->WriteString(strRels1); m_pWriter->WriteString(strRels1);
m_pWriter->WriteString(strRels2); m_pWriter->WriteString(strRels2);
m_pWriter->WriteString(strRels3); m_pWriter->WriteString(strRels3);
......
...@@ -419,7 +419,7 @@ namespace NSBinPptxRW ...@@ -419,7 +419,7 @@ namespace NSBinPptxRW
int WriteRels (const std::wstring& bsType, const std::wstring& bsTarget, const std::wstring& bsTargetMode); int WriteRels (const std::wstring& bsType, const std::wstring& bsTarget, const std::wstring& bsTargetMode);
int WriteHyperlink (const std::wstring& strLink, const bool& bIsActionInit); int WriteHyperlink (const std::wstring& strLink, const bool& bIsActionInit);
void EndPresentationRels (const bool& bIsCommentsAuthors); void EndPresentationRels (const bool& bIsCommentsAuthors, const bool& bIsNotesMaster = false);
int GetNextId (); int GetNextId ();
void CloseRels (); void CloseRels ();
......
...@@ -184,6 +184,7 @@ namespace NSBinPptxRW ...@@ -184,6 +184,7 @@ namespace NSBinPptxRW
LONG nCountMasters = 0; LONG nCountMasters = 0;
LONG nCountLayouts = 0; LONG nCountLayouts = 0;
LONG nCountSlides = 0; LONG nCountSlides = 0;
bool bNotesMasterPresent = false;
pPair = m_mainTables.find(NSMainTables::Themes); pPair = m_mainTables.find(NSMainTables::Themes);
if (m_mainTables.end() != pPair) if (m_mainTables.end() != pPair)
...@@ -544,6 +545,7 @@ namespace NSBinPptxRW ...@@ -544,6 +545,7 @@ namespace NSBinPptxRW
m_oReader.m_pRels->Clear(); m_oReader.m_pRels->Clear();
m_oReader.m_pRels->StartNotesMaster(m_arSlideMasters_Theme.size()); m_oReader.m_pRels->StartNotesMaster(m_arSlideMasters_Theme.size());
bNotesMasterPresent = true;
if (lCount > 0) if (lCount > 0)
{ {
m_arNotesMasters.back().fromPPTY(&m_oReader); m_arNotesMasters.back().fromPPTY(&m_oReader);
...@@ -782,13 +784,16 @@ namespace NSBinPptxRW ...@@ -782,13 +784,16 @@ namespace NSBinPptxRW
} }
m_oReader.m_pRels->WriteSlides(nCountSlides); m_oReader.m_pRels->WriteSlides(nCountSlides);
m_oReader.m_pRels->EndPresentationRels(m_oPresentation.commentAuthors.is_init());
m_oPresentation.notesMasterIdLst.clear(); m_oPresentation.notesMasterIdLst.clear();
if (bNotesMasterPresent)
{
m_oPresentation.notesMasterIdLst.push_back(PPTX::Logic::XmlId()); m_oPresentation.notesMasterIdLst.push_back(PPTX::Logic::XmlId());
m_oPresentation.notesMasterIdLst[0].m_name = _T("notesMasterId"); m_oPresentation.notesMasterIdLst[0].m_name = _T("notesMasterId");
m_oPresentation.notesMasterIdLst[0].rid = (size_t)nCurrentRels; m_oPresentation.notesMasterIdLst[0].rid = (size_t)nCurrentRels;
++nCurrentRels;
}
m_oReader.m_pRels->EndPresentationRels(m_oPresentation.commentAuthors.is_init(), bNotesMasterPresent);
m_oReader.m_pRels->CloseRels(); m_oReader.m_pRels->CloseRels();
oXmlWriter.ClearNoAttack(); oXmlWriter.ClearNoAttack();
......
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