Compare commits

..

13 Commits

Author SHA1 Message Date
6f09ec71f9 . 2019-01-30 12:18:25 +03:00
b122d75f34 DocFormat - fix bug #40363 2019-01-29 19:58:40 +03:00
ed613f7ec1 x2t - fix bug #39977 2019-01-25 15:12:38 +03:00
e0bc06d3db OdfFormatReader - ... 2019-01-25 14:29:47 +03:00
366f16aa4f Merge remote-tracking branch 'origin/hotfix/v5.2.8' into develop 2019-01-25 13:35:27 +03:00
662c687520 . 2019-01-25 13:33:35 +03:00
efc70421e2 [ios] up 2019-01-25 11:05:14 +03:00
7522ad9167 Fix bug 40283 2019-01-25 10:28:43 +03:00
f7922fcea8 . 2019-01-24 19:32:23 +03:00
19dabff8e6 Refactoring 2019-01-24 16:19:42 +03:00
84bd16951f Fix bug #39966
Fix the problem with embedding non-bolded fonts. Improve check whether the font is bold
2019-01-24 15:39:42 +03:00
8996935a10 XlsFormat - fix bug #40178 2019-01-23 18:47:25 +03:00
87c999474d XlsFormat - write default theme 2019-01-23 17:16:42 +03:00
100 changed files with 2485 additions and 2346 deletions

View File

@ -31,7 +31,6 @@
*/
#include "MainDocumentMapping.h"
#include "OfficeDrawing/FillStyleBooleanProperties.h"
namespace DocFileFormat
{
@ -88,10 +87,11 @@ namespace DocFileFormat
m_document->DocProperties->bDisplayBackgroundShape = true;
ShapeContainer* pShape = m_document->GetOfficeArt()->GetShapeBackgound();
OptionEntryPtr boolFill = pShape->ExtractOption(fillStyleBooleanProperties);
ODRAW::OfficeArtFOPTEPtr boolFill = pShape->ExtractOption(fillStyleBooleanProperties);
FillStyleBooleanProperties booleans(boolFill ? boolFill->op : 0);
if (booleans.fUsefFilled && !booleans.fFilled)
ODRAW::FillStyleBooleanProperties* booleans = dynamic_cast<ODRAW::FillStyleBooleanProperties*>(boolFill.get());
if (booleans && (booleans->fUsefFilled && !booleans->fFilled))
{
bFilled = false;
}

View File

@ -1,80 +0,0 @@
/*
* (c) Copyright Ascensio System SIA 2010-2019
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha
* street, Riga, Latvia, EU, LV-1050.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
#pragma once
namespace DocFileFormat
{
// 2.3.7.43 Fill Style Boolean Properties - [MS-ODRAW] — v20130726
class FillStyleBooleanProperties
{
public:
FillStyleBooleanProperties(unsigned int op)
{
fNoFillHitTest = FormatUtils::BitmaskToBool(op, 0x1);
fillUseRect = FormatUtils::BitmaskToBool(op, 0x1 << 1);
fillShape = FormatUtils::BitmaskToBool(op, 0x1 << 2);
fHitTestFill = FormatUtils::BitmaskToBool(op, 0x1 << 3);
fFilled = FormatUtils::BitmaskToBool(op, 0x1 << 4);
fUseShapeAnchor = FormatUtils::BitmaskToBool(op, 0x1 << 5);
fRecolorFillAsPicture = FormatUtils::BitmaskToBool(op, 0x1 << 6);
// 0x1 << 7-15 is ununsed
fUsefNoFillHitTest = FormatUtils::BitmaskToBool(op, 0x1 << 16);
fUsefillUseRect = FormatUtils::BitmaskToBool(op, 0x1 << 17);
fUsefillShape = FormatUtils::BitmaskToBool(op, 0x1 << 18);
fUseHitTestFill = FormatUtils::BitmaskToBool(op, 0x1 << 19);
fUsefFilled = FormatUtils::BitmaskToBool(op, 0x1 << 20);
fUsefUseShapeAnchor = FormatUtils::BitmaskToBool(op, 0x1 << 21);
fUsefRecolorFillAsPicture = FormatUtils::BitmaskToBool(op, 0x1 << 22);
}
public:
bool fNoFillHitTest;
bool fillUseRect;
bool fillShape;
bool fHitTestFill;
bool fFilled;
bool fUseShapeAnchor;
bool fRecolorFillAsPicture;
bool fUsefNoFillHitTest;
bool fUsefillUseRect;
bool fUsefillShape;
bool fUseHitTestFill;
bool fUsefFilled;
bool fUsefUseShapeAnchor;
bool fUsefRecolorFillAsPicture;
};
}

View File

@ -1,72 +0,0 @@
/*
* (c) Copyright Ascensio System SIA 2010-2019
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha
* street, Riga, Latvia, EU, LV-1050.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
#pragma once
namespace DocFileFormat
{
// 2.3.6.31 Geometry Boolean Properties - [MS-ODRAW] — v20130726
class GeometryBooleanProperties
{
public:
GeometryBooleanProperties(unsigned int op)
{
fUsefShadowOK = GETBIT(op, 8);
fUsef3DOK = GETBIT(op, 9);
fUsefLineOK = GETBIT(op, 10);
fUsefGtextOK = GETBIT(op, 11);
fUsefFillShadeShapeOK = GETBIT(op, 12);
fUsefFillOK = GETBIT(op, 13);
fShadowOK = GETBIT(op, 22);
f3DOK = GETBIT(op, 23);
fLineOK = GETBIT(op, 24);
fGtextOK = GETBIT(op, 25);
fFillShadeShapeOK = GETBIT(op, 26);
fFillOK = GETBIT(op, 27);
}
bool fFillOK;
bool fFillShadeShapeOK;
bool fGtextOK;
bool fLineOK;
bool f3DOK;
bool fShadowOK;
bool fUsefFillOK;
bool fUsefFillShadeShapeOK;
bool fUsefGtextOK;
bool fUsefLineOK;
bool fUsef3DOK;
bool fUsefShadowOK;
};
}

View File

@ -1,114 +0,0 @@
/*
* (c) Copyright Ascensio System SIA 2010-2019
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha
* street, Riga, Latvia, EU, LV-1050.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
#pragma once
namespace DocFileFormat
{
// 2.3.6.31 Geometry Boolean Properties - [MS-ODRAW] — v20130726
class GeometryTextBooleanProperties
{
public:
GeometryTextBooleanProperties(unsigned int op)
{
gtextFStrikethrough = FormatUtils::BitmaskToBool(op, 0x1);
gtextFSmallcaps = FormatUtils::BitmaskToBool(op, 0x1 << 1);
gtextFShadow = FormatUtils::BitmaskToBool(op, 0x1 << 2);
gtextFUnderline = FormatUtils::BitmaskToBool(op, 0x1 << 3);
gtextFItalic = FormatUtils::BitmaskToBool(op, 0x1 << 4);
gtextFBold = FormatUtils::BitmaskToBool(op, 0x1 << 5);
gtextFDxMeasure = FormatUtils::BitmaskToBool(op, 0x1 << 6);
gtextFNormalize = FormatUtils::BitmaskToBool(op, 0x1 << 7);
gtextFBestFit = FormatUtils::BitmaskToBool(op, 0x1 << 8);
gtextFShrinkFit = FormatUtils::BitmaskToBool(op, 0x1 << 9);
gtextFStretch = FormatUtils::BitmaskToBool(op, 0x1 << 10);
gtextFTight = FormatUtils::BitmaskToBool(op, 0x1 << 11);
gtextFKern = FormatUtils::BitmaskToBool(op, 0x1 << 12);
gtextFVertical = FormatUtils::BitmaskToBool(op, 0x1 << 13);
fGtext = FormatUtils::BitmaskToBool(op, 0x1 << 14);
gtextFReverseRows = FormatUtils::BitmaskToBool(op, 0x1 << 15);
fUsegtextFSStrikeThrough = FormatUtils::BitmaskToBool(op, 0x1 << 16);
fUsegtextFSmallcaps = FormatUtils::BitmaskToBool(op, 0x1 << 17);
fUsegtextFShadow = FormatUtils::BitmaskToBool(op, 0x1 << 18);
fUsegtextFUnderline = FormatUtils::BitmaskToBool(op, 0x1 << 19);
fUsegtextFItalic = FormatUtils::BitmaskToBool(op, 0x1 << 20);
fUsegtextFBold = FormatUtils::BitmaskToBool(op, 0x1 << 21);
fUsegtextFDxMeasure = FormatUtils::BitmaskToBool(op, 0x1 << 22);
fUsegtextFNormalize = FormatUtils::BitmaskToBool(op, 0x1 << 23);
fUsegtextFBestFit = FormatUtils::BitmaskToBool(op, 0x1 << 24);
fUsegtextFShrinkFit = FormatUtils::BitmaskToBool(op, 0x1 << 25);
fUsegtextFStretch = FormatUtils::BitmaskToBool(op, 0x1 << 26);
fUsegtextFTight = FormatUtils::BitmaskToBool(op, 0x1 << 27);
fUsegtextFKern = FormatUtils::BitmaskToBool(op, 0x1 << 28);
fUsegtextFVertical = FormatUtils::BitmaskToBool(op, 0x1 << 29);
fUsefGtext = FormatUtils::BitmaskToBool(op, 0x1 << 30);
fUsegtextFReverseRows = FormatUtils::BitmaskToBool(op, 0x40000000);
}
public:
bool gtextFStrikethrough;
bool gtextFSmallcaps;
bool gtextFShadow;
bool gtextFUnderline;
bool gtextFItalic;
bool gtextFBold;
bool gtextFDxMeasure;
bool gtextFNormalize;
bool gtextFBestFit;
bool gtextFShrinkFit;
bool gtextFStretch;
bool gtextFTight;
bool gtextFKern;
bool gtextFVertical;
bool fGtext;
bool gtextFReverseRows;
bool fUsegtextFSStrikeThrough;
bool fUsegtextFSmallcaps;
bool fUsegtextFShadow;
bool fUsegtextFUnderline;
bool fUsegtextFItalic;
bool fUsegtextFBold;
bool fUsegtextFDxMeasure;
bool fUsegtextFNormalize;
bool fUsegtextFBestFit;
bool fUsegtextFShrinkFit;
bool fUsegtextFStretch;
bool fUsegtextFTight;
bool fUsegtextFKern;
bool fUsegtextFVertical;
bool fUsefGtext;
bool fUsegtextFReverseRows;
};
}

View File

@ -1,126 +0,0 @@
/*
* (c) Copyright Ascensio System SIA 2010-2019
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha
* street, Riga, Latvia, EU, LV-1050.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
#pragma once
namespace DocFileFormat
{
// 2.3.4.44 Group Shape Boolean Properties - [MS-ODRAW] — v20130726
class GroupShapeBooleanProperties
{
public:
GroupShapeBooleanProperties(unsigned int op)
{
fPrint = FormatUtils::BitmaskToBool(op, 0x1);
fHidden = FormatUtils::BitmaskToBool(op, 0x2);
fOneD = FormatUtils::BitmaskToBool(op, 0x4);
fIsButton = FormatUtils::BitmaskToBool(op, 0x8);
fOnDblClickNotify = FormatUtils::BitmaskToBool(op, 0x10);
fBehindDocument = FormatUtils::BitmaskToBool(op, 0x20);
fEditedWrap = FormatUtils::BitmaskToBool(op, 0x40);
fScriptAnchor = FormatUtils::BitmaskToBool(op, 0x80);
fReallyHidden = FormatUtils::BitmaskToBool(op, 0x100);
fAllowOverlap = FormatUtils::BitmaskToBool(op, 0x200);
fUserDrawn = FormatUtils::BitmaskToBool(op, 0x400);
fHorizRule = FormatUtils::BitmaskToBool(op, 0x800);
fNoshadeHR = FormatUtils::BitmaskToBool(op, 0x1000);
fStandardHR = FormatUtils::BitmaskToBool(op, 0x2000);
fIsBullet = FormatUtils::BitmaskToBool(op, 0x4000);
fLayoutInCell = FormatUtils::BitmaskToBool(op, 0x8000);
fUsefPrint = FormatUtils::BitmaskToBool(op, 0x10000);
fUsefHidden = FormatUtils::BitmaskToBool(op, 0x20000);
fUsefOneD = FormatUtils::BitmaskToBool(op, 0x40000);
fUsefIsButton = FormatUtils::BitmaskToBool(op, 0x80000);
fUsefOnDblClickNotify = FormatUtils::BitmaskToBool(op, 0x100000);
fUsefBehindDocument = FormatUtils::BitmaskToBool(op, 0x200000);
fUsefEditedWrap = FormatUtils::BitmaskToBool(op, 0x400000);
fUsefScriptAnchor = FormatUtils::BitmaskToBool(op, 0x800000);
fUsefReallyHidden = FormatUtils::BitmaskToBool(op, 0x1000000);
fUsefAllowOverlap = FormatUtils::BitmaskToBool(op, 0x2000000);
fUsefUserDrawn = FormatUtils::BitmaskToBool(op, 0x4000000);
fUsefHorizRule = FormatUtils::BitmaskToBool(op, 0x8000000);
fUsefNoshadeHR = FormatUtils::BitmaskToBool(op, 0x10000000);
fUsefStandardHR = FormatUtils::BitmaskToBool(op, 0x20000000);
fUsefIsBullet = FormatUtils::BitmaskToBool(op, 0x40000000);
fUsefLayoutInCell = FormatUtils::BitmaskToBool(op, 0x80000000);
}
public:
bool fPrint;
bool fHidden;
bool fOneD;
bool fIsButton;
bool fOnDblClickNotify;
bool fBehindDocument;
bool fEditedWrap;
bool fScriptAnchor;
bool fReallyHidden;
bool fAllowOverlap;
bool fUserDrawn;
bool fHorizRule;
bool fNoshadeHR;
bool fStandardHR;
bool fIsBullet;
bool fLayoutInCell;
bool fUsefPrint;
bool fUsefHidden;
bool fUsefOneD;
bool fUsefIsButton;
bool fUsefOnDblClickNotify;
bool fUsefBehindDocument;
bool fUsefEditedWrap;
bool fUsefScriptAnchor;
bool fUsefReallyHidden;
bool fUsefAllowOverlap;
bool fUsefUserDrawn;
bool fUsefHorizRule;
bool fUsefNoshadeHR;
bool fUsefStandardHR;
bool fUsefIsBullet;
bool fUsefLayoutInCell;
};
}

View File

@ -1,91 +0,0 @@
/*
* (c) Copyright Ascensio System SIA 2010-2019
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha
* street, Riga, Latvia, EU, LV-1050.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
#pragma once
namespace DocFileFormat
{
// 2.3.8.38 Line Style Boolean Properties - [MS-ODRAW] — v20130726
class LineStyleBooleanProperties
{
public:
LineStyleBooleanProperties(unsigned int op)
{
fNoLineDrawDash = FormatUtils::BitmaskToBool(op, 0x1);
fLineFillShape = FormatUtils::BitmaskToBool(op, 0x2);
fHitTestLine = FormatUtils::BitmaskToBool(op, 0x4);
fLine = FormatUtils::BitmaskToBool(op, 0x8);
fArrowheadsOK = FormatUtils::BitmaskToBool(op, 0x10);
fInsetPenOK = FormatUtils::BitmaskToBool(op, 0x20);
fInsetPen = FormatUtils::BitmaskToBool(op, 0x40);
//Reserved 0x80 0x100
fLineOpaqueBackColor = FormatUtils::BitmaskToBool(op, 0x200);
//Unused 0x400 0x800 0x1000 0x2000 0x4000 0x8000
fUsefNoLineDrawDash = FormatUtils::BitmaskToBool(op, 0x10000);
fUsefLineFillShape = FormatUtils::BitmaskToBool(op, 0x20000);
fUsefHitTestLine = FormatUtils::BitmaskToBool(op, 0x40000);
fUsefLine = FormatUtils::BitmaskToBool(op, 0x80000);
fUsefArrowheadsOK = FormatUtils::BitmaskToBool(op, 0x100000);
fUsefInsetPenOK = FormatUtils::BitmaskToBool(op, 0x200000);
fUsefInsetPen = FormatUtils::BitmaskToBool(op, 0x400000);
//Reserved 0x800000 0x1000000
fUsefLineOpaqueBackColor = FormatUtils::BitmaskToBool(op, 0x2000000);
}
public:
bool fNoLineDrawDash;
bool fLineFillShape;
bool fHitTestLine;
bool fLine;
bool fArrowheadsOK;
bool fInsetPenOK;
bool fInsetPen;
bool fLineOpaqueBackColor;
bool fUsefNoLineDrawDash;
bool fUsefLineFillShape;
bool fUsefHitTestLine;
bool fUsefLine;
bool fUsefArrowheadsOK;
bool fUsefInsetPenOK;
bool fUsefInsetPen;
bool fUsefLineOpaqueBackColor;
};
}

View File

@ -1,280 +0,0 @@
/*
* (c) Copyright Ascensio System SIA 2010-2019
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha
* street, Riga, Latvia, EU, LV-1050.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
#pragma once
#include "PathSegment.h"
namespace DocFileFormat
{
struct _guides
{
unsigned char type;
unsigned char param_type1;
unsigned char param_type2;
unsigned char param_type3;
WORD param1;
WORD param2;
WORD param3;
};
class PathParser
{
public:
PathParser (const unsigned char* pSegmentInfo, unsigned int pSegmentInfoSize, const unsigned char* pVertices, unsigned int pVerticesSize, std::vector<_guides> & guides)
{
if ((pSegmentInfo != NULL) && (pSegmentInfoSize > 0))
{
unsigned short nElems = FormatUtils::BytesToUInt16(pSegmentInfo, 0, pSegmentInfoSize);
unsigned short nElemsAlloc = FormatUtils::BytesToUInt16(pSegmentInfo, 2, pSegmentInfoSize);
unsigned short cb = FormatUtils::BytesToUInt16(pSegmentInfo, 4, pSegmentInfoSize);
unsigned short cbElement = 4;
int offset = 6;
if (cb == 0xfff0)
cbElement = 2;
if (nElems == 0)
{
nElems = (pSegmentInfoSize - offset) / cbElement;
}
for (unsigned short i = 0; i < nElems; ++i)
{
PathSegment oSegment = PathSegment(FormatUtils::BytesToInt32(pSegmentInfo + offset, (i * cbElement), pSegmentInfoSize - offset));
m_arSegments.push_back (oSegment);
}
if ((long)pSegmentInfoSize < (long)(cb * nElems)) // Есть несколько файлов с мусором вместо данных
m_arSegments.clear();
}
if ((NULL != pVertices) && (pVerticesSize > 0))
{
unsigned short nElems = FormatUtils::BytesToUInt16(pVertices, 0, pVerticesSize);
unsigned short nElemsAlloc = FormatUtils::BytesToUInt16(pVertices, 2, pVerticesSize);
unsigned short cb = FormatUtils::BytesToUInt16(pVertices, 4, pVerticesSize);
unsigned short cbElement = 4;
if (cb == 0xfff0)
cbElement = 2;
int offset = 6;
for (unsigned short i = 0; i < nElems; ++i)
{
POINT point;
if (cbElement == 4)
{
point.x = FormatUtils::BytesToInt32(pVertices + offset, 0, pVerticesSize - offset);
point.y = FormatUtils::BytesToInt32(pVertices + offset + cbElement, 0 , pVerticesSize - offset);
}
else
{
point.x = FormatUtils::BytesToInt16(pVertices + offset, 0, pVerticesSize - offset);
point.y = FormatUtils::BytesToInt16(pVertices + offset + cbElement, 0 , pVerticesSize - offset);
}
offset += cbElement * 2;
LONG lMinF = (LONG)0x80000000;
if (lMinF <= point.x)
{
int index = (DWORD)point.x - 0x80000000;
if (index >= 0 && index < (int)guides.size())
{
point.x = guides[index].param3;
}
}
if (lMinF <= point.y)
{
int index = (DWORD)point.y - 0x80000000;
if (index >= 0 && index < (int)guides.size())
{
point.y = guides[index].param3;
}
}
if ((size_t)point.y > 0xffff)
{
point.y &= 0xffff;
}
if ((size_t)point.x > 0xffff)
{
point.x &= 0xffff;
}
m_arPoints.push_back(point);
}
}
}
inline std::wstring GetVmlPath () const
{
if ((0 == m_arSegments.size()) && (0 == m_arPoints.size()))
return std::wstring(L"");
std::wstring strVmlPath;
int valuePointer = 0;
if (0 == m_arSegments.size())
{
for (size_t i = 0; i < m_arPoints.size(); ++i)
{
strVmlPath += L"l";
strVmlPath += FormatUtils::IntToWideString(m_arPoints[i].x);
strVmlPath += L",";
strVmlPath += FormatUtils::IntToWideString(m_arPoints[i].y);
++valuePointer;
}
strVmlPath += L"xe";
return strVmlPath;
}
int cc = 0;
std::vector<PathSegment>::const_iterator end = m_arSegments.end();
for (std::vector<PathSegment>::const_iterator iter = m_arSegments.begin(); iter != end; ++iter, cc++)
{
switch (iter->Type)
{
case PathSegment::msopathLineTo:
{
for (int i = 0; i < iter->Count; ++i)
{
if (valuePointer + 1 > (int)m_arPoints.size())
{
break;
strVmlPath += L"l";
strVmlPath += FormatUtils::IntToWideString(m_arPoints[0].x);
strVmlPath += L",";
strVmlPath += FormatUtils::IntToWideString(m_arPoints[0].y);
++valuePointer;
//break;
}
else
{
strVmlPath += L"l";
strVmlPath += FormatUtils::IntToWideString(m_arPoints[valuePointer].x );
strVmlPath += L",";
strVmlPath += FormatUtils::IntToWideString(m_arPoints[valuePointer].y );
++valuePointer;
}
}
}
break;
case PathSegment::msopathCurveTo:
{
for (int i = 0; i < iter->Count; ++i)
{
if (valuePointer + 3 > (int)m_arPoints.size())
break;
strVmlPath += L"c";
strVmlPath += FormatUtils::IntToWideString(m_arPoints[valuePointer].x );
strVmlPath += L",";
strVmlPath += FormatUtils::IntToWideString(m_arPoints[valuePointer].y );
strVmlPath += L",";
strVmlPath += FormatUtils::IntToWideString(m_arPoints[valuePointer + 1].x );
strVmlPath += L",";
strVmlPath += FormatUtils::IntToWideString(m_arPoints[valuePointer + 1].y );
strVmlPath += L",";
strVmlPath += FormatUtils::IntToWideString(m_arPoints[valuePointer + 2].x );
strVmlPath += L",";
strVmlPath += FormatUtils::IntToWideString(m_arPoints[valuePointer + 2].y );
valuePointer += 3;
}
}
break;
case PathSegment::msopathMoveTo:
{
if (valuePointer < (int)m_arPoints.size())
{
strVmlPath += L"m";
strVmlPath += FormatUtils::IntToWideString(m_arPoints[valuePointer].x );
strVmlPath += L",";
strVmlPath += FormatUtils::IntToWideString(m_arPoints[valuePointer].y );
++valuePointer;
}
}
break;
case PathSegment::msopathClose:
{
strVmlPath += L"x";
}
break;
case PathSegment::msopathEnd:
{
strVmlPath += L"e";
}
break;
case PathSegment::msopathEscape:
{
if (PathSegment::msopathEscapeNoFill == iter->EscapeCode)
strVmlPath += L"nf";
if (PathSegment::msopathEscapeNoLine == iter->EscapeCode)
strVmlPath += L"ns";
}
case PathSegment::msopathClientEscape:
case PathSegment::msopathInvalid:
{
//ignore escape segments and invalid segments
}
break;
}
}
// end the path
if ( !strVmlPath.empty() && ( strVmlPath[strVmlPath.size() - 1] != L'e' ) )
strVmlPath +=L"e";
return strVmlPath;
}
private:
std::vector<POINT> m_arPoints;
std::vector<PathSegment> m_arSegments;
};
}

View File

@ -1,101 +0,0 @@
/*
* (c) Copyright Ascensio System SIA 2010-2019
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha
* street, Riga, Latvia, EU, LV-1050.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
#pragma once
namespace DocFileFormat
{
class PathSegment
{
public:
enum MSOPATHTYPE
{
msopathLineTo,
msopathCurveTo,
msopathMoveTo,
msopathClose,
msopathEnd,
msopathEscape,
msopathClientEscape,
msopathInvalid
};
enum MSOPATHESCAPE
{
msopathEscapeExtension = 0x00000000,
msopathEscapeAngleEllipseTo = 0x00000001,
msopathEscapeAngleEllipse = 0x00000002,
msopathEscapeArcTo = 0x00000003,
msopathEscapeArc = 0x00000004,
msopathEscapeClockwiseArcTo = 0x00000005,
msopathEscapeClockwiseArc = 0x00000006,
msopathEscapeEllipticalQuadrantX = 0x00000007,
msopathEscapeEllipticalQuadrantY = 0x00000008,
msopathEscapeQuadraticBezier = 0x00000009,
msopathEscapeNoFill = 0x0000000A,
msopathEscapeNoLine = 0x0000000B,
msopathEscapeAutoLine = 0x0000000C,
msopathEscapeAutoCurve = 0x0000000D,
msopathEscapeCornerLine = 0x0000000E,
msopathEscapeCornerCurve = 0x0000000F,
msopathEscapeSmoothLine = 0x00000010,
msopathEscapeSmoothCurve = 0x00000011,
msopathEscapeSymmetricLine = 0x00000012,
msopathEscapeSymmetricCurve = 0x00000013,
msopathEscapeFreeform = 0x00000014,
msopathEscapeFillColor = 0x00000015,
msopathEscapeLineColor = 0x00000016
};
PathSegment (unsigned short segment): Type(msopathInvalid), Count(0), EscapeCode(msopathEscapeExtension), VertexCount(0)
{
Type = (MSOPATHTYPE)FormatUtils::BitmaskToInt (segment, 0xE000);
if (msopathEscape == Type)
{
EscapeCode = (MSOPATHESCAPE)FormatUtils::BitmaskToInt (segment, 0x1F00);
VertexCount = FormatUtils::BitmaskToInt (segment, 0x00FF);
}
else
{
Count = FormatUtils::BitmaskToInt (segment, 0x1FFF);
}
}
public:
MSOPATHTYPE Type;
int Count;
int VertexCount;
MSOPATHESCAPE EscapeCode;
};
}

View File

@ -1,97 +0,0 @@
/*
* (c) Copyright Ascensio System SIA 2010-2019
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha
* street, Riga, Latvia, EU, LV-1050.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
#pragma once
#include "../../Common/FormatUtils.h"
namespace DocFileFormat
{
// 2.3.20.1 Protection Boolean Properties - [MS-ODRAW] — v20130726
class ProtectionBooleanProperties
{
public:
ProtectionBooleanProperties(unsigned int op)
{
fLockAgainstGrouping = FormatUtils::BitmaskToBool(op,0x1);
fLockAdjustHandles = FormatUtils::BitmaskToBool(op,0x2);
fLockText = FormatUtils::BitmaskToBool(op,0x4);
fLockVertices = FormatUtils::BitmaskToBool(op,0x8);
fLockCropping = FormatUtils::BitmaskToBool(op,0x10);
fLockAgainstSelect = FormatUtils::BitmaskToBool(op,0x20);
fLockPosition = FormatUtils::BitmaskToBool(op,0x30);
fLockAspectRatio = FormatUtils::BitmaskToBool(op,0x40);
fLockRotation = FormatUtils::BitmaskToBool(op,0x100);
fLockAgainstUngrouping = FormatUtils::BitmaskToBool(op,0x200);
//unused 0x400 0x800 0x1000 0x2000 0x4000 0x8000
fUsefLockAgainstGrouping = FormatUtils::BitmaskToBool(op,0x10000);
fUsefLockAdjustHandles = FormatUtils::BitmaskToBool(op,0x20000);
fUsefLockText = FormatUtils::BitmaskToBool(op,0x40000);
fUsefLockVertices = FormatUtils::BitmaskToBool(op,0x80000);
fUsefLockCropping = FormatUtils::BitmaskToBool(op,0x100000);
fUsefLockAgainstSelect = FormatUtils::BitmaskToBool(op,0x200000);
fUsefLockPosition = FormatUtils::BitmaskToBool(op,0x400000);
fUsefLockAspectRatio = FormatUtils::BitmaskToBool(op,0x800000);
fUsefLockRotation = FormatUtils::BitmaskToBool(op,0x1000000);
fUsefLockAgainstUngrouping = FormatUtils::BitmaskToBool(op,0x2000000);
}
bool fLockAgainstGrouping;
bool fLockAdjustHandles;
bool fLockText;
bool fLockVertices;
bool fLockCropping;
bool fLockAgainstSelect;
bool fLockPosition;
bool fLockAspectRatio;
bool fLockRotation;
bool fLockAgainstUngrouping;
bool fUsefLockAgainstGrouping;
bool fUsefLockAdjustHandles;
bool fUsefLockText;
bool fUsefLockVertices;
bool fUsefLockCropping;
bool fUsefLockAgainstSelect;
bool fUsefLockPosition;
bool fUsefLockAspectRatio;
bool fUsefLockRotation;
bool fUsefLockAgainstUngrouping;
};
}

View File

@ -1,58 +0,0 @@
/*
* (c) Copyright Ascensio System SIA 2010-2019
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha
* street, Riga, Latvia, EU, LV-1050.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
#pragma once
namespace DocFileFormat
{
// 2.3.13.23 Shadow Style Boolean Properties - [MS-ODRAW] — v20130726
class ShadowStyleBooleanProperties
{
public:
ShadowStyleBooleanProperties(unsigned int op)
{
fshadowObscured = FormatUtils::BitmaskToBool(op, 0x1);
fShadow = FormatUtils::BitmaskToBool(op, 0x1 << 1);
fUsefshadowObscured = FormatUtils::BitmaskToBool(op, 0x1 << 16);
fUsefShadow = FormatUtils::BitmaskToBool(op, 0x1 << 17);
}
public:
bool fUsefShadow;
bool fUsefshadowObscured;
bool fShadow;
bool fshadowObscured;
};
}

View File

@ -75,9 +75,9 @@ namespace DocFileFormat
}
else
{
for ( std::vector<Record*>::const_iterator iter1 = this->Children.begin(); iter1 != this->Children.end(); iter1++ )
for ( size_t j = 0; j < this->Children.size(); ++j)
{
ShapeOptions* sh_options = dynamic_cast<ShapeOptions*>( *iter1 );
ShapeOptions* sh_options = dynamic_cast<ShapeOptions*>( this->Children[j] );
if (sh_options)
{
if (sh_options->OptionsByID.end() != sh_options->OptionsByID.find(Pib))
@ -101,16 +101,17 @@ namespace DocFileFormat
return new ShapeContainer( _reader, bodySize, typeCode, version, instance );
}
OptionEntryPtr ExtractOption(const PropertyId & prop) const
ODRAW::OfficeArtFOPTEPtr ExtractOption(const PropertyId & prop) const
{
OptionEntryPtr ret;
ODRAW::OfficeArtFOPTEPtr ret;
for ( size_t i = 0; i < this->Children.size(); ++i )
{
ShapeOptions* opt = dynamic_cast<ShapeOptions*>( this->Children[i] );
if ( opt == NULL ) continue;
std::map<PropertyId, OptionEntryPtr>::iterator pFind = opt->OptionsByID.find(prop);
std::map<PropertyId, ODRAW::OfficeArtFOPTEPtr>::iterator pFind = opt->OptionsByID.find(prop);
if (pFind != opt->OptionsByID.end())
{
ret = pFind->second;
@ -119,9 +120,9 @@ namespace DocFileFormat
return ret;
}
std::vector<OptionEntryPtr> ExtractOptions() const
std::vector<ODRAW::OfficeArtFOPTEPtr> ExtractOptions() const
{
std::vector<OptionEntryPtr> ret;
std::vector<ODRAW::OfficeArtFOPTEPtr> ret;
//build the list of all option entries of this shape
for ( size_t i = 0; i < this->Children.size(); ++i )

View File

@ -32,6 +32,7 @@
#pragma once
#include "Record.h"
#include "../../../ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/ODRAW/OfficeArtRGFOPTE.h"
namespace DocFileFormat
{
@ -526,21 +527,6 @@ namespace DocFileFormat
LineDashing_LongDashDotDotGEL
} LineDashing;
struct OptionEntry
{
OptionEntry() : pid(PropertyId_left), fBid(false), fComplex(false), op(0)
{
}
PropertyId pid;
bool fBid;
bool fComplex;
unsigned int op;
std::shared_ptr<unsigned char> opComplex;
};
typedef std::shared_ptr<OptionEntry> OptionEntryPtr;
class ShapeOptions: public Record
{
public:
@ -548,9 +534,9 @@ namespace DocFileFormat
static const unsigned short TYPE_CODE_0xF121 = 0xF121;
static const unsigned short TYPE_CODE_0xF122 = 0xF122;
std::vector<OptionEntryPtr> Options;
std::map<PropertyId, OptionEntryPtr> OptionsByID;
std::vector<ODRAW::OfficeArtFOPTEPtr> Options;
std::map<PropertyId, ODRAW::OfficeArtFOPTEPtr> OptionsByID;
ShapeOptions() : Record()
{
}
@ -563,41 +549,24 @@ namespace DocFileFormat
{
long pos = Reader->GetPosition();
//parse the flags and the simple values
// parse the flags and the simple values
for (unsigned int i = 0; i < instance; ++i)
{
OptionEntryPtr entry = std::shared_ptr<OptionEntry>(new OptionEntry());
unsigned short flag = Reader->ReadUInt16();
ODRAW::OfficeArtFOPTEPtr fopte = ODRAW::OfficeArtFOPTE::load_and_create(Reader);
if (!fopte)continue;
entry->pid = (PropertyId)FormatUtils::BitmaskToInt (flag, 0x3FFF);
entry->fBid = FormatUtils::BitmaskToBool (flag, 0x4000);
entry->fComplex = FormatUtils::BitmaskToBool (flag, 0x8000);
entry->op = Reader->ReadUInt32();
Options.push_back( entry );
Options.push_back(fopte);
}
// complex load
//parse the complex values & sorted by pid
for (unsigned int i = 0; i < instance; ++i)
for(size_t i = 0; i < Options.size(); ++i)
{
if (Options[i]->fComplex && Options[i]->op > 0)
{
unsigned int size = Options[i]->op;
if (Options[i]->pid == 0x0145 ||
Options[i]->pid == 0x0146 ||
Options[i]->pid == 0x0197 ||
Options[i]->pid == 0x0156 ||
Options[i]->pid == 0x0155 ||
Options[i]->pid == 0x0151 ||
Options[i]->pid == 0x0152 ||
Options[i]->pid == 0x0157 ||
Options[i]->pid == 0x0158)//mso arrays
size += 6;
Options[i]->opComplex = std::shared_ptr<unsigned char>(Reader->ReadBytes( size, true ));
if(Options[i]->fComplex && Options[i]->op > 0)
{
Options[i]->ReadComplexData(Reader);
}
OptionsByID.insert(std::make_pair(Options[i]->pid, Options[i]));
OptionsByID.insert(std::make_pair((PropertyId)Options[i]->opid, Options[i]));
}
Reader->Seek(( pos + size ), 0/*STREAM_SEEK_SET*/);

View File

@ -31,13 +31,15 @@
*/
#pragma once
#include "ProtectionBooleanProperties.h"
#include "../IVisitable.h"
#include "../../Common/XmlTools.h"
#include <boost/shared_ptr.hpp>
#include <list>
namespace ODRAW
{
class OfficeArtFOPTE;
typedef boost::shared_ptr<OfficeArtFOPTE> OfficeArtFOPTEPtr;
}
namespace DocFileFormat
{
enum MSOSPT
@ -274,9 +276,6 @@ namespace DocFileFormat
position = pos;
xrange = xRange;
}
public:
std::wstring position;
std::wstring xrange;
std::wstring switchHandle;
@ -289,7 +288,7 @@ namespace DocFileFormat
{
public:
ShapeType (unsigned int typeCode) : Filled(true), Stroked(true), Lock(0), TypeCode(typeCode), Joins(miter), ShapeConcentricFill(false)
ShapeType (unsigned int typeCode) : Filled(true), Stroked(true), TypeCode(typeCode), Joins(miter), ShapeConcentricFill(false)
{
}
@ -301,8 +300,7 @@ namespace DocFileFormat
{
return TypeCode;
}
public:
/// This string describes a sequence of commands that define the shapes path.
/// This string describes both the pSegmentInfo array and pVertices array in the shapes geometry properties.
std::wstring Path;
@ -344,7 +342,7 @@ namespace DocFileFormat
bool Stroked;
/// Speicfies the locked properties of teh shape.
/// By default nothing is locked.
ProtectionBooleanProperties Lock;
ODRAW::OfficeArtFOPTEPtr Lock;
///
std::wstring Textpath;

View File

@ -60,9 +60,9 @@ namespace DocFileFormat
this->Filled = false;
this->Stroked = false;
//pictures have a lock on the aspect ratio by default
this->Lock.fUsefLockAspectRatio = true;
this->Lock.fLockAspectRatio = true;
// //pictures have a lock on the aspect ratio by default
//this->Lock.fUsefLockAspectRatio = true;
// this->Lock.fLockAspectRatio = true;
}
void SetType(unsigned int nType)
{

View File

@ -1,92 +0,0 @@
/*
* (c) Copyright Ascensio System SIA 2010-2019
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha
* street, Riga, Latvia, EU, LV-1050.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
#pragma once
namespace DocFileFormat
{
class ThreeDStyleBooleanProperties
{
public:
ThreeDStyleBooleanProperties(unsigned int op)
{
fUsefc3DConstrainRotation = GETBIT(op, 0);
fUsefc3DRotationCenterAuto = GETBIT(op, 1);
fUsefc3DParallel = GETBIT(op, 2);
fUsefc3DKeyHarsh = GETBIT(op, 3);
fUsefc3DFillHarsh = GETBIT(op, 4);
fc3DConstrainRotation = GETBIT(op, 16);
fc3DRotationCenterAuto = GETBIT(op, 17);
fc3DParallel = GETBIT(op, 18);
fc3DKeyHarsh = GETBIT(op, 19);
fc3DFillHarsh = GETBIT(op, 20);
}
bool fUsefc3DConstrainRotation;
bool fUsefc3DRotationCenterAuto;
bool fUsefc3DParallel;
bool fUsefc3DKeyHarsh;
bool fUsefc3DFillHarsh;
bool fc3DConstrainRotation;
bool fc3DRotationCenterAuto;
bool fc3DParallel;
bool fc3DKeyHarsh;
bool fc3DFillHarsh;
};
class ThreeDObjectBooleanProperties
{
public:
ThreeDObjectBooleanProperties(unsigned int op)
{
fUsef3D = GETBIT(op, 0);
fUsefc3DMetallic = GETBIT(op, 1);
fUsefc3DUseExtrusionColor = GETBIT(op, 2);
fUsefc3DLightFace = GETBIT(op, 3);
// 12 unused
f3D = GETBIT(op, 16);
fc3DMetallic = GETBIT(op, 17);
fc3DUseExtrusionColor = GETBIT(op, 18);
fc3DLightFace = GETBIT(op, 19);
}
bool fUsef3D;
bool fUsefc3DMetallic;
bool fUsefc3DUseExtrusionColor;
bool fUsefc3DLightFace;
bool f3D;
bool fc3DMetallic;
bool fc3DUseExtrusionColor;
bool fc3DLightFace;
};
}

View File

@ -33,9 +33,6 @@
#include "VMLPictureMapping.h"
#include "VMLShapeMapping.h"
#include "OfficeDrawing/GeometryBooleanProperties.h"
#include "OfficeDrawing/GeometryTextBooleanProperties.h"
#include "OfficeDrawing/GroupShapeBooleanProperties.h"
#include "OfficeDrawing/MetafilePictBlip.h"
#include "../../DesktopEditor/common/StringExt.h"
@ -44,30 +41,10 @@
#include "../../DesktopEditor/common/File.h"
#include "../../DesktopEditor/raster/BgraFrame.h"
#include "../../ASCOfficePPTFile/PPTFormatLib/Reader/ReadStructures.h"
using namespace DocFileFormat;
typedef struct
{
DWORD iType; // Record type EMR_HEADER
DWORD nSize; // Record size in bytes. This may be greater
// than the sizeof(ENHMETAHEADER).
RECT rclBounds; // Inclusive-inclusive bounds in device units
RECT rclFrame; // Inclusive-inclusive Picture Frame .01mm unit
DWORD dSignature; // Signature. Must be ENHMETA_SIGNATURE.
DWORD nVersion; // Version number
DWORD nBytes; // Size of the metafile in bytes
DWORD nRecords; // Number of records in the metafile
WORD nHandles; // Number of handles in the handle table
// Handle index zero is reserved.
WORD sReserved; // Reserved. Must be zero.
DWORD nDescription; // Number of chars in the unicode desc string
// This is 0 if there is no description string
DWORD offDescription; // Offset to the metafile description record.
// This is 0 if there is no description string
DWORD nPalEntries; // Number of entries in the metafile palette.
SIZE szlDevice; // Size of the reference device in pels
SIZE szlMillimeters; // Size of the reference device in millimeters
} ENHMETAHEADER3;
namespace DocFileFormat
{
@ -302,7 +279,7 @@ namespace DocFileFormat
std::wstring strHeight = FormatUtils::DoubleToWideString( height.ToPoints() );
std::wstring strStyle;
std::vector<OptionEntryPtr> options;
std::vector<ODRAW::OfficeArtFOPTEPtr> options;
PictureFrameType type;
Shape* pShape = NULL;
@ -342,33 +319,37 @@ namespace DocFileFormat
for (size_t i = 0; i < options.size(); i++)
{
OptionEntryPtr & iter = options[i];
switch ( iter->pid )
ODRAW::OfficeArtFOPTEPtr & iter = options[i];
switch ( iter->opid )
{
case wzEquationXML:
{
m_isEquation = true;
m_isEmbedded = true;
m_embeddedData = std::string((char*)iter->opComplex.get(), iter->op);
if (ParseEmbeddedEquation( m_embeddedData, m_equationXml))
ODRAW::xmlString *pXml = dynamic_cast<ODRAW::xmlString*>(iter.get());
if (pXml)
{
m_isEmbedded = false;
m_isEquation = true;
m_isEmbedded = true;
m_embeddedData = pXml->data;
if (ParseEmbeddedEquation( m_embeddedData, m_equationXml))
{
m_isEmbedded = false;
}
}
}break;
case metroBlob:
{
//встроенная неведомая хуйня
m_isBlob = true;
m_isEmbedded = true;
m_embeddedData = std::string((char*)iter->opComplex.get(), iter->op);
//if (ParseEmbeddedBlob( m_embeddedData, m_blobXml)) // todoooo
//{
// m_isEmbedded = false;
//}
{//встроенная неведомая хуйня
ODRAW::metroBlob* blob = dynamic_cast<ODRAW::metroBlob*>(iter.get());
if (blob)
{
m_isBlob = true;
m_isEmbedded = true;
//if (ParseEmbeddedBlob( blob->data.first, blob->data.second)) // todoooo
//{
// m_isEmbedded = false;
//}
}
}break;
//BORDERS
case borderBottomColor:
@ -459,9 +440,9 @@ namespace DocFileFormat
}break;
case groupShapeBooleans:
{
GroupShapeBooleanProperties groupShapeBooleans(iter->op);
ODRAW::GroupShapeBooleanProperties* booleans = dynamic_cast<ODRAW::GroupShapeBooleanProperties*>(iter.get());
if (groupShapeBooleans.fUsefBehindDocument && groupShapeBooleans.fBehindDocument)
if (booleans->fUsefBehindDocument && booleans->fBehindDocument)
{
//The shape is behind the text, so the z-index must be negative.
appendStyleProperty(&strStyle, L"z-index", L"-1" );
@ -471,7 +452,7 @@ namespace DocFileFormat
// appendStyleProperty( &strStyle, L"z-index", FormatUtils::IntToWideString(zIndex + 0x7ffff));
//}
if (groupShapeBooleans.fHidden && groupShapeBooleans.fUsefHidden)
if (booleans->fHidden && booleans->fUsefHidden)
{
appendStyleProperty(&strStyle, L"visibility", L"hidden");
}

View File

@ -38,20 +38,7 @@
#include "OfficeDrawing/Shapetypes/OvalType.h"
#include "OfficeDrawing/Shapetypes/RectangleType.h"
#include "OfficeDrawing/Shapetypes/RoundedRectangleType.h"
#include "OfficeDrawing/threeDBooleanProperties.h"
#include "OfficeDrawing/OfficeArtClientTextbox.h"
#include "OfficeDrawing/DiagramBooleanProperties.h"
#include "OfficeDrawing/GeometryBooleanProperties.h"
#include "OfficeDrawing/ShadowStyleBooleanProperties.h"
#include "OfficeDrawing/GeometryBooleanProperties.h"
#include "OfficeDrawing/FillStyleBooleanProperties.h"
#include "OfficeDrawing/GeometryBooleanProperties.h"
#include "OfficeDrawing/FillStyleBooleanProperties.h"
#include "OfficeDrawing/LineStyleBooleanProperties.h"
#include "OfficeDrawing/GeometryTextBooleanProperties.h"
#include "OfficeDrawing/GroupShapeBooleanProperties.h"
#include "OfficeDrawing/ProtectionBooleanProperties.h"
#include "DrawingPrimitives.h"
@ -141,12 +128,13 @@ namespace DocFileFormat
{
if ((container != NULL) && (!container->Children.empty()))
{
ShapeContainer* groupShape = static_cast<ShapeContainer*>(container->Children[0]);
GroupShapeRecord* gsr = static_cast<GroupShapeRecord*>(groupShape->Children[0]);
Shape* shape = static_cast<Shape*>(groupShape->Children[1]);
ShapeContainer* groupShape = static_cast<ShapeContainer*>(container->Children[0]);
GroupShapeRecord* gsr = static_cast<GroupShapeRecord*>(groupShape->Children[0]);
Shape* shape = static_cast<Shape*>(groupShape->Children[1]);
ChildAnchor* anchor = groupShape->FirstChildWithType<ChildAnchor>();
std::vector<OptionEntryPtr> options = groupShape->ExtractOptions();
ChildAnchor* anchor = groupShape->FirstChildWithType<ChildAnchor>();
std::vector<ODRAW::OfficeArtFOPTEPtr> options = groupShape->ExtractOptions();
m_shapeId = GetShapeID(shape);
@ -159,12 +147,12 @@ namespace DocFileFormat
// Write wrap coords
for (size_t i = 0; i < options.size(); i++)
{
switch (options[i]->pid)
switch (options[i]->opid)
{
case pWrapPolygonVertices:
{
std::wstring wrapCoords = GetWrapCoords(options[i]);
if (wrapCoords.length())
if (!wrapCoords.empty())
m_pXmlWriter->WriteAttribute(L"wrapcoords", wrapCoords);
}
break;
@ -229,9 +217,10 @@ namespace DocFileFormat
bool freeform = true;
std::wstring sShapeId;
std::vector<OptionEntryPtr> options = pContainer->ExtractOptions();
ChildAnchor* pAnchor = pContainer->FirstChildWithType<ChildAnchor>();
ClientAnchor* clientAnchor = pContainer->FirstChildWithType<ClientAnchor>();
std::vector<ODRAW::OfficeArtFOPTEPtr> options = pContainer->ExtractOptions();
ChildAnchor* pAnchor = pContainer->FirstChildWithType<ChildAnchor>();
ClientAnchor* clientAnchor = pContainer->FirstChildWithType<ClientAnchor>();
WriteBeginShapeNode (pShape);
@ -267,20 +256,20 @@ namespace DocFileFormat
}
}
EmuValue ShadowOffsetX;
EmuValue ShadowOffsetY;
EmuValue SecondShadowOffsetX;
EmuValue SecondShadowOffsetY;
EmuValue ViewPointX;
EmuValue ViewPointY;
EmuValue ViewPointZ;
boost::optional<EmuValue> ShadowOffsetX;
boost::optional<EmuValue> ShadowOffsetY;
boost::optional<EmuValue> SecondShadowOffsetX;
boost::optional<EmuValue> SecondShadowOffsetY;
boost::optional<EmuValue> ViewPointX;
boost::optional<EmuValue> ViewPointY;
boost::optional<EmuValue> ViewPointZ;
double viewPointOriginX = 0;
double viewPointOriginY = 0;
double ShadowOriginX = 0;
double ShadowOriginY = 0;
unsigned int xCoord = 0;
unsigned int yCoord = 0;
boost::optional<double> viewPointOriginX;
boost::optional<double> viewPointOriginY;
boost::optional<double> ShadowOriginX;
boost::optional<double> ShadowOriginY;
boost::optional<unsigned int> xCoord;
boost::optional<unsigned int> yCoord;
bool bStroked = true;
bool bFilled = true;
@ -301,36 +290,34 @@ namespace DocFileFormat
std::wstring sTextboxStyle;
OptionEntryPtr opSegmentInfo;
OptionEntryPtr opVerticles;
OptionEntryPtr opInscribe;
OptionEntryPtr opConnectAngles;
OptionEntryPtr opConnectLocs;
ThreeDStyleBooleanProperties threeDStyleProps_(0);
ODRAW::OfficeArtFOPTEPtr opSegmentInfo;
ODRAW::OfficeArtFOPTEPtr opVerticles;
ODRAW::OfficeArtFOPTEPtr opInscribe;
ODRAW::OfficeArtFOPTEPtr opConnectAngles;
ODRAW::OfficeArtFOPTEPtr opConnectLocs;
for (size_t i = 0; i < options.size(); i++)
{
OptionEntryPtr & iter = options[i];
switch (iter->pid)
ODRAW::OfficeArtFOPTEPtr & iter = options[i];
switch (iter->opid)
{
//BOOLEANS
case geometryBooleans:
{
GeometryBooleanProperties booleans(iter->op);
if (booleans.fUsefLineOK && !booleans.fLineOK)
ODRAW::GeometryBooleanProperties *booleans = dynamic_cast<ODRAW::GeometryBooleanProperties*>(iter.get());
if (booleans->fUsefLineOK && !booleans->fLineOK)
{
bStroked = false;
}
if (booleans.fUsefFillOK && !booleans.fFillOK)
if (booleans->fUsefFillOK && !booleans->fFillOK)
{
bFilled = false;
}
if (booleans.fUsef3DOK && booleans.f3DOK)
if (booleans->fUsef3DOK && booleans->f3DOK)
{
b3D = true;
}
if (booleans.fUsefShadowOK && booleans.fShadowOK)
if (booleans->fUsefShadowOK && booleans->fShadowOK)
{
bShadow = true;
}
@ -338,21 +325,21 @@ namespace DocFileFormat
break;
case fillStyleBooleanProperties:
{
FillStyleBooleanProperties booleans(iter->op);
if (booleans.fUsefFilled && !booleans.fFilled)
ODRAW::FillStyleBooleanProperties *booleans = dynamic_cast<ODRAW::FillStyleBooleanProperties *>(iter.get());
if (booleans->fUsefFilled && !booleans->fFilled)
{
bFilled = false;
}
if (booleans.fUsefUseShapeAnchor && booleans.fUseShapeAnchor)
if (booleans->fUsefUseShapeAnchor && booleans->fUseShapeAnchor)
{
appendValueAttribute(&m_fill, L"rotate", L"t");
}
}break;
case lineStyleBooleans:
{
LineStyleBooleanProperties booleans(iter->op);
if (booleans.fUsefLine && !booleans.fLine)
ODRAW::LineStyleBooleanProperties *booleans = dynamic_cast<ODRAW::LineStyleBooleanProperties *>(iter.get());
if (booleans->fUsefLine && !booleans->fLine)
{
bStroked = false;
}
@ -360,20 +347,19 @@ namespace DocFileFormat
break;
case protectionBooleans:
{
ProtectionBooleanProperties booleans(iter->op);
//ProtectionBooleanProperties booleans(iter->op);
}
break;
case diagramBooleans:
{
DiagramBooleanProperties booleans(iter->op);
}
break;
case groupShapeBooleans:
{
GroupShapeBooleanProperties booleans(iter->op);
if (booleans.fUsefLayoutInCell)
ODRAW::GroupShapeBooleanProperties *booleans = dynamic_cast<ODRAW::GroupShapeBooleanProperties *>(iter.get());
if (booleans->fUsefLayoutInCell)
{
layoutInCell = booleans.fLayoutInCell;
layoutInCell = booleans->fLayoutInCell;
}
}
break;
@ -541,8 +527,8 @@ namespace DocFileFormat
}break;
case fillAngle:
{
FixedPointNumber fllAngl( iter->op );
appendValueAttribute(&m_fill, L"angle", FormatUtils::DoubleToWideString( fllAngl.ToAngle() ));
ODRAW::FixedPoint* point = dynamic_cast<ODRAW::FixedPoint*>(iter.get());
if (point) appendValueAttribute(&m_fill, L"angle", FormatUtils::DoubleToWideString( point->dVal ));
}break;
case fillShadeType:
{
@ -550,7 +536,7 @@ namespace DocFileFormat
}break;
case fillShadeColors:
{
appendValueAttribute(&m_fill, L"colors", getFillColorString( iter->opComplex.get(), iter->op ));
appendValueAttribute(&m_fill, L"colors", getFillColorString( iter ));
}break;
case fillFocus:
{
@ -582,11 +568,11 @@ namespace DocFileFormat
}break;
case fillBlipName:
{
std::wstring name;
FormatUtils::GetSTLCollectionFromBytes<std::wstring>(&name, iter->opComplex.get(), iter->op, ENCODING_UTF16);
if (!name.empty())
appendValueAttribute(&m_fill, L"o:title", FormatUtils::XmlEncode(name));
ODRAW::anyString* str = dynamic_cast<ODRAW::anyString*>(iter.get());
if ((str) && (!str->string_.empty()))
{
appendValueAttribute(&m_fill, L"o:title", FormatUtils::XmlEncode(str->string_));
}
}break;
case fillOpacity:
{
@ -640,7 +626,7 @@ namespace DocFileFormat
}break;
case shadowStyleBooleanProperties:
{
ShadowStyleBooleanProperties props(iter->op);
//ODRAW::ShadowStyleBooleanProperties
}break;
// OLE
@ -664,21 +650,23 @@ namespace DocFileFormat
}break;
case pibName:
{
std::wstring name;
FormatUtils::GetSTLCollectionFromBytes<std::wstring>(&name, iter->opComplex.get(), iter->op, ENCODING_UTF16);
if (!name.empty())
appendValueAttribute(&m_imagedata, L"o:title", FormatUtils::XmlEncode(name));
ODRAW::anyString* str = dynamic_cast<ODRAW::anyString*>(iter.get());
if ((str) && (!str->string_.empty()))
{
appendValueAttribute(&m_imagedata, L"o:title", FormatUtils::XmlEncode(str->string_));
}
}break;
// 3D STYLE
case threeDStyleBooleanProperties:
{
threeDStyleProps_ = ThreeDStyleBooleanProperties(iter->op);
ODRAW::ThreeDStyleBooleanProperties* booleans = dynamic_cast<ODRAW::ThreeDStyleBooleanProperties*>(iter.get());
}break;
case threeDObjectBooleanProperties:
{
ThreeDObjectBooleanProperties booleans(iter->op);
ODRAW::ThreeDObjectBooleanProperties* booleans = dynamic_cast<ODRAW::ThreeDObjectBooleanProperties*>(iter.get());
if (booleans.fUsef3D && !booleans.f3D) b3D = false;
if (booleans->fUsef3D && !booleans->f3D)
b3D = false;
}break;
case c3DRenderMode:
{
@ -715,37 +703,34 @@ namespace DocFileFormat
appendValueAttribute(&m_3dstyle, L"color", color);
}break;
case c3DSkewAngle:
if (threeDStyleProps_.fUsefc3DParallel && threeDStyleProps_.fc3DParallel)
{
FixedPointNumber skewAngle( iter->op );
appendValueAttribute(&m_3dstyle, L"skewangle", FormatUtils::DoubleToWideString( skewAngle.ToAngle() ));
ODRAW::FixedPoint* point = dynamic_cast<ODRAW::FixedPoint*>(iter.get());
if (point) appendValueAttribute(&m_3dstyle, L"skewangle", FormatUtils::DoubleToWideString( point->dVal ));
}break;
case c3DXViewpoint:
if (threeDStyleProps_.fUsefc3DParallel && !threeDStyleProps_.fc3DParallel)
{
ViewPointX = EmuValue( FixedPointNumber( iter->op ).Integral );
}break;
ODRAW::FixedPoint* point = dynamic_cast<ODRAW::FixedPoint*>(iter.get());
if (point) ViewPointX = EmuValue( (int)point->dVal );
}break;
case c3DYViewpoint:
if (threeDStyleProps_.fUsefc3DParallel && !threeDStyleProps_.fc3DParallel)
{
ViewPointY = EmuValue( FixedPointNumber( iter->op ).Integral );
ODRAW::FixedPoint* point = dynamic_cast<ODRAW::FixedPoint*>(iter.get());
if (point) ViewPointY = EmuValue( (int)point->dVal );
}break;
case c3DZViewpoint:
if (threeDStyleProps_.fUsefc3DParallel && !threeDStyleProps_.fc3DParallel)
{
ViewPointZ = EmuValue( FixedPointNumber( iter->op ).Integral );
ODRAW::FixedPoint* point = dynamic_cast<ODRAW::FixedPoint*>(iter.get());
if (point) ViewPointZ = EmuValue( (int)point->dVal );
}break;
case c3DOriginX:
if (threeDStyleProps_.fUsefc3DParallel && !threeDStyleProps_.fc3DParallel)
{
FixedPointNumber dOriginX( iter->op );
viewPointOriginX = ( dOriginX.Integral / 65536.0 );
ODRAW::FixedPoint* point = dynamic_cast<ODRAW::FixedPoint*>(iter.get());
if (point) viewPointOriginX = point->dVal;
}break;
case c3DOriginY:
if (threeDStyleProps_.fUsefc3DParallel && !threeDStyleProps_.fc3DParallel)
{
FixedPointNumber dOriginY( iter->op );
viewPointOriginY = (dOriginY.Integral / 65536.0 );
ODRAW::FixedPoint* point = dynamic_cast<ODRAW::FixedPoint*>(iter.get());
if (point) viewPointOriginY = point->dVal;
}break;
// TEXTBOX
case lTxid:
@ -777,30 +762,35 @@ namespace DocFileFormat
// Word Art
case gtextUNICODE:
{
std::wstring text = NSStringExt::CConverter::GetUnicodeFromUTF16((unsigned short*)iter->opComplex.get(), (iter->op)/2);
text = FormatUtils::XmlEncode(text);
if (std::wstring::npos != text.find(L"\n"))
ODRAW::anyString* str = dynamic_cast<ODRAW::anyString*>(iter.get());
if ((str) && (!str->string_.empty()))
{
m_textpath.AppendText(text);
std::wstring text = FormatUtils::XmlEncode(str->string_);
if (std::wstring::npos != text.find(L"\n"))
{
m_textpath.AppendText(text);
}
text = ReplaceString(text, L"\n", L"&#xA;");
appendValueAttribute(&m_textpath, L"string", text);
}
text = ReplaceString(text, L"\n", L"&#xA;");
appendValueAttribute(&m_textpath, L"string", text);
}break;
case gtextFont:
{
std::wstring font = NSStringExt::CConverter::GetUnicodeFromUTF16((unsigned short*)iter->opComplex.get(), (iter->op)/2);
size_t i = font.size();
while (i > 0)
ODRAW::anyString* str = dynamic_cast<ODRAW::anyString*>(iter.get());
if ((str) && (!str->string_.empty()))
{
if (font[i-1] != 0) break;
i--;
}
if (i < font.size()) font.erase(font.begin() + i, font.end());
std::wstring font = str->string_;
size_t i = font.size();
while (i > 0)
{
if (font[i-1] != 0) break;
i--;
}
if (i < font.size()) font.erase(font.begin() + i, font.end());
font = std::wstring(L"\"") + font + std::wstring(L"\"");
appendStyleProperty(&m_textPathStyle, L"font-family", font);
font = std::wstring(L"\"") + font + std::wstring(L"\"");
appendStyleProperty(&m_textPathStyle, L"font-family", font);
}
}break;
case gtextSize:
{
@ -814,29 +804,29 @@ namespace DocFileFormat
}break;
case geometryTextBooleanProperties:
{
GeometryTextBooleanProperties props(iter->op);
if (props.fUsegtextFBestFit && props.gtextFBestFit)
ODRAW::GeometryTextBooleanProperties *props = dynamic_cast<ODRAW::GeometryTextBooleanProperties*>(iter.get());
if (props->fUsegFBestFit && props->fBestFit)
{
appendValueAttribute(&m_textpath, L"fitshape", L"t");
}
if (props.fUsegtextFShrinkFit && props.gtextFShrinkFit)
if (props->fUsegFShrinkFit && props->fShrinkFit)
{
appendValueAttribute(&m_textpath, L"trim", L"t");
}
if (props.fUsegtextFVertical && props.gtextFVertical)
if (props->fUsegFVertical && props->fVertical)
{
appendStyleProperty(&m_textPathStyle, L"v-rotate-letters", L"t");
//_twistDimension = true;
}
if (props.fUsegtextFKern && props.gtextFKern)
if (props->fUsegFKern && props->fKern)
{
appendStyleProperty(&m_textPathStyle, L"v-text-kern", L"t");
}
if (props.fUsegtextFItalic && props.gtextFItalic)
if (props->fUsegFItalic && props->fItalic)
{
appendStyleProperty(&m_textPathStyle, L"font-style", L"italic");
}
if (props.fUsegtextFBold && props.gtextFBold)
if (props->fUsegFBold && props->fBold)
{
appendStyleProperty(&m_textPathStyle, L"font-weight", L"bold");
}
@ -848,20 +838,17 @@ namespace DocFileFormat
}
}
if (opVerticles && opSegmentInfo)
{
const unsigned char* pVP = opVerticles->opComplex.get();
unsigned int nVP = opVerticles->op;
const unsigned char* pSI = opSegmentInfo->opComplex.get();
unsigned int nSI = opSegmentInfo->op;
PathParser oParser (pSI, nSI, pVP, nVP, m_arrGuides);
std::wstring path = oParser.GetVmlPath();
ODRAW::PVertices* pVP = dynamic_cast<ODRAW::PVertices*>(opVerticles.get());
ODRAW::PSegmentInfo* pSI = dynamic_cast<ODRAW::PSegmentInfo*>(opSegmentInfo.get());
if (pVP && pSI)
{
ODRAW::PathParser oParser (pSI->complex.data, pVP->complex.data, m_arrGuides);
std::wstring path = oParser.GetVmlPath();
if (false == path.empty())
m_pXmlWriter->WriteAttribute (L"path", path);
}
if (freeform && (xCoord == 0 || yCoord == 0 ))
if (freeform && (!xCoord || !yCoord ))
{
xCoord = 21600;
yCoord = 21600;
@ -881,9 +868,9 @@ namespace DocFileFormat
m_pXmlWriter->WriteAttribute(L"o:allowincell", L"f");
}
if ( xCoord > 0 && yCoord > 0 )
if ( xCoord && yCoord )
{
m_pXmlWriter->WriteAttribute( L"coordsize", ( FormatUtils::IntToWideString( xCoord ) + L"," + FormatUtils::IntToWideString( yCoord ) ));
m_pXmlWriter->WriteAttribute( L"coordsize", ( FormatUtils::IntToWideString( *xCoord ) + L"," + FormatUtils::IntToWideString( *yCoord ) ));
}
int nCode = 0;
@ -917,15 +904,15 @@ namespace DocFileFormat
//build shadow offsets
std::wstring offset;
if ( ShadowOffsetX != 0 )
if ( ShadowOffsetX)
{
offset += FormatUtils::DoubleToWideString( ShadowOffsetX.ToPoints() );
offset += FormatUtils::DoubleToWideString( ShadowOffsetX->ToPoints() );
offset += L"pt";
}
if ( ShadowOffsetY != 0 )
if ( ShadowOffsetY )
{
offset += L",";
offset += FormatUtils::DoubleToWideString( ShadowOffsetY.ToPoints() );
offset += FormatUtils::DoubleToWideString( ShadowOffsetY->ToPoints() );
offset += L"pt";
}
if ( !offset.empty() )
@ -935,16 +922,16 @@ namespace DocFileFormat
std::wstring offset2;
if ( SecondShadowOffsetX != 0 )
if ( SecondShadowOffsetX)
{
offset2 += FormatUtils::DoubleToWideString( SecondShadowOffsetX.ToPoints() );
offset2 += FormatUtils::DoubleToWideString( SecondShadowOffsetX->ToPoints() );
offset2 += L"pt";
}
if ( SecondShadowOffsetY != 0 )
if ( SecondShadowOffsetY)
{
offset2 += L",";
offset2 += FormatUtils::DoubleToWideString(SecondShadowOffsetY.ToPoints());
offset2 += FormatUtils::DoubleToWideString(SecondShadowOffsetY->ToPoints());
offset2 += L"pt";
}
@ -954,9 +941,9 @@ namespace DocFileFormat
}
//build shadow origin
if ( ( ShadowOriginX != 0 ) && ( ShadowOriginY != 0 ) )
if ( ShadowOriginX && ShadowOriginY)
{
appendValueAttribute(&m_shadow, L"origin", (FormatUtils::DoubleToWideString(shadowOriginX) + std::wstring(L"," ) + FormatUtils::DoubleToWideString(shadowOriginY)));
appendValueAttribute(&m_shadow, L"origin", FormatUtils::DoubleToWideString(*ShadowOriginX) + std::wstring(L"," ) + FormatUtils::DoubleToWideString(*ShadowOriginY));
}
// write shadow
@ -967,41 +954,41 @@ namespace DocFileFormat
}
//write the viewpoint
if ( ( ViewPointX != 0 ) || ( ViewPointY != 0 ) || ( ViewPointZ != 0 ) )
if ( ViewPointX || ViewPointY || ViewPointZ )
{
std::wstring viewPoint;
if ( ViewPointX != 0 )
if ( ViewPointX )
{
viewPoint += FormatUtils::IntToWideString( ViewPointX ) + L"pt";
viewPoint += FormatUtils::IntToWideString( *ViewPointX ) + L"pt";
}
viewPoint += L",";
if ( ViewPointY != 0 )
if ( ViewPointY)
{
viewPoint += FormatUtils::IntToWideString( ViewPointY ) + L"pt";
viewPoint += FormatUtils::IntToWideString( *ViewPointY ) + L"pt";
}
viewPoint += L",";
if ( ViewPointZ != 0 )
if ( ViewPointZ)
{
viewPoint += FormatUtils::IntToWideString( ViewPointZ ) + L"pt";
viewPoint += FormatUtils::IntToWideString( *ViewPointZ ) + L"pt";
}
appendValueAttribute(&m_3dstyle, L"viewpoint", viewPoint);
}
// write the viewpointorigin
if ( ( viewPointOriginX != 0 ) || ( viewPointOriginY != 0 ) )
if ( viewPointOriginX || viewPointOriginY)
{
std::wstring viewPointOrigin;
if ( viewPointOriginX != 0 )
if ( viewPointOriginX )
{
viewPointOrigin += FormatUtils::DoubleToFormattedWideString( viewPointOriginX, L"%.2f" );
viewPointOrigin += FormatUtils::DoubleToFormattedWideString( *viewPointOriginX, L"%.2f" );
}
if ( viewPointOriginY != 0 )
if ( viewPointOriginY )
{
viewPointOrigin += L",";
viewPointOrigin += FormatUtils::DoubleToFormattedWideString( viewPointOriginY, L"%.2f" );
viewPointOrigin += FormatUtils::DoubleToFormattedWideString( *viewPointOriginY, L"%.2f" );
}
appendValueAttribute(&m_3dstyle, L"viewpointorigin", viewPointOrigin);
@ -1272,37 +1259,23 @@ namespace DocFileFormat
}
/// Build the VML wrapcoords string for a given pWrapPolygonVertices
std::wstring VMLShapeMapping::GetWrapCoords(const OptionEntryPtr& pWrapPolygonVertices) const
std::wstring VMLShapeMapping::GetWrapCoords(const ODRAW::OfficeArtFOPTEPtr& pOpt) const
{
ODRAW::pWrapPolygonVertices* pWrapPolygonVertices = dynamic_cast<ODRAW::pWrapPolygonVertices*>(pOpt.get());
if (!pWrapPolygonVertices) return L"";
std::wstring coords;
MemoryStream oStream(pWrapPolygonVertices->opComplex.get(), pWrapPolygonVertices->op);
std::list<int> arrVertices;
unsigned short nElems = oStream.ReadUInt16();
unsigned short nElemsAlloc = oStream.ReadUInt16();
unsigned short cbElem = oStream.ReadUInt16();
if ( ( nElems > 0 ) && ( cbElem > 0 ) && ( nElems <= nElemsAlloc ) )
for (size_t i = 0; i < pWrapPolygonVertices->complex.data.size(); ++i)
{
//!!!TODO: read the Int32 coordinates!!!
while (oStream.GetPosition() < oStream.GetSize())
{
arrVertices.push_back(oStream.ReadInt32());
}
std::list<int>::const_iterator end = arrVertices.end();
for (std::list<int>::const_iterator iter = arrVertices.begin(); iter != end; ++iter)
{
coords += FormatUtils::IntToWideString(*iter);
coords += L",";
}
coords.erase(coords.size() - 1);
coords += FormatUtils::IntToWideString(pWrapPolygonVertices->complex.data[i++].x);
coords += L",";
coords += FormatUtils::IntToWideString(pWrapPolygonVertices->complex.data[i].y);
coords += L",";
}
coords.erase(coords.size() - 1);
return coords;
}
@ -1594,7 +1567,7 @@ namespace DocFileFormat
}
}
void VMLShapeMapping::AppendOptionsToStyle (std::wstring* oStyle, const std::vector<OptionEntryPtr>& options, int zIndex) const
void VMLShapeMapping::AppendOptionsToStyle (std::wstring* oStyle, const std::vector<ODRAW::OfficeArtFOPTEPtr>& options, int zIndex) const
{
bool bRelH = false;
bool bRelV = false;
@ -1606,8 +1579,8 @@ namespace DocFileFormat
for (size_t i = 0; i < options.size(); i++)
{
const OptionEntryPtr & iter = options[i];
switch (iter->pid)
const ODRAW::OfficeArtFOPTEPtr & iter = options[i];
switch (iter->opid)
{
// POSITIONING
case posh:
@ -1633,9 +1606,9 @@ namespace DocFileFormat
// BOOLEANS
case groupShapeBooleans:
{
GroupShapeBooleanProperties groupShapeBooleans(iter->op);
ODRAW::GroupShapeBooleanProperties* booleans = dynamic_cast<ODRAW::GroupShapeBooleanProperties*>(iter.get());
if (groupShapeBooleans.fUsefBehindDocument && groupShapeBooleans.fBehindDocument && !bZIndex)
if (booleans->fUsefBehindDocument && booleans->fBehindDocument && !bZIndex)
{
//The shape is behind the text, so the z-index must be negative.
appendStyleProperty(oStyle, L"z-index", L"-1" );
@ -1647,7 +1620,7 @@ namespace DocFileFormat
bZIndex = true;
}
if (groupShapeBooleans.fHidden && groupShapeBooleans.fUsefHidden)
if (booleans->fHidden && booleans->fUsefHidden)
{
appendStyleProperty(oStyle, L"visibility", L"hidden" );
}
@ -1714,7 +1687,7 @@ namespace DocFileFormat
}
//
std::wstring VMLShapeMapping::buildStyle (const Shape* shape, const ChildAnchor* anchor, const std::vector<OptionEntryPtr>& options, int zIndex) const
std::wstring VMLShapeMapping::buildStyle (const Shape* shape, const ChildAnchor* anchor, const std::vector<ODRAW::OfficeArtFOPTEPtr>& options, int zIndex) const
{
std::wstring style;
@ -1722,19 +1695,19 @@ namespace DocFileFormat
for (size_t i = 0; i < options.size(); i++)
{
const OptionEntryPtr & iter = options[i];
const ODRAW::OfficeArtFOPTEPtr & iter = options[i];
if (geometryTextBooleanProperties == iter->pid)
if (geometryTextBooleanProperties == iter->opid)
{
GeometryTextBooleanProperties props(iter->op);
ODRAW::GeometryTextBooleanProperties* booleans = dynamic_cast<ODRAW::GeometryTextBooleanProperties*>(iter.get());
if (props.fUsegtextFVertical && props.gtextFVertical)
if (booleans->fUsegFVertical && booleans->fVertical)
{
twistDimensions = true;
}
}
if (PropertyId_rotation == iter->pid)
else if (PropertyId_rotation == iter->opid)
{
double dAngle = (double)((int)iter->op) / 65535.0;
@ -1867,29 +1840,18 @@ namespace DocFileFormat
}
}
std::wstring VMLShapeMapping::getFillColorString(const unsigned char* p, unsigned int size) const
std::wstring VMLShapeMapping::getFillColorString(const ODRAW::OfficeArtFOPTEPtr& pOpt) const
{
ODRAW::fillShadeColors* pColors = dynamic_cast<ODRAW::fillShadeColors*>(pOpt.get());
if (!pColors) return L"";
std::wstring result;
if ( ( p != NULL ) && ( size > 0 ) )
for (size_t i = 0; i < pColors->complex.data.size(); ++i)
{
// parse the IMsoArray
unsigned short nElems = FormatUtils::BytesToUInt16(p, 0, size);
unsigned short nElemsAlloc = FormatUtils::BytesToUInt16(p, 2, size);
unsigned short cb = FormatUtils::BytesToUInt16(p, 4, size);
for ( unsigned short i = 0; i < nElems; i++ )
{
int pos = ( 6 + ( i * cb ) );
RGBColor color(FormatUtils::BytesToInt32(p, pos, size ), RedFirst);
int colorPos = FormatUtils::BytesToInt32(p, ( pos + 4 ), size);
result += FormatUtils::IntToWideString(colorPos);
result += L"f #";
result += color.SixDigitHexCode;
result += L";";
}
result += FormatUtils::IntToWideString((int)pColors->complex.data[i].dPosition);
result += L"f #";
result += pColors->complex.data[i].color.sColorRGB;
result += L";";
}
return result;
@ -1959,41 +1921,15 @@ namespace DocFileFormat
return wrapType;
}
std::wstring VMLShapeMapping::GetConnectAngles(const OptionEntryPtr& opAngles) const
std::wstring VMLShapeMapping::GetConnectAngles(const ODRAW::OfficeArtFOPTEPtr& pOpt) const
{
if (!opAngles) return L"";
if (!opAngles->opComplex) return L"";
ODRAW::pConnectionSitesDir* pAngles = dynamic_cast<ODRAW::pConnectionSitesDir*>(pOpt.get());
if (!pAngles) return L"";
MemoryStream reader(opAngles->opComplex.get(), opAngles->op);
unsigned short nElems = reader.ReadUInt16();
unsigned short nElemsAlloc = reader.ReadUInt16();
unsigned short nElemSize = reader.ReadUInt16();
bool bTruncated = false;
if (0xFFF0 == nElemSize)
{
nElemSize = 4;
bTruncated = true;
}
long dwSize = nElems * nElemSize;
if (opAngles->op - 6 != (dwSize))
{
bool b = false;
}
if (nElemSize < 1) return L"";
int count = dwSize / nElemSize;
std::wstring angles;
for (int i = 0; i < count; ++i)
for (size_t i = 0; i < pAngles->complex.data.size(); ++i)
{
DWORD v = reader.ReadUInt32();
double val = (double)((WORD)(v >> 16) + ((WORD)(v) / 65536.0));
angles += std::to_wstring((int)val) + (i < (count - 1) ? L"," : L"");
angles += std::to_wstring((int)pAngles->complex.data[i].dVal) + (i < (pAngles->complex.data.size() - 1) ? L"," : L"");
}
return angles;
}
@ -2007,180 +1943,74 @@ namespace DocFileFormat
if (index >= 0 && index < (int)m_arrGuides.size())
{
new_val = m_arrGuides[index].param3;
new_val = m_arrGuides[index].m_param_value3;
}
}
return new_val;
}
void VMLShapeMapping::GetGuides( const OptionEntryPtr& opGuides )
void VMLShapeMapping::GetGuides( const ODRAW::OfficeArtFOPTEPtr& pOpt )
{
if (!opGuides) return;
if (!opGuides->opComplex) return;
MemoryStream reader(opGuides->opComplex.get(), opGuides->op);
ODRAW::pGuides* pGuides = dynamic_cast<ODRAW::pGuides*>(pOpt.get());
if (!pGuides) return;
unsigned short nElems = reader.ReadUInt16();
unsigned short nElemsAlloc = reader.ReadUInt16();
unsigned short nElemSize = reader.ReadUInt16();
m_arrGuides = pGuides->complex.data;
//for (size_t i = 0; i < pGuides->complex.data.size(); ++i)
//{
// _guides g;
bool bTruncated = false;
// g.type = pGuides->complex.data[i].type;
if (0xFFF0 == nElemSize)
{
nElemSize = 4;
bTruncated = true;
}
if (nElemSize == 0)
{
nElemSize = 2; //enredobar.doc
}
long dwSize = nElems * nElemSize;
// g.param_type1 = pGuides->complex.data[i].param_type1;
// g.param_type2 = pGuides->complex.data[i].param_type2;
// g.param_type3 = pGuides->complex.data[i].param_type3;
if (opGuides->op - 6 != (dwSize))
{
bool b = false;
if (nElems > 0x7fff)
{
dwSize = (opGuides->op - 6);
}
}
int count = dwSize / nElemSize; //1x (int or short)
for (int i = 0; i < count; ++i)
{
_guides g;
WORD flags = reader.ReadUInt16();
// g.param1 = pGuides->complex.data[i].param1;
// g.param2 = pGuides->complex.data[i].param2;
// g.param3 = pGuides->complex.data[i].param3;
g.type = flags & 0x1FFF;
g.param_type1 = (unsigned char)(flags & 0x04);
g.param_type2 = (unsigned char)(flags & 0x02);
g.param_type3 = (unsigned char)(flags & 0x01);
g.param1 = reader.ReadUInt16();
g.param2 = reader.ReadUInt16();
g.param3 = reader.ReadUInt16();
m_arrGuides.push_back(g);
}
// m_arrGuides.push_back(g);
//}
}
std::wstring VMLShapeMapping::GetConnectLocs( const OptionEntryPtr& opLocs ) const
std::wstring VMLShapeMapping::GetConnectLocs( const ODRAW::OfficeArtFOPTEPtr& pOpt ) const
{
if (!opLocs) return L"";
if (!opLocs->opComplex) return L"";
ODRAW::pConnectionSites* pConnection = dynamic_cast<ODRAW::pConnectionSites*>(pOpt.get());
if (!pConnection) return L"";
MemoryStream reader(opLocs->opComplex.get(), opLocs->op);
unsigned short nElems = reader.ReadUInt16();
unsigned short nElemsAlloc = reader.ReadUInt16();
unsigned short nElemSize = reader.ReadUInt16();
bool bTruncated = false;
if (0xFFF0 == nElemSize)
{
nElemSize = 4;
bTruncated = true;
}
if (nElemSize == 0)
{
nElemSize = 2; //enredobar.doc
}
long dwSize = nElems * nElemSize;
if (opLocs->op - 6 != (dwSize))
{
bool b = false;
if (nElems > 0x7fff)
{
dwSize = (opLocs->op - 6);
}
}
int count = dwSize / nElemSize; //2x (int or short)
std::wstring locs;
for (int i = 0; i < count; ++i)
for (size_t i = 0; i < pConnection->complex.data.size(); ++i)
{
POINT pt;
if (bTruncated)
{
pt.x = reader.ReadInt16();
pt.y = reader.ReadInt16();
}
else
{
pt.x = reader.ReadInt32();
pt.y = reader.ReadInt32();
}
pt.x = UpdateFromGuides(pt.x);
pt.y = UpdateFromGuides(pt.y);
pt.x = UpdateFromGuides(pConnection->complex.data[i].x);
pt.y = UpdateFromGuides(pConnection->complex.data[i].y);
locs += std::to_wstring(pt.x) + L"," + std::to_wstring(pt.y) + (i < (count - 1) ? L";" : L"");
locs += std::to_wstring(pt.x) + L"," + std::to_wstring(pt.y) + (i < (pConnection->complex.data.size() - 1) ? L";" : L"");
}
return locs;
}
std::vector<std::wstring> VMLShapeMapping::GetTextRectangles( const OptionEntryPtr& opInscribe ) const
std::vector<std::wstring> VMLShapeMapping::GetTextRectangles( const ODRAW::OfficeArtFOPTEPtr& pOpt ) const
{
std::vector<std::wstring> rectangles;
if (!opInscribe) return rectangles;
if (!opInscribe->opComplex) return rectangles;
MemoryStream reader(opInscribe->opComplex.get(), opInscribe->op);
unsigned short nElems = reader.ReadUInt16();
unsigned short nElemsAlloc = reader.ReadUInt16();
unsigned short nElemSize = reader.ReadUInt16();
bool bTruncated = false;
if (0xFFF0 == nElemSize)
{
nElemSize = 4;
bTruncated = true;
}
else nElemSize = 2;
long dwSize = nElems * nElemSize;
if (opInscribe->op - 6 != (dwSize))
{
bool b = false;
}
int count = dwSize / nElemSize; //4x (int or short)
ODRAW::pInscribe* pInscribe = dynamic_cast<ODRAW::pInscribe*>(pOpt.get());
if (!pInscribe) return rectangles;
for (int i = 0; i < count; ++i)
for (size_t i = 0; i < pInscribe->complex.data.size(); ++i)
{
RECT rc;
if (bTruncated)
{
rc.top = reader.ReadInt16();
rc.left = reader.ReadInt16();
rc.right = reader.ReadInt16();
rc.bottom = reader.ReadInt16();
}
else
{
rc.top = reader.ReadInt32();
rc.left = reader.ReadInt32();
rc.right = reader.ReadInt32();
rc.bottom = reader.ReadInt32();
}
rc.top = UpdateFromGuides(rc.top);
rc.left = UpdateFromGuides(rc.left);
rc.right = UpdateFromGuides(rc.right);
rc.bottom = UpdateFromGuides(rc.bottom);
rc.top = UpdateFromGuides(pInscribe->complex.data[i].t);
rc.left = UpdateFromGuides(pInscribe->complex.data[i].l);
rc.right = UpdateFromGuides(pInscribe->complex.data[i].r);
rc.bottom = UpdateFromGuides(pInscribe->complex.data[i].b);
rectangles.push_back( std::to_wstring(rc.top) + L"," + std::to_wstring(rc.left) + L"," +
std::to_wstring(rc.right) + L"," + std::to_wstring(rc.bottom));
}
return rectangles;
}
//------------------------------------------------------------------------------------------------------

View File

@ -48,7 +48,6 @@
#include "OfficeDrawing/ChildAnchor.h"
#include "OfficeDrawing/ClientAnchor.h"
#include "OfficeDrawing/Shapetypes/LineType.h"
#include "OfficeDrawing/PathParser.h"
#include "OfficeDrawing/MetafilePictBlip.h"
#include "OfficeDrawing/BitmapBlip.h"
@ -90,8 +89,8 @@ namespace DocFileFormat
std::wstring getTextboxAnchor( unsigned int anchor ) const;
std::wstring buildStyle ( const Shape* shape, const ChildAnchor* anchor, const std::vector<OptionEntryPtr>& options, int zIndex ) const;
void AppendOptionsToStyle ( std::wstring* style, const std::vector<OptionEntryPtr>& options, int zIndex ) const;
std::wstring buildStyle ( const Shape* shape, const ChildAnchor* anchor, const std::vector<ODRAW::OfficeArtFOPTEPtr>& options, int zIndex ) const;
void AppendOptionsToStyle ( std::wstring* style, const std::vector<ODRAW::OfficeArtFOPTEPtr>& options, int zIndex ) const;
int UpdateFromGuides(const int val) const;
@ -100,7 +99,7 @@ namespace DocFileFormat
std::wstring getArrowLength ( unsigned int op ) const;
std::wstring getArrowWidth ( unsigned int op ) const;
std::wstring getFillMethod ( unsigned int p ) const;
std::wstring getFillColorString( const unsigned char* p, unsigned int size ) const;
std::wstring getFillColorString( const ODRAW::OfficeArtFOPTEPtr& pOpt ) const;
std::wstring getFillType ( unsigned int p ) const;
std::wstring getShadowType ( unsigned int p ) const;
@ -114,14 +113,14 @@ namespace DocFileFormat
std::wstring GetLineFrom (const ChildAnchor* pAnchor) const;
std::wstring GetLineTo (const ChildAnchor* pAnchor) const;
std::wstring GetWrapCoords ( const OptionEntryPtr& pOpt ) const;
std::vector<std::wstring> GetTextRectangles ( const OptionEntryPtr& pOpt ) const;
std::wstring GetConnectAngles ( const OptionEntryPtr& pOpt ) const;
std::wstring GetConnectLocs ( const OptionEntryPtr& pOpt ) const;
void GetGuides ( const OptionEntryPtr& pOpt );
std::wstring GetWrapCoords ( const ODRAW::OfficeArtFOPTEPtr& pOpt ) const;
std::vector<std::wstring> GetTextRectangles ( const ODRAW::OfficeArtFOPTEPtr& pOpt ) const;
std::wstring GetConnectAngles ( const ODRAW::OfficeArtFOPTEPtr& pOpt ) const;
std::wstring GetConnectLocs ( const ODRAW::OfficeArtFOPTEPtr& pOpt ) const;
void GetGuides ( const ODRAW::OfficeArtFOPTEPtr& pOpt );
int m_nAdjValues[8];
std::vector<_guides> m_arrGuides;
std::vector<ODRAW::MSOSG> m_arrGuides;
bool m_isInlineShape;
Spa* m_pSpa;

View File

@ -33,6 +33,7 @@
#include "VMLShapeTypeMapping.h"
#include "OfficeDrawing/Shapetypes/OvalType.h"
#include "OfficeDrawing/Shapetypes/WordArtText.h"
#include "../../ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/ODRAW/OfficeArtFOPTE.h"
namespace DocFileFormat
{
@ -170,8 +171,9 @@ namespace DocFileFormat
m_pXmlWriter->WriteNodeEnd( L"", true );
//Lock
if ( ( pShape->Lock.fUsefLockAspectRatio ) && ( pShape->Lock.fLockAspectRatio ) )
//Lock ???
ODRAW::ProtectionBooleanProperties *prot = dynamic_cast<ODRAW::ProtectionBooleanProperties*>(pShape->Lock.get());
if ((prot) && (prot->fUsefLockAspectRatio && prot->fLockAspectRatio))
{
appendValueAttribute( _lock, L"aspectratio", L"t" );
}

View File

@ -208,28 +208,19 @@ HEADERS += \
../../DocDocxConverter/OfficeDrawing/ChildAnchor.h \
../../DocDocxConverter/OfficeDrawing/ClientAnchor.h \
../../DocDocxConverter/OfficeDrawing/ClientData.h \
../../DocDocxConverter/OfficeDrawing/DiagramBooleanProperties.h \
../../DocDocxConverter/OfficeDrawing/DrawingContainer.h \
../../DocDocxConverter/OfficeDrawing/DrawingGroup.h \
../../DocDocxConverter/OfficeDrawing/DrawingGroupRecord.h \
../../DocDocxConverter/OfficeDrawing/DrawingRecord.h \
../../DocDocxConverter/OfficeDrawing/FillStyleBooleanProperties.h \
../../DocDocxConverter/OfficeDrawing/GeometryBooleanProperties.h \
../../DocDocxConverter/OfficeDrawing/GeometryTextBooleanProperties.h \
../../DocDocxConverter/OfficeDrawing/GroupContainer.h \
../../DocDocxConverter/OfficeDrawing/GroupShapeBooleanProperties.h \
../../DocDocxConverter/OfficeDrawing/GroupShapeRecord.h \
../../DocDocxConverter/OfficeDrawing/LineStyleBooleanProperties.h \
../../DocDocxConverter/OfficeDrawing/MetafilePictBlip.h \
../../DocDocxConverter/OfficeDrawing/OfficeArtClientTextbox.h \
../../DocDocxConverter/OfficeDrawing/PathParser.h \
../../DocDocxConverter/OfficeDrawing/PathSegment.h \
../../DocDocxConverter/OfficeDrawing/ProtectionBooleanProperties.h \
../../DocDocxConverter/OfficeDrawing/Record.h \
../../DocDocxConverter/OfficeDrawing/RecordFactory.h \
../../DocDocxConverter/OfficeDrawing/RegularContainer.h \
../../DocDocxConverter/OfficeDrawing/ShadowStyleBooleanProperties.h \
../../DocDocxConverter/OfficeDrawing/threeDBooleanProperties.h \
../../DocDocxConverter/OfficeDrawing/Shape.h \
../../DocDocxConverter/OfficeDrawing/ShapeContainer.h \
../../DocDocxConverter/OfficeDrawing/ShapeOptions.h \

View File

@ -775,10 +775,6 @@
RelativePath="..\..\DocDocxConverter\OfficeDrawing\ClientData.h"
>
</File>
<File
RelativePath="..\..\DocDocxConverter\OfficeDrawing\DiagramBooleanProperties.h"
>
</File>
<File
RelativePath="..\..\DocDocxConverter\OfficeDrawing\DrawingContainer.h"
>
@ -795,34 +791,14 @@
RelativePath="..\..\DocDocxConverter\OfficeDrawing\DrawingRecord.h"
>
</File>
<File
RelativePath="..\..\DocDocxConverter\OfficeDrawing\FillStyleBooleanProperties.h"
>
</File>
<File
RelativePath="..\..\DocDocxConverter\OfficeDrawing\GeometryBooleanProperties.h"
>
</File>
<File
RelativePath="..\..\DocDocxConverter\OfficeDrawing\GeometryTextBooleanProperties.h"
>
</File>
<File
RelativePath="..\..\DocDocxConverter\OfficeDrawing\GroupContainer.h"
>
</File>
<File
RelativePath="..\..\DocDocxConverter\OfficeDrawing\GroupShapeBooleanProperties.h"
>
</File>
<File
RelativePath="..\..\DocDocxConverter\OfficeDrawing\GroupShapeRecord.h"
>
</File>
<File
RelativePath="..\..\DocDocxConverter\OfficeDrawing\LineStyleBooleanProperties.h"
>
</File>
<File
RelativePath="..\..\DocDocxConverter\OfficeDrawing\MetafilePictBlip.h"
>
@ -831,18 +807,6 @@
RelativePath="..\..\DocDocxConverter\OfficeDrawing\OfficeArtClientTextbox.h"
>
</File>
<File
RelativePath="..\..\DocDocxConverter\OfficeDrawing\PathParser.h"
>
</File>
<File
RelativePath="..\..\DocDocxConverter\OfficeDrawing\PathSegment.h"
>
</File>
<File
RelativePath="..\..\DocDocxConverter\OfficeDrawing\ProtectionBooleanProperties.h"
>
</File>
<File
RelativePath="..\..\DocDocxConverter\OfficeDrawing\Record.cpp"
>
@ -863,10 +827,6 @@
RelativePath="..\..\DocDocxConverter\OfficeDrawing\RegularContainer.h"
>
</File>
<File
RelativePath="..\..\DocDocxConverter\OfficeDrawing\ShadowStyleBooleanProperties.h"
>
</File>
<File
RelativePath="..\..\DocDocxConverter\OfficeDrawing\Shape.h"
>

View File

@ -4266,10 +4266,10 @@ namespace BinDocxRW
if ( pSSub->m_oSSubPr.IsInit() )
WriteMathSSubPr(pSSub->m_oSSubPr.get());
if ( pSSub->m_oSub.IsInit() )
WriteMathSub(pSSub->m_oSub.get());
if ( pSSub->m_oElement.IsInit() )
WriteMathElement(pSSub->m_oElement.get());
if ( pSSub->m_oSub.IsInit() )
WriteMathSub(pSSub->m_oSub.get());
m_oBcw.WriteItemEnd(nCurPos);
break;
@ -4281,12 +4281,12 @@ namespace BinDocxRW
if ( pSSubSup->m_oSSubSupPr.IsInit() )
WriteMathSSubSupPr(pSSubSup->m_oSSubSupPr.get());
if ( pSSubSup->m_oElement.IsInit() )
WriteMathElement(pSSubSup->m_oElement.get());
if ( pSSubSup->m_oSub.IsInit() )
WriteMathSub(pSSubSup->m_oSub.get());
if ( pSSubSup->m_oSup.IsInit() )
WriteMathSup(pSSubSup->m_oSup.get());
if ( pSSubSup->m_oElement.IsInit() )
WriteMathElement(pSSubSup->m_oElement.get());
m_oBcw.WriteItemEnd(nCurPos);
break;

View File

@ -260,8 +260,7 @@ namespace BinXlsxRW{
{
OOX::Spreadsheet::CTableFile* pTable = new OOX::Spreadsheet::CTableFile(NULL);
pTable->m_oTable.Init();
pTable->m_oTable->m_oDisplayName.Init();
pTable->m_oTable->m_oDisplayName->append(L"Table1");
pTable->m_oTable->m_oDisplayName = L"Table1";
pTable->m_oTable->m_oRef.Init();
pTable->m_oTable->m_oRef->SetValue(OOX::Spreadsheet::CCell::combineRef(m_nRow1 - 1, m_nCol1 - 1) + L":" + OOX::Spreadsheet::CCell::combineRef(m_nRow2 - 1, m_nCol2 - 1));
pTable->m_oTable->m_oTotalsRowCount.Init();

View File

@ -42,11 +42,11 @@ namespace odf_reader {
const wchar_t * abstract_xml::ns = L"";
const wchar_t * abstract_xml::name = L"abstract-xml";
std::wostream & abstract_xml::text_to_stream(std::wostream & _Wostream) const
std::wostream & abstract_xml::text_to_stream(std::wostream & _Wostream, bool bXmlEncode) const
{
for (size_t i = 0; i < xml_content_.size(); i++)
{
xml_content_[i]->text_to_stream(_Wostream);
xml_content_[i]->text_to_stream(_Wostream, bXmlEncode);
}
return _Wostream;
}

View File

@ -47,7 +47,7 @@ public:
CPDOCCORE_DEFINE_VISITABLE();
public:
virtual std::wostream & text_to_stream(std::wostream & _Wostream) const;
virtual std::wostream & text_to_stream(std::wostream & _Wostream, bool bXmlEncode = true) const;
virtual std::wostream & xml_to_stream(std::wostream & _Wostream) const;
public:

View File

@ -34,6 +34,8 @@
#include "serialize_elements.h"
#include <odf/odf_document.h>
#include <xml/utils.h>
#include "../formulasconvert/formulasconvert.h"
#include "style_graphic_properties.h"
@ -735,7 +737,7 @@ void process_build_object::visit(chart_title& val)
if (val.text_p_)
{
std::wstringstream v;
val.text_p_->text_to_stream(v);
val.text_p_->text_to_stream(v, false);
t.content_ = v.str();
}
ApplyTextProperties(val.attlist_.common_attlist_.chart_style_name_.get_value_or(L""), t.text_properties_);
@ -762,7 +764,7 @@ void process_build_object::visit(chart_subtitle & val)
{
title t;
std::wstringstream v;
val.text_p_->text_to_stream(v);
val.text_p_->text_to_stream(v, false);
t.content_ = v.str();
if (val.attlist_.common_draw_position_attlist_.svg_x_)
@ -1036,7 +1038,8 @@ void process_build_object::visit(table_table_cell& val)
for (size_t i = 0 ; i < val.content_.elements_.size(); i++)
{
std::wstringstream wstream_temp;
val.content_.elements_[i]->text_to_stream(wstream_temp);
val.content_.elements_[i]->text_to_stream(wstream_temp, false);
if (val.content_.elements_[i]->get_type() == typeTextP)
{
cell_cash += wstream_temp.str();

View File

@ -106,7 +106,7 @@ void draw_image::add_child_element( xml::sax * Reader, const std::wstring & Ns,
//CP_NOT_APPLICABLE_ELM();
}
}
std::wostream & draw_image::text_to_stream(std::wostream & _Wostream) const
std::wostream & draw_image::text_to_stream(std::wostream & _Wostream, bool bXmlEncode) const
{
return _Wostream;
}
@ -115,7 +115,7 @@ std::wostream & draw_image::text_to_stream(std::wostream & _Wostream) const
const wchar_t * draw_chart::ns = L"draw";
const wchar_t * draw_chart::name = L"chart";
std::wostream & draw_chart::text_to_stream(std::wostream & _Wostream) const
std::wostream & draw_chart::text_to_stream(std::wostream & _Wostream, bool bXmlEncode) const
{
return _Wostream;
}
@ -225,9 +225,9 @@ void draw_g::add_child_element( xml::sax * Reader, const std::wstring & Ns, cons
}
}
std::wostream & draw_g::text_to_stream(std::wostream & _Wostream) const
std::wostream & draw_g::text_to_stream(std::wostream & _Wostream, bool bXmlEncode) const
{
CP_SERIALIZE_TEXT(content_);
CP_SERIALIZE_TEXT(content_, bXmlEncode);
return _Wostream;
}
@ -236,9 +236,9 @@ std::wostream & draw_g::text_to_stream(std::wostream & _Wostream) const
const wchar_t * draw_frame::ns = L"draw";
const wchar_t * draw_frame::name = L"frame";
std::wostream & draw_frame::text_to_stream(std::wostream & _Wostream) const
std::wostream & draw_frame::text_to_stream(std::wostream & _Wostream, bool bXmlEncode) const
{
CP_SERIALIZE_TEXT(content_);
CP_SERIALIZE_TEXT(content_, bXmlEncode);
return _Wostream;
}
@ -308,9 +308,9 @@ void draw_text_box_attlist::add_attributes( const xml::attributes_wc_ptr & Attri
const wchar_t * draw_text_box::ns = L"draw";
const wchar_t * draw_text_box::name = L"text-box";
std::wostream & draw_text_box::text_to_stream(std::wostream & _Wostream) const
std::wostream & draw_text_box::text_to_stream(std::wostream & _Wostream, bool bXmlEncode) const
{
CP_SERIALIZE_TEXT(content_);
CP_SERIALIZE_TEXT(content_, bXmlEncode);
return _Wostream;
}

View File

@ -70,7 +70,7 @@ public:
static const ElementType type = typeDrawImage;
CPDOCCORE_DEFINE_VISITABLE();
virtual std::wostream & text_to_stream(std::wostream & _Wostream) const;
virtual std::wostream & text_to_stream(std::wostream & _Wostream, bool bXmlEncode = true) const;
virtual void docx_convert(oox::docx_conversion_context & Context);
virtual void xlsx_convert(oox::xlsx_conversion_context & Context);
@ -114,7 +114,7 @@ public:
virtual void pptx_convert(oox::pptx_conversion_context & Context);
public:
virtual std::wostream & text_to_stream(std::wostream & _Wostream) const;
virtual std::wostream & text_to_stream(std::wostream & _Wostream, bool bXmlEncode = true) const;
private:
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
virtual void add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name);
@ -160,7 +160,7 @@ public:
virtual void pptx_convert(oox::pptx_conversion_context & Context);
virtual void pptx_convert_placeHolder(oox::pptx_conversion_context & Context);
virtual std::wostream & text_to_stream(std::wostream & _Wostream) const;
virtual std::wostream & text_to_stream(std::wostream & _Wostream, bool bXmlEncode = true) const;
int idx_in_owner ;
@ -211,7 +211,7 @@ public:
draw_g() : position_child_x1(0x7fffffff), position_child_y1(0x7fffffff), position_child_x2(0x7fffffff), position_child_y2(0x7fffffff) {}
virtual std::wostream & text_to_stream(std::wostream & _Wostream) const;
virtual std::wostream & text_to_stream(std::wostream & _Wostream, bool bXmlEncode = true) const;
virtual void docx_convert(oox::docx_conversion_context & Context);
virtual void xlsx_convert(oox::xlsx_conversion_context & Context);
@ -263,7 +263,7 @@ public:
virtual void xlsx_convert(oox::xlsx_conversion_context & Context);
virtual void pptx_convert(oox::pptx_conversion_context & Context);
virtual std::wostream & text_to_stream(std::wostream & _Wostream) const;
virtual std::wostream & text_to_stream(std::wostream & _Wostream, bool bXmlEncode = true) const;
draw_text_box_attlist draw_text_box_attlist_;
office_element_ptr_array content_;

View File

@ -44,7 +44,7 @@ namespace odf_reader {
const wchar_t * svg_desc::ns = L"svg";
const wchar_t * svg_desc::name = L"desc";
std::wostream & svg_desc::text_to_stream(std::wostream & _Wostream) const
std::wostream & svg_desc::text_to_stream(std::wostream & _Wostream, bool bXmlEncode) const
{
_Wostream << text_ ;
return _Wostream;
@ -60,7 +60,7 @@ void svg_desc::add_text(const std::wstring & Text)
const wchar_t * svg_font_face_uri::ns = L"svg";
const wchar_t * svg_font_face_uri::name = L"font-face-uri";
std::wostream & svg_font_face_uri::text_to_stream(std::wostream & _Wostream) const
std::wostream & svg_font_face_uri::text_to_stream(std::wostream & _Wostream, bool bXmlEncode) const
{
return _Wostream;
}
@ -88,7 +88,7 @@ void svg_font_face_uri::add_text(const std::wstring & Text)
const wchar_t * svg_font_face_format::ns = L"svg";
const wchar_t * svg_font_face_format::name = L"font-face-format";
std::wostream & svg_font_face_format::text_to_stream(std::wostream & _Wostream) const
std::wostream & svg_font_face_format::text_to_stream(std::wostream & _Wostream, bool bXmlEncode) const
{
return _Wostream;
}
@ -111,7 +111,7 @@ void svg_font_face_format::add_text(const std::wstring & Text)
const wchar_t * svg_font_face_name::ns = L"svg";
const wchar_t * svg_font_face_name::name = L"font-face-name";
std::wostream & svg_font_face_name::text_to_stream(std::wostream & _Wostream) const
std::wostream & svg_font_face_name::text_to_stream(std::wostream & _Wostream, bool bXmlEncode) const
{
return _Wostream;
}

View File

@ -69,7 +69,7 @@ public:
CPDOCCORE_DEFINE_VISITABLE();
virtual std::wostream & text_to_stream(std::wostream & _Wostream) const;
virtual std::wostream & text_to_stream(std::wostream & _Wostream, bool bXmlEncode = true) const;
common_svg_font_face_xlink_attlist common_svg_font_face_xlink_attlist_;
office_element_ptr_array svg_font_face_format_;
@ -92,7 +92,7 @@ public:
CPDOCCORE_DEFINE_VISITABLE();
virtual std::wostream & text_to_stream(std::wostream & _Wostream) const;
virtual std::wostream & text_to_stream(std::wostream & _Wostream, bool bXmlEncode = true) const;
std::wstring text_;
@ -114,7 +114,7 @@ public:
CPDOCCORE_DEFINE_VISITABLE();
virtual std::wostream & text_to_stream(std::wostream & _Wostream) const;
virtual std::wostream & text_to_stream(std::wostream & _Wostream, bool bXmlEncode = true) const;
optional<std::wstring>::Type svg_string_;
@ -136,7 +136,7 @@ public:
CPDOCCORE_DEFINE_VISITABLE();
virtual std::wostream & text_to_stream(std::wostream & _Wostream) const;
virtual std::wostream & text_to_stream(std::wostream & _Wostream, bool bXmlEncode = true) const;
optional<std::wstring>::Type name_;
private:

View File

@ -87,9 +87,9 @@ void common_style_header_footer_attlist::add_attributes( const xml::attributes_w
}
// header-footer-content
std::wostream & header_footer_content::text_to_stream(std::wostream & _Wostream) const
std::wostream & header_footer_content::text_to_stream(std::wostream & _Wostream, bool bXmlEncode) const
{
serialize_elements_text(_Wostream, content_);
serialize_elements_text(_Wostream, content_, bXmlEncode);
return _Wostream;
}

View File

@ -100,7 +100,7 @@ private:
class header_footer_content
{
public:
std::wostream & text_to_stream(std::wostream & _Wostream) const;
std::wostream & text_to_stream(std::wostream & _Wostream, bool bXmlEncode = true) const;
void add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name, document_context * Context);
office_element_ptr tracked_changes_;

View File

@ -48,9 +48,9 @@ namespace text {
const wchar_t * number::ns = L"text";
const wchar_t * number::name = L"number";
std::wostream & number::text_to_stream(std::wostream & _Wostream) const
std::wostream & number::text_to_stream(std::wostream & _Wostream, bool bXmlEncode) const
{
_Wostream << xml::utils::replace_xml_to_text( string_ );
_Wostream << (bXmlEncode ? xml::utils::replace_xml_to_text( string_ ) : string_);
return _Wostream;
}
@ -64,11 +64,11 @@ void number::add_text(const std::wstring & Text)
const wchar_t * list_item::ns = L"text";
const wchar_t * list_item::name = L"list-item";
std::wostream & list_item::text_to_stream(std::wostream & _Wostream) const
std::wostream & list_item::text_to_stream(std::wostream & _Wostream, bool bXmlEncode) const
{
for (size_t i = 0; i < content_.size(); i++)
{
content_[i]->text_to_stream(_Wostream);
content_[i]->text_to_stream(_Wostream, bXmlEncode);
}
return _Wostream;
}
@ -161,11 +161,11 @@ void list_header::pptx_convert(oox::pptx_conversion_context & Context)
}
std::wostream & list_header::text_to_stream(std::wostream & _Wostream) const
std::wostream & list_header::text_to_stream(std::wostream & _Wostream, bool bXmlEncode) const
{
for (size_t i = 0; i < content_.size(); i++)
{
content_[i]->text_to_stream(_Wostream);
content_[i]->text_to_stream(_Wostream, bXmlEncode);
}
return _Wostream;
}

View File

@ -52,7 +52,7 @@ public:
CPDOCCORE_DEFINE_VISITABLE();
public:
virtual std::wostream & text_to_stream(std::wostream & _Wostream) const;
virtual std::wostream & text_to_stream(std::wostream & _Wostream, bool bXmlEncode = true) const;
public:
number() {}
@ -90,7 +90,7 @@ public:
void pptx_convert(oox::pptx_conversion_context & Context);
public:
virtual std::wostream & text_to_stream(std::wostream & _Wostream) const;
virtual std::wostream & text_to_stream(std::wostream & _Wostream, bool bXmlEncode = true) const;
public:
list_item() {}
@ -128,7 +128,7 @@ public:
void pptx_convert(oox::pptx_conversion_context & Context);
public:
virtual std::wostream & text_to_stream(std::wostream & _Wostream) const;
virtual std::wostream & text_to_stream(std::wostream & _Wostream, bool bXmlEncode = true) const;
public:
list_header() {}

View File

@ -65,7 +65,7 @@ void math_mi::add_text(const std::wstring & Text)
text_ = Text;
}
std::wostream & math_mi::text_to_stream(std::wostream & _strm) const
std::wostream & math_mi::text_to_stream(std::wostream & _strm, bool bXmlEncode) const
{
if (text_)
_strm << *text_;
@ -143,7 +143,7 @@ void math_mo::add_text(const std::wstring & Text)
text_ = Text;
}
std::wostream & math_mo::text_to_stream(std::wostream & _strm) const
std::wostream & math_mo::text_to_stream(std::wostream & _strm, bool bXmlEncode) const
{
if (text_)
_strm << *text_;

View File

@ -48,7 +48,7 @@ public:
virtual void oox_convert(oox::math_context & Context);
virtual std::wostream & text_to_stream(std::wostream & _Wostream) const;
virtual std::wostream & text_to_stream(std::wostream & _Wostream, bool bXmlEncode = true) const;
private:
virtual void add_attributes ( const xml::attributes_wc_ptr & Attributes );
virtual void add_child_element ( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name);
@ -73,7 +73,7 @@ public:
virtual void oox_convert(oox::math_context & Context);
virtual std::wostream & text_to_stream(std::wostream & _Wostream) const;
virtual std::wostream & text_to_stream(std::wostream & _Wostream, bool bXmlEncode = true) const;
_CP_OPT(bool) fence_;
_CP_OPT(bool) stretchy_;

View File

@ -48,14 +48,14 @@ namespace text {
const wchar_t * note_citation::ns = L"text";
const wchar_t * note_citation::name = L"note-citation";
std::wostream & note_citation::text_to_stream(std::wostream & _Wostream) const
std::wostream & note_citation::text_to_stream(std::wostream & _Wostream, bool bXmlEncode) const
{
if (!text_label_.empty())
_Wostream << text_label_;
for (size_t i = 0; i < content_.size(); i++)
{
content_[i]->text_to_stream(_Wostream);
content_[i]->text_to_stream(_Wostream, bXmlEncode);
}
return _Wostream;
}
@ -89,11 +89,11 @@ void note_citation::docx_convert(oox::docx_conversion_context & Context)
const wchar_t * note_body::ns = L"text";
const wchar_t * note_body::name = L"note-body";
std::wostream & note_body::text_to_stream(std::wostream & _Wostream) const
std::wostream & note_body::text_to_stream(std::wostream & _Wostream, bool bXmlEncode) const
{
for (size_t i = 0; i < content_.size(); i++)
{
content_[i]->text_to_stream(_Wostream);
content_[i]->text_to_stream(_Wostream, bXmlEncode);
}
return _Wostream;
}

View File

@ -53,7 +53,7 @@ public:
virtual void docx_convert(oox::docx_conversion_context & Context) ;
public:
virtual std::wostream & text_to_stream(std::wostream & _Wostream) const;
virtual std::wostream & text_to_stream(std::wostream & _Wostream, bool bXmlEncode = true) const;
public:
note_citation() {}
@ -84,7 +84,7 @@ public:
virtual void docx_convert(oox::docx_conversion_context & Context) ;
public:
virtual std::wostream & text_to_stream(std::wostream & _Wostream) const;
virtual std::wostream & text_to_stream(std::wostream & _Wostream, bool bXmlEncode = true) const;
public:
note_body() {}

View File

@ -45,7 +45,7 @@ namespace odf_reader {
const wchar_t * office_binary_data::ns = L"office";
const wchar_t * office_binary_data::name = L"binary-data";
std::wostream & office_binary_data::text_to_stream(std::wostream & _Wostream) const
std::wostream & office_binary_data::text_to_stream(std::wostream & _Wostream, bool bXmlEncode) const
{
return _Wostream;
}

View File

@ -53,7 +53,7 @@ public:
CPDOCCORE_DEFINE_VISITABLE();
virtual std::wostream & text_to_stream(std::wostream & _Wostream) const;
virtual std::wostream & text_to_stream(std::wostream & _Wostream, bool bXmlEncode = true) const;
std::wstring write_to(const std::wstring & path);
private:

View File

@ -55,10 +55,10 @@ namespace odf_reader {
const wchar_t * office_body::ns = L"office";
const wchar_t * office_body::name = L"body";
std::wostream & office_body::text_to_stream(std::wostream & _Wostream) const
std::wostream & office_body::text_to_stream(std::wostream & _Wostream, bool bXmlEncode) const
{
if (content_)
content_->text_to_stream(_Wostream);
content_->text_to_stream(_Wostream, bXmlEncode);
return _Wostream;
}

View File

@ -62,7 +62,7 @@ public:
virtual void pptx_convert(oox::pptx_conversion_context & Context);
public:
virtual std::wostream & text_to_stream(std::wostream & _Wostream) const;
virtual std::wostream & text_to_stream(std::wostream & _Wostream, bool bXmlEncode = true) const;
public:
office_body();

View File

@ -43,9 +43,9 @@ namespace odf_reader {
std::wostream & office_document_base::text_to_stream(std::wostream & _Wostream) const
std::wostream & office_document_base::text_to_stream(std::wostream & _Wostream, bool bXmlEncode) const
{
office_body_->text_to_stream(_Wostream);
office_body_->text_to_stream(_Wostream, bXmlEncode);
return _Wostream;
}

View File

@ -44,7 +44,7 @@ namespace odf_reader {
class office_document_base : public office_element
{
public:
virtual std::wostream & text_to_stream(std::wostream & _Wostream) const;
virtual std::wostream & text_to_stream(std::wostream & _Wostream, bool bXmlEncode = true) const;
CPDOCCORE_DEFINE_VISITABLE();

View File

@ -112,7 +112,7 @@ public:
_CP_OPT(std::wstring) element_style_name;
_CP_OPT(std::wstring) next_element_style_name; //for master page
virtual std::wostream & text_to_stream(std::wostream & _Wostream) const
virtual std::wostream & text_to_stream(std::wostream & _Wostream, bool bXmlEncode = true) const
{
_CP_LOG << L"[warning] use base text_to_stream\n";
return _Wostream;

View File

@ -120,9 +120,9 @@ void paragraph_content_element<ElementT>::docx_serialize_run(office_element_ptr
const wchar_t * text::ns = L"";
const wchar_t * text::name = L"";
std::wostream & text::text_to_stream(std::wostream & _Wostream) const
std::wostream & text::text_to_stream(std::wostream & _Wostream, bool bXmlEncode) const
{
_Wostream << xml::utils::replace_text_to_xml( text_, true );
_Wostream << (bXmlEncode ? xml::utils::replace_text_to_xml( text_, true ) : text_);
return _Wostream;
}
@ -202,7 +202,7 @@ office_element_ptr text::create(const std::wstring & Text)
const wchar_t * s::ns = L"text";
const wchar_t * s::name = L"s";
std::wostream & s::text_to_stream(std::wostream & _Wostream) const
std::wostream & s::text_to_stream(std::wostream & _Wostream, bool bXmlEncode) const
{
if (text_c_)
{
@ -259,7 +259,7 @@ void s::pptx_convert(oox::pptx_conversion_context & Context)
const wchar_t * tab::ns = L"text";
const wchar_t * tab::name = L"tab";
std::wostream & tab::text_to_stream(std::wostream & _Wostream) const
std::wostream & tab::text_to_stream(std::wostream & _Wostream, bool bXmlEncode) const
{
_Wostream << std::wstring(L"\t");
return _Wostream;
@ -291,7 +291,7 @@ void tab::pptx_convert(oox::pptx_conversion_context & Context)
const wchar_t * line_break::ns = L"text";
const wchar_t * line_break::name = L"line-break";
std::wostream & line_break::text_to_stream(std::wostream & _Wostream) const
std::wostream & line_break::text_to_stream(std::wostream & _Wostream, bool bXmlEncode) const
{
_Wostream << std::wstring(L"\r\n");
return _Wostream;
@ -332,7 +332,7 @@ void bookmark::add_attributes( const xml::attributes_wc_ptr & Attributes )
{
CP_APPLY_ATTR(L"text:name", text_name_, std::wstring(L""));
}
std::wostream & bookmark::text_to_stream(std::wostream & _Wostream) const
std::wostream & bookmark::text_to_stream(std::wostream & _Wostream, bool bXmlEncode) const
{
return _Wostream;
}
@ -348,7 +348,7 @@ void bookmark_start::docx_convert(oox::docx_conversion_context & Context)
{
Context.start_bookmark(name_);
}
std::wostream & bookmark_start::text_to_stream(std::wostream & _Wostream) const
std::wostream & bookmark_start::text_to_stream(std::wostream & _Wostream, bool bXmlEncode) const
{
return _Wostream;
}
@ -364,7 +364,7 @@ void bookmark_end::docx_convert(oox::docx_conversion_context & Context)
{
Context.end_bookmark(name_);
}
std::wostream & bookmark_end::text_to_stream(std::wostream & _Wostream) const
std::wostream & bookmark_end::text_to_stream(std::wostream & _Wostream, bool bXmlEncode) const
{
return _Wostream;
}
@ -461,11 +461,11 @@ void hidden_text::docx_convert(oox::docx_conversion_context & Context)
const wchar_t * span::ns = L"text";
const wchar_t * span::name = L"span";
std::wostream & span::text_to_stream(std::wostream & _Wostream) const
std::wostream & span::text_to_stream(std::wostream & _Wostream, bool bXmlEncode) const
{
for (size_t i = 0; i < content_.size(); i++)
{
content_[i]->text_to_stream(_Wostream);
content_[i]->text_to_stream(_Wostream, bXmlEncode);
}
return _Wostream;
}
@ -574,11 +574,11 @@ void span::pptx_convert(oox::pptx_conversion_context & Context)
const wchar_t * a::ns = L"text";
const wchar_t * a::name = L"a";
std::wostream & a::text_to_stream(std::wostream & _Wostream) const
std::wostream & a::text_to_stream(std::wostream & _Wostream, bool bXmlEncode) const
{
for (size_t i = 0; i < content_.size(); i++)
{
content_[i]->text_to_stream(_Wostream);
content_[i]->text_to_stream(_Wostream, bXmlEncode);
}
return _Wostream;
}
@ -712,13 +712,13 @@ const wchar_t * note::name = L"note";
note::note()
{}
std::wostream & note::text_to_stream(std::wostream & _Wostream) const
std::wostream & note::text_to_stream(std::wostream & _Wostream, bool bXmlEncode) const
{
if (text_note_citation_)
text_note_citation_->text_to_stream(_Wostream);
text_note_citation_->text_to_stream(_Wostream, bXmlEncode);
if (text_note_body_)
text_note_body_->text_to_stream(_Wostream);
text_note_body_->text_to_stream(_Wostream, bXmlEncode);
return _Wostream;
}
@ -806,13 +806,13 @@ void note::docx_convert(oox::docx_conversion_context & Context)
const wchar_t * ruby::ns = L"text";
const wchar_t * ruby::name = L"ruby";
std::wostream & ruby::text_to_stream(std::wostream & _Wostream) const
std::wostream & ruby::text_to_stream(std::wostream & _Wostream, bool bXmlEncode) const
{
if (text_ruby_base_)
text_ruby_base_->text_to_stream(_Wostream);
text_ruby_base_->text_to_stream(_Wostream, bXmlEncode);
if (text_ruby_text_)
text_ruby_text_->text_to_stream(_Wostream);
text_ruby_text_->text_to_stream(_Wostream, bXmlEncode);
return _Wostream;
}
@ -846,9 +846,9 @@ void ruby::add_text(const std::wstring & Text)
const wchar_t * title::ns = L"text";
const wchar_t * title::name = L"title";
std::wostream & title::text_to_stream(std::wostream & _Wostream) const
std::wostream & title::text_to_stream(std::wostream & _Wostream, bool bXmlEncode) const
{
CP_SERIALIZE_TEXT(text_);
CP_SERIALIZE_TEXT(text_, bXmlEncode);
return _Wostream;
}
@ -883,9 +883,9 @@ void title::pptx_convert(oox::pptx_conversion_context & Context)
const wchar_t * subject::ns = L"text";
const wchar_t * subject::name = L"subject";
std::wostream & subject::text_to_stream(std::wostream & _Wostream) const
std::wostream & subject::text_to_stream(std::wostream & _Wostream, bool bXmlEncode) const
{
CP_SERIALIZE_TEXT(text_);
CP_SERIALIZE_TEXT(text_, bXmlEncode);
return _Wostream;
}
@ -919,9 +919,9 @@ void subject::pptx_convert(oox::pptx_conversion_context & Context)
const wchar_t * chapter::ns = L"text";
const wchar_t * chapter::name = L"chapter";
std::wostream & chapter::text_to_stream(std::wostream & _Wostream) const
std::wostream & chapter::text_to_stream(std::wostream & _Wostream, bool bXmlEncode) const
{
CP_SERIALIZE_TEXT(text_);
CP_SERIALIZE_TEXT(text_, bXmlEncode);
return _Wostream;
}
@ -955,9 +955,9 @@ void chapter::pptx_convert(oox::pptx_conversion_context & Context)
const wchar_t * text_placeholder::ns = L"text";
const wchar_t * text_placeholder::name = L"placeholder";
std::wostream & text_placeholder::text_to_stream(std::wostream & _Wostream) const
std::wostream & text_placeholder::text_to_stream(std::wostream & _Wostream, bool bXmlEncode) const
{
CP_SERIALIZE_TEXT(text_);
CP_SERIALIZE_TEXT(text_, bXmlEncode);
return _Wostream;
}
@ -986,9 +986,9 @@ void text_placeholder::pptx_convert(oox::pptx_conversion_context & Context)
const wchar_t * text_page_number::ns = L"text";
const wchar_t * text_page_number::name = L"page-number";
std::wostream & text_page_number::text_to_stream(std::wostream & _Wostream) const
std::wostream & text_page_number::text_to_stream(std::wostream & _Wostream, bool bXmlEncode) const
{
CP_SERIALIZE_TEXT(text_);
CP_SERIALIZE_TEXT(text_, bXmlEncode);
return _Wostream;
}
@ -1024,9 +1024,9 @@ void text_page_number::pptx_convert(oox::pptx_conversion_context & Context)
const wchar_t * text_page_count::ns = L"text";
const wchar_t * text_page_count::name = L"page-count";
std::wostream & text_page_count::text_to_stream(std::wostream & _Wostream) const
std::wostream & text_page_count::text_to_stream(std::wostream & _Wostream, bool bXmlEncode) const
{
CP_SERIALIZE_TEXT(text_);
CP_SERIALIZE_TEXT(text_, bXmlEncode);
return _Wostream;
}
@ -1059,9 +1059,9 @@ void text_page_count::pptx_convert(oox::pptx_conversion_context & Context)
const wchar_t * text_date::ns = L"text";
const wchar_t * text_date::name = L"date";
std::wostream & text_date::text_to_stream(std::wostream & _Wostream) const
std::wostream & text_date::text_to_stream(std::wostream & _Wostream, bool bXmlEncode) const
{
CP_SERIALIZE_TEXT(text_);
CP_SERIALIZE_TEXT(text_, bXmlEncode);
return _Wostream;
}
@ -1120,9 +1120,9 @@ void text_modification_date::pptx_convert(oox::pptx_conversion_context & Context
const wchar_t * text_time::ns = L"text";
const wchar_t * text_time::name = L"time";
std::wostream & text_time::text_to_stream(std::wostream & _Wostream) const
std::wostream & text_time::text_to_stream(std::wostream & _Wostream, bool bXmlEncode) const
{
CP_SERIALIZE_TEXT(text_);
CP_SERIALIZE_TEXT(text_, bXmlEncode);
return _Wostream;
}
@ -1180,9 +1180,9 @@ void text_modification_time::pptx_convert(oox::pptx_conversion_context & Context
const wchar_t * text_file_name::ns = L"text";
const wchar_t * text_file_name::name = L"file-name";
std::wostream & text_file_name::text_to_stream(std::wostream & _Wostream) const
std::wostream & text_file_name::text_to_stream(std::wostream & _Wostream, bool bXmlEncode) const
{
CP_SERIALIZE_TEXT(text_);
CP_SERIALIZE_TEXT(text_, bXmlEncode);
return _Wostream;
}
void text_file_name::add_attributes( const xml::attributes_wc_ptr & Attributes )
@ -1245,9 +1245,9 @@ void sequence::add_attributes( const xml::attributes_wc_ptr & Attributes )
CP_APPLY_ATTR(L"text:ref-name", ref_name_);
CP_APPLY_ATTR(L"text:name", name_);
}
std::wostream & sequence::text_to_stream(std::wostream & _Wostream) const
std::wostream & sequence::text_to_stream(std::wostream & _Wostream, bool bXmlEncode) const
{
CP_SERIALIZE_TEXT(text_);
CP_SERIALIZE_TEXT(text_, bXmlEncode);
return _Wostream;
}
void sequence::add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name)
@ -1332,9 +1332,9 @@ void expression::add_attributes( const xml::attributes_wc_ptr & Attributes )
CP_APPLY_ATTR(L"text:formula", text_formula_);
}
std::wostream & expression::text_to_stream(std::wostream & _Wostream) const
std::wostream & expression::text_to_stream(std::wostream & _Wostream, bool bXmlEncode) const
{
_Wostream << xml::utils::replace_text_to_xml( text_ );
_Wostream << (bXmlEncode ? xml::utils::replace_text_to_xml( text_ ) : text_);
return _Wostream;
}
void expression::add_text(const std::wstring & Text)
@ -1361,9 +1361,9 @@ void text_input::add_attributes( const xml::attributes_wc_ptr & Attributes )
CP_APPLY_ATTR(L"text:description", text_description_);
}
std::wostream & text_input::text_to_stream(std::wostream & _Wostream) const
std::wostream & text_input::text_to_stream(std::wostream & _Wostream, bool bXmlEncode) const
{
_Wostream << xml::utils::replace_text_to_xml( text_ );
_Wostream << (bXmlEncode ? xml::utils::replace_text_to_xml( text_ ) : text_);
return _Wostream;
}
void text_input::add_text(const std::wstring & Text)
@ -1405,9 +1405,9 @@ void text_drop_down::add_text(const std::wstring & Text)
{
text_ = Text;
}
std::wostream & text_drop_down::text_to_stream(std::wostream & _Wostream) const
std::wostream & text_drop_down::text_to_stream(std::wostream & _Wostream, bool bXmlEncode) const
{
_Wostream << xml::utils::replace_text_to_xml( text_ );
_Wostream << (bXmlEncode ? xml::utils::replace_text_to_xml( text_ ) : text_);
return _Wostream;
}
@ -1570,9 +1570,9 @@ void sender_company::docx_convert(oox::docx_conversion_context & Context)
const wchar_t * sender_postal_code::ns = L"text";
const wchar_t * sender_postal_code::name = L"sender-postal-code";
std::wostream & sender_postal_code::text_to_stream(std::wostream & _Wostream) const
std::wostream & sender_postal_code::text_to_stream(std::wostream & _Wostream, bool bXmlEncode) const
{
CP_SERIALIZE_TEXT(text_);
CP_SERIALIZE_TEXT(text_, bXmlEncode);
return _Wostream;
}
@ -1722,9 +1722,9 @@ void bibliography_mark::add_text(const std::wstring & Text)
text_ = text::create(Text) ;
}
std::wostream & bibliography_mark::text_to_stream(std::wostream & _Wostream) const
std::wostream & bibliography_mark::text_to_stream(std::wostream & _Wostream, bool bXmlEncode) const
{
CP_SERIALIZE_TEXT(text_);
CP_SERIALIZE_TEXT(text_, bXmlEncode);
return _Wostream;
}
void bibliography_mark::serialize(std::wostream & strm)

View File

@ -79,7 +79,7 @@ public:
virtual void xlsx_convert(oox::xlsx_conversion_context & Context);
virtual void pptx_convert(oox::pptx_conversion_context & Context) ;
virtual std::wostream & text_to_stream(std::wostream & _Wostream) const;
virtual std::wostream & text_to_stream(std::wostream & _Wostream, bool bXmlEncode = true) const;
bool preserve_;
@ -112,7 +112,7 @@ public:
virtual void xlsx_convert(oox::xlsx_conversion_context & Context);
virtual void pptx_convert(oox::pptx_conversion_context & Context);
virtual std::wostream & text_to_stream(std::wostream & _Wostream) const;
virtual std::wostream & text_to_stream(std::wostream & _Wostream, bool bXmlEncode = true) const;
s(unsigned int c) : text_c_(c) {};
s() {};
@ -146,7 +146,7 @@ public:
virtual void xlsx_convert(oox::xlsx_conversion_context & Context) ;
virtual void pptx_convert(oox::pptx_conversion_context & Context) ;
virtual std::wostream & text_to_stream(std::wostream & _Wostream) const;
virtual std::wostream & text_to_stream(std::wostream & _Wostream, bool bXmlEncode = true) const;
_CP_OPT(unsigned int) text_tab_ref_;
@ -174,7 +174,7 @@ public:
virtual void xlsx_convert(oox::xlsx_conversion_context & Context);
virtual void pptx_convert(oox::pptx_conversion_context & Context) ;
virtual std::wostream & text_to_stream(std::wostream & _Wostream) const;
virtual std::wostream & text_to_stream(std::wostream & _Wostream, bool bXmlEncode = true) const;
private:
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes ) {}
@ -196,7 +196,7 @@ public:
static const ElementType type = typeTextBookmark;
CPDOCCORE_DEFINE_VISITABLE();
virtual std::wostream & text_to_stream(std::wostream & _Wostream) const;
virtual std::wostream & text_to_stream(std::wostream & _Wostream, bool bXmlEncode = true) const;
std::wstring text_name_;
@ -220,7 +220,7 @@ public:
static const ElementType type = typeTextBookmarkStart;
CPDOCCORE_DEFINE_VISITABLE();
virtual std::wostream & text_to_stream(std::wostream & _Wostream) const;
virtual std::wostream & text_to_stream(std::wostream & _Wostream, bool bXmlEncode = true) const;
virtual void docx_convert(oox::docx_conversion_context & Context);
std::wstring name_;
@ -244,7 +244,7 @@ public:
static const ElementType type = typeTextBookmarkEnd;
CPDOCCORE_DEFINE_VISITABLE();
virtual std::wostream & text_to_stream(std::wostream & _Wostream) const;
virtual std::wostream & text_to_stream(std::wostream & _Wostream, bool bXmlEncode = true) const;
virtual void docx_convert(oox::docx_conversion_context & Context);
std::wstring name_;
@ -382,7 +382,7 @@ public:
virtual void xlsx_convert(oox::xlsx_conversion_context & Context);
virtual void pptx_convert(oox::pptx_conversion_context & Context) ;
virtual std::wostream & text_to_stream(std::wostream & _Wostream) const;
virtual std::wostream & text_to_stream(std::wostream & _Wostream, bool bXmlEncode = true) const;
span() {}
@ -414,7 +414,7 @@ public:
virtual void xlsx_convert(oox::xlsx_conversion_context & Context);
virtual void pptx_convert(oox::pptx_conversion_context & Context) ;
virtual std::wostream & text_to_stream(std::wostream & _Wostream) const;
virtual std::wostream & text_to_stream(std::wostream & _Wostream, bool bXmlEncode = true) const;
a() {}
@ -450,7 +450,7 @@ public:
void docx_convert(oox::docx_conversion_context & Context);
void pptx_convert(oox::pptx_conversion_context & Context);
virtual std::wostream & text_to_stream(std::wostream & _Wostream) const;
virtual std::wostream & text_to_stream(std::wostream & _Wostream, bool bXmlEncode = true) const;
note();
private:
@ -477,7 +477,7 @@ public:
static const ElementType type = typeTextRuby;
CPDOCCORE_DEFINE_VISITABLE();
virtual std::wostream & text_to_stream(std::wostream & _Wostream) const;
virtual std::wostream & text_to_stream(std::wostream & _Wostream, bool bXmlEncode = true) const;
private:
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
@ -502,7 +502,7 @@ public:
static const ElementType type = typeTextTitle;
CPDOCCORE_DEFINE_VISITABLE();
virtual std::wostream & text_to_stream(std::wostream & _Wostream) const;
virtual std::wostream & text_to_stream(std::wostream & _Wostream, bool bXmlEncode = true) const;
virtual void docx_convert(oox::docx_conversion_context & Context);
virtual void xlsx_convert(oox::xlsx_conversion_context & Context);
@ -530,7 +530,7 @@ public:
static const ElementType type = typeTextChapter;
CPDOCCORE_DEFINE_VISITABLE();
virtual std::wostream & text_to_stream(std::wostream & _Wostream) const;
virtual std::wostream & text_to_stream(std::wostream & _Wostream, bool bXmlEncode = true) const;
virtual void docx_convert(oox::docx_conversion_context & Context);
virtual void xlsx_convert(oox::xlsx_conversion_context & Context);
virtual void pptx_convert(oox::pptx_conversion_context & Context) ;
@ -556,7 +556,7 @@ public:
static const ElementType type = typeTextSubject;
CPDOCCORE_DEFINE_VISITABLE();
virtual std::wostream & text_to_stream(std::wostream & _Wostream) const;
virtual std::wostream & text_to_stream(std::wostream & _Wostream, bool bXmlEncode = true) const;
virtual void docx_convert(oox::docx_conversion_context & Context);
virtual void xlsx_convert(oox::xlsx_conversion_context & Context);
virtual void pptx_convert(oox::pptx_conversion_context & Context) ;
@ -584,7 +584,7 @@ public:
void docx_convert(oox::docx_conversion_context & Context);
void pptx_convert(oox::pptx_conversion_context & Context);
virtual std::wostream & text_to_stream(std::wostream & _Wostream) const;
virtual std::wostream & text_to_stream(std::wostream & _Wostream, bool bXmlEncode = true) const;
_CP_OPT(std::wstring) text_description_;
_CP_OPT(std::wstring) text_placeholder_type_;
@ -611,7 +611,7 @@ public:
void docx_convert(oox::docx_conversion_context & Context);
void pptx_convert(oox::pptx_conversion_context & Context);
virtual std::wostream & text_to_stream(std::wostream & _Wostream) const;
virtual std::wostream & text_to_stream(std::wostream & _Wostream, bool bXmlEncode = true) const;
private:
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
@ -643,7 +643,7 @@ public:
void docx_convert(oox::docx_conversion_context & Context);
void pptx_convert(oox::pptx_conversion_context & Context);
virtual std::wostream & text_to_stream(std::wostream & _Wostream) const;
virtual std::wostream & text_to_stream(std::wostream & _Wostream, bool bXmlEncode = true) const;
_CP_OPT(odf_types::style_numformat) style_num_format_;
_CP_OPT(odf_types::Bool) style_num_letter_sync_;
@ -672,7 +672,7 @@ public:
virtual void docx_convert(oox::docx_conversion_context & Context);
virtual void pptx_convert(oox::pptx_conversion_context & Context);
std::wostream & text_to_stream(std::wostream & _Wostream) const;
std::wostream & text_to_stream(std::wostream & _Wostream, bool bXmlEncode = true) const;
_CP_OPT(std::wstring) style_data_style_name_;
_CP_OPT(odf_types::Bool) text_fixed_;
@ -727,7 +727,7 @@ public:
virtual void docx_convert(oox::docx_conversion_context & Context);
virtual void pptx_convert(oox::pptx_conversion_context & Context);
std::wostream & text_to_stream(std::wostream & _Wostream) const;
std::wostream & text_to_stream(std::wostream & _Wostream, bool bXmlEncode = true) const;
_CP_OPT(std::wstring) style_data_style_name_;
_CP_OPT(odf_types::Bool)text_fixed_;
@ -782,7 +782,7 @@ public:
void docx_convert(oox::docx_conversion_context & Context);
void pptx_convert(oox::pptx_conversion_context & Context);
virtual std::wostream & text_to_stream(std::wostream & _Wostream) const;
virtual std::wostream & text_to_stream(std::wostream & _Wostream, bool bXmlEncode = true) const;
private:
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
@ -858,7 +858,7 @@ public:
void docx_convert(oox::docx_conversion_context & Context);
void pptx_convert(oox::pptx_conversion_context & Context) ;
virtual std::wostream & text_to_stream(std::wostream & _Wostream) const;
virtual std::wostream & text_to_stream(std::wostream & _Wostream, bool bXmlEncode = true) const;
_CP_OPT(odf_types::style_numformat) style_num_format_;
_CP_OPT(std::wstring) style_num_letter_sync_;
@ -888,7 +888,7 @@ public:
void docx_convert(oox::docx_conversion_context & Context);
virtual std::wostream & text_to_stream(std::wostream & _Wostream) const;
virtual std::wostream & text_to_stream(std::wostream & _Wostream, bool bXmlEncode = true) const;
_CP_OPT(std::wstring) style_data_style_name_;
_CP_OPT(std::wstring) text_display_;
@ -916,7 +916,7 @@ public:
void docx_convert(oox::docx_conversion_context & Context);
virtual std::wostream & text_to_stream(std::wostream & _Wostream) const;
virtual std::wostream & text_to_stream(std::wostream & _Wostream, bool bXmlEncode = true) const;
_CP_OPT(std::wstring) text_description_;
std::wstring text_;
@ -965,7 +965,7 @@ public:
void docx_convert(oox::docx_conversion_context & Context);
virtual std::wostream & text_to_stream(std::wostream & _Wostream) const;
virtual std::wostream & text_to_stream(std::wostream & _Wostream, bool bXmlEncode = true) const;
private:
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
@ -1099,7 +1099,7 @@ public:
static const ElementType type = typeTextSenderPostalCode;
CPDOCCORE_DEFINE_VISITABLE();
virtual std::wostream & text_to_stream(std::wostream & _Wostream) const;
virtual std::wostream & text_to_stream(std::wostream & _Wostream, bool bXmlEncode = true) const;
virtual void docx_convert(oox::docx_conversion_context & Context);
private:
@ -1316,7 +1316,7 @@ public:
void serialize(std::wostream & strm);
virtual std::wostream & text_to_stream(std::wostream & _Wostream) const;
virtual std::wostream & text_to_stream(std::wostream & _Wostream, bool bXmlEncode = true) const;
std::wstring identifier_;
odf_types::bibliography bibliography_type_;

View File

@ -50,9 +50,9 @@ namespace text {
const wchar_t * ruby_base::ns = L"text";
const wchar_t * ruby_base::name = L"ruby-base";
std::wostream & ruby_base::text_to_stream(std::wostream & _Wostream) const
std::wostream & ruby_base::text_to_stream(std::wostream & _Wostream, bool bXmlEncode) const
{
serialize_elements_text(_Wostream, content_);
serialize_elements_text(_Wostream, content_, bXmlEncode);
return _Wostream;
}
@ -76,9 +76,9 @@ void ruby_base::add_text(const std::wstring & Text)
const wchar_t * ruby_text::ns = L"text";
const wchar_t * ruby_text::name = L"ruby-text";
std::wostream & ruby_text::text_to_stream(std::wostream & _Wostream) const
std::wostream & ruby_text::text_to_stream(std::wostream & _Wostream, bool bXmlEncode) const
{
CP_SERIALIZE_TEXT(content_);
CP_SERIALIZE_TEXT(content_, bXmlEncode);
return _Wostream;
}

View File

@ -53,9 +53,7 @@ public:
static const ElementType type = typeTextRubyBase;
CPDOCCORE_DEFINE_VISITABLE();
public:
virtual std::wostream & text_to_stream(std::wostream & _Wostream) const;
public:
virtual std::wostream & text_to_stream(std::wostream & _Wostream, bool bXmlEncode = true) const;
ruby_base() {}
private:
@ -63,7 +61,6 @@ private:
virtual void add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name);
virtual void add_text(const std::wstring & Text);
private:
office_element_ptr_array content_;
};
@ -82,10 +79,8 @@ public:
static const ElementType type = typeTextRubyText;
CPDOCCORE_DEFINE_VISITABLE();
public:
virtual std::wostream & text_to_stream(std::wostream & _Wostream) const;
virtual std::wostream & text_to_stream(std::wostream & _Wostream, bool bXmlEncode = true) const;
public:
ruby_text() {}
private:
@ -93,7 +88,6 @@ private:
virtual void add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name);
virtual void add_text(const std::wstring & Text);
private:
odf_types::style_ref text_style_name_;
office_element_ptr_array content_;

View File

@ -36,40 +36,23 @@
namespace cpdoccore {
namespace odf_reader {
inline std::wostream & serialize_elements(std::wostream & _Wostream, const office_element_ptr & elm)
inline std::wostream & serialize_elements_text(std::wostream & _Wostream, const office_element_ptr & elm, bool bXmlEncode = true)
{
if (elm)
elm->xml_to_stream(_Wostream);
elm->text_to_stream(_Wostream, bXmlEncode);
return _Wostream;
}
inline std::wostream & serialize_elements(std::wostream & _Wostream, const office_element_ptr_array & elms)
inline std::wostream & serialize_elements_text(std::wostream & _Wostream, const office_element_ptr_array & elms, bool bXmlEncode = true)
{
for (size_t i = 0; i < elms.size(); i++)
{
serialize_elements(_Wostream, elms[i]);
serialize_elements_text(_Wostream, elms[i], bXmlEncode);
}
return _Wostream;
}
inline std::wostream & serialize_elements_text(std::wostream & _Wostream, const office_element_ptr & elm)
{
if (elm)
elm->text_to_stream(_Wostream);
return _Wostream;
}
inline std::wostream & serialize_elements_text(std::wostream & _Wostream, const office_element_ptr_array & elms)
{
for (size_t i = 0; i < elms.size(); i++)
{
serialize_elements_text(_Wostream, elms[i]);
}
return _Wostream;
}
#define CP_SERIALIZE_XML(ELEMENT) serialize_elements(_Wostream, (ELEMENT))
#define CP_SERIALIZE_TEXT(ELEMENT) serialize_elements_text(_Wostream, (ELEMENT))
#define CP_SERIALIZE_TEXT(ELEMENT, bXmlEncode) serialize_elements_text(_Wostream, (ELEMENT), bXmlEncode)
}

View File

@ -53,7 +53,7 @@ namespace odf_reader {
const wchar_t * style_tab_stop::ns = L"style";
const wchar_t * style_tab_stop::name = L"tab-stop";
std::wostream & style_tab_stop::text_to_stream(std::wostream & _Wostream) const
std::wostream & style_tab_stop::text_to_stream(std::wostream & _Wostream, bool bXmlEncode) const
{
return _Wostream;
}
@ -84,7 +84,7 @@ void style_tab_stop::add_text(const std::wstring & Text)
const wchar_t * style_tab_stops::ns = L"style";
const wchar_t * style_tab_stops::name = L"tab-stops";
std::wostream & style_tab_stops::text_to_stream(std::wostream & _Wostream) const
std::wostream & style_tab_stops::text_to_stream(std::wostream & _Wostream, bool bXmlEncode) const
{
return _Wostream;
}
@ -104,7 +104,7 @@ void style_tab_stops::add_child_element( xml::sax * Reader, const std::wstring &
const wchar_t * style_drop_cap::ns = L"style";
const wchar_t * style_drop_cap::name = L"drop-cap";
std::wostream & style_drop_cap::text_to_stream(std::wostream & _Wostream) const
std::wostream & style_drop_cap::text_to_stream(std::wostream & _Wostream, bool bXmlEncode) const
{
return _Wostream;
}
@ -129,7 +129,7 @@ void style_drop_cap::add_text(const std::wstring & Text)
const wchar_t * style_background_image::ns = L"style";
const wchar_t * style_background_image::name = L"background-image";
std::wostream & style_background_image::text_to_stream(std::wostream & _Wostream) const
std::wostream & style_background_image::text_to_stream(std::wostream & _Wostream, bool bXmlEncode) const
{
return _Wostream;
}
@ -267,7 +267,7 @@ bool paragraph_format_properties::add_child_element( xml::sax * Reader, const st
const wchar_t * style_paragraph_properties::ns = L"style";
const wchar_t * style_paragraph_properties::name = L"paragraph-properties";
std::wostream & style_paragraph_properties::text_to_stream(std::wostream & _Wostream) const
std::wostream & style_paragraph_properties::text_to_stream(std::wostream & _Wostream, bool bXmlEncode) const
{
return _Wostream;
}

View File

@ -92,7 +92,7 @@ public:
void pptx_convert(oox::pptx_conversion_context & Context);
virtual std::wostream & text_to_stream(std::wostream & _Wostream) const;
virtual std::wostream & text_to_stream(std::wostream & _Wostream, bool bXmlEncode = true) const;
private:
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
virtual void add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name);
@ -129,7 +129,7 @@ public:
void docx_convert(oox::docx_conversion_context & Context);
void pptx_convert(oox::pptx_conversion_context & Context);
virtual std::wostream & text_to_stream(std::wostream & _Wostream) const;
virtual std::wostream & text_to_stream(std::wostream & _Wostream, bool bXmlEncode = true) const;
office_element_ptr_array content_;
private:
@ -152,7 +152,7 @@ public:
CPDOCCORE_DEFINE_VISITABLE();
public:
virtual std::wostream & text_to_stream(std::wostream & _Wostream) const;
virtual std::wostream & text_to_stream(std::wostream & _Wostream, bool bXmlEncode = true) const;
odf_types::drop_cap_length style_length_;
unsigned int style_lines_;
@ -179,7 +179,7 @@ public:
CPDOCCORE_DEFINE_VISITABLE();
virtual std::wostream & text_to_stream(std::wostream & _Wostream) const;
virtual std::wostream & text_to_stream(std::wostream & _Wostream, bool bXmlEncode = true) const;
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
virtual void add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name);
@ -294,7 +294,7 @@ public:
paragraph_format_properties content_;
public:
virtual std::wostream & text_to_stream(std::wostream & _Wostream) const;
virtual std::wostream & text_to_stream(std::wostream & _Wostream, bool bXmlEncode = true) const;
private:
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );

View File

@ -296,7 +296,7 @@ void style_content::add_child_element( xml::sax * Reader, const std::wstring & N
const wchar_t * default_style::ns = L"style";
const wchar_t * default_style::name = L"default-style";
std::wostream & default_style::text_to_stream(std::wostream & _Wostream) const
std::wostream & default_style::text_to_stream(std::wostream & _Wostream, bool bXmlEncode) const
{
return _Wostream;
}
@ -440,7 +440,7 @@ void draw_opacity::add_child_element( xml::sax * Reader, const std::wstring & Ns
const wchar_t * style::ns = L"style";
const wchar_t * style::name = L"style";
std::wostream & style::text_to_stream(std::wostream & _Wostream) const
std::wostream & style::text_to_stream(std::wostream & _Wostream, bool bXmlEncode) const
{
return _Wostream;
}
@ -559,7 +559,7 @@ void draw_styles::add_child_element( xml::sax * Reader, const std::wstring & Ns,
const wchar_t * office_automatic_styles::ns = L"office";
const wchar_t * office_automatic_styles::name = L"automatic-styles";
std::wostream & office_automatic_styles::text_to_stream(std::wostream & _Wostream) const
std::wostream & office_automatic_styles::text_to_stream(std::wostream & _Wostream, bool bXmlEncode) const
{
return _Wostream;
}
@ -587,7 +587,7 @@ void office_automatic_styles::add_text(const std::wstring & Text)
const wchar_t * office_master_styles::ns = L"office";
const wchar_t * office_master_styles::name = L"master-styles";
std::wostream & office_master_styles::text_to_stream(std::wostream & _Wostream) const
std::wostream & office_master_styles::text_to_stream(std::wostream & _Wostream, bool bXmlEncode) const
{
return _Wostream;
}
@ -849,7 +849,7 @@ void style_section_properties::add_child_element( xml::sax * Reader, const std::
const wchar_t * style_header_style::ns = L"style";
const wchar_t * style_header_style::name = L"header-style";
std::wostream & style_header_style::text_to_stream(std::wostream & _Wostream) const
std::wostream & style_header_style::text_to_stream(std::wostream & _Wostream, bool bXmlEncode) const
{
return _Wostream;
}
@ -874,7 +874,7 @@ void style_header_style::add_child_element( xml::sax * Reader, const std::wstrin
const wchar_t * style_footer_style::ns = L"style";
const wchar_t * style_footer_style::name = L"footer-style";
std::wostream & style_footer_style::text_to_stream(std::wostream & _Wostream) const
std::wostream & style_footer_style::text_to_stream(std::wostream & _Wostream, bool bXmlEncode) const
{
return _Wostream;
}
@ -900,7 +900,7 @@ void style_footer_style::add_child_element( xml::sax * Reader, const std::wstrin
const wchar_t * style_page_layout::ns = L"style";
const wchar_t * style_page_layout::name = L"page-layout";
std::wostream & style_page_layout::text_to_stream(std::wostream & _Wostream) const
std::wostream & style_page_layout::text_to_stream(std::wostream & _Wostream, bool bXmlEncode) const
{
return _Wostream;
}
@ -1529,7 +1529,7 @@ void style_master_page_attlist::add_attributes( const xml::attributes_wc_ptr & A
const wchar_t * style_master_page::ns = L"style";
const wchar_t * style_master_page::name = L"master-page";
std::wostream & style_master_page::text_to_stream(std::wostream & _Wostream) const
std::wostream & style_master_page::text_to_stream(std::wostream & _Wostream, bool bXmlEncode) const
{
return _Wostream;
}
@ -1786,7 +1786,7 @@ void text_notes_configuration::add_text(const std::wstring & Text)
const wchar_t * style_presentation_page_layout::ns = L"style";
const wchar_t * style_presentation_page_layout::name = L"presentation-page-layout";
std::wostream & style_presentation_page_layout::text_to_stream(std::wostream & _Wostream) const
std::wostream & style_presentation_page_layout::text_to_stream(std::wostream & _Wostream, bool bXmlEncode) const
{
return _Wostream;
}

View File

@ -129,7 +129,7 @@ public:
static const ElementType type = typeStyleDefaultStyle;
CPDOCCORE_DEFINE_VISITABLE();
virtual std::wostream & text_to_stream(std::wostream & _Wostream) const;
virtual std::wostream & text_to_stream(std::wostream & _Wostream, bool bXmlEncode = true) const;
default_style() {};
@ -350,7 +350,7 @@ public:
static const ElementType type = typeStyleStyle;
CPDOCCORE_DEFINE_VISITABLE();
virtual std::wostream & text_to_stream(std::wostream & _Wostream) const;
virtual std::wostream & text_to_stream(std::wostream & _Wostream, bool bXmlEncode = true) const;
style() : style_auto_update_(false) { }
@ -442,7 +442,7 @@ public:
static const ElementType type = typeOfficeAutomaticStyles;
CPDOCCORE_DEFINE_VISITABLE();
virtual std::wostream & text_to_stream(std::wostream & _Wostream) const;
virtual std::wostream & text_to_stream(std::wostream & _Wostream, bool bXmlEncode = true) const;
styles styles_; ///< styles
office_element_ptr_array style_page_layout_;
@ -467,7 +467,7 @@ public:
static const ElementType type = typeOfficeMasterStyles;
CPDOCCORE_DEFINE_VISITABLE();
virtual std::wostream & text_to_stream(std::wostream & _Wostream) const;
virtual std::wostream & text_to_stream(std::wostream & _Wostream, bool bXmlEncode = true) const;
office_element_ptr_array style_master_page_; // разметки тем
office_element_ptr style_handout_master_; // разметки для принтера - .. второстепенно
@ -512,7 +512,7 @@ public:
CPDOCCORE_DEFINE_VISITABLE();
virtual void pptx_convert(oox::pptx_conversion_context & Context);
virtual std::wostream & text_to_stream(std::wostream & _Wostream) const;
virtual std::wostream & text_to_stream(std::wostream & _Wostream, bool bXmlEncode = true) const;
private:
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
@ -843,7 +843,7 @@ public:
static const ElementType type = typeStyleHeaderStyle;
CPDOCCORE_DEFINE_VISITABLE();
virtual std::wostream & text_to_stream(std::wostream & _Wostream) const;
virtual std::wostream & text_to_stream(std::wostream & _Wostream, bool bXmlEncode = true) const;
office_element_ptr style_header_footer_properties_;
@ -864,7 +864,7 @@ public:
static const ElementType type = typeStyleFooterStyle;
CPDOCCORE_DEFINE_VISITABLE();
virtual std::wostream & text_to_stream(std::wostream & _Wostream) const;
virtual std::wostream & text_to_stream(std::wostream & _Wostream, bool bXmlEncode = true) const;
office_element_ptr style_header_footer_properties_;
@ -885,7 +885,7 @@ public:
static const ElementType type = typeStylePageLayout;
CPDOCCORE_DEFINE_VISITABLE();
virtual std::wostream & text_to_stream(std::wostream & _Wostream) const;
virtual std::wostream & text_to_stream(std::wostream & _Wostream, bool bXmlEncode = true) const;
std::wstring style_name_;
odf_types::page_usage style_page_usage_; // default All
@ -1082,7 +1082,7 @@ public:
virtual void pptx_convert(oox::pptx_conversion_context & Context);
virtual std::wostream & text_to_stream(std::wostream & _Wostream) const;
virtual std::wostream & text_to_stream(std::wostream & _Wostream, bool bXmlEncode = true) const;
_CP_OPT(std::wstring) style_name_;
office_element_ptr_array content_;

View File

@ -369,9 +369,9 @@ void table_columns_and_groups::add_child_element( xml::sax * Reader, const std::
//////////////////////////////////////////////////////////////////////////////////////////////////
std::wostream & table_table_cell_content::text_to_stream(std::wostream & _Wostream) const
std::wostream & table_table_cell_content::text_to_stream(std::wostream & _Wostream, bool bXmlEncode) const
{
return CP_SERIALIZE_TEXT(elements_);
return CP_SERIALIZE_TEXT(elements_, bXmlEncode);
}
void table_table_cell_content::add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name, document_context * Context)
@ -384,9 +384,9 @@ void table_table_cell_content::add_child_element( xml::sax * Reader, const std::
const wchar_t * table_table_cell::ns = L"table";
const wchar_t * table_table_cell::name = L"table-cell";
std::wostream & table_table_cell::text_to_stream(std::wostream & _Wostream) const
std::wostream & table_table_cell::text_to_stream(std::wostream & _Wostream, bool bXmlEncode) const
{
return content_.text_to_stream(_Wostream);
return content_.text_to_stream(_Wostream, bXmlEncode);
}
void table_table_cell::add_attributes( const xml::attributes_wc_ptr & Attributes )
@ -420,9 +420,9 @@ bool table_table_cell::empty(bool bWithStyle)
const wchar_t * table_covered_table_cell::ns = L"table";
const wchar_t * table_covered_table_cell::name = L"covered-table-cell";
std::wostream & table_covered_table_cell::text_to_stream(std::wostream & _Wostream) const
std::wostream & table_covered_table_cell::text_to_stream(std::wostream & _Wostream, bool bXmlEncode) const
{
return content_.text_to_stream(_Wostream);
return content_.text_to_stream(_Wostream, bXmlEncode);
}
void table_covered_table_cell::add_attributes( const xml::attributes_wc_ptr & Attributes )
@ -451,9 +451,9 @@ bool table_covered_table_cell::empty()
const wchar_t * table_table_row::ns = L"table";
const wchar_t * table_table_row::name = L"table-row";
std::wostream & table_table_row::text_to_stream(std::wostream & _Wostream) const
std::wostream & table_table_row::text_to_stream(std::wostream & _Wostream, bool bXmlEncode) const
{
return CP_SERIALIZE_TEXT(content_);
return CP_SERIALIZE_TEXT(content_, bXmlEncode);
}
void table_table_row::add_attributes( const xml::attributes_wc_ptr & Attributes )
@ -508,9 +508,9 @@ bool table_table_row::empty_content_cells(bool bWithCellStyle)
const wchar_t * table_table_rows::ns = L"table";
const wchar_t * table_table_rows::name = L"table-rows";
std::wostream & table_table_rows::text_to_stream(std::wostream & _Wostream) const
std::wostream & table_table_rows::text_to_stream(std::wostream & _Wostream, bool bXmlEncode) const
{
return CP_SERIALIZE_TEXT(table_table_row_);
return CP_SERIALIZE_TEXT(table_table_row_, bXmlEncode);
}
void table_table_rows::add_attributes( const xml::attributes_wc_ptr & Attributes )
@ -527,9 +527,9 @@ void table_table_rows::add_child_element( xml::sax * Reader, const std::wstring
const wchar_t * table_table_header_rows::ns = L"table";
const wchar_t * table_table_header_rows::name = L"table-header-rows";
std::wostream & table_table_header_rows::text_to_stream(std::wostream & _Wostream) const
std::wostream & table_table_header_rows::text_to_stream(std::wostream & _Wostream, bool bXmlEncode) const
{
return serialize_elements_text(_Wostream, table_table_row_);
return serialize_elements_text(_Wostream, table_table_row_, bXmlEncode);
}
void table_table_header_rows::add_attributes( const xml::attributes_wc_ptr & Attributes )
@ -552,12 +552,12 @@ void table_table_header_rows::add_text(const std::wstring & Text)
//////////////////////////////////////////////////////////////////////////////////////////////////
// table:rows
std::wostream & table_rows::text_to_stream(std::wostream & _Wostream) const
std::wostream & table_rows::text_to_stream(std::wostream & _Wostream, bool bXmlEncode) const
{
if (table_table_rows_)
CP_SERIALIZE_TEXT(table_table_rows_);
CP_SERIALIZE_TEXT(table_table_rows_, bXmlEncode);
else
CP_SERIALIZE_TEXT(table_table_row_);
CP_SERIALIZE_TEXT(table_table_row_, bXmlEncode);
return _Wostream;
}
@ -628,10 +628,10 @@ table_rows_no_group::table_rows_no_group() : was_header_(false)
{
};
std::wostream & table_rows_no_group::text_to_stream(std::wostream & _Wostream) const
std::wostream & table_rows_no_group::text_to_stream(std::wostream & _Wostream, bool bXmlEncode) const
{
table_rows_1_.text_to_stream(_Wostream);
CP_SERIALIZE_TEXT(table_table_header_rows_);
CP_SERIALIZE_TEXT(table_table_header_rows_, bXmlEncode);
table_rows_2_.text_to_stream(_Wostream);
return _Wostream;
}
@ -663,9 +663,9 @@ table_rows_and_groups::table_rows_and_groups()
{
}
std::wostream & table_rows_and_groups::text_to_stream(std::wostream & _Wostream) const
std::wostream & table_rows_and_groups::text_to_stream(std::wostream & _Wostream, bool bXmlEncode) const
{
CP_SERIALIZE_TEXT(content_);
CP_SERIALIZE_TEXT(content_, bXmlEncode);
return _Wostream;
}
@ -706,9 +706,9 @@ void table_rows_and_groups::add_child_element( xml::sax * Reader, const std::wst
const wchar_t * table_table_row_group::ns = L"table";
const wchar_t * table_table_row_group::name = L"table-row-group";
std::wostream & table_table_row_group::text_to_stream(std::wostream & _Wostream) const
std::wostream & table_table_row_group::text_to_stream(std::wostream & _Wostream, bool bXmlEncode) const
{
return table_rows_and_groups_.text_to_stream(_Wostream);
return table_rows_and_groups_.text_to_stream(_Wostream, bXmlEncode);
}
void table_table_row_group::add_attributes( const xml::attributes_wc_ptr & Attributes )

View File

@ -356,7 +356,7 @@ public:
virtual void xlsx_convert(oox::xlsx_conversion_context & Context);
virtual void pptx_convert(oox::pptx_conversion_context & Context) ;
virtual std::wostream & text_to_stream(std::wostream & _Wostream) const;
virtual std::wostream & text_to_stream(std::wostream & _Wostream, bool bXmlEncode = true) const;
private:
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
@ -375,7 +375,7 @@ CP_REGISTER_OFFICE_ELEMENT2(table_table_row);
class table_table_cell_content
{
public:
std::wostream & text_to_stream(std::wostream & _Wostream) const;
std::wostream & text_to_stream(std::wostream & _Wostream, bool bXmlEncode = true) const;
void add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name, document_context * Context);
bool docx_convert(oox::docx_conversion_context & Context) ;
@ -404,7 +404,7 @@ public:
virtual void xlsx_convert(oox::xlsx_conversion_context & Context) ;
virtual void pptx_convert(oox::pptx_conversion_context & Context) ;
virtual std::wostream & text_to_stream(std::wostream & _Wostream) const;
virtual std::wostream & text_to_stream(std::wostream & _Wostream, bool bXmlEncode = true) const;
private:
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
@ -439,7 +439,7 @@ public:
virtual void pptx_convert(oox::pptx_conversion_context & Context) ;
virtual void xlsx_convert(oox::xlsx_conversion_context & Context) ;
virtual std::wostream & text_to_stream(std::wostream & _Wostream) const;
virtual std::wostream & text_to_stream(std::wostream & _Wostream, bool bXmlEncode = true) const;
private:
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
@ -475,7 +475,7 @@ public:
table_table_rows()
{
}
virtual std::wostream & text_to_stream(std::wostream & _Wostream) const;
virtual std::wostream & text_to_stream(std::wostream & _Wostream, bool bXmlEncode = true) const;
private:
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
@ -501,7 +501,7 @@ public:
virtual void xlsx_convert(oox::xlsx_conversion_context & Context) ;
virtual void pptx_convert(oox::pptx_conversion_context & Context) ;
virtual std::wostream & text_to_stream(std::wostream & _Wostream) const;
virtual std::wostream & text_to_stream(std::wostream & _Wostream, bool bXmlEncode = true) const;
private:
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
@ -517,7 +517,7 @@ CP_REGISTER_OFFICE_ELEMENT2(table_table_header_rows);
class table_rows
{
public:
std::wostream & text_to_stream(std::wostream & _Wostream) const;
std::wostream & text_to_stream(std::wostream & _Wostream, bool bXmlEncode = true) const;
void add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name, document_context * Context);
void docx_convert(oox::docx_conversion_context & Context);
@ -549,7 +549,7 @@ public:
table_rows_no_group();
std::wostream & text_to_stream(std::wostream & _Wostream) const;
std::wostream & text_to_stream(std::wostream & _Wostream, bool bXmlEncode = true) const;
void add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name, document_context * Context);
void docx_convert(oox::docx_conversion_context & Context);
@ -568,7 +568,7 @@ class table_rows_and_groups
{
public:
table_rows_and_groups();
std::wostream & text_to_stream(std::wostream & _Wostream) const;
std::wostream & text_to_stream(std::wostream & _Wostream, bool bXmlEncode = true) const;
void add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name, document_context * Context);
@ -606,7 +606,7 @@ public:
{
}
virtual void xlsx_convert(oox::xlsx_conversion_context & Context) ;
virtual std::wostream & text_to_stream(std::wostream & _Wostream) const;
virtual std::wostream & text_to_stream(std::wostream & _Wostream, bool bXmlEncode = true) const;
private:
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );

View File

@ -122,9 +122,9 @@ void process_paragraph_index(const paragraph_attrs & Attr, oox::docx_conversion_
}
std::wostream & paragraph::text_to_stream(std::wostream & _Wostream) const
std::wostream & paragraph::text_to_stream(std::wostream & _Wostream, bool bXmlEncode) const
{
CP_SERIALIZE_TEXT(content_);
CP_SERIALIZE_TEXT(content_, bXmlEncode);
//_Wostream << L"\n";
return _Wostream;
}
@ -255,7 +255,7 @@ void paragraph::docx_convert(oox::docx_conversion_context & Context)
if (sequence_)
{
std::wstringstream _Wostream;
CP_SERIALIZE_TEXT(content_);///todooo
CP_SERIALIZE_TEXT(content_, true);///todooo
Context.get_drawing_context().set_next_object_caption(_Wostream.str());
}
@ -431,9 +431,9 @@ void soft_page_break::docx_convert(oox::docx_conversion_context & Context)
//////////////////////////////////////////////
std::wostream & h::text_to_stream(std::wostream & _Wostream) const
std::wostream & h::text_to_stream(std::wostream & _Wostream, bool bXmlEncode) const
{
return paragraph_.text_to_stream(_Wostream);
return paragraph_.text_to_stream(_Wostream, bXmlEncode);
}
void h::add_attributes( const xml::attributes_wc_ptr & Attributes )
@ -485,9 +485,9 @@ void h::pptx_convert(oox::pptx_conversion_context & Context)
const wchar_t * p::ns = L"text";
const wchar_t * p::name = L"p";
std::wostream & p::text_to_stream(std::wostream & _Wostream) const
std::wostream & p::text_to_stream(std::wostream & _Wostream, bool bXmlEncode) const
{
return paragraph_.text_to_stream(_Wostream);
return paragraph_.text_to_stream(_Wostream, bXmlEncode);
}
void p::add_attributes( const xml::attributes_wc_ptr & Attributes )
@ -531,11 +531,11 @@ void p::afterReadContent()
const wchar_t * list::ns = L"text";
const wchar_t * list::name = L"list";
std::wostream & list::text_to_stream(std::wostream & _Wostream) const
std::wostream & list::text_to_stream(std::wostream & _Wostream, bool bXmlEncode) const
{
for (size_t i = 0; i < list_items_.size(); i++)
{
list_items_[i]->text_to_stream(_Wostream);
list_items_[i]->text_to_stream(_Wostream, bXmlEncode);
}
return _Wostream;
}
@ -599,7 +599,7 @@ void list::pptx_convert(oox::pptx_conversion_context & Context)
const wchar_t * soft_page_break::ns = L"text";
const wchar_t * soft_page_break::name = L"soft-page-break";
std::wostream & soft_page_break::text_to_stream(std::wostream & _Wostream) const
std::wostream & soft_page_break::text_to_stream(std::wostream & _Wostream, bool bXmlEncode) const
{
_Wostream << L"\n";
return _Wostream;
@ -618,9 +618,9 @@ void soft_page_break::add_child_element( xml::sax * Reader, const std::wstring &
const wchar_t * section::ns = L"text";
const wchar_t * section::name = L"section";
std::wostream & section::text_to_stream(std::wostream & _Wostream) const
std::wostream & section::text_to_stream(std::wostream & _Wostream, bool bXmlEncode) const
{
return serialize_elements_text(_Wostream, content_);
return serialize_elements_text(_Wostream, content_, bXmlEncode);
}
void section::afterCreate()
@ -768,9 +768,9 @@ void section_source::add_child_element( xml::sax * Reader, const std::wstring &
const wchar_t * index_body::ns = L"text";
const wchar_t * index_body::name = L"index-body";
std::wostream & index_body::text_to_stream(std::wostream & _Wostream) const
std::wostream & index_body::text_to_stream(std::wostream & _Wostream, bool bXmlEncode) const
{
CP_SERIALIZE_TEXT(content_);
CP_SERIALIZE_TEXT(content_, bXmlEncode);
return _Wostream;
}
@ -829,9 +829,9 @@ void index_title::pptx_convert(oox::pptx_conversion_context & Context)
content_[i]->pptx_convert(Context);
}
}
std::wostream & index_title::text_to_stream(std::wostream & _Wostream) const
std::wostream & index_title::text_to_stream(std::wostream & _Wostream, bool bXmlEncode) const
{
CP_SERIALIZE_TEXT(content_);
CP_SERIALIZE_TEXT(content_, bXmlEncode);
return _Wostream;
}
@ -914,9 +914,9 @@ void table_of_content::pptx_convert(oox::pptx_conversion_context & Context)
}
std::wostream & table_of_content::text_to_stream(std::wostream & _Wostream) const
std::wostream & table_of_content::text_to_stream(std::wostream & _Wostream, bool bXmlEncode) const
{
CP_SERIALIZE_TEXT(index_body_);
CP_SERIALIZE_TEXT(index_body_, bXmlEncode);
return _Wostream;
}
// text:table-of-content-source
@ -1032,9 +1032,9 @@ void table_index::pptx_convert(oox::pptx_conversion_context & Context)
if (index_body_)
index_body_->pptx_convert(Context);
}
std::wostream & table_index::text_to_stream(std::wostream & _Wostream) const
std::wostream & table_index::text_to_stream(std::wostream & _Wostream, bool bXmlEncode) const
{
CP_SERIALIZE_TEXT(index_body_);
CP_SERIALIZE_TEXT(index_body_, bXmlEncode);
return _Wostream;
}
void table_index::add_attributes( const xml::attributes_wc_ptr & Attributes )
@ -1155,9 +1155,9 @@ void illustration_index::pptx_convert(oox::pptx_conversion_context & Context)
index_body_->pptx_convert(Context);
}
std::wostream & illustration_index::text_to_stream(std::wostream & _Wostream) const
std::wostream & illustration_index::text_to_stream(std::wostream & _Wostream, bool bXmlEncode) const
{
CP_SERIALIZE_TEXT(index_body_);
CP_SERIALIZE_TEXT(index_body_, bXmlEncode);
return _Wostream;
}
@ -1307,9 +1307,9 @@ void alphabetical_index::pptx_convert(oox::pptx_conversion_context & Context)
if (index_body_)
index_body_->pptx_convert(Context);
}
std::wostream & alphabetical_index::text_to_stream(std::wostream & _Wostream) const
std::wostream & alphabetical_index::text_to_stream(std::wostream & _Wostream, bool bXmlEncode) const
{
CP_SERIALIZE_TEXT(index_body_);
CP_SERIALIZE_TEXT(index_body_, bXmlEncode);
return _Wostream;
}
//----------------------------------------------------------------------------------------
@ -1418,9 +1418,9 @@ void object_index::pptx_convert(oox::pptx_conversion_context & Context)
if (index_body_)
index_body_->pptx_convert(Context);
}
std::wostream & object_index::text_to_stream(std::wostream & _Wostream) const
std::wostream & object_index::text_to_stream(std::wostream & _Wostream, bool bXmlEncode) const
{
CP_SERIALIZE_TEXT(index_body_);
CP_SERIALIZE_TEXT(index_body_, bXmlEncode);
return _Wostream;
}
void object_index::add_attributes( const xml::attributes_wc_ptr & Attributes )
@ -1531,9 +1531,9 @@ void user_index::pptx_convert(oox::pptx_conversion_context & Context)
if (index_body_)
index_body_->pptx_convert(Context);
}
std::wostream & user_index::text_to_stream(std::wostream & _Wostream) const
std::wostream & user_index::text_to_stream(std::wostream & _Wostream, bool bXmlEncode) const
{
CP_SERIALIZE_TEXT(index_body_);
CP_SERIALIZE_TEXT(index_body_, bXmlEncode);
return _Wostream;
}
void user_index::add_attributes( const xml::attributes_wc_ptr & Attributes )
@ -1692,9 +1692,9 @@ void bibliography::pptx_convert(oox::pptx_conversion_context & Context)
}
}
std::wostream & bibliography::text_to_stream(std::wostream & _Wostream) const
std::wostream & bibliography::text_to_stream(std::wostream & _Wostream, bool bXmlEncode) const
{
CP_SERIALIZE_TEXT(index_body_);
CP_SERIALIZE_TEXT(index_body_, bXmlEncode);
return _Wostream;
}
@ -1949,9 +1949,9 @@ void variable_input::add_text(const std::wstring & Text)
{
text_ = Text;
}
std::wostream & variable_input::text_to_stream(std::wostream & _Wostream) const
std::wostream & variable_input::text_to_stream(std::wostream & _Wostream, bool bXmlEncode) const
{
_Wostream << xml::utils::replace_text_to_xml( text_ );
_Wostream << xml::utils::replace_text_to_xml( text_, bXmlEncode );
return _Wostream;
}

View File

@ -53,7 +53,7 @@ class paragraph
public:
paragraph() : next_section_(false), next_end_section_(false), is_header_(false) {}
std::wostream & text_to_stream(std::wostream & _Wostream) const;
std::wostream & text_to_stream(std::wostream & _Wostream, bool bXmlEncode = true) const;
void add_attributes ( const xml::attributes_wc_ptr & Attributes );
void add_child_element ( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name, document_context * Context);
@ -110,7 +110,7 @@ public:
virtual void afterReadContent();
virtual std::wostream & text_to_stream(std::wostream & _Wostream) const;
virtual std::wostream & text_to_stream(std::wostream & _Wostream, bool bXmlEncode = true) const;
paragraph paragraph_;
@ -146,7 +146,7 @@ public:
virtual void afterReadContent();
virtual std::wostream & text_to_stream(std::wostream & _Wostream) const;
virtual std::wostream & text_to_stream(std::wostream & _Wostream, bool bXmlEncode = true) const;
p(){};
paragraph paragraph_;
@ -169,7 +169,7 @@ public:
static const ElementType type = typeTextList;
CPDOCCORE_DEFINE_VISITABLE();
virtual std::wostream & text_to_stream(std::wostream & _Wostream) const;
virtual std::wostream & text_to_stream(std::wostream & _Wostream, bool bXmlEncode = true) const;
list(){};
@ -200,7 +200,7 @@ public:
static const ElementType type = typeTextSoftPageBreak;
CPDOCCORE_DEFINE_VISITABLE();
virtual std::wostream & text_to_stream(std::wostream & _Wostream) const;
virtual std::wostream & text_to_stream(std::wostream & _Wostream, bool bXmlEncode = true) const;
void docx_convert(oox::docx_conversion_context & Context);
private:
@ -222,7 +222,7 @@ public:
void docx_convert(oox::docx_conversion_context & Context);
virtual std::wostream & text_to_stream(std::wostream & _Wostream) const;
virtual std::wostream & text_to_stream(std::wostream & _Wostream, bool bXmlEncode = true) const;
virtual void afterCreate();
virtual void afterReadContent();
@ -306,7 +306,7 @@ public:
void docx_convert(oox::docx_conversion_context & Context);
void pptx_convert(oox::pptx_conversion_context & Context) ;
virtual std::wostream & text_to_stream(std::wostream & _Wostream) const;
virtual std::wostream & text_to_stream(std::wostream & _Wostream, bool bXmlEncode = true) const;
private:
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
@ -336,7 +336,7 @@ public:
void docx_convert(oox::docx_conversion_context & Context);
void pptx_convert(oox::pptx_conversion_context & Context) ;
virtual std::wostream & text_to_stream(std::wostream & _Wostream) const;
virtual std::wostream & text_to_stream(std::wostream & _Wostream, bool bXmlEncode = true) const;
private:
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
@ -368,7 +368,7 @@ public:
void docx_convert(oox::docx_conversion_context & Context);
void pptx_convert(oox::pptx_conversion_context & Context) ;
virtual std::wostream & text_to_stream(std::wostream & _Wostream) const;
virtual std::wostream & text_to_stream(std::wostream & _Wostream, bool bXmlEncode = true) const;
private:
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
@ -400,7 +400,7 @@ public:
void docx_convert(oox::docx_conversion_context & Context);
void pptx_convert(oox::pptx_conversion_context & Context) ;
virtual std::wostream & text_to_stream(std::wostream & _Wostream) const;
virtual std::wostream & text_to_stream(std::wostream & _Wostream, bool bXmlEncode = true) const;
private:
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
@ -432,7 +432,7 @@ public:
void docx_convert(oox::docx_conversion_context & Context);
void pptx_convert(oox::pptx_conversion_context & Context) ;
virtual std::wostream & text_to_stream(std::wostream & _Wostream) const;
virtual std::wostream & text_to_stream(std::wostream & _Wostream, bool bXmlEncode = true) const;
private:
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
@ -464,7 +464,7 @@ public:
void docx_convert(oox::docx_conversion_context & Context);
void pptx_convert(oox::pptx_conversion_context & Context) ;
virtual std::wostream & text_to_stream(std::wostream & _Wostream) const;
virtual std::wostream & text_to_stream(std::wostream & _Wostream, bool bXmlEncode = true) const;
private:
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
@ -496,7 +496,7 @@ public:
void docx_convert(oox::docx_conversion_context & Context);
void pptx_convert(oox::pptx_conversion_context & Context) ;
virtual std::wostream & text_to_stream(std::wostream & _Wostream) const;
virtual std::wostream & text_to_stream(std::wostream & _Wostream, bool bXmlEncode = true) const;
private:
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
@ -565,7 +565,7 @@ public:
void docx_convert(oox::docx_conversion_context & Context);
void pptx_convert(oox::pptx_conversion_context & Context) ;
virtual std::wostream & text_to_stream(std::wostream & _Wostream) const;
virtual std::wostream & text_to_stream(std::wostream & _Wostream, bool bXmlEncode = true) const;
office_element_ptr index_title_;
office_element_ptr_array content_;
@ -588,7 +588,7 @@ public:
void pptx_convert(oox::pptx_conversion_context & Context) ;
void docx_convert(oox::docx_conversion_context & Context);
virtual std::wostream & text_to_stream(std::wostream & _Wostream) const;
virtual std::wostream & text_to_stream(std::wostream & _Wostream, bool bXmlEncode = true) const;
private:
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
@ -814,7 +814,7 @@ public:
void docx_convert(oox::docx_conversion_context & Context);
virtual std::wostream & text_to_stream(std::wostream & _Wostream) const;
virtual std::wostream & text_to_stream(std::wostream & _Wostream, bool bXmlEncode = true) const;
private:
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
virtual void add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name){}

View File

@ -306,38 +306,18 @@
>
</File>
</Filter>
<Filter
Name="include"
>
<File
RelativePath="..\include\cpdoccore\xml\attributes.h"
>
</File>
<File
RelativePath="..\include\cpdoccore\xml\nodetype.h"
>
</File>
<File
RelativePath="..\include\cpdoccore\xml\sax.h"
>
</File>
<File
RelativePath="..\include\cpdoccore\xml\simple_xml_writer.h"
>
</File>
<File
RelativePath="..\include\cpdoccore\xml\xmlchar.h"
>
</File>
<File
RelativePath="..\include\cpdoccore\xml\xmlelement.h"
>
</File>
</Filter>
<File
RelativePath="..\src\xml\attributes.cpp"
>
</File>
<File
RelativePath="..\include\xml\attributes.h"
>
</File>
<File
RelativePath="..\include\xml\nodetype.h"
>
</File>
<File
RelativePath="..\src\xml\sax.cpp"
>
@ -350,6 +330,14 @@
/>
</FileConfiguration>
</File>
<File
RelativePath="..\include\xml\sax.h"
>
</File>
<File
RelativePath="..\include\xml\simple_xml_writer.h"
>
</File>
<File
RelativePath="..\src\xml\utils.cpp"
>
@ -363,13 +351,21 @@
</FileConfiguration>
</File>
<File
RelativePath="..\include\cpdoccore\xml\utils.h"
RelativePath="..\include\xml\utils.h"
>
</File>
<File
RelativePath="..\src\xml\xmlchar.cpp"
>
</File>
<File
RelativePath="..\include\xml\xmlchar.h"
>
</File>
<File
RelativePath="..\include\xml\xmlelement.h"
>
</File>
</Files>
<Globals>
</Globals>

View File

@ -89,26 +89,27 @@ struct SFileIdCluster
}
};
#if !defined(_WIN32) && !defined (_WIN64)
typedef struct tagPOINT
{
long x;
long y;
} POINT;
typedef struct tagSIZE
{
long cx;
long cy;
}SIZE;
typedef struct tagRECT
{
long left;
long top;
long right;
long bottom;
}RECT;
#endif
#ifndef customTagPoint
#define customTagPoint
typedef struct tagPOINT
{
_INT32 x;
_INT32 y;
} POINT;
typedef struct tagRECT
{
_INT32 left;
_INT32 top;
_INT32 right;
_INT32 bottom;
} RECT;
typedef struct tagSIZE
{
_INT32 cx;
_INT32 cy;
}SIZE;
#endif
#endif
namespace Gdiplus
{

View File

@ -38,6 +38,7 @@
#include "../../Common/common.h"
#include "../Auxiliary/HelpFunc.h"
#include "../../../../ASCOfficeDocFile/DocDocxConverter/OfficeDrawing/Record.h"
namespace XLS
{

View File

@ -62,6 +62,15 @@ void Theme::readFields(CFRecord& record)
if (dwThemeVersion == 124226)
{
//default theme
global_info->sTheme = \
"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\
<a:theme xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" name=\"Theme Office\">\
<a:themeElements>\
<a:clrScheme name=\"Standard\"><a:dk1><a:sysClr val=\"windowText\" lastClr=\"000000\"/></a:dk1><a:lt1><a:sysClr val=\"window\" lastClr=\"FFFFFF\"/></a:lt1><a:dk2><a:srgbClr val=\"1F497D\"/></a:dk2><a:lt2><a:srgbClr val=\"EEECE1\"/></a:lt2><a:accent1><a:srgbClr val=\"4F81BD\"/></a:accent1><a:accent2><a:srgbClr val=\"C0504D\"/></a:accent2><a:accent3><a:srgbClr val=\"9BBB59\"/></a:accent3><a:accent4><a:srgbClr val=\"8064A2\"/></a:accent4><a:accent5><a:srgbClr val=\"4BACC6\"/></a:accent5><a:accent6><a:srgbClr val=\"F79646\"/></a:accent6><a:hlink><a:srgbClr val=\"0000FF\"/></a:hlink><a:folHlink><a:srgbClr val=\"800080\"/></a:folHlink></a:clrScheme>\
<a:fontScheme name=\"Standard\"><a:majorFont><a:latin typeface=\"Cambria\" panose=\"020F0302020204030204\"/><a:ea typeface=\"\"/><a:cs typeface=\"\"/><a:font script=\"Jpan\" typeface=\" Pゴシック\"/><a:font script=\"Hang\" typeface=\"맑은 고딕\"/><a:font script=\"Hans\" typeface=\"宋体\"/><a:font script=\"Hant\" typeface=\"新細明體\"/><a:font script=\"Arab\" typeface=\"Times New Roman\"/><a:font script=\"Hebr\" typeface=\"Times New Roman\"/><a:font script=\"Thai\" typeface=\"Tahoma\"/><a:font script=\"Ethi\" typeface=\"Nyala\"/><a:font script=\"Beng\" typeface=\"Vrinda\"/><a:font script=\"Gujr\" typeface=\"Shruti\"/><a:font script=\"Khmr\" typeface=\"MoolBoran\"/><a:font script=\"Knda\" typeface=\"Tunga\"/><a:font script=\"Guru\" typeface=\"Raavi\"/><a:font script=\"Cans\" typeface=\"Euphemia\"/><a:font script=\"Cher\" typeface=\"Plantagenet Cherokee\"/><a:font script=\"Yiii\" typeface=\"Microsoft Yi Baiti\"/><a:font script=\"Tibt\" typeface=\"Microsoft Himalaya\"/><a:font script=\"Thaa\" typeface=\"MV Boli\"/><a:font script=\"Deva\" typeface=\"Mangal\"/><a:font script=\"Telu\" typeface=\"Gautami\"/><a:font script=\"Taml\" typeface=\"Latha\"/><a:font script=\"Syrc\" typeface=\"Estrangelo Edessa\"/><a:font script=\"Orya\" typeface=\"Kalinga\"/><a:font script=\"Mlym\" typeface=\"Kartika\"/><a:font script=\"Laoo\" typeface=\"DokChampa\"/><a:font script=\"Sinh\" typeface=\"Iskoola Pota\"/><a:font script=\"Mong\" typeface=\"Mongolian Baiti\"/><a:font script=\"Viet\" typeface=\"Times New Roman\"/><a:font script=\"Uigh\" typeface=\"Microsoft Uighur\"/><a:font script=\"Geor\" typeface=\"Sylfaen\"/></a:majorFont><a:minorFont><a:latin typeface=\"Calibri\" panose=\"020F0502020204030204\"/><a:ea typeface=\"\"/><a:cs typeface=\"\"/><a:font script=\"Jpan\" typeface=\" Pゴシック\"/><a:font script=\"Hang\" typeface=\"맑은 고딕\"/><a:font script=\"Hans\" typeface=\"宋体\"/><a:font script=\"Hant\" typeface=\"新細明體\"/><a:font script=\"Arab\" typeface=\"Arial\"/><a:font script=\"Hebr\" typeface=\"Arial\"/><a:font script=\"Thai\" typeface=\"Tahoma\"/><a:font script=\"Ethi\" typeface=\"Nyala\"/><a:font script=\"Beng\" typeface=\"Vrinda\"/><a:font script=\"Gujr\" typeface=\"Shruti\"/><a:font script=\"Khmr\" typeface=\"DaunPenh\"/><a:font script=\"Knda\" typeface=\"Tunga\"/><a:font script=\"Guru\" typeface=\"Raavi\"/><a:font script=\"Cans\" typeface=\"Euphemia\"/><a:font script=\"Cher\" typeface=\"Plantagenet Cherokee\"/><a:font script=\"Yiii\" typeface=\"Microsoft Yi Baiti\"/><a:font script=\"Tibt\" typeface=\"Microsoft Himalaya\"/><a:font script=\"Thaa\" typeface=\"MV Boli\"/><a:font script=\"Deva\" typeface=\"Mangal\"/><a:font script=\"Telu\" typeface=\"Gautami\"/><a:font script=\"Taml\" typeface=\"Latha\"/><a:font script=\"Syrc\" typeface=\"Estrangelo Edessa\"/><a:font script=\"Orya\" typeface=\"Kalinga\"/><a:font script=\"Mlym\" typeface=\"Kartika\"/><a:font script=\"Laoo\" typeface=\"DokChampa\"/><a:font script=\"Sinh\" typeface=\"Iskoola Pota\"/><a:font script=\"Mong\" typeface=\"Mongolian Baiti\"/><a:font script=\"Viet\" typeface=\"Arial\"/><a:font script=\"Uigh\" typeface=\"Microsoft Uighur\"/><a:font script=\"Geor\" typeface=\"Sylfaen\"/></a:minorFont></a:fontScheme>\
<a:fmtScheme name=\"Standard\"><a:fillStyleLst><a:solidFill><a:schemeClr val=\"phClr\"/></a:solidFill><a:gradFill rotWithShape=\"1\"><a:gsLst><a:gs pos=\"0\"><a:schemeClr val=\"phClr\"><a:tint val=\"50000\"/><a:satMod val=\"300000\"/></a:schemeClr></a:gs><a:gs pos=\"35000\"><a:schemeClr val=\"phClr\"><a:tint val=\"37000\"/><a:satMod val=\"300000\"/></a:schemeClr></a:gs><a:gs pos=\"100000\"><a:schemeClr val=\"phClr\"><a:tint val=\"15000\"/><a:satMod val=\"350000\"/></a:schemeClr></a:gs></a:gsLst><a:lin ang=\"16200000\" scaled=\"1\"/></a:gradFill><a:gradFill rotWithShape=\"1\"><a:gsLst><a:gs pos=\"0\"><a:schemeClr val=\"phClr\"><a:shade val=\"51000\"/><a:satMod val=\"130000\"/></a:schemeClr></a:gs><a:gs pos=\"80000\"><a:schemeClr val=\"phClr\"><a:shade val=\"93000\"/><a:satMod val=\"130000\"/></a:schemeClr></a:gs><a:gs pos=\"100000\"><a:schemeClr val=\"phClr\"><a:shade val=\"94000\"/><a:satMod val=\"135000\"/></a:schemeClr></a:gs></a:gsLst><a:lin ang=\"16200000\" scaled=\"0\"/></a:gradFill></a:fillStyleLst><a:lnStyleLst><a:ln w=\"9525\" cap=\"flat\" cmpd=\"sng\" algn=\"ctr\"><a:solidFill><a:schemeClr val=\"phClr\"><a:shade val=\"95000\"/><a:satMod val=\"105000\"/></a:schemeClr></a:solidFill><a:prstDash val=\"solid\"/></a:ln><a:ln w=\"25400\" cap=\"flat\" cmpd=\"sng\" algn=\"ctr\"><a:solidFill><a:schemeClr val=\"phClr\"/></a:solidFill><a:prstDash val=\"solid\"/></a:ln><a:ln w=\"38100\" cap=\"flat\" cmpd=\"sng\" algn=\"ctr\"><a:solidFill><a:schemeClr val=\"phClr\"/></a:solidFill><a:prstDash val=\"solid\"/></a:ln></a:lnStyleLst><a:effectStyleLst><a:effectStyle><a:effectLst><a:outerShdw blurRad=\"40000\" dist=\"20000\" dir=\"5400000\" rotWithShape=\"0\"><a:srgbClr val=\"000000\"><a:alpha val=\"38000\"/></a:srgbClr></a:outerShdw></a:effectLst></a:effectStyle><a:effectStyle><a:effectLst><a:outerShdw blurRad=\"40000\" dist=\"23000\" dir=\"5400000\" rotWithShape=\"0\"><a:srgbClr val=\"000000\"><a:alpha val=\"35000\"/></a:srgbClr></a:outerShdw></a:effectLst></a:effectStyle><a:effectStyle><a:effectLst><a:outerShdw blurRad=\"40000\" dist=\"23000\" dir=\"5400000\" rotWithShape=\"0\"><a:srgbClr val=\"000000\"><a:alpha val=\"35000\"/></a:srgbClr></a:outerShdw></a:effectLst><a:scene3d><a:camera prst=\"orthographicFront\"><a:rot lat=\"0\" lon=\"0\" rev=\"0\"/></a:camera><a:lightRig rig=\"threePt\" dir=\"t\"><a:rot lat=\"0\" lon=\"0\" rev=\"1200000\"/></a:lightRig></a:scene3d><a:sp3d><a:bevelT w=\"63500\" h=\"25400\"/></a:sp3d></a:effectStyle></a:effectStyleLst><a:bgFillStyleLst><a:solidFill><a:schemeClr val=\"phClr\"/></a:solidFill><a:gradFill rotWithShape=\"1\"><a:gsLst><a:gs pos=\"0\"><a:schemeClr val=\"phClr\"><a:tint val=\"40000\"/><a:satMod val=\"350000\"/></a:schemeClr></a:gs><a:gs pos=\"40000\"><a:schemeClr val=\"phClr\"><a:tint val=\"45000\"/><a:shade val=\"99000\"/><a:satMod val=\"350000\"/></a:schemeClr></a:gs><a:gs pos=\"100000\"><a:schemeClr val=\"phClr\"><a:shade val=\"20000\"/><a:satMod val=\"255000\"/></a:schemeClr></a:gs></a:gsLst><a:path path=\"circle\"><a:fillToRect l=\"50000\" t=\"-80000\" r=\"50000\" b=\"180000\"/></a:path></a:gradFill><a:gradFill rotWithShape=\"1\"><a:gsLst><a:gs pos=\"0\"><a:schemeClr val=\"phClr\"><a:tint val=\"80000\"/><a:satMod val=\"300000\"/></a:schemeClr></a:gs><a:gs pos=\"100000\"><a:schemeClr val=\"phClr\"><a:shade val=\"30000\"/><a:satMod val=\"200000\"/></a:schemeClr></a:gs></a:gsLst><a:path path=\"circle\"><a:fillToRect l=\"50000\" t=\"50000\" r=\"50000\" b=\"50000\"/></a:path></a:gradFill></a:bgFillStyleLst></a:fmtScheme>\
</a:themeElements>\
<a:objectDefaults/><a:extraClrSchemeLst/></a:theme>";
}
else
{
@ -91,18 +100,21 @@ void Theme::readFields(CFRecord& record)
if (hresult != S_OK || pBuffer == NULL)
hresult = OfficeUtils.LoadFileFromArchive(tempThemePath, L"theme/theme/theme1.xml", &pBuffer, nBufferSize);
//??? переписать по нормальному
if (hresult == S_OK && pBuffer != NULL)
{
global_info->sTheme = std::string((char*)pBuffer, nBufferSize);
global_info->m_pTheme = boost::shared_ptr<PPTX::Theme>(new PPTX::Theme(NULL, global_info->sTheme));
delete []pBuffer;
pBuffer = NULL;
}
}
if (false == global_info->sTheme.empty())
{
global_info->m_pTheme = boost::shared_ptr<PPTX::Theme>(new PPTX::Theme(NULL, global_info->sTheme));
}
}
} // namespace XLS

View File

@ -88,7 +88,41 @@ void BiffString::load(CFRecord& record)
// EXCEPT::LE::WhatIsTheFuck("Wrong usage of BiffString. Stack overflow stopped.", __FUNCTION__);
// record >> *this; // :-)
}
void BiffString::load(IBinaryReader* reader)
{
}
void BiffString::load(IBinaryReader* reader, const size_t cch1, const bool is_wide1)
{
bool is_wide = is_wide1;
size_t cch = cch1;
if ((cch_) && (*cch_ != cch1) && cch1 < 1)
{
cch = cch_.get();
}
size_t raw_length = cch << (is_wide ? 1 : 0);
if (reader->GetPosition() + cch > reader->GetSize())
{
//ОШИБКА - нехватило Continue records - нужно найти место где именно и подзагрузить
return;
}
unsigned char* pData = reader->ReadBytes(cch, true);
if(is_wide)
{
#if defined(_WIN32) || defined(_WIN64)
str_ = std::wstring((wchar_t*)pData, cch);
#else
str_ = convertUtf16ToWString((UTF16*)pData, cch);
#endif
}
else
{
}
delete []pData;
}
void BiffString::load(CFRecord& record, const size_t cch1, const bool is_wide1)
{
@ -241,5 +275,35 @@ void XLUnicodeStringSegmented::load(CFRecord& record)
strTotal += arStrings.back();
}
}
void XLUnicodeStringSegmented::load(IBinaryReader* reader)
{
cchTotal = reader->ReadUInt32();
if (cchTotal < 1) return;
if (cchTotal > reader->GetSize() - reader->GetPosition())
{
cchTotal = cchTotal >> 8;
}
_UINT32 cchTotal_test = 0;
while(true)
{
if (reader->GetPosition() >= reader->GetSize())
break;
if (cchTotal_test >= cchTotal)
break;
_UINT32 max_string_size = cchTotal - cchTotal_test;
XLUnicodeString string;
string.load(reader);
arStrings.push_back(string.value());
cchTotal_test += arStrings.back().length();
strTotal += arStrings.back();
}
}
} // namespace XLS

View File

@ -70,7 +70,9 @@ public:
BiffStructurePtr clone();
virtual void load(CFRecord& record);
virtual void load(IBinaryReader* reader);
void load(IBinaryReader* reader, const size_t cch1, const bool is_wide1);
void load(CFRecord& record, const size_t cch, const bool is_wide);
void setSize(const size_t size); // Set cch for string that don't have own cch field
@ -222,6 +224,7 @@ public:
BiffStructurePtr clone();
virtual void load(CFRecord& record);
virtual void load(IBinaryReader* reader);
static const ElementType type = typeStringSegmented;

View File

@ -35,11 +35,11 @@
namespace XLS
{
// this function will never be called ( look at operator>>(CFRecord& record, T& val))
void BiffStructure_NoVtbl::load(CFRecord& record)
{
// EXCEPT::LE::HowCouldItHappen("Unexpected behaviour.", __FUNCTION__);
}
void BiffStructure_NoVtbl::load(IBinaryReader* reader)
{
}

View File

@ -48,7 +48,7 @@ class BiffStructure_NoVtbl
{
public:
void load(CFRecord& record); // this function will never be called ( look at operator>>(CFRecord& record, T& val))
void load(IBinaryReader* reader);
};
class BiffStructure;
@ -62,7 +62,10 @@ public:
virtual BiffStructurePtr clone() = 0;
virtual void load(CFRecord& record) = 0;
virtual void load(IBinaryReader* reader)
{
}
virtual ElementType get_type() = 0;
virtual int serialize(std::wostream & _stream)

View File

@ -67,6 +67,7 @@ std::size_t hash_value(BorderInfo const & val)
std::size_t hash_value(FontInfo const & val)
{
std::size_t seed = 0;
boost::hash_combine(seed, val.dyHeight);
boost::hash_combine(seed, val.fItalic);
boost::hash_combine(seed, val.fStrikeOut);
boost::hash_combine(seed, val.fOutline);
@ -91,6 +92,7 @@ std::size_t hash_value(FontInfo const & val)
bool FontInfo::operator == (const FontInfo & rVal) const
{
const bool res =
dyHeight== rVal.dyHeight &&
name == rVal.name &&
scheme == rVal.scheme &&
fItalic == rVal.fItalic &&

View File

@ -65,6 +65,13 @@ void FixedPoint::load(XLS::CFRecord& record)
dVal = Integral + Fractional/65536.;
}
void FixedPoint::load(IBinaryReader* reader)
{
Fractional = reader->ReadUInt16();
Integral = reader->ReadInt16();
dVal = Integral + Fractional/65536.;
}
} // namespace OSHARED

View File

@ -47,7 +47,7 @@ public:
XLS::BiffStructurePtr clone();
virtual void load(XLS::CFRecord& record);
virtual void load(IBinaryReader* reader);
short Integral;
unsigned short Fractional;

View File

@ -65,6 +65,48 @@ XLS::BiffStructurePtr HyperlinkMoniker::clone()
{
return XLS::BiffStructurePtr(new HyperlinkMoniker(*this));
}
void HyperlinkMoniker::load(IBinaryReader* reader)
{
_GUID_ clsid={};
clsid.Data1 = reader->ReadUInt32();
clsid.Data2 = reader->ReadUInt16();
clsid.Data3 = reader->ReadUInt16();
unsigned char* pData = reader->ReadBytes(8, true);
memcpy(clsid.Data4, pData, 8) ;
delete pData;
if(URLMoniker_CLSID == clsid)
{
data.reset(new URLMoniker);
}
else if (FileMoniker_CLSID == clsid)
{
data.reset(new FileMoniker);
}
else if (CompositeMoniker_CLSID == clsid)
{
data.reset(new CompositeMoniker);
}
else if (AntiMoniker_CLSID == clsid)
{
data.reset(new AntiMoniker);
}
else if (ItemMoniker_CLSID == clsid)
{
data.reset(new ItemMoniker);
}
else
{
//throw;
}
if (data)
{
data->load(reader);
}
}
void HyperlinkMoniker::load(XLS::CFRecord& record)
{

View File

@ -45,7 +45,7 @@ public:
XLS::BiffStructurePtr clone();
virtual void load(XLS::CFRecord& record);
virtual void load(IBinaryReader* reader);
static const XLS::ElementType type = XLS::typeHyperlinkMoniker;

View File

@ -31,18 +31,15 @@
*/
#include "HyperlinkObject.h"
#include <Binary/CFRecord.h>
//#include <Exception/AttributeDataWrong.h>
#include "../../Binary/CFRecord.h"
namespace OSHARED
{
XLS::BiffStructurePtr HyperlinkObject::clone()
{
return XLS::BiffStructurePtr(new HyperlinkObject(*this));
}
void HyperlinkObject::load(XLS::CFRecord& record)
{
_UINT32 flags;
@ -93,5 +90,64 @@ void HyperlinkObject::load(XLS::CFRecord& record)
}
void HyperlinkObject::load(IBinaryReader* reader)
{
streamVersion = reader->ReadUInt32();
_UINT32 flags = reader->ReadUInt32();
hlstmfHasMoniker = GETBIT(flags, 0);
hlstmfIsAbsolute = GETBIT(flags, 1);
hlstmfSiteGaveDisplayName = GETBIT(flags, 2);
hlstmfHasLocationStr = GETBIT(flags, 3);
hlstmfHasDisplayName = GETBIT(flags, 4);
hlstmfHasGUID = GETBIT(flags, 5);
hlstmfHasCreationTime = GETBIT(flags, 6);
hlstmfHasFrameName = GETBIT(flags, 7);
hlstmfMonikerSavedAsStr = GETBIT(flags, 8);
hlstmfAbsFromGetdataRel = GETBIT(flags, 9);
if(hlstmfHasDisplayName)
{
displayName.load(reader);
}
if(hlstmfHasFrameName)
{
targetFrameName.load(reader);
}
if(hlstmfHasMoniker && hlstmfMonikerSavedAsStr)
{
moniker.load(reader);
}
if(hlstmfHasMoniker && !hlstmfMonikerSavedAsStr)
{
oleMoniker.load(reader);
}
if(hlstmfHasLocationStr)
{
location.load(reader);
}
if(hlstmfHasGUID)
{
_GUID_ guid_num;
guid_num.Data1 = reader->ReadUInt32();
guid_num.Data2 = reader->ReadUInt16();
guid_num.Data3 = reader->ReadUInt16();
unsigned char* pData = reader->ReadBytes(8, true);
memcpy(guid_num.Data4, pData, 8) ;
delete pData;
guid = STR::guid2bstr(guid_num);
}
if(hlstmfHasCreationTime)
{
fileTime.dwLowDateTime = reader->ReadUInt32();
fileTime.dwHighDateTime = reader->ReadUInt32();
}
}
} // namespace OSHARED

View File

@ -31,9 +31,8 @@
*/
#pragma once
#include "BiffStructure.h"
#include <Logic/Biff_structures/HyperlinkMoniker.h>
#include <Logic/Biff_structures/BiffString.h>
#include "HyperlinkMoniker.h"
#include "BiffString.h"
#if !defined(_WIN32) && !defined(_WIN64)
@ -57,11 +56,11 @@ public:
XLS::BiffStructurePtr clone();
virtual void load(XLS::CFRecord& record);
void load(IBinaryReader* reader);
_UINT32 streamVersion;
static const XLS::ElementType type = XLS::typeHyperlinkObject;
static const XLS::ElementType type = XLS::typeHyperlinkObject;
bool hlstmfHasMoniker;
bool hlstmfIsAbsolute;

View File

@ -49,7 +49,25 @@ class IMsoArray : public XLS::BiffStructure
public:
XLS::BiffStructurePtr clone(){return XLS::BiffStructurePtr(new IMsoArray(*this));}
static const XLS::ElementType type = XLS::typeIMsoArray;
static const XLS::ElementType type = XLS::typeIMsoArray;
void load(IBinaryReader* reader)
{
unsigned short nElems, nElemsAlloc;
unsigned short cbElem;
nElems = reader->ReadUInt16();
nElemsAlloc = reader->ReadUInt16();
cbElem = reader->ReadUInt16();
for (unsigned short i = 0; i < nElems; i++)
{
Type element(cbElem);
element.load(reader);
data.push_back(element);
}
}
virtual void load(XLS::CFRecord& record)
{

View File

@ -51,7 +51,15 @@ XLS::BiffStructurePtr MSOSHADECOLOR::clone()
{
return XLS::BiffStructurePtr(new MSOSHADECOLOR(*this));
}
void MSOSHADECOLOR::load(IBinaryReader* reader)
{
_UINT32 raw_color = reader->ReadUInt32();
color = OfficeArtCOLORREF(raw_color);
position.load(reader);
dPosition = position.Integral + position.Fractional / 65536.;
}
void MSOSHADECOLOR::load(XLS::CFRecord& record)
{
_UINT32 raw_color;

View File

@ -56,6 +56,7 @@ public:
static const XLS::ElementType type = XLS::typeMSOSHADECOLOR;
virtual void load(XLS::CFRecord& record);
virtual void load(IBinaryReader* reader);
unsigned short cbElement;

View File

@ -79,6 +79,15 @@ void OfficeArtBlip::readCompressedData(XLS::CFRecord& record, OfficeArtMetafileH
record.skipNunBytes(metafileHeader.cbSave);
}
void OfficeArtBlip::loadFields(IBinaryReader* reader)
{
OfficeArtRecordHeader rc_header;
rc_header.load(reader);
BYTE tag = 0xff;
recType = rc_header.recType;
bool isCompressed = false;
}
void OfficeArtBlip::loadFields(XLS::CFRecord& record)
{

View File

@ -55,6 +55,8 @@ public:
virtual void loadFields(XLS::CFRecord& record);
void loadFields(IBinaryReader* reader);
XLS::BiffStructurePtr clone()
{
return XLS::BiffStructurePtr(new OfficeArtBlip(recType));

View File

@ -117,6 +117,15 @@ XLS::BiffStructurePtr OfficeArtFOPTE::clone()
return XLS::BiffStructurePtr(new OfficeArtFOPTE(*this));
}
void OfficeArtFOPTE::load(IBinaryReader* _reader)
{
unsigned short flags = _reader->ReadUInt16();
op = _reader->ReadUInt32();
opid = GETBITS(flags, 0, 13);
fBid = GETBIT(flags, 14);
fComplex = GETBIT(flags, 15);
}
void OfficeArtFOPTE::load(XLS::CFRecord& record)
{
unsigned short flags;
@ -126,12 +135,8 @@ void OfficeArtFOPTE::load(XLS::CFRecord& record)
fBid = GETBIT(flags, 14);
fComplex = GETBIT(flags, 15);
}
OfficeArtFOPTEPtr OfficeArtFOPTE::load_and_create(XLS::CFRecord& record)
OfficeArtFOPTEPtr OfficeArtFOPTE::create(unsigned short opid)
{
const unsigned short* op = record.getCurData<unsigned short>();
unsigned short opid = GETBITS(*op, 0, 13);
OfficeArtFOPTEPtr fopte;
switch(opid)
{
@ -414,6 +419,9 @@ OfficeArtFOPTEPtr OfficeArtFOPTE::load_and_create(XLS::CFRecord& record)
/*todo*/case 0x0303: //cxstyle
fopte = OfficeArtFOPTEPtr(new OfficeArtFOPTE);
break;
case 0x030C:
fopte = OfficeArtFOPTEPtr(new xmlString);
break;
case 0x033F:
fopte = OfficeArtFOPTEPtr(new ShapeBooleanProperties);
break;
@ -424,6 +432,9 @@ OfficeArtFOPTEPtr OfficeArtFOPTE::load_and_create(XLS::CFRecord& record)
case 0x0382:
fopte = OfficeArtFOPTEPtr(new pihlShape);
break;
case 0x0383:
fopte = OfficeArtFOPTEPtr(new pWrapPolygonVertices);
break;
case 0x03A9:
fopte = OfficeArtFOPTEPtr(new metroBlob);
break;
@ -434,8 +445,34 @@ OfficeArtFOPTEPtr OfficeArtFOPTE::load_and_create(XLS::CFRecord& record)
fopte = OfficeArtFOPTEPtr(new OfficeArtFOPTE);
break;
}
return fopte;
}
fopte->load(record);
OfficeArtFOPTEPtr OfficeArtFOPTE::load_and_create(IBinaryReader* _reader)
{
if (!_reader) return OfficeArtFOPTEPtr();
long pos = _reader->GetPosition();
unsigned short opid = _reader->ReadUInt16();
opid = GETBITS(opid, 0, 13);
_reader->Seek(pos, 0);
OfficeArtFOPTEPtr fopte = create(opid);
if (fopte) fopte->load(_reader);
return fopte;
}
OfficeArtFOPTEPtr OfficeArtFOPTE::load_and_create(XLS::CFRecord& record)
{
const unsigned short* op = record.getCurData<unsigned short>();
unsigned short opid = GETBITS(*op, 0, 13);
OfficeArtFOPTEPtr fopte = create(opid);
if (fopte) fopte->load(record);
return fopte;
}
@ -456,15 +493,35 @@ void FixedPoint::load(XLS::CFRecord& record)
dVal = Integral + (Fractional / 65536.0);
}
void FixedPoint::load(IBinaryReader* reader)
{
OfficeArtFOPTE::load(reader);
short Integral = op >> 16;
unsigned short Fractional = op - (Integral << 16);
dVal = Integral + (Fractional / 65536.0);
}
void OfficeArtFOPTE::ReadComplexData(XLS::CFRecord& record)
{
record.skipNunBytes(op); // default is to skip complex data
}
void OfficeArtFOPTE::ReadComplexData(IBinaryReader* reader)
{
reader->ReadBytes( op, false ); // default is to skip complex data
}
void TextBooleanProperties::load(XLS::CFRecord& record)
{
OfficeArtFOPTE::load(record);
set();
}
void TextBooleanProperties::load(IBinaryReader* reader)
{
OfficeArtFOPTE::load(reader);
set();
}
void TextBooleanProperties::set()
{
fUsefFitShapeToText = GETBIT(op, 17);
fUsefAutoTextMargin = GETBIT(op, 19);
fUsefSelectText = GETBIT(op, 20);
@ -476,11 +533,19 @@ void TextBooleanProperties::load(XLS::CFRecord& record)
void GeometryTextBooleanProperties::load(XLS::CFRecord& record)
{
OfficeArtFOPTE::load(record);
set();
}
void GeometryTextBooleanProperties::load(IBinaryReader* reader)
{
OfficeArtFOPTE::load(reader);
set();
}
void GeometryTextBooleanProperties::set()
{
fUsegFReverseRows = GETBIT(op, 31);
fUsefGtext = GETBIT(op, 30);
fUsegFVertical = GETBIT(op, 29);
fUsegtextFKern = GETBIT(op, 28);
fUsegFKern = GETBIT(op, 28);
fUsegTight = GETBIT(op, 27);
fUsegFStretch = GETBIT(op, 26);
fUsegFShrinkFit = GETBIT(op, 25);
@ -511,10 +576,18 @@ void GeometryTextBooleanProperties::load(XLS::CFRecord& record)
fSmallcaps = GETBIT(op, 1);
fStrikethrough = GETBIT(op, 0);
}
void GroupShapeBooleanProperties::load(IBinaryReader* reader)
{
OfficeArtFOPTE::load(reader);
set();
}
void GroupShapeBooleanProperties::load(XLS::CFRecord& record)
{
OfficeArtFOPTE::load(record);
set();
}
void GroupShapeBooleanProperties::set()
{
fUsefLayoutInCell = GETBIT(op, 31);
fUsefIsBullet = GETBIT(op, 30);
fUsefStandardHR = GETBIT(op, 29);
@ -559,11 +632,28 @@ void fillShadeType::load(XLS::CFRecord& record)
msoshadeBand = GETBIT(op, 3);
msoshadeOneColor = GETBIT(op, 4);
}
void fillShadeType::load(IBinaryReader* reader)
{
OfficeArtFOPTE::load(reader);
msoshadeNone = GETBIT(op, 0);
msoshadeGamma = GETBIT(op, 1);
msoshadeSigma = GETBIT(op, 2);
msoshadeBand = GETBIT(op, 3);
msoshadeOneColor = GETBIT(op, 4);
}
void FillStyleBooleanProperties::load(XLS::CFRecord& record)
{
OfficeArtFOPTE::load(record);
set();
}
void FillStyleBooleanProperties::load(IBinaryReader* reader)
{
OfficeArtFOPTE::load(reader);
set();
}
void FillStyleBooleanProperties::set()
{
fNoFillHitTest = GETBIT(op, 0);
fillUseRect = GETBIT(op, 1);
fillShape = GETBIT(op, 2);
@ -580,7 +670,6 @@ void FillStyleBooleanProperties::load(XLS::CFRecord& record)
fUsefUseShapeAnchor = GETBIT(op, 21);
fUsefRecolorFillAsPicture = GETBIT(op, 22);
}
void fillBlip::ReadComplexData(XLS::CFRecord& record)
{
OfficeArtRecordHeader rh_child;
@ -591,7 +680,38 @@ void fillBlip::ReadComplexData(XLS::CFRecord& record)
blip = OfficeArtBlipPtr(new OfficeArtBlip(rh_child.recType));
blip->loadFields(record);
}
void fillBlip::ReadComplexData(IBinaryReader* reader)
{
long pos = reader->GetPosition();
OfficeArtRecordHeader rh_child;
rh_child.load(reader);
reader->Seek(pos, 0);
blip = OfficeArtBlipPtr(new OfficeArtBlip(rh_child.recType));
blip->loadFields(reader);
}
void anyString::ReadComplexData(IBinaryReader* reader)
{
unsigned char* pData = reader->ReadBytes(op, true);
#if defined(_WIN32) || defined(_WIN64)
string_ = std::wstring((wchar_t*)pData, op);
#else
string_ = convertUtf16ToWString((UTF16*)pData, op);
#endif
if (!string_.empty())
{
int i, length = (std::min)(op, (_INT32)string_.length());
for (i = 0; i < length; i++)
{
if (string_.at(i) < 14 ) break;
}
string_ = string_.substr(0, i);
}
delete []pData;
}
void anyString::ReadComplexData(XLS::CFRecord& record)
{
#if defined(_WIN32) || defined(_WIN64)
@ -614,14 +734,26 @@ void anyString::ReadComplexData(XLS::CFRecord& record)
void fillShadeColors::ReadComplexData(XLS::CFRecord& record)
{
fillShadeColors_complex.op = op;
record >> fillShadeColors_complex;
complex.op = op;
record >> complex;
}
void fillShadeColors::ReadComplexData(IBinaryReader* reader)
{
complex.op = op;
complex.load(reader);
}
void ProtectionBooleanProperties::load(IBinaryReader* reader)
{
OfficeArtFOPTE::load(reader);
set();
}
void ProtectionBooleanProperties::load(XLS::CFRecord& record)
{
OfficeArtFOPTE::load(record);
set();
}
void ProtectionBooleanProperties::set()
{
fLockAgainstGrouping = GETBIT(op, 0);
fLockAdjustHandles = GETBIT(op, 1);
fLockText = GETBIT(op, 2);
@ -645,10 +777,18 @@ void ProtectionBooleanProperties::load(XLS::CFRecord& record)
fUsefLockAgainstUngrouping = GETBIT(op, 25);
}
void LineStyleBooleanProperties::load(IBinaryReader* reader)
{
OfficeArtFOPTE::load(reader);
set();
}
void LineStyleBooleanProperties::load(XLS::CFRecord& record)
{
OfficeArtFOPTE::load(record);
set();
}
void LineStyleBooleanProperties::set()
{
fNoLineDrawDash = GETBIT(op, 0);
fLineFillShape = GETBIT(op, 1);
fHitTestLine = GETBIT(op, 2);
@ -666,21 +806,35 @@ void LineStyleBooleanProperties::load(XLS::CFRecord& record)
fUsefInsetPen = GETBIT(op, 22);
fUsefLineOpaqueBackColor= GETBIT(op, 25);
}
void ShadowStyleBooleanProperties::load(XLS::CFRecord& record)
{
OfficeArtFOPTE::load(record);
set();
}
void ShadowStyleBooleanProperties::load(IBinaryReader* reader)
{
OfficeArtFOPTE::load(reader);
set();
}
void ShadowStyleBooleanProperties::set()
{
fshadowObscured = GETBIT(op, 0);
fShadow = GETBIT(op, 1);
fUsefshadowObscured = GETBIT(op, 16);
fUsefShadow = GETBIT(op, 17);
}
void GeometryBooleanProperties::load(IBinaryReader* reader)
{
OfficeArtFOPTE::load(reader);
set();
}
void GeometryBooleanProperties::load(XLS::CFRecord& record)
{
OfficeArtFOPTE::load(record);
set();
}
void GeometryBooleanProperties::set()
{
fUsefShadowOK = GETBIT(op, 8);
fUsef3DOK = GETBIT(op, 9);
fUsefLineOK = GETBIT(op, 10);
@ -695,6 +849,54 @@ void GeometryBooleanProperties::load(XLS::CFRecord& record)
fFillShadeShapeOK = GETBIT(op, 26);
fFillOK = GETBIT(op, 27);
}
void ThreeDObjectBooleanProperties::load(IBinaryReader* reader)
{
OfficeArtFOPTE::load(reader);
set();
}
void ThreeDObjectBooleanProperties::load(XLS::CFRecord& record)
{
OfficeArtFOPTE::load(record);
set();
}
void ThreeDObjectBooleanProperties::set()
{
fUsef3D = GETBIT(op, 0);
fUsefc3DMetallic = GETBIT(op, 1);
fUsefc3DUseExtrusionColor = GETBIT(op, 2);
fUsefc3DLightFace = GETBIT(op, 3);
// 12 unused
f3D = GETBIT(op, 16);
fc3DMetallic = GETBIT(op, 17);
fc3DUseExtrusionColor = GETBIT(op, 18);
fc3DLightFace = GETBIT(op, 19);
}
void ThreeDStyleBooleanProperties::load(IBinaryReader* reader)
{
OfficeArtFOPTE::load(reader);
set();
}
void ThreeDStyleBooleanProperties::load(XLS::CFRecord& record)
{
OfficeArtFOPTE::load(record);
set();
}
void ThreeDStyleBooleanProperties::set()
{
fUsefc3DConstrainRotation = GETBIT(op, 0);
fUsefc3DRotationCenterAuto = GETBIT(op, 1);
fUsefc3DParallel = GETBIT(op, 2);
fUsefc3DKeyHarsh = GETBIT(op, 3);
fUsefc3DFillHarsh = GETBIT(op, 4);
fc3DConstrainRotation = GETBIT(op, 16);
fc3DRotationCenterAuto = GETBIT(op, 17);
fc3DParallel = GETBIT(op, 18);
fc3DKeyHarsh = GETBIT(op, 19);
fc3DFillHarsh = GETBIT(op, 20);
}
XLS::BiffStructurePtr IHlink::clone()
{
return XLS::BiffStructurePtr(new IHlink(*this));
@ -705,13 +907,48 @@ void IHlink::load(XLS::CFRecord& record)
record >> CLSID_StdHlink;
record >> hyperlink;
}
void IHlink::load(IBinaryReader* reader)
{
CLSID_StdHlink.Data1 = reader->ReadUInt32();
CLSID_StdHlink.Data2 = reader->ReadUInt16();
CLSID_StdHlink.Data3 = reader->ReadUInt16();
unsigned char* pData = reader->ReadBytes(8, true);
memcpy(CLSID_StdHlink.Data4, pData, 8) ;
delete pData;
hyperlink.load(reader);
}
void pihlShape::ReadComplexData(XLS::CFRecord& record)
{
int pos = record.getRdPtr();
record >> complex;
}
void pihlShape::ReadComplexData(IBinaryReader* reader)
{
complex.load(reader);
}
void xmlString::ReadComplexData(IBinaryReader* reader)
{
unsigned char* pData = reader->ReadBytes(op, true);
data = std::string((char*)pData, op);
delete []pData;
}
void xmlString::ReadComplexData(XLS::CFRecord& record)
{
data = std::string(record.getCurData<char>(), op);
record.skipNunBytes(op);
}
void metroBlob::ReadComplexData(IBinaryReader* reader)
{
unsigned char* pData = reader->ReadBytes(op, true);
data = std::make_pair(boost::shared_array<unsigned char>(pData), op);
}
void metroBlob::ReadComplexData(XLS::CFRecord& record)
{
int pos = record.getRdPtr();
@ -770,7 +1007,23 @@ XLS::BiffStructurePtr MSOPOINT::clone()
{
return XLS::BiffStructurePtr(new MSOPOINT(*this));
}
void MSOPOINT::load(IBinaryReader* reader)
{
if (cbElement == 4)
{
x = reader->ReadInt32();
y = reader->ReadInt32();
}
else
{
unsigned short x_, y_;
x_ = reader->ReadInt16();
y_ = reader->ReadInt16();
x = x_;
y = y_;
}
}
void MSOPOINT::load(XLS::CFRecord& record)
{
if (cbElement == 4)
@ -806,7 +1059,30 @@ XLS::BiffStructurePtr MSORECT::clone()
{
return XLS::BiffStructurePtr(new MSORECT(*this));
}
void MSORECT::load(IBinaryReader* reader)
{
if (cbElement == 8)
{
l = reader->ReadInt32();
t = reader->ReadInt32();
r = reader->ReadInt32();
b = reader->ReadInt32();
}
else
{
unsigned short l_, t_, r_, b_;
l_ = reader->ReadInt16();
t_ = reader->ReadInt16();
r_ = reader->ReadInt16();
b_ = reader->ReadInt16();
l = l_;
t = t_;
r = r_;
b = b_;
}
}
void MSORECT::load(XLS::CFRecord& record)
{
if (cbElement == 8)
@ -841,7 +1117,121 @@ XLS::BiffStructurePtr MSOPATHINFO::clone()
{
return XLS::BiffStructurePtr(new MSOPATHINFO(*this));
}
void MSOPATHINFO::load(IBinaryReader* reader)
{
_UINT16 mem = reader->ReadInt16();
unsigned char type = (mem >> 13 & 0x07);
if (type <= 4)
{
m_eRuler = (NSCustomShapesConvert::RulesType)type;
m_nCount = (mem & 0x1FFF);
m_nCount = (_UINT16)GetCountPoints2(m_eRuler, m_nCount);
return;
}
type = (mem >> 8) & 0x1F;
mem = mem & 0xFF;
switch (type)
{
case 0x00:
{
m_eRuler = NSCustomShapesConvert::rtLineTo;
break;
}
case 0x01:
{
m_eRuler = NSCustomShapesConvert::rtAngleEllipseTo;
break;
}
case 0x02:
{
m_eRuler = NSCustomShapesConvert::rtAngleEllipse;
break;
}
case 0x03:
{
m_eRuler = NSCustomShapesConvert::rtArcTo;
break;
}
case 0x04:
{
m_eRuler = NSCustomShapesConvert::rtArc;
break;
}
case 0x05:
{
m_eRuler = NSCustomShapesConvert::rtClockwiseArcTo;
break;
}
case 0x06:
{
m_eRuler = NSCustomShapesConvert::rtClockwiseArc;
break;
}
case 0x07:
{
m_eRuler = NSCustomShapesConvert::rtEllipticalQuadrX;
break;
}
case 0x08:
{
m_eRuler = NSCustomShapesConvert::rtEllipticalQuadrY;
break;
}
case 0x09:
{
m_eRuler = NSCustomShapesConvert::rtQuadrBesier;
break;
}
case 0x0A:
{
m_eRuler = NSCustomShapesConvert::rtNoFill;
break;
}
case 0x0B:
{
m_eRuler = NSCustomShapesConvert::rtNoStroke;
break;
}
case 0x0C:
case 0x10:
{
m_eRuler = NSCustomShapesConvert::rtLineTo;
break;
}
case 0x0D:
case 0x0E:
case 0x0F:
case 0x11:
case 0x12:
case 0x13:
case 0x14:
{
m_eRuler = NSCustomShapesConvert::rtCurveTo;
break;
}
case 0x15:
{
m_eRuler = NSCustomShapesConvert::rtFillColor;
break;
}
case 0x16:
{
m_eRuler = NSCustomShapesConvert::rtLineColor;
break;
}
default:
{
m_eRuler = NSCustomShapesConvert::rtCurveTo;
}
};
m_nCount = (_UINT16)mem;
m_nCount = (_UINT16)GetCountPoints2(m_eRuler, m_nCount);
}
void MSOPATHINFO::load(XLS::CFRecord& record)
{
_UINT16 mem = 0;
@ -977,6 +1367,21 @@ XLS::BiffStructurePtr MSOSG::clone()
return XLS::BiffStructurePtr(new MSOSG(*this));
}
void MSOSG::load(IBinaryReader* reader)
{
_UINT16 ftType = reader->ReadUInt16();
m_eType = NSCustomShapesConvert::FormulaType(ftType & 0x1FFF);
m_param_type1 = (unsigned char)(ftType & 0x04);
m_param_type2 = (unsigned char)(ftType & 0x02);
m_param_type3 = (unsigned char)(ftType & 0x01);
m_param_value1 = reader->ReadUInt16();
m_param_value2 = reader->ReadUInt16();
m_param_value3 = reader->ReadUInt16();
}
void MSOSG::load(XLS::CFRecord& record)
{
_UINT16 ftType;
@ -1006,6 +1411,55 @@ XLS::BiffStructurePtr ADJH::clone()
return XLS::BiffStructurePtr(new ADJH(*this));
}
void ADJH::load(IBinaryReader* reader)
{
_UINT32 flag = reader->ReadUInt32();
fahInverseX = GETBIT(flag, 31);
fahInverseY = GETBIT(flag, 30);
fahSwitchPosition = GETBIT(flag, 29);
fahPolar = GETBIT(flag, 28);
fahPin = GETBIT(flag, 27);
fahUnused = GETBIT(flag, 26);
fahxMin = GETBIT(flag, 25);
fahxMax = GETBIT(flag, 24);
fahyMin = GETBIT(flag, 23);
fahyMax = GETBIT(flag, 22);
fahxRange = GETBIT(flag, 21);
fahyRange = GETBIT(flag, 20);
fahPolarPin = GETBIT(flag, 19);
cbElement -= 4;
if (cbElement == 4)
{
_UINT16 x, y;
x = reader->ReadUInt16();
y = reader->ReadUInt16();
apX = x;
apY = y;
cbElement -= 4;
}
else
{
apX = reader->ReadUInt32();
apY = reader->ReadUInt32();
cbElement -= 8;
}
if (cbElement < 1) return;
if (fahxRange) xRange = reader->ReadInt16();
if (fahyRange) yRange = reader->ReadInt16();
if (fahxMin) xMin = reader->ReadInt16();
if (fahxMax) xMax = reader->ReadInt16();
if (fahyMin) yMin = reader->ReadInt16();
if (fahyMax) yMax = reader->ReadInt16();
}
void ADJH::load(XLS::CFRecord& record)
{
_UINT32 flag;
@ -1061,7 +1515,11 @@ void PVertices::ReadComplexData(XLS::CFRecord& record)
record >> complex;
}
void PVertices::ReadComplexData(IBinaryReader* reader)
{
complex.op = op;
complex.load(reader);
}
void PSegmentInfo::ReadComplexData(XLS::CFRecord& record)
{
complex.op = op;
@ -1069,7 +1527,11 @@ void PSegmentInfo::ReadComplexData(XLS::CFRecord& record)
record >> complex;
}
void PSegmentInfo::ReadComplexData(IBinaryReader* reader)
{
complex.op = op;
complex.load(reader);
}
void pGuides::ReadComplexData(XLS::CFRecord& record)
{
complex.op = op;
@ -1077,6 +1539,11 @@ void pGuides::ReadComplexData(XLS::CFRecord& record)
record >> complex;
}
void pGuides::ReadComplexData(IBinaryReader* reader)
{
complex.op = op;
complex.load(reader);
}
void pAdjustHandles::ReadComplexData(XLS::CFRecord& record)
{
complex.op = op;
@ -1085,6 +1552,11 @@ void pAdjustHandles::ReadComplexData(XLS::CFRecord& record)
record >> complex;
}
void pAdjustHandles::ReadComplexData(IBinaryReader* reader)
{
complex.op = op;
complex.load(reader);
}
void pConnectionSites::ReadComplexData(XLS::CFRecord& record)
{
complex.op = op;
@ -1092,6 +1564,11 @@ void pConnectionSites::ReadComplexData(XLS::CFRecord& record)
record >> complex;
}
void pConnectionSites::ReadComplexData(IBinaryReader* reader)
{
complex.op = op;
complex.load(reader);
}
void pConnectionSitesDir::ReadComplexData(XLS::CFRecord& record)
{
complex.op = op;
@ -1099,6 +1576,11 @@ void pConnectionSitesDir::ReadComplexData(XLS::CFRecord& record)
record >> complex;
}
void pConnectionSitesDir::ReadComplexData(IBinaryReader* reader)
{
complex.op = op;
complex.load(reader);
}
void pInscribe::ReadComplexData(XLS::CFRecord& record)
{
complex.op = op;
@ -1106,4 +1588,22 @@ void pInscribe::ReadComplexData(XLS::CFRecord& record)
record >> complex;
}
void pInscribe::ReadComplexData(IBinaryReader* reader)
{
complex.op = op;
complex.load(reader);
}
void pWrapPolygonVertices::ReadComplexData(XLS::CFRecord& record)
{
complex.op = op;
int pos = record.getRdPtr();
record >> complex;
}
void pWrapPolygonVertices::ReadComplexData(IBinaryReader* reader)
{
complex.op = op;
complex.load(reader);
}
}

View File

@ -59,22 +59,22 @@ typedef boost::shared_ptr<OfficeArtFOPTE> OfficeArtFOPTEPtr;
class OfficeArtFOPTE : public XLS::BiffStructure
{
BASE_STRUCTURE_DEFINE_CLASS_NAME(OfficeArtFOPTE)
protected:
virtual void load(XLS::CFRecord& record);
void load(IBinaryReader* reader);
public:
XLS::BiffStructurePtr clone();
static const XLS::ElementType type = XLS::typeOfficeArtFOPTE;
static const XLS::ElementType type = XLS::typeOfficeArtFOPTE;
protected:
virtual void load(XLS::CFRecord& record);
public:
static OfficeArtFOPTEPtr load_and_create(XLS::CFRecord& record);
virtual void ReadComplexData(XLS::CFRecord& record);
static OfficeArtFOPTEPtr load_and_create(IBinaryReader* reader);
static OfficeArtFOPTEPtr create(unsigned short opid);
virtual void ReadComplexData(XLS::CFRecord& record);
virtual void ReadComplexData(IBinaryReader* reader);
public:
unsigned short opid;
bool fBid;
bool fComplex;
@ -92,7 +92,9 @@ class FixedPoint : public OfficeArtFOPTE
FixedPoint();
FixedPoint(unsigned short cbElement_); //fixed always!!
virtual void load(XLS::CFRecord& record);
virtual void load(IBinaryReader* reader);
double dVal;
};
@ -102,7 +104,8 @@ class TextBooleanProperties : public OfficeArtFOPTE
BASE_STRUCTURE_DEFINE_CLASS_NAME(TextBooleanProperties)
virtual void load(XLS::CFRecord& record);
virtual void load(IBinaryReader* reader);
bool fFitShapeToText;
bool fAutoTextMargin;
bool fSelectText;
@ -110,13 +113,55 @@ class TextBooleanProperties : public OfficeArtFOPTE
bool fUsefFitShapeToText;
bool fUsefAutoTextMargin;
bool fUsefSelectText;
private:
void set();
};
class ThreeDStyleBooleanProperties : public OfficeArtFOPTE
{
BASE_STRUCTURE_DEFINE_CLASS_NAME(ThreeDStyleBooleanProperties)
virtual void load(XLS::CFRecord& record);
virtual void load(IBinaryReader* reader);
bool fUsefc3DConstrainRotation;
bool fUsefc3DRotationCenterAuto;
bool fUsefc3DParallel;
bool fUsefc3DKeyHarsh;
bool fUsefc3DFillHarsh;
bool fc3DConstrainRotation;
bool fc3DRotationCenterAuto;
bool fc3DParallel;
bool fc3DKeyHarsh;
bool fc3DFillHarsh;
private:
void set();
};
class ThreeDObjectBooleanProperties : public OfficeArtFOPTE
{
BASE_STRUCTURE_DEFINE_CLASS_NAME(ThreeDObjectBooleanProperties)
virtual void load(XLS::CFRecord& record);
virtual void load(IBinaryReader* reader);
bool fUsef3D;
bool fUsefc3DMetallic;
bool fUsefc3DUseExtrusionColor;
bool fUsefc3DLightFace;
bool f3D;
bool fc3DMetallic;
bool fc3DUseExtrusionColor;
bool fc3DLightFace;
private:
void set();
};
class GeometryTextBooleanProperties : public OfficeArtFOPTE
{
BASE_STRUCTURE_DEFINE_CLASS_NAME(TextBooleanProperties)
virtual void load(XLS::CFRecord& record);
virtual void load(IBinaryReader* reader);
bool gFReverseRows;
bool fGtext;
@ -138,7 +183,7 @@ class GeometryTextBooleanProperties : public OfficeArtFOPTE
bool fUsegFReverseRows;
bool fUsefGtext ;
bool fUsegFVertical ;
bool fUsegtextFKern ;
bool fUsegFKern ;
bool fUsegTight ;
bool fUsegFStretch ;
bool fUsegFShrinkFit;
@ -151,6 +196,8 @@ class GeometryTextBooleanProperties : public OfficeArtFOPTE
bool fUsegFShadow ;
bool fUsegFSmallcaps ;
bool fUsegFStrikethrough;
private:
void set();
};
class GroupShapeBooleanProperties : public OfficeArtFOPTE
@ -158,6 +205,7 @@ class GroupShapeBooleanProperties : public OfficeArtFOPTE
BASE_STRUCTURE_DEFINE_CLASS_NAME(GroupShapeBooleanProperties)
virtual void load(XLS::CFRecord& record);
virtual void load(IBinaryReader* reader);
bool fUsefLayoutInCell;
bool fUsefIsBullet;
@ -192,6 +240,8 @@ class GroupShapeBooleanProperties : public OfficeArtFOPTE
bool fOneD;
bool fHidden;
bool fPrint;
private:
void set();
};
class lineColor : public OfficeArtFOPTE
@ -250,6 +300,7 @@ class fillShadeType : public OfficeArtFOPTE
BASE_STRUCTURE_DEFINE_CLASS_NAME(fillShadeType)
virtual void load(XLS::CFRecord& record);
virtual void load(IBinaryReader* reader);
bool msoshadeNone;
bool msoshadeGamma;
@ -263,6 +314,7 @@ class FillStyleBooleanProperties : public OfficeArtFOPTE
BASE_STRUCTURE_DEFINE_CLASS_NAME(FillStyleBooleanProperties)
virtual void load(XLS::CFRecord& record);
virtual void load(IBinaryReader* reader);
bool fNoFillHitTest;
bool fillUseRect;
@ -278,6 +330,8 @@ class FillStyleBooleanProperties : public OfficeArtFOPTE
bool fUsefFilled;
bool fUsefUseShapeAnchor;
bool fUsefRecolorFillAsPicture;
private:
void set();
};
class fillBlip : public OfficeArtFOPTE
@ -285,6 +339,7 @@ class fillBlip : public OfficeArtFOPTE
BASE_STRUCTURE_DEFINE_CLASS_NAME(fillBlip)
virtual void ReadComplexData(XLS::CFRecord& record);
virtual void ReadComplexData(IBinaryReader* reader);
OfficeArtBlipPtr blip;
};
@ -302,6 +357,7 @@ class anyString : public OfficeArtFOPTE
BASE_STRUCTURE_DEFINE_CLASS_NAME(anyString)
virtual void ReadComplexData(XLS::CFRecord& record);
virtual void ReadComplexData(IBinaryReader* reader);
std::wstring string_;
};
@ -391,8 +447,9 @@ class fillShadeColors : public OfficeArtFOPTE
BASE_STRUCTURE_DEFINE_CLASS_NAME(fillShadeColors)
virtual void ReadComplexData(XLS::CFRecord& record);
virtual void ReadComplexData(IBinaryReader* reader);
IMsoArray<MSOSHADECOLOR> fillShadeColors_complex;
IMsoArray<MSOSHADECOLOR> complex;
};
@ -471,6 +528,7 @@ class ProtectionBooleanProperties : public OfficeArtFOPTE
BASE_STRUCTURE_DEFINE_CLASS_NAME(ProtectionBooleanProperties)
virtual void load(XLS::CFRecord& record);
virtual void load(IBinaryReader* reader);
bool fLockAgainstGrouping ;
bool fLockAdjustHandles ;
@ -492,6 +550,8 @@ class ProtectionBooleanProperties : public OfficeArtFOPTE
bool fUsefLockAspectRatio;
bool fUsefLockRotation ;
bool fUsefLockAgainstUngrouping;
private:
void set();
};
class LineStyleBooleanProperties : public OfficeArtFOPTE
@ -499,6 +559,7 @@ class LineStyleBooleanProperties : public OfficeArtFOPTE
BASE_STRUCTURE_DEFINE_CLASS_NAME(LineStyleBooleanProperties)
virtual void load(XLS::CFRecord& record);
virtual void load(IBinaryReader* reader);
bool fNoLineDrawDash;
bool fLineFillShape;
@ -516,6 +577,8 @@ class LineStyleBooleanProperties : public OfficeArtFOPTE
bool fUsefInsetPenOK;
bool fUsefInsetPen;
bool fUsefLineOpaqueBackColor ;
private:
void set();
};
class ShadowStyleBooleanProperties : public OfficeArtFOPTE
@ -523,11 +586,14 @@ class ShadowStyleBooleanProperties : public OfficeArtFOPTE
BASE_STRUCTURE_DEFINE_CLASS_NAME(ShadowStyleBooleanProperties)
virtual void load(XLS::CFRecord& record);
virtual void load(IBinaryReader* reader);
bool fshadowObscured ;
bool fShadow ;
bool fUsefshadowObscured ;
bool fUsefShadow ;
private:
void set();
};
class GeometryBooleanProperties : public OfficeArtFOPTE
@ -535,6 +601,7 @@ class GeometryBooleanProperties : public OfficeArtFOPTE
BASE_STRUCTURE_DEFINE_CLASS_NAME(GeometryBooleanProperties)
virtual void load(XLS::CFRecord& record);
virtual void load(IBinaryReader* reader);
bool fUsefShadowOK;
bool fUsef3DOK ;
@ -549,6 +616,8 @@ class GeometryBooleanProperties : public OfficeArtFOPTE
bool fGtextOK;
bool fFillShadeShapeOK;
bool fFillOK;
private:
void set();
};
class lineWidth : public OfficeArtFOPTE
@ -614,6 +683,7 @@ class MSOPOINT : public XLS::BiffStructure
XLS::BiffStructurePtr clone();
virtual void load(XLS::CFRecord& record);
virtual void load(IBinaryReader* reader);
static const XLS::ElementType type = XLS::typeOfficeArtRecord;
@ -633,6 +703,7 @@ class MSORECT : public XLS::BiffStructure
XLS::BiffStructurePtr clone();
virtual void load(XLS::CFRecord& record);
virtual void load(IBinaryReader* reader);
static const XLS::ElementType type = XLS::typeOfficeArtRecord;
@ -655,6 +726,7 @@ class MSOPATHINFO : public XLS::BiffStructure
XLS::BiffStructurePtr clone();
virtual void load(XLS::CFRecord& record);
virtual void load(IBinaryReader* reader);
static const XLS::ElementType type = XLS::typeOfficeArtRecord;
@ -673,6 +745,7 @@ class MSOSG : public XLS::BiffStructure
XLS::BiffStructurePtr clone();
virtual void load(XLS::CFRecord& record);
virtual void load(IBinaryReader* reader);
static const XLS::ElementType type = XLS::typeOfficeArtRecord;
@ -698,6 +771,7 @@ class ADJH : public XLS::BiffStructure
XLS::BiffStructurePtr clone();
virtual void load(XLS::CFRecord& record);
virtual void load(IBinaryReader* reader);
static const XLS::ElementType type = XLS::typeOfficeArtRecord;
@ -746,6 +820,7 @@ class PVertices : public OfficeArtFOPTE
BASE_STRUCTURE_DEFINE_CLASS_NAME(PVertices)
virtual void ReadComplexData(XLS::CFRecord& record);
virtual void ReadComplexData(IBinaryReader* reader);
IMsoArray<MSOPOINT> complex;
};
@ -755,6 +830,7 @@ class PSegmentInfo : public OfficeArtFOPTE
BASE_STRUCTURE_DEFINE_CLASS_NAME(PSegmentInfo)
virtual void ReadComplexData(XLS::CFRecord& record);
virtual void ReadComplexData(IBinaryReader* reader);
IMsoArray<MSOPATHINFO> complex;
};
@ -763,6 +839,7 @@ class pGuides : public OfficeArtFOPTE
BASE_STRUCTURE_DEFINE_CLASS_NAME(pGuides)
virtual void ReadComplexData(XLS::CFRecord& record);
virtual void ReadComplexData(IBinaryReader* reader);
IMsoArray<MSOSG> complex;
};
@ -777,6 +854,7 @@ class pAdjustHandles : public OfficeArtFOPTE
BASE_STRUCTURE_DEFINE_CLASS_NAME(pAdjustHandles)
virtual void ReadComplexData(XLS::CFRecord& record);
virtual void ReadComplexData(IBinaryReader* reader);
IMsoArray<ADJH> complex;
};
@ -786,6 +864,7 @@ class pConnectionSites : public OfficeArtFOPTE
BASE_STRUCTURE_DEFINE_CLASS_NAME(pConnectionSites)
virtual void ReadComplexData(XLS::CFRecord& record);
virtual void ReadComplexData(IBinaryReader* reader);
IMsoArray<MSOPOINT> complex;
};
@ -795,6 +874,7 @@ class pConnectionSitesDir : public OfficeArtFOPTE
BASE_STRUCTURE_DEFINE_CLASS_NAME(pConnectionSitesDir)
virtual void ReadComplexData(XLS::CFRecord& record);
virtual void ReadComplexData(IBinaryReader* reader);
IMsoArray<OSHARED::FixedPoint> complex;
};
@ -804,9 +884,20 @@ class pInscribe : public OfficeArtFOPTE
BASE_STRUCTURE_DEFINE_CLASS_NAME(pInscribe)
virtual void ReadComplexData(XLS::CFRecord& record);
virtual void ReadComplexData(IBinaryReader* reader);
IMsoArray<MSORECT> complex;
};
class pWrapPolygonVertices : public OfficeArtFOPTE
{
BASE_STRUCTURE_DEFINE_CLASS_NAME(pWrapPolygonVertices)
virtual void ReadComplexData(XLS::CFRecord& record);
virtual void ReadComplexData(IBinaryReader* reader);
IMsoArray<MSOPOINT> complex;
};
//class cxk : public OfficeArtFOPTE
//{
// BASE_STRUCTURE_DEFINE_CLASS_NAME(cxk)
@ -846,6 +937,7 @@ class IHlink : public XLS::BiffStructure
XLS::BiffStructurePtr clone();
void load(XLS::CFRecord& record);
void load(IBinaryReader* reader);
static const XLS::ElementType type = XLS::typeIHLink;
@ -857,7 +949,8 @@ class pihlShape : public OfficeArtFOPTE
{
BASE_STRUCTURE_DEFINE_CLASS_NAME(pihlShape)
void ReadComplexData(XLS::CFRecord& record);
virtual void ReadComplexData(XLS::CFRecord& record);
virtual void ReadComplexData(IBinaryReader* reader);
IHlink complex;
};
@ -866,13 +959,172 @@ class metroBlob : public OfficeArtFOPTE
{
BASE_STRUCTURE_DEFINE_CLASS_NAME(metroBlob)
void ReadComplexData(XLS::CFRecord& record);
virtual void ReadComplexData(XLS::CFRecord& record);
virtual void ReadComplexData(IBinaryReader* reader);
std::pair<boost::shared_array<unsigned char>, _INT32> data;
std::wstring xmlString;
};
class xmlString : public OfficeArtFOPTE
{
BASE_STRUCTURE_DEFINE_CLASS_NAME(metroBlob)
virtual void ReadComplexData(XLS::CFRecord& record);
virtual void ReadComplexData(IBinaryReader* reader);
std::string data; //utf-8
};
class PathParser
{
public:
PathParser (std::vector<MSOPATHINFO> &arSegments, std::vector<MSOPOINT>& arPoints, std::vector<MSOSG> & arGuides)
: m_arSegments(arSegments)
{
LONG lMinF = (_INT32)0x80000000;
POINT point;
for (size_t i = 0; i < arPoints.size(); i++)
{
point.x = arPoints[i].x;
point.y = arPoints[i].y;
if (lMinF <= point.x)
{
int index = (_UINT32)point.x - 0x80000000;
if (index >= 0 && index < (int)arGuides.size())
{
point.x = arGuides[index].m_param_value3;
}
}
if (lMinF <= point.y)
{
int index = (_UINT32)point.y - 0x80000000;
if (index >= 0 && index < (int)arGuides.size())
{
point.y = arGuides[index].m_param_value3;
}
}
if ((size_t)point.y > 0xffff) point.y &= 0xffff;
if ((size_t)point.x > 0xffff) point.x &= 0xffff;
m_arPoints.push_back(point);
}
}
inline std::wstring GetVmlPath () const
{
if (m_arSegments.empty() && m_arPoints.empty())
return std::wstring(L"");
std::wstring strVmlPath;
size_t valuePointer = 0;
if (m_arSegments.empty())
{
for (size_t i = 0; i < m_arPoints.size(); ++i)
{
strVmlPath += L"l";
strVmlPath += std::to_wstring(m_arPoints[i].x);
strVmlPath += L",";
strVmlPath += std::to_wstring(m_arPoints[i].y);
++valuePointer;
}
strVmlPath += L"xe";
return strVmlPath;
}
for (size_t i = 0; i < m_arSegments.size(); i++)
{
switch (m_arSegments[i].m_eRuler)
{
case NSCustomShapesConvert::rtLineTo:
{
for (_UINT16 j = 0; j < m_arSegments[i].m_nCount; ++j)
{
if (valuePointer + 1 > m_arPoints.size())
{
break;
strVmlPath += L"l";
strVmlPath += std::to_wstring(m_arPoints[0].x);
strVmlPath += L",";
strVmlPath += std::to_wstring(m_arPoints[0].y);
++valuePointer;
}
else
{
strVmlPath += L"l";
strVmlPath += std::to_wstring(m_arPoints[valuePointer].x );
strVmlPath += L",";
strVmlPath += std::to_wstring(m_arPoints[valuePointer].y );
++valuePointer;
}
}
}break;
case NSCustomShapesConvert::rtCurveTo:
{
for (_UINT16 j = 0; j < m_arSegments[i].m_nCount; ++j)
{
if (valuePointer + 3 > m_arPoints.size())
break;
strVmlPath += L"c";
strVmlPath += std::to_wstring(m_arPoints[valuePointer].x );
strVmlPath += L",";
strVmlPath += std::to_wstring(m_arPoints[valuePointer].y );
strVmlPath += L",";
strVmlPath += std::to_wstring(m_arPoints[valuePointer + 1].x );
strVmlPath += L",";
strVmlPath += std::to_wstring(m_arPoints[valuePointer + 1].y );
strVmlPath += L",";
strVmlPath += std::to_wstring(m_arPoints[valuePointer + 2].x );
strVmlPath += L",";
strVmlPath += std::to_wstring(m_arPoints[valuePointer + 2].y );
valuePointer += 3;
}
}break;
case NSCustomShapesConvert::rtMoveTo:
{
if (valuePointer < m_arPoints.size())
{
strVmlPath += L"m";
strVmlPath += std::to_wstring(m_arPoints[valuePointer].x );
strVmlPath += L",";
strVmlPath += std::to_wstring(m_arPoints[valuePointer].y );
++valuePointer;
}
}
break;
case NSCustomShapesConvert::rtClose:
{
strVmlPath += L"x";
}
break;
case NSCustomShapesConvert::rtEnd:
{
strVmlPath += L"e";
}break;
default:
break;
}
}
if ( !strVmlPath.empty() && ( strVmlPath[strVmlPath.size() - 1] != L'e' ) )
strVmlPath +=L"e";
return strVmlPath;
}
private:
std::vector<MSOPATHINFO> &m_arSegments;
std::vector<POINT> m_arPoints;
};
}

View File

@ -36,23 +36,26 @@
#include "../FixedPoint.h"
#if !defined(_WIN32) && !defined(_WIN64)
#ifndef customTagPoint
#define customTagPoint
typedef struct tagPOINT
{
_INT32 x;
_INT32 y;
} POINT;
#endif
typedef struct tagRECT
{
_INT32 left;
_INT32 top;
_INT32 right;
_INT32 bottom;
} RECT;
#ifndef customTagPoint
#define customTagPoint
typedef struct tagPOINT
{
_INT32 x;
_INT32 y;
} POINT;
typedef struct tagRECT
{
_INT32 left;
_INT32 top;
_INT32 right;
_INT32 bottom;
} RECT;
typedef struct tagSIZE
{
_INT32 cx;
_INT32 cy;
}SIZE;
#endif
#else
#include <windows.h>
#endif

View File

@ -54,7 +54,16 @@ void OfficeArtRecordHeader::load(XLS::CFRecord& record)
recVer = GETBITS(ver_inst, 0, 3);
recInstance = GETBITS(ver_inst, 4, 15);
}
void OfficeArtRecordHeader::load(IBinaryReader* reader)
{
unsigned short ver_inst = reader->ReadUInt16();
recType = reader->ReadUInt16();
recLen = reader->ReadUInt32();
recVer = GETBITS(ver_inst, 0, 3);
recInstance = GETBITS(ver_inst, 4, 15);
}
const size_t OfficeArtRecordHeader::size() const
{

View File

@ -50,7 +50,7 @@ public:
XLS::BiffStructurePtr clone();
virtual void load(XLS::CFRecord& record);
virtual void load(IBinaryReader* reader);
static const XLS::ElementType type = XLS::typeOfficeArtRecordHeader;

View File

@ -190,14 +190,12 @@ namespace NSCustomShapesConvert
std::vector<CGuide> m_arGuides;
std::vector<LONG>* m_pAdjustValues;
bool m_bIsVerticesPresent;
bool m_bIsPathPresent;
CCustomVML() : m_arVertices(), m_arSegments(), m_arGuides(), m_pAdjustValues(NULL)
{
m_ePath = rtCurveTo/*rtLineTo*/;
m_bIsVerticesPresent = false;
m_bIsPathPresent = false;
}
@ -222,7 +220,6 @@ namespace NSCustomShapesConvert
m_pAdjustValues = oSrc.m_pAdjustValues;
m_bIsPathPresent = oSrc.m_bIsPathPresent;
m_bIsVerticesPresent = oSrc.m_bIsVerticesPresent;
return *this;
}
@ -231,13 +228,11 @@ namespace NSCustomShapesConvert
{
}
public:
bool IsCustom()
{
return (m_bIsVerticesPresent && m_bIsPathPresent);
return (!m_arVertices.empty() && (m_bIsPathPresent || !m_arSegments.empty()));
}
public:
void SetPath(RulesType ePath)
{
m_ePath = ePath;

View File

@ -1573,9 +1573,9 @@ void XlsConverter::convert_fill_style(std::vector<ODRAW::OfficeArtFOPTEPtr> & pr
{
ODRAW::fillShadeColors *shadeColors = dynamic_cast<ODRAW::fillShadeColors*>(props[i].get());
for (size_t i = 0 ; (shadeColors) && (i < shadeColors->fillShadeColors_complex.data.size()); i++)
for (size_t i = 0 ; (shadeColors) && (i < shadeColors->complex.data.size()); i++)
{
ODRAW::OfficeArtCOLORREF & color = shadeColors->fillShadeColors_complex.data[i].color;
ODRAW::OfficeArtCOLORREF & color = shadeColors->complex.data[i].color;
std::wstring strColor;
if (!color.sColorRGB.empty()) strColor = color.sColorRGB;
@ -1585,10 +1585,10 @@ void XlsConverter::convert_fill_style(std::vector<ODRAW::OfficeArtFOPTEPtr> & pr
if (it != xls_global_info->colors_palette.end()) strColor = it->second;
}
if (!strColor.empty())
xlsx_context->get_drawing_context().add_fill_colors( shadeColors->fillShadeColors_complex.data[i].dPosition, strColor);
xlsx_context->get_drawing_context().add_fill_colors( shadeColors->complex.data[i].dPosition, strColor);
else
{
xlsx_context->get_drawing_context().add_fill_colors( shadeColors->fillShadeColors_complex.data[i].dPosition,
xlsx_context->get_drawing_context().add_fill_colors( shadeColors->complex.data[i].dPosition,
color.index, color.fSchemeIndex ? 1 : 3 );
}
}

View File

@ -47,156 +47,6 @@
namespace oox {
class PathParser
{
public:
PathParser (std::vector<ODRAW::MSOPATHINFO> &arSegments, std::vector<ODRAW::MSOPOINT>& arPoints, std::vector<ODRAW::MSOSG> & arGuides)
: m_arSegments(arSegments)
{
LONG lMinF = (_INT32)0x80000000;
POINT point;
for (size_t i = 0; i < arPoints.size(); i++)
{
point.x = arPoints[i].x;
point.y = arPoints[i].y;
if (lMinF <= point.x)
{
int index = (_UINT32)point.x - 0x80000000;
if (index >= 0 && index < (int)arGuides.size())
{
point.x = arGuides[index].m_param_value3;
}
}
if (lMinF <= point.y)
{
int index = (_UINT32)point.y - 0x80000000;
if (index >= 0 && index < (int)arGuides.size())
{
point.y = arGuides[index].m_param_value3;
}
}
if ((size_t)point.y > 0xffff) point.y &= 0xffff;
if ((size_t)point.x > 0xffff) point.x &= 0xffff;
m_arPoints.push_back(point);
}
}
inline std::wstring GetVmlPath () const
{
if (m_arSegments.empty() && m_arPoints.empty())
return std::wstring(L"");
std::wstring strVmlPath;
size_t valuePointer = 0;
if (m_arSegments.empty())
{
for (size_t i = 0; i < m_arPoints.size(); ++i)
{
strVmlPath += L"l";
strVmlPath += std::to_wstring(m_arPoints[i].x);
strVmlPath += L",";
strVmlPath += std::to_wstring(m_arPoints[i].y);
++valuePointer;
}
strVmlPath += L"xe";
return strVmlPath;
}
for (size_t i = 0; i < m_arSegments.size(); i++)
{
switch (m_arSegments[i].m_eRuler)
{
case NSCustomShapesConvert::rtLineTo:
{
for (_UINT16 i = 0; i < m_arSegments[i].m_nCount; ++i)
{
if (valuePointer + 1 > m_arPoints.size())
{
break;
strVmlPath += L"l";
strVmlPath += std::to_wstring(m_arPoints[0].x);
strVmlPath += L",";
strVmlPath += std::to_wstring(m_arPoints[0].y);
++valuePointer;
}
else
{
strVmlPath += L"l";
strVmlPath += std::to_wstring(m_arPoints[valuePointer].x );
strVmlPath += L",";
strVmlPath += std::to_wstring(m_arPoints[valuePointer].y );
++valuePointer;
}
}
}break;
case NSCustomShapesConvert::rtCurveTo:
{
for (_UINT16 i = 0; i < m_arSegments[i].m_nCount; ++i)
{
if (valuePointer + 3 > m_arPoints.size())
break;
strVmlPath += L"c";
strVmlPath += std::to_wstring(m_arPoints[valuePointer].x );
strVmlPath += L",";
strVmlPath += std::to_wstring(m_arPoints[valuePointer].y );
strVmlPath += L",";
strVmlPath += std::to_wstring(m_arPoints[valuePointer + 1].x );
strVmlPath += L",";
strVmlPath += std::to_wstring(m_arPoints[valuePointer + 1].y );
strVmlPath += L",";
strVmlPath += std::to_wstring(m_arPoints[valuePointer + 2].x );
strVmlPath += L",";
strVmlPath += std::to_wstring(m_arPoints[valuePointer + 2].y );
valuePointer += 3;
}
}break;
case NSCustomShapesConvert::rtMoveTo:
{
if (valuePointer < m_arPoints.size())
{
strVmlPath += L"m";
strVmlPath += std::to_wstring(m_arPoints[valuePointer].x );
strVmlPath += L",";
strVmlPath += std::to_wstring(m_arPoints[valuePointer].y );
++valuePointer;
}
}
break;
case NSCustomShapesConvert::rtClose:
{
strVmlPath += L"x";
}
break;
case NSCustomShapesConvert::rtEnd:
{
strVmlPath += L"e";
}break;
default:
break;
}
}
if ( !strVmlPath.empty() && ( strVmlPath[strVmlPath.size() - 1] != L'e' ) )
strVmlPath +=L"e";
return strVmlPath;
}
private:
std::vector<ODRAW::MSOPATHINFO> &m_arSegments;
std::vector<POINT> m_arPoints;
};
//-----------------------------------------------------------------------------------------------------------
const static std::wstring shemeColor[18] =
{L"accent1",L"accent2",L"accent3",L"accent4",L"accent5",L"accent6",L"bk1",L"bk2",L"dk1",L"dk2",L"folHlink",L"hlink",L"lt1",L"lt2",L"none", L"tx1",L"tx2",L"phClr"};
@ -1117,7 +967,7 @@ void xlsx_drawing_context::serialize_vml_shape(_drawing_state_ptr & drawing_stat
if (!current_drawing_states->back()->custom_verticles.empty() &&
!current_drawing_states->back()->custom_segments.empty())
{
PathParser oParser (current_drawing_states->back()->custom_segments, current_drawing_states->back()->custom_verticles, current_drawing_states->back()->custom_guides);
ODRAW::PathParser oParser (current_drawing_states->back()->custom_segments, current_drawing_states->back()->custom_verticles, current_drawing_states->back()->custom_guides);
std::wstring path = oParser.GetVmlPath();
if (false == path.empty())
@ -1736,8 +1586,6 @@ std::wstring xlsx_drawing_context::convert_custom_shape(_drawing_state_ptr & dra
shape->m_oCustomVML.SetAdjusts(&shape->m_arAdjustments);
shape->m_oCustomVML.m_bIsVerticesPresent = drawing_state->custom_verticles.empty() ? false : true;
for (size_t i = 0 ; i < drawing_state->custom_verticles.size(); i++)
{
Aggplus::POINT p;
@ -1788,9 +1636,9 @@ std::wstring xlsx_drawing_context::convert_custom_shape(_drawing_state_ptr & dra
shape->m_oCustomVML.addAdjust(i, *drawing_state->custom_adjustValues[i]);
}
}
if (drawing_state->custom_path >=0)
if (drawing_state->custom_path >= 0)
shape->m_oCustomVML.SetPath((NSCustomShapesConvert::RulesType)drawing_state->custom_path);
shape->m_oCustomVML.ToCustomShape(shape, shape->m_oManager);
shape->ReCalculate();
//-------------------------------------------------------------------------------------

View File

@ -285,6 +285,22 @@ namespace OOX
L"",
L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/externalLinkPath");
const FileType ExternalLinkLibrary (L"", L"",
L"",
L"http://schemas.microsoft.com/office/2006/relationships/xlExternalLinkPath/xlLibrary");
const FileType ExternalLinkPathMissing(L"", L"",
L"",
L"http://schemas.microsoft.com/office/2006/relationships/xlExternalLinkPath/xlPathMissing");
const FileType ExternalLinkPathStartup(L"", L"",
L"",
L"http://schemas.microsoft.com/office/2006/relationships/xlExternalLinkPath/xlStartup");
const FileType ExternalLinkPathAlternateStartup(L"", L"",
L"",
L"http://schemas.microsoft.com/office/2006/relationships/xlExternalLinkPath/xlAlternateStartup");
const FileType LegacyDiagramText (L"", L"legacyDiagramText.bin",
L"",
L"http://schemas.microsoft.com/office/2006/relationships/legacyDiagramText");

View File

@ -1076,7 +1076,13 @@ namespace OOX
et_x_Controls,
et_x_Control,
et_x_ControlPr,
et_x_OcxPr,
et_x_OcxPr,
et_x_QueryTable,
et_x_QueryTableField,
et_x_QueryTableFields,
et_x_QueryTableRefresh,
et_x_QueryTableDeletedFields,
et_x_QueryTableDeletedField,
et_x_TableParts,
et_x_TablePart,
et_x_Table,

View File

@ -89,35 +89,46 @@ namespace OOX
return smart_ptr<OOX::File>(new CWorksheet( pMain, oRootPath, oFileName, oRelation.rId().ToString() ));
else if ( oRelation.Type() == FileTypes::Table )
return smart_ptr<OOX::File>(new CTableFile( pMain, oRootPath, oFileName ));
else if ( oRelation.Type() == FileTypes::QueryTable )
return smart_ptr<OOX::File>(new CQueryTableFile( pMain, oRootPath, oFileName ));
else if ( oRelation.Type() == FileTypes::Comments )
return smart_ptr<OOX::File>(new CComments( pMain, oRootPath, oFileName ));
else if ( oRelation.Type() == FileTypes::WorkbookComments)
return smart_ptr<OOX::File>(new WorkbookComments( pMain, oRootPath, oFileName));
else if ( oRelation.Type() == FileTypes::ExternalLinks )
return smart_ptr<OOX::File>(new CExternalLink( pMain, oRootPath, oFileName ));
else if ( oRelation.Type() == OOX::FileTypes::Chart )
return smart_ptr<OOX::File>(new CChartSpace( pMain, oRootPath, oFileName ));
else if ( oRelation.Type() == OOX::FileTypes::ExternalLinkPath)
else if ( oRelation.Type() == OOX::FileTypes::ExternalLinkPath ||
oRelation.Type() == OOX::FileTypes::ExternalLinkPathMissing ||
oRelation.Type() == OOX::FileTypes::ExternalLinkPathStartup ||
oRelation.Type() == OOX::FileTypes::ExternalLinkPathAlternateStartup ||
oRelation.Type() == OOX::FileTypes::ExternalLinkLibrary)
{// https://msdn.microsoft.com/en-us/library/ff531845(v=office.12).aspx
return smart_ptr<OOX::File>(new ExternalLinkPath( pMain, oRelation.Target()));
else if ( oRelation.Type() == FileTypes::WorkbookComments)
return smart_ptr<OOX::File>(new WorkbookComments( pMain, oRootPath, oFileName));
//common
//else if ( oRelation.Type() == OOX::FileTypes::ChartDrawing)
// return smart_ptr<OOX::File>(new CChartDrawing( pMain, oRootPath, oFileName ));
//else if ( oRelation.Type() == OOX::FileTypes::VmlDrawing )
// return smart_ptr<OOX::File>(new CVmlDrawing( oRootPath, oFileName ));
//else if ( oRelation.Type() == OOX::FileTypes::Theme )
// return smart_ptr<OOX::File>(new PPTX::Theme( oFileName ));
//else if ( oRelation.Type() == OOX::FileTypes::Image )
// return smart_ptr<OOX::File>(new Image( oFileName ));
//else if ( oRelation.Type() == OOX::FileTypes::ThemeOverride )
// return smart_ptr<OOX::File>(new PPTX::Theme( oFileName ));
//else if ( oRelation.Type() == OOX::FileTypes::OleObject)
// return smart_ptr<OOX::File>(new OOX::OleObject( oFileName ));
//else if ( oRelation.Type() == OOX::FileTypes::Data)
// return smart_ptr<OOX::File>(new OOX::CDiagramData( oRootPath, oFileName ));
//else if ( oRelation.Type() == OOX::FileTypes::DiagDrawing)
// return smart_ptr<OOX::File>(new OOX::CDiagramDrawing( oRootPath, oFileName ));
//else if ( oRelation.Type() == OOX::FileTypes::MicrosoftOfficeUnknown) //ms package
// return smart_ptr<OOX::File>(new OOX::OleObject( oFileName, true ));
}
else if ( oRelation.Type() == OOX::FileTypes::OleObject)
{
if (oRelation.IsExternal())
{
return smart_ptr<OOX::File>(new OOX::OleObject( pMain, oRelationFilename ));
}
else
{
return smart_ptr<OOX::File>(new OOX::OleObject( pMain, oFileName ));
}
}
else if ( oRelation.Type() == OOX::FileTypes::Data)
return smart_ptr<OOX::File>(new OOX::CDiagramData( pMain, oRootPath, oFileName ));
else if ( oRelation.Type() == OOX::FileTypes::DiagDrawing)
return smart_ptr<OOX::File>(new OOX::CDiagramDrawing( pMain, oRootPath, oFileName ));
else if ( oRelation.Type() == OOX::FileTypes::MicrosoftOfficeUnknown) //ms package
return smart_ptr<OOX::File>(new OOX::OleObject( pMain, oFileName, true ));
else if ( oRelation.Type() == OOX::FileTypes::ActiveX_xml)
return smart_ptr<OOX::File>(new OOX::ActiveX_xml( pMain, oRootPath, oFileName ));
else if ( oRelation.Type() == OOX::FileTypes::ActiveX_bin)
return smart_ptr<OOX::File>(new OOX::ActiveX_bin( pMain, oFileName ));
return smart_ptr<OOX::File>( new UnknowTypeFile(pMain) );
}
@ -171,6 +182,8 @@ namespace OOX
return smart_ptr<OOX::File>(new CWorksheet( pMain, oRootPath, oFileName, pRelation->rId().ToString() ));
else if ( pRelation->Type() == FileTypes::Table )
return smart_ptr<OOX::File>(new CTableFile( pMain, oRootPath, oFileName ));
else if ( pRelation->Type() == FileTypes::QueryTable )
return smart_ptr<OOX::File>(new CQueryTableFile( pMain, oRootPath, oFileName ));
else if ( pRelation->Type() == OOX::FileTypes::VmlDrawing )
return smart_ptr<OOX::File>(new CVmlDrawing( pMain, oRootPath, oFileName ));
else if ( pRelation->Type() == OOX::FileTypes::ChartDrawing)
@ -181,8 +194,14 @@ namespace OOX
return smart_ptr<OOX::File>(new CChartSpace( pMain, oRootPath, oFileName ));
else if ( pRelation->Type() == FileTypes::ExternalLinks )
return smart_ptr<OOX::File>(new CExternalLink( pMain, oRootPath, oFileName ));
else if ( pRelation->Type() == OOX::FileTypes::ExternalLinkPath)
else if ( pRelation->Type() == OOX::FileTypes::ExternalLinkPath ||
pRelation->Type() == OOX::FileTypes::ExternalLinkPathMissing ||
pRelation->Type() == OOX::FileTypes::ExternalLinkPathStartup ||
pRelation->Type() == OOX::FileTypes::ExternalLinkPathAlternateStartup ||
pRelation->Type() == OOX::FileTypes::ExternalLinkLibrary )
{// https://msdn.microsoft.com/en-us/library/ff531845(v=office.12).aspx)
return smart_ptr<OOX::File>(new ExternalLinkPath( pMain, oRelationFilename ));
}
else if ( pRelation->Type() == OOX::FileTypes::OleObject)
{
if (pRelation->IsExternal())

View File

@ -82,6 +82,11 @@ namespace OOX
L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/table",
L"tables/table", true, true);
const FileType QueryTable (L"../queryTables", L"queryTable.xml",
L"application/vnd.openxmlformats-officedocument.spreadsheetml.queryTable+xml",
L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/queryTable",
L"queryTables/table", true, true);
const FileType Drawings (L"../drawings", L"drawing.xml",
L"application/vnd.openxmlformats-officedocument.drawing+xml",
L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/drawing",

View File

@ -64,13 +64,50 @@ namespace SimpleTypes
E m_eValue;
};
enum ETableType
{
typeQueryTable = 0,
typeWorksheet = 1,
typeXml = 2,
};
template<ETableType eDefValue = typeWorksheet>
class CTableType : public CSimpleType<ETableType, eDefValue>
{
public:
CTableType() {}
virtual ETableType FromString(std::wstring &sValue)
{
if ( _T("queryTable") == sValue ) this->m_eValue = typeQueryTable;
else if ( _T("worksheet") == sValue ) this->m_eValue = typeWorksheet;
else if ( _T("xml") == sValue ) this->m_eValue = typeXml;
else this->m_eValue = eDefValue;
return this->m_eValue;
}
virtual std::wstring ToString () const
{
switch(this->m_eValue)
{
case typeQueryTable : return _T("queryTable");break;
case typeWorksheet : return _T("worksheet");break;
case typeXml : return _T("xml");break;
default : return _T("typeWorksheet");
}
}
SimpleType_FromString (ETableType)
SimpleType_Operator_Equal (CTableType)
};
enum EVisibleType
{
visibleHidden = 0,
visibleVeryHidden = 1,
visibleVisible = 2,
};
template<EVisibleType eDefValue = visibleVisible>
class CVisibleType : public CSimpleType<EVisibleType, eDefValue>
{
@ -87,7 +124,7 @@ namespace SimpleTypes
return this->m_eValue;
}
virtual std::wstring ToString () const
virtual std::wstring ToString () const
{
switch(this->m_eValue)
{
@ -100,7 +137,7 @@ namespace SimpleTypes
}
SimpleType_FromString (EVisibleType)
SimpleType_Operator_Equal (CVisibleType)
SimpleType_Operator_Equal (CVisibleType)
};
enum EPhoneticAlignmentType

View File

@ -152,11 +152,11 @@ namespace OOX
{
WritingElement_ReadAttributes_Start( oReader )
WritingElement_ReadAttributes_Read_if ( oReader, _T("name"), m_oName )
WritingElement_ReadAttributes_Read_if ( oReader, _T("showColumnStripes"), m_oShowColumnStripes )
WritingElement_ReadAttributes_Read_if ( oReader, _T("showFirstColumn"), m_oShowFirstColumn )
WritingElement_ReadAttributes_Read_if ( oReader, _T("showLastColumn"), m_oShowLastColumn )
WritingElement_ReadAttributes_Read_if ( oReader, _T("showRowStripes"), m_oShowRowStripes )
WritingElement_ReadAttributes_Read_if ( oReader, _T("name"), m_oName )
WritingElement_ReadAttributes_Read_if ( oReader, _T("showColumnStripes"), m_oShowColumnStripes )
WritingElement_ReadAttributes_Read_if ( oReader, _T("showFirstColumn"), m_oShowFirstColumn )
WritingElement_ReadAttributes_Read_if ( oReader, _T("showLastColumn"), m_oShowLastColumn )
WritingElement_ReadAttributes_Read_if ( oReader, _T("showRowStripes"), m_oShowRowStripes )
WritingElement_ReadAttributes_End( oReader )
}
@ -351,39 +351,68 @@ namespace OOX
}
virtual void toXML(NSStringUtils::CStringBuilder& writer) const
{
}
virtual void toXML2(NSStringUtils::CStringBuilder& writer, int nIndex) const
{
if(m_oRef.IsInit() && m_oDisplayName.IsInit())
{
writer.WriteString(L"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><table xmlns=\"http://schemas.openxmlformats.org/spreadsheetml/2006/main\"");
WritingStringAttrInt(L"id", nIndex);
WritingStringAttrEncodeXmlString(L"name", m_oDisplayName.get());
WritingStringAttrEncodeXmlString(L"displayName", m_oDisplayName.get());
WritingStringAttrString(L"ref", m_oRef->ToString());
if(m_oHeaderRowCount.IsInit() && 0 == m_oHeaderRowCount->GetValue())
writer.WriteString(L" headerRowCount=\"0\"");
if(m_oTotalsRowCount.IsInit() && m_oTotalsRowCount->GetValue() > 0)
writer.WriteString(L" totalsRowCount=\"1\"");
else
writer.WriteString(L" totalsRowShown=\"0\"");
WritingStringNullableAttrInt(L"tableBorderDxfId", m_oTableBorderDxfId, m_oTableBorderDxfId->GetValue());
writer.WriteString(L">");
writer.WriteString(L"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\
<table \
xmlns=\"http://schemas.openxmlformats.org/spreadsheetml/2006/main\" \
xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\" \
mc:Ignorable=\"xr xr3\" \
xmlns:xr=\"http://schemas.microsoft.com/office/spreadsheetml/2014/revision\" \
xmlns:xr3=\"http://schemas.microsoft.com/office/spreadsheetml/2016/revision3\"");
if(m_oAutoFilter.IsInit())
m_oAutoFilter->toXML(writer);
if(m_oSortState.IsInit())
m_oSortState->toXML(writer);
if(m_oTableColumns.IsInit())
m_oTableColumns->toXML(writer);
if(m_oTableStyleInfo.IsInit())
m_oTableStyleInfo->toXML(writer);
if(m_oExtLst.IsInit())
{
writer.WriteString(m_oExtLst->toXMLWithNS(_T("")));
}
writer.WriteString(L"</table>");
WritingStringNullableAttrInt(L"id", m_oId, m_oId->GetValue());
WritingStringAttrEncodeXmlString(L"name", m_oDisplayName.get());
WritingStringAttrEncodeXmlString(L"displayName", m_oDisplayName.get());
WritingStringAttrString(L"ref", m_oRef->ToString());
WritingStringNullableAttrInt(L"connectionId", m_oConnectionId, m_oConnectionId->GetValue());
WritingStringNullableAttrString(L"tableType", m_oTableType, m_oTableType->ToString());
WritingStringNullableAttrString(L"totalsRowDxfId", m_oComment, *m_oComment);
WritingStringNullableAttrInt(L"totalsRowDxfId", m_oTotalsRowDxfId, m_oTotalsRowDxfId->GetValue());
WritingStringNullableAttrInt(L"tableBorderDxfId", m_oTableBorderDxfId, m_oTableBorderDxfId->GetValue());
WritingStringNullableAttrString(L"dataCellStyle", m_oDataCellStyle, *m_oDataCellStyle);
WritingStringNullableAttrInt(L"headerRowBorderDxfId", m_oHeaderRowBorderDxfId, m_oHeaderRowBorderDxfId->GetValue());
WritingStringNullableAttrString(L"headerRowCellStyle", m_oHeaderRowCellStyle, *m_oHeaderRowCellStyle);
WritingStringNullableAttrInt(L"headerRowDxfId", m_oHeaderRowDxfId, m_oHeaderRowDxfId->GetValue());
WritingStringNullableAttrInt(L"totalsRowBorderDxfId", m_oTotalsRowBorderDxfId, m_oTotalsRowBorderDxfId->GetValue());
WritingStringNullableAttrInt(L"totalsRowDxfId", m_oTotalsRowDxfId, m_oTotalsRowDxfId->GetValue());
WritingStringNullableAttrString(L"totalsRowCellStyle", m_oTotalsRowCellStyle, *m_oTotalsRowCellStyle);
if(m_oHeaderRowCount.IsInit() && 0 == m_oHeaderRowCount->GetValue())
writer.WriteString(L" headerRowCount=\"0\"");
if(m_oTotalsRowCount.IsInit() && m_oTotalsRowCount->GetValue() > 0)
writer.WriteString(L" totalsRowCount=\"1\"");
else
writer.WriteString(L" totalsRowShown=\"0\"");//m_oTotalsRowShown
if (m_oInsertRow.IsInit()) WritingStringAttrString(L"insertRow", *m_oInsertRow ? L"1" : L"0");
if (m_oInsertRowShift.IsInit()) WritingStringAttrString(L"insertRowShift", *m_oInsertRowShift ? L"1" : L"0");
if (m_oPublished.IsInit()) WritingStringAttrString(L"published", *m_oPublished ? L"1" : L"0");
writer.WriteString(L">");
if(m_oAutoFilter.IsInit())
m_oAutoFilter->toXML(writer);
if(m_oSortState.IsInit())
m_oSortState->toXML(writer);
if(m_oTableColumns.IsInit())
m_oTableColumns->toXML(writer);
if(m_oTableStyleInfo.IsInit())
m_oTableStyleInfo->toXML(writer);
if(m_oExtLst.IsInit())
{
writer.WriteString(m_oExtLst->toXMLWithNS(_T("")));
}
writer.WriteString(L"</table>");
}
virtual void toXML2(NSStringUtils::CStringBuilder& writer, int nIndex)
{
if(false == m_oRef.IsInit() || false == m_oDisplayName.IsInit()) return;
m_oId.Init();
m_oId->SetValue((unsigned int)nIndex);
toXML(writer);
}
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
{
@ -418,23 +447,52 @@ namespace OOX
private:
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
{
// Читаем атрибуты
WritingElement_ReadAttributes_Start( oReader )
WritingElement_ReadAttributes_Read_if ( oReader, _T("ref"), m_oRef )
WritingElement_ReadAttributes_Read_if ( oReader, _T("headerRowCount"), m_oHeaderRowCount )
WritingElement_ReadAttributes_Read_if ( oReader, _T("totalsRowCount"), m_oTotalsRowCount )
WritingElement_ReadAttributes_Read_if ( oReader, _T("displayName"), m_oDisplayName )
WritingElement_ReadAttributes_Read_if ( oReader, _T("tableBorderDxfId"), m_oTableBorderDxfId )
WritingElement_ReadAttributes_End( oReader )
WritingElement_ReadAttributes_Read_if ( oReader, L"ref", m_oRef )
WritingElement_ReadAttributes_Read_else_if ( oReader, L"headerRowCount", m_oHeaderRowCount )
WritingElement_ReadAttributes_Read_else_if ( oReader, L"totalsRowCount", m_oTotalsRowCount )
WritingElement_ReadAttributes_Read_else_if ( oReader, L"displayName", m_oDisplayName )
WritingElement_ReadAttributes_Read_else_if ( oReader, L"tableBorderDxfId", m_oTableBorderDxfId )
WritingElement_ReadAttributes_Read_else_if ( oReader, L"comment", m_oComment )
WritingElement_ReadAttributes_Read_else_if ( oReader, L"connectionId", m_oConnectionId )
WritingElement_ReadAttributes_Read_else_if ( oReader, L"dataCellStyle", m_oDataCellStyle )
WritingElement_ReadAttributes_Read_else_if ( oReader, L"headerRowBorderDxfId", m_oHeaderRowBorderDxfId )
WritingElement_ReadAttributes_Read_else_if ( oReader, L"headerRowCellStyle", m_oHeaderRowCellStyle )
WritingElement_ReadAttributes_Read_else_if ( oReader, L"headerRowDxfId", m_oHeaderRowDxfId )
WritingElement_ReadAttributes_Read_else_if ( oReader, L"insertRow", m_oInsertRow )
WritingElement_ReadAttributes_Read_else_if ( oReader, L"insertRowShift", m_oInsertRowShift )
WritingElement_ReadAttributes_Read_else_if ( oReader, L"published", m_oPublished )
WritingElement_ReadAttributes_Read_else_if ( oReader, L"id", m_oId )
WritingElement_ReadAttributes_Read_else_if ( oReader, L"tableType", m_oTableType )
WritingElement_ReadAttributes_Read_else_if ( oReader, L"totalsRowBorderDxfId", m_oTotalsRowBorderDxfId )
WritingElement_ReadAttributes_Read_else_if ( oReader, L"totalsRowCellStyle", m_oTotalsRowCellStyle )
WritingElement_ReadAttributes_Read_else_if ( oReader, L"totalsRowDxfId", m_oTotalsRowDxfId )
WritingElement_ReadAttributes_Read_else_if ( oReader, L"totalsRowShown", m_oTotalsRowShown )
WritingElement_ReadAttributes_End( oReader )
}
public:
nullable<SimpleTypes::CRelationshipId > m_oRef;
nullable<SimpleTypes::CUnsignedDecimalNumber<> > m_oHeaderRowCount;
nullable<SimpleTypes::CUnsignedDecimalNumber<> > m_oTotalsRowCount;
nullable<std::wstring > m_oDisplayName;
nullable<SimpleTypes::CUnsignedDecimalNumber<> > m_oTableBorderDxfId;
nullable<SimpleTypes::CUnsignedDecimalNumber<>> m_oHeaderRowCount;
nullable<SimpleTypes::CUnsignedDecimalNumber<>> m_oTotalsRowCount;
nullable_string m_oDisplayName;
nullable_string m_oName;
nullable<SimpleTypes::CUnsignedDecimalNumber<>> m_oTableBorderDxfId;
nullable_string m_oComment;
nullable<SimpleTypes::CUnsignedDecimalNumber<>> m_oConnectionId;
nullable_string m_oDataCellStyle;
nullable<SimpleTypes::CUnsignedDecimalNumber<>> m_oHeaderRowBorderDxfId;
nullable_string m_oHeaderRowCellStyle;
nullable<SimpleTypes::CUnsignedDecimalNumber<>> m_oHeaderRowDxfId;
nullable_bool m_oInsertRow;
nullable_bool m_oInsertRowShift;
nullable_bool m_oPublished;
nullable<SimpleTypes::CUnsignedDecimalNumber<>> m_oId;
nullable<SimpleTypes::Spreadsheet::CTableType<>> m_oTableType;
nullable<SimpleTypes::CUnsignedDecimalNumber<>> m_oTotalsRowBorderDxfId;
nullable_string m_oTotalsRowCellStyle;
nullable<SimpleTypes::CUnsignedDecimalNumber<>> m_oTotalsRowDxfId;
nullable_bool m_oTotalsRowShown;
nullable<CAutofilter > m_oAutoFilter;
nullable<CSortState > m_oSortState;
@ -582,8 +640,6 @@ namespace OOX
virtual ~CTableFile()
{
}
public:
virtual void read(const CPath& oPath)
{
//don't use this. use read(const CPath& oRootPath, const CPath& oFilePath)
@ -645,6 +701,560 @@ namespace OOX
{
}
};
//-------------------------------------------------------------------------------------------------
class CQueryTableField : public WritingElement
{
public:
WritingElement_AdditionConstructors(CQueryTableField)
CQueryTableField(){}
virtual ~CQueryTableField() {}
virtual void fromXML(XmlUtils::CXmlNode& node)
{
}
virtual std::wstring toXML() const
{
return L"";
}
virtual void toXML(NSStringUtils::CStringBuilder& writer) const
{
writer.WriteString(L"<queryTableField");
WritingStringNullableAttrEncodeXmlString(L"name", m_oName, m_oName.get());
WritingStringNullableAttrInt(L"id", m_oId, m_oId->GetValue());
WritingStringNullableAttrInt(L"tableColumnId", m_oTableColumnId, m_oTableColumnId->GetValue());
if (m_oRowNumbers.IsInit()) WritingStringAttrString(L"rowNumbers", *m_oRowNumbers ? L"1" : L"0");
if (m_oFillFormulas.IsInit()) WritingStringAttrString(L"fillFormulas",*m_oFillFormulas ? L"1" : L"0");
if (m_oDataBound.IsInit()) WritingStringAttrString(L"dataBound", *m_oDataBound ? L"1" : L"0");
if (m_oClipped.IsInit()) WritingStringAttrString(L"clipped", *m_oClipped ? L"1" : L"0");
writer.WriteString(L"/>");
}
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("extLst") == sName)
m_oExtLst = oReader;
}
}
virtual EElementType getType () const
{
return et_x_QueryTableField;
}
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
{
WritingElement_ReadAttributes_Start( oReader )
WritingElement_ReadAttributes_Read_if ( oReader, _T("id"), m_oId )
WritingElement_ReadAttributes_Read_if ( oReader, _T("tableColumnId"), m_oTableColumnId )
WritingElement_ReadAttributes_Read_else_if ( oReader, _T("name"), m_oName )
WritingElement_ReadAttributes_Read_else_if ( oReader, _T("rowNumbers"), m_oRowNumbers )
WritingElement_ReadAttributes_Read_else_if ( oReader, _T("fillFormulas"), m_oFillFormulas )
WritingElement_ReadAttributes_Read_else_if ( oReader, _T("dataBound"), m_oDataBound )
WritingElement_ReadAttributes_Read_else_if ( oReader, _T("clipped"), m_oClipped )
WritingElement_ReadAttributes_End( oReader )
}
nullable<SimpleTypes::CUnsignedDecimalNumber<>> m_oId;
nullable<SimpleTypes::CUnsignedDecimalNumber<>> m_oTableColumnId;
nullable<std::wstring> m_oName;
nullable_bool m_oRowNumbers;
nullable_bool m_oFillFormulas;
nullable_bool m_oDataBound;
nullable_bool m_oClipped;
nullable<OOX::Drawing::COfficeArtExtensionList> m_oExtLst;
};
class CQueryTableFields : public WritingElementWithChilds<CQueryTableField>
{
public:
WritingElement_AdditionConstructors(CQueryTableFields)
CQueryTableFields(){}
virtual ~CQueryTableFields() {}
virtual void fromXML(XmlUtils::CXmlNode& node)
{
}
virtual std::wstring toXML() const
{
return _T("");
}
virtual void toXML(NSStringUtils::CStringBuilder& writer) const
{
if(m_arrItems.empty()) return;
writer.WriteString(L"<queryTableFields");
WritingStringAttrInt(L"count", (int)m_arrItems.size());
writer.WriteString(L">");
for ( size_t i = 0; i < m_arrItems.size(); ++i)
{
if ( m_arrItems[i] )
{
m_arrItems[i]->toXML(writer);
}
}
writer.WriteString(L"</queryTableFields>");
}
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 ( L"queryTableField" == sName )
m_arrItems.push_back(new CQueryTableField(oReader));
}
}
virtual EElementType getType () const
{
return et_x_QueryTableFields;
}
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
{
WritingElement_ReadAttributes_Start( oReader )
WritingElement_ReadAttributes_Read_if ( oReader, _T("count"), m_oCount )
WritingElement_ReadAttributes_End( oReader )
}
nullable<SimpleTypes::CUnsignedDecimalNumber<> > m_oCount;
};
class CQueryTableDeletedField : public WritingElement
{
public:
WritingElement_AdditionConstructors(CQueryTableDeletedField)
CQueryTableDeletedField(){}
virtual ~CQueryTableDeletedField() {}
virtual void fromXML(XmlUtils::CXmlNode& node)
{
}
virtual std::wstring toXML() const
{
return L"";
}
virtual void toXML(NSStringUtils::CStringBuilder& writer) const
{
writer.WriteString(L"<deletedField");
WritingStringNullableAttrEncodeXmlString(L"name", m_oName, m_oName.get());
writer.WriteString(L"/>");
}
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
{
ReadAttributes( oReader );
}
virtual EElementType getType () const
{
return et_x_QueryTableDeletedField;
}
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
{
WritingElement_ReadAttributes_Start( oReader )
WritingElement_ReadAttributes_Read_if ( oReader, _T("name"), m_oName )
WritingElement_ReadAttributes_End( oReader )
}
nullable<std::wstring> m_oName;
};
class CQueryTableDeletedFields : public WritingElementWithChilds<CQueryTableDeletedField>
{
public:
WritingElement_AdditionConstructors(CQueryTableDeletedFields)
CQueryTableDeletedFields(){}
virtual ~CQueryTableDeletedFields() {}
virtual void fromXML(XmlUtils::CXmlNode& node)
{
}
virtual std::wstring toXML() const
{
return _T("");
}
virtual void toXML(NSStringUtils::CStringBuilder& writer) const
{
if(m_arrItems.empty()) return;
writer.WriteString(L"<queryTableDeletedFields");
WritingStringAttrInt(L"count", (int)m_arrItems.size());
writer.WriteString(L">");
for ( size_t i = 0; i < m_arrItems.size(); ++i)
{
if ( m_arrItems[i] )
{
m_arrItems[i]->toXML(writer);
}
}
writer.WriteString(L"</queryTableDeletedFields>");
}
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 ( L"deletedField" == sName )
m_arrItems.push_back(new CQueryTableDeletedField(oReader));
}
}
virtual EElementType getType () const
{
return et_x_QueryTableFields;
}
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
{
WritingElement_ReadAttributes_Start( oReader )
WritingElement_ReadAttributes_Read_if ( oReader, _T("count"), m_oCount )
WritingElement_ReadAttributes_End( oReader )
}
nullable<SimpleTypes::CUnsignedDecimalNumber<> > m_oCount;
};
class CQueryTableRefresh : public WritingElement
{
public:
WritingElement_AdditionConstructors(CQueryTableRefresh)
CQueryTableRefresh(){}
virtual ~CQueryTableRefresh() {}
virtual void fromXML(XmlUtils::CXmlNode& node)
{
}
virtual std::wstring toXML() const
{
return L"";
}
virtual void toXML(NSStringUtils::CStringBuilder& writer) const
{
writer.WriteString(L"<queryTableRefresh");
WritingStringNullableAttrInt(L"nextId", m_oNextId, m_oNextId->GetValue());
WritingStringNullableAttrInt(L"unboundColumnsLeft", m_UnboundColumnsLeft, m_UnboundColumnsLeft->GetValue());
WritingStringNullableAttrInt(L"unboundColumnsRight", m_UnboundColumnsRight, m_UnboundColumnsRight->GetValue());
if (m_FieldIdWrapped.IsInit()) WritingStringAttrString(L"fieldIdWrapped", *m_FieldIdWrapped ? L"1" : L"0");
if (m_HeadersInLastRefresh.IsInit()) WritingStringAttrString(L"headersInLastRefresh", *m_HeadersInLastRefresh ? L"1" : L"0");
if (m_PreserveSortFilterLayout.IsInit())WritingStringAttrString(L"preserveSortFilterLayout", *m_PreserveSortFilterLayout ? L"1" : L"0");
if (m_oMinimumVersion.IsInit()) WritingStringAttrInt(L"minimumVersion", m_oMinimumVersion->GetValue());
writer.WriteString(L">");
if (m_oQueryTableFields.IsInit())
m_oQueryTableFields->toXML(writer);
if (m_oQueryTableDeletedFields.IsInit())
m_oQueryTableDeletedFields->toXML(writer);
if (m_oSortState.IsInit())
m_oSortState->toXML(writer);
writer.WriteString(L"</queryTableRefresh");
}
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("queryTableFields") == sName)
m_oQueryTableFields = oReader;
else if (_T("queryTableDeletedFields") == sName)
m_oQueryTableDeletedFields = oReader;
else if (_T("sortState") == sName)
m_oSortState = oReader;
else if (_T("extLst") == sName)
m_oExtLst = oReader;
}
}
virtual EElementType getType () const
{
return et_x_QueryTableRefresh;
}
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
{
WritingElement_ReadAttributes_Start( oReader )
WritingElement_ReadAttributes_Read_if ( oReader, _T("id"), m_oNextId )
WritingElement_ReadAttributes_Read_else_if ( oReader, _T("minimumVersion"), m_oMinimumVersion )
WritingElement_ReadAttributes_Read_else_if ( oReader, _T("fieldIdWrapped"), m_FieldIdWrapped )
WritingElement_ReadAttributes_Read_else_if ( oReader, _T("headersInLastRefresh"), m_HeadersInLastRefresh )
WritingElement_ReadAttributes_Read_else_if ( oReader, _T("preserveSortFilterLayout"), m_PreserveSortFilterLayout )
WritingElement_ReadAttributes_Read_else_if ( oReader, _T("unboundColumnsLeft"), m_UnboundColumnsLeft )
WritingElement_ReadAttributes_Read_else_if ( oReader, _T("unboundColumnsRight"), m_UnboundColumnsRight )
WritingElement_ReadAttributes_End( oReader )
}
nullable<SimpleTypes::CUnsignedDecimalNumber<>> m_oNextId;
nullable<SimpleTypes::CUnsignedDecimalNumber<>> m_oMinimumVersion;
nullable_bool m_FieldIdWrapped;
nullable_bool m_HeadersInLastRefresh;
nullable_bool m_PreserveSortFilterLayout;
nullable<SimpleTypes::CUnsignedDecimalNumber<>> m_UnboundColumnsLeft;
nullable<SimpleTypes::CUnsignedDecimalNumber<>> m_UnboundColumnsRight;
nullable<CQueryTableFields> m_oQueryTableFields;
nullable<CQueryTableDeletedFields> m_oQueryTableDeletedFields;
nullable<CSortState> m_oSortState;
nullable<OOX::Drawing::COfficeArtExtensionList> m_oExtLst;
};
class CQueryTable : public WritingElement
{
public:
WritingElement_AdditionConstructors(CQueryTable)
CQueryTable()
{
}
virtual ~CQueryTable()
{
}
virtual void fromXML(XmlUtils::CXmlNode& node)
{
}
virtual std::wstring toXML() const
{
return L"";
}
virtual void toXML(NSStringUtils::CStringBuilder& writer) const
{
if(false == m_oName.IsInit()) return;
writer.WriteString(L"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\
<queryTable \
xmlns=\"http://schemas.openxmlformats.org/spreadsheetml/2006/main\" \
xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\" \
mc:Ignorable=\"xr16\" \
xmlns:xr16=\"http://schemas.microsoft.com/office/spreadsheetml/2017/revision16\"");
if (m_oAdjustColumnWidth.IsInit()) WritingStringAttrString(L"adjustColumnWidth", *m_oAdjustColumnWidth ? L"1" : L"0");
if (m_oApplyAlignmentFormats.IsInit()) WritingStringAttrString(L"applyAlignmentFormats", *m_oApplyAlignmentFormats ? L"1" : L"0");
if (m_oApplyBorderFormats.IsInit()) WritingStringAttrString(L"applyBorderFormats", *m_oApplyBorderFormats ? L"1" : L"0");
if (m_oApplyFontFormats.IsInit()) WritingStringAttrString(L"applyFontFormats", *m_oApplyFontFormats ? L"1" : L"0");
if (m_oApplyNumberFormats.IsInit()) WritingStringAttrString(L"applyNumberFormats", *m_oApplyNumberFormats ? L"1" : L"0");
if (m_oApplyPatternFormats.IsInit()) WritingStringAttrString(L"applyPatternFormats", *m_oApplyPatternFormats ? L"1" : L"0");
if (m_oApplyWidthHeightFormats.IsInit()) WritingStringAttrString(L"applyWidthHeightFormats", *m_oApplyWidthHeightFormats ? L"1" : L"0");
if (m_oBackgroundRefresh.IsInit()) WritingStringAttrString(L"backgroundRefresh", *m_oBackgroundRefresh ? L"1" : L"0");
WritingStringNullableAttrEncodeXmlString(L"name", m_oName, m_oName.get());
WritingStringNullableAttrInt(L"connectionId", m_oConnectionId, m_oConnectionId->GetValue());
WritingStringNullableAttrInt(L"autoFormatId", m_oAutoFormatId, m_oAutoFormatId->GetValue());
if (m_oDisableEdit.IsInit()) WritingStringAttrString(L"disableEdit", *m_oDisableEdit ? L"1" : L"0");
if (m_oDisableRefresh.IsInit()) WritingStringAttrString(L"disableRefresh", *m_oDisableRefresh ? L"1" : L"0");
if (m_oFillFormulas.IsInit()) WritingStringAttrString(L"fillFormulas", *m_oFillFormulas ? L"1" : L"0");
if (m_oFirstBackgroundRefresh.IsInit()) WritingStringAttrString(L"firstBackgroundRefresh", *m_oFirstBackgroundRefresh ? L"1" : L"0");
WritingStringNullableAttrEncodeXmlString(L"growShrinkType", m_oGrowShrinkType, m_oGrowShrinkType.get());
if (m_oHeaders.IsInit()) WritingStringAttrString(L"headers", *m_oHeaders ? L"1" : L"0");
if (m_oIntermediate.IsInit()) WritingStringAttrString(L"intermediate", *m_oIntermediate ? L"1" : L"0");
if (m_oPreserveFormatting.IsInit()) WritingStringAttrString(L"preserveFormatting", *m_oPreserveFormatting ? L"1" : L"0");
if (m_oRefreshOnLoad.IsInit()) WritingStringAttrString(L"refreshOnLoad", *m_oRefreshOnLoad ? L"1" : L"0");
if (m_oRemoveDataOnSave.IsInit()) WritingStringAttrString(L"removeDataOnSave", *m_oRemoveDataOnSave ? L"1" : L"0");
if (m_oRowNumbers.IsInit()) WritingStringAttrString(L"rowNumbers", *m_oRowNumbers ? L"1" : L"0");
writer.WriteString(L">");
if(m_oQueryTableRefresh.IsInit())
m_oQueryTableRefresh->toXML(writer);
if(m_oExtLst.IsInit())
{
writer.WriteString(m_oExtLst->toXMLWithNS(_T("")));
}
writer.WriteString(L"</queryTable>");
}
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("queryTableRefresh") == sName )
m_oQueryTableRefresh = oReader;
else if (_T("extLst") == sName)
m_oExtLst = oReader;
}
}
virtual EElementType getType () const
{
return et_x_QueryTable;
}
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
{
WritingElement_ReadAttributes_Start( oReader )
WritingElement_ReadAttributes_Read_if ( oReader, L"adjustColumnWidth", m_oAdjustColumnWidth )
WritingElement_ReadAttributes_Read_else_if ( oReader, L"applyAlignmentFormats", m_oApplyAlignmentFormats )
WritingElement_ReadAttributes_Read_else_if ( oReader, L"applyBorderFormats", m_oApplyBorderFormats )
WritingElement_ReadAttributes_Read_else_if ( oReader, L"applyFontFormats", m_oApplyFontFormats )
WritingElement_ReadAttributes_Read_else_if ( oReader, L"applyNumberFormats", m_oApplyNumberFormats )
WritingElement_ReadAttributes_Read_else_if ( oReader, L"applyPatternFormats", m_oApplyPatternFormats )
WritingElement_ReadAttributes_Read_else_if ( oReader, L"applyWidthHeightFormats", m_oApplyWidthHeightFormats )
WritingElement_ReadAttributes_Read_else_if ( oReader, L"autoFormatId", m_oAutoFormatId )
WritingElement_ReadAttributes_Read_else_if ( oReader, L"backgroundRefresh", m_oBackgroundRefresh )
WritingElement_ReadAttributes_Read_else_if ( oReader, L"connectionId", m_oConnectionId )
WritingElement_ReadAttributes_Read_else_if ( oReader, L"disableEdit", m_oDisableEdit )
WritingElement_ReadAttributes_Read_else_if ( oReader, L"disableRefresh", m_oDisableRefresh )
WritingElement_ReadAttributes_Read_else_if ( oReader, L"fillFormulas", m_oFillFormulas )
WritingElement_ReadAttributes_Read_else_if ( oReader, L"firstBackgroundRefresh",m_oFirstBackgroundRefresh )
WritingElement_ReadAttributes_Read_else_if ( oReader, L"growShrinkType", m_oGrowShrinkType )
WritingElement_ReadAttributes_Read_else_if ( oReader, L"headers", m_oHeaders )
WritingElement_ReadAttributes_Read_else_if ( oReader, L"intermediate", m_oIntermediate )
WritingElement_ReadAttributes_Read_else_if ( oReader, L"name", m_oName )
WritingElement_ReadAttributes_Read_else_if ( oReader, L"preserveFormatting", m_oPreserveFormatting )
WritingElement_ReadAttributes_Read_else_if ( oReader, L"refreshOnLoad", m_oRefreshOnLoad )
WritingElement_ReadAttributes_Read_else_if ( oReader, L"removeDataOnSave", m_oRemoveDataOnSave )
WritingElement_ReadAttributes_Read_else_if ( oReader, L"rowNumbers", m_oRowNumbers )
WritingElement_ReadAttributes_End( oReader )
}
nullable_bool m_oAdjustColumnWidth;
nullable_bool m_oApplyAlignmentFormats;
nullable_bool m_oApplyBorderFormats;
nullable_bool m_oApplyFontFormats;
nullable_bool m_oApplyNumberFormats;
nullable_bool m_oApplyPatternFormats;
nullable_bool m_oApplyWidthHeightFormats;
nullable_bool m_oBackgroundRefresh;
nullable<SimpleTypes::CUnsignedDecimalNumber<>> m_oAutoFormatId;
nullable<SimpleTypes::CUnsignedDecimalNumber<>> m_oConnectionId;
nullable_bool m_oDisableEdit;
nullable_bool m_oDisableRefresh;
nullable_bool m_oFillFormulas;
nullable_bool m_oFirstBackgroundRefresh;
nullable_string m_oGrowShrinkType;
nullable_bool m_oHeaders;
nullable_bool m_oIntermediate;
nullable_string m_oName;
nullable_bool m_oPreserveFormatting;
nullable_bool m_oRefreshOnLoad;
nullable_bool m_oRemoveDataOnSave;
nullable_bool m_oRowNumbers;
nullable<CQueryTableRefresh> m_oQueryTableRefresh;
nullable<OOX::Drawing::COfficeArtExtensionList> m_oExtLst;
};
class CQueryTableFile : public OOX::FileGlobalEnumerated, public OOX::IFileContainer
{
public:
CQueryTableFile(OOX::Document* pMain) : OOX::FileGlobalEnumerated(pMain), OOX::IFileContainer(pMain)
{
m_bSpreadsheets = true;
}
CQueryTableFile(OOX::Document* pMain, const CPath& oRootPath, const CPath& oPath) : OOX::FileGlobalEnumerated(pMain), OOX::IFileContainer(pMain)
{
m_bSpreadsheets = true;
read( oRootPath, oPath );
}
virtual ~CQueryTableFile()
{
}
virtual void read(const CPath& oPath)
{
//don't use this. use read(const CPath& oRootPath, const CPath& oFilePath)
CPath oRootPath;
read(oRootPath, oPath);
}
virtual void read(const CPath& oRootPath, const CPath& oPath)
{
m_oReadPath = oPath;
IFileContainer::Read( oRootPath, oPath );
XmlUtils::CXmlLiteReader oReader;
if ( !oReader.FromFile( oPath.GetPath() ) )
return;
if ( !oReader.ReadNextNode() )
return;
m_oQueryTable = oReader;
}
virtual void write(const CPath& oPath, const CPath& oDirectory, CContentTypes& oContent) const
{
if(false == m_oQueryTable.IsInit()) return;
NSStringUtils::CStringBuilder sXml;
m_oQueryTable->toXML(sXml);
std::wstring sPath = oPath.GetPath();
NSFile::CFileBinary::SaveToFile(sPath, sXml.GetData());
oContent.Registration( type().OverrideType(), oDirectory, oPath.GetFilename() );
IFileContainer::Write( oPath, oDirectory, oContent );
}
virtual const OOX::FileType type() const
{
return OOX::Spreadsheet::FileTypes::QueryTable;
}
virtual const CPath DefaultDirectory() const
{
return type().DefaultDirectory();
}
virtual const CPath DefaultFileName() const
{
return type().DefaultFileName();
}
const CPath& GetReadPath()
{
return m_oReadPath;
}
nullable<CQueryTable> m_oQueryTable;
private:
CPath m_oReadPath;
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
{
}
};
} //Spreadsheet
} // namespace OOX

View File

@ -42,14 +42,14 @@ public:
{
m_dwMagicWord = 0xEDB88320;
m_dwInitCrc = 0xFFFFFFFF;
m_bInitTable = FALSE;
m_bInitTable = false;
}
public:
unsigned int Calc(const unsigned char* pStream, int nSize)
unsigned int Calc(const unsigned char* pStream, unsigned int nSize)
{
InitCRCTable();
unsigned int dwRes = m_dwInitCrc;
for (int i=0;i<nSize;i++)
for (unsigned int i=0;i<nSize;i++)
{
dwRes = m_arCRCTable[(dwRes ^ pStream[i])& 0xFF] ^ (dwRes >> 8);
}
@ -77,6 +77,7 @@ private:
}
m_arCRCTable[i] = dwTemp;
}
m_bInitTable = true;
}
unsigned int m_dwMagicWord;

View File

@ -439,6 +439,7 @@ namespace NSDirectory
if (0 == attemps)
{
pcTemplate = L"";
break;
}
}
return pcTemplate;

View File

@ -1850,6 +1850,10 @@ bool CFontFile::IsBold()
if (!m_pFace)
return false;
TT_OS2* pOS2 = (TT_OS2*)FT_Get_Sfnt_Table(m_pFace, ft_sfnt_os2);
if (pOS2 && pOS2->version != 0xFFFF && pOS2->usWeightClass >= 800)
return true;
return ((m_pFace->style_flags & FT_STYLE_FLAG_BOLD) != 0) ? true : false;
}

View File

@ -1,4 +1,4 @@
/*
/*
* (c) Copyright Ascensio System SIA 2010-2019
*
* This program is a free software product. You can redistribute it and/or
@ -33,33 +33,12 @@
#include "Timer.h"
#include "time.h"
#ifdef _MAC
#include "mach/mach.h"
#include "mach/mach_time.h"
#endif
#if defined(_WIN32) || defined (_WIN64)
//#define _CAN_USE_COM_THREADS
#endif
namespace NSTimers
{
#ifdef _MAC
static DWORD getUptimeInMilliseconds()
{
const int64_t kOneMillion = 1000 * 1000;
static mach_timebase_info_data_t s_timebase_info;
if (s_timebase_info.denom == 0) {
(void) mach_timebase_info(&s_timebase_info);
}
// mach_absolute_time() returns billionth of seconds,
// so divide by one million to get milliseconds
return (DWORD)((mach_absolute_time() * s_timebase_info.numer) / (kOneMillion * s_timebase_info.denom));
}
#endif
{
// CLOCK_MONOTONIC defined ONLY since macOS 10.12!!! (crash on earlier version)
DWORD GetTickCount()
{

View File

@ -34,6 +34,11 @@
#include "BaseThread.h"
#ifdef _MAC
#include "mach/mach.h"
#include "mach/mach_time.h"
#endif
namespace NSTimers
{
KERNEL_DECL DWORD GetTickCount();
@ -56,6 +61,31 @@ namespace NSTimers
virtual void OnTimer() = 0;
};
inline static unsigned long getUptimeInMilliseconds()
{
#ifdef _IOS
const int64_t kOneMillion = 1000 * 1000;
static mach_timebase_info_data_t s_timebase_info;
if (s_timebase_info.denom == 0) {
(void) mach_timebase_info(&s_timebase_info);
}
// mach_absolute_time() returns billionth of seconds,
// so divide by one million to get milliseconds
return (unsigned long)((mach_absolute_time() * s_timebase_info.numer) / (kOneMillion * s_timebase_info.denom));
#endif
#ifdef __ANDROID__
struct timespec ts;
clock_gettime(CLOCK_MONOTONIC, &ts);
return (ts.tv_sec * 1000 + (DWORD)(ts.tv_nsec / 1000000));
#endif
return 0;
}
}
#endif

View File

@ -383,14 +383,16 @@ void CPdfRenderer::CCommandManager::Flush()
oTextLine.Flush(pPage);
lTextColor = pText->GetColor();
TColor oColor = lTextColor;
pPage->SetFillColor(oColor.r, oColor.g, oColor.b);
pPage->SetFillColor(oColor.r, oColor.g, oColor.b);
pPage->SetStrokeColor(oColor.r, oColor.g, oColor.b);
}
if (nTextAlpha != pText->GetAlpha())
{
oTextLine.Flush(pPage);
nTextAlpha = pText->GetAlpha();
pPage->SetFillAlpha(nTextAlpha);
pPage->SetFillAlpha(nTextAlpha);
pPage->SetStrokeAlpha(nTextAlpha);
}
if (fabs(dTextSpace - pText->GetSpace()) > 0.001)

View File

@ -116,7 +116,7 @@ namespace BinXlsxRW
if(oTable.m_oDisplayName.IsInit())
{
m_oBcw.m_oStream.WriteBYTE(c_oSer_TablePart::DisplayName);
m_oBcw.m_oStream.WriteStringW(oTable.m_oDisplayName.get2());
m_oBcw.m_oStream.WriteStringW(*oTable.m_oDisplayName);
}
if(oTable.m_oAutoFilter.IsInit())
{

View File

@ -224,8 +224,7 @@ namespace BinXlsxRW
}
else if(c_oSer_TablePart::DisplayName == type)
{
pTable->m_oDisplayName.Init();
pTable->m_oDisplayName->append(m_oBufferedStream.GetString4(length));
pTable->m_oDisplayName = m_oBufferedStream.GetString4(length);
}
else if(c_oSer_TablePart::AutoFilter == type)
{