Compare commits

...

3 Commits

Author SHA1 Message Date
cbbb4c19de . 2019-02-05 12:23:10 +03:00
f4e0ce53b4 [x2t] For linux build 8f332c3c09 2019-02-05 11:24:36 +03:00
8f332c3c09 [x2t] Add app.xml, core.xml to Editor.bin 2019-02-04 20:04:37 +03:00
15 changed files with 658 additions and 254 deletions

View File

@ -58,6 +58,11 @@ namespace NSBinPptxRW
{
class CDrawingConverter;
}
namespace OOX
{
class CApp;
class CCore;
}
namespace Writers
{
@ -87,6 +92,8 @@ namespace Writers
std::wstring m_sThemePath;
int m_nDocPrIndex;
BinDocxRW::CComments* m_pComments;
OOX::CApp* m_pApp;
OOX::CCore* m_pCore;
FileWriter (std::wstring sDirOutput,std::wstring sFontDir, bool bNoFontDir, int nVersion, bool bSaveChartAsImg, NSBinPptxRW::CDrawingConverter* pDrawingConverter, std::wstring sThemePath)
: m_pDrawingConverter(pDrawingConverter), m_sThemePath(sThemePath), m_bSaveChartAsImg(bSaveChartAsImg),
@ -105,9 +112,16 @@ namespace Writers
m_oWebSettingsWriter (sDirOutput),
m_nDocPrIndex(0),
m_pComments(NULL),
m_oCustomXmlWriter (sDirOutput, pDrawingConverter)
m_oCustomXmlWriter (sDirOutput, pDrawingConverter),
m_pApp (NULL),
m_pCore (NULL)
{
}
~FileWriter()
{
RELEASEOBJECT(m_pApp);
RELEASEOBJECT(m_pCore);
}
int getNextDocPr()
{
m_nDocPrIndex++;

View File

@ -38,6 +38,9 @@
#include "../BinWriter/BinReaderWriterDefines.h"
#include "../../XlsxSerializerCom/Writer/BinaryReader.h"
#include "../../ASCOfficePPTXFile/PPTXFormat/App.h"
#include "../../ASCOfficePPTXFile/PPTXFormat/Core.h"
#include "../../Common/DocxFormat/Source/DocxFormat/Docx.h"
#include "../../Common/DocxFormat/Source/DocxFormat/Document.h"
#include "../../Common/DocxFormat/Source/DocxFormat/FontTable.h"
@ -47,6 +50,8 @@
#include "../../Common/DocxFormat/Source/DocxFormat/Footnote.h"
#include "../../Common/DocxFormat/Source/DocxFormat/Endnote.h"
#include "../../Common/DocxFormat/Source/DocxFormat/Settings/Settings.h"
#include "../../Common/DocxFormat/Source/DocxFormat/App.h"
#include "../../Common/DocxFormat/Source/DocxFormat/Core.h"
#include "../DocWrapper/XlsxSerializer.h"
@ -8798,6 +8803,28 @@ public:
//case c_oSerTableTypes::Document:
// res = Binary_DocumentTableReader(m_oBufferedStream, m_oFileWriter, m_oFileWriter.m_oDocumentWriter).Read();
// break;
case c_oSerTableTypes::App:
{
PPTX::App oApp(NULL);
m_oBufferedStream.Skip(1); // type
oApp.fromPPTY(&m_oBufferedStream);
OOX::CApp* pApp = new OOX::CApp(NULL);
pApp->FromPptxApp(&oApp);
pApp->SetRequiredDefaults();
m_oFileWriter.m_pApp = pApp;
}
break;
case c_oSerTableTypes::Core:
{
PPTX::Core oCore(NULL);
m_oBufferedStream.Skip(1); // type
oCore.fromPPTY(&m_oBufferedStream);
OOX::CCore* pCore = new OOX::CCore(NULL);
pCore->FromPptxCore(&oCore);
pCore->SetRequiredDefaults();
m_oFileWriter.m_pCore = pCore;
}
break;
case c_oSerTableTypes::HdrFtr:
res = Binary_HdrFtrTableReader(m_oBufferedStream, m_oFileWriter, m_oFileWriter.m_pComments).Read();
break;

View File

@ -296,33 +296,28 @@ bool BinDocxRW::CDocxSerializer::loadFromFile(const std::wstring& sSrcFileName,
OOX::CPath DocProps = std::wstring(_T("docProps"));
OOX::CApp* pApp = new OOX::CApp(NULL);
if (pApp)
if (NULL != m_pCurFileWriter->m_pApp)
{
std::wstring sApplication = NSSystemUtils::GetEnvVariable(NSSystemUtils::gc_EnvApplicationName);
if (sApplication.empty())
sApplication = NSSystemUtils::gc_EnvApplicationNameDefault;
pApp->SetApplication(sApplication);
#if defined(INTVER)
pApp->SetAppVersion(VALUE2STR(INTVER));
#endif
pApp->SetDocSecurity(0);
pApp->SetScaleCrop(false);
pApp->SetLinksUpToDate(false);
pApp->SetSharedDoc(false);
pApp->SetHyperlinksChanged(false);
pApp->write(pathDocProps + FILE_SEPARATOR_STR + _T("app.xml"), DocProps, *pContentTypes);
delete pApp;
}
OOX::CCore* pCore = new OOX::CCore(NULL);
if (pCore)
m_pCurFileWriter->m_pApp->write(pathDocProps + FILE_SEPARATOR_STR + _T("app.xml"), DocProps, *pContentTypes);
}
else
{
pCore->SetCreator(_T(""));
pCore->SetLastModifiedBy(_T(""));
pCore->write(pathDocProps + FILE_SEPARATOR_STR + _T("core.xml"), DocProps, *pContentTypes);
delete pCore;
}
OOX::CApp pApp(NULL);
pApp.SetDefaults();
pApp.write(pathDocProps + FILE_SEPARATOR_STR + _T("app.xml"), DocProps, *pContentTypes);
}
if (NULL != m_pCurFileWriter->m_pCore)
{
m_pCurFileWriter->m_pCore->write(pathDocProps + FILE_SEPARATOR_STR + _T("core.xml"), DocProps, *pContentTypes);
}
else
{
OOX::CCore pCore(NULL);
pCore.SetDefaults();
pCore.write(pathDocProps + FILE_SEPARATOR_STR + _T("core.xml"), DocProps, *pContentTypes);
}
/////////////////////////////////////////////////////////////////////////////////////
m_pCurFileWriter->Write();
pContentTypes->Write(sDstPath);

View File

@ -660,24 +660,28 @@ namespace NSBinPptxRW
m_oReader.m_pRels->SaveRels(pathFileRels.GetPath());
}
}
// app
CreateDefaultApp();
pPair = m_mainTables.find(NSBinPptxRW::NSMainTables::App);
if (m_mainTables.end() != pPair)
{
m_oReader.Seek(pPair->second);
m_oApp.fromPPTY(&m_oReader);
SetRequiredDefaultsApp();
}
// core
CreateDefaultCore();
pPair = m_mainTables.find(NSBinPptxRW::NSMainTables::Core);
if (m_mainTables.end() != pPair)
{
m_oReader.Seek(pPair->second);
m_oCore.fromPPTY(&m_oReader);
SetRequiredDefaultsCore();
}
if (false)
{
// app
pPair = m_mainTables.find(NSBinPptxRW::NSMainTables::App);
if (m_mainTables.end() != pPair)
{
m_oReader.Seek(pPair->second);
m_oApp.fromPPTY(&m_oReader);
}
// core
pPair = m_mainTables.find(NSBinPptxRW::NSMainTables::Core);
if (m_mainTables.end() != pPair)
{
m_oReader.Seek(pPair->second);
m_oCore.fromPPTY(&m_oReader);
}
// tableStyles
pPair = m_mainTables.find(NSBinPptxRW::NSMainTables::TableStyles);
if (m_mainTables.end() != pPair)
@ -706,9 +710,6 @@ namespace NSBinPptxRW
else
{
// create default
CreateDefaultApp();
CreateDefaultCore();
CreateDefaultViewProps();
// presProps
@ -1028,18 +1029,24 @@ namespace NSBinPptxRW
m_oReader.Seek(_end_rec);
}
void CreateDefaultApp()
void SetRequiredDefaultsApp()
{
m_oApp.TotalTime = 0;
m_oApp.Words = 0;
m_oApp.AppVersion.reset(NULL);
std::wstring sApplication = NSSystemUtils::GetEnvVariable(NSSystemUtils::gc_EnvApplicationName);
if (sApplication.empty())
sApplication = NSSystemUtils::gc_EnvApplicationNameDefault;
#if defined(INTVER)
std::string s = VALUE2STR(INTVER);
sApplication += L"/" + std::wstring(s.begin(), s.end());
std::string s = VALUE2STR(INTVER);
sApplication += L"/" + std::wstring(s.begin(), s.end());
#endif
m_oApp.Application = sApplication;
}
void CreateDefaultApp()
{
m_oApp.TotalTime = 0;
m_oApp.Words = 0;
SetRequiredDefaultsApp();
m_oApp.PresentationFormat = L"On-screen Show (4:3)";
m_oApp.Paragraphs = 0;
m_oApp.Slides = (int)m_arSlides.size();
@ -1082,6 +1089,15 @@ namespace NSBinPptxRW
m_oApp.SharedDoc = false;
m_oApp.HyperlinksChanged = false;
}
void SetRequiredDefaultsCore()
{
std::wstring sCreator = NSSystemUtils::GetEnvVariable(NSSystemUtils::gc_EnvCreator);
if (!sCreator.empty())
m_oCore.creator = sCreator;
std::wstring sLastModifiedBy = NSSystemUtils::GetEnvVariable(NSSystemUtils::gc_EnvLastModifiedBy);
if (!sLastModifiedBy.empty())
m_oCore.lastModifiedBy = sLastModifiedBy;
}
void CreateDefaultCore()
{
m_oCore.creator = _T("");

View File

@ -531,6 +531,12 @@ namespace NSBinPptxRW
WriteString(val);
WriteNodeEnd(strNodeName);
}
AVSINLINE void WriteNodeValue2(const std::wstring& strNodeName, const std::wstring& val)
{
WriteNodeBegin(strNodeName);
WriteStringXML(val);
WriteNodeEnd(strNodeName);
}
AVSINLINE void WriteNodeValue(const std::wstring& strNodeName, const bool& val)
{
WriteNodeBegin(strNodeName);
@ -663,6 +669,11 @@ namespace NSBinPptxRW
if (value.IsInit())
WriteNodeValue(strName, *value);
}
AVSINLINE void WriteNodeValue2(const std::wstring& strName, const nullable_string& value)
{
if (value.IsInit())
WriteNodeValue2(strName, *value);
}
AVSINLINE void WriteNodeValue(const std::wstring& strName, const nullable_bool& value)
{
if (value.IsInit())

View File

@ -65,8 +65,12 @@ namespace PPTX
XmlMacroReadNodeValueBase(oNode, L"Template", Template);
XmlMacroReadNodeValueBase(oNode, L"TotalTime", TotalTime);
XmlMacroReadNodeValueBase(oNode, L"Pages", Pages);
XmlMacroReadNodeValueBase(oNode, L"Words", Words);
XmlMacroReadNodeValueBase(oNode, L"Characters", Characters);
XmlMacroReadNodeValueBase(oNode, L"Application", Application);
XmlMacroReadNodeValueBase(oNode, L"DocSecurity", DocSecurity);
XmlMacroReadNodeValueBase(oNode, L"Lines", Lines);
XmlMacroReadNodeValueBase(oNode, L"PresentationFormat", PresentationFormat);
XmlMacroReadNodeValueBase(oNode, L"Paragraphs", Paragraphs);
XmlMacroReadNodeValueBase(oNode, L"Slides", Slides);
@ -91,21 +95,16 @@ namespace PPTX
XmlMacroLoadArray(oNodeVector2, _T("vt:variant"), TitlesOfParts, Logic::PartTitle);
}
XmlMacroReadNodeValueBase(oNode, L"Manager", Manager);
XmlMacroReadNodeValueBase(oNode, L"Company", Company);
XmlMacroReadNodeValueBase(oNode, L"LinksUpToDate", LinksUpToDate);
XmlMacroReadNodeValueBase(oNode, L"CharactersWithSpaces", CharactersWithSpaces);
XmlMacroReadNodeValueBase(oNode, L"SharedDoc", SharedDoc);
XmlMacroReadNodeValueBase(oNode, L"HyperlinkBase", HyperlinkBase);
XmlMacroReadNodeValueBase(oNode, L"HyperlinksChanged", HyperlinksChanged);
XmlMacroReadNodeValueBase(oNode, L"AppVersion", AppVersion);
//Characters = document.Root.element("Characters").text();
//CharactersWithSpaces = document.Root.element("CharactersWithSpaces").text();
//DigSig (Digital Signature)
//DocSecurity = document.Root.element("DocSecurity").text();
//HLinks
//HyperlinkBase = document.Root.element("HyperlinkBase").text();
//Lines = document.Root.element("Lines").text();
//Manager = document.Root.element("Manager").text();
//Pages = document.Root.element("Pages").text();
Normalize();
}
@ -153,7 +152,98 @@ namespace PPTX
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeEnd);
//start new record because new attributes is incompatible with previous versions
pWriter->StartRecord(0);
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeStart);
pWriter->WriteInt2(16, Characters);
pWriter->WriteInt2(17, CharactersWithSpaces);
pWriter->WriteInt2(18, DocSecurity);
pWriter->WriteString2(19, HyperlinkBase);
pWriter->WriteInt2(20, Lines);
pWriter->WriteString2(21, Manager);
pWriter->WriteInt2(22, Pages);
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeEnd);
pWriter->EndRecord();
pWriter->EndRecord();
}
virtual void fromPPTY(NSBinPptxRW::CBinaryFileReader* pReader)
{
LONG _end_rec = pReader->GetPos() + pReader->GetLong() + 4;
pReader->Skip(1); // start attributes
while (true)
{
BYTE _at = pReader->GetUChar_TypeNode();
if (_at == NSBinPptxRW::g_nodeAttributeEnd)
break;
switch (_at)
{
case 0: Template = pReader->GetString2(); break;
case 1: Application = pReader->GetString2(); break;
case 2: PresentationFormat = pReader->GetString2(); break;
case 3: Company = pReader->GetString2(); break;
case 4: AppVersion = pReader->GetString2(); break;
case 5: TotalTime = pReader->GetULong(); break;
case 6: Words = pReader->GetULong(); break;
case 7: Paragraphs = pReader->GetULong(); break;
case 8: Slides = pReader->GetULong(); break;
case 9: Notes = pReader->GetULong(); break;
case 10: HiddenSlides = pReader->GetULong(); break;
case 11: MMClips = pReader->GetULong(); break;
case 12: ScaleCrop = pReader->GetBool(); break;
case 13: LinksUpToDate = pReader->GetBool(); break;
case 14: SharedDoc = pReader->GetBool(); break;
case 15: HyperlinksChanged = pReader->GetBool(); break;
default: break;
}
}
while (pReader->GetPos() < _end_rec)
{
BYTE _at = pReader->GetUChar();
switch (_at)
{
case 0:
{
LONG _end_rec2 = pReader->GetPos() + pReader->GetLong() + 4;
pReader->Skip(1); // start attributes
while (true)
{
BYTE _at = pReader->GetUChar_TypeNode();
if (_at == NSBinPptxRW::g_nodeAttributeEnd)
break;
switch (_at)
{
case 16: Characters = pReader->GetULong(); break;
case 17: CharactersWithSpaces = pReader->GetULong(); break;
case 18: DocSecurity = pReader->GetULong(); break;
case 19: HyperlinkBase = pReader->GetString2(); break;
case 20: Lines = pReader->GetULong(); break;
case 21: Manager = pReader->GetString2(); break;
case 22: Pages = pReader->GetULong(); break;
default: break;
}
}
pReader->Seek(_end_rec2);
}
break;
default:
{
pReader->SkipRecord();
break;
}
}
}
pReader->Seek(_end_rec);
}
virtual void toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const
{
@ -166,11 +256,16 @@ namespace PPTX
pWriter->EndAttributes();
pWriter->WriteNodeValue(_T("Template"), Template);
pWriter->WriteNodeValue2(_T("Template"), Template);
pWriter->WriteNodeValue(_T("TotalTime"), TotalTime);
pWriter->WriteNodeValue(_T("Pages"), Pages);
pWriter->WriteNodeValue(_T("Words"), Words);
pWriter->WriteNodeValue(_T("Application"), Application);
pWriter->WriteNodeValue(_T("PresentationFormat"), PresentationFormat);
pWriter->WriteNodeValue(_T("Characters"), Characters);
pWriter->WriteNodeValue(_T("CharactersWithSpaces"), CharactersWithSpaces);
pWriter->WriteNodeValue2(_T("Application"), Application);
pWriter->WriteNodeValue(_T("DocSecurity"), DocSecurity);
pWriter->WriteNodeValue2(_T("PresentationFormat"), PresentationFormat);
pWriter->WriteNodeValue(_T("Lines"), Lines);
pWriter->WriteNodeValue(_T("Paragraphs"), Paragraphs);
pWriter->WriteNodeValue(_T("Slides"), Slides);
pWriter->WriteNodeValue(_T("Notes"), Notes);
@ -206,11 +301,13 @@ namespace PPTX
pWriter->EndNode(_T("vt:vector"));
pWriter->EndNode(_T("TitlesOfParts"));
pWriter->WriteNodeValue(_T("Company"), Company);
pWriter->WriteNodeValue2(_T("Manager"), Manager);
pWriter->WriteNodeValue2(_T("Company"), Company);
pWriter->WriteNodeValue(_T("LinksUpToDate"), LinksUpToDate);
pWriter->WriteNodeValue(_T("SharedDoc"), SharedDoc);
pWriter->WriteNodeValue2(_T("HyperlinkBase"), HyperlinkBase);
pWriter->WriteNodeValue(_T("HyperlinksChanged"), HyperlinksChanged);
pWriter->WriteNodeValue(_T("AppVersion"), AppVersion);
pWriter->WriteNodeValue2(_T("AppVersion"), AppVersion);
pWriter->EndNode(_T("Properties"));
}
@ -235,15 +332,16 @@ namespace PPTX
nullable_bool HyperlinksChanged; // (Hyperlinks Changed)
nullable_string AppVersion; // (Application Version)
//nullable_property<int, setter::only_positive<int> > Characters; // (Total Number of Characters)
//nullable_property<int, setter::only_positive<int> > CharactersWithSpaces; // (Number of Characters (With Spaces))
nullable_int Characters; // (Total Number of Characters)
nullable_int CharactersWithSpaces; // (Number of Characters (With Spaces))
nullable_int DocSecurity; // (Document Security)
nullable_string HyperlinkBase; // (Relative Hyperlink Base)
nullable_int Lines; // (Number of Lines)
nullable_string Manager; // (Name of Manager)
nullable_int Pages; // (Total Number of Pages)
//DigSig (Digital Signature)
//nullable_property<int, setter::only_positive<int> > DocSecurity; // (Document Security)
//std::list<std::string> - ??? HLinks; // (Hyperlink List)
//nullable_property<std::string> HyperlinkBase; // (Relative Hyperlink Base)
//nullable_property<int, setter::only_positive<int> > Lines; // (Number of Lines)
//nullable_property<std::string> Manager; // (Name of Manager)
//nullable_property<int, setter::only_positive<int> > Pages; // (Total Number of Pages)
private:
nullable_int m_VectorSize;
nullable_int m_Headings;
@ -259,6 +357,11 @@ namespace PPTX
MMClips.normalize_positive();
m_VectorSize.normalize_positive();
m_Headings.normalize_positive();
Characters.normalize_positive();
CharactersWithSpaces.normalize_positive();
DocSecurity.normalize_positive();
Lines.normalize_positive();
Pages.normalize_positive();
}
};
} // namespace PPTX

View File

@ -61,26 +61,25 @@ namespace PPTX
XmlUtils::CXmlNode oNode;
oNode.FromXmlFile(filename.m_strFilename);
XmlMacroReadNodeValueBase(oNode, _T("dc:title"), title);
XmlMacroReadNodeValueBase(oNode, _T("dc:creator"), creator);
XmlMacroReadNodeValueBase(oNode, _T("cp:lastModifiedBy"), lastModifiedBy);
XmlMacroReadNodeValueBase(oNode, _T("cp:revision"), revision);
XmlMacroReadNodeValueBase(oNode, _T("dcterms:modified"), modified);
XmlMacroReadNodeValueBase(oNode, _T("cp:category"), category);
XmlMacroReadNodeValueBase(oNode, _T("cp:contentStatus"), contentStatus);
XmlMacroReadNodeValueBase(oNode, _T("dcterms:created"), created);
// created = PPTX::DateTime::Parse(document.Root.element("created").text().ToString());
// modified = PPTX::DateTime::Parse(document.Root.element("modified").text().ToString());
/*
category = document.Root.element("category").text();
contentStatus = document.Root.element("contentStatus").text();
description = document.Root.element("description").text();
//identifier - ???
// keywords = document.Root.element("keywords").text();
language = document.Root.element("language").text();
// lastPrinted = PPTX::DateTime::Parse(document.Root.element("lastPrinted").text().ToString());
subject = document.Root.element("subject").text();
version = document.Root.element("version").text();
*/
//created = PPTX::DateTime::Parse(document.Root.element("created").text().ToString());
XmlMacroReadNodeValueBase(oNode, _T("dc:creator"), creator);
XmlMacroReadNodeValueBase(oNode, _T("dc:description"), description);
XmlMacroReadNodeValueBase(oNode, _T("dc:identifier"), identifier);
//todo keywords is complex by spec there is no real example
XmlMacroReadNodeValueBase(oNode, _T("cp:keywords"), keywords);
XmlMacroReadNodeValueBase(oNode, _T("dc:language"), language);
XmlMacroReadNodeValueBase(oNode, _T("cp:lastModifiedBy"), lastModifiedBy);
XmlMacroReadNodeValueBase(oNode, _T("cp:lastPrinted"), lastPrinted);
//lastPrinted = PPTX::DateTime::Parse(document.Root.element("lastPrinted").text().ToString());
XmlMacroReadNodeValueBase(oNode, _T("dcterms:modified"), modified);
//modified = PPTX::DateTime::Parse(document.Root.element("modified").text().ToString());
XmlMacroReadNodeValueBase(oNode, _T("cp:revision"), revision);
XmlMacroReadNodeValueBase(oNode, _T("dc:subject"), subject);
XmlMacroReadNodeValueBase(oNode, _T("dc:title"), title);
XmlMacroReadNodeValueBase(oNode, _T("cp:version"), title);
}
virtual void write(const OOX::CPath& filename, const OOX::CPath& directory, OOX::CContentTypes& content)const
{
@ -116,7 +115,91 @@ namespace PPTX
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeEnd);
//start new record because new attributes is incompatible with previous versions
pWriter->StartRecord(0);
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeStart);
pWriter->WriteString2(6, category);
pWriter->WriteString2(7, contentStatus);
pWriter->WriteString2(8, description);
pWriter->WriteString2(9, identifier);
pWriter->WriteString2(10, keywords);
pWriter->WriteString2(11, language);
pWriter->WriteString2(12, lastPrinted);
pWriter->WriteString2(13, subject);
pWriter->WriteString2(14, version);
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeEnd);
pWriter->EndRecord();
pWriter->EndRecord();
}
virtual void fromPPTY(NSBinPptxRW::CBinaryFileReader* pReader)
{
LONG _end_rec = pReader->GetPos() + pReader->GetLong() + 4;
pReader->Skip(1); // start attributes
while (true)
{
BYTE _at = pReader->GetUChar_TypeNode();
if (_at == NSBinPptxRW::g_nodeAttributeEnd)
break;
switch (_at)
{
case 0: title = pReader->GetString2(); break;
case 1: creator = pReader->GetString2(); break;
case 2: lastModifiedBy = pReader->GetString2(); break;
case 3: revision = pReader->GetString2(); break;
case 4: created = pReader->GetString2(); break;
case 5: modified = pReader->GetString2(); break;
default: break;
}
}
while (pReader->GetPos() < _end_rec)
{
BYTE _at = pReader->GetUChar();
switch (_at)
{
case 0:
{
LONG _end_rec2 = pReader->GetPos() + pReader->GetLong() + 4;
pReader->Skip(1); // start attributes
while (true)
{
BYTE _at = pReader->GetUChar_TypeNode();
if (_at == NSBinPptxRW::g_nodeAttributeEnd)
break;
switch (_at)
{
case 6: category = pReader->GetString2(); break;
case 7: contentStatus = pReader->GetString2(); break;
case 8: description = pReader->GetString2(); break;
case 9: identifier = pReader->GetString2(); break;
case 10: keywords = pReader->GetString2(); break;
case 11: language = pReader->GetString2(); break;
case 12: lastPrinted = pReader->GetString2(); break;
case 13: subject = pReader->GetString2(); break;
case 14: version = pReader->GetString2(); break;
}
}
pReader->Seek(_end_rec2);
}
break;
default:
{
pReader->SkipRecord();
break;
}
}
}
pReader->Seek(_end_rec);
}
virtual void toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const
{
@ -131,37 +214,44 @@ namespace PPTX
pWriter->EndAttributes();
pWriter->WriteNodeValue(_T("dc:title"), title);
pWriter->WriteNodeValue(_T("dc:creator"), creator);
pWriter->WriteNodeValue(_T("cp:lastModifiedBy"), lastModifiedBy);
pWriter->WriteNodeValue(_T("cp:revision"), revision);
pWriter->WriteNodeValue2(_T("dc:title"), title);
pWriter->WriteNodeValue2(_T("dc:subject"), title);
pWriter->WriteNodeValue2(_T("dc:creator"), creator);
pWriter->WriteNodeValue2(_T("cp:keywords"), keywords);
pWriter->WriteNodeValue2(_T("dc:description"), description);
pWriter->WriteNodeValue2(_T("dc:identifier"), identifier);
pWriter->WriteNodeValue2(_T("dc:language"), language);
pWriter->WriteNodeValue2(_T("cp:lastModifiedBy"), lastModifiedBy);
pWriter->WriteNodeValue2(_T("cp:revision"), revision);
pWriter->WriteNodeValue2(_T("cp:lastPrinted"), lastPrinted);
pWriter->WriteNodeValue2(_T("dcterms:created xsi:type=\"dcterms:W3CDTF\""), created);
pWriter->WriteNodeValue2(_T("dcterms:modified xsi:type=\"dcterms:W3CDTF\""), modified);
pWriter->WriteNodeValue2(_T("cp:category"), revision);
pWriter->WriteNodeValue2(_T("cp:contentStatus"), revision);
pWriter->WriteNodeValue2(_T("cp:version"), revision);
pWriter->WriteNodeValue(_T("dcterms:created xsi:type=\"dcterms:W3CDTF\""), created);
pWriter->WriteNodeValue(_T("dcterms:modified xsi:type=\"dcterms:W3CDTF\""), modified);
pWriter->EndNode(_T("cp:coreProperties"));
}
public:
nullable_string title;
nullable_string creator;
nullable_string lastModifiedBy;
nullable_string revision;
// nullable_property<PPTX::DateTime> created;
nullable_string category;
nullable_string contentStatus;
//nullable_property<std::string, Limit::ContentStatus> contentStatus;
nullable_string created;
// nullable_property<PPTX::DateTime> modified;
//nullable_property<PPTX::DateTime> created;
nullable_string creator;
nullable_string description;
nullable_string identifier;
nullable_string keywords;
nullable_string language;
nullable_string lastModifiedBy;
nullable_string lastPrinted;
nullable_string modified;
/*
nullable_property<std::string> category;
nullable_property<std::string, Limit::ContentStatus> contentStatus;
nullable_property<std::string> description;
//identifier - ???
// nullable_property<std::string> keywords;
nullable_property<std::string> language;
nullable_property<PPTX::DateTime> lastPrinted;
nullable_property<std::string> subject;
nullable_property<std::string> version;
*/
//nullable_property<PPTX::DateTime> modified;
nullable_string revision;
nullable_string subject;
nullable_string title;
nullable_string version;
};
} // namespace PPTX

View File

@ -101,7 +101,11 @@ namespace PPTX
XmlUtils::CNodeValue oValue;
oValue.Write(cNvPr);
oValue.Write(cNvCxnSpPr);
//oValue.Write(nvPr); //todooo ??? 3622708.xlsx
if (m_namespace != L"xdr" && m_namespace != L"cdr")
{
oValue.Write(nvPr);
}
return XmlUtils::CreateNode(m_namespace + L":nvCxnSpPr", oValue);
}
@ -120,7 +124,12 @@ namespace PPTX
cNvPr.toXmlWriter2(namespace_ , pWriter);
cNvCxnSpPr.toXmlWriter(pWriter);
//nvPr.toXmlWriter2(namespace_, pWriter); //todooo ??? 3622708.xlsx
if (pWriter->m_lDocType != XMLWRITER_DOC_TYPE_GRAPHICS &&
pWriter->m_lDocType != XMLWRITER_DOC_TYPE_CHART_DRAWING)
{
nvPr.toXmlWriter2(namespace_, pWriter);
}
pWriter->EndNode(namespace_ + L":nvCxnSpPr");
}

View File

@ -86,7 +86,69 @@ namespace OOX
res->HyperlinksChanged = m_bHyperlinksChanged.get();
if(m_sAppVersion.IsInit())
res->AppVersion = m_sAppVersion.get();
if(m_nCharacters.IsInit())
res->Characters = m_nCharacters.get();
if(m_nCharactersWithSpaces.IsInit())
res->CharactersWithSpaces = m_nCharactersWithSpaces.get();
if(m_nDocSecurity.IsInit())
res->DocSecurity = m_nDocSecurity.get();
if(m_sHyperlinkBase.IsInit())
res->HyperlinkBase = m_sHyperlinkBase.get();
if(m_nLines.IsInit())
res->Lines = m_nLines.get();
if(m_sManager.IsInit())
res->Manager = m_sManager.get();
if(m_nPages.IsInit())
res->Pages = m_nPages.get();
return res;
}
void CApp::FromPptxApp(PPTX::App* pApp)
{
if(pApp->Template.IsInit())
m_sTemplate = pApp->Template.get();
if(pApp->TotalTime.IsInit())
m_nTotalTime = pApp->TotalTime.get();
if(pApp->Words.IsInit())
m_nWords = pApp->Words.get();
if(pApp->Application.IsInit())
m_sApplication = pApp->Application.get();
if(pApp->PresentationFormat.IsInit())
m_sPresentationForm = pApp->PresentationFormat.get();
if(pApp->Paragraphs.IsInit())
m_nParagraphs = pApp->Paragraphs.get();
if(pApp->Slides.IsInit())
m_nSlides = pApp->Slides.get();
if(pApp->Notes.IsInit())
m_nNotes = pApp->Notes.get();
if(pApp->HiddenSlides.IsInit())
m_nHiddenSlides = pApp->HiddenSlides.get();
if(pApp->MMClips.IsInit())
m_nMMClips = pApp->MMClips.get();
if(pApp->ScaleCrop.IsInit())
m_bScaleCrop = pApp->ScaleCrop.get();
if(pApp->Company.IsInit())
m_sCompany = pApp->Company.get();
if(pApp->LinksUpToDate.IsInit())
m_bLinksUpToDate = pApp->LinksUpToDate.get();
if(pApp->SharedDoc.IsInit())
m_bSharedDoc = pApp->SharedDoc.get();
if(pApp->HyperlinksChanged.IsInit())
m_bHyperlinksChanged = pApp->HyperlinksChanged.get();
if(pApp->AppVersion.IsInit())
m_sAppVersion = pApp->AppVersion.get();
if(pApp->Characters.IsInit())
m_nCharacters = pApp->Characters.get();
if(pApp->CharactersWithSpaces.IsInit())
m_nCharactersWithSpaces = pApp->CharactersWithSpaces.get();
if(pApp->DocSecurity.IsInit())
m_nDocSecurity = pApp->DocSecurity.get();
if(pApp->HyperlinkBase.IsInit())
m_sHyperlinkBase = pApp->HyperlinkBase.get();
if(pApp->Lines.IsInit())
m_nLines = pApp->Lines.get();
if(pApp->Manager.IsInit())
m_sManager = pApp->Manager.get();
if(pApp->Pages.IsInit())
m_nPages = pApp->Pages.get();
}
} // namespace OOX

View File

@ -186,11 +186,11 @@ namespace OOX
if ( m_sApplication.IsInit() )
{
sXml += _T("<Application>");
sXml += m_sApplication.get();
sXml += XmlUtils::EncodeXmlString(m_sApplication.get());
if ( m_sAppVersion.IsInit() )
{
sXml += L"/";
sXml += m_sAppVersion.get();
sXml += XmlUtils::EncodeXmlString(m_sAppVersion.get());
}
sXml += _T("</Application>");
}
@ -225,7 +225,7 @@ namespace OOX
if ( m_sCompany.IsInit() )
{
sXml += _T("<Company>");
sXml += m_sCompany.get();
sXml += XmlUtils::EncodeXmlString(m_sCompany.get());
sXml += _T("</Company>");
}
@ -252,7 +252,7 @@ namespace OOX
if ( m_sHyperlinkBase.IsInit() )
{
sXml += _T("<HyperlinkBase>");
sXml += m_sHyperlinkBase.get();
sXml += XmlUtils::EncodeXmlString(m_sHyperlinkBase.get());
sXml += _T("</HyperlinkBase>");
}
@ -289,7 +289,7 @@ namespace OOX
if ( m_sManager.IsInit() )
{
sXml += _T("<Manager>");
sXml += m_sManager.get();
sXml += XmlUtils::EncodeXmlString(m_sManager.get());
sXml += _T("</Manager>");
}
@ -366,7 +366,7 @@ namespace OOX
if ( m_sTemplate.IsInit() )
{
sXml += _T("<Template>");
sXml += m_sTemplate.get();
sXml += XmlUtils::EncodeXmlString(m_sTemplate.get());
sXml += _T("</Template>");
}
@ -410,19 +410,24 @@ namespace OOX
}
void SetDefaults()
{
std::wstring sApplication = NSSystemUtils::GetEnvVariable(NSSystemUtils::gc_EnvApplicationName);
if (sApplication.empty())
sApplication = NSSystemUtils::gc_EnvApplicationNameDefault;
SetApplication(sApplication);
#if defined(INTVER)
SetAppVersion(VALUE2STR(INTVER));
#endif
SetRequiredDefaults();
SetDocSecurity(0);
SetScaleCrop(false);
SetLinksUpToDate(false);
SetSharedDoc(false);
SetHyperlinksChanged(false);
}
void SetRequiredDefaults()
{
m_sAppVersion.reset(NULL);
std::wstring sApplication = NSSystemUtils::GetEnvVariable(NSSystemUtils::gc_EnvApplicationName);
if (sApplication.empty())
sApplication = NSSystemUtils::gc_EnvApplicationNameDefault;
SetApplication(sApplication);
#if defined(INTVER)
SetAppVersion(VALUE2STR(INTVER));
#endif
}
void SetApplication(const std::wstring& sVal)
{
m_sApplication = sVal;
@ -460,6 +465,7 @@ namespace OOX
m_bHyperlinksChanged = bVal;
}
PPTX::App* ToPptxApp();
void FromPptxApp(PPTX::App* pApp);
// TO DO: DigSig
// HeadingPairs

View File

@ -55,18 +55,69 @@ namespace OOX
PPTX::Core* CCore::ToPptxCore()
{
PPTX::Core* res = new PPTX::Core(NULL);
if (m_sTitle.IsInit())
res->title = m_sTitle.get();
if (m_sCreator.IsInit())
res->creator = m_sCreator.get();
if (m_sLastModifiedBy.IsInit())
res->lastModifiedBy = m_sLastModifiedBy.get();
if (m_sRevision.IsInit())
res->revision = m_sRevision.get();
if (m_sCategory.IsInit())
res->category = m_sCategory.get();
if (m_sContentStatus.IsInit())
res->contentStatus = m_sContentStatus.get();
if (m_sCreated.IsInit())
res->created = m_sCreated.get();
if (m_sCreator.IsInit())
res->creator = m_sCreator.get();
if (m_sDescription.IsInit())
res->description = m_sDescription.get();
if (m_sIdentifier.IsInit())
res->identifier = m_sIdentifier.get();
if (m_sKeywords.IsInit())
res->keywords = m_sKeywords.get();
if (m_sLanguage.IsInit())
res->language = m_sLanguage.get();
if (m_sLastModifiedBy.IsInit())
res->lastModifiedBy = m_sLastModifiedBy.get();
if (m_sLastPrinted.IsInit())
res->lastPrinted = m_sLastPrinted.get();
if (m_sModified.IsInit())
res->modified = m_sModified.get();
if (m_sRevision.IsInit())
res->revision = m_sRevision.get();
if (m_sSubject.IsInit())
res->subject = m_sSubject.get();
if (m_sTitle.IsInit())
res->title = m_sTitle.get();
if (m_sVersion.IsInit())
res->version = m_sVersion.get();
return res;
}
void CCore::FromPptxCore(PPTX::Core* pCore)
{
if(pCore->category.IsInit())
m_sCategory = pCore->category.get();
if(pCore->contentStatus.IsInit())
m_sContentStatus = pCore->contentStatus.get();
if(pCore->created.IsInit())
m_sCreated = pCore->created.get();
if(pCore->creator.IsInit())
m_sCreator = pCore->creator.get();
if(pCore->description.IsInit())
m_sDescription = pCore->description.get();
if(pCore->identifier.IsInit())
m_sIdentifier = pCore->identifier.get();
if(pCore->keywords.IsInit())
m_sKeywords = pCore->keywords.get();
if(pCore->language.IsInit())
m_sLanguage = pCore->language.get();
if(pCore->lastModifiedBy.IsInit())
m_sLastModifiedBy = pCore->lastModifiedBy.get();
if(pCore->lastPrinted.IsInit())
m_sLastPrinted = pCore->lastPrinted.get();
if(pCore->modified.IsInit())
m_sModified = pCore->modified.get();
if(pCore->revision.IsInit())
m_sRevision = pCore->revision.get();
if(pCore->subject.IsInit())
m_sSubject = pCore->subject.get();
if(pCore->title.IsInit())
m_sTitle = pCore->title.get();
if(pCore->version.IsInit())
m_sVersion = pCore->version.get();
}
} // namespace OOX

View File

@ -36,6 +36,7 @@
#include "Docx.h"
#include "File.h"
#include "../Base/Nullable.h"
#include "../../../../DesktopEditor/common/SystemUtils.h"
namespace PPTX
{
@ -111,111 +112,96 @@ namespace OOX
std::wstring sXml;
sXml = _T("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><cp:coreProperties xmlns:cp=\"http://schemas.openxmlformats.org/package/2006/metadata/core-properties\" xmlns:dc=\"http://purl.org/dc/elements/1.1/\" xmlns:dcterms=\"http://purl.org/dc/terms/\" xmlns:dcmitype=\"http://purl.org/dc/dcmitype/\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">");
if ( m_sCategory.IsInit() )
{
sXml += _T("<cp:category>");
sXml += m_sCategory.get();
sXml += _T("</cp:category>");
}
if ( m_sContentStatus.IsInit() )
{
sXml += _T("<cp:contentStatus>");
sXml += m_sContentStatus.get();
sXml += _T("</cp:contentStatus>");
}
if ( m_sCreated.IsInit() )
{
sXml += _T("<dcterms:created xsi:type=\"dcterms:W3CDTF\">");
sXml += m_sCreated.get();
sXml += _T("</dcterms:created>");
}
if ( m_sCreator.IsInit() )
{
sXml += _T("<dc:creator>");
sXml += m_sCreator.get();
sXml += _T("</dc:creator>");
}
if ( m_sDescription.IsInit() )
{
sXml += _T("<dc:description>");
sXml += m_sDescription.get();
sXml += _T("</dc:description>");
}
if ( m_sIdentifier.IsInit() )
{
sXml += _T("<dc:identifier>");
sXml += m_sIdentifier.get();
sXml += _T("</dc:identifier>");
}
if ( m_sKeywords.IsInit() )
{
sXml += _T("<cp:keywords>");
sXml += m_sKeywords.get();
sXml += _T("</cp:keywords>");
}
if ( m_sLanguage.IsInit() )
{
sXml += _T("<dc:language>");
sXml += m_sLanguage.get();
sXml += _T("</dc:language>");
}
if ( m_sLastModifiedBy.IsInit() )
{
sXml += _T("<cp:lastModifiedBy>");
sXml += m_sLastModifiedBy.get();
sXml += _T("</cp:lastModifiedBy>");
}
if ( m_sLastPrinted.IsInit() )
{
sXml += _T("<cp:lastPrinted>");
sXml += m_sLastPrinted.get();
sXml += _T("</cp:lastPrinted>");
}
if ( m_sModified.IsInit() )
{
sXml += _T("<dcterms:modified xsi:type=\"dcterms:W3CDTF\">");
sXml += m_sModified.get();
sXml += _T("</dcterms:modified>");
}
if ( m_sRevision.IsInit() )
{
sXml += _T("<cp:revision>");
sXml += m_sRevision.get();
sXml += _T("</cp:revision>");
}
if ( m_sSubject.IsInit() )
{
sXml += _T("<dc:subject>");
sXml += m_sSubject.get();
sXml += _T("</dc:subject>");
}
if ( m_sTitle.IsInit() )
{
sXml += _T("<dc:title>");
sXml += m_sTitle.get();
sXml += XmlUtils::EncodeXmlString(m_sTitle.get());
sXml += _T("</dc:title>");
}
if ( m_sSubject.IsInit() )
{
sXml += _T("<dc:subject>");
sXml += XmlUtils::EncodeXmlString(m_sSubject.get());
sXml += _T("</dc:subject>");
}
if ( m_sCreator.IsInit() )
{
sXml += _T("<dc:creator>");
sXml += XmlUtils::EncodeXmlString(m_sCreator.get());
sXml += _T("</dc:creator>");
}
if ( m_sKeywords.IsInit() )
{
sXml += _T("<cp:keywords>");
sXml += XmlUtils::EncodeXmlString(m_sKeywords.get());
sXml += _T("</cp:keywords>");
}
if ( m_sDescription.IsInit() )
{
sXml += _T("<dc:description>");
sXml += XmlUtils::EncodeXmlString(m_sDescription.get());
sXml += _T("</dc:description>");
}
if ( m_sIdentifier.IsInit() )
{
sXml += _T("<dc:identifier>");
sXml += XmlUtils::EncodeXmlString(m_sIdentifier.get());
sXml += _T("</dc:identifier>");
}
if ( m_sLanguage.IsInit() )
{
sXml += _T("<dc:language>");
sXml += XmlUtils::EncodeXmlString(m_sLanguage.get());
sXml += _T("</dc:language>");
}
if ( m_sLastModifiedBy.IsInit() )
{
sXml += _T("<cp:lastModifiedBy>");
sXml += XmlUtils::EncodeXmlString(m_sLastModifiedBy.get());
sXml += _T("</cp:lastModifiedBy>");
}
if ( m_sRevision.IsInit() )
{
sXml += _T("<cp:revision>");
sXml += XmlUtils::EncodeXmlString(m_sRevision.get());
sXml += _T("</cp:revision>");
}
if ( m_sLastPrinted.IsInit() )
{
sXml += _T("<cp:lastPrinted>");
sXml += XmlUtils::EncodeXmlString(m_sLastPrinted.get());
sXml += _T("</cp:lastPrinted>");
}
if ( m_sCreated.IsInit() )
{
sXml += _T("<dcterms:created xsi:type=\"dcterms:W3CDTF\">");
sXml += XmlUtils::EncodeXmlString(m_sCreated.get());
sXml += _T("</dcterms:created>");
}
if ( m_sModified.IsInit() )
{
sXml += _T("<dcterms:modified xsi:type=\"dcterms:W3CDTF\">");
sXml += XmlUtils::EncodeXmlString(m_sModified.get());
sXml += _T("</dcterms:modified>");
}
if ( m_sCategory.IsInit() )
{
sXml += _T("<cp:category>");
sXml += XmlUtils::EncodeXmlString(m_sCategory.get());
sXml += _T("</cp:category>");
}
if ( m_sContentStatus.IsInit() )
{
sXml += _T("<cp:contentStatus>");
sXml += XmlUtils::EncodeXmlString(m_sContentStatus.get());
sXml += _T("</cp:contentStatus>");
}
if ( m_sVersion.IsInit() )
{
sXml += _T("<cp:version>");
sXml += m_sVersion.get();
sXml += XmlUtils::EncodeXmlString(m_sVersion.get());
sXml += _T("</cp:version>");
}
sXml += _T("</cp:coreProperties>");
NSFile::CFileBinary::SaveToFile( oPath.GetPath(), sXml );
@ -240,6 +226,15 @@ namespace OOX
m_sCreator = L"";
m_sLastModifiedBy = L"";
}
void SetRequiredDefaults()
{
std::wstring sCreator = NSSystemUtils::GetEnvVariable(NSSystemUtils::gc_EnvCreator);
if (!sCreator.empty())
m_sCreator = sCreator;
std::wstring sLastModifiedBy = NSSystemUtils::GetEnvVariable(NSSystemUtils::gc_EnvLastModifiedBy);
if (!sLastModifiedBy.empty())
m_sLastModifiedBy = sLastModifiedBy;
}
void SetCreator(std::wstring sVal)
{
m_sCreator = sVal;
@ -249,6 +244,7 @@ namespace OOX
m_sLastModifiedBy = sVal;
}
PPTX::Core* ToPptxCore();
void FromPptxCore(PPTX::Core* pCore);
nullable<std::wstring> m_sCategory;
nullable<std::wstring> m_sContentStatus;

View File

@ -123,30 +123,22 @@ bool OOX::Spreadsheet::CXlsx::Write(const CPath& oDirPath, OOX::CContentTypes &o
return false;
//CApp
OOX::CApp* pApp = new OOX::CApp(this);
if(NULL == m_pApp)
{
OOX::CApp* pApp = new OOX::CApp(this);
pApp->SetDefaults();
smart_ptr<OOX::File> pAppFile(pApp);
Add(pAppFile);
}
std::wstring sApplication = NSSystemUtils::GetEnvVariable(NSSystemUtils::gc_EnvApplicationName);
if (sApplication.empty())
sApplication = NSSystemUtils::gc_EnvApplicationNameDefault;
pApp->SetApplication(sApplication);
#if defined(INTVER)
pApp->SetAppVersion(VALUE2STR(INTVER));
#endif
pApp->SetDocSecurity(0);
pApp->SetScaleCrop(false);
pApp->SetLinksUpToDate(false);
pApp->SetSharedDoc(false);
pApp->SetHyperlinksChanged(false);
smart_ptr<OOX::File> pAppFile(pApp);
const OOX::RId oAppRId = Add(pAppFile);
//CCore
OOX::CCore* pCore = new OOX::CCore(this);
pCore->SetCreator(_T(""));
pCore->SetLastModifiedBy(_T(""));
smart_ptr<OOX::File> pCoreFile(pCore);
const OOX::RId oCoreRId = Add(pCoreFile);
if(NULL == m_pCore)
{
OOX::CCore* pCore = new OOX::CCore(this);
pCore->SetDefaults();
smart_ptr<OOX::File> pCoreFile(pCore);
Add(pCoreFile);
}
//xl
CPath oXlPath = oDirPath / m_pWorkbook->DefaultDirectory();

View File

@ -43,6 +43,8 @@ namespace NSSystemUtils
static const wchar_t* gc_EnvCompanyNameDefault = L"Ascensio System SIA Copyright (c) 2018";
static const wchar_t* gc_EnvMethodEncrypt = L"METHOD_CRYPT";
static const wchar_t* gc_EnvMethodEncryptDefault = L"Strong";
static const wchar_t* gc_EnvCreator = L"CREATOR";
static const wchar_t* gc_EnvLastModifiedBy = L"LAST_MODIFIED_BY";
KERNEL_DECL std::wstring GetEnvVariable(const std::wstring& strName);
}

View File

@ -50,6 +50,8 @@
#include "../../ASCOfficePPTXFile/PPTXFormat/Theme.h"
#include "../../ASCOfficePPTXFile/Editor/Drawing/Shapes/BaseShape/Common.h"
#include "../../ASCOfficePPTXFile/PPTXFormat/App.h"
#include "../../ASCOfficePPTXFile/PPTXFormat/Core.h"
#include "../../Common/DocxFormat/Source/XlsxFormat/Workbook/Workbook.h"
#include "../../Common/DocxFormat/Source/XlsxFormat/Worksheets/Worksheet.h"
@ -69,6 +71,8 @@
#include "../../Common/DocxFormat/Source/DocxFormat/Media/VbaProject.h"
#include "../../Common/DocxFormat/Source/DocxFormat/Media/JsaProject.h"
#include "../../Common/DocxFormat/Source/DocxFormat/VmlDrawing.h"
#include "../../Common/DocxFormat/Source/DocxFormat/App.h"
#include "../../Common/DocxFormat/Source/DocxFormat/Core.h"
namespace BinXlsxRW
{
@ -5063,6 +5067,32 @@ namespace BinXlsxRW
oBufferedStream.Seek(mtiOffBits);
switch(mtiType)
{
case c_oSerTableTypes::App:
{
PPTX::App oApp(NULL);
oBufferedStream.Skip(1); // type
oApp.fromPPTY(&oBufferedStream);
OOX::CApp* pApp = new OOX::CApp(NULL);
pApp->FromPptxApp(&oApp);
pApp->SetRequiredDefaults();
oXlsx.m_pApp = pApp;
smart_ptr<OOX::File> oCurFile(pApp);
oXlsx.Add(oCurFile);
}
break;
case c_oSerTableTypes::Core:
{
PPTX::Core oCore(NULL);
oBufferedStream.Skip(1); // type
oCore.fromPPTY(&oBufferedStream);
OOX::CCore* pCore = new OOX::CCore(NULL);
pCore->FromPptxCore(&oCore);
pCore->SetRequiredDefaults();
oXlsx.m_pCore = pCore;
smart_ptr<OOX::File> oCurFile(pCore);
oXlsx.Add(oCurFile);
}
break;
case c_oSerTableTypes::Styles:
{
oXlsx.CreateStyles();