Compare commits

...

14 Commits

41 changed files with 671 additions and 289 deletions

View File

@ -41,23 +41,20 @@ namespace DocFileFormat
GeometryBooleanProperties(unsigned int op)
{
fFillOK = FormatUtils::BitmaskToBool (op, 0x1);
fFillShadeShapeOK = FormatUtils::BitmaskToBool (op, 0x2);
fGtextOK = FormatUtils::BitmaskToBool (op, 0x4);
fLineOK = FormatUtils::BitmaskToBool (op, 0x8);
f3DOK = FormatUtils::BitmaskToBool (op, 0x10);
fShadowOK = FormatUtils::BitmaskToBool (op, 0x20);
fUsefFillOK = FormatUtils::BitmaskToBool (op, 0x10000);
fUsefFillShadeShapeOK = FormatUtils::BitmaskToBool (op, 0x20000);
fUsefGtextOK = FormatUtils::BitmaskToBool (op, 0x40000);
fUsefLineOK = FormatUtils::BitmaskToBool (op, 0x80000);
fUsef3DOK = FormatUtils::BitmaskToBool (op, 0x100000);
fUsefShadowOK = FormatUtils::BitmaskToBool (op, 0x200000);
fUsefShadowOK = GETBIT(op, 8);
fUsef3DOK = GETBIT(op, 9);
fUsefLineOK = GETBIT(op, 10);
fUsefGtextOK = GETBIT(op, 11);
fUsefFillShadeShapeOK = GETBIT(op, 12);
fUsefFillOK = GETBIT(op, 13);
fShadowOK = GETBIT(op, 22);
f3DOK = GETBIT(op, 23);
fLineOK = GETBIT(op, 24);
fGtextOK = GETBIT(op, 25);
fFillShadeShapeOK = GETBIT(op, 26);
fFillOK = GETBIT(op, 27);
}
public:
bool fFillOK;
bool fFillShadeShapeOK;
bool fGtextOK;

View File

@ -53,7 +53,6 @@ namespace DocFileFormat
PathParser (const unsigned char* pSegmentInfo, unsigned int pSegmentInfoSize, const unsigned char* pVertices, unsigned int pVerticesSize, std::vector<_guides> & guides)
{
int offset = 6;
if ((pSegmentInfo != NULL) && (pSegmentInfoSize > 0))
{
@ -63,6 +62,7 @@ namespace DocFileFormat
unsigned short cbElement = 4;
int offset = 6;
if (cb == 0xfff0)
cbElement = 2;
@ -86,24 +86,27 @@ namespace DocFileFormat
unsigned short nElemsAlloc = FormatUtils::BytesToUInt16(pVertices, 2, pVerticesSize);
unsigned short cb = FormatUtils::BytesToUInt16(pVertices, 4, pVerticesSize);
unsigned short cbElement = cb;
unsigned short cbElement = 4;
if (cb == 0xfff0)
cbElement = 4;
cbElement = 2;
int offset = 6;
for (unsigned short i = 0; i < nElems; ++i)
{
POINT point;
if (cbElement == 4)
{
point.x = FormatUtils::BytesToInt16(pVertices + offset, (i * cbElement), pVerticesSize - offset);
point.y = FormatUtils::BytesToInt16(pVertices + offset, (i * cbElement) + (cbElement / 2), pVerticesSize - offset);
point.x = FormatUtils::BytesToInt32(pVertices + offset, 0, pVerticesSize - offset);
point.y = FormatUtils::BytesToInt32(pVertices + offset + cbElement, 0 , pVerticesSize - offset);
}
else
{
point.x = FormatUtils::BytesToInt32(pVertices + offset, (i * cbElement), pVerticesSize - offset);
point.y = FormatUtils::BytesToInt32(pVertices + offset, (i * cbElement) + (cbElement / 2), pVerticesSize - offset);
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)

View File

@ -71,7 +71,6 @@ namespace DocFileFormat
fUsefLockAgainstUngrouping = FormatUtils::BitmaskToBool(op,0x2000000);
}
public:
bool fLockAgainstGrouping;
bool fLockAdjustHandles;

View File

@ -49,15 +49,15 @@ namespace DocFileFormat
PropertyId_fFlipH=63,
//Protection
fLockAgainstUngrouping=118,
fLockRotation=119,
fLockAspectRatio=120,
fLockPosition=121,
fLockAgainstSelect=122,
fLockCropping=123,
fLockVertices=124,
fLockText=125,
fLockAdjustHandles=126,
//fLockAgainstUngrouping=118,
//fLockRotation=119,
//fLockAspectRatio=120,
//fLockPosition=121,
//fLockAgainstSelect=122,
//fLockCropping=123,
//fLockVertices=124,
//fLockText=125,
//fLockAdjustHandles=126,
protectionBooleans=127,
//Text
@ -75,10 +75,7 @@ namespace DocFileFormat
txdir=139,
ccol=140,
dzColMargin=141,
fSelectText=187,
fAutoTextMargin=188,
fRotateText=189,
fFitShapeToText=190,
textBooleanProperties=191,
//GeoText
@ -89,21 +86,21 @@ namespace DocFileFormat
gtextSpacing=196,
gtextFont=197,
gtextCSSFont=198,
gtextFReverseRows=240,
fGtext=241,
gtextFVertical=242,
gtextFKern=243,
gtextFTight=244,
gtextFStretch=245,
gtextFShrinkFit=246,
gtextFBestFit=247,
gtextFNormalize=248,
gtextFDxMeasure=249,
gtextFBold=250,
gtextFItalic=251,
gtextFUnderline=252,
gtextFShadow=253,
gtextFSmallcaps=254,
//gtextFReverseRows=240,
//fGtext=241,
//gtextFVertical=242,
//gtextFKern=243,
//gtextFTight=244,
//gtextFStretch=245,
//gtextFShrinkFit=246,
//gtextFBestFit=247,
//gtextFNormalize=248,
//gtextFDxMeasure=249,
//gtextFBold=250,
//gtextFItalic=251,
//gtextFUnderline=252,
//gtextFShadow=253,
//gtextFSmallcaps=254,
geometryTextBooleanProperties=255,
//BLIP
@ -128,10 +125,7 @@ namespace DocFileFormat
movie=274,
pictureRecolor=282,
picturePreserveGrays=313,
fRewind=314,
fLooping=315,
pictureGray=317,
pictureBiLevel=318,
blipBooleanProperties=319,
//Geometry
@ -161,12 +155,7 @@ namespace DocFileFormat
pInscribe=343,
cxk=344,
pFragments=345,
fColumnLineOK=377,
fShadowOK=378,
f3DOK=379,
fLineOK=380,
fGtextOK=381,
fFillShadeShapeOK=382,
geometryBooleans=383,
//Fill Style
@ -205,12 +194,6 @@ namespace DocFileFormat
fillBackColorExt=418,
fillBackColorExtMod=420,
fRecolorFillAsPicture=441,
fUseShapeAnchor=442,
fFilled=443,
fHitTestFill=444,
fillShape=445,
fillUseRect=446,
fillStyleBooleanProperties=447,
//Line Style
@ -238,12 +221,7 @@ namespace DocFileFormat
lineEndArrowLength=469,
lineJoinStyle=470,
lineEndCapStyle=471,
fInsetPen=505,
fInsetPenOK=506,
fArrowheadsOK=507,
fLine=508,
fHitTestLine=509,
lineFillShape=510,
lineStyleBooleans=511,
//Shadow Style
@ -265,7 +243,7 @@ namespace DocFileFormat
shadowWeight=527,
shadowOriginX=528,
shadowOriginY=529,
fShadow=574,
shadowStyleBooleanProperties=575,
//Perspective Style
@ -281,6 +259,7 @@ namespace DocFileFormat
perspectiveWeight=585,
perspectiveOriginX=586,
perspectiveOriginY=587,
perspectiveStyleBooleanProperties=639,
//3D Object
@ -293,9 +272,7 @@ namespace DocFileFormat
c3DExtrudePlane=646,
c3DExtrusionColor=647,
c3DCrMod=648,
f3D=700,
fc3DMetallic=701,
fc3DUseExtrusionColor=702,
threeDObjectBooleanProperties=703,
//3D Style
@ -326,10 +303,7 @@ namespace DocFileFormat
c3DFillY=728,
c3DFillZ=729,
c3DFillIntensity=730,
fc3DConstrainRotation=763,
fc3DRotationCenterAuto=764,
fc3DParallel=765,
fc3DKeyHarsh=766,
threeDStyleBooleanProperties=767,
//Shape
@ -343,14 +317,7 @@ namespace DocFileFormat
dgmNodeKind=778,
dgmLayoutMRU=779,
wzEquationXML=780,
fPolicyLabel=822,
fPolicyBarcode=823,
fFlipHQFE5152=824,
fFlipVQFE5152=825,
fPreferRelativeResize=827,
fLockShapeType=828,
fInitiator=829,
fDeleteAttachedObject=830,
shapeBooleans=831,
//Callout
@ -410,16 +377,9 @@ namespace DocFileFormat
wzAccessBlob=936,
metroBlob=937,
dhgt=938,
fLayoutInCell=944,
fIsBullet=945,
fStandardHR=946,
fNoshadeHR=947,
fHorizRule=948,
fUserDrawn=949,
fAllowOverlap=950,
fReallyHidden=951,
fScriptAnchor=952,
groupShapeBooleans = 959,
relRotation = 964,
//Unknown HTML
@ -622,7 +582,19 @@ namespace DocFileFormat
{
if (Options[i]->fComplex && Options[i]->op > 0)
{
Options[i]->opComplex = std::shared_ptr<unsigned char>(Reader->ReadBytes( Options[i]->op, true ));
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 ));
}
OptionsByID.insert(std::make_pair(Options[i]->pid, Options[i]));

View File

@ -0,0 +1,92 @@
/*
* (c) Copyright Ascensio System SIA 2010-2017
*
* 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 Lubanas st. 125a-25, Riga, Latvia,
* EU, LV-1021.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
#pragma once
namespace DocFileFormat
{
class ThreeDStyleBooleanProperties
{
public:
ThreeDStyleBooleanProperties(unsigned int op)
{
fUsefc3DConstrainRotation = GETBIT(op, 0);
fUsefc3DRotationCenterAuto = GETBIT(op, 1);
fUsefc3DParallel = GETBIT(op, 2);
fUsefc3DKeyHarsh = GETBIT(op, 3);
fUsefc3DFillHarsh = GETBIT(op, 4);
fc3DConstrainRotation = GETBIT(op, 16);
fc3DRotationCenterAuto = GETBIT(op, 17);
fc3DParallel = GETBIT(op, 18);
fc3DKeyHarsh = GETBIT(op, 19);
fc3DFillHarsh = GETBIT(op, 20);
}
bool fUsefc3DConstrainRotation;
bool fUsefc3DRotationCenterAuto;
bool fUsefc3DParallel;
bool fUsefc3DKeyHarsh;
bool fUsefc3DFillHarsh;
bool fc3DConstrainRotation;
bool fc3DRotationCenterAuto;
bool fc3DParallel;
bool fc3DKeyHarsh;
bool fc3DFillHarsh;
};
class ThreeDObjectBooleanProperties
{
public:
ThreeDObjectBooleanProperties(unsigned int op)
{
fUsef3D = GETBIT(op, 0);
fUsefc3DMetallic = GETBIT(op, 1);
fUsefc3DUseExtrusionColor = GETBIT(op, 2);
fUsefc3DLightFace = GETBIT(op, 3);
// 12 unused
f3D = GETBIT(op, 16);
fc3DMetallic = GETBIT(op, 17);
fc3DUseExtrusionColor = GETBIT(op, 18);
fc3DLightFace = GETBIT(op, 19);
}
bool fUsef3D;
bool fUsefc3DMetallic;
bool fUsefc3DUseExtrusionColor;
bool fUsefc3DLightFace;
bool f3D;
bool fc3DMetallic;
bool fc3DUseExtrusionColor;
bool fc3DLightFace;
};
}

View File

@ -66,25 +66,23 @@ namespace DocFileFormat
ole->Program = L"Word.Document";
}
m_pXmlWriter->WriteNodeBegin( L"o:OLEObject", TRUE );
int relID = -1;
if ( ole->bLinked )
{
int relID = m_context->_docx->RegisterExternalOLEObject(_caller, ole->ClipboardFormat, ole->Link);
relID = m_context->_docx->RegisterExternalOLEObject(_caller, ole->ClipboardFormat, ole->Link);
m_pXmlWriter->WriteAttribute( L"r:id", ( std::wstring( L"rId" ) + FormatUtils::IntToWideString( relID ) ));
m_pXmlWriter->WriteAttribute( L"Type", L"Link" );
m_pXmlWriter->WriteAttribute( L"UpdateMode", ole->UpdateMode);
}
else
{
int relID = -1;
{
if (ole->isEmbedded)
relID = m_context->_docx->RegisterPackage(_caller, ole->ClipboardFormat);
else
relID = m_context->_docx->RegisterOLEObject(_caller, ole->ClipboardFormat);
m_pXmlWriter->WriteAttribute( L"r:id", L"rId"+ FormatUtils::IntToWideString( relID ) );
m_pXmlWriter->WriteAttribute( L"Type", L"Embed" );
copyEmbeddedObject( ole );
@ -94,7 +92,8 @@ namespace DocFileFormat
m_pXmlWriter->WriteAttribute( L"ShapeID", _shapeId);
m_pXmlWriter->WriteAttribute( L"DrawAspect", L"Content" );
m_pXmlWriter->WriteAttribute( L"ObjectID", ole->ObjectId);
m_pXmlWriter->WriteNodeEnd( L"", TRUE, FALSE );
m_pXmlWriter->WriteAttribute( L"r:id", L"rId"+ FormatUtils::IntToWideString( relID ) );
m_pXmlWriter->WriteNodeEnd( L"", TRUE, FALSE );
m_pXmlWriter->WriteNodeEnd( L"o:OLEObject" );
}

View File

@ -165,15 +165,21 @@ namespace DocFileFormat
{
std::wstring path = L"ObjectPool/" + oleObjectFileStructure.objectID;
std::list<std::wstring> entries = storageInp->entries(path);
std::list<std::wstring> entries = storageInp->entries_with_prefix(path);
for (std::list<std::wstring>::iterator it = entries.begin(); it != entries.end(); ++it)
{
POLE::Stream *stream_inp = new POLE::Stream(storageInp, path + L"/"+ (*it));
std::wstring stream_name_open = (*it);
std::wstring stream_name_create = (*it);
if (stream_name_open[0] < 32)
stream_name_open = stream_name_open.substr(1);
POLE::Stream *stream_inp = new POLE::Stream(storageInp, path + L"/"+ stream_name_open);
if (stream_inp == NULL)continue;
POLE::uint64 size = stream_inp->size();
POLE::Stream *stream_out = new POLE::Stream(storageOut, *it, true, size);
POLE::Stream *stream_out = new POLE::Stream(storageOut, stream_name_create, true, size);
if (stream_out)
{

View File

@ -267,7 +267,6 @@ namespace DocFileFormat
}
m_pXmlWriter->WriteNodeBegin( L"v:shape", true );
m_pXmlWriter->WriteAttribute( L"type", std::wstring( L"#" + VMLShapeTypeMapping::GenerateTypeId(&type)));
count_vml_objects++;
@ -275,15 +274,9 @@ namespace DocFileFormat
m_shapeId = L"_x0000_s" + FormatUtils::IntToWideString(1024 + count_vml_objects);
m_pXmlWriter->WriteAttribute( L"id", m_shapeId);
m_pXmlWriter->WriteAttribute( L"type", std::wstring( L"#" + VMLShapeTypeMapping::GenerateTypeId(&type)));
if (m_isOlePreview)
{
m_pXmlWriter->WriteAttribute( L"o:ole", L"" );
}
else if (m_isBullete)
{
m_pXmlWriter->WriteAttribute( L"o:bullet", L"1" );
}
//todooo oбъединить с shape_mapping
for (size_t i = 0; i < options.size(); i++)
@ -423,6 +416,15 @@ namespace DocFileFormat
strStyle += L"width:" + strWidth + L"pt;" + L"height:" + strHeight + L"pt;";
m_pXmlWriter->WriteAttribute( L"style", strStyle);
if (m_isOlePreview)
{
m_pXmlWriter->WriteAttribute( L"o:ole", L"t" );
}
else if (m_isBullete)
{
m_pXmlWriter->WriteAttribute( L"o:bullet", L"1" );
}
m_pXmlWriter->WriteNodeEnd( L"", TRUE, FALSE );
if (CopyPicture(pict))

View File

@ -39,6 +39,7 @@
#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"
@ -277,10 +278,13 @@ namespace DocFileFormat
double ShadowOriginY = 0;
unsigned int xCoord = 0;
unsigned int yCoord = 0;
bool stroked = true;
bool filled = true;
bool bStroked = true;
bool bFilled = true;
bool hasTextbox = false;
bool layoutInCell = true; //anmeldebogenfos.doc
bool b3D = false;
bool bShadow = false;
int ndxTextLeft = -1;
int ndyTextTop = -1;
@ -292,16 +296,16 @@ namespace DocFileFormat
int nAdjValues = 0;
int nLTxID = -1;
std::wstring sTextboxStyle;
ShadowStyleBooleanProperties shadowBoolean(0);
std::wstring sTextboxStyle;
OptionEntryPtr opSegmentInfo;
OptionEntryPtr opVerticles;
OptionEntryPtr opInscribe;
OptionEntryPtr opConnectAngles;
OptionEntryPtr opConnectLocs;
ThreeDStyleBooleanProperties threeDStyleProps_(0);
for (size_t i = 0; i < options.size(); i++)
{
OptionEntryPtr & iter = options[i];
@ -313,12 +317,19 @@ namespace DocFileFormat
GeometryBooleanProperties booleans(iter->op);
if (booleans.fUsefLineOK && !booleans.fLineOK)
{
stroked = false;
bStroked = false;
}
if (booleans.fUsefFillOK && !booleans.fFillOK)
{
filled = false;
bFilled = false;
}
if (booleans.fUsef3DOK && booleans.f3DOK)
{
b3D = true;
}
if (booleans.fUsefShadowOK && booleans.fShadowOK)
{
bShadow = true;
}
}
break;
@ -327,7 +338,12 @@ namespace DocFileFormat
FillStyleBooleanProperties booleans(iter->op);
if (booleans.fUsefFilled && !booleans.fFilled)
{
filled = false;
bFilled = false;
}
if (booleans.fUsefUseShapeAnchor && booleans.fUseShapeAnchor)
{
appendValueAttribute(&m_fill, L"rotate", L"t");
}
}break;
case lineStyleBooleans:
@ -335,7 +351,7 @@ namespace DocFileFormat
LineStyleBooleanProperties booleans(iter->op);
if (booleans.fUsefLine && !booleans.fLine)
{
stroked = false;
bStroked = false;
}
}
break;
@ -536,6 +552,7 @@ namespace DocFileFormat
case fillFocus:
{
appendValueAttribute(&m_fill, L"focus", ( FormatUtils::IntToWideString( iter->op ) + L"%" ));
appendValueAttribute(&m_fill, L"focussize", L"");
}break;
case fillType:
{
@ -575,7 +592,7 @@ namespace DocFileFormat
break;
case fillBackOpacity:
{
appendValueAttribute(&m_fill, L"opacity2", (FormatUtils::IntToWideString(iter->op) + L"f"));
appendValueAttribute(&m_fill, L"o:opacity2", (FormatUtils::IntToWideString(iter->op) + L"f"));
}break;
// SHADOW
case shadowType:
@ -620,7 +637,8 @@ namespace DocFileFormat
}break;
case shadowStyleBooleanProperties:
{
shadowBoolean = ShadowStyleBooleanProperties(iter->op);
ShadowStyleBooleanProperties props(iter->op);
}break;
// OLE
case pictureId:
@ -649,11 +667,19 @@ namespace DocFileFormat
appendValueAttribute(&m_imagedata, L"o:title", FormatUtils::XmlEncode(name));
}break;
// 3D STYLE
case f3D:
case threeDStyleBooleanProperties:
{
threeDStyleProps_ = ThreeDStyleBooleanProperties(iter->op);
}break;
case threeDObjectBooleanProperties:
break;
{
ThreeDObjectBooleanProperties booleans(iter->op);
if (booleans.fUsef3D && !booleans.f3D) b3D = false;
}break;
case c3DRenderMode:
{
}break;
case c3DExtrudeBackward:
{
EmuValue backwardValue( (int)iter->op );
@ -686,28 +712,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() ));
}break;
case c3DXViewpoint:
if (threeDStyleProps_.fUsefc3DParallel && !threeDStyleProps_.fc3DParallel)
{
ViewPointX = EmuValue( FixedPointNumber( iter->op ).Integral );
}break;
case c3DYViewpoint:
{
if (threeDStyleProps_.fUsefc3DParallel && !threeDStyleProps_.fc3DParallel)
{
ViewPointY = EmuValue( FixedPointNumber( iter->op ).Integral );
}break;
case c3DZViewpoint:
if (threeDStyleProps_.fUsefc3DParallel && !threeDStyleProps_.fc3DParallel)
{
ViewPointZ = EmuValue( FixedPointNumber( iter->op ).Integral );
}break;
case c3DOriginX:
if (threeDStyleProps_.fUsefc3DParallel && !threeDStyleProps_.fc3DParallel)
{
FixedPointNumber dOriginX( iter->op );
viewPointOriginX = ( dOriginX.Integral / 65536.0 );
}break;
case c3DOriginY:
if (threeDStyleProps_.fUsefc3DParallel && !threeDStyleProps_.fc3DParallel)
{
FixedPointNumber dOriginY( iter->op );
viewPointOriginY = (dOriginY.Integral / 65536.0 );
@ -831,12 +863,12 @@ namespace DocFileFormat
xCoord = 21600;
yCoord = 21600;
}
if ( !filled )
if ( !bFilled )
{
m_pXmlWriter->WriteAttribute( L"filled", L"f" );
}
if ( !stroked )
if ( !bStroked )
{
m_pXmlWriter->WriteAttribute( L"stroked", L"f" );
}
@ -927,60 +959,59 @@ namespace DocFileFormat
// write shadow
if (m_shadow.GetAttributeCount() > 0)
{
if (shadowBoolean.fShadow)
{
appendValueAttribute(&m_shadow, L"on", L"t" );
}
appendValueAttribute(&m_shadow, L"on", bShadow ? L"t" : L"f" );
m_pXmlWriter->WriteString(m_shadow.GetXMLString());
}
//write the viewpoint
if ( ( ViewPointX != 0 ) || ( ViewPointY != 0 ) || ( ViewPointZ != 0 ) )
{
std::wstring viewPoint;
if ( ViewPointX != 0 )
{
viewPoint += FormatUtils::IntToWideString( ViewPointX ) + L"pt";
}
viewPoint += L",";
if ( ViewPointY != 0 )
{
viewPoint += FormatUtils::IntToWideString( ViewPointY ) + L"pt";
}
viewPoint += L",";
if ( ViewPointZ != 0 )
{
viewPoint += FormatUtils::IntToWideString( ViewPointZ ) + L"pt";
}
appendValueAttribute(&m_3dstyle, L"viewpoint", viewPoint);
}
// write the viewpointorigin
if ( ( viewPointOriginX != 0 ) || ( viewPointOriginY != 0 ) )
{
std::wstring viewPointOrigin;
if ( viewPointOriginX != 0 )
{
viewPointOrigin += FormatUtils::DoubleToFormattedWideString( viewPointOriginX, L"%.2f" );
}
if ( viewPointOriginY != 0 )
{
viewPointOrigin += L",";
viewPointOrigin += FormatUtils::DoubleToFormattedWideString( viewPointOriginY, L"%.2f" );
}
appendValueAttribute(&m_3dstyle, L"viewpointorigin", viewPointOrigin);
}
//write 3d style
if (m_3dstyle.GetAttributeCount() > 0)
{
appendValueAttribute(&m_3dstyle, L"v:ext", L"view" );
appendValueAttribute(&m_3dstyle, L"on", L"t" );
//write the viewpoint
if ( ( ViewPointX != 0 ) || ( ViewPointY != 0 ) || ( ViewPointZ != 0 ) )
if (b3D)
{
std::wstring viewPoint;
if ( ViewPointX != 0 )
{
viewPoint += FormatUtils::IntToWideString( ViewPointX ) + L"pt";
}
viewPoint += L",";
if ( ViewPointY != 0 )
{
viewPoint += FormatUtils::IntToWideString( ViewPointY ) + L"pt";
}
viewPoint += L",";
if ( ViewPointZ != 0 )
{
viewPoint += FormatUtils::IntToWideString( ViewPointZ ) + L"pt";
}
appendValueAttribute(&m_3dstyle, L"viewpoint", viewPoint);
appendValueAttribute(&m_3dstyle, L"v:ext", L"view" ); //??? вытащить
}
// write the viewpointorigin
if ( ( viewPointOriginX != 0 ) || ( viewPointOriginY != 0 ) )
{
std::wstring viewPointOrigin;
if ( viewPointOriginX != 0 )
{
viewPointOrigin += FormatUtils::DoubleToFormattedWideString( viewPointOriginX, L"%.2f" );
}
if ( viewPointOriginY != 0 )
{
viewPointOrigin += L",";
viewPointOrigin += FormatUtils::DoubleToFormattedWideString( viewPointOriginY, L"%.2f" );
}
appendValueAttribute(&m_3dstyle, L"viewpointorigin", viewPointOrigin);
}
appendValueAttribute(&m_3dstyle, L"on", b3D ? L"t" : L"f" );
m_pXmlWriter->WriteString(m_3dstyle.GetXMLString());
}
// write wrap

View File

@ -134,10 +134,11 @@ namespace DocFileFormat
// Path
m_pXmlWriter->WriteNodeBegin( L"v:path", true );
m_pXmlWriter->WriteAttribute( L"o:extrusionok", L"f");
if (_isInlineShape)
{
m_pXmlWriter->WriteAttribute( L"o:extrusionok", L"f");
m_pXmlWriter->WriteAttribute( L"gradientshapeok", L"t" );
m_pXmlWriter->WriteAttribute( L"o:connecttype", L"rect" );
}

View File

@ -235,6 +235,7 @@ HEADERS += \
../../DocDocxConverter/OfficeDrawing/RecordFactory.h \
../../DocDocxConverter/OfficeDrawing/RegularContainer.h \
../../DocDocxConverter/OfficeDrawing/ShadowStyleBooleanProperties.h \
../../DocDocxConverter/OfficeDrawing/threeDBooleanProperties.h \
../../DocDocxConverter/OfficeDrawing/Shape.h \
../../DocDocxConverter/OfficeDrawing/ShapeContainer.h \
../../DocDocxConverter/OfficeDrawing/ShapeOptions.h \

View File

@ -895,6 +895,10 @@
RelativePath="..\..\DocDocxConverter\OfficeDrawing\SplitMenuColorContainer.h"
>
</File>
<File
RelativePath="..\..\DocDocxConverter\OfficeDrawing\threeDBooleanProperties.h"
>
</File>
<File
RelativePath="..\..\DocDocxConverter\OfficeDrawing\UnknownRecord.h"
>

View File

@ -90,6 +90,11 @@ void odp_conversion_context::end_document()
{
odf_conversion_context::end_document();
}
size_t odp_conversion_context::get_pages_count()
{
return root_presentation_->pages_.size();
}
void odp_conversion_context::start_slide()
{
slide_context_.set_styles_context(styles_context());

View File

@ -52,6 +52,8 @@ public:
void start_slide();
void end_slide();
size_t get_pages_count();
void start_master_slide(std::wstring name);
void end_master_slide();

View File

@ -1329,8 +1329,17 @@ void PptxConverter::convert_slide(PPTX::Logic::CSld *oox_slide, PPTX::Logic::TxS
if (current_theme && current_clrMap)
current_theme->SetColorMap(*current_clrMap);
std::wstring page_name;
if (oox_slide->attrName.IsInit())
odp_context->current_slide().set_page_name(oox_slide->attrName.get());
page_name = oox_slide->attrName.get();
if (page_name.empty())
{
if (type == Slide)
page_name = L"Slide_" + std::to_wstring(odp_context->get_pages_count());
}
odp_context->current_slide().set_page_name(page_name);
if (type != Notes && type != NotesMaster)
{

View File

@ -486,14 +486,14 @@ namespace PPTX
pReader->Seek(_end_rec);
}
public:
nullable<PrstTxWarp> prstTxWarp;
TextFit Fit;
nullable<Scene3d> scene3d;
nullable_int flatTx;
nullable<Sp3d> sp3d;
// Attributes
// Attributes
nullable_limit<Limit::TextAnchor> anchor;
nullable_bool anchorCtr;
nullable_int bIns;
@ -513,9 +513,8 @@ namespace PPTX
nullable_limit<Limit::TextVerticalType> vert;
nullable_limit<Limit::VertOverflow> vertOverflow;
nullable_limit<Limit::TextWrap> wrap;
//private:
public:
mutable std::wstring m_namespace;
mutable std::wstring m_namespace;
protected:
virtual void FillParentPointersForChilds()
{

View File

@ -57,7 +57,7 @@ namespace PPTX
while( oReader.ReadNextSiblingNode( nCurDepth ) )
{
std::wstring sName = oReader.GetName();
Color.fromXML(oReader);
}
}
virtual OOX::EElementType getType () const

View File

@ -162,7 +162,17 @@ namespace PPTX
else if(parentFileIs<TableStyles>())
RGB = parentFileAs<TableStyles>().GetARGBFromMap(str);
else if(parentFileIs<Theme>())
RGB = parentFileAs<Theme>().GetARGBFromMap(str);
{
Theme & theme = parentFileAs<Theme>();
if (theme.isMapPresent())
{
RGB = parentFileAs<Theme>().GetARGBFromMap(str);
}
else
{
RGB = parentFileAs<Theme>().GetABGRFromScheme(str);
}
}
else if(parentFileIs<Presentation>())
RGB = parentFileAs<Presentation>().GetARGBFromMap(str);
//{

View File

@ -40,7 +40,6 @@ namespace PPTX
{
namespace Logic
{
class SolidFill : public WrapperWritingElement
{
public:
@ -127,10 +126,8 @@ namespace PPTX
if(Color.is_init())
fill.Color = Color;
}
public:
UniColor Color;
std::wstring m_namespace;
UniColor Color;
std::wstring m_namespace;
protected:
virtual void FillParentPointersForChilds()
{

View File

@ -140,14 +140,11 @@ namespace PPTX
pReader->Seek(_end_rec);
}
UniColor Color;
nullable_limit<Limit::FontStyleIndex> idx;
public:
UniColor Color;
// Attributes
nullable_limit<Limit::FontStyleIndex> idx;
//private:
public:
std::wstring m_name;
std::wstring m_name;
protected:
virtual void FillParentPointersForChilds()
{

View File

@ -120,7 +120,7 @@ namespace PPTX
std::wstring strName = XmlUtils::GetNameNoNS(oReader.GetName());
std::wstring strNamespace = XmlUtils::GetNamespace(oReader.GetName());
if (L"xfrm" == strName && strNamespace != L"xdr")
if (L"xfrm" == strName)
xfrm = oReader;
else if (L"cNvGraphicFramePr" == strName)
nvGraphicFramePr.cNvGraphicFramePr.fromXML( oReader );
@ -320,7 +320,7 @@ namespace PPTX
std::wstring strName = XmlUtils::GetNameNoNS(oNode.GetName());
std::wstring strNamespace = XmlUtils::GetNamespace(oNode.GetName());
if (L"xfrm" == strName && strNamespace != L"xdr")
if (L"xfrm" == strName)
xfrm = oNode;
else if (L"nvGraphicFramePr" == strName)
nvGraphicFramePr = oNode;

View File

@ -324,15 +324,18 @@ namespace PPTX
}
DWORD GetARGBFromMap(const std::wstring& str)const
{
return GetARGBFromScheme(m_map->GetColorSchemeIndex(str));
if (m_map) return GetARGBFromScheme(m_map->GetColorSchemeIndex(str));
else return 0;
}
DWORD GetBGRAFromMap(const std::wstring& str)const
{
return GetBGRAFromScheme(m_map->GetColorSchemeIndex(str));
if (m_map) return GetBGRAFromScheme(m_map->GetColorSchemeIndex(str));
else return 0;
}
DWORD GetABGRFromMap(const std::wstring& str)const
{
return GetABGRFromScheme(m_map->GetColorSchemeIndex(str));
if (m_map) return GetABGRFromScheme(m_map->GetColorSchemeIndex(str));
else return 0;
}
void GetLineStyle(int number, Logic::Ln& lnStyle)const
{
@ -357,6 +360,7 @@ namespace PPTX
void SetColorMap(const Logic::ClrMap& map){m_map = &map;};
bool isMapPresent() {return (m_map != NULL);}
private:
Logic::ClrMap const* m_map;
};

View File

@ -1926,6 +1926,9 @@ void RtfShapeReader::ShapePropertyReader::ShapePropertyValueReader::PopState( Rt
else if ( L"posrelv" == m_sPropName ) m_oShape.m_nPositionVRelative = nValue;
else if ( L"fLayoutInCell" == m_sPropName ) m_oShape.m_bLayoutInCell = nValue;
else if ( L"fAllowOverlap" == m_sPropName ) m_oShape.m_bAllowOverlap = nValue;
else if ( L"fLockPosition" == m_sPropName ) m_oShape.m_nLockPosition = nValue;
else if ( L"fLockRotation" == m_sPropName ) m_oShape.m_nLockRotation = nValue;
//Position relative
else if ( L"pctHorizPos" == m_sPropName ) m_oShape.m_nPositionHPct = nValue;
else if ( L"pctVertPos" == m_sPropName ) m_oShape.m_nPositionVPct = nValue;
@ -2032,6 +2035,12 @@ void RtfShapeReader::ShapePropertyReader::ShapePropertyValueReader::PopState( Rt
else if ( L"dxTextRight" == m_sPropName ) m_oShape.m_nTexpRight = nValue;
else if ( L"dyTextBottom" == m_sPropName ) m_oShape.m_nTexpBottom = nValue;
else if ( L"anchorText" == m_sPropName ) m_oShape.m_nAnchorText = nValue;
else if ( L"WrapText" == m_sPropName ) m_oShape.m_nWrapText = nValue;
else if ( L"txflTextFlow" == m_sPropName ) m_oShape.m_nTxflTextFlow = nValue;
else if ( L"ccol" == m_sPropName ) m_oShape.m_nCcol = nValue;
else if ( L"txdir" == m_sPropName ) m_oShape.m_nTxdir = nValue;
else if ( L"fFitShapeToText"== m_sPropName ) m_oShape.m_bFitShapeToText = nValue;
else if ( L"fFitTextToShape"== m_sPropName ) m_oShape.m_bFitTextToShape = nValue;
//Geometry
else if ( L"adjustValue" == m_sPropName ) m_oShape.m_nAdjustValue[0] = nValue;

View File

@ -1427,7 +1427,7 @@ bool OOXrPrReader::Parse( ReaderParameter oParam, RtfCharProperty& oOutputProper
if (m_ooxRunProps->m_oPosition.IsInit() && m_ooxRunProps->m_oPosition->m_oVal.IsInit())
{
int nValue = m_ooxRunProps->m_oPosition->m_oVal->ToTwips();
int nValue = m_ooxRunProps->m_oPosition->m_oVal->ToTwips() / 10;
if( nValue >= 0 )
oOutputProperty.m_nUp = nValue;
else
@ -1518,7 +1518,32 @@ bool OOXrPrReader::Parse( ReaderParameter oParam, RtfCharProperty& oOutputProper
m_ooxRunProps->m_oHighlight->m_oVal->Get_G(),
m_ooxRunProps->m_oHighlight->m_oVal->Get_B()));
}
if( m_ooxRunProps->m_oColor.IsInit() )
if ( m_ooxRunProps->m_oTextOutline.IsInit())
{
if (m_ooxRunProps->m_oTextOutline->Fill.m_type == PPTX::Logic::UniFill::noFill )
{
oOutputProperty.m_nForeColor = 0xffffff; //white
}
else if (m_ooxRunProps->m_oTextOutline->Fill.m_type == PPTX::Logic::UniFill::solidFill )
{
NSCommon::smart_ptr<PPTX::Logic::SolidFill> fill = m_ooxRunProps->m_oTextOutline->Fill.Fill.smart_dynamic_cast<PPTX::Logic::SolidFill>();
unsigned int nColor = 0; //black
_CP_OPT(double) opacity;
OOXShapeReader::Parse(oParam, fill->Color.Color.operator ->(), nColor, opacity);
oOutputProperty.m_nForeColor = nColor;
}
if (oOutputProperty.m_nForeColor != PROP_DEF)
{
RtfColor rtfColor;
rtfColor.SetRGB(oOutputProperty.m_nForeColor);
oOutputProperty.m_nForeColor = oParam.oRtf->m_oColorTable.AddItem(rtfColor);
}
}
else if( m_ooxRunProps->m_oColor.IsInit() )
{
OOXColorReader oColorReader;
RtfColor oColor;
@ -1965,14 +1990,22 @@ bool OOXSectionPropertyReader::Parse( ReaderParameter oParam , RtfSectionPropert
}
if( m_ooxSectionProperty->m_oCols.IsInit() )
{
if(m_ooxSectionProperty->m_oCols->m_oNum.IsInit())
oOutput.m_nColumnNumber = m_ooxSectionProperty->m_oCols->m_oNum->GetValue();
else
oOutput.m_nColumnNumber = 1;
if (!m_ooxSectionProperty->m_oCols->m_arrColumns.empty())
{
oOutput.m_nColumnNumber = m_ooxSectionProperty->m_oCols->m_arrColumns.size();
}
if(m_ooxSectionProperty->m_oCols->m_oNum.IsInit())
{
oOutput.m_nColumnNumber = m_ooxSectionProperty->m_oCols->m_oNum->GetValue();
}
if(m_ooxSectionProperty->m_oCols->m_oSpace.IsInit())
oOutput.m_nColumnSpace = m_ooxSectionProperty->m_oCols->m_oSpace->ToTwips(); //todooo twips????
if (m_ooxSectionProperty->m_oCols->m_oSep.IsInit())
oOutput.m_bColumnLineBetween = m_ooxSectionProperty->m_oCols->m_oSep->ToBool();
for (size_t i = 0; i < m_ooxSectionProperty->m_oCols->m_arrColumns.size(); i++ )
{
RtfSectionProperty::ColumnProperty::CollumnVar oNewColumn;

View File

@ -287,16 +287,16 @@ public:
if (m_ooxAnchor->m_oWrapTight->m_oWrapPolygon->m_oStart.IsInit())
{
nValueX = m_ooxAnchor->m_oWrapTight->m_oWrapPolygon->m_oStart->m_oX.ToTwips();
nValueY = m_ooxAnchor->m_oWrapTight->m_oWrapPolygon->m_oStart->m_oY.ToTwips();
nValueX = m_ooxAnchor->m_oWrapTight->m_oWrapPolygon->m_oStart->m_oX.ToEmu();
nValueY = m_ooxAnchor->m_oWrapTight->m_oWrapPolygon->m_oStart->m_oY.ToEmu();
pOutput->m_aWrapPoints.push_back( std::pair<int,int>(nValueX, nValueY) );
}
for (size_t i = 0; i < m_ooxAnchor->m_oWrapTight->m_oWrapPolygon->m_arrLineTo.size(); i++ )
{
nValueX = m_ooxAnchor->m_oWrapTight->m_oWrapPolygon->m_arrLineTo[i]->m_oX.ToTwips();
nValueY = m_ooxAnchor->m_oWrapTight->m_oWrapPolygon->m_arrLineTo[i]->m_oY.ToTwips();
nValueX = m_ooxAnchor->m_oWrapTight->m_oWrapPolygon->m_arrLineTo[i]->m_oX.ToEmu();
nValueY = m_ooxAnchor->m_oWrapTight->m_oWrapPolygon->m_arrLineTo[i]->m_oY.ToEmu();
pOutput->m_aWrapPoints.push_back( std::pair<int,int>(nValueX, nValueY) );
}

View File

@ -51,7 +51,7 @@ public:
pOutput->m_nTop = 0;
pOutput->m_nPositionHRelative = 3;
pOutput->m_nPositionVRelative = 3;
int nDistLeft = m_ooxInline->m_oDistL.IsInit() ? (int)m_ooxInline->m_oDistL->ToTwips() : PROP_DEF;
int nDistTop = m_ooxInline->m_oDistT.IsInit() ? (int)m_ooxInline->m_oDistT->ToTwips() : PROP_DEF;
int nDistRight = m_ooxInline->m_oDistR.IsInit() ? (int)m_ooxInline->m_oDistR->ToTwips() : PROP_DEF;

View File

@ -648,11 +648,13 @@ void OOXShapeReader::Parse(ReaderParameter oParam, PPTX::Logic::ColorBase *oox_c
{
if (!oox_color) return;
oox_color->SetParentFilePointer(oParam.oDocx->m_pTheme);
nColor = oox_color->GetARGB(0);
BYTE alpha = nColor >> 24;
if (alpha != 0xff)
opacity = alpha;
nColor = nColor & 0xff000000;
nColor = nColor & 0x00ffffff;
//switch( oox_color->m_eType )
//{
// case OOX::Drawing::colorSheme: Parse(oParam, &oox_color->m_oShemeClr, nColor, opacity); break;
@ -698,7 +700,10 @@ void OOXShapeReader::Parse(ReaderParameter oParam, RtfShapePtr& pOutput, PPTX::L
if (change_sheme_color && oox_solid_fill->Color.getType() == OOX::et_a_schemeClr)
{
//oox_solid_fill->m_oShemeClr.m_oVal.FromString(*change_sheme_color);
PPTX::Logic::SchemeClr *pSchemeColor = new PPTX::Logic::SchemeClr();
pSchemeColor->val.set(*change_sheme_color);
oox_solid_fill->Color.Color.reset(pSchemeColor);
}
Parse(oParam, oox_solid_fill, nColor, opacity);
@ -910,21 +915,29 @@ void OOXShapeReader::Parse(ReaderParameter oParam, RtfShapePtr& pOutput, PPTX::L
{
NSCommon::smart_ptr<PPTX::Logic::SolidFill> fill = oox_line_prop->Fill.Fill.smart_dynamic_cast<PPTX::Logic::SolidFill>();
NSCommon::smart_ptr<PPTX::Logic::NoFill> no_fill = oox_line_prop->Fill.Fill.smart_dynamic_cast<PPTX::Logic::NoFill>();
if (fill.IsInit())
if (no_fill.IsInit())
{
pOutput->m_bLine = false;
}
else if (fill.IsInit())
{
if (change_sheme_color && fill->Color.getType() == OOX::et_a_schemeClr)
{
//fill->Color.FromString(*change_sheme_color);
}
PPTX::Logic::SchemeClr *pSchemeColor = new PPTX::Logic::SchemeClr();
pSchemeColor->val.set(*change_sheme_color);
fill->Color.Color.reset(pSchemeColor);
}
unsigned int nColor = 0; //black
_CP_OPT(double) opacity;
Parse(oParam, fill.operator->(), nColor, opacity);
pOutput->m_nLineColor = nColor;
}
else if (no_fill.IsInit())
else
{
pOutput->m_bLine = false;
}
}
if (oox_line_prop->w.IsInit())
@ -1061,15 +1074,26 @@ bool OOXShapeReader::ParseShape( ReaderParameter oParam, RtfShapePtr& pOutput)
PPTX::Logic::Shape * ooxShape = dynamic_cast<PPTX::Logic::Shape*> (m_ooxShape);
if (!ooxShape) return false;
PPTX::Logic::BodyPr *text_properties = NULL;
if (ooxShape->oTextBoxBodyPr.IsInit())
if (ooxShape->oTextBoxShape.IsInit())
{
if (ooxShape->oTextBoxBodyPr->fromWordArt.get_value_or(false))
text_properties = ooxShape->oTextBoxBodyPr.GetPointer();
}
if (ooxShape->txBody.IsInit())
{
text_properties = ooxShape->txBody->bodyPr.GetPointer();
}
if (text_properties)
{
if (text_properties->fromWordArt.get_value_or(false))
{
pOutput->m_bGtext = 1;
if (ooxShape->oTextBoxBodyPr->prstTxWarp.IsInit())
if (text_properties->prstTxWarp.IsInit())
{
SimpleTypes::ETextShapeType type = (SimpleTypes::ETextShapeType)ooxShape->oTextBoxBodyPr->prstTxWarp->prst.GetBYTECode();
SimpleTypes::ETextShapeType type = (SimpleTypes::ETextShapeType)text_properties->prstTxWarp->prst.GetBYTECode();
pOutput->m_nShapeType = OOX::PrstTx2VmlShapeType(type);
}
@ -1164,9 +1188,50 @@ bool OOXShapeReader::ParseShape( ReaderParameter oParam, RtfShapePtr& pOutput)
Parse(oParam, pOutput, ooxShape->spPr.ln.GetPointer());
}
//---------------------------------------------------------------------
PPTX::Logic::TxBody * text_properties = NULL;
OOXTextItemReader oTextItemReader;
RtfCharProperty old = oParam.oRtf->m_oDefaultCharProp;
if ((oox_sp_style) && (oox_sp_style->fontRef.idx.IsInit()))
{
std::wstring font_name;
if (oox_sp_style->fontRef.idx->GetBYTECode() == 0)
{
font_name = oParam.oDocx->m_pTheme->themeElements.fontScheme.majorFont.latin.typeface;
}
else if (oox_sp_style->fontRef.idx->GetBYTECode() == 1)
{
font_name = oParam.oDocx->m_pTheme->themeElements.fontScheme.minorFont.latin.typeface;
}
if (!font_name.empty())
{
RtfFont oCurFont;
if( true == oParam.oRtf->m_oFontTable.GetFont( font_name, oCurFont ) )
{
oParam.oRtf->m_oDefaultCharProp.m_nFont = oCurFont.m_nID;
}
else
{
oCurFont.m_sName = font_name;
oCurFont.m_nID = oParam.oRtf->m_oDefaultCharProp.m_nFont = oParam.oRtf->m_oFontTable.GetCount() + 1;
oParam.oRtf->m_oFontTable.AddItem( oCurFont );
}
}
if (oox_sp_style->fontRef.Color.is_init())
{
unsigned int nColor = 0; //black
_CP_OPT(double) opacity;
OOXShapeReader::Parse(oParam, oox_sp_style->fontRef.Color.Color.operator ->(), nColor, opacity);
RtfColor rtfColor;
rtfColor.SetRGB(nColor);
oParam.oRtf->m_oDefaultCharProp.m_nForeColor = oParam.oRtf->m_oColorTable.AddItem(rtfColor);
}
}
Parse(oParam, pOutput, text_properties);
if (ooxShape->txBody.IsInit())
{
for (size_t i=0; i < ooxShape->txBody->Paragrs.size(); i++)
@ -1174,7 +1239,13 @@ bool OOXShapeReader::ParseShape( ReaderParameter oParam, RtfShapePtr& pOutput)
oTextItemReader.Parse(&ooxShape->txBody->Paragrs[i], oParam );
}
text_properties = ooxShape->txBody.GetPointer();
}
else if (ooxShape->oTextBoxShape.IsInit())
{
for (size_t i=0; i < ooxShape->oTextBoxShape->m_arrItems.size(); i++)
{
oTextItemReader.Parse(ooxShape->oTextBoxShape->m_arrItems[i], oParam );
}
}
if (oTextItemReader.m_oTextItems)
@ -1190,13 +1261,66 @@ bool OOXShapeReader::ParseShape( ReaderParameter oParam, RtfShapePtr& pOutput)
{
pOutput->m_aTextItems = oTextItemReader.m_oTextItems;
}
}
if (text_properties)
oParam.oRtf->m_oDefaultCharProp = old;
return true;
}
void OOXShapeReader::Parse(ReaderParameter oParam, RtfShapePtr& pOutput, PPTX::Logic::BodyPr *text_props)
{
if (!text_props) return;
if (text_props->lIns.IsInit()) pOutput->m_nTexpLeft = *text_props->lIns;
if (text_props->tIns.IsInit()) pOutput->m_nTexpTop = *text_props->tIns;
if (text_props->rIns.IsInit()) pOutput->m_nTexpRight = *text_props->rIns;
if (text_props->bIns.IsInit()) pOutput->m_nTexpBottom = *text_props->bIns;
if (text_props->anchor.IsInit())
{
switch(text_props->anchor->GetBYTECode())
{
case 0: pOutput->m_nAnchorText = 2; break;
case 4: pOutput->m_nAnchorText = 0; break;
case 1:
case 2:
case 3:
default:
pOutput->m_nAnchorText = 4; break;
}
}
return true;
if (text_props->rtlCol.IsInit())
pOutput->m_nTxdir = *text_props->rtlCol;
if (text_props->numCol.IsInit())
pOutput->m_nCcol = *text_props->numCol;
switch(text_props->Fit.type)
{
case 2: pOutput->m_bFitShapeToText = 1; break;
case 3: pOutput->m_bFitTextToShape = 1; break;
default:
break;
}
if (text_props->vert.IsInit())
{
switch(text_props->vert->GetBYTECode())
{
case 0: pOutput->m_nTxflTextFlow = 1; break;
case 2: pOutput->m_nTxflTextFlow = 2; break;
case 3: pOutput->m_nTxflTextFlow = 1; break;
case 4: pOutput->m_nTxflTextFlow = 2; break;
case 5: pOutput->m_nTxflTextFlow = 5; break;
case 6: pOutput->m_nTxflTextFlow = 5; break;
default:
break;
}
}
//nullable_int rot;
//nullable_limit<Limit::TextWrap> wrap;
}
bool OOXShapeReader::ParsePic( ReaderParameter oParam, RtfShapePtr& pOutput)

View File

@ -66,14 +66,15 @@ public:
void ParseAdjustment(RtfShape& oShape, std::wstring sAdjustment);
static bool Parse(ReaderParameter oParam, RtfShapePtr& pOutput, PPTX::Logic::BlipFill *oox_bitmap_fill);
static void Parse(ReaderParameter oParam, PPTX::Logic::ColorBase *oox_color, unsigned int & nColor, _CP_OPT(double) &opacity);
private:
bool ParseShape( ReaderParameter oParam , RtfShapePtr& oOutput);
bool ParsePic( ReaderParameter oParam , RtfShapePtr& oOutput);
void Parse(ReaderParameter oParam, RtfShapePtr& pOutput, PPTX::Logic::BodyPr *text_properties);
void Parse(ReaderParameter oParam, RtfShapePtr& pOutput, PPTX::Logic::Xfrm *xfrm);
void Parse(ReaderParameter oParam, PPTX::Logic::ColorBase *oox_color, unsigned int & nColor, _CP_OPT(double) &opacity);
void Parse(ReaderParameter oParam, PPTX::Logic::SolidFill *oox_solid_fill, unsigned int & nColor, _CP_OPT(double) &opacity);
void Parse(ReaderParameter oParam, RtfShapePtr& pOutput, PPTX::Logic::StyleRef *style_ref, int type);

View File

@ -307,13 +307,12 @@ std::wstring RtfSectionProperty::RenderToRtf(RenderParameter oRenderParameter)
RENDER_RTF_INT ( m_nColumnNumber, sResult, L"cols" )
RENDER_RTF_INT ( m_nColumnSpace, sResult, L"colsx" )
RENDER_RTF_BOOL ( m_bColumnLineBetween, sResult, L"linebetcol" )
int nCollFormCount = (int)m_oCollumnProperty.m_aCollumnProperty.size();
if( nCollFormCount > 0 )
{
for( int i = 0; i < nCollFormCount; i++ )
if (m_nColumnNumber > 1)
{
for( size_t i = 0; i < m_oCollumnProperty.m_aCollumnProperty.size(); i++ )
{
sResult += L"\\colno" + std::to_wstring( i + 1 );
sResult += L"\\colno" + std::to_wstring( i + 1 );
RENDER_RTF_INT( m_oCollumnProperty.m_aCollumnProperty[i].m_nColumnSpaceToRightOfCol, sResult, L"colsr" )
RENDER_RTF_INT( m_oCollumnProperty.m_aCollumnProperty[i].m_nColumnWidth, sResult, L"colw" )
}
@ -575,23 +574,36 @@ std::wstring RtfSectionProperty::RenderToOOX(RenderParameter oRenderParameter)
}
}
sCollumnFormating += L"<w:cols w:num=\"" + std::to_wstring(m_nColumnNumber) + L"\"";
if( PROP_DEF != m_nColumnSpace )
sCollumnFormating += L" w:space=\"" + std::to_wstring(m_nColumnSpace) + L"\"";
if( true == bEqualWidth )
sCollumnFormating += L" w:equalWidth=\"true\"/>";
if (m_nColumnNumber > 1)
{
if (PROP_DEF != m_bColumnLineBetween)
sCollumnFormating += std::wstring(L" w:sep=\"") + (m_bColumnLineBetween ? L"1" : L"0") + L"\"";
if( true == bEqualWidth )
sCollumnFormating += L" w:equalWidth=\"true\"/>";
else
{
sCollumnFormating += L" w:equalWidth=\"false\">";
for (size_t i = 0; i < m_oCollumnProperty.m_aCollumnProperty.size(); i++ )
{
sCollumnFormating += L"<w:col";
if( PROP_DEF != m_oCollumnProperty.m_aCollumnProperty[i].m_nColumnWidth )
sCollumnFormating += L" w:w=\"" + std::to_wstring(m_oCollumnProperty.m_aCollumnProperty[i].m_nColumnWidth) + L"\"";
if( PROP_DEF != m_oCollumnProperty.m_aCollumnProperty[i].m_nColumnSpaceToRightOfCol )
sCollumnFormating += L" w:space=\"" + std::to_wstring(m_oCollumnProperty.m_aCollumnProperty[i].m_nColumnSpaceToRightOfCol ) + L"\"";
sCollumnFormating += L"/>";
}
sCollumnFormating += L"</w:cols>";
}
}
else
{
sCollumnFormating += L" w:equalWidth=\"false\">";
for (size_t i = 0; i < m_oCollumnProperty.m_aCollumnProperty.size(); i++ )
{
sCollumnFormating += L"<w:col";
if( PROP_DEF != m_oCollumnProperty.m_aCollumnProperty[i].m_nColumnWidth )
sCollumnFormating += L" w:w=\"" + std::to_wstring(m_oCollumnProperty.m_aCollumnProperty[i].m_nColumnWidth) + L"\"";
if( PROP_DEF != m_oCollumnProperty.m_aCollumnProperty[i].m_nColumnSpaceToRightOfCol )
sCollumnFormating += L" w:space=\"" + std::to_wstring(m_oCollumnProperty.m_aCollumnProperty[i].m_nColumnSpaceToRightOfCol ) + L"\"";
sCollumnFormating += L"/>";
}
sCollumnFormating += L"</w:cols>";
sCollumnFormating += L"/>";
}
if( false == sCollumnFormating.empty() )
sResult += sCollumnFormating;

View File

@ -315,15 +315,11 @@ public:
class ColumnProperty
{
public:
class CollumnVar
struct CollumnVar
{
public: int m_nColumnSpaceToRightOfCol; // colsrN Space to right of column in twips; used to specify formatting for variable-width columns.
int m_nColumnWidth; // colwN Width of column in twips; used to override the default constant width setting for variable-width columns.
CollumnVar()
{
m_nColumnSpaceToRightOfCol = PROP_DEF;
m_nColumnWidth = PROP_DEF;
}
int m_nColumnSpaceToRightOfCol = PROP_DEF; // colsrN Space to right of column in twips; used to specify formatting for variable-width columns.
int m_nColumnWidth = PROP_DEF; // colwN Width of column in twips; used to override the default constant width setting for variable-width columns.
};
std::vector< CollumnVar > m_aCollumnProperty;
ColumnProperty()
@ -570,8 +566,6 @@ public:
DEFAULT_PROPERTY ( m_nColumnSpace )
DEFAULT_PROPERTY ( m_bColumnLineBetween )
m_oCollumnProperty.m_aCollumnProperty.resize( m_nColumnNumber );
//Footnotes and Endnotes
DEFAULT_PROPERTY_DEF( m_eFootnotesJust, fj_none )
DEFAULT_PROPERTY ( m_nFootnotesStart )

View File

@ -55,7 +55,8 @@ void RtfShape::SetDefault()
DEFAULT_PROPERTY( m_bLockAnchor )
DEFAULT_PROPERTY_DEF( m_eXAnchor, ax_column ) //по умолчанию - привязка к тексту
DEFAULT_PROPERTY_DEF( m_eYAnchor, ay_Para )//по умолчанию - привязка к тексту
DEFAULT_PROPERTY( m_nLockPosition )
DEFAULT_PROPERTY( m_nLockRotation )
//Position absolute
DEFAULT_PROPERTY( m_nPositionH )
DEFAULT_PROPERTY( m_nPositionHRelative )
@ -89,19 +90,27 @@ void RtfShape::SetDefault()
//Text box
DEFAULT_PROPERTY( m_nAnchorText )
DEFAULT_PROPERTY_DEF( m_nTexpLeft, 91440 )
DEFAULT_PROPERTY_DEF( m_nTexpTop, 45720 )
DEFAULT_PROPERTY_DEF( m_nTexpRight, 91440 )
DEFAULT_PROPERTY_DEF( m_nTexpBottom, 45720 )
//DEFAULT_PROPERTY_DEF( m_nTexpLeft, 91440 )
//DEFAULT_PROPERTY_DEF( m_nTexpTop, 45720 )
//DEFAULT_PROPERTY_DEF( m_nTexpRight, 91440 )
//DEFAULT_PROPERTY_DEF( m_nTexpBottom, 45720 )
DEFAULT_PROPERTY( m_nTexpLeft )
DEFAULT_PROPERTY( m_nTexpTop )
DEFAULT_PROPERTY( m_nTexpRight )
DEFAULT_PROPERTY( m_nTexpBottom )
DEFAULT_PROPERTY( m_bFitShapeToText )
DEFAULT_PROPERTY( m_bFitTextToShape )
DEFAULT_PROPERTY( m_nCcol )
DEFAULT_PROPERTY( m_nTxdir )
DEFAULT_PROPERTY( m_nWrapText )
DEFAULT_PROPERTY( m_nTxflTextFlow)
DEFAULT_PROPERTY( m_fRotateText)
DEFAULT_PROPERTY( m_nScaleText)
DEFAULT_PROPERTY( m_fAutoTextMargin)
DEFAULT_PROPERTY( m_CdirFont)
//Geometry
for (size_t i = 0; i < 10; i++)
DEFAULT_PROPERTY( m_nAdjustValue[i] )
@ -425,6 +434,8 @@ std::wstring RtfShape::RenderToRtfShapeProperty(RenderParameter oRenderParameter
RENDER_RTF_SHAPE_PROP(L"posrelh", sResult, m_nPositionHRelative);
RENDER_RTF_SHAPE_PROP(L"posv", sResult, m_nPositionV);
RENDER_RTF_SHAPE_PROP(L"posrelv", sResult, m_nPositionVRelative);
RENDER_RTF_SHAPE_PROP(L"fLockPosition", sResult, m_nLockPosition);
RENDER_RTF_SHAPE_PROP(L"fLockRotation", sResult, m_nLockRotation);
RENDER_RTF_SHAPE_PROP(L"fLayoutInCell", sResult, m_bLayoutInCell);
RENDER_RTF_SHAPE_PROP(L"fAllowOverlap", sResult, m_bAllowOverlap);
@ -442,12 +453,12 @@ std::wstring RtfShape::RenderToRtfShapeProperty(RenderParameter oRenderParameter
if (m_sName.empty() == false)
{
sResult += L"{\\sp{\\sn wzName}{\\sv ";
sResult += m_sName + L"}}";
sResult += RtfChar::renderRtfText( m_sName, oRenderParameter.poDocument, -1 ) + L"}}";
}
if (m_sDescription.empty() == false)
{
sResult += L"{\\sp{\\sn wzDescription}{\\sv ";
sResult += m_sDescription + L"}}";
sResult += RtfChar::renderRtfText(m_sDescription, oRenderParameter.poDocument, -1 ) + L"}}";
}
//Rehydration
//RENDER_RTF_SHAPE_PROP(L"metroBlob", sResult, m_sMetroBlob);
@ -482,6 +493,7 @@ std::wstring RtfShape::RenderToRtfShapeProperty(RenderParameter oRenderParameter
RENDER_RTF_SHAPE_PROP(L"ccol", sResult, m_nCcol);
RENDER_RTF_SHAPE_PROP(L"txdir", sResult, m_nTxdir);
RENDER_RTF_SHAPE_PROP(L"WrapText", sResult, m_nWrapText);
RENDER_RTF_SHAPE_PROP(L"txflTextFlow", sResult, m_nTxflTextFlow);
//Geometry
RENDER_RTF_SHAPE_PROP(L"adjustValue", sResult, m_nAdjustValue[0] );
RENDER_RTF_SHAPE_PROP(L"adjust2Value", sResult, m_nAdjustValue[1] );
@ -538,7 +550,7 @@ std::wstring RtfShape::RenderToRtfShapeProperty(RenderParameter oRenderParameter
//Fill
if( 0 == m_bFilled )
sResult += L"{\\sp{\\sn fFilled}{\\sv 0}}";
RENDER_RTF_SHAPE_PROP(L"fillType", sResult, m_nFillType );
RENDER_RTF_SHAPE_PROP(L"fillType", sResult, m_nFillType );
RENDER_RTF_SHAPE_PROP(L"fillColor", sResult, m_nFillColor );
RENDER_RTF_SHAPE_PROP(L"fillBackColor", sResult, m_nFillColor2 );

View File

@ -83,6 +83,8 @@ public:
int m_nWrapSideType; //shpwrkN Wrap on side (for types 2 and 4 for \shpwrN ):
int m_nZOrderRelative; //shpfblwtxtN Describes relative z-ordering:
int m_bLockAnchor; //shplockanchor Lock anchor for a shape.
int m_nLockPosition;
int m_nLockRotation;
_AnchorX m_eXAnchor;
_AnchorY m_eYAnchor;
@ -132,6 +134,11 @@ public:
int m_nCcol; //columns
int m_nTxdir; //bidi
int m_nWrapText;
int m_nTxflTextFlow;
int m_fAutoTextMargin;
int m_fRotateText;
int m_nScaleText;
int m_CdirFont;
//Geometry
int m_nAdjustValue[10];
//Custom

View File

@ -515,6 +515,7 @@ void FillStyleBooleanProperties::load(XLS::CFRecord& record)
fillShape = GETBIT(op, 2);
fHitTestFill = GETBIT(op, 3);
fFilled = GETBIT(op, 4);
fUseShapeAnchor = GETBIT(op, 5);
fRecolorFillAsPicture = GETBIT(op, 6);
fUsefNoFillHitTest = GETBIT(op, 16);

View File

@ -28,7 +28,6 @@
17C1FBA61ACC4250006B99B3 /* ParagraphProperty.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 17E6A0661AC4262700F28F8B /* ParagraphProperty.cpp */; };
17C1FBA71ACC4250006B99B3 /* NumFormat.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 17E6A0001AC4262700F28F8B /* NumFormat.cpp */; };
17C1FBA81ACC4250006B99B3 /* SystemUtility.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 17E6A13D1AC4262800F28F8B /* SystemUtility.cpp */; };
17C1FBAA1ACC4250006B99B3 /* Utils.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 17E6A00E1AC4262700F28F8B /* Utils.cpp */; };
17C1FBAB1ACC4250006B99B3 /* FileFactory_Spreadsheet.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 17E6A1631AC4262800F28F8B /* FileFactory_Spreadsheet.cpp */; };
17C1FBAC1ACC4250006B99B3 /* AlternateContent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 17E6A0561AC4262700F28F8B /* AlternateContent.cpp */; };
17C1FBAD1ACC4250006B99B3 /* SmartTag.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 17E6A0721AC4262700F28F8B /* SmartTag.cpp */; };
@ -215,6 +214,11 @@
690FE0831E9BBA23004B26D0 /* DiagramDrawing.h in Headers */ = {isa = PBXBuildFile; fileRef = 690FE0811E9BBA23004B26D0 /* DiagramDrawing.h */; };
691C3E131F20C3D500F1775E /* File.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 691C3E121F20C3D500F1775E /* File.cpp */; };
69B3ADA920120093000EC6A7 /* VmlDrawing.h in Headers */ = {isa = PBXBuildFile; fileRef = 69B3ADA820120093000EC6A7 /* VmlDrawing.h */; };
69E6AC872031AB0C00795D9D /* Xlsx.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 69E6AC862031AB0C00795D9D /* Xlsx.cpp */; };
69E6AC892031AC3500795D9D /* SheetData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 69E6AC882031AC3500795D9D /* SheetData.cpp */; };
69E6AC8C2031ACA900795D9D /* VbaProject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 69E6AC8A2031ACA900795D9D /* VbaProject.cpp */; };
69E6AC8D2031ACA900795D9D /* VbaProject.h in Headers */ = {isa = PBXBuildFile; fileRef = 69E6AC8B2031ACA900795D9D /* VbaProject.h */; };
69E6AC8F2031B72500795D9D /* Worksheet.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 69E6AC8E2031B72500795D9D /* Worksheet.cpp */; };
69F181EC1C7734A700B2952B /* strings_hack_printf.h in Headers */ = {isa = PBXBuildFile; fileRef = 69F181EA1C7734A700B2952B /* strings_hack_printf.h */; };
/* End PBXBuildFile section */
@ -252,7 +256,6 @@
17E6A00B1AC4262700F28F8B /* SimpleTypes_Word.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SimpleTypes_Word.h; sourceTree = "<group>"; };
17E6A00C1AC4262700F28F8B /* Size.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Size.h; sourceTree = "<group>"; };
17E6A00D1AC4262700F28F8B /* Unit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Unit.h; sourceTree = "<group>"; };
17E6A00E1AC4262700F28F8B /* Utils.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Utils.cpp; sourceTree = "<group>"; };
17E6A00F1AC4262700F28F8B /* Utils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Utils.h; sourceTree = "<group>"; };
17E6A0101AC4262700F28F8B /* Wrap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Wrap.cpp; sourceTree = "<group>"; };
17E6A0111AC4262700F28F8B /* Wrap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Wrap.h; sourceTree = "<group>"; };
@ -435,6 +438,11 @@
690FE0811E9BBA23004B26D0 /* DiagramDrawing.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DiagramDrawing.h; sourceTree = "<group>"; };
691C3E121F20C3D500F1775E /* File.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp.preprocessed; fileEncoding = 4; path = File.cpp; sourceTree = "<group>"; };
69B3ADA820120093000EC6A7 /* VmlDrawing.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VmlDrawing.h; sourceTree = "<group>"; };
69E6AC862031AB0C00795D9D /* Xlsx.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Xlsx.cpp; sourceTree = "<group>"; };
69E6AC882031AC3500795D9D /* SheetData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SheetData.cpp; sourceTree = "<group>"; };
69E6AC8A2031ACA900795D9D /* VbaProject.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = VbaProject.cpp; sourceTree = "<group>"; };
69E6AC8B2031ACA900795D9D /* VbaProject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VbaProject.h; sourceTree = "<group>"; };
69E6AC8E2031B72500795D9D /* Worksheet.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Worksheet.cpp; sourceTree = "<group>"; };
69F181EA1C7734A700B2952B /* strings_hack_printf.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = strings_hack_printf.h; path = ../../Common/DocxFormat/Source/Base/strings_hack_printf.h; sourceTree = "<group>"; };
/* End PBXFileReference section */
@ -541,7 +549,6 @@
17E6A00B1AC4262700F28F8B /* SimpleTypes_Word.h */,
17E6A00C1AC4262700F28F8B /* Size.h */,
17E6A00D1AC4262700F28F8B /* Unit.h */,
17E6A00E1AC4262700F28F8B /* Utils.cpp */,
17E6A00F1AC4262700F28F8B /* Utils.h */,
17E6A0101AC4262700F28F8B /* Wrap.cpp */,
17E6A0111AC4262700F28F8B /* Wrap.h */,
@ -697,6 +704,8 @@
17E6A0871AC4262700F28F8B /* Media.h */,
17E6A0881AC4262700F28F8B /* OleObject.h */,
17E6A0891AC4262700F28F8B /* Video.h */,
69E6AC8A2031ACA900795D9D /* VbaProject.cpp */,
69E6AC8B2031ACA900795D9D /* VbaProject.h */,
);
path = Media;
sourceTree = "<group>";
@ -772,6 +781,7 @@
17E6A1871AC4262800F28F8B /* Worksheets */,
17E6A18F1AC4262800F28F8B /* WritingElement.h */,
17E6A1901AC4262800F28F8B /* Xlsx.h */,
69E6AC862031AB0C00795D9D /* Xlsx.cpp */,
);
path = XlsxFormat;
sourceTree = "<group>";
@ -883,7 +893,9 @@
17E6A18A1AC4262800F28F8B /* Hyperlinks.h */,
17E6A18B1AC4262800F28F8B /* MergeCells.h */,
17E6A18C1AC4262800F28F8B /* SheetData.h */,
69E6AC882031AC3500795D9D /* SheetData.cpp */,
17E6A18D1AC4262800F28F8B /* Worksheet.h */,
69E6AC8E2031B72500795D9D /* Worksheet.cpp */,
17E6A18E1AC4262800F28F8B /* WorksheetChildOther.h */,
);
path = Worksheets;
@ -1052,6 +1064,7 @@
17C1FC691ACC4250006B99B3 /* Footnote.h in Headers */,
17C1FC6A1ACC4250006B99B3 /* ComplexTypes.h in Headers */,
17C1FC6C1ACC4250006B99B3 /* RunContent.h in Headers */,
69E6AC8D2031ACA900795D9D /* VbaProject.h in Headers */,
17C1FC6D1ACC4250006B99B3 /* External.h in Headers */,
17C1FC6E1ACC4250006B99B3 /* Fills.h in Headers */,
17C1FC6F1ACC4250006B99B3 /* PhoneticPr.h in Headers */,
@ -1156,6 +1169,7 @@
17C1FB9E1ACC4250006B99B3 /* Align.cpp in Sources */,
17C1FB9F1ACC4250006B99B3 /* Index.cpp in Sources */,
17C1FBA01ACC4250006B99B3 /* TxtFile.cpp in Sources */,
69E6AC8F2031B72500795D9D /* Worksheet.cpp in Sources */,
17C1FBA11ACC4250006B99B3 /* SectionProperty.cpp in Sources */,
17C1FBA31ACC4250006B99B3 /* Color.cpp in Sources */,
17C1FBA41ACC4250006B99B3 /* Docx.cpp in Sources */,
@ -1163,17 +1177,19 @@
17C1FBA61ACC4250006B99B3 /* ParagraphProperty.cpp in Sources */,
17C1FBA71ACC4250006B99B3 /* NumFormat.cpp in Sources */,
17C1FBA81ACC4250006B99B3 /* SystemUtility.cpp in Sources */,
17C1FBAA1ACC4250006B99B3 /* Utils.cpp in Sources */,
17C1FBAB1ACC4250006B99B3 /* FileFactory_Spreadsheet.cpp in Sources */,
17C1FBAC1ACC4250006B99B3 /* AlternateContent.cpp in Sources */,
17C1FBAD1ACC4250006B99B3 /* SmartTag.cpp in Sources */,
17C1FBAE1ACC4250006B99B3 /* oMath.cpp in Sources */,
69E6AC892031AC3500795D9D /* SheetData.cpp in Sources */,
17C1FBAF1ACC4250006B99B3 /* ChartSerialize.cpp in Sources */,
17C1FBB11ACC4250006B99B3 /* Position.cpp in Sources */,
69E6AC8C2031ACA900795D9D /* VbaProject.cpp in Sources */,
691C3E131F20C3D500F1775E /* File.cpp in Sources */,
17C1FBB21ACC4250006B99B3 /* Vml.cpp in Sources */,
17C1FBB31ACC4250006B99B3 /* unicode_util.cpp in Sources */,
17C1FBB41ACC4250006B99B3 /* FldSimple.cpp in Sources */,
69E6AC872031AB0C00795D9D /* Xlsx.cpp in Sources */,
17C1FBB91ACC4250006B99B3 /* Paragraph.cpp in Sources */,
17C1FBBA1ACC4250006B99B3 /* SimpleTypes_Word.cpp in Sources */,
17C1FBBB1ACC4250006B99B3 /* MathEquation.cpp in Sources */,

View File

@ -1,4 +1,4 @@
VERSION = 2.4.516.0
VERSION = 2.4.517.0
DEFINES += INTVER=$$VERSION
# CONFIGURATION

View File

@ -616,12 +616,25 @@ namespace NSCommon
mapFontsPriorityStandard.insert(std::pair<std::wstring, int>(L"Courier New", 15));
mapFontsPriorityStandard.insert(std::pair<std::wstring, int>(L"Carlito", 16));
mapFontsPriorityStandard.insert(std::pair<std::wstring, int>(L"Segoe UI", 17));
mapFontsPriorityStandard.insert(std::pair<std::wstring, int>(L"MS Gothic", 18));
mapFontsPriorityStandard.insert(std::pair<std::wstring, int>(L"SimSun", 19));
mapFontsPriorityStandard.insert(std::pair<std::wstring, int>(L"SimSun", 18));
mapFontsPriorityStandard.insert(std::pair<std::wstring, int>(L"MS Gothic", 19));
mapFontsPriorityStandard.insert(std::pair<std::wstring, int>(L"Nirmala UI", 20));
mapFontsPriorityStandard.insert(std::pair<std::wstring, int>(L"Batang", 21));
mapFontsPriorityStandard.insert(std::pair<std::wstring, int>(L"MS Mincho", 22));
mapFontsPriorityStandard.insert(std::pair<std::wstring, int>(L"Wingdings", 23));
mapFontsPriorityStandard.insert(std::pair<std::wstring, int>(L"Microsoft JhengHei", 24));
mapFontsPriorityStandard.insert(std::pair<std::wstring, int>(L"Microsoft JhengHei UI", 25));
mapFontsPriorityStandard.insert(std::pair<std::wstring, int>(L"Microsoft YaHei", 26));
mapFontsPriorityStandard.insert(std::pair<std::wstring, int>(L"PMingLiU", 27));
mapFontsPriorityStandard.insert(std::pair<std::wstring, int>(L"MingLiU", 28));
mapFontsPriorityStandard.insert(std::pair<std::wstring, int>(L"DFKai-SB", 29));
mapFontsPriorityStandard.insert(std::pair<std::wstring, int>(L"FangSong", 30));
mapFontsPriorityStandard.insert(std::pair<std::wstring, int>(L"KaiTi", 31));
mapFontsPriorityStandard.insert(std::pair<std::wstring, int>(L"SimKai", 32));
mapFontsPriorityStandard.insert(std::pair<std::wstring, int>(L"SimHei", 33));
mapFontsPriorityStandard.insert(std::pair<std::wstring, int>(L"Meiryo", 34));
CApplicationFontsSymbols oApplicationChecker;

View File

@ -710,11 +710,23 @@ namespace NSCommon
mapFontsPriorityStandard.insert(std::pair<std::wstring, int>(L"Courier New", 15));
mapFontsPriorityStandard.insert(std::pair<std::wstring, int>(L"Carlito", 16));
mapFontsPriorityStandard.insert(std::pair<std::wstring, int>(L"Segoe UI", 17));
mapFontsPriorityStandard.insert(std::pair<std::wstring, int>(L"MS Gothic", 18));
mapFontsPriorityStandard.insert(std::pair<std::wstring, int>(L"SimSun", 19));
mapFontsPriorityStandard.insert(std::pair<std::wstring, int>(L"SimSun", 18));
mapFontsPriorityStandard.insert(std::pair<std::wstring, int>(L"MS Gothic", 19));
mapFontsPriorityStandard.insert(std::pair<std::wstring, int>(L"Nirmala UI", 20));
mapFontsPriorityStandard.insert(std::pair<std::wstring, int>(L"Batang", 21));
mapFontsPriorityStandard.insert(std::pair<std::wstring, int>(L"MS Mincho", 22));
mapFontsPriorityStandard.insert(std::pair<std::wstring, int>(L"Wingdings", 23));
mapFontsPriorityStandard.insert(std::pair<std::wstring, int>(L"Microsoft JhengHei", 24));
mapFontsPriorityStandard.insert(std::pair<std::wstring, int>(L"Microsoft JhengHei UI", 25));
mapFontsPriorityStandard.insert(std::pair<std::wstring, int>(L"Microsoft YaHei", 26));
mapFontsPriorityStandard.insert(std::pair<std::wstring, int>(L"PMingLiU", 27));
mapFontsPriorityStandard.insert(std::pair<std::wstring, int>(L"MingLiU", 28));
mapFontsPriorityStandard.insert(std::pair<std::wstring, int>(L"DFKai-SB", 29));
mapFontsPriorityStandard.insert(std::pair<std::wstring, int>(L"FangSong", 30));
mapFontsPriorityStandard.insert(std::pair<std::wstring, int>(L"KaiTi", 31));
mapFontsPriorityStandard.insert(std::pair<std::wstring, int>(L"SimKai", 32));
mapFontsPriorityStandard.insert(std::pair<std::wstring, int>(L"SimHei", 33));
mapFontsPriorityStandard.insert(std::pair<std::wstring, int>(L"Meiryo", 34));
CApplicationFontsSymbols oApplicationChecker;

View File

@ -814,7 +814,7 @@
17A762B21B0F35320046BC0B /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0800;
LastUpgradeCheck = 0920;
ORGANIZATIONNAME = "Ascensio System SIA";
};
buildConfigurationList = 17A762B51B0F35320046BC0B /* Build configuration list for PBXProject "metafile" */;
@ -1019,14 +1019,20 @@
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
@ -1061,14 +1067,20 @@
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;

View File

@ -110,10 +110,10 @@ namespace NSUnicodeConverter
{ 46, 65001, "UTF-8", "Unicode (UTF-8)" },
{ 47, 65000, "UTF-7", "Unicode (UTF-7)" },
{ 48, 1200, "UTF-16", "Unicode (UTF-16)" },
{ 48, 1200, "UTF-16LE", "Unicode (UTF-16)" },
{ 49, 1201, "UTF-16BE", "Unicode (UTF-16 Big Endian)" },
{ 50, 12000, "UTF-32", "Unicode (UTF-32)" },
{ 50, 12000, "UTF-32LE", "Unicode (UTF-32)" },
{ 51, 12001, "UTF-32BE", "Unicode (UTF-32 Big Endian)" }
};
}

View File

@ -339,8 +339,14 @@ namespace CSVReader
size_t nSize = sFileDataW.length();
if (nSize < 1 && nInputBufferSize > 0)
{
return AVS_FILEUTILS_ERROR_CONVERT_ICU;
{//для синхронности вывода превью и нормального результата
const NSUnicodeConverter::EncodindId& oEncodindId = NSUnicodeConverter::Encodings[nCodePage];
NSUnicodeConverter::CUnicodeConverter oUnicodeConverter;
sFileDataW = oUnicodeConverter.toUnicode((const char*)pInputBuffer, nInputBufferSize, oEncodindId.Name);
nSize = sFileDataW.length();
//return AVS_FILEUTILS_ERROR_CONVERT_ICU;
}
const WCHAR *pTemp = sFileDataW.c_str();

View File

@ -2455,7 +2455,7 @@ namespace BinXlsxRW
{
m_pCurWorksheet = new OOX::Spreadsheet::CWorksheet(NULL);
m_pCurSheet = new OOX::Spreadsheet::CSheet();
m_pCurVmlDrawing = new OOX::CVmlDrawing(false);
m_pCurVmlDrawing = new OOX::CVmlDrawing(NULL, false);
m_pCurVmlDrawing->m_lObjectIdVML = (long)(1024 * (m_oWorkbook.m_oSheets->m_arrItems.size() + 1) + 1);