Commit 63fd3bbc authored by Elen.Subbotina's avatar Elen.Subbotina Committed by Alexander Trofimov

PPTformat

git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@65644 954022d7-b5bf-4e40-9824-e11837661b57
parent 6affb86a
...@@ -257,6 +257,8 @@ public: ...@@ -257,6 +257,8 @@ public:
int AddNewLayout(NSPresentationEditor::CTheme* pTheme, SSlideLayoutAtom* layoutRecord, std::vector<CTextFullSettings> & text, int AddNewLayout(NSPresentationEditor::CTheme* pTheme, SSlideLayoutAtom* layoutRecord, std::vector<CTextFullSettings> & text,
CRecordHeadersFootersAtom* headers_footers, bool addShapes, bool bMasterObjects); CRecordHeadersFootersAtom* headers_footers, bool addShapes, bool bMasterObjects);
IElement* AddNewLayoutElement (CLayout *pLayout, int placeholderType, int placeholderSizePreset = -1); IElement* AddNewLayoutPlaceholder (CLayout *pLayout, int placeholderType, int placeholderSizePreset = -1);
IElement* AddThemeLayoutElement (CLayout *pLayout, int placeholderType, NSPresentationEditor::CTheme* pTheme); IElement* AddThemeLayoutPlaceholder (CLayout *pLayout, int placeholderType, CTheme* pTheme);
IElement* AddNewThemePlaceholder (CTheme* pTheme, int placeholderType, int placeholderSizePreset = -1);
}; };
...@@ -371,6 +371,8 @@ void CTextPFRun_ppt::LoadFromStream(POLE::Stream* pStream, bool bIsIndentation) ...@@ -371,6 +371,8 @@ void CTextPFRun_ppt::LoadFromStream(POLE::Stream* pStream, bool bIsIndentation)
WORD tabStopsCount = StreamUtils::ReadWORD(pStream); WORD tabStopsCount = StreamUtils::ReadWORD(pStream);
m_oRun.tabStops.clear(); m_oRun.tabStops.clear();
tabStopsCount = tabStopsCount & 0x000f;
for (int i = 0; i < (int)tabStopsCount; ++i) for (int i = 0; i < (int)tabStopsCount; ++i)
{ {
WORD tabPos = StreamUtils::ReadWORD(pStream); WORD tabPos = StreamUtils::ReadWORD(pStream);
......
...@@ -45,6 +45,8 @@ public: ...@@ -45,6 +45,8 @@ public:
while (lMemCount < m_lCount + 1) while (lMemCount < m_lCount + 1)
{ {
if (pStream->tell() >= m_lOffsetInStream + m_oHeader.RecLen) break;
CTextPFRun_ppt elm; CTextPFRun_ppt elm;
m_arrPFs.push_back(elm); m_arrPFs.push_back(elm);
m_arrPFs[lCountItems].LoadFromStream(pStream); m_arrPFs[lCountItems].LoadFromStream(pStream);
...@@ -57,6 +59,8 @@ public: ...@@ -57,6 +59,8 @@ public:
lCountItems = 0; lCountItems = 0;
while (lMemCount < m_lCount + 1) while (lMemCount < m_lCount + 1)
{ {
if (pStream->tell() >= m_lOffsetInStream + m_oHeader.RecLen) break;
CTextCFRun_ppt elm; CTextCFRun_ppt elm;
m_arrCFs.push_back(elm); m_arrCFs.push_back(elm);
......
...@@ -9,7 +9,7 @@ namespace NSPresentationEditor ...@@ -9,7 +9,7 @@ namespace NSPresentationEditor
std::vector<IElement*> m_arElements; std::vector<IElement*> m_arElements;
std::vector<CColor> m_arColorScheme; std::vector<CColor> m_arColorScheme;
std::map<int,int> m_pPlaceholders; std::map<int,int> m_mapPlaceholders;
bool m_bUseThemeColorScheme; bool m_bUseThemeColorScheme;
...@@ -45,7 +45,7 @@ namespace NSPresentationEditor ...@@ -45,7 +45,7 @@ namespace NSPresentationEditor
{ {
Clear(); Clear();
m_arElements.insert(m_arElements.end(), oSrc.m_arElements.begin(), oSrc.m_arElements.end()); m_arElements = oSrc.m_arElements;
size_t nCount = m_arElements.size(); size_t nCount = m_arElements.size();
for (size_t nIndex = 0; nIndex < nCount; ++nIndex) for (size_t nIndex = 0; nIndex < nCount; ++nIndex)
...@@ -53,6 +53,7 @@ namespace NSPresentationEditor ...@@ -53,6 +53,7 @@ namespace NSPresentationEditor
ADDREFINTERFACE((m_arElements[nIndex])); ADDREFINTERFACE((m_arElements[nIndex]));
} }
m_mapPlaceholders = oSrc.m_mapPlaceholders;
m_arColorScheme = oSrc.m_arColorScheme; m_arColorScheme = oSrc.m_arColorScheme;
m_bUseThemeColorScheme = oSrc.m_bUseThemeColorScheme; m_bUseThemeColorScheme = oSrc.m_bUseThemeColorScheme;
...@@ -69,6 +70,8 @@ namespace NSPresentationEditor ...@@ -69,6 +70,8 @@ namespace NSPresentationEditor
m_bShowMasterShapes = oSrc.m_bShowMasterShapes; m_bShowMasterShapes = oSrc.m_bShowMasterShapes;
m_strLayoutType = oSrc.m_strLayoutType; m_strLayoutType = oSrc.m_strLayoutType;
m_sName = oSrc.m_sName;
return *this; return *this;
} }
...@@ -91,6 +94,7 @@ namespace NSPresentationEditor ...@@ -91,6 +94,7 @@ namespace NSPresentationEditor
} }
m_arElements.clear(); m_arElements.clear();
m_mapPlaceholders.clear();
m_bUseThemeColorScheme = true; m_bUseThemeColorScheme = true;
m_bShowMasterShapes = true; m_bShowMasterShapes = true;
......
...@@ -34,7 +34,7 @@ namespace NSPresentationEditor ...@@ -34,7 +34,7 @@ namespace NSPresentationEditor
CMetricInfo m_oInfo; CMetricInfo m_oInfo;
CString m_strComment; std::wstring m_strComment;
std::wstring m_sName; std::wstring m_sName;
public: public:
CSlide() : m_arElements(), m_oSlideShow() CSlide() : m_arElements(), m_oSlideShow()
...@@ -70,7 +70,8 @@ namespace NSPresentationEditor ...@@ -70,7 +70,8 @@ namespace NSPresentationEditor
m_dDuration = 30000.0; m_dDuration = 30000.0;
m_bShowMasterShapes = true; m_bShowMasterShapes = true;
m_strComment = _T(""); m_strComment.clear();
m_sName.clear();
} }
...@@ -143,6 +144,7 @@ namespace NSPresentationEditor ...@@ -143,6 +144,7 @@ namespace NSPresentationEditor
m_bShowMasterShapes = oSrc.m_bShowMasterShapes; m_bShowMasterShapes = oSrc.m_bShowMasterShapes;
m_strComment = oSrc.m_strComment; m_strComment = oSrc.m_strComment;
m_sName = oSrc.m_sName;
} }
public: public:
...@@ -213,23 +215,9 @@ namespace NSPresentationEditor ...@@ -213,23 +215,9 @@ namespace NSPresentationEditor
return; return;
} }
//m_arElements[nIndexElement] = pLayoutElem->CreateDublicate();
//m_arElements[nIndexElement]->m_oProperties = pElement->m_oProperties;
m_arElements[nIndexElement]->SetupProperties(this, pTheme, pLayout); m_arElements[nIndexElement]->SetupProperties(this, pTheme, pLayout);
} }
virtual CString SerializeToXml()
{
CString strSlide = _T("");
strSlide.Format(_T("<Slide tid='%d' lid='%d'>"), m_lThemeID, m_lLayoutID);
for (size_t i = 0; i < m_arElements.size(); ++i)
{
strSlide += m_arElements[i]->SerializeToXml();
}
strSlide += _T("</Slide>");
return strSlide;
}
void SetMetricInfo(const CMetricInfo& oInfo) void SetMetricInfo(const CMetricInfo& oInfo)
{ {
m_oInfo = oInfo; m_oInfo = oInfo;
......
...@@ -13,6 +13,8 @@ namespace NSPresentationEditor ...@@ -13,6 +13,8 @@ namespace NSPresentationEditor
std::map<_UINT64, LONG> m_mapGeomToLayout;// std::map<_UINT64, LONG> m_mapGeomToLayout;//
std::map<DWORD, LONG> m_mapTitleLayout; // std::map<DWORD, LONG> m_mapTitleLayout; //
std::map<int,int> m_mapPlaceholders;
std::vector<CColor> m_arColorScheme; std::vector<CColor> m_arColorScheme;
std::vector<CFont> m_arFonts; std::vector<CFont> m_arFonts;
std::vector<CBrush> m_arBrushes; std::vector<CBrush> m_arBrushes;
...@@ -27,7 +29,6 @@ namespace NSPresentationEditor ...@@ -27,7 +29,6 @@ namespace NSPresentationEditor
std::vector<IElement*> m_arElements; std::vector<IElement*> m_arElements;
std::map<int,int> m_pPlaceholders;
CMetricInfo m_oInfo; CMetricInfo m_oInfo;
std::wstring m_sThemeName; std::wstring m_sThemeName;
...@@ -91,6 +92,7 @@ namespace NSPresentationEditor ...@@ -91,6 +92,7 @@ namespace NSPresentationEditor
m_arLayouts = oSrc.m_arLayouts; m_arLayouts = oSrc.m_arLayouts;
m_mapTitleLayout = oSrc.m_mapTitleLayout; m_mapTitleLayout = oSrc.m_mapTitleLayout;
m_mapGeomToLayout = oSrc.m_mapGeomToLayout; m_mapGeomToLayout = oSrc.m_mapGeomToLayout;
m_mapPlaceholders = oSrc.m_mapPlaceholders;
m_bIsBackground = oSrc.m_bIsBackground; m_bIsBackground = oSrc.m_bIsBackground;
m_oBackground = oSrc.m_oBackground; m_oBackground = oSrc.m_oBackground;
...@@ -143,6 +145,10 @@ namespace NSPresentationEditor ...@@ -143,6 +145,10 @@ namespace NSPresentationEditor
} }
m_arElements.clear(); m_arElements.clear();
m_arLayouts.clear();
m_mapTitleLayout.clear();
m_mapGeomToLayout.clear();
m_mapPlaceholders.clear();
m_lOriginalWidth = m_lOriginalHeight = 0; m_lOriginalWidth = m_lOriginalHeight = 0;
......
...@@ -189,7 +189,7 @@ namespace NSPresentationEditor ...@@ -189,7 +189,7 @@ namespace NSPresentationEditor
str.Format(_T("<Relationship Id=\"rId%d\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/notesSlide\" Target=\"../notesSlides/notesSlide%d.xml\"/>"), m_lNextRelsID++, nIndexSlide + 1); str.Format(_T("<Relationship Id=\"rId%d\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/notesSlide\" Target=\"../notesSlides/notesSlide%d.xml\"/>"), m_lNextRelsID++, nIndexSlide + 1);
m_oWriter.WriteString(str); m_oWriter.WriteString(str);
} }
static AVSINLINE void StartNotes(int nIndexSlide, CString strDirectory, CString strComment) static AVSINLINE void StartNotes(int nIndexSlide, CString strDirectory, std::wstring strComment)
{ {
CString sNum = _T(""); CString sNum = _T("");
sNum.Format(_T("%d"), nIndexSlide + 1); sNum.Format(_T("%d"), nIndexSlide + 1);
......
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