Commit 7896b750 authored by ElenaSubbotina's avatar ElenaSubbotina

PptFormatReader - presentation master notes & master handout

parent 7d188b22
......@@ -72,6 +72,7 @@ namespace NSPresentationEditor
void WritePresInfo ();
void WriteAll ();
void WriteThemes ();
void WriteTheme (CTheme* pTheme, int & nIndexTheme, int & nStartLayout, int Type = 1);
void WriteSlides ();
void WriteNotes ();
void WriteLayout (CLayout& oLayout, int nIndexLayout, int nStartLayout, int nIndexTheme);
......
......@@ -170,12 +170,11 @@ namespace NSPresentationEditor
m_oWriter.WriteString(str1);
int nCurrent = nStartLayoutIndex;
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::to_wstring(nCurrent + 1) + L".xml\"/>";
++nCurrent;
+ std::to_wstring(nStartLayoutIndex + 1) + L".xml\"/>";
nStartLayoutIndex++;
m_oWriter.WriteString(str);
}
......@@ -196,16 +195,20 @@ namespace NSPresentationEditor
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\" ?>\
<Relationships xmlns=\"http://schemas.openxmlformats.org/package/2006/relationships\">");
m_oWriter.WriteString(L"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\" ?>\
<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)
{
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"
+ std::to_wstring(nIndexSlide + 1) + L".xml\"/>");
L"\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/slide\" Target=\"../slides/slide"
+ std::to_wstring(nIndexSlide + 1) + L".xml\"/>");
}
}
inline void StartSlide(int nIndexLayout, int nIndexNotes)
......
......@@ -51,6 +51,9 @@ public:
std::map<DWORD, CRecordSlide*> m_mapMasters;
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_arrMastersOrder;
std::vector<DWORD> m_arrNotesOrder;
......@@ -66,6 +69,9 @@ public:
std::vector<CSlideInfo> m_arMasterWrapper;
std::vector<CSlideInfo> m_arNotesWrapper;
CSlideInfo* m_pNotesMasterWrapper;
CSlideInfo* m_pHandoutMasterWrapper;
// эти параметры - одни на весь документ.
// чтобы поддержать нашу схему (пптх) - копируем их в темы
std::vector<CRecordBlipStoreContainer*> m_arrBlipStore;
......@@ -124,10 +130,14 @@ public:
void LoadNoMainMaster (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 LoadMasterFromPrevUsers(DWORD dwSlideID);
void LoadNoteFromPrevUsers (DWORD dwSlideID);
void LoadSlideFromPrevUsers (DWORD dwSlideID);
void LoadMasterFromPrevUsers (DWORD dwSlideID);
void LoadNotesFromPrevUsers (DWORD dwSlideID);
void LoadNotesMasterFromPrevUsers (DWORD dwSlideID);
void LoadHandoutMasterFromPrevUsers (DWORD dwSlideID);
void LoadExternal(CRecordExObjListContainer* pExObjects);
......
......@@ -85,7 +85,6 @@ public:
std::map<int, std::wstring>* m_mapFilePictures;
nullable_base<NSPresentationEditor::CTextStyles> m_pStyles[9];
public:
CSlideInfo()
{
}
......
......@@ -50,84 +50,6 @@ public:
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)
{
m_oHeader = oHeader;
......
......@@ -462,10 +462,6 @@
RelativePath="..\Reader\ClassesAtom.h"
>
</File>
<File
RelativePath="..\..\..\ASCPresentationEditor\OfficeDrawing\Document.h"
>
</File>
<File
RelativePath="..\Reader\PPTDocumentInfo.h"
>
......
......@@ -43,59 +43,36 @@ namespace NSPresentationEditor
std::vector<CSlide*> m_arSlides;
std::vector<CSlide*> m_arNotes;
CTheme* m_pNotesMaster;
CTheme* m_pHandoutMaster;
CMetricInfo m_oInfo;
CDocument() : m_arThemes(), m_arSlides()
{
m_pHandoutMaster = NULL;
m_pNotesMaster = NULL;
}
~CDocument()
{
}
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;
Clear();
}
inline void Clear()
{
ClearThemes();
m_arThemes.clear();
try
{
ClearSlides();
ClearNotes();
RELEASEOBJECT(m_pHandoutMaster);
RELEASEOBJECT(m_pNotesMaster);
}catch(...)
{
}
}
inline void ClearThemes()
{
m_arThemes.clear();
}
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()
{
for (size_t i = 0 ; i < m_arSlides.size(); i++)
......
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