mirror of
https://github.com/ONLYOFFICE/core.git
synced 2026-04-07 13:55:33 +08:00
Compare commits
21 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 3a97757b86 | |||
| 14c517eaf5 | |||
| 110cee404a | |||
| d294c98f9e | |||
| bf804905c7 | |||
| a2f6876f60 | |||
| 5b53f2395f | |||
| 8382ba6fee | |||
| a6bd2e1a74 | |||
| ae20888616 | |||
| ad29f72359 | |||
| 0c1185c9d6 | |||
| e1a08edb99 | |||
| 54f3716ce6 | |||
| 6bafc487d4 | |||
| b2be8e63b6 | |||
| e37ef6b999 | |||
| 571bad5381 | |||
| 2fea55841a | |||
| c7e73feb0f | |||
| 64453f020c |
@ -332,18 +332,6 @@ template<typename T> int Binary_CommonReader2::ReadTrackRevisionInner(BYTE type,
|
||||
res = c_oSerConstants::ReadUnknown;
|
||||
return res;
|
||||
}
|
||||
|
||||
Binary_VbaProjectTableReader::Binary_VbaProjectTableReader (NSBinPptxRW::CBinaryFileReader& poBufferedStream, Writers::FileWriter& oFileWriter)
|
||||
: Binary_CommonReader(poBufferedStream), m_oFileWriter(oFileWriter)
|
||||
{
|
||||
}
|
||||
int Binary_VbaProjectTableReader::Read()
|
||||
{
|
||||
m_oFileWriter.m_pVbaProject = new OOX::VbaProject(NULL);
|
||||
m_oFileWriter.m_pVbaProject->fromPPTY(&m_oBufferedStream);
|
||||
|
||||
return c_oSerConstants::ReadOk;
|
||||
}
|
||||
Binary_HdrFtrTableReader::Binary_HdrFtrTableReader(NSBinPptxRW::CBinaryFileReader& poBufferedStream, Writers::FileWriter& oFileWriter, CComments* pComments)
|
||||
:
|
||||
Binary_CommonReader(poBufferedStream),
|
||||
@ -9149,6 +9137,11 @@ int Binary_DocumentTableReader::ReadSdtPr(BYTE type, long length, void* poResult
|
||||
pSdtPr->m_oTextFormPr.Init();
|
||||
READ1_DEF(length, res, this->ReadSdtTextFormPr, pSdtPr->m_oTextFormPr.GetPointer());
|
||||
}
|
||||
else if (c_oSerSdt::PictureFormPr == type)
|
||||
{
|
||||
pSdtPr->m_oPicture.Init();
|
||||
READ1_DEF(length, res, this->ReadSdtPicture, pSdtPr->m_oPicture.GetPointer());
|
||||
}
|
||||
else
|
||||
res = c_oSerConstants::ReadUnknown;
|
||||
return res;
|
||||
@ -9334,6 +9327,35 @@ int Binary_DocumentTableReader::ReadDropDownList(BYTE type, long length, void* p
|
||||
res = c_oSerConstants::ReadUnknown;
|
||||
return res;
|
||||
}
|
||||
int Binary_DocumentTableReader::ReadSdtPicture(BYTE type, long length, void* poResult)
|
||||
{
|
||||
OOX::Logic::CSdtPicture* pPicture = static_cast<OOX::Logic::CSdtPicture*>(poResult);
|
||||
|
||||
int res = 0;
|
||||
if (c_oSerSdt::PictureFormPrScaleFlag == type)
|
||||
{
|
||||
pPicture->m_oScaleFlag = m_oBufferedStream.GetLong();
|
||||
}
|
||||
else if (c_oSerSdt::PictureFormPrLockProportions == type)
|
||||
{
|
||||
pPicture->m_oLockProportions = m_oBufferedStream.GetBool();
|
||||
}
|
||||
else if (c_oSerSdt::PictureFormPrRespectBorders == type)
|
||||
{
|
||||
pPicture->m_oRespectBorders = m_oBufferedStream.GetBool();
|
||||
}
|
||||
else if (c_oSerSdt::PictureFormPrShiftX == type)
|
||||
{
|
||||
pPicture->m_oShiftX = m_oBufferedStream.GetDoubleReal();
|
||||
}
|
||||
else if (c_oSerSdt::PictureFormPrShiftY == type)
|
||||
{
|
||||
pPicture->m_oShiftY = m_oBufferedStream.GetDoubleReal();
|
||||
}
|
||||
else
|
||||
res = c_oSerConstants::ReadUnknown;
|
||||
return res;
|
||||
}
|
||||
int Binary_DocumentTableReader::ReadSdtFormPr(BYTE type, long length, void* poResult)
|
||||
{
|
||||
int res = 0;
|
||||
@ -9377,6 +9399,14 @@ int Binary_DocumentTableReader::ReadSdtTextFormPr(BYTE type, long length, void*
|
||||
pTextFormPr->m_oCombBorder.Init();
|
||||
READ2_DEF(length, res, oBinary_pPrReader.ReadBorder2, pTextFormPr->m_oCombBorder.GetPointer());
|
||||
}
|
||||
else if (c_oSerSdt::TextFormPrAutoFit == type)
|
||||
{
|
||||
pTextFormPr->m_oAutoFit = m_oBufferedStream.GetBool();
|
||||
}
|
||||
else if (c_oSerSdt::TextFormPrMultiLine == type)
|
||||
{
|
||||
pTextFormPr->m_oMultiLine = m_oBufferedStream.GetBool();
|
||||
}
|
||||
else
|
||||
res = c_oSerConstants::ReadUnknown;
|
||||
return res;
|
||||
@ -9513,8 +9543,12 @@ int Binary_NotesTableReader::ReadNoteContent(BYTE type, long length, void* poRes
|
||||
};
|
||||
|
||||
|
||||
BinaryFileReader::BinaryFileReader(std::wstring& sFileInDir, NSBinPptxRW::CBinaryFileReader& oBufferedStream, Writers::FileWriter& oFileWriter) :
|
||||
m_sFileInDir(sFileInDir), m_oBufferedStream(oBufferedStream), m_oFileWriter(oFileWriter)
|
||||
BinaryFileReader::BinaryFileReader(std::wstring& sFileInDir, NSBinPptxRW::CBinaryFileReader& oBufferedStream, Writers::FileWriter& oFileWriter, bool bMacro)
|
||||
:
|
||||
m_sFileInDir(sFileInDir),
|
||||
m_oBufferedStream(oBufferedStream),
|
||||
m_oFileWriter(oFileWriter),
|
||||
m_bMacro(bMacro)
|
||||
{
|
||||
}
|
||||
int BinaryFileReader::ReadFile()
|
||||
@ -9713,7 +9747,14 @@ int BinaryFileReader::ReadMainTable()
|
||||
}break;
|
||||
case c_oSerTableTypes::VbaProject:
|
||||
{
|
||||
res = Binary_VbaProjectTableReader(m_oBufferedStream, m_oFileWriter).Read();
|
||||
m_oBufferedStream.Skip(1); //skip type
|
||||
if (m_bMacro)
|
||||
{
|
||||
m_oFileWriter.m_pVbaProject = new OOX::VbaProject(NULL);
|
||||
m_oFileWriter.m_pVbaProject->fromPPTY(&m_oBufferedStream);
|
||||
}
|
||||
else
|
||||
m_oBufferedStream.SkipRecord();
|
||||
}break;
|
||||
case c_oSerTableTypes::Glossary:
|
||||
{
|
||||
|
||||
@ -64,16 +64,6 @@ public:
|
||||
private:
|
||||
template<typename T> int ReadTrackRevisionInner(BYTE type, long length, T* poResult);
|
||||
};
|
||||
class Binary_VbaProjectTableReader : public Binary_CommonReader
|
||||
{
|
||||
Writers::FileWriter& m_oFileWriter;
|
||||
|
||||
public:
|
||||
|
||||
Binary_VbaProjectTableReader (NSBinPptxRW::CBinaryFileReader& poBufferedStream, Writers::FileWriter& oFileWriter);
|
||||
int Read ();
|
||||
};
|
||||
|
||||
class Binary_HdrFtrTableReader : public Binary_CommonReader
|
||||
{
|
||||
Writers::FileWriter& m_oFileWriter;
|
||||
@ -485,6 +475,7 @@ public:
|
||||
int ReadSdtFormPr(BYTE type, long length, void* poResult);
|
||||
int ReadSdtTextFormPr(BYTE type, long length, void* poResult);
|
||||
int ReadSdtTextFormPrComb(BYTE type, long length, void* poResult);
|
||||
int ReadSdtPicture(BYTE type, long length, void* poResult);
|
||||
};
|
||||
class Binary_NotesTableReader : public Binary_CommonReader
|
||||
{
|
||||
@ -506,8 +497,9 @@ private:
|
||||
NSBinPptxRW::CBinaryFileReader& m_oBufferedStream;
|
||||
Writers::FileWriter& m_oFileWriter;
|
||||
std::wstring m_sFileInDir;
|
||||
bool m_bMacro;
|
||||
public:
|
||||
BinaryFileReader(std::wstring& sFileInDir, NSBinPptxRW::CBinaryFileReader& oBufferedStream, Writers::FileWriter& oFileWriter);
|
||||
BinaryFileReader(std::wstring& sFileInDir, NSBinPptxRW::CBinaryFileReader& oBufferedStream, Writers::FileWriter& oFileWriter, bool bMacro = false);
|
||||
int ReadFile();
|
||||
int ReadMainTable();
|
||||
};
|
||||
|
||||
@ -1233,7 +1233,15 @@ extern int g_nCurFormatVersion;
|
||||
TextFormPrCombSym = 53,
|
||||
TextFormPrCombFont = 54,
|
||||
TextFormPrMaxCharacters = 55,
|
||||
TextFormPrCombBorder = 56
|
||||
TextFormPrCombBorder = 56,
|
||||
TextFormPrAutoFit = 57,
|
||||
TextFormPrMultiLine = 58,
|
||||
PictureFormPr = 60,
|
||||
PictureFormPrScaleFlag = 61,
|
||||
PictureFormPrLockProportions = 62,
|
||||
PictureFormPrRespectBorders = 63,
|
||||
PictureFormPrShiftX = 64,
|
||||
PictureFormPrShiftY = 65
|
||||
};}
|
||||
namespace c_oSerFFData{enum c_oSerFFData
|
||||
{
|
||||
|
||||
@ -3090,13 +3090,6 @@ BinaryDocumentTableWriter::BinaryDocumentTableWriter(ParamsWriter& oParamsWriter
|
||||
pJsaProject = NULL;
|
||||
m_bWriteSectPr = false;
|
||||
}
|
||||
void BinaryDocumentTableWriter::WriteVbaProject(OOX::VbaProject& oVbaProject)
|
||||
{
|
||||
m_oBcw.m_oStream.StartRecord(0);
|
||||
oVbaProject.toPPTY(&m_oBcw.m_oStream);
|
||||
m_oBcw.m_oStream.EndRecord();
|
||||
|
||||
}
|
||||
void BinaryDocumentTableWriter::Write(OOX::Logic::CDocPartPr* pDocPartPr)
|
||||
{
|
||||
if (!pDocPartPr) return;
|
||||
@ -7637,6 +7630,46 @@ void BinaryDocumentTableWriter::WriteSdtPr(const OOX::Logic::CSdtPr& oStdPr)
|
||||
WriteSdtTextFormPr(oStdPr.m_oTextFormPr.get());
|
||||
m_oBcw.WriteItemEnd(nCurPos);
|
||||
}
|
||||
if (oStdPr.m_oPicture.IsInit())
|
||||
{
|
||||
nCurPos = m_oBcw.WriteItemStart(c_oSerSdt::PictureFormPr);
|
||||
WriteSdtPicture(oStdPr.m_oPicture.get());
|
||||
m_oBcw.WriteItemEnd(nCurPos);
|
||||
}
|
||||
}
|
||||
void BinaryDocumentTableWriter::WriteSdtPicture(const OOX::Logic::CSdtPicture& oSdtPicture)
|
||||
{
|
||||
int nCurPos = 0;
|
||||
if (oSdtPicture.m_oScaleFlag.IsInit())
|
||||
{
|
||||
nCurPos = m_oBcw.WriteItemStart(c_oSerSdt::PictureFormPrScaleFlag);
|
||||
m_oBcw.m_oStream.WriteLONG(*oSdtPicture.m_oScaleFlag);
|
||||
m_oBcw.WriteItemEnd(nCurPos);
|
||||
}
|
||||
if (oSdtPicture.m_oLockProportions.IsInit())
|
||||
{
|
||||
nCurPos = m_oBcw.WriteItemStart(c_oSerSdt::PictureFormPrLockProportions);
|
||||
m_oBcw.m_oStream.WriteBOOL(*oSdtPicture.m_oLockProportions);
|
||||
m_oBcw.WriteItemEnd(nCurPos);
|
||||
}
|
||||
if (oSdtPicture.m_oRespectBorders.IsInit())
|
||||
{
|
||||
nCurPos = m_oBcw.WriteItemStart(c_oSerSdt::PictureFormPrRespectBorders);
|
||||
m_oBcw.m_oStream.WriteBOOL(*oSdtPicture.m_oRespectBorders);
|
||||
m_oBcw.WriteItemEnd(nCurPos);
|
||||
}
|
||||
if (oSdtPicture.m_oShiftX.IsInit())
|
||||
{
|
||||
nCurPos = m_oBcw.WriteItemStart(c_oSerSdt::PictureFormPrShiftX);
|
||||
m_oBcw.m_oStream.WriteDoubleReal(*oSdtPicture.m_oShiftX);
|
||||
m_oBcw.WriteItemEnd(nCurPos);
|
||||
}
|
||||
if (oSdtPicture.m_oShiftY.IsInit())
|
||||
{
|
||||
nCurPos = m_oBcw.WriteItemStart(c_oSerSdt::PictureFormPrShiftY);
|
||||
m_oBcw.m_oStream.WriteDoubleReal(*oSdtPicture.m_oShiftY);
|
||||
m_oBcw.WriteItemEnd(nCurPos);
|
||||
}
|
||||
}
|
||||
void BinaryDocumentTableWriter::WriteSdtCheckBox(const OOX::Logic::CSdtCheckBox& oSdtCheckBox)
|
||||
{
|
||||
@ -7859,6 +7892,18 @@ void BinaryDocumentTableWriter::WriteSdtTextFormPr(const OOX::Logic::CTextFormPr
|
||||
m_oBcw.WriteBorder(oTextFormPr.m_oCombBorder.get());
|
||||
m_oBcw.WriteItemEnd(nCurPos);
|
||||
}
|
||||
if (oTextFormPr.m_oAutoFit.IsInit())
|
||||
{
|
||||
nCurPos = m_oBcw.WriteItemStart(c_oSerSdt::TextFormPrAutoFit);
|
||||
m_oBcw.m_oStream.WriteBOOL(oTextFormPr.m_oAutoFit.get());
|
||||
m_oBcw.WriteItemEnd(nCurPos);
|
||||
}
|
||||
if (oTextFormPr.m_oMultiLine.IsInit())
|
||||
{
|
||||
nCurPos = m_oBcw.WriteItemStart(c_oSerSdt::TextFormPrMultiLine);
|
||||
m_oBcw.m_oStream.WriteBOOL(oTextFormPr.m_oMultiLine.get());
|
||||
m_oBcw.WriteItemEnd(nCurPos);
|
||||
}
|
||||
}
|
||||
void BinaryDocumentTableWriter::WriteSdtTextFormPrComb(const ComplexTypes::Word::CComb& oComb)
|
||||
{
|
||||
@ -9076,7 +9121,11 @@ void BinaryFileWriter::intoBindoc(const std::wstring& sDir)
|
||||
if ((pDocx) && (pDocx->m_pVbaProject))
|
||||
{
|
||||
nCurPos = this->WriteTableStart(BinDocxRW::c_oSerTableTypes::VbaProject);
|
||||
oBinaryDocumentTableWriter.WriteVbaProject(*pDocx->m_pVbaProject);
|
||||
|
||||
m_oBcw.m_oStream.StartRecord(0);
|
||||
pDocx->m_pVbaProject->toPPTY(&m_oBcw.m_oStream);
|
||||
m_oBcw.m_oStream.EndRecord();
|
||||
|
||||
this->WriteTableEnd(nCurPos);
|
||||
}
|
||||
}
|
||||
|
||||
@ -88,8 +88,12 @@ namespace BinDocxRW
|
||||
OOX::IFileContainer* m_pCurRels;
|
||||
std::map<int, bool> m_mapIgnoreComments;
|
||||
|
||||
ParamsWriter(NSBinPptxRW::CBinaryFileWriter* pCBufferedStream, DocWrapper::FontProcessor* pFontProcessor, NSBinPptxRW::CDrawingConverter* pOfficeDrawingConverter, NSFontCutter::CEmbeddedFontsManager* pEmbeddedFontsManager):
|
||||
m_pCBufferedStream(pCBufferedStream), m_pFontProcessor(pFontProcessor), m_pOfficeDrawingConverter(pOfficeDrawingConverter), m_pEmbeddedFontsManager(pEmbeddedFontsManager)
|
||||
ParamsWriter(NSBinPptxRW::CBinaryFileWriter* pCBufferedStream, DocWrapper::FontProcessor* pFontProcessor, NSBinPptxRW::CDrawingConverter* pOfficeDrawingConverter, NSFontCutter::CEmbeddedFontsManager* pEmbeddedFontsManager)
|
||||
:
|
||||
m_pCBufferedStream(pCBufferedStream),
|
||||
m_pFontProcessor(pFontProcessor),
|
||||
m_pOfficeDrawingConverter(pOfficeDrawingConverter),
|
||||
m_pEmbeddedFontsManager(pEmbeddedFontsManager)
|
||||
{
|
||||
m_pMain = NULL;
|
||||
m_pSettings = NULL;
|
||||
@ -331,7 +335,6 @@ namespace BinDocxRW
|
||||
|
||||
void WriteAltChunk(OOX::Media& oAltChunk, OOX::CStyles* styles);
|
||||
|
||||
void WriteVbaProject(OOX::VbaProject& oVbaProject);
|
||||
void Write(std::vector<OOX::WritingElement*> & aElems);
|
||||
void WriteDocumentContent(const std::vector<OOX::WritingElement*> & aElems);
|
||||
void WriteBackground (OOX::WritingElement* pBackground);
|
||||
@ -498,6 +501,7 @@ namespace BinDocxRW
|
||||
void WriteSdtFormPr(const ComplexTypes::Word::CFormPr& oFormPr);
|
||||
void WriteSdtTextFormPr(const OOX::Logic::CTextFormPr& oTextFormPr);
|
||||
void WriteSdtTextFormPrComb(const ComplexTypes::Word::CComb& oComb);
|
||||
void WriteSdtPicture(const OOX::Logic::CSdtPicture& oSdtPicture);
|
||||
};
|
||||
class BinaryCustomsTableWriter
|
||||
{
|
||||
|
||||
@ -175,13 +175,10 @@ namespace BinDocxRW
|
||||
};
|
||||
}
|
||||
|
||||
BinDocxRW::CDocxSerializer::CDocxSerializer()
|
||||
BinDocxRW::CDocxSerializer::CDocxSerializer() : m_bIsMacro(false), m_bIsNoBase64Save(false), m_bIsNoBase64(false)
|
||||
{
|
||||
m_pParamsWriter = NULL;
|
||||
m_pCurFileWriter = NULL;
|
||||
|
||||
m_bIsNoBase64Save = false;
|
||||
m_bIsNoBase64 = false;
|
||||
}
|
||||
BinDocxRW::CDocxSerializer::~CDocxSerializer()
|
||||
{
|
||||
@ -414,7 +411,7 @@ bool BinDocxRW::CDocxSerializer::loadFromFile(const std::wstring& sSrcFileName,
|
||||
|
||||
oDrawingConverter.SetSrcPath(sFileInDir);
|
||||
|
||||
BinaryFileReader oBinaryFileReader(sFileInDir, oBufferedStream, *m_pCurFileWriter);
|
||||
BinaryFileReader oBinaryFileReader(sFileInDir, oBufferedStream, *m_pCurFileWriter, m_bIsMacro);
|
||||
oBinaryFileReader.ReadFile();
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
//themes
|
||||
@ -591,13 +588,17 @@ void BinDocxRW::CDocxSerializer::setEmbeddedFontsDir(const std::wstring& sEmbedd
|
||||
{
|
||||
m_sEmbeddedFontsDir = sEmbeddedFontsDir;
|
||||
}
|
||||
void BinDocxRW::CDocxSerializer::setIsNoBase64Save(bool bIsNoBase64Save)
|
||||
void BinDocxRW::CDocxSerializer::setIsNoBase64Save(bool val)
|
||||
{
|
||||
m_bIsNoBase64Save = bIsNoBase64Save;
|
||||
m_bIsNoBase64Save = val;
|
||||
}
|
||||
void BinDocxRW::CDocxSerializer::setIsNoBase64(bool bIsNoBase64)
|
||||
void BinDocxRW::CDocxSerializer::setIsNoBase64(bool val)
|
||||
{
|
||||
m_bIsNoBase64 = bIsNoBase64;
|
||||
m_bIsNoBase64 = val;
|
||||
}
|
||||
void BinDocxRW::CDocxSerializer::setMacroEnabled(bool val)
|
||||
{
|
||||
m_bIsMacro = val;
|
||||
}
|
||||
bool BinDocxRW::CDocxSerializer::unpackageFile(const std::wstring& sSrcFileName, const std::wstring& sDstPath)
|
||||
{
|
||||
|
||||
@ -49,14 +49,16 @@ namespace BinDocxRW
|
||||
|
||||
class CDocxSerializer
|
||||
{
|
||||
public:
|
||||
private:
|
||||
std::wstring m_sFontDir;
|
||||
std::wstring m_sEmbeddedFontsDir;
|
||||
bool m_bIsMacro;
|
||||
bool m_bIsNoBase64Save;
|
||||
bool m_bIsNoBase64;
|
||||
ParamsWriter* m_pParamsWriter;
|
||||
public:
|
||||
Writers::FileWriter* m_pCurFileWriter;
|
||||
|
||||
ParamsWriter* m_pParamsWriter;
|
||||
|
||||
CDocxSerializer();
|
||||
virtual ~CDocxSerializer();
|
||||
|
||||
@ -75,8 +77,9 @@ namespace BinDocxRW
|
||||
|
||||
void setFontDir (const std::wstring& sFontDir);
|
||||
void setEmbeddedFontsDir(const std::wstring& sEmbeddedFontsDir);
|
||||
void setIsNoBase64Save (bool bIsNoBase64Save);
|
||||
void setIsNoBase64 (bool bIsNoBase64);
|
||||
void setSaveChartAsImg (bool bSaveChartAsImg);
|
||||
void setIsNoBase64Save (bool val);
|
||||
void setIsNoBase64 (bool val);
|
||||
void setSaveChartAsImg (bool val);
|
||||
void setMacroEnabled (bool val);
|
||||
};
|
||||
}
|
||||
|
||||
@ -47,10 +47,9 @@
|
||||
namespace BinXlsxRW{
|
||||
int g_nCurFormatVersion = 0;
|
||||
|
||||
CXlsxSerializer::CXlsxSerializer()
|
||||
CXlsxSerializer::CXlsxSerializer() : m_bIsMacro(false), m_bIsNoBase64(false)
|
||||
{
|
||||
m_pExternalDrawingConverter = NULL;
|
||||
m_bIsNoBase64 = false;
|
||||
}
|
||||
CXlsxSerializer::~CXlsxSerializer()
|
||||
{
|
||||
@ -98,7 +97,7 @@ namespace BinXlsxRW{
|
||||
oDrawingConverter.SetEmbedDstPath(sEmbedDir);
|
||||
|
||||
BinXlsxRW::BinaryFileReader oBinaryFileReader;
|
||||
return oBinaryFileReader.ReadFile(sSrcFileName, sDstPath, &oDrawingConverter, sXMLOptions);
|
||||
return oBinaryFileReader.ReadFile(sSrcFileName, sDstPath, &oDrawingConverter, sXMLOptions, m_bIsMacro);
|
||||
}
|
||||
_UINT32 CXlsxSerializer::saveToFile(const std::wstring& sDstFileName, const std::wstring& sSrcPath, const std::wstring& sXMLOptions)
|
||||
{
|
||||
@ -259,9 +258,13 @@ namespace BinXlsxRW{
|
||||
{
|
||||
m_pExternalDrawingConverter = pDrawingConverter;
|
||||
}
|
||||
void CXlsxSerializer::setIsNoBase64(bool bIsNoBase64)
|
||||
void CXlsxSerializer::setIsNoBase64(bool val)
|
||||
{
|
||||
m_bIsNoBase64 = bIsNoBase64;
|
||||
m_bIsNoBase64 = val;
|
||||
}
|
||||
void CXlsxSerializer::setMacroEnabled(bool val)
|
||||
{
|
||||
m_bIsMacro = val;
|
||||
}
|
||||
|
||||
bool CXlsxSerializer::writeChartXlsx(const std::wstring& sDstFile, NSCommon::smart_ptr<OOX::File> &file)
|
||||
|
||||
@ -55,6 +55,7 @@ namespace BinXlsxRW {
|
||||
std::wstring m_sEmbeddedFontsDir;
|
||||
NSBinPptxRW::CDrawingConverter* m_pExternalDrawingConverter;
|
||||
bool m_bIsNoBase64;
|
||||
bool m_bIsMacro;
|
||||
public:
|
||||
CXlsxSerializer();
|
||||
~CXlsxSerializer();
|
||||
@ -69,7 +70,8 @@ namespace BinXlsxRW {
|
||||
void setFontDir (const std::wstring& sFontDir);
|
||||
void setEmbeddedFontsDir(const std::wstring& sEmbeddedFontsDir);
|
||||
void setDrawingConverter(NSBinPptxRW::CDrawingConverter* pDrawingConverter);
|
||||
void setIsNoBase64 (bool bIsNoBase64);
|
||||
void setIsNoBase64 (bool val);
|
||||
void setMacroEnabled (bool val);
|
||||
|
||||
bool writeChartXlsx (const std::wstring& sDstFile, NSCommon::smart_ptr<OOX::File> &file);
|
||||
bool hasPivot (const std::wstring& sSrcPath);
|
||||
|
||||
@ -92,7 +92,7 @@ PptxConverter::PptxConverter(const std::wstring & path, bool bTemplate)
|
||||
return;
|
||||
}
|
||||
|
||||
pptx_document->read(oox_path.GetPath() + FILE_SEPARATOR_STR, NULL);
|
||||
pptx_document->read(oox_path.GetPath() + FILE_SEPARATOR_STR);
|
||||
|
||||
smart_ptr<PPTX::Presentation> presentation_ptr = pptx_document->Get(OOX::Presentation::FileTypes::Presentation).smart_dynamic_cast<PPTX::Presentation>();
|
||||
if (!presentation_ptr.is_init())
|
||||
|
||||
@ -342,6 +342,8 @@ void Animation::FillAnimMotion(
|
||||
if (!pMotion->m_pVarPath->m_Value.empty())
|
||||
oAnim.path = pMotion->m_pVarPath->m_Value;
|
||||
|
||||
// oAnim.ptsTypes
|
||||
|
||||
|
||||
oAnim.pathEditMode = new PPTX::Limit::TLPathEditMode;
|
||||
oAnim.pathEditMode->set(oAtom.m_bEditRotationPropertyUsed ? L"fixed" : L"relative");
|
||||
@ -412,7 +414,7 @@ void Animation::FillAudio(CRecordClientVisualElementContainer *pCVEC,
|
||||
bool bExternal(false);
|
||||
oAudio.cMediaNode.tgtEl.embed =
|
||||
new OOX::RId(m_pRels->WriteAudio(pInfo1->m_strFilePath, bExternal));
|
||||
oAudio.cMediaNode.tgtEl.name = pInfo1->m_name;
|
||||
oAudio.cMediaNode.tgtEl.name = XmlUtils::EncodeXmlString(pInfo1->m_name);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -706,7 +708,7 @@ void Animation::FillCond(
|
||||
PPTX::Logic::Cond &cond)
|
||||
{
|
||||
if (oldCond->m_oTimeConditionAtom.m_nTimeDelay != -1)
|
||||
cond.delay = std::to_wstring(oldCond->m_oTimeConditionAtom.m_nTimeDelay * 1000);
|
||||
cond.delay = std::to_wstring(oldCond->m_oTimeConditionAtom.m_nTimeDelay);
|
||||
else
|
||||
cond.delay = L"indefinite";
|
||||
|
||||
@ -747,6 +749,8 @@ void Animation::FillCond(
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Not called
|
||||
void Animation::FillCTn(
|
||||
CRecordExtTimeNodeContainer *pETNC,
|
||||
PPTX::Logic::CTn &oCTn)
|
||||
@ -922,8 +926,7 @@ void Animation::FillCTn(
|
||||
case 5:
|
||||
{
|
||||
// Check 1000
|
||||
oCTn.autoRev = std::to_wstring((int)
|
||||
timeModAtom->m_Value * 1000);
|
||||
oCTn.autoRev = (bool)timeModAtom->m_Value;
|
||||
break;
|
||||
}
|
||||
|
||||
@ -993,12 +996,12 @@ void Animation::FillSeq(
|
||||
oSec.prevCondLst->list.push_back(cond);
|
||||
}
|
||||
|
||||
if (!pETNC->m_arrRgBeginTimeCondition.empty())
|
||||
if (!pETNC->m_arrRgNextTimeCondition.empty())
|
||||
{
|
||||
oSec.nextCondLst = new PPTX::Logic::CondLst();
|
||||
oSec.nextCondLst->node_name = L"nextCondLst";
|
||||
}
|
||||
for (auto oldCond : pETNC->m_arrRgBeginTimeCondition)
|
||||
for (auto oldCond : pETNC->m_arrRgNextTimeCondition)
|
||||
{
|
||||
PPTX::Logic::Cond cond;
|
||||
cond.node_name = L"cond";
|
||||
@ -1006,7 +1009,6 @@ void Animation::FillSeq(
|
||||
oSec.nextCondLst->list.push_back(cond);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
void Animation::FillSet(
|
||||
@ -1364,99 +1366,6 @@ void Animation::InitTimingTags(PPTX::Logic::Timing &oTiming)
|
||||
|
||||
}
|
||||
|
||||
//void Animation::FillOldAnim(SOldAnimation& oldAnim, PPTX::Logic::TimeNodeBase &oTimeNodeBase)
|
||||
//{
|
||||
//// auto animAtom = oldAnim.anim->m_AnimationAtom;
|
||||
|
||||
//// auto par1 = new PPTX::Logic::Par;
|
||||
//// par1->cTn.id = m_cTnId++;
|
||||
//// par1->cTn.fill = L"hold";
|
||||
//// par1->cTn.nodeType = L"clickPar";
|
||||
|
||||
//// // p:stCondLst 1
|
||||
//// par1->cTn.stCondLst = new PPTX::Logic::CondLst;
|
||||
//// par1->cTn.stCondLst->node_name = L"stCondLst";
|
||||
//// PPTX::Logic::Cond cond1;
|
||||
//// cond1.delay = L"indefinite";
|
||||
//// par1->cTn.stCondLst->list.push_back(cond1);
|
||||
//// if (animAtom.m_OrderID == 1 &&
|
||||
//// animAtom.m_fAutomatic)
|
||||
//// {
|
||||
//// PPTX::Logic::Cond cond1;
|
||||
//// cond1.evt = L"onBegin";
|
||||
//// cond1.delay = L"0";
|
||||
//// cond1.tn = 2;
|
||||
//// par1->cTn.stCondLst->list.push_back(cond1);
|
||||
//// }
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// auto par2 = new PPTX::Logic::Par;
|
||||
// par2->cTn.id = m_cTnId++;
|
||||
// par2->cTn.fill = L"hold";
|
||||
// par2->cTn.nodeType = L"withGroup";
|
||||
|
||||
// // p:stCondLst 2
|
||||
// par2->cTn.stCondLst = new PPTX::Logic::CondLst;
|
||||
// par2->cTn.stCondLst->node_name = L"stCondLst";
|
||||
// PPTX::Logic::Cond cond2;
|
||||
// cond2.delay = animAtom.m_fAutomatic ? std::to_wstring(animAtom.m_DelayTime) : L"0"; // Experimental
|
||||
// par2->cTn.stCondLst->list.push_back(cond2);
|
||||
|
||||
// auto par3 = new PPTX::Logic::Par;
|
||||
// par3->cTn.id = m_cTnId++;
|
||||
// par3->cTn.fill = L"hold";
|
||||
// par3->cTn.nodeType = (animAtom.m_fAutomatic ? L"afterEffect" : L"clickEffect");
|
||||
// par3->cTn.presetID = 1;
|
||||
// par3->cTn.presetSubtype = 0;
|
||||
// par3->cTn.presetClass = L"entr";
|
||||
// par3->cTn.grpId = 0;
|
||||
|
||||
// // p:stCondLst 3
|
||||
// par3->cTn.stCondLst = new PPTX::Logic::CondLst;
|
||||
// par3->cTn.stCondLst->node_name = L"stCondLst";
|
||||
// PPTX::Logic::Cond cond3;
|
||||
// cond3.delay = std::to_wstring(0); // Experimental
|
||||
// par3->cTn.stCondLst->list.push_back(cond2);
|
||||
// par3->cTn.childTnLst = new PPTX::Logic::ChildTnLst;
|
||||
|
||||
// // anim
|
||||
// PPTX::Logic::TimeNodeBase animTimeNode;
|
||||
// auto animSet = new PPTX::Logic::Set;
|
||||
// FillCBhvr(1,oldAnim.shapeId,L"style.visibility", 499, animSet->cBhvr);
|
||||
// animSet->to = new PPTX::Logic::AnimVariant;
|
||||
// animSet->to->node_name = L"to";
|
||||
// animSet->to->strVal = L"visible";
|
||||
|
||||
// animTimeNode.m_node = animSet;
|
||||
// par3->cTn.childTnLst->list.push_back(animTimeNode);
|
||||
|
||||
//// auto anim1 = new PPTX::Logic::Anim;
|
||||
|
||||
//// animTimeNode.m_node = anim1;
|
||||
//// // push_back(animTimeNode);
|
||||
//// auto anim2 = new PPTX::Logic::Anim;
|
||||
|
||||
//// animTimeNode.m_node = anim2;
|
||||
//// // push_back(animTimeNode);
|
||||
|
||||
// // p:childTnLst 3
|
||||
// PPTX::Logic::TimeNodeBase timeNode3;
|
||||
// timeNode3.m_node = par3;
|
||||
// par2->cTn.childTnLst = new PPTX::Logic::ChildTnLst;
|
||||
// par2->cTn.childTnLst->list.push_back(timeNode3);
|
||||
|
||||
// // p:childTnLst 2
|
||||
// PPTX::Logic::TimeNodeBase timeNode2;
|
||||
// timeNode2.m_node = par2;
|
||||
// par1->cTn.childTnLst = new PPTX::Logic::ChildTnLst;
|
||||
// par1->cTn.childTnLst->list.push_back(timeNode2);
|
||||
|
||||
// oTimeNodeBase.m_node = par1;
|
||||
//}
|
||||
|
||||
void Animation::SplitAnim(std::list<std::list<SOldAnimation*> >& arrClickPar)
|
||||
{
|
||||
std::sort(m_arrOldAnim.begin(), m_arrOldAnim.end(), [] (
|
||||
|
||||
@ -40,7 +40,6 @@
|
||||
#include "../../../ASCOfficeXlsFile2/source/Common/simple_xml_writer.h"
|
||||
#include "../../../DesktopEditor/common/Directory.h"
|
||||
#include "../../../DesktopEditor/common/SystemUtils.h"
|
||||
|
||||
#include "../Reader/PPTDocumentInfo.h"
|
||||
|
||||
#include "ShapeWriter.h"
|
||||
@ -49,23 +48,36 @@
|
||||
#include "Converter.h"
|
||||
#include "Animation.h"
|
||||
|
||||
|
||||
#include "../../../ASCOfficePPTXFile/PPTXFormat/Logic/Transitions/Transition.h"
|
||||
#include "../../../ASCOfficePPTXFile/PPTXFormat/Logic/Transitions/TransitionBase.h"
|
||||
#include "../../../ASCOfficePPTXFile/PPTXFormat/Logic/Transitions/EmptyTransition.h"
|
||||
#include "../../../ASCOfficePPTXFile/PPTXFormat/Logic/Transitions/OrientationTransition.h"
|
||||
#include "../../../ASCOfficePPTXFile/PPTXFormat/Logic/Transitions/EightDirectionTransition.h"
|
||||
#include "../../../ASCOfficePPTXFile/PPTXFormat/Logic/Transitions/OptionalBlackTransition.h"
|
||||
#include "../../../ASCOfficePPTXFile/PPTXFormat/Logic/Transitions/SideDirectionTransition.h"
|
||||
#include "../../../ASCOfficePPTXFile/PPTXFormat/Logic/Transitions/CornerDirectionTransition.h"
|
||||
#include "../../../ASCOfficePPTXFile/PPTXFormat/Logic/Transitions/WheelTransition.h"
|
||||
#include "../../../ASCOfficePPTXFile/PPTXFormat/Logic/Transitions/SplitTransition.h"
|
||||
#include "../../../ASCOfficePPTXFile/PPTXFormat/Logic/Transitions/ZoomTransition.h"
|
||||
|
||||
namespace PPT_FORMAT
|
||||
{
|
||||
namespace NSPPTXWriterConst
|
||||
{
|
||||
static std::wstring g_string_rels_presentation = _T("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\
|
||||
<Relationships xmlns=\"http://schemas.openxmlformats.org/package/2006/relationships\">\
|
||||
<Relationship Id=\"rId3\" Type=\"http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties\" Target=\"docProps/core.xml\"/>\
|
||||
<Relationship Id=\"rId1\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument\" Target=\"ppt/presentation.xml\"/>\
|
||||
<Relationship Id=\"rId2\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties\" Target=\"docProps/app.xml\"/>\
|
||||
</Relationships>");
|
||||
namespace NSPPTXWriterConst
|
||||
{
|
||||
static std::wstring g_string_rels_presentation = _T("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\
|
||||
<Relationships xmlns=\"http://schemas.openxmlformats.org/package/2006/relationships\">\
|
||||
<Relationship Id=\"rId3\" Type=\"http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties\" Target=\"docProps/core.xml\"/>\
|
||||
<Relationship Id=\"rId1\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument\" Target=\"ppt/presentation.xml\"/>\
|
||||
<Relationship Id=\"rId2\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties\" Target=\"docProps/app.xml\"/>\
|
||||
</Relationships>");
|
||||
|
||||
static std::wstring g_string_core = _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\">\
|
||||
<dc:title>Slide 1</dc:title>\
|
||||
<cp:revision>1</cp:revision>\
|
||||
</cp:coreProperties>");
|
||||
}
|
||||
<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\">\
|
||||
<dc:title>Slide 1</dc:title>\
|
||||
<cp:revision>1</cp:revision>\
|
||||
</cp:coreProperties>");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -185,43 +197,43 @@ void PPT_FORMAT::CPPTXWriter::CloseFile()
|
||||
void PPT_FORMAT::CPPTXWriter::WriteContentTypes()
|
||||
{
|
||||
std::wstring strContentTypes = L"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\" ?>\
|
||||
<Types xmlns=\"http://schemas.openxmlformats.org/package/2006/content-types\">\
|
||||
<Default Extension=\"bmp\" ContentType=\"image/bmp\"/>\
|
||||
<Default Extension=\"png\" ContentType=\"image/png\"/>\
|
||||
<Default Extension=\"jpeg\" ContentType=\"image/jpeg\"/>\
|
||||
<Default Extension=\"wmf\" ContentType=\"image/x-wmf\"/>\
|
||||
<Default Extension=\"rels\" ContentType=\"application/vnd.openxmlformats-package.relationships+xml\"/>\
|
||||
<Default Extension=\"xml\" ContentType=\"application/xml\"/>\
|
||||
<Default Extension=\"gif\" ContentType=\"image/gif\"/>\
|
||||
<Default Extension=\"emf\" ContentType=\"image/x-emf\"/>\
|
||||
<Default Extension=\"wav\" ContentType=\"audio/wav\"/>\
|
||||
<Default Extension=\"wma\" ContentType=\"audio/x-ms-wma\"/>\
|
||||
<Default Extension=\"mp3\" ContentType=\"audio/unknown\"/>\
|
||||
<Default Extension=\"m4a\" ContentType=\"audio/unknown\"/>\
|
||||
<Default Extension=\"wmv\" ContentType=\"video/x-ms-wmv\"/>\
|
||||
<Default Extension=\"avi\" ContentType=\"video/avi\"/>\
|
||||
<Default Extension=\"m4v\" ContentType=\"video/unknown\"/>\
|
||||
<Default Extension=\"mp4\" ContentType=\"video/unknown\"/>\
|
||||
<Default Extension=\"mov\" ContentType=\"video/unknown\"/>\
|
||||
<Default Extension=\"xls\" ContentType=\"application/vnd.ms-excel\"/>\
|
||||
<Default Extension=\"xlsx\" ContentType=\"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet\"/>\
|
||||
<Default Extension=\"bin\" ContentType=\"application/vnd.openxmlformats-officedocument.oleObject\" />\
|
||||
<Default Extension=\"jpg\" ContentType=\"image/jpeg\"/>";
|
||||
<Types xmlns=\"http://schemas.openxmlformats.org/package/2006/content-types\">\
|
||||
<Default Extension=\"bmp\" ContentType=\"image/bmp\"/>\
|
||||
<Default Extension=\"png\" ContentType=\"image/png\"/>\
|
||||
<Default Extension=\"jpeg\" ContentType=\"image/jpeg\"/>\
|
||||
<Default Extension=\"wmf\" ContentType=\"image/x-wmf\"/>\
|
||||
<Default Extension=\"rels\" ContentType=\"application/vnd.openxmlformats-package.relationships+xml\"/>\
|
||||
<Default Extension=\"xml\" ContentType=\"application/xml\"/>\
|
||||
<Default Extension=\"gif\" ContentType=\"image/gif\"/>\
|
||||
<Default Extension=\"emf\" ContentType=\"image/x-emf\"/>\
|
||||
<Default Extension=\"wav\" ContentType=\"audio/wav\"/>\
|
||||
<Default Extension=\"wma\" ContentType=\"audio/x-ms-wma\"/>\
|
||||
<Default Extension=\"mp3\" ContentType=\"audio/unknown\"/>\
|
||||
<Default Extension=\"m4a\" ContentType=\"audio/unknown\"/>\
|
||||
<Default Extension=\"wmv\" ContentType=\"video/x-ms-wmv\"/>\
|
||||
<Default Extension=\"avi\" ContentType=\"video/avi\"/>\
|
||||
<Default Extension=\"m4v\" ContentType=\"video/unknown\"/>\
|
||||
<Default Extension=\"mp4\" ContentType=\"video/unknown\"/>\
|
||||
<Default Extension=\"mov\" ContentType=\"video/unknown\"/>\
|
||||
<Default Extension=\"xls\" ContentType=\"application/vnd.ms-excel\"/>\
|
||||
<Default Extension=\"xlsx\" ContentType=\"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet\"/>\
|
||||
<Default Extension=\"bin\" ContentType=\"application/vnd.openxmlformats-officedocument.oleObject\" />\
|
||||
<Default Extension=\"jpg\" ContentType=\"image/jpeg\"/>";
|
||||
|
||||
if (m_pDocument->m_bMacros)
|
||||
{
|
||||
strContentTypes += L"<Override PartName=\"/ppt/presentation.xml\" ContentType=\"application/vnd.ms-powerpoint.presentation.macroEnabled.main+xml\" />\
|
||||
<Override PartName=\"/ppt/vbaProject.bin\" ContentType=\"application/vnd.ms-office.vbaProject\" />";
|
||||
<Override PartName=\"/ppt/vbaProject.bin\" ContentType=\"application/vnd.ms-office.vbaProject\" />";
|
||||
}
|
||||
else
|
||||
{
|
||||
strContentTypes += L"<Override PartName=\"/ppt/presentation.xml\" ContentType=\"application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml\" />";
|
||||
}
|
||||
strContentTypes += L"<Override PartName=\"/ppt/presProps.xml\" ContentType=\"application/vnd.openxmlformats-officedocument.presentationml.presProps+xml\" />\
|
||||
<Override PartName=\"/ppt/viewProps.xml\" ContentType=\"application/vnd.openxmlformats-officedocument.presentationml.viewProps+xml\" />\
|
||||
<Override PartName=\"/ppt/tableStyles.xml\" ContentType=\"application/vnd.openxmlformats-officedocument.presentationml.tableStyles+xml\"/>\
|
||||
<Override PartName=\"/docProps/core.xml\" ContentType=\"application/vnd.openxmlformats-package.core-properties+xml\" />\
|
||||
<Override PartName=\"/docProps/app.xml\" ContentType=\"application/vnd.openxmlformats-officedocument.extended-properties+xml\" />";
|
||||
<Override PartName=\"/ppt/viewProps.xml\" ContentType=\"application/vnd.openxmlformats-officedocument.presentationml.viewProps+xml\" />\
|
||||
<Override PartName=\"/ppt/tableStyles.xml\" ContentType=\"application/vnd.openxmlformats-officedocument.presentationml.tableStyles+xml\"/>\
|
||||
<Override PartName=\"/docProps/core.xml\" ContentType=\"application/vnd.openxmlformats-package.core-properties+xml\" />\
|
||||
<Override PartName=\"/docProps/app.xml\" ContentType=\"application/vnd.openxmlformats-officedocument.extended-properties+xml\" />";
|
||||
|
||||
int nIndexLayout = 1, nIndexTheme = 1;
|
||||
|
||||
@ -237,20 +249,20 @@ void PPT_FORMAT::CPPTXWriter::WriteContentTypes()
|
||||
for (size_t nL = 0; nL < m_pDocument->m_arThemes[nT]->m_arLayouts.size(); nL++, nIndexLayout++)
|
||||
{
|
||||
strContentTypes += L"<Override PartName=\"/ppt/slideLayouts/slideLayout" + std::to_wstring(nIndexLayout) +
|
||||
L".xml\" ContentType=\"application/vnd.openxmlformats-officedocument.presentationml.slideLayout+xml\"/>";
|
||||
L".xml\" ContentType=\"application/vnd.openxmlformats-officedocument.presentationml.slideLayout+xml\"/>";
|
||||
}
|
||||
}
|
||||
|
||||
if (m_pDocument->m_pNotesMaster)
|
||||
{
|
||||
strContentTypes += L"<Override PartName=\"/ppt/theme/theme" + std::to_wstring(nIndexTheme++) + L".xml\" \
|
||||
ContentType=\"application/vnd.openxmlformats-officedocument.theme+xml\"/>";
|
||||
ContentType=\"application/vnd.openxmlformats-officedocument.theme+xml\"/>";
|
||||
strContentTypes += L"<Override PartName=\"/ppt/notesMasters/notesMaster1.xml\" ContentType=\"application/vnd.openxmlformats-officedocument.presentationml.notesMaster+xml\"/>";
|
||||
}
|
||||
if (m_pDocument->m_pHandoutMaster)
|
||||
{
|
||||
strContentTypes += L"<Override PartName=\"/ppt/theme/theme" + std::to_wstring(nIndexTheme++) + L".xml\" \
|
||||
ContentType=\"application/vnd.openxmlformats-officedocument.theme+xml\"/>";
|
||||
ContentType=\"application/vnd.openxmlformats-officedocument.theme+xml\"/>";
|
||||
strContentTypes += L"<Override PartName=\"/ppt/handoutMasters/handoutMaster1.xml\" ContentType=\"application/vnd.openxmlformats-officedocument.presentationml.handoutMaster+xml\"/>";
|
||||
}
|
||||
|
||||
@ -263,7 +275,7 @@ void PPT_FORMAT::CPPTXWriter::WriteContentTypes()
|
||||
for (size_t nS = 0; nS < m_pDocument->m_arNotes.size(); ++nS)
|
||||
{
|
||||
strContentTypes += L"<Override PartName=\"/ppt/notesSlides/notesSlide" + std::to_wstring( nS + 1)
|
||||
+ L".xml\" ContentType=\"application/vnd.openxmlformats-officedocument.presentationml.notesSlide+xml\"/>";
|
||||
+ L".xml\" ContentType=\"application/vnd.openxmlformats-officedocument.presentationml.notesSlide+xml\"/>";
|
||||
}
|
||||
strContentTypes += _T("</Types>");
|
||||
|
||||
@ -296,10 +308,10 @@ void PPT_FORMAT::CPPTXWriter::WriteApp(CFile& oFile)
|
||||
std::wstring sApplication = NSSystemUtils::GetEnvVariable(NSSystemUtils::gc_EnvApplicationName);
|
||||
if (sApplication.empty())
|
||||
sApplication = NSSystemUtils::gc_EnvApplicationNameDefault;
|
||||
#if defined(INTVER)
|
||||
#if defined(INTVER)
|
||||
std::string s = VALUE2STR(INTVER);
|
||||
sApplication += L"/" + std::wstring(s.begin(), s.end());
|
||||
#endif
|
||||
#endif
|
||||
CP_XML_NODE(L"Application")
|
||||
{
|
||||
CP_XML_STREAM() << sApplication;
|
||||
@ -367,7 +379,7 @@ void PPT_FORMAT::CPPTXWriter::WriteApp(CFile& oFile)
|
||||
CP_XML_NODE(L"vt:variant")
|
||||
{
|
||||
CP_XML_NODE(L"vt:i4")
|
||||
CP_XML_STREAM() << m_pDocument->m_arSlides.size();
|
||||
CP_XML_STREAM() << m_pDocument->m_arSlides.size();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -418,32 +430,32 @@ void PPT_FORMAT::CPPTXWriter::WritePresInfo()
|
||||
{
|
||||
CFile oFile;
|
||||
|
||||
// tableStyles.xml
|
||||
// tableStyles.xml
|
||||
oFile.CreateFile(m_strTempDirectory + FILE_SEPARATOR_STR + _T("ppt") + FILE_SEPARATOR_STR + _T("tableStyles.xml"));
|
||||
|
||||
oFile.WriteStringUTF8(L"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\" ?>\
|
||||
<a:tblStyleLst xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" def=\"{5C22544A-7EE6-4342-B048-85BDC9FD1C3A}\"/>");
|
||||
oFile.CloseFile();
|
||||
|
||||
// presProps.xml
|
||||
// presProps.xml
|
||||
oFile.CreateFile(m_strTempDirectory + FILE_SEPARATOR_STR + _T("ppt") + FILE_SEPARATOR_STR + _T("presProps.xml"));
|
||||
oFile.WriteStringUTF8(L"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\" ?>\
|
||||
<p:presentationPr 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:extLst><p:ext uri=\"{E76CE94A-603C-4142-B9EB-6D1370010A27}\">\
|
||||
<p14:discardImageEditData xmlns:p14=\"http://schemas.microsoft.com/office/powerpoint/2010/main\" val=\"0\" /></p:ext>\
|
||||
<p:ext uri=\"{D31A062A-798A-4329-ABDD-BBA856620510}\">\
|
||||
<p14:defaultImageDpi xmlns:p14=\"http://schemas.microsoft.com/office/powerpoint/2010/main\" val=\"220\" />\
|
||||
</p:ext></p:extLst></p:presentationPr>");
|
||||
oFile.CloseFile();
|
||||
<p:extLst><p:ext uri=\"{E76CE94A-603C-4142-B9EB-6D1370010A27}\">\
|
||||
<p14:discardImageEditData xmlns:p14=\"http://schemas.microsoft.com/office/powerpoint/2010/main\" val=\"0\" /></p:ext>\
|
||||
<p:ext uri=\"{D31A062A-798A-4329-ABDD-BBA856620510}\">\
|
||||
<p14:defaultImageDpi xmlns:p14=\"http://schemas.microsoft.com/office/powerpoint/2010/main\" val=\"220\" />\
|
||||
</p:ext></p:extLst></p:presentationPr>");
|
||||
oFile.CloseFile();
|
||||
|
||||
// viewProps.xml
|
||||
oFile.CreateFile(m_strTempDirectory + FILE_SEPARATOR_STR + _T("ppt") + FILE_SEPARATOR_STR + _T("viewProps.xml"));
|
||||
// viewProps.xml
|
||||
oFile.CreateFile(m_strTempDirectory + FILE_SEPARATOR_STR + _T("ppt") + FILE_SEPARATOR_STR + _T("viewProps.xml"));
|
||||
oFile.WriteStringUTF8(L"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\
|
||||
<p:viewPr 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:normalViewPr><p:restoredLeft sz=\"15620\"/><p:restoredTop sz=\"94660\"/></p:normalViewPr><p:slideViewPr><p:cSldViewPr><p:cViewPr varScale=\"1\">\
|
||||
<p:scale><a:sx n=\"104\" d=\"100\"/><a:sy n=\"104\" d=\"100\"/></p:scale><p:origin x=\"-1236\" y=\"-90\"/></p:cViewPr><p:guideLst>\
|
||||
<p:guide orient=\"horz\" pos=\"2160\"/><p:guide pos=\"2880\"/></p:guideLst></p:cSldViewPr></p:slideViewPr><p:notesTextViewPr><p:cViewPr><p:scale>\
|
||||
<a:sx n=\"1\" d=\"1\"/><a:sy n=\"1\" d=\"1\"/></p:scale><p:origin x=\"0\" y=\"0\"/></p:cViewPr></p:notesTextViewPr><p:gridSpacing cx=\"72008\" cy=\"72008\"/></p:viewPr>");
|
||||
<p:normalViewPr><p:restoredLeft sz=\"15620\"/><p:restoredTop sz=\"94660\"/></p:normalViewPr><p:slideViewPr><p:cSldViewPr><p:cViewPr varScale=\"1\">\
|
||||
<p:scale><a:sx n=\"104\" d=\"100\"/><a:sy n=\"104\" d=\"100\"/></p:scale><p:origin x=\"-1236\" y=\"-90\"/></p:cViewPr><p:guideLst>\
|
||||
<p:guide orient=\"horz\" pos=\"2160\"/><p:guide pos=\"2880\"/></p:guideLst></p:cSldViewPr></p:slideViewPr><p:notesTextViewPr><p:cViewPr><p:scale>\
|
||||
<a:sx n=\"1\" d=\"1\"/><a:sy n=\"1\" d=\"1\"/></p:scale><p:origin x=\"0\" y=\"0\"/></p:cViewPr></p:notesTextViewPr><p:gridSpacing cx=\"72008\" cy=\"72008\"/></p:viewPr>");
|
||||
oFile.CloseFile();
|
||||
|
||||
// presentation.xml + _rels/presentation.xml.rels
|
||||
@ -489,8 +501,8 @@ void PPT_FORMAT::CPPTXWriter::WritePresInfo()
|
||||
for (size_t nIndexSlide = 0; nIndexSlide < m_pDocument->m_arSlides.size(); ++nIndexSlide, ++nCurrentRels)
|
||||
{
|
||||
strPresRels += L"<Relationship Id=\"rId" + std::to_wstring(nCurrentRels) +
|
||||
L"\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/slide\" Target=\"slides/slide" +
|
||||
std::to_wstring(nIndexSlide + 1) + L".xml\" />";
|
||||
L"\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/slide\" Target=\"slides/slide" +
|
||||
std::to_wstring(nIndexSlide + 1) + L".xml\" />";
|
||||
|
||||
strPresSlides += L"<p:sldId id=\"" + std::to_wstring(256 + nIndexSlide) + L"\" r:id=\"rId" + std::to_wstring(nCurrentRels) + L"\"/>";
|
||||
}
|
||||
@ -509,7 +521,7 @@ void PPT_FORMAT::CPPTXWriter::WritePresInfo()
|
||||
}
|
||||
}
|
||||
strPresRels = L"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\" ?><Relationships xmlns=\"http://schemas.openxmlformats.org/package/2006/relationships\">"
|
||||
+ strPresRels + L"</Relationships>";
|
||||
+ strPresRels + L"</Relationships>";
|
||||
|
||||
std::wstring strPptRels = m_strTempDirectory + FILE_SEPARATOR_STR + _T("ppt") + FILE_SEPARATOR_STR + _T("_rels");
|
||||
|
||||
@ -519,7 +531,7 @@ void PPT_FORMAT::CPPTXWriter::WritePresInfo()
|
||||
oFile.CloseFile();
|
||||
|
||||
std::wstring strSizePres = L"<p:sldSz cx=\"" + std::to_wstring(m_pDocument->m_lSlideWidth) +
|
||||
L"\" cy=\"" + std::to_wstring(m_pDocument->m_lSlideHeight) +
|
||||
L"\" cy=\"" + std::to_wstring(m_pDocument->m_lSlideHeight) +
|
||||
L"\" type=\"screen4x3\" /><p:notesSz cx=\"" + std::to_wstring(m_pDocument->m_lNotesWidth) +
|
||||
L"\" cy=\"" + std::to_wstring(m_pDocument->m_lNotesHeight) + L"\"/>";
|
||||
|
||||
@ -534,17 +546,17 @@ void PPT_FORMAT::CPPTXWriter::WritePresInfo()
|
||||
|
||||
std::wstring strPres = _T("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\" ?>");
|
||||
strPres += _T("<p:presentation 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\" saveSubsetFonts=\"1\"");
|
||||
if ((m_pUserInfo) && (m_pUserInfo->m_bRtl))
|
||||
{
|
||||
strPres += _T(" rtl=\"1\"");
|
||||
}
|
||||
strPres += _T(">");
|
||||
strPres += _T("<p:sldMasterIdLst>") + strPresMasters + _T("</p:sldMasterIdLst>");
|
||||
strPres += strNotesIDs ;
|
||||
strPres += strHandoutIDs ;
|
||||
strPres +=_T("<p:sldIdLst>") + strPresSlides + _T("</p:sldIdLst>");
|
||||
strPres += strSizePres;
|
||||
strPres += strDefaultTextStyle;
|
||||
if ((m_pUserInfo) && (m_pUserInfo->m_bRtl))
|
||||
{
|
||||
strPres += _T(" rtl=\"1\"");
|
||||
}
|
||||
strPres += _T(">");
|
||||
strPres += _T("<p:sldMasterIdLst>") + strPresMasters + _T("</p:sldMasterIdLst>");
|
||||
strPres += strNotesIDs ;
|
||||
strPres += strHandoutIDs ;
|
||||
strPres +=_T("<p:sldIdLst>") + strPresSlides + _T("</p:sldIdLst>");
|
||||
strPres += strSizePres;
|
||||
strPres += strDefaultTextStyle;
|
||||
strPres +=_T("</p:presentation>");
|
||||
|
||||
oFile.CreateFile(m_strTempDirectory+ FILE_SEPARATOR_STR + _T("ppt") + FILE_SEPARATOR_STR + _T("presentation.xml"));
|
||||
@ -593,7 +605,7 @@ void PPT_FORMAT::CPPTXWriter::WriteThemes()
|
||||
for (size_t i = 0; i < m_pDocument->m_arThemes.size(); i++)
|
||||
{
|
||||
m_pShapeWriter->m_pTheme = m_pDocument->m_arThemes[i].get();
|
||||
WriteTheme(m_pDocument->m_arThemes[i], nIndexTheme, nStartLayout);
|
||||
WriteTheme(m_pDocument->m_arThemes[i], nIndexTheme, nStartLayout);
|
||||
m_pShapeWriter->m_pTheme = NULL;
|
||||
}
|
||||
|
||||
@ -633,32 +645,32 @@ void PPT_FORMAT::CPPTXWriter::WriteTheme(CThemePtr pTheme, int & nIndexTheme, in
|
||||
oStringWriter.WriteString(std::wstring(L"\"/><a:ea typeface=\"\"/><a:cs typeface=\"\"/></a:minorFont>"));
|
||||
oStringWriter.WriteString(std::wstring(L"</a:fontScheme>"));
|
||||
|
||||
oStringWriter.WriteString(std::wstring(L"<a:fmtScheme name=\"Default\">\
|
||||
<a:fillStyleLst><a:solidFill><a:schemeClr val=\"phClr\"/></a:solidFill><a:gradFill rotWithShape=\"1\"><a:gsLst><a:gs pos=\"0\"><a:schemeClr val=\"phClr\">\
|
||||
<a:tint val=\"50000\"/><a:satMod val=\"300000\"/></a:schemeClr></a:gs><a:gs pos=\"35000\"><a:schemeClr val=\"phClr\"><a:tint val=\"37000\"/>\
|
||||
<a:satMod val=\"300000\"/></a:schemeClr></a:gs><a:gs pos=\"100000\"><a:schemeClr val=\"phClr\"><a:tint val=\"15000\"/><a:satMod val=\"350000\"/>\
|
||||
</a:schemeClr></a:gs></a:gsLst><a:lin ang=\"16200000\" scaled=\"1\"/></a:gradFill><a:gradFill rotWithShape=\"1\"><a:gsLst><a:gs pos=\"0\">\
|
||||
<a:schemeClr val=\"phClr\"><a:shade val=\"51000\"/><a:satMod val=\"130000\"/></a:schemeClr></a:gs><a:gs pos=\"80000\"><a:schemeClr val=\"phClr\">\
|
||||
<a:shade val=\"93000\"/><a:satMod val=\"130000\"/></a:schemeClr></a:gs><a:gs pos=\"100000\"><a:schemeClr val=\"phClr\"><a:shade val=\"94000\"/>\
|
||||
<a:satMod val=\"135000\"/></a:schemeClr></a:gs></a:gsLst><a:lin ang=\"16200000\" scaled=\"0\"/></a:gradFill></a:fillStyleLst><a:lnStyleLst>\
|
||||
<a:ln w=\"9525\" cap=\"flat\" cmpd=\"sng\" algn=\"ctr\"><a:solidFill><a:schemeClr val=\"phClr\"><a:shade val=\"95000\"/><a:satMod val=\"105000\"/>\
|
||||
</a:schemeClr></a:solidFill><a:prstDash val=\"solid\"/></a:ln><a:ln w=\"25400\" cap=\"flat\" cmpd=\"sng\" algn=\"ctr\"><a:solidFill>\
|
||||
<a:schemeClr val=\"phClr\"/></a:solidFill><a:prstDash val=\"solid\"/></a:ln><a:ln w=\"38100\" cap=\"flat\" cmpd=\"sng\" algn=\"ctr\">\
|
||||
<a:solidFill><a:schemeClr val=\"phClr\"/></a:solidFill><a:prstDash val=\"solid\"/></a:ln></a:lnStyleLst><a:effectStyleLst><a:effectStyle><a:effectLst>\
|
||||
<a:outerShdw blurRad=\"40000\" dist=\"20000\" dir=\"5400000\" rotWithShape=\"0\"><a:srgbClr val=\"000000\"><a:alpha val=\"38000\"/></a:srgbClr>\
|
||||
</a:outerShdw></a:effectLst></a:effectStyle><a:effectStyle><a:effectLst><a:outerShdw blurRad=\"40000\" dist=\"23000\" dir=\"5400000\" rotWithShape=\"0\">\
|
||||
<a:srgbClr val=\"000000\"><a:alpha val=\"35000\"/></a:srgbClr></a:outerShdw></a:effectLst></a:effectStyle><a:effectStyle><a:effectLst>\
|
||||
<a:outerShdw blurRad=\"40000\" dist=\"23000\" dir=\"5400000\" rotWithShape=\"0\"><a:srgbClr val=\"000000\"><a:alpha val=\"35000\"/></a:srgbClr>\
|
||||
</a:outerShdw></a:effectLst><a:scene3d><a:camera prst=\"orthographicFront\"><a:rot lat=\"0\" lon=\"0\" rev=\"0\"/></a:camera>\
|
||||
<a:lightRig rig=\"threePt\" dir=\"t\"><a:rot lat=\"0\" lon=\"0\" rev=\"1200000\"/></a:lightRig></a:scene3d><a:sp3d><a:bevelT w=\"63500\" h=\"25400\"/>\
|
||||
</a:sp3d></a:effectStyle></a:effectStyleLst><a:bgFillStyleLst><a:solidFill><a:schemeClr val=\"phClr\"/></a:solidFill><a:gradFill rotWithShape=\"1\">\
|
||||
<a:gsLst><a:gs pos=\"0\"><a:schemeClr val=\"phClr\"><a:tint val=\"40000\"/><a:satMod val=\"350000\"/></a:schemeClr></a:gs><a:gs pos=\"40000\">\
|
||||
<a:schemeClr val=\"phClr\"><a:tint val=\"45000\"/><a:shade val=\"99000\"/><a:satMod val=\"350000\"/></a:schemeClr></a:gs><a:gs pos=\"100000\">\
|
||||
<a:schemeClr val=\"phClr\"><a:shade val=\"20000\"/><a:satMod val=\"255000\"/></a:schemeClr></a:gs></a:gsLst><a:path path=\"circle\">\
|
||||
<a:fillToRect l=\"50000\" t=\"-80000\" r=\"50000\" b=\"180000\"/></a:path></a:gradFill><a:gradFill rotWithShape=\"1\"><a:gsLst><a:gs pos=\"0\">\
|
||||
<a:schemeClr val=\"phClr\"><a:tint val=\"80000\"/><a:satMod val=\"300000\"/></a:schemeClr></a:gs><a:gs pos=\"100000\"><a:schemeClr val=\"phClr\">\
|
||||
<a:shade val=\"30000\"/><a:satMod val=\"200000\"/></a:schemeClr></a:gs></a:gsLst><a:path path=\"circle\">\
|
||||
<a:fillToRect l=\"50000\" t=\"50000\" r=\"50000\" b=\"50000\"/></a:path></a:gradFill></a:bgFillStyleLst></a:fmtScheme>"));
|
||||
oStringWriter.WriteString(std::wstring(L"<a:fmtScheme name=\"Default\">\
|
||||
<a:fillStyleLst><a:solidFill><a:schemeClr val=\"phClr\"/></a:solidFill><a:gradFill rotWithShape=\"1\"><a:gsLst><a:gs pos=\"0\"><a:schemeClr val=\"phClr\">\
|
||||
<a:tint val=\"50000\"/><a:satMod val=\"300000\"/></a:schemeClr></a:gs><a:gs pos=\"35000\"><a:schemeClr val=\"phClr\"><a:tint val=\"37000\"/>\
|
||||
<a:satMod val=\"300000\"/></a:schemeClr></a:gs><a:gs pos=\"100000\"><a:schemeClr val=\"phClr\"><a:tint val=\"15000\"/><a:satMod val=\"350000\"/>\
|
||||
</a:schemeClr></a:gs></a:gsLst><a:lin ang=\"16200000\" scaled=\"1\"/></a:gradFill><a:gradFill rotWithShape=\"1\"><a:gsLst><a:gs pos=\"0\">\
|
||||
<a:schemeClr val=\"phClr\"><a:shade val=\"51000\"/><a:satMod val=\"130000\"/></a:schemeClr></a:gs><a:gs pos=\"80000\"><a:schemeClr val=\"phClr\">\
|
||||
<a:shade val=\"93000\"/><a:satMod val=\"130000\"/></a:schemeClr></a:gs><a:gs pos=\"100000\"><a:schemeClr val=\"phClr\"><a:shade val=\"94000\"/>\
|
||||
<a:satMod val=\"135000\"/></a:schemeClr></a:gs></a:gsLst><a:lin ang=\"16200000\" scaled=\"0\"/></a:gradFill></a:fillStyleLst><a:lnStyleLst>\
|
||||
<a:ln w=\"9525\" cap=\"flat\" cmpd=\"sng\" algn=\"ctr\"><a:solidFill><a:schemeClr val=\"phClr\"><a:shade val=\"95000\"/><a:satMod val=\"105000\"/>\
|
||||
</a:schemeClr></a:solidFill><a:prstDash val=\"solid\"/></a:ln><a:ln w=\"25400\" cap=\"flat\" cmpd=\"sng\" algn=\"ctr\"><a:solidFill>\
|
||||
<a:schemeClr val=\"phClr\"/></a:solidFill><a:prstDash val=\"solid\"/></a:ln><a:ln w=\"38100\" cap=\"flat\" cmpd=\"sng\" algn=\"ctr\">\
|
||||
<a:solidFill><a:schemeClr val=\"phClr\"/></a:solidFill><a:prstDash val=\"solid\"/></a:ln></a:lnStyleLst><a:effectStyleLst><a:effectStyle><a:effectLst>\
|
||||
<a:outerShdw blurRad=\"40000\" dist=\"20000\" dir=\"5400000\" rotWithShape=\"0\"><a:srgbClr val=\"000000\"><a:alpha val=\"38000\"/></a:srgbClr>\
|
||||
</a:outerShdw></a:effectLst></a:effectStyle><a:effectStyle><a:effectLst><a:outerShdw blurRad=\"40000\" dist=\"23000\" dir=\"5400000\" rotWithShape=\"0\">\
|
||||
<a:srgbClr val=\"000000\"><a:alpha val=\"35000\"/></a:srgbClr></a:outerShdw></a:effectLst></a:effectStyle><a:effectStyle><a:effectLst>\
|
||||
<a:outerShdw blurRad=\"40000\" dist=\"23000\" dir=\"5400000\" rotWithShape=\"0\"><a:srgbClr val=\"000000\"><a:alpha val=\"35000\"/></a:srgbClr>\
|
||||
</a:outerShdw></a:effectLst><a:scene3d><a:camera prst=\"orthographicFront\"><a:rot lat=\"0\" lon=\"0\" rev=\"0\"/></a:camera>\
|
||||
<a:lightRig rig=\"threePt\" dir=\"t\"><a:rot lat=\"0\" lon=\"0\" rev=\"1200000\"/></a:lightRig></a:scene3d><a:sp3d><a:bevelT w=\"63500\" h=\"25400\"/>\
|
||||
</a:sp3d></a:effectStyle></a:effectStyleLst><a:bgFillStyleLst><a:solidFill><a:schemeClr val=\"phClr\"/></a:solidFill><a:gradFill rotWithShape=\"1\">\
|
||||
<a:gsLst><a:gs pos=\"0\"><a:schemeClr val=\"phClr\"><a:tint val=\"40000\"/><a:satMod val=\"350000\"/></a:schemeClr></a:gs><a:gs pos=\"40000\">\
|
||||
<a:schemeClr val=\"phClr\"><a:tint val=\"45000\"/><a:shade val=\"99000\"/><a:satMod val=\"350000\"/></a:schemeClr></a:gs><a:gs pos=\"100000\">\
|
||||
<a:schemeClr val=\"phClr\"><a:shade val=\"20000\"/><a:satMod val=\"255000\"/></a:schemeClr></a:gs></a:gsLst><a:path path=\"circle\">\
|
||||
<a:fillToRect l=\"50000\" t=\"-80000\" r=\"50000\" b=\"180000\"/></a:path></a:gradFill><a:gradFill rotWithShape=\"1\"><a:gsLst><a:gs pos=\"0\">\
|
||||
<a:schemeClr val=\"phClr\"><a:tint val=\"80000\"/><a:satMod val=\"300000\"/></a:schemeClr></a:gs><a:gs pos=\"100000\"><a:schemeClr val=\"phClr\">\
|
||||
<a:shade val=\"30000\"/><a:satMod val=\"200000\"/></a:schemeClr></a:gs></a:gsLst><a:path path=\"circle\">\
|
||||
<a:fillToRect l=\"50000\" t=\"50000\" r=\"50000\" b=\"50000\"/></a:path></a:gradFill></a:bgFillStyleLst></a:fmtScheme>"));
|
||||
|
||||
oStringWriter.WriteString(std::wstring(L"</a:themeElements><a:objectDefaults/>"));
|
||||
oStringWriter.WriteString(std::wstring(L"<a:extraClrSchemeLst>"));
|
||||
@ -701,7 +713,7 @@ void PPT_FORMAT::CPPTXWriter::WriteTheme(CThemePtr pTheme, int & nIndexTheme, in
|
||||
WriteBackground(oWriter, oRels, pTheme->m_oBackground);
|
||||
}
|
||||
oWriter.WriteString(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>");
|
||||
|
||||
CGroupElement *pGroupElement = !pTheme->m_arElements.empty() ? dynamic_cast<CGroupElement *>(pTheme->m_arElements[0].get()) : NULL;
|
||||
|
||||
@ -779,7 +791,7 @@ void PPT_FORMAT::CPPTXWriter::WriteTheme(CThemePtr pTheme, int & nIndexTheme, in
|
||||
oWriter.WriteString(std::wstring(L"<p:hf"));
|
||||
if (!pTheme->m_bHasDate) oWriter.WriteString(std::wstring(L" dt=\"0\""));
|
||||
if (!pTheme->m_bHasSlideNumber) oWriter.WriteString(std::wstring(L" sldNum=\"0\""));
|
||||
oWriter.WriteString(std::wstring(L" hdr=\"0\""));
|
||||
oWriter.WriteString(std::wstring(L" hdr=\"0\""));
|
||||
if (!pTheme->m_bHasFooter) oWriter.WriteString(std::wstring(L" ftr=\"0\""));
|
||||
oWriter.WriteString(std::wstring(L"/>"));
|
||||
}
|
||||
@ -844,8 +856,8 @@ void PPT_FORMAT::CPPTXWriter::WriteTheme(CThemePtr pTheme, int & nIndexTheme, in
|
||||
strSlideMasterRelsFile = strPptDirectory + _T("handoutMasters") + FILE_SEPARATOR_STR + _T("_rels") + FILE_SEPARATOR_STR + strSlideMasterRelsFile;
|
||||
}
|
||||
oFile.CreateFile(strSlideMasterFile);
|
||||
std::wstring strMaster = oWriter.GetData();
|
||||
oFile.WriteStringUTF8(strMaster);
|
||||
std::wstring strMaster = oWriter.GetData();
|
||||
oFile.WriteStringUTF8(strMaster);
|
||||
oFile.CloseFile();
|
||||
|
||||
oRels.CloseRels();
|
||||
@ -860,11 +872,11 @@ void PPT_FORMAT::CPPTXWriter::WriteColorScheme(CStringWriter& oStringWriter, con
|
||||
if (colors.size() < 1)
|
||||
{
|
||||
oStringWriter.WriteString(L"<a:clrScheme name=\"Default\"><a:dk1><a:sysClr val=\"windowText\" lastClr=\"000000\"/>\
|
||||
</a:dk1><a:lt1><a:sysClr val=\"window\" lastClr=\"FFFFFF\"/></a:lt1><a:dk2><a:srgbClr val=\"1F497D\"/></a:dk2><a:lt2>\
|
||||
<a:srgbClr val=\"EEECE1\"/></a:lt2><a:accent1><a:srgbClr val=\"4F81BD\"/></a:accent1><a:accent2><a:srgbClr val=\"C0504D\"/>\
|
||||
</a:accent2><a:accent3><a:srgbClr val=\"9BBB59\"/></a:accent3><a:accent4><a:srgbClr val=\"8064A2\"/></a:accent4><a:accent5>\
|
||||
<a:srgbClr val=\"4BACC6\"/></a:accent5><a:accent6><a:srgbClr val=\"F79646\"/></a:accent6><a:hlink><a:srgbClr val=\"0000FF\"/>\
|
||||
</a:hlink><a:folHlink><a:srgbClr val=\"800080\"/></a:folHlink></a:clrScheme>");
|
||||
</a:dk1><a:lt1><a:sysClr val=\"window\" lastClr=\"FFFFFF\"/></a:lt1><a:dk2><a:srgbClr val=\"1F497D\"/></a:dk2><a:lt2>\
|
||||
<a:srgbClr val=\"EEECE1\"/></a:lt2><a:accent1><a:srgbClr val=\"4F81BD\"/></a:accent1><a:accent2><a:srgbClr val=\"C0504D\"/>\
|
||||
</a:accent2><a:accent3><a:srgbClr val=\"9BBB59\"/></a:accent3><a:accent4><a:srgbClr val=\"8064A2\"/></a:accent4><a:accent5>\
|
||||
<a:srgbClr val=\"4BACC6\"/></a:accent5><a:accent6><a:srgbClr val=\"F79646\"/></a:accent6><a:hlink><a:srgbClr val=\"0000FF\"/>\
|
||||
</a:hlink><a:folHlink><a:srgbClr val=\"800080\"/></a:folHlink></a:clrScheme>");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -904,7 +916,7 @@ void PPT_FORMAT::CPPTXWriter::WriteColorScheme(CStringWriter& oStringWriter, con
|
||||
if (extra)
|
||||
{
|
||||
oStringWriter.WriteString(L"<a:clrMap bg1=\"lt1\" tx1=\"dk1\" bg2=\"lt2\" tx2=\"dk2\" accent1=\"accent1\" \
|
||||
accent2=\"accent2\" accent3=\"accent3\" accent4=\"accent4\" accent5=\"accent5\" accent6=\"accent6\" hlink=\"hlink\" folHlink=\"folHlink\"/>");
|
||||
accent2=\"accent2\" accent3=\"accent3\" accent4=\"accent4\" accent5=\"accent5\" accent6=\"accent6\" hlink=\"hlink\" folHlink=\"folHlink\"/>");
|
||||
oStringWriter.WriteString(L"</a:extraClrScheme>");
|
||||
}
|
||||
}
|
||||
@ -940,10 +952,10 @@ void PPT_FORMAT::CPPTXWriter::WriteTable(CStringWriter& oWriter, CRelsGenerator&
|
||||
oWriter.WriteString(m_pShapeWriter->ConvertTable());
|
||||
|
||||
oWriter.WriteString(m_pShapeWriter->ConvertTableCells());
|
||||
// for (size_t i = 0; i < pGroupElement->m_pChildElements.size(); i++)
|
||||
// {
|
||||
// WriteElement(oWriter, oRels, pGroupElement->m_pChildElements[i], pLayout);
|
||||
// }
|
||||
// for (size_t i = 0; i < pGroupElement->m_pChildElements.size(); i++)
|
||||
// {
|
||||
// WriteElement(oWriter, oRels, pGroupElement->m_pChildElements[i], pLayout);
|
||||
// }
|
||||
oWriter.WriteString(L"</a:tbl></a:graphicData></a:graphic></p:graphicFrame>");
|
||||
}
|
||||
void PPT_FORMAT::CPPTXWriter::WriteElement(CStringWriter& oWriter, CRelsGenerator& oRels, CElementPtr pElement, CLayout* pLayout)
|
||||
@ -973,12 +985,12 @@ void PPT_FORMAT::CPPTXWriter::WriteElement(CStringWriter& oWriter, CRelsGenerato
|
||||
for (size_t nIndex = 0; nIndex < nCountElements; ++nIndex)
|
||||
{
|
||||
if ((pElement->m_lPlaceholderType == pLayout->m_arElements[nIndex]->m_lPlaceholderType) &&
|
||||
(pElement->m_lPlaceholderID == pLayout->m_arElements[nIndex]->m_lPlaceholderID))
|
||||
(pElement->m_lPlaceholderID == pLayout->m_arElements[nIndex]->m_lPlaceholderID))
|
||||
{
|
||||
CElementPtr pElLayout = pLayout->m_arElements[nIndex];
|
||||
|
||||
bool bIsEqualTransform = ((pElement->m_dRotate == pElLayout->m_dRotate)
|
||||
&& (pElement->m_bFlipH == pElLayout->m_bFlipH) && (pElement->m_bFlipV == pElLayout->m_bFlipV));
|
||||
&& (pElement->m_bFlipH == pElLayout->m_bFlipH) && (pElement->m_bFlipV == pElLayout->m_bFlipV));
|
||||
|
||||
if (bIsEqualTransform)
|
||||
{
|
||||
@ -1021,7 +1033,7 @@ void PPT_FORMAT::CPPTXWriter::WriteLayout(CLayoutPtr pLayout, int nIndexLayout,
|
||||
|
||||
if ( pLayout->m_sName.empty() == false)
|
||||
oWriter.WriteString(std::wstring(L" name=\"") + pLayout->m_sName + std::wstring(L"\""));
|
||||
oWriter.WriteString(std::wstring(L">"));
|
||||
oWriter.WriteString(std::wstring(L">"));
|
||||
|
||||
if (pLayout->m_bIsBackground)
|
||||
{
|
||||
@ -1029,7 +1041,7 @@ void PPT_FORMAT::CPPTXWriter::WriteLayout(CLayoutPtr pLayout, int nIndexLayout,
|
||||
}
|
||||
|
||||
std::wstring strElems = _T("<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 start_index = 0;
|
||||
@ -1111,7 +1123,7 @@ void PPT_FORMAT::CPPTXWriter::WriteSlide(int nIndexSlide)
|
||||
}
|
||||
|
||||
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>"));
|
||||
|
||||
CGroupElement *pGroupElement = !pSlide->m_arElements.empty() ? dynamic_cast<CGroupElement *>(pSlide->m_arElements[0].get()) : NULL;
|
||||
|
||||
@ -1139,7 +1151,7 @@ void PPT_FORMAT::CPPTXWriter::WriteSlide(int nIndexSlide)
|
||||
WriteTransition(oWriter, pSlide->m_oSlideShow);
|
||||
|
||||
// TODO write new method and class for timing
|
||||
WriteTiming(oWriter, oRels, nIndexSlide);
|
||||
WriteTiming(oWriter, oRels, nIndexSlide);
|
||||
|
||||
|
||||
oWriter.WriteString(std::wstring(L"</p:sld>"));
|
||||
@ -1165,201 +1177,174 @@ void PPT_FORMAT::CPPTXWriter::WriteSlide(int nIndexSlide)
|
||||
void PPT_FORMAT::CPPTXWriter::WriteTransition(CStringWriter& oWriter, CSlideShowInfo &oSSInfo)
|
||||
{
|
||||
CTransition& transition = oSSInfo.m_oTransition;
|
||||
|
||||
if (transition.m_nEffectType == 0xFF) return;
|
||||
|
||||
std::wstring type;
|
||||
PPTX::Logic::Transition Tr;
|
||||
|
||||
std::wstring param_name, param_value;
|
||||
std::wstring param_name2, param_value2;
|
||||
|
||||
switch(transition.m_nEffectType)
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
type = L"p:cut";
|
||||
param_name = L"thruBlk";
|
||||
param_value = transition.m_nEffectDirection ? L"true" : L"false";
|
||||
}break;
|
||||
case 1:
|
||||
case 17:
|
||||
case 18:
|
||||
case 19:
|
||||
case 22:
|
||||
case 23:
|
||||
case 27:
|
||||
{
|
||||
auto pTrBase = new PPTX::Logic::EmptyTransition();
|
||||
switch (transition.m_nEffectType)
|
||||
{
|
||||
type = L"p:random";
|
||||
}break;
|
||||
case 1: pTrBase->name = L"random"; break;
|
||||
case 17: pTrBase->name = L"diamond"; break;
|
||||
case 18: pTrBase->name = L"plus"; break;
|
||||
case 19: pTrBase->name = L"wedge"; break;
|
||||
case 22: pTrBase->name = L"newsflash"; break;
|
||||
case 23: pTrBase->name = L"fade"; break;
|
||||
case 27: pTrBase->name = L"circle"; break;
|
||||
}
|
||||
Tr.base.base.reset(pTrBase);
|
||||
}break;
|
||||
case 2:
|
||||
{
|
||||
type = L"p:blinds";
|
||||
param_name = L"dir";
|
||||
param_value = transition.m_nEffectDirection ? L"vert" : L"horz";
|
||||
}break;
|
||||
case 3:
|
||||
case 8:
|
||||
case 21:
|
||||
{
|
||||
auto pTrBase = new PPTX::Logic::OrientationTransition;
|
||||
switch (transition.m_nEffectType)
|
||||
{
|
||||
type = L"p:checker";
|
||||
param_name = L"dir";
|
||||
param_value = transition.m_nEffectDirection ? L"vert" : L"horz";
|
||||
}break;
|
||||
case 2: pTrBase->name = L"blinds"; break;
|
||||
case 3: pTrBase->name = L"checker"; break;
|
||||
case 8: pTrBase->name = L"randomBar"; break;
|
||||
case 21: pTrBase->name = L"comb"; break;
|
||||
}
|
||||
pTrBase->dir = new PPTX::Limit::Orient;
|
||||
pTrBase->dir->SetBYTECode(transition.m_nEffectDirection);
|
||||
Tr.base.base.reset(pTrBase);
|
||||
}break;
|
||||
case 0:
|
||||
case 5:
|
||||
{
|
||||
type = L"p:dissolve";
|
||||
param_name = L"thruBlk";
|
||||
param_value = transition.m_nEffectDirection ? L"true" : L"false";
|
||||
}break;
|
||||
case 6:
|
||||
{
|
||||
type = L"p:fade";
|
||||
param_name = L"thruBlk";
|
||||
param_value = transition.m_nEffectDirection ? L"true" : L"false";
|
||||
}break;
|
||||
{
|
||||
auto pTrBase = new PPTX::Logic::OptionalBlackTransition;
|
||||
if (transition.m_nEffectType == 0) param_name = L"cut";
|
||||
else if (transition.m_nEffectType == 5) param_name = L"dissolve";
|
||||
else if (transition.m_nEffectType == 6) param_name = L"fade";
|
||||
pTrBase->thruBlk = transition.m_nEffectDirection;
|
||||
}break;
|
||||
case 4:
|
||||
case 7:
|
||||
{
|
||||
auto pTrBase = new PPTX::Logic::EightDirectionTransition;
|
||||
if (transition.m_nEffectType == 4) pTrBase->name = L"cover";
|
||||
else if (transition.m_nEffectType == 7) pTrBase->name = L"pull";
|
||||
|
||||
pTrBase->dir = new PPTX::Limit::EightDirectionVal;
|
||||
switch(transition.m_nEffectDirection)
|
||||
{
|
||||
if (transition.m_nEffectType == 4) type = L"p:cover";
|
||||
if (transition.m_nEffectType == 7) type = L"p:pull";
|
||||
param_name = L"dir";
|
||||
switch(transition.m_nEffectDirection)
|
||||
{
|
||||
case 0: param_value = L"r"; break;
|
||||
case 1: param_value = L"b"; break;
|
||||
case 2: param_value = L"l"; break;
|
||||
case 3: param_value = L"t"; break;
|
||||
case 4: param_value = L"br"; break;
|
||||
case 5: param_value = L"bl"; break;
|
||||
case 6: param_value = L"tr"; break;
|
||||
case 7: param_value = L"tl"; break;
|
||||
}
|
||||
}break;
|
||||
case 8:
|
||||
{
|
||||
type = L"p:randomBars";
|
||||
param_name = L"dir";
|
||||
param_value = transition.m_nEffectDirection ? L"vert" : L"horz";
|
||||
}break;
|
||||
case 0: param_value = L"r"; break;
|
||||
case 1: param_value = L"b"; break;
|
||||
case 2: param_value = L"l"; break;
|
||||
case 3: param_value = L"t"; break;
|
||||
case 4: param_value = L"br"; break;
|
||||
case 5: param_value = L"bl"; break;
|
||||
case 6: param_value = L"tr"; break;
|
||||
case 7: param_value = L"tl"; break;
|
||||
}
|
||||
pTrBase->dir->set(param_value);
|
||||
Tr.base.base.reset(pTrBase);
|
||||
}break;
|
||||
case 9:
|
||||
{
|
||||
|
||||
auto pTrBase = new PPTX::Logic::CornerDirectionTransition;
|
||||
pTrBase->name = L"strips";
|
||||
pTrBase->dir = new PPTX::Limit::CornerDirectionVal;
|
||||
switch(transition.m_nEffectDirection)
|
||||
{
|
||||
type = L"p:strips";
|
||||
param_name = L"dir";
|
||||
switch(transition.m_nEffectDirection)
|
||||
{
|
||||
case 0: param_value = L"ru"; break;
|
||||
case 1: param_value = L"lu"; break;
|
||||
case 2: param_value = L"rd"; break;
|
||||
case 3: param_value = L"ld"; break;
|
||||
}
|
||||
}break;
|
||||
case 0: param_value = L"ru"; break;
|
||||
case 1: param_value = L"lu"; break;
|
||||
case 2: param_value = L"rd"; break;
|
||||
case 3: param_value = L"ld"; break;
|
||||
}
|
||||
pTrBase->dir->set(param_value);
|
||||
Tr.base.base.reset(pTrBase);
|
||||
}break;
|
||||
case 10:
|
||||
case 20:
|
||||
{
|
||||
if (transition.m_nEffectType == 10) type = L"p:wipe";
|
||||
if (transition.m_nEffectType == 20) type = L"p:push";
|
||||
{
|
||||
auto pTrBase = new PPTX::Logic::SideDirectionTransition;
|
||||
if (transition.m_nEffectType == 10) pTrBase->name = L"wipe";
|
||||
if (transition.m_nEffectType == 20) pTrBase->name = L"push";
|
||||
|
||||
param_name = L"dir";
|
||||
switch(transition.m_nEffectDirection)
|
||||
{
|
||||
case 0: param_value = L"l"; break;
|
||||
case 1: param_value = L"u"; break;
|
||||
case 2: param_value = L"r"; break;
|
||||
case 3: param_value = L"d"; break;
|
||||
}
|
||||
}break;
|
||||
pTrBase->dir = new PPTX::Limit::SideDirectionVal;
|
||||
switch(transition.m_nEffectDirection)
|
||||
{
|
||||
case 0: param_value = L"l"; break;
|
||||
case 1: param_value = L"u"; break;
|
||||
case 2: param_value = L"r"; break;
|
||||
case 3: param_value = L"d"; break;
|
||||
}
|
||||
pTrBase->dir->set(param_value);
|
||||
Tr.base.base.reset(pTrBase);
|
||||
}break;
|
||||
case 11:
|
||||
{
|
||||
type = L"p:zoom";
|
||||
param_name = L"dir";
|
||||
param_value = transition.m_nEffectDirection ? L"in" : L"out";
|
||||
}break;
|
||||
{
|
||||
auto pTrBase = new PPTX::Logic::ZoomTransition;
|
||||
pTrBase->dir = new PPTX::Limit::InOutDirectionVal;
|
||||
pTrBase->dir->SetBYTECode(!transition.m_nEffectDirection);
|
||||
Tr.base.base.reset(pTrBase);
|
||||
}break;
|
||||
case 13:
|
||||
{
|
||||
type = L"p:split";
|
||||
param_name = L"dir";
|
||||
param_name2 = L"orient";
|
||||
switch(transition.m_nEffectDirection)
|
||||
{
|
||||
case 0: param_value2 = L"horz"; param_value = L"out"; break;
|
||||
case 1: param_value2 = L"horz"; param_value = L"in"; break;
|
||||
case 2: param_value2 = L"vert"; param_value = L"out"; break;
|
||||
case 3: param_value2 = L"vert"; param_value = L"in"; break;
|
||||
}
|
||||
}break;
|
||||
case 17:
|
||||
{
|
||||
type = L"p:diamond";
|
||||
}break;
|
||||
case 18:
|
||||
{
|
||||
type = L"p:plus";
|
||||
}break;
|
||||
case 19:
|
||||
{
|
||||
type = L"p:wedge";
|
||||
}break;
|
||||
{
|
||||
auto pTrBase = new PPTX::Logic::SplitTransition;
|
||||
pTrBase->dir = new PPTX::Limit::InOutDirectionVal;
|
||||
pTrBase->orient = new PPTX::Limit::Orient;
|
||||
|
||||
case 21:
|
||||
switch(transition.m_nEffectDirection)
|
||||
{
|
||||
type = L"p:comb";
|
||||
param_name = L"dir";
|
||||
param_value = transition.m_nEffectDirection ? L"vert" : L"horz";
|
||||
}break;
|
||||
case 22:
|
||||
{
|
||||
type = L"p:newsflash";
|
||||
}break;
|
||||
case 23:
|
||||
{
|
||||
type = L"p:fade";
|
||||
// p:alphaFade
|
||||
}break;
|
||||
case 0: param_value2 = L"horz"; param_value = L"out"; break;
|
||||
case 1: param_value2 = L"horz"; param_value = L"in"; break;
|
||||
case 2: param_value2 = L"vert"; param_value = L"out"; break;
|
||||
case 3: param_value2 = L"vert"; param_value = L"in"; break;
|
||||
}
|
||||
pTrBase->dir->set(param_value);
|
||||
pTrBase->orient->set(param_value2);
|
||||
|
||||
Tr.base.base.reset(pTrBase);
|
||||
}break;
|
||||
case 26:
|
||||
{
|
||||
type = L"p:wheel";
|
||||
param_name = L"spokes";
|
||||
param_value = std::to_wstring(transition.m_nEffectDirection);
|
||||
}break;
|
||||
case 27:
|
||||
{
|
||||
type = L"p:circle";
|
||||
}break;
|
||||
{
|
||||
auto pTrBase = new PPTX::Logic::WheelTransition;
|
||||
pTrBase->spokes = transition.m_nEffectDirection;
|
||||
Tr.base.base.reset(pTrBase);
|
||||
}break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if (type.empty()) return;
|
||||
oWriter.WriteString(std::wstring(L"<p:transition"));
|
||||
switch (transition.m_nSpeed)
|
||||
{
|
||||
// TODO check this moment. Always write fast
|
||||
case 0x00: oWriter.WriteString(L" spd=\"fast\""); break;
|
||||
case 0x01: oWriter.WriteString(L" spd=\"med\""); break;
|
||||
case 0x02:
|
||||
default: oWriter.WriteString(L" spd=\"slow\""); break;
|
||||
}
|
||||
if (oSSInfo.m_bOnlyClick == false)
|
||||
{
|
||||
oWriter.WriteString(L" advClick=\"0\"");
|
||||
}
|
||||
if (oSSInfo.m_dSlideDuration != 0)
|
||||
{
|
||||
std::wstring sAdvTm = std::to_wstring((long)(oSSInfo.m_dSlideDuration));
|
||||
oWriter.WriteString(L" advTm=\"" + sAdvTm + L"\"");
|
||||
}
|
||||
oWriter.WriteString(L">");
|
||||
oWriter.WriteString(L"<" + type);
|
||||
if (!param_name.empty() && !param_value.empty())
|
||||
{
|
||||
oWriter.WriteString(L" " + param_name + L"=\"" + param_value + L"\"");
|
||||
}
|
||||
if (!param_name2.empty() && !param_value2.empty())
|
||||
{
|
||||
oWriter.WriteString(L" " + param_name2 + L"=\"" + param_value2 + L"\"");
|
||||
}
|
||||
oWriter.WriteString(L"/>");
|
||||
Tr.spd = new PPTX::Limit::TransitionSpeed;
|
||||
// "2 -" переворот числа
|
||||
Tr.spd->SetBYTECode(2 - transition.m_nSpeed);
|
||||
|
||||
Tr.advClick = oSSInfo.m_bManulClick;
|
||||
|
||||
if (oSSInfo.m_bAdvClick &&
|
||||
oSSInfo.m_dSlideDuration >= 0 &&
|
||||
oSSInfo.m_dSlideDuration <= 86399000)
|
||||
{
|
||||
Tr.advTm = oSSInfo.m_dSlideDuration;
|
||||
}
|
||||
if (transition.m_bAudioPresent)
|
||||
{
|
||||
bool bExternal = false;
|
||||
std::wstring rId = m_pShapeWriter->m_pRels->WriteAudio(transition.m_oAudio.m_strAudioFileName, bExternal);
|
||||
oWriter.WriteString(std::wstring(L"<p:sndAc><p:stSnd>"));
|
||||
oWriter.WriteString(L"<p:snd r:embed=\"" + rId + L"\" name=\"" + transition.m_oAudio.m_sImageName + L"\"/>");
|
||||
oWriter.WriteString(std::wstring(L"</p:stSnd></p:sndAc>"));
|
||||
Tr.sndAc = new PPTX::Logic::SndAc;
|
||||
Tr.sndAc->stSnd = new PPTX::Logic::StSnd;
|
||||
Tr.sndAc->stSnd->name = XmlUtils::EncodeXmlString(transition.m_oAudio.m_sImageName);
|
||||
Tr.sndAc->stSnd->embed = rId;
|
||||
}
|
||||
oWriter.WriteString(std::wstring(L"</p:transition>"));
|
||||
oWriter.WriteString(Tr.toXML());
|
||||
}
|
||||
|
||||
void PPT_FORMAT::CPPTXWriter::WriteNotes(int nIndexNotes)
|
||||
@ -1385,7 +1370,7 @@ void PPT_FORMAT::CPPTXWriter::WriteNotes(int nIndexNotes)
|
||||
}
|
||||
|
||||
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>"));
|
||||
|
||||
CGroupElement *pGroupElement = !pNotes->m_arElements.empty() ? dynamic_cast<CGroupElement *>(pNotes->m_arElements[0].get()) : NULL;
|
||||
|
||||
|
||||
@ -813,11 +813,12 @@ void CPPTUserInfo::LoadSlide(_UINT32 dwSlideID, CSlide* pSlide)
|
||||
pTransition->m_bLoopSound = pAtom->m_bLoopSound;
|
||||
pTransition->m_bStopSound = pAtom->m_bStopSound;
|
||||
pTransition->m_nEffectDirection = pAtom->m_nEffectDirection;
|
||||
pTransition->m_nEffectType = pAtom->m_nEffectType; // тут нужно сконвертить тип
|
||||
pTransition->m_nEffectType = pAtom->m_nEffectType; // тут нужно сконвертить тип // конвертится в Converter.cpp
|
||||
pTransition->m_nSpeed = pAtom->m_nSpeed;
|
||||
|
||||
pSlide->m_oSlideShow.m_dSlideDuration = pAtom->m_nSlideTime;
|
||||
pSlide->m_oSlideShow.m_bOnlyClick = ! (pAtom->m_bAutoAdvance);
|
||||
pSlide->m_oSlideShow.m_bManulClick = pAtom->m_bManualAdvance;
|
||||
pSlide->m_oSlideShow.m_bAdvClick = pAtom->m_bAutoAdvance;
|
||||
}
|
||||
|
||||
CSlideShowSlideInfoAtom* pAtom = &pRecordSlide->m_oSlideShowSlideInfoAtom;
|
||||
|
||||
@ -78,6 +78,7 @@ public:
|
||||
CRecordTimeSequenceDataAtom* m_pTimeSequenceDataAtom; // OPTIONAL
|
||||
|
||||
std::vector<CRecordTimeConditionContainer*> m_arrRgBeginTimeCondition; // OPTIONAL
|
||||
std::vector<CRecordTimeConditionContainer*> m_arrRgNextTimeCondition; // OPTIONAL // Same as m_arrRgBeginTimeCondition in ms-ppt
|
||||
std::vector<CRecordTimeConditionContainer*> m_arrRgEndTimeCondition; // OPTIONAL
|
||||
CRecordTimeConditionContainer* m_pTimeEndSyncTimeCondition; // OPTIONAL
|
||||
|
||||
@ -162,6 +163,9 @@ public:
|
||||
for ( size_t i = 0; i < m_arrRgBeginTimeCondition.size(); ++i )
|
||||
RELEASEOBJECT ( m_arrRgBeginTimeCondition[i] );
|
||||
|
||||
for ( size_t i = 0; i < m_arrRgNextTimeCondition.size(); ++i )
|
||||
RELEASEOBJECT ( m_arrRgNextTimeCondition[i] );
|
||||
|
||||
for ( size_t i = 0; i < m_arrRgEndTimeCondition.size(); ++i )
|
||||
RELEASEOBJECT ( m_arrRgEndTimeCondition[i] );
|
||||
|
||||
@ -332,8 +336,14 @@ public:
|
||||
pTimeCondition->ReadFromStream(ReadHeader, pStream);
|
||||
unsigned short recInst = ReadHeader.RecInstance;
|
||||
|
||||
if (recInst == TL_CT_Begin || recInst == TL_CT_Next)
|
||||
if (recInst == TL_CT_Begin)
|
||||
{
|
||||
m_arrRgBeginTimeCondition.push_back(pTimeCondition);
|
||||
}
|
||||
else if (recInst == TL_CT_Next)
|
||||
{
|
||||
m_arrRgNextTimeCondition.push_back(pTimeCondition);
|
||||
}
|
||||
|
||||
else if (recInst == TL_CT_End || recInst == TL_CT_Previous)
|
||||
{
|
||||
|
||||
@ -36,102 +36,102 @@ class CSlideShowSlideInfoAtom : public CUnknownRecord
|
||||
{
|
||||
public:
|
||||
|
||||
INT m_nSlideTime;
|
||||
// We need to take it for rels and correct
|
||||
_UINT32 m_nSoundRef;
|
||||
INT m_nSlideTime;
|
||||
// We need to take it for rels and correct
|
||||
_UINT32 m_nSoundRef;
|
||||
|
||||
BYTE m_nEffectDirection;
|
||||
BYTE m_nEffectType;
|
||||
BYTE m_nEffectDirection;
|
||||
BYTE m_nEffectType;
|
||||
|
||||
bool m_bManualAdvance;
|
||||
// reserved1 (1 bit)
|
||||
bool m_bHidden;
|
||||
// reserved1 (1 bit)
|
||||
bool m_bSound;
|
||||
// reserved1 (1 bit)
|
||||
bool m_bLoopSound;
|
||||
// reserved1 (1 bit)
|
||||
bool m_bStopSound;
|
||||
// reserved1 (1 bit)
|
||||
bool m_bAutoAdvance;
|
||||
// reserved1 (1 bit)
|
||||
bool m_bCursorVisible;
|
||||
// reserved1 (3 bit)
|
||||
bool m_bManualAdvance;
|
||||
// reserved1 (1 bit)
|
||||
bool m_bHidden;
|
||||
// reserved1 (1 bit)
|
||||
bool m_bSound;
|
||||
// reserved1 (1 bit)
|
||||
bool m_bLoopSound;
|
||||
// reserved1 (1 bit)
|
||||
bool m_bStopSound;
|
||||
// reserved1 (1 bit)
|
||||
bool m_bAutoAdvance;
|
||||
// reserved1 (1 bit)
|
||||
bool m_bCursorVisible;
|
||||
// reserved1 (3 bit)
|
||||
|
||||
BYTE m_nSpeed;
|
||||
BYTE m_nSpeed;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
CSlideShowSlideInfoAtom()
|
||||
{
|
||||
m_nSlideTime = -1;
|
||||
m_nSoundRef = 0xFFFFFFFE;
|
||||
|
||||
m_nEffectDirection = 0;
|
||||
m_nEffectType = 0;
|
||||
|
||||
m_bManualAdvance = false;
|
||||
m_bHidden = false;
|
||||
m_bSound = false;
|
||||
m_bLoopSound = false;
|
||||
m_bStopSound = false;
|
||||
m_bAutoAdvance = false;
|
||||
m_bCursorVisible = false;
|
||||
CSlideShowSlideInfoAtom()
|
||||
{
|
||||
m_nSlideTime = -1;
|
||||
m_nSoundRef = 0xFFFFFFFE;
|
||||
|
||||
m_nSpeed = 1;
|
||||
}
|
||||
m_nEffectDirection = 0;
|
||||
m_nEffectType = 0;
|
||||
|
||||
~CSlideShowSlideInfoAtom()
|
||||
{
|
||||
}
|
||||
m_bManualAdvance = false;
|
||||
m_bHidden = false;
|
||||
m_bSound = false;
|
||||
m_bLoopSound = false;
|
||||
m_bStopSound = false;
|
||||
m_bAutoAdvance = false;
|
||||
m_bCursorVisible = false;
|
||||
|
||||
virtual void ReadFromStream ( SRecordHeader & oHeader, POLE::Stream* pStream )
|
||||
{
|
||||
m_oHeader = oHeader;
|
||||
|
||||
m_nSlideTime = (INT)StreamUtils::ReadDWORD ( pStream );
|
||||
m_nSoundRef = StreamUtils::ReadDWORD ( pStream );
|
||||
|
||||
m_nEffectDirection = StreamUtils::ReadBYTE ( pStream );
|
||||
m_nEffectType = StreamUtils::ReadBYTE ( pStream );
|
||||
m_nSpeed = 1;
|
||||
}
|
||||
|
||||
BYTE bValue = StreamUtils::ReadBYTE ( pStream );
|
||||
|
||||
m_bManualAdvance = (0x01 == (0x01 & bValue));
|
||||
m_bHidden = (0x04 == (0x04 & bValue));
|
||||
m_bSound = (0x10 == (0x10 & bValue));
|
||||
m_bLoopSound = (0x40 == (0x40 & bValue));
|
||||
~CSlideShowSlideInfoAtom()
|
||||
{
|
||||
}
|
||||
|
||||
bValue = StreamUtils::ReadBYTE ( pStream );
|
||||
|
||||
m_bStopSound = (0x01 == (0x01 & bValue));
|
||||
m_bAutoAdvance = (0x04 == (0x04 & bValue));
|
||||
m_bCursorVisible = (0x10 == (0x10 & bValue));
|
||||
virtual void ReadFromStream ( SRecordHeader & oHeader, POLE::Stream* pStream )
|
||||
{
|
||||
m_oHeader = oHeader;
|
||||
|
||||
//_UINT32 dwValue = StreamUtils::ReadDWORD ( pStream );
|
||||
//m_nSpeed = ( 0x01 == ( 0x01 & ((BYTE)dwValue) ) );
|
||||
m_nSpeed = StreamUtils::ReadBYTE( pStream );
|
||||
StreamUtils::StreamSkip(3, pStream);
|
||||
}
|
||||
m_nSlideTime = (INT)StreamUtils::ReadDWORD ( pStream );
|
||||
m_nSoundRef = StreamUtils::ReadDWORD ( pStream );
|
||||
|
||||
double GetTimeTransition()
|
||||
{
|
||||
double dTime = 500.0;
|
||||
if (0 == m_nSpeed)
|
||||
{
|
||||
dTime = 750.0;
|
||||
}
|
||||
else if (2 == m_nSpeed)
|
||||
{
|
||||
dTime = 250.0;
|
||||
}
|
||||
m_nEffectDirection = StreamUtils::ReadBYTE ( pStream );
|
||||
m_nEffectType = StreamUtils::ReadBYTE ( pStream );
|
||||
|
||||
return dTime;
|
||||
}
|
||||
BYTE bValue = StreamUtils::ReadBYTE ( pStream );
|
||||
|
||||
double GetTimeSlide()
|
||||
{
|
||||
return (double)m_nSlideTime;
|
||||
}
|
||||
m_bManualAdvance = (0x01 == (0x01 & bValue));
|
||||
m_bHidden = (0x04 == (0x04 & bValue));
|
||||
m_bSound = (0x10 == (0x10 & bValue));
|
||||
m_bLoopSound = (0x40 == (0x40 & bValue));
|
||||
|
||||
bValue = StreamUtils::ReadBYTE ( pStream );
|
||||
|
||||
m_bStopSound = (0x01 == (0x01 & bValue));
|
||||
m_bAutoAdvance = (0x04 == (0x04 & bValue));
|
||||
m_bCursorVisible = (0x10 == (0x10 & bValue));
|
||||
|
||||
//_UINT32 dwValue = StreamUtils::ReadDWORD ( pStream );
|
||||
//m_nSpeed = ( 0x01 == ( 0x01 & ((BYTE)dwValue) ) );
|
||||
m_nSpeed = StreamUtils::ReadBYTE( pStream );
|
||||
StreamUtils::StreamSkip(3, pStream);
|
||||
}
|
||||
|
||||
double GetTimeTransition()
|
||||
{
|
||||
double dTime = 500.0;
|
||||
if (0 == m_nSpeed)
|
||||
{
|
||||
dTime = 750.0;
|
||||
}
|
||||
else if (2 == m_nSpeed)
|
||||
{
|
||||
dTime = 250.0;
|
||||
}
|
||||
|
||||
return dTime;
|
||||
}
|
||||
|
||||
double GetTimeSlide()
|
||||
{
|
||||
return (double)m_nSlideTime;
|
||||
}
|
||||
};
|
||||
|
||||
@ -95,10 +95,6 @@ public:
|
||||
{
|
||||
m_bExistsTransition = true;
|
||||
m_oSlideShowSlideInfoAtom.ReadFromStream ( oRec, pStream );
|
||||
|
||||
// TODO : временно
|
||||
if ( 0 == m_oSlideShowSlideInfoAtom.m_nEffectType )
|
||||
m_bExistsTransition = false;
|
||||
|
||||
lCurLen += (8 + oRec.RecLen);
|
||||
continue;
|
||||
|
||||
@ -29,26 +29,17 @@
|
||||
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
*
|
||||
*/
|
||||
#ifndef ASC_OFFICE_PPTX_FILE
|
||||
#define ASC_OFFICE_PPTX_FILE
|
||||
#pragma once
|
||||
|
||||
#include "../DesktopEditor/common/ASCVariant.h"
|
||||
|
||||
#include "../Common/DocxFormat/Source/Base/Base.h"
|
||||
#include "PPTXFormat/PPTXEvent.h"
|
||||
|
||||
|
||||
typedef void (*load_from_resource) (void*, int, std::wstring&);
|
||||
typedef bool (*extract_to_directory) (void*, std::wstring&, std::wstring&);
|
||||
typedef bool (*compress_from_directory) (void*, std::wstring&, std::wstring&);
|
||||
typedef bool (*progress_operation) (void*, long, long);
|
||||
|
||||
namespace PPTX
|
||||
{
|
||||
class Document;
|
||||
}
|
||||
|
||||
class CPPTXFile : public PPTX::IPPTXEvent
|
||||
class CPPTXFile
|
||||
{
|
||||
private:
|
||||
PPTX::Document* m_pPptxDocument;
|
||||
@ -62,43 +53,31 @@ private:
|
||||
std::wstring m_strEmbeddedFontsDirectory;
|
||||
|
||||
std::wstring m_strFolderThemes;
|
||||
|
||||
bool m_bIsNoBase64;
|
||||
|
||||
extract_to_directory m_fCallbackExtract;
|
||||
compress_from_directory m_fCallbackCompress;
|
||||
progress_operation m_fCallbackProgress;
|
||||
void* m_pCallbackArg;
|
||||
bool m_bIsMacro;
|
||||
public:
|
||||
|
||||
CPPTXFile(extract_to_directory fCallbackExtract, compress_from_directory fCallbackCompress, progress_operation fCallbackProgress, void* pCallbackArg);
|
||||
|
||||
CPPTXFile();
|
||||
~CPPTXFile();
|
||||
|
||||
_UINT32 LoadFromFile(std::wstring sSrcFileName, std::wstring sDstPath, std::wstring sXMLOptions);
|
||||
|
||||
_UINT32 SaveToFile(std::wstring sDstFileName, std::wstring sSrcPath, std::wstring sXMLOptions);
|
||||
|
||||
HRESULT get_TempDirectory(std::wstring* pVal);
|
||||
void get_TempDirectory(std::wstring* pVal);
|
||||
HRESULT put_TempDirectory(std::wstring newVal);
|
||||
|
||||
HRESULT GetDVDXml (std::wstring* pbstrPTTXml);
|
||||
HRESULT GetBluRayXml (std::wstring* pbstrDVDXml);
|
||||
|
||||
HRESULT get_DrawingXml (std::wstring* pVal);
|
||||
|
||||
virtual bool Progress (long ID, long Percent);
|
||||
|
||||
void SetEmbeddedFontsDirectory(std::wstring val);
|
||||
|
||||
// to PPTY
|
||||
HRESULT SetMediaDir (std::wstring bsMediaDir);
|
||||
HRESULT SetFontDir (std::wstring bsFontDir);
|
||||
HRESULT SetThemesDir (std::wstring bsDir);
|
||||
HRESULT SetUseSystemFonts (bool useSystemFonts);
|
||||
void SetIsNoBase64 (bool bIsNoBase64);
|
||||
|
||||
void SetMediaDir (std::wstring bsMediaDir);
|
||||
void SetFontDir (std::wstring bsFontDir);
|
||||
void SetThemesDir (std::wstring bsDir);
|
||||
void SetUseSystemFonts (bool useSystemFonts);
|
||||
|
||||
void SetIsNoBase64 (bool val);
|
||||
void SetMacroEnabled (bool val);
|
||||
|
||||
_UINT32 OpenFileToPPTY (std::wstring bsInput, std::wstring bsOutput);
|
||||
_UINT32 OpenDirectoryToPPTY (std::wstring bsInput, std::wstring bsOutput);
|
||||
_UINT32 ConvertPPTYToPPTX (std::wstring bsInput, std::wstring bsOutput, std::wstring bsThemesFolder);
|
||||
};
|
||||
#endif //ASC_OFFICE_PPTX_FILE
|
||||
|
||||
@ -49,7 +49,7 @@
|
||||
#include "PPTXFormat/PPTXEvent.h"
|
||||
#include "../Common/OfficeFileErrorDescription.h"
|
||||
|
||||
CPPTXFile::CPPTXFile(extract_to_directory fCallbackExtract, compress_from_directory fCallbackCompress, progress_operation fCallbackProgress, void* pCallbackArg)
|
||||
CPPTXFile::CPPTXFile()
|
||||
{
|
||||
#if defined(_WIN32) || defined (_WIN64)
|
||||
WCHAR buffer[4096];
|
||||
@ -61,20 +61,10 @@ CPPTXFile::CPPTXFile(extract_to_directory fCallbackExtract, compress_from_direct
|
||||
#else
|
||||
m_strTempDir = NSDirectory::GetTempPath() + L"_PPTX/";
|
||||
#endif
|
||||
//
|
||||
m_strFontDirectory = _T("");
|
||||
m_strMediaDirectory = _T("");
|
||||
|
||||
m_bIsUseSystemFonts = false;
|
||||
m_strEmbeddedFontsDirectory = _T("");
|
||||
|
||||
m_strFolderThemes = _T("");
|
||||
m_bIsNoBase64 = false;
|
||||
|
||||
//m_fCallbackResource = fCallbackResource;
|
||||
m_fCallbackExtract = fCallbackExtract;
|
||||
m_fCallbackCompress = fCallbackCompress;
|
||||
m_fCallbackProgress = fCallbackProgress;
|
||||
m_pCallbackArg = pCallbackArg;
|
||||
m_bIsMacro = false;
|
||||
|
||||
m_pPptxDocument = NULL;
|
||||
}
|
||||
@ -101,15 +91,8 @@ _UINT32 CPPTXFile::LoadFromFile(std::wstring sSrcFileName, std::wstring sDstPath
|
||||
localTempDir = m_strTempDir;
|
||||
|
||||
std::wstring srcFileName = sSrcFileName;
|
||||
if (m_pCallbackArg)
|
||||
{
|
||||
if(!m_fCallbackExtract(m_pCallbackArg, srcFileName , localTempDir))
|
||||
return AVS_FILEUTILS_ERROR_CONVERT;
|
||||
}
|
||||
else
|
||||
{
|
||||
localTempDir = sSrcFileName;
|
||||
}
|
||||
|
||||
localTempDir = sSrcFileName;
|
||||
|
||||
RELEASEOBJECT(m_pPptxDocument);
|
||||
m_pPptxDocument = new PPTX::Document();
|
||||
@ -119,10 +102,8 @@ _UINT32 CPPTXFile::LoadFromFile(std::wstring sSrcFileName, std::wstring sDstPath
|
||||
RELEASEOBJECT(m_pPptxDocument);
|
||||
return AVS_FILEUTILS_ERROR_CONVERT;
|
||||
}
|
||||
m_pPptxDocument->read(localTempDir, (PPTX::IPPTXEvent*)this);
|
||||
if(GetPercent() < 1000000)
|
||||
if(false == m_pPptxDocument->read(localTempDir))
|
||||
{
|
||||
RELEASEOBJECT(m_pPptxDocument);
|
||||
return AVS_FILEUTILS_ERROR_CONVERT;
|
||||
}
|
||||
smart_ptr<PPTX::Presentation> presentation = m_pPptxDocument->Get(OOX::Presentation::FileTypes::Presentation).smart_dynamic_cast<PPTX::Presentation>();
|
||||
@ -148,14 +129,11 @@ _UINT32 CPPTXFile::SaveToFile(std::wstring sDstFileName, std::wstring sSrcPath,
|
||||
oPath.m_strFilename = std::wstring(sSrcPath);
|
||||
m_pPptxDocument->write(oPath);
|
||||
|
||||
std::wstring srcFilePath = sSrcPath;
|
||||
std::wstring dstFileName = sDstFileName;
|
||||
return m_fCallbackCompress ? (m_fCallbackCompress(m_pCallbackArg, srcFilePath, dstFileName) ? 0 : AVS_FILEUTILS_ERROR_CONVERT) : 0;
|
||||
return 0;
|
||||
}
|
||||
HRESULT CPPTXFile::get_TempDirectory(std::wstring* pVal)
|
||||
void CPPTXFile::get_TempDirectory(std::wstring* pVal)
|
||||
{
|
||||
*pVal = m_strTempDir;
|
||||
return S_OK;
|
||||
}
|
||||
HRESULT CPPTXFile::put_TempDirectory(std::wstring newVal)
|
||||
{
|
||||
@ -179,64 +157,33 @@ HRESULT CPPTXFile::put_TempDirectory(std::wstring newVal)
|
||||
#endif
|
||||
return S_FALSE;
|
||||
}
|
||||
HRESULT CPPTXFile::GetDVDXml(std::wstring* pbstrPTTXml)
|
||||
{
|
||||
return S_OK;
|
||||
}
|
||||
HRESULT CPPTXFile::GetBluRayXml(std::wstring* pbstrDVDXml)
|
||||
{
|
||||
return S_OK;
|
||||
}
|
||||
HRESULT CPPTXFile::get_DrawingXml(std::wstring* pVal)
|
||||
{
|
||||
if ((NULL == m_pPptxDocument) || (NULL == pVal))
|
||||
return S_FALSE;
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
void CPPTXFile::SetEmbeddedFontsDirectory(std::wstring val)
|
||||
{
|
||||
m_strEmbeddedFontsDirectory = val;
|
||||
}
|
||||
|
||||
|
||||
bool CPPTXFile::Progress(long ID, long Percent)
|
||||
{
|
||||
percent = Percent;
|
||||
if (m_pCallbackArg == NULL)
|
||||
{
|
||||
if (Percent == 1000000 ) return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
return m_fCallbackProgress(m_pCallbackArg, ID, Percent);
|
||||
}
|
||||
|
||||
// to PPTY
|
||||
HRESULT CPPTXFile::SetMediaDir(std::wstring bsMediaDir)
|
||||
void CPPTXFile::SetMediaDir(std::wstring bsMediaDir)
|
||||
{
|
||||
m_strMediaDirectory = bsMediaDir;
|
||||
return S_OK;
|
||||
}
|
||||
HRESULT CPPTXFile::SetFontDir(std::wstring bsFontDir)
|
||||
void CPPTXFile::SetFontDir(std::wstring bsFontDir)
|
||||
{
|
||||
m_strFontDirectory = bsFontDir;
|
||||
return S_OK;
|
||||
}
|
||||
HRESULT CPPTXFile::SetThemesDir(std::wstring bsDir)
|
||||
void CPPTXFile::SetThemesDir(std::wstring bsDir)
|
||||
{
|
||||
m_strFolderThemes = bsDir;
|
||||
return S_OK;
|
||||
}
|
||||
HRESULT CPPTXFile::SetUseSystemFonts(bool val)
|
||||
void CPPTXFile::SetUseSystemFonts(bool val)
|
||||
{
|
||||
m_bIsUseSystemFonts = val;
|
||||
return S_OK;
|
||||
}
|
||||
void CPPTXFile::SetIsNoBase64(bool bIsNoBase64)
|
||||
void CPPTXFile::SetIsNoBase64(bool val)
|
||||
{
|
||||
m_bIsNoBase64 = bIsNoBase64;
|
||||
m_bIsNoBase64 = val;
|
||||
}
|
||||
void CPPTXFile::SetMacroEnabled(bool val)
|
||||
{
|
||||
m_bIsMacro = val;
|
||||
}
|
||||
_UINT32 CPPTXFile::OpenFileToPPTY(std::wstring bsInput, std::wstring bsOutput)
|
||||
{
|
||||
@ -247,32 +194,7 @@ _UINT32 CPPTXFile::OpenFileToPPTY(std::wstring bsInput, std::wstring bsOutput)
|
||||
|
||||
NSDirectory::CreateDirectory(m_strTempDir);
|
||||
|
||||
OOX::CPath pathLocalInputTemp = NSDirectory::CreateDirectoryWithUniqueName(m_strTempDir);
|
||||
|
||||
bool notDeleteInput = false;
|
||||
|
||||
if (m_fCallbackExtract)
|
||||
{
|
||||
std::wstring strInput = bsInput;
|
||||
std::wstring strOutput = pathLocalInputTemp.GetPath();
|
||||
|
||||
if(!m_fCallbackExtract(m_pCallbackArg, strInput , strOutput))
|
||||
{
|
||||
pathLocalInputTemp = bsInput;
|
||||
notDeleteInput = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
pathLocalInputTemp = bsInput;
|
||||
notDeleteInput = true;
|
||||
}
|
||||
std::wstring bsLocalInputTemp= pathLocalInputTemp.GetPath();
|
||||
|
||||
_UINT32 hr = OpenDirectoryToPPTY(bsLocalInputTemp, bsOutput);
|
||||
|
||||
if (notDeleteInput == false)
|
||||
NSDirectory::DeleteDirectory(pathLocalInputTemp.GetPath());
|
||||
_UINT32 hr = OpenDirectoryToPPTY(bsInput, bsOutput);
|
||||
|
||||
return hr;
|
||||
}
|
||||
@ -289,8 +211,8 @@ _UINT32 CPPTXFile::OpenDirectoryToPPTY(std::wstring bsInput, std::wstring bsOutp
|
||||
return AVS_FILEUTILS_ERROR_CONVERT;
|
||||
}
|
||||
|
||||
m_pPptxDocument->read(pathInputDirectory.GetPath() + FILE_SEPARATOR_STR, (PPTX::IPPTXEvent*)this);
|
||||
if(GetPercent() < 1000000)
|
||||
bool res = m_pPptxDocument->read(pathInputDirectory.GetPath() + FILE_SEPARATOR_STR);
|
||||
if (false == res)
|
||||
{
|
||||
RELEASEOBJECT(m_pPptxDocument);
|
||||
return AVS_FILEUTILS_ERROR_CONVERT;
|
||||
@ -338,23 +260,10 @@ _UINT32 CPPTXFile::OpenDirectoryToPPTY(std::wstring bsInput, std::wstring bsOutp
|
||||
|
||||
_UINT32 CPPTXFile::ConvertPPTYToPPTX(std::wstring bsInput, std::wstring bsOutput, std::wstring bsThemesFolder)//bsOutput и файл и директория может быть
|
||||
{
|
||||
OOX::CPath pathLocalTempDirectory;
|
||||
OOX::CPath pathLocalTempDirectory = bsOutput; //выходной файл - папка
|
||||
|
||||
if (m_fCallbackCompress)//если компрессора нет - конвертим в назначеную директорию
|
||||
pathLocalTempDirectory = m_strTempDir ;
|
||||
else
|
||||
pathLocalTempDirectory = bsOutput; //выходной файл - папка
|
||||
|
||||
#ifdef _DEBUG
|
||||
#if defined(_WIN32) || defined (_WIN64)
|
||||
if (m_fCallbackCompress)
|
||||
pathLocalTempDirectory = _T("C:\\PPTMemory\\PPTX_test");
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
NSBinPptxRW::CPPTXWriter oWriter;
|
||||
oWriter.Init(pathLocalTempDirectory.GetPath());
|
||||
oWriter.Init(pathLocalTempDirectory.GetPath(), m_bIsMacro);
|
||||
|
||||
CFile oFileBinary;
|
||||
oFileBinary.OpenFile((std::wstring)bsInput);
|
||||
@ -379,15 +288,5 @@ _UINT32 CPPTXFile::ConvertPPTYToPPTX(std::wstring bsInput, std::wstring bsOutput
|
||||
|
||||
RELEASEARRAYOBJECTS(pSrcBuffer);
|
||||
|
||||
|
||||
if (m_fCallbackCompress)
|
||||
{
|
||||
std::wstring strOutput = bsOutput;
|
||||
std::wstring strInput = pathLocalTempDirectory.GetPath();
|
||||
|
||||
hRes = m_fCallbackCompress(m_pCallbackArg, strInput, strOutput) ? 0 : AVS_FILEUTILS_ERROR_CONVERT;
|
||||
|
||||
NSDirectory::DeleteDirectory(strInput);
|
||||
}
|
||||
return hRes;
|
||||
}
|
||||
|
||||
@ -98,13 +98,15 @@ namespace PPT_FORMAT
|
||||
|
||||
CTransition m_oTransition; // переход
|
||||
|
||||
bool m_bOnlyClick; // переход на следующий по щелчку
|
||||
bool m_bAdvClick; // разрешить автопереход по времени
|
||||
bool m_bManulClick; // переход на следующий по щелчку
|
||||
|
||||
CSlideShowInfo() : m_oTransition()
|
||||
{
|
||||
m_dSlideDuration = 30000.0;
|
||||
m_bHidden = false;
|
||||
m_bOnlyClick = false;
|
||||
m_dSlideDuration = -1.0;
|
||||
m_bHidden = false;
|
||||
m_bAdvClick = false;
|
||||
m_bManulClick = true;
|
||||
}
|
||||
~CSlideShowInfo()
|
||||
{
|
||||
@ -114,7 +116,7 @@ namespace PPT_FORMAT
|
||||
{
|
||||
m_dSlideDuration = oSrc.m_dSlideDuration;
|
||||
m_bHidden = oSrc.m_bHidden;
|
||||
m_bOnlyClick = oSrc.m_bOnlyClick;
|
||||
m_bAdvClick = oSrc.m_bAdvClick;
|
||||
|
||||
m_oTransition = oSrc.m_oTransition;
|
||||
return *this;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -154,7 +154,7 @@ namespace PPTX
|
||||
return _T("");
|
||||
return p->filename().m_strFilename;
|
||||
}
|
||||
void FileContainer::read(const OOX::CRels& rels, const OOX::CPath& path, FileMap& map, IPPTXEvent* Event)
|
||||
void FileContainer::read(const OOX::CRels& rels, const OOX::CPath& path, FileMap& map)
|
||||
{
|
||||
bool bIsSlide = false;
|
||||
OOX::File* pSrcFile = dynamic_cast<OOX::File*>(this);
|
||||
@ -197,8 +197,6 @@ namespace PPTX
|
||||
}
|
||||
else
|
||||
{
|
||||
long percent = Event ? Event->GetPercent() : 0;
|
||||
|
||||
smart_ptr<OOX::File> file = PPTX::FileFactory::CreateFilePPTX(normPath, *pRelation, map, OOX::IFileContainer::m_pMainDocument);
|
||||
|
||||
if (file.IsInit() == false)
|
||||
@ -209,20 +207,10 @@ namespace PPTX
|
||||
|
||||
smart_ptr<FileContainer> pContainer = file.smart_dynamic_cast<FileContainer>();
|
||||
|
||||
if (Event) Event->Progress(0, percent + m_lPercent);
|
||||
|
||||
if (pContainer.IsInit())
|
||||
{
|
||||
pContainer->m_lPercent = m_lPercent;
|
||||
if (Event) Event->AddPercent(m_lPercent);
|
||||
|
||||
pContainer->read(normPath, map, Event);
|
||||
m_bCancelled = pContainer->m_bCancelled;
|
||||
pContainer->read(normPath, map);
|
||||
}
|
||||
if (m_bCancelled)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -312,11 +300,11 @@ namespace PPTX
|
||||
}
|
||||
}
|
||||
|
||||
void FileContainer::read(const OOX::CPath& filename, FileMap& map, IPPTXEvent* Event)
|
||||
void FileContainer::read(const OOX::CPath& filename, FileMap& map)
|
||||
{
|
||||
OOX::CRels rels(filename);
|
||||
OOX::CPath path = filename.GetDirectory();
|
||||
read(rels, path, map, Event);
|
||||
read(rels, path, map);
|
||||
}
|
||||
|
||||
OOX::CPath FileContainer::CorrectPathRels(const OOX::CPath& path, OOX::Rels::CRelationShip* relation )
|
||||
|
||||
@ -49,8 +49,6 @@ namespace PPTX
|
||||
public:
|
||||
FileContainer(OOX::Document *pMain) : OOX::IFileContainer(pMain)
|
||||
{
|
||||
m_lPercent = 0;
|
||||
m_bCancelled = false;
|
||||
}
|
||||
virtual ~FileContainer()
|
||||
{
|
||||
@ -67,17 +65,14 @@ namespace PPTX
|
||||
void read(const OOX::CPath& filename);
|
||||
void read(const OOX::CRels& rels, const OOX::CPath& path);
|
||||
|
||||
void read(const OOX::CPath& filename, FileMap& map, IPPTXEvent* Event);
|
||||
void read(const OOX::CRels& rels, const OOX::CPath& path, FileMap& map, IPPTXEvent* Event);
|
||||
void read(const OOX::CPath& filename, FileMap& map);
|
||||
void read(const OOX::CRels& rels, const OOX::CPath& path, FileMap& map);
|
||||
|
||||
void write(const OOX::CPath& filename, const OOX::CPath& directory, OOX::CContentTypes& content) const;
|
||||
void write(OOX::CRels& rels, const OOX::CPath& current, const OOX::CPath& directory, OOX::CContentTypes& content) const;
|
||||
|
||||
void WrittenSetFalse();
|
||||
OOX::CPath CorrectPathRels(const OOX::CPath& path, OOX::Rels::CRelationShip* relation );
|
||||
|
||||
long m_lPercent;
|
||||
bool m_bCancelled;
|
||||
};
|
||||
|
||||
} // namespace PPTX
|
||||
|
||||
@ -51,28 +51,22 @@ namespace PPTX
|
||||
{
|
||||
}
|
||||
|
||||
Document::Document(const OOX::CPath& path, IPPTXEvent* Event) : FileContainer(this)
|
||||
Document::Document(const OOX::CPath& path) : FileContainer(this)
|
||||
{
|
||||
read(path, Event);
|
||||
read(path);
|
||||
}
|
||||
|
||||
void Document::read(const OOX::CPath& path, IPPTXEvent* Event)
|
||||
bool Document::read(const OOX::CPath& path)
|
||||
{
|
||||
OOX::CRels rels(path);
|
||||
PPTX::FileMap map;
|
||||
long files = CountFiles(path);
|
||||
if(files == 0)
|
||||
return;
|
||||
return false;
|
||||
|
||||
m_sDocumentPath = path.GetPath();
|
||||
|
||||
m_lPercent = (long)floor(1000000. / files);
|
||||
FileContainer::read(rels, path, map, Event);
|
||||
|
||||
long percent = Event ? Event->GetPercent() : 0;
|
||||
|
||||
if(m_bCancelled && percent < 1000000)
|
||||
return;
|
||||
FileContainer::read(rels, path, map);
|
||||
|
||||
smart_ptr<PPTX::Presentation> _presentation = FileContainer::Get(OOX::Presentation::FileTypes::Presentation).smart_dynamic_cast<PPTX::Presentation>();
|
||||
if (_presentation.is_init())
|
||||
@ -164,9 +158,7 @@ namespace PPTX
|
||||
pointer->ApplyRels();
|
||||
}
|
||||
}
|
||||
|
||||
if (Event)
|
||||
Event->Progress(0, 1000000);
|
||||
return true;
|
||||
}
|
||||
|
||||
void Document::write(const OOX::CPath& path)
|
||||
|
||||
@ -40,16 +40,14 @@ namespace PPTX
|
||||
{
|
||||
public:
|
||||
Document();
|
||||
Document(const OOX::CPath& path, IPPTXEvent* Event);
|
||||
Document(const OOX::CPath& path);
|
||||
|
||||
void read(const OOX::CPath& path, IPPTXEvent* Event);
|
||||
bool read(const OOX::CPath& path);
|
||||
void write(const OOX::CPath& path);
|
||||
void createFromTemplate(const OOX::CPath& path);
|
||||
|
||||
const bool isValid(const OOX::CPath& path) const;
|
||||
|
||||
//void extractPictures(const OOX::CPath& path);
|
||||
//void extractPictures(const OOX::CPath& source, const OOX::CPath& path);
|
||||
private:
|
||||
long CountFiles(const OOX::CPath& path);
|
||||
};
|
||||
|
||||
@ -30,10 +30,8 @@
|
||||
*
|
||||
*/
|
||||
#pragma once
|
||||
#ifndef PPTX_LOGIC_TABLECOL_INCLUDE_H_
|
||||
#define PPTX_LOGIC_TABLECOL_INCLUDE_H_
|
||||
|
||||
#include "./../../WrapperWritingElement.h"
|
||||
#include "../../WrapperWritingElement.h"
|
||||
|
||||
namespace PPTX
|
||||
{
|
||||
@ -120,5 +118,3 @@ namespace PPTX
|
||||
};
|
||||
} // namespace Logic
|
||||
} // namespace PPTX
|
||||
|
||||
#endif // PPTX_LOGIC_TABLECOL_INCLUDE_H_
|
||||
@ -345,14 +345,17 @@ namespace PPTX
|
||||
sectionLst->fromPPTY(pReader);
|
||||
}break;
|
||||
case 8:
|
||||
{
|
||||
m_pVbaProject = new OOX::VbaProject(File::m_pMainDocument);
|
||||
m_pVbaProject->fromPPTY(pReader);
|
||||
|
||||
smart_ptr<OOX::File> file = m_pVbaProject.smart_dynamic_cast<OOX::File>();
|
||||
FileContainer::Add(file);
|
||||
|
||||
m_bMacroEnabled = true;
|
||||
{
|
||||
if (m_bMacroEnabled)
|
||||
{
|
||||
m_pVbaProject = new OOX::VbaProject(File::m_pMainDocument);
|
||||
m_pVbaProject->fromPPTY(pReader);
|
||||
|
||||
smart_ptr<OOX::File> file = m_pVbaProject.smart_dynamic_cast<OOX::File>();
|
||||
FileContainer::Add(file);
|
||||
}
|
||||
else
|
||||
pReader->SkipRecord();
|
||||
}break;
|
||||
case 9:
|
||||
{
|
||||
|
||||
@ -76,6 +76,9 @@ mc:Ignorable=\"w14 w15 w16se wp14\">";
|
||||
|
||||
if (m_oDocument.m_pBackground)
|
||||
{
|
||||
if (PROP_DEF == m_oDocument.m_pBackground->m_nFillColor)
|
||||
m_oDocument.m_pBackground->m_nFillColor = 0xFFFFFF;
|
||||
|
||||
RtfColor color(m_oDocument.m_pBackground->m_nFillColor);
|
||||
|
||||
sResult += L"<w:background w:color=\"" + color.ToHexColor() + L"\">";
|
||||
|
||||
@ -57,10 +57,10 @@ namespace ComplexTypes
|
||||
{
|
||||
void CFormPr::FromXML(XmlUtils::CXmlNode& oNode)
|
||||
{
|
||||
XmlMacroReadAttributeBase( oNode, _T("w:key"), m_oKey );
|
||||
XmlMacroReadAttributeBase( oNode, _T("w:label"), m_oLabel );
|
||||
XmlMacroReadAttributeBase( oNode, _T("w:helpText"), m_oHelpText );
|
||||
XmlMacroReadAttributeBase( oNode, _T("w:required"), m_oRequired );
|
||||
XmlMacroReadAttributeBase( oNode, L"w:key", m_oKey );
|
||||
XmlMacroReadAttributeBase( oNode, L"w:label", m_oLabel );
|
||||
XmlMacroReadAttributeBase( oNode, L"w:helpText", m_oHelpText );
|
||||
XmlMacroReadAttributeBase( oNode, L"w:required", m_oRequired );
|
||||
}
|
||||
void CFormPr::FromXML(XmlUtils::CXmlLiteReader& oReader)
|
||||
{
|
||||
@ -74,25 +74,25 @@ namespace ComplexTypes
|
||||
std::wstring sResult;
|
||||
if(m_oKey.IsInit())
|
||||
{
|
||||
sResult += _T("w:key=\"") + XmlUtils::EncodeXmlString(m_oKey.get()) + _T("\" ");
|
||||
sResult += L"w:key=\"" + XmlUtils::EncodeXmlString(m_oKey.get()) + L"\" ";
|
||||
}
|
||||
if(m_oLabel.IsInit())
|
||||
{
|
||||
sResult += _T("w:label=\"") + XmlUtils::EncodeXmlString(m_oLabel.get()) + _T("\" ");
|
||||
sResult += L"w:label=\"" + XmlUtils::EncodeXmlString(m_oLabel.get()) + L"\" ";
|
||||
}
|
||||
if(m_oHelpText.IsInit())
|
||||
{
|
||||
sResult += _T("w:helpText=\"") + XmlUtils::EncodeXmlString(m_oHelpText.get()) + _T("\" ");
|
||||
sResult += L"w:helpText=\"" + XmlUtils::EncodeXmlString(m_oHelpText.get()) + L"\" ";
|
||||
}
|
||||
if(m_oRequired.IsInit())
|
||||
{
|
||||
if(*m_oRequired)
|
||||
{
|
||||
sResult += _T("w:required=\"1\" ");
|
||||
sResult += L"w:required=\"1\" ";
|
||||
}
|
||||
else
|
||||
{
|
||||
sResult += _T("w:required=\"0\" ");
|
||||
sResult += L"w:required=\"0\" ";
|
||||
}
|
||||
|
||||
}
|
||||
@ -102,17 +102,17 @@ namespace ComplexTypes
|
||||
void CFormPr::ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
|
||||
{
|
||||
WritingElement_ReadAttributes_Start_No_NS( oReader )
|
||||
WritingElement_ReadAttributes_Read_if( oReader, _T("key"), m_oKey )
|
||||
WritingElement_ReadAttributes_Read_else_if( oReader, _T("label"), m_oLabel )
|
||||
WritingElement_ReadAttributes_Read_else_if( oReader, _T("helpText"), m_oHelpText )
|
||||
WritingElement_ReadAttributes_Read_else_if( oReader, _T("required"), m_oRequired )
|
||||
WritingElement_ReadAttributes_Read_if( oReader, L"key", m_oKey )
|
||||
WritingElement_ReadAttributes_Read_else_if( oReader, L"label", m_oLabel )
|
||||
WritingElement_ReadAttributes_Read_else_if( oReader, L"helpText", m_oHelpText )
|
||||
WritingElement_ReadAttributes_Read_else_if( oReader, L"required", m_oRequired )
|
||||
WritingElement_ReadAttributes_End_No_NS( oReader )
|
||||
}
|
||||
void CComb::FromXML(XmlUtils::CXmlNode& oNode)
|
||||
{
|
||||
XmlMacroReadAttributeBase( oNode, _T("w:width"), m_oWidth );
|
||||
XmlMacroReadAttributeBase( oNode, _T("w:sym"), m_oSym );
|
||||
XmlMacroReadAttributeBase( oNode, _T("w:font"), m_oFont );
|
||||
XmlMacroReadAttributeBase( oNode, L"w:width", m_oWidth );
|
||||
XmlMacroReadAttributeBase( oNode, L"w:sym", m_oSym );
|
||||
XmlMacroReadAttributeBase( oNode, L"w:font", m_oFont );
|
||||
}
|
||||
void CComb::FromXML(XmlUtils::CXmlLiteReader& oReader)
|
||||
{
|
||||
@ -126,15 +126,15 @@ namespace ComplexTypes
|
||||
std::wstring sResult;
|
||||
if(m_oWidth.IsInit())
|
||||
{
|
||||
sResult += _T("w:width=\"") + std::to_wstring(m_oWidth.get()) + _T("\" ");
|
||||
sResult += L"w:width=\"" + std::to_wstring(m_oWidth.get()) + L"\" ";
|
||||
}
|
||||
if(m_oSym.IsInit())
|
||||
{
|
||||
sResult += _T("w:sym=\"") + XmlUtils::EncodeXmlString(m_oSym.get()) + _T("\" ");
|
||||
sResult += L"w:sym=\"" + XmlUtils::EncodeXmlString(m_oSym.get()) + L"\" ";
|
||||
}
|
||||
if(m_oFont.IsInit())
|
||||
{
|
||||
sResult += _T("w:font=\"") + XmlUtils::EncodeXmlString(m_oFont.get()) + _T("\" ");
|
||||
sResult += L"w:font=\"" + XmlUtils::EncodeXmlString(m_oFont.get()) + L"\" ";
|
||||
}
|
||||
|
||||
return sResult;
|
||||
@ -142,13 +142,14 @@ namespace ComplexTypes
|
||||
void CComb::ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
|
||||
{
|
||||
WritingElement_ReadAttributes_Start( oReader )
|
||||
WritingElement_ReadAttributes_Read_if( oReader, _T("w:width"), m_oWidth )
|
||||
WritingElement_ReadAttributes_Read_else_if( oReader, _T("w:sym"), m_oSym )
|
||||
WritingElement_ReadAttributes_Read_else_if( oReader, _T("w:font"), m_oFont )
|
||||
WritingElement_ReadAttributes_Read_if( oReader, L"w:width", m_oWidth )
|
||||
WritingElement_ReadAttributes_Read_else_if( oReader, L"w:sym", m_oSym )
|
||||
WritingElement_ReadAttributes_Read_else_if( oReader, L"w:font", m_oFont )
|
||||
WritingElement_ReadAttributes_End( oReader )
|
||||
}
|
||||
}
|
||||
}
|
||||
//-----------------------------------------------------------------------------------------------------------------------------
|
||||
namespace OOX
|
||||
{
|
||||
namespace Logic
|
||||
@ -161,7 +162,7 @@ namespace OOX
|
||||
ClearItems();
|
||||
|
||||
XmlUtils::CXmlNodes oChilds;
|
||||
if ( oNode.GetNodes( _T("*"), oChilds ) )
|
||||
if ( oNode.GetNodes( L"*", oChilds ) )
|
||||
{
|
||||
XmlUtils::CXmlNode oItem;
|
||||
for ( int nIndex = 0; nIndex < oChilds.GetCount(); nIndex++ )
|
||||
@ -171,81 +172,81 @@ namespace OOX
|
||||
std::wstring sName = oItem.GetName();
|
||||
WritingElement *pItem = NULL;
|
||||
|
||||
if ( _T("w:bdo") == sName )
|
||||
if ( L"w:bdo" == sName )
|
||||
pItem = new CBdo( oItem );
|
||||
else if ( _T("w:bookmarkEnd") == sName )
|
||||
else if ( L"w:bookmarkEnd" == sName )
|
||||
pItem = new CBookmarkEnd( oItem );
|
||||
else if ( _T("w:bookmarkStart") == sName )
|
||||
else if ( L"w:bookmarkStart" == sName )
|
||||
pItem = new CBookmarkStart( oItem );
|
||||
else if ( _T("w:commentRangeEnd") == sName )
|
||||
else if ( L"w:commentRangeEnd" == sName )
|
||||
pItem = new CCommentRangeEnd( oItem );
|
||||
else if ( _T("w:commentRangeStart") == sName )
|
||||
else if ( L"w:commentRangeStart" == sName )
|
||||
pItem = new CCommentRangeStart( oItem );
|
||||
//else if ( _T("w:customXml") == sName )
|
||||
//else if ( L"w:customXml" == sName )
|
||||
// pItem = new CCustomXml( oItem );
|
||||
else if ( _T("w:customXmlDelRangeEnd") == sName )
|
||||
else if ( L"w:customXmlDelRangeEnd" == sName )
|
||||
pItem = new CCustomXmlDelRangeEnd( oItem );
|
||||
else if ( _T("w:customXmlDelRangeStart") == sName )
|
||||
else if ( L"w:customXmlDelRangeStart" == sName )
|
||||
pItem = new CCustomXmlDelRangeStart( oItem );
|
||||
else if ( _T("w:customXmlInsRangeEnd") == sName )
|
||||
else if ( L"w:customXmlInsRangeEnd" == sName )
|
||||
pItem = new CCustomXmlInsRangeEnd( oItem );
|
||||
else if ( _T("w:customXmlInsRangeStart") == sName )
|
||||
else if ( L"w:customXmlInsRangeStart" == sName )
|
||||
pItem = new CCustomXmlInsRangeStart( oItem );
|
||||
else if ( _T("w:customXmlMoveFromRangeEnd") == sName )
|
||||
else if ( L"w:customXmlMoveFromRangeEnd" == sName )
|
||||
pItem = new CCustomXmlMoveFromRangeEnd( oItem );
|
||||
else if ( _T("w:customXmlMoveFromRangeStart") == sName )
|
||||
else if ( L"w:customXmlMoveFromRangeStart" == sName )
|
||||
pItem = new CCustomXmlMoveFromRangeStart( oItem );
|
||||
else if ( _T("w:customXmlMoveToRangeEnd") == sName )
|
||||
else if ( L"w:customXmlMoveToRangeEnd" == sName )
|
||||
pItem = new CCustomXmlMoveToRangeEnd( oItem );
|
||||
else if ( _T("w:customXmlMoveToRangeStart") == sName )
|
||||
else if ( L"w:customXmlMoveToRangeStart" == sName )
|
||||
pItem = new CCustomXmlMoveToRangeStart( oItem );
|
||||
//else if ( _T("w:del") == sName )
|
||||
//else if ( L"w:del" == sName )
|
||||
// pItem = new CDel( oItem );
|
||||
else if ( _T("w:dir") == sName )
|
||||
else if ( L"w:dir" == sName )
|
||||
pItem = new CDir( oItem );
|
||||
else if ( _T("w:fldSimple") == sName )
|
||||
else if ( L"w:fldSimple" == sName )
|
||||
pItem = new CFldSimple( oItem );
|
||||
else if ( _T("w:hyperlink") == sName )
|
||||
else if ( L"w:hyperlink" == sName )
|
||||
pItem = new CHyperlink( oItem );
|
||||
//else if ( _T("w:ins") == sName )
|
||||
//else if ( L"w:ins" == sName )
|
||||
// pItem = new CIns( oItem );
|
||||
//else if ( _T("w:moveFrom") == sName )
|
||||
//else if ( L"w:moveFrom" == sName )
|
||||
// pItem = new CMoveFrom( oItem );
|
||||
else if ( _T("w:moveFromRangeEnd") == sName )
|
||||
else if ( L"w:moveFromRangeEnd" == sName )
|
||||
pItem = new CMoveFromRangeEnd( oItem );
|
||||
else if ( _T("w:moveFromRangeStart") == sName )
|
||||
else if ( L"w:moveFromRangeStart" == sName )
|
||||
pItem = new CMoveFromRangeStart( oItem );
|
||||
//else if ( _T("w:moveTo") == sName )
|
||||
//else if ( L"w:moveTo" == sName )
|
||||
// pItem = new CMoveTo( oItem );
|
||||
else if ( _T("w:moveToRangeEnd") == sName )
|
||||
else if ( L"w:moveToRangeEnd" == sName )
|
||||
pItem = new CMoveToRangeEnd( oItem );
|
||||
else if ( _T("w:moveToRangeStart") == sName )
|
||||
else if ( L"w:moveToRangeStart" == sName )
|
||||
pItem = new CMoveToRangeStart( oItem );
|
||||
else if ( _T("m:oMath") == sName )
|
||||
else if ( L"m:oMath" == sName )
|
||||
pItem = new COMath( oItem );
|
||||
else if ( _T("m:oMathPara") == sName )
|
||||
else if ( L"m:oMathPara" == sName )
|
||||
pItem = new COMathPara( oItem );
|
||||
else if ( _T("w:p") == sName )
|
||||
else if ( L"w:p" == sName )
|
||||
pItem = new CParagraph( oItem );
|
||||
else if ( _T("w:permEnd") == sName )
|
||||
else if ( L"w:permEnd" == sName )
|
||||
pItem = new CPermEnd( oItem );
|
||||
else if ( _T("w:permStart") == sName )
|
||||
else if ( L"w:permStart" == sName )
|
||||
pItem = new CPermStart( oItem );
|
||||
else if ( _T("w:proofErr") == sName )
|
||||
else if ( L"w:proofErr" == sName )
|
||||
pItem = new CProofErr( oItem );
|
||||
else if ( _T("w:r") == sName )
|
||||
else if ( L"w:r" == sName )
|
||||
pItem = new CRun( oItem );
|
||||
else if ( _T("w:sdt") == sName )
|
||||
else if ( L"w:sdt" == sName )
|
||||
pItem = new CSdt( oItem );
|
||||
else if ( _T("w:smartTag") == sName )
|
||||
else if ( L"w:smartTag" == sName )
|
||||
pItem = new CSmartTag( oItem );
|
||||
//else if ( _T("w:subDoc") == sName )
|
||||
//else if ( L"w:subDoc" == sName )
|
||||
// pItem = new CSubDoc( oItem );
|
||||
else if ( _T("w:tbl") == sName )
|
||||
else if ( L"w:tbl" == sName )
|
||||
pItem = new CTbl( oItem );
|
||||
else if ( _T("w:tc") == sName )
|
||||
else if ( L"w:tc" == sName )
|
||||
pItem = new CTc( oItem );
|
||||
else if ( _T("w:tr") == sName )
|
||||
else if ( L"w:tr" == sName )
|
||||
pItem = new CTr( oItem );
|
||||
|
||||
if ( pItem )
|
||||
@ -266,81 +267,81 @@ namespace OOX
|
||||
std::wstring sName = oReader.GetName();
|
||||
WritingElement *pItem = NULL;
|
||||
|
||||
if ( _T("w:bdo") == sName )
|
||||
if ( L"w:bdo" == sName )
|
||||
pItem = new CBdo( oReader );
|
||||
else if ( _T("w:bookmarkEnd") == sName )
|
||||
else if ( L"w:bookmarkEnd" == sName )
|
||||
pItem = new CBookmarkEnd( oReader );
|
||||
else if ( _T("w:bookmarkStart") == sName )
|
||||
else if ( L"w:bookmarkStart" == sName )
|
||||
pItem = new CBookmarkStart( oReader );
|
||||
else if ( _T("w:commentRangeEnd") == sName )
|
||||
else if ( L"w:commentRangeEnd" == sName )
|
||||
pItem = new CCommentRangeEnd( oReader );
|
||||
else if ( _T("w:commentRangeStart") == sName )
|
||||
else if ( L"w:commentRangeStart" == sName )
|
||||
pItem = new CCommentRangeStart( oReader );
|
||||
//else if ( _T("w:customXml") == sName )
|
||||
//else if ( L"w:customXml" == sName )
|
||||
// pItem = new CCustomXml( oReader );
|
||||
else if ( _T("w:customXmlDelRangeEnd") == sName )
|
||||
else if ( L"w:customXmlDelRangeEnd" == sName )
|
||||
pItem = new CCustomXmlDelRangeEnd( oReader );
|
||||
else if ( _T("w:customXmlDelRangeStart") == sName )
|
||||
else if ( L"w:customXmlDelRangeStart" == sName )
|
||||
pItem = new CCustomXmlDelRangeStart( oReader );
|
||||
else if ( _T("w:customXmlInsRangeEnd") == sName )
|
||||
else if ( L"w:customXmlInsRangeEnd" == sName )
|
||||
pItem = new CCustomXmlInsRangeEnd( oReader );
|
||||
else if ( _T("w:customXmlInsRangeStart") == sName )
|
||||
else if ( L"w:customXmlInsRangeStart" == sName )
|
||||
pItem = new CCustomXmlInsRangeStart( oReader );
|
||||
else if ( _T("w:customXmlMoveFromRangeEnd") == sName )
|
||||
else if ( L"w:customXmlMoveFromRangeEnd" == sName )
|
||||
pItem = new CCustomXmlMoveFromRangeEnd( oReader );
|
||||
else if ( _T("w:customXmlMoveFromRangeStart") == sName )
|
||||
else if ( L"w:customXmlMoveFromRangeStart" == sName )
|
||||
pItem = new CCustomXmlMoveFromRangeStart( oReader );
|
||||
else if ( _T("w:customXmlMoveToRangeEnd") == sName )
|
||||
else if ( L"w:customXmlMoveToRangeEnd" == sName )
|
||||
pItem = new CCustomXmlMoveToRangeEnd( oReader );
|
||||
else if ( _T("w:customXmlMoveToRangeStart") == sName )
|
||||
else if ( L"w:customXmlMoveToRangeStart" == sName )
|
||||
pItem = new CCustomXmlMoveToRangeStart( oReader );
|
||||
else if ( _T("w:del") == sName )
|
||||
else if ( L"w:del" == sName )
|
||||
pItem = new CDel( oReader );
|
||||
else if ( _T("w:dir") == sName )
|
||||
else if ( L"w:dir" == sName )
|
||||
pItem = new CDir( oReader );
|
||||
else if ( _T("w:fldSimple") == sName )
|
||||
else if ( L"w:fldSimple" == sName )
|
||||
pItem = new CFldSimple( oReader );
|
||||
else if ( _T("w:hyperlink") == sName )
|
||||
else if ( L"w:hyperlink" == sName )
|
||||
pItem = new CHyperlink( oReader );
|
||||
else if ( _T("w:ins") == sName )
|
||||
else if ( L"w:ins" == sName )
|
||||
pItem = new CIns( oReader );
|
||||
else if ( _T("w:moveFrom") == sName )
|
||||
else if ( L"w:moveFrom" == sName )
|
||||
pItem = new CMoveFrom( oReader );
|
||||
else if ( _T("w:moveFromRangeEnd") == sName )
|
||||
else if ( L"w:moveFromRangeEnd" == sName )
|
||||
pItem = new CMoveFromRangeEnd( oReader );
|
||||
else if ( _T("w:moveFromRangeStart") == sName )
|
||||
else if ( L"w:moveFromRangeStart" == sName )
|
||||
pItem = new CMoveFromRangeStart( oReader );
|
||||
else if ( _T("w:moveTo") == sName )
|
||||
else if ( L"w:moveTo" == sName )
|
||||
pItem = new CMoveTo( oReader );
|
||||
else if ( _T("w:moveToRangeEnd") == sName )
|
||||
else if ( L"w:moveToRangeEnd" == sName )
|
||||
pItem = new CMoveToRangeEnd( oReader );
|
||||
else if ( _T("w:moveToRangeStart") == sName )
|
||||
else if ( L"w:moveToRangeStart" == sName )
|
||||
pItem = new CMoveToRangeStart( oReader );
|
||||
else if ( _T("m:oMath") == sName )
|
||||
else if ( L"m:oMath" == sName )
|
||||
pItem = new COMath( oReader );
|
||||
else if ( _T("m:oMathPara") == sName )
|
||||
else if ( L"m:oMathPara" == sName )
|
||||
pItem = new COMathPara( oReader );
|
||||
else if ( _T("w:p") == sName )
|
||||
else if ( L"w:p" == sName )
|
||||
pItem = new CParagraph( oReader );
|
||||
else if ( _T("w:permEnd") == sName )
|
||||
else if ( L"w:permEnd" == sName )
|
||||
pItem = new CPermEnd( oReader );
|
||||
else if ( _T("w:permStart") == sName )
|
||||
else if ( L"w:permStart" == sName )
|
||||
pItem = new CPermStart( oReader );
|
||||
else if ( _T("w:proofErr") == sName )
|
||||
else if ( L"w:proofErr" == sName )
|
||||
pItem = new CProofErr( oReader );
|
||||
else if ( _T("w:r") == sName )
|
||||
else if ( L"w:r" == sName )
|
||||
pItem = new CRun( oReader );
|
||||
else if ( _T("w:sdt") == sName )
|
||||
else if ( L"w:sdt" == sName )
|
||||
pItem = new CSdt( oReader );
|
||||
else if ( _T("w:smartTag") == sName )
|
||||
else if ( L"w:smartTag" == sName )
|
||||
pItem = new CSmartTag( oReader );
|
||||
//else if ( _T("w:subDoc") == sName )
|
||||
//else if ( L"w:subDoc" == sName )
|
||||
// pItem = new CSubDoc( oReader );
|
||||
else if ( _T("w:tbl") == sName )
|
||||
else if ( L"w:tbl" == sName )
|
||||
pItem = new CTbl( oReader );
|
||||
else if ( _T("w:tc") == sName )
|
||||
else if ( L"w:tc" == sName )
|
||||
pItem = new CTc( oReader );
|
||||
else if ( _T("w:tr") == sName )
|
||||
else if ( L"w:tr" == sName )
|
||||
pItem = new CTr( oReader );
|
||||
|
||||
if ( pItem )
|
||||
@ -349,29 +350,29 @@ namespace OOX
|
||||
}
|
||||
std::wstring CSdtContent::toXML() const
|
||||
{
|
||||
std::wstring sResult = _T("<w:sdtContent>");
|
||||
std::wstring sResult = L"<w:sdtContent>";
|
||||
|
||||
for ( size_t i = 0; i < m_arrItems.size(); ++i)
|
||||
for ( size_t i = 0; i < m_arrItems.size(); ++i)
|
||||
{
|
||||
if ( m_arrItems[i] )
|
||||
{
|
||||
if ( m_arrItems[i] )
|
||||
{
|
||||
sResult += m_arrItems[i]->toXML();
|
||||
}
|
||||
sResult += m_arrItems[i]->toXML();
|
||||
}
|
||||
}
|
||||
|
||||
sResult += _T("</w:sdtContent>");
|
||||
sResult += L"</w:sdtContent>";
|
||||
|
||||
return sResult;
|
||||
return sResult;
|
||||
}
|
||||
//-----------------------------------------------------------------------------------------------------------------------------
|
||||
void CTextFormPr::fromXML(XmlUtils::CXmlNode& oNode)
|
||||
{
|
||||
XmlUtils::CXmlNode oChild;
|
||||
|
||||
WritingElement_ReadNode( oNode, oChild, _T("w:comb"), m_oComb );
|
||||
WritingElement_ReadNode( oNode, oChild, _T("w:maxCharacters"), m_oMaxCharacters );
|
||||
WritingElement_ReadNode( oNode, oChild, _T("w:combBorder"), m_oCombBorder );
|
||||
WritingElement_ReadNode( oNode, oChild, L"w:comb", m_oComb );
|
||||
WritingElement_ReadNode( oNode, oChild, L"w:maxCharacters", m_oMaxCharacters );
|
||||
WritingElement_ReadNode( oNode, oChild, L"w:combBorder", m_oCombBorder );
|
||||
}
|
||||
|
||||
void CTextFormPr::fromXML(XmlUtils::CXmlLiteReader& oReader)
|
||||
{
|
||||
ReadAttributes( oReader );
|
||||
@ -383,23 +384,31 @@ namespace OOX
|
||||
while( oReader.ReadNextSiblingNode( nParentDepth ) )
|
||||
{
|
||||
std::wstring sName = oReader.GetName();
|
||||
if ( _T("w:comb") == sName )
|
||||
if ( L"w:comb" == sName )
|
||||
m_oComb = oReader;
|
||||
else if ( _T("w:maxCharacters") == sName )
|
||||
else if ( L"w:maxCharacters" == sName )
|
||||
m_oMaxCharacters = oReader;
|
||||
else if ( _T("w:combBorder") == sName )
|
||||
else if ( L"w:combBorder" == sName )
|
||||
m_oCombBorder = oReader;
|
||||
}
|
||||
}
|
||||
std::wstring CTextFormPr::toXML() const
|
||||
{
|
||||
std::wstring sResult= _T("<w:textFormPr>");
|
||||
std::wstring sResult= L"<w:textFormPr";
|
||||
if (m_oMultiLine.IsInit())
|
||||
{
|
||||
sResult += L" w:multiLine=\"" + std::wstring(*m_oMultiLine ? L"1" : L"0") + L"\"";
|
||||
}
|
||||
if (m_oAutoFit.IsInit())
|
||||
{
|
||||
sResult += L" w:autoFit=\"" + std::wstring(*m_oAutoFit ? L"1" : L"0") + L"\"";
|
||||
}
|
||||
sResult += L">";
|
||||
WritingElement_WriteNode_1( L"<w:comb ", m_oComb );
|
||||
WritingElement_WriteNode_1( L"<w:maxCharacters ", m_oMaxCharacters );
|
||||
WritingElement_WriteNode_1( L"<w:combBorder ", m_oCombBorder );
|
||||
|
||||
WritingElement_WriteNode_1( _T("<w:comb "), m_oComb );
|
||||
WritingElement_WriteNode_1( _T("<w:maxCharacters "), m_oMaxCharacters );
|
||||
WritingElement_WriteNode_1( _T("<w:combBorder "), m_oCombBorder );
|
||||
|
||||
sResult += _T("</w:textFormPr>");
|
||||
sResult += L"</w:textFormPr>";
|
||||
|
||||
return sResult;
|
||||
}
|
||||
@ -409,6 +418,439 @@ namespace OOX
|
||||
}
|
||||
void CTextFormPr::ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
|
||||
{
|
||||
WritingElement_ReadAttributes_Start(oReader)
|
||||
WritingElement_ReadAttributes_Read_if(oReader, L"w:autoFit", m_oAutoFit)
|
||||
WritingElement_ReadAttributes_Read_else_if(oReader, L"w:multiLine", m_oMultiLine)
|
||||
WritingElement_ReadAttributes_End(oReader)
|
||||
}
|
||||
//-----------------------------------------------------------------------------------------------------------------------------
|
||||
void CSdtPr::fromXML(XmlUtils::CXmlNode& oNode)
|
||||
{
|
||||
m_eType = sdttypeUnknown;
|
||||
|
||||
XmlUtils::CXmlNode oChild;
|
||||
|
||||
if (oNode.GetNode(L"w:alias", oChild))
|
||||
m_oAlias = oChild;
|
||||
|
||||
if (oNode.GetNode(L"w15:appearance", oChild))
|
||||
m_oAppearance = oChild;
|
||||
|
||||
if (oNode.GetNode(L"w:bibliography", oChild))
|
||||
m_eType = sdttypeBibliography;
|
||||
|
||||
if (sdttypeUnknown == m_eType && oNode.GetNode(L"w:citation", oChild))
|
||||
m_eType = sdttypeCitation;
|
||||
|
||||
if (sdttypeUnknown == m_eType && oNode.GetNode(L"w:comboBox", oChild))
|
||||
{
|
||||
m_oComboBox = oChild;
|
||||
m_eType = sdttypeComboBox;
|
||||
}
|
||||
if (oNode.GetNode(L"w15:color", oChild))
|
||||
m_oColor = oChild;
|
||||
|
||||
if (oNode.GetNode(L"w:dataBinding", oChild))
|
||||
m_oDataBinding = oChild;
|
||||
|
||||
if (sdttypeUnknown == m_eType && oNode.GetNode(L"w:date", oChild))
|
||||
{
|
||||
m_oDate = oChild;
|
||||
m_eType = sdttypeDate;
|
||||
}
|
||||
|
||||
if (sdttypeUnknown == m_eType && oNode.GetNode(L"w:docPartList", oChild))
|
||||
{
|
||||
m_oDocPartList = oChild;
|
||||
m_eType = sdttypeDocPartList;
|
||||
}
|
||||
|
||||
if (sdttypeUnknown == m_eType && oNode.GetNode(L"w:docPartObj", oChild))
|
||||
{
|
||||
m_oDocPartObj = oChild;
|
||||
m_eType = sdttypeDocPartObj;
|
||||
}
|
||||
|
||||
if (sdttypeUnknown == m_eType && oNode.GetNode(L"w:dropDownList", oChild))
|
||||
{
|
||||
m_oDropDownList = oChild;
|
||||
m_eType = sdttypeDropDownList;
|
||||
}
|
||||
|
||||
if (sdttypeUnknown == m_eType && oNode.GetNode(L"w:equation", oChild))
|
||||
m_eType = sdttypeEquation;
|
||||
|
||||
if (sdttypeUnknown == m_eType && oNode.GetNode(L"w:group", oChild))
|
||||
m_eType = sdttypeGroup;
|
||||
|
||||
if (oNode.GetNode(L"w:id", oChild))
|
||||
m_oId = oChild;
|
||||
|
||||
if (oNode.GetNode(L"w:label", oChild))
|
||||
m_oLabel = oChild;
|
||||
|
||||
if (oNode.GetNode(L"w:lock", oChild))
|
||||
m_oLock = oChild;
|
||||
|
||||
if (sdttypeUnknown == m_eType && oNode.GetNode(L"w:picture", oChild))
|
||||
{
|
||||
m_oPicture = oChild;
|
||||
m_eType = sdttypePicture;
|
||||
}
|
||||
|
||||
if (oNode.GetNode(L"w:placeholder", oChild))
|
||||
m_oPlaceHolder = oChild;
|
||||
|
||||
if (sdttypeUnknown == m_eType && oNode.GetNode(L"w:richText", oChild))
|
||||
m_eType = sdttypeRichText;
|
||||
|
||||
if (oNode.GetNode(L"w:rPr", oChild))
|
||||
m_oRPr = oChild;
|
||||
|
||||
if (oNode.GetNode(L"w:showingPlcHdr", oChild))
|
||||
m_oShowingPlcHdr = oChild;
|
||||
|
||||
if (oNode.GetNode(L"w:tabIndex", oChild))
|
||||
m_oTabIndex = oChild;
|
||||
|
||||
if (oNode.GetNode(L"w:tag", oChild))
|
||||
m_oTag = oChild;
|
||||
|
||||
if (oNode.GetNode(L"w:temporary", oChild))
|
||||
m_oTemporary = oChild;
|
||||
if (oNode.GetNode(L"w:formPr", oChild))
|
||||
m_oFormPr = oChild;
|
||||
if (oNode.GetNode(L"w:textFormPr", oChild))
|
||||
m_oTextFormPr = oChild;
|
||||
|
||||
if (sdttypeUnknown == m_eType && oNode.GetNode(L"w:text", oChild))
|
||||
{
|
||||
m_oText = oChild;
|
||||
m_eType = sdttypeText;
|
||||
}
|
||||
|
||||
if (sdttypeUnknown == m_eType && oNode.GetNode(L"w14:checkbox", oChild))
|
||||
{
|
||||
m_oCheckbox = oChild;
|
||||
m_eType = sdttypeCheckBox;
|
||||
}
|
||||
}
|
||||
void CSdtPr::fromXML(XmlUtils::CXmlLiteReader& oReader)
|
||||
{
|
||||
m_eType = sdttypeUnknown;
|
||||
|
||||
if (oReader.IsEmptyNode())
|
||||
return;
|
||||
|
||||
int nParentDepth = oReader.GetDepth();
|
||||
while (oReader.ReadNextSiblingNode(nParentDepth))
|
||||
{
|
||||
std::wstring sName = oReader.GetName();
|
||||
|
||||
if (L"w:alias" == sName)
|
||||
m_oAlias = oReader;
|
||||
else if (L"w15:appearance" == sName)
|
||||
m_oAppearance = oReader;
|
||||
else if (L"w:bibliography" == sName)
|
||||
m_eType = sdttypeBibliography;
|
||||
else if (sdttypeUnknown == m_eType && L"w:citation" == sName)
|
||||
m_eType = sdttypeCitation;
|
||||
else if (sdttypeUnknown == m_eType && L"w:comboBox" == sName)
|
||||
{
|
||||
m_oComboBox = oReader;
|
||||
m_eType = sdttypeComboBox;
|
||||
}
|
||||
else if (L"w15:color" == sName)
|
||||
m_oColor = oReader;
|
||||
else if (L"w:dataBinding" == sName)
|
||||
m_oDataBinding = oReader;
|
||||
else if (sdttypeUnknown == m_eType && L"w:date" == sName)
|
||||
{
|
||||
m_oDate = oReader;
|
||||
m_eType = sdttypeDate;
|
||||
}
|
||||
else if (sdttypeUnknown == m_eType && L"w:docPartList" == sName)
|
||||
{
|
||||
m_oDocPartList = oReader;
|
||||
m_eType = sdttypeDocPartList;
|
||||
}
|
||||
else if (sdttypeUnknown == m_eType && L"w:docPartObj" == sName)
|
||||
{
|
||||
m_oDocPartObj = oReader;
|
||||
m_eType = sdttypeDocPartObj;
|
||||
|
||||
if (m_oDocPartObj.IsInit() && m_oDocPartObj->m_oDocPartGallery.IsInit())
|
||||
{
|
||||
if (m_oDocPartObj->m_oDocPartGallery->m_sVal == L"Bibliographies")
|
||||
m_eType = sdttypeBibliography;
|
||||
}
|
||||
}
|
||||
else if (sdttypeUnknown == m_eType && L"w:dropDownList" == sName)
|
||||
{
|
||||
m_oDropDownList = oReader;
|
||||
m_eType = sdttypeDropDownList;
|
||||
}
|
||||
else if (sdttypeUnknown == m_eType && L"w:equation" == sName)
|
||||
m_eType = sdttypeEquation;
|
||||
else if (sdttypeUnknown == m_eType && L"w:group" == sName)
|
||||
m_eType = sdttypeGroup;
|
||||
else if (L"w:id" == sName)
|
||||
m_oId = oReader;
|
||||
else if (L"w:label" == sName)
|
||||
m_oLabel = oReader;
|
||||
else if (L"w:lock" == sName)
|
||||
m_oLock = oReader;
|
||||
else if (sdttypeUnknown == m_eType && L"w:picture" == sName)
|
||||
{
|
||||
m_oPicture = oReader;
|
||||
m_eType = sdttypePicture;
|
||||
}
|
||||
else if (L"w:placeholder" == sName)
|
||||
m_oPlaceHolder = oReader;
|
||||
else if (sdttypeUnknown == m_eType && L"w:richText" == sName)
|
||||
m_eType = sdttypeRichText;
|
||||
else if (L"w:rPr" == sName)
|
||||
m_oRPr = oReader;
|
||||
else if (L"w:showingPlcHdr" == sName)
|
||||
m_oShowingPlcHdr = oReader;
|
||||
else if (L"w:tabIndex" == sName)
|
||||
m_oTabIndex = oReader;
|
||||
else if (L"w:tag" == sName)
|
||||
m_oTag = oReader;
|
||||
else if (L"w:temporary" == sName)
|
||||
m_oTemporary = oReader;
|
||||
else if (L"w:formPr" == sName)
|
||||
m_oFormPr = oReader;
|
||||
else if (L"w:textFormPr" == sName)
|
||||
m_oTextFormPr = oReader;
|
||||
else if (sdttypeUnknown == m_eType && L"w:text" == sName)
|
||||
{
|
||||
m_oText = oReader;
|
||||
m_eType = sdttypeText;
|
||||
}
|
||||
else if (sdttypeUnknown == m_eType && L"w14:checkbox" == sName)
|
||||
{
|
||||
m_oCheckbox = oReader;
|
||||
m_eType = sdttypeCheckBox;
|
||||
}
|
||||
}
|
||||
}
|
||||
std::wstring CSdtPr::toXMLStart() const
|
||||
{
|
||||
std::wstring sResult = L"<w:sdtPr>";
|
||||
|
||||
WritingElement_WriteNode_2(m_oRPr);
|
||||
WritingElement_WriteNode_1(L"<w:alias ", m_oAlias);
|
||||
WritingElement_WriteNode_1(L"<w15:appearance ", m_oAppearance);
|
||||
WritingElement_WriteNode_1(L"<w15:color ", m_oColor);
|
||||
WritingElement_WriteNode_1(L"<w:id ", m_oId);
|
||||
WritingElement_WriteNode_1(L"<w:label ", m_oLabel);
|
||||
WritingElement_WriteNode_1(L"<w:tabIndex ", m_oTabIndex);
|
||||
WritingElement_WriteNode_1(L"<w:lock ", m_oLock);
|
||||
WritingElement_WriteNode_2(m_oPlaceHolder);
|
||||
WritingElement_WriteNode_1(L"<w:showingPlcHdr ", m_oShowingPlcHdr);
|
||||
WritingElement_WriteNode_1(L"<w:dataBinding ", m_oDataBinding);
|
||||
WritingElement_WriteNode_1(L"<w:temporary ", m_oTemporary);
|
||||
WritingElement_WriteNode_1(L"<w:tag ", m_oTag);
|
||||
|
||||
switch (m_eType)
|
||||
{
|
||||
case sdttypeBibliography:
|
||||
{
|
||||
sResult += L"<w:bibliography/>";
|
||||
break;
|
||||
}
|
||||
case sdttypeCitation:
|
||||
{
|
||||
sResult += L"<w:citation/>";
|
||||
break;
|
||||
}
|
||||
case sdttypeComboBox:
|
||||
{
|
||||
if (m_oComboBox.IsInit())
|
||||
sResult += m_oComboBox->toXML();
|
||||
|
||||
break;
|
||||
}
|
||||
case sdttypeDate:
|
||||
{
|
||||
if (m_oDate.IsInit())
|
||||
sResult += m_oDate->toXML();
|
||||
|
||||
break;
|
||||
}
|
||||
case sdttypeDocPartList:
|
||||
{
|
||||
if (m_oDocPartList.IsInit())
|
||||
sResult += m_oDocPartList->toXML2(L"w:docPartList");
|
||||
|
||||
break;
|
||||
}
|
||||
case sdttypeDocPartObj:
|
||||
{
|
||||
if (m_oDocPartObj.IsInit())
|
||||
sResult += m_oDocPartObj->toXML2(L"w:docPartObj");
|
||||
|
||||
break;
|
||||
}
|
||||
case sdttypeDropDownList:
|
||||
{
|
||||
if (m_oDropDownList.IsInit())
|
||||
sResult += m_oDropDownList->toXML();
|
||||
|
||||
break;
|
||||
}
|
||||
case sdttypeEquation:
|
||||
{
|
||||
sResult += L"<w:equation/>";
|
||||
break;
|
||||
}
|
||||
case sdttypeGroup:
|
||||
{
|
||||
sResult += L"<w:group/>";
|
||||
break;
|
||||
}
|
||||
case sdttypePicture:
|
||||
{
|
||||
if (m_oPicture.IsInit())
|
||||
sResult += m_oPicture->toXML();
|
||||
else
|
||||
sResult += L"<w:picture/>";
|
||||
break;
|
||||
}
|
||||
case sdttypeRichText:
|
||||
{
|
||||
sResult += L"<w:richText/>";
|
||||
break;
|
||||
}
|
||||
case sdttypeText:
|
||||
{
|
||||
sResult += L"<w:text ";
|
||||
if (m_oText.IsInit())
|
||||
{
|
||||
sResult += m_oText->ToString();
|
||||
}
|
||||
sResult += L"/>";
|
||||
break;
|
||||
}
|
||||
case sdttypeCheckBox:
|
||||
{
|
||||
WritingElement_WriteNode_2(m_oCheckbox);
|
||||
break;
|
||||
}
|
||||
}
|
||||
WritingElement_WriteNode_1(L"<w:formPr ", m_oFormPr);
|
||||
WritingElement_WriteNode_2(m_oTextFormPr);
|
||||
|
||||
return sResult;
|
||||
}
|
||||
//-----------------------------------------------------------------------------------------------------------------------------
|
||||
void CSdtCheckBox::fromXML(XmlUtils::CXmlNode& oNode)
|
||||
{
|
||||
XmlUtils::CXmlNode oChild;
|
||||
|
||||
if (oNode.GetNode(L"w14:checked", oChild))
|
||||
m_oChecked = oChild;
|
||||
else if (oNode.GetNode(L"w14:checkedState", oChild))
|
||||
m_oCheckedState = oChild;
|
||||
else if (oNode.GetNode(L"w14:uncheckedState", oChild))
|
||||
m_oUncheckedState = oChild;
|
||||
else if (oNode.GetNode(L"w14:groupKey", oChild))
|
||||
m_oGroupKey = oChild;
|
||||
}
|
||||
void CSdtCheckBox::fromXML(XmlUtils::CXmlLiteReader& oReader)
|
||||
{
|
||||
if (oReader.IsEmptyNode())
|
||||
return;
|
||||
|
||||
int nParentDepth = oReader.GetDepth();
|
||||
while (oReader.ReadNextSiblingNode(nParentDepth))
|
||||
{
|
||||
std::wstring sName = oReader.GetName();
|
||||
if (L"w14:checked" == sName)
|
||||
m_oChecked = oReader;
|
||||
else if (L"w14:checkedState" == sName)
|
||||
m_oCheckedState = oReader;
|
||||
else if (L"w14:uncheckedState" == sName)
|
||||
m_oUncheckedState = oReader;
|
||||
else if (L"w14:groupKey" == sName)
|
||||
m_oGroupKey = oReader;
|
||||
}
|
||||
}
|
||||
std::wstring CSdtCheckBox::toXML() const
|
||||
{
|
||||
std::wstring sResult = L"<w14:checkbox>";
|
||||
|
||||
if (m_oChecked.IsInit())
|
||||
{
|
||||
sResult += L"<w14:checked w14:val=\"";
|
||||
sResult += m_oChecked->m_oVal.ToString2(SimpleTypes::onofftostring1);
|
||||
sResult += L"\"/>";
|
||||
}
|
||||
WritingElement_WriteNode_1(L"<w14:checkedState ", m_oCheckedState);
|
||||
WritingElement_WriteNode_1(L"<w14:uncheckedState ", m_oUncheckedState);
|
||||
if (m_oGroupKey.IsInit())
|
||||
{
|
||||
sResult += L"<w14:groupKey ";
|
||||
sResult += m_oGroupKey->ToStringWithNS(L"w14:");
|
||||
sResult += L"/>";
|
||||
}
|
||||
|
||||
sResult += L"</w14:checkbox>";
|
||||
|
||||
return sResult;
|
||||
}
|
||||
//-----------------------------------------------------------------------------------------------------------------------------
|
||||
void CSdtPicture::fromXML(XmlUtils::CXmlNode& oNode)
|
||||
{
|
||||
XmlMacroReadAttributeBase(oNode, L"w:scaleFlag", m_oScaleFlag);
|
||||
XmlMacroReadAttributeBase(oNode, L"w:lockProportions", m_oLockProportions);
|
||||
XmlMacroReadAttributeBase(oNode, L"w:respectBorders", m_oRespectBorders);
|
||||
XmlMacroReadAttributeBase(oNode, L"w:shiftX", m_oShiftX);
|
||||
XmlMacroReadAttributeBase(oNode, L"w:shiftY", m_oShiftY);
|
||||
}
|
||||
void CSdtPicture::ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
|
||||
{
|
||||
WritingElement_ReadAttributes_Start(oReader)
|
||||
WritingElement_ReadAttributes_Read_if(oReader, L"w:scaleFlag", m_oScaleFlag)
|
||||
WritingElement_ReadAttributes_Read_else_if(oReader, L"w:lockProportions", m_oLockProportions)
|
||||
WritingElement_ReadAttributes_Read_else_if(oReader, L"w:respectBorders", m_oRespectBorders)
|
||||
WritingElement_ReadAttributes_Read_else_if(oReader, L"w:shiftX", m_oShiftX)
|
||||
WritingElement_ReadAttributes_Read_else_if(oReader, L"w:shiftY", m_oShiftY)
|
||||
WritingElement_ReadAttributes_End(oReader)
|
||||
}
|
||||
void CSdtPicture::fromXML(XmlUtils::CXmlLiteReader& oReader)
|
||||
{
|
||||
ReadAttributes(oReader);
|
||||
|
||||
if (oReader.IsEmptyNode())
|
||||
return;
|
||||
}
|
||||
std::wstring CSdtPicture::toXML() const
|
||||
{
|
||||
std::wstring sResult = L"<w:picture";
|
||||
if (m_oScaleFlag.IsInit())
|
||||
{
|
||||
sResult += L" w:scaleFlag=\"" + std::to_wstring(*m_oScaleFlag) + L"\"";
|
||||
}
|
||||
if (m_oLockProportions.IsInit())
|
||||
{
|
||||
sResult += L" w:lockProportions=\"" + std::wstring(*m_oLockProportions ? L"1" : L"0") + L"\"";
|
||||
}
|
||||
if (m_oRespectBorders.IsInit())
|
||||
{
|
||||
sResult += L" w:respectBorders=\"" + std::wstring(*m_oRespectBorders ? L"1" : L"0") + L"\"";
|
||||
}
|
||||
if (m_oShiftX.IsInit())
|
||||
{
|
||||
sResult += L" w:shiftX=\"" + std::to_wstring(*m_oShiftX) + L"\"";
|
||||
}
|
||||
if (m_oShiftY.IsInit())
|
||||
{
|
||||
sResult += L" w:shiftY=\"" + std::to_wstring(*m_oShiftY) + L"\"";
|
||||
}
|
||||
sResult += L"/>";
|
||||
return sResult;
|
||||
}
|
||||
|
||||
} // namespace Logic
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -99,7 +99,8 @@ namespace OOX
|
||||
}
|
||||
void VbaProject::fromPPTY(NSBinPptxRW::CBinaryFileReader* pReader)
|
||||
{
|
||||
LONG _end_rec = pReader->GetPos() + pReader->GetRecordSize() + 4;
|
||||
LONG _rec_size = pReader->GetRecordSize();
|
||||
LONG _end_rec = pReader->GetPos() + _rec_size + 4;
|
||||
|
||||
pReader->Skip(1); // start attributes
|
||||
while (true)
|
||||
|
||||
@ -832,6 +832,7 @@ namespace OOX
|
||||
et_w_sdtEndPr, // <w:sdtEndPr>
|
||||
et_w_sdtPr, // <w:sdtPr>
|
||||
et_w_sdtCheckbox, // <w:checkbox>
|
||||
et_w_sdtPicture, // <w:picture>
|
||||
et_w_sdtCheckboxSymbol, // <w:checkedState>
|
||||
et_w_sectPr, // <w:sectPr>
|
||||
et_w_sectPrChange, // <w:sectPrChange>
|
||||
|
||||
@ -322,6 +322,10 @@ plugin {
|
||||
}
|
||||
}
|
||||
|
||||
core_disable_all_warnings {
|
||||
CONFIG += warn_off
|
||||
}
|
||||
|
||||
# BUILD_PATHS
|
||||
# MUST BE DEFINED CORE_ROOT_DIR
|
||||
!core_no_dst {
|
||||
|
||||
@ -365,6 +365,7 @@ void CPdfRenderer::CCommandManager::Flush()
|
||||
ETextRenderingMode eMode = textrenderingmode_Fill;
|
||||
bool isNeedDoBold = false;
|
||||
bool isNeedDoItalic = false;
|
||||
double dLineWidth = -1;
|
||||
|
||||
double dPrevX = -1000;
|
||||
double dPrevY = -1000;
|
||||
@ -416,9 +417,20 @@ void CPdfRenderer::CCommandManager::Flush()
|
||||
isNeedDoBold = pText->IsNeedDoBold();
|
||||
|
||||
if (isNeedDoBold && eMode == textrenderingmode_Fill)
|
||||
{
|
||||
double dNewLineWidth = dTextSize / 12 * 0.343;
|
||||
if (fabs(dLineWidth - dNewLineWidth) > 0.001)
|
||||
{
|
||||
dLineWidth = dNewLineWidth;
|
||||
pPage->SetLineWidth(dLineWidth);
|
||||
}
|
||||
|
||||
pPage->SetTextRenderingMode(textrenderingmode_FillThenStroke);
|
||||
}
|
||||
else
|
||||
{
|
||||
pPage->SetTextRenderingMode(eMode);
|
||||
}
|
||||
}
|
||||
|
||||
if (fabs(dHorScaling - pText->GetHorScaling()) > 0.001)
|
||||
@ -457,8 +469,8 @@ void CPdfRenderer::CCommandManager::Flush()
|
||||
}
|
||||
}
|
||||
}
|
||||
oTextLine.Flush(pPage);
|
||||
|
||||
oTextLine.Flush(pPage);
|
||||
pPage->EndText();
|
||||
}
|
||||
|
||||
|
||||
@ -34,12 +34,12 @@
|
||||
|
||||
#include "Types.h"
|
||||
|
||||
#define NEEDS_ESCAPE(c) (c < 0x20 || \
|
||||
#define NEEDS_ESCAPE(c) (c < 0x21 || \
|
||||
c > 0x7e || \
|
||||
c == '\\' || \
|
||||
c == '%' || \
|
||||
c == '#' || \
|
||||
/*c == '/' || */\
|
||||
c == '/' || \
|
||||
c == '(' || \
|
||||
c == ')' || \
|
||||
c == '<' || \
|
||||
|
||||
@ -346,6 +346,7 @@ namespace NExtractTools
|
||||
|
||||
BinDocxRW::CDocxSerializer m_oCDocxSerializer;
|
||||
|
||||
m_oCDocxSerializer.setMacroEnabled(params.m_bMacro);
|
||||
m_oCDocxSerializer.setIsNoBase64(params.getIsNoBase64());
|
||||
m_oCDocxSerializer.setFontDir(params.getFontPath());
|
||||
|
||||
@ -380,7 +381,7 @@ namespace NExtractTools
|
||||
if (S_OK != oCOfficeUtils.ExtractToDirectory(sFrom, sTempUnpackedDOCT, NULL, 0))
|
||||
return AVS_FILEUTILS_ERROR_CONVERT;
|
||||
|
||||
return doct_bin2docx(sTempDoctFileEditor, sTo, sTemp, bFromChanges, sThemeDir, params);
|
||||
return doct_bin2docx(sTempDoctFileEditor, sTo, sTemp, bFromChanges, sThemeDir, params);
|
||||
}
|
||||
// dotx -> docx
|
||||
_UINT32 dotx2docx (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, InputParams& params)
|
||||
@ -784,6 +785,7 @@ namespace NExtractTools
|
||||
|
||||
BinXlsxRW::CXlsxSerializer m_oCXlsxSerializer;
|
||||
|
||||
m_oCXlsxSerializer.setMacroEnabled(params.m_bMacro);
|
||||
m_oCXlsxSerializer.setIsNoBase64(params.getIsNoBase64());
|
||||
m_oCXlsxSerializer.setFontDir(params.getFontPath());
|
||||
|
||||
@ -817,7 +819,7 @@ namespace NExtractTools
|
||||
if (S_OK != oCOfficeUtils.ExtractToDirectory(sFrom, sTempUnpackedXLST, NULL, 0))
|
||||
return AVS_FILEUTILS_ERROR_CONVERT;
|
||||
|
||||
return xlst_bin2xlsx(sTempXlstFileEditor, sTo, sTemp, bFromChanges, sThemeDir, params);
|
||||
return xlst_bin2xlsx(sTempXlstFileEditor, sTo, sTemp, bFromChanges, sThemeDir, params);
|
||||
}
|
||||
// xltx -> xlsx
|
||||
_UINT32 xltx2xlsx (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, InputParams& params)
|
||||
@ -1068,7 +1070,7 @@ namespace NExtractTools
|
||||
_UINT32 pptx_dir2pptt_bin (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, InputParams& params)
|
||||
{
|
||||
// convert unzipped pptx to unzipped pptt
|
||||
CPPTXFile *pptx_file = new CPPTXFile(NULL, NULL, NULL, NULL);
|
||||
CPPTXFile *pptx_file = new CPPTXFile();
|
||||
|
||||
_UINT32 nRes = 0;
|
||||
|
||||
@ -1144,12 +1146,13 @@ namespace NExtractTools
|
||||
else
|
||||
sTargetBin = sFrom;
|
||||
|
||||
CPPTXFile *pptx_file = new CPPTXFile(NULL, NULL, NULL, NULL);
|
||||
CPPTXFile *pptx_file = new CPPTXFile();
|
||||
|
||||
HRESULT hr = S_OK;
|
||||
|
||||
if (pptx_file)
|
||||
{
|
||||
pptx_file->SetMacroEnabled(params.m_bMacro);
|
||||
pptx_file->SetIsNoBase64(params.getIsNoBase64());
|
||||
pptx_file->SetFontDir(params.getFontPath());
|
||||
nRes = (S_OK == pptx_file->ConvertPPTYToPPTX(sTargetBin, sTo, sThemeDir)) ? nRes : AVS_FILEUTILS_ERROR_CONVERT;
|
||||
@ -2090,8 +2093,8 @@ namespace NExtractTools
|
||||
|
||||
pptFile.put_TempDirectory(sTemp);
|
||||
|
||||
bool bMacros = false;
|
||||
long nRes = pptFile.LoadFromFile(sFrom, sTo, params.getPassword(), bMacros);
|
||||
params.m_bMacro = false;
|
||||
long nRes = pptFile.LoadFromFile(sFrom, sTo, params.getPassword(), params.m_bMacro);
|
||||
nRes = processEncryptionError(nRes, sFrom, params);
|
||||
return nRes;
|
||||
}
|
||||
@ -2118,8 +2121,8 @@ namespace NExtractTools
|
||||
|
||||
pptFile.put_TempDirectory(sTemp);
|
||||
|
||||
bool bMacros = true;
|
||||
_UINT32 nRes = pptFile.LoadFromFile(sFrom, sTo, params.getPassword(), bMacros);
|
||||
params.m_bMacro = true;
|
||||
_UINT32 nRes = pptFile.LoadFromFile(sFrom, sTo, params.getPassword(), params.m_bMacro);
|
||||
nRes = processEncryptionError(nRes, sFrom, params);
|
||||
return nRes;
|
||||
}
|
||||
@ -2153,14 +2156,14 @@ namespace NExtractTools
|
||||
|
||||
pptFile.put_TempDirectory(sTemp);
|
||||
|
||||
bool bMacros = true;
|
||||
_UINT32 nRes = pptFile.LoadFromFile(sFrom, sTempUnpackedPPTX, params.getPassword(), bMacros);
|
||||
params.m_bMacro = true;
|
||||
_UINT32 nRes = pptFile.LoadFromFile(sFrom, sTempUnpackedPPTX, params.getPassword(), params.m_bMacro);
|
||||
|
||||
nRes = processEncryptionError(nRes, sFrom, params);
|
||||
if (SUCCEEDED_X2T(nRes))
|
||||
{
|
||||
// convert unzipped pptx to unzipped pptt
|
||||
CPPTXFile *pptx_file = new CPPTXFile(NULL, NULL, NULL, NULL);
|
||||
CPPTXFile *pptx_file = new CPPTXFile();
|
||||
|
||||
if (pptx_file)
|
||||
{
|
||||
@ -2344,9 +2347,9 @@ namespace NExtractTools
|
||||
docFile.m_sTempFolder = sTemp;
|
||||
docFile.m_nUserLCID = (NULL != params.m_nLcid) ? *params.m_nLcid : -1;
|
||||
|
||||
bool bMacros = false;
|
||||
params.m_bMacro = false;
|
||||
|
||||
_UINT32 hRes = docFile.LoadFromFile( sFrom, sTo, params.getPassword(), bMacros, NULL);
|
||||
_UINT32 hRes = docFile.LoadFromFile( sFrom, sTo, params.getPassword(), params.m_bMacro, NULL);
|
||||
if (AVS_ERROR_DRM == hRes)
|
||||
{
|
||||
if(!params.getDontSaveAdditional())
|
||||
@ -2395,9 +2398,9 @@ namespace NExtractTools
|
||||
COfficeDocFile docFile;
|
||||
docFile.m_sTempFolder = sTemp;
|
||||
|
||||
bool bMacros = true;
|
||||
params.m_bMacro = true;
|
||||
|
||||
_UINT32 hRes = docFile.LoadFromFile( sFrom, sTo, params.getPassword(), bMacros, NULL);
|
||||
_UINT32 hRes = docFile.LoadFromFile( sFrom, sTo, params.getPassword(), params.m_bMacro, NULL);
|
||||
if (AVS_ERROR_DRM == hRes)
|
||||
{
|
||||
if(!params.getDontSaveAdditional())
|
||||
@ -2443,9 +2446,9 @@ namespace NExtractTools
|
||||
COfficeDocFile docFile;
|
||||
docFile.m_sTempFolder = sTemp;
|
||||
|
||||
bool bMacros = true;
|
||||
params.m_bMacro = true;
|
||||
|
||||
_UINT32 nRes = docFile.LoadFromFile( sFrom, sResultDocxDir, params.getPassword(), bMacros, NULL);
|
||||
_UINT32 nRes = docFile.LoadFromFile( sFrom, sResultDocxDir, params.getPassword(), params.m_bMacro, NULL);
|
||||
|
||||
nRes = processEncryptionError(nRes, sFrom, params);
|
||||
if (SUCCEEDED_X2T(nRes))
|
||||
@ -4232,11 +4235,11 @@ namespace NExtractTools
|
||||
}
|
||||
_UINT32 xls2xlsx_dir (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, InputParams& params)
|
||||
{
|
||||
bool bMacros = false;
|
||||
params.m_bMacro = false;
|
||||
|
||||
int lcid = (NULL != params.m_nLcid) ? *params.m_nLcid : -1;
|
||||
|
||||
_UINT32 nRes = ConvertXls2Xlsx( sFrom, sTo, params.getPassword(), params.getFontPath(), sTemp, lcid, bMacros);
|
||||
_UINT32 nRes = ConvertXls2Xlsx( sFrom, sTo, params.getPassword(), params.getFontPath(), sTemp, lcid, params.m_bMacro);
|
||||
|
||||
nRes = processEncryptionError(nRes, sFrom, params);
|
||||
return nRes;
|
||||
@ -4260,9 +4263,9 @@ namespace NExtractTools
|
||||
}
|
||||
_UINT32 xls2xlsm_dir (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, InputParams& params)
|
||||
{
|
||||
bool bMacros = true;
|
||||
params.m_bMacro = true;
|
||||
|
||||
_UINT32 nRes = ConvertXls2Xlsx( sFrom, sTo, params.getPassword(), params.getFontPath(), sTemp, NULL, bMacros);
|
||||
_UINT32 nRes = ConvertXls2Xlsx( sFrom, sTo, params.getPassword(), params.getFontPath(), sTemp, NULL, params.m_bMacro);
|
||||
|
||||
nRes = processEncryptionError(nRes, sFrom, params);
|
||||
return nRes;
|
||||
@ -4294,8 +4297,8 @@ namespace NExtractTools
|
||||
|
||||
NSDirectory::CreateDirectory(sResultXlsxDir);
|
||||
|
||||
bool bMacros = true;
|
||||
_UINT32 nRes = ConvertXls2Xlsx( sFrom, sResultXlsxDir, params.getPassword(), params.getFontPath(), sTemp, NULL, bMacros);
|
||||
params.m_bMacro = true;
|
||||
_UINT32 nRes = ConvertXls2Xlsx( sFrom, sResultXlsxDir, params.getPassword(), params.getFontPath(), sTemp, NULL, params.m_bMacro);
|
||||
|
||||
nRes = processEncryptionError(nRes, sFrom, params);
|
||||
if (SUCCEEDED_X2T(nRes))
|
||||
@ -4517,16 +4520,19 @@ namespace NExtractTools
|
||||
}break;
|
||||
case TCD_DOCT2DOCX:
|
||||
{
|
||||
oInputParams.m_bMacro = false;
|
||||
oInputParams.m_nFormatTo = new int(AVS_OFFICESTUDIO_FILE_DOCUMENT_DOCX);
|
||||
result = doct2docx (sFileFrom, sFileTo, sTempDir, bFromChanges, sThemeDir, oInputParams);
|
||||
}break;
|
||||
case TCD_DOCT2DOTX:
|
||||
{
|
||||
oInputParams.m_bMacro = false;
|
||||
oInputParams.m_nFormatTo = new int(AVS_OFFICESTUDIO_FILE_DOCUMENT_DOTX);
|
||||
result = doct2docx (sFileFrom, sFileTo, sTempDir, bFromChanges, sThemeDir, oInputParams);
|
||||
}break;
|
||||
case TCD_DOCT2DOCM:
|
||||
{
|
||||
oInputParams.m_bMacro = true;
|
||||
oInputParams.m_nFormatTo = new int(AVS_OFFICESTUDIO_FILE_DOCUMENT_DOCM);
|
||||
result = doct2docx (sFileFrom, sFileTo, sTempDir, bFromChanges, sThemeDir, oInputParams);
|
||||
}break;
|
||||
@ -4544,16 +4550,19 @@ namespace NExtractTools
|
||||
}break;
|
||||
case TCD_XLST2XLSX:
|
||||
{
|
||||
oInputParams.m_bMacro = false;
|
||||
oInputParams.m_nFormatTo = new int(AVS_OFFICESTUDIO_FILE_SPREADSHEET_XLSX);
|
||||
result = xlst2xlsx (sFileFrom, sFileTo, sTempDir, bFromChanges, sThemeDir, oInputParams);
|
||||
}break;
|
||||
case TCD_XLST2XLSM:
|
||||
{
|
||||
oInputParams.m_bMacro = true;
|
||||
oInputParams.m_nFormatTo = new int(AVS_OFFICESTUDIO_FILE_SPREADSHEET_XLSM);
|
||||
result = xlst2xlsx (sFileFrom, sFileTo, sTempDir, bFromChanges, sThemeDir, oInputParams);
|
||||
}break;
|
||||
case TCD_XLST2XLTX:
|
||||
{
|
||||
oInputParams.m_bMacro = false;
|
||||
oInputParams.m_nFormatTo = new int(AVS_OFFICESTUDIO_FILE_SPREADSHEET_XLTX);
|
||||
result = xlst2xlsx (sFileFrom, sFileTo, sTempDir, bFromChanges, sThemeDir, oInputParams);
|
||||
}break;
|
||||
@ -4563,16 +4572,19 @@ namespace NExtractTools
|
||||
}break;
|
||||
case TCD_PPTT2PPTX:
|
||||
{
|
||||
oInputParams.m_bMacro = false;
|
||||
oInputParams.m_nFormatTo = new int(AVS_OFFICESTUDIO_FILE_PRESENTATION_PPTX);
|
||||
result = pptt2pptx (sFileFrom, sFileTo, sTempDir, bFromChanges, sThemeDir, oInputParams);
|
||||
}break;
|
||||
case TCD_PPTT2PPTM:
|
||||
{
|
||||
oInputParams.m_bMacro = true;
|
||||
oInputParams.m_nFormatTo = new int(AVS_OFFICESTUDIO_FILE_PRESENTATION_PPTM);
|
||||
result = pptt2pptx (sFileFrom, sFileTo, sTempDir, bFromChanges, sThemeDir, oInputParams);
|
||||
}break;
|
||||
case TCD_PPTT2POTX:
|
||||
{
|
||||
oInputParams.m_bMacro = false;
|
||||
oInputParams.m_nFormatTo = new int(AVS_OFFICESTUDIO_FILE_PRESENTATION_POTX);
|
||||
result = pptt2pptx (sFileFrom, sFileTo, sTempDir, bFromChanges, sThemeDir, oInputParams);
|
||||
}break;
|
||||
|
||||
@ -429,6 +429,7 @@ namespace NExtractTools
|
||||
bool* m_bIsPDFA;
|
||||
//output params
|
||||
mutable bool m_bOutputConvertCorrupted;
|
||||
mutable bool m_bMacro;
|
||||
public:
|
||||
InputParams()
|
||||
{
|
||||
@ -459,6 +460,7 @@ namespace NExtractTools
|
||||
m_bIsPDFA = NULL;
|
||||
|
||||
m_bOutputConvertCorrupted = false;
|
||||
m_bMacro = false;
|
||||
}
|
||||
~InputParams()
|
||||
{
|
||||
@ -781,6 +783,8 @@ namespace NExtractTools
|
||||
}
|
||||
sRes = L"<xmlOptions><fileOptions fileType='" + std::to_wstring(nFileType);
|
||||
sRes += L"' codePage='" + std::to_wstring(nCsvEncoding);
|
||||
if (m_bMacro)
|
||||
sRes += L"' macro='1";
|
||||
sRes += L"' delimiter='" + XmlUtils::EncodeXmlStringExtend(cDelimiter) + L"' " + sSaveType;
|
||||
sRes += L"/><TXTOptions><Encoding>" + std::to_wstring(nCsvEncoding) + L"</Encoding></TXTOptions></xmlOptions>";
|
||||
|
||||
|
||||
@ -47,11 +47,12 @@ using namespace OOX::Spreadsheet;
|
||||
|
||||
namespace BinXlsxRW
|
||||
{
|
||||
SaveParams::SaveParams(const std::wstring& _sDrawingsPath, const std::wstring& _sEmbeddingsPath, const std::wstring& _sThemePath, OOX::CContentTypes* _pContentTypes, CSVWriter::CCSVWriter* _pCSVWriter)
|
||||
SaveParams::SaveParams(const std::wstring& _sDrawingsPath, const std::wstring& _sEmbeddingsPath, const std::wstring& _sThemePath, OOX::CContentTypes* _pContentTypes, CSVWriter::CCSVWriter* _pCSVWriter, bool bMacro)
|
||||
{
|
||||
pContentTypes = _pContentTypes;
|
||||
sThemePath = _sThemePath;
|
||||
sDrawingsPath = _sDrawingsPath;
|
||||
bMacroEnabled = bMacro;
|
||||
pContentTypes = _pContentTypes;
|
||||
sThemePath = _sThemePath;
|
||||
sDrawingsPath = _sDrawingsPath;
|
||||
sEmbeddingsPath = _sEmbeddingsPath;
|
||||
|
||||
nThemeOverrideCount = 1;
|
||||
|
||||
@ -93,10 +93,9 @@ namespace OOX
|
||||
|
||||
namespace BinXlsxRW
|
||||
{
|
||||
class SaveParams
|
||||
struct SaveParams
|
||||
{
|
||||
public:
|
||||
SaveParams (const std::wstring& _sDrawingsPath, const std::wstring& _sEmbeddingsPath, const std::wstring& _sThemePath, OOX::CContentTypes *pContentTypes, CSVWriter::CCSVWriter* pCSVWriter = NULL);
|
||||
SaveParams (const std::wstring& _sDrawingsPath, const std::wstring& _sEmbeddingsPath, const std::wstring& _sThemePath, OOX::CContentTypes *pContentTypes, CSVWriter::CCSVWriter* pCSVWriter = NULL, bool bMacro = false);
|
||||
|
||||
smart_ptr<PPTX::Theme> pTheme;
|
||||
std::wstring sThemePath;
|
||||
@ -105,6 +104,7 @@ namespace BinXlsxRW
|
||||
OOX::CContentTypes* pContentTypes;
|
||||
int nThemeOverrideCount;
|
||||
CSVWriter::CCSVWriter* pCSVWriter;
|
||||
bool bMacroEnabled = false;
|
||||
};
|
||||
|
||||
class BinaryChartReader : public Binary_CommonReader
|
||||
|
||||
@ -2097,14 +2097,21 @@ int BinaryWorkbookTableReader::ReadWorkbookTableContent(BYTE type, long length,
|
||||
}
|
||||
else if(c_oSerWorkbookTypes::VbaProject == type)
|
||||
{
|
||||
smart_ptr<OOX::VbaProject> oFileVbaProject(new OOX::VbaProject(NULL));
|
||||
m_oBufferedStream.Skip(1); //skip type
|
||||
|
||||
oFileVbaProject->fromPPTY(&m_oBufferedStream);
|
||||
if (m_oWorkbook.m_bMacroEnabled)
|
||||
{
|
||||
smart_ptr<OOX::VbaProject> oFileVbaProject(new OOX::VbaProject(NULL));
|
||||
|
||||
smart_ptr<OOX::File> oFile = oFileVbaProject.smart_dynamic_cast<OOX::File>();
|
||||
const OOX::RId oRId = m_oWorkbook.Add(oFile);
|
||||
oFileVbaProject->fromPPTY(&m_oBufferedStream);
|
||||
|
||||
m_oWorkbook.m_bMacroEnabled = true;
|
||||
smart_ptr<OOX::File> oFile = oFileVbaProject.smart_dynamic_cast<OOX::File>();
|
||||
const OOX::RId oRId = m_oWorkbook.Add(oFile);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_oBufferedStream.SkipRecord();
|
||||
}
|
||||
}
|
||||
else if(c_oSerWorkbookTypes::JsaProject == type)
|
||||
{
|
||||
@ -7098,7 +7105,7 @@ int BinaryPersonReader::ReadPerson(BYTE type, long length, void* poResult)
|
||||
BinaryFileReader::BinaryFileReader()
|
||||
{
|
||||
}
|
||||
int BinaryFileReader::ReadFile(const std::wstring& sSrcFileName, std::wstring sDstPath, NSBinPptxRW::CDrawingConverter* pOfficeDrawingConverter, const std::wstring& sXMLOptions)
|
||||
int BinaryFileReader::ReadFile(const std::wstring& sSrcFileName, std::wstring sDstPath, NSBinPptxRW::CDrawingConverter* pOfficeDrawingConverter, const std::wstring& sXMLOptions, bool bMacro)
|
||||
{
|
||||
bool bResultOk = false;
|
||||
|
||||
@ -7217,7 +7224,7 @@ int BinaryFileReader::ReadFile(const std::wstring& sSrcFileName, std::wstring sD
|
||||
|
||||
if(BinXlsxRW::c_oFileTypes::XLSX == fileType)
|
||||
{
|
||||
SaveParams oSaveParams(drawingsPath, embeddingsPath, themePath, pOfficeDrawingConverter->GetContentTypes(), NULL);
|
||||
SaveParams oSaveParams(drawingsPath, embeddingsPath, themePath, pOfficeDrawingConverter->GetContentTypes(), NULL, bMacro);
|
||||
|
||||
try
|
||||
{
|
||||
@ -7330,6 +7337,8 @@ int BinaryFileReader::ReadMainTable(OOX::Spreadsheet::CXlsx& oXlsx, NSBinPptxRW:
|
||||
boost::unordered_map<long, NSCommon::smart_ptr<OOX::File>> m_mapPivotCacheDefinitions;
|
||||
if(-1 != nWorkbookOffBits)
|
||||
{
|
||||
oXlsx.m_pWorkbook->m_bMacroEnabled = oSaveParams.bMacroEnabled;
|
||||
|
||||
oBufferedStream.Seek(nWorkbookOffBits);
|
||||
res = BinaryWorkbookTableReader(oBufferedStream, *oXlsx.m_pWorkbook, m_mapPivotCacheDefinitions, sOutDir, pOfficeDrawingConverter).Read();
|
||||
if(c_oSerConstants::ReadOk != res)
|
||||
|
||||
@ -391,7 +391,7 @@ namespace BinXlsxRW
|
||||
{
|
||||
public:
|
||||
BinaryFileReader();
|
||||
int ReadFile(const std::wstring& sSrcFileName, std::wstring sDstPath, NSBinPptxRW::CDrawingConverter* pOfficeDrawingConverter, const std::wstring& sXMLOptions);
|
||||
int ReadFile(const std::wstring& sSrcFileName, std::wstring sDstPath, NSBinPptxRW::CDrawingConverter* pOfficeDrawingConverter, const std::wstring& sXMLOptions, bool bMacro = false);
|
||||
int ReadMainTable(OOX::Spreadsheet::CXlsx& oXlsx, NSBinPptxRW::CBinaryFileReader& oBufferedStream, const std::wstring& sFileInDir, const std::wstring& sOutDir, SaveParams& oSaveParams, NSBinPptxRW::CDrawingConverter* pOfficeDrawingConverter);
|
||||
void initWorkbook(OOX::Spreadsheet::CWorkbook* pWorkbook);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user