Commit 7929d798 authored by Sergey Konovalov's avatar Sergey Konovalov

open presentation notes

parent 4c3d8ca0
...@@ -80,7 +80,9 @@ namespace NSBinPptxRW ...@@ -80,7 +80,9 @@ namespace NSBinPptxRW
ImageMap = 42, ImageMap = 42,
FontMap = 43, FontMap = 43,
FontsEmbedded = 44 FontsEmbedded = 44,
SlideNotesRels = 45,
NotesRels = 46
}; };
} }
} }
......
...@@ -152,6 +152,8 @@ namespace NSBinPptxRW ...@@ -152,6 +152,8 @@ namespace NSBinPptxRW
std::vector<_masterSlideInfo> m_oRels; std::vector<_masterSlideInfo> m_oRels;
std::vector<LONG> m_oSlide_Layout_Rels; std::vector<LONG> m_oSlide_Layout_Rels;
std::vector<LONG> m_oSlide_Notes_Rels;
std::vector<LONG> m_oNote_Rels;
NSShapeImageGen::CImageManager* m_pImageManager; NSShapeImageGen::CImageManager* m_pImageManager;
......
...@@ -194,7 +194,7 @@ namespace PPTX2EditorAdvanced ...@@ -194,7 +194,7 @@ namespace PPTX2EditorAdvanced
// проверяем note // проверяем note
size_t pPointerN = (size_t)(slide->Note.operator ->()); size_t pPointerN = (size_t)(slide->Note.operator ->());
LONG nNoteIndex = -1;
if (NULL != pPointerN) if (NULL != pPointerN)
{ {
std::map<size_t, LONG>::const_iterator pSearchN = pCommon->notes.find(pPointerN); std::map<size_t, LONG>::const_iterator pSearchN = pCommon->notes.find(pPointerN);
...@@ -203,8 +203,27 @@ namespace PPTX2EditorAdvanced ...@@ -203,8 +203,27 @@ namespace PPTX2EditorAdvanced
LONG lCountN = (LONG)_notes.size(); LONG lCountN = (LONG)_notes.size();
pCommon->notes [pPointerN] = lCountN; pCommon->notes [pPointerN] = lCountN;
_notes.push_back(slide->Note); _notes.push_back(slide->Note);
nNoteIndex = lCountN;
}
}
oBinaryWriter.m_pCommon->m_oSlide_Notes_Rels.push_back(nNoteIndex);
}
for (size_t i = 0; i < _notes.size(); ++i)
{
smart_ptr<PPTX::NotesSlide> note = _notes[i];
LONG nMasterIndex = -1;
smart_ptr<PPTX::NotesMaster> noteMaster = note->Get(OOX::Presentation::FileTypes::NotesMaster).smart_dynamic_cast<PPTX::NotesMaster>();
if(noteMaster.is_init())
{
size_t pPointerL = (size_t)(noteMaster.operator ->());
std::map<size_t, LONG>::const_iterator pSearchL = pCommon->notesMasters.find(pPointerL);
if (pSearchL != pCommon->notesMasters.end())
{
nMasterIndex = pSearchL->second;
} }
} }
oBinaryWriter.m_pCommon->m_oNote_Rels.push_back(nMasterIndex);
} }
// нужно записать все в maintables. А кроме главных таблиц ничего и нету. Все остальное лежит в них // нужно записать все в maintables. А кроме главных таблиц ничего и нету. Все остальное лежит в них
...@@ -328,27 +347,22 @@ namespace PPTX2EditorAdvanced ...@@ -328,27 +347,22 @@ namespace PPTX2EditorAdvanced
_slides[i]->toPPTY(&oBinaryWriter); _slides[i]->toPPTY(&oBinaryWriter);
} }
if (false)
{
// ПОКА нету NOTES
// notes // notes
oBinaryWriter.StartMainRecord(NSMainTables::NotesSlides); oBinaryWriter.StartMainRecord(NSMainTables::NotesSlides);
ULONG nCountN = (ULONG)_notes.size(); ULONG nCountN = (ULONG)_notes.size();
oBinaryWriter.WriteULONG(nCountN); oBinaryWriter.WriteULONG(nCountN);
for (ULONG i = 0; i < nCountN; ++i) for (ULONG i = 0; i < nCountN; ++i)
{ {
_notes[i]->toPPTY(&oBinaryWriter); _notes[i]->toPPTY(&oBinaryWriter);
} }
// notesmasters // notesmasters
oBinaryWriter.StartMainRecord(NSMainTables::NotesMasters); oBinaryWriter.StartMainRecord(NSMainTables::NotesMasters);
ULONG nCountNM = (ULONG)_notesMasters.size(); ULONG nCountNM = (ULONG)_notesMasters.size();
oBinaryWriter.WriteULONG(nCountNM); oBinaryWriter.WriteULONG(nCountNM);
for (ULONG i = 0; i < nCountNM; ++i) for (ULONG i = 0; i < nCountNM; ++i)
{ {
_notesMasters[i]->toPPTY(&oBinaryWriter); _notesMasters[i]->toPPTY(&oBinaryWriter);
}
} }
// ImageMap --------------------------------------- // ImageMap ---------------------------------------
...@@ -405,7 +419,21 @@ namespace PPTX2EditorAdvanced ...@@ -405,7 +419,21 @@ namespace PPTX2EditorAdvanced
oBinaryWriter.WriteBYTE(NSBinPptxRW::g_nodeAttributeEnd); oBinaryWriter.WriteBYTE(NSBinPptxRW::g_nodeAttributeEnd);
oBinaryWriter.EndRecord(); oBinaryWriter.EndRecord();
// ------------------------------------------------
// SlideNotesRels --------------------------------------
oBinaryWriter.StartMainRecord(NSMainTables::SlideNotesRels);
oBinaryWriter.StartRecord(NSMainTables::SlideNotesRels);
oBinaryWriter.WriteBYTE(NSBinPptxRW::g_nodeAttributeStart);
_s_rels = oBinaryWriter.m_pCommon->m_oSlide_Notes_Rels.size();
for (size_t i = 0; i < _s_rels; ++i)
{
oBinaryWriter.WriteInt1(0, oBinaryWriter.m_pCommon->m_oSlide_Notes_Rels[i]);
}
oBinaryWriter.WriteBYTE(NSBinPptxRW::g_nodeAttributeEnd);
oBinaryWriter.EndRecord();
// ------------------------------------------------ // ------------------------------------------------
// ThemeRels -------------------------------------- // ThemeRels --------------------------------------
...@@ -445,7 +473,24 @@ namespace PPTX2EditorAdvanced ...@@ -445,7 +473,24 @@ namespace PPTX2EditorAdvanced
oBinaryWriter.EndRecord(); oBinaryWriter.EndRecord();
} }
// ------------------------------------------------
// NoteRels --------------------------------------
oBinaryWriter.StartMainRecord(NSMainTables::NotesRels);
oBinaryWriter.StartRecord(NSMainTables::NotesRels);
oBinaryWriter.WriteBYTE(NSBinPptxRW::g_nodeAttributeStart);
_s_rels = oBinaryWriter.m_pCommon->m_oNote_Rels.size();
for (size_t i = 0; i < _s_rels; ++i)
{
oBinaryWriter.WriteInt1(0, oBinaryWriter.m_pCommon->m_oNote_Rels[i]);
}
oBinaryWriter.WriteBYTE(NSBinPptxRW::g_nodeAttributeEnd);
oBinaryWriter.EndRecord();
// ------------------------------------------------
oBinaryWriter.EndRecord(); oBinaryWriter.EndRecord();
} }
......
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