From 998742d33117f91ca19797cf9ae21609f6471b18 Mon Sep 17 00:00:00 2001 From: ElenaSubbotina Date: Thu, 5 Dec 2019 15:20:42 +0300 Subject: [PATCH] XlsFormat - fix after testing --- .../DocDocxConverter/MainDocumentMapping.cpp | 2 +- .../OfficeDrawing/ShapeContainer.h | 6 +- .../OfficeDrawing/ShapeOptions.h | 432 +----------------- .../DocDocxConverter/VMLPictureMapping.cpp | 30 +- .../DocDocxConverter/VMLShapeMapping.cpp | 198 ++++---- .../BaseShape/PPTShape/ElementSettings.h | 2 +- .../Drawing/Shapes/BaseShape/PPTShape/Enums.h | 94 ++-- ASCOfficePPTXFile/PPTXFormat/Logic/BgPr.h | 1 + .../PPTXFormat/Logic/EffectLst.cpp | 14 +- ASCOfficePPTXFile/PPTXFormat/Logic/GrpSpPr.h | 19 +- ASCOfficePPTXFile/PPTXFormat/Logic/Ln.h | 26 +- .../PPTXFormat/Logic/RunProperties.h | 20 +- ASCOfficePPTXFile/PPTXFormat/Logic/SpPr.cpp | 16 +- ASCOfficePPTXFile/PPTXFormat/Logic/SpPr.h | 3 + .../PPTXFormat/Logic/Table/TableProperties.h | 19 +- .../Biff_structures/ODRAW/OfficeArtFOPTE.cpp | 30 +- .../Biff_structures/ODRAW/OfficeArtFOPTE.h | 21 + .../source/XlsXlsxConverter/XlsConverter.cpp | 272 ++++++++--- .../XlsXlsxConverter/xlsx_drawing_context.cpp | 80 +++- .../XlsXlsxConverter/xlsx_drawing_context.h | 36 +- 20 files changed, 617 insertions(+), 704 deletions(-) diff --git a/ASCOfficeDocFile/DocDocxConverter/MainDocumentMapping.cpp b/ASCOfficeDocFile/DocDocxConverter/MainDocumentMapping.cpp index 400d451d5d..4bd3967830 100644 --- a/ASCOfficeDocFile/DocDocxConverter/MainDocumentMapping.cpp +++ b/ASCOfficeDocFile/DocDocxConverter/MainDocumentMapping.cpp @@ -87,7 +87,7 @@ namespace DocFileFormat m_document->DocProperties->bDisplayBackgroundShape = true; ShapeContainer* pShape = m_document->GetOfficeArt()->GetShapeBackgound(); - ODRAW::OfficeArtFOPTEPtr boolFill = pShape->ExtractOption(fillStyleBooleanProperties); + ODRAW::OfficeArtFOPTEPtr boolFill = pShape->ExtractOption(ODRAW::fillStyleBooleanProperties); ODRAW::FillStyleBooleanProperties* booleans = dynamic_cast(boolFill.get()); diff --git a/ASCOfficeDocFile/DocDocxConverter/OfficeDrawing/ShapeContainer.h b/ASCOfficeDocFile/DocDocxConverter/OfficeDrawing/ShapeContainer.h index 0aafb3f8ae..c7d8e7e505 100644 --- a/ASCOfficeDocFile/DocDocxConverter/OfficeDrawing/ShapeContainer.h +++ b/ASCOfficeDocFile/DocDocxConverter/OfficeDrawing/ShapeContainer.h @@ -80,7 +80,7 @@ namespace DocFileFormat ShapeOptions* sh_options = dynamic_cast( this->Children[j] ); if (sh_options) { - if (sh_options->OptionsByID.end() != sh_options->OptionsByID.find(Pib)) + if (sh_options->OptionsByID.end() != sh_options->OptionsByID.find(ODRAW::pib)) { m_nShapeType = msosptPictureFrame; } @@ -101,7 +101,7 @@ namespace DocFileFormat return new ShapeContainer( _reader, bodySize, typeCode, version, instance ); } - ODRAW::OfficeArtFOPTEPtr ExtractOption(const PropertyId & prop) const + ODRAW::OfficeArtFOPTEPtr ExtractOption(const ODRAW::ePropertyId & prop) const { ODRAW::OfficeArtFOPTEPtr ret; @@ -111,7 +111,7 @@ namespace DocFileFormat if ( opt == NULL ) continue; - std::map::iterator pFind = opt->OptionsByID.find(prop); + std::map::iterator pFind = opt->OptionsByID.find(prop); if (pFind != opt->OptionsByID.end()) { ret = pFind->second; diff --git a/ASCOfficeDocFile/DocDocxConverter/OfficeDrawing/ShapeOptions.h b/ASCOfficeDocFile/DocDocxConverter/OfficeDrawing/ShapeOptions.h index 3c010bceaa..d2570fd4d1 100644 --- a/ASCOfficeDocFile/DocDocxConverter/OfficeDrawing/ShapeOptions.h +++ b/ASCOfficeDocFile/DocDocxConverter/OfficeDrawing/ShapeOptions.h @@ -36,432 +36,6 @@ namespace DocFileFormat { - typedef enum _PropertyId - { - //Transform - PropertyId_left=0, - PropertyId_top=1, - PropertyId_right=2, - PropertyId_bottom=3, - PropertyId_rotation=4, - PropertyId_gvPage=5, - PropertyId_fChangePage=61, - PropertyId_fFlipV=62, - PropertyId_fFlipH=63, - - //Protection - //fLockAgainstUngrouping=118, - //fLockRotation=119, - //fLockAspectRatio=120, - //fLockPosition=121, - //fLockAgainstSelect=122, - //fLockCropping=123, - //fLockVertices=124, - //fLockText=125, - //fLockAdjustHandles=126, - protectionBooleans=127, - - //Text - lTxid=128, - dxTextLeft=129, - dyTextTop=130, - dxTextRight=131, - dyTextBottom=132, - WrapText=133, - scaleText=134, - anchorText=135, - txflTextFlow=136, - cdirFont=137, - hspNext=138, - txdir=139, - ccol=140, - dzColMargin=141, - - textBooleanProperties=191, - - //GeoText - gtextUNICODE=192, - gtextRTF=193, - gtextAlign=194, - gtextSize=195, - 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, - geometryTextBooleanProperties=255, - - //BLIP - cropFromTop=256, - cropFromBottom=257, - cropFromLeft=258, - cropFromRight=259, - Pib=260, - pibName=261, - pibFlags=262, - pictureTransparent=263, - pictureContrast=264, - pictureBrightness=265, - pictureGamma=266, - pictureId=267, - pictureDblCrMod=268, - pictureFillCrMod=269, - pictureLineCrMod=270, - pibPrint=271, - pibPrintName=272, - pibPrintFlags=273, - movie=274, - pictureRecolor=282, - picturePreserveGrays=313, - - blipBooleanProperties=319, - - //Geometry - geoLeft=320, - geoTop=321, - geoRight=322, - geoBottom=323, - shapePath=324, - pVertices=325, - pSegmentInfo=326, - adjustValue=327, - adjust2Value=328, - adjust3Value=329, - adjust4Value=330, - adjust5Value=331, - adjust6Value=332, - adjust7Value=333, - adjust8Value=334, - adjust9Value=335, - adjust10Value=336, - pConnectionSites=337, - pConnectionSitesDir=338, - xLimo=339, - yLimo=340, - pAdjustHandles=341, - pGuides=342, - pInscribe=343, - cxk=344, - pFragments=345, - - geometryBooleans=383, - - //Fill Style - fillType=384, - fillColor=385, - fillOpacity=386, - fillBackColor=387, - fillBackOpacity=388, - fillCrMod=389, - fillBlip=390, - fillBlipName=391, - fillBlipFlags=392, - fillWidth=393, - fillHeight=394, - fillAngle=395, - fillFocus=396, - fillToLeft=397, - fillToTop=398, - fillToRight=399, - fillToBottom=400, - fillRectLeft=401, - fillRectTop=402, - fillRectRight=403, - fillRectBottom=404, - fillDztype=405, - fillShadePreset=406, - fillShadeColors=407, - fillOriginX=408, - fillOriginY=409, - fillShapeOriginX=410, - fillShapeOriginY=411, - fillShadeType=412, - - fillColorExt=414, - fillColorExtMod=416, - fillBackColorExt=418, - fillBackColorExtMod=420, - - fillStyleBooleanProperties=447, - - //Line Style - lineColor=448, - lineOpacity=449, - lineBackColor=450, - lineCrMod=451, - lineType=452, - lineFillBlip=453, - lineFillBlipName=454, - lineFillBlipFlags=455, - lineFillWidth=456, - lineFillHeight=457, - lineFillDztype=458, - lineWidth=459, - lineMiterLimit=460, - lineStyle=461, - lineDashing=462, - lineDashStyle=463, - lineStartArrowhead=464, - lineEndArrowhead=465, - lineStartArrowWidth=466, - lineStartArrowLength=467, - lineEndArrowWidth=468, - lineEndArrowLength=469, - lineJoinStyle=470, - lineEndCapStyle=471, - - lineStyleBooleans=511, - - //Shadow Style - shadowType=512, - shadowColor=513, - shadowHighlight=514, - shadowCrMod=515, - shadowOpacity=516, - shadowOffsetX=517, - shadowOffsetY=518, - shadowSecondOffsetX=519, - shadowSecondOffsetY=520, - shadowScaleXToX=521, - shadowScaleYToX=522, - shadowScaleXToY=523, - shadowScaleYToY=524, - shadowPerspectiveX=525, - shadowPerspectiveY=526, - shadowWeight=527, - shadowOriginX=528, - shadowOriginY=529, - - shadowStyleBooleanProperties=575, - - //Perspective Style - perspectiveType=576, - perspectiveOffsetX=577, - perspectiveOffsetY=578, - perspectiveScaleXToX=579, - perspectiveScaleYToX=580, - perspectiveScaleXToY=581, - perspectiveScaleYToY=582, - perspectivePerspectiveX=583, - perspectivePerspectiveY=584, - perspectiveWeight=585, - perspectiveOriginX=586, - perspectiveOriginY=587, - - perspectiveStyleBooleanProperties=639, - - //3D Object - c3DSpecularAmt=640, - c3DDiffuseAmt=641, - c3DShininess=642, - c3DEdgeThickness=643, - C3DExtrudeForward=644, - c3DExtrudeBackward=645, - c3DExtrudePlane=646, - c3DExtrusionColor=647, - c3DCrMod=648, - - threeDObjectBooleanProperties=703, - - //3D Style - c3DYRotationAngle=704, - c3DXRotationAngle=705, - c3DRotationAxisX=706, - c3DRotationAxisY=707, - c3DRotationAxisZ=708, - c3DRotationAngle=709, - c3DRotationCenterX=710, - c3DRotationCenterY=711, - c3DRotationCenterZ=712, - c3DRenderMode=713, - c3DTolerance=714, - c3DXViewpoint=715, - c3DYViewpoint=716, - c3DZViewpoint=717, - c3DOriginX=718, - c3DOriginY=719, - c3DSkewAngle=720, - c3DSkewAmount=721, - c3DAmbientIntensity=722, - c3DKeyX=723, - c3DKeyY=724, - c3DKeyZ=725, - c3DKeyIntensity=726, - c3DFillX=727, - c3DFillY=728, - c3DFillZ=729, - c3DFillIntensity=730, - - threeDStyleBooleanProperties=767, - - //Shape - hspMaster=769, - cxstyle=771, - bWMode=772, - bWModePureBW=773, - bWModeBW=774, - idDiscussAnchor=775, - dgmLayout=777, - dgmNodeKind=778, - dgmLayoutMRU=779, - wzEquationXML=780, - - shapeBooleans=831, - - //Callout - spcot=832, - dxyCalloutGap=833, - spcoa=834, - spcod=835, - dxyCalloutDropSpecified=836, - dxyCalloutLengthSpecified=837, - fCallout=889, - fCalloutAccentBar=890, - fCalloutTextBorder=891, - fCalloutMinusX=892, - fCalloutMinusY=893, - fCalloutDropAuto=894, - fCalloutLengthSpecified=895, - - //Groupe Shape - wzName=896, - wzDescription=897, - pihlShape=898, - pWrapPolygonVertices=899, - dxWrapDistLeft=900, - dyWrapDistTop=901, - dxWrapDistRight=902, - dyWrapDistBottom=903, - lidRegroup=904, - groupLeft=905, - groupTop=906, - groupRight=907, - groupBottom=908, - wzTooltip=909, - wzScript=910, - posh=911, - posrelh=912, - posv=913, - posrelv=914, - pctHR=915, - alignHR=916, - dxHeightHR=917, - dxWidthHR=918, - wzScriptExtAttr=919, - scriptLang=920, - wzScriptIdAttr=921, - wzScriptLangAttr=922, - borderTopColor=923, - borderLeftColor=924, - borderBottomColor=925, - borderRightColor=926, - tableProperties=927, - tableRowProperties=928, - scriptHtmlLocation=929, - wzApplet=930, - wzFrameTrgtUnused=932, - wzWebBot=933, - wzAppletArg=934, - wzAccessBlob=936, - metroBlob=937, - dhgt=938, - - groupShapeBooleans = 959, - - relRotation = 964, - - //Unknown HTML - wzLineId=1026, - wzFillId=1027, - wzPictureId=1028, - wzPathId=1029, - wzShadowId=1030, - wzPerspectiveId=1031, - wzGtextId=1032, - wzFormulaeId=1033, - wzHandlesId=1034, - wzCalloutId=1035, - wzLockId=1036, - wzTextId=1037, - wzThreeDId=1038, - FakeShapeType=1039, - fFakeMaster=1086, - - //Diagramm - dgmt=1280, - dgmStyle=1281, - pRelationTbl=1284, - dgmScaleX=1285, - dgmScaleY=1286, - dgmDefaultFontSize=1287, - dgmConstrainBounds=1288, - dgmBaseTextScale=1289, - fBorderlessCanvas=1338, - fNonStickyInkCanvas=1339, - fDoFormat=1340, - fReverse=1341, - fDoLayout=1342, - diagramBooleans=1343, - - //Web Component - webComponentWzHtml=1664, - webComponentWzName=1665, - webComponentWzUrl=1666, - webComponentWzProperties=1667, - fIsWebComponent=1727, - - //Clip - pVerticesClip=1728, - pSegmentInfoClip=1729, - shapePathClip=1730, - fClipToWrap=1790, - fClippedOK=1791, - - //Ink - pInkData=1792, - fInkAnnotation=1852, - fHitTestInk=1853, - fRenderShape=1854, - fRenderInk=1855, - - //Signature - wzSigSetupId=1921, - wzSigSetupProvId=192, - wzSigSetupSuggSigner=1923, - wzSigSetupSuggSigner2=1924, - wzSigSetupSuggSignerEmail=1925, - wzSigSetupSignInst=1926, - wzSigSetupAddlXml=1927, - wzSigSetupProvUrl=1928, - fSigSetupShowSignDate=1980, - fSigSetupAllowComments=1981, - fSigSetupSignInstSet=1982, - fIsSignatureLine=1983, - - //Groupe Shape 2 - pctHoriz=1984, - pctVert=1985, - pctHorizPos=1986, - pctVertPos=1987, - sizerelh=1988, - sizerelv=1989, - colStart=1990, - colSpan=1991 - } PropertyId; - //!!!TODO: Реальные значения не соответствуют значениям из спецификации!!! typedef enum _PositionHorizontal { @@ -534,8 +108,8 @@ namespace DocFileFormat static const unsigned short TYPE_CODE_0xF121 = 0xF121; static const unsigned short TYPE_CODE_0xF122 = 0xF122; - std::vector Options; - std::map OptionsByID; + std::vector Options; + std::map OptionsByID; ShapeOptions() : Record() { @@ -566,7 +140,7 @@ namespace DocFileFormat { Options[i]->ReadComplexData(Reader); } - OptionsByID.insert(std::make_pair((PropertyId)Options[i]->opid, Options[i])); + OptionsByID.insert(std::make_pair((ODRAW::ePropertyId)Options[i]->opid, Options[i])); } Reader->Seek(( pos + size ), 0/*STREAM_SEEK_SET*/); diff --git a/ASCOfficeDocFile/DocDocxConverter/VMLPictureMapping.cpp b/ASCOfficeDocFile/DocDocxConverter/VMLPictureMapping.cpp index c4ce82e0a7..0e6280b7eb 100644 --- a/ASCOfficeDocFile/DocDocxConverter/VMLPictureMapping.cpp +++ b/ASCOfficeDocFile/DocDocxConverter/VMLPictureMapping.cpp @@ -336,7 +336,7 @@ namespace DocFileFormat } } }break; - case metroBlob: + case ODRAW::metroBlob: {//встроенная неведомая хуйня ODRAW::MetroBlob* blob = dynamic_cast(iter.get()); if (blob) @@ -350,28 +350,28 @@ namespace DocFileFormat } }break; //BORDERS - case borderBottomColor: + case ODRAW::borderBottomColor: if (!pict->brcBottom) { RGBColor bottomColor( (int)iter->op, RedFirst ); m_pXmlWriter->WriteAttribute( L"o:borderbottomcolor", L"#" + bottomColor.SixDigitHexCode); } break; - case borderLeftColor: + case ODRAW::borderLeftColor: if (!pict->brcLeft) { RGBColor leftColor( (int)iter->op, RedFirst ); m_pXmlWriter->WriteAttribute( L"o:borderleftcolor", L"#" + leftColor.SixDigitHexCode); } break; - case borderRightColor: + case ODRAW::borderRightColor: if (!pict->brcRight) { RGBColor rightColor( (int)iter->op, RedFirst ); m_pXmlWriter->WriteAttribute( L"o:borderrightcolor", L"#" + rightColor.SixDigitHexCode); } break; - case borderTopColor: + case ODRAW::borderTopColor: if (!pict->brcTop) { RGBColor topColor( (int)iter->op, RedFirst ); @@ -379,28 +379,28 @@ namespace DocFileFormat } break; //CROPPING - case cropFromBottom: + case ODRAW::cropFromBottom: { //cast to signed integer int cropBottom = (int)iter->op; appendValueAttribute(m_imageData, L"cropbottom", FormatUtils::IntToWideString( cropBottom ) + L"f" ); } break; - case cropFromLeft: + case ODRAW::cropFromLeft: { //cast to signed integer int cropLeft = (int)iter->op; appendValueAttribute(m_imageData, L"cropleft", FormatUtils::IntToWideString( cropLeft ) + L"f" ); } break; - case cropFromRight: + case ODRAW::cropFromRight: { //cast to signed integer int cropRight = (int)iter->op; appendValueAttribute(m_imageData, L"cropright", FormatUtils::IntToWideString( cropRight ) + L"f" ); } break; - case cropFromTop: + case ODRAW::cropFromTop: { //cast to signed integer int cropTop = (int)iter->op; @@ -408,7 +408,7 @@ namespace DocFileFormat } break; //------------------------------------------------------------ - case PropertyId_rotation: + case ODRAW::ePropertyId_rotation: { double dAngle = (double)((int)iter->op) / 65535.0; @@ -420,23 +420,23 @@ namespace DocFileFormat appendStyleProperty(strStyle, L"rotation", FormatUtils::DoubleToWideString(dAngle)); }break; - case posh: + case ODRAW::posh: { appendStyleProperty(strStyle, L"mso-position-horizontal", VMLShapeMapping::mapHorizontalPosition((PositionHorizontal)iter->op)); }break; - case posrelh: + case ODRAW::posrelh: { appendStyleProperty(strStyle, L"mso-position-horizontal-relative", VMLShapeMapping::mapHorizontalPositionRelative((PositionHorizontalRelative)iter->op)); }break; - case posv: + case ODRAW::posv: { appendStyleProperty(strStyle, L"mso-position-vertical", VMLShapeMapping::mapVerticalPosition((PositionVertical)iter->op)); }break; - case posrelv: + case ODRAW::posrelv: { appendStyleProperty(strStyle, L"mso-position-vertical-relative", VMLShapeMapping::mapVerticalPositionRelative((PositionVerticalRelative)iter->op)); }break; - case groupShapeBooleans: + case ODRAW::groupShapeBooleans: { ODRAW::GroupShapeBooleanProperties* booleans = dynamic_cast(iter.get()); diff --git a/ASCOfficeDocFile/DocDocxConverter/VMLShapeMapping.cpp b/ASCOfficeDocFile/DocDocxConverter/VMLShapeMapping.cpp index 906b00438b..2c69b0eb72 100644 --- a/ASCOfficeDocFile/DocDocxConverter/VMLShapeMapping.cpp +++ b/ASCOfficeDocFile/DocDocxConverter/VMLShapeMapping.cpp @@ -152,7 +152,7 @@ namespace DocFileFormat { switch (options[i]->opid) { - case pWrapPolygonVertices: + case ODRAW::pWrapPolygonVertices: { std::wstring wrapCoords = GetWrapCoords(options[i]); if (!wrapCoords.empty()) @@ -307,7 +307,7 @@ namespace DocFileFormat switch (iter->opid) { //BOOLEANS - case geometryBooleans: + case ODRAW::geometryBooleans: { ODRAW::GeometryBooleanProperties *booleans = dynamic_cast(iter.get()); if (booleans->fUsefLineOK && !booleans->fLineOK) @@ -328,7 +328,7 @@ namespace DocFileFormat } } break; - case fillStyleBooleanProperties: + case ODRAW::fillStyleBooleanProperties: { ODRAW::FillStyleBooleanProperties *booleans = dynamic_cast(iter.get()); if (booleans->fUsefFilled && !booleans->fFilled) @@ -341,7 +341,7 @@ namespace DocFileFormat appendValueAttribute(&m_fill, L"rotate", L"t"); } }break; - case lineStyleBooleans: + case ODRAW::lineStyleBooleans: { ODRAW::LineStyleBooleanProperties *booleans = dynamic_cast(iter.get()); if (booleans->fUsefLine && !booleans->fLine) @@ -350,16 +350,16 @@ namespace DocFileFormat } } break; - case protectionBooleans: + case ODRAW::protectionBooleans: { //ProtectionBooleanProperties booleans(iter->op); } break; - case diagramBooleans: + case ODRAW::diagramBooleans: { } break; - case groupShapeBooleans: + case ODRAW::groupShapeBooleans: { ODRAW::GroupShapeBooleanProperties *booleans = dynamic_cast(iter.get()); if (booleans->fUsefLayoutInCell) @@ -369,78 +369,78 @@ namespace DocFileFormat } break; // GEOMETRY - case shapePath : + case ODRAW::shapePath : { bHavePath = true; nShapePath = iter->op; }break; - case pVertices: + case ODRAW::pVertices: { opVerticles = iter; }break; - case pSegmentInfo: + case ODRAW::pSegmentInfo: { opSegmentInfo = iter; }break; - case pGuides: + case ODRAW::pGuides: { GetGuides(iter); }break; - case pConnectionSites: + case ODRAW::pConnectionSites: { opConnectLocs = iter; }break; - case pConnectionSitesDir: + case ODRAW::pConnectionSitesDir: { opConnectAngles = iter; }break; - case pInscribe: + case ODRAW::pInscribe: { opInscribe = iter; }break; - case adjustValue: + case ODRAW::adjustValue: { m_nAdjValues[0] = (int)iter->op; nAdjValues = (std::max)(nAdjValues,1); } break; - case adjust2Value: + case ODRAW::adjust2Value: { m_nAdjValues[1] = (int)iter->op; nAdjValues = (std::max)(nAdjValues, 2); } break; - case adjust3Value: + case ODRAW::adjust3Value: { m_nAdjValues[2] = (int)iter->op; nAdjValues =(std::max)(nAdjValues, 3); }break; - case adjust4Value: + case ODRAW::adjust4Value: { m_nAdjValues[3] = (int)iter->op; nAdjValues = (std::max)(nAdjValues, 4); }break; - case adjust5Value: + case ODRAW::adjust5Value: { m_nAdjValues[4] = (int)iter->op; nAdjValues = (std::max)(nAdjValues, 5); }break; - case adjust6Value: + case ODRAW::adjust6Value: { m_nAdjValues[5] = (int)iter->op; nAdjValues = (std::max)(nAdjValues, 6); }break; - case adjust7Value: + case ODRAW::adjust7Value: { m_nAdjValues[6] = (int)iter->op; nAdjValues = (std::max)(nAdjValues, 7); }break; - case adjust8Value: + case ODRAW::adjust8Value: { m_nAdjValues[7] = (int)iter->op; nAdjValues = (std::max)(nAdjValues, 8); }break; - case pWrapPolygonVertices: + case ODRAW::pWrapPolygonVertices: { std::wstring wrapCoords = GetWrapCoords(iter); @@ -449,22 +449,22 @@ namespace DocFileFormat m_pXmlWriter->WriteAttribute( L"wrapcoords", wrapCoords); } }break; - case geoRight: + case ODRAW::geoRight: { xCoord = iter->op; }break; - case geoBottom: + case ODRAW::geoBottom: { yCoord = iter->op; }break; // LINE - case lineColor: + case ODRAW::lineColor: { RGBColor lineColor((int)iter->op, RedFirst); if ( !pShape->fBackground ) m_pXmlWriter->WriteAttribute( L"strokecolor", (std::wstring(L"#") + lineColor.SixDigitHexCode)); }break; - case lineWidth: + case ODRAW::lineWidth: { if (iter->op > 0) { @@ -472,39 +472,39 @@ namespace DocFileFormat m_pXmlWriter->WriteAttribute(L"strokeweight", FormatUtils::DoubleToWideString(eLineWidth.ToPoints()) + L"pt"); } }break; - case lineDashing: + case ODRAW::lineDashing: { appendValueAttribute(&m_stroke, L"dashstyle", FormatUtils::MapValueToWideString( iter->op, &Global::DashStyleMap[0][0], 11, 16 ) ); }break; - case lineStyle: + case ODRAW::lineStyle: { appendValueAttribute(&m_stroke, L"linestyle", getLineStyle( iter->op )); }break; - case lineEndArrowhead: + case ODRAW::lineEndArrowhead: { appendValueAttribute(&m_stroke, L"endarrow", getArrowStyle( iter->op )); }break; - case lineEndArrowLength: + case ODRAW::lineEndArrowLength: { appendValueAttribute(&m_stroke, L"endarrowlength", getArrowLength( iter->op )); }break; - case lineEndArrowWidth: + case ODRAW::lineEndArrowWidth: { appendValueAttribute(&m_stroke, L"endarrowwidth", getArrowWidth( iter->op )); }break; - case lineStartArrowhead: + case ODRAW::lineStartArrowhead: { appendValueAttribute(&m_stroke, L"startarrow", getArrowStyle( iter->op )); }break; - case lineStartArrowLength: + case ODRAW::lineStartArrowLength: { appendValueAttribute(&m_stroke, L"startarrowlength", getArrowLength( iter->op )); }break; - case lineStartArrowWidth: + case ODRAW::lineStartArrowWidth: { appendValueAttribute(&m_stroke, L"startarrowwidth", getArrowWidth( iter->op )); }break; - case cxstyle: + case ODRAW::cxstyle: { if (pShape->GetShapeType() == NULL) { @@ -520,39 +520,39 @@ namespace DocFileFormat } }break; // FILL - case fillColor: + case ODRAW::fillColor: { RGBColor fillColor((int)iter->op, RedFirst); m_pXmlWriter->WriteAttribute(L"fillcolor", ( std::wstring( L"#" ) + fillColor.SixDigitHexCode )); }break; - case fillBackColor: + case ODRAW::fillBackColor: { RGBColor fillBackColor( (int)iter->op, RedFirst ); appendValueAttribute(&m_fill, L"color2", ( std::wstring( L"#" ) + fillBackColor.SixDigitHexCode )); }break; - case fillAngle: + case ODRAW::fillAngle: { ODRAW::FixedPoint* point = dynamic_cast(iter.get()); if (point) appendValueAttribute(&m_fill, L"angle", FormatUtils::DoubleToWideString( point->dVal )); }break; - case fillShadeType: + case ODRAW::fillShadeType: { appendValueAttribute(&m_fill, L"method", getFillMethod( iter->op )); }break; - case fillShadeColors: + case ODRAW::fillShadeColors: { appendValueAttribute(&m_fill, L"colors", getFillColorString( iter )); }break; - case fillFocus: + case ODRAW::fillFocus: { appendValueAttribute(&m_fill, L"focus", ( FormatUtils::IntToWideString( iter->op ) + L"%" )); appendValueAttribute(&m_fill, L"focussize", L""); }break; - case fillType: + case ODRAW::fillType: { appendValueAttribute(&m_fill, L"type", getFillType( iter->op )); }break; - case fillBlip: + case ODRAW::fillBlip: { BlipStoreEntry* pFillBlip = NULL; @@ -573,7 +573,7 @@ namespace DocFileFormat bPicturePresent = true; }break; - case fillBlipName: + case ODRAW::fillBlipName: { ODRAW::AnyString* str = dynamic_cast(iter.get()); if ((str) && (!str->string_.empty())) @@ -581,68 +581,68 @@ namespace DocFileFormat appendValueAttribute(&m_fill, L"o:title", str->string_); } }break; - case fillOpacity: + case ODRAW::fillOpacity: { appendValueAttribute(&m_fill, L"opacity", ( FormatUtils::IntToWideString( iter->op ) + L"f" )); } break; - case fillBackOpacity: + case ODRAW::fillBackOpacity: { appendValueAttribute(&m_fill, L"o:opacity2", (FormatUtils::IntToWideString(iter->op) + L"f")); }break; // SHADOW - case shadowType: + case ODRAW::shadowType: { appendValueAttribute(&m_shadow, L"type", getShadowType(iter->op)); }break; - case shadowColor: + case ODRAW::shadowColor: { RGBColor shadowColor((int)iter->op, RedFirst); appendValueAttribute(&m_shadow, L"color", ( std::wstring( L"#" ) + shadowColor.SixDigitHexCode )); }break; - case shadowOffsetX: + case ODRAW::shadowOffsetX: { ShadowOffsetX = EmuValue( (int)iter->op ); }break; - case shadowSecondOffsetX: + case ODRAW::shadowSecondOffsetX: { SecondShadowOffsetX = EmuValue( (int)iter->op ); }break; - case shadowOffsetY: + case ODRAW::shadowOffsetY: { ShadowOffsetY = EmuValue( (int)iter->op ); }break; - case shadowSecondOffsetY: + case ODRAW::shadowSecondOffsetY: { SecondShadowOffsetY = EmuValue( (int)iter->op ); }break; - case shadowOriginX: + case ODRAW::shadowOriginX: { ShadowOriginX = ( iter->op / pow( (double)2, (double)16 ) ); }break; - case shadowOriginY: + case ODRAW::shadowOriginY: { ShadowOriginY = (iter->op / pow( (double)2, (double)16)); }break; - case shadowOpacity: + case ODRAW::shadowOpacity: { double shadowOpa = (iter->op / pow( (double)2, (double)16)); appendValueAttribute(&m_shadow, L"opacity", FormatUtils::DoubleToFormattedWideString( shadowOpa, L"%.2f" )); }break; - case shadowStyleBooleanProperties: + case ODRAW::shadowStyleBooleanProperties: { //ODRAW::ShadowStyleBooleanProperties }break; // OLE - case pictureId: + case ODRAW::pictureId: { indexOLE = iter->op; }break; // PICTURE - case Pib: + case ODRAW::pib: { int index = (int)( iter->op - 1 ); @@ -656,7 +656,7 @@ namespace DocFileFormat } bPicturePresent = true; }break; - case pibName: + case ODRAW::pibName: { ODRAW::AnyString* str = dynamic_cast(iter.get()); if ((str) && (!str->string_.empty())) @@ -665,92 +665,92 @@ namespace DocFileFormat } }break; // 3D STYLE - case threeDStyleBooleanProperties: + case ODRAW::threeDStyleBooleanProperties: { ODRAW::ThreeDStyleBooleanProperties* booleans = dynamic_cast(iter.get()); }break; - case threeDObjectBooleanProperties: + case ODRAW::threeDObjectBooleanProperties: { ODRAW::ThreeDObjectBooleanProperties* booleans = dynamic_cast(iter.get()); if ((booleans) && (booleans->fUsef3D && !booleans->f3D)) b3D = false; }break; - case c3DRenderMode: + case ODRAW::c3DRenderMode: { }break; - case c3DExtrudeBackward: + case ODRAW::c3DExtrudeBackward: { EmuValue backwardValue( (int)iter->op ); std::wstring depth = FormatUtils::DoubleToWideString( backwardValue.ToPoints() ) + L"pt"; appendValueAttribute(&m_3dstyle, L"backdepth", depth); }break; - case c3DAmbientIntensity: + case ODRAW::c3DAmbientIntensity: { std::wstring intens = FormatUtils::IntToWideString((int)iter->op) + L"f"; appendValueAttribute(&m_3dstyle, L"brightness", intens); }break; - case c3DSpecularAmt: + case ODRAW::c3DSpecularAmt: { std::wstring amt = FormatUtils::IntToWideString((int)iter->op) + L"f"; appendValueAttribute(&m_3dstyle, L"specularity", amt); }break; - case c3DDiffuseAmt: + case ODRAW::c3DDiffuseAmt: { std::wstring amt = FormatUtils::IntToWideString((int)iter->op) + L"f"; appendValueAttribute(&m_3dstyle, L"diffusity", amt); }break; - case c3DKeyIntensity: + case ODRAW::c3DKeyIntensity: { std::wstring amt = FormatUtils::IntToWideString((int)iter->op); appendValueAttribute(&m_3dstyle, L"lightlevel", amt); }break; - case c3DExtrusionColor: + case ODRAW::c3DExtrusionColor: { std::wstring color = FormatUtils::IntToFormattedWideString(iter->op, L"#%06x"); appendValueAttribute(&m_3dstyle, L"color", color); }break; - case c3DSkewAngle: + case ODRAW::c3DSkewAngle: { ODRAW::FixedPoint* point = dynamic_cast(iter.get()); if (point) appendValueAttribute(&m_3dstyle, L"skewangle", FormatUtils::DoubleToWideString( point->dVal )); }break; - case c3DXViewpoint: + case ODRAW::c3DXViewpoint: { ODRAW::FixedPoint* point = dynamic_cast(iter.get()); if (point) ViewPointX = EmuValue( (int)point->dVal ); }break; - case c3DYViewpoint: + case ODRAW::c3DYViewpoint: { ODRAW::FixedPoint* point = dynamic_cast(iter.get()); if (point) ViewPointY = EmuValue( (int)point->dVal ); }break; - case c3DZViewpoint: + case ODRAW::c3DZViewpoint: { ODRAW::FixedPoint* point = dynamic_cast(iter.get()); if (point) ViewPointZ = EmuValue( (int)point->dVal ); }break; - case c3DOriginX: + case ODRAW::c3DOriginX: { ODRAW::FixedPoint* point = dynamic_cast(iter.get()); if (point) viewPointOriginX = point->dVal; }break; - case c3DOriginY: + case ODRAW::c3DOriginY: { ODRAW::FixedPoint* point = dynamic_cast(iter.get()); if (point) viewPointOriginY = point->dVal; }break; // TEXTBOX - case lTxid: + case ODRAW::lTxid: { hasTextbox = true; nLTxID = (((iter->op) >> 16) & 0xFFFF); }break; - case dxTextLeft: {ndxTextLeft = (int)iter->op; break;} - case dyTextTop: {ndyTextTop = (int)iter->op; break;} - case dxTextRight: {ndxTextRight = (int)iter->op; break;} - case dyTextBottom: {ndyTextBottom = (int)iter->op; break;} - case txflTextFlow: + case ODRAW::dxTextLeft: {ndxTextLeft = (int)iter->op; break;} + case ODRAW::dyTextTop: {ndyTextTop = (int)iter->op; break;} + case ODRAW::dxTextRight: {ndxTextRight = (int)iter->op; break;} + case ODRAW::dyTextBottom: {ndyTextBottom = (int)iter->op; break;} + case ODRAW::txflTextFlow: { switch(iter->op) { @@ -769,7 +769,7 @@ namespace DocFileFormat } }break; // Word Art - case gtextUNICODE: + case ODRAW::gtextUNICODE: { ODRAW::AnyString* str = dynamic_cast(iter.get()); if ((str) && (!str->string_.empty())) @@ -777,7 +777,7 @@ namespace DocFileFormat appendValueAttribute(&m_textpath, L"string", str->string_); } }break; - case gtextFont: + case ODRAW::gtextFont: { ODRAW::AnyString* str = dynamic_cast(iter.get()); if (str) @@ -785,17 +785,17 @@ namespace DocFileFormat appendStyleProperty(m_textPathStyle, L"font-family", str->string_); } }break; - case gtextSize: + case ODRAW::gtextSize: { std::wstring fontSize = FormatUtils::IntToWideString(iter->op/65535); appendStyleProperty(m_textPathStyle, L"font-size", fontSize + L"pt"); }break; - case gtextSpacing: + case ODRAW::gtextSpacing: { std::wstring spacing = FormatUtils::IntToWideString(iter->op); appendStyleProperty(m_textPathStyle, L"v-text-spacing", spacing + L"f"); }break; - case geometryTextBooleanProperties: + case ODRAW::geometryTextBooleanProperties: { ODRAW::GeometryTextBooleanProperties *props = dynamic_cast(iter.get()); if (props->fUsegFBestFit && props->fBestFit) @@ -1632,26 +1632,26 @@ namespace DocFileFormat switch (iter->opid) { // POSITIONING - case posh: + case ODRAW::posh: { nPosH = iter->op; }break; - case posrelh: + case ODRAW::posrelh: { nRelH = iter->op; appendStyleProperty(oStyle, L"mso-position-horizontal-relative", mapHorizontalPositionRelative((PositionHorizontalRelative)iter->op)); }break; - case posv: + case ODRAW::posv: { nPosV = iter->op; }break; - case posrelv: + case ODRAW::posrelv: { nRelV = iter->op; appendStyleProperty(oStyle, L"mso-position-vertical-relative", mapVerticalPositionRelative((PositionVerticalRelative)iter->op)); }break; // BOOLEANS - case groupShapeBooleans: + case ODRAW::groupShapeBooleans: { ODRAW::GroupShapeBooleanProperties* booleans = dynamic_cast(iter.get()); @@ -1679,7 +1679,7 @@ namespace DocFileFormat } }break; // GEOMETRY - case PropertyId_rotation: + case ODRAW::ePropertyId_rotation: { double dAngle = (double)((int)iter->op) / 65535.0; @@ -1689,24 +1689,24 @@ namespace DocFileFormat appendStyleProperty(oStyle, L"rotation", FormatUtils::DoubleToWideString(dAngle)); }break; // TEXTBOX - case anchorText: + case ODRAW::anchorText: { appendStyleProperty(oStyle, L"v-text-anchor", getTextboxAnchor(iter->op)); }break; // WRAP DISTANCE - case dxWrapDistLeft: + case ODRAW::dxWrapDistLeft: { appendStyleProperty(oStyle, L"mso-wrap-distance-left", (FormatUtils::DoubleToWideString(EmuValue((int)iter->op).ToPoints()) + std::wstring(L"pt"))); }break; - case dxWrapDistRight: + case ODRAW::dxWrapDistRight: { appendStyleProperty(oStyle, L"mso-wrap-distance-right", (FormatUtils::DoubleToWideString(EmuValue((int)iter->op).ToPoints()) + std::wstring(L"pt"))); }break; - case dyWrapDistBottom: + case ODRAW::dyWrapDistBottom: { appendStyleProperty(oStyle, L"mso-wrap-distance-bottom", (FormatUtils::DoubleToWideString(EmuValue((int)iter->op).ToPoints()) + std::wstring(L"pt"))); }break; - case dyWrapDistTop: + case ODRAW::dyWrapDistTop: { appendStyleProperty(oStyle, L"mso-wrap-distance-top", (FormatUtils::DoubleToWideString(EmuValue((int)iter->op).ToPoints()) + std::wstring(L"pt"))); }break; @@ -1775,7 +1775,7 @@ namespace DocFileFormat { const ODRAW::OfficeArtFOPTEPtr & iter = options[i]; - if (geometryTextBooleanProperties == iter->opid) + if (ODRAW::geometryTextBooleanProperties == iter->opid) { ODRAW::GeometryTextBooleanProperties* booleans = dynamic_cast(iter.get()); @@ -1785,7 +1785,7 @@ namespace DocFileFormat } } - else if (PropertyId_rotation == iter->opid) + else if (ODRAW::ePropertyId_rotation == iter->opid) { double dAngle = (double)((int)iter->op) / 65535.0; diff --git a/ASCOfficePPTXFile/Editor/Drawing/Shapes/BaseShape/PPTShape/ElementSettings.h b/ASCOfficePPTXFile/Editor/Drawing/Shapes/BaseShape/PPTShape/ElementSettings.h index 6108d7825b..a9790930a4 100644 --- a/ASCOfficePPTXFile/Editor/Drawing/Shapes/BaseShape/PPTShape/ElementSettings.h +++ b/ASCOfficePPTXFile/Editor/Drawing/Shapes/BaseShape/PPTShape/ElementSettings.h @@ -52,7 +52,7 @@ public: CProperty() { - m_ePID = ODRAW::left; + m_ePID = ODRAW::ePropertyId_left; m_bIsBlip = false; m_bComplex = false; m_lValue = 0; diff --git a/ASCOfficePPTXFile/Editor/Drawing/Shapes/BaseShape/PPTShape/Enums.h b/ASCOfficePPTXFile/Editor/Drawing/Shapes/BaseShape/PPTShape/Enums.h index 26ac15c0da..8707cf8b93 100644 --- a/ASCOfficePPTXFile/Editor/Drawing/Shapes/BaseShape/PPTShape/Enums.h +++ b/ASCOfficePPTXFile/Editor/Drawing/Shapes/BaseShape/PPTShape/Enums.h @@ -849,28 +849,19 @@ namespace ODRAW enum ePropertyId { - //Transform - left=0, - top=1, - right=2, - bottom=3, - rotation=4, - gvPage=5, - fChangePage=61, - fFlipV=62, - fFlipH=63, + //Transform + ePropertyId_left=0, + ePropertyId_top=1, + ePropertyId_right=2, + ePropertyId_bottom=3, + ePropertyId_rotation=4, + ePropertyId_gvPage=5, + ePropertyId_fChangePage=61, + ePropertyId_fFlipV=62, + ePropertyId_fFlipH=63, //Protection - fLockAgainstUngrouping=118, - fLockRotation=119, - fLockAspectRatio=120, - fLockPosition=121, - fLockAgainstSelect=122, - fLockCropping=123, - fLockVertices=124, - fLockText=125, - fLockAdjustHandles=126, - fLockAgainstGrouping=127, + protectionBooleans=127, //Text lTxid=128, @@ -887,7 +878,8 @@ namespace ODRAW txdir=139, ccol=140, dzColMargin=141, - textBoolean=191, + + textBooleanProperties=191, //GeoText gtextUNICODE=192, @@ -898,7 +890,8 @@ namespace ODRAW gtextFont=197, gtextCSSFont=198, gtextFReverseRows=240, - gtextBoolean=255, + + geometryTextBooleanProperties=255, //BLIP cropFromTop=256, @@ -919,14 +912,20 @@ namespace ODRAW pibPrint=271, pibPrintName=272, pibPrintFlags=273, - movie=274, - pictureRecolor=282, - picturePreserveGrays=313, - fRewind=314, - fLooping=315, - pictureGray=317, - pictureBiLevel=318, - pictureActive=319, + movie=274, + pictureTransparentExt=277, + reserved278=278, + pictureTransparentExtMod=279, + reserved280=280, + reserved281=281, + pictureRecolor=282, + pictureRecolorExt=283, + reserved284=284, + pictureRecolorExtMod=285, + reserved286=286, + reserved287=287, + + blipBooleanProperties=319, //Geometry geoLeft=320, @@ -955,7 +954,7 @@ namespace ODRAW pInscribe=343, cxk=344, pFragments=345, - geoBoolean=383, + geometryBooleans=383, //Fill Style fillType=384, @@ -987,15 +986,11 @@ namespace ODRAW fillShapeOriginX=410, fillShapeOriginY=411, fillShadeType=412, - fillColorExt=414, + fillColorExt=414, + fillColorExtMod=416, fillBackColorExt=418, - fRecolorFillAsPicture=441, - fUseShapeAnchor=442, - fFilled=443, - fHitTestFill=444, - fillShape=445, - fillUseRect=446, - fillBoolean=447, + fillBackColorExtMod=420, + fillStyleBooleanProperties=447, //Line Style lineColor=448, @@ -1022,7 +1017,7 @@ namespace ODRAW lineEndArrowLength=469, lineJoinStyle=470, lineEndCapStyle=471, - lineBoolean=511, + lineStyleBooleans=511, //Shadow Style shadowType=512, @@ -1043,7 +1038,7 @@ namespace ODRAW shadowWeight=527, shadowOriginX=528, shadowOriginY=529, - shadowBoolean=575, + shadowStyleBooleanProperties=575, //Perspective Style perspectiveType=576, @@ -1078,7 +1073,8 @@ namespace ODRAW c3DTopBevelWidth = 664, c3DTopBevelHeight = 665, c3DTopBevelType = 666, - c3DBoolean = 703, + + threeDObjectBooleanProperties = 703, //3D Style c3DYRotationAngle=704, @@ -1108,7 +1104,8 @@ namespace ODRAW c3DFillY=728, c3DFillZ=729, c3DFillIntensity = 730, - c3DStyleBoolean = 767, + + threeDStyleBooleanProperties=767, //Shape hspMaster = 769, @@ -1174,7 +1171,8 @@ namespace ODRAW wzAccessBlob=936, metroBlob = 937, dhgt = 938, - groupShapeBoolean = 959, + + groupShapeBooleans = 959, //Unknown HTML wzLineId=1026, @@ -1202,12 +1200,8 @@ namespace ODRAW dgmDefaultFontSize=1287, dgmConstrainBounds=1288, dgmBaseTextScale=1289, - fBorderlessCanvas=1338, - fNonStickyInkCanvas=1339, - fDoFormat=1340, - fReverse=1341, - fDoLayout=1342, - fPseudoInline=1343, + + diagramBooleans=1343, // dashing lineLeftDashStyle=1359, diff --git a/ASCOfficePPTXFile/PPTXFormat/Logic/BgPr.h b/ASCOfficePPTXFile/PPTXFormat/Logic/BgPr.h index 2396a2351d..421428641b 100644 --- a/ASCOfficePPTXFile/PPTXFormat/Logic/BgPr.h +++ b/ASCOfficePPTXFile/PPTXFormat/Logic/BgPr.h @@ -36,6 +36,7 @@ #include "./../WrapperWritingElement.h" #include "UniFill.h" #include "EffectProperties.h" +#include "ExtP.h" namespace PPTX { diff --git a/ASCOfficePPTXFile/PPTXFormat/Logic/EffectLst.cpp b/ASCOfficePPTXFile/PPTXFormat/Logic/EffectLst.cpp index 3b604d0693..50f6579d84 100644 --- a/ASCOfficePPTXFile/PPTXFormat/Logic/EffectLst.cpp +++ b/ASCOfficePPTXFile/PPTXFormat/Logic/EffectLst.cpp @@ -62,19 +62,19 @@ namespace PPTX if (strName == L"a:blur") blur = oReader; - if (strName == L"a:fillOverlay") + else if (strName == L"a:fillOverlay") fillOverlay = oReader; - if (strName == L"a:glow") + else if (strName == L"a:glow") glow = oReader; - if (strName == L"a:innerShdw") + else if (strName == L"a:innerShdw") innerShdw = oReader; - if (strName == L"a:outerShdw") + else if (strName == L"a:outerShdw") outerShdw = oReader; - if (strName == L"a:prstShdw") + else if (strName == L"a:prstShdw") prstShdw = oReader; - if (strName == L"a:reflection") + else if (strName == L"a:reflection") reflection = oReader; - if (strName == L"a:softEdge") + else if (strName == L"a:softEdge") softEdge = oReader; } diff --git a/ASCOfficePPTXFile/PPTXFormat/Logic/GrpSpPr.h b/ASCOfficePPTXFile/PPTXFormat/Logic/GrpSpPr.h index ec4ffae09d..f814bbb343 100644 --- a/ASCOfficePPTXFile/PPTXFormat/Logic/GrpSpPr.h +++ b/ASCOfficePPTXFile/PPTXFormat/Logic/GrpSpPr.h @@ -39,6 +39,7 @@ #include "UniFill.h" #include "EffectProperties.h" #include "Scene3d.h" +#include "ExtP.h" namespace PPTX { @@ -96,11 +97,23 @@ namespace PPTX Fill.fromXML(oReader); } else if ( L"effectDag" == sName || - L"effectLst" == sName || - L"extLst" == sName ) + L"effectLst" == sName) { EffectList.fromXML(oReader); } + else if ( L"extLst" == sName ) + { + if ( oReader.IsEmptyNode() ) + continue; + + int nParentDepth1 = oReader.GetDepth(); + while( oReader.ReadNextSiblingNode( nParentDepth1 ) ) + { + Ext element; + element.fromXML(oReader); + extLst.push_back (element); + } + } } FillParentPointersForChilds(); } @@ -260,6 +273,8 @@ namespace PPTX EffectProperties EffectList; nullable scene3d; + std::vector extLst; + nullable_limit bwMode; protected: virtual void FillParentPointersForChilds() diff --git a/ASCOfficePPTXFile/PPTXFormat/Logic/Ln.h b/ASCOfficePPTXFile/PPTXFormat/Logic/Ln.h index 85057e2062..83271a43de 100644 --- a/ASCOfficePPTXFile/PPTXFormat/Logic/Ln.h +++ b/ASCOfficePPTXFile/PPTXFormat/Logic/Ln.h @@ -43,6 +43,7 @@ #include "PrstDash.h" #include "LineEnd.h" #include "LineJoin.h" +#include "ExtP.h" namespace PPTX { @@ -99,8 +100,24 @@ namespace PPTX prstDash = oReader; //m_eDashType = OOX::Drawing::linedashtypePreset; } - else if ( _T("a:extLst") == sName ) - Effects.fromXML(oReader); + else if ( L"effectDag" == sName || + L"effectLst" == sName) + { + Effects.fromXML(oReader); + } + else if ( L"extLst" == sName ) + { + if ( oReader.IsEmptyNode() ) + continue; + + int nParentDepth1 = oReader.GetDepth(); + while( oReader.ReadNextSiblingNode( nParentDepth1 ) ) + { + Ext element; + element.fromXML(oReader); + extLst.push_back (element); + } + } } FillParentPointersForChilds(); } @@ -123,7 +140,6 @@ namespace PPTX } void ReadAttributes(XmlUtils::CXmlLiteReader& oReader) { - // Читаем атрибуты WritingElement_ReadAttributes_Start_No_NS( oReader ) WritingElement_ReadAttributes_Read_if ( oReader, _T("algn"), algn ) WritingElement_ReadAttributes_Read_else_if( oReader, _T("cap"), cap ) @@ -346,8 +362,10 @@ namespace PPTX public: // OOX::Drawing::ELineDashType m_eDashType; // Тип штриха - EffectProperties Effects; UniFill Fill; + EffectProperties Effects; + + std::vector extLst; nullable prstDash; //custDash (Custom Dash) ยง20.1.8.21 diff --git a/ASCOfficePPTXFile/PPTXFormat/Logic/RunProperties.h b/ASCOfficePPTXFile/PPTXFormat/Logic/RunProperties.h index bd76ed371f..77e85e0b25 100644 --- a/ASCOfficePPTXFile/PPTXFormat/Logic/RunProperties.h +++ b/ASCOfficePPTXFile/PPTXFormat/Logic/RunProperties.h @@ -43,6 +43,7 @@ #include "TextFont.h" #include "EffectProperties.h" #include "Hyperlink.h" +#include "ExtP.h" namespace PPTX { @@ -347,11 +348,23 @@ namespace PPTX else if ( L"rtl" == sName ) rtl = oReader; else if ( L"effectDag" == sName || - L"effectLst" == sName || - L"extLst" == sName ) + L"effectLst" == sName) { EffectList.fromXML(oReader); } + else if ( L"a:extLst" == sName ) + { + if ( oReader.IsEmptyNode() ) + continue; + + int nParentDepth1 = oReader.GetDepth(); + while( oReader.ReadNextSiblingNode( nParentDepth1 ) ) + { + Ext element; + element.fromXML(oReader); + extLst.push_back (element); + } + } } FillParentPointersForChilds(); } @@ -777,6 +790,9 @@ namespace PPTX nullable ln; UniFill Fill; EffectProperties EffectList; + + std::vector extLst; + nullable highlight; nullable uFill; nullable uFillTx; diff --git a/ASCOfficePPTXFile/PPTXFormat/Logic/SpPr.cpp b/ASCOfficePPTXFile/PPTXFormat/Logic/SpPr.cpp index 46abfb61a6..4450aa4b18 100644 --- a/ASCOfficePPTXFile/PPTXFormat/Logic/SpPr.cpp +++ b/ASCOfficePPTXFile/PPTXFormat/Logic/SpPr.cpp @@ -98,8 +98,7 @@ namespace PPTX Fill.fromXML(oReader); } else if ( L"effectDag" == sName || - L"effectLst" == sName || - L"extLst" == sName ) + L"effectLst" == sName ) { EffectList.fromXML(oReader); } @@ -108,6 +107,19 @@ namespace PPTX { Geometry.fromXML(oReader); } + else if ( L"extLst" == sName) + { + if ( oReader.IsEmptyNode() ) + continue; + + int nParentDepth1 = oReader.GetDepth(); + while( oReader.ReadNextSiblingNode( nParentDepth1 ) ) + { + Ext element; + element.fromXML(oReader); + extLst.push_back (element); + } + } } FillParentPointersForChilds(); } diff --git a/ASCOfficePPTXFile/PPTXFormat/Logic/SpPr.h b/ASCOfficePPTXFile/PPTXFormat/Logic/SpPr.h index 83d704b9d9..b9e14d5d56 100644 --- a/ASCOfficePPTXFile/PPTXFormat/Logic/SpPr.h +++ b/ASCOfficePPTXFile/PPTXFormat/Logic/SpPr.h @@ -42,6 +42,7 @@ #include "Scene3d.h" #include "Sp3d.h" #include "Geometry.h" +#include "ExtP.h" #include "../../../DesktopEditor/graphics/aggplustypes.h" //for RECT @@ -147,6 +148,8 @@ namespace PPTX nullable_limit bwMode; + std::vector extLst; + std::wstring m_namespace; protected: virtual void FillParentPointersForChilds(); diff --git a/ASCOfficePPTXFile/PPTXFormat/Logic/Table/TableProperties.h b/ASCOfficePPTXFile/PPTXFormat/Logic/Table/TableProperties.h index e53be909b5..fb1a7c9e1e 100644 --- a/ASCOfficePPTXFile/PPTXFormat/Logic/Table/TableProperties.h +++ b/ASCOfficePPTXFile/PPTXFormat/Logic/Table/TableProperties.h @@ -36,6 +36,7 @@ #include "./../../WrapperWritingElement.h" #include "./../UniFill.h" #include "./../EffectProperties.h" +#include "./../ExtP.h" namespace PPTX { @@ -95,11 +96,23 @@ namespace PPTX Fill.fromXML(oReader); } else if ( L"a:effectDag" == strName || - L"a:effectLst" == strName || - L"a:extLst" == strName ) + L"a:effectLst" == strName) { Effects.fromXML(oReader); } + else if ( L"a:extLst" == strName ) + { + if ( oReader.IsEmptyNode() ) + continue; + + int nParentDepth1 = oReader.GetDepth(); + while( oReader.ReadNextSiblingNode( nParentDepth1 ) ) + { + Ext element; + element.fromXML(oReader); + extLst.push_back (element); + } + } } FillParentPointersForChilds(); } @@ -263,6 +276,8 @@ namespace PPTX UniFill Fill; EffectProperties Effects; nullable_string TableStyleId; + + std::vector extLst; /* diff --git a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/ODRAW/OfficeArtFOPTE.cpp b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/ODRAW/OfficeArtFOPTE.cpp index 0b7dd245ea..e02dd655d9 100644 --- a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/ODRAW/OfficeArtFOPTE.cpp +++ b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/ODRAW/OfficeArtFOPTE.cpp @@ -165,7 +165,7 @@ OfficeArtFOPTEPtr OfficeArtFOPTE::create(unsigned short opid) case ODRAW::gtextSpacing: fopte = OfficeArtFOPTEPtr(new FixedPoint); break; - case ODRAW::textBoolean: + case ODRAW::textBooleanProperties: fopte = OfficeArtFOPTEPtr(new TextBooleanProperties); break; case ODRAW::gtextUNICODE: @@ -672,6 +672,34 @@ void FillStyleBooleanProperties::set() fUsefUseShapeAnchor = GETBIT(op, 21); fUsefRecolorFillAsPicture = GETBIT(op, 22); } +void BlipBooleanProperties::load(XLS::CFRecord& record) +{ + OfficeArtFOPTE::load(record); + set(); +} +void BlipBooleanProperties::load(IBinaryReader* reader) +{ + OfficeArtFOPTE::load(reader); + set(); +} +void BlipBooleanProperties::set() +{ + fUsefPicturePreserveGrays = GETBIT(op,22); + fUsefRewind = GETBIT(op,21); + fUsefLooping = GETBIT(op,20); + fUsefNoHitTestPicture = GETBIT(op,19); + fUsefPictureGray = GETBIT(op,18); + fUsefPictureBiLevel = GETBIT(op,17); + fUsefPictureActive = GETBIT(op,16); + + fPicturePreserveGrays = GETBIT(op, 6); + fRewind = GETBIT(op, 5); + fLooping = GETBIT(op, 4); + fNoHitTestPicture = GETBIT(op, 3); + fPictureGray = GETBIT(op, 2); + fPictureBiLevel = GETBIT(op, 1); + fPictureActive = GETBIT(op, 0); +} void FillBlip::ReadComplexData(XLS::CFRecord& record) { OfficeArtRecordHeader rh_child; diff --git a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/ODRAW/OfficeArtFOPTE.h b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/ODRAW/OfficeArtFOPTE.h index e4cdfdc53a..5d4d92cf43 100644 --- a/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/ODRAW/OfficeArtFOPTE.h +++ b/ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/ODRAW/OfficeArtFOPTE.h @@ -346,6 +346,27 @@ class FillBlip : public OfficeArtFOPTE class BlipBooleanProperties : public OfficeArtFOPTE { BASE_STRUCTURE_DEFINE_CLASS_NAME(BlipBooleanProperties) + + virtual void load(XLS::CFRecord& record); + virtual void load(IBinaryReader* reader); + + bool fUsefPicturePreserveGrays; + bool fUsefRewind; + bool fUsefLooping; + bool fUsefNoHitTestPicture; + bool fUsefPictureGray; + bool fUsefPictureBiLevel; + bool fUsefPictureActive; + + bool fPicturePreserveGrays; + bool fRewind; + bool fLooping; + bool fNoHitTestPicture; + bool fPictureGray; + bool fPictureBiLevel; + bool fPictureActive; +private: + void set(); }; class ShapeBooleanProperties : public OfficeArtFOPTE { diff --git a/ASCOfficeXlsFile2/source/XlsXlsxConverter/XlsConverter.cpp b/ASCOfficeXlsFile2/source/XlsXlsxConverter/XlsConverter.cpp index b946f86232..af40297a01 100644 --- a/ASCOfficeXlsFile2/source/XlsXlsxConverter/XlsConverter.cpp +++ b/ASCOfficeXlsFile2/source/XlsXlsxConverter/XlsConverter.cpp @@ -1595,7 +1595,7 @@ void XlsConverter::convert_fill_style(std::vector & pr } } }break; - case ODRAW::fillBoolean: + case ODRAW::fillStyleBooleanProperties: { ODRAW::FillStyleBooleanProperties * bools = (ODRAW::FillStyleBooleanProperties *)(props[i].get()); if (bools) @@ -1679,7 +1679,7 @@ void XlsConverter::convert_line_style(std::vector & pr { xlsx_context->get_drawing_context().set_arrow_end_length(props[i]->op); }break; - case ODRAW::lineBoolean: + case ODRAW::lineStyleBooleans: { ODRAW::LineStyleBooleanProperties * bools = (ODRAW::LineStyleBooleanProperties *)(props[i].get()); if (bools) @@ -1717,37 +1717,116 @@ void XlsConverter::convert_blip(std::vector & props) ODRAW::FixedPoint * fixed_point = static_cast(props[i].get()); switch(props[i]->opid) { - case 0x100: - { - if (fixed_point) - xlsx_context->get_drawing_context().set_crop_top(fixed_point->dVal * 10); - }break; - case 0x101: - { - if (fixed_point) - xlsx_context->get_drawing_context().set_crop_bottom(fixed_point->dVal * 10); - }break; - case 0x102: - { - if (fixed_point) - xlsx_context->get_drawing_context().set_crop_left(fixed_point->dVal * 10); - }break; - case 0x103: - { - if (fixed_point) - xlsx_context->get_drawing_context().set_crop_right(fixed_point->dVal * 10); - }break; - case 0x104: - { - bool isIternal = false; - std::wstring target; + case ODRAW::cropFromTop: + { + if (fixed_point) + xlsx_context->get_drawing_context().set_picture_crop_top(fixed_point->dVal * 10); + }break; + case ODRAW::cropFromBottom: + { + if (fixed_point) + xlsx_context->get_drawing_context().set_picture_crop_bottom(fixed_point->dVal * 10); + }break; + case ODRAW::cropFromLeft: + { + if (fixed_point) + xlsx_context->get_drawing_context().set_picture_crop_left(fixed_point->dVal * 10); + }break; + case ODRAW::cropFromRight: + { + if (fixed_point) + xlsx_context->get_drawing_context().set_picture_crop_right(fixed_point->dVal * 10); + }break; + case ODRAW::pib: + { + bool isIternal = false; + std::wstring target; - int id = props[i]->op; - if (xlsx_context->get_drawing_context().get_mode_HF()) - id += 3000; + int id = props[i]->op; + if (xlsx_context->get_drawing_context().get_mode_HF()) + id += 3000; + + std::wstring rId = xlsx_context->get_mediaitems().find_image(id , target, isIternal); + xlsx_context->get_drawing_context().set_fill_texture(target); + }break; + case ODRAW::pibName: + { + ODRAW::AnyString *str = dynamic_cast(props[i].get()); + xlsx_context->get_drawing_context().set_picture_name(str->string_); + }break; + case ODRAW::pibFlags: + { + }break; + case ODRAW::pictureTransparent: + { + ODRAW::OfficeArtCOLORREF color((_UINT32)props[i]->op); - std::wstring rId = xlsx_context->get_mediaitems().find_image(id , target, isIternal); - xlsx_context->get_drawing_context().set_fill_texture(target); + if (!color.sColorRGB.empty()) + xlsx_context->get_drawing_context().set_picture_transparent(color.nColorRGB, color.sColorRGB); + //... + }break; + case ODRAW::pictureContrast: + { + int val = 0; + if (props[i]->op == 0x7FFFFFFF) + { + val = 100; + } + else if (props[i]->op == 0x00010000) + { + val = 0; + } + else if (props[i]->op > 0x00010000) + { + val = 51. / (props[i]->op / 65536.); + val = (50 - val) * 2; + } + else + { + val = (100. * props[i]->op / 65536. + 0.5) - 100; + } + xlsx_context->get_drawing_context().set_picture_contrast(val); + }break; + case ODRAW::pictureBrightness: + { + int val = ((_INT32)props[i]->op * 100. + 0.5) / 0x00008000; + xlsx_context->get_drawing_context().set_picture_brightness(val); + }break; + case ODRAW::pictureGamma: + { + }break; + case ODRAW::pictureId: + { + }break; + case ODRAW::pictureDblCrMod: + { + }break; + case ODRAW::pictureFillCrMod: + { + }break; + case ODRAW::pictureLineCrMod: + { + }break; + case ODRAW::pibPrint: + { + }break; + case ODRAW::pibPrintName: + { + }break; + case ODRAW::pibPrintFlags: + { + }break; + case ODRAW::blipBooleanProperties: + { + ODRAW::BlipBooleanProperties * bools = (ODRAW::BlipBooleanProperties *)(props[i].get()); + if (bools) + { + if (bools->fUsefPictureGray && bools->fPictureGray) + xlsx_context->get_drawing_context().set_picture_grayscale(true); + if (bools->fUsefPictureBiLevel && bools->fPictureBiLevel) + xlsx_context->get_drawing_context().set_picture_biLevel(50); + } + }break; } } @@ -1763,71 +1842,71 @@ void XlsConverter::convert_geometry(std::vector & prop { switch(props[i]->opid) { - case 0x0140: rect.x = props[i]->op; break; - case 0x0141: rect.y = props[i]->op; break; - case 0x0142: rect.cx = props[i]->op; break; - case 0x0143: rect.cy = props[i]->op; break; - case 0x0144: - xlsx_context->get_drawing_context().set_custom_path(props[i]->op); break; - case 0x0145: - { - ODRAW::PVertices * v = (ODRAW::PVertices *)(props[i].get()); - xlsx_context->get_drawing_context().set_custom_verticles(v->complex.data); - }break; - case 0x0146: - { - ODRAW::PSegmentInfo * s = (ODRAW::PSegmentInfo *)(props[i].get()); - xlsx_context->get_drawing_context().set_custom_segments(s->complex.data); - }break; - case 0x0147: //adjustValue .... //adjust8Value - case 0x0148: - case 0x0149: - case 0x014A: - case 0x014B: - case 0x014C: - case 0x014D: - case 0x014E: + case ODRAW::geoLeft: rect.x = props[i]->op; break; + case ODRAW::geoTop: rect.y = props[i]->op; break; + case ODRAW::geoRight: rect.cx = props[i]->op; break; + case ODRAW::geoBottom: rect.cy = props[i]->op; break; + case ODRAW::shapePath: + xlsx_context->get_drawing_context().set_custom_path(props[i]->op); break; + case ODRAW::pVertices: + { + ODRAW::PVertices * v = (ODRAW::PVertices *)(props[i].get()); + xlsx_context->get_drawing_context().set_custom_verticles(v->complex.data); + }break; + case ODRAW::pSegmentInfo: + { + ODRAW::PSegmentInfo * s = (ODRAW::PSegmentInfo *)(props[i].get()); + xlsx_context->get_drawing_context().set_custom_segments(s->complex.data); + }break; + case 0x0147: //adjustValue .... //adjust8Value + case 0x0148: + case 0x0149: + case 0x014A: + case 0x014B: + case 0x014C: + case 0x014D: + case ODRAW::adjust10Value: { adjustValues[props[i]->opid - 0x0147] = props[i]->op ; }break; - case 0x0151: + case ODRAW::pConnectionSites: { ODRAW::PConnectionSites * a = (ODRAW::PConnectionSites *)(props[i].get()); xlsx_context->get_drawing_context().set_custom_connection(a->complex.data); }break; - case 0x0152: + case ODRAW::pConnectionSitesDir: { ODRAW::PConnectionSitesDir * a = (ODRAW::PConnectionSitesDir *)(props[i].get()); xlsx_context->get_drawing_context().set_custom_connectionDir(a->complex.data); }break; - case 0x0153: + case ODRAW::xLimo: { xlsx_context->get_drawing_context().set_custom_x_limo(props[i]->op); }break; - case 0x0154: + case ODRAW::yLimo: { xlsx_context->get_drawing_context().set_custom_y_limo(props[i]->op); }break; - case 0x0155: + case ODRAW::pAdjustHandles: { ODRAW::PAdjustHandles * a = (ODRAW::PAdjustHandles *)(props[i].get()); xlsx_context->get_drawing_context().set_custom_adjustHandles(a->complex.data); }break; - case 0x0156: + case ODRAW::pGuides: { ODRAW::PGuides* s = (ODRAW::PGuides *)(props[i].get()); xlsx_context->get_drawing_context().set_custom_guides(s->complex.data); }break; - case 0x0157: + case ODRAW::pInscribe: { ODRAW::PInscribe * a = (ODRAW::PInscribe *)(props[i].get()); xlsx_context->get_drawing_context().set_custom_inscribe(a->complex.data); }break; - //case 0x0158: - // { - // ODRAW::cxk * a = (ODRAW::cxk *)(props[i].get()); - // xlsx_context->get_drawing_context().set_custom_cxk(a->complex.data); - // }break; + //case ODRAW::cxk: + // { + // ODRAW::cxk * a = (ODRAW::cxk *)(props[i].get()); + // xlsx_context->get_drawing_context().set_custom_cxk(a->complex.data); + // }break; } } rect.cy -= rect.y; @@ -1922,7 +2001,7 @@ void XlsConverter::convert_text(std::vector & props) { xlsx_context->get_drawing_context().set_text_vertical(props[i]->op); }break; - case ODRAW::textBoolean: + case ODRAW::textBooleanProperties: { ODRAW::TextBooleanProperties *bools = dynamic_cast(props[i].get()); if (bools) @@ -1989,6 +2068,63 @@ void XlsConverter::convert_shadow(std::vector & props) for (size_t i = 0 ; i < props.size() ; i++) { + switch(props[i]->opid) + { + case ODRAW::shadowType: + { + }break; + case ODRAW::shadowColor: + { + }break; + case ODRAW::shadowHighlight: + { + }break; + case ODRAW::shadowCrMod: + { + }break; + case ODRAW::shadowOpacity: + { + }break; + case ODRAW::shadowOffsetX: + { + }break; + case ODRAW::shadowOffsetY: + { + }break; + case ODRAW::shadowSecondOffsetX: + { + }break; + case ODRAW::shadowSecondOffsetY: + { + }break; + case ODRAW::shadowScaleXToX: + { + }break; + case ODRAW::shadowScaleYToX: + { + }break; + case ODRAW::shadowScaleXToY: + { + }break; + case ODRAW::shadowScaleYToY: + { + }break; + case ODRAW::shadowPerspectiveX: + { + }break; + case ODRAW::shadowPerspectiveY: + { + }break; + case ODRAW::shadowWeight: + { + }break; + case ODRAW::shadowOriginX: + { + }break; + case ODRAW::shadowOriginY: + { + }break; + } } } void XlsConverter::convert_shape(std::vector & props) diff --git a/ASCOfficeXlsFile2/source/XlsXlsxConverter/xlsx_drawing_context.cpp b/ASCOfficeXlsFile2/source/XlsXlsxConverter/xlsx_drawing_context.cpp index dc7d32c12c..1cf7695a8b 100644 --- a/ASCOfficeXlsFile2/source/XlsXlsxConverter/xlsx_drawing_context.cpp +++ b/ASCOfficeXlsFile2/source/XlsXlsxConverter/xlsx_drawing_context.cpp @@ -622,6 +622,13 @@ void xlsx_drawing_context::reset_alternative_drawing() current_drawing_states->back()->xmlFillAlternative = writerFill.GetXmlString(); } + if (shape->spPr.EffectList.is_init()) + { + NSBinPptxRW::CXmlWriter writerEffect(XMLWRITER_DOC_TYPE_XLSX); + shape->spPr.EffectList.toXmlWriter(&writerEffect); + + current_drawing_states->back()->xmlEffectAlternative = writerEffect.GetXmlString(); + } } smart_ptr groupShape = oElement->GetElem().smart_dynamic_cast(); if (groupShape.IsInit()) @@ -1372,6 +1379,15 @@ void xlsx_drawing_context::serialize_pic(_drawing_state_ptr & drawing_state) } CP_XML_NODE(L"a:noFill"); + + if (false == drawing_state->xmlEffectAlternative.empty()) + { + CP_XML_STREAM() << drawing_state->xmlEffectAlternative; + } + else + { + //serialize_effect(CP_XML_STREAM(), drawing_state); + } } } } @@ -1638,7 +1654,16 @@ void xlsx_drawing_context::serialize_shape(_drawing_state_ptr & drawing_state) serialize_fill(CP_XML_STREAM(), drawing_state); } } - serialize_line(CP_XML_STREAM(), drawing_state); + serialize_line(CP_XML_STREAM(), drawing_state); + + if (false == drawing_state->xmlEffectAlternative.empty()) + { + CP_XML_STREAM() << drawing_state->xmlEffectAlternative; + } + else + { + //serialize_effect(CP_XML_STREAM(), drawing_state); + } } serialize_text(CP_XML_STREAM(), drawing_state); } @@ -2339,6 +2364,26 @@ void xlsx_drawing_context::serialize_bitmap_fill(std::wostream & stream, _drawin CP_XML_NODE(L"a:blip") { CP_XML_ATTR(L"r:embed", rId); + + if (fill.grayscale) + { + CP_XML_NODE(L"a:grayscl"); + } + if (fill.brightness || fill.contrast) + { + CP_XML_NODE(L"a:lum") + { + if (fill.brightness)CP_XML_ATTR(L"bright", *fill.brightness * 1000); + if (fill.contrast) CP_XML_ATTR(L"contrast", *fill.contrast * 1000); + } + } + if (fill.biLevel) + { + CP_XML_NODE(L"a:biLevel") + { + CP_XML_ATTR(L"thresh", *fill.biLevel * 1000); + } + } } CP_XML_NODE(L"a:srcRect") @@ -2740,8 +2785,7 @@ void xlsx_drawing_context::set_fill_texture(const std::wstring & str) current_drawing_states->back()->fill.texture_target = str; } - -void xlsx_drawing_context::set_crop_top (double val) +void xlsx_drawing_context::set_picture_crop_top (double val) { if (current_drawing_states == NULL) return; if (current_drawing_states->empty()) return; @@ -2749,7 +2793,7 @@ void xlsx_drawing_context::set_crop_top (double val) current_drawing_states->back()->fill.texture_crop[1] = val; current_drawing_states->back()->fill.texture_crop_enabled = true; } -void xlsx_drawing_context::set_crop_bottom(double val) +void xlsx_drawing_context::set_picture_crop_bottom(double val) { if (current_drawing_states == NULL) return; if (current_drawing_states->empty()) return; @@ -2757,7 +2801,7 @@ void xlsx_drawing_context::set_crop_bottom(double val) current_drawing_states->back()->fill.texture_crop[3] = val; current_drawing_states->back()->fill.texture_crop_enabled = true; } -void xlsx_drawing_context::set_crop_left (double val) +void xlsx_drawing_context::set_picture_crop_left (double val) { if (current_drawing_states == NULL) return; if (current_drawing_states->empty()) return; @@ -2765,7 +2809,7 @@ void xlsx_drawing_context::set_crop_left (double val) current_drawing_states->back()->fill.texture_crop[0] = val; current_drawing_states->back()->fill.texture_crop_enabled = true; } -void xlsx_drawing_context::set_crop_right (double val) +void xlsx_drawing_context::set_picture_crop_right (double val) { if (current_drawing_states == NULL) return; if (current_drawing_states->empty()) return; @@ -2773,6 +2817,30 @@ void xlsx_drawing_context::set_crop_right (double val) current_drawing_states->back()->fill.texture_crop[2] = val; current_drawing_states->back()->fill.texture_crop_enabled = true; } +void xlsx_drawing_context::set_picture_name(const std::wstring & str) +{ + //.... +} +void xlsx_drawing_context::set_picture_grayscale(bool val) +{ + current_drawing_states->back()->fill.grayscale = val; +} +void xlsx_drawing_context::set_picture_brightness(int val) +{ + current_drawing_states->back()->fill.brightness = val; +} +void xlsx_drawing_context::set_picture_contrast(int val) +{ + current_drawing_states->back()->fill.contrast = val; +} +void xlsx_drawing_context::set_picture_biLevel(int val) +{ + current_drawing_states->back()->fill.biLevel = val; +} +void xlsx_drawing_context::set_picture_transparent(int nColor, const std::wstring & sColor) +{ + //.... +} void xlsx_drawing_context::set_rotation (double val) { if (current_drawing_states == NULL) return; diff --git a/ASCOfficeXlsFile2/source/XlsXlsxConverter/xlsx_drawing_context.h b/ASCOfficeXlsFile2/source/XlsXlsxConverter/xlsx_drawing_context.h index 74a8abcf86..3f94f69978 100644 --- a/ASCOfficeXlsFile2/source/XlsXlsxConverter/xlsx_drawing_context.h +++ b/ASCOfficeXlsFile2/source/XlsXlsxConverter/xlsx_drawing_context.h @@ -164,6 +164,7 @@ public: std::wstring xmlGeomAlternative; std::wstring xmlTxBodyAlternative; std::wstring xmlFillAlternative; + std::wstring xmlEffectAlternative; std::wstring objectId; std::wstring objectProgId; @@ -264,24 +265,27 @@ public: _fill() { color.SetRGB(0xff, 0xff, 0xff); - angle = opacity = opacity2 = focus = 0; type = fillSolid; memset(texture_crop, 0, 4 * sizeof(double)); - texture_crop_enabled = false; } _color color; _color color2; - double opacity; - double opacity2; - _fill_type type; + double opacity = 0; + double opacity2 = 0; + _fill_type type = fillSolid; - int focus; - double angle; + int focus = 0; + double angle = 0; std::wstring texture_target; double texture_crop[4]; - bool texture_crop_enabled; + bool texture_crop_enabled = false; _texture_mode texture_mode; + _CP_OPT(int) contrast; + _CP_OPT(int) brightness; + _CP_OPT(bool) grayscale; + _CP_OPT(int) biLevel; + std::vector> colorsPosition; }fill; @@ -293,6 +297,8 @@ public: memset(fill.texture_crop, 0, 4 * sizeof(double)); fill.texture_crop_enabled = false; fill.colorsPosition.clear(); + + fill.contrast = fill.brightness = fill.grayscale = boost::none; } struct _arrow { @@ -398,10 +404,16 @@ public: void set_ole_object (const std::wstring & id, const std::wstring & info); void set_control_activeX (const std::wstring & id); - void set_crop_top (double val); - void set_crop_bottom (double val); - void set_crop_left (double val); - void set_crop_right (double val); + void set_picture_crop_top (double val); + void set_picture_crop_bottom(double val); + void set_picture_crop_left (double val); + void set_picture_crop_right (double val); + void set_picture_name (const std::wstring & str); + void set_picture_grayscale (bool val); + void set_picture_brightness (int val); + void set_picture_contrast (int val); + void set_picture_biLevel (int val); + void set_picture_transparent(int nColor, const std::wstring & sColor); void set_rotation (double val);