Commit 92cda5bc authored by ElenaSubbotina's avatar ElenaSubbotina

fix bug #35146

parent 1a377d87
......@@ -1209,10 +1209,14 @@ namespace NSBinPptxRW
m_pWriter->WriteString(strRels);
}
void CRelsGenerator::EndPresentationRels(const bool& bIsCommentsAuthors = false)
void CRelsGenerator::EndPresentationRels(const bool& bIsCommentsAuthors = false, const bool& bIsNotesMaster = false)
{
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\"/>";
if (bIsNotesMaster)
{
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\"/>";
m_pWriter->WriteString(strRels0);
}
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\" />";
std::wstring strRels2 = L"<Relationship Id=\"rId" + std::to_wstring(m_lNextRelsID++) +
......@@ -1220,7 +1224,6 @@ namespace NSBinPptxRW
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\" />";
m_pWriter->WriteString(strRels0);
m_pWriter->WriteString(strRels1);
m_pWriter->WriteString(strRels2);
m_pWriter->WriteString(strRels3);
......
......@@ -419,7 +419,7 @@ namespace NSBinPptxRW
int WriteRels (const std::wstring& bsType, const std::wstring& bsTarget, const std::wstring& bsTargetMode);
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 ();
void CloseRels ();
......
......@@ -180,10 +180,11 @@ namespace NSBinPptxRW
CXmlWriter oXmlWriter;
// первым делом определим количество необходимого. если хоть одно из этих чисел - ноль, то ппту не корректный
LONG nCountThemes = 0;
LONG nCountMasters = 0;
LONG nCountLayouts = 0;
LONG nCountSlides = 0;
LONG nCountThemes = 0;
LONG nCountMasters = 0;
LONG nCountLayouts = 0;
LONG nCountSlides = 0;
bool bNotesMasterPresent = false;
pPair = m_mainTables.find(NSMainTables::Themes);
if (m_mainTables.end() != pPair)
......@@ -544,6 +545,7 @@ namespace NSBinPptxRW
m_oReader.m_pRels->Clear();
m_oReader.m_pRels->StartNotesMaster(m_arSlideMasters_Theme.size());
bNotesMasterPresent = true;
if (lCount > 0)
{
m_arNotesMasters.back().fromPPTY(&m_oReader);
......@@ -782,13 +784,16 @@ namespace NSBinPptxRW
}
m_oReader.m_pRels->WriteSlides(nCountSlides);
m_oReader.m_pRels->EndPresentationRels(m_oPresentation.commentAuthors.is_init());
m_oPresentation.notesMasterIdLst.clear();
m_oPresentation.notesMasterIdLst.push_back(PPTX::Logic::XmlId());
m_oPresentation.notesMasterIdLst[0].m_name = _T("notesMasterId");
m_oPresentation.notesMasterIdLst[0].rid = (size_t)nCurrentRels;
if (bNotesMasterPresent)
{
m_oPresentation.notesMasterIdLst.push_back(PPTX::Logic::XmlId());
m_oPresentation.notesMasterIdLst[0].m_name = _T("notesMasterId");
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();
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