mirror of
https://github.com/ONLYOFFICE/core.git
synced 2026-02-20 23:06:35 +08:00
Compare commits
99 Commits
core-linux
...
core-linux
| Author | SHA1 | Date | |
|---|---|---|---|
| ee43592691 | |||
| 00328e88b2 | |||
| ed2878a8cc | |||
| bc18304827 | |||
| 8d59eeabd5 | |||
| df894c0193 | |||
| 655c393a1b | |||
| 06b25e1cc6 | |||
| e4ed9cade7 | |||
| 47dc96ba3c | |||
| 3c4154b3ac | |||
| 455c8b3836 | |||
| a9252192e8 | |||
| e31f101021 | |||
| f34660291a | |||
| cebfe04802 | |||
| 746490cea1 | |||
| 18df04b508 | |||
| 0bd1fb972f | |||
| 7b92c7d079 | |||
| 7e3aebe79c | |||
| 34fc112d0e | |||
| 2d219d5a74 | |||
| 9d30e3ecab | |||
| c6de9b9e52 | |||
| affc65c679 | |||
| 2cff8d9804 | |||
| 28f8de794f | |||
| daac90f8dc | |||
| 30adbb0a24 | |||
| 94e59cfc82 | |||
| 9794d714d3 | |||
| 8d80005bab | |||
| a4d22be862 | |||
| 3f615c2ece | |||
| 95e1a1edf9 | |||
| f7f9346286 | |||
| c0c6baf636 | |||
| ccbc044f11 | |||
| a8668df5fd | |||
| cc228f3393 | |||
| 19904acd30 | |||
| 30d175144a | |||
| acf15abe41 | |||
| 5a7fc7f548 | |||
| e7326556e0 | |||
| c589d8fe8a | |||
| a28e8f1357 | |||
| 8b7bb944bc | |||
| 14ee946069 | |||
| 7aebdd8ec5 | |||
| 977baafc03 | |||
| 31b854bc70 | |||
| e274dc50d7 | |||
| d153db627b | |||
| 9cc6bc14c5 | |||
| 775c57be5d | |||
| da37aeb039 | |||
| 751c6647a2 | |||
| ec2344ccd5 | |||
| 0494882541 | |||
| 07b0ba71d9 | |||
| 299ef4873f | |||
| 93c7819106 | |||
| 16c3f81dee | |||
| 7fc67bdadf | |||
| 31deb60343 | |||
| 7e83e168db | |||
| a4c0fbe4ea | |||
| ae0f5867dd | |||
| 0dd4fc9c14 | |||
| 3a92ef2395 | |||
| 23c9a65fcb | |||
| ba55f1436d | |||
| f1c1d62a4d | |||
| c2bdec6bde | |||
| 93d0ebfa09 | |||
| 6f881e2066 | |||
| 8be0d7f2b3 | |||
| cbbb4c19de | |||
| f4e0ce53b4 | |||
| 8f332c3c09 | |||
| 4721a4a96b | |||
| 44a0c65637 | |||
| 4de7090c78 | |||
| 6f09ec71f9 | |||
| b122d75f34 | |||
| ed613f7ec1 | |||
| e0bc06d3db | |||
| 366f16aa4f | |||
| 662c687520 | |||
| efc70421e2 | |||
| 7522ad9167 | |||
| f7922fcea8 | |||
| 19dabff8e6 | |||
| 84bd16951f | |||
| 4e4e1e4ba5 | |||
| 8996935a10 | |||
| 87c999474d |
2
.gitignore
vendored
2
.gitignore
vendored
@ -3,6 +3,8 @@ dictionaries/
|
||||
LicenceManager/
|
||||
Common/boost_1_58_0
|
||||
Common/3dParty/boost/boost_1_58_0
|
||||
Common/3dParty/boost/ios
|
||||
Common/3dParty/boost/osx
|
||||
Common/3dParty/icu/win_64
|
||||
Common/3dParty/icu/win_32
|
||||
Common/3dParty/icu/linux_64
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
@ -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;
|
||||
|
||||
};
|
||||
}
|
||||
@ -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;
|
||||
};
|
||||
}
|
||||
@ -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;
|
||||
};
|
||||
}
|
||||
@ -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;
|
||||
};
|
||||
}
|
||||
@ -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;
|
||||
};
|
||||
}
|
||||
@ -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;
|
||||
};
|
||||
}
|
||||
@ -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;
|
||||
};
|
||||
}
|
||||
@ -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 )
|
||||
|
||||
@ -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*/);
|
||||
|
||||
@ -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 shape’s path.
|
||||
/// This string describes both the pSegmentInfo array and pVertices array in the shape’s 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;
|
||||
|
||||
@ -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)
|
||||
{
|
||||
|
||||
@ -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");
|
||||
}
|
||||
|
||||
@ -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) && (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"
");
|
||||
appendValueAttribute(&m_textpath, L"string", text);
|
||||
}
|
||||
text = ReplaceString(text, L"\n", L"
");
|
||||
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,25 @@ 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"";
|
||||
if (pWrapPolygonVertices->complex.data.empty()) 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 +1569,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 +1581,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 +1608,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 +1622,7 @@ namespace DocFileFormat
|
||||
bZIndex = true;
|
||||
}
|
||||
|
||||
if (groupShapeBooleans.fHidden && groupShapeBooleans.fUsefHidden)
|
||||
if (booleans->fHidden && booleans->fUsefHidden)
|
||||
{
|
||||
appendStyleProperty(oStyle, L"visibility", L"hidden" );
|
||||
}
|
||||
@ -1714,7 +1689,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 +1697,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 +1842,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 +1923,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 +1945,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;
|
||||
}
|
||||
//------------------------------------------------------------------------------------------------------
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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" );
|
||||
}
|
||||
|
||||
@ -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 \
|
||||
|
||||
@ -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"
|
||||
>
|
||||
|
||||
@ -33,6 +33,7 @@
|
||||
#define COMMENTS_WRITER
|
||||
|
||||
#include "../../XlsxSerializerCom/Common/Common.h"
|
||||
#include "../../Common/DocxFormat/Source/DocxFormat/FileTypes.h"
|
||||
|
||||
namespace Writers
|
||||
{
|
||||
@ -50,21 +51,28 @@ namespace Writers
|
||||
std::wstring m_sComment;
|
||||
std::wstring m_sCommentExt;
|
||||
std::wstring m_sPeople;
|
||||
std::wstring m_sDocumentComment;
|
||||
std::wstring m_sDocumentCommentExt;
|
||||
std::wstring m_sDocumentPeople;
|
||||
|
||||
CommentsWriter(std::wstring sDir) : m_sDir(sDir)
|
||||
{
|
||||
}
|
||||
void setElements(std::wstring& sComment, std::wstring& sCommentExt, std::wstring& sPeople)
|
||||
void setElements(std::wstring& sComment, std::wstring& sCommentExt, std::wstring& sPeople, std::wstring& sDocumentComment, std::wstring& sDocumentCommentExt, std::wstring& sDocumentPeople)
|
||||
{
|
||||
m_sComment = sComment;
|
||||
m_sCommentExt = sCommentExt;
|
||||
m_sPeople = sPeople;
|
||||
m_sDocumentComment = sDocumentComment;
|
||||
m_sDocumentCommentExt = sDocumentCommentExt;
|
||||
m_sDocumentPeople = sDocumentPeople;
|
||||
}
|
||||
void Write()
|
||||
{
|
||||
std::wstring sDir = m_sDir + FILE_SEPARATOR_STR + _T("word") + FILE_SEPARATOR_STR;
|
||||
if(false == m_sComment.empty())
|
||||
{
|
||||
OOX::CPath filePath = m_sDir + FILE_SEPARATOR_STR + _T("word") + FILE_SEPARATOR_STR + _T("comments.xml");
|
||||
OOX::CPath filePath = sDir + OOX::FileTypes::Comments.DefaultFileName().GetPath();
|
||||
|
||||
NSFile::CFileBinary oFile;
|
||||
oFile.CreateFileW(filePath.GetPath());
|
||||
@ -76,7 +84,7 @@ namespace Writers
|
||||
if(false == m_sCommentExt.empty())
|
||||
{
|
||||
NSFile::CFileBinary oFile;
|
||||
oFile.CreateFileW(m_sDir + FILE_SEPARATOR_STR + _T("word") + FILE_SEPARATOR_STR + _T("commentsExtended.xml"));
|
||||
oFile.CreateFileW(sDir + OOX::FileTypes::CommentsExt.DefaultFileName().GetPath());
|
||||
oFile.WriteStringUTF8(g_string_commentExt_Start);
|
||||
oFile.WriteStringUTF8(m_sCommentExt);
|
||||
oFile.WriteStringUTF8(g_string_commentExt_End);
|
||||
@ -85,12 +93,43 @@ namespace Writers
|
||||
if(false == m_sPeople.empty())
|
||||
{
|
||||
NSFile::CFileBinary oFile;
|
||||
oFile.CreateFileW(m_sDir + FILE_SEPARATOR_STR + _T("word") + FILE_SEPARATOR_STR + _T("people.xml"));
|
||||
oFile.CreateFileW(sDir + OOX::FileTypes::People.DefaultFileName().GetPath());
|
||||
oFile.WriteStringUTF8(g_string_people_Start);
|
||||
oFile.WriteStringUTF8(m_sPeople);
|
||||
oFile.WriteStringUTF8(g_string_people_End);
|
||||
oFile.CloseFile();
|
||||
}
|
||||
|
||||
if(false == m_sDocumentComment.empty())
|
||||
{
|
||||
OOX::CPath filePath = sDir + OOX::FileTypes::DocumentComments.DefaultFileName().GetPath();
|
||||
|
||||
NSFile::CFileBinary oFile;
|
||||
oFile.CreateFileW(filePath.GetPath());
|
||||
oFile.WriteStringUTF8(g_string_comment_Start);
|
||||
oFile.WriteStringUTF8(m_sDocumentComment);
|
||||
oFile.WriteStringUTF8(g_string_comment_End);
|
||||
oFile.CloseFile();
|
||||
}
|
||||
if(false == m_sDocumentCommentExt.empty())
|
||||
{
|
||||
NSFile::CFileBinary oFile;
|
||||
oFile.CreateFileW(sDir + OOX::FileTypes::DocumentCommentsExt.DefaultFileName().GetPath());
|
||||
oFile.WriteStringUTF8(g_string_commentExt_Start);
|
||||
oFile.WriteStringUTF8(m_sDocumentCommentExt);
|
||||
oFile.WriteStringUTF8(g_string_commentExt_End);
|
||||
oFile.CloseFile();
|
||||
}
|
||||
if(false == m_sDocumentPeople.empty())
|
||||
{
|
||||
NSFile::CFileBinary oFile;
|
||||
oFile.CreateFileW(sDir + OOX::FileTypes::DocumentPeople.DefaultFileName().GetPath());
|
||||
oFile.WriteStringUTF8(g_string_people_Start);
|
||||
oFile.WriteStringUTF8(m_sDocumentPeople);
|
||||
oFile.WriteStringUTF8(g_string_people_End);
|
||||
oFile.CloseFile();
|
||||
}
|
||||
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@ -58,6 +58,11 @@ namespace NSBinPptxRW
|
||||
{
|
||||
class CDrawingConverter;
|
||||
}
|
||||
namespace OOX
|
||||
{
|
||||
class CApp;
|
||||
class CCore;
|
||||
}
|
||||
|
||||
namespace Writers
|
||||
{
|
||||
@ -87,6 +92,8 @@ namespace Writers
|
||||
std::wstring m_sThemePath;
|
||||
int m_nDocPrIndex;
|
||||
BinDocxRW::CComments* m_pComments;
|
||||
OOX::CApp* m_pApp;
|
||||
OOX::CCore* m_pCore;
|
||||
|
||||
FileWriter (std::wstring sDirOutput,std::wstring sFontDir, bool bNoFontDir, int nVersion, bool bSaveChartAsImg, NSBinPptxRW::CDrawingConverter* pDrawingConverter, std::wstring sThemePath)
|
||||
: m_pDrawingConverter(pDrawingConverter), m_sThemePath(sThemePath), m_bSaveChartAsImg(bSaveChartAsImg),
|
||||
@ -105,9 +112,16 @@ namespace Writers
|
||||
m_oWebSettingsWriter (sDirOutput),
|
||||
m_nDocPrIndex(0),
|
||||
m_pComments(NULL),
|
||||
m_oCustomXmlWriter (sDirOutput, pDrawingConverter)
|
||||
m_oCustomXmlWriter (sDirOutput, pDrawingConverter),
|
||||
m_pApp (NULL),
|
||||
m_pCore (NULL)
|
||||
{
|
||||
}
|
||||
~FileWriter()
|
||||
{
|
||||
RELEASEOBJECT(m_pApp);
|
||||
RELEASEOBJECT(m_pCore);
|
||||
}
|
||||
int getNextDocPr()
|
||||
{
|
||||
m_nDocPrIndex++;
|
||||
|
||||
@ -29,6 +29,8 @@
|
||||
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
*
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#ifndef READER_CLASSES
|
||||
#define READER_CLASSES
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -37,7 +37,7 @@
|
||||
namespace Writers
|
||||
{
|
||||
static std::wstring g_string_set_Start = _T("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\" ?><w:settings xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\" xmlns:m=\"http://schemas.openxmlformats.org/officeDocument/2006/math\" xmlns:o=\"urn:schemas-microsoft-com:office:office\" xmlns:v=\"urn:schemas-microsoft-com:vml\">");
|
||||
static std::wstring g_string_set_Default = _T("<w:zoom w:percent=\"100\"/><w:characterSpacingControl w:val=\"doNotCompress\"/><w:compat><w:compatSetting w:name=\"compatibilityMode\" w:uri=\"http://schemas.microsoft.com/office/word\" w:val=\"15\"/><w:compatSetting w:name=\"overrideTableStyleFontSizeAndJustification\" w:uri=\"http://schemas.microsoft.com/office/word\" w:val=\"1\"/><w:compatSetting w:name=\"enableOpenTypeFeatures\" w:uri=\"http://schemas.microsoft.com/office/word\" w:val=\"1\"/><w:compatSetting w:name=\"doNotFlipMirrorIndents\" w:uri=\"http://schemas.microsoft.com/office/word\" w:val=\"1\"/></w:compat><w:themeFontLang w:val=\"en-US\" w:eastAsia=\"zh-CN\"/><w:shapeDefaults><o:shapedefaults v:ext=\"edit\" spidmax=\"1026\"/><o:shapelayout v:ext=\"edit\"><o:idmap v:ext=\"edit\" data=\"1\"/></o:shapelayout></w:shapeDefaults><w:decimalSymbol w:val=\".\"/><w:listSeparator w:val=\",\"/>");
|
||||
static std::wstring g_string_set_Default = _T("<w:zoom w:percent=\"100\"/><w:characterSpacingControl w:val=\"doNotCompress\"/><w:compat><w:compatSetting w:name=\"compatibilityMode\" w:uri=\"http://schemas.microsoft.com/office/word\" w:val=\"15\"/><w:compatSetting w:name=\"overrideTableStyleFontSizeAndJustification\" w:uri=\"http://schemas.microsoft.com/office/word\" w:val=\"1\"/><w:compatSetting w:name=\"enableOpenTypeFeatures\" w:uri=\"http://schemas.microsoft.com/office/word\" w:val=\"1\"/><w:compatSetting w:name=\"doNotFlipMirrorIndents\" w:uri=\"http://schemas.microsoft.com/office/word\" w:val=\"1\"/></w:compat><w:themeFontLang w:val=\"en-US\" w:eastAsia=\"zh-CN\"/><w:shapeDefaults><o:shapedefaults v:ext=\"edit\" spidmax=\"1026\"/><o:shapelayout v:ext=\"edit\"><o:idmap v:ext=\"edit\" data=\"1\"/></o:shapelayout></w:shapeDefaults>");
|
||||
static std::wstring g_string_set_End = _T("</w:settings>");
|
||||
|
||||
class SettingWriter
|
||||
|
||||
@ -34,8 +34,9 @@
|
||||
|
||||
#include "BinReaderWriterDefines.h"
|
||||
|
||||
#include "../../Common/DocxFormat/Source/Common/SimpleTypes_OMath.h"
|
||||
#include "../../Common/DocxFormat/Source/MathEquation/OutputDev.h"
|
||||
#include "../../Common/DocxFormat/Source/Common/SimpleTypes_OMath.h"
|
||||
#include "../../Common/DocxFormat/Source/Common/SimpleTypes_Shared.h"
|
||||
#include <stack>
|
||||
|
||||
namespace MathEquation
|
||||
|
||||
@ -146,7 +146,8 @@ extern int g_nCurFormatVersion;
|
||||
Background = 12,
|
||||
VbaProject = 13,
|
||||
App = 15,
|
||||
Core = 16
|
||||
Core = 16,
|
||||
DocumentComments = 17
|
||||
};}
|
||||
namespace c_oSerSigTypes{enum c_oSerSigTypes
|
||||
{
|
||||
@ -809,7 +810,9 @@ extern int g_nCurFormatVersion;
|
||||
SdtGlobalColor = 6,
|
||||
SdtGlobalShowHighlight = 7,
|
||||
Compat = 8,
|
||||
DefaultTabStopTwips = 9
|
||||
DefaultTabStopTwips = 9,
|
||||
DecimalSymbol = 10,
|
||||
ListSeparator = 11
|
||||
};}
|
||||
namespace c_oSer_MathPrType{enum c_oSer_SettingsType
|
||||
{
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -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();
|
||||
|
||||
@ -30,15 +30,20 @@
|
||||
*
|
||||
*/
|
||||
#include "DocxSerializer.h"
|
||||
|
||||
#include "../BinWriter/BinWriters.h"
|
||||
#include "../BinReader/Readers.h"
|
||||
|
||||
#include "../../ASCOfficePPTXFile/ASCOfficeDrawingConverter.h"
|
||||
#include "../../ASCOfficePPTXFile/Editor/FontPicker.h"
|
||||
|
||||
#include "FontProcessor.h"
|
||||
#include "../../OfficeUtils/src/OfficeUtils.h"
|
||||
|
||||
#include "../../DesktopEditor/common/Directory.h"
|
||||
#include "../../DesktopEditor/common/File.h"
|
||||
#include "../../DesktopEditor/common/Path.h"
|
||||
#include "../../DesktopEditor/common/SystemUtils.h"
|
||||
#include "../BinWriter/BinWriters.h"
|
||||
#include "../BinReader/Readers.h"
|
||||
#include "../../ASCOfficePPTXFile/Editor/FontPicker.h"
|
||||
#include "../../OfficeUtils/src/OfficeUtils.h"
|
||||
|
||||
#include "../../Common/DocxFormat/Source/DocxFormat/App.h"
|
||||
#include "../../Common/DocxFormat/Source/DocxFormat/Core.h"
|
||||
@ -296,33 +301,28 @@ bool BinDocxRW::CDocxSerializer::loadFromFile(const std::wstring& sSrcFileName,
|
||||
|
||||
OOX::CPath DocProps = std::wstring(_T("docProps"));
|
||||
|
||||
OOX::CApp* pApp = new OOX::CApp(NULL);
|
||||
if (pApp)
|
||||
if (NULL != m_pCurFileWriter->m_pApp)
|
||||
{
|
||||
std::wstring sApplication = NSSystemUtils::GetEnvVariable(NSSystemUtils::gc_EnvApplicationName);
|
||||
if (sApplication.empty())
|
||||
sApplication = NSSystemUtils::gc_EnvApplicationNameDefault;
|
||||
pApp->SetApplication(sApplication);
|
||||
#if defined(INTVER)
|
||||
pApp->SetAppVersion(VALUE2STR(INTVER));
|
||||
#endif
|
||||
pApp->SetDocSecurity(0);
|
||||
pApp->SetScaleCrop(false);
|
||||
pApp->SetLinksUpToDate(false);
|
||||
pApp->SetSharedDoc(false);
|
||||
pApp->SetHyperlinksChanged(false);
|
||||
|
||||
pApp->write(pathDocProps + FILE_SEPARATOR_STR + _T("app.xml"), DocProps, *pContentTypes);
|
||||
delete pApp;
|
||||
}
|
||||
OOX::CCore* pCore = new OOX::CCore(NULL);
|
||||
if (pCore)
|
||||
m_pCurFileWriter->m_pApp->write(pathDocProps + FILE_SEPARATOR_STR + _T("app.xml"), DocProps, *pContentTypes);
|
||||
}
|
||||
else
|
||||
{
|
||||
pCore->SetCreator(_T(""));
|
||||
pCore->SetLastModifiedBy(_T(""));
|
||||
pCore->write(pathDocProps + FILE_SEPARATOR_STR + _T("core.xml"), DocProps, *pContentTypes);
|
||||
delete pCore;
|
||||
}
|
||||
OOX::CApp pApp(NULL);
|
||||
pApp.SetDefaults();
|
||||
pApp.write(pathDocProps + FILE_SEPARATOR_STR + _T("app.xml"), DocProps, *pContentTypes);
|
||||
}
|
||||
|
||||
if (NULL != m_pCurFileWriter->m_pCore)
|
||||
{
|
||||
m_pCurFileWriter->m_pCore->write(pathDocProps + FILE_SEPARATOR_STR + _T("core.xml"), DocProps, *pContentTypes);
|
||||
}
|
||||
else
|
||||
{
|
||||
OOX::CCore pCore(NULL);
|
||||
pCore.SetDefaults();
|
||||
pCore.write(pathDocProps + FILE_SEPARATOR_STR + _T("core.xml"), DocProps, *pContentTypes);
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////
|
||||
m_pCurFileWriter->Write();
|
||||
pContentTypes->Write(sDstPath);
|
||||
|
||||
@ -32,6 +32,8 @@ SOURCES += \
|
||||
../../XlsxSerializerCom/Reader/ChartFromToBinary.cpp \
|
||||
../../XlsxSerializerCom/Reader/CommonWriter.cpp \
|
||||
../../XlsxSerializerCom/Reader/CSVReader.cpp \
|
||||
../../XlsxSerializerCom/Reader/BinaryWriter.cpp \
|
||||
../../XlsxSerializerCom/Writer/BinaryReader.cpp \
|
||||
../../XlsxSerializerCom/Writer/CSVWriter.cpp \
|
||||
../../OfficeCryptReader/source/ECMACryptFile.cpp \
|
||||
../../OfficeCryptReader/source/CryptTransform.cpp \
|
||||
|
||||
@ -55,6 +55,8 @@
|
||||
8A404FD5208A01CE00F2D5CF /* FileDownloader_private.h in Headers */ = {isa = PBXBuildFile; fileRef = 8A404FD4208A01CE00F2D5CF /* FileDownloader_private.h */; };
|
||||
8AB24BFD213004E400E80DDD /* CustormXmlWriter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8AB24BFB213004E300E80DDD /* CustormXmlWriter.cpp */; };
|
||||
8AB24BFE213004E400E80DDD /* CustormXmlWriter.h in Headers */ = {isa = PBXBuildFile; fileRef = 8AB24BFC213004E300E80DDD /* CustormXmlWriter.h */; };
|
||||
8AE10E6E222824F400A542DE /* BinaryWriter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8AE10E6D222824F400A542DE /* BinaryWriter.cpp */; };
|
||||
8AE10E702228251000A542DE /* BinaryReader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8AE10E6F2228251000A542DE /* BinaryReader.cpp */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
@ -107,6 +109,8 @@
|
||||
8A404FD4208A01CE00F2D5CF /* FileDownloader_private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FileDownloader_private.h; path = ../../../Common/FileDownloader/FileDownloader_private.h; sourceTree = "<group>"; };
|
||||
8AB24BFB213004E300E80DDD /* CustormXmlWriter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CustormXmlWriter.cpp; sourceTree = "<group>"; };
|
||||
8AB24BFC213004E300E80DDD /* CustormXmlWriter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CustormXmlWriter.h; sourceTree = "<group>"; };
|
||||
8AE10E6D222824F400A542DE /* BinaryWriter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BinaryWriter.cpp; sourceTree = "<group>"; };
|
||||
8AE10E6F2228251000A542DE /* BinaryReader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BinaryReader.cpp; sourceTree = "<group>"; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
@ -215,6 +219,7 @@
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
17E17F211AC4549B00BEA2EA /* BinaryWriter.h */,
|
||||
8AE10E6D222824F400A542DE /* BinaryWriter.cpp */,
|
||||
17E17F221AC4549B00BEA2EA /* ChartFromToBinary.cpp */,
|
||||
17E17F231AC4549B00BEA2EA /* ChartFromToBinary.h */,
|
||||
17E17F241AC4549B00BEA2EA /* CommonWriter.cpp */,
|
||||
@ -230,6 +235,7 @@
|
||||
children = (
|
||||
17E17F2D1AC4549B00BEA2EA /* BinaryCommonReader.h */,
|
||||
17E17F2E1AC4549B00BEA2EA /* BinaryReader.h */,
|
||||
8AE10E6F2228251000A542DE /* BinaryReader.cpp */,
|
||||
17E17F2F1AC4549B00BEA2EA /* CSVWriter.cpp */,
|
||||
17E17F301AC4549B00BEA2EA /* CSVWriter.h */,
|
||||
);
|
||||
@ -362,11 +368,13 @@
|
||||
17C1FE9B1ACC42C4006B99B3 /* CSVWriter.cpp in Sources */,
|
||||
69414A301CB51666003E771B /* ChartWriter.cpp in Sources */,
|
||||
6967917E1D9E8AEE002CA4BA /* BinWriters.cpp in Sources */,
|
||||
8AE10E702228251000A542DE /* BinaryReader.cpp in Sources */,
|
||||
69BBDF251F0B8AAC00EB1BF7 /* FileDownloader_mac.mm in Sources */,
|
||||
17C1FE9C1ACC42C4006B99B3 /* XlsxSerializer.cpp in Sources */,
|
||||
690FE0851E9BBD68004B26D0 /* Readers.cpp in Sources */,
|
||||
17C1FE9D1ACC42C4006B99B3 /* FontProcessor.cpp in Sources */,
|
||||
8A404FD3208A01AF00F2D5CF /* FileDownloader.cpp in Sources */,
|
||||
8AE10E6E222824F400A542DE /* BinaryWriter.cpp in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
|
||||
@ -0,0 +1,80 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "1010"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
buildImplicitDependencies = "YES">
|
||||
<BuildActionEntries>
|
||||
<BuildActionEntry
|
||||
buildForTesting = "YES"
|
||||
buildForRunning = "YES"
|
||||
buildForProfiling = "YES"
|
||||
buildForArchiving = "YES"
|
||||
buildForAnalyzing = "YES">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "17C1FE921ACC42C4006B99B3"
|
||||
BuildableName = "libASCOfficeDocxFile2Lib_ios.a"
|
||||
BlueprintName = "ASCOfficeDocxFile2Lib"
|
||||
ReferencedContainer = "container:ASCOfficeDocxFile2Lib.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildActionEntry>
|
||||
</BuildActionEntries>
|
||||
</BuildAction>
|
||||
<TestAction
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES">
|
||||
<Testables>
|
||||
</Testables>
|
||||
<AdditionalOptions>
|
||||
</AdditionalOptions>
|
||||
</TestAction>
|
||||
<LaunchAction
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
launchStyle = "0"
|
||||
useCustomWorkingDirectory = "NO"
|
||||
ignoresPersistentStateOnLaunch = "NO"
|
||||
debugDocumentVersioning = "YES"
|
||||
debugServiceExtension = "internal"
|
||||
allowLocationSimulation = "YES">
|
||||
<MacroExpansion>
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "17C1FE921ACC42C4006B99B3"
|
||||
BuildableName = "libASCOfficeDocxFile2Lib_ios.a"
|
||||
BlueprintName = "ASCOfficeDocxFile2Lib"
|
||||
ReferencedContainer = "container:ASCOfficeDocxFile2Lib.xcodeproj">
|
||||
</BuildableReference>
|
||||
</MacroExpansion>
|
||||
<AdditionalOptions>
|
||||
</AdditionalOptions>
|
||||
</LaunchAction>
|
||||
<ProfileAction
|
||||
buildConfiguration = "Release"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES"
|
||||
savedToolIdentifier = ""
|
||||
useCustomWorkingDirectory = "NO"
|
||||
debugDocumentVersioning = "YES">
|
||||
<MacroExpansion>
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "17C1FE921ACC42C4006B99B3"
|
||||
BuildableName = "libASCOfficeDocxFile2Lib_ios.a"
|
||||
BlueprintName = "ASCOfficeDocxFile2Lib"
|
||||
ReferencedContainer = "container:ASCOfficeDocxFile2Lib.xcodeproj">
|
||||
</BuildableReference>
|
||||
</MacroExpansion>
|
||||
</ProfileAction>
|
||||
<AnalyzeAction
|
||||
buildConfiguration = "Debug">
|
||||
</AnalyzeAction>
|
||||
<ArchiveAction
|
||||
buildConfiguration = "Release"
|
||||
revealArchiveInOrganizer = "YES">
|
||||
</ArchiveAction>
|
||||
</Scheme>
|
||||
@ -14,8 +14,8 @@
|
||||
buildForAnalyzing = "YES">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "17E17EDB1AC453F800BEA2EA"
|
||||
BuildableName = "libASCOfficeDocxFile2Lib.a"
|
||||
BlueprintIdentifier = "17C1FE921ACC42C4006B99B3"
|
||||
BuildableName = "libASCOfficeDocxFile2Lib_ios.a"
|
||||
BlueprintName = "ASCOfficeDocxFile2Lib"
|
||||
ReferencedContainer = "container:ASCOfficeDocxFile2Lib.xcodeproj">
|
||||
</BuildableReference>
|
||||
@ -23,27 +23,30 @@
|
||||
</BuildActionEntries>
|
||||
</BuildAction>
|
||||
<TestAction
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES"
|
||||
buildConfiguration = "Debug">
|
||||
shouldUseLaunchSchemeArgsEnv = "YES">
|
||||
<Testables>
|
||||
</Testables>
|
||||
<AdditionalOptions>
|
||||
</AdditionalOptions>
|
||||
</TestAction>
|
||||
<LaunchAction
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
launchStyle = "0"
|
||||
useCustomWorkingDirectory = "NO"
|
||||
buildConfiguration = "Debug"
|
||||
ignoresPersistentStateOnLaunch = "NO"
|
||||
debugDocumentVersioning = "YES"
|
||||
debugServiceExtension = "internal"
|
||||
allowLocationSimulation = "YES">
|
||||
<MacroExpansion>
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "17E17EDB1AC453F800BEA2EA"
|
||||
BuildableName = "libASCOfficeDocxFile2Lib.a"
|
||||
BlueprintIdentifier = "17C1FE921ACC42C4006B99B3"
|
||||
BuildableName = "libASCOfficeDocxFile2Lib_ios.a"
|
||||
BlueprintName = "ASCOfficeDocxFile2Lib"
|
||||
ReferencedContainer = "container:ASCOfficeDocxFile2Lib.xcodeproj">
|
||||
</BuildableReference>
|
||||
@ -52,16 +55,16 @@
|
||||
</AdditionalOptions>
|
||||
</LaunchAction>
|
||||
<ProfileAction
|
||||
buildConfiguration = "Release"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES"
|
||||
savedToolIdentifier = ""
|
||||
useCustomWorkingDirectory = "NO"
|
||||
buildConfiguration = "Release"
|
||||
debugDocumentVersioning = "YES">
|
||||
<MacroExpansion>
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "17E17EDB1AC453F800BEA2EA"
|
||||
BuildableName = "libASCOfficeDocxFile2Lib.a"
|
||||
BlueprintIdentifier = "17C1FE921ACC42C4006B99B3"
|
||||
BuildableName = "libASCOfficeDocxFile2Lib_ios.a"
|
||||
BlueprintName = "ASCOfficeDocxFile2Lib"
|
||||
ReferencedContainer = "container:ASCOfficeDocxFile2Lib.xcodeproj">
|
||||
</BuildableReference>
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Workspace
|
||||
version = "1.0">
|
||||
<FileRef
|
||||
location = "self:ASCOfficeOdfFile.xcodeproj">
|
||||
</FileRef>
|
||||
</Workspace>
|
||||
@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>IDEDidComputeMac32BitWarning</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</plist>
|
||||
@ -0,0 +1 @@
|
||||
DO NOT REMOVE FOLDER FOR XCODE
|
||||
@ -47,6 +47,7 @@
|
||||
#include "../odf/style_graphic_properties.h"
|
||||
|
||||
#include "docx_package.h"
|
||||
#include "xlsx_package.h"
|
||||
#include "oox_rels.h"
|
||||
#include "logging.h"
|
||||
|
||||
@ -130,7 +131,7 @@ text_tracked_context::_state & text_tracked_context::get_tracked_change(std::wst
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------------------------------
|
||||
docx_conversion_context::docx_conversion_context(odf_reader::odf_document * OdfDocument) :
|
||||
docx_conversion_context::docx_conversion_context(odf_reader::odf_document * _odf_document) :
|
||||
last_dump_page_properties_ (true),
|
||||
next_dump_page_properties_ (false),
|
||||
page_break_ (false),
|
||||
@ -146,16 +147,19 @@ docx_conversion_context::docx_conversion_context(odf_reader::odf_document * OdfD
|
||||
process_note_ (noNote),
|
||||
new_list_style_number_ (0),
|
||||
current_margin_left_ (0),
|
||||
current_outline_level_ (-1),
|
||||
is_rtl_ (false),
|
||||
is_delete_text_ (false),
|
||||
delayed_converting_ (false),
|
||||
process_headers_footers_ (false),
|
||||
process_comment_ (false),
|
||||
mediaitems_ (OdfDocument->get_folder() ),
|
||||
math_context_ (OdfDocument->odf_context().fontContainer(), false),
|
||||
odf_document_ (OdfDocument)
|
||||
odf_document_ (_odf_document),
|
||||
math_context_ (_odf_document->odf_context().fontContainer(), false)
|
||||
{
|
||||
streams_man_ = streams_man::create(temp_stream_);
|
||||
mediaitems_ = boost::make_shared<mediaitems>(odf_document_->get_folder());
|
||||
chart_drawing_handle_ = boost::make_shared<xlsx_drawing_context_handle>(mediaitems_);
|
||||
|
||||
streams_man_ = streams_man::create(temp_stream_);
|
||||
}
|
||||
docx_conversion_context::~docx_conversion_context()
|
||||
{
|
||||
@ -166,7 +170,7 @@ void docx_conversion_context::set_output_document(package::docx_document * docum
|
||||
}
|
||||
void docx_conversion_context::set_font_directory(std::wstring pathFonts)
|
||||
{
|
||||
mediaitems_.set_font_directory(pathFonts);
|
||||
mediaitems_->set_font_directory(pathFonts);
|
||||
}
|
||||
std::wstring styles_map::get(const std::wstring & Name, odf_types::style_family::type Type)
|
||||
{
|
||||
@ -369,6 +373,9 @@ void docx_conversion_context::start_index_content()
|
||||
sInstrText += L" \\n "+ std::to_wstring(table_content_context_.min_outline_level) + L"-" +
|
||||
std::to_wstring(table_content_context_.max_outline_level);
|
||||
}
|
||||
else if (table_content_context_.type_table_content == 1)
|
||||
sInstrText += L" \\o";
|
||||
|
||||
if (false == table_content_context_.outline_level_styles.empty())
|
||||
{
|
||||
sInstrText += L" \\t \"";
|
||||
@ -681,11 +688,14 @@ void docx_conversion_context::end_document()
|
||||
{
|
||||
output_stream() << L"</w:document>";
|
||||
|
||||
output_document_->get_word_files().set_document ( package::simple_element::create(L"document.xml", document_xml_.str()) );
|
||||
output_document_->get_word_files().set_document ( package::simple_element::create(L"document.xml", document_xml_.str()) );
|
||||
output_document_->get_word_files().set_settings ( package::simple_element::create(L"settings.xml", dump_settings_document()));
|
||||
output_document_->get_word_files().set_media ( mediaitems_);
|
||||
output_document_->get_word_files().set_comments ( comments_context_);
|
||||
output_document_->get_word_files().set_headers_footers( headers_footers_);
|
||||
output_document_->get_word_files().set_headers_footers( headers_footers_);
|
||||
|
||||
package::xl_drawings_ptr drawings = package::xl_drawings::create(chart_drawing_handle_->content());
|
||||
output_document_->get_word_files().set_drawings(drawings);
|
||||
|
||||
package::content_types_file & content_file_ = output_document_->get_content_types_file();
|
||||
content_file_.set_media( mediaitems_);
|
||||
@ -852,9 +862,12 @@ namespace
|
||||
}
|
||||
}
|
||||
|
||||
std::wstring StyleDisplayName(const std::wstring & Name, odf_types::style_family::type Type)
|
||||
std::wstring StyleDisplayName(const std::wstring & Name, const std::wstring & DisplayName, odf_types::style_family::type Type)
|
||||
{
|
||||
if (!Name.empty())
|
||||
if (!DisplayName.empty())
|
||||
return DisplayName;
|
||||
|
||||
if (!Name.empty())
|
||||
return Name;
|
||||
else
|
||||
{
|
||||
@ -930,8 +943,8 @@ mc:Ignorable=\"w14 wp14\">";
|
||||
|
||||
for (size_t i = 0; i < numIds.size(); i++)
|
||||
{
|
||||
strm << L"<w:num w:numId=\"" << numIds[i] << L"\" >";
|
||||
strm << L"<w:abstractNumId w:val=\"" << numIds[i] << "\" />";
|
||||
strm << L"<w:num w:numId=\"" << numIds[i] << L"\">";
|
||||
strm << L"<w:abstractNumId w:val=\"" << numIds[i] << "\"/>";
|
||||
strm << L"</w:num>";
|
||||
}
|
||||
|
||||
@ -957,19 +970,19 @@ void docx_conversion_context::process_fonts()
|
||||
if (!arFonts[i]) continue;
|
||||
if (arFonts[i]->name().empty()) continue;
|
||||
|
||||
strm << L"<w:font w:name=\"" << arFonts[i]->name() << L"\" >";
|
||||
strm << L"<w:font w:name=\"" << arFonts[i]->name() << L"\">";
|
||||
|
||||
if (!arFonts[i]->charset().empty())
|
||||
strm << L"<w:charset w:val=\"" << arFonts[i]->charset() <<"\" />";
|
||||
strm << L"<w:charset w:val=\"" << arFonts[i]->charset() <<"\"/>";
|
||||
|
||||
if (!arFonts[i]->family().empty())
|
||||
strm << L"<w:family w:val=\"" << arFonts[i]->family() << "\" />";
|
||||
strm << L"<w:family w:val=\"" << arFonts[i]->family() << "\"/>";
|
||||
|
||||
if (!arFonts[i]->pitch().empty())
|
||||
strm << L"<w:pitch w:val=\"" << arFonts[i]->pitch() << "\" />";
|
||||
strm << L"<w:pitch w:val=\"" << arFonts[i]->pitch() << "\"/>";
|
||||
|
||||
if (!arFonts[i]->alt_name().empty())
|
||||
strm << L"<w:altName w:val=\"" << arFonts[i]->alt_name() << "\" />";
|
||||
strm << L"<w:altName w:val=\"" << arFonts[i]->alt_name() << "\"/>";
|
||||
|
||||
strm << L"</w:font>";
|
||||
}
|
||||
@ -992,7 +1005,7 @@ void docx_conversion_context::process_styles()
|
||||
_Wostream << L"xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" ";
|
||||
_Wostream << L"xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\" ";
|
||||
_Wostream << L"xmlns:w14=\"http://schemas.microsoft.com/office/word/2010/wordml\" ";
|
||||
_Wostream << L"mc:Ignorable=\"w14\"> ";
|
||||
_Wostream << L"mc:Ignorable=\"w14\">";
|
||||
|
||||
if (odf_reader::odf_document * doc = root())
|
||||
{
|
||||
@ -1062,30 +1075,34 @@ void docx_conversion_context::process_styles()
|
||||
}
|
||||
_Wostream << L">";
|
||||
|
||||
const std::wstring displayName = StyleDisplayName(arStyles[i]->name(), arStyles[i]->type());
|
||||
const std::wstring displayName = StyleDisplayName(arStyles[i]->name(), arStyles[i]->display_name(), arStyles[i]->type());
|
||||
|
||||
_Wostream << L"<w:name w:val=\"" << displayName << L"\" />";
|
||||
_Wostream << L"<w:name w:val=\"" << displayName << L"\"/>";
|
||||
|
||||
if (odf_reader::style_instance * baseOn = arStyles[i]->parent())
|
||||
{
|
||||
const std::wstring basedOnId = styles_map_.get(baseOn->name(), baseOn->type());
|
||||
_Wostream << L"<w:basedOn w:val=\"" << basedOnId << "\" />";
|
||||
_Wostream << L"<w:basedOn w:val=\"" << basedOnId << "\"/>";
|
||||
}
|
||||
else if (!arStyles[i]->is_default() && styles_map_.check(L"", arStyles[i]->type()))
|
||||
{
|
||||
const std::wstring basedOnId = styles_map_.get(L"", arStyles[i]->type());
|
||||
_Wostream << L"<w:basedOn w:val=\"" << basedOnId << "\" />";
|
||||
_Wostream << L"<w:basedOn w:val=\"" << basedOnId << "\"/>";
|
||||
}
|
||||
else
|
||||
{
|
||||
_Wostream << L"<w:qFormat/>";
|
||||
}
|
||||
|
||||
if (odf_reader::style_instance * next = arStyles[i]->next())
|
||||
{
|
||||
const std::wstring nextId = styles_map_.get(next->name(), next->type());
|
||||
_Wostream << L"<w:next w:val=\"" << nextId << "\" />";
|
||||
_Wostream << L"<w:next w:val=\"" << nextId << "\"/>";
|
||||
}
|
||||
else if (arStyles[i]->is_default())
|
||||
{
|
||||
// self
|
||||
_Wostream << L"<w:next w:val=\"" << id << "\" />";
|
||||
_Wostream << L"<w:next w:val=\"" << id << "\"/>";
|
||||
}
|
||||
|
||||
if (odf_reader::style_content * content = arStyles[i]->content())
|
||||
@ -1334,6 +1351,7 @@ void docx_conversion_context::end_automatic_style()
|
||||
in_automatic_style_ = false;
|
||||
automatic_parent_style_.clear();
|
||||
tabs_context_.clear();
|
||||
current_outline_level_ = -1;
|
||||
}
|
||||
|
||||
bool docx_conversion_context::in_automatic_style()
|
||||
@ -1555,7 +1573,8 @@ int docx_conversion_context::process_paragraph_attr(odf_reader::text::paragraph_
|
||||
)
|
||||
{
|
||||
process_page_break_after(styleInst);
|
||||
if (styleInst->is_automatic())
|
||||
|
||||
if (styleInst->is_automatic())
|
||||
{
|
||||
if (odf_reader::style_content * styleContent = styleInst->content())
|
||||
{
|
||||
@ -1593,7 +1612,10 @@ int docx_conversion_context::process_paragraph_attr(odf_reader::text::paragraph_
|
||||
}
|
||||
}
|
||||
set_margin_left(properties.fo_margin_left_? 20.0 * properties.fo_margin_left_->get_length().get_value_unit(odf_types::length::pt) : 0);
|
||||
|
||||
if ((Attr->outline_level_) && (*Attr->outline_level_ > 0))
|
||||
{
|
||||
set_outline_level(*Attr->outline_level_ - 1);
|
||||
}
|
||||
styleContent->docx_convert(*this);
|
||||
|
||||
end_automatic_style();
|
||||
@ -1632,12 +1654,6 @@ int docx_conversion_context::process_paragraph_attr(odf_reader::text::paragraph_
|
||||
output_stream() << L"</w:pPr>";
|
||||
}
|
||||
}
|
||||
else if ((Attr->outline_level_) && (*Attr->outline_level_ > 0))
|
||||
{
|
||||
output_stream() << L"<w:pPr>";
|
||||
output_stream() << L"<w:outlineLvl w:val=\"" << *Attr->outline_level_ - 1 << L"\"/>";
|
||||
output_stream() << L"</w:pPr>";
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
@ -1818,7 +1834,7 @@ namespace
|
||||
//слить если есть mediaitems, добавить релсы и обнулить их для основного документа.
|
||||
rels internal_rels;
|
||||
|
||||
Context.get_mediaitems().dump_rels(internal_rels);
|
||||
Context.get_mediaitems()->dump_rels(internal_rels);
|
||||
Context.dump_hyperlinks(internal_rels, hyperlinks::document_place);
|
||||
|
||||
Context.get_headers_footers().add(styleName, dbgStr, type, internal_rels);
|
||||
|
||||
@ -42,6 +42,7 @@
|
||||
#include "docx_table_context.h"
|
||||
#include "oox_conversion_context.h"
|
||||
#include "oox_chart_context.h"
|
||||
#include "xlsx_drawing_context.h"
|
||||
|
||||
#include "headers_footers.h"
|
||||
#include "hyperlinks.h"
|
||||
@ -734,7 +735,7 @@ class docx_conversion_context : boost::noncopyable
|
||||
public:
|
||||
enum NoteType { noNote, footNote, footNoteRefSet, endNote, endNoteRefSet };
|
||||
|
||||
docx_conversion_context(odf_reader::odf_document * OdfDocument);
|
||||
docx_conversion_context(odf_reader::odf_document * _odf_document);
|
||||
~docx_conversion_context();
|
||||
|
||||
void set_output_document (package::docx_document * document);
|
||||
@ -887,7 +888,7 @@ public:
|
||||
|
||||
styles_map * get_style_map() { return &styles_map_; }
|
||||
|
||||
mediaitems & get_mediaitems() {return mediaitems_;}
|
||||
mediaitems_ptr & get_mediaitems() {return mediaitems_;}
|
||||
styles_context & get_styles_context() { return styles_context_; }
|
||||
drawing_context & get_drawing_context() { return drawing_context_; }
|
||||
comments_context & get_comments_context() { return comments_context_; }
|
||||
@ -897,8 +898,9 @@ public:
|
||||
text_tracked_context& get_text_tracked_context(){ return text_tracked_context_; }
|
||||
forms_context & get_forms_context() { return forms_context_; }
|
||||
tabs_context & get_tabs_context() { return tabs_context_;}
|
||||
table_content_context & get_table_content_context() { return table_content_context_;}
|
||||
|
||||
table_content_context & get_table_content_context() { return table_content_context_;}
|
||||
xlsx_drawing_context_handle_ptr & get_chart_drawing_handle() { return chart_drawing_handle_;}
|
||||
|
||||
void set_drawing_text_props (const std::wstring &props);
|
||||
|
||||
@ -916,6 +918,9 @@ public:
|
||||
void set_margin_left(int val) {current_margin_left_ = val;}
|
||||
int get_margin_left() {return current_margin_left_;}
|
||||
|
||||
void set_outline_level(int val) {current_outline_level_ = val;}
|
||||
int get_outline_level() {return current_outline_level_;}
|
||||
|
||||
void set_process_note (NoteType Val) { process_note_ = Val; }
|
||||
NoteType get_process_note () const { return process_note_; }
|
||||
void add_note_reference ();
|
||||
@ -982,6 +987,8 @@ private:
|
||||
std::wstringstream settings_xml_;
|
||||
std::wstringstream meta_xml_;
|
||||
|
||||
xlsx_drawing_context_handle_ptr chart_drawing_handle_;
|
||||
|
||||
styles_context styles_context_;
|
||||
math_context math_context_;
|
||||
drawing_context drawing_context_;
|
||||
@ -1004,7 +1011,7 @@ private:
|
||||
std::vector<odf_reader::_property> settings_properties_;
|
||||
|
||||
hyperlinks hyperlinks_;
|
||||
mediaitems mediaitems_;
|
||||
mediaitems_ptr mediaitems_;
|
||||
std::vector<oox_chart_context_ptr> charts_;
|
||||
headers_footers headers_footers_;
|
||||
|
||||
@ -1031,6 +1038,7 @@ private:
|
||||
|
||||
std::wstring current_alphabetic_index_;
|
||||
int current_margin_left_;
|
||||
int current_outline_level_;
|
||||
int new_list_style_number_; // счетчик для нумерации имен созданных в процессе конвертации стилей
|
||||
NoteType process_note_;
|
||||
|
||||
|
||||
@ -102,7 +102,11 @@ void word_files::write(const std::wstring & RootPath)
|
||||
{
|
||||
embeddings_->write( path );
|
||||
}
|
||||
|
||||
if (drawings_)
|
||||
{
|
||||
drawings_->set_main_document(get_main_document());
|
||||
drawings_->write( path );
|
||||
}
|
||||
if (headers_footers_)
|
||||
{
|
||||
headers_footers_->write( path );
|
||||
@ -140,22 +144,22 @@ void word_files::write(const std::wstring & RootPath)
|
||||
|
||||
void word_files::update_rels(docx_conversion_context & Context)
|
||||
{
|
||||
Context.get_mediaitems().dump_rels(rels_files_.get_rel_file()->get_rels());
|
||||
Context.get_mediaitems()->dump_rels(rels_files_.get_rel_file()->get_rels());
|
||||
|
||||
Context.dump_hyperlinks (rels_files_.get_rel_file()->get_rels(), hyperlinks::document_place);
|
||||
Context.dump_headers_footers(rels_files_.get_rel_file()->get_rels());
|
||||
Context.dump_notes (rels_files_.get_rel_file()->get_rels());
|
||||
}
|
||||
|
||||
void word_files::set_media(mediaitems & _Mediaitems)
|
||||
void word_files::set_media(mediaitems_ptr & _mediaitems)
|
||||
{
|
||||
if (_Mediaitems.count_image + _Mediaitems.count_media > 0)
|
||||
if (_mediaitems->count_image + _mediaitems->count_media > 0)
|
||||
{
|
||||
media_ = element_ptr( new media(_Mediaitems, _Mediaitems.applicationFonts()) );
|
||||
media_ = element_ptr( new media(_mediaitems, _mediaitems->applicationFonts()) );
|
||||
}
|
||||
if (_Mediaitems.count_object > 0)
|
||||
if (_mediaitems->count_object > 0)
|
||||
{
|
||||
embeddings_ = element_ptr( new embeddings(_Mediaitems) );
|
||||
embeddings_ = element_ptr( new embeddings(_mediaitems) );
|
||||
embeddings_->set_main_document( get_main_document() );
|
||||
}
|
||||
}
|
||||
@ -195,6 +199,10 @@ void word_files::add_jsaProject(const std::string &content)
|
||||
{
|
||||
jsaProject_ = package::simple_element::create(L"jsaProject.bin", content);
|
||||
}
|
||||
void word_files::set_drawings(element_ptr Element)
|
||||
{
|
||||
drawings_ = Element;
|
||||
}
|
||||
void word_files::set_headers_footers(headers_footers & HeadersFooters)
|
||||
{
|
||||
headers_footers_elements * elm = new headers_footers_elements(HeadersFooters);
|
||||
|
||||
@ -137,10 +137,11 @@ public:
|
||||
void set_numbering (element_ptr Element);
|
||||
void set_settings (element_ptr Element);
|
||||
bool has_numbering ();
|
||||
void set_media (mediaitems & mediaitems_);
|
||||
void set_media (mediaitems_ptr & mediaitems_);
|
||||
void set_headers_footers(headers_footers & HeadersFooters);
|
||||
void set_notes (notes_context & notesContext);
|
||||
void set_comments (comments_context & commentsContext);
|
||||
void set_drawings (element_ptr Element);
|
||||
|
||||
void add_charts(chart_content_ptr chart);
|
||||
void add_jsaProject(const std::string &content);
|
||||
@ -163,6 +164,7 @@ private:
|
||||
element_ptr settings_;
|
||||
element_ptr comments_;
|
||||
element_ptr jsaProject_;
|
||||
element_ptr drawings_;
|
||||
|
||||
};
|
||||
|
||||
|
||||
@ -62,6 +62,9 @@ struct drawing_object_description
|
||||
double anchor_x_;
|
||||
double anchor_y_;
|
||||
|
||||
_CP_OPT(_INT32) owner_cx_;
|
||||
_CP_OPT(_INT32) owner_cy_;
|
||||
|
||||
_action_desc action_;
|
||||
std::vector<_hlink_desc> hlinks_;
|
||||
|
||||
|
||||
@ -101,6 +101,7 @@ void mediaitems::set_font_directory(std::wstring pathFonts)
|
||||
if (applicationFonts_)
|
||||
applicationFonts_->InitializeFromFolder(pathFonts);
|
||||
}
|
||||
|
||||
std::wstring mediaitems::add_or_find(const std::wstring & href, RelsType type, bool & isInternal)
|
||||
{
|
||||
std::wstring ref;
|
||||
@ -329,6 +330,10 @@ void mediaitems::dump_rels(rels & Rels)
|
||||
{
|
||||
for (size_t i = 0; i < items_.size(); i++)
|
||||
{
|
||||
if ( items_[i].type == typeUnknown ) continue;
|
||||
if ( items_[i].type == typeShape ) continue;
|
||||
if ( items_[i].type == typeGroupShape ) continue;
|
||||
|
||||
if (items_[i].count_used >= items_[i].count_add) continue; // уже использовали этот релс выше(колонтитул ....)
|
||||
|
||||
Rels.add( relationship(
|
||||
@ -338,7 +343,7 @@ void mediaitems::dump_rels(rels & Rels)
|
||||
items_[i].mediaInternal ? L"" : L"External" )
|
||||
);
|
||||
items_[i].count_used++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -123,19 +123,21 @@ public:
|
||||
|
||||
if (sExt == L"wmv") return typeVideo;
|
||||
if (sExt == L"avi") return typeVideo;
|
||||
if (sExt == L"wmv") return typeVideo;
|
||||
if (sExt == L"wma") return typeAudio;
|
||||
if (sExt == L"wav") return typeAudio;
|
||||
|
||||
if (sExt == L"mp3") return typeAudio;
|
||||
if (sExt == L"m4a") return typeAudio;
|
||||
if (sExt == L"m4v") return typeVideo;
|
||||
if (sExt == L"mp4") return typeVideo;
|
||||
if (sExt == L"mov") return typeVideo;
|
||||
if (sExt == L"mkv") return typeVideo;
|
||||
if (sExt == L"webm") return typeVideo;
|
||||
|
||||
if (sExt == L"wmv") return typeVideo;
|
||||
if (sExt == L"wma") return typeAudio;
|
||||
if (sExt == L"wav") return typeAudio;
|
||||
if (sExt == L"mp3") return typeAudio;
|
||||
if (sExt == L"m4a") return typeAudio;
|
||||
|
||||
return typeMedia;
|
||||
}
|
||||
|
||||
private:
|
||||
std::wstring create_file_name (const std::wstring & uri, RelsType type, bool & isInternal, size_t Num);
|
||||
std::wstring detectImageFileExtension (const std::wstring &fileName);
|
||||
@ -146,6 +148,7 @@ private:
|
||||
NSFonts::IApplicationFonts *applicationFonts_;
|
||||
};
|
||||
|
||||
typedef _CP_PTR(mediaitems) mediaitems_ptr;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -53,7 +53,7 @@ public:
|
||||
std::wstring drawingId_;
|
||||
};
|
||||
|
||||
oox_chart_context::oox_chart_context(mediaitems & m, std::wstring name) :
|
||||
oox_chart_context::oox_chart_context(mediaitems_ptr & m, std::wstring name) :
|
||||
impl_(new oox_chart_context::Impl( name)), mediaitems_(m)
|
||||
{
|
||||
|
||||
@ -65,7 +65,7 @@ void oox_chart_context::reset_fill(oox::_oox_fill &f)
|
||||
{
|
||||
bool isInternal = true;
|
||||
std::wstring ref;
|
||||
f.bitmap->rId = mediaitems_.add_or_find(f.bitmap->xlink_href_, typeImage, isInternal, ref);
|
||||
f.bitmap->rId = mediaitems_->add_or_find(f.bitmap->xlink_href_, typeImage, isInternal, ref);
|
||||
|
||||
rels_.push_back(_rel(isInternal, f.bitmap->rId, ref, typeImage));
|
||||
}
|
||||
@ -75,9 +75,15 @@ void oox_chart_context::set_externalData(const std::wstring & href)
|
||||
bool isInternal = true;
|
||||
std::wstring href_out;
|
||||
|
||||
externalDataId_ = mediaitems_.add_or_find(href, typeMsObject, isInternal, href_out);
|
||||
externalDataId_ = mediaitems_->add_or_find(href, typeMsObject, isInternal, href_out);
|
||||
rels_.push_back(_rel(isInternal, externalDataId_, href_out, typeMsObject));
|
||||
}
|
||||
void oox_chart_context::set_userShapes(std::pair<std::wstring, std::wstring> &link)
|
||||
{
|
||||
bool isInternal = true;
|
||||
userShapesId_ = link.second;
|
||||
rels_.push_back(_rel(isInternal, userShapesId_, link.first, typeChartUserShapes));
|
||||
}
|
||||
std::wostream & oox_chart_context::chartData()
|
||||
{
|
||||
return impl_->chartData_;
|
||||
@ -116,6 +122,15 @@ void oox_chart_context::dump_rels(rels & Rels)
|
||||
(r.is_internal ? L"" : L"External"))
|
||||
);
|
||||
}
|
||||
else if (r.type == typeChartUserShapes)
|
||||
{
|
||||
Rels.add(relationship(
|
||||
r.rid,
|
||||
L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/chartUserShapes",
|
||||
r.is_internal ? std::wstring(L"../drawings/") + r.ref : r.ref,
|
||||
(r.is_internal ? L"" : L"External"))
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -226,6 +241,13 @@ void oox_chart_context::serialize(std::wostream & strm)
|
||||
}
|
||||
}
|
||||
}
|
||||
if (userShapesId_.empty() == false)
|
||||
{
|
||||
CP_XML_NODE(L"c:userShapes")
|
||||
{
|
||||
CP_XML_ATTR(L"r:id", userShapesId_);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -53,7 +53,7 @@ typedef _CP_PTR(oox_chart_context) oox_chart_context_ptr;
|
||||
class oox_chart_context
|
||||
{
|
||||
public:
|
||||
oox_chart_context(mediaitems & mediaitems_, std::wstring name);
|
||||
oox_chart_context(mediaitems_ptr & mediaitems_, std::wstring name);
|
||||
~oox_chart_context();
|
||||
|
||||
std::wostream & chartData();
|
||||
@ -83,6 +83,8 @@ public:
|
||||
}
|
||||
}
|
||||
void set_externalData(const std::wstring & href);
|
||||
void set_userShapes(std::pair<std::wstring, std::wstring> &link);
|
||||
|
||||
void add_chart(int type)
|
||||
{
|
||||
plot_area_.add_chart(type);
|
||||
@ -128,7 +130,7 @@ private:
|
||||
class Impl;
|
||||
_CP_SCOPED_PTR(Impl) impl_;
|
||||
|
||||
mediaitems &mediaitems_;
|
||||
mediaitems_ptr mediaitems_;
|
||||
std::vector<_rel> rels_;
|
||||
|
||||
cpdoccore::oox::oox_title title_;
|
||||
@ -137,6 +139,7 @@ private:
|
||||
|
||||
std::wstring pivot_source_;
|
||||
std::wstring externalDataId_;
|
||||
std::wstring userShapesId_;
|
||||
|
||||
std::vector<odf_reader::_property> graphic_properties_;
|
||||
_oox_fill fill_;
|
||||
|
||||
@ -375,10 +375,9 @@ void _oox_drawing::serialize_bodyPr(std::wostream & strm, const std::wstring & n
|
||||
{
|
||||
CP_XML_NODE(L"a:spAutoFit");
|
||||
}
|
||||
else if ((bFitToSize) && (*bFitToSize))
|
||||
if ((bFitToSize) && (*bFitToSize))
|
||||
{
|
||||
CP_XML_NODE(L"a:noAutofit");
|
||||
//CP_XML_NODE(L"a:spAutoFit")
|
||||
CP_XML_NODE(L"a:normAutofit");
|
||||
//{
|
||||
// CP_XML_ATTR(L"lnSpcReduction", 10000);
|
||||
//}
|
||||
|
||||
@ -75,6 +75,7 @@ static std::wstring get_mime_type(const std::wstring & extension)
|
||||
else if (L"tiff" == extension) return L"image/x-tiff";
|
||||
else if (L"pdf" == extension) return L"application/pdf";
|
||||
else if (L"bmp" == extension) return L"image/bmp";
|
||||
else if (L"wdp" == extension) return L"image/vnd.ms-photo";
|
||||
|
||||
else if (L"wav" == extension) return L"audio/wav";
|
||||
else if (L"mp3" == extension) return L"audio/mpeg";
|
||||
@ -172,6 +173,26 @@ bool content_types_file::add_or_find_override(const std::wstring & fileName)
|
||||
|
||||
return true;
|
||||
}
|
||||
void content_types_file::set_media(mediaitems_ptr & _Mediaitems)
|
||||
{
|
||||
std::vector<mediaitems::item> & items_ = _Mediaitems->items();
|
||||
for (size_t i = 0; i < items_.size(); i++)
|
||||
{
|
||||
if ((items_[i].type == typeImage ||
|
||||
items_[i].type == typeMedia ||
|
||||
items_[i].type == typeVideo ||
|
||||
items_[i].type == typeAudio) && items_[i].mediaInternal)
|
||||
{
|
||||
int n = items_[i].outputName.rfind(L".");
|
||||
if (n > 0)
|
||||
{
|
||||
add_or_find_default(items_[i].outputName.substr(n + 1, items_[i].outputName.length() - n));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
void content_types_file::set_media(mediaitems & _Mediaitems)
|
||||
{
|
||||
@ -348,7 +369,7 @@ void docProps_files::write(const std::wstring & RootPath)
|
||||
////////////
|
||||
|
||||
|
||||
media::media(mediaitems & _Mediaitems, NSFonts::IApplicationFonts *pAppFonts) : mediaitems_(_Mediaitems), appFonts_(pAppFonts)
|
||||
media::media(mediaitems_ptr & _mediaitems, NSFonts::IApplicationFonts *pAppFonts) : mediaItems_(_mediaitems), appFonts_(pAppFonts)
|
||||
{
|
||||
}
|
||||
|
||||
@ -357,7 +378,8 @@ void media::write(const std::wstring & RootPath)
|
||||
std::wstring path = RootPath + FILE_SEPARATOR_STR + L"media";
|
||||
NSDirectory::CreateDirectory(path.c_str());
|
||||
|
||||
mediaitems::items_array & items = mediaitems_.items();
|
||||
mediaitems::items_array & items = mediaItems_->items();
|
||||
|
||||
for (size_t i = 0; i < items.size(); i++ )
|
||||
{
|
||||
if (items[i].mediaInternal && items[i].valid && ( items[i].type == typeImage ||
|
||||
@ -380,7 +402,7 @@ void media::write(const std::wstring & RootPath)
|
||||
|
||||
}
|
||||
//------------------------------------------------------------------------------------------------------------
|
||||
charts::charts(mediaitems & _ChartsItems) : chartsitems_(_ChartsItems)
|
||||
charts::charts(mediaitems_ptr & _chartsItems) : chartsItems_(_chartsItems)
|
||||
{
|
||||
}
|
||||
|
||||
@ -389,7 +411,7 @@ void charts::write(const std::wstring & RootPath)
|
||||
|
||||
}
|
||||
//--------------------------------------------------------------------------------------------------------------
|
||||
embeddings::embeddings(mediaitems & _EmbeddingsItems) : embeddingsitems_(_EmbeddingsItems)
|
||||
embeddings::embeddings(mediaitems_ptr & _EmbeddingsItems) : embeddingsItems_(_EmbeddingsItems)
|
||||
{
|
||||
}
|
||||
void embeddings::write(const std::wstring & RootPath)
|
||||
@ -399,7 +421,8 @@ void embeddings::write(const std::wstring & RootPath)
|
||||
|
||||
content_types_file & content_types = get_main_document()->get_content_types_file();
|
||||
|
||||
mediaitems::items_array & items = embeddingsitems_.items();
|
||||
mediaitems::items_array & items = embeddingsItems_->items();
|
||||
|
||||
for (size_t i = 0; i < items.size(); i++ )
|
||||
{
|
||||
if ( items[i].mediaInternal && items[i].valid &&
|
||||
|
||||
@ -51,6 +51,7 @@ namespace cpdoccore {
|
||||
namespace oox {
|
||||
|
||||
class mediaitems;
|
||||
typedef _CP_PTR(mediaitems) mediaitems_ptr;
|
||||
|
||||
namespace package {
|
||||
|
||||
@ -81,16 +82,17 @@ inline element::~element()
|
||||
class content_types_file : public element
|
||||
{
|
||||
public:
|
||||
content_types_file ();
|
||||
void write (const std::wstring & RootPath);
|
||||
bool add_or_find_default (const std::wstring & extension);
|
||||
bool add_or_find_override(const std::wstring & fileName);
|
||||
void set_media (mediaitems & _Mediaitems);
|
||||
content_type * content ();
|
||||
content_types_file ();
|
||||
void write (const std::wstring & RootPath);
|
||||
bool add_or_find_default (const std::wstring & extension);
|
||||
bool add_or_find_override(const std::wstring & fileName);
|
||||
void set_media (mediaitems & _Mediaitems);
|
||||
void set_media (mediaitems_ptr & _Mediaitems);
|
||||
content_type* content ();
|
||||
|
||||
private:
|
||||
content_type content_type_content_;
|
||||
std::wstring filename_;
|
||||
std::wstring filename_;
|
||||
};
|
||||
|
||||
class simple_element;
|
||||
@ -189,8 +191,8 @@ public:
|
||||
std::wstring str() { return content_.str(); }
|
||||
static _CP_PTR(chart_content) create();
|
||||
private:
|
||||
std::wstringstream content_;
|
||||
rels_file_ptr rels_;
|
||||
std::wstringstream content_;
|
||||
rels_file_ptr rels_;
|
||||
};
|
||||
//------------------------------------------------------------------------
|
||||
class document : public element
|
||||
@ -228,39 +230,39 @@ private:
|
||||
class media : public element
|
||||
{
|
||||
public:
|
||||
media(mediaitems & _Mediaitems, NSFonts::IApplicationFonts *pAppFonts);
|
||||
media(mediaitems_ptr & _mediaItems, NSFonts::IApplicationFonts *pAppFonts);
|
||||
|
||||
public:
|
||||
virtual void write(const std::wstring & RootPath);
|
||||
|
||||
private:
|
||||
mediaitems & mediaitems_;
|
||||
NSFonts::IApplicationFonts * appFonts_;
|
||||
mediaitems_ptr mediaItems_;
|
||||
NSFonts::IApplicationFonts* appFonts_;
|
||||
|
||||
};
|
||||
|
||||
class charts : public element
|
||||
{
|
||||
public:
|
||||
charts(mediaitems & _ChartsItems);
|
||||
charts(mediaitems_ptr & _chartsItems);
|
||||
|
||||
public:
|
||||
virtual void write(const std::wstring & RootPath);
|
||||
|
||||
private:
|
||||
mediaitems & chartsitems_;
|
||||
mediaitems_ptr chartsItems_;
|
||||
|
||||
};
|
||||
class embeddings : public element
|
||||
{
|
||||
public:
|
||||
embeddings(mediaitems & _EmbeddingsItems);
|
||||
embeddings(mediaitems_ptr & _embeddingsItems);
|
||||
|
||||
public:
|
||||
virtual void write(const std::wstring & RootPath);
|
||||
|
||||
private:
|
||||
mediaitems & embeddingsitems_;
|
||||
mediaitems_ptr embeddingsItems_;
|
||||
|
||||
};
|
||||
} // namespace package
|
||||
|
||||
@ -43,6 +43,7 @@ namespace oox {
|
||||
enum RelsType
|
||||
{
|
||||
typeUnknown = 0,
|
||||
typeDefault,
|
||||
typeImage,
|
||||
typeChart,
|
||||
typeShape,
|
||||
@ -59,7 +60,8 @@ enum RelsType
|
||||
typeExternalLink,
|
||||
typeActiveX,
|
||||
typeControl,
|
||||
typeControlProps
|
||||
typeControlProps,
|
||||
typeChartUserShapes
|
||||
};
|
||||
|
||||
struct _rel
|
||||
@ -71,10 +73,10 @@ struct _rel
|
||||
type(type_)
|
||||
{}
|
||||
|
||||
bool is_internal;
|
||||
std::wstring rid;
|
||||
std::wstring ref;
|
||||
RelsType type;
|
||||
bool is_internal;
|
||||
std::wstring rid;
|
||||
std::wstring ref;
|
||||
RelsType type;
|
||||
};
|
||||
|
||||
class relationship : public xml::element_impl<relationship>
|
||||
|
||||
@ -83,7 +83,7 @@ void pptx_conversion_context::set_output_document(package::pptx_document * docum
|
||||
|
||||
void pptx_conversion_context::set_font_directory(std::wstring pathFonts)
|
||||
{
|
||||
pptx_slide_context_.get_mediaitems().set_font_directory(pathFonts);
|
||||
pptx_slide_context_.get_mediaitems()->set_font_directory(pathFonts);
|
||||
}
|
||||
|
||||
void pptx_conversion_context::process_layouts()
|
||||
|
||||
@ -133,7 +133,7 @@ public:
|
||||
|
||||
pptx_table_context & get_table_context() { return pptx_table_context_; }
|
||||
|
||||
mediaitems & get_mediaitems() { return pptx_slide_context_.get_mediaitems(); }
|
||||
mediaitems_ptr & get_mediaitems() { return pptx_slide_context_.get_mediaitems(); }
|
||||
|
||||
//void start_hyperlink(const std::wstring & styleName);
|
||||
//void end_hyperlink(std::wstring const & href);
|
||||
|
||||
@ -509,15 +509,15 @@ void ppt_files::add_notesMaster(slide_content_ptr slide)
|
||||
{
|
||||
notesMaster_files_.add_slide(slide);
|
||||
}
|
||||
void ppt_files::set_media(mediaitems & _Mediaitems)
|
||||
void ppt_files::set_media(mediaitems_ptr & _mediaitems)
|
||||
{
|
||||
if (_Mediaitems.count_image + _Mediaitems.count_media > 0)
|
||||
if (_mediaitems->count_image + _mediaitems->count_media > 0)
|
||||
{
|
||||
media_ = element_ptr( new media(_Mediaitems, _Mediaitems.applicationFonts()) );
|
||||
media_ = element_ptr( new media(_mediaitems, _mediaitems->applicationFonts()) );
|
||||
}
|
||||
if (_Mediaitems.count_object > 0)
|
||||
if (_mediaitems->count_object > 0)
|
||||
{
|
||||
embeddings_ = element_ptr( new embeddings(_Mediaitems) );
|
||||
embeddings_ = element_ptr( new embeddings(_mediaitems) );
|
||||
}
|
||||
}
|
||||
void ppt_files::set_authors_comments(pptx_xml_authors_comments_ptr & authors_comments)
|
||||
|
||||
@ -217,7 +217,7 @@ public:
|
||||
void add_notes (slide_content_ptr sheet);
|
||||
void add_notesMaster(slide_content_ptr sheet);
|
||||
|
||||
void set_media(mediaitems & _Mediaitems);
|
||||
void set_media(mediaitems_ptr & _mediaitems);
|
||||
void add_charts(chart_content_ptr chart);
|
||||
void add_theme (pptx_xml_theme_ptr theme);
|
||||
|
||||
|
||||
@ -65,8 +65,10 @@ public:
|
||||
bool onClick;
|
||||
};
|
||||
|
||||
Impl(const std::wstring & odfPacket) : mediaitems_(odfPacket), odfPacket_(odfPacket)
|
||||
Impl(const std::wstring & _odfPacket) : odfPacket_(_odfPacket)
|
||||
{
|
||||
mediaitems_ = boost::make_shared<mediaitems>(odfPacket_);
|
||||
|
||||
clear();
|
||||
}
|
||||
|
||||
@ -88,7 +90,7 @@ public:
|
||||
{
|
||||
pptx_drawings_->add(isInternal, rid, ref, type);
|
||||
}
|
||||
mediaitems & get_mediaitems() { return mediaitems_; }
|
||||
mediaitems_ptr & get_mediaitems() { return mediaitems_; }
|
||||
|
||||
bool empty() const
|
||||
{
|
||||
@ -138,7 +140,7 @@ private:
|
||||
void process_media (drawing_object_description& obj, _pptx_drawing & drawing);
|
||||
|
||||
size_t rId_;
|
||||
mediaitems mediaitems_;
|
||||
mediaitems_ptr mediaitems_;
|
||||
pptx_drawings_ptr pptx_drawings_;
|
||||
pptx_drawings_ptr pptx_notes_drawings_;
|
||||
};
|
||||
@ -357,7 +359,7 @@ void pptx_slide_context::add_background(_oox_fill & fill)
|
||||
bool isMediaInternal = false;
|
||||
std::wstring ref;
|
||||
|
||||
fill.bitmap->rId = get_mediaitems().add_or_find(fill.bitmap->xlink_href_, typeImage, isMediaInternal, ref);
|
||||
fill.bitmap->rId = get_mediaitems()->add_or_find(fill.bitmap->xlink_href_, typeImage, isMediaInternal, ref);
|
||||
add_rels(isMediaInternal, fill.bitmap->rId, ref, typeImage);
|
||||
}
|
||||
impl_->background_fill_ = fill;
|
||||
@ -421,7 +423,7 @@ void pptx_slide_context::set_link(std::wstring link, RelsType typeRels)
|
||||
{
|
||||
bool isMediaInternal = true;
|
||||
|
||||
impl_->object_description_.action_.hSoundId = get_mediaitems().add_or_find(link, typeAudio, isMediaInternal, impl_->object_description_.action_.hSoundRef);
|
||||
impl_->object_description_.action_.hSoundId = get_mediaitems()->add_or_find(link, typeAudio, isMediaInternal, impl_->object_description_.action_.hSoundRef);
|
||||
impl_->add_additional_rels(isMediaInternal, impl_->object_description_.action_.hSoundId, impl_->object_description_.action_.hSoundRef, typeAudio);
|
||||
}
|
||||
else
|
||||
@ -562,7 +564,7 @@ void pptx_slide_context::Impl::process_image(drawing_object_description& obj, _p
|
||||
}
|
||||
|
||||
std::wstring fileName = odfPacket_ + FILE_SEPARATOR_STR + obj.xlink_href_;
|
||||
drawing.fill.bitmap->bCrop = odf_reader::parse_clipping(obj.clipping_string_, fileName, drawing.fill.bitmap->cropRect, get_mediaitems().applicationFonts());
|
||||
drawing.fill.bitmap->bCrop = odf_reader::parse_clipping(obj.clipping_string_, fileName, drawing.fill.bitmap->cropRect, get_mediaitems()->applicationFonts());
|
||||
drawing.fill.bitmap->bStretch = true;
|
||||
|
||||
if ((sColorMode) && (*sColorMode == L"greyscale"))
|
||||
@ -572,7 +574,7 @@ void pptx_slide_context::Impl::process_image(drawing_object_description& obj, _p
|
||||
std::wstring ref;/// это ссылка на выходной внешний объект
|
||||
bool isMediaInternal = false;
|
||||
|
||||
drawing.fill.bitmap->rId = get_mediaitems().add_or_find(obj.xlink_href_, typeImage, isMediaInternal, ref);
|
||||
drawing.fill.bitmap->rId = get_mediaitems()->add_or_find(obj.xlink_href_, typeImage, isMediaInternal, ref);
|
||||
drawing.fill.bitmap->isInternal = isMediaInternal;
|
||||
|
||||
if (drawing.type == typeShape)
|
||||
@ -580,7 +582,7 @@ void pptx_slide_context::Impl::process_image(drawing_object_description& obj, _p
|
||||
add_additional_rels(isMediaInternal, drawing.fill.bitmap->rId, ref, typeImage);//собственно это не объект, а доп рел и ref объекта
|
||||
|
||||
isMediaInternal = true;
|
||||
std::wstring rId = get_mediaitems().add_or_find(L"", typeShape, isMediaInternal, ref);
|
||||
std::wstring rId = get_mediaitems()->add_or_find(L"", typeShape, isMediaInternal, ref);
|
||||
|
||||
add_drawing(drawing, isMediaInternal, rId, ref, typeShape);//объект
|
||||
|
||||
@ -595,7 +597,7 @@ void pptx_slide_context::Impl::process_chart(drawing_object_description & obj, _
|
||||
std::wstring ref;
|
||||
bool isMediaInternal = true;
|
||||
|
||||
drawing.objectId = get_mediaitems().add_or_find(obj.xlink_href_, obj.type_, isMediaInternal, ref);
|
||||
drawing.objectId = get_mediaitems()->add_or_find(obj.xlink_href_, obj.type_, isMediaInternal, ref);
|
||||
|
||||
add_drawing(drawing, isMediaInternal, drawing.objectId, ref, drawing.type);
|
||||
}
|
||||
@ -604,7 +606,7 @@ void pptx_slide_context::Impl::process_table(drawing_object_description & obj, _
|
||||
{
|
||||
std::wstring ref;
|
||||
bool isMediaInternal = true;
|
||||
std::wstring rId = get_mediaitems().add_or_find(L"", obj.type_, isMediaInternal, ref);
|
||||
std::wstring rId = get_mediaitems()->add_or_find(L"", obj.type_, isMediaInternal, ref);
|
||||
|
||||
add_drawing(drawing, isMediaInternal, rId, ref, drawing.type);
|
||||
|
||||
@ -619,12 +621,12 @@ void pptx_slide_context::Impl::process_shape(drawing_object_description & obj, _
|
||||
|
||||
if (drawing.fill.bitmap)
|
||||
{
|
||||
drawing.fill.bitmap->rId = get_mediaitems().add_or_find(drawing.fill.bitmap->xlink_href_, typeImage, isMediaInternal, ref);
|
||||
drawing.fill.bitmap->rId = get_mediaitems()->add_or_find(drawing.fill.bitmap->xlink_href_, typeImage, isMediaInternal, ref);
|
||||
|
||||
add_additional_rels(isMediaInternal, drawing.fill.bitmap->rId, ref, typeImage);
|
||||
}
|
||||
|
||||
std::wstring rId = get_mediaitems().add_or_find(L"", typeShape, isMediaInternal, ref);
|
||||
std::wstring rId = get_mediaitems()->add_or_find(L"", typeShape, isMediaInternal, ref);
|
||||
|
||||
////////////////////////////////////////////////////////////////
|
||||
_CP_OPT(std::wstring) sPlaceHolderType;
|
||||
@ -647,7 +649,7 @@ void pptx_slide_context::Impl::process_object(drawing_object_description& obj, _
|
||||
std::wstring ref, ref_image;
|
||||
bool isMediaInternal = true, isMediaInternal_image = true;
|
||||
|
||||
drawing.objectId = get_mediaitems().add_or_find(obj.xlink_href_, obj.type_, isMediaInternal, ref);
|
||||
drawing.objectId = get_mediaitems()->add_or_find(obj.xlink_href_, obj.type_, isMediaInternal, ref);
|
||||
drawing.objectProgId = obj.descriptor_;
|
||||
|
||||
if (!drawing.fill.bitmap)
|
||||
@ -658,7 +660,7 @@ void pptx_slide_context::Impl::process_object(drawing_object_description& obj, _
|
||||
_image_file_::GenerateZeroImage(odfPacket_ + FILE_SEPARATOR_STR + L"zero.png");
|
||||
}
|
||||
|
||||
drawing.fill.bitmap->rId = get_mediaitems().add_or_find(drawing.fill.bitmap->xlink_href_, typeImage, isMediaInternal_image, ref_image);
|
||||
drawing.fill.bitmap->rId = get_mediaitems()->add_or_find(drawing.fill.bitmap->xlink_href_, typeImage, isMediaInternal_image, ref_image);
|
||||
add_additional_rels(isMediaInternal_image, drawing.fill.bitmap->rId, ref_image, typeImage);
|
||||
|
||||
add_drawing(drawing, isMediaInternal, drawing.objectId, ref, drawing.type);
|
||||
@ -670,7 +672,7 @@ void pptx_slide_context::Impl::process_media(drawing_object_description& obj, _p
|
||||
|
||||
drawing.type = mediaitems::detectMediaType(obj.xlink_href_); //reset from Media to Audio, Video, ... QuickTime? AudioCD? ...
|
||||
|
||||
drawing.objectId = get_mediaitems().add_or_find(obj.xlink_href_, drawing.type, isMediaInternal, ref);
|
||||
drawing.objectId = get_mediaitems()->add_or_find(obj.xlink_href_, drawing.type, isMediaInternal, ref);
|
||||
drawing.extId = L"ext" + drawing.objectId;
|
||||
drawing.extExternal = !isMediaInternal;
|
||||
|
||||
@ -681,7 +683,7 @@ void pptx_slide_context::Impl::process_media(drawing_object_description& obj, _p
|
||||
|
||||
_image_file_::GenerateZeroImage(odfPacket_ + FILE_SEPARATOR_STR + L"zero.png");
|
||||
}
|
||||
drawing.fill.bitmap->rId = get_mediaitems().add_or_find(drawing.fill.bitmap->xlink_href_, typeImage, isMediaInternal_image, ref_image);
|
||||
drawing.fill.bitmap->rId = get_mediaitems()->add_or_find(drawing.fill.bitmap->xlink_href_, typeImage, isMediaInternal_image, ref_image);
|
||||
add_additional_rels(isMediaInternal_image, drawing.fill.bitmap->rId, ref_image, typeImage);
|
||||
|
||||
add_drawing(drawing, false, drawing.objectId, L"NULL", drawing.type);
|
||||
@ -714,7 +716,7 @@ void pptx_slide_context::dump_rels(rels & Rels)
|
||||
impl_->get_drawings()->dump_rels(Rels);
|
||||
}
|
||||
|
||||
mediaitems & pptx_slide_context::get_mediaitems()
|
||||
mediaitems_ptr & pptx_slide_context::get_mediaitems()
|
||||
{
|
||||
return impl_->get_mediaitems();
|
||||
}
|
||||
|
||||
@ -116,7 +116,7 @@ public:
|
||||
|
||||
void process_drawings();
|
||||
|
||||
mediaitems & get_mediaitems();
|
||||
mediaitems_ptr & get_mediaitems();
|
||||
|
||||
void add_background (_oox_fill & fill);
|
||||
|
||||
|
||||
@ -390,7 +390,7 @@ void oox_serialize_tcPr(std::wostream & strm, std::vector<const odf_reader::styl
|
||||
{
|
||||
bool isMediaInternal = true;
|
||||
std::wstring ref;
|
||||
fill.bitmap->rId = Context.get_slide_context().get_mediaitems().add_or_find(fill.bitmap->xlink_href_, oox::typeImage, isMediaInternal, ref);
|
||||
fill.bitmap->rId = Context.get_slide_context().get_mediaitems()->add_or_find(fill.bitmap->xlink_href_, oox::typeImage, isMediaInternal, ref);
|
||||
Context.get_slide_context().add_rels(isMediaInternal, fill.bitmap->rId, ref, oox::typeImage);
|
||||
}
|
||||
oox::oox_serialize_fill(CP_XML_STREAM(), fill);
|
||||
|
||||
@ -48,17 +48,17 @@ std::wostream & operator << (std::wostream & strm, xlsx_drawing_position::type_t
|
||||
}
|
||||
|
||||
}
|
||||
void xlsx_serialize_text(std::wostream & strm, _xlsx_drawing & val)
|
||||
void xlsx_serialize_text(std::wostream & strm, _xlsx_drawing & val, const std::wstring & ns)
|
||||
{
|
||||
_CP_OPT(std::wstring) strTextContent;
|
||||
odf_reader::GetProperty ( val.additional ,L"text-content", strTextContent);
|
||||
odf_reader::GetProperty ( val.additional, L"text-content", strTextContent);
|
||||
|
||||
if (!strTextContent)return;
|
||||
if (strTextContent->empty())return;
|
||||
|
||||
CP_XML_WRITER(strm)
|
||||
{
|
||||
CP_XML_NODE(L"xdr:txBody")
|
||||
CP_XML_NODE(ns + L":txBody")
|
||||
{
|
||||
val.serialize_bodyPr(CP_XML_STREAM());
|
||||
|
||||
@ -71,28 +71,28 @@ void xlsx_serialize_text(std::wostream & strm, _xlsx_drawing & val)
|
||||
}
|
||||
}
|
||||
|
||||
void xlsx_drawing_position::serialize(std::wostream & strm, std::wstring ns)
|
||||
void xlsx_drawing_position::serialize(std::wostream & strm, const std::wstring & ns)
|
||||
{
|
||||
CP_XML_WRITER(strm)
|
||||
{
|
||||
CP_XML_NODE( ns + (type == xlsx_drawing_position::from ? L"from" : L"to") )
|
||||
CP_XML_NODE( ns + (ns.empty() ? L"" : L":") + (type == xlsx_drawing_position::from ? L"from" : L"to") )
|
||||
{
|
||||
CP_XML_NODE(L"xdr:col")
|
||||
CP_XML_NODE(ns + L":col")
|
||||
{
|
||||
CP_XML_CONTENT(position.col);
|
||||
}
|
||||
|
||||
CP_XML_NODE(L"xdr:colOff")
|
||||
CP_XML_NODE(ns + L":colOff")
|
||||
{
|
||||
CP_XML_CONTENT(static_cast<size_t>(position.colOff));
|
||||
}
|
||||
|
||||
CP_XML_NODE(L"xdr:row")
|
||||
CP_XML_NODE(ns + L":row")
|
||||
{
|
||||
CP_XML_CONTENT(position.row);
|
||||
}
|
||||
|
||||
CP_XML_NODE(L"xdr:rowOff")
|
||||
CP_XML_NODE(ns + L":rowOff")
|
||||
{
|
||||
CP_XML_CONTENT(static_cast<size_t>(position.rowOff));
|
||||
}
|
||||
@ -100,15 +100,15 @@ void xlsx_drawing_position::serialize(std::wostream & strm, std::wstring ns)
|
||||
}
|
||||
}
|
||||
|
||||
void xlsx_serialize_image(std::wostream & strm, _xlsx_drawing & val)
|
||||
void xlsx_serialize_image(std::wostream & strm, _xlsx_drawing & val, const std::wstring & ns)
|
||||
{
|
||||
CP_XML_WRITER(strm)
|
||||
{
|
||||
CP_XML_NODE(L"xdr:pic")
|
||||
CP_XML_NODE(ns + L":pic")
|
||||
{
|
||||
CP_XML_NODE(L"xdr:nvPicPr")
|
||||
CP_XML_NODE(ns + L":nvPicPr")
|
||||
{
|
||||
CP_XML_NODE(L"xdr:cNvPr")
|
||||
CP_XML_NODE(ns + L":cNvPr")
|
||||
{
|
||||
CP_XML_ATTR(L"id", val.id);
|
||||
CP_XML_ATTR(L"name", val.name);
|
||||
@ -116,7 +116,7 @@ void xlsx_serialize_image(std::wostream & strm, _xlsx_drawing & val)
|
||||
oox_serialize_action(CP_XML_STREAM(), val.action);
|
||||
|
||||
}
|
||||
CP_XML_NODE(L"xdr:cNvPicPr")
|
||||
CP_XML_NODE(ns + L":cNvPicPr")
|
||||
{
|
||||
if (val.fill.bitmap->bCrop)
|
||||
{
|
||||
@ -128,7 +128,7 @@ void xlsx_serialize_image(std::wostream & strm, _xlsx_drawing & val)
|
||||
val.fill.bitmap->name_space = L"xdr";
|
||||
oox_serialize_fill(CP_XML_STREAM(), val.fill);
|
||||
|
||||
CP_XML_NODE(L"xdr:spPr")
|
||||
CP_XML_NODE(ns + L":spPr")
|
||||
{
|
||||
val.serialize_xfrm(CP_XML_STREAM());
|
||||
|
||||
@ -139,20 +139,20 @@ void xlsx_serialize_image(std::wostream & strm, _xlsx_drawing & val)
|
||||
}
|
||||
oox_serialize_ln(CP_XML_STREAM(), val.additional);
|
||||
}
|
||||
xlsx_serialize_text(CP_XML_STREAM(), val);
|
||||
xlsx_serialize_text(CP_XML_STREAM(), val, ns);
|
||||
}
|
||||
} // CP_XML_WRITER
|
||||
}
|
||||
|
||||
void xlsx_serialize_shape(std::wostream & strm, _xlsx_drawing & val)
|
||||
void xlsx_serialize_shape(std::wostream & strm, _xlsx_drawing & val, const std::wstring & ns)
|
||||
{
|
||||
CP_XML_WRITER(strm)
|
||||
{
|
||||
CP_XML_NODE(L"xdr:sp")
|
||||
CP_XML_NODE(ns + L":sp")
|
||||
{
|
||||
CP_XML_NODE(L"xdr:nvSpPr")
|
||||
CP_XML_NODE(ns + L":nvSpPr")
|
||||
{
|
||||
CP_XML_NODE(L"xdr:cNvPr")
|
||||
CP_XML_NODE(ns + L":cNvPr")
|
||||
{
|
||||
CP_XML_ATTR(L"id", val.id);//числовое значение val.rId
|
||||
|
||||
@ -160,12 +160,12 @@ void xlsx_serialize_shape(std::wostream & strm, _xlsx_drawing & val)
|
||||
|
||||
oox_serialize_action(CP_XML_STREAM(), val.action);
|
||||
}
|
||||
CP_XML_NODE(L"xdr:cNvSpPr")//non visual properies (собственно тока 1 там)
|
||||
CP_XML_NODE(ns + L":cNvSpPr")//non visual properies (собственно тока 1 там)
|
||||
{
|
||||
if (val.sub_type == 1)CP_XML_ATTR(L"txBox", 1);
|
||||
}
|
||||
} // xdr:nv_Pr
|
||||
CP_XML_NODE(L"xdr:spPr")
|
||||
CP_XML_NODE(ns + L":spPr")
|
||||
{
|
||||
val.serialize_xfrm(CP_XML_STREAM());
|
||||
|
||||
@ -174,7 +174,7 @@ void xlsx_serialize_shape(std::wostream & strm, _xlsx_drawing & val)
|
||||
oox_serialize_ln(CP_XML_STREAM(),val.additional, val.lined);
|
||||
} // xdr:spPr
|
||||
|
||||
xlsx_serialize_text(CP_XML_STREAM(), val);
|
||||
xlsx_serialize_text(CP_XML_STREAM(), val, ns);
|
||||
}
|
||||
} // CP_XML_WRITER
|
||||
}
|
||||
@ -206,22 +206,22 @@ void xlsx_serialize_object(std::wostream & strm, _xlsx_drawing & val)
|
||||
}
|
||||
}
|
||||
}
|
||||
void xlsx_serialize_group(std::wostream & strm, _xlsx_drawing & val)
|
||||
void xlsx_serialize_group(std::wostream & strm, _xlsx_drawing & val, const std::wstring & ns)
|
||||
{
|
||||
CP_XML_WRITER(strm)
|
||||
{
|
||||
CP_XML_NODE(L"xdr:grpSp")
|
||||
CP_XML_NODE(ns + L":grpSp")
|
||||
{
|
||||
CP_XML_NODE(L"xdr:nvGrpSpPr")
|
||||
CP_XML_NODE(ns + L":nvGrpSpPr")
|
||||
{
|
||||
CP_XML_NODE(L"xdr:cNvPr")
|
||||
CP_XML_NODE(ns + L":cNvPr")
|
||||
{
|
||||
CP_XML_ATTR(L"id", val.id);
|
||||
CP_XML_ATTR(L"name", val.name);
|
||||
}
|
||||
CP_XML_NODE(L"xdr:cNvGrpSpPr");
|
||||
CP_XML_NODE(ns + L":cNvGrpSpPr");
|
||||
}
|
||||
CP_XML_NODE(L"xdr:grpSpPr")
|
||||
CP_XML_NODE(ns + L":grpSpPr")
|
||||
{
|
||||
val.serialize_xfrm(CP_XML_STREAM());
|
||||
|
||||
@ -266,15 +266,15 @@ void xlsx_serialize_chart(std::wostream & strm, _xlsx_drawing & val)
|
||||
}
|
||||
}
|
||||
}
|
||||
void xlsx_serialize(std::wostream & strm, _xlsx_drawing & val)
|
||||
void xlsx_serialize(std::wostream & strm, _xlsx_drawing & val, const std::wstring & ns)
|
||||
{
|
||||
if (val.type == typeShape)
|
||||
{
|
||||
xlsx_serialize_shape(strm, val);
|
||||
xlsx_serialize_shape(strm, val, ns);
|
||||
}
|
||||
else if (val.type == typeImage)
|
||||
{
|
||||
xlsx_serialize_image(strm, val);
|
||||
xlsx_serialize_image(strm, val, ns);
|
||||
}
|
||||
else if (val.type == typeChart)
|
||||
{
|
||||
@ -282,7 +282,7 @@ void xlsx_serialize(std::wostream & strm, _xlsx_drawing & val)
|
||||
}
|
||||
else if (val.type == typeGroupShape)
|
||||
{
|
||||
xlsx_serialize_group(strm, val);
|
||||
xlsx_serialize_group(strm, val, ns);
|
||||
}
|
||||
else if (val.type == typeOleObject ||
|
||||
val.type == typeMsObject ||
|
||||
@ -292,44 +292,76 @@ void xlsx_serialize(std::wostream & strm, _xlsx_drawing & val)
|
||||
}
|
||||
}
|
||||
|
||||
void _xlsx_drawing::serialize(std::wostream & strm)
|
||||
void _xlsx_drawing::serialize(std::wostream & strm, const std::wstring & ns)
|
||||
{
|
||||
if (inGroup)
|
||||
return xlsx_serialize(strm, *this);
|
||||
return xlsx_serialize(strm, *this, ns);
|
||||
|
||||
CP_XML_WRITER(strm)
|
||||
{
|
||||
if (type_anchor == 1)
|
||||
{
|
||||
CP_XML_NODE(L"xdr:twoCellAnchor")
|
||||
CP_XML_NODE(ns + L":twoCellAnchor")
|
||||
{
|
||||
CP_XML_ATTR(L"editAs", L"oneCell");//"absolute");oneCell
|
||||
|
||||
from_.serialize (CP_XML_STREAM());
|
||||
to_.serialize (CP_XML_STREAM());
|
||||
|
||||
xlsx_serialize (CP_XML_STREAM(), *this);
|
||||
CP_XML_NODE(L"xdr:clientData");
|
||||
xlsx_serialize (CP_XML_STREAM(), *this, ns);
|
||||
CP_XML_NODE(ns + L":clientData");
|
||||
}
|
||||
}
|
||||
else
|
||||
else if (type_anchor == 2)
|
||||
{
|
||||
CP_XML_NODE(L"xdr:absoluteAnchor")
|
||||
CP_XML_NODE(ns + L":absoluteAnchor")
|
||||
{
|
||||
CP_XML_NODE(L"xdr:pos")
|
||||
CP_XML_NODE(ns + L":pos")
|
||||
{
|
||||
CP_XML_ATTR(L"x", x);
|
||||
CP_XML_ATTR(L"y", y);
|
||||
}
|
||||
CP_XML_NODE(L"xdr:ext")
|
||||
CP_XML_NODE(ns + L":ext")
|
||||
{
|
||||
CP_XML_ATTR(L"cx", cx);
|
||||
CP_XML_ATTR(L"cy", cy);
|
||||
}
|
||||
xlsx_serialize(CP_XML_STREAM(), *this);
|
||||
CP_XML_NODE(L"xdr:clientData");
|
||||
xlsx_serialize(CP_XML_STREAM(), *this, ns);
|
||||
CP_XML_NODE(ns + L":clientData");
|
||||
}
|
||||
}
|
||||
else if (type_anchor == 3)
|
||||
{
|
||||
CP_XML_NODE(ns + L":relSizeAnchor")
|
||||
{
|
||||
CP_XML_NODE(ns + L":from")
|
||||
{
|
||||
CP_XML_NODE(ns + L":x")
|
||||
{
|
||||
CP_XML_STREAM() << ((double)x / *owner_cx_);
|
||||
}
|
||||
CP_XML_NODE(ns + L":y")
|
||||
{
|
||||
CP_XML_STREAM() << ((double)y / *owner_cy_);
|
||||
}
|
||||
}
|
||||
CP_XML_NODE(ns + L":to")
|
||||
{
|
||||
_INT32 x1 = x + cx;
|
||||
_INT32 y1 = y + cy;
|
||||
|
||||
CP_XML_NODE(ns + L":x")
|
||||
{
|
||||
CP_XML_STREAM() << ((double)x1 / *owner_cx_);
|
||||
}
|
||||
CP_XML_NODE(ns + L":y")
|
||||
{
|
||||
CP_XML_STREAM() << ((double)y1 / *owner_cy_);
|
||||
}
|
||||
}
|
||||
xlsx_serialize(CP_XML_STREAM(), *this, ns);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -49,7 +49,7 @@ struct xlsx_drawing_position
|
||||
enum type_t {from, to} type;
|
||||
xlsx_table_position position;
|
||||
|
||||
void serialize(std::wostream & _Wostream, std::wstring ns = L"xdr:");
|
||||
void serialize(std::wostream & _Wostream, const std::wstring & ns = L"xdr");
|
||||
};
|
||||
|
||||
|
||||
@ -63,9 +63,14 @@ public:
|
||||
xlsx_drawing_position from_;
|
||||
xlsx_drawing_position to_;
|
||||
|
||||
_CP_OPT(_INT32) owner_cx_;
|
||||
_CP_OPT(_INT32) owner_cy_;
|
||||
|
||||
std::wstring content_group_;
|
||||
|
||||
void serialize (std::wostream & strm);
|
||||
virtual void serialize (std::wostream & strm) {return serialize(strm, L"xdr");}
|
||||
|
||||
void serialize (std::wostream & strm, const std::wstring & ns);
|
||||
void serialize_object (std::wostream & strm);
|
||||
void serialize_control (std::wostream & strm);
|
||||
};
|
||||
|
||||
@ -53,41 +53,42 @@ namespace oox {
|
||||
class xlsx_drawing_context_handle::Impl
|
||||
{
|
||||
public:
|
||||
Impl(mediaitems & items) : items_(items), next_rId_(1), next_drawing_id_(1)
|
||||
Impl(mediaitems_ptr & items) : items_(items), next_rId_(1), next_drawing_id_(1)
|
||||
{
|
||||
}
|
||||
|
||||
mediaitems & get_mediaitems() { return items_; }
|
||||
mediaitems_ptr & get_mediaitems() { return items_; }
|
||||
|
||||
size_t next_rId()
|
||||
{
|
||||
return next_rId_++;
|
||||
}
|
||||
|
||||
std::pair<std::wstring, std::wstring> add_drawing_xml(std::wstring const & content, xlsx_drawings_ptr drawings)
|
||||
std::pair<std::wstring, std::wstring> add_drawing_xml(std::wstring const & content, xlsx_drawings_ptr drawings, RelsType const & type_)
|
||||
{
|
||||
const std::wstring id = std::to_wstring(next_drawing_id_++);
|
||||
const std::wstring fileName = std::wstring(L"drawing") + id + L".xml";
|
||||
drawings_.push_back(drawing_elm(fileName, content, drawings));
|
||||
const std::wstring rId = std::wstring(L"rId") + id;//rDrId
|
||||
return std::pair<std::wstring, std::wstring>(fileName, rId);
|
||||
|
||||
drawings_.push_back(drawing_elm(fileName, content, drawings, type_));
|
||||
const std::wstring rId = std::wstring(L"rDrId") + id;
|
||||
|
||||
return std::pair<std::wstring, std::wstring>(fileName, rId);
|
||||
}
|
||||
|
||||
const std::vector<drawing_elm> & content() const
|
||||
{
|
||||
return drawings_;
|
||||
}
|
||||
|
||||
private:
|
||||
mediaitems & items_;
|
||||
mediaitems_ptr items_;
|
||||
std::vector<drawing_elm> drawings_;
|
||||
|
||||
size_t next_rId_;
|
||||
size_t next_drawing_id_;
|
||||
};
|
||||
|
||||
xlsx_drawing_context_handle::xlsx_drawing_context_handle(mediaitems & items)
|
||||
: impl_(new xlsx_drawing_context_handle::Impl(items))
|
||||
xlsx_drawing_context_handle::xlsx_drawing_context_handle(mediaitems_ptr & items) :
|
||||
impl_(new xlsx_drawing_context_handle::Impl(items))
|
||||
{
|
||||
}
|
||||
|
||||
@ -95,9 +96,9 @@ xlsx_drawing_context_handle::~xlsx_drawing_context_handle()
|
||||
{
|
||||
}
|
||||
|
||||
std::pair<std::wstring, std::wstring> xlsx_drawing_context_handle::add_drawing_xml(std::wstring const & content, xlsx_drawings_ptr drawings)
|
||||
std::pair<std::wstring, std::wstring> xlsx_drawing_context_handle::add_drawing_xml(std::wstring const & content, xlsx_drawings_ptr drawings, RelsType const & type_)
|
||||
{
|
||||
return impl_->add_drawing_xml(content, drawings);
|
||||
return impl_->add_drawing_xml(content, drawings, type_);
|
||||
}
|
||||
|
||||
const std::vector<drawing_elm> & xlsx_drawing_context_handle::content() const
|
||||
@ -108,13 +109,13 @@ const std::vector<drawing_elm> & xlsx_drawing_context_handle::content() const
|
||||
class xlsx_drawing_context::Impl
|
||||
{
|
||||
public:
|
||||
Impl(xlsx_drawing_context_handle & handle) : xlsx_drawings_(xlsx_drawings::create(false)), handle_(handle)
|
||||
Impl(xlsx_drawing_context_handle_ptr & handle) : xlsx_drawings_(xlsx_drawings::create(false)), handle_(handle)
|
||||
{
|
||||
current_level_ = &objects_;
|
||||
use_image_replacement_ = false;
|
||||
}
|
||||
|
||||
xlsx_drawing_context_handle& handle_;
|
||||
xlsx_drawing_context_handle_ptr handle_;
|
||||
drawing_object_description object_description_;
|
||||
|
||||
std::vector<drawing_object_description> objects_;
|
||||
@ -124,11 +125,11 @@ public:
|
||||
bool use_image_replacement_;
|
||||
//-----------------------------------------------------------------------------------
|
||||
|
||||
mediaitems & get_mediaitems() { return handle_.impl_->get_mediaitems(); }
|
||||
mediaitems_ptr & get_mediaitems() { return handle_->impl_->get_mediaitems(); }
|
||||
|
||||
void serialize(std::wostream & strm)
|
||||
void serialize(std::wostream & strm, const std::wstring & ns = L"xdr")
|
||||
{
|
||||
xlsx_drawings_->serialize(strm);
|
||||
xlsx_drawings_->serialize(strm, ns);
|
||||
}
|
||||
|
||||
bool empty() const
|
||||
@ -138,7 +139,7 @@ public:
|
||||
|
||||
size_t next_rId()
|
||||
{
|
||||
return handle_.impl_->next_rId();
|
||||
return handle_->impl_->next_rId();
|
||||
}
|
||||
|
||||
xlsx_drawings_ptr get_drawings()
|
||||
@ -150,7 +151,7 @@ private:
|
||||
};
|
||||
|
||||
|
||||
xlsx_drawing_context::xlsx_drawing_context(xlsx_drawing_context_handle & h)
|
||||
xlsx_drawing_context::xlsx_drawing_context(xlsx_drawing_context_handle_ptr & h)
|
||||
: impl_(new xlsx_drawing_context::Impl(h))
|
||||
{
|
||||
hlinks_size_ = 0;
|
||||
@ -386,6 +387,12 @@ void xlsx_drawing_context::set_scale(double cx_pt, double cy_pt)
|
||||
|
||||
}
|
||||
}
|
||||
void xlsx_drawing_context::set_rel_anchor(_INT32 owner_cx, _INT32 owner_cy)
|
||||
{
|
||||
impl_->object_description_.owner_cx_ = owner_cx;
|
||||
impl_->object_description_.owner_cy_ = owner_cy;
|
||||
}
|
||||
|
||||
void xlsx_drawing_context::set_anchor(std::wstring anchor, double x_pt, double y_pt, bool group)
|
||||
{
|
||||
if (group)
|
||||
@ -444,9 +451,17 @@ void xlsx_drawing_context::process_common_properties(drawing_object_description
|
||||
{
|
||||
if (obj.anchor_.empty())
|
||||
{
|
||||
drawing.type_anchor = 2; // absolute
|
||||
if (obj.owner_cx_ && obj.owner_cy_)
|
||||
{
|
||||
drawing.type_anchor = 3; // relative
|
||||
drawing.owner_cx_ = obj.owner_cx_;
|
||||
drawing.owner_cy_ = obj.owner_cy_;
|
||||
}
|
||||
else
|
||||
drawing.type_anchor = 2; // absolute
|
||||
}
|
||||
else
|
||||
|
||||
if (drawing.type_anchor == 1)
|
||||
{
|
||||
xlsx_table_position from, to;
|
||||
|
||||
@ -470,17 +485,19 @@ void xlsx_drawing_context::process_common_properties(drawing_object_description
|
||||
_rect & r = obj.svg_rect_.get();
|
||||
|
||||
//todooo непонятно что делать с отрицательными значениями
|
||||
int val = 0.5 + odf_types::length(obj.svg_rect_->x, odf_types::length::pt).get_value_unit(odf_types::length::emu);
|
||||
if (val >=0) drawing.x = val;
|
||||
_INT32 val = 0;
|
||||
|
||||
val = (_INT32) (0.5 + odf_types::length(obj.svg_rect_->x, odf_types::length::pt).get_value_unit(odf_types::length::emu));
|
||||
if (val >= 0) drawing.x = val;
|
||||
|
||||
val = 0.5 + odf_types::length(obj.svg_rect_->y, odf_types::length::pt).get_value_unit(odf_types::length::emu);
|
||||
if (val >=0) drawing.y = val;
|
||||
val = (_INT32) (0.5 + odf_types::length(obj.svg_rect_->y, odf_types::length::pt).get_value_unit(odf_types::length::emu));
|
||||
if (val >= 0) drawing.y = val;
|
||||
|
||||
val = 0.5 + odf_types::length(obj.svg_rect_->cx, odf_types::length::pt).get_value_unit(odf_types::length::emu);
|
||||
if (val >=0) drawing.cx = val;
|
||||
val = (_INT32) (0.5 + odf_types::length(obj.svg_rect_->cx, odf_types::length::pt).get_value_unit(odf_types::length::emu));
|
||||
if (val >= 0) drawing.cx = val;
|
||||
|
||||
val = .5 + odf_types::length(obj.svg_rect_->cy, odf_types::length::pt).get_value_unit(odf_types::length::emu);
|
||||
if (val >=0) drawing.cy = val;
|
||||
val = (_INT32) (0.5 + odf_types::length(obj.svg_rect_->cy, odf_types::length::pt).get_value_unit(odf_types::length::emu));
|
||||
if (val >= 0) drawing.cy = val;
|
||||
}
|
||||
|
||||
drawing.additional = obj.additional_;
|
||||
@ -555,7 +572,7 @@ void xlsx_drawing_context::process_image(drawing_object_description & obj, _xlsx
|
||||
}
|
||||
std::wstring fileName = odf_packet_path_ + FILE_SEPARATOR_STR + obj.xlink_href_;
|
||||
|
||||
drawing.fill.bitmap->bCrop = odf_reader::parse_clipping(obj.clipping_string_, fileName, drawing.fill.bitmap->cropRect, impl_->get_mediaitems().applicationFonts());
|
||||
drawing.fill.bitmap->bCrop = odf_reader::parse_clipping(obj.clipping_string_, fileName, drawing.fill.bitmap->cropRect, impl_->get_mediaitems()->applicationFonts());
|
||||
drawing.fill.bitmap->bStretch = true;
|
||||
|
||||
if ((sColorMode) && (*sColorMode == L"greyscale"))
|
||||
@ -564,14 +581,14 @@ void xlsx_drawing_context::process_image(drawing_object_description & obj, _xlsx
|
||||
std::wstring ref;/// это ссылка на выходной внешний объект
|
||||
bool isMediaInternal = false;
|
||||
|
||||
drawing.fill.bitmap->rId = impl_->get_mediaitems().add_or_find(obj.xlink_href_, typeImage, isMediaInternal, ref);
|
||||
drawing.fill.bitmap->rId = impl_->get_mediaitems()->add_or_find(obj.xlink_href_, typeImage, isMediaInternal, ref);
|
||||
|
||||
if (drawing.type == typeShape)
|
||||
{
|
||||
impl_->get_drawings()->add(isMediaInternal, drawing.fill.bitmap->rId, ref, typeImage);//собственно это не объект, а доп рел и ref объекта
|
||||
|
||||
isMediaInternal=true;
|
||||
std::wstring rId = impl_->get_mediaitems().add_or_find(L"", typeShape, isMediaInternal, ref);
|
||||
std::wstring rId = impl_->get_mediaitems()->add_or_find(L"", typeShape, isMediaInternal, ref);
|
||||
|
||||
xlsx_drawings_->add(drawing, isMediaInternal, rId, ref, typeShape);//объект
|
||||
|
||||
@ -589,7 +606,7 @@ void xlsx_drawing_context::process_chart(drawing_object_description & obj,_xlsx_
|
||||
std::wstring ref;
|
||||
bool isMediaInternal = true;
|
||||
|
||||
drawing.objectId = impl_->get_mediaitems().add_or_find(obj.xlink_href_, obj.type_, isMediaInternal, ref);
|
||||
drawing.objectId = impl_->get_mediaitems()->add_or_find(obj.xlink_href_, obj.type_, isMediaInternal, ref);
|
||||
xlsx_drawings_->add(drawing, isMediaInternal, drawing.objectId, ref, obj.type_);
|
||||
|
||||
if (drawing.inGroup)
|
||||
@ -627,7 +644,7 @@ void xlsx_drawing_context::process_object(drawing_object_description & obj, xlsx
|
||||
}
|
||||
else
|
||||
{
|
||||
drawing.objectId = impl_->get_mediaitems().add_or_find(obj.xlink_href_, obj.type_, isMediaInternal, ref);
|
||||
drawing.objectId = impl_->get_mediaitems()->add_or_find(obj.xlink_href_, obj.type_, isMediaInternal, ref);
|
||||
drawing.objectProgId = obj.descriptor_;
|
||||
|
||||
xlsx_drawings_->add(drawing, isMediaInternal, drawing.objectId, ref, obj.type_, true);
|
||||
@ -641,7 +658,7 @@ void xlsx_drawing_context::process_shape(drawing_object_description & obj,_xlsx_
|
||||
std::wstring ref;
|
||||
bool isMediaInternal = true;
|
||||
|
||||
std::wstring rId = impl_->get_mediaitems().add_or_find(L"", obj.type_, isMediaInternal, ref);
|
||||
std::wstring rId = impl_->get_mediaitems()->add_or_find(L"", obj.type_, isMediaInternal, ref);
|
||||
xlsx_drawings_->add(drawing, isMediaInternal, rId, ref, obj.type_);
|
||||
}
|
||||
|
||||
@ -653,7 +670,7 @@ void xlsx_drawing_context::process_group(drawing_object_description & obj, xlsx_
|
||||
|
||||
std::wstringstream strm;
|
||||
|
||||
xlsx_drawings_child->serialize(strm);
|
||||
xlsx_drawings_child->serialize(strm, L"xdr");
|
||||
|
||||
drawing.content_group_ = strm.str();
|
||||
|
||||
@ -661,7 +678,7 @@ void xlsx_drawing_context::process_group(drawing_object_description & obj, xlsx_
|
||||
std::wstring ref;
|
||||
bool isMediaInternal = true;
|
||||
|
||||
std::wstring rId = impl_->get_mediaitems().add_or_find(L"", obj.type_, isMediaInternal, ref);
|
||||
std::wstring rId = impl_->get_mediaitems()->add_or_find(L"", obj.type_, isMediaInternal, ref);
|
||||
xlsx_drawings_->add(drawing, isMediaInternal, rId, ref, obj.type_);
|
||||
|
||||
}
|
||||
@ -692,7 +709,7 @@ void xlsx_drawing_context::process_group_objects(std::vector<drawing_object_desc
|
||||
std::wstring ref;
|
||||
bool isMediaInternal = true;
|
||||
|
||||
drawing.fill.bitmap->rId = impl_->get_mediaitems().add_or_find(drawing.fill.bitmap->xlink_href_, typeImage, isMediaInternal, ref);
|
||||
drawing.fill.bitmap->rId = impl_->get_mediaitems()->add_or_find(drawing.fill.bitmap->xlink_href_, typeImage, isMediaInternal, ref);
|
||||
|
||||
bool in_sheet = (obj.type_== typeOleObject || obj.type_== typeMsObject) ? true : false;
|
||||
impl_->get_drawings()->add(isMediaInternal, drawing.fill.bitmap->rId, ref, typeImage, in_sheet);//собственно это не объект, а доп рел и ref объекта
|
||||
@ -716,9 +733,9 @@ void xlsx_drawing_context::process_group_objects(std::vector<drawing_object_desc
|
||||
}
|
||||
}
|
||||
|
||||
void xlsx_drawing_context::serialize(std::wostream & strm)
|
||||
void xlsx_drawing_context::serialize(std::wostream & strm, const std::wstring& ns)
|
||||
{
|
||||
impl_->serialize(strm);
|
||||
impl_->serialize(strm, ns);
|
||||
}
|
||||
|
||||
xlsx_drawings_ptr xlsx_drawing_context::get_drawings()
|
||||
@ -756,6 +773,5 @@ void xlsx_drawing_context::set_is_connector_shape(bool val)
|
||||
impl_->object_description_.connector_ = val;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -53,15 +53,16 @@ namespace oox {
|
||||
class xlsx_drawings;
|
||||
struct _oox_fill;
|
||||
|
||||
typedef _CP_PTR(xlsx_drawings) xlsx_drawings_ptr;
|
||||
typedef _CP_PTR(mediaitems) mediaitems_ptr;
|
||||
typedef _CP_PTR(xlsx_drawings) xlsx_drawings_ptr;
|
||||
|
||||
class xlsx_drawing_context_handle
|
||||
{
|
||||
public:
|
||||
xlsx_drawing_context_handle(mediaitems & items);
|
||||
xlsx_drawing_context_handle(mediaitems_ptr & items);
|
||||
~xlsx_drawing_context_handle();
|
||||
|
||||
std::pair<std::wstring, std::wstring> add_drawing_xml(std::wstring const & content, xlsx_drawings_ptr drawings);
|
||||
std::pair<std::wstring, std::wstring> add_drawing_xml(std::wstring const & content, xlsx_drawings_ptr drawings, RelsType const & type_ = typeDefault);
|
||||
const std::vector<drawing_elm> & content() const;
|
||||
|
||||
friend class xlsx_drawing_context;
|
||||
@ -72,10 +73,12 @@ public:
|
||||
|
||||
|
||||
|
||||
typedef _CP_PTR(xlsx_drawing_context_handle) xlsx_drawing_context_handle_ptr;
|
||||
|
||||
class xlsx_drawing_context
|
||||
{
|
||||
public:
|
||||
xlsx_drawing_context(xlsx_drawing_context_handle & h);
|
||||
xlsx_drawing_context(xlsx_drawing_context_handle_ptr & h);
|
||||
~xlsx_drawing_context();
|
||||
|
||||
void set_odf_packet_path(std::wstring path){odf_packet_path_ = path;}//для анализа картинок
|
||||
@ -105,6 +108,7 @@ public:
|
||||
void set_scale (double cx_pt, double cy_pt);
|
||||
void set_rotate (double angle, bool translate = false);
|
||||
|
||||
void set_rel_anchor (_INT32 owner_cx, _INT32 owner_cy);
|
||||
void set_anchor (std::wstring anchor, double x_pt, double y_pt, bool group = false);
|
||||
void set_property (odf_reader::_property p);
|
||||
void set_clipping (const std::wstring & str );
|
||||
@ -122,7 +126,8 @@ public:
|
||||
bool empty() const;
|
||||
void clear();
|
||||
|
||||
void serialize(std::wostream & strm);
|
||||
void serialize(std::wostream & strm, const std::wstring& ns = L"xdr");
|
||||
|
||||
std::wstring dump_path(std::vector<svg_path::_polyline> & path, double w,double h);
|
||||
|
||||
xlsx_drawings_ptr get_drawings();
|
||||
|
||||
@ -85,28 +85,35 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
void serialize(std::wostream & strm)
|
||||
void serialize(std::wostream & strm, const std::wstring & ns)
|
||||
{
|
||||
if (inGroup)
|
||||
{
|
||||
for (size_t i = 0 ; i < xlsx_drawings_.size(); i++)
|
||||
{
|
||||
xlsx_drawings_[i].serialize(strm);
|
||||
xlsx_drawings_[i].serialize(strm, ns);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
CP_XML_WRITER(strm)
|
||||
{
|
||||
CP_XML_NODE(L"xdr:wsDr")
|
||||
CP_XML_NODE(ns + L":wsDr")
|
||||
{
|
||||
CP_XML_ATTR(L"xmlns:xdr", L"http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing");
|
||||
if (ns == L"xdr")
|
||||
{
|
||||
CP_XML_ATTR(L"xmlns:xdr", L"http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing");
|
||||
}
|
||||
if (ns == L"cdr")
|
||||
{
|
||||
CP_XML_ATTR(L"xmlns:cdr", L"http://schemas.openxmlformats.org/drawingml/2006/chartDrawing");
|
||||
}
|
||||
CP_XML_ATTR(L"xmlns:a" , L"http://schemas.openxmlformats.org/drawingml/2006/main");
|
||||
CP_XML_ATTR(L"xmlns:r" , L"http://schemas.openxmlformats.org/officeDocument/2006/relationships");
|
||||
|
||||
for (size_t i = 0 ; i < xlsx_drawings_.size(); i++)
|
||||
{
|
||||
xlsx_drawings_[i].serialize(CP_XML_STREAM());
|
||||
xlsx_drawings_[i].serialize(CP_XML_STREAM(), ns);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -192,9 +199,9 @@ void xlsx_drawings::add( bool isInternal, std::wstring const & rid, std::wstring
|
||||
impl_->add(isInternal, rid, ref, type, sheet_rel);
|
||||
}
|
||||
|
||||
void xlsx_drawings::serialize(std::wostream & strm)
|
||||
void xlsx_drawings::serialize(std::wostream & strm, const std::wstring & ns)
|
||||
{
|
||||
impl_->serialize(strm);
|
||||
impl_->serialize(strm, ns);
|
||||
}
|
||||
|
||||
void xlsx_drawings::serialize_objects(std::wostream & strm)
|
||||
|
||||
@ -46,13 +46,14 @@ typedef _CP_PTR(xlsx_drawings) xlsx_drawings_ptr;
|
||||
|
||||
struct drawing_elm
|
||||
{
|
||||
drawing_elm(std::wstring const & _filename, std::wstring const & _content, xlsx_drawings_ptr _drawings)
|
||||
: filename(_filename), content(_content), drawings(_drawings)
|
||||
drawing_elm(std::wstring const & _filename, std::wstring const & _content, xlsx_drawings_ptr _drawings, RelsType const & _type)
|
||||
: filename(_filename), content(_content), drawings(_drawings), type(_type)
|
||||
{}
|
||||
|
||||
std::wstring filename;
|
||||
std::wstring content;
|
||||
xlsx_drawings_ptr drawings;
|
||||
RelsType type;
|
||||
};
|
||||
|
||||
class _xlsx_drawing;
|
||||
@ -71,7 +72,7 @@ public:
|
||||
void dump_rels_sheet (rels & Rels);
|
||||
void dump_rels_drawing (rels & Rels);
|
||||
|
||||
void serialize (std::wostream & _Wostream);
|
||||
void serialize (std::wostream & _Wostream, const std::wstring & ns);
|
||||
void serialize_objects (std::wostream & _Wostream);
|
||||
void serialize_controls (std::wostream & _Wostream);
|
||||
private:
|
||||
|
||||
@ -31,6 +31,8 @@
|
||||
*/
|
||||
|
||||
#include "xlsx_package.h"
|
||||
#include "docx_package.h"
|
||||
#include "pptx_package.h"
|
||||
|
||||
#include <boost/ref.hpp>
|
||||
|
||||
@ -298,16 +300,16 @@ void xl_files::add_sheet(sheet_content_ptr sheet)
|
||||
sheets_files_.add_sheet(sheet);
|
||||
}
|
||||
|
||||
void xl_files::set_media(mediaitems & _Mediaitems)
|
||||
void xl_files::set_media(mediaitems_ptr & _mediaitems)
|
||||
{
|
||||
if (_Mediaitems.count_image + _Mediaitems.count_media > 0)
|
||||
if (_mediaitems->count_image + _mediaitems->count_media > 0)
|
||||
{
|
||||
media_ = element_ptr( new media(_Mediaitems, _Mediaitems.applicationFonts()) );
|
||||
media_ = element_ptr( new media(_mediaitems, _mediaitems->applicationFonts()) );
|
||||
}
|
||||
|
||||
if (_Mediaitems.count_object > 0)
|
||||
if (_mediaitems->count_object > 0)
|
||||
{
|
||||
embeddings_ = element_ptr( new embeddings(_Mediaitems) );
|
||||
embeddings_ = element_ptr( new embeddings(_mediaitems) );
|
||||
}
|
||||
}
|
||||
void xl_files::set_comments(element_ptr Element)
|
||||
@ -563,10 +565,18 @@ xl_drawings_ptr xl_drawings::create(const std::vector<drawing_elm> & elms)
|
||||
|
||||
void xl_drawings::write(const std::wstring & RootPath)
|
||||
{
|
||||
content_type * contentTypes = this->get_main_document()->get_content_types_file().content();
|
||||
|
||||
std::wstring path = RootPath + FILE_SEPARATOR_STR + L"drawings";
|
||||
NSDirectory::CreateDirectory(path.c_str());
|
||||
|
||||
for (size_t i = 0; i < drawings_.size(); i++)
|
||||
pptx_document *pptx = dynamic_cast<pptx_document*>(this->get_main_document());
|
||||
xlsx_document *xlsx = dynamic_cast<xlsx_document*>(this->get_main_document());
|
||||
docx_document *docx = dynamic_cast<docx_document*>(this->get_main_document());
|
||||
|
||||
const std::wstring override_str = docx ? L"/word/drawings/" : (pptx ? L"/ppt/drawings/" : L"/xl/drawings/");
|
||||
|
||||
for (size_t i = 0; i < drawings_.size(); i++)
|
||||
{
|
||||
package::simple_element(drawings_[i].filename, drawings_[i].content).write(path);
|
||||
|
||||
@ -578,10 +588,11 @@ void xl_drawings::write(const std::wstring & RootPath)
|
||||
relFiles.add_rel_file(r);
|
||||
relFiles.write(path);
|
||||
|
||||
content_type * contentTypes = this->get_main_document()->get_content_types_file().content();
|
||||
|
||||
const std::wstring kDrawingCT = L"application/vnd.openxmlformats-officedocument.drawing+xml";
|
||||
contentTypes->add_override(L"/xl/drawings/" + drawings_[i].filename, kDrawingCT);
|
||||
const std::wstring kDrawingCT = drawings_[i].type == typeChartUserShapes ?
|
||||
L"application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml" :
|
||||
L"application/vnd.openxmlformats-officedocument.drawing+xml";
|
||||
|
||||
contentTypes->add_override(override_str + drawings_[i].filename, kDrawingCT);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -284,7 +284,7 @@ public:
|
||||
void set_sharedStrings (element_ptr Element);
|
||||
void set_connections (element_ptr Element);
|
||||
void add_sheet (sheet_content_ptr sheet);
|
||||
void set_media (mediaitems & _Mediaitems);
|
||||
void set_media (mediaitems_ptr & _Mediaitems);
|
||||
void set_drawings (element_ptr Element);
|
||||
void set_vml_drawings (element_ptr Element);
|
||||
void set_comments (element_ptr Element);
|
||||
|
||||
@ -69,12 +69,12 @@ xlsx_conversion_context::xlsx_conversion_context(odf_reader::odf_document * odfD
|
||||
xlsx_table_context_ (this, xlsx_text_context_),
|
||||
math_context_ (odf_document_->odf_context().fontContainer(), true),
|
||||
xlsx_style_ (this),
|
||||
|
||||
|
||||
maxDigitSize_ (std::make_pair(-1.f, -1.f) ),
|
||||
default_style_ ( (std::numeric_limits<size_t>::max)() ),
|
||||
mediaitems_ (odf_document_->get_folder()),
|
||||
xlsx_drawing_context_handle_(mediaitems_)
|
||||
default_style_ ( (std::numeric_limits<size_t>::max)() )
|
||||
{
|
||||
mediaitems_ = boost::make_shared<mediaitems>(odf_document_->get_folder());
|
||||
drawing_context_handle_ = boost::make_shared<xlsx_drawing_context_handle>(mediaitems_);
|
||||
}
|
||||
|
||||
std::unordered_map<std::wstring, int> xlsx_conversion_context::mapExternalLink_;
|
||||
@ -90,7 +90,16 @@ xlsx_conversion_context::~xlsx_conversion_context()
|
||||
|
||||
void xlsx_conversion_context::set_font_directory(std::wstring pathFonts)
|
||||
{
|
||||
mediaitems_.set_font_directory(pathFonts);
|
||||
mediaitems_->set_font_directory(pathFonts);
|
||||
}
|
||||
void xlsx_conversion_context::set_drawing_context_handle(xlsx_drawing_context_handle_ptr &handle)
|
||||
{
|
||||
drawing_context_handle_ = handle;
|
||||
}
|
||||
|
||||
void xlsx_conversion_context::set_mediaitems(mediaitems_ptr &items)
|
||||
{
|
||||
mediaitems_ = items;
|
||||
}
|
||||
|
||||
void xlsx_conversion_context::start_chart(std::wstring name)
|
||||
@ -323,7 +332,7 @@ void xlsx_conversion_context::end_document()
|
||||
output_document_->get_content_types_file().set_media(get_mediaitems());
|
||||
output_document_->get_xl_files().set_media(get_mediaitems());
|
||||
|
||||
package::xl_drawings_ptr drawings = package::xl_drawings::create(xlsx_drawing_context_handle_.content());
|
||||
package::xl_drawings_ptr drawings = package::xl_drawings::create(drawing_context_handle_->content());
|
||||
output_document_->get_xl_files().set_drawings(drawings);
|
||||
|
||||
package::xl_comments_ptr comments = package::xl_comments::create(xlsx_comments_context_handle_.content());
|
||||
@ -496,13 +505,13 @@ void xlsx_conversion_context::end_table()
|
||||
L"../pivotTables/pivotTable" + std::to_wstring(it->second) + L".xml"));
|
||||
}
|
||||
|
||||
if (!get_drawing_context().empty())
|
||||
if (false == get_drawing_context().empty())
|
||||
{
|
||||
std::wstringstream strm;
|
||||
get_drawing_context().serialize(strm);
|
||||
|
||||
const std::pair<std::wstring, std::wstring> drawingName
|
||||
= xlsx_drawing_context_handle_.add_drawing_xml(strm.str(), get_drawing_context().get_drawings() );
|
||||
= drawing_context_handle_->add_drawing_xml(strm.str(), get_drawing_context().get_drawings() );
|
||||
|
||||
current_sheet().set_drawing_link(drawingName.first, drawingName.second);
|
||||
|
||||
@ -730,7 +739,7 @@ std::pair<float,float> xlsx_conversion_context::getMaxDigitSize()
|
||||
else
|
||||
font_size =10;
|
||||
|
||||
maxDigitSize_ = utils::GetMaxDigitSizePixels(font_name.c_str(), font_size, 96., 0, mediaitems_.applicationFonts());
|
||||
maxDigitSize_ = utils::GetMaxDigitSizePixels(font_name.c_str(), font_size, 96., 0, mediaitems_->applicationFonts());
|
||||
}
|
||||
return maxDigitSize_;
|
||||
}
|
||||
@ -749,9 +758,9 @@ xlsx_drawing_context & xlsx_conversion_context::get_drawing_context()
|
||||
return get_table_context().get_drawing_context();
|
||||
}
|
||||
|
||||
xlsx_drawing_context_handle & xlsx_conversion_context::get_drawing_context_handle()
|
||||
xlsx_drawing_context_handle_ptr & xlsx_conversion_context::get_drawing_context_handle()
|
||||
{
|
||||
return xlsx_drawing_context_handle_;
|
||||
return drawing_context_handle_;
|
||||
}
|
||||
xlsx_comments_context & xlsx_conversion_context::get_comments_context()
|
||||
{
|
||||
|
||||
@ -188,12 +188,16 @@ public:
|
||||
xlsx_pivots_context & get_pivots_context() { return xlsx_pivots_context_;}
|
||||
xlsx_table_metrics & get_table_metrics();
|
||||
xlsx_drawing_context & get_drawing_context();
|
||||
xlsx_drawing_context_handle & get_drawing_context_handle();
|
||||
xlsx_comments_context & get_comments_context();
|
||||
xlsx_comments_context_handle & get_comments_context_handle();
|
||||
xlsx_dataValidations_context& get_dataValidations_context() { return xlsx_dataValidations_context_;}
|
||||
|
||||
mediaitems & get_mediaitems() { return mediaitems_; }
|
||||
|
||||
xlsx_drawing_context_handle_ptr & get_drawing_context_handle();
|
||||
void set_drawing_context_handle(xlsx_drawing_context_handle_ptr &handle);
|
||||
|
||||
mediaitems_ptr & get_mediaitems() { return mediaitems_; }
|
||||
void set_mediaitems(mediaitems_ptr &items);
|
||||
|
||||
static std::unordered_map<std::wstring, int> mapExternalLink_;
|
||||
std::map<std::wstring, int> mapUsedNames_;
|
||||
@ -213,7 +217,7 @@ private:
|
||||
std::pair<float,float> maxDigitSize_;
|
||||
num_format_context num_format_context_;
|
||||
size_t default_style_;
|
||||
mediaitems mediaitems_;
|
||||
mediaitems_ptr mediaitems_;
|
||||
std::multimap<std::wstring, int> mapPivotsTableView_;
|
||||
|
||||
std::map<std::wstring, std::wstring> control_props_;
|
||||
@ -223,9 +227,9 @@ private:
|
||||
xlsx_table_context xlsx_table_context_;
|
||||
xlsx_text_context xlsx_text_context_;
|
||||
xlsx_pivots_context xlsx_pivots_context_;
|
||||
xlsx_drawing_context_handle xlsx_drawing_context_handle_;
|
||||
xlsx_comments_context_handle xlsx_comments_context_handle_;
|
||||
xlsx_dataValidations_context xlsx_dataValidations_context_;
|
||||
xlsx_drawing_context_handle_ptr drawing_context_handle_;
|
||||
|
||||
math_context math_context_;
|
||||
forms_context forms_context_;
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
@ -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:
|
||||
|
||||
@ -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"
|
||||
@ -210,13 +212,18 @@ void object_odf_context::docx_convert(oox::docx_conversion_context & Context)
|
||||
|
||||
oox_convert(chart_context);
|
||||
|
||||
if (embeddedData.empty())
|
||||
if (false == embeddedData.empty())
|
||||
{
|
||||
chart_context.set_cache_only(true);
|
||||
chart_context.set_externalData(embeddedData);
|
||||
}
|
||||
else
|
||||
{
|
||||
chart_context.set_externalData(embeddedData);
|
||||
chart_context.set_cache_only(true);
|
||||
}
|
||||
|
||||
if (false == userShapes.first.empty())
|
||||
{
|
||||
chart_context.set_userShapes(userShapes);
|
||||
}
|
||||
|
||||
Context.end_chart();
|
||||
@ -448,14 +455,14 @@ void object_odf_context::oox_convert(oox::oox_chart_context & chart_context)
|
||||
}
|
||||
else
|
||||
{ //x
|
||||
if (false == domain_cash.empty())
|
||||
if (false == domain_cash.empty() || cash_values.empty())
|
||||
{
|
||||
if (!bPivotChart_)
|
||||
current->set_formula_series(2, domain_cell_range_adress_, formatCode, boolVal.get_value_or(true));
|
||||
current->set_values_series (2, domain_cash);
|
||||
}
|
||||
//y
|
||||
if (false == cell_cash.empty())
|
||||
if (false == cell_cash.empty() || cash_values.empty())
|
||||
{
|
||||
if (!bPivotChart_)
|
||||
current->set_formula_series(3, series_[i].cell_range_address_, formatCode, boolVal.get_value_or(true));
|
||||
@ -735,7 +742,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 +769,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 +1043,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();
|
||||
|
||||
@ -206,6 +206,7 @@ public:
|
||||
std::map<std::wstring, _cell>cash_pivot;
|
||||
|
||||
std::wstring embeddedData;
|
||||
std::pair<std::wstring, std::wstring> userShapes;
|
||||
//---------------------------------------
|
||||
std::wstring target_table_;
|
||||
std::wstring table_name_;
|
||||
|
||||
@ -124,9 +124,8 @@ namespace chart {
|
||||
std::wstring chart_name_;
|
||||
std::wstring style_name_;
|
||||
std::vector<grid> grids_;
|
||||
int type_;
|
||||
|
||||
};
|
||||
int type_;
|
||||
};
|
||||
struct series : public simple
|
||||
{
|
||||
struct point : public simple
|
||||
|
||||
@ -76,27 +76,26 @@ std::wostream & operator<< (std::wostream & _Wostream, const length & _Length)
|
||||
_Wostream << std::setprecision(4) << _Length.get_value() << _Length.get_unit();
|
||||
return _Wostream;
|
||||
}
|
||||
length operator+ (length & _Length1, length & _Length2)
|
||||
length operator+ (length _Length1, length _Length2)
|
||||
{
|
||||
return length(_Length1.get_value() + _Length2.get_value(),_Length1.get_unit()); //проверка на одинаковость типа .. или приведение к одному
|
||||
}
|
||||
|
||||
length operator+ (length & _Length1, double val)
|
||||
length operator+ (length _Length1, double val)
|
||||
{
|
||||
return length(_Length1.get_value() + val,_Length1.get_unit());
|
||||
}
|
||||
|
||||
length operator- (length & _Length1, length & _Length2)
|
||||
length operator- (length _Length1, length _Length2)
|
||||
{
|
||||
return length(_Length1.get_value() - _Length2.get_value(),_Length1.get_unit()); //проверка на одинаковость типа .. или приведение к одному
|
||||
return length(_Length1.get_value() - _Length2.get_value(), _Length1.get_unit()); //проверка на одинаковость типа .. или приведение к одному
|
||||
}
|
||||
length operator/ (length & _Length1, double val)
|
||||
length operator/ (length _Length1, double val)
|
||||
{
|
||||
return length(_Length1.get_value() / val ,_Length1.get_unit());
|
||||
return length(_Length1.get_value() / val, _Length1.get_unit());
|
||||
}
|
||||
length operator* (length & _Length1, double val)
|
||||
length operator* (length _Length1, double val)
|
||||
{
|
||||
return length(_Length1.get_value() * val ,_Length1.get_unit());
|
||||
return length(_Length1.get_value() * val, _Length1.get_unit());
|
||||
}
|
||||
bool operator== (length & _Length1, length & _Length2)
|
||||
{
|
||||
|
||||
@ -78,11 +78,12 @@ private:
|
||||
std::wostream & operator<< (std::wostream & _Wostream, const length::unit _Unit);
|
||||
std::wostream & operator<< (std::wostream & _Wostream, const length & _Length);
|
||||
|
||||
length operator+ (length & _Length1, double val);
|
||||
length operator+ (length & _Length1, length & _Length2);
|
||||
length operator- (length & _Length1, length & _Length2);
|
||||
length operator/ (length & _Length1, double val);
|
||||
length operator* (length & _Length1, double val);
|
||||
length operator+ (length _Length1, double val);
|
||||
length operator+ (length _Length1, length _Length2);
|
||||
length operator- (length _Length1, length _Length2);
|
||||
length operator/ (length _Length1, double val);
|
||||
length operator* (length _Length1, double val);
|
||||
|
||||
bool operator== (length & _Length1, length & _Length2);
|
||||
bool operator== (const length & _Length1, const length & _Length2);
|
||||
|
||||
|
||||
@ -499,6 +499,15 @@ void Compute_GraphicFill(const common_draw_fill_attlist & props, const office_el
|
||||
fill.gradient = oox::oox_gradient_fill::create();
|
||||
|
||||
Compute_GradientFill(image_style, fill.gradient);
|
||||
|
||||
if (fill.opacity)
|
||||
{
|
||||
for (size_t i = 0; i < fill.gradient->colors.size(); i++)
|
||||
{
|
||||
if (!fill.gradient->colors[i].opacity)
|
||||
fill.gradient->colors[i].opacity = fill.opacity;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -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;
|
||||
}
|
||||
@ -207,6 +207,11 @@ void draw_g::add_child_element( xml::sax * Reader, const std::wstring & Ns, cons
|
||||
|
||||
if (position_child_x2 < x + cx || position_child_x2 == 0x7fffffff) position_child_x2 = x + cx;
|
||||
if (position_child_y2 < y + cy || position_child_y2 == 0x7fffffff) position_child_y2 = y + cy;
|
||||
|
||||
if (frame->is_object_)
|
||||
{
|
||||
object_index = content_.size() - 1;
|
||||
}
|
||||
}
|
||||
else if (shape)
|
||||
{
|
||||
@ -225,9 +230,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 +241,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;
|
||||
}
|
||||
|
||||
@ -256,16 +261,20 @@ void draw_frame::add_attributes( const xml::attributes_wc_ptr & Attributes )
|
||||
void draw_frame::add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name)
|
||||
{
|
||||
if (CP_CHECK_NAME(L"draw", L"text-box") ||
|
||||
CP_CHECK_NAME(L"draw", L"image") ||//копия объекта в виде картинки ну.. или просто картинка
|
||||
CP_CHECK_NAME(L"draw", L"object") ||//месторасположение embedded объекта
|
||||
CP_CHECK_NAME(L"draw", L"object-ole") ||
|
||||
CP_CHECK_NAME(L"draw", L"applet") ||
|
||||
CP_CHECK_NAME(L"draw", L"floating-frame") ||
|
||||
CP_CHECK_NAME(L"draw", L"plugin") ||
|
||||
CP_CHECK_NAME(L"table", L"table")
|
||||
)
|
||||
CP_CHECK_NAME(L"draw", L"image") ||//копия объекта в виде картинки ну.. или просто картинка
|
||||
CP_CHECK_NAME(L"table", L"table") ||
|
||||
CP_CHECK_NAME(L"draw", L"object-ole")||
|
||||
CP_CHECK_NAME(L"draw", L"applet") ||
|
||||
CP_CHECK_NAME(L"draw", L"floating-frame")||
|
||||
CP_CHECK_NAME(L"draw", L"plugin")
|
||||
)
|
||||
{
|
||||
CP_CREATE_ELEMENT(content_);
|
||||
}
|
||||
else if CP_CHECK_NAME(L"draw", L"object") //embedded объект
|
||||
{
|
||||
CP_CREATE_ELEMENT(content_);
|
||||
is_object_ = true;
|
||||
}
|
||||
else if CP_CHECK_NAME(L"office", L"event-listeners")
|
||||
{
|
||||
@ -308,9 +317,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;
|
||||
}
|
||||
|
||||
|
||||
@ -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);
|
||||
@ -153,14 +153,14 @@ public:
|
||||
static const ElementType type = typeDrawFrame;
|
||||
CPDOCCORE_DEFINE_VISITABLE();
|
||||
|
||||
draw_frame() : oox_drawing_(), idx_in_owner(-1) {}
|
||||
draw_frame() : oox_drawing_(), idx_in_owner(-1), is_object_(false) {}
|
||||
|
||||
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);
|
||||
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 ;
|
||||
|
||||
@ -185,10 +185,10 @@ public:
|
||||
|
||||
oox_drawing_ptr oox_drawing_;
|
||||
|
||||
bool is_object_;
|
||||
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);
|
||||
|
||||
};
|
||||
|
||||
CP_REGISTER_OFFICE_ELEMENT2(draw_frame);
|
||||
@ -209,9 +209,9 @@ public:
|
||||
static const ElementType type = typeDrawG;
|
||||
CPDOCCORE_DEFINE_VISITABLE();
|
||||
|
||||
draw_g() : position_child_x1(0x7fffffff), position_child_y1(0x7fffffff), position_child_x2(0x7fffffff), position_child_y2(0x7fffffff) {}
|
||||
draw_g() : object_index(-1), 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);
|
||||
@ -228,6 +228,8 @@ public:
|
||||
int position_child_x2;
|
||||
int position_child_y2;
|
||||
|
||||
int object_index ;
|
||||
|
||||
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);
|
||||
@ -263,7 +265,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_;
|
||||
@ -306,6 +308,7 @@ public:
|
||||
|
||||
odf_document_ptr odf_document_;
|
||||
|
||||
office_element_ptr_array content_; //for case group with object
|
||||
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);
|
||||
|
||||
@ -923,7 +923,7 @@ void common_draw_docx_convert(oox::docx_conversion_context & Context, union_comm
|
||||
if ((drawing->fill.bitmap) && (drawing->fill.bitmap->rId.empty()))
|
||||
{
|
||||
std::wstring href = drawing->fill.bitmap->xlink_href_;
|
||||
drawing->fill.bitmap->rId = Context.get_mediaitems().add_or_find(href, oox::typeImage, drawing->fill.bitmap->isInternal, href);
|
||||
drawing->fill.bitmap->rId = Context.get_mediaitems()->add_or_find(href, oox::typeImage, drawing->fill.bitmap->isInternal, href);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////
|
||||
@ -1196,7 +1196,7 @@ void draw_image::docx_convert(oox::docx_conversion_context & Context)
|
||||
drawing->fill.bitmap = oox::oox_bitmap_fill::create();
|
||||
drawing->fill.type = 2;
|
||||
drawing->fill.bitmap->isInternal = false;
|
||||
drawing->fill.bitmap->rId = Context.get_mediaitems().add_or_find(href, oox::typeImage, drawing->fill.bitmap->isInternal, href);
|
||||
drawing->fill.bitmap->rId = Context.get_mediaitems()->add_or_find(href, oox::typeImage, drawing->fill.bitmap->isInternal, href);
|
||||
drawing->fill.bitmap->bStretch = true;
|
||||
|
||||
const std::wstring styleName = frame->common_draw_attlists_.shape_with_text_and_styles_.
|
||||
@ -1216,7 +1216,7 @@ void draw_image::docx_convert(oox::docx_conversion_context & Context)
|
||||
|
||||
std::wstring fileName = Context.root()->get_folder() + FILE_SEPARATOR_STR + xlink_attlist_.href_.get_value_or(L"");
|
||||
|
||||
drawing->fill.bitmap->bCrop = parse_clipping(strRectClip, fileName, drawing->fill.bitmap->cropRect, Context.get_mediaitems().applicationFonts());
|
||||
drawing->fill.bitmap->bCrop = parse_clipping(strRectClip, fileName, drawing->fill.bitmap->cropRect, Context.get_mediaitems()->applicationFonts());
|
||||
}
|
||||
if (properties->common_draw_fill_attlist_.draw_luminance_)
|
||||
{
|
||||
@ -1352,6 +1352,32 @@ void draw_g::docx_convert(oox::docx_conversion_context & Context)
|
||||
Context.add_delayed_element(this);
|
||||
return;
|
||||
}
|
||||
|
||||
if (object_index >= 0) //только в документах нельзя объект объединять с шейпами в группы (
|
||||
{
|
||||
draw_frame *frame = dynamic_cast<draw_frame*>(content_[object_index].get());
|
||||
|
||||
frame->common_draw_attlists_.shape_with_text_and_styles_.common_text_anchor_attlist_.type_ =
|
||||
common_draw_attlists_.shape_with_text_and_styles_.common_text_anchor_attlist_.type_;
|
||||
|
||||
for (size_t i = 0; i < frame->content_.size(); i++)
|
||||
{
|
||||
draw_object *object = dynamic_cast<draw_object*>(frame->content_[i].get());
|
||||
if (!object)continue;
|
||||
|
||||
for (size_t j = 0; j < content_.size(); j++)
|
||||
{
|
||||
if (j == object_index) continue;
|
||||
|
||||
object->content_.push_back(content_[j]);
|
||||
|
||||
}
|
||||
break;
|
||||
}
|
||||
frame->docx_convert(Context);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
oox::_docx_drawing drawing = oox::_docx_drawing();
|
||||
|
||||
@ -1541,6 +1567,10 @@ void draw_object::docx_convert(oox::docx_conversion_context & Context)
|
||||
process_build_object process_build_object_(objectBuild, odf_document_->odf_context());
|
||||
contentSubDoc->accept(process_build_object_);
|
||||
|
||||
frame = Context.get_drawing_context().get_current_frame(); //owner
|
||||
if (frame)
|
||||
drawing = dynamic_cast<oox::_docx_drawing *>(frame->oox_drawing_.get());
|
||||
|
||||
if (objectBuild.table_table_)
|
||||
{
|
||||
oox::xlsx_conversion_context xlsx_context(odf_document_.get());
|
||||
@ -1556,7 +1586,7 @@ void draw_object::docx_convert(oox::docx_conversion_context & Context)
|
||||
NSDirectory::CreateDirectory(href_folder);
|
||||
outputXlsx.write(href_folder);
|
||||
|
||||
std::wstring href = L"Microsoft_Excel_Worksheet_" + std::to_wstring(Context.get_mediaitems().count_object + 1) + L".xlsx";
|
||||
std::wstring href = L"Microsoft_Excel_Worksheet_" + std::to_wstring(Context.get_mediaitems()->count_object + 1) + L".xlsx";
|
||||
|
||||
COfficeUtils oCOfficeUtils(NULL);
|
||||
if (S_OK == oCOfficeUtils.CompressFileOrDirectory(href_folder, odfPath + FILE_SEPARATOR_STR + href, true))
|
||||
@ -1565,11 +1595,34 @@ void draw_object::docx_convert(oox::docx_conversion_context & Context)
|
||||
}
|
||||
}
|
||||
|
||||
if (false == content_.empty())
|
||||
{
|
||||
oox::xlsx_conversion_context xlsx_context(Context.root());
|
||||
|
||||
xlsx_context.set_drawing_context_handle(Context.get_chart_drawing_handle());
|
||||
xlsx_context.set_mediaitems(Context.get_mediaitems());
|
||||
|
||||
xlsx_context.get_table_context().start_table(L"", L"", 0);
|
||||
|
||||
for (size_t i = 0; i < content_.size(); ++i)
|
||||
{
|
||||
xlsx_context.get_drawing_context().set_rel_anchor(drawing->cx, drawing->cy);
|
||||
content_[i]->xlsx_convert(xlsx_context);
|
||||
}
|
||||
xlsx_context.get_table_context().end_table();
|
||||
|
||||
xlsx_context.get_drawing_context().process_objects(xlsx_context.get_table_metrics());
|
||||
|
||||
std::wstringstream strm;
|
||||
xlsx_context.get_drawing_context().serialize(strm, L"cdr");
|
||||
|
||||
const std::pair<std::wstring, std::wstring> drawingName =
|
||||
xlsx_context.get_drawing_context_handle()->add_drawing_xml(strm.str(), xlsx_context.get_drawing_context().get_drawings(), oox::typeChartUserShapes );
|
||||
|
||||
objectBuild.userShapes = drawingName;
|
||||
}
|
||||
|
||||
objectBuild.docx_convert(Context);
|
||||
|
||||
frame = Context.get_drawing_context().get_current_frame(); //owner
|
||||
if (frame)
|
||||
drawing = dynamic_cast<oox::_docx_drawing *>(frame->oox_drawing_.get());
|
||||
}
|
||||
//------------------------------------------------------------------------------------------------------------
|
||||
if (!frame || !drawing)
|
||||
@ -1582,7 +1635,7 @@ void draw_object::docx_convert(oox::docx_conversion_context & Context)
|
||||
drawing->type = oox::typeChart;
|
||||
|
||||
bool isMediaInternal = true;
|
||||
drawing->objectId = Context.get_mediaitems().add_or_find(href, drawing->type, isMediaInternal, href);
|
||||
drawing->objectId = Context.get_mediaitems()->add_or_find(href, drawing->type, isMediaInternal, href);
|
||||
}
|
||||
else if (objectBuild.object_type_ == 2 ) //embedded text
|
||||
{
|
||||
@ -1641,7 +1694,7 @@ void draw_object::docx_convert(oox::docx_conversion_context & Context)
|
||||
bool isMediaInternal = true;
|
||||
|
||||
href += FILE_SEPARATOR_STR + href_new;
|
||||
drawing->objectId = Context.get_mediaitems().add_or_find(href, drawing->type, isMediaInternal, href);
|
||||
drawing->objectId = Context.get_mediaitems()->add_or_find(href, drawing->type, isMediaInternal, href);
|
||||
drawing->objectProgId = L"Excel.Sheet.12";
|
||||
}
|
||||
}
|
||||
@ -1682,7 +1735,7 @@ void draw_object_ole::docx_convert(oox::docx_conversion_context & Context)
|
||||
NSFile::CFileBinary::Copy(objectPath, objectPath + extension);
|
||||
|
||||
bool isMediaInternal = true;
|
||||
drawing->objectId = Context.get_mediaitems().add_or_find(href + extension, drawing->type, isMediaInternal, href);
|
||||
drawing->objectId = Context.get_mediaitems()->add_or_find(href + extension, drawing->type, isMediaInternal, href);
|
||||
|
||||
}
|
||||
void draw_control::docx_convert(oox::docx_conversion_context & Context)
|
||||
|
||||
@ -145,8 +145,11 @@ void draw_frame::pptx_convert(oox::pptx_conversion_context & Context)
|
||||
{
|
||||
style_instance * defaultStyle = Context.root()->odf_context().styleContainer().style_default_by_type(odf_types::style_family::Presentation);
|
||||
if (defaultStyle)instances.push_back(defaultStyle);
|
||||
|
||||
instances.push_back(baseStyleInst);
|
||||
instances.push_back(baseStyleInst);
|
||||
}
|
||||
else if (common_presentation_attlist_.presentation_class_)
|
||||
{
|
||||
instances.push_back(baseStyleInst);
|
||||
}
|
||||
if (grStyleInst)//обычная векторная фигура
|
||||
{
|
||||
@ -300,7 +303,7 @@ void draw_object::pptx_convert(oox::pptx_conversion_context & Context)
|
||||
NSDirectory::CreateDirectory(href_folder);
|
||||
outputXlsx.write(href_folder);
|
||||
|
||||
std::wstring href = L"Microsoft_Excel_Worksheet_" + std::to_wstring(Context.get_mediaitems().count_object + 1) + L".xlsx";
|
||||
std::wstring href = L"Microsoft_Excel_Worksheet_" + std::to_wstring(Context.get_mediaitems()->count_object + 1) + L".xlsx";
|
||||
|
||||
COfficeUtils oCOfficeUtils(NULL);
|
||||
if (S_OK == oCOfficeUtils.CompressFileOrDirectory(href_folder, odfPath + FILE_SEPARATOR_STR + href, true))
|
||||
|
||||
@ -102,7 +102,7 @@ void draw_shape::common_docx_convert(oox::docx_conversion_context & Context)
|
||||
if ((fill.bitmap) && (fill.bitmap->rId.empty()))
|
||||
{
|
||||
std::wstring href = fill.bitmap->xlink_href_;
|
||||
fill.bitmap->rId = Context.get_mediaitems().add_or_find(href, oox::typeImage, fill.bitmap->isInternal, href);
|
||||
fill.bitmap->rId = Context.get_mediaitems()->add_or_find(href, oox::typeImage, fill.bitmap->isInternal, href);
|
||||
fill.bitmap->name_space = L"w14";
|
||||
}
|
||||
|
||||
|
||||
@ -399,7 +399,7 @@ void draw_control::xlsx_convert(oox::xlsx_conversion_context & Context)
|
||||
if (state.ctrlPropId.empty())
|
||||
{
|
||||
std::wstring target;
|
||||
state.ctrlPropId = Context.get_mediaitems().add_control_props(target);
|
||||
state.ctrlPropId = Context.get_mediaitems()->add_control_props(target);
|
||||
|
||||
std::wstringstream strm;
|
||||
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
@ -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:
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
|
||||
@ -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_;
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
@ -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() {}
|
||||
|
||||
@ -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_;
|
||||
|
||||
@ -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_;
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
@ -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() {}
|
||||
|
||||
|
||||
@ -57,6 +57,7 @@ namespace odf_reader {
|
||||
style_instance::style_instance(
|
||||
styles_container *Container,
|
||||
const std::wstring &Name,
|
||||
const std::wstring &DisplayName,
|
||||
style_family::type Type,
|
||||
style_content *Content,
|
||||
bool IsAutomatic,
|
||||
@ -68,6 +69,7 @@ style_instance::style_instance(
|
||||
) :
|
||||
container_ (Container),
|
||||
name_ (Name),
|
||||
display_name_ (DisplayName),
|
||||
style_type_ (Type),
|
||||
content_ (Content),
|
||||
is_automatic_ (IsAutomatic),
|
||||
@ -110,7 +112,7 @@ void styles_container::add_style( const std::wstring & Name,
|
||||
{
|
||||
ParentStyleName = L"";//иначе в коде возможно зацикливание.
|
||||
}
|
||||
style_instance_ptr newStyle = style_instance_ptr( new style_instance(this, Name, Type, Content, IsAutomatic, IsDefault,
|
||||
style_instance_ptr newStyle = style_instance_ptr( new style_instance(this, Name, DisplayName, Type, Content, IsAutomatic, IsDefault,
|
||||
ParentStyleName, NextStyleName, DataStyleName, StyleClass));
|
||||
|
||||
instances_.push_back(newStyle);
|
||||
@ -143,7 +145,10 @@ const std::wstring & style_instance::name() const
|
||||
{
|
||||
return name_;
|
||||
}
|
||||
|
||||
const std::wstring & style_instance::display_name() const
|
||||
{
|
||||
return display_name_;
|
||||
}
|
||||
style_family::type style_instance::type() const
|
||||
{
|
||||
return style_type_;
|
||||
@ -518,11 +523,7 @@ const std::wstring & font_instance::style_name() const
|
||||
|
||||
const std::wstring & font_instance::name() const
|
||||
{
|
||||
static const std::wstring Symbol = L"Symbol";
|
||||
if (name_ == L"StarSymbol")
|
||||
return Symbol;
|
||||
else
|
||||
return name_;
|
||||
return name_;
|
||||
}
|
||||
|
||||
const std::wstring & font_instance::charset() const
|
||||
|
||||
@ -61,6 +61,7 @@ public:
|
||||
style_instance(
|
||||
styles_container * Container,
|
||||
const std::wstring & Name,
|
||||
const std::wstring & DisplayName,
|
||||
odf_types::style_family::type Type,
|
||||
style_content * Content,
|
||||
bool IsAutomatic,
|
||||
@ -71,8 +72,8 @@ public:
|
||||
const std::wstring & StyleClass
|
||||
);
|
||||
|
||||
|
||||
const std::wstring & name() const;
|
||||
const std::wstring & display_name()const;
|
||||
const std::wstring & name() const;
|
||||
odf_types::style_family::type type() const;
|
||||
style_content * content() const;
|
||||
style_instance * parent() const;
|
||||
@ -88,7 +89,10 @@ public:
|
||||
|
||||
private:
|
||||
styles_container * container_;
|
||||
|
||||
std::wstring name_;
|
||||
std::wstring display_name_;
|
||||
|
||||
odf_types::style_family::type style_type_;
|
||||
style_content * content_;
|
||||
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
@ -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:
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
@ -126,7 +126,7 @@ void office_body::docx_convert(oox::docx_conversion_context & Context)
|
||||
if ((fill.bitmap) && (fill.bitmap->rId.empty()))
|
||||
{
|
||||
std::wstring href = fill.bitmap->xlink_href_;
|
||||
fill.bitmap->rId = Context.get_mediaitems().add_or_find(href, oox::typeImage, fill.bitmap->isInternal, href);
|
||||
fill.bitmap->rId = Context.get_mediaitems()->add_or_find(href, oox::typeImage, fill.bitmap->isInternal, href);
|
||||
}
|
||||
int id = Context.get_drawing_context().get_current_shape_id();
|
||||
if (layout_properties->docx_background_serialize(Context.output_stream(), Context, fill, id))
|
||||
|
||||
@ -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();
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user