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
...@@ -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