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

PPTFormat

git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@65623 954022d7-b5bf-4e40-9824-e11837661b57
parent 6383b6ef
...@@ -465,7 +465,13 @@ void CPPTUserInfo::LoadSlide(DWORD dwSlideID, CSlide* pSlide) ...@@ -465,7 +465,13 @@ void CPPTUserInfo::LoadSlide(DWORD dwSlideID, CSlide* pSlide)
//????? !!! //????? !!!
pPairTheme = m_mapMasterToTheme.begin(); pPairTheme = m_mapMasterToTheme.begin();
} }
//------------------
std::vector<CRecordHeadersFootersAtom*> oArrayHeadersFootersAtoms;
pRecordSlide->GetRecordsByType(&oArrayHeadersFootersAtoms, true, true);
CRecordHeadersFootersAtom* headers_footers = NULL;
if (!oArrayHeadersFootersAtoms.empty()) headers_footers = oArrayHeadersFootersAtoms[0];
//-----------------
pSlide->m_lThemeID = pPairTheme->second; pSlide->m_lThemeID = pPairTheme->second;
CTheme * pTheme = &m_arThemes [pSlide->m_lThemeID]; CTheme * pTheme = &m_arThemes [pSlide->m_lThemeID];
...@@ -487,12 +493,6 @@ void CPPTUserInfo::LoadSlide(DWORD dwSlideID, CSlide* pSlide) ...@@ -487,12 +493,6 @@ void CPPTUserInfo::LoadSlide(DWORD dwSlideID, CSlide* pSlide)
if (pPairLayoutGeom == pTheme->m_mapGeomToLayout.end()) if (pPairLayoutGeom == pTheme->m_mapGeomToLayout.end())
{ {
std::vector<CRecordHeadersFootersAtom*> oArrayHeadersFootersAtoms;
pRecordSlide->GetRecordsByType(&oArrayHeadersFootersAtoms, true, true);
CRecordHeadersFootersAtom* headers_footers = NULL;
if (!oArrayHeadersFootersAtoms.empty()) headers_footers = oArrayHeadersFootersAtoms[0];
pSlide->m_lLayoutID = AddNewLayout(pTheme, &oArraySlideAtoms[0]->m_oLayout, pRecordSlide->m_oPersist.m_arTextAttrs, headers_footers); pSlide->m_lLayoutID = AddNewLayout(pTheme, &oArraySlideAtoms[0]->m_oLayout, pRecordSlide->m_oPersist.m_arTextAttrs, headers_footers);
pLayout = &pTheme->m_arLayouts[pSlide->m_lLayoutID]; pLayout = &pTheme->m_arLayouts[pSlide->m_lLayoutID];
pLayout->m_bShowMasterShapes = true; pLayout->m_bShowMasterShapes = true;
...@@ -545,6 +545,16 @@ void CPPTUserInfo::LoadSlide(DWORD dwSlideID, CSlide* pSlide) ...@@ -545,6 +545,16 @@ void CPPTUserInfo::LoadSlide(DWORD dwSlideID, CSlide* pSlide)
} }
} }
} }
std::vector<CRecordCString*> oArrayStrings;
pRecordSlide->GetRecordsByType(&oArrayStrings, false, false);
for (int i=0; i < oArrayStrings.size(); i++)
{
if (oArrayStrings[i]->m_oHeader.RecType == 0x0fba)
{
pSlide->m_sName = oArrayStrings[i]->m_strText;
}
}
// ... // ...
std::vector<CRecordShapeContainer*> oArrayShapes; std::vector<CRecordShapeContainer*> oArrayShapes;
...@@ -553,7 +563,7 @@ void CPPTUserInfo::LoadSlide(DWORD dwSlideID, CSlide* pSlide) ...@@ -553,7 +563,7 @@ void CPPTUserInfo::LoadSlide(DWORD dwSlideID, CSlide* pSlide)
pSlide->m_bShowMasterShapes = bMasterObjects; pSlide->m_bShowMasterShapes = bMasterObjects;
pSlide->m_bIsBackground = false; pSlide->m_bIsBackground = false;
std::vector<int> slidePlaceholders; std::map<int,int> slidePlaceholders;
for (int nShape = 0; nShape < oArrayShapes.size(); ++nShape) for (int nShape = 0; nShape < oArrayShapes.size(); ++nShape)
{ {
...@@ -585,19 +595,45 @@ void CPPTUserInfo::LoadSlide(DWORD dwSlideID, CSlide* pSlide) ...@@ -585,19 +595,45 @@ void CPPTUserInfo::LoadSlide(DWORD dwSlideID, CSlide* pSlide)
pSlide->m_arElements.push_back(pElem); pSlide->m_arElements.push_back(pElem);
} }
if (pElem->m_lPlaceholderType > 0 ) if (pElem->m_lPlaceholderType > 0 )
slidePlaceholders.push_back( pElem->m_lPlaceholderType ); slidePlaceholders.insert(std::pair<int,int>(pElem->m_lPlaceholderType, pSlide->m_arElements.size() - 1) );
} }
} }
//------------- ()
std::map<int, int>::iterator it;
it = pLayout->m_pPlaceholders.find(NSOfficePPT::MasterSlideNumber);
if ( it != pLayout->m_pPlaceholders.end() &&
slidePlaceholders.find(NSOfficePPT::MasterSlideNumber) == slidePlaceholders.end())
{
IElement* pElement = pLayout->m_arElements[it->second]->CreateDublicate();
pSlide->m_arElements.push_back(pElement);
}
it = pLayout->m_pPlaceholders.find(MasterDate);
if ( it != pLayout->m_pPlaceholders.end() &&
slidePlaceholders.find(NSOfficePPT::MasterDate) == slidePlaceholders.end())
{
IElement* pElement = pLayout->m_arElements[it->second]->CreateDublicate();
pSlide->m_arElements.push_back(pElement);
}
it = pLayout->m_pPlaceholders.find(MasterHeader);
if ( it != pLayout->m_pPlaceholders.end() &&
slidePlaceholders.find(NSOfficePPT::MasterHeader) == slidePlaceholders.end())
{
IElement* pElement = pLayout->m_arElements[it->second]->CreateDublicate();
pSlide->m_arElements.push_back(pElement);
}
it = pLayout->m_pPlaceholders.find(MasterFooter);
if ( it != pLayout->m_pPlaceholders.end() &&
slidePlaceholders.find(NSOfficePPT::MasterFooter) == slidePlaceholders.end())
{
IElement* pElement = pLayout->m_arElements[it->second]->CreateDublicate();
pSlide->m_arElements.push_back(pElement);
}
//
//for (std::map<int, int>::iterator it = pLayout->m_pPlaceholders.begin(); it != pLayout->m_pPlaceholders.end(); it++)
//{
// if ( std::find(slidePlaceholders.begin(), slidePlaceholders.end(), it->first) == slidePlaceholders.end() )
// {
// IElement * elm = pLayout->m_arElements[it->second]->CreateDublicate();
// pSlide->m_arElements.push_back(elm);
// }
//}
} }
IElement* CPPTUserInfo::AddNewLayoutElement (CLayout *pLayout, int placeholderType, int placeholderSizePreset) IElement* CPPTUserInfo::AddNewLayoutElement (CLayout *pLayout, int placeholderType, int placeholderSizePreset)
...@@ -677,7 +713,37 @@ int CPPTUserInfo::AddNewLayout(NSPresentationEditor::CTheme* pTheme, SSlideLayou ...@@ -677,7 +713,37 @@ int CPPTUserInfo::AddNewLayout(NSPresentationEditor::CTheme* pTheme, SSlideLayou
for (int i = 0 ; i < 8; i ++) for (int i = 0 ; i < 8; i ++)
{ {
if (layoutRecord->m_pPlaceHolderID[i] == 0) break; if (layoutRecord->m_pPlaceHolderID[i] == 0) break;
AddNewLayoutElement(pLayout, layoutRecord->m_pPlaceHolderID[i], defObjSize);
switch(layoutRecord->m_pPlaceHolderID[i])
{
case NSOfficePPT::MasterTitle :
case NSOfficePPT::MasterBody :
case NSOfficePPT::MasterCenteredTitle :
case NSOfficePPT::MasterSubtitle :
case NSOfficePPT::MasterNotesSlideImage :
case NSOfficePPT::MasterNotesBody:
case NSOfficePPT::MasterSlideNumber:
case NSOfficePPT::MasterDate:
case NSOfficePPT::MasterHeader:
case NSOfficePPT::MasterFooter:
{
int usualType = layoutRecord->m_pPlaceHolderID[i];
CorrectPlaceholderType(usualType);
std::map<int, int>::iterator it = pTheme->m_pPlaceholders.find(NSOfficePPT::MasterSlideNumber);
if (it != pTheme->m_pPlaceholders.end())
{
IElement* pElement = pTheme->m_arElements[it->second]->CreateDublicate();
pLayout->m_arElements.push_back(dynamic_cast<IElement*>(pElement));
pLayout->m_pPlaceholders.insert(std::pair<int, int>(NSOfficePPT::MasterSlideNumber, pLayout->m_arElements.size()-1));
}
else
AddNewLayoutElement(pLayout, usualType, defObjSize);
}break;
default:
AddNewLayoutElement(pLayout, layoutRecord->m_pPlaceHolderID[i], defObjSize);
break;
}
} }
if (headers_footers) if (headers_footers)
...@@ -690,14 +756,15 @@ int CPPTUserInfo::AddNewLayout(NSPresentationEditor::CTheme* pTheme, SSlideLayou ...@@ -690,14 +756,15 @@ int CPPTUserInfo::AddNewLayout(NSPresentationEditor::CTheme* pTheme, SSlideLayou
it = pLayout->m_pPlaceholders.find(NSOfficePPT::MasterSlideNumber); it = pLayout->m_pPlaceholders.find(NSOfficePPT::MasterSlideNumber);
if ( it == pLayout->m_pPlaceholders.end()) if ( it == pLayout->m_pPlaceholders.end())
{ {
pElement = AddNewLayoutElement(pLayout, MasterSlideNumber, 4); it = pTheme->m_pPlaceholders.find(NSOfficePPT::MasterSlideNumber);
} if (it != pTheme->m_pPlaceholders.end())
else {
{ pElement = pTheme->m_arElements[it->second]->CreateDublicate();
pElement = pLayout->m_arElements[it->second]; pLayout->m_arElements.push_back(dynamic_cast<IElement*>(pElement));
} pLayout->m_pPlaceholders.insert(std::pair<int, int>(NSOfficePPT::MasterSlideNumber, pLayout->m_arElements.size()-1));
if (pElement) }
{ else
pElement = AddNewLayoutElement(pLayout, MasterSlideNumber, 4);
} }
} }
if (headers_footers->m_bHasTodayDate || if (headers_footers->m_bHasTodayDate ||
...@@ -708,14 +775,15 @@ int CPPTUserInfo::AddNewLayout(NSPresentationEditor::CTheme* pTheme, SSlideLayou ...@@ -708,14 +775,15 @@ int CPPTUserInfo::AddNewLayout(NSPresentationEditor::CTheme* pTheme, SSlideLayou
it = pLayout->m_pPlaceholders.find(MasterDate); it = pLayout->m_pPlaceholders.find(MasterDate);
if (it == pLayout->m_pPlaceholders.end()) if (it == pLayout->m_pPlaceholders.end())
{ {
pElement = AddNewLayoutElement(pLayout, MasterDate, 2); it = pTheme->m_pPlaceholders.find(NSOfficePPT::MasterDate);
} if (it != pTheme->m_pPlaceholders.end())
else {
{ pElement = pTheme->m_arElements[it->second]->CreateDublicate();
pElement = pLayout->m_arElements[it->second]; pLayout->m_arElements.push_back(dynamic_cast<IElement*>(pElement));
} pLayout->m_pPlaceholders.insert(std::pair<int, int>(NSOfficePPT::MasterDate, pLayout->m_arElements.size()-1));
if (pElement) }
{ else
pElement = AddNewLayoutElement(pLayout, MasterDate, 2);
} }
} }
if (headers_footers->m_bHasHeader) if (headers_footers->m_bHasHeader)
...@@ -724,14 +792,15 @@ int CPPTUserInfo::AddNewLayout(NSPresentationEditor::CTheme* pTheme, SSlideLayou ...@@ -724,14 +792,15 @@ int CPPTUserInfo::AddNewLayout(NSPresentationEditor::CTheme* pTheme, SSlideLayou
it = pLayout->m_pPlaceholders.find(MasterHeader); it = pLayout->m_pPlaceholders.find(MasterHeader);
if (it == pLayout->m_pPlaceholders.end()) if (it == pLayout->m_pPlaceholders.end())
{ {
pElement = AddNewLayoutElement(pLayout, MasterHeader, 2); it = pTheme->m_pPlaceholders.find(NSOfficePPT::MasterHeader);
} if (it != pTheme->m_pPlaceholders.end())
else {
{ pElement = pTheme->m_arElements[it->second]->CreateDublicate();
pElement = pLayout->m_arElements[it->second]; pLayout->m_arElements.push_back(dynamic_cast<IElement*>(pElement));
} pLayout->m_pPlaceholders.insert(std::pair<int, int>(NSOfficePPT::MasterHeader, pLayout->m_arElements.size()-1));
if (pElement) }
{ else
pElement = AddNewLayoutElement(pLayout, MasterHeader, 2);
} }
} }
if (headers_footers->m_bHasFooter) if (headers_footers->m_bHasFooter)
...@@ -740,14 +809,15 @@ int CPPTUserInfo::AddNewLayout(NSPresentationEditor::CTheme* pTheme, SSlideLayou ...@@ -740,14 +809,15 @@ int CPPTUserInfo::AddNewLayout(NSPresentationEditor::CTheme* pTheme, SSlideLayou
it = pLayout->m_pPlaceholders.find(MasterFooter); it = pLayout->m_pPlaceholders.find(MasterFooter);
if (it == pLayout->m_pPlaceholders.end()) if (it == pLayout->m_pPlaceholders.end())
{ {
pElement = AddNewLayoutElement(pLayout, MasterFooter, 4); it = pTheme->m_pPlaceholders.find(NSOfficePPT::MasterFooter);
} if (it != pTheme->m_pPlaceholders.end())
else {
{ pElement = pTheme->m_arElements[it->second]->CreateDublicate();
pElement = pLayout->m_arElements[it->second]; pLayout->m_arElements.push_back(dynamic_cast<IElement*>(pElement));
} pLayout->m_pPlaceholders.insert(std::pair<int, int>(NSOfficePPT::MasterFooter, pLayout->m_arElements.size()-1));
if (pElement) }
{ else
pElement = AddNewLayoutElement(pLayout, MasterFooter, 4);
} }
} }
} }
...@@ -960,6 +1030,7 @@ void CPPTUserInfo::LoadMainMaster(DWORD dwMasterID, const LONG& lOriginWidth, co ...@@ -960,6 +1030,7 @@ void CPPTUserInfo::LoadMainMaster(DWORD dwMasterID, const LONG& lOriginWidth, co
continue; continue;
} }
pTheme->m_arElements.push_back(pElem); pTheme->m_arElements.push_back(pElem);
if ( pElem->m_lPlaceholderType >0) if ( pElem->m_lPlaceholderType >0)
pTheme->m_pPlaceholders.insert(std::pair<int, int>(pElem->m_lPlaceholderType, pTheme->m_arElements.size()-1)); pTheme->m_pPlaceholders.insert(std::pair<int, int>(pElem->m_lPlaceholderType, pTheme->m_arElements.size()-1));
...@@ -1139,6 +1210,16 @@ void CPPTUserInfo::LoadNoMainMaster(DWORD dwMasterID, const LONG& lOriginWidth, ...@@ -1139,6 +1210,16 @@ void CPPTUserInfo::LoadNoMainMaster(DWORD dwMasterID, const LONG& lOriginWidth,
} }
} }
} }
std::vector<CRecordCString*> oArrayStrings;
pCurMaster->GetRecordsByType(&oArrayStrings, false, false);
for (int i=0; i < oArrayStrings.size(); i++)
{
if (oArrayStrings[i]->m_oHeader.RecType == 0x0fba)
{
pLayout->m_sName = oArrayStrings[i]->m_strText;
}
}
// ... // ...
std::vector<CRecordShapeContainer*> oArrayShapes; std::vector<CRecordShapeContainer*> oArrayShapes;
pCurMaster->GetRecordsByType(&oArrayShapes, true); pCurMaster->GetRecordsByType(&oArrayShapes, true);
......
...@@ -29,6 +29,7 @@ namespace NSPresentationEditor ...@@ -29,6 +29,7 @@ namespace NSPresentationEditor
bool m_bShowMasterShapes; bool m_bShowMasterShapes;
std::wstring m_strLayoutType; std::wstring m_strLayoutType;
std::wstring m_sName;
public: public:
CLayout() CLayout()
{ {
......
...@@ -35,7 +35,7 @@ namespace NSPresentationEditor ...@@ -35,7 +35,7 @@ namespace NSPresentationEditor
CMetricInfo m_oInfo; CMetricInfo m_oInfo;
CString m_strComment; CString m_strComment;
std::wstring m_sName;
public: public:
CSlide() : m_arElements(), m_oSlideShow() CSlide() : m_arElements(), m_oSlideShow()
{ {
......
...@@ -776,7 +776,11 @@ void NSPresentationEditor::CPPTXWriter::WriteLayout(CLayout& oLayout, int nIndex ...@@ -776,7 +776,11 @@ void NSPresentationEditor::CPPTXWriter::WriteLayout(CLayout& oLayout, int nIndex
oWriter.WriteString(std::wstring(L"<p:sldLayout xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:p=\"http://schemas.openxmlformats.org/presentationml/2006/main\"")); oWriter.WriteString(std::wstring(L"<p:sldLayout xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:p=\"http://schemas.openxmlformats.org/presentationml/2006/main\""));
oWriter.WriteString(std::wstring(L" type=\"") + oLayout.m_strLayoutType + _T("\"")); oWriter.WriteString(std::wstring(L" type=\"") + oLayout.m_strLayoutType + _T("\""));
oWriter.WriteString(std::wstring(L" showMasterSp=\"") + (oLayout.m_bShowMasterShapes ? _T("1") : _T("0"))); oWriter.WriteString(std::wstring(L" showMasterSp=\"") + (oLayout.m_bShowMasterShapes ? _T("1") : _T("0")));
oWriter.WriteString(std::wstring(L"\" preserve=\"1\"><p:cSld>")); oWriter.WriteString(std::wstring(L"\" preserve=\"1\"><p:cSld"));
if ( oLayout.m_sName.empty() == false)
oWriter.WriteString(std::wstring(L" name=\"") + oLayout.m_sName + std::wstring(L"\""));
oWriter.WriteString(std::wstring(L">"));
if (oLayout.m_bIsBackground) if (oLayout.m_bIsBackground)
{ {
...@@ -789,7 +793,9 @@ void NSPresentationEditor::CPPTXWriter::WriteLayout(CLayout& oLayout, int nIndex ...@@ -789,7 +793,9 @@ void NSPresentationEditor::CPPTXWriter::WriteLayout(CLayout& oLayout, int nIndex
size_t nElements = oLayout.m_arElements.size(); size_t nElements = oLayout.m_arElements.size();
for (size_t nEl = 0; nEl < nElements; ++nEl) for (size_t nEl = 0; nEl < nElements; ++nEl)
{
WriteElement(oWriter, oRels, oLayout.m_arElements[nEl]); WriteElement(oWriter, oRels, oLayout.m_arElements[nEl]);
}
oWriter.WriteString(std::wstring(L"</p:spTree></p:cSld>")); oWriter.WriteString(std::wstring(L"</p:spTree></p:cSld>"));
...@@ -830,20 +836,23 @@ void NSPresentationEditor::CPPTXWriter::WriteSlide(int nIndexSlide) ...@@ -830,20 +836,23 @@ void NSPresentationEditor::CPPTXWriter::WriteSlide(int nIndexSlide)
oRels.StartSlide(nLayout, nIndexSlide); oRels.StartSlide(nLayout, nIndexSlide);
} }
CString str1 = _T("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><p:sld xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:p=\"http://schemas.openxmlformats.org/presentationml/2006/main\"><p:cSld>"); oWriter.WriteString(std::wstring(L"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><p:sld xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:p=\"http://schemas.openxmlformats.org/presentationml/2006/main\">"));
oWriter.WriteString(str1); oWriter.WriteString(std::wstring(L"<p:cSld"));
if ( pSlide->m_sName.empty() == false)
oWriter.WriteString(std::wstring(L" name=\"") + pSlide->m_sName + std::wstring(L"\""));
oWriter.WriteString(std::wstring(L">"));
if (pSlide->m_bIsBackground) if (pSlide->m_bIsBackground)
{ {
WriteBackground(oWriter, oRels, pSlide->m_oBackground); WriteBackground(oWriter, oRels, pSlide->m_oBackground);
} }
CString strElems = _T("<p:spTree><p:nvGrpSpPr><p:cNvPr id=\"1\" name=\"\"/><p:cNvGrpSpPr/><p:nvPr/></p:nvGrpSpPr><p:grpSpPr>\ oWriter.WriteString(std::wstring(L"<p:spTree><p:nvGrpSpPr><p:cNvPr id=\"1\" name=\"\"/><p:cNvGrpSpPr/><p:nvPr/></p:nvGrpSpPr><p:grpSpPr>\
<a:xfrm><a:off x=\"0\" y=\"0\"/><a:ext cx=\"0\" cy=\"0\"/><a:chOff x=\"0\" y=\"0\"/><a:chExt cx=\"0\" cy=\"0\"/></a:xfrm></p:grpSpPr>"); <a:xfrm><a:off x=\"0\" y=\"0\"/><a:ext cx=\"0\" cy=\"0\"/><a:chOff x=\"0\" y=\"0\"/><a:chExt cx=\"0\" cy=\"0\"/></a:xfrm></p:grpSpPr>"));
oWriter.WriteString(strElems);
size_t nElements = pSlide->m_arElements.size(); for (size_t nEl = 0; nEl < pSlide->m_arElements.size(); ++nEl)
for (size_t nEl = 0; nEl < nElements; ++nEl)
{ {
WriteElement(oWriter, oRels, pSlide->m_arElements[nEl], &m_pDocument->m_arThemes[pSlide->m_lThemeID].m_arLayouts[pSlide->m_lLayoutID]); WriteElement(oWriter, oRels, pSlide->m_arElements[nEl], &m_pDocument->m_arThemes[pSlide->m_lThemeID].m_arLayouts[pSlide->m_lLayoutID]);
} }
...@@ -874,6 +883,7 @@ void NSPresentationEditor::CPPTXWriter::WriteSlide(int nIndexSlide) ...@@ -874,6 +883,7 @@ void NSPresentationEditor::CPPTXWriter::WriteSlide(int nIndexSlide)
void NSPresentationEditor::CPPTXWriter::WriteSlides() void NSPresentationEditor::CPPTXWriter::WriteSlides()
{ {
size_t nCountSlides = m_pDocument->m_arSlides.size(); size_t nCountSlides = m_pDocument->m_arSlides.size();
for (size_t nIndexS = 0; nIndexS < nCountSlides; ++nIndexS) for (size_t nIndexS = 0; nIndexS < nCountSlides; ++nIndexS)
{ {
CRelsGenerator::StartNotes((int)nIndexS, m_strTempDirectory, m_pDocument->m_arSlides[nIndexS]->m_strComment); CRelsGenerator::StartNotes((int)nIndexS, m_strTempDirectory, m_pDocument->m_arSlides[nIndexS]->m_strComment);
......
...@@ -895,12 +895,6 @@ void NSPresentationEditor::CShapeWriter::WriteTextInfo() ...@@ -895,12 +895,6 @@ void NSPresentationEditor::CShapeWriter::WriteTextInfo()
std::wstring typeRun = L"a:r"; std::wstring typeRun = L"a:r";
//if (m_pShapeElement->m_lPlaceholderType == PT_MasterSlideNumber)
//{
// m_oWriter.WriteString(std::wstring(L"<a:fld id=\"{D038279B-FC19-497E-A7D1-5ADD9CAF016F}\" type=\"slidenum\">"));
// m_oWriter.WriteString(std::wstring(L"<a:rPr/><a:t>#</a:t></a:fld>"));
//}
size_t nCountSpans = pParagraph->m_arSpans.size(); size_t nCountSpans = pParagraph->m_arSpans.size();
for (size_t nSpan = 0; nSpan < nCountSpans; ++nSpan) for (size_t nSpan = 0; nSpan < nCountSpans; ++nSpan)
{ {
...@@ -945,10 +939,14 @@ void NSPresentationEditor::CShapeWriter::WriteTextInfo() ...@@ -945,10 +939,14 @@ void NSPresentationEditor::CShapeWriter::WriteTextInfo()
} }
else else
{ {
if (m_pShapeElement->m_lPlaceholderType == PT_MasterSlideNumber)//todooo + date if (m_pShapeElement->m_lPlaceholderType == PT_MasterSlideNumber)
{ {
m_oWriter.WriteString(std::wstring(L"<a:fld id=\"{D038279B-FC19-497E-A7D1-5ADD9CAF016F}\" type=\"slidenum\"><a:rPr")); m_oWriter.WriteString(std::wstring(L"<a:fld id=\"{D038279B-FC19-497E-A7D1-5ADD9CAF016F}\" type=\"slidenum\"><a:rPr"));
} }
else if (m_pShapeElement->m_lPlaceholderType == PT_MasterDate)
{
m_oWriter.WriteString(std::wstring(L"<a:fld id=\"{D7E01130-044F-4930-9A27-C729C70D8524}\" type=\"datetime1\"><a:rPr"));
}
else else
{ {
m_oWriter.WriteString(std::wstring(L"<a:r><a:rPr")); m_oWriter.WriteString(std::wstring(L"<a:r><a:rPr"));
...@@ -1060,8 +1058,11 @@ void NSPresentationEditor::CShapeWriter::WriteTextInfo() ...@@ -1060,8 +1058,11 @@ void NSPresentationEditor::CShapeWriter::WriteTextInfo()
CString strT2 = _T("</a:t>"); CString strT2 = _T("</a:t>");
m_oWriter.WriteString(strT2); m_oWriter.WriteString(strT2);
if (m_pShapeElement->m_lPlaceholderType == PT_MasterSlideNumber) if (m_pShapeElement->m_lPlaceholderType == PT_MasterSlideNumber ||
m_pShapeElement->m_lPlaceholderType == PT_MasterDate)
{
m_oWriter.WriteString(std::wstring(L"</a:fld>")); m_oWriter.WriteString(std::wstring(L"</a:fld>"));
}
else else
m_oWriter.WriteString(std::wstring(L"</a:r>")); m_oWriter.WriteString(std::wstring(L"</a:r>"));
} }
......
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