Compare commits

..

9 Commits

Author SHA1 Message Date
7496de06f0 . 2017-02-21 13:19:21 +03:00
fdd443a2d7 . 2017-02-21 13:18:29 +03:00
037c4046eb PptxFormat - extending reading xml; sppr, txpr in chart without DrawingConverter 2017-02-21 11:32:31 +03:00
4e5ac14ca9 errors for builder (open/save) 2017-02-18 14:17:42 +03:00
dedf74b366 fix for build 2017-02-18 11:02:42 +03:00
6f2eef1137 .. 2017-02-17 16:42:49 +03:00
9a8d3edbef . 2017-02-17 16:33:19 +03:00
305ebda78d OfficeUtils - add sort for compress 2017-02-17 16:28:00 +03:00
114050c23e fix bug #33849 2017-02-16 19:26:50 +03:00
70 changed files with 2120 additions and 1710 deletions

View File

@ -61,7 +61,7 @@ bool BinDocxRW::CDocxSerializer::ConvertDocxToDoct(const std::wstring& sSrcFileN
if(S_OK == oCOfficeUtils.ExtractToDirectory(sSrcFileName, strDirSrc, NULL, 0))
if(saveToFile(strEditorBin, strDirSrc, sXMLOptions))
if(S_OK == oCOfficeUtils.CompressFileOrDirectory(strDirDst, sDstFileName, -1))
if(S_OK == oCOfficeUtils.CompressFileOrDirectory(strDirDst, sDstFileName))
return true;
return false;
}
@ -88,7 +88,7 @@ bool BinDocxRW::CDocxSerializer::ConvertDoctToDocx(const std::wstring& sSrcFileN
if(loadFromFile(sEditorBin, strDirDst, sXMLOptions, sThemePath, sMediaPath, sEmbedPath))
{
if(S_OK == oCOfficeUtils.CompressFileOrDirectory(strDirDst, sDstFileName, -1))
if(S_OK == oCOfficeUtils.CompressFileOrDirectory(strDirDst, sDstFileName, true))
return true;
}
}

View File

@ -275,7 +275,7 @@ namespace BinXlsxRW{
oXlsx.Write(oPath, sAdditionalContentTypes);
//zip
COfficeUtils oOfficeUtils(NULL);
oOfficeUtils.CompressFileOrDirectory(sTempDir, sDstFile, -1);
oOfficeUtils.CompressFileOrDirectory(sTempDir, sDstFile, true);
//clean
NSDirectory::DeleteDirectory(sTempDir);
}

View File

@ -34,7 +34,6 @@
#include <stdio.h>
#include <tchar.h>
#include "../../OfficeUtils/src/OfficeUtils.h"
#include "../../DesktopEditor/common/Directory.h"
#include "../src/ConvertOO2OOX.h"
@ -55,7 +54,7 @@ int _tmain(int argc, _TCHAR* argv[])
HRESULT hr = S_OK;
//////////////////////////////////////////////////////////////////////////
std::wstring srcFileName = argv[1];
std::wstring dstPath = argc > 2 ? argv[2] : srcFileName + L"-my.docx"; //xlsx pptx
std::wstring dstPath = argc > 2 ? argv[2] : srcFileName + L"-my.xlsx"; //xlsx pptx docx
std::wstring outputDir = NSDirectory::GetFolderPath(dstPath);
@ -73,7 +72,7 @@ int _tmain(int argc, _TCHAR* argv[])
if (hr != S_OK) return hr;
if (S_OK != oCOfficeUtils.CompressFileOrDirectory(dstTempPath.c_str(), dstPath.c_str(), -1))
if (S_OK != oCOfficeUtils.CompressFileOrDirectory(dstTempPath.c_str(), dstPath.c_str(), true))
return hr;
NSDirectory::DeleteDirectory(dstTempPath);

View File

@ -64,6 +64,8 @@
<Tool
Name="VCLinkerTool"
AdditionalDependencies="gdi32.lib Rpcrt4.lib"
ShowProgress="0"
Version=""
LinkIncremental="2"
GenerateDebugInformation="true"
SubSystem="1"

View File

@ -24,7 +24,8 @@ DEFINES += UNICODE \
_USE_LIBXML2_READER_ \
_USE_XMLLITE_READER_ \
USE_LITE_READER \
LIBXML_READER_ENABLED
LIBXML_READER_ENABLED \
DONT_WRITE_EMBEDDED_FONTS
INCLUDEPATH += ../include
INCLUDEPATH += ../../DesktopEditor/freetype-2.5.2/include

View File

@ -47,12 +47,12 @@ docx_content_types_file::docx_content_types_file()
content()->add_default(L"jpg", L"image/jpeg");
content()->add_default(L"png", L"image/png");
//
content()->add_override(L"/_rels/.rels", L"application/vnd.openxmlformats-package.relationships+xml");
content()->add_override(L"/word/_rels/document.xml.rels", L"application/vnd.openxmlformats-package.relationships+xml");
content()->add_override(L"/word/document.xml", L"application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml");
content()->add_override(L"/word/settings.xml", L"application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml");
content()->add_override(L"/word/styles.xml", L"application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml");
content()->add_override(L"/word/fontTable.xml", L"application/vnd.openxmlformats-officedocument.wordprocessingml.fontTable+xml");
//content()->add_override(L"/word/_rels/document.xml.rels", L"application/vnd.openxmlformats-package.relationships+xml");
//content()->add_override(L"/_rels/.rels", L"application/vnd.openxmlformats-package.relationships+xml");
content()->add_override(L"/docProps/app.xml", L"application/vnd.openxmlformats-officedocument.extended-properties+xml");
content()->add_override(L"/docProps/core.xml", L"application/vnd.openxmlformats-package.core-properties+xml");
}

View File

@ -381,7 +381,7 @@ std::wstring draw_object::office_convert(odf_document * odfDocument, int type)
std::wstring temp_file = folderPath + FILE_SEPARATOR_STR + href_result;
COfficeUtils oCOfficeUtils(NULL);
oCOfficeUtils.CompressFileOrDirectory(objectOutPath.c_str(), temp_file.c_str(), -1);
oCOfficeUtils.CompressFileOrDirectory(objectOutPath.c_str(), temp_file.c_str(), true);
}
NSDirectory::DeleteDirectory(objectOutPath);

View File

@ -85,9 +85,10 @@ void OoxConverter::convert(PPTX::Logic::Shape *oox_shape)
if (type == SimpleTypes::shapetypeRect && oox_shape->txBody.IsInit()) type = 2000;
if (type == 2000 && oox_shape->txBody->bodyPr.fromWordArt.get_value_or(false))
if (type == 2000 && oox_shape->txBody->bodyPr.IsInit()
&& oox_shape->txBody->bodyPr->fromWordArt.get_value_or(false))
{
int wordart_type = convert(oox_shape->txBody->bodyPr.prstTxWarp.GetPointer());
int wordart_type = convert(oox_shape->txBody->bodyPr->prstTxWarp.GetPointer());
if (wordart_type > 0) type = wordart_type;
}
@ -111,7 +112,7 @@ void OoxConverter::convert(PPTX::Logic::Shape *oox_shape)
odf_context()->drawing_context()->set_text( odf_context()->text_context());
//наложим внешние настройки для текста
convert(&oox_shape->txBody->bodyPr);
convert(oox_shape->txBody->bodyPr.GetPointer());
if (oox_shape->style.IsInit())
{
@ -281,15 +282,15 @@ void OoxConverter::convert(PPTX::Logic::PathBase *oox_path)
}
if (cubicBezTo)
{
std::wstring path_elm = cubicBezTo->x1 + L" " + cubicBezTo->y1 + L" " +
cubicBezTo->x2 + L" " + cubicBezTo->y2 + L" " +
cubicBezTo->x3 + L" " + cubicBezTo->y3;
std::wstring path_elm = cubicBezTo->x[0] + L" " + cubicBezTo->y[0] + L" " +
cubicBezTo->x[1] + L" " + cubicBezTo->y[1] + L" " +
cubicBezTo->x[2] + L" " + cubicBezTo->y[2];
odf_context()->drawing_context()->add_path_element(std::wstring(L"C"), path_elm);
}
if (quadBezTo)
{
std::wstring path_elm = quadBezTo->x1 + L" " + quadBezTo->y1 + L" " +
quadBezTo->x2 + L" " + quadBezTo->y2;
std::wstring path_elm = quadBezTo->x[0] + L" " + quadBezTo->y[0] + L" " +
quadBezTo->x[1] + L" " + quadBezTo->y[1];
odf_context()->drawing_context()->add_path_element(std::wstring(L"S"), path_elm);
}
if (arcTo)

View File

@ -395,7 +395,7 @@ void OoxConverter::convert(OOX::Drawing::CDiagrammParts *oox_diagramm)
if (oFile.is_init() && OOX::FileTypes::DiagDrawing == oFile->type())
{
_CP_OPT(double) x, y, width, height, cx = 0, cy = 0;
_CP_OPT(double) x, y, width, height, cx, cy;
odf_context()->drawing_context()->get_size (width, height);
odf_context()->drawing_context()->get_position (x, y);

View File

@ -270,7 +270,6 @@ namespace OOX
class CT_Style1;
class CT_Style;
class CT_TextLanguageID;
class CRichText;
class CTextProperties;
}
namespace Vml
@ -495,8 +494,8 @@ public:
void convert(OOX::Spreadsheet::CT_LineSer *ser);
void convert(OOX::Spreadsheet::CT_AxDataSource *cat, int type);
void convert(OOX::Spreadsheet::CT_NumDataSource *val);
void convert(OOX::Spreadsheet::CRichText *rich);
void convert(OOX::Spreadsheet::CTextProperties *txPr);
//void convert(OOX::Spreadsheet::CRichText *rich);
//void convert(OOX::Spreadsheet::CTextProperties *txPr);
void convert(OOX::Spreadsheet::CT_Tx *ct_tx);
void convert(OOX::Spreadsheet::CT_Layout *ct_layout);
void convert(OOX::Spreadsheet::CT_ManualLayout *ct_layout);

View File

@ -73,32 +73,32 @@ void OoxConverter::convert(OOX::Spreadsheet::CT_ChartSpace *oox_chart)
odf_context()->chart_context()->end_plot_area();
}
void OoxConverter::convert(OOX::Spreadsheet::CRichText* rich)
{
if (rich == NULL)return;
odf_context()->chart_context()->start_text();
OoxConverter::convert(rich->m_oBodyPr.GetPointer());
for (size_t i = 0; i < rich->m_arrItems.size();i++)
{
OoxConverter::convert(rich->m_arrItems[i]);
}
odf_context()->chart_context()->end_text();
}
void OoxConverter::convert(OOX::Spreadsheet::CTextProperties* txPr)
{
if (txPr == NULL)return;
odf_context()->chart_context()->start_text();
OoxConverter::convert(txPr->m_oBodyPr.GetPointer());
for (size_t i = 0; i < txPr->m_arrItems.size();i++)
{
OoxConverter::convert(txPr->m_arrItems[i]);
}
odf_context()->chart_context()->end_text();
}
//void OoxConverter::convert(OOX::Spreadsheet::CRichText* rich)
//{
// if (rich == NULL)return;
//
// odf_context()->chart_context()->start_text();
// OoxConverter::convert(rich->m_oBodyPr.GetPointer());
//
// for (size_t i = 0; i < rich->m_arrItems.size();i++)
// {
// OoxConverter::convert(rich->m_arrItems[i]);
// }
// odf_context()->chart_context()->end_text();
//}
//void OoxConverter::convert(OOX::Spreadsheet::CTextProperties* txPr)
//{
// if (txPr == NULL)return;
//
// odf_context()->chart_context()->start_text();
// OoxConverter::convert(txPr->m_oBodyPr.GetPointer());
//
// for (size_t i = 0; i < txPr->m_arrItems.size();i++)
// {
// OoxConverter::convert(txPr->m_arrItems[i]);
// }
// odf_context()->chart_context()->end_text();
//}
void OoxConverter::convert(OOX::Spreadsheet::CT_Tx* ct_tx)
{
if (ct_tx == NULL)return;

View File

@ -2754,7 +2754,11 @@ void CDrawingConverter::doc_LoadShape(PPTX::Logic::SpTreeElem *elem, XmlUtils::C
{
if (pShape->txBody.IsInit() == false)
pShape->txBody = new PPTX::Logic::TxBody();
pShape->txBody->bodyPr.vert = pShape->TextBoxBodyPr->vert;
if (!pShape->txBody->bodyPr.IsInit())
pShape->txBody->bodyPr = new PPTX::Logic::BodyPr();
pShape->txBody->bodyPr->vert = pShape->TextBoxBodyPr->vert;
}
pPair = oCSSParser.m_mapSettings.find(L"mso-rotate");
@ -2765,7 +2769,11 @@ void CDrawingConverter::doc_LoadShape(PPTX::Logic::SpTreeElem *elem, XmlUtils::C
pShape->TextBoxBodyPr->rot = _wtoi(pPair->second.c_str()) * 60000; //для docx, xlsx
if (pShape->txBody.IsInit() == false) //для pptx
pShape->txBody = new PPTX::Logic::TxBody();
pShape->txBody->bodyPr.rot = pShape->TextBoxBodyPr->rot;
if (!pShape->txBody->bodyPr.IsInit())
pShape->txBody->bodyPr = new PPTX::Logic::BodyPr();
pShape->txBody->bodyPr->rot = pShape->TextBoxBodyPr->rot;
}catch(...){}
}
@ -5210,45 +5218,45 @@ void CDrawingConverter::ConvertMainPropsToVML(const std::wstring& bsMainProps, N
pWriter.m_strStyleMain = oWriter.GetXmlString();
}
HRESULT CDrawingConverter::GetTxBodyBinary(const std::wstring& bsXml)
{
XmlUtils::CXmlNode oNode;
if (!oNode.FromXmlString((std::wstring)bsXml))
return S_FALSE;
PPTX::Logic::TxBody oTxBody(oNode);
//HRESULT CDrawingConverter::GetTxBodyBinary(const std::wstring& bsXml)
//{
// XmlUtils::CXmlNode oNode;
// if (!oNode.FromXmlString((std::wstring)bsXml))
// return S_FALSE;
//
// PPTX::Logic::TxBody oTxBody(oNode);
//
// //m_pBinaryWriter->ClearNoAttack();
// //ULONG lOldPos = m_pBinaryWriter->GetPosition();
// m_pBinaryWriter->m_pCommon->CheckFontPicker();
// //m_pBinaryWriter->m_pCommon->m_pNativePicker->Init(m_strFontDirectory);
//
// m_pBinaryWriter->WriteRecord1(0, oTxBody);
//
// //m_pBinaryWriter->SetPosition(lOldPos);
//
// //m_pBinaryWriter->ClearNoAttack();
// return S_OK;
//}
//m_pBinaryWriter->ClearNoAttack();
//ULONG lOldPos = m_pBinaryWriter->GetPosition();
m_pBinaryWriter->m_pCommon->CheckFontPicker();
//m_pBinaryWriter->m_pCommon->m_pNativePicker->Init(m_strFontDirectory);
m_pBinaryWriter->WriteRecord1(0, oTxBody);
//m_pBinaryWriter->SetPosition(lOldPos);
//m_pBinaryWriter->ClearNoAttack();
return S_OK;
}
HRESULT CDrawingConverter::GetTxBodyXml(LONG lStart, std::wstring& sXml)
{
m_pReader->Seek(lStart);
BYTE type = m_pReader->GetUChar();
if (0 != type)
return S_FALSE;
PPTX::Logic::TxBody oTxBody;
oTxBody.fromPPTY(m_pReader);
NSBinPptxRW::CXmlWriter oWriter;
oTxBody.toXmlWriterExcel(&oWriter);
sXml = oWriter.GetXmlString();
return S_OK;
}
//HRESULT CDrawingConverter::GetTxBodyXml(LONG lStart, std::wstring& sXml)
//{
// m_pReader->Seek(lStart);
//
// BYTE type = m_pReader->GetUChar();
// if (0 != type)
// return S_FALSE;
//
// PPTX::Logic::TxBody oTxBody;
// oTxBody.fromPPTY(m_pReader);
//
// NSBinPptxRW::CXmlWriter oWriter;
// oTxBody.toXmlWriterExcel(&oWriter);
//
// sXml = oWriter.GetXmlString();
//
// return S_OK;
//}
HRESULT CDrawingConverter::SetFontDir(const std::wstring& bsFontDir)
{

View File

@ -236,8 +236,6 @@ namespace NSBinPptxRW
HRESULT WriteRels (const std::wstring& sType, const std::wstring& sTarget, const std::wstring& sTargetMode, long* lId);
HRESULT LoadClrMap (const std::wstring& sXml);
HRESULT(GetTxBodyBinary) (const std::wstring& sXml);
HRESULT(GetTxBodyXml) (long lStart, std::wstring & Xml);
HRESULT(SetFontDir) (const std::wstring& sFontDir);
HRESULT SetFontPicker (COfficeFontPicker* pFontPicker);

View File

@ -73,9 +73,9 @@ namespace PPTX
{
directory = directory.substr(0, pos_ppt - 1); //root directory
}
CArray<std::wstring> arrFiles = NSDirectory::GetFiles(directory, true);
std::vector<std::wstring> arrFiles = NSDirectory::GetFiles(directory, true);
for (int i = 0 ; i < arrFiles.GetCount(); i++)
for (size_t i = 0 ; i < arrFiles.size(); i++)
{
if (std::wstring::npos != arrFiles[i].find(filename))
{

View File

@ -45,9 +45,15 @@ namespace PPTX
class AhBase : public WrapperWritingElement
{
public:
PPTX_LOGIC_BASE(AhBase)
WritingElement_AdditionConstructors(AhBase)
PPTX_LOGIC_BASE2(AhBase)
public:
virtual OOX::EElementType getType() const
{
if (ah.IsInit())
return ah->getType();
return OOX::et_Unknown;
}
virtual void fromXML(XmlUtils::CXmlNode& node)
{
std::wstring name = XmlUtils::GetNameNoNS(node.GetName());
@ -58,7 +64,16 @@ namespace PPTX
ah.reset(new Logic::AhPolar(node));
else ah.reset();
}
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
{
std::wstring sName = oReader.GetName();
if (sName == L"a:ahXY")
ah.reset(new Logic::AhXY(oReader));
else if(sName == L"a:ahPolar")
ah.reset(new Logic::AhPolar(oReader));
else ah.reset();
}
virtual void GetAdjustHandleFrom(XmlUtils::CXmlNode& element)
{
XmlUtils::CXmlNode oNode;

View File

@ -43,9 +43,9 @@ namespace PPTX
class AhPolar : public Ah
{
public:
PPTX_LOGIC_BASE(AhPolar)
WritingElement_AdditionConstructors(AhPolar)
PPTX_LOGIC_BASE2(AhPolar)
public:
virtual void fromXML(XmlUtils::CXmlNode& node)
{
XmlUtils::CXmlNode oPos = node.ReadNode(_T("a:pos"));
@ -60,7 +60,46 @@ namespace PPTX
node.ReadAttributeBase(L"minAng", minAng);
node.ReadAttributeBase(L"minR", minR);
}
virtual OOX::EElementType getType() const
{
return OOX::et_a_ahPolar;
}
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
{
ReadAttributes( oReader );
if ( oReader.IsEmptyNode() )
return;
int nParentDepth = oReader.GetDepth();
while( oReader.ReadNextSiblingNode( nParentDepth ) )
{
std::wstring sName = oReader.GetName();
if (sName == L"a:pos")
{
ReadAttributes2(oReader);
}
}
}
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
{
WritingElement_ReadAttributes_Start( oReader )
WritingElement_ReadAttributes_Read_if ( oReader, _T("gdRefR"), gdRefR )
WritingElement_ReadAttributes_Read_else_if ( oReader, _T("minR"), minR )
WritingElement_ReadAttributes_Read_else_if ( oReader, _T("maxR"), maxR )
WritingElement_ReadAttributes_Read_else_if ( oReader, _T("gdRefAng"), gdRefAng )
WritingElement_ReadAttributes_Read_else_if ( oReader, _T("minAng"), minAng )
WritingElement_ReadAttributes_Read_else_if ( oReader, _T("maxAng"), maxAng )
WritingElement_ReadAttributes_End( oReader )
}
void ReadAttributes2(XmlUtils::CXmlLiteReader& oReader)
{
WritingElement_ReadAttributes_Start( oReader )
WritingElement_ReadAttributes_Read_if ( oReader, _T("x"), x )
WritingElement_ReadAttributes_Read_else_if ( oReader, _T("y"), y )
WritingElement_ReadAttributes_End( oReader )
}
virtual std::wstring toXML() const
{
XmlUtils::CAttribute oAttr1;

View File

@ -43,9 +43,9 @@ namespace PPTX
class AhXY : public Ah
{
public:
PPTX_LOGIC_BASE(AhXY)
WritingElement_AdditionConstructors(AhXY)
PPTX_LOGIC_BASE2(AhXY)
public:
virtual void fromXML(XmlUtils::CXmlNode& node)
{
XmlUtils::CXmlNode oPos = node.ReadNode(_T("a:pos"));
@ -60,7 +60,46 @@ namespace PPTX
node.ReadAttributeBase(L"minX", minX);
node.ReadAttributeBase(L"minY", minY);
}
virtual OOX::EElementType getType() const
{
return OOX::et_a_ahXY;
}
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
{
ReadAttributes( oReader );
if ( oReader.IsEmptyNode() )
return;
int nParentDepth = oReader.GetDepth();
while( oReader.ReadNextSiblingNode( nParentDepth ) )
{
std::wstring sName = oReader.GetName();
if (sName == L"a:pos")
{
ReadAttributes2(oReader);
}
}
}
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
{
WritingElement_ReadAttributes_Start( oReader )
WritingElement_ReadAttributes_Read_if ( oReader, _T("gdRefX"), gdRefX )
WritingElement_ReadAttributes_Read_else_if ( oReader, _T("minX"), minX )
WritingElement_ReadAttributes_Read_else_if ( oReader, _T("maxX"), maxX )
WritingElement_ReadAttributes_Read_else_if ( oReader, _T("gdRefY"), gdRefY )
WritingElement_ReadAttributes_Read_else_if ( oReader, _T("minY"), minY )
WritingElement_ReadAttributes_Read_else_if ( oReader, _T("maxY"), maxY )
WritingElement_ReadAttributes_End( oReader )
}
void ReadAttributes2(XmlUtils::CXmlLiteReader& oReader)
{
WritingElement_ReadAttributes_Start( oReader )
WritingElement_ReadAttributes_Read_if ( oReader, _T("x"), x )
WritingElement_ReadAttributes_Read_else_if ( oReader, _T("y"), y )
WritingElement_ReadAttributes_End( oReader )
}
virtual std::wstring toXML() const
{
XmlUtils::CAttribute oAttr1;

View File

@ -51,9 +51,63 @@ namespace PPTX
class BodyPr : public WrapperWritingElement
{
public:
PPTX_LOGIC_BASE(BodyPr)
WritingElement_AdditionConstructors(BodyPr)
PPTX_LOGIC_BASE2(BodyPr)
public:
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
{
ReadAttributes( oReader );
if ( oReader.IsEmptyNode() )
return;
int nCurDepth = oReader.GetDepth();
while( oReader.ReadNextSiblingNode( nCurDepth ) )
{
std::wstring strName = oReader.GetName();
if (L"a:prstTxWarp" == strName)
prstTxWarp = oReader;
else if (L"a:scene3d" == strName)
scene3d = oReader;
else if (L"a:sp3d" == strName)
sp3d = oReader;
else if (strName == L"a:noAutofit" || strName == L"a:spAutoFit" || strName == L"a:normAutofit")
Fit.fromXML(oReader);
else if (L"a:flatTx" == strName)
{
//oNode.ReadAttributeBase(L"z", flatTx);
}
}
FillParentPointersForChilds();
}
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
{
WritingElement_ReadAttributes_Start ( oReader )
WritingElement_ReadAttributes_Read_if ( oReader, _T("anchor"), anchor )
WritingElement_ReadAttributes_Read_else_if( oReader, _T("anchorCtr"), anchorCtr )
WritingElement_ReadAttributes_Read_else_if( oReader, _T("bIns"), bIns )
WritingElement_ReadAttributes_Read_else_if( oReader, _T("compatLnSpc"), compatLnSpc )
WritingElement_ReadAttributes_Read_else_if( oReader, _T("forceAA"), forceAA )
WritingElement_ReadAttributes_Read_else_if( oReader, _T("fromWordArt"), fromWordArt )
WritingElement_ReadAttributes_Read_else_if( oReader, _T("horzOverflow"), horzOverflow )
WritingElement_ReadAttributes_Read_else_if( oReader, _T("lIns"), lIns )
WritingElement_ReadAttributes_Read_else_if( oReader, _T("numCol"), numCol )
WritingElement_ReadAttributes_Read_else_if( oReader, _T("rIns"), rIns )
WritingElement_ReadAttributes_Read_else_if( oReader, _T("rot"), rot )
WritingElement_ReadAttributes_Read_else_if( oReader, _T("rtlCol"), rtlCol )
WritingElement_ReadAttributes_Read_else_if( oReader, _T("spcCol"), spcCol )
WritingElement_ReadAttributes_Read_else_if( oReader, _T("spcFirstLastPara"), spcFirstLastPara )
WritingElement_ReadAttributes_Read_else_if( oReader, _T("tIns"), tIns )
WritingElement_ReadAttributes_Read_else_if( oReader, _T("upright"), upright )
WritingElement_ReadAttributes_Read_else_if( oReader, _T("vert"), vert )
WritingElement_ReadAttributes_Read_else_if( oReader, _T("vertOverflow"), vertOverflow )
WritingElement_ReadAttributes_Read_else_if( oReader, _T("wrap"), wrap )
WritingElement_ReadAttributes_End ( oReader )
Normalize();
}
virtual void fromXML(XmlUtils::CXmlNode& node)
{
m_namespace = XmlUtils::GetNamespace(node.GetName());
@ -172,10 +226,16 @@ namespace PPTX
pWriter->EndNode(m_namespace + _T(":bodyPr"));
}
void Merge(BodyPr& bodyPr)const
void Merge(nullable<BodyPr>& bodyPr)const
{
if (!bodyPr.IsInit())
{
bodyPr = new PPTX::Logic::BodyPr();
}
if(Fit.type != TextFit::FitEmpty)
Fit.Merge(bodyPr.Fit);
Fit.Merge(bodyPr->Fit);
/*
nullable_property<PrstTxWarp> prstTxWarp;
nullable_property<Scene3d> scene3d;
@ -184,43 +244,43 @@ namespace PPTX
*/
// Attributes
if(anchor.IsInit())
bodyPr.anchor = *anchor;
bodyPr->anchor = *anchor;
if(anchorCtr.IsInit())
bodyPr.anchorCtr = *anchorCtr;
bodyPr->anchorCtr = *anchorCtr;
if(bIns.IsInit())
bodyPr.bIns = *bIns;
bodyPr->bIns = *bIns;
if(compatLnSpc.IsInit())
bodyPr.compatLnSpc = *compatLnSpc;
bodyPr->compatLnSpc = *compatLnSpc;
if(forceAA.IsInit())
bodyPr.forceAA = *forceAA;
bodyPr->forceAA = *forceAA;
if(fromWordArt.IsInit())
bodyPr.fromWordArt = *fromWordArt;
bodyPr->fromWordArt = *fromWordArt;
if(horzOverflow.IsInit())
bodyPr.horzOverflow = *horzOverflow;
bodyPr->horzOverflow = *horzOverflow;
if(lIns.IsInit())
bodyPr.lIns = *lIns;
bodyPr->lIns = *lIns;
if(numCol.IsInit())
bodyPr.numCol = *numCol;
bodyPr->numCol = *numCol;
if(rIns.IsInit())
bodyPr.rIns = *rIns;
bodyPr->rIns = *rIns;
if(rot.IsInit())
bodyPr.rot = *rot;
bodyPr->rot = *rot;
if(rtlCol.IsInit())
bodyPr.rtlCol = *rtlCol;
bodyPr->rtlCol = *rtlCol;
if(spcCol.IsInit())
bodyPr.spcCol = *spcCol;
bodyPr->spcCol = *spcCol;
if(spcFirstLastPara.IsInit())
bodyPr.spcFirstLastPara = *spcFirstLastPara;
bodyPr->spcFirstLastPara = *spcFirstLastPara;
if(tIns.IsInit())
bodyPr.tIns = *tIns;
bodyPr->tIns = *tIns;
if(upright.IsInit())
bodyPr.upright = *upright;
bodyPr->upright = *upright;
if(vert.IsInit())
bodyPr.vert = *vert;
bodyPr->vert = *vert;
if(vertOverflow.IsInit())
bodyPr.vertOverflow = *vertOverflow;
bodyPr->vertOverflow = *vertOverflow;
if(wrap.IsInit())
bodyPr.wrap = *wrap;
bodyPr->wrap = *wrap;
}
virtual void toPPTY(NSBinPptxRW::CBinaryFileWriter* pWriter) const

View File

@ -47,7 +47,8 @@ namespace PPTX
class CustGeom : public WrapperWritingElement
{
public:
PPTX_LOGIC_BASE(CustGeom)
WritingElement_AdditionConstructors(CustGeom)
PPTX_LOGIC_BASE2(CustGeom)
CustGeom& operator=(const CustGeom& oSrc)
{
@ -65,7 +66,107 @@ namespace PPTX
return *this;
}
public:
virtual OOX::EElementType getType() const
{
return OOX::et_a_custGeom;
}
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
{
if ( oReader.IsEmptyNode() )
return;
int nParentDepth = oReader.GetDepth();
while( oReader.ReadNextSiblingNode( nParentDepth ) )
{
std::wstring sName = oReader.GetName();
if (sName == L"a:avLst")
{
int nParentDepth1 = oReader.GetDepth();
while( oReader.ReadNextSiblingNode( nParentDepth1 ) )
{
std::wstring sName1 = oReader.GetName();
if (sName1 == L"a:gd")
{
Gd gd;
avLst.push_back(gd);
avLst.back().fromXML(oReader);
}
}
}
else if (sName == L"a:gdLst")
{
int nParentDepth1 = oReader.GetDepth();
while( oReader.ReadNextSiblingNode( nParentDepth1 ) )
{
std::wstring sName1 = oReader.GetName();
if (sName1 == L"a:gd")
{
Gd gd;
gdLst.push_back(gd);
gdLst.back().fromXML(oReader);
}
}
}
else if (sName == L"a:rect")
rect = oReader;
else if (sName == L"a:pathLst")
{
int nParentDepth1 = oReader.GetDepth();
while( oReader.ReadNextSiblingNode( nParentDepth1 ) )
{
std::wstring sName1 = oReader.GetName();
if (sName1 == L"a:path")
{
Path2D gd;
pathLst.push_back(gd);
pathLst.back().fromXML(oReader);
}
}
}
else if (sName == L"a:ahLst")
{
int nParentDepth1 = oReader.GetDepth();
while( oReader.ReadNextSiblingNode( nParentDepth1 ) )
{
std::wstring sName1 = oReader.GetName();
if (sName1 == L"a:ahPolar")
{
AhBase gd;
ahLst.push_back(gd);
ahLst.back().fromXML(oReader);
}
else if (sName1 == L"a:ahXY")
{
AhBase gd;
ahLst.push_back(gd);
ahLst.back().fromXML(oReader);
}
}
}
else if (sName == L"a:cxnLst")
{
int nParentDepth1 = oReader.GetDepth();
while( oReader.ReadNextSiblingNode( nParentDepth1 ) )
{
std::wstring sName1 = oReader.GetName();
if (sName1 == L"a:cxn")
{
Cxn gd;
cxnLst.push_back(gd);
cxnLst.back().fromXML(oReader);
}
}
}
}
FillParentPointersForChilds();
}
virtual void fromXML(XmlUtils::CXmlNode& node)
{
XmlUtils::CXmlNode oNode;

View File

@ -43,7 +43,8 @@ namespace PPTX
class Cxn : public WrapperWritingElement
{
public:
PPTX_LOGIC_BASE(Cxn)
WritingElement_AdditionConstructors(Cxn)
PPTX_LOGIC_BASE2(Cxn)
Cxn& operator=(const Cxn& oSrc)
{
@ -55,8 +56,41 @@ namespace PPTX
ang = oSrc.ang;
return *this;
}
virtual OOX::EElementType getType() const
{
return OOX::et_a_cxn;
}
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
{
ReadAttributes( oReader );
public:
if ( oReader.IsEmptyNode() )
return;
int nParentDepth = oReader.GetDepth();
while( oReader.ReadNextSiblingNode( nParentDepth ) )
{
std::wstring sName = oReader.GetName();
if (sName == L"a:pos")
{
ReadAttributes2(oReader);
}
}
}
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
{
WritingElement_ReadAttributes_Start( oReader )
WritingElement_ReadAttributes_ReadSingle( oReader, _T("ang"), ang )
WritingElement_ReadAttributes_End( oReader )
}
void ReadAttributes2(XmlUtils::CXmlLiteReader& oReader)
{
WritingElement_ReadAttributes_Start( oReader )
WritingElement_ReadAttributes_Read_if ( oReader, _T("x"), x )
WritingElement_ReadAttributes_Read_else_if ( oReader, _T("y"), y )
WritingElement_ReadAttributes_End( oReader )
}
virtual void fromXML(XmlUtils::CXmlNode& node)
{
ang = node.GetAttribute(_T("ang"));

View File

@ -95,7 +95,7 @@ namespace PPTX
{
XmlUtils::CNodeValue oValue;
oValue.Write(spPr);
oValue.Write(bodyPr);
oValue.WriteNullable(bodyPr);
oValue.Write(lstStyle);
oValue.WriteNullable(style);
@ -105,7 +105,7 @@ namespace PPTX
virtual void toPPTY(NSBinPptxRW::CBinaryFileWriter* pWriter) const
{
pWriter->WriteRecord1(0, spPr);
pWriter->WriteRecord1(1, bodyPr);
pWriter->WriteRecord2(1, bodyPr);
pWriter->WriteRecord1(2, lstStyle);
pWriter->WriteRecord2(3, style);
}
@ -127,8 +127,9 @@ namespace PPTX
}
case 1:
{
bodyPr.m_namespace = _T("a");
bodyPr.fromPPTY(pReader);
bodyPr = BodyPr();
bodyPr->m_namespace = _T("a");
bodyPr->fromPPTY(pReader);
break;
}
case 2:
@ -160,7 +161,9 @@ namespace PPTX
pWriter->m_lFlag = 0x04;
spPr.toXmlWriter(pWriter);
pWriter->m_lFlag = 0;
bodyPr.toXmlWriter(pWriter);
if (bodyPr.IsInit())
bodyPr->toXmlWriter(pWriter);
lstStyle.toXmlWriter(pWriter);
pWriter->Write(style);
@ -169,16 +172,19 @@ namespace PPTX
public:
SpPr spPr;
BodyPr bodyPr;
nullable<BodyPr> bodyPr;
TextListStyle lstStyle;
nullable<ShapeStyle> style;
public:
std::wstring m_name;
std::wstring m_name;
protected:
virtual void FillParentPointersForChilds()
{
spPr.SetParentPointer(this);
bodyPr.SetParentPointer(this);
if (bodyPr.IsInit())
bodyPr->SetParentPointer(this);
lstStyle.SetParentPointer(this);
if(style.IsInit())
style->SetParentPointer(this);

View File

@ -78,7 +78,7 @@ namespace PPTX
int nCurDepth = oReader.GetDepth();
while( oReader.ReadNextSiblingNode( nCurDepth ) )
{
std::wstring strName = oReader.GetName();
std::wstring strName = XmlUtils::GetNameNoNS(oReader.GetName());
if (_T("blip") == strName)
{
if (!blip.IsInit())

View File

@ -42,9 +42,25 @@ namespace PPTX
class Gd : public WrapperWritingElement
{
public:
PPTX_LOGIC_BASE(Gd)
WritingElement_AdditionConstructors(Gd)
PPTX_LOGIC_BASE2(Gd)
public:
virtual OOX::EElementType getType () const
{
return OOX::et_a_gd;
}
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
{
ReadAttributes( oReader );
}
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
{
WritingElement_ReadAttributes_Start ( oReader )
WritingElement_ReadAttributes_Read_if ( oReader, _T("name"), name )
WritingElement_ReadAttributes_Read_else_if ( oReader, _T("fmla"), fmla )
WritingElement_ReadAttributes_End ( oReader )
}
virtual void fromXML(XmlUtils::CXmlNode& node)
{
node.ReadAttributeBase(L"name", name);

View File

@ -45,9 +45,26 @@ namespace PPTX
class Geometry : public WrapperWritingElement
{
public:
PPTX_LOGIC_BASE(Geometry)
WritingElement_AdditionConstructors(Geometry)
PPTX_LOGIC_BASE2(Geometry)
public:
virtual OOX::EElementType getType() const
{
if (m_geometry.IsInit())
return m_geometry->getType();
return OOX::et_Unknown;
}
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
{
std::wstring strName = XmlUtils::GetNameNoNS(oReader.GetName());
if (strName == _T("prstGeom"))
m_geometry.reset(new Logic::PrstGeom(oReader));
else if (strName == _T("custGeom"))
m_geometry.reset(new Logic::CustGeom(oReader));
else
m_geometry.reset();
}
virtual void fromXML(XmlUtils::CXmlNode& node)
{
std::wstring strName = XmlUtils::GetNameNoNS(node.GetName());

View File

@ -45,7 +45,8 @@ namespace PPTX
class Path2D : public WrapperWritingElement
{
public:
PPTX_LOGIC_BASE(Path2D)
WritingElement_AdditionConstructors(Path2D)
PPTX_LOGIC_BASE2(Path2D)
Path2D& operator=(const Path2D& oSrc)
{
@ -62,8 +63,40 @@ namespace PPTX
return *this;
}
virtual OOX::EElementType getType() const
{
return OOX::et_a_path;
}
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
{
ReadAttributes( oReader );
public:
Paths.clear();
if ( oReader.IsEmptyNode() )
return;
int nParentDepth = oReader.GetDepth();
while( oReader.ReadNextSiblingNode( nParentDepth ) )
{
std::wstring sName = oReader.GetName();
UniPath2D p;
Paths.push_back(p);
Paths.back().fromXML(oReader);
}
FillParentPointersForChilds();
}
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
{
WritingElement_ReadAttributes_Start( oReader )
WritingElement_ReadAttributes_Read_if ( oReader, _T("extrusionOk"), extrusionOk)
WritingElement_ReadAttributes_Read_else_if( oReader, _T("fill"), fill )
WritingElement_ReadAttributes_Read_else_if( oReader, _T("h"), h )
WritingElement_ReadAttributes_Read_else_if( oReader, _T("stroke"), stroke )
WritingElement_ReadAttributes_Read_else_if( oReader, _T("w"), w )
WritingElement_ReadAttributes_End( oReader )
}
virtual void fromXML(XmlUtils::CXmlNode& node)
{
node.ReadAttributeBase(L"extrusionOk", extrusionOk);
@ -229,12 +262,12 @@ namespace PPTX
case GEOMETRY_TYPE_PATH_CUBICBEZTO:
{
Logic::CubicBezTo* p = new Logic::CubicBezTo();
p->x1 = arr[0];
p->y1 = arr[1];
p->x2 = arr[2];
p->y2 = arr[3];
p->x3 = arr[4];
p->y3 = arr[5];
p->x[0] = arr[0];
p->y[0] = arr[1];
p->x[1] = arr[2];
p->y[1] = arr[3];
p->x[2] = arr[4];
p->y[2] = arr[5];
oPath.Path2D.reset(p);
break;
}
@ -251,10 +284,10 @@ namespace PPTX
case GEOMETRY_TYPE_PATH_QUADBEZTO:
{
Logic::QuadBezTo* p = new Logic::QuadBezTo();
p->x1 = arr[0];
p->y1 = arr[1];
p->x2 = arr[2];
p->y2 = arr[3];
p->x[0] = arr[0];
p->y[0] = arr[1];
p->x[1] = arr[2];
p->y[1] = arr[3];
oPath.Path2D.reset(p);
break;
}

View File

@ -42,7 +42,8 @@ namespace PPTX
class ArcTo : public PathBase
{
public:
PPTX_LOGIC_BASE(ArcTo)
WritingElement_AdditionConstructors(ArcTo)
PPTX_LOGIC_BASE2(ArcTo)
ArcTo& operator=(const ArcTo& oSrc)
{
@ -56,8 +57,23 @@ namespace PPTX
return *this;
}
public:
virtual OOX::EElementType getType() const
{
return OOX::et_a_arcTo;
}
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
{
ReadAttributes( oReader );
}
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
{
WritingElement_ReadAttributes_Start( oReader )
WritingElement_ReadAttributes_Read_if ( oReader, _T("wR"), wR )
WritingElement_ReadAttributes_Read_else_if ( oReader, _T("hR"), hR)
WritingElement_ReadAttributes_Read_else_if ( oReader, _T("stAng"), stAng)
WritingElement_ReadAttributes_Read_else_if ( oReader, _T("swAng"), swAng)
WritingElement_ReadAttributes_End( oReader )
}
virtual void fromXML(XmlUtils::CXmlNode& node)
{
wR = node.GetAttribute(_T("wR"));

View File

@ -43,7 +43,8 @@ namespace PPTX
class Close : public PathBase
{
public:
PPTX_LOGIC_BASE(Close)
WritingElement_AdditionConstructors(Close)
PPTX_LOGIC_BASE2(Close)
Close& operator=(const Close& oSrc)
{
@ -52,8 +53,14 @@ namespace PPTX
return *this;
}
virtual OOX::EElementType getType() const
{
return OOX::et_a_close;
}
public:
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
{
}
virtual void fromXML(XmlUtils::CXmlNode& node)
{
}

View File

@ -43,24 +43,24 @@ namespace PPTX
class CubicBezTo : public PathBase
{
public:
PPTX_LOGIC_BASE(CubicBezTo)
WritingElement_AdditionConstructors(CubicBezTo)
PPTX_LOGIC_BASE2(CubicBezTo)
CubicBezTo& operator=(const CubicBezTo& oSrc)
{
parentFile = oSrc.parentFile;
parentElement = oSrc.parentElement;
x1 = oSrc.x1;
y1 = oSrc.y1;
x2 = oSrc.x2;
y2 = oSrc.y2;
x3 = oSrc.x3;
y3 = oSrc.y3;
x[0] = oSrc.x[0];
y[0] = oSrc.y[0];
x[1] = oSrc.x[1];
y[1] = oSrc.y[1];
x[2] = oSrc.x[2];
y[2] = oSrc.y[2];
return *this;
}
public:
virtual void fromXML(XmlUtils::CXmlNode& node)
{
XmlUtils::CXmlNodes oNodes;
@ -73,23 +73,53 @@ namespace PPTX
XmlUtils::CXmlNode oNode;
oNodes.GetAt(0, oNode);
x1 = oNode.GetAttribute(_T("x"));
y1 = oNode.GetAttribute(_T("y"));
x[0] = oNode.GetAttribute(_T("x"));
y[0] = oNode.GetAttribute(_T("y"));
oNodes.GetAt(1, oNode);
x2 = oNode.GetAttribute(_T("x"));
y2 = oNode.GetAttribute(_T("y"));
x[1] = oNode.GetAttribute(_T("x"));
y[1] = oNode.GetAttribute(_T("y"));
oNodes.GetAt(2, oNode);
x3 = oNode.GetAttribute(_T("x"));
y3 = oNode.GetAttribute(_T("y"));
x[2] = oNode.GetAttribute(_T("x"));
y[2] = oNode.GetAttribute(_T("y"));
}
}
}
virtual OOX::EElementType getType() const
{
return OOX::et_a_cubicBezTo;
}
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
{
if ( oReader.IsEmptyNode() )
return;
int count = 0;
int nParentDepth = oReader.GetDepth();
while( oReader.ReadNextSiblingNode( nParentDepth ) )
{
std::wstring sName = oReader.GetName();
if (sName == L"a:pos")
{
ReadAttributes2(oReader, x[count], y[count]);
count++;
}
}
}
void ReadAttributes2(XmlUtils::CXmlLiteReader& oReader, std::wstring & x, std::wstring & y)
{
WritingElement_ReadAttributes_Start( oReader )
WritingElement_ReadAttributes_Read_if ( oReader, _T("x"), x )
WritingElement_ReadAttributes_Read_else_if ( oReader, _T("y"), y )
WritingElement_ReadAttributes_End( oReader )
}
virtual std::wstring toXML() const
{
std::wstring str1 = L"<a:pt x=\"" + x1 + L"\" y=\"" + y1 + L"\" />";
std::wstring str2 = L"<a:pt x=\"" + x2 + L"\" y=\"" + y2 + L"\" />";
std::wstring str3 = L"<a:pt x=\"" + x3 + L"\" y=\"" + y3 + L"\" />";
std::wstring str1 = L"<a:pt x=\"" + x[0] + L"\" y=\"" + y[0] + L"\" />";
std::wstring str2 = L"<a:pt x=\"" + x[1] + L"\" y=\"" + y[1] + L"\" />";
std::wstring str3 = L"<a:pt x=\"" + x[2] + L"\" y=\"" + y[2] + L"\" />";
return _T("<a:cubicBezTo>") + str1 + str2 + str3 + _T("</a:cubicBezTo>");
}
@ -101,22 +131,22 @@ namespace PPTX
pWriter->StartNode(_T("a:pt"));
pWriter->StartAttributes();
pWriter->WriteAttribute(_T("x"), x1);
pWriter->WriteAttribute(_T("y"), y1);
pWriter->WriteAttribute(_T("x"), x[0]);
pWriter->WriteAttribute(_T("y"), y[0]);
pWriter->EndAttributes();
pWriter->EndNode(_T("a:pt"));
pWriter->StartNode(_T("a:pt"));
pWriter->StartAttributes();
pWriter->WriteAttribute(_T("x"), x2);
pWriter->WriteAttribute(_T("y"), y2);
pWriter->WriteAttribute(_T("x"), x[1]);
pWriter->WriteAttribute(_T("y"), y[1]);
pWriter->EndAttributes();
pWriter->EndNode(_T("a:pt"));
pWriter->StartNode(_T("a:pt"));
pWriter->StartAttributes();
pWriter->WriteAttribute(_T("x"), x3);
pWriter->WriteAttribute(_T("y"), y3);
pWriter->WriteAttribute(_T("x"), x[2]);
pWriter->WriteAttribute(_T("y"), y[2]);
pWriter->EndAttributes();
pWriter->EndNode(_T("a:pt"));
@ -128,33 +158,29 @@ namespace PPTX
pWriter->StartRecord(GEOMETRY_TYPE_PATH_CUBICBEZTO);
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeStart);
pWriter->WriteString1(0, x1);
pWriter->WriteString1(1, y1);
pWriter->WriteString1(2, x2);
pWriter->WriteString1(3, y2);
pWriter->WriteString1(4, x3);
pWriter->WriteString1(5, y3);
pWriter->WriteString1(0, x[0]);
pWriter->WriteString1(1, y[0]);
pWriter->WriteString1(2, x[1]);
pWriter->WriteString1(3, y[1]);
pWriter->WriteString1(4, x[2]);
pWriter->WriteString1(5, y[2]);
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeEnd);
pWriter->EndRecord();
}
public:
std::wstring x1;
std::wstring y1;
std::wstring x2;
std::wstring y2;
std::wstring x3;
std::wstring y3;
std::wstring x[3];
std::wstring y[3];
protected:
virtual void FillParentPointersForChilds(){};
public:
virtual std::wstring GetODString()const
{
std::wstring str1 = L"<pt x=\"" + x1 + L"\" y=\"" + y1 + L"\"/>";
std::wstring str2 = L"<pt x=\"" + x2 + L"\" y=\"" + y2 + L"\"/>";
std::wstring str3 = L"<pt x=\"" + x3 + L"\" y=\"" + y3 + L"\"/>";
std::wstring str1 = L"<pt x=\"" + x[0] + L"\" y=\"" + y[0] + L"\"/>";
std::wstring str2 = L"<pt x=\"" + x[1] + L"\" y=\"" + y[1] + L"\"/>";
std::wstring str3 = L"<pt x=\"" + x[2] + L"\" y=\"" + y[2] + L"\"/>";
return _T("<cubicBezTo>") + str1 + str2 + str3 + _T("</cubicBezTo>");
}

View File

@ -43,7 +43,8 @@ namespace PPTX
class LineTo : public PathBase
{
public:
PPTX_LOGIC_BASE(LineTo)
WritingElement_AdditionConstructors(LineTo)
PPTX_LOGIC_BASE2(LineTo)
LineTo& operator=(const LineTo& oSrc)
{
@ -55,7 +56,33 @@ namespace PPTX
return *this;
}
public:
virtual OOX::EElementType getType() const
{
return OOX::et_a_lineTo;
}
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
{
if ( oReader.IsEmptyNode() )
return;
int nParentDepth = oReader.GetDepth();
while( oReader.ReadNextSiblingNode( nParentDepth ) )
{
std::wstring sName = oReader.GetName();
if (sName == L"a:pos")
{
ReadAttributes2(oReader);
}
}
}
void ReadAttributes2(XmlUtils::CXmlLiteReader& oReader)
{
WritingElement_ReadAttributes_Start( oReader )
WritingElement_ReadAttributes_Read_if ( oReader, _T("x"), x )
WritingElement_ReadAttributes_Read_else_if ( oReader, _T("y"), y )
WritingElement_ReadAttributes_End( oReader )
}
virtual void fromXML(XmlUtils::CXmlNode& node)
{
XmlUtils::CXmlNode oNode;

View File

@ -43,7 +43,8 @@ namespace PPTX
class MoveTo : public PathBase
{
public:
PPTX_LOGIC_BASE(MoveTo)
WritingElement_AdditionConstructors(MoveTo)
PPTX_LOGIC_BASE2(MoveTo)
MoveTo& operator=(const MoveTo& oSrc)
{
@ -54,8 +55,34 @@ namespace PPTX
y = oSrc.y;
return *this;
}
virtual OOX::EElementType getType() const
{
return OOX::et_a_moveTo;
}
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
{
if ( oReader.IsEmptyNode() )
return;
int nParentDepth = oReader.GetDepth();
while( oReader.ReadNextSiblingNode( nParentDepth ) )
{
std::wstring sName = oReader.GetName();
public:
if (sName == L"a:pos")
{
ReadAttributes2(oReader);
}
}
}
void ReadAttributes2(XmlUtils::CXmlLiteReader& oReader)
{
WritingElement_ReadAttributes_Start( oReader )
WritingElement_ReadAttributes_Read_if ( oReader, _T("x"), x )
WritingElement_ReadAttributes_Read_else_if ( oReader, _T("y"), y )
WritingElement_ReadAttributes_End( oReader )
}
virtual void fromXML(XmlUtils::CXmlNode& node)
{
XmlUtils::CXmlNode oNode;

View File

@ -42,21 +42,52 @@ namespace PPTX
class QuadBezTo : public PathBase
{
public:
PPTX_LOGIC_BASE(QuadBezTo)
WritingElement_AdditionConstructors(QuadBezTo)
PPTX_LOGIC_BASE2(QuadBezTo)
QuadBezTo& operator=(const QuadBezTo& oSrc)
{
parentFile = oSrc.parentFile;
parentElement = oSrc.parentElement;
x1 = oSrc.x1;
y1 = oSrc.y1;
x2 = oSrc.x2;
y2 = oSrc.y2;
x[0] = oSrc.x[0];
y[0] = oSrc.y[0];
x[1] = oSrc.x[1];
y[1] = oSrc.y[1];
return (*this);
}
public:
virtual OOX::EElementType getType() const
{
return OOX::et_a_quadBezTo;
}
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
{
if ( oReader.IsEmptyNode() )
return;
int count = 0;
int nParentDepth = oReader.GetDepth();
while( oReader.ReadNextSiblingNode( nParentDepth ) )
{
std::wstring sName = oReader.GetName();
if (sName == L"a:pos")
{
ReadAttributes2(oReader, x[count], y[count]);
count++;
}
}
}
void ReadAttributes2(XmlUtils::CXmlLiteReader& oReader, std::wstring & x, std::wstring & y)
{
WritingElement_ReadAttributes_Start( oReader )
WritingElement_ReadAttributes_Read_if ( oReader, _T("x"), x )
WritingElement_ReadAttributes_Read_else_if ( oReader, _T("y"), y )
WritingElement_ReadAttributes_End( oReader )
}
virtual void fromXML(XmlUtils::CXmlNode& node)
{
XmlUtils::CXmlNodes oNodes;
@ -69,19 +100,19 @@ namespace PPTX
XmlUtils::CXmlNode oNode;
oNodes.GetAt(0, oNode);
x1 = oNode.GetAttribute(_T("x"));
y1 = oNode.GetAttribute(_T("y"));
x[0] = oNode.GetAttribute(_T("x"));
y[0] = oNode.GetAttribute(_T("y"));
oNodes.GetAt(1, oNode);
x2 = oNode.GetAttribute(_T("x"));
y2 = oNode.GetAttribute(_T("y"));
x[1] = oNode.GetAttribute(_T("x"));
y[1] = oNode.GetAttribute(_T("y"));
}
}
}
virtual std::wstring toXML() const
{
std::wstring str1 = L"<a:pt x=\"" + x1 + L"\" y=\"" + y1 + L"\" />";
std::wstring str2 = L"<a:pt x=\"" + x2 + L"\" y=\"" + y2 + L"\" />";
std::wstring str1 = L"<a:pt x=\"" + x[0] + L"\" y=\"" + y[0] + L"\" />";
std::wstring str2 = L"<a:pt x=\"" + x[1] + L"\" y=\"" + y[1] + L"\" />";
return _T("<a:quadBezTo>") + str1 + str2 + _T("</a:quadBezTo>");
}
@ -93,15 +124,15 @@ namespace PPTX
pWriter->StartNode(_T("a:pt"));
pWriter->StartAttributes();
pWriter->WriteAttribute(_T("x"), x1);
pWriter->WriteAttribute(_T("y"), y1);
pWriter->WriteAttribute(_T("x"), x[0]);
pWriter->WriteAttribute(_T("y"), y[0]);
pWriter->EndAttributes();
pWriter->EndNode(_T("a:pt"));
pWriter->StartNode(_T("a:pt"));
pWriter->StartAttributes();
pWriter->WriteAttribute(_T("x"), x2);
pWriter->WriteAttribute(_T("y"), y2);
pWriter->WriteAttribute(_T("x"), x[1]);
pWriter->WriteAttribute(_T("y"), y[1]);
pWriter->EndAttributes();
pWriter->EndNode(_T("a:pt"));
@ -113,27 +144,25 @@ namespace PPTX
pWriter->StartRecord(GEOMETRY_TYPE_PATH_QUADBEZTO);
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeStart);
pWriter->WriteString1(0, x1);
pWriter->WriteString1(1, y1);
pWriter->WriteString1(2, x2);
pWriter->WriteString1(3, y2);
pWriter->WriteString1(0, x[0]);
pWriter->WriteString1(1, y[0]);
pWriter->WriteString1(2, x[1]);
pWriter->WriteString1(3, y[1]);
pWriter->WriteBYTE(NSBinPptxRW::g_nodeAttributeEnd);
pWriter->EndRecord();
}
public:
std::wstring x1;
std::wstring y1;
std::wstring x2;
std::wstring y2;
std::wstring x[2];
std::wstring y[2];
protected:
virtual void FillParentPointersForChilds(){};
public:
virtual std::wstring GetODString()const
{
std::wstring str1 = L"<a:pt x=\"" + x1 + L"\" y=\"" + y1 + L"\" />";
std::wstring str2 = L"<a:pt x=\"" + x2 + L"\" y=\"" + y2 + L"\" />";
std::wstring str1 = L"<a:pt x=\"" + x[0] + L"\" y=\"" + y[0] + L"\" />";
std::wstring str2 = L"<a:pt x=\"" + x[1] + L"\" y=\"" + y[1] + L"\" />";
return _T("<quadBezTo>") + str1 + str2 + _T("</quadBezTo>");
}

View File

@ -44,7 +44,8 @@ namespace PPTX
class PrstGeom : public WrapperWritingElement
{
public:
PPTX_LOGIC_BASE(PrstGeom)
WritingElement_AdditionConstructors(PrstGeom)
PPTX_LOGIC_BASE2(PrstGeom)
PrstGeom& operator=(const PrstGeom& oSrc)
{
@ -56,8 +57,47 @@ namespace PPTX
return *this;
}
virtual OOX::EElementType getType() const
{
return OOX::et_a_prstGeom;
}
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
{
ReadAttributes( oReader );
public:
if ( oReader.IsEmptyNode() )
return;
int nParentDepth = oReader.GetDepth();
while( oReader.ReadNextSiblingNode( nParentDepth ) )
{
std::wstring sName = oReader.GetName();
if (sName == L"a:avLst")
{
int nParentDepth1 = oReader.GetDepth();
while( oReader.ReadNextSiblingNode( nParentDepth1 ) )
{
std::wstring sName1 = oReader.GetName();
if (sName1 == L"a:gd")
{
Gd gd;
avLst.push_back(gd);
avLst.back().fromXML(oReader);
}
}
}
}
FillParentPointersForChilds();
}
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
{
WritingElement_ReadAttributes_Start( oReader )
WritingElement_ReadAttributes_ReadSingle( oReader, _T("r:prst"), prst)
WritingElement_ReadAttributes_End( oReader )
}
virtual void fromXML(XmlUtils::CXmlNode& node)
{
node.ReadAttributeBase(L"prst", prst);

View File

@ -44,7 +44,8 @@ namespace PPTX
class PrstTxWarp : public WrapperWritingElement
{
public:
PPTX_LOGIC_BASE(PrstTxWarp)
WritingElement_AdditionConstructors(PrstTxWarp)
PPTX_LOGIC_BASE2(PrstTxWarp)
PrstTxWarp& operator=(const PrstTxWarp& oSrc)
{
@ -56,8 +57,45 @@ namespace PPTX
return *this;
}
virtual OOX::EElementType getType () const
{
return OOX::et_a_prstTxWarp;
}
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
{
ReadAttributes( oReader );
public:
if ( oReader.IsEmptyNode() )
return;
int nCurDepth = oReader.GetDepth();
while( oReader.ReadNextSiblingNode( nCurDepth ) )
{
std::wstring strName = oReader.GetName();
if (_T("a:avLst") == strName)
{
int nCurDepth1 = oReader.GetDepth();
while( oReader.ReadNextSiblingNode( nCurDepth1 ) )
{
std::wstring strName1 = oReader.GetName();
if (_T("a:gd") == strName1)
{
Gd gd;
avLst.push_back(gd);
avLst.back().fromXML(oReader);
}
}
}
}
}
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
{
WritingElement_ReadAttributes_Start ( oReader )
WritingElement_ReadAttributes_ReadSingle ( oReader, _T("prst"), prst )
WritingElement_ReadAttributes_End ( oReader )
}
virtual void fromXML(XmlUtils::CXmlNode& node)
{
node.ReadAttributeBase(L"prst", prst);

View File

@ -176,7 +176,7 @@ namespace PPTX
if (pWriter->m_lDocType != XMLWRITER_DOC_TYPE_DOCX)
{
if (pWriter->m_lDocType == XMLWRITER_DOC_TYPE_XLSX && txBody.is_init())
txBody->m_ns = _T("xdr");
txBody->m_name = _T("xdr:txBody");
pWriter->Write(txBody);
}
@ -198,7 +198,7 @@ namespace PPTX
}
else if (txBody.is_init())
{
txBody->m_ns = _T("wps");
txBody->m_name = _T("wps:txBody");
pWriter->Write(txBody);
}
@ -371,7 +371,7 @@ namespace PPTX
pWriter->m_pMainDocument->getBinaryContent(strContent, *pWriter, lDataSize);
pWriter->EndRecord();
pWriter->WriteRecord1(5, txBody->bodyPr);
pWriter->WriteRecord2(5, txBody->bodyPr);
}
}
else
@ -597,7 +597,9 @@ namespace PPTX
if(!shape.txBody.is_init())
shape.txBody = new TxBody();
txBody->bodyPr.Merge(shape.txBody->bodyPr);
if (txBody->bodyPr.IsInit())
txBody->bodyPr->Merge(shape.txBody->bodyPr);
if(txBody->lstStyle.is_init())
{
for (int i = 0; i < 10; i++)
@ -738,9 +740,9 @@ namespace PPTX
if (txBody.is_init())
{
if (txBody->bodyPr.anchor.is_init())
if (txBody->bodyPr.IsInit() && txBody->bodyPr->anchor.is_init())
{
std::wstring _strAnchor = txBody->bodyPr.anchor->get();
std::wstring _strAnchor = txBody->bodyPr->anchor->get();
if (_strAnchor == L"t")
oStylesWriter.WriteAttributeCSS(L"v-text-anchor", L"top");
else if (_strAnchor == L"b")

View File

@ -65,7 +65,9 @@ namespace PPTX
{
if(Src.IsInit())
{
Src->bodyPr.Merge(bodyPr);
if (Src->bodyPr.IsInit())
Src->bodyPr->Merge(bodyPr);
if(Src->lstStyle.IsInit())
{
for(int i = 0; i < 10; i++)
@ -753,7 +755,9 @@ namespace PPTX
void ShapeProperties::SetParentFilePointer(const WrapperFile* pFile)
{
bodyPr.SetParentFilePointer(pFile);
if (bodyPr.IsInit())
bodyPr->SetParentFilePointer(pFile);
for(int i = 0; i < 10; i ++)
{
levels[i]->SetParentFilePointer(pFile);
@ -766,45 +770,53 @@ namespace PPTX
DWORD ShapeProperties::GetHyperlinkRGBA()const
{
if(bodyPr.parentFileIs<Slide>())
return bodyPr.parentFileAs<Slide>().GetRGBAFromMap(_T("hlink"));
else if(bodyPr.parentFileIs<SlideLayout>())
return bodyPr.parentFileAs<SlideLayout>().GetRGBAFromMap(_T("hlink"));
else if(bodyPr.parentFileIs<SlideMaster>())
return bodyPr.parentFileAs<SlideMaster>().GetRGBAFromMap(_T("hlink"));
if (!bodyPr.IsInit()) return 0;
if(bodyPr->parentFileIs<Slide>())
return bodyPr->parentFileAs<Slide>().GetRGBAFromMap(_T("hlink"));
else if(bodyPr->parentFileIs<SlideLayout>())
return bodyPr->parentFileAs<SlideLayout>().GetRGBAFromMap(_T("hlink"));
else if(bodyPr->parentFileIs<SlideMaster>())
return bodyPr->parentFileAs<SlideMaster>().GetRGBAFromMap(_T("hlink"));
else return 0;
}
DWORD ShapeProperties::GetHyperlinkARGB()const
{
if(bodyPr.parentFileIs<Slide>())
return bodyPr.parentFileAs<Slide>().GetARGBFromMap(_T("hlink"));
else if(bodyPr.parentFileIs<SlideLayout>())
return bodyPr.parentFileAs<SlideLayout>().GetARGBFromMap(_T("hlink"));
else if(bodyPr.parentFileIs<SlideMaster>())
return bodyPr.parentFileAs<SlideMaster>().GetARGBFromMap(_T("hlink"));
if (!bodyPr.IsInit()) return 0;
if(bodyPr->parentFileIs<Slide>())
return bodyPr->parentFileAs<Slide>().GetARGBFromMap(_T("hlink"));
else if(bodyPr->parentFileIs<SlideLayout>())
return bodyPr->parentFileAs<SlideLayout>().GetARGBFromMap(_T("hlink"));
else if(bodyPr->parentFileIs<SlideMaster>())
return bodyPr->parentFileAs<SlideMaster>().GetARGBFromMap(_T("hlink"));
else return 0;
}
DWORD ShapeProperties::GetHyperlinkBGRA()const
{
if(bodyPr.parentFileIs<Slide>())
return bodyPr.parentFileAs<Slide>().GetBGRAFromMap(_T("hlink"));
else if(bodyPr.parentFileIs<SlideLayout>())
return bodyPr.parentFileAs<SlideLayout>().GetBGRAFromMap(_T("hlink"));
else if(bodyPr.parentFileIs<SlideMaster>())
return bodyPr.parentFileAs<SlideMaster>().GetBGRAFromMap(_T("hlink"));
if (!bodyPr.IsInit()) return 0;
if(bodyPr->parentFileIs<Slide>())
return bodyPr->parentFileAs<Slide>().GetBGRAFromMap(_T("hlink"));
else if(bodyPr->parentFileIs<SlideLayout>())
return bodyPr->parentFileAs<SlideLayout>().GetBGRAFromMap(_T("hlink"));
else if(bodyPr->parentFileIs<SlideMaster>())
return bodyPr->parentFileAs<SlideMaster>().GetBGRAFromMap(_T("hlink"));
else return 0;
}
DWORD ShapeProperties::GetHyperlinkABGR()const
{
if(bodyPr.parentFileIs<Slide>())
return bodyPr.parentFileAs<Slide>().GetABGRFromMap(_T("hlink"));
else if(bodyPr.parentFileIs<SlideLayout>())
return bodyPr.parentFileAs<SlideLayout>().GetABGRFromMap(_T("hlink"));
else if(bodyPr.parentFileIs<SlideMaster>())
return bodyPr.parentFileAs<SlideMaster>().GetABGRFromMap(_T("hlink"));
if (!bodyPr.IsInit()) return 0;
if(bodyPr->parentFileIs<Slide>())
return bodyPr->parentFileAs<Slide>().GetABGRFromMap(_T("hlink"));
else if(bodyPr->parentFileIs<SlideLayout>())
return bodyPr->parentFileAs<SlideLayout>().GetABGRFromMap(_T("hlink"));
else if(bodyPr->parentFileIs<SlideMaster>())
return bodyPr->parentFileAs<SlideMaster>().GetABGRFromMap(_T("hlink"));
else return 0;
}

View File

@ -56,7 +56,7 @@ namespace PPTX
nullable<FontRef> fontStyle;
nullable<TextParagraphPr> levels[10];
nullable<TextParagraphPr> masters[10];
BodyPr bodyPr;
nullable<BodyPr> bodyPr;
//std::string MajorLatin;
//std::string MinorLatin;
@ -80,7 +80,7 @@ namespace PPTX
void SetMajorLatin(const TextFont& mjltFont){MajorLatin = mjltFont;};
void SetMinorLatin(const TextFont& mnltFont){MinorLatin = mnltFont;};
std::wstring GetAnchor()const{return bodyPr.anchor.get_value_or(_T("t"));};
std::wstring GetAnchor()const{return bodyPr.IsInit() ? bodyPr->anchor.get_value_or(L"t") : L"t";};
std::wstring GetParagraphAlgn (int level, const nullable<TextParagraphPr>& pParagraph)const;
int GetParagraphLeftMargin (int level, const nullable<TextParagraphPr>& pParagraph)const;

View File

@ -101,7 +101,9 @@ namespace PPTX
{
if (Src.IsInit())
{
Src->bodyPr.Merge(bodyPr);
if (Src->bodyPr.IsInit())
Src->bodyPr->Merge(bodyPr);
if (Src->lstStyle.IsInit())
{
for(int i = 0; i < 10; i++)
@ -589,48 +591,57 @@ namespace PPTX
DWORD CShapeTextProperties::GetHyperlinkRGBA()const
{
if(bodyPr.parentFileIs<Slide>())
return bodyPr.parentFileAs<Slide>().GetRGBAFromMap(_T("hlink"));
else if(bodyPr.parentFileIs<SlideLayout>())
return bodyPr.parentFileAs<SlideLayout>().GetRGBAFromMap(_T("hlink"));
else if(bodyPr.parentFileIs<SlideMaster>())
return bodyPr.parentFileAs<SlideMaster>().GetRGBAFromMap(_T("hlink"));
if (!bodyPr.IsInit()) return 0;
if(bodyPr->parentFileIs<Slide>())
return bodyPr->parentFileAs<Slide>().GetRGBAFromMap(_T("hlink"));
else if(bodyPr->parentFileIs<SlideLayout>())
return bodyPr->parentFileAs<SlideLayout>().GetRGBAFromMap(_T("hlink"));
else if(bodyPr->parentFileIs<SlideMaster>())
return bodyPr->parentFileAs<SlideMaster>().GetRGBAFromMap(_T("hlink"));
else return 0;
}
DWORD CShapeTextProperties::GetHyperlinkARGB()const
{
if(bodyPr.parentFileIs<Slide>())
return bodyPr.parentFileAs<Slide>().GetARGBFromMap(_T("hlink"));
else if(bodyPr.parentFileIs<SlideLayout>())
return bodyPr.parentFileAs<SlideLayout>().GetARGBFromMap(_T("hlink"));
else if(bodyPr.parentFileIs<SlideMaster>())
return bodyPr.parentFileAs<SlideMaster>().GetARGBFromMap(_T("hlink"));
if (!bodyPr.IsInit()) return 0;
if(bodyPr->parentFileIs<Slide>())
return bodyPr->parentFileAs<Slide>().GetARGBFromMap(_T("hlink"));
else if(bodyPr->parentFileIs<SlideLayout>())
return bodyPr->parentFileAs<SlideLayout>().GetARGBFromMap(_T("hlink"));
else if(bodyPr->parentFileIs<SlideMaster>())
return bodyPr->parentFileAs<SlideMaster>().GetARGBFromMap(_T("hlink"));
else return 0;
}
DWORD CShapeTextProperties::GetHyperlinkBGRA()const
{
if(bodyPr.parentFileIs<Slide>())
return bodyPr.parentFileAs<Slide>().GetBGRAFromMap(_T("hlink"));
else if(bodyPr.parentFileIs<SlideLayout>())
return bodyPr.parentFileAs<SlideLayout>().GetBGRAFromMap(_T("hlink"));
else if(bodyPr.parentFileIs<SlideMaster>())
return bodyPr.parentFileAs<SlideMaster>().GetBGRAFromMap(_T("hlink"));
if (!bodyPr.IsInit()) return 0;
if(bodyPr->parentFileIs<Slide>())
return bodyPr->parentFileAs<Slide>().GetBGRAFromMap(_T("hlink"));
else if(bodyPr->parentFileIs<SlideLayout>())
return bodyPr->parentFileAs<SlideLayout>().GetBGRAFromMap(_T("hlink"));
else if(bodyPr->parentFileIs<SlideMaster>())
return bodyPr->parentFileAs<SlideMaster>().GetBGRAFromMap(_T("hlink"));
else return 0;
}
DWORD CShapeTextProperties::GetHyperlinkABGR()const
{
if(bodyPr.parentFileIs<Slide>())
return bodyPr.parentFileAs<Slide>().GetABGRFromMap(_T("hlink"));
else if(bodyPr.parentFileIs<SlideLayout>())
return bodyPr.parentFileAs<SlideLayout>().GetABGRFromMap(_T("hlink"));
else if(bodyPr.parentFileIs<SlideMaster>())
return bodyPr.parentFileAs<SlideMaster>().GetABGRFromMap(_T("hlink"));
if (!bodyPr.IsInit()) return 0;
if(bodyPr->parentFileIs<Slide>())
return bodyPr->parentFileAs<Slide>().GetABGRFromMap(_T("hlink"));
else if(bodyPr->parentFileIs<SlideLayout>())
return bodyPr->parentFileAs<SlideLayout>().GetABGRFromMap(_T("hlink"));
else if(bodyPr->parentFileIs<SlideMaster>())
return bodyPr->parentFileAs<SlideMaster>().GetABGRFromMap(_T("hlink"));
else return 0;
}
void CShapeTextProperties::SetParentFilePointer(const WrapperFile* pFile)
{
bodyPr.SetParentFilePointer(pFile);
if (bodyPr.IsInit())
bodyPr->SetParentFilePointer(pFile);
m_pFile = pFile;

View File

@ -48,11 +48,11 @@ namespace PPTX
class CFontInfo
{
public:
LONG FontRef;
LONG FontRef;
std::wstring strFontName;
std::wstring strPanose;
std::wstring strPitchFamily;
BYTE Charset;
std::wstring strPanose;
std::wstring strPitchFamily;
BYTE Charset;
public:
CFontInfo()
@ -90,7 +90,7 @@ namespace PPTX
LONG m_lTextType;
nullable<TextParagraphPr> m_levels[10];
nullable<TextParagraphPr> m_body[10];
BodyPr bodyPr;
nullable<BodyPr> bodyPr;
// просто указатель - он должен выставиться из темы
std::vector<nullable<TextParagraphPr>*>* m_masters;
@ -135,7 +135,7 @@ namespace PPTX
return -1;
}
std::wstring GetAnchor()const{return bodyPr.anchor.get_value_or(_T("t"));};
std::wstring GetAnchor()const{return bodyPr.IsInit() ? bodyPr->anchor.get_value_or(L"t") : L"t"; };
nullable_base<WORD> GetParagraphAlgn (int level, const nullable<TextParagraphPr>& pParagraph)const;
nullable_base<LONG> GetParagraphLeftMargin (int level, const nullable<TextParagraphPr>& pParagraph)const;

View File

@ -44,26 +44,73 @@ namespace PPTX
{
Fill.m_type = UniFill::notInit;
}
SpPr::~SpPr()
{
}
SpPr::SpPr(XmlUtils::CXmlNode& node)
{
fromXML(node);
}
SpPr::SpPr(XmlUtils::CXmlLiteReader& oReader)
{
fromXML(oReader);
}
const SpPr& SpPr::operator =(XmlUtils::CXmlNode& node)
{
fromXML(node);
return *this;
}
const SpPr& SpPr::operator =(XmlUtils::CXmlLiteReader& oReader)
{
fromXML(oReader);
return *this;
}
void SpPr::fromXML(XmlUtils::CXmlLiteReader& oReader)
{
m_namespace = XmlUtils::GetNamespace(oReader.GetName());
ReadAttributes( oReader );
if ( oReader.IsEmptyNode() )
return;
int nParentDepth = oReader.GetDepth();
while( oReader.ReadNextSiblingNode( nParentDepth ) )
{
std::wstring sName = XmlUtils::GetNameNoNS(oReader.GetName());
if ( L"xfrm" == sName)
xfrm = oReader;
else if ( L"ln" == sName)
ln = oReader;
else if ( L"scene3d" == sName)
scene3d = oReader;
else if ( L"sp3d" == sName)
sp3d = oReader;
else if ( L"blipFill" == sName ||
L"gradFill" == sName ||
L"grpFill" == sName ||
L"noFill" == sName ||
L"pattFill" == sName ||
L"solidFill" == sName )
{
Fill.fromXML(oReader);
}
else if ( L"effectDag" == sName ||
L"effectLst" == sName ||
L"extLst" == sName )
{
EffectList.fromXML(oReader);
}
else if ( L"prstGeom" == sName ||
L"custGeom" == sName)
{
Geometry.fromXML(oReader);
}
}
FillParentPointersForChilds();
}
void SpPr::fromXML(XmlUtils::CXmlNode& node)
{
m_namespace = XmlUtils::GetNamespace(node.GetName());

View File

@ -57,12 +57,24 @@ namespace PPTX
explicit SpPr(XmlUtils::CXmlNode& node);
const SpPr& operator =(XmlUtils::CXmlNode& node);
explicit SpPr(XmlUtils::CXmlLiteReader& oReader);
const SpPr& operator =(XmlUtils::CXmlLiteReader& oReader);
virtual OOX::EElementType getType () const
{
return OOX::et_p_spPr;
return OOX::et_a_spPr;
}
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader);
virtual void fromXML(XmlUtils::CXmlNode& node);
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
{
WritingElement_ReadAttributes_Start( oReader )
WritingElement_ReadAttributes_ReadSingle( oReader, _T("bwMode"), bwMode )
WritingElement_ReadAttributes_End( oReader )
}
virtual std::wstring toXML() const;
virtual void toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const

View File

@ -148,7 +148,7 @@ namespace PPTX
{
txBody = new Logic::TxBody();
txBody->fromPPTY(pReader);
txBody->m_ns = _T("a");
txBody->m_name = _T("a:txBody");
break;
}
default:

View File

@ -44,9 +44,9 @@ namespace PPTX
class TextListStyle : public WrapperWritingElement
{
public:
PPTX_LOGIC_BASE(TextListStyle)
WritingElement_AdditionConstructors(TextListStyle)
PPTX_LOGIC_BASE2(TextListStyle)
public:
virtual void fromXML(XmlUtils::CXmlNode& node)
{
m_name = node.GetName();
@ -64,6 +64,44 @@ namespace PPTX
FillParentPointersForChilds();
}
virtual OOX::EElementType getType () const
{
return OOX::et_Unknown;//a_bodyStyle;
}
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
{
m_name = oReader.GetName();
if ( oReader.IsEmptyNode() )
return;
int nCurDepth = oReader.GetDepth();
while( oReader.ReadNextSiblingNode( nCurDepth ) )
{
std::wstring strName = XmlUtils::GetNameNoNS(oReader.GetName());
if (_T("defPPr") == strName)
levels[9] = oReader;
else if (_T("lvl1pPr") == strName)
levels[0] = oReader;
else if (_T("lvl2pPr") == strName)
levels[1] = oReader;
else if (_T("lvl3pPr") == strName)
levels[2] = oReader;
else if (_T("lvl4pPr") == strName)
levels[3] = oReader;
else if (_T("lvl5pPr") == strName)
levels[4] = oReader;
else if (_T("lvl6pPr") == strName)
levels[5] = oReader;
else if (_T("lvl7pPr") == strName)
levels[6] = oReader;
else if (_T("lvl8pPr") == strName)
levels[7] = oReader;
else if (_T("lvl9pPr") == strName)
levels[8] = oReader;
}
}
virtual std::wstring toXML() const
{
XmlUtils::CNodeValue oValue;
@ -139,10 +177,8 @@ namespace PPTX
levels[i]->Merge(lstStyle->levels[i]);
}
public:
nullable<TextParagraphPr> levels[10];
//private:
public:
mutable std::wstring m_name;
nullable<TextParagraphPr> levels[10];
mutable std::wstring m_name;
protected:
virtual void FillParentPointersForChilds()
{

View File

@ -49,15 +49,27 @@ namespace PPTX
public:
TxBody()
{
m_ns = _T("p");
m_name = _T("p:txBody");
}
virtual ~TxBody() {}
explicit TxBody(XmlUtils::CXmlNode& node) { fromXML(node); }
explicit TxBody(XmlUtils::CXmlNode& node)
{
fromXML(node);
}
const TxBody& operator =(XmlUtils::CXmlNode& node)
{
fromXML(node);
return *this;
}
explicit TxBody(XmlUtils::CXmlLiteReader& oReader)
{
fromXML(oReader);
}
const TxBody& operator =(XmlUtils::CXmlLiteReader& oReader)
{
fromXML(oReader);
return *this;
}
TxBody(const TxBody& oSrc) { *this = oSrc; }
TxBody& operator=(const TxBody& oSrc)
@ -65,20 +77,49 @@ namespace PPTX
parentFile = oSrc.parentFile;
parentElement = oSrc.parentElement;
bodyPr = oSrc.bodyPr;
lstStyle = oSrc.lstStyle;
Paragrs = oSrc.Paragrs;
bodyPr = oSrc.bodyPr;
lstStyle = oSrc.lstStyle;
Paragrs = oSrc.Paragrs;
m_ns = oSrc.m_ns;
m_name = oSrc.m_name;
return *this;
}
public:
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
{
m_name = oReader.GetName();
if ( oReader.IsEmptyNode() )
return;
int nCurDepth = oReader.GetDepth();
while( oReader.ReadNextSiblingNode( nCurDepth ) )
{
std::wstring strName = oReader.GetName();
if (_T("a:bodyPr") == strName)
{
bodyPr = oReader;
}
else if (_T("a:lstStyle") == strName)
{
lstStyle = oReader;
}
else if (_T("a:p") == strName)
{
Paragraph p;
Paragrs.push_back(p);
Paragrs.back().fromXML(oReader);
}
}
FillParentPointersForChilds();
}
virtual void fromXML(XmlUtils::CXmlNode& node)
{
Paragrs.clear();
m_name = node.GetName();
bodyPr = node.ReadNode(_T("a:bodyPr"));
lstStyle = node.ReadNode(_T("a:lstStyle"));
@ -89,22 +130,25 @@ namespace PPTX
virtual std::wstring toXML() const
{
XmlUtils::CNodeValue oValue;
oValue.Write(bodyPr);
oValue.WriteNullable(bodyPr);
oValue.WriteNullable(lstStyle);
oValue.WriteArray(Paragrs);
return XmlUtils::CreateNode(_T("p:txBody"), oValue);
return XmlUtils::CreateNode(m_name, oValue);
}
virtual void toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const
{
pWriter->StartNode(m_ns + _T(":txBody"));
pWriter->StartNode(m_name);
pWriter->EndAttributes();
bodyPr.m_namespace = _T("a");
bodyPr.toXmlWriter(pWriter);
if (lstStyle.is_init())
if (bodyPr.IsInit())
{
bodyPr->m_namespace = _T("a");
bodyPr->toXmlWriter(pWriter);
}
if (lstStyle.IsInit())
lstStyle->m_name = _T("a:lstStyle");
pWriter->Write(lstStyle);
@ -112,7 +156,7 @@ namespace PPTX
for (size_t i = 0; i < nCount; ++i)
Paragrs[i].toXmlWriter(pWriter);
pWriter->EndNode(m_ns + _T(":txBody"));
pWriter->EndNode(m_name);
}
void toXmlWriterExcel(NSBinPptxRW::CXmlWriter* pWriter) const
@ -121,9 +165,11 @@ namespace PPTX
pWriter->StartNode(_T("c:rich"));
pWriter->EndAttributes();
*/
bodyPr.m_namespace = _T("a");
bodyPr.toXmlWriter(pWriter);
if (bodyPr.IsInit())
{
bodyPr->m_namespace = _T("a");
bodyPr->toXmlWriter(pWriter);
}
if (lstStyle.is_init())
lstStyle->m_name = _T("a:lstStyle");
@ -150,16 +196,18 @@ namespace PPTX
void Merge(nullable<TxBody>& txBody)const
{
if(!txBody.is_init())
txBody = new TxBody();
bodyPr.Merge(txBody->bodyPr);
if(lstStyle.is_init())
if(!txBody.is_init()) return;
if(bodyPr.IsInit())
bodyPr->Merge(txBody->bodyPr);
if(lstStyle.IsInit())
lstStyle->Merge(txBody->lstStyle);
}
virtual void toPPTY(NSBinPptxRW::CBinaryFileWriter* pWriter) const
{
pWriter->WriteRecord1(0, bodyPr);
pWriter->WriteRecord2(0, bodyPr);
pWriter->WriteRecord2(1, lstStyle);
pWriter->WriteRecordArray(2, 0, Paragrs);
}
@ -174,7 +222,8 @@ namespace PPTX
{
case 0:
{
bodyPr.fromPPTY(pReader);
bodyPr = new Logic::BodyPr();
bodyPr->fromPPTY(pReader);
break;
}
case 1:
@ -206,15 +255,17 @@ namespace PPTX
}
public:
BodyPr bodyPr;
nullable<BodyPr> bodyPr;
nullable<TextListStyle> lstStyle;
std::vector<Paragraph> Paragrs;
std::wstring m_ns;
std::wstring m_name;
protected:
virtual void FillParentPointersForChilds()
{
bodyPr.SetParentPointer(this);
if(bodyPr.is_init())
bodyPr->SetParentPointer(this);
if(lstStyle.is_init())
lstStyle->SetParentPointer(this);
@ -226,9 +277,11 @@ namespace PPTX
public:
bool IsOneLineParagraphs() const
{
if (!bodyPr.wrap.is_init())
return false;
return (bodyPr.wrap->get() == _T("none"));
if (!bodyPr.is_init()) return false;
if (!bodyPr->wrap.is_init()) return false;
return (bodyPr->wrap->get() == _T("none"));
}
std::wstring GetDocxTxBoxContent(NSBinPptxRW::CBinaryFileWriter* pWriter, const nullable<PPTX::Logic::ShapeStyle>& shape_style);

View File

@ -51,6 +51,12 @@ namespace PPTX
WritingElement_AdditionConstructors(UniFill)
PPTX_LOGIC_BASE2(UniFill)
virtual OOX::EElementType getType() const
{
if (Fill.IsInit())
return Fill->getType();
return OOX::et_Unknown;
}
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
{
std::wstring name = oReader.GetName();

View File

@ -49,9 +49,35 @@ namespace PPTX
class UniPath2D : public WrapperWritingElement
{
public:
PPTX_LOGIC_BASE(UniPath2D)
WritingElement_AdditionConstructors(UniPath2D)
PPTX_LOGIC_BASE2(UniPath2D)
public:
virtual OOX::EElementType getType() const
{
if (Path2D.IsInit())
return Path2D->getType();
return OOX::et_Unknown;
}
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
{
std::wstring name = XmlUtils::GetNameNoNS(oReader.GetName());
if (name == _T("moveTo"))
Path2D.reset(new Logic::MoveTo(oReader));
else if (name == _T("lnTo"))
Path2D.reset(new Logic::LineTo(oReader));
else if (name == _T("cubicBezTo"))
Path2D.reset(new Logic::CubicBezTo(oReader));
else if (name == _T("close"))
Path2D.reset(new Logic::Close(oReader));
else if (name == _T("arcTo"))
Path2D.reset(new Logic::ArcTo(oReader));
else if (name == _T("quadBezTo"))
Path2D.reset(new Logic::QuadBezTo(oReader));
else Path2D.reset();
}
virtual void fromXML(XmlUtils::CXmlNode& node)
{
std::wstring name = XmlUtils::GetNameNoNS(node.GetName());

View File

@ -47,7 +47,8 @@ namespace PPTX
m_ns = _T("a");
}
virtual ~Xfrm() {}
explicit Xfrm(XmlUtils::CXmlNode& node) { fromXML(node); }
explicit Xfrm(XmlUtils::CXmlNode& node) { fromXML(node); }
explicit Xfrm(XmlUtils::CXmlLiteReader& oReader){ fromXML(oReader); }
const Xfrm& operator =(XmlUtils::CXmlNode& node)
{
fromXML(node);
@ -57,9 +58,54 @@ namespace PPTX
virtual OOX::EElementType getType () const
{
return OOX::et_p_xfrm;
return OOX::et_a_xfrm;
}
public:
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
{
ReadAttributes(oReader);
if ( oReader.IsEmptyNode() )
return;
int nParentDepth = oReader.GetDepth();
while( oReader.ReadNextSiblingNode( nParentDepth ) )
{
std::wstring sName = oReader.GetName();
if (sName == L"a:off")
ReadAttributes1(oReader, offX, offY);
else if (sName == L"a:ext")
ReadAttributes2(oReader, extX, extY);
else if (sName == L"a:chOff")
ReadAttributes1(oReader, chOffX, chOffY);
else if (sName == L"a:chExt")
ReadAttributes2(oReader, chExtX, chExtY);
}
}
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
{
WritingElement_ReadAttributes_Start( oReader )
WritingElement_ReadAttributes_Read_if ( oReader, _T("flipH"), flipH)
WritingElement_ReadAttributes_Read_else_if ( oReader, _T("flipV"), flipV )
WritingElement_ReadAttributes_Read_else_if ( oReader, _T("rot"), rot )
WritingElement_ReadAttributes_End( oReader )
}
void ReadAttributes1(XmlUtils::CXmlLiteReader& oReader, nullable_int & x, nullable_int & y)
{
WritingElement_ReadAttributes_Start( oReader )
WritingElement_ReadAttributes_Read_if ( oReader, _T("x"), x )
WritingElement_ReadAttributes_Read_else_if ( oReader, _T("y"), y )
WritingElement_ReadAttributes_End( oReader )
}
void ReadAttributes2(XmlUtils::CXmlLiteReader& oReader, nullable_int & cx, nullable_int & cy)
{
WritingElement_ReadAttributes_Start( oReader )
WritingElement_ReadAttributes_Read_if ( oReader, _T("cx"), cx )
WritingElement_ReadAttributes_Read_else_if ( oReader, _T("cy"), cy )
WritingElement_ReadAttributes_End( oReader )
}
virtual void fromXML(XmlUtils::CXmlNode& node)
{
m_ns = XmlUtils::GetNamespace(node.GetName());

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="windows-1251"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="8,00"
Version="8.00"
Name="PPTXFormat"
ProjectGUID="{36636678-AE25-4BE6-9A34-2561D1BCF302}"
RootNamespace="PPTXFormat"

View File

@ -249,6 +249,7 @@ namespace OOX
et_a_latin, // <a:latin>
et_a_lightRig, // <a:lightRig>
et_a_lin, // <a:lin>
et_a_lineTo, // <a:lineTo>
et_a_ln, // <a:ln>
et_a_lnDef, // <a:lnDef>
et_a_lnRef, // <a:lnRef>

View File

@ -176,11 +176,11 @@ namespace OOX
std::wstring lowerFileName = XmlUtils::GetLower(m_strFilename);
CArray<std::wstring> trueArray;
std::vector<std::wstring> trueArray;
NSDirectory::GetFiles2(fileDirectory, trueArray);
for (int i = 0; i < trueArray.GetCount(); i++)
for (size_t i = 0; i < trueArray.size(); i++)
{
std::wstring lowerTest = XmlUtils::GetLower(trueArray[i]);

File diff suppressed because it is too large Load Diff

View File

@ -469,39 +469,27 @@ namespace OOX{
class CT_ChartSpace
{
public:
//Member
CT_Boolean* m_date1904;
//Member
CT_TextLanguageID* m_lang;
//Member
CT_Boolean* m_roundedCorners;
//Member
AlternateContent* m_AlternateContent;
//Member
CT_Style1* m_style;
//Member
std::wstring* m_clrMapOvr;
//Member
CT_PivotSource* m_pivotSource;
//Member
CT_Protection* m_protection;
//Member
CT_Chart* m_chart;
//Member
std::wstring *m_spPr;
nullable<OOX::Drawing::CShapeProperties> m_oSpPr;
std::wstring *m_txPr;
nullable<CTextProperties> m_oTxPr;
//Member
CT_ExternalData* m_externalData;
//Member
CT_PrintSettings* m_printSettings;
//Member
CT_RelId* m_userShapes;
//Member
CT_extLst* m_extLst;
CT_Boolean* m_date1904;
CT_TextLanguageID* m_lang;
CT_Boolean* m_roundedCorners;
AlternateContent* m_AlternateContent;
CT_Style1* m_style;
std::wstring* m_clrMapOvr;
CT_PivotSource* m_pivotSource;
CT_Protection* m_protection;
CT_Chart* m_chart;
nullable<PPTX::Logic::SpPr> m_oSpPr;
nullable<PPTX::Logic::TxBody> m_oTxPr;
CT_ExternalData* m_externalData;
CT_PrintSettings* m_printSettings;
CT_RelId* m_userShapes;
CT_extLst* m_extLst;
CT_ChartSpace();
~CT_ChartSpace();
void fromXML(XmlUtils::CXmlLiteReader& oReader);
void toXML(const std::wstring& sNodeName, NSStringUtils::CStringBuilder& writer) const;
EElementType getType();
@ -656,14 +644,11 @@ namespace OOX{
class CT_LegendEntry
{
public:
//Member
CT_UnsignedInt* m_idx;
//Member
CT_Boolean* m_delete;
//Member
std::wstring *m_txPr;
nullable<CTextProperties> m_oTxPr;
CT_extLst* m_extLst;
CT_UnsignedInt* m_idx;
CT_Boolean* m_delete;
nullable<PPTX::Logic::TxBody> m_oTxPr;
CT_extLst* m_extLst;
CT_LegendEntry();
~CT_LegendEntry();
void fromXML(XmlUtils::CXmlLiteReader& oReader);
@ -712,13 +697,11 @@ namespace OOX{
{
public:
CT_LegendPos *m_legendPos;
std::vector<CT_LegendEntry*> m_legendEntry;
std::vector<CT_LegendEntry*> m_legendEntry;
CT_Layout *m_layout;
CT_Boolean *m_overlay;
std::wstring *m_spPr;
nullable<OOX::Drawing::CShapeProperties> m_oSpPr;
std::wstring *m_txPr;
nullable<CTextProperties> m_oTxPr;
nullable<PPTX::Logic::SpPr> m_oSpPr;
nullable<PPTX::Logic::TxBody> m_oTxPr;
CT_extLst * m_extLst;
/*--------------------------------------------------*/
CT_Legend();
@ -808,19 +791,14 @@ namespace OOX{
class CT_DTable
{
public:
//Member
CT_Boolean* m_showHorzBorder;
//Member
CT_Boolean* m_showVertBorder;
//Member
CT_Boolean* m_showOutline;
//Member
CT_Boolean* m_showKeys;
std::wstring *m_spPr;
nullable<OOX::Drawing::CShapeProperties> m_oSpPr;
std::wstring *m_txPr;
nullable<CTextProperties> m_oTxPr;
CT_extLst* m_extLst;
nullable<PPTX::Logic::SpPr> m_oSpPr;
nullable<PPTX::Logic::TxBody> m_oTxPr;
CT_extLst* m_extLst;
CT_DTable();
~CT_DTable();
void fromXML(XmlUtils::CXmlLiteReader& oReader);
@ -841,10 +819,8 @@ namespace OOX{
CT_TickMark *m_majorTickMark;
CT_TickMark *m_minorTickMark;
CT_TickLblPos *m_tickLblPos;
std::wstring *m_spPr;
nullable<OOX::Drawing::CShapeProperties> m_oSpPr;
std::wstring *m_txPr;
nullable<CTextProperties> m_oTxPr;
nullable<PPTX::Logic::SpPr> m_oSpPr;
nullable<PPTX::Logic::TxBody> m_oTxPr;
CT_UnsignedInt *m_crossAx;
CT_Crosses *m_crosses;
CT_Double *m_crossesAt;
@ -916,8 +892,7 @@ namespace OOX{
class CT_ChartLines
{
public:
std::wstring *m_spPr;
nullable<OOX::Drawing::CShapeProperties> m_oSpPr;
nullable<PPTX::Logic::SpPr> m_oSpPr;
/*--------------------------------------------------------------*/
CT_ChartLines();
~CT_ChartLines();
@ -928,14 +903,12 @@ namespace OOX{
class CT_Title
{
public:
CT_Tx *m_tx;
CT_Layout *m_layout;
CT_Boolean *m_overlay;
std::wstring *m_spPr;
nullable<OOX::Drawing::CShapeProperties> m_oSpPr;
std::wstring *m_txPr;
nullable<CTextProperties> m_oTxPr;
CT_extLst *m_extLst;
CT_Tx *m_tx;
CT_Layout *m_layout;
CT_Boolean *m_overlay;
nullable<PPTX::Logic::SpPr> m_oSpPr;
nullable<PPTX::Logic::TxBody> m_oTxPr;
CT_extLst *m_extLst;
/*--------------------------------------------------------------*/
CT_Title();
~CT_Title();
@ -944,126 +917,13 @@ namespace OOX{
EElementType getType();
};
//--------------------------------------------------------------------------------
// 21.2.2.156 rich (Rich Text)
//--------------------------------------------------------------------------------
class CRichText : public WritingElementWithChilds<Drawing::CParagraph>
{
public:
WritingElementSpreadsheet_AdditionConstructors(CRichText)
CRichText()
{
}
virtual ~CRichText()
{
}
public:
virtual std::wstring toXML() const
{
return _T("");
}
virtual void toXML(NSStringUtils::CStringBuilder& writer) const
{
}
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
{
ReadAttributes( oReader );
if ( oReader.IsEmptyNode() )
return;
int nCurDepth = oReader.GetDepth();
while( oReader.ReadNextSiblingNode( nCurDepth ) )
{
std::wstring sName = XmlUtils::GetNameNoNS(oReader.GetName());
if ( _T("bodyPr") == sName )
m_oBodyPr = oReader;
else if ( _T("p") == sName )
m_arrItems.push_back( new Drawing::CParagraph( oReader ));
}
}
virtual EElementType getType () const
{
return et_ChartRichText;
}
private:
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
{
WritingElement_ReadAttributes_Start ( oReader )
WritingElement_ReadAttributes_End ( oReader )
}
public:
nullable<OOX::Drawing::CTextBodyProperties> m_oBodyPr;
//nullable<OOX::Drawing::CTextListStyle> m_oLstStyle; - not supported.
};
//--------------------------------------------------------------------------------
// 21.2.2.216 txPr (Text Properties)
//--------------------------------------------------------------------------------
class CTextProperties : public WritingElementWithChilds<Drawing::CParagraph>
{
public:
WritingElementSpreadsheet_AdditionConstructors(CTextProperties)
CTextProperties()
{
}
virtual ~CTextProperties()
{
}
public:
virtual std::wstring toXML() const
{
return _T("");
}
virtual void toXML(NSStringUtils::CStringBuilder& writer) const
{
}
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
{
ReadAttributes( oReader );
if ( oReader.IsEmptyNode() )
return;
int nCurDepth = oReader.GetDepth();
while( oReader.ReadNextSiblingNode( nCurDepth ) )
{
std::wstring sName = XmlUtils::GetNameNoNS(oReader.GetName());
if ( _T("bodyPr") == sName )
m_oBodyPr = oReader;
else if ( _T("p") == sName )
m_arrItems.push_back( new Drawing::CParagraph( oReader ));
}
}
virtual EElementType getType () const
{
return et_ChartTextProperties;
}
private:
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
{
WritingElement_ReadAttributes_Start ( oReader )
WritingElement_ReadAttributes_End ( oReader )
}
public:
nullable<OOX::Drawing::CTextBodyProperties> m_oBodyPr;
//nullable<OOX::Drawing::CTextListStyle> m_oLstStyle; - not supported.
};
//--------------------------------------------------------------------------------
// 21.2.2.214 tx (Chart Text)
//--------------------------------------------------------------------------------
class CT_Tx
{
public:
std::wstring *m_rich;
nullable<CRichText> m_oRich;
CT_StrRef *m_strRef;
nullable<PPTX::Logic::TxBody> m_oRich;
CT_StrRef *m_strRef;
/*--------------------------------------------------------------*/
CT_Tx();
~CT_Tx();
@ -1190,55 +1050,31 @@ namespace OOX{
class CT_DateAx
{
public:
//Member
CT_UnsignedInt* m_axId;
//Member
CT_Scaling* m_scaling;
//Member
CT_Boolean* m_delete;
//Member
CT_AxPos* m_axPos;
//Member
CT_ChartLines* m_majorGridlines;
//Member
CT_ChartLines* m_minorGridlines;
//Member
CT_Title* m_title;
//Member
CT_NumFmt* m_numFmt;
//Member
CT_TickMark* m_majorTickMark;
//Member
CT_TickMark* m_minorTickMark;
//Member
CT_TickLblPos* m_tickLblPos;
//Member
std::wstring* m_spPr;
nullable<OOX::Drawing::CShapeProperties> m_oSpPr;
std::wstring *m_txPr;
nullable<CTextProperties> m_oTxPr;
//Member
CT_UnsignedInt* m_crossAx;
//Member
CT_Crosses* m_crosses;
//Member
CT_Double* m_crossesAt;
//Member
CT_Boolean* m_auto;
//Member
CT_LblOffset* m_lblOffset;
//Member
CT_TimeUnit* m_baseTimeUnit;
//Member
CT_AxisUnit* m_majorUnit;
//Member
CT_TimeUnit* m_majorTimeUnit;
//Member
CT_AxisUnit* m_minorUnit;
//Member
CT_TimeUnit* m_minorTimeUnit;
//Member
CT_extLst* m_extLst;
CT_UnsignedInt* m_axId;
CT_Scaling* m_scaling;
CT_Boolean* m_delete;
CT_AxPos* m_axPos;
CT_ChartLines* m_majorGridlines;
CT_ChartLines* m_minorGridlines;
CT_Title* m_title;
CT_NumFmt* m_numFmt;
CT_TickMark* m_majorTickMark;
CT_TickMark* m_minorTickMark;
CT_TickLblPos* m_tickLblPos;
nullable<PPTX::Logic::SpPr> m_oSpPr;
nullable<PPTX::Logic::TxBody> m_oTxPr;
CT_UnsignedInt* m_crossAx;
CT_Crosses* m_crosses;
CT_Double* m_crossesAt;
CT_Boolean* m_auto;
CT_LblOffset* m_lblOffset;
CT_TimeUnit* m_baseTimeUnit;
CT_AxisUnit* m_majorUnit;
CT_TimeUnit* m_majorTimeUnit;
CT_AxisUnit* m_minorUnit;
CT_TimeUnit* m_minorTimeUnit;
CT_extLst* m_extLst;
CT_DateAx();
~CT_DateAx();
void fromXML(XmlUtils::CXmlLiteReader& oReader);
@ -1306,12 +1142,8 @@ namespace OOX{
CT_TickMark* m_minorTickMark;
//Member
CT_TickLblPos* m_tickLblPos;
//Member
std::wstring *m_spPr;
nullable<OOX::Drawing::CShapeProperties> m_oSpPr;
std::wstring *m_txPr;
nullable<CTextProperties> m_oTxPr;
//Member
nullable<PPTX::Logic::SpPr> m_oSpPr;
nullable<PPTX::Logic::TxBody> m_oTxPr;
CT_UnsignedInt* m_crossAx;
//Member
CT_Crosses* m_crosses;
@ -1340,17 +1172,14 @@ namespace OOX{
class CT_DispUnitsLbl
{
public:
//Member
CT_Layout* m_layout;
//Member
CT_Tx* m_tx;
//Member
std::wstring *m_spPr;
nullable<OOX::Drawing::CShapeProperties> m_oSpPr;
std::wstring *m_txPr;
nullable<CTextProperties> m_oTxPr;
CT_Layout* m_layout;
CT_Tx* m_tx;
nullable<PPTX::Logic::SpPr> m_oSpPr;
nullable<PPTX::Logic::TxBody> m_oTxPr;
CT_DispUnitsLbl();
~CT_DispUnitsLbl();
void fromXML(XmlUtils::CXmlLiteReader& oReader);
void toXML(std::wstring& sNodeName, NSStringUtils::CStringBuilder& writer) const;
EElementType getType();
@ -1399,51 +1228,31 @@ namespace OOX{
class CT_ValAx
{
public:
//Member
CT_UnsignedInt* m_axId;
//Member
CT_Scaling* m_scaling;
//Member
CT_Boolean* m_delete;
//Member
CT_AxPos* m_axPos;
//Member
CT_ChartLines* m_majorGridlines;
//Member
CT_ChartLines* m_minorGridlines;
//Member
CT_Title* m_title;
//Member
CT_NumFmt* m_numFmt;
//Member
CT_TickMark* m_majorTickMark;
//Member
CT_TickMark* m_minorTickMark;
//Member
CT_TickLblPos* m_tickLblPos;
//Member
std::wstring *m_spPr;
nullable<OOX::Drawing::CShapeProperties> m_oSpPr;
std::wstring *m_txPr;
nullable<CTextProperties> m_oTxPr;
//Member
CT_UnsignedInt* m_crossAx;
//Member
CT_Crosses* m_crosses;
//Member
CT_Double* m_crossesAt;
//Member
CT_CrossBetween* m_crossBetween;
//Member
CT_AxisUnit* m_majorUnit;
//Member
CT_AxisUnit* m_minorUnit;
//Member
CT_DispUnits* m_dispUnits;
//Member
CT_extLst* m_extLst;
CT_UnsignedInt* m_axId;
CT_Scaling* m_scaling;
CT_Boolean* m_delete;
CT_AxPos* m_axPos;
CT_ChartLines* m_majorGridlines;
CT_ChartLines* m_minorGridlines;
CT_Title* m_title;
CT_NumFmt* m_numFmt;
CT_TickMark* m_majorTickMark;
CT_TickMark* m_minorTickMark;
CT_TickLblPos* m_tickLblPos;
nullable<PPTX::Logic::SpPr> m_oSpPr;
nullable<PPTX::Logic::TxBody> m_oTxPr;
CT_UnsignedInt* m_crossAx;
CT_Crosses* m_crosses;
CT_Double* m_crossesAt;
CT_CrossBetween* m_crossBetween;
CT_AxisUnit* m_majorUnit;
CT_AxisUnit* m_minorUnit;
CT_DispUnits* m_dispUnits;
CT_extLst* m_extLst;
CT_ValAx();
~CT_ValAx();
void fromXML(XmlUtils::CXmlLiteReader& oReader);
void toXML(std::wstring& sNodeName, NSStringUtils::CStringBuilder& writer) const;
EElementType getType();
@ -1475,15 +1284,10 @@ namespace OOX{
class CT_BubbleSer
{
public:
//Member
CT_UnsignedInt* m_idx;
//Member
CT_UnsignedInt* m_order;
//Member
CT_SerTx* m_tx;
//Member
std::wstring* m_spPr;
nullable<OOX::Drawing::CShapeProperties> m_oSpPr;
CT_SerTx* m_tx;
nullable<PPTX::Logic::SpPr> m_oSpPr;
//Member
CT_Boolean* m_invertIfNegative;
//Member
@ -1526,23 +1330,15 @@ namespace OOX{
class CT_DPt
{
public:
//Member
CT_UnsignedInt* m_idx;
//Member
CT_Boolean* m_invertIfNegative;
//Member
CT_Marker* m_marker;
//Member
CT_Boolean* m_bubble3D;
//Member
CT_UnsignedInt* m_explosion;
//Member
std::wstring* m_spPr;
nullable<OOX::Drawing::CShapeProperties> m_oSpPr;
//Member
CT_PictureOptions* m_pictureOptions;
//Member
CT_extLst* m_extLst;
CT_UnsignedInt* m_idx;
CT_Boolean* m_invertIfNegative;
CT_Marker* m_marker;
CT_Boolean* m_bubble3D;
CT_UnsignedInt* m_explosion;
nullable<PPTX::Logic::SpPr> m_oSpPr;
CT_PictureOptions* m_pictureOptions;
CT_extLst* m_extLst;
CT_DPt();
~CT_DPt();
void fromXML(XmlUtils::CXmlLiteReader& oReader);
@ -1552,15 +1348,11 @@ namespace OOX{
class CT_Marker
{
public:
//Member
CT_MarkerStyle* m_symbol;
//Member
CT_MarkerSize* m_size;
//Member
std::wstring* m_spPr;
nullable<OOX::Drawing::CShapeProperties> m_oSpPr;
//Member
CT_extLst* m_extLst;
CT_MarkerStyle* m_symbol;
CT_MarkerSize* m_size;
nullable<PPTX::Logic::SpPr> m_oSpPr;
CT_extLst* m_extLst;
CT_Marker();
~CT_Marker();
void fromXML(XmlUtils::CXmlLiteReader& oReader);
@ -1637,14 +1429,11 @@ namespace OOX{
class CT_DLbls
{
public:
//Member
std::vector<CT_DLbl*> m_dLbl;
//Member
std::vector<ItemsChoiceType3*> m_ItemsElementName0;
//Member
std::vector<void*> m_Items;
//Member
CT_extLst* m_extLst;
std::vector<CT_DLbl*> m_dLbl;
std::vector<ItemsChoiceType3*> m_ItemsElementName0;
std::vector<void*> m_Items;
CT_extLst* m_extLst;
CT_DLbls();
~CT_DLbls();
void fromXML(XmlUtils::CXmlLiteReader& oReader);
@ -1687,13 +1476,9 @@ namespace OOX{
class CT_Trendline
{
public:
//Member
std::wstring* m_name;
//Member
std::wstring* m_spPr;
nullable<OOX::Drawing::CShapeProperties> m_oSpPr;
//Member
CT_TrendlineType* m_trendlineType;
std::wstring* m_name;
nullable<PPTX::Logic::SpPr> m_oSpPr;
CT_TrendlineType* m_trendlineType;
//Member
CT_Order* m_order;
//Member
@ -1757,19 +1542,16 @@ namespace OOX{
class CT_TrendlineLbl
{
public:
//Member
CT_Layout* m_layout;
//Member
CT_Tx* m_tx;
//Member
CT_NumFmt* m_numFmt;
std::wstring *m_spPr;
nullable<OOX::Drawing::CShapeProperties> m_oSpPr;
std::wstring *m_txPr;
nullable<CTextProperties> m_oTxPr;
CT_extLst* m_extLst;
CT_Layout* m_layout;
CT_Tx* m_tx;
CT_NumFmt* m_numFmt;
nullable<PPTX::Logic::SpPr> m_oSpPr;
nullable<PPTX::Logic::TxBody> m_oTxPr;
CT_extLst* m_extLst;
CT_TrendlineLbl();
~CT_TrendlineLbl();
void fromXML(XmlUtils::CXmlLiteReader& oReader);
void toXML(std::wstring& sNodeName, NSStringUtils::CStringBuilder& writer) const;
EElementType getType();
@ -1791,11 +1573,9 @@ namespace OOX{
CT_NumDataSource* m_minus;
//Member
CT_Double* m_val;
//Member
std::wstring* m_spPr;
nullable<OOX::Drawing::CShapeProperties> m_oSpPr;
//Member
CT_extLst* m_extLst;
nullable<PPTX::Logic::SpPr> m_oSpPr;
CT_extLst* m_extLst;
CT_ErrBars();
~CT_ErrBars();
void fromXML(XmlUtils::CXmlLiteReader& oReader);
@ -2019,21 +1799,14 @@ namespace OOX{
class CT_SurfaceSer
{
public:
//Member
CT_UnsignedInt* m_idx;
//Member
CT_UnsignedInt* m_order;
//Member
CT_SerTx* m_tx;
//Member
std::wstring* m_spPr;
nullable<OOX::Drawing::CShapeProperties> m_oSpPr;
//Member
CT_AxDataSource* m_cat;
//Member
CT_NumDataSource* m_val;
//Member
CT_extLst* m_extLst;
CT_UnsignedInt* m_idx;
CT_UnsignedInt* m_order;
CT_SerTx* m_tx;
nullable<PPTX::Logic::SpPr> m_oSpPr;
CT_AxDataSource* m_cat;
CT_NumDataSource* m_val;
CT_extLst* m_extLst;
CT_SurfaceSer();
~CT_SurfaceSer();
void fromXML(XmlUtils::CXmlLiteReader& oReader);
@ -2043,11 +1816,9 @@ namespace OOX{
class CT_BandFmt
{
public:
//Member
CT_UnsignedInt* m_idx;
//Member
std::wstring* m_spPr;
nullable<OOX::Drawing::CShapeProperties> m_oSpPr;
CT_UnsignedInt* m_idx;
nullable<PPTX::Logic::SpPr> m_oSpPr;
CT_BandFmt();
~CT_BandFmt();
void fromXML(XmlUtils::CXmlLiteReader& oReader);
@ -2154,17 +1925,11 @@ namespace OOX{
class CT_PieSer
{
public:
//Member
CT_UnsignedInt* m_idx;
//Member
CT_UnsignedInt* m_order;
//Member
CT_SerTx* m_tx;
//Member
std::wstring* m_spPr;
nullable<OOX::Drawing::CShapeProperties> m_oSpPr;
//Member
CT_UnsignedInt* m_explosion;
CT_UnsignedInt* m_idx;
CT_UnsignedInt* m_order;
CT_SerTx* m_tx;
nullable<PPTX::Logic::SpPr> m_oSpPr;
CT_UnsignedInt* m_explosion;
//Member
std::vector<CT_DPt*> m_dPt;
//Member
@ -2254,10 +2019,8 @@ namespace OOX{
//Member
CT_UnsignedInt* m_order;
//Member
CT_SerTx* m_tx;
//Member
std::wstring* m_spPr;
nullable<OOX::Drawing::CShapeProperties> m_oSpPr;
CT_SerTx* m_tx;
nullable<PPTX::Logic::SpPr> m_oSpPr;
//Member
CT_Boolean* m_invertIfNegative;
//Member
@ -2427,9 +2190,7 @@ namespace OOX{
CT_UnsignedInt* m_order;
//Member
CT_SerTx* m_tx;
//Member
std::wstring* m_spPr;
nullable<OOX::Drawing::CShapeProperties> m_oSpPr;
nullable<PPTX::Logic::SpPr> m_oSpPr;
//Member
CT_Marker* m_marker;
//Member
@ -2495,10 +2256,8 @@ namespace OOX{
//Member
CT_UnsignedInt* m_order;
//Member
CT_SerTx* m_tx;
//Member
std::wstring* m_spPr;
nullable<OOX::Drawing::CShapeProperties> m_oSpPr;
CT_SerTx* m_tx;
nullable<PPTX::Logic::SpPr> m_oSpPr;
//Member
CT_Marker* m_marker;
//Member
@ -2581,10 +2340,8 @@ namespace OOX{
//Member
CT_UnsignedInt* m_order;
//Member
CT_SerTx* m_tx;
//Member
std::wstring* m_spPr;
nullable<OOX::Drawing::CShapeProperties> m_oSpPr;
CT_SerTx* m_tx;
nullable<PPTX::Logic::SpPr> m_oSpPr;
//Member
CT_Marker* m_marker;
//Member
@ -2612,14 +2369,11 @@ namespace OOX{
class CT_UpDownBars
{
public:
//Member
CT_GapAmount* m_gapWidth;
//Member
CT_UpDownBar* m_upBars;
//Member
CT_UpDownBar* m_downBars;
//Member
CT_extLst* m_extLst;
CT_GapAmount* m_gapWidth;
CT_UpDownBar* m_upBars;
CT_UpDownBar* m_downBars;
CT_extLst* m_extLst;
CT_UpDownBars();
~CT_UpDownBars();
void fromXML(XmlUtils::CXmlLiteReader& oReader);
@ -2629,9 +2383,8 @@ namespace OOX{
class CT_UpDownBar
{
public:
//Member
std::wstring* m_spPr;
nullable<OOX::Drawing::CShapeProperties> m_oSpPr;
nullable<PPTX::Logic::SpPr> m_oSpPr;
CT_UpDownBar();
~CT_UpDownBar();
void fromXML(XmlUtils::CXmlLiteReader& oReader);
@ -2740,9 +2493,7 @@ namespace OOX{
CT_UnsignedInt* m_order;
//Member
CT_SerTx* m_tx;
//Member
std::wstring* m_spPr;
nullable<OOX::Drawing::CShapeProperties> m_oSpPr;
nullable<PPTX::Logic::SpPr> m_oSpPr;
//Member
CT_PictureOptions* m_pictureOptions;
//Member
@ -2803,9 +2554,7 @@ namespace OOX{
std::vector<void*> m_Items1;
//Member
CT_DTable* m_dTable;
//Member
std::wstring* m_spPr;
nullable<OOX::Drawing::CShapeProperties> m_oSpPr;
nullable<PPTX::Logic::SpPr> m_oSpPr;
//Member
CT_extLst* m_extLst;
CT_PlotArea();
@ -2833,15 +2582,11 @@ namespace OOX{
class CT_Surface
{
public:
//Member
CT_Thickness* m_thickness;
//Member
std::wstring* m_spPr;
nullable<OOX::Drawing::CShapeProperties> m_oSpPr;
//Member
CT_PictureOptions* m_pictureOptions;
//Member
CT_extLst* m_extLst;
CT_Thickness* m_thickness;
nullable<PPTX::Logic::SpPr> m_oSpPr;
CT_PictureOptions* m_pictureOptions;
CT_extLst* m_extLst;
CT_Surface();
~CT_Surface();
void fromXML(XmlUtils::CXmlLiteReader& oReader);
@ -2934,20 +2679,16 @@ namespace OOX{
class CT_PivotFmt
{
public:
//Member
CT_UnsignedInt* m_idx;
std::wstring *m_spPr;
nullable<OOX::Drawing::CShapeProperties> m_oSpPr;
std::wstring *m_txPr;
nullable<CTextProperties> m_oTxPr;
//Member
CT_Marker* m_marker;
//Member
CT_DLbl* m_dLbl;
//Member
CT_extLst* m_extLst;
CT_UnsignedInt* m_idx;
nullable<PPTX::Logic::SpPr> m_oSpPr;
nullable<PPTX::Logic::TxBody> m_oTxPr;
CT_Marker* m_marker;
CT_DLbl* m_dLbl;
CT_extLst* m_extLst;
CT_PivotFmt();
~CT_PivotFmt();
void fromXML(XmlUtils::CXmlLiteReader& oReader);
void toXML(std::wstring& sNodeName, NSStringUtils::CStringBuilder& writer) const;
EElementType getType();

View File

@ -41,6 +41,9 @@
#include "../DocxFormat/Drawing/DrawingTextProperties.h"
#include "../DocxFormat/Drawing/DrawingParagraph.h"
#include "../../../../ASCOfficePPTXFile/PPTXFormat/Logic/SpPr.h"
#include "../../../../ASCOfficePPTXFile/PPTXFormat/Logic/TxBody.h"
#include "ComplexTypes_Spreadsheet.h"
#include "FileTypes_Spreadsheet.h"
#include "WritingElement.h"

View File

@ -34,7 +34,7 @@
#include <stdio.h>
#include <string>
#include "Array.h"
#include <vector>
#include "File.h"
#if defined(_WIN32) || defined (_WIN64)
@ -109,9 +109,9 @@ namespace NSDirectory
#endif
#ifdef _IOS
void GetFiles2_ios(std::wstring strDirectory, CArray<std::wstring>& oArray, bool bIsRecursion);
void GetFiles2_ios(std::wstring strDirectory, std::vector<std::wstring>& oArray, bool bIsRecursion);
#endif
static void GetFiles2(std::wstring strDirectory, CArray<std::wstring>& oArray, bool bIsRecursion = false)
static void GetFiles2(std::wstring strDirectory, std::vector<std::wstring>& oArray, bool bIsRecursion = false)
{
#if defined(_WIN32) || defined (_WIN64)
WIN32_FIND_DATAW oFD;
@ -128,7 +128,7 @@ namespace NSDirectory
sSpec = strDirectory + L"\\" + sSpec;
if( !( oFD.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY ) )
{
oArray.Add(sSpec);
oArray.push_back(sSpec);
}
else if (bIsRecursion)
{
@ -169,7 +169,7 @@ namespace NSDirectory
if (2 == nType)
{
std::wstring sName = NSFile::CUtf8Converter::GetUnicodeStringFromUTF8((BYTE*)dirp->d_name, strlen(dirp->d_name));
oArray.Add(strDirectory + L"/" + sName);
oArray.push_back(strDirectory + L"/" + sName);
}
if (bIsRecursion && (1 == nType))
@ -199,7 +199,7 @@ namespace NSDirectory
if(DT_REG == dirp->d_type)
{
std::wstring sName = NSFile::CUtf8Converter::GetUnicodeStringFromUTF8((BYTE*)dirp->d_name, strlen(dirp->d_name));
oArray.Add(strDirectory + L"/" + sName);
oArray.push_back(strDirectory + L"/" + sName);
}
if (bIsRecursion && DT_DIR == dirp->d_type)
@ -218,9 +218,9 @@ namespace NSDirectory
#endif
}
static CArray<std::wstring> GetFiles(std::wstring strDirectory, bool bIsRecursion = false)
static std::vector<std::wstring> GetFiles(std::wstring strDirectory, bool bIsRecursion = false)
{
CArray<std::wstring> oArray;
std::vector<std::wstring> oArray;
if (!strDirectory.empty())
{
@ -228,10 +228,9 @@ namespace NSDirectory
}
return oArray;
}
static CArray<std::wstring> GetDirectories(std::wstring strDirectory)
static std::vector<std::wstring> GetDirectories(std::wstring strDirectory)
{
CArray<std::wstring> oArray;
std::vector<std::wstring> oArray;
#if defined(_WIN32) || defined (_WIN64)
WIN32_FIND_DATAW oFD;
@ -248,7 +247,7 @@ namespace NSDirectory
sSpec = strDirectory + L"\\" + sSpec;
if( oFD.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY )
{
oArray.Add(sSpec);
oArray.push_back(sSpec);
}
}
} while( FindNextFileW( hRes, &oFD ) );
@ -280,7 +279,7 @@ namespace NSDirectory
if(dirp->d_name[0] != '.')
{
std::wstring sName = NSFile::CUtf8Converter::GetUnicodeStringFromUTF8((BYTE*)dirp->d_name, strlen(dirp->d_name));
oArray.Add(strDirectory + L"/" + sName);
oArray.push_back(strDirectory + L"/" + sName);
}
}
}
@ -302,7 +301,7 @@ namespace NSDirectory
if(dirp->d_name[0] != '.')
{
std::wstring sName = NSFile::CUtf8Converter::GetUnicodeStringFromUTF8((BYTE*)dirp->d_name, strlen(dirp->d_name));
oArray.Add(strDirectory + L"/" + sName);
oArray.push_back(strDirectory + L"/" + sName);
}
}
}
@ -381,13 +380,13 @@ namespace NSDirectory
}
static void DeleteDirectory(const std::wstring& strDirectory, bool deleteRoot = true)
{
CArray<std::wstring> aFiles = GetFiles(strDirectory);
for(int i = 0; i < aFiles.GetCount(); ++i)
std::vector<std::wstring> aFiles = GetFiles(strDirectory);
for(size_t i = 0; i < aFiles.size(); ++i)
{
NSFile::CFileBinary::Remove(aFiles[i]);
}
CArray<std::wstring> aDirectories = GetDirectories(strDirectory);
for(int i = 0; i < aDirectories.GetCount(); ++i)
std::vector<std::wstring> aDirectories = GetDirectories(strDirectory);
for(size_t i = 0; i < aDirectories.size(); ++i)
{
DeleteDirectory(aDirectories[i]);
}
@ -473,11 +472,11 @@ namespace NSDirectory
static int GetFilesCount(const std::wstring& path, const bool& recursive)
{
CArray<std::wstring> arrFiles = NSDirectory::GetFiles(path, recursive);
std::vector<std::wstring> arrFiles = NSDirectory::GetFiles(path, recursive);
#if defined(_WIN32) || defined (_WIN64)
return arrFiles.GetCount();
return (int)arrFiles.size();
#endif
return arrFiles.GetCount() + 1;
return (int)arrFiles.size() + 1;
// ???
}
#if !defined(_WIN32) && !defined (_WIN64)

View File

@ -36,7 +36,6 @@
#include <string>
#include <fstream>
#include <time.h>
#include "Array.h"
#include "errno.h"
#include "Base64.h"
#include <time.h>
@ -50,6 +49,7 @@
#if defined(__linux__) || defined(_MAC) && !defined(_IOS)
#include <unistd.h>
#include <string.h>
#endif
#ifdef _IOS

View File

@ -42,7 +42,7 @@ namespace NSDoctRenderer
RELEASEOBJECT(m_pInternal);
}
bool CDocBuilder::OpenFile(const wchar_t* path, const wchar_t* params)
int CDocBuilder::OpenFile(const wchar_t* path, const wchar_t* params)
{
m_pInternal->m_nFileType = -1;
if (!NSDirectory::Exists(m_pInternal->m_sTmpFolder))
@ -50,7 +50,7 @@ namespace NSDoctRenderer
return m_pInternal->OpenFile(path, params);
}
bool CDocBuilder::SaveFile(const int& type, const wchar_t* path, const wchar_t* params)
int CDocBuilder::SaveFile(const int& type, const wchar_t* path, const wchar_t* params)
{
return m_pInternal->SaveFile(type, path, params);
}

View File

@ -44,10 +44,10 @@ namespace NSDoctRenderer
~CDocBuilder();
public:
bool OpenFile(const wchar_t* path, const wchar_t* params);
int OpenFile(const wchar_t* path, const wchar_t* params);
bool CreateFile(const int& type);
void SetTmpFolder(const wchar_t* folder);
bool SaveFile(const int& type, const wchar_t* path, const wchar_t* params = 0);
int SaveFile(const int& type, const wchar_t* path, const wchar_t* params = 0);
void CloseFile();
bool ExecuteCommand(const wchar_t* command);

View File

@ -611,7 +611,7 @@ namespace NSDoctRenderer
void CheckFonts(bool bIsCheckSystemFonts)
{
CArray<std::string> strFonts;
std::vector<std::string> strFonts;
std::wstring strDirectory = NSCommon::GetDirectoryName(m_strAllFonts);
std::wstring strAllFontsJSPath = strDirectory + L"/AllFonts.js";
@ -638,7 +638,7 @@ namespace NSDoctRenderer
if (nEnd > nStart)
{
std::string s(pBuffer + nStart, nEnd - nStart + 1);
strFonts.Add(s);
strFonts.push_back(s);
}
nStart = nCur + 1;
}
@ -653,14 +653,14 @@ namespace NSDoctRenderer
if (!bIsEqual || bIsCheckSystemFonts)
{
CApplicationFonts oApplicationF;
CArray<std::wstring> strFontsW_Cur = oApplicationF.GetSetupFontFiles();
std::vector<std::wstring> strFontsW_Cur = oApplicationF.GetSetupFontFiles();
if (strFonts.GetCount() != strFontsW_Cur.GetCount())
if (strFonts.size() != strFontsW_Cur.size())
bIsEqual = false;
if (bIsEqual)
{
int nCount = strFonts.GetCount();
int nCount = (int)strFonts.size();
for (int i = 0; i < nCount; ++i)
{
if (strFonts[i] != NSFile::CUtf8Converter::GetUtf8StringFromUnicode2(strFontsW_Cur[i].c_str(), strFontsW_Cur[i].length()))
@ -678,12 +678,12 @@ namespace NSDoctRenderer
if (NSFile::CFileBinary::Exists(strFontsSelectionBin))
NSFile::CFileBinary::Remove(strFontsSelectionBin);
if (strFonts.GetCount() != 0)
if (strFonts.size() != 0)
NSFile::CFileBinary::Remove(strDirectory + L"/fonts.log");
NSFile::CFileBinary oFile;
oFile.CreateFileW(strDirectory + L"/fonts.log");
int nCount = strFontsW_Cur.GetCount();
int nCount = (int)strFontsW_Cur.size();
for (int i = 0; i < nCount; ++i)
{
oFile.WriteStringUTF8(strFontsW_Cur[i]);
@ -761,7 +761,7 @@ namespace NSDoctRenderer
#endif
}
bool OpenFile(const std::wstring& path, const std::wstring& params)
int OpenFile(const std::wstring& path, const std::wstring& params)
{
Init();
@ -914,14 +914,15 @@ namespace NSDoctRenderer
LOGGER_SPEED_LAP("open_convert")
if (0 == nReturnCode)
return true;
return 0;
NSDirectory::DeleteDirectory(m_sFileDir);
m_sFileDir = L"";
m_nFileType = -1;
CV8RealTimeWorker::_LOGGING_ERROR_(L"error: ", L"open file error");
return false;
std::wstring sErrorLog = L"open file error (" + std::to_wstring(nReturnCode) + L")";
CV8RealTimeWorker::_LOGGING_ERROR_(L"error: ", sErrorLog);
return nReturnCode;
}
void CloseFile()
@ -937,7 +938,7 @@ namespace NSDoctRenderer
RELEASEOBJECT(m_pWorker);
}
bool SaveFile(const int& type, const std::wstring& path, const wchar_t* params = NULL)
int SaveFile(const int& type, const std::wstring& path, const wchar_t* params = NULL)
{
Init();
@ -1114,10 +1115,11 @@ namespace NSDoctRenderer
LOGGER_SPEED_LAP("save_convert")
if (0 == nReturnCode)
return true;
return 0;
CV8RealTimeWorker::_LOGGING_ERROR_(L"error: ", L"save file error");
return false;
std::wstring sErrorLog = L"save file error (" + std::to_wstring(nReturnCode) + L")";
CV8RealTimeWorker::_LOGGING_ERROR_(L"error: ", sErrorLog);
return nReturnCode;
}
bool ExecuteCommand(const std::wstring& command)
@ -1414,7 +1416,7 @@ namespace NSDoctRenderer
ParceParameters(command, _builder_params, nCountParameters);
if ("OpenFile" == sFuncNum)
bIsNoError = this->OpenFile(_builder_params[0].c_str(), _builder_params[1].c_str());
bIsNoError = (0 == this->OpenFile(_builder_params[0].c_str(), _builder_params[1].c_str()));
else if ("CreateFile" == sFuncNum)
{
if (L"docx" == _builder_params[0])

View File

@ -1327,9 +1327,9 @@ void CFontList::SetDefaultFont(std::wstring& sName)
}
}
void CFontList::LoadFromArrayFiles(CArray<std::wstring>& oArray, int nFlag)
void CFontList::LoadFromArrayFiles(std::vector<std::wstring>& oArray, int nFlag)
{
int nCount = oArray.GetCount();
size_t nCount = oArray.size();
FT_Library pLibrary = NULL;
if (FT_Init_FreeType(&pLibrary))
@ -1347,7 +1347,7 @@ void CFontList::LoadFromArrayFiles(CArray<std::wstring>& oArray, int nFlag)
// определяем размер буфера, чтобы не выделять много кусков, а обойтись одним
int nMaxFontSize = 0;
for (int nIndex = 0; nIndex < nCount; ++nIndex)
for (size_t nIndex = 0; nIndex < nCount; ++nIndex)
{
NSFile::CFileBinary oFile;
if (oFile.OpenFile(oArray[nIndex]))
@ -1356,7 +1356,7 @@ void CFontList::LoadFromArrayFiles(CArray<std::wstring>& oArray, int nFlag)
if (nSizeTmp > 100000000)
{
// такие огромные шрифты не учитываем
oArray.RemoveAt(nIndex);
oArray.erase(oArray.begin() + nIndex, oArray.begin() + nIndex + 1);
nIndex--;
nCount--;
}
@ -1596,7 +1596,7 @@ void CFontList::LoadFromArrayFiles(CArray<std::wstring>& oArray, int nFlag)
}
void CFontList::LoadFromFolder(const std::wstring& strDirectory)
{
CArray<std::wstring> oArray = NSDirectory::GetFiles(strDirectory, true);
std::vector<std::wstring> oArray = NSDirectory::GetFiles(strDirectory, true);
this->LoadFromArrayFiles(oArray);
}
@ -1765,7 +1765,7 @@ static long GetNextNameValue(HKEY key, const std::wstring& sSubkey, std::wstring
#endif
CArray<std::wstring> CApplicationFonts::GetSetupFontFiles()
std::vector<std::wstring> CApplicationFonts::GetSetupFontFiles()
{
#if defined(_WIN32) || defined (_WIN64)
// Ищем директорию с фонтами (обычно это C:\Windows\Fonts)
@ -1791,8 +1791,9 @@ CArray<std::wstring> CApplicationFonts::GetSetupFontFiles()
std::wstring sName;
std::wstring sData;
std::map<std::wstring, bool> map_files;
CArray<std::wstring> oArray;
std::map<std::wstring, bool> map_files;
std::vector<std::wstring> oArray;
while (GetNextNameValue( HKEY_LOCAL_MACHINE, wsPath, sName, sData ) == ERROR_SUCCESS)
{
if (wsPath.length())
@ -1805,7 +1806,7 @@ CArray<std::wstring> CApplicationFonts::GetSetupFontFiles()
if (map_files.find(sData) == map_files.end())
{
oArray.Add(sData);
oArray.push_back(sData);
map_files.insert(map_files.begin(), std::pair<std::wstring,bool>(sData,true));
}
continue;
@ -1820,7 +1821,7 @@ CArray<std::wstring> CApplicationFonts::GetSetupFontFiles()
if (map_files.find(sFileInDir) == map_files.end())
{
oArray.Add(sFileInDir);
oArray.push_back(sFileInDir);
map_files.insert(map_files.begin(), std::pair<std::wstring,bool>(sFileInDir,true));
}
continue;
@ -1830,16 +1831,16 @@ CArray<std::wstring> CApplicationFonts::GetSetupFontFiles()
#endif
#if defined(__linux__) && !defined(_MAC)
CArray<std::wstring> _array = NSDirectory::GetFiles(L"/usr/share/fonts", true);
std::vector<std::wstring> _array = NSDirectory::GetFiles(L"/usr/share/fonts", true);
NSDirectory::GetFiles2(L"/usr/share/X11/fonts", _array, true);
NSDirectory::GetFiles2(L"/usr/X11R6/lib/X11/fonts", _array, true);
return _array;
#endif
#if defined(_MAC) && !defined(_IOS)
CArray<std::wstring> _array = NSDirectory::GetFiles(L"/Library/Fonts", true);
NSDirectory::GetFiles2(L"/System/Library/Fonts", _array, true);
return _array;
std::vector<std::wstring> _array = NSDirectory::GetFiles(L"/Library/Fonts", true);
NSDirectory::GetFiles2(L"/System/Library/Fonts", _array, true);
return _array;
#endif
#ifdef _IOS
@ -1847,11 +1848,11 @@ CArray<std::wstring> CApplicationFonts::GetSetupFontFiles()
return GetSetupFontFiles_ios();
#endif
CArray<std::wstring> ret;
std::vector<std::wstring> ret;
return ret;
}
void CApplicationFonts::InitializeFromArrayFiles(CArray<std::wstring>& files, int nFlag)
void CApplicationFonts::InitializeFromArrayFiles(std::vector<std::wstring>& files, int nFlag)
{
m_oList.LoadFromArrayFiles(files, nFlag);
}
@ -1860,7 +1861,7 @@ void CApplicationFonts::InitializeFromArrayFiles(CArray<std::wstring>& files, in
void CApplicationFonts::InitFromReg()
{
CArray<std::wstring> oArray = GetSetupFontFiles();
std::vector<std::wstring> oArray = GetSetupFontFiles();
m_oList.LoadFromArrayFiles(oArray);
}

View File

@ -240,13 +240,13 @@ public:
void ToBuffer(BYTE** pDstData, LONG* pLen, std::wstring strDirectory = L"", bool bIsOnlyFileName = false);
public:
void LoadFromArrayFiles(CArray<std::wstring>& arrFiles, int nFlag = 0);
void LoadFromFolder(const std::wstring& strDirectory);
bool CheckLoadFromFolderBin(const std::wstring& strDirectory);
void Add(CFontInfo* pInfo);
CFontInfo* GetByParams(CFontSelectFormat& oSelect, bool bIsDictionaryUse = true);
CArray<CFontInfo*> GetAllByName(const std::wstring& strFontName);
void SetDefaultFont(std::wstring& sName);
void LoadFromArrayFiles (std::vector<std::wstring>& arrFiles, int nFlag = 0);
void LoadFromFolder (const std::wstring& strDirectory);
bool CheckLoadFromFolderBin (const std::wstring& strDirectory);
void Add (CFontInfo* pInfo);
CFontInfo* GetByParams (CFontSelectFormat& oSelect, bool bIsDictionaryUse = true);
CArray<CFontInfo*> GetAllByName (const std::wstring& strFontName);
void SetDefaultFont (std::wstring& sName);
};
class CApplicationFonts
@ -268,8 +268,8 @@ public:
void InitializeFromFolder(std::wstring strFolder, bool bIsCheckSelection = true);
void Initialize(bool bIsCheckSelection = true);
CArray<std::wstring> GetSetupFontFiles();
void InitializeFromArrayFiles(CArray<std::wstring>& files, int nFlag = 0);
std::vector<std::wstring> GetSetupFontFiles();
void InitializeFromArrayFiles(std::vector<std::wstring>& files, int nFlag = 0);
#if defined(_WIN32) || defined (_WIN64)
void InitFromReg();

View File

@ -41,23 +41,23 @@ COfficeUtils::COfficeUtils(OnProgressCallback* fCallback)
HRESULT COfficeUtils::ExtractToDirectory(const std::wstring& zipFile, const std::wstring& unzipDir, wchar_t* password, SHORT extract_without_path)
{
if( ZLibZipUtils::UnzipToDir( zipFile.c_str(), unzipDir.c_str(), m_fCallback, password, ( extract_without_path > 0 ) ? (true) : (false) ) == 0 )
{
return S_OK;
}
else
{
return S_FALSE;
}
if( ZLibZipUtils::UnzipToDir( zipFile.c_str(), unzipDir.c_str(), m_fCallback, password, ( extract_without_path > 0 ) ? (true) : (false) ) == 0 )
{
return S_OK;
}
else
{
return S_FALSE;
}
}
HRESULT COfficeUtils::CompressFileOrDirectory(const std::wstring& name, const std::wstring& outputFile, SHORT level)
HRESULT COfficeUtils::CompressFileOrDirectory(const std::wstring& name, const std::wstring& outputFile, bool bSorted, short level)
{
HRESULT result = S_FALSE;
if(NSDirectory::Exists(name))
{
if ( ZLibZipUtils::ZipDir( name.c_str(), outputFile.c_str(), m_fCallback, level ) == 0 )
if ( ZLibZipUtils::ZipDir( name.c_str(), outputFile.c_str(), m_fCallback, bSorted, level ) == 0 )
{
result = S_OK;
}
@ -92,7 +92,7 @@ HRESULT COfficeUtils::Uncompress(BYTE* destBuf, ULONG* destSize, BYTE* sourceBuf
}
}
HRESULT COfficeUtils::Compress(BYTE* destBuf, ULONG* destSize, BYTE* sourceBuf, ULONG sourceSize, SHORT level)
HRESULT COfficeUtils::Compress(BYTE* destBuf, ULONG* destSize, BYTE* sourceBuf, ULONG sourceSize, short level)
{
if ( ZLibZipUtils::CompressBytes( destBuf, destSize, sourceBuf, sourceSize, level ) == Z_OK )
{

View File

@ -39,20 +39,19 @@ class COfficeUtils
private:
OnProgressCallback* m_fCallback;
public:
COfficeUtils(OnProgressCallback* fCallback);
COfficeUtils(OnProgressCallback* bCallback = NULL);
public:
HRESULT ExtractToDirectory (const std::wstring& zipFile, const std::wstring& unzipDir, wchar_t* password, short extract_without_path);
HRESULT CompressFileOrDirectory (const std::wstring& name, const std::wstring& outputFile, bool bSorted = false, short level = -1);
HRESULT Uncompress (BYTE* destBuf, ULONG* destSize, BYTE* sourceBuf, ULONG sourceSize);
HRESULT Compress (BYTE* destBuf, ULONG* destSize, BYTE* sourceBuf, ULONG sourceSize, short level = -1);
HRESULT ExtractToDirectory(const std::wstring& zipFile, const std::wstring& unzipDir, wchar_t* password, SHORT extract_without_path);
HRESULT CompressFileOrDirectory(const std::wstring& name, const std::wstring& outputFile, SHORT level);
HRESULT Uncompress(BYTE* destBuf, ULONG* destSize, BYTE* sourceBuf, ULONG sourceSize);
HRESULT Compress(BYTE* destBuf, ULONG* destSize, BYTE* sourceBuf, ULONG sourceSize, SHORT level);
HRESULT IsArchive(const std::wstring& filename);
HRESULT IsFileExistInArchive(const std::wstring& zipFile, const std::wstring& filePath);
HRESULT LoadFileFromArchive(const std::wstring& zipFile, const std::wstring& filePath, BYTE** fileInBytes, ULONG& nFileSize);
HRESULT ExtractFilesToMemory(const std::wstring& zipFile, const ExtractedFileCallback& data_receiver, void* pParam, bool* result);
HRESULT CompressFilesFromMemory(const std::wstring& zipFile, const RequestFileCallback& data_source, void* pParam, SHORT compression_level, bool* result);
HRESULT IsArchive (const std::wstring& filename);
HRESULT IsFileExistInArchive (const std::wstring& zipFile, const std::wstring& filePath);
HRESULT LoadFileFromArchive (const std::wstring& zipFile, const std::wstring& filePath, BYTE** fileInBytes, ULONG& nFileSize);
HRESULT ExtractFilesToMemory (const std::wstring& zipFile, const ExtractedFileCallback& data_receiver, void* pParam, bool* result);
HRESULT CompressFilesFromMemory (const std::wstring& zipFile, const RequestFileCallback& data_source, void* pParam, short compression_level, bool* result);
};

View File

@ -477,122 +477,144 @@ namespace ZLibZipUtils
return false;
}
/*========================================================================================================*/
int ZipDir( const WCHAR* dir, const WCHAR* outputFile, const OnProgressCallback* progress, int compressionLevel )
{
/*========================================================================================================*/
int oneZipFile(zipFile & zf, zip_fileinfo & zi, std::wstring & file_name, std::wstring & zip_file_name, int method, int compressionLevel)
{
int err = -1;
if ( ( dir != NULL ) && ( outputFile != NULL ) )
{
deque<wstring> StringDeque;
deque<wstring> zipDeque;
StringDeque.push_back( wstring( dir ) );
wstring zipDir;
wstring file;
wstring zipFileName;
wstring szText;
NSFile::CFileBinary oFile;
if(oFile.OpenFile(file_name))
{
DWORD dwSizeRead;
BYTE* pData = new BYTE[oFile.GetFileSize()];
if(oFile.ReadFile(pData, oFile.GetFileSize(), dwSizeRead))
{
std::string zipFileNameA = codepage_issue_fixToOEM(zip_file_name);
err = zipOpenNewFileInZip( zf, zipFileNameA.c_str(), &zi, NULL, 0, NULL, 0, NULL, method, compressionLevel );
err = zipWriteInFileInZip( zf, pData, dwSizeRead );
err = zipCloseFileInZip( zf );
}
RELEASEARRAYOBJECTS(pData);
}
return 0;
}
int ZipDir( const WCHAR* dir, const WCHAR* outputFile, const OnProgressCallback* progress, bool sorted, int compressionLevel )
{
if ( ( dir != NULL ) && ( outputFile != NULL ) )
{
deque<wstring> StringDeque;
deque<wstring> zipDeque;
StringDeque.push_back( wstring( dir ) );
zipFile zf = zipOpenHelp(outputFile);
wstring zipDir;
wstring file;
wstring zipFileName;
wstring szText;
zip_fileinfo zi;
zipFile zf = zipOpenHelp(outputFile);
zi.tmz_date.tm_sec = zi.tmz_date.tm_min = zi.tmz_date.tm_hour =
zi.tmz_date.tm_mday = zi.tmz_date.tm_mon = zi.tmz_date.tm_year = 0;
zi.dosDate = 0;
zi.internal_fa = 0;
zi.external_fa = 0;
zip_fileinfo zi;
zi.tmz_date.tm_sec = zi.tmz_date.tm_min = zi.tmz_date.tm_hour =
zi.tmz_date.tm_mday = zi.tmz_date.tm_mon = zi.tmz_date.tm_year = 0;
zi.dosDate = 0;
zi.internal_fa = 0;
zi.external_fa = 0;
#if defined(_WIN32) || defined (_WIN64)
SYSTEMTIME currTime;
SYSTEMTIME currTime;
GetLocalTime( &currTime );
GetLocalTime( &currTime );
zi.tmz_date.tm_sec = currTime.wSecond;
zi.tmz_date.tm_min = currTime.wMinute;
zi.tmz_date.tm_hour = currTime.wHour;
zi.tmz_date.tm_mday = currTime.wDay;
zi.tmz_date.tm_mon = currTime.wMonth;
zi.tmz_date.tm_year = currTime.wYear;
zi.tmz_date.tm_sec = currTime.wSecond;
zi.tmz_date.tm_min = currTime.wMinute;
zi.tmz_date.tm_hour = currTime.wHour;
zi.tmz_date.tm_mday = currTime.wDay;
zi.tmz_date.tm_mon = currTime.wMonth;
zi.tmz_date.tm_year = currTime.wYear;
#endif
unsigned int filesCount = get_files_count( dir );
unsigned int currentFileIndex = 0;
while ( !StringDeque.empty() )
{
szText = StringDeque.front();
StringDeque.pop_front();
if(zipDeque.size() > 0)
{
zipDir = zipDeque.front() + wstring( L"/" );
zipDeque.pop_front();
}
CArray<std::wstring> aCurFiles = NSDirectory::GetFiles(szText);
CArray<std::wstring> aCurDirectories = NSDirectory::GetDirectories(szText);
for(int i = 0; i < aCurDirectories.GetCount(); ++i)
{
std::wstring sCurDirectory = aCurDirectories[i];
std::wstring sDirName = NSSystemPath::GetFileName(sCurDirectory);
StringDeque.push_back( sCurDirectory );
zipDeque.push_back( zipDir + sDirName );
}
for(int i = 0; i < aCurFiles.GetCount(); ++i)
{
std::wstring cFilePath = aCurFiles[i];
std::wstring cFileName = NSSystemPath::GetFileName(cFilePath);
file = NSSystemPath::Combine(szText, cFileName);
zipFileName = zipDir + cFileName;
NSFile::CFileBinary oFile;
if(oFile.OpenFile(file))
{
DWORD dwSizeRead;
BYTE* pData = new BYTE[oFile.GetFileSize()];
if(oFile.ReadFile(pData, oFile.GetFileSize(), dwSizeRead))
{
std::string zipFileNameA = codepage_issue_fixToOEM(zipFileName);
err = zipOpenNewFileInZip( zf, zipFileNameA.c_str(), &zi, NULL, 0, NULL, 0, NULL, Z_DEFLATED, compressionLevel );
err = zipWriteInFileInZip( zf, pData, dwSizeRead );
err = zipCloseFileInZip( zf );
}
RELEASEARRAYOBJECTS(pData);
}
unsigned int filesCount = get_files_count( dir );
unsigned int currentFileIndex = 0;
if ( progress != NULL )
{
short cancel = 0;
long progressValue = ( 1000000 / filesCount * currentFileIndex );
while ( !StringDeque.empty() )
{
szText = StringDeque.front();
StringDeque.pop_front();
if(zipDeque.size() > 0)
{
zipDir = zipDeque.front() + wstring( L"/" );
zipDeque.pop_front();
}
std::vector<std::wstring> aCurFiles = NSDirectory::GetFiles(szText);
std::vector<std::wstring> aCurDirectories = NSDirectory::GetDirectories(szText);
if (sorted)
{
std::sort(aCurFiles.begin(), aCurFiles.end());
std::sort(aCurDirectories.begin(), aCurDirectories.end());
}
for(size_t i = 0; i < aCurDirectories.size(); ++i)
{
std::wstring sDirName = NSSystemPath::GetFileName(aCurDirectories[i]);
StringDeque.push_back( aCurDirectories[i] );
zipDeque.push_back( zipDir + sDirName );
}
for (size_t i = 0; i < aCurFiles.size(); ++i)
{
std::wstring cFileName = NSSystemPath::GetFileName(aCurFiles[i]);
if (std::wstring::npos != cFileName.find(L"mimetype")) // возможно и полное соответствие
{
file = NSSystemPath::Combine(szText, cFileName);
zipFileName = zipDir + cFileName;
oneZipFile(zf, zi, file, zipFileName, 0, compressionLevel);
aCurFiles.erase(aCurFiles.begin() + i, aCurFiles.begin() + i + 1);
break;
}
}
for (size_t i = 0; i < aCurFiles.size(); ++i)
{
std::wstring cFileName = NSSystemPath::GetFileName(aCurFiles[i]);
file = NSSystemPath::Combine(szText, cFileName);
zipFileName = zipDir + cFileName;
oneZipFile(zf, zi, file, zipFileName, Z_DEFLATED, compressionLevel);
if ( progress != NULL )
{
short cancel = 0;
long progressValue = ( 1000000 / filesCount * currentFileIndex );
if(NULL != progress)
(*progress)( UTILS_ONPROGRESSEVENT_ID, progressValue, &cancel );
if ( cancel != 0 )
{
zipClose( zf, NULL );
}
}
currentFileIndex++;
}
}
zipClose( zf, NULL );
if ( progress != NULL )
{
short cancel = 0;
long progressValue = 1000000;
if(NULL != progress)
(*progress)( UTILS_ONPROGRESSEVENT_ID, progressValue, &cancel );
if ( cancel != 0 )
{
err = zipClose( zf, NULL );
return err;
}
}
currentFileIndex++;
}
}
err = zipClose( zf, NULL );
if ( progress != NULL )
{
short cancel = 0;
long progressValue = 1000000;
if(NULL != progress)
(*progress)( UTILS_ONPROGRESSEVENT_ID, progressValue, &cancel );
}
}
}
return err;
}
return 0;
}
/*========================================================================================================*/
@ -933,10 +955,12 @@ namespace ZLibZipUtils
StringDeque.pop_front();
CArray<std::wstring> aCurFiles = NSDirectory::GetFiles(szText);
filescount += aCurFiles.GetCount();
CArray<std::wstring> aCurDirectories = NSDirectory::GetDirectories(szText);
for(int i = 0; i < aCurDirectories.GetCount(); ++i)
std::vector<std::wstring> aCurFiles = NSDirectory::GetFiles(szText);
filescount += aCurFiles.size();
std::vector<std::wstring> aCurDirectories = NSDirectory::GetDirectories(szText);
for(size_t i = 0; i < aCurDirectories.size(); ++i)
{
std::wstring sCurDirectory = aCurDirectories[i];
StringDeque.push_back( sCurDirectory );

View File

@ -43,22 +43,17 @@
#include "OfficeUtilsCommon.h"
#include "../../DesktopEditor/common/Types.h"
using namespace std;
//#define ZLIB_WINAPI
//#define CODEPAGE_ISSUE_FIX
#include "zlib-1.2.3/contrib/minizip/unzip.h"
#include "zlib-1.2.3/contrib/minizip/zip.h"
//#pragma comment(lib, "zlibstat.lib")
#include <zlib.h>
//#if defined(_WIN32) || defined (_WIN64)
#include "zlib-1.2.3/contrib/minizip/unzip.h"
#include "zlib-1.2.3/contrib/minizip/zip.h"
//#else
#include <zlib.h>
//#endif
namespace ZLibZipUtils
{
int ZipDir( const WCHAR* dir, const WCHAR* outputFile, const OnProgressCallback* progress, int compressionLevel = -1 );
int ZipDir( const WCHAR* dir, const WCHAR* outputFile, const OnProgressCallback* progress, bool sorted = false , int compressionLevel = -1);
int ZipFile( const WCHAR* inputFile, const WCHAR* outputFile, int compressionLevel = -1 );
bool ClearDirectory( const WCHAR* dir, bool delDir = false );
int UnzipToDir( const WCHAR* zipFile, const WCHAR* unzipDir, const OnProgressCallback* progress, const WCHAR* password = NULL, bool opt_extract_without_path = false, bool clearOutputDirectory = false );

View File

@ -39,7 +39,7 @@
// TODO: write JPG from Photoshop...
#include "../../DesktopEditor/raster/ImageFileFormatChecker.h"
#include "../../DesktopEditor/raster/BgraFrame.h"
#include "../DesktopEditor/cximage/CxImage/ximage.h"
#include "../../DesktopEditor/cximage/CxImage/ximage.h"
namespace NSImageReSaver
{
static void CorrectImage(const wchar_t* wsFileName, BYTE*& pBuffer, int& nBufferSize, unsigned int& unWidth, unsigned int& unHeight)

View File

@ -7,7 +7,7 @@
QT -= core
QT -= gui
VERSION = 2.0.3.440
VERSION = 2.0.3.441
DEFINES += INTVER=$$VERSION
TARGET = x2t

View File

@ -152,7 +152,7 @@ namespace NExtractTools
if (SUCCEEDED_X2T(nRes))
{
COfficeUtils oCOfficeUtils(NULL);
nRes = (S_OK == oCOfficeUtils.CompressFileOrDirectory(sResultDoctDir, sTo, -1)) ? nRes : AVS_FILEUTILS_ERROR_CONVERT;
nRes = (S_OK == oCOfficeUtils.CompressFileOrDirectory(sResultDoctDir, sTo)) ? nRes : AVS_FILEUTILS_ERROR_CONVERT;
}
return nRes;
@ -172,7 +172,7 @@ namespace NExtractTools
{
// compress
COfficeUtils oCOfficeUtils(NULL);
nRes = (S_OK == oCOfficeUtils.CompressFileOrDirectory (sResultDocxDir, sTo, -1)) ? nRes : AVS_FILEUTILS_ERROR_CONVERT;
nRes = (S_OK == oCOfficeUtils.CompressFileOrDirectory (sResultDocxDir, sTo, true)) ? nRes : AVS_FILEUTILS_ERROR_CONVERT;
}
return nRes;
}
@ -273,7 +273,7 @@ namespace NExtractTools
if (SUCCEEDED_X2T(nRes))
{
COfficeUtils oCOfficeUtils(NULL);
nRes = (S_OK == oCOfficeUtils.CompressFileOrDirectory(sResultXlstDir, sTo, -1)) ? nRes : AVS_FILEUTILS_ERROR_CONVERT;
nRes = (S_OK == oCOfficeUtils.CompressFileOrDirectory(sResultXlstDir, sTo)) ? nRes : AVS_FILEUTILS_ERROR_CONVERT;
}
return nRes;
@ -293,7 +293,7 @@ namespace NExtractTools
{
// compress
COfficeUtils oCOfficeUtils(NULL);
nRes = (S_OK == oCOfficeUtils.CompressFileOrDirectory (sResultXlsxDir, sTo, -1)) ? nRes : AVS_FILEUTILS_ERROR_CONVERT;
nRes = (S_OK == oCOfficeUtils.CompressFileOrDirectory (sResultXlsxDir, sTo, true)) ? nRes : AVS_FILEUTILS_ERROR_CONVERT;
}
return nRes;
}
@ -398,7 +398,7 @@ namespace NExtractTools
{
// zip pptt folder to output file
COfficeUtils oCOfficeUtils(NULL);
nRes = (S_OK == oCOfficeUtils.CompressFileOrDirectory (sResultPpttDir, sTo, -1)) ? nRes : AVS_FILEUTILS_ERROR_CONVERT;
nRes = (S_OK == oCOfficeUtils.CompressFileOrDirectory (sResultPpttDir, sTo)) ? nRes : AVS_FILEUTILS_ERROR_CONVERT;
}
return nRes;
}
@ -417,7 +417,7 @@ namespace NExtractTools
// zip pptx folder to output file
COfficeUtils oCOfficeUtils(NULL);
nRes = (S_OK == oCOfficeUtils.CompressFileOrDirectory (sResultPptxDir,sTo, -1)) ? nRes : AVS_FILEUTILS_ERROR_CONVERT;
nRes = (S_OK == oCOfficeUtils.CompressFileOrDirectory (sResultPptxDir,sTo, true)) ? nRes : AVS_FILEUTILS_ERROR_CONVERT;
return nRes;
}
@ -468,7 +468,7 @@ namespace NExtractTools
int dir2zip (const std::wstring &sFrom, const std::wstring &sTo)
{
COfficeUtils oCOfficeUtils(NULL);
return (S_OK == oCOfficeUtils.CompressFileOrDirectory(sFrom, sTo, -1)) ? 0 : AVS_FILEUTILS_ERROR_CONVERT;
return (S_OK == oCOfficeUtils.CompressFileOrDirectory(sFrom, sTo)) ? 0 : AVS_FILEUTILS_ERROR_CONVERT;
}
// unzip dir
@ -496,7 +496,7 @@ namespace NExtractTools
int nRes = m_oCXlsxSerializer.saveToFile (sResultXlstFileEditor, sCSV, params.getXmlOptions()) ? 0 : AVS_FILEUTILS_ERROR_CONVERT;
if (SUCCEEDED_X2T(nRes))
{
nRes = (S_OK == oCOfficeUtils.CompressFileOrDirectory(sResultXlstDir, sTo, -1)) ? nRes : AVS_FILEUTILS_ERROR_CONVERT;
nRes = (S_OK == oCOfficeUtils.CompressFileOrDirectory(sResultXlstDir, sTo)) ? nRes : AVS_FILEUTILS_ERROR_CONVERT;
}
return nRes;
@ -529,7 +529,7 @@ namespace NExtractTools
nRes = m_oCXlsxSerializer.loadFromFile(sResultXlstFileEditor, sTempUnpackedXLSX, params.getXmlOptions(), sMediaPath, sEmbedPath) ? nRes : AVS_FILEUTILS_ERROR_CONVERT;
if (SUCCEEDED_X2T(nRes))
{
nRes = (S_OK == oCOfficeUtils.CompressFileOrDirectory(sTempUnpackedXLSX, sTo, -1)) ? nRes : AVS_FILEUTILS_ERROR_CONVERT;
nRes = (S_OK == oCOfficeUtils.CompressFileOrDirectory(sTempUnpackedXLSX, sTo, true)) ? nRes : AVS_FILEUTILS_ERROR_CONVERT;
}
}
@ -695,7 +695,7 @@ namespace NExtractTools
if(!imageWriter.m_bIsOnlyFirst)
{
COfficeUtils oCOfficeUtils(NULL);
nRes = S_OK == oCOfficeUtils.CompressFileOrDirectory(sThumbnailDir, sTo, -1) ? nRes : AVS_FILEUTILS_ERROR_CONVERT;
nRes = S_OK == oCOfficeUtils.CompressFileOrDirectory(sThumbnailDir, sTo) ? nRes : AVS_FILEUTILS_ERROR_CONVERT;
}
return nRes;
}
@ -821,7 +821,7 @@ namespace NExtractTools
if(SUCCEEDED_X2T(nRes))
{
COfficeUtils oCOfficeUtils(NULL);
if(S_OK == oCOfficeUtils.CompressFileOrDirectory(sTempUnpackedPPSX, sTo, -1))
if(S_OK == oCOfficeUtils.CompressFileOrDirectory(sTempUnpackedPPSX, sTo, true))
return 0;
}
return AVS_FILEUTILS_ERROR_CONVERT;
@ -863,7 +863,7 @@ namespace NExtractTools
if(SUCCEEDED_X2T(nRes))
{
COfficeUtils oCOfficeUtils(NULL);
if(S_OK == oCOfficeUtils.CompressFileOrDirectory(sResultPptxDir, sTo, -1))
if(S_OK == oCOfficeUtils.CompressFileOrDirectory(sResultPptxDir, sTo, true))
return 0;
}
return AVS_FILEUTILS_ERROR_CONVERT;
@ -888,7 +888,7 @@ namespace NExtractTools
{
// zip pptt folder to output file
COfficeUtils oCOfficeUtils(NULL);
nRes = (S_OK == oCOfficeUtils.CompressFileOrDirectory (sResultPpttDir, sTo, -1)) ? nRes : AVS_FILEUTILS_ERROR_CONVERT;
nRes = (S_OK == oCOfficeUtils.CompressFileOrDirectory (sResultPpttDir, sTo)) ? nRes : AVS_FILEUTILS_ERROR_CONVERT;
}
return nRes;
}
@ -932,7 +932,7 @@ namespace NExtractTools
if(SUCCEEDED_X2T(nRes))
{
COfficeUtils oCOfficeUtils(NULL);
if(S_OK == oCOfficeUtils.CompressFileOrDirectory(sResultDocxDir, sTo, -1))
if(S_OK == oCOfficeUtils.CompressFileOrDirectory(sResultDocxDir, sTo, true))
return 0;
}
return AVS_FILEUTILS_ERROR_CONVERT;
@ -958,7 +958,7 @@ namespace NExtractTools
if (SUCCEEDED_X2T(nRes))
{
COfficeUtils oCOfficeUtils(NULL);
nRes = (S_OK == oCOfficeUtils.CompressFileOrDirectory(sResultDoctDir, sTo, -1)) ? nRes : AVS_FILEUTILS_ERROR_CONVERT;
nRes = (S_OK == oCOfficeUtils.CompressFileOrDirectory(sResultDoctDir, sTo)) ? nRes : AVS_FILEUTILS_ERROR_CONVERT;
}
return nRes;
@ -1025,7 +1025,7 @@ namespace NExtractTools
if(SUCCEEDED_X2T(hRes))
{
COfficeUtils oCOfficeUtils(NULL);
if(S_OK == oCOfficeUtils.CompressFileOrDirectory(sResultDocxDir, sTo, -1))
if(S_OK == oCOfficeUtils.CompressFileOrDirectory(sResultDocxDir, sTo, true))
return 0;
}
else if (AVS_ERROR_DRM == hRes)
@ -1076,7 +1076,7 @@ namespace NExtractTools
if (SUCCEEDED_X2T(nRes))
{
COfficeUtils oCOfficeUtils(NULL);
nRes = (S_OK == oCOfficeUtils.CompressFileOrDirectory(sResultDoctDir, sTo, -1)) ? nRes : AVS_FILEUTILS_ERROR_CONVERT;
nRes = (S_OK == oCOfficeUtils.CompressFileOrDirectory(sResultDoctDir, sTo)) ? nRes : AVS_FILEUTILS_ERROR_CONVERT;
}
return nRes;
@ -1198,7 +1198,7 @@ namespace NExtractTools
if(SUCCEEDED_X2T(nRes))
{
COfficeUtils oCOfficeUtils(NULL);
if(S_OK == oCOfficeUtils.CompressFileOrDirectory(sResultDocxDir, sTo, -1))
if(S_OK == oCOfficeUtils.CompressFileOrDirectory(sResultDocxDir, sTo, true))
return 0;
}
return AVS_FILEUTILS_ERROR_CONVERT;
@ -1224,7 +1224,7 @@ namespace NExtractTools
if (SUCCEEDED_X2T(nRes))
{
COfficeUtils oCOfficeUtils(NULL);
nRes = (S_OK == oCOfficeUtils.CompressFileOrDirectory(sResultDoctDir, sTo, -1)) ? nRes : AVS_FILEUTILS_ERROR_CONVERT;
nRes = (S_OK == oCOfficeUtils.CompressFileOrDirectory(sResultDoctDir, sTo)) ? nRes : AVS_FILEUTILS_ERROR_CONVERT;
}
return nRes;
@ -1273,7 +1273,7 @@ namespace NExtractTools
if (SUCCEEDED_X2T(nRes))
{
COfficeUtils oCOfficeUtils(NULL);
nRes = (S_OK == oCOfficeUtils.CompressFileOrDirectory(sResultDoctDir, sTo, -1)) ? nRes : AVS_FILEUTILS_ERROR_CONVERT;
nRes = (S_OK == oCOfficeUtils.CompressFileOrDirectory(sResultDoctDir, sTo)) ? nRes : AVS_FILEUTILS_ERROR_CONVERT;
}
return nRes;
@ -1315,7 +1315,7 @@ namespace NExtractTools
if(SUCCEEDED_X2T(nRes))
{
COfficeUtils oCOfficeUtils(NULL);
nRes = (S_OK == oCOfficeUtils.CompressFileOrDirectory(sTempUnpackedOox, sTo, -1)) ? nRes : AVS_FILEUTILS_ERROR_CONVERT;
nRes = (S_OK == oCOfficeUtils.CompressFileOrDirectory(sTempUnpackedOox, sTo, true)) ? nRes : AVS_FILEUTILS_ERROR_CONVERT;
}
return nRes;
}
@ -1358,7 +1358,7 @@ namespace NExtractTools
converter.write(sTempUnpackedODT);
COfficeUtils oCOfficeUtils(NULL);
nRes = (S_OK == oCOfficeUtils.CompressFileOrDirectory(sTempUnpackedODT, sTo, -1)) ? 0 : AVS_FILEUTILS_ERROR_CONVERT;
nRes = (S_OK == oCOfficeUtils.CompressFileOrDirectory(sTempUnpackedODT, sTo)) ? 0 : AVS_FILEUTILS_ERROR_CONVERT;
}catch(...)
{
nRes = AVS_FILEUTILS_ERROR_CONVERT;
@ -1393,7 +1393,7 @@ namespace NExtractTools
converter.write(sTempUnpackedODS);
COfficeUtils oCOfficeUtils(NULL);
int nRes = (S_OK == oCOfficeUtils.CompressFileOrDirectory(sTempUnpackedODS, sTo, -1)) ? 0 : AVS_FILEUTILS_ERROR_CONVERT;
int nRes = (S_OK == oCOfficeUtils.CompressFileOrDirectory(sTempUnpackedODS, sTo)) ? 0 : AVS_FILEUTILS_ERROR_CONVERT;
return nRes;
}catch(...)
@ -1413,7 +1413,7 @@ namespace NExtractTools
if (SUCCEEDED_X2T(nRes))
{
COfficeUtils oCOfficeUtils(NULL);
nRes = (S_OK == oCOfficeUtils.CompressFileOrDirectory(sResultOotDir, sTo, -1)) ? nRes : AVS_FILEUTILS_ERROR_CONVERT;
nRes = (S_OK == oCOfficeUtils.CompressFileOrDirectory(sResultOotDir, sTo)) ? nRes : AVS_FILEUTILS_ERROR_CONVERT;
}
return nRes;
@ -1622,7 +1622,7 @@ namespace NExtractTools
if(SUCCEEDED_X2T(nRes))
{
COfficeUtils oCOfficeUtils(NULL);
nRes = (S_OK == oCOfficeUtils.CompressFileOrDirectory(sTempDocx, sFilePathOut, -1)) ? 0 : AVS_FILEUTILS_ERROR_CONVERT;
nRes = (S_OK == oCOfficeUtils.CompressFileOrDirectory(sTempDocx, sFilePathOut, true)) ? 0 : AVS_FILEUTILS_ERROR_CONVERT;
}
}
else if (NSDoctRenderer::DoctRendererFormat::FormatFile::PDF == eTypeTo)
@ -1835,7 +1835,7 @@ namespace NExtractTools
if(!bIsOnlyFirst)
{
COfficeUtils oCOfficeUtils(NULL);
nRes = S_OK == oCOfficeUtils.CompressFileOrDirectory(sThumbnailDir, sTo, -1) ? nRes : AVS_FILEUTILS_ERROR_CONVERT;
nRes = S_OK == oCOfficeUtils.CompressFileOrDirectory(sThumbnailDir, sTo) ? nRes : AVS_FILEUTILS_ERROR_CONVERT;
}
}
else
@ -2392,7 +2392,7 @@ namespace NExtractTools
if(SUCCEEDED_X2T(nRes))
{
COfficeUtils oCOfficeUtils(NULL);
if(S_OK == oCOfficeUtils.CompressFileOrDirectory(sResultDocxDir, sTo, -1))
if(S_OK == oCOfficeUtils.CompressFileOrDirectory(sResultDocxDir, sTo, true))
return 0;
}
return AVS_FILEUTILS_ERROR_CONVERT;
@ -2429,7 +2429,7 @@ namespace NExtractTools
if (SUCCEEDED_X2T(nRes))
{
COfficeUtils oCOfficeUtils(NULL);
nRes = (S_OK == oCOfficeUtils.CompressFileOrDirectory(sResultDoctDir, sTo, -1)) ? nRes : AVS_FILEUTILS_ERROR_CONVERT;
nRes = (S_OK == oCOfficeUtils.CompressFileOrDirectory(sResultDoctDir, sTo)) ? nRes : AVS_FILEUTILS_ERROR_CONVERT;
}
return nRes;

View File

@ -276,10 +276,12 @@ namespace NExtractTools
if (NSDirectory::Exists(sChangesDir))
{
std::vector<std::wstring> aChangesFiles;
CArray<std::wstring> oArray;
NSDirectory::GetFiles2(sChangesDir, oArray, false);
std::vector<std::wstring> oArray;
std::vector<std::wstring> aFiles;
for(int i = 0; i < oArray.GetCount(); ++i)
NSDirectory::GetFiles2(sChangesDir, oArray, false);
for(size_t i = 0; i < oArray.size(); ++i)
{
aChangesFiles.push_back(oArray[i]);
}
@ -360,7 +362,7 @@ namespace NExtractTools
std::wstring sToResultDir = NSDirectory::GetFolderPath(sToResult);
std::wstring sTo = sToResultDir + FILE_SEPARATOR_STR + _T("changes.zip");
COfficeUtils oCOfficeUtils(NULL);
oCOfficeUtils.CompressFileOrDirectory(sChangesDir, sTo, -1);
oCOfficeUtils.CompressFileOrDirectory(sChangesDir, sTo);
}
break;
}

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="windows-1251"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="8,00"
Version="8.00"
Name="X2tTest"
ProjectGUID="{355A22F4-1394-4B82-B2F1-FF0ECFB9E3EF}"
RootNamespace="X2tTest"
@ -356,10 +356,38 @@
<Filter
Name="Common"
>
<File
RelativePath="..\..\..\XlsxSerializerCom\Writer\BinaryReader.h"
>
</File>
<File
RelativePath="..\..\..\XlsxSerializerCom\Common\BinReaderWriterDefines.h"
>
</File>
<File
RelativePath="..\..\..\XlsxSerializerCom\Reader\ChartFromToBinary.cpp"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="0"
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|x64"
>
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="0"
/>
</FileConfiguration>
</File>
<File
RelativePath="..\..\..\XlsxSerializerCom\Reader\ChartFromToBinary.h"
>
</File>
<File
RelativePath="..\..\..\XlsxSerializerCom\Common\Common.cpp"
>
@ -397,10 +425,6 @@
RelativePath="..\..\..\XlsxSerializerCom\Writer\BinaryCommonReader.h"
>
</File>
<File
RelativePath="..\..\..\XlsxSerializerCom\Writer\BinaryReader.h"
>
</File>
<File
RelativePath="..\..\..\XlsxSerializerCom\Reader\CSVReader.cpp"
>
@ -433,30 +457,6 @@
RelativePath="..\..\..\XlsxSerializerCom\Reader\BinaryWriter.h"
>
</File>
<File
RelativePath="..\..\..\XlsxSerializerCom\Reader\ChartFromToBinary.cpp"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="0"
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|x64"
>
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="0"
/>
</FileConfiguration>
</File>
<File
RelativePath="..\..\..\XlsxSerializerCom\Reader\ChartFromToBinary.h"
>
</File>
<File
RelativePath="..\..\..\ASCOfficeDocxFile2\DocWrapper\ChartWriter.cpp"
>

File diff suppressed because it is too large Load Diff

View File

@ -59,7 +59,6 @@ namespace BinXlsxRW {
int ReadCT_RelId (long length, CT_RelId* poResult);
private:
std::wstring* GetRecordXml (long length, int nRecordType);
std::wstring* GetTxBodyXml (long length);
int ReadCT_extLst (BYTE type, long length, void* poResult);
int ReadCT_ChartSpace (BYTE type, long length, void* poResult);
@ -201,6 +200,8 @@ namespace BinXlsxRW {
int ReadAlternateContent (BYTE type, long length, void* poResult);
int ReadAlternateContentChoice (BYTE type, long length, void* poResult);
int ReadAlternateContentFallback(BYTE type, long length, void* poResult);
int ReadCT_SpPr (BYTE type, long length, void* poResult);
int ReadCT_TxPr (BYTE type, long length, void* poResult);
};
class BinaryChartWriter
{
@ -348,15 +349,14 @@ namespace BinXlsxRW {
void WriteAlternateContent(AlternateContent& oVal);
void WriteAlternateContentChoice(AlternateContentChoice& oVal);
void WriteAlternateContentFallback(AlternateContentFallback& oVal);
private:
void toBin(ItemsChoiceType5 eType, void* pVal);
void toBin(ItemsChoiceType6 eType, void* pVal);
void toBin(ItemsChoiceType4 eType, void* pVal);
void GetRecordBinary(int nType, std::wstring& sXml, int nRecordType);
void GetTxBodyBinary(int nType, std::wstring& sXml);
void toBin(ItemsChoiceType3 eType, void* pVal);
void GetRecordBinary(int nType, std::wstring& sXml, int nRecordType);
};
}
#endif // #ifndef CHART_FROM_TO_BINARY