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:
int AddNewLayout(NSPresentationEditor::CTheme* pTheme, SSlideLayoutAtom* layoutRecord, std::vector<CTextFullSettings> & text,
CRecordHeadersFootersAtom* headers_footers, bool addShapes, bool bMasterObjects);
IElement* AddNewLayoutElement (CLayout *pLayout, int placeholderType, int placeholderSizePreset = -1);
IElement* AddThemeLayoutElement (CLayout *pLayout, int placeholderType, NSPresentationEditor::CTheme* pTheme);
IElement* AddNewLayoutPlaceholder (CLayout *pLayout, int placeholderType, int placeholderSizePreset = -1);
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)
WORD tabStopsCount = StreamUtils::ReadWORD(pStream);
m_oRun.tabStops.clear();
tabStopsCount = tabStopsCount & 0x000f;
for (int i = 0; i < (int)tabStopsCount; ++i)
{
WORD tabPos = StreamUtils::ReadWORD(pStream);
......
......@@ -45,6 +45,8 @@ public:
while (lMemCount < m_lCount + 1)
{
if (pStream->tell() >= m_lOffsetInStream + m_oHeader.RecLen) break;
CTextPFRun_ppt elm;
m_arrPFs.push_back(elm);
m_arrPFs[lCountItems].LoadFromStream(pStream);
......@@ -57,6 +59,8 @@ public:
lCountItems = 0;
while (lMemCount < m_lCount + 1)
{
if (pStream->tell() >= m_lOffsetInStream + m_oHeader.RecLen) break;
CTextCFRun_ppt elm;
m_arrCFs.push_back(elm);
......
......@@ -9,7 +9,7 @@ namespace NSPresentationEditor
std::vector<IElement*> m_arElements;
std::vector<CColor> m_arColorScheme;
std::map<int,int> m_pPlaceholders;
std::map<int,int> m_mapPlaceholders;
bool m_bUseThemeColorScheme;
......@@ -45,7 +45,7 @@ namespace NSPresentationEditor
{
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();
for (size_t nIndex = 0; nIndex < nCount; ++nIndex)
......@@ -53,7 +53,8 @@ namespace NSPresentationEditor
ADDREFINTERFACE((m_arElements[nIndex]));
}
m_arColorScheme = oSrc.m_arColorScheme;
m_mapPlaceholders = oSrc.m_mapPlaceholders;
m_arColorScheme = oSrc.m_arColorScheme;
m_bUseThemeColorScheme = oSrc.m_bUseThemeColorScheme;
......@@ -69,6 +70,8 @@ namespace NSPresentationEditor
m_bShowMasterShapes = oSrc.m_bShowMasterShapes;
m_strLayoutType = oSrc.m_strLayoutType;
m_sName = oSrc.m_sName;
return *this;
}
......@@ -91,6 +94,7 @@ namespace NSPresentationEditor
}
m_arElements.clear();
m_mapPlaceholders.clear();
m_bUseThemeColorScheme = true;
m_bShowMasterShapes = true;
......@@ -122,7 +126,7 @@ namespace NSPresentationEditor
return pNew;
}
IElement* GetPlaceholder(LONG lID, bool bIsAddRef)
IElement* GetPlaceholder(LONG lID, bool bIsAddRef)
{
size_t nCount = m_arElements.size();
......
......@@ -34,7 +34,7 @@ namespace NSPresentationEditor
CMetricInfo m_oInfo;
CString m_strComment;
std::wstring m_strComment;
std::wstring m_sName;
public:
CSlide() : m_arElements(), m_oSlideShow()
......@@ -70,7 +70,8 @@ namespace NSPresentationEditor
m_dDuration = 30000.0;
m_bShowMasterShapes = true;
m_strComment = _T("");
m_strComment.clear();
m_sName.clear();
}
......@@ -143,6 +144,7 @@ namespace NSPresentationEditor
m_bShowMasterShapes = oSrc.m_bShowMasterShapes;
m_strComment = oSrc.m_strComment;
m_sName = oSrc.m_sName;
}
public:
......@@ -213,23 +215,9 @@ namespace NSPresentationEditor
return;
}
//m_arElements[nIndexElement] = pLayoutElem->CreateDublicate();
//m_arElements[nIndexElement]->m_oProperties = pElement->m_oProperties;
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)
{
m_oInfo = oInfo;
......
......@@ -13,6 +13,8 @@ namespace NSPresentationEditor
std::map<_UINT64, LONG> m_mapGeomToLayout;//
std::map<DWORD, LONG> m_mapTitleLayout; //
std::map<int,int> m_mapPlaceholders;
std::vector<CColor> m_arColorScheme;
std::vector<CFont> m_arFonts;
std::vector<CBrush> m_arBrushes;
......@@ -27,7 +29,6 @@ namespace NSPresentationEditor
std::vector<IElement*> m_arElements;
std::map<int,int> m_pPlaceholders;
CMetricInfo m_oInfo;
std::wstring m_sThemeName;
......@@ -48,13 +49,13 @@ namespace NSPresentationEditor
CTheme() : m_arColorScheme(), m_arFonts(), m_arBrushes(),
m_arPens(), m_arEffects(), m_arLayouts()
{
m_sThemeName = L"Default";
m_lOriginalWidth = m_lOriginalHeight = 0;
m_sThemeName = L"Default";
m_lOriginalWidth = m_lOriginalHeight = 0;
m_bHasDate = false;
m_bHasSlideNumber = false;
m_bHasHeader = false;
m_bHasFooter = false;
m_bHasDate = false;
m_bHasSlideNumber = false;
m_bHasHeader = false;
m_bHasFooter = false;
}
CTheme(const CTheme& oSrc)
......@@ -91,6 +92,7 @@ namespace NSPresentationEditor
m_arLayouts = oSrc.m_arLayouts;
m_mapTitleLayout = oSrc.m_mapTitleLayout;
m_mapGeomToLayout = oSrc.m_mapGeomToLayout;
m_mapPlaceholders = oSrc.m_mapPlaceholders;
m_bIsBackground = oSrc.m_bIsBackground;
m_oBackground = oSrc.m_oBackground;
......@@ -143,6 +145,10 @@ namespace NSPresentationEditor
}
m_arElements.clear();
m_arLayouts.clear();
m_mapTitleLayout.clear();
m_mapGeomToLayout.clear();
m_mapPlaceholders.clear();
m_lOriginalWidth = m_lOriginalHeight = 0;
......
......@@ -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);
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("");
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