Commit 7896b750 authored by ElenaSubbotina's avatar ElenaSubbotina

PptFormatReader - presentation master notes & master handout

parent 7d188b22
...@@ -72,6 +72,7 @@ namespace NSPresentationEditor ...@@ -72,6 +72,7 @@ namespace NSPresentationEditor
void WritePresInfo (); void WritePresInfo ();
void WriteAll (); void WriteAll ();
void WriteThemes (); void WriteThemes ();
void WriteTheme (CTheme* pTheme, int & nIndexTheme, int & nStartLayout, int Type = 1);
void WriteSlides (); void WriteSlides ();
void WriteNotes (); void WriteNotes ();
void WriteLayout (CLayout& oLayout, int nIndexLayout, int nStartLayout, int nIndexTheme); void WriteLayout (CLayout& oLayout, int nIndexLayout, int nStartLayout, int nIndexTheme);
......
...@@ -170,12 +170,11 @@ namespace NSPresentationEditor ...@@ -170,12 +170,11 @@ namespace NSPresentationEditor
m_oWriter.WriteString(str1); m_oWriter.WriteString(str1);
int nCurrent = nStartLayoutIndex;
for (int i = 0; i < nCountLayouts; ++i) for (int i = 0; i < nCountLayouts; ++i)
{ {
std::wstring str = L"<Relationship Id=\"rId" + std::to_wstring(m_lNextRelsID++) + L"\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideLayout\" Target=\"../slideLayouts/slideLayout" std::wstring str = L"<Relationship Id=\"rId" + std::to_wstring(m_lNextRelsID++) + L"\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideLayout\" Target=\"../slideLayouts/slideLayout"
+ std::to_wstring(nCurrent + 1) + L".xml\"/>"; + std::to_wstring(nStartLayoutIndex + 1) + L".xml\"/>";
++nCurrent; nStartLayoutIndex++;
m_oWriter.WriteString(str); m_oWriter.WriteString(str);
} }
...@@ -196,15 +195,19 @@ namespace NSPresentationEditor ...@@ -196,15 +195,19 @@ namespace NSPresentationEditor
m_oWriter.WriteString(str); m_oWriter.WriteString(str);
} }
inline void StartNotes(int nIndexSlide) inline void StartNotes(int nIndexSlide, bool bMaster)
{ {
m_oWriter.WriteString(L"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\" ?>\ m_oWriter.WriteString(L"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\" ?>\
<Relationships xmlns=\"http://schemas.openxmlformats.org/package/2006/relationships\">"); <Relationships xmlns=\"http://schemas.openxmlformats.org/package/2006/relationships\">");
if (bMaster)
{
m_oWriter.WriteString(L"<Relationship Id=\"rId" + std::to_wstring(m_lNextRelsID++) +
L"\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/notesMaster\" Target=\"../notesMasters/notesMaster1.xml\"/>");
}
if (nIndexSlide >= 0) if (nIndexSlide >= 0)
{ {
m_oWriter.WriteString(L"<Relationship Id=\"rId" + std::to_wstring(m_lNextRelsID++) + m_oWriter.WriteString(L"<Relationship Id=\"rId" + std::to_wstring(m_lNextRelsID++) +
L"\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/notesSlide\" Target=\"../slides/slide" L"\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/slide\" Target=\"../slides/slide"
+ std::to_wstring(nIndexSlide + 1) + L".xml\"/>"); + std::to_wstring(nIndexSlide + 1) + L".xml\"/>");
} }
} }
......
...@@ -51,6 +51,9 @@ public: ...@@ -51,6 +51,9 @@ public:
std::map<DWORD, CRecordSlide*> m_mapMasters; std::map<DWORD, CRecordSlide*> m_mapMasters;
std::map<DWORD, CRecordSlide*> m_mapNotes; std::map<DWORD, CRecordSlide*> m_mapNotes;
std::map<DWORD, CRecordSlide*> m_mapNotesMasters;
std::map<DWORD, CRecordSlide*> m_mapHandoutMasters;
std::vector<DWORD> m_arrSlidesOrder; std::vector<DWORD> m_arrSlidesOrder;
std::vector<DWORD> m_arrMastersOrder; std::vector<DWORD> m_arrMastersOrder;
std::vector<DWORD> m_arrNotesOrder; std::vector<DWORD> m_arrNotesOrder;
...@@ -66,6 +69,9 @@ public: ...@@ -66,6 +69,9 @@ public:
std::vector<CSlideInfo> m_arMasterWrapper; std::vector<CSlideInfo> m_arMasterWrapper;
std::vector<CSlideInfo> m_arNotesWrapper; std::vector<CSlideInfo> m_arNotesWrapper;
CSlideInfo* m_pNotesMasterWrapper;
CSlideInfo* m_pHandoutMasterWrapper;
// эти параметры - одни на весь документ. // эти параметры - одни на весь документ.
// чтобы поддержать нашу схему (пптх) - копируем их в темы // чтобы поддержать нашу схему (пптх) - копируем их в темы
std::vector<CRecordBlipStoreContainer*> m_arrBlipStore; std::vector<CRecordBlipStoreContainer*> m_arrBlipStore;
...@@ -125,9 +131,13 @@ public: ...@@ -125,9 +131,13 @@ public:
void LoadNoMainMaster (DWORD dwMasterID, const LONG& lOriginWidth, const LONG& lOriginHeight); void LoadNoMainMaster (DWORD dwMasterID, const LONG& lOriginWidth, const LONG& lOriginHeight);
void LoadMainMaster (DWORD dwMasterID, const LONG& lOriginWidth, const LONG& lOriginHeight); void LoadMainMaster (DWORD dwMasterID, const LONG& lOriginWidth, const LONG& lOriginHeight);
void CPPTUserInfo::LoadMaster(CRecordSlide* pMaster, CSlideInfo *& pMasterWrapper, CTheme *& pTheme);
void LoadSlideFromPrevUsers (DWORD dwSlideID); void LoadSlideFromPrevUsers (DWORD dwSlideID);
void LoadMasterFromPrevUsers(DWORD dwSlideID); void LoadMasterFromPrevUsers (DWORD dwSlideID);
void LoadNoteFromPrevUsers (DWORD dwSlideID); void LoadNotesFromPrevUsers (DWORD dwSlideID);
void LoadNotesMasterFromPrevUsers (DWORD dwSlideID);
void LoadHandoutMasterFromPrevUsers (DWORD dwSlideID);
void LoadExternal(CRecordExObjListContainer* pExObjects); void LoadExternal(CRecordExObjListContainer* pExObjects);
......
...@@ -85,7 +85,6 @@ public: ...@@ -85,7 +85,6 @@ public:
std::map<int, std::wstring>* m_mapFilePictures; std::map<int, std::wstring>* m_mapFilePictures;
nullable_base<NSPresentationEditor::CTextStyles> m_pStyles[9]; nullable_base<NSPresentationEditor::CTextStyles> m_pStyles[9];
public:
CSlideInfo() CSlideInfo()
{ {
} }
......
...@@ -50,84 +50,6 @@ public: ...@@ -50,84 +50,6 @@ public:
m_arSlidePersists.clear(); m_arSlidePersists.clear();
} }
/*virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream)
{
m_oHeader = oHeader;
m_arMasterPersists.clear();
m_arNotePersists.clear();
m_arSlidePersists.clear();
m_arRecords.clear();
UINT lCurLen = 0;
ULONG lReadLen = 0;
SRecordHeader oRec;
while (lCurLen < m_oHeader.RecLen)
{
pStream->Read(&oRec, sizeof(oRec), &lReadLen);
if (0 >= lReadLen)
{
break;
}
if (RECORD_TYPE_SLIDELISTWITHTEXT == oRec.RecType)
{
CRecordSlideListWithText* pAtom = new CRecordSlideListWithText();
pAtom->ReadFromStream(oRec, pStream);
std::vector<SSlidePersist>* pArray = NULL;
switch (pAtom->m_Type)
{
case CRecordSlideListWithText::CollectionOfMasterSlides:
{
pArray = &m_arMasterPersists;
break;
}
case CRecordSlideListWithText::CollectionOfNotesSlides:
{
pArray = &m_arNotePersists;
break;
}
case CRecordSlideListWithText::CollectionOfSlides:
{
pArray = &m_arSlidePersists;
break;
}
default:
{
// этого не может быть...
lCurLen += (8 + oRec.RecLen);
continue;
}
};
size_t nCountItems = pAtom->m_arSlides.size();
for (size_t index = 0; index < nCountItems; ++index)
{
SSlidePersist oPersist;
oPersist.m_nPsrRef = pAtom->m_arSlides[index]->m_nPsrRef;
oPersist.m_nSlideID = pAtom->m_arSlides[index]->m_nSlideID;
oPersist.m_arTextAttrs += pAtom->m_arTextPlaceHolders[index];
pArray->Add(oPersist);
}
delete pAtom;
}
else
{
IRecord* pRecord = CreateByType(oRec);
pRecord->ReadFromStream(oRec, pStream);
m_arRecords.Add(pRecord);
}
lCurLen += (8 + oRec.RecLen);
}
}*/
virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream) virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream)
{ {
m_oHeader = oHeader; m_oHeader = oHeader;
......
...@@ -462,10 +462,6 @@ ...@@ -462,10 +462,6 @@
RelativePath="..\Reader\ClassesAtom.h" RelativePath="..\Reader\ClassesAtom.h"
> >
</File> </File>
<File
RelativePath="..\..\..\ASCPresentationEditor\OfficeDrawing\Document.h"
>
</File>
<File <File
RelativePath="..\Reader\PPTDocumentInfo.h" RelativePath="..\Reader\PPTDocumentInfo.h"
> >
......
...@@ -43,58 +43,35 @@ namespace NSPresentationEditor ...@@ -43,58 +43,35 @@ namespace NSPresentationEditor
std::vector<CSlide*> m_arSlides; std::vector<CSlide*> m_arSlides;
std::vector<CSlide*> m_arNotes; std::vector<CSlide*> m_arNotes;
CTheme* m_pNotesMaster;
CTheme* m_pHandoutMaster;
CMetricInfo m_oInfo; CMetricInfo m_oInfo;
CDocument() : m_arThemes(), m_arSlides() CDocument() : m_arThemes(), m_arSlides()
{ {
m_pHandoutMaster = NULL;
m_pNotesMaster = NULL;
} }
~CDocument() ~CDocument()
{ {
} Clear();
CDocument& operator=(const CDocument& oSrc)
{
m_arThemes = oSrc.m_arThemes;
m_arSlides = oSrc.m_arSlides;
m_arNotes = oSrc.m_arNotes;
m_oInfo = oSrc.m_oInfo;
return *this;
}
CDocument(const CDocument& oSrc)
{
*this = oSrc;
} }
inline void Clear() inline void Clear()
{ {
ClearThemes(); m_arThemes.clear();
try try
{ {
ClearSlides(); ClearSlides();
ClearNotes(); ClearNotes();
}catch(...)
{
}
}
inline void ClearThemes() RELEASEOBJECT(m_pHandoutMaster);
{ RELEASEOBJECT(m_pNotesMaster);
m_arThemes.clear(); }catch(...)
}
inline void AddTheme(const CTheme& oTheme)
{ {
m_arThemes.push_back(oTheme);
} }
inline void UpdateTheme(size_t nIndex, const CTheme& oTheme)
{
if (nIndex >= m_arThemes.size())
return;
m_arThemes[nIndex] = oTheme;
} }
inline void ClearSlides() inline void ClearSlides()
{ {
......
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