From ed5640d8b587fbcfed7dd7967f3de04b37a76f26 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 11:06:44 +0200 Subject: Adding upstream version 4:7.4.7. Signed-off-by: Daniel Baumann --- oox/source/core/binarycodec.cxx | 41 + oox/source/core/contexthandler.cxx | 134 + oox/source/core/contexthandler2.cxx | 340 + oox/source/core/fastparser.cxx | 139 + oox/source/core/fasttokenhandler.cxx | 82 + oox/source/core/filterbase.cxx | 596 + oox/source/core/filterdetect.cxx | 479 + oox/source/core/fragmenthandler.cxx | 119 + oox/source/core/fragmenthandler2.cxx | 155 + oox/source/core/recordparser.cxx | 326 + oox/source/core/relations.cxx | 158 + oox/source/core/relationshandler.cxx | 95 + oox/source/core/xmlfilterbase.cxx | 1235 ++ oox/source/crypto/AgileEngine.cxx | 843 + oox/source/crypto/CryptTools.cxx | 507 + oox/source/crypto/DocumentDecryption.cxx | 223 + oox/source/crypto/DocumentEncryption.cxx | 103 + oox/source/crypto/Standard2007Engine.cxx | 333 + oox/source/crypto/StrongEncryptionDataSpace.cxx | 203 + oox/source/docprop/docprophandler.cxx | 716 + oox/source/docprop/docprophandler.hxx | 88 + oox/source/docprop/ooxmldocpropimport.cxx | 229 + oox/source/docprop/ooxmldocpropimport.hxx | 63 + .../drawingml/ThemeOverrideFragmentHandler.cxx | 47 + oox/source/drawingml/chart/axiscontext.cxx | 298 + oox/source/drawingml/chart/axisconverter.cxx | 437 + oox/source/drawingml/chart/axismodel.cxx | 63 + oox/source/drawingml/chart/chartcontextbase.cxx | 107 + oox/source/drawingml/chart/chartconverter.cxx | 157 + .../drawingml/chart/chartdrawingfragment.cxx | 244 + oox/source/drawingml/chart/chartspaceconverter.cxx | 308 + oox/source/drawingml/chart/chartspacefragment.cxx | 124 + oox/source/drawingml/chart/chartspacemodel.cxx | 41 + oox/source/drawingml/chart/converterbase.cxx | 446 + oox/source/drawingml/chart/datasourcecontext.cxx | 335 + oox/source/drawingml/chart/datasourceconverter.cxx | 106 + oox/source/drawingml/chart/datasourcemodel.cxx | 46 + oox/source/drawingml/chart/datatablecontext.cxx | 68 + oox/source/drawingml/chart/datatableconverter.cxx | 50 + oox/source/drawingml/chart/modelbase.cxx | 54 + oox/source/drawingml/chart/objectformatter.cxx | 1151 ++ oox/source/drawingml/chart/plotareacontext.cxx | 175 + oox/source/drawingml/chart/plotareaconverter.cxx | 481 + oox/source/drawingml/chart/plotareamodel.cxx | 52 + oox/source/drawingml/chart/seriescontext.cxx | 749 + oox/source/drawingml/chart/seriesconverter.cxx | 920 + oox/source/drawingml/chart/seriesmodel.cxx | 127 + oox/source/drawingml/chart/titlecontext.cxx | 176 + oox/source/drawingml/chart/titleconverter.cxx | 363 + oox/source/drawingml/chart/titlemodel.cxx | 61 + oox/source/drawingml/chart/typegroupcontext.cxx | 371 + oox/source/drawingml/chart/typegroupconverter.cxx | 605 + oox/source/drawingml/chart/typegroupmodel.cxx | 67 + oox/source/drawingml/clrscheme.cxx | 125 + oox/source/drawingml/clrschemecontext.cxx | 102 + oox/source/drawingml/color.cxx | 873 + oox/source/drawingml/colorchoicecontext.cxx | 178 + oox/source/drawingml/connectorshapecontext.cxx | 128 + oox/source/drawingml/customshapegeometry.cxx | 1296 ++ oox/source/drawingml/customshapepresetdata.cxx | 974 + oox/source/drawingml/customshapeproperties.cxx | 364 + oox/source/drawingml/customshapes/README.md | 19 + oox/source/drawingml/customshapes/cshape.pptx | Bin 0 -> 48204 bytes oox/source/drawingml/customshapes/generate.sh | 38 + .../drawingml/customshapes/generatePresetsData.pl | 74 + .../drawingml/customshapes/generatePresetsPPTXs.pl | 193 + .../customshapes/oox-drawingml-cs-presets | 3179 +++ .../customshapes/presetShapeDefinitions.xml | 19898 +++++++++++++++++++ .../drawingml/diagram/constraintlistcontext.cxx | 78 + .../drawingml/diagram/constraintlistcontext.hxx | 43 + oox/source/drawingml/diagram/datamodel.cxx | 468 + oox/source/drawingml/diagram/datamodel.hxx | 80 + oox/source/drawingml/diagram/datamodelcontext.cxx | 385 + oox/source/drawingml/diagram/datamodelcontext.hxx | 45 + oox/source/drawingml/diagram/diagram.cxx | 444 + oox/source/drawingml/diagram/diagram.hxx | 171 + .../drawingml/diagram/diagramdefinitioncontext.cxx | 99 + .../drawingml/diagram/diagramdefinitioncontext.hxx | 44 + .../drawingml/diagram/diagramfragmenthandler.cxx | 234 + .../drawingml/diagram/diagramfragmenthandler.hxx | 103 + oox/source/drawingml/diagram/diagramhelper.cxx | 269 + oox/source/drawingml/diagram/diagramhelper.hxx | 94 + .../drawingml/diagram/diagramlayoutatoms.cxx | 2047 ++ .../drawingml/diagram/diagramlayoutatoms.hxx | 372 + .../drawingml/diagram/layoutatomvisitorbase.cxx | 176 + .../drawingml/diagram/layoutatomvisitorbase.hxx | 98 + .../drawingml/diagram/layoutatomvisitors.cxx | 269 + .../drawingml/diagram/layoutatomvisitors.hxx | 96 + oox/source/drawingml/diagram/layoutnodecontext.cxx | 309 + oox/source/drawingml/diagram/layoutnodecontext.hxx | 43 + oox/source/drawingml/diagram/rulelistcontext.cxx | 58 + oox/source/drawingml/diagram/rulelistcontext.hxx | 42 + oox/source/drawingml/drawingmltypes.cxx | 419 + oox/source/drawingml/effectproperties.cxx | 132 + oox/source/drawingml/effectproperties.hxx | 88 + oox/source/drawingml/effectpropertiescontext.cxx | 133 + oox/source/drawingml/embeddedwavaudiofile.cxx | 37 + oox/source/drawingml/fillproperties.cxx | 1257 ++ oox/source/drawingml/graphicshapecontext.cxx | 341 + oox/source/drawingml/guidcontext.cxx | 40 + oox/source/drawingml/hyperlinkcontext.cxx | 166 + oox/source/drawingml/hyperlinkcontext.hxx | 48 + oox/source/drawingml/lineproperties.cxx | 538 + oox/source/drawingml/linepropertiescontext.cxx | 137 + oox/source/drawingml/misccontexts.cxx | 386 + oox/source/drawingml/objectdefaultcontext.cxx | 53 + oox/source/drawingml/presetgeometrynames.cxx | 114 + oox/source/drawingml/scene3dcontext.cxx | 189 + oox/source/drawingml/shape.cxx | 2368 +++ oox/source/drawingml/shape3dproperties.cxx | 392 + oox/source/drawingml/shapecontext.cxx | 134 + oox/source/drawingml/shapegroupcontext.cxx | 117 + oox/source/drawingml/shapepropertiescontext.cxx | 103 + oox/source/drawingml/shapepropertymap.cxx | 238 + oox/source/drawingml/shapestylecontext.cxx | 70 + oox/source/drawingml/spdefcontext.cxx | 62 + .../drawingml/table/predefined-table-styles.cxx | 975 + .../table/tablebackgroundstylecontext.cxx | 74 + oox/source/drawingml/table/tablecell.cxx | 578 + oox/source/drawingml/table/tablecellcontext.cxx | 103 + oox/source/drawingml/table/tablecontext.cxx | 98 + .../drawingml/table/tablepartstylecontext.cxx | 60 + oox/source/drawingml/table/tableproperties.cxx | 216 + oox/source/drawingml/table/tablerow.cxx | 35 + oox/source/drawingml/table/tablerowcontext.cxx | 65 + oox/source/drawingml/table/tablestyle.cxx | 27 + .../drawingml/table/tablestylecellstylecontext.cxx | 110 + oox/source/drawingml/table/tablestylecontext.cxx | 89 + oox/source/drawingml/table/tablestylelist.cxx | 30 + .../table/tablestylelistfragmenthandler.cxx | 63 + oox/source/drawingml/table/tablestylepart.cxx | 33 + .../drawingml/table/tablestyletextstylecontext.cxx | 98 + oox/source/drawingml/textbody.cxx | 158 + oox/source/drawingml/textbodycontext.cxx | 221 + oox/source/drawingml/textbodyproperties.cxx | 190 + oox/source/drawingml/textbodypropertiescontext.cxx | 220 + oox/source/drawingml/textcharacterproperties.cxx | 248 + .../drawingml/textcharacterpropertiescontext.cxx | 334 + oox/source/drawingml/texteffectscontext.cxx | 318 + oox/source/drawingml/textfield.cxx | 274 + oox/source/drawingml/textfieldcontext.cxx | 78 + oox/source/drawingml/textfont.cxx | 96 + oox/source/drawingml/textliststyle.cxx | 81 + oox/source/drawingml/textliststylecontext.cxx | 78 + oox/source/drawingml/textparagraph.cxx | 220 + oox/source/drawingml/textparagraphproperties.cxx | 553 + .../drawingml/textparagraphpropertiescontext.cxx | 375 + oox/source/drawingml/textrun.cxx | 190 + oox/source/drawingml/textspacingcontext.cxx | 63 + oox/source/drawingml/textspacingcontext.hxx | 44 + oox/source/drawingml/texttabstoplistcontext.cxx | 73 + oox/source/drawingml/texttabstoplistcontext.hxx | 48 + oox/source/drawingml/theme.cxx | 122 + oox/source/drawingml/themeelementscontext.cxx | 243 + oox/source/drawingml/themefragmenthandler.cxx | 78 + oox/source/drawingml/transform2dcontext.cxx | 129 + oox/source/dump/biffdumper.ini | 2397 +++ oox/source/dump/dffdumper.cxx | 227 + oox/source/dump/dffdumper.ini | 676 + oox/source/dump/dumperbase.cxx | 2580 +++ oox/source/dump/dumperbase.ini | 412 + oox/source/dump/oledumper.cxx | 2085 ++ oox/source/dump/oledumper.ini | 904 + oox/source/dump/pptxdumper.cxx | 131 + oox/source/dump/pptxdumper.ini | 35 + oox/source/dump/xlsbdumper.ini | 1204 ++ oox/source/export/ColorPropertySet.cxx | 178 + oox/source/export/ColorPropertySet.hxx | 87 + oox/source/export/DMLPresetShapeExport.cxx | 1658 ++ oox/source/export/README | 2 + oox/source/export/chartexport.cxx | 4685 +++++ oox/source/export/drawingml.cxx | 6125 ++++++ oox/source/export/ooxml-export-notes.txt | 235 + .../export/preset-definitions-to-shape-types.pl | 1237 ++ oox/source/export/presetTextWarpDefinitions.xml | 1885 ++ oox/source/export/shapes.cxx | 2728 +++ oox/source/export/vmlexport.cxx | 1529 ++ oox/source/helper/attributelist.cxx | 361 + oox/source/helper/binaryinputstream.cxx | 322 + oox/source/helper/binaryoutputstream.cxx | 184 + oox/source/helper/binarystreambase.cxx | 146 + oox/source/helper/containerhelper.cxx | 126 + oox/source/helper/grabbagstack.cxx | 82 + oox/source/helper/graphichelper.cxx | 323 + oox/source/helper/modelobjecthelper.cxx | 159 + oox/source/helper/ooxresid.cxx | 17 + oox/source/helper/progressbar.cxx | 167 + oox/source/helper/propertymap.cxx | 956 + oox/source/helper/propertyset.cxx | 150 + oox/source/helper/storagebase.cxx | 255 + oox/source/helper/textinputstream.cxx | 208 + oox/source/helper/zipstorage.cxx | 203 + oox/source/mathml/export.cxx | 18 + oox/source/mathml/import.cxx | 114 + oox/source/mathml/importutils.cxx | 337 + oox/source/ole/axbinaryreader.cxx | 291 + oox/source/ole/axbinarywriter.cxx | 201 + oox/source/ole/axcontrol.cxx | 2786 +++ oox/source/ole/axcontrolfragment.cxx | 167 + oox/source/ole/axfontdata.cxx | 117 + oox/source/ole/olehelper.cxx | 571 + oox/source/ole/oleobjecthelper.cxx | 176 + oox/source/ole/olestorage.cxx | 376 + oox/source/ole/vbacontrol.cxx | 874 + oox/source/ole/vbaexport.cxx | 1193 ++ oox/source/ole/vbahelper.cxx | 59 + oox/source/ole/vbainputstream.cxx | 208 + oox/source/ole/vbamodule.cxx | 347 + oox/source/ole/vbaproject.cxx | 564 + oox/source/ppt/animationspersist.cxx | 220 + oox/source/ppt/animationtypes.cxx | 63 + oox/source/ppt/animationtypes.hxx | 35 + oox/source/ppt/animvariantcontext.cxx | 95 + oox/source/ppt/animvariantcontext.hxx | 50 + oox/source/ppt/backgroundproperties.cxx | 50 + oox/source/ppt/buildlistcontext.cxx | 84 + oox/source/ppt/buildlistcontext.hxx | 48 + oox/source/ppt/comments.cxx | 89 + oox/source/ppt/commonbehaviorcontext.cxx | 145 + oox/source/ppt/commonbehaviorcontext.hxx | 65 + oox/source/ppt/commontimenodecontext.cxx | 666 + oox/source/ppt/commontimenodecontext.hxx | 48 + oox/source/ppt/conditioncontext.cxx | 182 + oox/source/ppt/conditioncontext.hxx | 67 + oox/source/ppt/customshowlistcontext.cxx | 105 + oox/source/ppt/extdrawingfragmenthandler.cxx | 64 + oox/source/ppt/extdrawingfragmenthandler.hxx | 41 + oox/source/ppt/headerfootercontext.cxx | 58 + oox/source/ppt/headerfootercontext.hxx | 42 + oox/source/ppt/layoutfragmenthandler.cxx | 72 + oox/source/ppt/pptfilterhelpers.cxx | 422 + oox/source/ppt/pptgraphicshapecontext.cxx | 189 + oox/source/ppt/pptimport.cxx | 309 + oox/source/ppt/pptshape.cxx | 809 + oox/source/ppt/pptshapecontext.cxx | 195 + oox/source/ppt/pptshapegroupcontext.cxx | 158 + oox/source/ppt/pptshapepropertiescontext.cxx | 56 + oox/source/ppt/presPropsfragmenthandler.cxx | 89 + oox/source/ppt/presentationfragmenthandler.cxx | 792 + oox/source/ppt/slidefragmenthandler.cxx | 265 + oox/source/ppt/slidemastertextstylescontext.cxx | 79 + oox/source/ppt/slidepersist.cxx | 555 + oox/source/ppt/slidetimingcontext.cxx | 70 + oox/source/ppt/slidetransition.cxx | 467 + oox/source/ppt/slidetransitioncontext.cxx | 200 + oox/source/ppt/soundactioncontext.cxx | 109 + oox/source/ppt/timeanimvaluecontext.cxx | 84 + oox/source/ppt/timeanimvaluecontext.hxx | 51 + oox/source/ppt/timenode.cxx | 668 + oox/source/ppt/timenodelistcontext.cxx | 1048 + oox/source/ppt/timetargetelementcontext.cxx | 168 + oox/source/ppt/timetargetelementcontext.hxx | 45 + oox/source/shape/LockedCanvasContext.cxx | 97 + oox/source/shape/LockedCanvasContext.hxx | 37 + oox/source/shape/ShapeContextHandler.cxx | 584 + oox/source/shape/ShapeDrawingFragmentHandler.cxx | 48 + oox/source/shape/ShapeDrawingFragmentHandler.hxx | 35 + oox/source/shape/ShapeFilterBase.cxx | 137 + oox/source/shape/WpgContext.cxx | 99 + oox/source/shape/WpgContext.hxx | 43 + oox/source/shape/WpsContext.cxx | 338 + oox/source/shape/WpsContext.hxx | 45 + oox/source/token/namespacemap.cxx | 43 + oox/source/token/namespaces-strict.txt | 99 + oox/source/token/namespaces.hxx.head | 25 + oox/source/token/namespaces.hxx.tail | 71 + oox/source/token/namespaces.py | 85 + oox/source/token/namespaces.txt | 99 + oox/source/token/parsexsd.pl | 66 + oox/source/token/properties.hxx.head | 24 + oox/source/token/properties.hxx.tail | 6 + oox/source/token/properties.py | 50 + oox/source/token/properties.txt | 611 + oox/source/token/propertynames.cxx | 35 + oox/source/token/relationship.cxx | 34 + oox/source/token/relationship.inc | 48 + oox/source/token/tokenmap.cxx | 98 + oox/source/token/tokens.hxx.head | 24 + oox/source/token/tokens.hxx.tail | 8 + oox/source/token/tokens.txt | 5890 ++++++ oox/source/vml/vmldrawing.cxx | 346 + oox/source/vml/vmldrawingfragment.cxx | 82 + oox/source/vml/vmlformatting.cxx | 1001 + oox/source/vml/vmlinputstream.cxx | 393 + oox/source/vml/vmlshape.cxx | 1574 ++ oox/source/vml/vmlshapecontainer.cxx | 138 + oox/source/vml/vmlshapecontext.cxx | 731 + oox/source/vml/vmltextbox.cxx | 204 + oox/source/vml/vmltextboxcontext.cxx | 287 + 289 files changed, 129304 insertions(+) create mode 100644 oox/source/core/binarycodec.cxx create mode 100644 oox/source/core/contexthandler.cxx create mode 100644 oox/source/core/contexthandler2.cxx create mode 100644 oox/source/core/fastparser.cxx create mode 100644 oox/source/core/fasttokenhandler.cxx create mode 100644 oox/source/core/filterbase.cxx create mode 100644 oox/source/core/filterdetect.cxx create mode 100644 oox/source/core/fragmenthandler.cxx create mode 100644 oox/source/core/fragmenthandler2.cxx create mode 100644 oox/source/core/recordparser.cxx create mode 100644 oox/source/core/relations.cxx create mode 100644 oox/source/core/relationshandler.cxx create mode 100644 oox/source/core/xmlfilterbase.cxx create mode 100644 oox/source/crypto/AgileEngine.cxx create mode 100644 oox/source/crypto/CryptTools.cxx create mode 100644 oox/source/crypto/DocumentDecryption.cxx create mode 100644 oox/source/crypto/DocumentEncryption.cxx create mode 100644 oox/source/crypto/Standard2007Engine.cxx create mode 100644 oox/source/crypto/StrongEncryptionDataSpace.cxx create mode 100644 oox/source/docprop/docprophandler.cxx create mode 100644 oox/source/docprop/docprophandler.hxx create mode 100644 oox/source/docprop/ooxmldocpropimport.cxx create mode 100644 oox/source/docprop/ooxmldocpropimport.hxx create mode 100644 oox/source/drawingml/ThemeOverrideFragmentHandler.cxx create mode 100644 oox/source/drawingml/chart/axiscontext.cxx create mode 100644 oox/source/drawingml/chart/axisconverter.cxx create mode 100644 oox/source/drawingml/chart/axismodel.cxx create mode 100644 oox/source/drawingml/chart/chartcontextbase.cxx create mode 100644 oox/source/drawingml/chart/chartconverter.cxx create mode 100644 oox/source/drawingml/chart/chartdrawingfragment.cxx create mode 100644 oox/source/drawingml/chart/chartspaceconverter.cxx create mode 100644 oox/source/drawingml/chart/chartspacefragment.cxx create mode 100644 oox/source/drawingml/chart/chartspacemodel.cxx create mode 100644 oox/source/drawingml/chart/converterbase.cxx create mode 100644 oox/source/drawingml/chart/datasourcecontext.cxx create mode 100644 oox/source/drawingml/chart/datasourceconverter.cxx create mode 100644 oox/source/drawingml/chart/datasourcemodel.cxx create mode 100644 oox/source/drawingml/chart/datatablecontext.cxx create mode 100644 oox/source/drawingml/chart/datatableconverter.cxx create mode 100644 oox/source/drawingml/chart/modelbase.cxx create mode 100644 oox/source/drawingml/chart/objectformatter.cxx create mode 100644 oox/source/drawingml/chart/plotareacontext.cxx create mode 100644 oox/source/drawingml/chart/plotareaconverter.cxx create mode 100644 oox/source/drawingml/chart/plotareamodel.cxx create mode 100644 oox/source/drawingml/chart/seriescontext.cxx create mode 100644 oox/source/drawingml/chart/seriesconverter.cxx create mode 100644 oox/source/drawingml/chart/seriesmodel.cxx create mode 100644 oox/source/drawingml/chart/titlecontext.cxx create mode 100644 oox/source/drawingml/chart/titleconverter.cxx create mode 100644 oox/source/drawingml/chart/titlemodel.cxx create mode 100644 oox/source/drawingml/chart/typegroupcontext.cxx create mode 100644 oox/source/drawingml/chart/typegroupconverter.cxx create mode 100644 oox/source/drawingml/chart/typegroupmodel.cxx create mode 100644 oox/source/drawingml/clrscheme.cxx create mode 100644 oox/source/drawingml/clrschemecontext.cxx create mode 100644 oox/source/drawingml/color.cxx create mode 100644 oox/source/drawingml/colorchoicecontext.cxx create mode 100644 oox/source/drawingml/connectorshapecontext.cxx create mode 100644 oox/source/drawingml/customshapegeometry.cxx create mode 100644 oox/source/drawingml/customshapepresetdata.cxx create mode 100644 oox/source/drawingml/customshapeproperties.cxx create mode 100644 oox/source/drawingml/customshapes/README.md create mode 100644 oox/source/drawingml/customshapes/cshape.pptx create mode 100755 oox/source/drawingml/customshapes/generate.sh create mode 100755 oox/source/drawingml/customshapes/generatePresetsData.pl create mode 100755 oox/source/drawingml/customshapes/generatePresetsPPTXs.pl create mode 100644 oox/source/drawingml/customshapes/oox-drawingml-cs-presets create mode 100644 oox/source/drawingml/customshapes/presetShapeDefinitions.xml create mode 100644 oox/source/drawingml/diagram/constraintlistcontext.cxx create mode 100644 oox/source/drawingml/diagram/constraintlistcontext.hxx create mode 100644 oox/source/drawingml/diagram/datamodel.cxx create mode 100644 oox/source/drawingml/diagram/datamodel.hxx create mode 100644 oox/source/drawingml/diagram/datamodelcontext.cxx create mode 100644 oox/source/drawingml/diagram/datamodelcontext.hxx create mode 100644 oox/source/drawingml/diagram/diagram.cxx create mode 100644 oox/source/drawingml/diagram/diagram.hxx create mode 100644 oox/source/drawingml/diagram/diagramdefinitioncontext.cxx create mode 100644 oox/source/drawingml/diagram/diagramdefinitioncontext.hxx create mode 100644 oox/source/drawingml/diagram/diagramfragmenthandler.cxx create mode 100644 oox/source/drawingml/diagram/diagramfragmenthandler.hxx create mode 100644 oox/source/drawingml/diagram/diagramhelper.cxx create mode 100644 oox/source/drawingml/diagram/diagramhelper.hxx create mode 100644 oox/source/drawingml/diagram/diagramlayoutatoms.cxx create mode 100644 oox/source/drawingml/diagram/diagramlayoutatoms.hxx create mode 100644 oox/source/drawingml/diagram/layoutatomvisitorbase.cxx create mode 100644 oox/source/drawingml/diagram/layoutatomvisitorbase.hxx create mode 100644 oox/source/drawingml/diagram/layoutatomvisitors.cxx create mode 100644 oox/source/drawingml/diagram/layoutatomvisitors.hxx create mode 100644 oox/source/drawingml/diagram/layoutnodecontext.cxx create mode 100644 oox/source/drawingml/diagram/layoutnodecontext.hxx create mode 100644 oox/source/drawingml/diagram/rulelistcontext.cxx create mode 100644 oox/source/drawingml/diagram/rulelistcontext.hxx create mode 100644 oox/source/drawingml/drawingmltypes.cxx create mode 100644 oox/source/drawingml/effectproperties.cxx create mode 100644 oox/source/drawingml/effectproperties.hxx create mode 100644 oox/source/drawingml/effectpropertiescontext.cxx create mode 100644 oox/source/drawingml/embeddedwavaudiofile.cxx create mode 100644 oox/source/drawingml/fillproperties.cxx create mode 100644 oox/source/drawingml/graphicshapecontext.cxx create mode 100644 oox/source/drawingml/guidcontext.cxx create mode 100644 oox/source/drawingml/hyperlinkcontext.cxx create mode 100644 oox/source/drawingml/hyperlinkcontext.hxx create mode 100644 oox/source/drawingml/lineproperties.cxx create mode 100644 oox/source/drawingml/linepropertiescontext.cxx create mode 100644 oox/source/drawingml/misccontexts.cxx create mode 100644 oox/source/drawingml/objectdefaultcontext.cxx create mode 100644 oox/source/drawingml/presetgeometrynames.cxx create mode 100644 oox/source/drawingml/scene3dcontext.cxx create mode 100644 oox/source/drawingml/shape.cxx create mode 100644 oox/source/drawingml/shape3dproperties.cxx create mode 100644 oox/source/drawingml/shapecontext.cxx create mode 100644 oox/source/drawingml/shapegroupcontext.cxx create mode 100644 oox/source/drawingml/shapepropertiescontext.cxx create mode 100644 oox/source/drawingml/shapepropertymap.cxx create mode 100644 oox/source/drawingml/shapestylecontext.cxx create mode 100644 oox/source/drawingml/spdefcontext.cxx create mode 100644 oox/source/drawingml/table/predefined-table-styles.cxx create mode 100644 oox/source/drawingml/table/tablebackgroundstylecontext.cxx create mode 100644 oox/source/drawingml/table/tablecell.cxx create mode 100644 oox/source/drawingml/table/tablecellcontext.cxx create mode 100644 oox/source/drawingml/table/tablecontext.cxx create mode 100644 oox/source/drawingml/table/tablepartstylecontext.cxx create mode 100644 oox/source/drawingml/table/tableproperties.cxx create mode 100644 oox/source/drawingml/table/tablerow.cxx create mode 100644 oox/source/drawingml/table/tablerowcontext.cxx create mode 100644 oox/source/drawingml/table/tablestyle.cxx create mode 100644 oox/source/drawingml/table/tablestylecellstylecontext.cxx create mode 100644 oox/source/drawingml/table/tablestylecontext.cxx create mode 100644 oox/source/drawingml/table/tablestylelist.cxx create mode 100644 oox/source/drawingml/table/tablestylelistfragmenthandler.cxx create mode 100644 oox/source/drawingml/table/tablestylepart.cxx create mode 100644 oox/source/drawingml/table/tablestyletextstylecontext.cxx create mode 100644 oox/source/drawingml/textbody.cxx create mode 100644 oox/source/drawingml/textbodycontext.cxx create mode 100644 oox/source/drawingml/textbodyproperties.cxx create mode 100644 oox/source/drawingml/textbodypropertiescontext.cxx create mode 100644 oox/source/drawingml/textcharacterproperties.cxx create mode 100644 oox/source/drawingml/textcharacterpropertiescontext.cxx create mode 100644 oox/source/drawingml/texteffectscontext.cxx create mode 100644 oox/source/drawingml/textfield.cxx create mode 100644 oox/source/drawingml/textfieldcontext.cxx create mode 100644 oox/source/drawingml/textfont.cxx create mode 100644 oox/source/drawingml/textliststyle.cxx create mode 100644 oox/source/drawingml/textliststylecontext.cxx create mode 100644 oox/source/drawingml/textparagraph.cxx create mode 100644 oox/source/drawingml/textparagraphproperties.cxx create mode 100644 oox/source/drawingml/textparagraphpropertiescontext.cxx create mode 100644 oox/source/drawingml/textrun.cxx create mode 100644 oox/source/drawingml/textspacingcontext.cxx create mode 100644 oox/source/drawingml/textspacingcontext.hxx create mode 100644 oox/source/drawingml/texttabstoplistcontext.cxx create mode 100644 oox/source/drawingml/texttabstoplistcontext.hxx create mode 100644 oox/source/drawingml/theme.cxx create mode 100644 oox/source/drawingml/themeelementscontext.cxx create mode 100644 oox/source/drawingml/themefragmenthandler.cxx create mode 100644 oox/source/drawingml/transform2dcontext.cxx create mode 100644 oox/source/dump/biffdumper.ini create mode 100644 oox/source/dump/dffdumper.cxx create mode 100644 oox/source/dump/dffdumper.ini create mode 100644 oox/source/dump/dumperbase.cxx create mode 100644 oox/source/dump/dumperbase.ini create mode 100644 oox/source/dump/oledumper.cxx create mode 100644 oox/source/dump/oledumper.ini create mode 100644 oox/source/dump/pptxdumper.cxx create mode 100644 oox/source/dump/pptxdumper.ini create mode 100644 oox/source/dump/xlsbdumper.ini create mode 100644 oox/source/export/ColorPropertySet.cxx create mode 100644 oox/source/export/ColorPropertySet.hxx create mode 100644 oox/source/export/DMLPresetShapeExport.cxx create mode 100644 oox/source/export/README create mode 100644 oox/source/export/chartexport.cxx create mode 100644 oox/source/export/drawingml.cxx create mode 100644 oox/source/export/ooxml-export-notes.txt create mode 100644 oox/source/export/preset-definitions-to-shape-types.pl create mode 100644 oox/source/export/presetTextWarpDefinitions.xml create mode 100644 oox/source/export/shapes.cxx create mode 100644 oox/source/export/vmlexport.cxx create mode 100644 oox/source/helper/attributelist.cxx create mode 100644 oox/source/helper/binaryinputstream.cxx create mode 100644 oox/source/helper/binaryoutputstream.cxx create mode 100644 oox/source/helper/binarystreambase.cxx create mode 100644 oox/source/helper/containerhelper.cxx create mode 100644 oox/source/helper/grabbagstack.cxx create mode 100644 oox/source/helper/graphichelper.cxx create mode 100644 oox/source/helper/modelobjecthelper.cxx create mode 100644 oox/source/helper/ooxresid.cxx create mode 100644 oox/source/helper/progressbar.cxx create mode 100644 oox/source/helper/propertymap.cxx create mode 100644 oox/source/helper/propertyset.cxx create mode 100644 oox/source/helper/storagebase.cxx create mode 100644 oox/source/helper/textinputstream.cxx create mode 100644 oox/source/helper/zipstorage.cxx create mode 100644 oox/source/mathml/export.cxx create mode 100644 oox/source/mathml/import.cxx create mode 100644 oox/source/mathml/importutils.cxx create mode 100644 oox/source/ole/axbinaryreader.cxx create mode 100644 oox/source/ole/axbinarywriter.cxx create mode 100644 oox/source/ole/axcontrol.cxx create mode 100644 oox/source/ole/axcontrolfragment.cxx create mode 100644 oox/source/ole/axfontdata.cxx create mode 100644 oox/source/ole/olehelper.cxx create mode 100644 oox/source/ole/oleobjecthelper.cxx create mode 100644 oox/source/ole/olestorage.cxx create mode 100644 oox/source/ole/vbacontrol.cxx create mode 100644 oox/source/ole/vbaexport.cxx create mode 100644 oox/source/ole/vbahelper.cxx create mode 100644 oox/source/ole/vbainputstream.cxx create mode 100644 oox/source/ole/vbamodule.cxx create mode 100644 oox/source/ole/vbaproject.cxx create mode 100644 oox/source/ppt/animationspersist.cxx create mode 100644 oox/source/ppt/animationtypes.cxx create mode 100644 oox/source/ppt/animationtypes.hxx create mode 100644 oox/source/ppt/animvariantcontext.cxx create mode 100644 oox/source/ppt/animvariantcontext.hxx create mode 100644 oox/source/ppt/backgroundproperties.cxx create mode 100644 oox/source/ppt/buildlistcontext.cxx create mode 100644 oox/source/ppt/buildlistcontext.hxx create mode 100644 oox/source/ppt/comments.cxx create mode 100644 oox/source/ppt/commonbehaviorcontext.cxx create mode 100644 oox/source/ppt/commonbehaviorcontext.hxx create mode 100644 oox/source/ppt/commontimenodecontext.cxx create mode 100644 oox/source/ppt/commontimenodecontext.hxx create mode 100644 oox/source/ppt/conditioncontext.cxx create mode 100644 oox/source/ppt/conditioncontext.hxx create mode 100644 oox/source/ppt/customshowlistcontext.cxx create mode 100644 oox/source/ppt/extdrawingfragmenthandler.cxx create mode 100644 oox/source/ppt/extdrawingfragmenthandler.hxx create mode 100644 oox/source/ppt/headerfootercontext.cxx create mode 100644 oox/source/ppt/headerfootercontext.hxx create mode 100644 oox/source/ppt/layoutfragmenthandler.cxx create mode 100644 oox/source/ppt/pptfilterhelpers.cxx create mode 100644 oox/source/ppt/pptgraphicshapecontext.cxx create mode 100644 oox/source/ppt/pptimport.cxx create mode 100644 oox/source/ppt/pptshape.cxx create mode 100644 oox/source/ppt/pptshapecontext.cxx create mode 100644 oox/source/ppt/pptshapegroupcontext.cxx create mode 100644 oox/source/ppt/pptshapepropertiescontext.cxx create mode 100644 oox/source/ppt/presPropsfragmenthandler.cxx create mode 100644 oox/source/ppt/presentationfragmenthandler.cxx create mode 100644 oox/source/ppt/slidefragmenthandler.cxx create mode 100644 oox/source/ppt/slidemastertextstylescontext.cxx create mode 100644 oox/source/ppt/slidepersist.cxx create mode 100644 oox/source/ppt/slidetimingcontext.cxx create mode 100644 oox/source/ppt/slidetransition.cxx create mode 100644 oox/source/ppt/slidetransitioncontext.cxx create mode 100644 oox/source/ppt/soundactioncontext.cxx create mode 100644 oox/source/ppt/timeanimvaluecontext.cxx create mode 100644 oox/source/ppt/timeanimvaluecontext.hxx create mode 100644 oox/source/ppt/timenode.cxx create mode 100644 oox/source/ppt/timenodelistcontext.cxx create mode 100644 oox/source/ppt/timetargetelementcontext.cxx create mode 100644 oox/source/ppt/timetargetelementcontext.hxx create mode 100644 oox/source/shape/LockedCanvasContext.cxx create mode 100644 oox/source/shape/LockedCanvasContext.hxx create mode 100644 oox/source/shape/ShapeContextHandler.cxx create mode 100644 oox/source/shape/ShapeDrawingFragmentHandler.cxx create mode 100644 oox/source/shape/ShapeDrawingFragmentHandler.hxx create mode 100644 oox/source/shape/ShapeFilterBase.cxx create mode 100644 oox/source/shape/WpgContext.cxx create mode 100644 oox/source/shape/WpgContext.hxx create mode 100644 oox/source/shape/WpsContext.cxx create mode 100644 oox/source/shape/WpsContext.hxx create mode 100644 oox/source/token/namespacemap.cxx create mode 100644 oox/source/token/namespaces-strict.txt create mode 100644 oox/source/token/namespaces.hxx.head create mode 100644 oox/source/token/namespaces.hxx.tail create mode 100644 oox/source/token/namespaces.py create mode 100644 oox/source/token/namespaces.txt create mode 100644 oox/source/token/parsexsd.pl create mode 100644 oox/source/token/properties.hxx.head create mode 100644 oox/source/token/properties.hxx.tail create mode 100644 oox/source/token/properties.py create mode 100644 oox/source/token/properties.txt create mode 100644 oox/source/token/propertynames.cxx create mode 100644 oox/source/token/relationship.cxx create mode 100644 oox/source/token/relationship.inc create mode 100644 oox/source/token/tokenmap.cxx create mode 100644 oox/source/token/tokens.hxx.head create mode 100644 oox/source/token/tokens.hxx.tail create mode 100644 oox/source/token/tokens.txt create mode 100644 oox/source/vml/vmldrawing.cxx create mode 100644 oox/source/vml/vmldrawingfragment.cxx create mode 100644 oox/source/vml/vmlformatting.cxx create mode 100644 oox/source/vml/vmlinputstream.cxx create mode 100644 oox/source/vml/vmlshape.cxx create mode 100644 oox/source/vml/vmlshapecontainer.cxx create mode 100644 oox/source/vml/vmlshapecontext.cxx create mode 100644 oox/source/vml/vmltextbox.cxx create mode 100644 oox/source/vml/vmltextboxcontext.cxx (limited to 'oox/source') diff --git a/oox/source/core/binarycodec.cxx b/oox/source/core/binarycodec.cxx new file mode 100644 index 000000000..7266e254b --- /dev/null +++ b/oox/source/core/binarycodec.cxx @@ -0,0 +1,41 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include + +#include + +#include + +using namespace ::com::sun::star; + +namespace oox::core { + +sal_uInt16 CodecHelper::getPasswordHash( const AttributeList& rAttribs, sal_Int32 nElement ) +{ + sal_Int32 nPasswordHash = rAttribs.getIntegerHex( nElement, 0 ); + OSL_ENSURE( (0 <= nPasswordHash) && (nPasswordHash <= SAL_MAX_UINT16), "CodecHelper::getPasswordHash - invalid password hash" ); + return static_cast< sal_uInt16 >( ((0 <= nPasswordHash) && (nPasswordHash <= SAL_MAX_UINT16)) ? nPasswordHash : 0 ); +} + + + +} // namespace oox::core + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/core/contexthandler.cxx b/oox/source/core/contexthandler.cxx new file mode 100644 index 000000000..80e274c4a --- /dev/null +++ b/oox/source/core/contexthandler.cxx @@ -0,0 +1,134 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include + +#include + +namespace oox::core { + +using namespace ::com::sun::star::uno; +using namespace ::com::sun::star::xml::sax; + +ContextHandler::ContextHandler( const ContextHandler& rParent ) : + ContextHandler_BASE(rParent), + mxBaseData( rParent.mxBaseData ) +{ +} + +ContextHandler::ContextHandler( const FragmentBaseDataRef& rxBaseData ) : + mxBaseData( rxBaseData ) +{ +} + +ContextHandler::~ContextHandler() +{ +} + +XmlFilterBase& ContextHandler::getFilter() const +{ + return mxBaseData->mrFilter; +} + +const Relations& ContextHandler::getRelations() const +{ + return *mxBaseData->mxRelations; +} + +const OUString& ContextHandler::getFragmentPath() const +{ + return mxBaseData->maFragmentPath; +} + +OUString ContextHandler::getFragmentPathFromRelation( const Relation& rRelation ) const +{ + return mxBaseData->mxRelations->getFragmentPathFromRelation( rRelation ); +} + +OUString ContextHandler::getFragmentPathFromRelId( const OUString& rRelId ) const +{ + return mxBaseData->mxRelations->getFragmentPathFromRelId( rRelId ); +} + +OUString ContextHandler::getFragmentPathFromFirstType( std::u16string_view rType ) const +{ + return mxBaseData->mxRelations->getFragmentPathFromFirstType( rType ); +} + +OUString ContextHandler::getFragmentPathFromFirstTypeFromOfficeDoc( std::u16string_view rType ) + const +{ + return mxBaseData->mxRelations->getFragmentPathFromFirstTypeFromOfficeDoc( rType ); +} + +void ContextHandler::implSetLocator( const Reference< XLocator >& rxLocator ) +{ + mxBaseData->mxLocator = rxLocator; +} + +// com.sun.star.xml.sax.XFastContextHandler interface ------------------------- + +void ContextHandler::startFastElement( sal_Int32, const Reference< XFastAttributeList >& ) +{ +} + +void ContextHandler::startUnknownElement( const OUString&, const OUString&, const Reference< XFastAttributeList >& ) +{ +} + +void ContextHandler::endFastElement( sal_Int32 ) +{ +} + +void ContextHandler::endUnknownElement( const OUString&, const OUString& ) +{ +} + +Reference< XFastContextHandler > ContextHandler::createFastChildContext( sal_Int32, const Reference< XFastAttributeList >& ) +{ + return nullptr; +} + +Reference< XFastContextHandler > ContextHandler::createUnknownChildContext( const OUString&, const OUString&, const Reference< XFastAttributeList >& ) +{ + return nullptr; +} + +void ContextHandler::characters( const OUString& ) +{ +} + +// record context interface --------------------------------------------------- + +ContextHandlerRef ContextHandler::createRecordContext( sal_Int32, SequenceInputStream& ) +{ + return nullptr; +} + +void ContextHandler::startRecord( sal_Int32, SequenceInputStream& ) +{ +} + +void ContextHandler::endRecord( sal_Int32 ) +{ +} + +} // namespace oox::core + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/core/contexthandler2.cxx b/oox/source/core/contexthandler2.cxx new file mode 100644 index 000000000..1613a3d33 --- /dev/null +++ b/oox/source/core/contexthandler2.cxx @@ -0,0 +1,340 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace oox::core { + +using namespace ::com::sun::star::uno; +using namespace ::com::sun::star::lang; +using namespace ::com::sun::star::xml::sax; + +/** Information about a processed element. */ +struct ElementInfo +{ + OUStringBuffer maChars; /// Collected element characters. + sal_Int32 mnElement; /// The element identifier. + bool mbTrimSpaces; /// True = trims leading/trailing spaces from text data. + + explicit ElementInfo() : maChars( 0), mnElement( XML_TOKEN_INVALID ), mbTrimSpaces( false ) {} +}; + +ContextHandler2Helper::ContextHandler2Helper( bool bEnableTrimSpace, XmlFilterBase& rFilter ) : + mxContextStack( std::make_shared() ), + mnRootStackSize( 0 ), + mbEnableTrimSpace( bEnableTrimSpace ), + mrFilter( rFilter ) +{ + pushElementInfo( XML_ROOT_CONTEXT ); +} + +ContextHandler2Helper::ContextHandler2Helper( const ContextHandler2Helper& rParent ) : + mxContextStack( rParent.mxContextStack ), + mnRootStackSize( rParent.mxContextStack->size() ), + mbEnableTrimSpace( rParent.mbEnableTrimSpace ), + mrFilter(rParent.mrFilter) +{ +} + +ContextHandler2Helper::~ContextHandler2Helper() +{ +} + +sal_Int32 ContextHandler2Helper::getCurrentElementWithMce() const +{ + return mxContextStack->empty() ? XML_ROOT_CONTEXT : mxContextStack->back().mnElement; +} + +sal_Int32 ContextHandler2Helper::getCurrentElement() const +{ + auto It = std::find_if(mxContextStack->rbegin(), mxContextStack->rend(), + [](const ElementInfo& rItem) { return getNamespace(rItem.mnElement) != NMSP_mce; }); + if (It != mxContextStack->rend()) + return It->mnElement; + return XML_ROOT_CONTEXT; +} + +sal_Int32 ContextHandler2Helper::getParentElement( sal_Int32 nCountBack ) const +{ + if( (nCountBack < 0) || (mxContextStack->size() < o3tl::make_unsigned( nCountBack )) ) + return XML_TOKEN_INVALID; + return (mxContextStack->size() == static_cast< size_t >( nCountBack )) ? + XML_ROOT_CONTEXT : (*mxContextStack)[ mxContextStack->size() - nCountBack - 1 ].mnElement; +} + +bool ContextHandler2Helper::isRootElement() const +{ + return mxContextStack->size() == mnRootStackSize + 1; +} + +Reference< XFastContextHandler > ContextHandler2Helper::implCreateChildContext( + sal_Int32 nElement, const Reference< XFastAttributeList >& rxAttribs ) +{ + // #i76091# process collected characters (calls onCharacters() if needed) + processCollectedChars(); + ContextHandlerRef xContext = onCreateContext( nElement, AttributeList( rxAttribs ) ); + return xContext; +} + +void ContextHandler2Helper::implStartElement( sal_Int32 nElement, const Reference< XFastAttributeList >& rxAttribs ) +{ + AttributeList aAttribs( rxAttribs ); + pushElementInfo( nElement ).mbTrimSpaces = aAttribs.getToken( XML_TOKEN( space ), XML_TOKEN_INVALID ) != XML_preserve; + onStartElement( aAttribs ); +} + +void ContextHandler2Helper::implCharacters( std::u16string_view rChars ) +{ + // #i76091# collect characters until new element starts or this element ends + if( !mxContextStack->empty() ) + mxContextStack->back().maChars.append(rChars); +} + +void ContextHandler2Helper::implEndElement( sal_Int32 nElement ) +{ + OSL_ENSURE( getCurrentElementWithMce() == nElement, "ContextHandler2Helper::implEndElement - context stack broken" ); + if( !mxContextStack->empty() ) + { + // #i76091# process collected characters (calls onCharacters() if needed) + processCollectedChars(); + onEndElement(); + popElementInfo(); + } +} + +ContextHandlerRef ContextHandler2Helper::implCreateRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm ) +{ + return onCreateRecordContext( nRecId, rStrm ); +} + +void ContextHandler2Helper::implStartRecord( sal_Int32 nRecId, SequenceInputStream& rStrm ) +{ + pushElementInfo( nRecId ); + onStartRecord( rStrm ); +} + +void ContextHandler2Helper::implEndRecord( sal_Int32 nRecId ) +{ + OSL_ENSURE( getCurrentElementWithMce() == nRecId, "ContextHandler2Helper::implEndRecord - context stack broken" ); + if( !mxContextStack->empty() ) + { + onEndRecord(); + popElementInfo(); + } +} + +ElementInfo& ContextHandler2Helper::pushElementInfo( sal_Int32 nElement ) +{ + mxContextStack->emplace_back(); + ElementInfo& rInfo = mxContextStack->back(); + rInfo.mnElement = nElement; + return rInfo; +} + +void ContextHandler2Helper::popElementInfo() +{ + OSL_ENSURE( !mxContextStack->empty(), "ContextHandler2Helper::popElementInfo - context stack broken" ); + if( !mxContextStack->empty() ) + mxContextStack->pop_back(); +} + +void ContextHandler2Helper::processCollectedChars() +{ + OSL_ENSURE( !mxContextStack->empty(), "ContextHandler2Helper::processCollectedChars - no context info" ); + if (mxContextStack->empty()) + return; + ElementInfo& rInfo = mxContextStack->back(); + if( !rInfo.maChars.isEmpty() ) + { + OUString aChars = rInfo.maChars.makeStringAndClear(); + if( mbEnableTrimSpace && rInfo.mbTrimSpaces ) + aChars = aChars.trim(); + if( !aChars.isEmpty() ) + onCharacters( aChars ); + } +} + +ContextHandler2::ContextHandler2( ContextHandler2Helper const & rParent ) : + ContextHandler( dynamic_cast< ContextHandler const & >( rParent ) ), + ContextHandler2Helper( rParent ) +{ +} + +ContextHandler2::~ContextHandler2() +{ +} + +// com.sun.star.xml.sax.XFastContextHandler interface ------------------------- + +Reference< XFastContextHandler > SAL_CALL ContextHandler2::createFastChildContext( + sal_Int32 nElement, const Reference< XFastAttributeList >& rxAttribs ) +{ + if( getNamespace( nElement ) == NMSP_mce ) // TODO for checking 'Ignorable' + { + if( prepareMceContext( nElement, AttributeList( rxAttribs ) ) ) + return this; + return nullptr; + } + + return implCreateChildContext( nElement, rxAttribs ); +} + +void SAL_CALL ContextHandler2::startFastElement( + sal_Int32 nElement, const Reference< XFastAttributeList >& rxAttribs ) +{ + implStartElement( nElement, rxAttribs ); +} + +void SAL_CALL ContextHandler2::characters( const OUString& rChars ) +{ + implCharacters( rChars ); +} + +void SAL_CALL ContextHandler2::endFastElement( sal_Int32 nElement ) +{ + implEndElement( nElement ); +} + +bool ContextHandler2Helper::prepareMceContext( sal_Int32 nElement, const AttributeList& rAttribs ) +{ + switch( nElement ) + { + case MCE_TOKEN( AlternateContent ): + addMCEState( MCE_STATE::Started ); + break; + + case MCE_TOKEN( Choice ): + { + if (isMCEStateEmpty() || getMCEState() != MCE_STATE::Started) + return false; + + OUString aRequires = rAttribs.getString( XML_Requires, "none" ); + + // At this point we can't access namespaces as the correct xml filter + // is long gone. For now let's decide depending on a list of supported + // namespaces like we do in writerfilter + + std::vector aSupportedNS = + { + "a14", // Impress needs this to import math formulas. + "p14", + "p15", + "x12ac", + "v" + }; + + Reference xModel(getDocFilter().getModel(), UNO_QUERY); + if (xModel.is() && xModel->supportsService("com.sun.star.sheet.SpreadsheetDocument")) + { + // No a14 for Calc documents, it would cause duplicated shapes as-is. + auto it = std::find(aSupportedNS.begin(), aSupportedNS.end(), "a14"); + if (it != aSupportedNS.end()) + { + aSupportedNS.erase(it); + } + } + + if (std::find(aSupportedNS.begin(), aSupportedNS.end(), aRequires) != aSupportedNS.end()) + setMCEState( MCE_STATE::FoundChoice ) ; + else + return false; + } + break; + + case MCE_TOKEN( Fallback ): + if( !isMCEStateEmpty() && getMCEState() == MCE_STATE::Started ) + break; + return false; + default: + { + OUString str = rAttribs.getString( MCE_TOKEN( Ignorable ), OUString() ); + if( !str.isEmpty() ) + { + // Sequence< css::xml::FastAttribute > attrs = rAttribs.getFastAttributeList()->getFastAttributes(); + // printf("MCE: %s\n", OUStringToOString( str, RTL_TEXTENCODING_UTF8 ).getStr() ); + // TODO: Check & Get the namespaces in "Ignorable" + // printf("NS: %d : %s\n", attrs.getLength(), OUStringToOString( str, RTL_TEXTENCODING_UTF8 ).getStr() ); + } + } + return false; + } + return true; +} + +// oox.core.RecordContext interface ------------------------------------------- + +ContextHandlerRef ContextHandler2::createRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm ) +{ + return implCreateRecordContext( nRecId, rStrm ); +} + +void ContextHandler2::startRecord( sal_Int32 nRecId, SequenceInputStream& rStrm ) +{ + implStartRecord( nRecId, rStrm ); +} + +void ContextHandler2::endRecord( sal_Int32 nRecId ) +{ + implEndRecord( nRecId ); +} + +// oox.core.ContextHandler2Helper interface ----------------------------------- + +ContextHandlerRef ContextHandler2::onCreateContext( sal_Int32, const AttributeList& ) +{ + return nullptr; +} + +void ContextHandler2::onStartElement( const AttributeList& ) +{ +} + +void ContextHandler2::onCharacters( const OUString& ) +{ +} + +void ContextHandler2::onEndElement() +{ +} + +ContextHandlerRef ContextHandler2::onCreateRecordContext( sal_Int32, SequenceInputStream& ) +{ + return nullptr; +} + +void ContextHandler2::onStartRecord( SequenceInputStream& ) +{ +} + +void ContextHandler2::onEndRecord() +{ +} + +} // namespace oox::core + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/core/fastparser.cxx b/oox/source/core/fastparser.cxx new file mode 100644 index 000000000..53e5eb78a --- /dev/null +++ b/oox/source/core/fastparser.cxx @@ -0,0 +1,139 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include + +#include +#include + +#include +#include +#include +#include + +#include + +namespace oox::core { + +using namespace ::com::sun::star::io; +using namespace ::com::sun::star::lang; +using namespace ::com::sun::star::uno; +using namespace ::com::sun::star::xml::sax; + +namespace { + +class InputStreamCloseGuard +{ +public: + explicit InputStreamCloseGuard( const Reference< XInputStream >& rxInStream, bool bCloseStream ); + ~InputStreamCloseGuard(); +private: + Reference< XInputStream > mxInStream; + bool mbCloseStream; +}; + +InputStreamCloseGuard::InputStreamCloseGuard( const Reference< XInputStream >& rxInStream, bool bCloseStream ) : + mxInStream( rxInStream ), + mbCloseStream( bCloseStream ) +{ +} + +InputStreamCloseGuard::~InputStreamCloseGuard() +{ + if( mxInStream.is() && mbCloseStream ) try { mxInStream->closeInput(); } catch( Exception& ) {} +} + +} // namespace + +FastParser::FastParser() : + mrNamespaceMap( StaticNamespaceMap() ) +{ + // create a fast parser instance + mxParser = new sax_fastparser::FastSaxParser; + + // create the fast tokenhandler + mxTokenHandler.set( new FastTokenHandler ); + + // create the fast token handler based on the OOXML token list + mxParser->setTokenHandler( mxTokenHandler ); +} + +FastParser::~FastParser() +{ +} + +void FastParser::registerNamespace( sal_Int32 nNamespaceId ) +{ + if( !mxParser.is() ) + throw RuntimeException(); + + // add handling for OOXML strict here + const OUString* pNamespaceUrl = ContainerHelper::getMapElement( mrNamespaceMap.maTransitionalNamespaceMap, nNamespaceId ); + if( !pNamespaceUrl ) + throw IllegalArgumentException(); + + mxParser->registerNamespace( *pNamespaceUrl, nNamespaceId ); + + //also register the OOXML strict namespaces for the same id + const OUString* pNamespaceStrictUrl = ContainerHelper::getMapElement( mrNamespaceMap.maStrictNamespaceMap, nNamespaceId ); + if(pNamespaceStrictUrl && (*pNamespaceUrl != *pNamespaceStrictUrl)) + { + mxParser->registerNamespace( *pNamespaceStrictUrl, nNamespaceId ); + } +} + +void FastParser::setDocumentHandler( const Reference< XFastDocumentHandler >& rxDocHandler ) +{ + if( !mxParser.is() ) + throw RuntimeException(); + mxParser->setFastDocumentHandler( rxDocHandler ); +} + +void FastParser::clearDocumentHandler() +{ + if (!mxParser.is()) + return; + mxParser->setFastDocumentHandler(nullptr); +} + +void FastParser::parseStream( const InputSource& rInputSource, bool bCloseStream ) +{ + // guard closing the input stream also when exceptions are thrown + InputStreamCloseGuard aGuard( rInputSource.aInputStream, bCloseStream ); + if( !mxParser.is() ) + throw RuntimeException(); + mxParser->parseStream( rInputSource ); +} + +void FastParser::parseStream( const Reference< XInputStream >& rxInStream, const OUString& rStreamName ) +{ + InputSource aInputSource; + aInputSource.sSystemId = rStreamName; + aInputSource.aInputStream = rxInStream; + parseStream( aInputSource ); +} + +void FastParser::parseStream( StorageBase& rStorage, const OUString& rStreamName ) +{ + parseStream( rStorage.openInputStream( rStreamName ), rStreamName ); +} + +} // namespace oox::core + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/core/fasttokenhandler.cxx b/oox/source/core/fasttokenhandler.cxx new file mode 100644 index 000000000..398772df0 --- /dev/null +++ b/oox/source/core/fasttokenhandler.cxx @@ -0,0 +1,82 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include + +#include +#include +#include + +using namespace ::com::sun::star; + +namespace oox::core { + +using namespace ::com::sun::star::uno; + +FastTokenHandler::FastTokenHandler() : + mrTokenMap( StaticTokenMap() ) +{ +} + +FastTokenHandler::~FastTokenHandler() +{ +} + +// XServiceInfo +OUString SAL_CALL FastTokenHandler::getImplementationName() +{ + return "com.sun.star.comp.oox.core.FastTokenHandler"; +} + +sal_Bool SAL_CALL FastTokenHandler::supportsService( const OUString& rServiceName ) +{ + return cppu::supportsService(this, rServiceName); +} + +Sequence< OUString > SAL_CALL FastTokenHandler::getSupportedServiceNames() +{ + Sequence aServiceNames { "com.sun.star.xml.sax.FastTokenHandler" }; + return aServiceNames; +} + +Sequence< sal_Int8 > FastTokenHandler::getUTF8Identifier( sal_Int32 nToken ) +{ + return mrTokenMap.getUtf8TokenName( nToken ); +} + +sal_Int32 FastTokenHandler::getTokenFromUTF8( const Sequence< sal_Int8 >& rIdentifier ) +{ + return mrTokenMap.getTokenFromUtf8( rIdentifier ); +} + +sal_Int32 FastTokenHandler::getTokenDirect( const char *pToken, sal_Int32 nLength ) const +{ + return mrTokenMap.getTokenFromUTF8( pToken, nLength ); +} + +} // namespace oox::core + +extern "C" SAL_DLLPUBLIC_EXPORT uno::XInterface* +com_sun_star_comp_oox_core_FastTokenHandler_get_implementation( + uno::XComponentContext* /*pCtx*/, uno::Sequence const& /*rSeq*/) +{ + return cppu::acquire(new oox::core::FastTokenHandler()); +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/core/filterbase.cxx b/oox/source/core/filterbase.cxx new file mode 100644 index 000000000..6ae55238c --- /dev/null +++ b/oox/source/core/filterbase.cxx @@ -0,0 +1,596 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +namespace oox::core { + +using namespace ::com::sun::star::beans; +using namespace ::com::sun::star::frame; +using namespace ::com::sun::star::graphic; +using namespace ::com::sun::star::drawing; +using namespace ::com::sun::star::io; +using namespace ::com::sun::star::lang; +using namespace ::com::sun::star::task; +using namespace ::com::sun::star::uno; + +using ::com::sun::star::container::XNameAccess; +using utl::MediaDescriptor; +using ::comphelper::SequenceAsHashMap; +using ::oox::ole::OleObjectHelper; +using ::oox::ole::VbaProject; + +namespace { + +struct UrlPool +{ + std::mutex maMutex; + ::std::set< OUString > maUrls; +}; + +UrlPool& StaticUrlPool() +{ + static UrlPool SINGLETON; + return SINGLETON; +} + +/** This guard prevents recursive loading/saving of the same document. */ +class DocumentOpenedGuard +{ +public: + explicit DocumentOpenedGuard( const OUString& rUrl ); + ~DocumentOpenedGuard(); + DocumentOpenedGuard(const DocumentOpenedGuard&) = delete; + DocumentOpenedGuard& operator=(const DocumentOpenedGuard&) = delete; + + bool isValid() const { return mbValid; } + +private: + OUString maUrl; + bool mbValid; +}; + +DocumentOpenedGuard::DocumentOpenedGuard( const OUString& rUrl ) +{ + UrlPool& rUrlPool = StaticUrlPool(); + std::scoped_lock aGuard( rUrlPool.maMutex ); + mbValid = rUrl.isEmpty() || (rUrlPool.maUrls.count( rUrl ) == 0); + if( mbValid && !rUrl.isEmpty() ) + { + rUrlPool.maUrls.insert( rUrl ); + maUrl = rUrl; + } +} + +DocumentOpenedGuard::~DocumentOpenedGuard() +{ + UrlPool& rUrlPool = StaticUrlPool(); + std::scoped_lock aGuard( rUrlPool.maMutex ); + if( !maUrl.isEmpty() ) + rUrlPool.maUrls.erase( maUrl ); +} + +/** Specifies whether this filter is an import or export filter. */ +enum FilterDirection +{ + FILTERDIRECTION_UNKNOWN, + FILTERDIRECTION_IMPORT, + FILTERDIRECTION_EXPORT +}; + +} // namespace + +struct FilterBaseImpl +{ + typedef std::shared_ptr< GraphicHelper > GraphicHelperRef; + typedef std::shared_ptr< ModelObjectHelper > ModelObjHelperRef; + typedef std::shared_ptr< OleObjectHelper > OleObjHelperRef; + typedef std::shared_ptr< VbaProject > VbaProjectRef; + + FilterDirection meDirection; + SequenceAsHashMap maArguments; + SequenceAsHashMap maFilterData; + MediaDescriptor maMediaDesc; + OUString maFileUrl; + StorageRef mxStorage; + OoxmlVersion meVersion; + + GraphicHelperRef mxGraphicHelper; /// Graphic and graphic object handling. + ModelObjHelperRef mxModelObjHelper; /// Tables to create new named drawing objects. + std::map, ModelObjHelperRef> + mxModelObjHelpers; + OleObjHelperRef mxOleObjHelper; /// OLE object handling. + VbaProjectRef mxVbaProject; /// VBA project manager. + + Reference< XComponentContext > mxComponentContext; + Reference< XModel > mxModel; + Reference< XMultiServiceFactory > mxModelFactory; + Reference< XFrame > mxTargetFrame; + Reference< XInputStream > mxInStream; + Reference< XStream > mxOutStream; + Reference< XStatusIndicator > mxStatusIndicator; + Reference< XInteractionHandler > mxInteractionHandler; + Reference< XShape > mxParentShape; + + bool mbExportVBA; + + bool mbExportTemplate; + + /// @throws RuntimeException + explicit FilterBaseImpl( const Reference< XComponentContext >& rxContext ); + + /// @throws IllegalArgumentException + void setDocumentModel( const Reference< XComponent >& rxComponent ); +}; + +FilterBaseImpl::FilterBaseImpl( const Reference< XComponentContext >& rxContext ) : + meDirection( FILTERDIRECTION_UNKNOWN ), + meVersion( ECMA_DIALECT ), + mxComponentContext( rxContext, UNO_SET_THROW ), + mbExportVBA(false), + mbExportTemplate(false) +{ +} + +void FilterBaseImpl::setDocumentModel( const Reference< XComponent >& rxComponent ) +{ + try + { + mxModel.set( rxComponent, UNO_QUERY_THROW ); + mxModelFactory.set( rxComponent, UNO_QUERY_THROW ); + } + catch( Exception& ) + { + throw IllegalArgumentException(); + } +} + +FilterBase::FilterBase( const Reference< XComponentContext >& rxContext ) : + mxImpl( new FilterBaseImpl( rxContext ) ) +{ +} + +FilterBase::~FilterBase() +{ +} + +bool FilterBase::isImportFilter() const +{ + return mxImpl->meDirection == FILTERDIRECTION_IMPORT; +} + +bool FilterBase::isExportFilter() const +{ + return mxImpl->meDirection == FILTERDIRECTION_EXPORT; +} + +OoxmlVersion FilterBase::getVersion() const +{ + return mxImpl->meVersion; +} + +const Reference< XComponentContext >& FilterBase::getComponentContext() const +{ + return mxImpl->mxComponentContext; +} + +const Reference< XModel >& FilterBase::getModel() const +{ + return mxImpl->mxModel; +} + +const Reference< XMultiServiceFactory >& FilterBase::getModelFactory() const +{ + return mxImpl->mxModelFactory; +} + +const Reference< XFrame >& FilterBase::getTargetFrame() const +{ + return mxImpl->mxTargetFrame; +} + +const Reference< XStatusIndicator >& FilterBase::getStatusIndicator() const +{ + return mxImpl->mxStatusIndicator; +} + +MediaDescriptor& FilterBase::getMediaDescriptor() const +{ + return mxImpl->maMediaDesc; +} + +SequenceAsHashMap& FilterBase::getFilterData() const +{ + return mxImpl->maFilterData; +} + +const OUString& FilterBase::getFileUrl() const +{ + return mxImpl->maFileUrl; +} + +namespace { + +bool lclIsDosDrive( const OUString& rUrl, sal_Int32 nPos = 0 ) +{ + return + (rUrl.getLength() >= nPos + 3) && + ((('A' <= rUrl[ nPos ]) && (rUrl[ nPos ] <= 'Z')) || (('a' <= rUrl[ nPos ]) && (rUrl[ nPos ] <= 'z'))) && + (rUrl[ nPos + 1 ] == ':') && + (rUrl[ nPos + 2 ] == '/'); +} + +} // namespace + +OUString FilterBase::getAbsoluteUrl( const OUString& rUrl ) const +{ + // handle some special cases before calling ::rtl::Uri::convertRelToAbs() + + static const OUStringLiteral aFileSchema = u"file:"; + static const OUStringLiteral aFilePrefix = u"file:///"; + const sal_Int32 nFilePrefixLen = aFilePrefix.getLength(); + static const OUStringLiteral aUncPrefix = u"//"; + + /* (1) convert all backslashes to slashes, and check that passed URL is + not empty. */ + OUString aUrl = rUrl.replace( '\\', '/' ); + if( aUrl.isEmpty() ) + return aUrl; + + /* (2) add 'file:///' to absolute Windows paths, e.g. convert + 'C:/path/file' to 'file:///c:/path/file'. */ + if( lclIsDosDrive( aUrl ) ) + return aFilePrefix + aUrl; + + /* (3) add 'file:' to UNC paths, e.g. convert '//server/path/file' to + 'file://server/path/file'. */ + if( aUrl.match( aUncPrefix ) ) + return aFileSchema + aUrl; + + /* (4) remove additional slashes from UNC paths, e.g. convert + 'file://///server/path/file' to 'file://server/path/file'. */ + if( (aUrl.getLength() >= nFilePrefixLen + 2) && + aUrl.match( aFilePrefix ) && + aUrl.match( aUncPrefix, nFilePrefixLen ) ) + { + return aFileSchema + aUrl.subView( nFilePrefixLen ); + } + + /* (5) handle URLs relative to current drive, e.g. the URL '/path1/file1' + relative to the base URL 'file:///C:/path2/file2' does not result in + the expected 'file:///C:/path1/file1', but in 'file:///path1/file1'. */ + if( aUrl.startsWith("/") && + mxImpl->maFileUrl.match( aFilePrefix ) && + lclIsDosDrive( mxImpl->maFileUrl, nFilePrefixLen ) ) + { + return OUString::Concat(mxImpl->maFileUrl.subView( 0, nFilePrefixLen + 3 )) + aUrl.subView( 1 ); + } + + try + { + return ::rtl::Uri::convertRelToAbs( mxImpl->maFileUrl, aUrl ); + } + catch( ::rtl::MalformedUriException& ) + { + } + return aUrl; +} + +StorageRef const & FilterBase::getStorage() const +{ + return mxImpl->mxStorage; +} + +Reference< XInputStream > FilterBase::openInputStream( const OUString& rStreamName ) const +{ + if (!mxImpl->mxStorage) + throw RuntimeException(); + return mxImpl->mxStorage->openInputStream( rStreamName ); +} + +Reference< XOutputStream > FilterBase::openOutputStream( const OUString& rStreamName ) const +{ + return mxImpl->mxStorage->openOutputStream( rStreamName ); +} + +void FilterBase::commitStorage() const +{ + mxImpl->mxStorage->commit(); +} + +// helpers + +GraphicHelper& FilterBase::getGraphicHelper() const +{ + if( !mxImpl->mxGraphicHelper ) + mxImpl->mxGraphicHelper.reset( implCreateGraphicHelper() ); + return *mxImpl->mxGraphicHelper; +} + +ModelObjectHelper& FilterBase::getModelObjectHelper() const +{ + if( !mxImpl->mxModelObjHelper ) + mxImpl->mxModelObjHelper = std::make_shared( mxImpl->mxModelFactory ); + return *mxImpl->mxModelObjHelper; +} + +ModelObjectHelper& FilterBase::getModelObjectHelperForModel( + const css::uno::Reference& xFactory) const +{ + if (!mxImpl->mxModelObjHelpers.count(xFactory)) + mxImpl->mxModelObjHelpers[xFactory] = std::make_shared(xFactory); + return *mxImpl->mxModelObjHelpers[xFactory]; +} + +OleObjectHelper& FilterBase::getOleObjectHelper() const +{ + if( !mxImpl->mxOleObjHelper ) + mxImpl->mxOleObjHelper = std::make_shared(mxImpl->mxModelFactory, mxImpl->mxModel); + return *mxImpl->mxOleObjHelper; +} + +VbaProject& FilterBase::getVbaProject() const +{ + if( !mxImpl->mxVbaProject ) + mxImpl->mxVbaProject.reset( implCreateVbaProject() ); + return *mxImpl->mxVbaProject; +} + +bool FilterBase::importBinaryData( StreamDataSequence & orDataSeq, const OUString& rStreamName ) +{ + OSL_ENSURE( !rStreamName.isEmpty(), "FilterBase::importBinaryData - empty stream name" ); + if( rStreamName.isEmpty() ) + return false; + + // try to open the stream (this may fail - do not assert) + BinaryXInputStream aInStrm( openInputStream( rStreamName ), true ); + if( aInStrm.isEof() ) + return false; + + // copy the entire stream to the passed sequence + SequenceOutputStream aOutStrm( orDataSeq ); + aInStrm.copyToStream( aOutStrm ); + return true; +} + +// com.sun.star.lang.XServiceInfo interface + +sal_Bool SAL_CALL FilterBase::supportsService( const OUString& rServiceName ) +{ + return cppu::supportsService(this, rServiceName); +} + +Sequence< OUString > SAL_CALL FilterBase::getSupportedServiceNames() +{ + return { "com.sun.star.document.ImportFilter", "com.sun.star.document.ExportFilter" }; +} + +// com.sun.star.lang.XInitialization interface + +void SAL_CALL FilterBase::initialize( const Sequence< Any >& rArgs ) +{ + if( rArgs.getLength() >= 2 ) try + { + mxImpl->maArguments << rArgs[ 1 ]; + } + catch( Exception& ) + { + } + + if (!rArgs.hasElements()) + return; + + Sequence aSeq; + rArgs[0] >>= aSeq; + for (const auto& rVal : std::as_const(aSeq)) + { + if (rVal.Name == "UserData") + { + css::uno::Sequence aUserDataSeq; + rVal.Value >>= aUserDataSeq; + if (comphelper::findValue(aUserDataSeq, "macro-enabled") != -1) + mxImpl->mbExportVBA = true; + } + else if (rVal.Name == "Flags") + { + sal_Int32 nFlags(0); + rVal.Value >>= nFlags; + mxImpl->mbExportTemplate = bool(static_cast(nFlags) & SfxFilterFlags::TEMPLATE); + } + } +} + +// com.sun.star.document.XImporter interface + +void SAL_CALL FilterBase::setTargetDocument( const Reference< XComponent >& rxDocument ) +{ + mxImpl->setDocumentModel( rxDocument ); + mxImpl->meDirection = FILTERDIRECTION_IMPORT; +} + +// com.sun.star.document.XExporter interface + +void SAL_CALL FilterBase::setSourceDocument( const Reference< XComponent >& rxDocument ) +{ + mxImpl->setDocumentModel( rxDocument ); + mxImpl->meDirection = FILTERDIRECTION_EXPORT; +} + +// com.sun.star.document.XFilter interface + +sal_Bool SAL_CALL FilterBase::filter( const Sequence< PropertyValue >& rMediaDescSeq ) +{ + if( !mxImpl->mxModel.is() || !mxImpl->mxModelFactory.is() || (mxImpl->meDirection == FILTERDIRECTION_UNKNOWN) ) + throw RuntimeException(); + + bool bRet = false; + setMediaDescriptor( rMediaDescSeq ); + DocumentOpenedGuard aOpenedGuard( mxImpl->maFileUrl ); + if( aOpenedGuard.isValid() || mxImpl->maFileUrl.isEmpty() ) + { + Reference xTempModel = mxImpl->mxModel; + xTempModel->lockControllers(); + comphelper::ScopeGuard const lockControllersGuard([xTempModel]() { + xTempModel->unlockControllers(); + }); + + switch( mxImpl->meDirection ) + { + case FILTERDIRECTION_UNKNOWN: + break; + case FILTERDIRECTION_IMPORT: + if( mxImpl->mxInStream.is() ) + { + mxImpl->mxStorage = implCreateStorage( mxImpl->mxInStream ); + bRet = mxImpl->mxStorage && importDocument(); + } + break; + case FILTERDIRECTION_EXPORT: + if( mxImpl->mxOutStream.is() ) + { + mxImpl->mxStorage = implCreateStorage( mxImpl->mxOutStream ); + bRet = mxImpl->mxStorage && exportDocument() && implFinalizeExport( getMediaDescriptor() ); + } + break; + } + } + return bRet; +} + +void SAL_CALL FilterBase::cancel() +{ +} + +// protected + +Reference< XInputStream > FilterBase::implGetInputStream( MediaDescriptor& rMediaDesc ) const +{ + return rMediaDesc.getUnpackedValueOrDefault( MediaDescriptor::PROP_INPUTSTREAM, Reference< XInputStream >() ); +} + +Reference< XStream > FilterBase::implGetOutputStream( MediaDescriptor& rMediaDesc ) const +{ + return rMediaDesc.getUnpackedValueOrDefault( MediaDescriptor::PROP_STREAMFOROUTPUT, Reference< XStream >() ); +} + +bool FilterBase::implFinalizeExport( MediaDescriptor& /*rMediaDescriptor*/ ) +{ + return true; +} + +Reference< XStream > const & FilterBase::getMainDocumentStream( ) const +{ + return mxImpl->mxOutStream; +} + +// private + +void FilterBase::setMediaDescriptor( const Sequence< PropertyValue >& rMediaDescSeq ) +{ + mxImpl->maMediaDesc << rMediaDescSeq; + + switch( mxImpl->meDirection ) + { + case FILTERDIRECTION_UNKNOWN: + OSL_FAIL( "FilterBase::setMediaDescriptor - invalid filter direction" ); + break; + case FILTERDIRECTION_IMPORT: + mxImpl->maMediaDesc.addInputStream(); + mxImpl->mxInStream = implGetInputStream( mxImpl->maMediaDesc ); + OSL_ENSURE( mxImpl->mxInStream.is(), "FilterBase::setMediaDescriptor - missing input stream" ); + break; + case FILTERDIRECTION_EXPORT: + mxImpl->mxOutStream = implGetOutputStream( mxImpl->maMediaDesc ); + OSL_ENSURE( mxImpl->mxOutStream.is(), "FilterBase::setMediaDescriptor - missing output stream" ); + break; + } + + mxImpl->maFileUrl = mxImpl->maMediaDesc.getUnpackedValueOrDefault( MediaDescriptor::PROP_URL, OUString() ); + mxImpl->mxTargetFrame = mxImpl->maMediaDesc.getUnpackedValueOrDefault( MediaDescriptor::PROP_FRAME, Reference< XFrame >() ); + mxImpl->mxStatusIndicator = mxImpl->maMediaDesc.getUnpackedValueOrDefault( MediaDescriptor::PROP_STATUSINDICATOR, Reference< XStatusIndicator >() ); + mxImpl->mxInteractionHandler = mxImpl->maMediaDesc.getUnpackedValueOrDefault( MediaDescriptor::PROP_INTERACTIONHANDLER, Reference< XInteractionHandler >() ); + mxImpl->mxParentShape = mxImpl->maMediaDesc.getUnpackedValueOrDefault( "ParentShape", mxImpl->mxParentShape ); + mxImpl->maFilterData = mxImpl->maMediaDesc.getUnpackedValueOrDefault( "FilterData", Sequence< PropertyValue >() ); + + // Check for ISO OOXML + OUString sFilterName = mxImpl->maMediaDesc.getUnpackedValueOrDefault( "FilterName", OUString() ); + try + { + Reference xFactory(getComponentContext()->getServiceManager(), UNO_QUERY_THROW); + Reference xFilters(xFactory->createInstance("com.sun.star.document.FilterFactory" ), UNO_QUERY_THROW ); + Any aValues = xFilters->getByName( sFilterName ); + Sequence aPropSeq; + aValues >>= aPropSeq; + SequenceAsHashMap aProps( aPropSeq ); + + sal_Int32 nVersion = aProps.getUnpackedValueOrDefault( "FileFormatVersion", sal_Int32( 0 ) ); + mxImpl->meVersion = OoxmlVersion( nVersion ); + } + catch ( const Exception& ) + { + // Not ISO OOXML + } +} + +GraphicHelper* FilterBase::implCreateGraphicHelper() const +{ + // default: return base implementation without any special behaviour + return new GraphicHelper( mxImpl->mxComponentContext, mxImpl->mxTargetFrame, mxImpl->mxStorage ); +} + +bool FilterBase::exportVBA() const +{ + return mxImpl->mbExportVBA; +} + +bool FilterBase::isExportTemplate() const +{ + return mxImpl->mbExportTemplate; +} + +} // namespace oox::core + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/core/filterdetect.cxx b/oox/source/core/filterdetect.cxx new file mode 100644 index 000000000..455d9a8b5 --- /dev/null +++ b/oox/source/core/filterdetect.cxx @@ -0,0 +1,479 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include + +#include +#include + +using namespace ::com::sun::star; + +namespace oox::core { + +using namespace ::com::sun::star::beans; +using namespace ::com::sun::star::io; +using namespace ::com::sun::star::lang; +using namespace ::com::sun::star::uno; +using namespace ::com::sun::star::xml::sax; +using namespace ::com::sun::star::uri; + +using utl::MediaDescriptor; +using comphelper::IDocPasswordVerifier; +using comphelper::DocPasswordVerifierResult; + +FilterDetectDocHandler::FilterDetectDocHandler( const Reference< XComponentContext >& rxContext, OUString& rFilterName, const OUString& rFileName ) : + mrFilterName( rFilterName ), + maFileName(rFileName), + maOOXMLVariant( OOXMLVariant::ECMA_Transitional ), + mxContext( rxContext ) +{ + maContextStack.reserve( 2 ); +} + +FilterDetectDocHandler::~FilterDetectDocHandler() +{ +} + +void SAL_CALL FilterDetectDocHandler::startDocument() +{ +} + +void SAL_CALL FilterDetectDocHandler::endDocument() +{ +} + +void SAL_CALL FilterDetectDocHandler::processingInstruction( const OUString& /*rTarget*/, const OUString& /*rData*/ ) +{ +} + +void SAL_CALL FilterDetectDocHandler::setDocumentLocator( const Reference& /*xLocator*/ ) +{ +} + +void SAL_CALL FilterDetectDocHandler::startFastElement( + sal_Int32 nElement, const Reference< XFastAttributeList >& rAttribs ) +{ + AttributeList aAttribs( rAttribs ); + switch ( nElement ) + { + // cases for _rels/.rels + case PR_TOKEN( Relationships ): + break; + case PR_TOKEN( Relationship ): + if( !maContextStack.empty() && (maContextStack.back() == PR_TOKEN( Relationships )) ) + parseRelationship( aAttribs ); + break; + + // cases for [Content_Types].xml + case PC_TOKEN( Types ): + break; + case PC_TOKEN( Default ): + if( !maContextStack.empty() && (maContextStack.back() == PC_TOKEN( Types )) ) + parseContentTypesDefault( aAttribs ); + break; + case PC_TOKEN( Override ): + if( !maContextStack.empty() && (maContextStack.back() == PC_TOKEN( Types )) ) + parseContentTypesOverride( aAttribs ); + break; + } + maContextStack.push_back( nElement ); +} + +void SAL_CALL FilterDetectDocHandler::startUnknownElement( + const OUString& /*Namespace*/, const OUString& /*Name*/, const Reference& /*Attribs*/ ) +{ +} + +void SAL_CALL FilterDetectDocHandler::endFastElement( sal_Int32 /*nElement*/ ) +{ + maContextStack.pop_back(); +} + +void SAL_CALL FilterDetectDocHandler::endUnknownElement( + const OUString& /*Namespace*/, const OUString& /*Name*/ ) +{ +} + +Reference SAL_CALL FilterDetectDocHandler::createFastChildContext( + sal_Int32 /*Element*/, const Reference& /*Attribs*/ ) +{ + return this; +} + +Reference SAL_CALL FilterDetectDocHandler::createUnknownChildContext( + const OUString& /*Namespace*/, const OUString& /*Name*/, const Reference& /*Attribs*/) +{ + return this; +} + +void SAL_CALL FilterDetectDocHandler::characters( const OUString& /*aChars*/ ) +{ +} + +void FilterDetectDocHandler::parseRelationship( const AttributeList& rAttribs ) +{ + OUString aType = rAttribs.getString( XML_Type, OUString() ); + + // tdf#131936 Remember filter when opening file as 'Office Open XML Text' + if (aType.startsWithIgnoreAsciiCase("http://schemas.openxmlformats.org/officedocument/2006/relationships/metadata/core-properties")) + maOOXMLVariant = OOXMLVariant::ISO_Transitional; + else if (aType.startsWithIgnoreAsciiCase("http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties")) + maOOXMLVariant = OOXMLVariant::ECMA_Transitional; + else if (aType.startsWithIgnoreAsciiCase("http://purl.oclc.org/ooxml/officeDocument")) + maOOXMLVariant = OOXMLVariant::ISO_Strict; + + if ( aType != "http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument" // OOXML Transitional + && aType != "http://purl.oclc.org/ooxml/officeDocument/relationships/officeDocument" ) //OOXML strict + return; + + Reference xFactory = UriReferenceFactory::create( mxContext ); + try + { + // use '/' to representent the root of the zip package ( and provide a 'file' scheme to + // keep the XUriReference implementation happy ) + Reference< XUriReference > xBase = xFactory->parse( "file:///" ); + + Reference< XUriReference > xPart = xFactory->parse( rAttribs.getString( XML_Target, OUString() ) ); + Reference< XUriReference > xAbs = xFactory->makeAbsolute( xBase, xPart, true, RelativeUriExcessParentSegments_RETAIN ); + + if ( xAbs.is() ) + maTargetPath = xAbs->getPath(); + } + catch( const Exception& ) + { + } +} + +OUString FilterDetectDocHandler::getFilterNameFromContentType( std::u16string_view rContentType, const OUString& rFileName ) +{ + bool bDocm = rFileName.endsWithIgnoreAsciiCase(".docm"); + + if( rContentType == u"application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml" && !bDocm ) + { + switch (maOOXMLVariant) + { + case OOXMLVariant::ISO_Transitional: + case OOXMLVariant::ISO_Strict: // Not supported, map to ISO transitional + return "writer_OOXML"; + case OOXMLVariant::ECMA_Transitional: + return "writer_MS_Word_2007"; + } + } + + if( rContentType == u"application/vnd.ms-word.document.macroEnabled.main+xml" || bDocm ) + return "writer_MS_Word_2007_VBA"; + + if( rContentType == u"application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml" || + rContentType == u"application/vnd.ms-word.template.macroEnabledTemplate.main+xml" ) + { + switch (maOOXMLVariant) + { + case OOXMLVariant::ISO_Transitional: + case OOXMLVariant::ISO_Strict: // Not supported, map to ISO transitional + return "writer_OOXML_Text_Template"; + case OOXMLVariant::ECMA_Transitional: + return "writer_MS_Word_2007_Template"; + } + } + + if( rContentType == u"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml") + return "MS Excel 2007 XML"; + + if (rContentType == u"application/vnd.ms-excel.sheet.macroEnabled.main+xml") + return "MS Excel 2007 VBA XML"; + + if( rContentType == u"application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml" || + rContentType == u"application/vnd.ms-excel.template.macroEnabled.main+xml" ) + return "MS Excel 2007 XML Template"; + + if ( rContentType == u"application/vnd.ms-excel.sheet.binary.macroEnabled.main" ) + return "MS Excel 2007 Binary"; + + if (rContentType == u"application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml") + return "MS PowerPoint 2007 XML"; + + if (rContentType == u"application/vnd.ms-powerpoint.presentation.macroEnabled.main+xml") + return "MS PowerPoint 2007 XML VBA"; + + if( rContentType == u"application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml" || + rContentType == u"application/vnd.ms-powerpoint.slideshow.macroEnabled.main+xml" ) + return "MS PowerPoint 2007 XML AutoPlay"; + + if( rContentType == u"application/vnd.openxmlformats-officedocument.presentationml.template.main+xml" || + rContentType == u"application/vnd.ms-powerpoint.template.macroEnabled.main+xml" ) + return "MS PowerPoint 2007 XML Template"; + + return OUString(); +} + +void FilterDetectDocHandler::parseContentTypesDefault( const AttributeList& rAttribs ) +{ + // only if no overridden part name found + if( mrFilterName.isEmpty() ) + { + // check if target path ends with extension + OUString aExtension = rAttribs.getString( XML_Extension, OUString() ); + sal_Int32 nExtPos = maTargetPath.getLength() - aExtension.getLength(); + if( (nExtPos > 0) && (maTargetPath[ nExtPos - 1 ] == '.') && maTargetPath.match( aExtension, nExtPos ) ) + mrFilterName = getFilterNameFromContentType( rAttribs.getString( XML_ContentType, OUString() ), maFileName ); + } +} + +void FilterDetectDocHandler::parseContentTypesOverride( const AttributeList& rAttribs ) +{ + if( rAttribs.getString( XML_PartName, OUString() ) == maTargetPath ) + mrFilterName = getFilterNameFromContentType( rAttribs.getString( XML_ContentType, OUString() ), maFileName ); +} + +FilterDetect::FilterDetect( const Reference< XComponentContext >& rxContext ) : + mxContext( rxContext, UNO_SET_THROW ) +{ +} + +FilterDetect::~FilterDetect() +{ +} + +namespace +{ + +bool lclIsZipPackage( const Reference< XComponentContext >& rxContext, const Reference< XInputStream >& rxInStrm ) +{ + ZipStorage aZipStorage( rxContext, rxInStrm ); + return aZipStorage.isStorage(); +} + +class PasswordVerifier : public IDocPasswordVerifier +{ +public: + explicit PasswordVerifier( crypto::DocumentDecryption& aDecryptor ); + + virtual DocPasswordVerifierResult verifyPassword( const OUString& rPassword, Sequence& rEncryptionData ) override; + + virtual DocPasswordVerifierResult verifyEncryptionData( const Sequence& rEncryptionData ) override; +private: + crypto::DocumentDecryption& mDecryptor; +}; + +PasswordVerifier::PasswordVerifier( crypto::DocumentDecryption& aDecryptor ) : + mDecryptor(aDecryptor) +{} + +comphelper::DocPasswordVerifierResult PasswordVerifier::verifyPassword( const OUString& rPassword, Sequence& rEncryptionData ) +{ + try + { + if (mDecryptor.generateEncryptionKey(rPassword)) + rEncryptionData = mDecryptor.createEncryptionData(rPassword); + } + catch (...) + { + // Any exception is a reason to abort + return comphelper::DocPasswordVerifierResult::Abort; + } + + return rEncryptionData.hasElements() ? comphelper::DocPasswordVerifierResult::OK : comphelper::DocPasswordVerifierResult::WrongPassword; +} + +comphelper::DocPasswordVerifierResult PasswordVerifier::verifyEncryptionData( const Sequence& ) +{ + return comphelper::DocPasswordVerifierResult::WrongPassword; +} + +} // namespace + +Reference< XInputStream > FilterDetect::extractUnencryptedPackage( MediaDescriptor& rMediaDescriptor ) const +{ + // try the plain input stream + Reference xInputStream( rMediaDescriptor[ MediaDescriptor::PROP_INPUTSTREAM ], UNO_QUERY ); + if( !xInputStream.is() || lclIsZipPackage( mxContext, xInputStream ) ) + return xInputStream; + + // check if a temporary file is passed in the 'ComponentData' property + Reference xDecrypted( rMediaDescriptor.getComponentDataEntry( "DecryptedPackage" ), UNO_QUERY ); + if( xDecrypted.is() ) + { + Reference xDecryptedInputStream = xDecrypted->getInputStream(); + if( lclIsZipPackage( mxContext, xDecryptedInputStream ) ) + return xDecryptedInputStream; + } + + // try to decrypt an encrypted OLE package + oox::ole::OleStorage aOleStorage( mxContext, xInputStream, false ); + if( aOleStorage.isStorage() ) + { + try + { + crypto::DocumentDecryption aDecryptor(mxContext, aOleStorage); + + if( aDecryptor.readEncryptionInfo() ) + { + /* "VelvetSweatshop" is the built-in default encryption + password used by MS Excel for the "workbook protection" + feature with password. Try this first before prompting the + user for a password. */ + std::vector aDefaultPasswords; + aDefaultPasswords.emplace_back("VelvetSweatshop"); + + /* Use the comphelper password helper to request a password. + This helper returns either with the correct password + (according to the verifier), or with an empty string if + user has cancelled the password input dialog. */ + PasswordVerifier aVerifier( aDecryptor ); + Sequence aEncryptionData = rMediaDescriptor.requestAndVerifyDocPassword( + aVerifier, + comphelper::DocPasswordRequestType::MS, + &aDefaultPasswords ); + + if( !aEncryptionData.hasElements() ) + { + rMediaDescriptor[ MediaDescriptor::PROP_ABORTED ] <<= true; + } + else + { + // create MemoryStream for unencrypted package - rather not put this in a tempfile + Reference const xTempStream( + mxContext->getServiceManager()->createInstanceWithContext( + "com.sun.star.comp.MemoryStream", mxContext), + UNO_QUERY_THROW); + + // if decryption was unsuccessful (corrupted file or any other reason) + if (!aDecryptor.decrypt(xTempStream)) + { + rMediaDescriptor[ MediaDescriptor::PROP_ABORTED ] <<= true; + } + else + { + // store temp file in media descriptor to keep it alive + rMediaDescriptor.setComponentDataEntry( "DecryptedPackage", Any( xTempStream ) ); + + Reference xDecryptedInputStream = xTempStream->getInputStream(); + if( lclIsZipPackage( mxContext, xDecryptedInputStream ) ) + return xDecryptedInputStream; + } + } + } + } + catch( const Exception& ) + { + } + } + return Reference(); +} + +// com.sun.star.lang.XServiceInfo interface ----------------------------------- + +OUString SAL_CALL FilterDetect::getImplementationName() +{ + return "com.sun.star.comp.oox.FormatDetector"; +} + +sal_Bool SAL_CALL FilterDetect::supportsService( const OUString& rServiceName ) +{ + return cppu::supportsService(this, rServiceName); +} + +Sequence< OUString > SAL_CALL FilterDetect::getSupportedServiceNames() +{ + return { "com.sun.star.frame.ExtendedTypeDetection" }; +} + +// com.sun.star.document.XExtendedFilterDetection interface ------------------- + +OUString SAL_CALL FilterDetect::detect( Sequence< PropertyValue >& rMediaDescSeq ) +{ + OUString aFilterName; + MediaDescriptor aMediaDescriptor( rMediaDescSeq ); + + try + { + aMediaDescriptor.addInputStream(); + + /* Get the unencrypted input stream. This may include creation of a + temporary file that contains the decrypted package. This temporary + file will be stored in the 'ComponentData' property of the media + descriptor. */ + Reference< XInputStream > xInputStream( extractUnencryptedPackage( aMediaDescriptor ), UNO_SET_THROW ); + + // stream must be a ZIP package + ZipStorage aZipStorage( mxContext, xInputStream ); + if( aZipStorage.isStorage() ) + { + // create the fast parser, register the XML namespaces, set document handler + FastParser aParser; + aParser.registerNamespace( NMSP_packageRel ); + aParser.registerNamespace( NMSP_officeRel ); + aParser.registerNamespace( NMSP_packageContentTypes ); + + OUString aFileName; + aMediaDescriptor[utl::MediaDescriptor::PROP_URL] >>= aFileName; + + aParser.setDocumentHandler( new FilterDetectDocHandler( mxContext, aFilterName, aFileName ) ); + + /* Parse '_rels/.rels' to get the target path and '[Content_Types].xml' + to determine the content type of the part at the target path. */ + aParser.parseStream( aZipStorage, "_rels/.rels" ); + aParser.parseStream( aZipStorage, "[Content_Types].xml" ); + } + } + catch( const Exception& ) + { + if ( aMediaDescriptor.getUnpackedValueOrDefault( MediaDescriptor::PROP_ABORTED, false ) ) + /* The user chose to abort detection, e.g. by hitting 'Cancel' in the password input dialog, + so we have to return non-empty type name to abort the detection loop. The loading code is + supposed to check whether the "Aborted" flag is present in the descriptor, and to not attempt + to actually load the file then. + + The returned type name is the one we got as an input, which typically was detected by the flat + detection (i.e. by file extension), so normally that's the correct one. Also at this point we + already know that the file is OLE encrypted package, so trying with other type detectors doesn't + make much sense anyway. + */ + aFilterName = aMediaDescriptor.getUnpackedValueOrDefault( MediaDescriptor::PROP_TYPENAME, OUString() ); + } + + // write back changed media descriptor members + aMediaDescriptor >> rMediaDescSeq; + return aFilterName; +} + +} // namespace oox::core + +extern "C" SAL_DLLPUBLIC_EXPORT uno::XInterface* +com_sun_star_comp_oox_FormatDetector_get_implementation(uno::XComponentContext* pCtx, + uno::Sequence const& /*rSeq*/) +{ + return cppu::acquire(new oox::core::FilterDetect(pCtx)); +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/core/fragmenthandler.cxx b/oox/source/core/fragmenthandler.cxx new file mode 100644 index 000000000..22319fda6 --- /dev/null +++ b/oox/source/core/fragmenthandler.cxx @@ -0,0 +1,119 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include + +#include + +namespace oox::core { + +using namespace ::com::sun::star::io; +using namespace ::com::sun::star::uno; +using namespace ::com::sun::star::xml::sax; + +FragmentBaseData::FragmentBaseData( XmlFilterBase& rFilter, const OUString& rFragmentPath, RelationsRef const & xRelations ) : + mrFilter( rFilter ), + maFragmentPath( rFragmentPath ), + mxRelations( xRelations ) +{ +} + +FragmentHandler::FragmentHandler( XmlFilterBase& rFilter, const OUString& rFragmentPath ) : + FragmentHandler_BASE( std::make_shared( rFilter, rFragmentPath, rFilter.importRelations( rFragmentPath ) ) ) +{ +} + +FragmentHandler::FragmentHandler( XmlFilterBase& rFilter, const OUString& rFragmentPath, RelationsRef xRelations ) : + FragmentHandler_BASE( std::make_shared( rFilter, rFragmentPath, xRelations ) ) +{ +} + +FragmentHandler::~FragmentHandler() +{ +} + +// com.sun.star.xml.sax.XFastDocumentHandler interface ------------------------ + +void FragmentHandler::startDocument() +{ +} + +void FragmentHandler::endDocument() +{ +} + +void FragmentHandler::processingInstruction( const OUString& /*rTarget*/, const OUString& /*rData*/ ) +{ +} + +void FragmentHandler::setDocumentLocator( const Reference< XLocator >& rxLocator ) +{ + implSetLocator( rxLocator ); +} + +// com.sun.star.xml.sax.XFastContextHandler interface ------------------------- + +void FragmentHandler::startFastElement( sal_Int32, const Reference< XFastAttributeList >& ) +{ +} + +void FragmentHandler::startUnknownElement( const OUString&, const OUString&, const Reference< XFastAttributeList >& ) +{ +} + +void FragmentHandler::endFastElement( sal_Int32 ) +{ +} + +void FragmentHandler::endUnknownElement( const OUString&, const OUString& ) +{ +} + +Reference< XFastContextHandler > FragmentHandler::createFastChildContext( sal_Int32, const Reference< XFastAttributeList >& ) +{ + return nullptr; +} + +Reference< XFastContextHandler > FragmentHandler::createUnknownChildContext( const OUString&, const OUString&, const Reference< XFastAttributeList >& ) +{ + return nullptr; +} + +void FragmentHandler::characters( const OUString& ) +{ +} + +// XML stream handling -------------------------------------------------------- + +Reference< XInputStream > FragmentHandler::openFragmentStream() const +{ + return getFilter().openInputStream( getFragmentPath() ); +} + +// binary records ------------------------------------------------------------- + +const RecordInfo* FragmentHandler::getRecordInfos() const +{ + // default: no support for binary records + return nullptr; +} + +} // namespace oox::core + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/core/fragmenthandler2.cxx b/oox/source/core/fragmenthandler2.cxx new file mode 100644 index 000000000..e4eeef076 --- /dev/null +++ b/oox/source/core/fragmenthandler2.cxx @@ -0,0 +1,155 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include + +#include +#include +#include +#include +#include + +namespace oox::core { + +using namespace ::com::sun::star; +using namespace ::com::sun::star::uno; +using namespace ::com::sun::star::xml::sax; + +FragmentHandler2::FragmentHandler2( XmlFilterBase& rFilter, const OUString& rFragmentPath, bool bEnableTrimSpace ) : + FragmentHandler( rFilter, rFragmentPath ), + ContextHandler2Helper( bEnableTrimSpace, rFilter ) +{ +} + +FragmentHandler2::~FragmentHandler2() +{ +} + +// com.sun.star.xml.sax.XFastDocumentHandler interface -------------------- + +void SAL_CALL FragmentHandler2::startDocument() +{ + initializeImport(); +} + +void SAL_CALL FragmentHandler2::endDocument() +{ + finalizeImport(); +} + +// com.sun.star.xml.sax.XFastContextHandler interface ------------------------- + +Reference< XFastContextHandler > SAL_CALL FragmentHandler2::createFastChildContext( + sal_Int32 nElement, const Reference< XFastAttributeList >& rxAttribs ) +{ + if( getNamespace( nElement ) == NMSP_mce ) // TODO for checking 'Ignorable' + { + if( prepareMceContext( nElement, AttributeList( rxAttribs ) ) ) + return getFastContextHandler(); + return nullptr; + } + return implCreateChildContext( nElement, rxAttribs ); +} + +void SAL_CALL FragmentHandler2::startFastElement( + sal_Int32 nElement, const Reference< XFastAttributeList >& rxAttribs ) +{ + implStartElement( nElement, rxAttribs ); +} + +void SAL_CALL FragmentHandler2::characters( const OUString& rChars ) +{ + implCharacters( rChars ); +} + +void SAL_CALL FragmentHandler2::endFastElement( sal_Int32 nElement ) +{ + /* If MCE */ + switch( nElement ) + { + case MCE_TOKEN( AlternateContent ): + removeMCEState(); + break; + } + + implEndElement( nElement ); +} + +// oox.core.ContextHandler interface ------------------------------------------ + +ContextHandlerRef FragmentHandler2::createRecordContext( sal_Int32 nRecId, SequenceInputStream& rStrm ) +{ + return implCreateRecordContext( nRecId, rStrm ); +} + +void FragmentHandler2::startRecord( sal_Int32 nRecId, SequenceInputStream& rStrm ) +{ + implStartRecord( nRecId, rStrm ); +} + +void FragmentHandler2::endRecord( sal_Int32 nRecId ) +{ + implEndRecord( nRecId ); +} + +// oox.core.ContextHandler2Helper interface ----------------------------------- + +ContextHandlerRef FragmentHandler2::onCreateContext( sal_Int32, const AttributeList& ) +{ + return nullptr; +} + +void FragmentHandler2::onStartElement( const AttributeList& ) +{ +} + +void FragmentHandler2::onCharacters( const OUString& ) +{ +} + +void FragmentHandler2::onEndElement() +{ +} + +ContextHandlerRef FragmentHandler2::onCreateRecordContext( sal_Int32, SequenceInputStream& ) +{ + return nullptr; +} + +void FragmentHandler2::onStartRecord( SequenceInputStream& ) +{ +} + +void FragmentHandler2::onEndRecord() +{ +} + +// oox.core.FragmentHandler2 interface ---------------------------------------- + +void FragmentHandler2::initializeImport() +{ +} + +void FragmentHandler2::finalizeImport() +{ +} + +} // namespace oox::core + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/core/recordparser.cxx b/oox/source/core/recordparser.cxx new file mode 100644 index 000000000..d6f35faca --- /dev/null +++ b/oox/source/core/recordparser.cxx @@ -0,0 +1,326 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace oox::core { + +using namespace ::com::sun::star::io; +using namespace ::com::sun::star::lang; +using namespace ::com::sun::star::uno; +using namespace ::com::sun::star::xml::sax; + +namespace prv { + +class Locator : public ::cppu::WeakImplHelper< XLocator > +{ +public: + explicit Locator( RecordParser* pParser ) : mpParser( pParser ) {} + + void dispose(); + /// @throws css::uno::RuntimeException + void checkDispose(); + + // com.sun.star.sax.XLocator interface + + virtual sal_Int32 SAL_CALL getColumnNumber() override; + virtual sal_Int32 SAL_CALL getLineNumber() override; + virtual OUString SAL_CALL getPublicId() override; + virtual OUString SAL_CALL getSystemId() override; + +private: + RecordParser* mpParser; +}; + +void Locator::dispose() +{ + mpParser = nullptr; +} + +void Locator::checkDispose() +{ + if( !mpParser ) + throw DisposedException(); +} + +sal_Int32 SAL_CALL Locator::getColumnNumber() +{ + return -1; +} + +sal_Int32 SAL_CALL Locator::getLineNumber() +{ + return -1; +} + +OUString SAL_CALL Locator::getPublicId() +{ + checkDispose(); + return OUString(); +} + +OUString SAL_CALL Locator::getSystemId() +{ + checkDispose(); + return mpParser->getInputSource().maSystemId; +} + +class ContextStack +{ +public: + explicit ContextStack( FragmentHandlerRef const & xHandler ); + + bool empty() const { return maStack.empty(); } + + sal_Int32 getCurrentRecId() const; + bool hasCurrentEndRecId() const; + ContextHandlerRef getCurrentContext() const; + + void pushContext( const RecordInfo& rRec, const ContextHandlerRef& rxContext ); + void popContext(); + +private: + typedef ::std::pair< RecordInfo, ContextHandlerRef > ContextInfo; + typedef ::std::vector< ContextInfo > ContextInfoVec; + + FragmentHandlerRef mxHandler; + ContextInfoVec maStack; +}; + +ContextStack::ContextStack( FragmentHandlerRef const & xHandler ) : + mxHandler( xHandler ) +{ +} + +sal_Int32 ContextStack::getCurrentRecId() const +{ + return maStack.empty() ? -1 : maStack.back().first.mnStartRecId; +} + +bool ContextStack::hasCurrentEndRecId() const +{ + return !maStack.empty() && (maStack.back().first.mnEndRecId >= 0); +} + +ContextHandlerRef ContextStack::getCurrentContext() const +{ + if( !maStack.empty() ) + return maStack.back().second; + return mxHandler; +} + +void ContextStack::pushContext( const RecordInfo& rRecInfo, const ContextHandlerRef& rxContext ) +{ + OSL_ENSURE( (rRecInfo.mnEndRecId >= 0) || maStack.empty() || hasCurrentEndRecId(), + "ContextStack::pushContext - nested incomplete context record identifiers" ); + maStack.emplace_back( rRecInfo, rxContext ); +} + +void ContextStack::popContext() +{ + OSL_ENSURE( !maStack.empty(), "ContextStack::popContext - no context on stack" ); + if( !maStack.empty() ) + { + ContextInfo& rContextInfo = maStack.back(); + if( rContextInfo.second.is() ) + rContextInfo.second->endRecord( rContextInfo.first.mnStartRecId ); + maStack.pop_back(); + } +} + +} // namespace oox::core::prv + +namespace { + +/** Reads a byte from the passed stream, returns true on success. */ +bool lclReadByte( sal_uInt8& ornByte, BinaryInputStream& rStrm ) +{ + return rStrm.readMemory( &ornByte, 1 ) == 1; +} + +/** Reads a compressed signed 32-bit integer from the passed stream. */ +bool lclReadCompressedInt( sal_Int32& ornValue, BinaryInputStream& rStrm ) +{ + ornValue = 0; + sal_uInt8 nByte; + if( !lclReadByte( nByte, rStrm ) ) return false; + ornValue = nByte & 0x7F; + if( (nByte & 0x80) == 0 ) return true; + if( !lclReadByte( nByte, rStrm ) ) return false; + ornValue |= sal_Int32( nByte & 0x7F ) << 7; + if( (nByte & 0x80) == 0 ) return true; + if( !lclReadByte( nByte, rStrm ) ) return false; + ornValue |= sal_Int32( nByte & 0x7F ) << 14; + if( (nByte & 0x80) == 0 ) return true; + if( !lclReadByte( nByte, rStrm ) ) return false; + ornValue |= sal_Int32( nByte & 0x7F ) << 21; + return true; +} + +bool lclReadRecordHeader( sal_Int32& ornRecId, sal_Int32& ornRecSize, BinaryInputStream& rStrm ) +{ + return + lclReadCompressedInt( ornRecId, rStrm ) && (ornRecId >= 0) && + lclReadCompressedInt( ornRecSize, rStrm ) && (ornRecSize >= 0); +} + +bool lclReadNextRecord( sal_Int32& ornRecId, StreamDataSequence& orData, BinaryInputStream& rStrm ) +{ + sal_Int32 nRecSize = 0; + bool bValid = lclReadRecordHeader( ornRecId, nRecSize, rStrm ); + if( bValid ) + { + orData.realloc( nRecSize ); + bValid = (nRecSize == 0) || (rStrm.readData( orData, nRecSize ) == nRecSize); + } + return bValid; +} + +} // namespace + +RecordParser::RecordParser() +{ + mxLocator.set( new prv::Locator( this ) ); +} + +RecordParser::~RecordParser() +{ + if( mxLocator.is() ) + mxLocator->dispose(); +} + +void RecordParser::setFragmentHandler( const ::rtl::Reference< FragmentHandler >& rxHandler ) +{ + mxHandler = rxHandler; + + // build record infos + maStartMap.clear(); + maEndMap.clear(); + const RecordInfo* pRecs = mxHandler.is() ? mxHandler->getRecordInfos() : nullptr; + OSL_ENSURE( pRecs, "RecordInfoProvider::RecordInfoProvider - missing record list" ); + for( ; pRecs && pRecs->mnStartRecId >= 0; ++pRecs ) + { + maStartMap[ pRecs->mnStartRecId ] = *pRecs; + if( pRecs->mnEndRecId >= 0 ) + maEndMap[ pRecs->mnEndRecId ] = *pRecs; + } +} + +void RecordParser::parseStream( const RecordInputSource& rInputSource ) +{ + maSource = rInputSource; + + if( !maSource.mxInStream || maSource.mxInStream->isEof() ) + throw IOException(); + if( !mxHandler.is() ) + throw SAXException(); + + // start the document + mxHandler->setDocumentLocator( mxLocator ); + mxHandler->startDocument(); + + // parse the stream + mxStack.reset( new prv::ContextStack( mxHandler ) ); + sal_Int32 nRecId = 0; + StreamDataSequence aRecData; + while( lclReadNextRecord( nRecId, aRecData, *maSource.mxInStream ) ) + { + // create record stream object from imported record data + SequenceInputStream aRecStrm( aRecData ); + // try to leave a context, there may be other incomplete contexts on the stack + if( const RecordInfo* pEndRecInfo = getEndRecordInfo( nRecId ) ) + { + // finalize contexts without record identifier for context end + while( !mxStack->empty() && !mxStack->hasCurrentEndRecId() ) + mxStack->popContext(); + // finalize the current context and pop context info from stack + OSL_ENSURE( mxStack->getCurrentRecId() == pEndRecInfo->mnStartRecId, "RecordParser::parseStream - context records mismatch" ); + ContextHandlerRef xCurrContext = mxStack->getCurrentContext(); + if( xCurrContext.is() ) + { + // context end record may contain some data, handle it as simple record + aRecStrm.seekToStart(); + xCurrContext->startRecord( nRecId, aRecStrm ); + xCurrContext->endRecord( nRecId ); + } + mxStack->popContext(); + } + else + { + // end context with incomplete record id, if the same id comes again + if( (mxStack->getCurrentRecId() == nRecId) && !mxStack->hasCurrentEndRecId() ) + mxStack->popContext(); + // try to start a new context + ContextHandlerRef xCurrContext = mxStack->getCurrentContext(); + if( xCurrContext.is() ) + { + aRecStrm.seekToStart(); + xCurrContext = xCurrContext->createRecordContext( nRecId, aRecStrm ); + } + // track all context identifiers on the stack (do not push simple records) + const RecordInfo* pStartRecInfo = getStartRecordInfo( nRecId ); + if( pStartRecInfo ) + mxStack->pushContext( *pStartRecInfo, xCurrContext ); + // import the record + if( xCurrContext.is() ) + { + // import the record + aRecStrm.seekToStart(); + xCurrContext->startRecord( nRecId, aRecStrm ); + // end simple records (context records are finished in ContextStack::popContext) + if( !pStartRecInfo ) + xCurrContext->endRecord( nRecId ); + } + } + } + // close remaining contexts (missing context end records or stream error) + while( !mxStack->empty() ) + mxStack->popContext(); + mxStack.reset(); + + // finish document + mxHandler->endDocument(); + + maSource = RecordInputSource(); +} + +const RecordInfo* RecordParser::getStartRecordInfo( sal_Int32 nRecId ) const +{ + RecordInfoMap::const_iterator aIt = maStartMap.find( nRecId ); + return (aIt == maStartMap.end()) ? nullptr : &aIt->second; +} + +const RecordInfo* RecordParser::getEndRecordInfo( sal_Int32 nRecId ) const +{ + RecordInfoMap::const_iterator aIt = maEndMap.find( nRecId ); + return (aIt == maEndMap.end()) ? nullptr : &aIt->second; +} + +} // namespace oox::core + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/core/relations.cxx b/oox/source/core/relations.cxx new file mode 100644 index 000000000..f927c542c --- /dev/null +++ b/oox/source/core/relations.cxx @@ -0,0 +1,158 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include + +#include +#include + +#include + +namespace oox::core { + +namespace { + +std::u16string_view lclRemoveFileName( std::u16string_view rPath ) +{ + size_t idx = rPath.rfind( '/' ); + if (idx == std::u16string_view::npos) + return std::u16string_view(); + return rPath.substr( 0, idx ); +} + +OUString lclAppendFileName( std::u16string_view rPath, const OUString& rFileName ) +{ + return rPath.empty() ? rFileName : + rPath + OUStringChar('/') + rFileName; +} + +OUString createOfficeDocRelationTypeTransitional(std::u16string_view rType) +{ + return OUString::Concat("http://schemas.openxmlformats.org/officeDocument/2006/relationships/") + + rType; +} + +OUString createOfficeDocRelationTypeStrict(std::u16string_view rType) +{ + return OUString::Concat("http://purl.oclc.org/ooxml/officeDocument/relationships/") + rType; +} + +} + +Relations::Relations( const OUString& rFragmentPath ) + : maFragmentPath( rFragmentPath ) +{ +} + +const Relation* Relations::getRelationFromRelId( const OUString& rId ) const +{ + ::std::map< OUString, Relation >::const_iterator aIt = maMap.find( rId ); + return (aIt == maMap.end()) ? nullptr : &aIt->second; +} + +const Relation* Relations::getRelationFromFirstType( std::u16string_view rType ) const +{ + for (auto const& elem : maMap) + if( elem.second.maType.equalsIgnoreAsciiCase( rType ) ) + return &elem.second; + return nullptr; +} + +RelationsRef Relations::getRelationsFromTypeFromOfficeDoc( std::u16string_view rType ) const +{ + RelationsRef xRelations = std::make_shared( maFragmentPath ); + for (auto const& elem : maMap) + if( elem.second.maType.equalsIgnoreAsciiCase( createOfficeDocRelationTypeTransitional(rType) ) || + elem.second.maType.equalsIgnoreAsciiCase( createOfficeDocRelationTypeStrict(rType) )) + xRelations->maMap[ elem.first ] = elem.second; + return xRelations; +} + +OUString Relations::getExternalTargetFromRelId( const OUString& rRelId ) const +{ + const Relation* pRelation = getRelationFromRelId( rRelId ); + return (pRelation && pRelation->mbExternal) ? pRelation->maTarget : OUString(); +} + +OUString Relations::getInternalTargetFromRelId( const OUString& rRelId ) const +{ + const Relation* pRelation = getRelationFromRelId( rRelId ); + return (pRelation && !pRelation->mbExternal) ? pRelation->maTarget : OUString(); +} + +OUString Relations::getFragmentPathFromRelation( const Relation& rRelation ) const +{ + // no target, no fragment path + if( rRelation.mbExternal || rRelation.maTarget.isEmpty() ) + return OUString(); + + // absolute target: return it without leading slash (#i100978) + if( rRelation.maTarget[ 0 ] == '/' ) + return rRelation.maTarget.copy( 1 ); + + // empty fragment path: return target + if( maFragmentPath.isEmpty() ) + return rRelation.maTarget; + + // resolve relative target path according to base path + OUString aPath( lclRemoveFileName( maFragmentPath ) ); + sal_Int32 nStartPos = 0; + while( nStartPos < rRelation.maTarget.getLength() ) + { + sal_Int32 nSepPos = rRelation.maTarget.indexOf( '/', nStartPos ); + if( nSepPos < 0 ) nSepPos = rRelation.maTarget.getLength(); + // append next directory name from aTarget to aPath, or remove last directory on '../' + if( (nStartPos + 2 == nSepPos) && (rRelation.maTarget[ nStartPos ] == '.') && (rRelation.maTarget[ nStartPos + 1 ] == '.') ) + aPath = lclRemoveFileName( aPath ); + else + aPath = lclAppendFileName( aPath, rRelation.maTarget.copy( nStartPos, nSepPos - nStartPos ) ); + // move nStartPos to next directory name + nStartPos = nSepPos + 1; + } + + return aPath; +} + +OUString Relations::getFragmentPathFromRelId( const OUString& rRelId ) const +{ + const Relation* pRelation = getRelationFromRelId( rRelId ); + return pRelation ? getFragmentPathFromRelation( *pRelation ) : OUString(); +} + +OUString Relations::getFragmentPathFromFirstType( std::u16string_view rType ) const +{ + const Relation* pRelation = getRelationFromFirstType( rType ); + return pRelation ? getFragmentPathFromRelation( *pRelation ) : OUString(); +} + +OUString Relations::getFragmentPathFromFirstTypeFromOfficeDoc( std::u16string_view rType ) const +{ + OUString aTransitionalType(createOfficeDocRelationTypeTransitional(rType)); + const Relation* pRelation = getRelationFromFirstType( aTransitionalType ); + if(!pRelation) + { + OUString aStrictType = createOfficeDocRelationTypeStrict(rType); + pRelation = getRelationFromFirstType( aStrictType ); + } + return pRelation ? getFragmentPathFromRelation( *pRelation ) : OUString(); +} + +} // namespace oox::core + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/core/relationshandler.cxx b/oox/source/core/relationshandler.cxx new file mode 100644 index 000000000..90f3ebcef --- /dev/null +++ b/oox/source/core/relationshandler.cxx @@ -0,0 +1,95 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include + +#include + +#include + +#include +#include +#include +#include + +namespace oox::core { + +using namespace ::com::sun::star::uno; +using namespace ::com::sun::star::xml::sax; + +namespace { + +/* Build path to relations file from passed fragment path, e.g.: + 'path/path/file.xml' -> 'path/path/_rels/file.xml.rels' + 'file.xml' -> '_rels/file.xml.rels' + '' -> '_rels/.rels' + */ +OUString lclGetRelationsPath( const OUString& rFragmentPath ) +{ + sal_Int32 nPathLen = ::std::max< sal_Int32 >( rFragmentPath.lastIndexOf( '/' ) + 1, 0 ); + return OUString::Concat(std::u16string_view(rFragmentPath.getStr(), nPathLen )) + // file path including slash + "_rels/" + // additional '_rels/' path + std::u16string_view(rFragmentPath.getStr() + nPathLen) + // file name after path + ".rels"; // '.rels' suffix +} + +} // namespace + +RelationsFragment::RelationsFragment( XmlFilterBase& rFilter, const RelationsRef& xRelations ) : + FragmentHandler( rFilter, lclGetRelationsPath( xRelations->getFragmentPath() ), xRelations ), + mxRelations( xRelations ) +{ +} + +Reference< XFastContextHandler > RelationsFragment::createFastChildContext( + sal_Int32 nElement, const Reference< XFastAttributeList >& rxAttribs ) +{ + Reference< XFastContextHandler > xRet; + AttributeList aAttribs( rxAttribs ); + switch( nElement ) + { + case PR_TOKEN( Relationship ): + { + Relation aRelation; + aRelation.maId = aAttribs.getString( XML_Id, OUString() ); + aRelation.maType = aAttribs.getString( XML_Type, OUString() ); + aRelation.maTarget = aAttribs.getString( XML_Target, OUString() ); + if( !aRelation.maId.isEmpty() && !aRelation.maType.isEmpty() && !aRelation.maTarget.isEmpty() ) + { + sal_Int32 nTargetMode = aAttribs.getToken( XML_TargetMode, XML_Internal ); + SAL_WARN_IF( (nTargetMode != XML_Internal) && (nTargetMode != XML_External), "oox", + "RelationsFragment::createFastChildContext - unexpected target mode, assuming external" ); + aRelation.mbExternal = nTargetMode != XML_Internal; + + SAL_WARN_IF( mxRelations->count( aRelation.maId ) != 0, "oox", + "RelationsFragment::createFastChildContext - relation identifier exists already" ); + mxRelations->emplace( aRelation.maId, aRelation ); + } + } + break; + case PR_TOKEN( Relationships ): + xRet = getFastContextHandler(); + break; + } + return xRet; +} + +} // namespace oox::core + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/core/xmlfilterbase.cxx b/oox/source/core/xmlfilterbase.cxx new file mode 100644 index 000000000..e8e1a1389 --- /dev/null +++ b/oox/source/core/xmlfilterbase.cxx @@ -0,0 +1,1235 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +using ::com::sun::star::xml::dom::DocumentBuilder; +using ::com::sun::star::xml::dom::XDocument; +using ::com::sun::star::xml::dom::XDocumentBuilder; + +namespace oox::core { + +using namespace ::com::sun::star; +using namespace ::com::sun::star::beans; +using namespace ::com::sun::star::container; +using namespace ::com::sun::star::document; +using namespace ::com::sun::star::embed; +using namespace ::com::sun::star::io; +using namespace ::com::sun::star::lang; +using namespace ::com::sun::star::uno; +using namespace ::com::sun::star::xml::sax; + +using utl::MediaDescriptor; +using ::sax_fastparser::FSHelperPtr; +using ::sax_fastparser::FastSerializerHelper; + +namespace { + +const Sequence< beans::Pair< OUString, sal_Int32 > >& NamespaceIds() +{ + static const Sequence< beans::Pair< OUString, sal_Int32 > > SINGLETON + { + {"http://www.w3.org/XML/1998/namespace", NMSP_xml}, + {"http://schemas.openxmlformats.org/package/2006/relationships", + NMSP_packageRel}, + {"http://schemas.openxmlformats.org/officeDocument/2006/relationships", + NMSP_officeRel}, + {"http://purl.oclc.org/ooxml/officeDocument/relationships", + NMSP_officeRel}, + {"http://schemas.openxmlformats.org/drawingml/2006/main", NMSP_dml}, + {"http://purl.oclc.org/ooxml/drawingml/main", NMSP_dml}, + {"http://schemas.openxmlformats.org/drawingml/2006/diagram", + NMSP_dmlDiagram}, + {"http://purl.oclc.org/ooxml/drawingml/diagram", NMSP_dmlDiagram}, + {"http://schemas.openxmlformats.org/drawingml/2006/chart", + NMSP_dmlChart}, + {"http://schemas.openxmlformats.org/drawingml/2006/chartDrawing", + NMSP_dmlChartDr}, + {"urn:schemas-microsoft-com:vml", NMSP_vml}, + {"urn:schemas-microsoft-com:office:office", NMSP_vmlOffice}, + {"urn:schemas-microsoft-com:office:word", NMSP_vmlWord}, + {"urn:schemas-microsoft-com:office:excel", NMSP_vmlExcel}, + {"urn:schemas-microsoft-com:office:powerpoint", NMSP_vmlPowerpoint}, + {"http://schemas.microsoft.com/office/2006/activeX", NMSP_ax}, + {"http://schemas.openxmlformats.org/spreadsheetml/2006/main", + NMSP_xls}, + {"http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing", + NMSP_xm}, + {"http://schemas.microsoft.com/office/excel/2006/main", + NMSP_dmlSpreadDr}, + {"http://schemas.openxmlformats.org/presentationml/2006/main", + NMSP_ppt}, + {"http://schemas.openxmlformats.org/markup-compatibility/2006", + NMSP_mce}, + {"http://schemas.openxmlformats.org/spreadsheetml/2006/main/v2", + NMSP_mceTest}, + {"http://schemas.openxmlformats.org/officeDocument/2006/math", + NMSP_officeMath}, + {"http://schemas.microsoft.com/office/drawing/2008/diagram", + NMSP_dsp}, + {"http://schemas.microsoft.com/office/spreadsheetml/2009/9/main", + NMSP_xls14Lst}, + {"http://schemas.libreoffice.org/", NMSP_loext}, + {"http://schemas.microsoft.com/office/drawing/2010/main", + NMSP_a14}, + {"http://schemas.microsoft.com/office/powerpoint/2010/main", + NMSP_p14}, + {"http://schemas.microsoft.com/office/powerpoint/2012/main", + NMSP_p15}, + {"http://schemas.microsoft.com/office/spreadsheetml/2011/1/ac", + NMSP_x12ac}, + {"http://schemas.microsoft.com/office/drawing/2012/chart", + NMSP_c15}, + {"http://schemas.microsoft.com/office/spreadsheetml/2015/revision2", + NMSP_xr2}, + }; + return SINGLETON; +}; + +void registerNamespaces( FastParser& rParser ) +{ + const Sequence< beans::Pair >& ids = NamespaceIds(); + + // Filter out duplicates: a namespace can have multiple URLs, think of + // strict vs transitional. + o3tl::sorted_vector aSet; + aSet.reserve(ids.getLength()); + for (const auto& rId : ids) + aSet.insert(rId.Second); + + for (auto const& elem : aSet) + rParser.registerNamespace(elem); +} + +} // namespace + +struct XmlFilterBaseImpl +{ + typedef RefMap< OUString, Relations > RelationsMap; + + FastParser maFastParser; + RelationsMap maRelationsMap; + TextFieldStack maTextFieldStack; + const NamespaceMap& mrNamespaceMap; + NamedShapePairs* mpDiagramFontHeights = nullptr; + + /// @throws RuntimeException + explicit XmlFilterBaseImpl(); +}; + +constexpr OUStringLiteral gaBinSuffix( u".bin" ); + +XmlFilterBaseImpl::XmlFilterBaseImpl() : + mrNamespaceMap(StaticNamespaceMap()) +{ + // register XML namespaces + registerNamespaces(maFastParser); +} + +XmlFilterBase::XmlFilterBase( const Reference< XComponentContext >& rxContext ) : + FilterBase( rxContext ), + mxImpl( new XmlFilterBaseImpl ), + mnRelId( 1 ), + mnMaxDocId( 0 ), + mbMSO2007(false), + mbMSO(false), + mbMissingExtDrawing(false) +{ +} + +XmlFilterBase::~XmlFilterBase() +{ + // #i118640# Reset the DocumentHandler at the FastSaxParser manually; this is + // needed since the mechanism is that instances of FragmentHandler execute + // their stuff (creating objects, setting attributes, ...) on being destroyed. + // They get destroyed by setting a new DocumentHandler. This also happens in + // the following implicit destruction chain of ~XmlFilterBaseImpl, but in that + // case it's member RelationsMap maRelationsMap will be destroyed, but maybe + // still be used by ~FragmentHandler -> crash. + mxImpl->maFastParser.clearDocumentHandler(); +} + +std::shared_ptr<::oox::drawingml::Theme> XmlFilterBase::getCurrentThemePtr() const +{ + // default returns empty ptr + return std::shared_ptr<::oox::drawingml::Theme>(); +} + +void XmlFilterBase::checkDocumentProperties(const Reference& xDocProps) +{ + mbMSO2007 = mbMSO = false; + if (!xDocProps->getGenerator().startsWithIgnoreAsciiCase("Microsoft")) + return; + mbMSO = true; + + uno::Reference xUserDefProps(xDocProps->getUserDefinedProperties(), uno::UNO_QUERY); + if (!xUserDefProps.is()) + return; + + comphelper::SequenceAsHashMap aUserDefinedProperties(xUserDefProps->getPropertyValues()); + comphelper::SequenceAsHashMap::iterator it = aUserDefinedProperties.find("AppVersion"); + if (it == aUserDefinedProperties.end()) + return; + + OUString aValue; + if (!(it->second >>= aValue)) + return; + + if (!aValue.startsWithIgnoreAsciiCase("12.")) + return; + + SAL_INFO("oox", "a MSO 2007 document"); + mbMSO2007 = true; +} + +void XmlFilterBase::putPropertiesToDocumentGrabBag(const css::uno::Reference& xDstDoc, + const comphelper::SequenceAsHashMap& rProperties) +{ + try + { + uno::Reference xDocProps(xDstDoc, uno::UNO_QUERY); + if (xDocProps.is()) + { + uno::Reference xPropsInfo = xDocProps->getPropertySetInfo(); + + static constexpr OUStringLiteral aGrabBagPropName = u"InteropGrabBag"; + if (xPropsInfo.is() && xPropsInfo->hasPropertyByName(aGrabBagPropName)) + { + // get existing grab bag + comphelper::SequenceAsHashMap aGrabBag(xDocProps->getPropertyValue(aGrabBagPropName)); + + // put the new items + aGrabBag.update(rProperties); + + // put it back to the document + xDocProps->setPropertyValue(aGrabBagPropName, uno::Any(aGrabBag.getAsConstPropertyValueList())); + } + } + } + catch (const uno::Exception&) + { + SAL_WARN("oox","Failed to save documents grab bag"); + } +} + +void XmlFilterBase::importDocumentProperties() +{ + MediaDescriptor aMediaDesc( getMediaDescriptor() ); + Reference< XInputStream > xInputStream; + Reference< XComponentContext > xContext = getComponentContext(); + rtl::Reference< ::oox::core::FilterDetect > xDetector( new ::oox::core::FilterDetect( xContext ) ); + xInputStream = xDetector->extractUnencryptedPackage( aMediaDesc ); + Reference< XComponent > xModel = getModel(); + Reference< XStorage > xDocumentStorage ( + ::comphelper::OStorageHelper::GetStorageOfFormatFromInputStream( OFOPXML_STORAGE_FORMAT_STRING, xInputStream ) ); + Reference< XInterface > xTemp = xContext->getServiceManager()->createInstanceWithContext( + "com.sun.star.document.OOXMLDocumentPropertiesImporter", + xContext); + Reference< XOOXMLDocumentPropertiesImporter > xImporter( xTemp, UNO_QUERY ); + Reference< XDocumentPropertiesSupplier > xPropSupplier( xModel, UNO_QUERY); + Reference< XDocumentProperties > xDocProps = xPropSupplier->getDocumentProperties(); + xImporter->importProperties( xDocumentStorage, xDocProps ); + checkDocumentProperties(xDocProps); + + importCustomFragments(xDocumentStorage); +} + +FastParser* XmlFilterBase::createParser() +{ + FastParser* pParser = new FastParser; + registerNamespaces(*pParser); + return pParser; +} + +namespace { + +OUString getTransitionalRelationshipOfficeDocType(std::u16string_view rPart) +{ + return OUString::Concat("http://schemas.openxmlformats.org/officeDocument/2006/relationships/") + + rPart; +} + +OUString getStrictRelationshipOfficeDocType(std::u16string_view rPart) +{ + return OUString::Concat("http://purl.oclc.org/ooxml/officeDocument/relationships/") + rPart; +} + +} + +OUString XmlFilterBase::getFragmentPathFromFirstTypeFromOfficeDoc( std::u16string_view rPart ) +{ + // importRelations() caches the relations map for subsequence calls + const OUString aTransitionalRelationshipType = getTransitionalRelationshipOfficeDocType(rPart); + OUString aFragment = importRelations( OUString() )->getFragmentPathFromFirstType( aTransitionalRelationshipType ); + if(aFragment.isEmpty()) + { + const OUString aStrictRelationshipType = getStrictRelationshipOfficeDocType(rPart); + aFragment = importRelations( OUString() )->getFragmentPathFromFirstType( aStrictRelationshipType ); + } + + return aFragment; +} + +bool XmlFilterBase::importFragment( const rtl::Reference& rxHandler ) +{ + FastParser aParser; + registerNamespaces(aParser); + return importFragment(rxHandler, aParser); +} + +bool XmlFilterBase::importFragment( const rtl::Reference& rxHandler, FastParser& rParser ) +{ + OSL_ENSURE( rxHandler.is(), "XmlFilterBase::importFragment - missing fragment handler" ); + if( !rxHandler.is() ) + return false; + + // fragment handler must contain path to fragment stream + OUString aFragmentPath = rxHandler->getFragmentPath(); + OSL_ENSURE( !aFragmentPath.isEmpty(), "XmlFilterBase::importFragment - missing fragment path" ); + if( aFragmentPath.isEmpty() ) + return false; + + // try to import binary streams (fragment extension must be '.bin') + if (aFragmentPath.endsWith(gaBinSuffix)) + { + try + { + // try to open the fragment stream (this may fail - do not assert) + Reference< XInputStream > xInStrm( openInputStream( aFragmentPath ), UNO_SET_THROW ); + + // create the record parser + RecordParser aParser; + aParser.setFragmentHandler( rxHandler ); + + // create the input source and parse the stream + RecordInputSource aSource; + aSource.mxInStream = std::make_shared( xInStrm, true ); + aSource.maSystemId = aFragmentPath; + aParser.parseStream( aSource ); + return true; + } + catch( Exception& ) + { + } + return false; + } + + // get the XFastDocumentHandler interface from the fragment handler + if( !rxHandler.is() ) + return false; + + // try to import XML stream + try + { + /* Try to open the fragment stream (may fail, do not throw/assert). + Using the virtual function openFragmentStream() allows a document + handler to create specialized input streams, e.g. VML streams that + have to preprocess the raw input data. */ + Reference< XInputStream > xInStrm = rxHandler->openFragmentStream(); + /* tdf#100084 Check again the aFragmentPath route with lowercase file name + TODO: complete handling of case-insensitive file paths */ + if ( !xInStrm.is() ) + { + sal_Int32 nPathLen = aFragmentPath.lastIndexOf('/') + 1; + OUString fileName = aFragmentPath.copy(nPathLen); + OUString sLowerCaseFileName = fileName.toAsciiLowerCase(); + if ( fileName != sLowerCaseFileName ) + { + aFragmentPath = aFragmentPath.subView(0, nPathLen) + sLowerCaseFileName; + xInStrm = openInputStream(aFragmentPath); + } + } + + // own try/catch block for showing parser failure assertion with fragment path + if( xInStrm.is() ) try + { + rParser.setDocumentHandler(rxHandler); + rParser.parseStream(xInStrm, aFragmentPath); + return true; + } + catch( Exception& ) + { + OSL_FAIL( OStringBuffer( "XmlFilterBase::importFragment - XML parser failed in fragment '" + + OUStringToOString( aFragmentPath, RTL_TEXTENCODING_ASCII_US ) + "'" ).getStr() ); + } + } + catch( Exception& ) + { + } + return false; +} + +Reference XmlFilterBase::importFragment( const OUString& aFragmentPath ) +{ + Reference xRet; + + // path to fragment stream valid? + OSL_ENSURE( !aFragmentPath.isEmpty(), "XmlFilterBase::importFragment - empty fragment path" ); + if( aFragmentPath.isEmpty() ) + return xRet; + + // try to open the fragment stream (this may fail - do not assert) + Reference< XInputStream > xInStrm = openInputStream( aFragmentPath ); + if( !xInStrm.is() ) + return xRet; + + // binary streams (fragment extension is '.bin') currently not supported + if (aFragmentPath.endsWith(gaBinSuffix)) + return xRet; + + // try to import XML stream + try + { + // create the dom parser + Reference xDomBuilder( DocumentBuilder::create( getComponentContext() ) ); + + // create DOM from fragment + xRet = xDomBuilder->parse(xInStrm); + } + catch( Exception& ) + { + } + + return xRet; +} + +bool XmlFilterBase::importFragment( const ::rtl::Reference< FragmentHandler >& rxHandler, + const Reference< XFastSAXSerializable >& rxSerializer ) +{ + if( !rxHandler.is() ) + return false; + + // try to import XML stream + try + { + rxSerializer->fastSerialize( rxHandler, + mxImpl->maFastParser.getTokenHandler(), + Sequence< StringPair >(), + NamespaceIds() ); + return true; + } + catch( Exception& ) + {} + + return false; +} + +RelationsRef XmlFilterBase::importRelations( const OUString& rFragmentPath ) +{ + // try to find cached relations + RelationsRef& rxRelations = mxImpl->maRelationsMap[ rFragmentPath ]; + if( !rxRelations ) + { + // import and cache relations + rxRelations = std::make_shared( rFragmentPath ); + importFragment( new RelationsFragment( *this, rxRelations ) ); + } + return rxRelations; +} + +Reference< XOutputStream > XmlFilterBase::openFragmentStream( const OUString& rStreamName, const OUString& rMediaType ) +{ + Reference< XOutputStream > xOutputStream = openOutputStream( rStreamName ); + PropertySet aPropSet( xOutputStream ); + aPropSet.setProperty( PROP_MediaType, rMediaType ); + return xOutputStream; +} + +FSHelperPtr XmlFilterBase::openFragmentStreamWithSerializer( const OUString& rStreamName, const OUString& rMediaType ) +{ + const bool bWriteHeader = rMediaType.indexOf( "vml" ) < 0 || rMediaType.indexOf( "+xml" ) >= 0; + return std::make_shared( openFragmentStream( rStreamName, rMediaType ), bWriteHeader ); +} + +TextFieldStack& XmlFilterBase::getTextFieldStack() const +{ + return mxImpl->maTextFieldStack; +} + +namespace { + +OUString lclAddRelation( const Reference< XRelationshipAccess >& rRelations, sal_Int32 nId, const OUString& rType, std::u16string_view rTarget, bool bExternal ) +{ + OUString sId = "rId" + OUString::number( nId ); + + Sequence< StringPair > aEntry( bExternal ? 3 : 2 ); + auto pEntry = aEntry.getArray(); + pEntry[0].First = "Type"; + pEntry[0].Second = rType; + pEntry[1].First = "Target"; + pEntry[1].Second = INetURLObject::decode(rTarget, INetURLObject::DecodeMechanism::ToIUri, RTL_TEXTENCODING_UTF8); + if( bExternal ) + { + pEntry[2].First = "TargetMode"; + pEntry[2].Second = "External"; + } + rRelations->insertRelationshipByID( sId, aEntry, true ); + + return sId; +} + +} // namespace + +OUString XmlFilterBase::addRelation( const OUString& rType, std::u16string_view rTarget ) +{ + Reference< XRelationshipAccess > xRelations( getStorage()->getXStorage(), UNO_QUERY ); + if( xRelations.is() ) + return lclAddRelation( xRelations, mnRelId ++, rType, rTarget, false/*bExternal*/ ); + + return OUString(); +} + +OUString XmlFilterBase::addRelation( const Reference< XOutputStream >& rOutputStream, const OUString& rType, std::u16string_view rTarget, bool bExternal ) +{ + sal_Int32 nId = 0; + + PropertySet aPropSet( rOutputStream ); + if( aPropSet.is() ) + aPropSet.getProperty( nId, PROP_RelId ); + else + nId = mnRelId++; + + Reference< XRelationshipAccess > xRelations( rOutputStream, UNO_QUERY ); + if( xRelations.is() ) + return lclAddRelation( xRelations, nId, rType, rTarget, bExternal ); + + return OUString(); +} + +static void +writeElement( const FSHelperPtr& pDoc, sal_Int32 nXmlElement, std::u16string_view sValue ) +{ + pDoc->startElement(nXmlElement); + pDoc->writeEscaped( sValue ); + pDoc->endElement( nXmlElement ); +} + +static void +writeElement( const FSHelperPtr& pDoc, sal_Int32 nXmlElement, const sal_Int32 nValue ) +{ + pDoc->startElement(nXmlElement); + pDoc->write( nValue ); + pDoc->endElement( nXmlElement ); +} + +static void +writeElement( const FSHelperPtr& pDoc, sal_Int32 nXmlElement, const util::DateTime& rTime ) +{ + if( rTime.Year == 0 ) + return; + + if ( ( nXmlElement >> 16 ) != XML_dcterms ) + pDoc->startElement(nXmlElement); + else + pDoc->startElement(nXmlElement, FSNS(XML_xsi, XML_type), "dcterms:W3CDTF"); + + char pStr[200]; + snprintf( pStr, sizeof( pStr ), "%d-%02d-%02dT%02d:%02d:%02dZ", + rTime.Year, rTime.Month, rTime.Day, + rTime.Hours, rTime.Minutes, rTime.Seconds ); + + pDoc->write( pStr ); + + pDoc->endElement( nXmlElement ); +} + +static void +writeElement( const FSHelperPtr& pDoc, sal_Int32 nXmlElement, const Sequence< OUString >& aItems ) +{ + if( !aItems.hasElements() ) + return; + + OUStringBuffer sRep; + // tdf#143175 - join elements including a delimiter using a standard iterator + ::comphelper::intersperse(aItems.begin(), aItems.end(), + ::comphelper::OUStringBufferAppender(sRep), OUString(" ")); + + writeElement( pDoc, nXmlElement, sRep.makeStringAndClear() ); +} + +static void +writeElement( const FSHelperPtr& pDoc, sal_Int32 nXmlElement, const LanguageTag& rLanguageTag ) +{ + // dc:language, Dublin Core recommends "such as RFC 4646", which is BCP 47 + // and obsoleted by RFC 5646, see + // http://dublincore.org/documents/dcmi-terms/#terms-language + // http://dublincore.org/documents/dcmi-terms/#elements-language + writeElement( pDoc, nXmlElement, rLanguageTag.getBcp47MS() ); +} + +static void +writeCoreProperties( XmlFilterBase& rSelf, const Reference< XDocumentProperties >& xProperties ) +{ + OUString sValue; + if( rSelf.getVersion() == oox::core::ISOIEC_29500_2008 ) + { + // The lowercase "officedocument" is intentional and according to the spec + // (although most other places are written "officeDocument") + sValue = "http://schemas.openxmlformats.org/officedocument/2006/relationships/metadata/core-properties"; + } + else + sValue = "http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties"; + + rSelf.addRelation( sValue, u"docProps/core.xml" ); + FSHelperPtr pCoreProps = rSelf.openFragmentStreamWithSerializer( + "docProps/core.xml", + "application/vnd.openxmlformats-package.core-properties+xml" ); + pCoreProps->startElementNS( XML_cp, XML_coreProperties, + FSNS(XML_xmlns, XML_cp), rSelf.getNamespaceURL(OOX_NS(packageMetaCorePr)), + FSNS(XML_xmlns, XML_dc), rSelf.getNamespaceURL(OOX_NS(dc)), + FSNS(XML_xmlns, XML_dcterms), rSelf.getNamespaceURL(OOX_NS(dcTerms)), + FSNS(XML_xmlns, XML_dcmitype), rSelf.getNamespaceURL(OOX_NS(dcmiType)), + FSNS(XML_xmlns, XML_xsi), rSelf.getNamespaceURL(OOX_NS(xsi))); + + uno::Reference xUserDefinedProperties(xProperties->getUserDefinedProperties(), uno::UNO_QUERY); + comphelper::SequenceAsHashMap aUserDefinedProperties(xUserDefinedProperties->getPropertyValues()); + comphelper::SequenceAsHashMap::iterator it; + + it = aUserDefinedProperties.find("OOXMLCorePropertyCategory"); + if (it != aUserDefinedProperties.end()) + { + OUString aValue; + if (it->second >>= aValue) + writeElement( pCoreProps, FSNS( XML_cp, XML_category ), aValue ); + } + + it = aUserDefinedProperties.find("OOXMLCorePropertyContentStatus"); + if (it != aUserDefinedProperties.end()) + { + OUString aValue; + if (it->second >>= aValue) + writeElement( pCoreProps, FSNS( XML_cp, XML_contentStatus ), aValue ); + } + + it = aUserDefinedProperties.find("OOXMLCorePropertyContentType"); + if (it != aUserDefinedProperties.end()) + { + OUString aValue; + if (it->second >>= aValue) + writeElement( pCoreProps, FSNS( XML_cp, XML_contentType ), aValue ); + } + writeElement( pCoreProps, FSNS( XML_dcterms, XML_created ), xProperties->getCreationDate() ); + writeElement( pCoreProps, FSNS( XML_dc, XML_creator ), xProperties->getAuthor() ); + writeElement( pCoreProps, FSNS( XML_dc, XML_description ), xProperties->getDescription() ); + + it = aUserDefinedProperties.find("OOXMLCorePropertyIdentifier"); + if (it != aUserDefinedProperties.end()) + { + OUString aValue; + if (it->second >>= aValue) + writeElement( pCoreProps, FSNS( XML_dc, XML_identifier ), aValue ); + } + writeElement( pCoreProps, FSNS( XML_cp, XML_keywords ), xProperties->getKeywords() ); + writeElement( pCoreProps, FSNS( XML_dc, XML_language ), LanguageTag( xProperties->getLanguage()) ); + writeElement( pCoreProps, FSNS( XML_cp, XML_lastModifiedBy ), xProperties->getModifiedBy() ); + writeElement( pCoreProps, FSNS( XML_cp, XML_lastPrinted ), xProperties->getPrintDate() ); + writeElement( pCoreProps, FSNS( XML_dcterms, XML_modified ), xProperties->getModificationDate() ); + writeElement( pCoreProps, FSNS( XML_cp, XML_revision ), xProperties->getEditingCycles() ); + writeElement( pCoreProps, FSNS( XML_dc, XML_subject ), xProperties->getSubject() ); + writeElement( pCoreProps, FSNS( XML_dc, XML_title ), xProperties->getTitle() ); + + it = aUserDefinedProperties.find("OOXMLCorePropertyVersion"); + if (it != aUserDefinedProperties.end()) + { + OUString aValue; + if (it->second >>= aValue) + writeElement( pCoreProps, FSNS( XML_cp, XML_version ), aValue ); + } + + pCoreProps->endElementNS( XML_cp, XML_coreProperties ); +} + +static void +writeAppProperties( XmlFilterBase& rSelf, const Reference< XDocumentProperties >& xProperties ) +{ + rSelf.addRelation( + "http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties", + u"docProps/app.xml" ); + FSHelperPtr pAppProps = rSelf.openFragmentStreamWithSerializer( + "docProps/app.xml", + "application/vnd.openxmlformats-officedocument.extended-properties+xml" ); + pAppProps->startElement( XML_Properties, + XML_xmlns, rSelf.getNamespaceURL(OOX_NS(officeExtPr)), + FSNS(XML_xmlns, XML_vt), rSelf.getNamespaceURL(OOX_NS(officeDocPropsVT))); + + uno::Reference xUserDefinedProperties(xProperties->getUserDefinedProperties(), uno::UNO_QUERY); + comphelper::SequenceAsHashMap aUserDefinedProperties(xUserDefinedProperties->getPropertyValues()); + comphelper::SequenceAsHashMap::iterator it; + + writeElement( pAppProps, XML_Template, xProperties->getTemplateName() ); + + it = aUserDefinedProperties.find("Manager"); + if (it != aUserDefinedProperties.end()) + { + OUString aValue; + if (it->second >>= aValue) + writeElement( pAppProps, XML_Manager, aValue ); + } + +#ifdef OOXTODO + writeElement( pAppProps, XML_PresentationFormat, "presentation format" ); + writeElement( pAppProps, XML_Lines, "lines" ); + writeElement( pAppProps, XML_Slides, "slides" ); + writeElement( pAppProps, XML_Notes, "notes" ); +#endif /* def OOXTODO */ + // EditingDuration is in seconds, TotalTime is in minutes. + writeElement( pAppProps, XML_TotalTime, xProperties->getEditingDuration() / 60 ); +#ifdef OOXTODO + writeElement( pAppProps, XML_HiddenSlides, "hidden slides" ); + writeElement( pAppProps, XML_MMClips, "mm clips" ); + writeElement( pAppProps, XML_ScaleCrop, "scale crop" ); + writeElement( pAppProps, XML_HeadingPairs, "heading pairs" ); + writeElement( pAppProps, XML_TitlesOfParts, "titles of parts" ); + writeElement( pAppProps, XML_LinksUpToDate, "links up-to-date" ); + writeElement( pAppProps, XML_SharedDoc, "shared doc" ); + writeElement( pAppProps, XML_HLinks, "hlinks" ); + writeElement( pAppProps, XML_HyperlinksChanged, "hyperlinks changed" ); + writeElement( pAppProps, XML_DigSig, "digital signature" ); +#endif /* def OOXTODO */ + writeElement( pAppProps, XML_Application, utl::DocInfoHelper::GetGeneratorString() ); + + it = aUserDefinedProperties.find("HyperlinkBase"); + if (it != aUserDefinedProperties.end()) + { + OUString aValue; + if (it->second >>= aValue) + writeElement( pAppProps, XML_HyperlinkBase, aValue ); + } + // AppVersion specifies the version of the application which produced document + // It is strictly connected with MS Office versions: + // * 12: [Office 2007] [LO < 7.0] + // * 14: [Office 2010] + // * 15: [Office 2013/2016/2019] [LO >= 7.0] + // The LibreOffice is application on 2013/2016/2019 level + writeElement( pAppProps, XML_AppVersion, u"15.0000" ); + + // OOXTODO Calculate DocSecurity value based on security (password, read-only etc.) + it = aUserDefinedProperties.find("DocSecurity"); + if (it != aUserDefinedProperties.end()) + { + sal_Int32 nValue; + if (it->second >>= nValue) + writeElement( pAppProps, XML_DocSecurity, nValue ); + } + + comphelper::SequenceAsHashMap aStats = xProperties->getDocumentStatistics(); + sal_Int32 nValue = 0; + + it = aStats.find("PageCount"); + if (it != aStats.end()) + { + if (it->second >>= nValue) + writeElement(pAppProps, XML_Pages, nValue); + } + + it = aStats.find("WordCount"); + if (it != aStats.end()) + { + if (it->second >>= nValue) + writeElement(pAppProps, XML_Words, nValue); + } + + it = aStats.find("NonWhitespaceCharacterCount"); + if (it != aStats.end()) + { + if (it->second >>= nValue) + writeElement(pAppProps, XML_Characters, nValue); + } + + it = aStats.find("CharacterCount"); + if (it != aStats.end()) + { + if (it->second >>= nValue) + writeElement(pAppProps, XML_CharactersWithSpaces, nValue); + } + + it = aStats.find("ParagraphCount"); + if (it != aStats.end()) + { + if (it->second >>= nValue) + writeElement(pAppProps, XML_Paragraphs, nValue); + } + + it = aUserDefinedProperties.find("Company"); + if (it != aUserDefinedProperties.end()) + { + OUString aValue; + if (it->second >>= aValue) + writeElement(pAppProps, XML_Company, aValue); + } + + pAppProps->endElement( XML_Properties ); +} + +static void +writeCustomProperties( XmlFilterBase& rSelf, const Reference< XDocumentProperties >& xProperties, bool bSecurityOptOpenReadOnly ) +{ + uno::Reference xUserDefinedProperties( xProperties->getUserDefinedProperties(), uno::UNO_QUERY ); + auto aprop = comphelper::sequenceToContainer< std::vector >(xUserDefinedProperties->getPropertyValues()); + sal_Int32 nbCustomProperties = aprop.size(); + // tdf#89791 : if no custom properties, no need to add docProps/custom.x + // tdf#107690: except the case of read-only documents, because that + // is handled by the _MarkAsFinal custom property in MSO. + if (!nbCustomProperties && !bSecurityOptOpenReadOnly) + return; + + if (bSecurityOptOpenReadOnly) + { + PropertyValue aPropertyValue; + // MSO custom property for read-only documents + aPropertyValue.Name = "_MarkAsFinal"; + aPropertyValue.Value <<= true; + aprop.push_back(aPropertyValue); + } + + rSelf.addRelation( + "http://schemas.openxmlformats.org/officeDocument/2006/relationships/custom-properties", + u"docProps/custom.xml" ); + FSHelperPtr pAppProps = rSelf.openFragmentStreamWithSerializer( + "docProps/custom.xml", + "application/vnd.openxmlformats-officedocument.custom-properties+xml" ); + pAppProps->startElement( XML_Properties, + XML_xmlns, rSelf.getNamespaceURL(OOX_NS(officeCustomPr)), + FSNS(XML_xmlns, XML_vt), rSelf.getNamespaceURL(OOX_NS(officeDocPropsVT))); + + size_t nIndex = 0; + for (const auto& rProp : aprop) + { + if ( !rProp.Name.isEmpty() ) + { + // Skip storing these values in Custom Properties as it will be stored in Core/Extended Properties + if (( rProp.Name == "OOXMLCorePropertyCategory" ) || // stored in cp:category + ( rProp.Name == "OOXMLCorePropertyContentStatus" ) || // stored in cp:contentStatus + ( rProp.Name == "OOXMLCorePropertyContentType" ) || // stored in cp:contentType + ( rProp.Name == "OOXMLCorePropertyIdentifier" ) || // stored in dc:identifier + ( rProp.Name == "OOXMLCorePropertyVersion" ) || // stored in cp:version + ( rProp.Name == "HyperlinkBase" ) || // stored in Extended File Properties + ( rProp.Name == "AppVersion" ) || // stored in Extended File Properties + ( rProp.Name == "DocSecurity" ) || // stored in Extended File Properties + ( rProp.Name == "Manager" ) || // stored in Extended File Properties + ( rProp.Name == "Company" )) // stored in Extended File Properties + continue; + + // pid starts from 2 not from 1 as MS supports pid from 2 + pAppProps->startElement( XML_property , + XML_fmtid, "{D5CDD505-2E9C-101B-9397-08002B2CF9AE}", + XML_pid, OString::number(nIndex + 2), + XML_name, rProp.Name); + + switch ( rProp.Value.getValueTypeClass() ) + { + case TypeClass_STRING: + { + OUString aValue; + rProp.Value >>= aValue; + writeElement( pAppProps, FSNS( XML_vt, XML_lpwstr ), aValue ); + } + break; + case TypeClass_BOOLEAN: + { + bool val = *o3tl::forceAccess(rProp.Value); + writeElement( pAppProps, FSNS( XML_vt, XML_bool ), val ? 1 : 0); + } + break; + case TypeClass_DOUBLE: + { + double num = {}; // spurious -Werror=maybe-uninitialized + if ( rProp.Value >>= num ) + { + // r8 - 8-byte real number + writeElement( pAppProps, FSNS( XML_vt, XML_r8 ), OUString::number(num) ); + } + } + break; + default: + { + double num = {}; // spurious -Werror=maybe-uninitialized + util::Date aDate; + util::Duration aDuration; + util::DateTime aDateTime; + if ( rProp.Value >>= num ) + { + // i4 - 4-byte signed integer + writeElement( pAppProps, FSNS( XML_vt, XML_i4 ), num ); + } + else if ( rProp.Value >>= aDate ) + { + aDateTime = util::DateTime( 0, 0 , 0, 0, aDate.Day, aDate.Month, aDate.Year, true ); + writeElement( pAppProps, FSNS( XML_vt, XML_filetime ), aDateTime); + } + else if ( rProp.Value >>= aDuration ) + { + OUStringBuffer buf; + ::sax::Converter::convertDuration( buf, aDuration ); + OUString aDurationStr = buf.makeStringAndClear(); + writeElement( pAppProps, FSNS( XML_vt, XML_lpwstr ), aDurationStr ); + } + else if ( rProp.Value >>= aDateTime ) + writeElement( pAppProps, FSNS( XML_vt, XML_filetime ), aDateTime ); + else + //no other options + OSL_FAIL( "XMLFilterBase::writeCustomProperties unsupported value type!" ); + } + break; + } + pAppProps->endElement( XML_property ); + } + ++nIndex; + } + pAppProps->endElement( XML_Properties ); +} + +void XmlFilterBase::exportDocumentProperties( const Reference< XDocumentProperties >& xProperties, bool bSecurityOptOpenReadOnly ) +{ + if( xProperties.is() ) + { + writeCoreProperties( *this, xProperties ); + writeAppProperties( *this, xProperties ); + writeCustomProperties( *this, xProperties, bSecurityOptOpenReadOnly ); + } +} + +// protected ------------------------------------------------------------------ + +Reference< XInputStream > XmlFilterBase::implGetInputStream( MediaDescriptor& rMediaDesc ) const +{ + /* Get the input stream directly from the media descriptor, or decrypt the + package again. The latter is needed e.g. when the document is reloaded. + All this is implemented in the detector service. */ + rtl::Reference< FilterDetect > xDetector( new FilterDetect( getComponentContext() ) ); + return xDetector->extractUnencryptedPackage( rMediaDesc ); +} + +Reference XmlFilterBase::implGetOutputStream( MediaDescriptor& rMediaDescriptor ) const +{ + const Sequence< NamedValue > aMediaEncData = rMediaDescriptor.getUnpackedValueOrDefault( + MediaDescriptor::PROP_ENCRYPTIONDATA, + Sequence< NamedValue >() ); + + if (aMediaEncData.getLength() == 0) + { + return FilterBase::implGetOutputStream( rMediaDescriptor ); + } + else // We need to encrypt the stream so create a memory stream + { + Reference< XComponentContext > xContext = getComponentContext(); + return Reference< XStream > ( + xContext->getServiceManager()->createInstanceWithContext("com.sun.star.comp.MemoryStream", xContext), + uno::UNO_QUERY_THROW ); + } +} + +bool XmlFilterBase::implFinalizeExport( MediaDescriptor& rMediaDescriptor ) +{ + bool bRet = true; + + const Sequence< NamedValue > aMediaEncData = rMediaDescriptor.getUnpackedValueOrDefault( + MediaDescriptor::PROP_ENCRYPTIONDATA, + Sequence< NamedValue >() ); + + if (aMediaEncData.getLength()) + { + commitStorage(); + + Reference< XStream> xDocumentStream (FilterBase::implGetOutputStream(rMediaDescriptor)); + oox::ole::OleStorage aOleStorage( getComponentContext(), xDocumentStream, true ); + crypto::DocumentEncryption encryptor( getComponentContext(), getMainDocumentStream(), aOleStorage, aMediaEncData ); + bRet = encryptor.encrypt(); + if (bRet) + aOleStorage.commit(); + } + + return bRet; +} + +// private -------------------------------------------------------------------- + +StorageRef XmlFilterBase::implCreateStorage( const Reference< XInputStream >& rxInStream ) const +{ + return std::make_shared( getComponentContext(), rxInStream ); +} + +StorageRef XmlFilterBase::implCreateStorage( const Reference< XStream >& rxOutStream ) const +{ + return std::make_shared( getComponentContext(), rxOutStream ); +} + +bool XmlFilterBase::isMSO2007Document() const +{ + return mbMSO2007; +} + +bool XmlFilterBase::isMSODocument() const +{ + return mbMSO; +} + +void XmlFilterBase::setMissingExtDrawing() +{ + mbMissingExtDrawing = true; +} + +void XmlFilterBase::setDiagramFontHeights(NamedShapePairs* pDiagramFontHeights) +{ + mxImpl->mpDiagramFontHeights = pDiagramFontHeights; +} + +NamedShapePairs* XmlFilterBase::getDiagramFontHeights() { return mxImpl->mpDiagramFontHeights; } + +OUString XmlFilterBase::getNamespaceURL(sal_Int32 nNSID) const +{ + auto itr = mxImpl->mrNamespaceMap.maTransitionalNamespaceMap.find(nNSID); + if (itr == mxImpl->mrNamespaceMap.maTransitionalNamespaceMap.end()) + { + SAL_WARN("oox", "missing namespace in the namespace map for : " << nNSID); + return OUString(); + } + + return itr->second; +} + +void XmlFilterBase::importCustomFragments(css::uno::Reference const & xDocumentStorage) +{ + Reference xRelations(xDocumentStorage, UNO_QUERY); + if (!xRelations.is()) + return; + + const uno::Sequence> aSeqs = xRelations->getAllRelationships(); + + std::vector aCustomFragments; + std::vector aCustomFragmentTypes; + std::vector aCustomFragmentTargets; + for (const uno::Sequence& aSeq : aSeqs) + { + OUString sType; + OUString sTarget; + for (const beans::StringPair& aPair : aSeq) + { + if (aPair.First == "Target") + sTarget = aPair.Second; + else if (aPair.First == "Type") + sType = aPair.Second; + } + + // Preserve non-standard (i.e. custom) entries. + if (!sType.match("http://schemas.openxmlformats.org") // OOXML/ECMA Transitional + && !sType.match("http://purl.oclc.org")) // OOXML Strict + { + StreamDataSequence aDataSeq; + if (importBinaryData(aDataSeq, sTarget)) + { + aCustomFragments.emplace_back(aDataSeq); + aCustomFragmentTypes.emplace_back(sType); + aCustomFragmentTargets.emplace_back(sTarget); + } + } + } + + // Adding the saved custom xml DOM + comphelper::SequenceAsHashMap aGrabBagProperties; + aGrabBagProperties["OOXCustomFragments"] <<= comphelper::containerToSequence(aCustomFragments); + aGrabBagProperties["OOXCustomFragmentTypes"] <<= comphelper::containerToSequence(aCustomFragmentTypes); + aGrabBagProperties["OOXCustomFragmentTargets"] <<= comphelper::containerToSequence(aCustomFragmentTargets); + + std::vector> aCustomXmlDomList; + std::vector> aCustomXmlDomPropsList; + //FIXME: Ideally, we should get these the relations, but it seems that is not consistently set. + // In some cases it's stored in the workbook relationships, which is unexpected. So we discover them directly. + for (int i = 1; ; ++i) + { + Reference xCustDoc = importFragment("customXml/item" + OUString::number(i) + ".xml"); + Reference xCustDocProps = importFragment("customXml/itemProps" + OUString::number(i) + ".xml"); + if (xCustDoc && xCustDocProps) + { + aCustomXmlDomList.emplace_back(xCustDoc); + aCustomXmlDomPropsList.emplace_back(xCustDocProps); + } + else + break; + } + + // Adding the saved custom xml DOM + aGrabBagProperties["OOXCustomXml"] <<= comphelper::containerToSequence(aCustomXmlDomList); + aGrabBagProperties["OOXCustomXmlProps"] <<= comphelper::containerToSequence(aCustomXmlDomPropsList); + + // Save the [Content_Types].xml after parsing. + uno::Sequence> aContentTypeInfo; + uno::Reference xInputStream = openInputStream("[Content_Types].xml"); + if (xInputStream.is()) + aContentTypeInfo = comphelper::OFOPXMLHelper::ReadContentTypeSequence(xInputStream, getComponentContext()); + + aGrabBagProperties["OOXContentTypes"] <<= aContentTypeInfo; + + Reference xModel = getModel(); + oox::core::XmlFilterBase::putPropertiesToDocumentGrabBag(xModel, aGrabBagProperties); +} + +void XmlFilterBase::exportCustomFragments() +{ + Reference xModel = getModel(); + uno::Reference xPropSet(xModel, uno::UNO_QUERY_THROW); + + uno::Reference xPropSetInfo = xPropSet->getPropertySetInfo(); + if (!xPropSetInfo->hasPropertyByName(UNO_NAME_MISC_OBJ_INTEROPGRABBAG)) + return; + + uno::Sequence> customXmlDomlist; + uno::Sequence> customXmlDomPropslist; + uno::Sequence customFragments; + uno::Sequence customFragmentTypes; + uno::Sequence customFragmentTargets; + uno::Sequence> aContentTypes; + + uno::Sequence propList; + xPropSet->getPropertyValue(UNO_NAME_MISC_OBJ_INTEROPGRABBAG) >>= propList; + for (const auto& rProp : std::as_const(propList)) + { + const OUString propName = rProp.Name; + if (propName == "OOXCustomXml") + { + rProp.Value >>= customXmlDomlist; + } + else if (propName == "OOXCustomXmlProps") + { + rProp.Value >>= customXmlDomPropslist; + } + else if (propName == "OOXCustomFragments") + { + rProp.Value >>= customFragments; + } + else if (propName == "OOXCustomFragmentTypes") + { + rProp.Value >>= customFragmentTypes; + } + else if (propName == "OOXCustomFragmentTargets") + { + rProp.Value >>= customFragmentTargets; + } + else if (propName == "OOXContentTypes") + { + rProp.Value >>= aContentTypes; + } + } + + // Expect customXmlDomPropslist.getLength() == customXmlDomlist.getLength(). + for (sal_Int32 j = 0; j < customXmlDomlist.getLength(); j++) + { + uno::Reference customXmlDom = customXmlDomlist[j]; + uno::Reference customXmlDomProps = customXmlDomPropslist[j]; + const OUString fragmentPath = "customXml/item" + OUString::number(j+1) + ".xml"; + if (customXmlDom.is()) + { + addRelation(oox::getRelationship(Relationship::CUSTOMXML), OUStringConcatenation("../" + fragmentPath)); + + uno::Reference serializer(customXmlDom, uno::UNO_QUERY); + uno::Reference writer = xml::sax::Writer::create(comphelper::getProcessComponentContext()); + writer->setOutputStream(openFragmentStream(fragmentPath, "application/xml")); + serializer->serialize(uno::Reference(writer, uno::UNO_QUERY_THROW), + uno::Sequence()); + } + + if (customXmlDomProps.is()) + { + uno::Reference serializer(customXmlDomProps, uno::UNO_QUERY); + uno::Reference writer = xml::sax::Writer::create(comphelper::getProcessComponentContext()); + writer->setOutputStream(openFragmentStream("customXml/itemProps"+OUString::number(j+1)+".xml", + "application/vnd.openxmlformats-officedocument.customXmlProperties+xml")); + serializer->serialize(uno::Reference(writer, uno::UNO_QUERY_THROW), + uno::Sequence()); + + // Adding itemprops's relationship entry to item.xml.rels file + addRelation(openFragmentStream(fragmentPath, "application/xml"), + oox::getRelationship(Relationship::CUSTOMXMLPROPS), + OUStringConcatenation("itemProps"+OUString::number(j+1)+".xml")); + } + } + + // Expect customFragments.getLength() == customFragmentTypes.getLength() == customFragmentTargets.getLength(). + for (sal_Int32 j = 0; j < customFragments.getLength(); j++) + { + addRelation(customFragmentTypes[j], customFragmentTargets[j]); + const OUString aFilename = customFragmentTargets[j]; + Reference xOutStream = openOutputStream(aFilename); + if (xOutStream.is()) + { + xOutStream->writeBytes(customFragments[j]); + uno::Reference xProps(xOutStream, uno::UNO_QUERY); + if (xProps.is()) + { + const OUString aType = comphelper::OFOPXMLHelper::GetContentTypeByName(aContentTypes, aFilename); + const OUString aContentType = (aType.getLength() ? aType : OUString("application/octet-stream")); + xProps->setPropertyValue("MediaType", uno::Any(aContentType)); + } + } + } +} + +} // namespace oox::core + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/crypto/AgileEngine.cxx b/oox/source/crypto/AgileEngine.cxx new file mode 100644 index 000000000..f75184981 --- /dev/null +++ b/oox/source/crypto/AgileEngine.cxx @@ -0,0 +1,843 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + */ + +#include + +#include +#include + +#include + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include +#include +#include + +using namespace css; +using namespace css::beans; +using namespace css::io; +using namespace css::lang; +using namespace css::uno; +using namespace css::xml::sax; +using namespace css::xml; + +namespace oox::crypto { + +namespace { + +std::u16string_view stripNamespacePrefix(std::u16string_view rsInputName) +{ + size_t idx = rsInputName.find(':'); + if (idx == std::u16string_view::npos) + return rsInputName; + return rsInputName.substr(idx + 1); +} + +class AgileTokenHandler : public sax_fastparser::FastTokenHandlerBase +{ +public: + virtual sal_Int32 SAL_CALL getTokenFromUTF8(const Sequence< sal_Int8 >& /*nIdentifier*/) override + { + return FastToken::DONTKNOW; + } + + virtual Sequence SAL_CALL getUTF8Identifier(sal_Int32 /*nToken*/) override + { + return Sequence(); + } + + virtual sal_Int32 getTokenDirect( const char * /* pToken */, sal_Int32 /* nLength */ ) const override + { + return -1; + } +}; + +class AgileDocumentHandler : public ::cppu::WeakImplHelper +{ + AgileEncryptionInfo& mInfo; + +public: + explicit AgileDocumentHandler(AgileEncryptionInfo& rInfo) : + mInfo(rInfo) + {} + + void SAL_CALL startDocument() override {} + void SAL_CALL endDocument() override {} + void SAL_CALL processingInstruction( const OUString& /*rTarget*/, const OUString& /*rData*/ ) override {} + void SAL_CALL setDocumentLocator( const Reference< XLocator >& /*xLocator*/ ) override {} + void SAL_CALL startFastElement( sal_Int32 /*Element*/, const Reference< XFastAttributeList >& /*Attribs*/ ) override {} + + void SAL_CALL startUnknownElement( const OUString& /*aNamespace*/, const OUString& rName, const Reference< XFastAttributeList >& aAttributeList ) override + { + std::u16string_view rLocalName = stripNamespacePrefix(rName); + + const css::uno::Sequence aUnknownAttributes = aAttributeList->getUnknownAttributes(); + for (const Attribute& rAttribute : aUnknownAttributes) + { + std::u16string_view rAttrLocalName = stripNamespacePrefix(rAttribute.Name); + + if (rAttrLocalName == u"spinCount") + { + ::sax::Converter::convertNumber(mInfo.spinCount, rAttribute.Value); + } + else if (rAttrLocalName == u"saltSize") + { + ::sax::Converter::convertNumber(mInfo.saltSize, rAttribute.Value); + } + else if (rAttrLocalName == u"blockSize") + { + ::sax::Converter::convertNumber(mInfo.blockSize, rAttribute.Value); + } + else if (rAttrLocalName == u"keyBits") + { + ::sax::Converter::convertNumber(mInfo.keyBits, rAttribute.Value); + } + else if (rAttrLocalName == u"hashSize") + { + ::sax::Converter::convertNumber(mInfo.hashSize, rAttribute.Value); + } + else if (rAttrLocalName == u"cipherAlgorithm") + { + mInfo.cipherAlgorithm = rAttribute.Value; + } + else if (rAttrLocalName == u"cipherChaining") + { + mInfo.cipherChaining = rAttribute.Value; + } + else if (rAttrLocalName == u"hashAlgorithm") + { + mInfo.hashAlgorithm = rAttribute.Value; + } + else if (rAttrLocalName == u"saltValue") + { + Sequence saltValue; + comphelper::Base64::decode(saltValue, rAttribute.Value); + if (rLocalName == u"encryptedKey") + mInfo.saltValue = comphelper::sequenceToContainer>(saltValue); + else if (rLocalName == u"keyData") + mInfo.keyDataSalt = comphelper::sequenceToContainer>(saltValue); + } + else if (rAttrLocalName == u"encryptedVerifierHashInput") + { + Sequence encryptedVerifierHashInput; + comphelper::Base64::decode(encryptedVerifierHashInput, rAttribute.Value); + mInfo.encryptedVerifierHashInput = comphelper::sequenceToContainer>(encryptedVerifierHashInput); + } + else if (rAttrLocalName == u"encryptedVerifierHashValue") + { + Sequence encryptedVerifierHashValue; + comphelper::Base64::decode(encryptedVerifierHashValue, rAttribute.Value); + mInfo.encryptedVerifierHashValue = comphelper::sequenceToContainer>(encryptedVerifierHashValue); + } + else if (rAttrLocalName == u"encryptedKeyValue") + { + Sequence encryptedKeyValue; + comphelper::Base64::decode(encryptedKeyValue, rAttribute.Value); + mInfo.encryptedKeyValue = comphelper::sequenceToContainer>(encryptedKeyValue); + } + if (rAttrLocalName == u"encryptedHmacKey") + { + Sequence aValue; + comphelper::Base64::decode(aValue, rAttribute.Value); + mInfo.hmacEncryptedKey = comphelper::sequenceToContainer>(aValue); + } + if (rAttrLocalName == u"encryptedHmacValue") + { + Sequence aValue; + comphelper::Base64::decode(aValue, rAttribute.Value); + mInfo.hmacEncryptedValue = comphelper::sequenceToContainer>(aValue); + } + } + } + + void SAL_CALL endFastElement( sal_Int32 /*aElement*/ ) override + {} + void SAL_CALL endUnknownElement( const OUString& /*aNamespace*/, const OUString& /*aName*/ ) override + {} + + Reference< XFastContextHandler > SAL_CALL createFastChildContext( sal_Int32 /*aElement*/, const Reference< XFastAttributeList >& /*aAttribs*/ ) override + { + return nullptr; + } + + Reference< XFastContextHandler > SAL_CALL createUnknownChildContext( const OUString& /*aNamespace*/, const OUString& /*aName*/, const Reference< XFastAttributeList >& /*aAttribs*/ ) override + { + return this; + } + + void SAL_CALL characters( const OUString& /*aChars*/ ) override + {} +}; + +constexpr const sal_uInt32 constSegmentLength = 4096; + +const std::vector constBlock1 { 0xfe, 0xa7, 0xd2, 0x76, 0x3b, 0x4b, 0x9e, 0x79 }; +const std::vector constBlock2 { 0xd7, 0xaa, 0x0f, 0x6d, 0x30, 0x61, 0x34, 0x4e }; +const std::vector constBlock3 { 0x14, 0x6e, 0x0b, 0xe7, 0xab, 0xac, 0xd0, 0xd6 }; +const std::vector constBlockHmac1 { 0x5f, 0xb2, 0xad, 0x01, 0x0c, 0xb9, 0xe1, 0xf6 }; +const std::vector constBlockHmac2 { 0xa0, 0x67, 0x7f, 0x02, 0xb2, 0x2c, 0x84, 0x33 }; + +bool hashCalc(std::vector& output, + std::vector& input, + std::u16string_view sAlgorithm ) +{ + if (sAlgorithm == u"SHA1") + { + std::vector out = comphelper::Hash::calculateHash(input.data(), input.size(), comphelper::HashType::SHA1); + output = out; + return true; + } + else if (sAlgorithm == u"SHA512") + { + std::vector out = comphelper::Hash::calculateHash(input.data(), input.size(), comphelper::HashType::SHA512); + output = out; + return true; + } + return false; +} + +CryptoHashType cryptoHashTypeFromString(std::u16string_view sAlgorithm) +{ + if (sAlgorithm == u"SHA512") + return CryptoHashType::SHA512; + return CryptoHashType::SHA1; +} + +} // namespace + +AgileEngine::AgileEngine() + : meEncryptionPreset(AgileEncryptionPreset::AES_256_SHA512) +{} + +Crypto::CryptoType AgileEngine::cryptoType(const AgileEncryptionInfo& rInfo) +{ + if (rInfo.keyBits == 128 && rInfo.cipherAlgorithm == "AES" && rInfo.cipherChaining == "ChainingModeCBC") + return Crypto::AES_128_CBC; + else if (rInfo.keyBits == 256 && rInfo.cipherAlgorithm == "AES" && rInfo.cipherChaining == "ChainingModeCBC") + return Crypto::AES_256_CBC; + return Crypto::UNKNOWN; +} + +static std::vector calculateIV(comphelper::HashType eType, + std::vector const & rSalt, + std::vector const & rBlock, + sal_Int32 nCipherBlockSize) +{ + comphelper::Hash aHasher(eType); + aHasher.update(rSalt.data(), rSalt.size()); + aHasher.update(rBlock.data(), rBlock.size()); + std::vector aIV = aHasher.finalize(); + aIV.resize(roundUp(sal_Int32(aIV.size()), nCipherBlockSize), 0x36); + return aIV; +} + +void AgileEngine::calculateBlock( + std::vector const & rBlock, + std::vector& rHashFinal, + std::vector& rInput, + std::vector& rOutput) +{ + std::vector hash(mInfo.hashSize, 0); + std::vector dataFinal(mInfo.hashSize + rBlock.size(), 0); + std::copy(rHashFinal.begin(), rHashFinal.end(), dataFinal.begin()); + std::copy(rBlock.begin(), rBlock.end(), dataFinal.begin() + mInfo.hashSize); + + hashCalc(hash, dataFinal, mInfo.hashAlgorithm); + + sal_Int32 keySize = mInfo.keyBits / 8; + std::vector key(keySize, 0); + + std::copy(hash.begin(), hash.begin() + keySize, key.begin()); + + Decrypt aDecryptor(key, mInfo.saltValue, cryptoType(mInfo)); + aDecryptor.update(rOutput, rInput); +} + +void AgileEngine::encryptBlock( + std::vector const & rBlock, + std::vector & rHashFinal, + std::vector & rInput, + std::vector & rOutput) +{ + std::vector hash(mInfo.hashSize, 0); + std::vector dataFinal(mInfo.hashSize + rBlock.size(), 0); + std::copy(rHashFinal.begin(), rHashFinal.end(), dataFinal.begin()); + std::copy(rBlock.begin(), rBlock.end(), dataFinal.begin() + mInfo.hashSize); + + hashCalc(hash, dataFinal, mInfo.hashAlgorithm); + + sal_Int32 keySize = mInfo.keyBits / 8; + std::vector key(keySize, 0); + + std::copy(hash.begin(), hash.begin() + keySize, key.begin()); + + Encrypt aEncryptor(key, mInfo.saltValue, cryptoType(mInfo)); + + aEncryptor.update(rOutput, rInput); +} + +void AgileEngine::calculateHashFinal(const OUString& rPassword, std::vector& aHashFinal) +{ + aHashFinal = comphelper::DocPasswordHelper::GetOoxHashAsVector( + rPassword, mInfo.saltValue, mInfo.spinCount, + comphelper::Hash::IterCount::PREPEND, mInfo.hashAlgorithm); +} + +namespace +{ + +bool generateBytes(std::vector & rBytes, sal_Int32 nSize) +{ + size_t nMax = std::min(rBytes.size(), size_t(nSize)); + + for (size_t i = 0; i < nMax; ++i) + { + rBytes[i] = sal_uInt8(comphelper::rng::uniform_uint_distribution(0, 0xFF)); + } + + return true; +} + +} // end anonymous namespace + +bool AgileEngine::decryptAndCheckVerifierHash(OUString const & rPassword) +{ + std::vector& encryptedHashValue = mInfo.encryptedVerifierHashValue; + size_t encryptedHashValueSize = encryptedHashValue.size(); + size_t nHashValueSize = mInfo.hashSize; + if (nHashValueSize > encryptedHashValueSize) + return false; + + std::vector hashFinal(nHashValueSize, 0); + calculateHashFinal(rPassword, hashFinal); + + std::vector& encryptedHashInput = mInfo.encryptedVerifierHashInput; + // SALT - needs to be a multiple of block size (?) + sal_uInt32 nSaltSize = roundUp(mInfo.saltSize, mInfo.blockSize); + if (nSaltSize < encryptedHashInput.size()) + return false; + std::vector hashInput(nSaltSize, 0); + calculateBlock(constBlock1, hashFinal, encryptedHashInput, hashInput); + + std::vector hashValue(encryptedHashValueSize, 0); + calculateBlock(constBlock2, hashFinal, encryptedHashValue, hashValue); + + std::vector hash(nHashValueSize, 0); + hashCalc(hash, hashInput, mInfo.hashAlgorithm); + + return std::equal(hash.begin(), hash.end(), hashValue.begin()); +} + +void AgileEngine::decryptEncryptionKey(OUString const & rPassword) +{ + sal_Int32 nKeySize = mInfo.keyBits / 8; + + mKey.clear(); + mKey.resize(nKeySize, 0); + + std::vector aPasswordHash(mInfo.hashSize, 0); + calculateHashFinal(rPassword, aPasswordHash); + + calculateBlock(constBlock3, aPasswordHash, mInfo.encryptedKeyValue, mKey); +} + +// TODO: Rename +bool AgileEngine::generateEncryptionKey(OUString const & rPassword) +{ + bool bResult = decryptAndCheckVerifierHash(rPassword); + + if (bResult) + { + decryptEncryptionKey(rPassword); + decryptHmacKey(); + decryptHmacValue(); + } + return bResult; +} + +bool AgileEngine::decryptHmacKey() +{ + // Initialize hmacKey + mInfo.hmacKey.clear(); + mInfo.hmacKey.resize(mInfo.hmacEncryptedKey.size(), 0); + + // Calculate IV + comphelper::HashType eType; + if (mInfo.hashAlgorithm == "SHA1") + eType = comphelper::HashType::SHA1; + else if (mInfo.hashAlgorithm == "SHA512") + eType = comphelper::HashType::SHA512; + else + return false; + + std::vector iv = calculateIV(eType, mInfo.keyDataSalt, constBlockHmac1, mInfo.blockSize); + + // Decrypt without key, calculated iv + Decrypt aDecrypt(mKey, iv, cryptoType(mInfo)); + aDecrypt.update(mInfo.hmacKey, mInfo.hmacEncryptedKey); + + mInfo.hmacKey.resize(mInfo.hashSize, 0); + + return true; +} + +bool AgileEngine::decryptHmacValue() +{ + // Initialize hmacHash + mInfo.hmacHash.clear(); + mInfo.hmacHash.resize(mInfo.hmacEncryptedValue.size(), 0); + + // Calculate IV + comphelper::HashType eType; + if (mInfo.hashAlgorithm == "SHA1") + eType = comphelper::HashType::SHA1; + else if (mInfo.hashAlgorithm == "SHA512") + eType = comphelper::HashType::SHA512; + else + return false; + std::vector iv = calculateIV(eType, mInfo.keyDataSalt, constBlockHmac2, mInfo.blockSize); + + // Decrypt without key, calculated iv + Decrypt aDecrypt(mKey, iv, cryptoType(mInfo)); + aDecrypt.update(mInfo.hmacHash, mInfo.hmacEncryptedValue); + + mInfo.hmacHash.resize(mInfo.hashSize, 0); + + return true; +} + +bool AgileEngine::checkDataIntegrity() +{ + bool bResult = (mInfo.hmacHash.size() == mInfo.hmacCalculatedHash.size() && + std::equal(mInfo.hmacHash.begin(), mInfo.hmacHash.end(), mInfo.hmacCalculatedHash.begin())); + + return bResult; +} + +bool AgileEngine::decrypt(BinaryXInputStream& aInputStream, + BinaryXOutputStream& aOutputStream) +{ + CryptoHash aCryptoHash(mInfo.hmacKey, cryptoHashTypeFromString(mInfo.hashAlgorithm)); + + sal_uInt32 totalSize = aInputStream.readuInt32(); // Document unencrypted size - 4 bytes + // account for size in HMAC + std::vector aSizeBytes(sizeof(sal_uInt32)); + ByteOrderConverter::writeLittleEndian(aSizeBytes.data(), totalSize); + aCryptoHash.update(aSizeBytes); + + aInputStream.skip(4); // Reserved 4 Bytes + // account for reserved 4 bytes (must be 0) + std::vector aReserved{0,0,0,0}; + aCryptoHash.update(aReserved); + + // setup decryption + std::vector& keyDataSalt = mInfo.keyDataSalt; + + sal_uInt32 saltSize = mInfo.saltSize; + sal_uInt32 keySize = mInfo.keyBits / 8; + + sal_uInt32 segment = 0; + + std::vector saltWithBlockKey(saltSize + sizeof(segment), 0); + std::copy(keyDataSalt.begin(), keyDataSalt.end(), saltWithBlockKey.begin()); + + std::vector hash(mInfo.hashSize, 0); + std::vector iv(keySize, 0); + + std::vector inputBuffer(constSegmentLength); + std::vector outputBuffer(constSegmentLength); + sal_uInt32 inputLength; + sal_uInt32 outputLength; + sal_uInt32 remaining = totalSize; + + while ((inputLength = aInputStream.readMemory(inputBuffer.data(), inputBuffer.size())) > 0) + { + auto p = saltWithBlockKey.begin() + saltSize; + p[0] = segment & 0xFF; + p[1] = (segment >> 8) & 0xFF; + p[2] = (segment >> 16) & 0xFF; + p[3] = segment >> 24; + + hashCalc(hash, saltWithBlockKey, mInfo.hashAlgorithm); + + // Only if hash > keySize + std::copy(hash.begin(), hash.begin() + keySize, iv.begin()); + + Decrypt aDecryptor(mKey, iv, AgileEngine::cryptoType(mInfo)); + outputLength = aDecryptor.update(outputBuffer, inputBuffer, inputLength); + + sal_uInt32 writeLength = std::min(outputLength, remaining); + + aCryptoHash.update(inputBuffer, inputLength); + + aOutputStream.writeMemory(outputBuffer.data(), writeLength); + + remaining -= outputLength; + segment++; + } + + mInfo.hmacCalculatedHash = aCryptoHash.finalize(); + + return true; +} + +bool AgileEngine::readEncryptionInfo(uno::Reference & rxInputStream) +{ + // Check reserved value + std::vector aExpectedReservedBytes(sizeof(sal_uInt32)); + ByteOrderConverter::writeLittleEndian(aExpectedReservedBytes.data(), msfilter::AGILE_ENCRYPTION_RESERVED); + + uno::Sequence aReadReservedBytes(sizeof(sal_uInt32)); + rxInputStream->readBytes(aReadReservedBytes, aReadReservedBytes.getLength()); + + if (!std::equal(std::cbegin(aReadReservedBytes), std::cend(aReadReservedBytes), aExpectedReservedBytes.begin())) + return false; + + mInfo.spinCount = 0; + mInfo.saltSize = 0; + mInfo.keyBits = 0; + mInfo.hashSize = 0; + mInfo.blockSize = 0; + + Reference xFastDocumentHandler(new AgileDocumentHandler(mInfo)); + Reference xFastTokenHandler(new AgileTokenHandler); + + Reference xParser(css::xml::sax::FastParser::create(comphelper::getProcessComponentContext())); + + xParser->setFastDocumentHandler(xFastDocumentHandler); + xParser->setTokenHandler(xFastTokenHandler); + + InputSource aInputSource; + aInputSource.aInputStream = rxInputStream; + xParser->parseStream(aInputSource); + + // CHECK info data + if (2 > mInfo.blockSize || mInfo.blockSize > 4096) + return false; + + if (0 > mInfo.spinCount || mInfo.spinCount > 10000000) + return false; + + if (1 > mInfo.saltSize|| mInfo.saltSize > 65536) // Check + return false; + + // AES 128 CBC with SHA1 + if (mInfo.keyBits == 128 && + mInfo.cipherAlgorithm == "AES" && + mInfo.cipherChaining == "ChainingModeCBC" && + mInfo.hashAlgorithm == "SHA1" && + mInfo.hashSize == comphelper::SHA1_HASH_LENGTH) + { + return true; + } + + // AES 256 CBC with SHA512 + if (mInfo.keyBits == 256 && + mInfo.cipherAlgorithm == "AES" && + mInfo.cipherChaining == "ChainingModeCBC" && + mInfo.hashAlgorithm == "SHA512" && + mInfo.hashSize == comphelper::SHA512_HASH_LENGTH) + { + return true; + } + + return false; +} + +bool AgileEngine::generateAndEncryptVerifierHash(OUString const & rPassword) +{ + if (!generateBytes(mInfo.saltValue, mInfo.saltSize)) + return false; + + std::vector unencryptedVerifierHashInput(mInfo.saltSize); + if (!generateBytes(unencryptedVerifierHashInput, mInfo.saltSize)) + return false; + + // HASH - needs to be modified to be multiple of block size + sal_Int32 nVerifierHash = roundUp(mInfo.hashSize, mInfo.blockSize); + std::vector unencryptedVerifierHashValue; + if (!hashCalc(unencryptedVerifierHashValue, unencryptedVerifierHashInput, mInfo.hashAlgorithm)) + return false; + unencryptedVerifierHashValue.resize(nVerifierHash, 0); + + std::vector hashFinal(mInfo.hashSize, 0); + calculateHashFinal(rPassword, hashFinal); + + encryptBlock(constBlock1, hashFinal, unencryptedVerifierHashInput, mInfo.encryptedVerifierHashInput); + + encryptBlock(constBlock2, hashFinal, unencryptedVerifierHashValue, mInfo.encryptedVerifierHashValue); + + return true; +} + +bool AgileEngine::encryptHmacKey() +{ + // Initialize hmacKey + mInfo.hmacKey.clear(); + mInfo.hmacKey.resize(mInfo.hashSize, 0); + + if (!generateBytes(mInfo.hmacKey, mInfo.hashSize)) + return false; + + // Encrypted salt must be multiple of block size + sal_Int32 nEncryptedSaltSize = oox::crypto::roundUp(mInfo.hashSize, mInfo.blockSize); + + // We need to extend hmacSalt to multiple of block size, padding with 0x36 + std::vector extendedSalt(mInfo.hmacKey); + extendedSalt.resize(nEncryptedSaltSize, 0x36); + + // Initialize hmacEncryptedKey + mInfo.hmacEncryptedKey.clear(); + mInfo.hmacEncryptedKey.resize(nEncryptedSaltSize, 0); + + // Calculate IV + comphelper::HashType eType; + if (mInfo.hashAlgorithm == "SHA1") + eType = comphelper::HashType::SHA1; + else if (mInfo.hashAlgorithm == "SHA512") + eType = comphelper::HashType::SHA512; + else + return false; + + std::vector iv = calculateIV(eType, mInfo.keyDataSalt, constBlockHmac1, mInfo.blockSize); + + // Encrypt without key, calculated iv + Encrypt aEncryptor(mKey, iv, cryptoType(mInfo)); + aEncryptor.update(mInfo.hmacEncryptedKey, extendedSalt); + + return true; +} + +bool AgileEngine::encryptHmacValue() +{ + sal_Int32 nEncryptedValueSize = roundUp(mInfo.hashSize, mInfo.blockSize); + mInfo.hmacEncryptedValue.clear(); + mInfo.hmacEncryptedValue.resize(nEncryptedValueSize, 0); + + std::vector extendedHash(mInfo.hmacHash); + extendedHash.resize(nEncryptedValueSize, 0x36); + + // Calculate IV + comphelper::HashType eType; + if (mInfo.hashAlgorithm == "SHA1") + eType = comphelper::HashType::SHA1; + else if (mInfo.hashAlgorithm == "SHA512") + eType = comphelper::HashType::SHA512; + else + return false; + + std::vector iv = calculateIV(eType, mInfo.keyDataSalt, constBlockHmac2, mInfo.blockSize); + + // Encrypt without key, calculated iv + Encrypt aEncryptor(mKey, iv, cryptoType(mInfo)); + aEncryptor.update(mInfo.hmacEncryptedValue, extendedHash); + + return true; +} + +bool AgileEngine::encryptEncryptionKey(OUString const & rPassword) +{ + sal_Int32 nKeySize = mInfo.keyBits / 8; + + mKey.clear(); + mKey.resize(nKeySize, 0); + + mInfo.encryptedKeyValue.clear(); + mInfo.encryptedKeyValue.resize(nKeySize, 0); + + if (!generateBytes(mKey, nKeySize)) + return false; + + std::vector aPasswordHash(mInfo.hashSize, 0); + calculateHashFinal(rPassword, aPasswordHash); + + encryptBlock(constBlock3, aPasswordHash, mKey, mInfo.encryptedKeyValue); + + return true; +} + +bool AgileEngine::setupEncryption(OUString const & rPassword) +{ + if (meEncryptionPreset == AgileEncryptionPreset::AES_128_SHA1) + setupEncryptionParameters({ 100000, 16, 128, 20, 16, OUString("AES"), OUString("ChainingModeCBC"), OUString("SHA1") }); + else + setupEncryptionParameters({ 100000, 16, 256, 64, 16, OUString("AES"), OUString("ChainingModeCBC"), OUString("SHA512") }); + + return setupEncryptionKey(rPassword); +} + +void AgileEngine::setupEncryptionParameters(AgileEncryptionParameters const & rAgileEncryptionParameters) +{ + mInfo.spinCount = rAgileEncryptionParameters.spinCount; + mInfo.saltSize = rAgileEncryptionParameters.saltSize; + mInfo.keyBits = rAgileEncryptionParameters.keyBits; + mInfo.hashSize = rAgileEncryptionParameters.hashSize; + mInfo.blockSize = rAgileEncryptionParameters.blockSize; + + mInfo.cipherAlgorithm = rAgileEncryptionParameters.cipherAlgorithm; + mInfo.cipherChaining = rAgileEncryptionParameters.cipherChaining; + mInfo.hashAlgorithm = rAgileEncryptionParameters.hashAlgorithm; + + mInfo.keyDataSalt.resize(mInfo.saltSize); + mInfo.saltValue.resize(mInfo.saltSize); + mInfo.encryptedVerifierHashInput.resize(mInfo.saltSize); + mInfo.encryptedVerifierHashValue.resize(roundUp(mInfo.hashSize, mInfo.blockSize), 0); +} + +bool AgileEngine::setupEncryptionKey(OUString const & rPassword) +{ + if (!generateAndEncryptVerifierHash(rPassword)) + return false; + if (!encryptEncryptionKey(rPassword)) + return false; + if (!generateBytes(mInfo.keyDataSalt, mInfo.saltSize)) + return false; + if (!encryptHmacKey()) + return false; + return true; +} + +void AgileEngine::writeEncryptionInfo(BinaryXOutputStream & rStream) +{ + rStream.WriteUInt32(msfilter::VERSION_INFO_AGILE); + rStream.WriteUInt32(msfilter::AGILE_ENCRYPTION_RESERVED); + + SvMemoryStream aMemStream; + tools::XmlWriter aXmlWriter(&aMemStream); + + if (aXmlWriter.startDocument(0/*nIndent*/)) + { + aXmlWriter.startElement("", "encryption", "http://schemas.microsoft.com/office/2006/encryption"); + aXmlWriter.attribute("xmlns:p", OString("http://schemas.microsoft.com/office/2006/keyEncryptor/password")); + + aXmlWriter.startElement("keyData"); + aXmlWriter.attribute("saltSize", mInfo.saltSize); + aXmlWriter.attribute("blockSize", mInfo.blockSize); + aXmlWriter.attribute("keyBits", mInfo.keyBits); + aXmlWriter.attribute("hashSize", mInfo.hashSize); + aXmlWriter.attribute("cipherAlgorithm", mInfo.cipherAlgorithm); + aXmlWriter.attribute("cipherChaining", mInfo.cipherChaining); + aXmlWriter.attribute("hashAlgorithm", mInfo.hashAlgorithm); + aXmlWriter.attributeBase64("saltValue", mInfo.keyDataSalt); + aXmlWriter.endElement(); + + aXmlWriter.startElement("dataIntegrity"); + aXmlWriter.attributeBase64("encryptedHmacKey", mInfo.hmacEncryptedKey); + aXmlWriter.attributeBase64("encryptedHmacValue", mInfo.hmacEncryptedValue); + aXmlWriter.endElement(); + + aXmlWriter.startElement("keyEncryptors"); + aXmlWriter.startElement("keyEncryptor"); + aXmlWriter.attribute("uri", OString("http://schemas.microsoft.com/office/2006/keyEncryptor/password")); + + aXmlWriter.startElement("p", "encryptedKey", ""); + aXmlWriter.attribute("spinCount", mInfo.spinCount); + aXmlWriter.attribute("saltSize", mInfo.saltSize); + aXmlWriter.attribute("blockSize", mInfo.blockSize); + aXmlWriter.attribute("keyBits", mInfo.keyBits); + aXmlWriter.attribute("hashSize", mInfo.hashSize); + aXmlWriter.attribute("cipherAlgorithm", mInfo.cipherAlgorithm); + aXmlWriter.attribute("cipherChaining", mInfo.cipherChaining); + aXmlWriter.attribute("hashAlgorithm", mInfo.hashAlgorithm); + aXmlWriter.attributeBase64("saltValue", mInfo.saltValue); + aXmlWriter.attributeBase64("encryptedVerifierHashInput", mInfo.encryptedVerifierHashInput); + aXmlWriter.attributeBase64("encryptedVerifierHashValue", mInfo.encryptedVerifierHashValue); + aXmlWriter.attributeBase64("encryptedKeyValue", mInfo.encryptedKeyValue); + aXmlWriter.endElement(); + + aXmlWriter.endElement(); + aXmlWriter.endElement(); + + aXmlWriter.endElement(); + aXmlWriter.endDocument(); + } + rStream.writeMemory(aMemStream.GetData(), aMemStream.GetSize()); +} + +void AgileEngine::encrypt(const css::uno::Reference & rxInputStream, + css::uno::Reference & rxOutputStream, + sal_uInt32 nSize) +{ + CryptoHash aCryptoHash(mInfo.hmacKey, cryptoHashTypeFromString(mInfo.hashAlgorithm)); + + BinaryXOutputStream aBinaryOutputStream(rxOutputStream, false); + BinaryXInputStream aBinaryInputStream(rxInputStream, false); + + std::vector aSizeBytes(sizeof(sal_uInt32)); + ByteOrderConverter::writeLittleEndian(aSizeBytes.data(), nSize); + aBinaryOutputStream.writeMemory(aSizeBytes.data(), aSizeBytes.size()); // size + aCryptoHash.update(aSizeBytes, aSizeBytes.size()); + + std::vector aNull{0,0,0,0}; + aBinaryOutputStream.writeMemory(aNull.data(), aNull.size()); // reserved + aCryptoHash.update(aNull, aNull.size()); + + std::vector& keyDataSalt = mInfo.keyDataSalt; + + sal_uInt32 saltSize = mInfo.saltSize; + sal_uInt32 keySize = mInfo.keyBits / 8; + + sal_uInt32 nSegment = 0; + sal_uInt32 nSegmentByteSize = sizeof(nSegment); + + std::vector saltWithBlockKey(saltSize + nSegmentByteSize, 0); + std::copy(keyDataSalt.begin(), keyDataSalt.end(), saltWithBlockKey.begin()); + + std::vector hash(mInfo.hashSize, 0); + std::vector iv(keySize, 0); + + std::vector inputBuffer(constSegmentLength); + std::vector outputBuffer(constSegmentLength); + sal_uInt32 inputLength; + sal_uInt32 outputLength; + + while ((inputLength = aBinaryInputStream.readMemory(inputBuffer.data(), inputBuffer.size())) > 0) + { + sal_uInt32 correctedInputLength = inputLength % mInfo.blockSize == 0 ? + inputLength : oox::crypto::roundUp(inputLength, sal_uInt32(mInfo.blockSize)); + + // Update Key + auto p = saltWithBlockKey.begin() + saltSize; + p[0] = nSegment & 0xFF; + p[1] = (nSegment >> 8) & 0xFF; + p[2] = (nSegment >> 16) & 0xFF; + p[3] = nSegment >> 24; + + hashCalc(hash, saltWithBlockKey, mInfo.hashAlgorithm); + + // Only if hash > keySize + std::copy(hash.begin(), hash.begin() + keySize, iv.begin()); + + Encrypt aEncryptor(mKey, iv, AgileEngine::cryptoType(mInfo)); + outputLength = aEncryptor.update(outputBuffer, inputBuffer, correctedInputLength); + aBinaryOutputStream.writeMemory(outputBuffer.data(), outputLength); + aCryptoHash.update(outputBuffer, outputLength); + + nSegment++; + } + mInfo.hmacHash = aCryptoHash.finalize(); + encryptHmacValue(); +} + +} // namespace oox::crypto + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/crypto/CryptTools.cxx b/oox/source/crypto/CryptTools.cxx new file mode 100644 index 000000000..ee68a8a50 --- /dev/null +++ b/oox/source/crypto/CryptTools.cxx @@ -0,0 +1,507 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + */ + +#include +#include + +#include + +#if USE_TLS_OPENSSL +#include +#include +#include +#endif // USE_TLS_OPENSSL + +#if USE_TLS_NSS +#include +#include +#endif // USE_TLS_NSS + +namespace oox::crypto { + +#if USE_TLS_OPENSSL + +#if (OPENSSL_VERSION_NUMBER < 0x10100000L) + +static HMAC_CTX *HMAC_CTX_new(void) +{ + HMAC_CTX *pContext = new HMAC_CTX; + HMAC_CTX_init(pContext); + return pContext; +} + +static void HMAC_CTX_free(HMAC_CTX *pContext) +{ + HMAC_CTX_cleanup(pContext); + delete pContext; +} +#endif + +namespace +{ + struct cipher_delete + { + void operator()(EVP_CIPHER_CTX* p) { EVP_CIPHER_CTX_free(p); } + }; + + struct hmac_delete + { + void operator()(HMAC_CTX* p) { HMAC_CTX_free(p); } + }; +} + +struct CryptoImpl +{ + std::unique_ptr mpContext; + std::unique_ptr mpHmacContext; + + CryptoImpl() = default; + + void setupEncryptContext(std::vector& key, std::vector& iv, Crypto::CryptoType eType) + { + mpContext.reset(EVP_CIPHER_CTX_new()); + EVP_CIPHER_CTX_init(mpContext.get()); + + const EVP_CIPHER* cipher = getCipher(eType); + if (cipher == nullptr) + return; + + if (iv.empty()) + EVP_EncryptInit_ex(mpContext.get(), cipher, nullptr, key.data(), nullptr); + else + EVP_EncryptInit_ex(mpContext.get(), cipher, nullptr, key.data(), iv.data()); + EVP_CIPHER_CTX_set_padding(mpContext.get(), 0); + } + + void setupDecryptContext(std::vector& key, std::vector& iv, Crypto::CryptoType eType) + { + mpContext.reset(EVP_CIPHER_CTX_new()); + EVP_CIPHER_CTX_init(mpContext.get()); + + const EVP_CIPHER* pCipher = getCipher(eType); + if (pCipher == nullptr) + return; + + const size_t nMinKeySize = EVP_CIPHER_key_length(pCipher); + if (key.size() < nMinKeySize) + key.resize(nMinKeySize, 0); + + if (iv.empty()) + EVP_DecryptInit_ex(mpContext.get(), pCipher, nullptr, key.data(), nullptr); + else + { + const size_t nMinIVSize = EVP_CIPHER_iv_length(pCipher); + if (iv.size() < nMinIVSize) + iv.resize(nMinIVSize, 0); + + EVP_DecryptInit_ex(mpContext.get(), pCipher, nullptr, key.data(), iv.data()); + } + EVP_CIPHER_CTX_set_padding(mpContext.get(), 0); + } + + void setupCryptoHashContext(std::vector& rKey, CryptoHashType eType) + { + mpHmacContext.reset(HMAC_CTX_new()); + const EVP_MD* aEvpMd = nullptr; + switch (eType) + { + case CryptoHashType::SHA1: + aEvpMd = EVP_sha1(); break; + case CryptoHashType::SHA256: + aEvpMd = EVP_sha256(); break; + case CryptoHashType::SHA512: + aEvpMd = EVP_sha512(); break; + } + HMAC_Init_ex(mpHmacContext.get(), rKey.data(), rKey.size(), aEvpMd, nullptr); + } + + ~CryptoImpl() + { + if (mpContext) + EVP_CIPHER_CTX_cleanup(mpContext.get()); + } + + static const EVP_CIPHER* getCipher(Crypto::CryptoType type) + { + switch(type) + { + case Crypto::CryptoType::AES_128_ECB: + return EVP_aes_128_ecb(); + case Crypto::CryptoType::AES_128_CBC: + return EVP_aes_128_cbc(); + case Crypto::CryptoType::AES_256_CBC: + return EVP_aes_256_cbc(); + default: + break; + } + return nullptr; + } +}; + +#elif USE_TLS_NSS + +#define MAX_WRAPPED_KEY_LEN 128 + +struct CryptoImpl +{ + PK11SlotInfo* mSlot; + PK11Context* mContext; + SECItem* mSecParam; + PK11SymKey* mSymKey; + PK11Context* mWrapKeyContext; + PK11SymKey* mWrapKey; + + CryptoImpl() + : mSlot(nullptr) + , mContext(nullptr) + , mSecParam(nullptr) + , mSymKey(nullptr) + , mWrapKeyContext(nullptr) + , mWrapKey(nullptr) + { + // Initialize NSS, database functions are not needed + NSS_NoDB_Init(nullptr); + } + + ~CryptoImpl() + { + if (mContext) + PK11_DestroyContext(mContext, PR_TRUE); + if (mSecParam) + SECITEM_FreeItem(mSecParam, PR_TRUE); + if (mSymKey) + PK11_FreeSymKey(mSymKey); + if (mWrapKeyContext) + PK11_DestroyContext(mWrapKeyContext, PR_TRUE); + if (mWrapKey) + PK11_FreeSymKey(mWrapKey); + if (mSlot) + PK11_FreeSlot(mSlot); + } + + PK11SymKey* ImportSymKey(CK_MECHANISM_TYPE mechanism, CK_ATTRIBUTE_TYPE operation, SECItem* key) + { + mSymKey = PK11_ImportSymKey(mSlot, mechanism, PK11_OriginUnwrap, operation, key, nullptr); + if (!mSymKey) //rhbz#1614419 maybe failed due to FIPS, use rhbz#1461450 style workaround + { + /* + * Without FIPS it would be possible to just use + * mSymKey = PK11_ImportSymKey( mSlot, mechanism, PK11_OriginUnwrap, CKA_ENCRYPT, &keyItem, nullptr ); + * with FIPS NSS Level 2 certification has to be "workarounded" (so it becomes Level 1) by using + * following method: + * 1. Generate wrap key + * 2. Encrypt authkey with wrap key + * 3. Unwrap encrypted authkey using wrap key + */ + + /* + * Generate wrapping key + */ + CK_MECHANISM_TYPE wrap_mechanism = PK11_GetBestWrapMechanism(mSlot); + int wrap_key_len = PK11_GetBestKeyLength(mSlot, wrap_mechanism); + mWrapKey = PK11_KeyGen(mSlot, wrap_mechanism, nullptr, wrap_key_len, nullptr); + if (!mWrapKey) + throw css::uno::RuntimeException("PK11_KeyGen SymKey failure", css::uno::Reference()); + + /* + * Encrypt authkey with wrapping key + */ + + /* + * Initialization of IV is not needed because PK11_GetBestWrapMechanism should return ECB mode + */ + SECItem tmp_sec_item = {}; + mWrapKeyContext = PK11_CreateContextBySymKey(wrap_mechanism, CKA_ENCRYPT, mWrapKey, &tmp_sec_item); + if (!mWrapKeyContext) + throw css::uno::RuntimeException("PK11_CreateContextBySymKey failure", css::uno::Reference()); + + unsigned char wrapped_key_data[MAX_WRAPPED_KEY_LEN]; + int wrapped_key_len = sizeof(wrapped_key_data); + + if (PK11_CipherOp(mWrapKeyContext, wrapped_key_data, &wrapped_key_len, + sizeof(wrapped_key_data), key->data, key->len) != SECSuccess) + { + throw css::uno::RuntimeException("PK11_CipherOp failure", css::uno::Reference()); + } + + if (PK11_Finalize(mWrapKeyContext) != SECSuccess) + throw css::uno::RuntimeException("PK11_Finalize failure", css::uno::Reference()); + + /* + * Finally unwrap sym key + */ + SECItem wrapped_key = {}; + wrapped_key.data = wrapped_key_data; + wrapped_key.len = wrapped_key_len; + + mSymKey = PK11_UnwrapSymKey(mWrapKey, wrap_mechanism, &tmp_sec_item, &wrapped_key, + mechanism, operation, key->len); + } + return mSymKey; + } + + void setupCryptoContext(std::vector& key, std::vector& iv, Crypto::CryptoType type, CK_ATTRIBUTE_TYPE operation) + { + CK_MECHANISM_TYPE mechanism = static_cast(-1); + + SECItem ivItem; + ivItem.type = siBuffer; + if(iv.empty()) + ivItem.data = nullptr; + else + ivItem.data = iv.data(); + ivItem.len = iv.size(); + + SECItem* pIvItem = nullptr; + + switch(type) + { + case Crypto::CryptoType::AES_128_ECB: + mechanism = CKM_AES_ECB; + break; + case Crypto::CryptoType::AES_128_CBC: + mechanism = CKM_AES_CBC; + pIvItem = &ivItem; + break; + case Crypto::CryptoType::AES_256_CBC: + mechanism = CKM_AES_CBC; + pIvItem = &ivItem; + break; + default: + break; + } + + mSlot = PK11_GetBestSlot(mechanism, nullptr); + + if (!mSlot) + throw css::uno::RuntimeException("NSS Slot failure", css::uno::Reference()); + + SECItem keyItem; + keyItem.type = siBuffer; + keyItem.data = key.data(); + keyItem.len = key.size(); + + mSymKey = ImportSymKey(mechanism, CKA_ENCRYPT, &keyItem); + if (!mSymKey) + throw css::uno::RuntimeException("NSS SymKey failure", css::uno::Reference()); + + mSecParam = PK11_ParamFromIV(mechanism, pIvItem); + mContext = PK11_CreateContextBySymKey(mechanism, operation, mSymKey, mSecParam); + } + + void setupCryptoHashContext(std::vector& rKey, CryptoHashType eType) + { + CK_MECHANISM_TYPE aMechanism = static_cast(-1); + + switch(eType) + { + case CryptoHashType::SHA1: + aMechanism = CKM_SHA_1_HMAC; + break; + case CryptoHashType::SHA256: + aMechanism = CKM_SHA256_HMAC; + break; + case CryptoHashType::SHA512: + aMechanism = CKM_SHA512_HMAC; + break; + } + + mSlot = PK11_GetBestSlot(aMechanism, nullptr); + + if (!mSlot) + throw css::uno::RuntimeException("NSS Slot failure", css::uno::Reference()); + + SECItem aKeyItem; + aKeyItem.data = rKey.data(); + aKeyItem.len = rKey.size(); + + mSymKey = ImportSymKey(aMechanism, CKA_SIGN, &aKeyItem); + if (!mSymKey) + throw css::uno::RuntimeException("NSS SymKey failure", css::uno::Reference()); + + SECItem param; + param.data = nullptr; + param.len = 0; + mContext = PK11_CreateContextBySymKey(aMechanism, CKA_SIGN, mSymKey, ¶m); + } +}; +#else +struct CryptoImpl +{}; +#endif + +Crypto::Crypto() + : mpImpl(std::make_unique()) +{ +} + +Crypto::~Crypto() +{ +} + +// DECRYPT + +Decrypt::Decrypt(std::vector& key, std::vector& iv, CryptoType type) +{ +#if USE_TLS_OPENSSL + USE_TLS_NSS == 0 + (void)key; + (void)iv; + (void)type; +#endif + +#if USE_TLS_OPENSSL + mpImpl->setupDecryptContext(key, iv, type); +#endif + +#if USE_TLS_NSS + mpImpl->setupCryptoContext(key, iv, type, CKA_DECRYPT); +#endif // USE_TLS_NSS +} + +sal_uInt32 Decrypt::update(std::vector& output, std::vector& input, sal_uInt32 inputLength) +{ + int outputLength = 0; + +#if USE_TLS_OPENSSL + USE_TLS_NSS > 0 + sal_uInt32 actualInputLength = inputLength == 0 || inputLength > input.size() ? input.size() : inputLength; +#else + (void)output; + (void)input; + (void)inputLength; +#endif + +#if USE_TLS_OPENSSL + (void)EVP_DecryptUpdate(mpImpl->mpContext.get(), output.data(), &outputLength, input.data(), actualInputLength); +#endif // USE_TLS_OPENSSL + +#if USE_TLS_NSS + if (!mpImpl->mContext) + return 0; + (void)PK11_CipherOp(mpImpl->mContext, output.data(), &outputLength, actualInputLength, input.data(), actualInputLength); +#endif // USE_TLS_NSS + + return static_cast(outputLength); +} + +sal_uInt32 Decrypt::aes128ecb(std::vector& output, std::vector& input, std::vector& key) +{ + sal_uInt32 outputLength = 0; + std::vector iv; + Decrypt crypto(key, iv, Crypto::AES_128_ECB); + outputLength = crypto.update(output, input); + return outputLength; +} + +// ENCRYPT + +Encrypt::Encrypt(std::vector& key, std::vector& iv, CryptoType type) +{ +#if USE_TLS_OPENSSL + USE_TLS_NSS == 0 + (void)key; + (void)iv; + (void)type; +#endif + +#if USE_TLS_OPENSSL + mpImpl->setupEncryptContext(key, iv, type); +#elif USE_TLS_NSS + mpImpl->setupCryptoContext(key, iv, type, CKA_ENCRYPT); +#endif // USE_TLS_NSS +} + +sal_uInt32 Encrypt::update(std::vector& output, std::vector& input, sal_uInt32 inputLength) +{ + int outputLength = 0; + +#if USE_TLS_OPENSSL + USE_TLS_NSS > 0 + sal_uInt32 actualInputLength = inputLength == 0 || inputLength > input.size() ? input.size() : inputLength; +#else + (void)output; + (void)input; + (void)inputLength; +#endif + +#if USE_TLS_OPENSSL + (void)EVP_EncryptUpdate(mpImpl->mpContext.get(), output.data(), &outputLength, input.data(), actualInputLength); +#endif // USE_TLS_OPENSSL + +#if USE_TLS_NSS + (void)PK11_CipherOp(mpImpl->mContext, output.data(), &outputLength, actualInputLength, input.data(), actualInputLength); +#endif // USE_TLS_NSS + + return static_cast(outputLength); +} + +// CryptoHash - HMAC + +namespace +{ + +sal_Int32 getSizeForHashType(CryptoHashType eType) +{ + switch (eType) + { + case CryptoHashType::SHA1: return 20; + case CryptoHashType::SHA256: return 32; + case CryptoHashType::SHA512: return 64; + } + return 0; +} + +} // end anonymous namespace + +CryptoHash::CryptoHash(std::vector& rKey, CryptoHashType eType) + : mnHashSize(getSizeForHashType(eType)) +{ +#if USE_TLS_OPENSSL + mpImpl->setupCryptoHashContext(rKey, eType); +#elif USE_TLS_NSS + mpImpl->setupCryptoHashContext(rKey, eType); + PK11_DigestBegin(mpImpl->mContext); +#else + (void)rKey; +#endif +} + +bool CryptoHash::update(std::vector& rInput, sal_uInt32 nInputLength) +{ +#if USE_TLS_OPENSSL + USE_TLS_NSS > 0 + sal_uInt32 nActualInputLength = (nInputLength == 0 || nInputLength > rInput.size()) ? rInput.size() : nInputLength; +#else + (void)rInput; + (void)nInputLength; +#endif + +#if USE_TLS_OPENSSL + return HMAC_Update(mpImpl->mpHmacContext.get(), rInput.data(), nActualInputLength) != 0; +#elif USE_TLS_NSS + return PK11_DigestOp(mpImpl->mContext, rInput.data(), nActualInputLength) == SECSuccess; +#else + return false; // ??? +#endif +} + +std::vector CryptoHash::finalize() +{ + std::vector aHash(mnHashSize, 0); + unsigned int nSizeWritten; +#if USE_TLS_OPENSSL + (void) HMAC_Final(mpImpl->mpHmacContext.get(), aHash.data(), &nSizeWritten); +#elif USE_TLS_NSS + PK11_DigestFinal(mpImpl->mContext, aHash.data(), &nSizeWritten, aHash.size()); +#endif + (void)nSizeWritten; + + return aHash; +} + +} // namespace oox::crypto + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/crypto/DocumentDecryption.cxx b/oox/source/crypto/DocumentDecryption.cxx new file mode 100644 index 000000000..cae8a1331 --- /dev/null +++ b/oox/source/crypto/DocumentDecryption.cxx @@ -0,0 +1,223 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + */ + +#include + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +namespace +{ +void lcl_getListOfStreams(oox::StorageBase* pStorage, std::vector& rElementNames) +{ + std::vector oElementNames; + pStorage->getElementNames(oElementNames); + for (const auto& sName : oElementNames) + { + oox::StorageRef rSubStorage = pStorage->openSubStorage(sName, false); + if (rSubStorage && rSubStorage->isStorage()) + { + lcl_getListOfStreams(rSubStorage.get(), rElementNames); + } + else + { + if (pStorage->isRootStorage()) + rElementNames.push_back(sName); + else + rElementNames.push_back(pStorage->getPath() + "/" + sName); + } + } +} +} + +namespace oox::crypto +{ +using namespace css; + +DocumentDecryption::DocumentDecryption( + const css::uno::Reference& rxContext, + oox::ole::OleStorage& rOleStorage) + : mxContext(rxContext) + , mrOleStorage(rOleStorage) +{ + // Get OLE streams into sequences for later use in CryptoEngine + std::vector aStreamNames; + lcl_getListOfStreams(&mrOleStorage, aStreamNames); + + comphelper::SequenceAsHashMap aStreamsData; + for (const auto& sStreamName : aStreamNames) + { + uno::Reference xStream = mrOleStorage.openInputStream(sStreamName); + if (!xStream.is()) + throw io::IOException("Cannot open OLE input stream for " + sStreamName + "!"); + + BinaryXInputStream aBinaryInputStream(xStream, true); + + css::uno::Sequence oData; + sal_Int32 nStreamSize = aBinaryInputStream.size(); + sal_Int32 nReadBytes = aBinaryInputStream.readData(oData, nStreamSize); + + if (nStreamSize != nReadBytes) + { + SAL_WARN("oox", "OLE stream invalid content"); + throw io::IOException("OLE stream invalid content for " + sStreamName + "!"); + } + + aStreamsData[sStreamName] <<= oData; + } + maStreamsSequence = aStreamsData.getAsConstNamedValueList(); +} + +bool DocumentDecryption::generateEncryptionKey(const OUString& rPassword) +{ + if (mxPackageEncryption.is()) + return mxPackageEncryption->generateEncryptionKey(rPassword); + return false; +} + +bool DocumentDecryption::readEncryptionInfo() +{ + if (!mrOleStorage.isStorage()) + return false; + + // Read 0x6DataSpaces/DataSpaceMap + uno::Reference xDataSpaceMap + = mrOleStorage.openInputStream("\006DataSpaces/DataSpaceMap"); + OUString sDataSpaceName; + + if (xDataSpaceMap.is()) + { + bool bBroken = false; + + BinaryXInputStream aDataSpaceStream(xDataSpaceMap, true); + sal_uInt32 aHeaderLength = aDataSpaceStream.readuInt32(); + SAL_WARN_IF(aHeaderLength != 8, "oox", + "DataSpaceMap length != 8 is not supported. Some content may be skipped"); + sal_uInt32 aEntryCount = aDataSpaceStream.readuInt32(); + SAL_WARN_IF(aEntryCount != 1, "oox", + "DataSpaceMap contains more than one entry. Some content may be skipped"); + + // Read each DataSpaceMapEntry (MS-OFFCRYPTO 2.1.6.1) + for (sal_uInt32 i = 0; i < aEntryCount && !bBroken; i++) + { + // entryLen unused for the moment + aDataSpaceStream.skip(sizeof(sal_uInt32)); + + // Read each DataSpaceReferenceComponent (MS-OFFCRYPTO 2.1.6.2) + sal_uInt32 aReferenceComponentCount = aDataSpaceStream.readuInt32(); + for (sal_uInt32 j = 0; j < aReferenceComponentCount && !bBroken; j++) + { + // Read next reference component + // refComponentType unused for the moment + aDataSpaceStream.skip(sizeof(sal_uInt32)); + sal_uInt32 aReferenceComponentNameLength = aDataSpaceStream.readuInt32(); + // sReferenceComponentName unused for the moment + if (aDataSpaceStream.getRemaining() < aReferenceComponentNameLength) + { + bBroken = true; + break; + } + aDataSpaceStream.readUnicodeArray(aReferenceComponentNameLength / 2); + aDataSpaceStream.skip((4 - (aReferenceComponentNameLength & 3)) + & 3); // Skip padding + + bBroken |= aDataSpaceStream.isEof(); + } + + sal_uInt32 aDataSpaceNameLength = aDataSpaceStream.readuInt32(); + if (aDataSpaceStream.getRemaining() < aDataSpaceNameLength) + { + bBroken = true; + break; + } + sDataSpaceName = aDataSpaceStream.readUnicodeArray(aDataSpaceNameLength / 2); + aDataSpaceStream.skip((4 - (aDataSpaceNameLength & 3)) & 3); // Skip padding + + bBroken |= aDataSpaceStream.isEof(); + } + + if (bBroken) + { + SAL_WARN("oox", "EOF on parsing DataSpaceMapEntry table"); + return false; + } + } + else + { + // Fallback for documents generated by LO: they sometimes do not have all + // required by MS-OFFCRYPTO specification streams (0x6DataSpaces/DataSpaceMap and others) + SAL_WARN("oox", "Encrypted package does not contain DataSpaceMap"); + sDataSpaceName = "StrongEncryptionDataSpace"; + } + + uno::Sequence aArguments; + mxPackageEncryption.set( + mxContext->getServiceManager()->createInstanceWithArgumentsAndContext( + "com.sun.star.comp.oox.crypto." + sDataSpaceName, aArguments, mxContext), + css::uno::UNO_QUERY); + + if (!mxPackageEncryption.is()) + { + // we do not know how to decrypt this document + return false; + } + + return mxPackageEncryption->readEncryptionInfo(maStreamsSequence); +} + +uno::Sequence DocumentDecryption::createEncryptionData(const OUString& rPassword) +{ + if (!mxPackageEncryption.is()) + return uno::Sequence(); + + return mxPackageEncryption->createEncryptionData(rPassword); +} + +bool DocumentDecryption::decrypt(const uno::Reference& xDocumentStream) +{ + bool bResult = false; + + if (!mrOleStorage.isStorage()) + return false; + + if (!mxPackageEncryption.is()) + return false; + + // open the required input streams in the encrypted package + uno::Reference xEncryptedPackage + = mrOleStorage.openInputStream("EncryptedPackage"); + + // create temporary file for unencrypted package + uno::Reference xDecryptedPackage = xDocumentStream->getOutputStream(); + + bResult = mxPackageEncryption->decrypt(xEncryptedPackage, xDecryptedPackage); + + css::uno::Reference xSeekable(xDecryptedPackage, css::uno::UNO_QUERY); + xSeekable->seek(0); + + if (bResult) + return mxPackageEncryption->checkDataIntegrity(); + + return bResult; +} + +} // namespace oox::crypto + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/crypto/DocumentEncryption.cxx b/oox/source/crypto/DocumentEncryption.cxx new file mode 100644 index 000000000..6b8854929 --- /dev/null +++ b/oox/source/crypto/DocumentEncryption.cxx @@ -0,0 +1,103 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + */ + +#include + +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +namespace oox::crypto { + +using namespace css::io; +using namespace css::uno; +using namespace css::beans; + +DocumentEncryption::DocumentEncryption(const Reference< XComponentContext >& rxContext, + Reference const & xDocumentStream, + oox::ole::OleStorage& rOleStorage, + const Sequence& rMediaEncData) + : mxContext(rxContext) + , mxDocumentStream(xDocumentStream) + , mrOleStorage(rOleStorage) + , mMediaEncData(rMediaEncData) +{ + // Select engine + for (int i = 0; i < rMediaEncData.getLength(); i++) + { + if (rMediaEncData[i].Name == "CryptoType") + { + OUString sCryptoType; + rMediaEncData[i].Value >>= sCryptoType; + + if (sCryptoType == "Standard") + sCryptoType = "StrongEncryptionDataSpace"; + + Sequence aArguments; + mxPackageEncryption.set( + mxContext->getServiceManager()->createInstanceWithArgumentsAndContext( + "com.sun.star.comp.oox.crypto." + sCryptoType, aArguments, mxContext), css::uno::UNO_QUERY); + + if (!mxPackageEncryption.is()) + { + SAL_WARN("oox", "Requested encryption method \"" << sCryptoType << "\" is not supported"); + } + + break; + } + } +} + +bool DocumentEncryption::encrypt() +{ + if (!mxPackageEncryption.is()) + return false; + + Reference xInputStream (mxDocumentStream->getInputStream(), UNO_SET_THROW); + Reference xSeekable(xInputStream, UNO_QUERY); + + if (!xSeekable.is()) + return false; + + xSeekable->seek(0); // seek to begin of the document stream + + if (!mrOleStorage.isStorage()) + return false; + + mxPackageEncryption->setupEncryption(mMediaEncData); + + Sequence aStreams = mxPackageEncryption->encrypt(xInputStream); + + for (const NamedValue & aStream : std::as_const(aStreams)) + { + Reference xOutputStream(mrOleStorage.openOutputStream(aStream.Name), UNO_SET_THROW); + BinaryXOutputStream aBinaryOutputStream(xOutputStream, true); + + css::uno::Sequence aStreamSequence; + aStream.Value >>= aStreamSequence; + + aBinaryOutputStream.writeData(aStreamSequence); + + aBinaryOutputStream.close(); + } + + return true; +} + +} // namespace oox::crypto + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/crypto/Standard2007Engine.cxx b/oox/source/crypto/Standard2007Engine.cxx new file mode 100644 index 000000000..c3b0efad9 --- /dev/null +++ b/oox/source/crypto/Standard2007Engine.cxx @@ -0,0 +1,333 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + */ + +#include + +#include +#include +#include +#include + +#include + +namespace oox::crypto { + +/* =========================================================================== */ +/* Kudos to Caolan McNamara who provided the core decryption implementations. */ +/* =========================================================================== */ +namespace +{ + +void lclRandomGenerateValues(sal_uInt8* aArray, sal_uInt32 aSize) +{ + rtlRandomPool aRandomPool = rtl_random_createPool(); + rtl_random_getBytes(aRandomPool, aArray, aSize); + rtl_random_destroyPool(aRandomPool); +} + +constexpr OUStringLiteral lclCspName = u"Microsoft Enhanced RSA and AES Cryptographic Provider"; +constexpr const sal_uInt32 AES128Size = 16; + +} // end anonymous namespace + +bool Standard2007Engine::generateVerifier() +{ + // only support key of size 128 bit (16 byte) + if (mKey.size() != 16) + return false; + + std::vector verifier(msfilter::ENCRYPTED_VERIFIER_LENGTH); + std::vector encryptedVerifier(msfilter::ENCRYPTED_VERIFIER_LENGTH); + + lclRandomGenerateValues(verifier.data(), verifier.size()); + + std::vector iv; + Encrypt aEncryptorVerifier(mKey, iv, Crypto::AES_128_ECB); + if (aEncryptorVerifier.update(encryptedVerifier, verifier) != msfilter::ENCRYPTED_VERIFIER_LENGTH) + return false; + std::copy(encryptedVerifier.begin(), encryptedVerifier.end(), mInfo.verifier.encryptedVerifier); + + mInfo.verifier.encryptedVerifierHashSize = comphelper::SHA1_HASH_LENGTH; + std::vector hash = comphelper::Hash::calculateHash(verifier.data(), verifier.size(), comphelper::HashType::SHA1); + hash.resize(comphelper::SHA256_HASH_LENGTH, 0); + + std::vector encryptedHash(comphelper::SHA256_HASH_LENGTH, 0); + + Encrypt aEncryptorHash(mKey, iv, Crypto::AES_128_ECB); + aEncryptorHash.update(encryptedHash, hash, hash.size()); + std::copy(encryptedHash.begin(), encryptedHash.end(), mInfo.verifier.encryptedVerifierHash); + + return true; +} + +bool Standard2007Engine::calculateEncryptionKey(const OUString& rPassword) +{ + sal_uInt32 saltSize = mInfo.verifier.saltSize; + sal_uInt32 passwordByteLength = rPassword.getLength() * 2; + const sal_uInt8* saltArray = mInfo.verifier.salt; + + // Prepare initial data -> salt + password (in 16-bit chars) + std::vector initialData(saltSize + passwordByteLength); + std::copy(saltArray, saltArray + saltSize, initialData.begin()); + + auto p = initialData.begin() + saltSize; + for (sal_Int32 i = 0; i != rPassword.getLength(); ++i) { + auto c = rPassword[i]; + *p++ = c & 0xFF; + *p++ = c >> 8; + } + + // use "hash" vector for result of sha1 hashing + // calculate SHA1 hash of initialData + std::vector hash = comphelper::Hash::calculateHash(initialData.data(), initialData.size(), comphelper::HashType::SHA1); + + // data = iterator (4bytes) + hash + std::vector data(comphelper::SHA1_HASH_LENGTH + 4, 0); + + for (sal_Int32 i = 0; i < 50000; ++i) + { + ByteOrderConverter::writeLittleEndian(data.data(), i); + std::copy(hash.begin(), hash.end(), data.begin() + 4); + hash = comphelper::Hash::calculateHash(data.data(), data.size(), comphelper::HashType::SHA1); + } + std::copy(hash.begin(), hash.end(), data.begin() ); + std::fill(data.begin() + comphelper::SHA1_HASH_LENGTH, data.end(), 0 ); + + hash = comphelper::Hash::calculateHash(data.data(), data.size(), comphelper::HashType::SHA1); + + // derive key + std::vector buffer(64, 0x36); + for (size_t i = 0; i < hash.size(); ++i) + buffer[i] ^= hash[i]; + + hash = comphelper::Hash::calculateHash(buffer.data(), buffer.size(), comphelper::HashType::SHA1); + if (mKey.size() > hash.size()) + return false; + std::copy(hash.begin(), hash.begin() + mKey.size(), mKey.begin()); + + return true; +} + +bool Standard2007Engine::generateEncryptionKey(const OUString& password) +{ + mKey.clear(); + /* + KeySize (4 bytes): An unsigned integer that specifies the number of bits in the encryption key. + MUST be a multiple of 8. MUST be one of the values in the following table: + Algorithm Value Comment + Any 0x00000000 Determined by Flags + RC4 0x00000028 – 0x00000080 (inclusive) 8-bit increments. + AES 0x00000080, 0x000000C0, 0x00000100 128, 192 or 256-bit + */ + if (mInfo.header.keyBits > 8192) // should we strictly enforce the above 256 bit limit ? + return false; + mKey.resize(mInfo.header.keyBits / 8, 0); + if (mKey.empty()) + return false; + + calculateEncryptionKey(password); + + std::vector encryptedVerifier(msfilter::ENCRYPTED_VERIFIER_LENGTH); + std::copy( + mInfo.verifier.encryptedVerifier, + mInfo.verifier.encryptedVerifier + msfilter::ENCRYPTED_VERIFIER_LENGTH, + encryptedVerifier.begin()); + + std::vector encryptedHash(comphelper::SHA256_HASH_LENGTH); + std::copy( + mInfo.verifier.encryptedVerifierHash, + mInfo.verifier.encryptedVerifierHash + comphelper::SHA256_HASH_LENGTH, + encryptedHash.begin()); + + std::vector verifier(encryptedVerifier.size(), 0); + Decrypt::aes128ecb(verifier, encryptedVerifier, mKey); + + std::vector verifierHash(encryptedHash.size(), 0); + Decrypt::aes128ecb(verifierHash, encryptedHash, mKey); + + std::vector hash = comphelper::Hash::calculateHash(verifier.data(), verifier.size(), comphelper::HashType::SHA1); + + return std::equal(hash.begin(), hash.end(), verifierHash.begin()); +} + +bool Standard2007Engine::decrypt(BinaryXInputStream& aInputStream, + BinaryXOutputStream& aOutputStream) +{ + sal_uInt32 totalSize = aInputStream.readuInt32(); // Document unencrypted size - 4 bytes + aInputStream.skip(4); // Reserved 4 Bytes + + std::vector iv; + Decrypt aDecryptor(mKey, iv, Crypto::AES_128_ECB); + std::vector inputBuffer (4096); + std::vector outputBuffer(4096); + sal_uInt32 inputLength; + sal_uInt32 outputLength; + sal_uInt32 remaining = totalSize; + + while ((inputLength = aInputStream.readMemory(inputBuffer.data(), inputBuffer.size())) > 0) + { + outputLength = aDecryptor.update(outputBuffer, inputBuffer, inputLength); + sal_uInt32 writeLength = std::min(outputLength, remaining); + aOutputStream.writeMemory(outputBuffer.data(), writeLength); + remaining -= outputLength; + } + return true; +} + +bool Standard2007Engine::checkDataIntegrity() +{ + return true; +} + +bool Standard2007Engine::setupEncryption(OUString const & password) +{ + mInfo.header.flags = msfilter::ENCRYPTINFO_AES | msfilter::ENCRYPTINFO_CRYPTOAPI; + mInfo.header.algId = msfilter::ENCRYPT_ALGO_AES128; + mInfo.header.algIdHash = msfilter::ENCRYPT_HASH_SHA1; + mInfo.header.keyBits = msfilter::ENCRYPT_KEY_SIZE_AES_128; + mInfo.header.providedType = msfilter::ENCRYPT_PROVIDER_TYPE_AES; + + lclRandomGenerateValues(mInfo.verifier.salt, mInfo.verifier.saltSize); + const sal_Int32 keyLength = mInfo.header.keyBits / 8; + + mKey.clear(); + mKey.resize(keyLength, 0); + + if (!calculateEncryptionKey(password)) + return false; + + if (!generateVerifier()) + return false; + + return true; +} + +void Standard2007Engine::writeEncryptionInfo(BinaryXOutputStream& rStream) +{ + rStream.WriteUInt32(msfilter::VERSION_INFO_2007_FORMAT); + + sal_uInt32 cspNameSize = (lclCspName.getLength() * 2) + 2; + + sal_uInt32 encryptionHeaderSize = static_cast(sizeof(msfilter::EncryptionStandardHeader)); + + rStream.WriteUInt32(mInfo.header.flags); + sal_uInt32 headerSize = encryptionHeaderSize + cspNameSize; + rStream.WriteUInt32(headerSize); + + rStream.WriteUInt32(mInfo.header.flags); + rStream.WriteUInt32(mInfo.header.sizeExtra); + rStream.WriteUInt32(mInfo.header.algId); + rStream.WriteUInt32(mInfo.header.algIdHash); + rStream.WriteUInt32(mInfo.header.keyBits); + rStream.WriteUInt32(mInfo.header.providedType); + rStream.WriteUInt32(mInfo.header.reserved1); + rStream.WriteUInt32(mInfo.header.reserved2); + rStream.writeUnicodeArray(lclCspName); + rStream.WriteUInt16(0); + + rStream.WriteUInt32(mInfo.verifier.saltSize); + rStream.writeMemory(&mInfo.verifier.salt, sizeof mInfo.verifier.salt); + rStream.writeMemory(&mInfo.verifier.encryptedVerifier, sizeof mInfo.verifier.encryptedVerifier); + rStream.WriteUInt32(mInfo.verifier.encryptedVerifierHashSize); + rStream.writeMemory( + &mInfo.verifier.encryptedVerifierHash, sizeof mInfo.verifier.encryptedVerifierHash); +} + +void Standard2007Engine::encrypt(const css::uno::Reference & rxInputStream, + css::uno::Reference & rxOutputStream, + sal_uInt32 nSize) +{ + if (mKey.empty()) + return; + + BinaryXOutputStream aBinaryOutputStream(rxOutputStream, false); + BinaryXInputStream aBinaryInputStream(rxInputStream, false); + + aBinaryOutputStream.WriteUInt32(nSize); // size + aBinaryOutputStream.WriteUInt32(0U); // reserved + + std::vector inputBuffer(1024); + std::vector outputBuffer(1024); + + sal_uInt32 inputLength; + sal_uInt32 outputLength; + + std::vector iv; + Encrypt aEncryptor(mKey, iv, Crypto::AES_128_ECB); + + while ((inputLength = aBinaryInputStream.readMemory(inputBuffer.data(), inputBuffer.size())) > 0) + { + // increase size to multiple of 16 (size of mKey) if necessary + inputLength = inputLength % AES128Size == 0 ? + inputLength : roundUp(inputLength, AES128Size); + outputLength = aEncryptor.update(outputBuffer, inputBuffer, inputLength); + aBinaryOutputStream.writeMemory(outputBuffer.data(), outputLength); + } +} + +bool Standard2007Engine::readEncryptionInfo(css::uno::Reference & rxInputStream) +{ + BinaryXInputStream aBinaryStream(rxInputStream, false); + + mInfo.header.flags = aBinaryStream.readuInt32(); + if (getFlag(mInfo.header.flags, msfilter::ENCRYPTINFO_EXTERNAL)) + return false; + + sal_uInt32 nHeaderSize = aBinaryStream.readuInt32(); + + sal_uInt32 actualHeaderSize = sizeof(mInfo.header); + + if (nHeaderSize < actualHeaderSize) + return false; + + mInfo.header.flags = aBinaryStream.readuInt32(); + mInfo.header.sizeExtra = aBinaryStream.readuInt32(); + mInfo.header.algId = aBinaryStream.readuInt32(); + mInfo.header.algIdHash = aBinaryStream.readuInt32(); + mInfo.header.keyBits = aBinaryStream.readuInt32(); + mInfo.header.providedType = aBinaryStream.readuInt32(); + mInfo.header.reserved1 = aBinaryStream.readuInt32(); + mInfo.header.reserved2 = aBinaryStream.readuInt32(); + + aBinaryStream.skip(nHeaderSize - actualHeaderSize); + + mInfo.verifier.saltSize = aBinaryStream.readuInt32(); + aBinaryStream.readArray(mInfo.verifier.salt, SAL_N_ELEMENTS(mInfo.verifier.salt)); + aBinaryStream.readArray(mInfo.verifier.encryptedVerifier, SAL_N_ELEMENTS(mInfo.verifier.encryptedVerifier)); + mInfo.verifier.encryptedVerifierHashSize = aBinaryStream.readuInt32(); + aBinaryStream.readArray(mInfo.verifier.encryptedVerifierHash, SAL_N_ELEMENTS(mInfo.verifier.encryptedVerifierHash)); + + if (mInfo.verifier.saltSize != 16) + return false; + + // check flags and algorithm IDs, required are AES128 and SHA-1 + if (!getFlag(mInfo.header.flags, msfilter::ENCRYPTINFO_CRYPTOAPI)) + return false; + + if (!getFlag(mInfo.header.flags, msfilter::ENCRYPTINFO_AES)) + return false; + + // algorithm ID 0 defaults to AES128 too, if ENCRYPTINFO_AES flag is set + if (mInfo.header.algId != 0 && mInfo.header.algId != msfilter::ENCRYPT_ALGO_AES128) + return false; + + // hash algorithm ID 0 defaults to SHA-1 too + if (mInfo.header.algIdHash != 0 && mInfo.header.algIdHash != msfilter::ENCRYPT_HASH_SHA1) + return false; + + if (mInfo.verifier.encryptedVerifierHashSize != 20) + return false; + + return !aBinaryStream.isEof(); +} + +} // namespace oox::crypto + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/crypto/StrongEncryptionDataSpace.cxx b/oox/source/crypto/StrongEncryptionDataSpace.cxx new file mode 100644 index 000000000..fd1b823b8 --- /dev/null +++ b/oox/source/crypto/StrongEncryptionDataSpace.cxx @@ -0,0 +1,203 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + */ + +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +using namespace css; +using namespace css::beans; +using namespace css::io; +using namespace css::lang; +using namespace css::uno; + +namespace oox::crypto +{ +StrongEncryptionDataSpace::StrongEncryptionDataSpace(const Reference& rxContext) + : mxContext(rxContext) + , mCryptoEngine(new Standard2007Engine) +{ +} + +sal_Bool StrongEncryptionDataSpace::generateEncryptionKey(const OUString& rPassword) +{ + if (!mCryptoEngine) + return false; + + return mCryptoEngine->generateEncryptionKey(rPassword); +} + +sal_Bool StrongEncryptionDataSpace::checkDataIntegrity() +{ + if (!mCryptoEngine) + return false; + + return mCryptoEngine->checkDataIntegrity(); +} + +sal_Bool StrongEncryptionDataSpace::decrypt(const Reference& rxInputStream, + Reference& rxOutputStream) +{ + if (!mCryptoEngine) + return false; + + BinaryXInputStream aInputStream(rxInputStream, true); + BinaryXOutputStream aOutputStream(rxOutputStream, true); + + mCryptoEngine->decrypt(aInputStream, aOutputStream); + + rxOutputStream->flush(); + return true; +} + +Reference StrongEncryptionDataSpace::getStream(const Sequence& rStreams, + std::u16string_view sStreamName) +{ + for (const auto& aStream : rStreams) + { + if (aStream.Name == sStreamName) + { + Sequence aSeq; + aStream.Value >>= aSeq; + Reference aStream2( + io::SequenceInputStream::createStreamFromSequence(mxContext, aSeq), + UNO_QUERY_THROW); + return aStream2; + } + } + return nullptr; +} + +sal_Bool StrongEncryptionDataSpace::readEncryptionInfo(const Sequence& aStreams) +{ + Reference xEncryptionInfo = getStream(aStreams, u"EncryptionInfo"); + if (!xEncryptionInfo.is()) + return false; + + BinaryXInputStream aBinaryInputStream(xEncryptionInfo, true); + sal_uInt32 aVersion = aBinaryInputStream.readuInt32(); + + switch (aVersion) + { + case msfilter::VERSION_INFO_2007_FORMAT: + case msfilter::VERSION_INFO_2007_FORMAT_SP2: + mCryptoEngine.reset(new Standard2007Engine); + break; + case msfilter::VERSION_INFO_AGILE: + mCryptoEngine.reset(new AgileEngine()); + break; + default: + break; + } + + if (!mCryptoEngine) + return false; + + return mCryptoEngine->readEncryptionInfo(xEncryptionInfo); +} + +sal_Bool StrongEncryptionDataSpace::setupEncryption(const Sequence& rMediaEncData) +{ + if (!mCryptoEngine) + return false; + + OUString sPassword; + for (const auto& aParam : rMediaEncData) + { + if (aParam.Name == "OOXPassword") + { + aParam.Value >>= sPassword; + } + } + + return mCryptoEngine->setupEncryption(sPassword); +} + +Sequence StrongEncryptionDataSpace::createEncryptionData(const OUString& rPassword) +{ + comphelper::SequenceAsHashMap aEncryptionData; + aEncryptionData["OOXPassword"] <<= rPassword; + aEncryptionData["CryptoType"] <<= OUString("StrongEncryptionDataSpace"); + + return aEncryptionData.getAsConstNamedValueList(); +} + +Sequence +StrongEncryptionDataSpace::encrypt(const Reference& rxInputStream) +{ + if (!mCryptoEngine) + return Sequence(); + + Reference xSeekable(rxInputStream, UNO_QUERY); + if (!xSeekable.is()) + return Sequence(); + + sal_uInt32 aLength = xSeekable->getLength(); // check length of the stream + + Reference xOutputStream( + mxContext->getServiceManager()->createInstanceWithContext( + "com.sun.star.io.SequenceOutputStream", mxContext), + UNO_QUERY); + + mCryptoEngine->encrypt(rxInputStream, xOutputStream, aLength); + + comphelper::SequenceAsHashMap aStreams; + + Reference xEncodedFileSequenceStream(xOutputStream, UNO_QUERY); + aStreams["EncryptedPackage"] <<= xEncodedFileSequenceStream->getWrittenBytes(); + + Reference aEncryptionInfoStream( + mxContext->getServiceManager()->createInstanceWithContext( + "com.sun.star.io.SequenceOutputStream", mxContext), + UNO_QUERY); + BinaryXOutputStream rStream(aEncryptionInfoStream, false); + mCryptoEngine->writeEncryptionInfo(rStream); + aEncryptionInfoStream->flush(); + Reference aEncryptionInfoSequenceStream(aEncryptionInfoStream, + UNO_QUERY); + + aStreams["EncryptionInfo"] <<= aEncryptionInfoSequenceStream->getWrittenBytes(); + + return aStreams.getAsConstNamedValueList(); +} + +OUString SAL_CALL StrongEncryptionDataSpace::getImplementationName() +{ + return "com.sun.star.comp.oox.crypto.StrongEncryptionDataSpace"; +} + +sal_Bool SAL_CALL StrongEncryptionDataSpace::supportsService(const OUString& rServiceName) +{ + return cppu::supportsService(this, rServiceName); +} + +css::uno::Sequence SAL_CALL StrongEncryptionDataSpace::getSupportedServiceNames() +{ + Sequence aServices{ "com.sun.star.packages.PackageEncryption" }; + return aServices; +} + +} // namespace oox::crypto + +extern "C" SAL_DLLPUBLIC_EXPORT uno::XInterface* +com_sun_star_comp_oox_crypto_StrongEncryptionDataSpace_get_implementation( + uno::XComponentContext* pCtx, uno::Sequence const& /*rSeq*/) +{ + return cppu::acquire(new oox::crypto::StrongEncryptionDataSpace(pCtx)); +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/docprop/docprophandler.cxx b/oox/source/docprop/docprophandler.cxx new file mode 100644 index 000000000..9a23991a4 --- /dev/null +++ b/oox/source/docprop/docprophandler.cxx @@ -0,0 +1,716 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include "docprophandler.hxx" + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include +#include + +#include + +using namespace ::com::sun::star; + +namespace oox::docprop { + +OOXMLDocPropHandler::OOXMLDocPropHandler( const uno::Reference< uno::XComponentContext >& xContext, + const uno::Reference< document::XDocumentProperties >& rDocProp ) + : m_xDocProp( rDocProp ) + , m_nState( 0 ) + , m_nBlock( 0 ) + , m_nType( 0 ) + , m_nInBlock( 0 ) + , m_CustomStringPropertyState(NONE) +{ + if ( !xContext.is() || !rDocProp.is() ) + throw uno::RuntimeException(); +} + +OOXMLDocPropHandler::~OOXMLDocPropHandler() +{ +} + +void OOXMLDocPropHandler::InitNew() +{ + m_nState = 0; + m_nBlock = 0; + m_aCustomPropertyName.clear(); + m_nType = 0; + m_nInBlock = 0; + m_CustomStringPropertyState = NONE; +} + +void OOXMLDocPropHandler::AddCustomProperty( const uno::Any& aAny ) +{ + if ( m_aCustomPropertyName.isEmpty() ) + return; + + const uno::Reference< beans::XPropertyContainer > xUserProps = + m_xDocProp->getUserDefinedProperties(); + if ( !xUserProps.is() ) + throw uno::RuntimeException(); + + try + { + xUserProps->addProperty( m_aCustomPropertyName, + beans::PropertyAttribute::REMOVABLE, aAny ); + } + catch( beans::PropertyExistException& ) + { + // conflicts with core and extended properties are possible + } + catch( uno::Exception& ) + { + OSL_FAIL( "Can not add custom property!" ); + } +} + +util::DateTime OOXMLDocPropHandler::GetDateTimeFromW3CDTF( const OUString& aChars ) +{ + oslDateTime aOslDTime = { 0, 0, 0, 0, 0, 0, 0, 0 }; + const sal_Int32 nLen = aChars.getLength(); + if ( nLen >= 4 ) + { + aOslDTime.Year = static_cast(o3tl::toInt32(aChars.subView( 0, 4 ))); + + if ( nLen >= 7 && aChars[4] == '-' ) + { + aOslDTime.Month = static_cast(o3tl::toInt32(aChars.subView( 5, 2 ))); + + if ( nLen >= 10 && aChars[7] == '-' ) + { + aOslDTime.Day = static_cast(o3tl::toInt32(aChars.subView( 8, 2 ))); + + if ( nLen >= 16 && aChars[10] == 'T' && aChars[13] == ':' ) + { + aOslDTime.Hours = static_cast(o3tl::toInt32(aChars.subView( 11, 2 ))); + aOslDTime.Minutes = static_cast(o3tl::toInt32(aChars.subView( 14, 2 ))); + + sal_Int32 nOptTime = 0; + if ( nLen >= 19 && aChars[16] == ':' ) + { + aOslDTime.Seconds = static_cast(o3tl::toInt32(aChars.subView( 17, 2 ))); + nOptTime += 3; + if ( nLen >= 20 && aChars[19] == '.' ) + { + nOptTime += 1; + sal_Int32 digitPos = 20; + while (nLen > digitPos && digitPos < 29) + { + sal_Unicode c = aChars[digitPos]; + if ( c < '0' || c > '9') + break; + aOslDTime.NanoSeconds *= 10; + aOslDTime.NanoSeconds += c - '0'; + ++digitPos; + } + if ( digitPos < 29 ) + { + // read less digits than 9 + // add correct exponent of 10 + nOptTime += digitPos - 20; + for(; digitPos<29; ++digitPos) + { + aOslDTime.NanoSeconds *= 10; + } + } + else + { + //skip digits with more precision than we can handle + while(nLen > digitPos) + { + sal_Unicode c = aChars[digitPos]; + if ( c < '0' || c > '9') + break; + ++digitPos; + } + nOptTime += digitPos - 20; + } + } + } + + sal_Int32 nModif = 0; + if ( nLen >= 16 + nOptTime + 6 ) + { + if ( ( aChars[16 + nOptTime] == '+' || aChars[16 + nOptTime] == '-' ) + && aChars[16 + nOptTime + 3] == ':' ) + { + nModif = o3tl::toInt32(aChars.subView( 16 + nOptTime + 1, 2 )) * 3600; + nModif += o3tl::toInt32(aChars.subView( 16 + nOptTime + 4, 2 )) * 60; + if ( aChars[16 + nOptTime] == '-' ) + nModif *= -1; + } + } + + if ( nModif ) + { + // convert to UTC time + TimeValue aTmp; + if ( osl_getTimeValueFromDateTime( &aOslDTime, &aTmp ) ) + { + aTmp.Seconds -= nModif; + osl_getDateTimeFromTimeValue( &aTmp, &aOslDTime ); + } + } + } + } + } + } + + return util::DateTime( aOslDTime.NanoSeconds, aOslDTime.Seconds, + aOslDTime.Minutes, aOslDTime.Hours, + aOslDTime.Day, aOslDTime.Month, aOslDTime.Year, false); +} + +uno::Sequence< OUString > OOXMLDocPropHandler::GetKeywordsSet( std::u16string_view aChars ) +{ + if ( !aChars.empty() ) + { + std::string aUtf8Chars = OUStringToOString( aChars, RTL_TEXTENCODING_UTF8 ).getStr(); + std::vector aUtf8Result; + boost::split( aUtf8Result, aUtf8Chars, boost::is_any_of(" ,;:\t"), boost::token_compress_on ); + + if (!aUtf8Result.empty()) + { + uno::Sequence< OUString > aResult( aUtf8Result.size() ); + OUString* pResultValues = aResult.getArray(); + for (auto const& elem : aUtf8Result) + { + *pResultValues = OUString( elem.c_str(), static_cast< sal_Int32 >( elem.size() ),RTL_TEXTENCODING_UTF8 ); + ++pResultValues; + } + + return aResult; + } + } + return uno::Sequence< OUString >(); +} + +void OOXMLDocPropHandler::UpdateDocStatistic( std::u16string_view aChars ) +{ + uno::Sequence< beans::NamedValue > aSet = m_xDocProp->getDocumentStatistics(); + OUString aName; + + switch( m_nBlock ) + { + case EXTPR_TOKEN( Characters ): + aName = "NonWhitespaceCharacterCount"; + break; + + case EXTPR_TOKEN( CharactersWithSpaces ): + aName = "CharacterCount"; + break; + + case EXTPR_TOKEN( Pages ): + aName = "PageCount"; + break; + + case EXTPR_TOKEN( Words ): + aName = "WordCount"; + break; + + case EXTPR_TOKEN( Paragraphs ): + aName = "ParagraphCount"; + break; + + default: + OSL_FAIL( "Unexpected statistic!" ); + break; + } + + if ( aName.isEmpty() ) + return; + + sal_Int32 nInd = 0; + for ( auto pProp = aSet.getConstArray(); nInd < aSet.getLength(); ++nInd ) + if ( pProp[nInd].Name == aName ) + break; + + if (nInd == aSet.getLength()) + aSet.realloc( nInd + 1 ); + + aSet.getArray()[nInd] = { aName, uno::Any(o3tl::toInt32(aChars)) }; + + m_xDocProp->setDocumentStatistics( aSet ); +} + +// com.sun.star.xml.sax.XFastDocumentHandler + +void SAL_CALL OOXMLDocPropHandler::startDocument() +{ +} + +void SAL_CALL OOXMLDocPropHandler::endDocument() +{ + InitNew(); +} + +void OOXMLDocPropHandler::processingInstruction( const OUString& /*rTarget*/, const OUString& /*rData*/ ) +{ +} + +void SAL_CALL OOXMLDocPropHandler::setDocumentLocator( const uno::Reference< xml::sax::XLocator >& ) +{ +} + +// com.sun.star.xml.sax.XFastContextHandler + +void SAL_CALL OOXMLDocPropHandler::startFastElement( ::sal_Int32 nElement, const uno::Reference< xml::sax::XFastAttributeList >& xAttribs ) +{ + if ( !m_nInBlock && !m_nState ) + { + if ( nElement == COREPR_TOKEN( coreProperties ) + || nElement == EXTPR_TOKEN( Properties ) + || nElement == CUSTPR_TOKEN( Properties ) ) + { + m_nState = nElement; + } + else + { + OSL_FAIL( "Unexpected file format!" ); + } + } + else if ( m_nState && m_nInBlock == 1 ) // that tag should contain the property name + { + // Currently the attributes are ignored for the core properties since the only + // known attribute is xsi:type that can only be used with dcterms:created and + // dcterms:modified, and this element is allowed currently to have only one value dcterms:W3CDTF + m_nBlock = nElement; + + if ( xAttribs.is() && xAttribs->hasAttribute( XML_name ) ) + m_aCustomPropertyName = xAttribs->getValue( XML_name ); + } + else if ( m_nState && m_nInBlock == 2 && getNamespace( nElement ) == NMSP_officeDocPropsVT ) + { + m_nType = nElement; + } + // variant tags in vector + else if ( m_nState && m_nInBlock == 3 && getNamespace( nElement ) == NMSP_officeDocPropsVT ) + { + m_nType = nElement; + } + // lpstr or i4 tags in vector + else if ( m_nState && m_nInBlock == 4 && getNamespace( nElement ) == NMSP_officeDocPropsVT ) + { + m_nType = nElement; + } + else + { + SAL_WARN("oox", "OOXMLDocPropHandler::startFastElement: unknown element " << getBaseToken(nElement) << " m_nState=" << m_nState << " m_nInBlock=" << m_nInBlock); + } + + if ( m_nInBlock == SAL_MAX_INT32 ) + throw uno::RuntimeException(); + + m_nInBlock++; +} + +void SAL_CALL OOXMLDocPropHandler::startUnknownElement( const OUString& aNamespace, const OUString& aName, const uno::Reference< xml::sax::XFastAttributeList >& ) +{ + SAL_WARN("oox", "Unknown element " << aNamespace << ":" << aName); + + if ( m_nInBlock == SAL_MAX_INT32 ) + throw uno::RuntimeException(); + + m_nInBlock++; +} + +void SAL_CALL OOXMLDocPropHandler::endFastElement( ::sal_Int32 ) +{ + if ( !m_nInBlock ) + return; + + m_nInBlock--; + + if ( !m_nInBlock ) + m_nState = 0; + else if ( m_nInBlock == 1 ) + { + m_nBlock = 0; + m_aCustomPropertyName.clear(); + } + else if ( m_nInBlock == 2 ) + { + if ( m_nState == CUSTPR_TOKEN(Properties) + && m_nBlock == CUSTPR_TOKEN(property)) + { + switch (m_nType) + { + case VT_TOKEN(bstr): + case VT_TOKEN(lpstr): + case VT_TOKEN(lpwstr): + if (!m_aCustomPropertyName.isEmpty() && + INSERTED != m_CustomStringPropertyState) + { + // the property has string type, so it is valid + // even with an empty value - characters() has + // not been called in that case + AddCustomProperty(uno::Any(OUString())); + } + break; + } + } + m_CustomStringPropertyState = NONE; + m_nType = 0; + } +} + +void SAL_CALL OOXMLDocPropHandler::endUnknownElement( const OUString&, const OUString& ) +{ + if ( m_nInBlock ) + m_nInBlock--; +} + +uno::Reference< xml::sax::XFastContextHandler > SAL_CALL OOXMLDocPropHandler::createFastChildContext( ::sal_Int32, const uno::Reference< xml::sax::XFastAttributeList >& ) +{ + // Should the arguments be parsed? + return uno::Reference< xml::sax::XFastContextHandler >( static_cast< xml::sax::XFastContextHandler* >( this ) ); +} + +uno::Reference< xml::sax::XFastContextHandler > SAL_CALL OOXMLDocPropHandler::createUnknownChildContext( const OUString&, const OUString&, const uno::Reference< xml::sax::XFastAttributeList >& ) +{ + return uno::Reference< xml::sax::XFastContextHandler >( static_cast< xml::sax::XFastContextHandler* >( this ) ); +} + +void SAL_CALL OOXMLDocPropHandler::characters( const OUString& aChars ) +{ + try + { + if ( (m_nInBlock == 2) || ((m_nInBlock == 3) && m_nType) ) + { + if ( m_nState == COREPR_TOKEN( coreProperties ) ) + { + switch( m_nBlock ) + { + case COREPR_TOKEN( category ): + m_aCustomPropertyName = "OOXMLCorePropertyCategory"; + AddCustomProperty( uno::Any( aChars ) ); // the property has string type + break; + + case COREPR_TOKEN( contentStatus ): + m_aCustomPropertyName = "OOXMLCorePropertyContentStatus"; + AddCustomProperty( uno::Any( aChars ) ); // the property has string type + break; + + case COREPR_TOKEN( contentType ): + m_aCustomPropertyName = "OOXMLCorePropertyContentType"; + AddCustomProperty( uno::Any( aChars ) ); // the property has string type + break; + + case DC_TOKEN( identifier ): + m_aCustomPropertyName = "OOXMLCorePropertyIdentifier"; + AddCustomProperty( uno::Any( aChars ) ); // the property has string type + break; + + case COREPR_TOKEN( version ): + m_aCustomPropertyName = "OOXMLCorePropertyVersion"; + AddCustomProperty( uno::Any( aChars ) ); // the property has string type + break; + + case DCT_TOKEN( created ): + if ( aChars.getLength() >= 4 ) + m_xDocProp->setCreationDate( GetDateTimeFromW3CDTF( aChars ) ); + break; + + case DC_TOKEN( creator ): + m_xDocProp->setAuthor( aChars ); + break; + + case DC_TOKEN( description ): + m_xDocProp->setDescription( aChars ); + break; + + case COREPR_TOKEN( keywords ): + m_xDocProp->setKeywords( GetKeywordsSet( aChars ) ); + break; + + case DC_TOKEN( language ): + if ( aChars.getLength() >= 2 ) + m_xDocProp->setLanguage( LanguageTag::convertToLocale( aChars) ); + break; + + case COREPR_TOKEN( lastModifiedBy ): + m_xDocProp->setModifiedBy( aChars ); + break; + + case COREPR_TOKEN( lastPrinted ): + if ( aChars.getLength() >= 4 ) + m_xDocProp->setPrintDate( GetDateTimeFromW3CDTF( aChars ) ); + break; + + case DCT_TOKEN( modified ): + if ( aChars.getLength() >= 4 ) + m_xDocProp->setModificationDate( GetDateTimeFromW3CDTF( aChars ) ); + break; + + case COREPR_TOKEN( revision ): + try + { + m_xDocProp->setEditingCycles( + static_cast(aChars.toInt32()) ); + } + catch (lang::IllegalArgumentException &) + { + // ignore + } + break; + + case DC_TOKEN( subject ): + m_xDocProp->setSubject( m_xDocProp->getSubject() + aChars ); + break; + + case DC_TOKEN( title ): + m_xDocProp->setTitle( m_xDocProp->getTitle() + aChars ); + break; + + default: + OSL_FAIL( "Unexpected core property!" ); + } + } + else if ( m_nState == EXTPR_TOKEN( Properties ) ) + { + switch( m_nBlock ) + { + case EXTPR_TOKEN( Application ): + m_xDocProp->setGenerator( aChars ); + break; + + case EXTPR_TOKEN( Template ): + m_xDocProp->setTemplateName( aChars ); + break; + + case EXTPR_TOKEN( TotalTime ): + { + sal_Int32 nDuration; + if (!o3tl::checked_multiply(aChars.toInt32(), 60, nDuration)) + { + try + { + // The TotalTime is in mins as per ECMA specification. + m_xDocProp->setEditingDuration(nDuration); + } + catch (const lang::IllegalArgumentException&) + { + // ignore + } + } + break; + } + case EXTPR_TOKEN( Characters ): + case EXTPR_TOKEN( CharactersWithSpaces ): + case EXTPR_TOKEN( Pages ): + case EXTPR_TOKEN( Words ): + case EXTPR_TOKEN( Paragraphs ): + UpdateDocStatistic( aChars ); + break; + + case EXTPR_TOKEN( HyperlinksChanged ): + m_aCustomPropertyName = "HyperlinksChanged"; + // tdf#103987 Don't create custom property if the value is default + if ( aChars.toBoolean() ) + AddCustomProperty( uno::Any( aChars.toBoolean() ) ); // the property has boolean type + break; + + case EXTPR_TOKEN( LinksUpToDate ): + m_aCustomPropertyName = "LinksUpToDate"; + // tdf#103987 Don't create custom property if the value is default + if ( aChars.toBoolean() ) + AddCustomProperty( uno::Any( aChars.toBoolean() ) ); // the property has boolean type + break; + + case EXTPR_TOKEN( ScaleCrop ): + m_aCustomPropertyName = "ScaleCrop"; + // tdf#103987 Don't create custom property if the value is default + if ( aChars.toBoolean() ) + AddCustomProperty( uno::Any( aChars.toBoolean() ) ); // the property has boolean type + break; + + case EXTPR_TOKEN( SharedDoc ): + m_aCustomPropertyName = "ShareDoc"; + // tdf#103987 Don't create custom property if the value is default + if ( aChars.toBoolean() ) + AddCustomProperty( uno::Any( aChars.toBoolean() ) ); // the property has boolean type + break; + + case EXTPR_TOKEN( DocSecurity ): + m_aCustomPropertyName = "DocSecurity"; + // tdf#103987 Don't create custom property if the value is default + // OOXTODO Instead of storing value, enable security + // 1 - password protected, 2 - recommended read-only + // 4 - enforced read-only, 8 - locked for annotation + if ( aChars.toInt32() != 0 ) + AddCustomProperty( uno::Any( aChars.toInt32() ) ); // the property has sal_Int32 type + break; + + case EXTPR_TOKEN( HiddenSlides ): + m_aCustomPropertyName = "HiddenSlides"; + // tdf#103987 Don't create custom property if the value is default + if ( aChars.toInt32() != 0 ) + AddCustomProperty( uno::Any( aChars.toInt32() ) ); // the property has sal_Int32 type + break; + + case EXTPR_TOKEN( MMClips ): + m_aCustomPropertyName = "MMClips"; + // tdf#103987 Don't create custom property if the value is default + if ( aChars.toInt32() != 0 ) + AddCustomProperty( uno::Any( aChars.toInt32() ) ); // the property has sal_Int32 type + break; + + case EXTPR_TOKEN( Notes ): + m_aCustomPropertyName = "Notes"; + // tdf#103987 Don't create custom property if the value is default + if ( aChars.toInt32() != 0 ) + AddCustomProperty( uno::Any( aChars.toInt32() ) ); // the property has sal_Int32 type + break; + + case EXTPR_TOKEN( Slides ): + m_aCustomPropertyName = "Slides"; + // tdf#103987 Don't create custom property if the value is default + if ( aChars.toInt32() != 0 ) + AddCustomProperty( uno::Any( aChars.toInt32() ) ); // the property has sal_Int32 type + break; + + case EXTPR_TOKEN( AppVersion ): + m_aCustomPropertyName = "AppVersion"; + AddCustomProperty( uno::Any( aChars ) ); // the property has string type + break; + + case EXTPR_TOKEN( Company ): + m_aCustomPropertyName = "Company"; + AddCustomProperty( uno::Any( aChars ) ); // the property has string type + break; + + case EXTPR_TOKEN( HyperlinkBase ): + m_aCustomPropertyName = "HyperlinkBase"; + AddCustomProperty( uno::Any( aChars ) ); // the property has string type + break; + + case EXTPR_TOKEN( Manager ): + m_aCustomPropertyName = "Manager"; + AddCustomProperty( uno::Any( aChars ) ); // the property has string type + break; + + case EXTPR_TOKEN( PresentationFormat ): + m_aCustomPropertyName = "PresentationFormat"; + AddCustomProperty( uno::Any( aChars ) ); // the property has string type + break; + + case EXTPR_TOKEN( Lines ): + case EXTPR_TOKEN( DigSig ): + case EXTPR_TOKEN( HeadingPairs ): + case EXTPR_TOKEN( HLinks ): + case EXTPR_TOKEN( TitlesOfParts ): + // ignored during the import currently + break; + + default: + OSL_FAIL( "Unexpected extended property!" ); + } + } + else if ( m_nState == CUSTPR_TOKEN( Properties ) ) + { + if ( m_nBlock == CUSTPR_TOKEN( property ) ) + { + // this is a custom property + switch( m_nType ) + { + case VT_TOKEN( bool ): + AddCustomProperty( uno::Any( aChars.toBoolean() ) ); + break; + + case VT_TOKEN( bstr ): + case VT_TOKEN( lpstr ): + case VT_TOKEN( lpwstr ): + // the property has string type + AddCustomProperty( uno::Any( AttributeConversion::decodeXString( aChars ) ) ); + m_CustomStringPropertyState = INSERTED; + break; + + case VT_TOKEN( date ): + case VT_TOKEN( filetime ): + AddCustomProperty( uno::Any( GetDateTimeFromW3CDTF( aChars ) ) ); + break; + + case VT_TOKEN( i1 ): + case VT_TOKEN( i2 ): + AddCustomProperty( uno::Any( static_cast(aChars.toInt32()) ) ); + break; + + case VT_TOKEN( i4 ): + case VT_TOKEN( int ): + AddCustomProperty( uno::Any( aChars.toInt32() ) ); + break; + + case VT_TOKEN( i8 ): + AddCustomProperty( uno::Any( aChars.toInt64() ) ); + break; + + case VT_TOKEN( r4 ): + AddCustomProperty( uno::Any( aChars.toFloat() ) ); + break; + + case VT_TOKEN( r8 ): + AddCustomProperty( uno::Any( aChars.toDouble() ) ); + break; + + default: + // all the other types are ignored; + break; + } + } + else + { + OSL_FAIL( "Unexpected tag in custom property!" ); + } + } + } + } + catch( uno::RuntimeException& ) + { + throw; + } + catch( xml::sax::SAXException& ) + { + throw; + } + catch( uno::Exception& ) + { + css::uno::Any anyEx = cppu::getCaughtException(); + throw xml::sax::SAXException( + "Error while setting document property!", + uno::Reference< uno::XInterface >(), + anyEx ); + } +} + +} // namespace oox::docprop + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/docprop/docprophandler.hxx b/oox/source/docprop/docprophandler.hxx new file mode 100644 index 000000000..69e091850 --- /dev/null +++ b/oox/source/docprop/docprophandler.hxx @@ -0,0 +1,88 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_OOX_SOURCE_DOCPROP_DOCPROPHANDLER_HXX +#define INCLUDED_OOX_SOURCE_DOCPROP_DOCPROPHANDLER_HXX + +#include +#include +#include + +#include + +#include + +namespace oox::docprop { + +#define COREPR_TOKEN( token ) (::oox::NMSP_packageMetaCorePr | XML_##token) +#define CUSTPR_TOKEN( token ) (::oox::NMSP_officeCustomPr | XML_##token) +#define EXTPR_TOKEN( token ) (::oox::NMSP_officeExtPr | XML_##token) +#define VT_TOKEN( token ) (::oox::NMSP_officeDocPropsVT | XML_##token) +#define DC_TOKEN( token ) (::oox::NMSP_dc | XML_##token) +#define DCT_TOKEN( token ) (::oox::NMSP_dcTerms | XML_##token) + +class OOXMLDocPropHandler : public ::cppu::WeakImplHelper< css::xml::sax::XFastDocumentHandler > +{ + css::uno::Reference< css::document::XDocumentProperties > m_xDocProp; + + sal_Int32 m_nState; + sal_Int32 m_nBlock; + sal_Int32 m_nType; + + sal_Int32 m_nInBlock; + + enum { NONE, INSERTED } m_CustomStringPropertyState; + OUString m_aCustomPropertyName; + +public: + explicit OOXMLDocPropHandler( const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::document::XDocumentProperties >& rDocProp ); + + virtual ~OOXMLDocPropHandler() override; + + void InitNew(); + void AddCustomProperty( const css::uno::Any& aAny ); + + static css::util::DateTime GetDateTimeFromW3CDTF( const OUString& aChars ); + static css::uno::Sequence< OUString > GetKeywordsSet( std::u16string_view aChars ); + void UpdateDocStatistic( std::u16string_view aChars ); + + // com.sun.star.xml.sax.XFastDocumentHandler + + virtual void SAL_CALL startDocument() override; + virtual void SAL_CALL endDocument() override; + virtual void SAL_CALL processingInstruction( const OUString& rTarget, const OUString& rData ) override; + virtual void SAL_CALL setDocumentLocator( const css::uno::Reference< css::xml::sax::XLocator >& rxLocator ) override; + + // com.sun.star.xml.sax.XFastContextHandler + + virtual void SAL_CALL startFastElement( ::sal_Int32 Element, const css::uno::Reference< css::xml::sax::XFastAttributeList >& Attribs ) override; + virtual void SAL_CALL startUnknownElement( const OUString& Namespace, const OUString& Name, const css::uno::Reference< css::xml::sax::XFastAttributeList >& Attribs ) override; + virtual void SAL_CALL endFastElement( ::sal_Int32 Element ) override; + virtual void SAL_CALL endUnknownElement( const OUString& Namespace, const OUString& Name ) override; + virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext( ::sal_Int32 Element, const css::uno::Reference< css::xml::sax::XFastAttributeList >& Attribs ) override; + virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createUnknownChildContext( const OUString& Namespace, const OUString& Name, const css::uno::Reference< css::xml::sax::XFastAttributeList >& Attribs ) override; + virtual void SAL_CALL characters( const OUString& aChars ) override; + +}; + +} // namespace oox::core + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/docprop/ooxmldocpropimport.cxx b/oox/source/docprop/ooxmldocpropimport.cxx new file mode 100644 index 000000000..f58476c56 --- /dev/null +++ b/oox/source/docprop/ooxmldocpropimport.cxx @@ -0,0 +1,229 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include "ooxmldocpropimport.hxx" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "docprophandler.hxx" + +#include +#include + +using namespace ::com::sun::star; + +namespace oox::docprop { + +using namespace ::com::sun::star::beans; +using namespace ::com::sun::star::document; +using namespace ::com::sun::star::embed; +using namespace ::com::sun::star::io; +using namespace ::com::sun::star::lang; +using namespace ::com::sun::star::uno; +using namespace ::com::sun::star::xml::sax; + +namespace { + +/// @throws RuntimeException +/// @throws css::io::IOException +Sequence< InputSource > lclGetRelatedStreams( const Reference< XStorage >& rxStorage, const OUString& rStreamType ) +{ + Reference< XRelationshipAccess > xRelation( rxStorage, UNO_QUERY_THROW ); + Reference< XHierarchicalStorageAccess > xHierarchy( rxStorage, UNO_QUERY_THROW ); + + const Sequence< Sequence< StringPair > > aPropsInfo = xRelation->getRelationshipsByType( rStreamType ); + + ::std::vector< InputSource > aResult; + + for( const Sequence< StringPair >& rEntries : aPropsInfo ) + { + auto pEntry = std::find_if(rEntries.begin(), rEntries.end(), + [](const StringPair& rEntry) { return rEntry.First == "Target"; }); + if (pEntry != rEntries.end()) + { + // The stream path is always a relative one, ignore the leading "/" if it's there. + OUString aStreamPath = pEntry->Second; + if (aStreamPath.startsWith("/")) + aStreamPath = aStreamPath.copy(1); + + Reference< XExtendedStorageStream > xExtStream( + xHierarchy->openStreamElementByHierarchicalName( aStreamPath, ElementModes::READ ), UNO_SET_THROW ); + Reference< XInputStream > xInStream = xExtStream->getInputStream(); + if( xInStream.is() ) + { + aResult.emplace_back(); + aResult.back().sSystemId = pEntry->Second; + aResult.back().aInputStream = xExtStream->getInputStream(); + } + } + } + + return comphelper::containerToSequence( aResult ); +} + +Sequence< InputSource > lclGetCoreStreams(const Reference< XStorage >& rxSource) +{ + Sequence< InputSource > aCoreStreams = lclGetRelatedStreams(rxSource, CREATE_OFFICEDOC_RELATION_TYPE("metadata/core-properties")); + // OOXML strict + if (!aCoreStreams.hasElements()) + aCoreStreams = lclGetRelatedStreams(rxSource, CREATE_OFFICEDOC_RELATION_TYPE_STRICT("metadata/core-properties")); + // MS Office seems to have a bug, so we have to do similar handling + if (!aCoreStreams.hasElements()) + aCoreStreams = lclGetRelatedStreams(rxSource, "http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties"); + + return aCoreStreams; +} + +Sequence< InputSource > lclGetExtStreams(const Reference< XStorage >& rxSource) +{ + Sequence< InputSource > aExtStreams = lclGetRelatedStreams(rxSource, CREATE_OFFICEDOC_RELATION_TYPE("extended-properties")); + // OOXML strict + if (!aExtStreams.hasElements()) + aExtStreams = lclGetRelatedStreams(rxSource, CREATE_OFFICEDOC_RELATION_TYPE_STRICT("extended-properties")); + + return aExtStreams; +} + +Sequence< InputSource > lclGetCustomStreams(const Reference< XStorage >& rxSource) +{ + Sequence< InputSource > aCustomStreams = lclGetRelatedStreams(rxSource, CREATE_OFFICEDOC_RELATION_TYPE("custom-properties")); + // OOXML strict + if (!aCustomStreams.hasElements()) + aCustomStreams = lclGetRelatedStreams(rxSource, CREATE_OFFICEDOC_RELATION_TYPE_STRICT("custom-properties")); + + return aCustomStreams; +} + + +} // namespace + +DocumentPropertiesImport::DocumentPropertiesImport( const Reference< XComponentContext >& rxContext ) : + mxContext( rxContext ) +{ +} + +// XServiceInfo +OUString SAL_CALL DocumentPropertiesImport::getImplementationName() +{ + return "com.sun.star.comp.oox.docprop.DocumentPropertiesImporter"; +} + +sal_Bool SAL_CALL DocumentPropertiesImport::supportsService( const OUString& rServiceName ) +{ + return cppu::supportsService(this, rServiceName); +} + +Sequence< OUString > SAL_CALL DocumentPropertiesImport::getSupportedServiceNames() +{ + Sequence aServices { "com.sun.star.document.OOXMLDocumentPropertiesImporter" }; + return aServices; +} + +// XOOXMLDocumentPropertiesImporter +void SAL_CALL DocumentPropertiesImport::importProperties( + const Reference< XStorage >& rxSource, const Reference< XDocumentProperties >& rxDocumentProperties ) +{ + if( !mxContext.is() ) + throw RuntimeException(); + + if( !rxSource.is() || !rxDocumentProperties.is() ) + throw IllegalArgumentException(); + + Sequence< InputSource > aCoreStreams = lclGetCoreStreams(rxSource); + + Sequence< InputSource > aExtStreams = lclGetExtStreams(rxSource); + + Sequence< InputSource > aCustomStreams = lclGetCustomStreams(rxSource); + + if( !(aCoreStreams.hasElements() || aExtStreams.hasElements() || aCustomStreams.hasElements()) ) + return; + + if( aCoreStreams.getLength() > 1 ) + throw IOException( "Unexpected core properties stream!" ); + + ::oox::core::FastParser aParser; + aParser.registerNamespace( NMSP_packageMetaCorePr ); + aParser.registerNamespace( NMSP_dc ); + aParser.registerNamespace( NMSP_dcTerms ); + aParser.registerNamespace( NMSP_officeExtPr ); + aParser.registerNamespace( NMSP_officeCustomPr ); + aParser.registerNamespace( NMSP_officeDocPropsVT ); + aParser.setDocumentHandler( new OOXMLDocPropHandler( mxContext, rxDocumentProperties ) ); + + if( aCoreStreams.hasElements() ) + aParser.parseStream( aCoreStreams[ 0 ], true ); + for( const auto& rExtStream : std::as_const(aExtStreams) ) + aParser.parseStream( rExtStream, true ); + for( const auto& rCustomStream : std::as_const(aCustomStreams) ) + aParser.parseStream( rCustomStream, true ); +} + +Reference < com::sun::star::io::XInputStream > SAL_CALL DocumentPropertiesImport::getCorePropertiesStream( + const Reference< XStorage >& rxSource) +{ + Sequence< InputSource > aCoreStreams = lclGetCoreStreams(rxSource); + if (!aCoreStreams.hasElements()) + return nullptr; + + return aCoreStreams[0].aInputStream; +} + +Reference < com::sun::star::io::XInputStream > SAL_CALL DocumentPropertiesImport::getExtendedPropertiesStream( + const Reference< XStorage >& rxSource) +{ + Sequence< InputSource > aExtStreams = lclGetExtStreams(rxSource); + if (!aExtStreams.hasElements()) + return nullptr; + + return aExtStreams[0].aInputStream; +} + +css::uno::Sequence< css::uno::Reference< com::sun::star::io::XInputStream > > SAL_CALL DocumentPropertiesImport::getCustomPropertiesStreams( + const Reference< XStorage >& rxSource) +{ + Sequence aExtStreams = lclGetCustomStreams(rxSource); + + // Repack the sequence + std::vector> aResult(aExtStreams.getLength()); + for (const auto& aInputSource : aExtStreams) + { + aResult.push_back(aInputSource.aInputStream); + } + + return comphelper::containerToSequence(aResult); +} + +} // namespace oox::docprop + +extern "C" SAL_DLLPUBLIC_EXPORT uno::XInterface* +com_sun_star_comp_oox_docprop_DocumentPropertiesImporter_get_implementation( + uno::XComponentContext* pCtx, uno::Sequence const& /*rSeq*/) +{ + return cppu::acquire(new oox::docprop::DocumentPropertiesImport(pCtx)); +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/docprop/ooxmldocpropimport.hxx b/oox/source/docprop/ooxmldocpropimport.hxx new file mode 100644 index 000000000..ba406bae9 --- /dev/null +++ b/oox/source/docprop/ooxmldocpropimport.hxx @@ -0,0 +1,63 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_OOX_SOURCE_DOCPROP_OOXMLDOCPROPIMPORT_HXX +#define INCLUDED_OOX_SOURCE_DOCPROP_OOXMLDOCPROPIMPORT_HXX + +#include +#include +#include +#include + +namespace oox::docprop { + +class DocumentPropertiesImport : + public ::cppu::WeakImplHelper< + css::lang::XServiceInfo, + css::document::XOOXMLDocumentPropertiesImporter > +{ +public: + explicit DocumentPropertiesImport( + const css::uno::Reference< css::uno::XComponentContext >& rxContext ); + + // XServiceInfo + virtual OUString SAL_CALL getImplementationName() override; + virtual sal_Bool SAL_CALL supportsService( const OUString& rServiceName ) override; + virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override; + + // XOOXMLDocumentPropertiesImporter + virtual void SAL_CALL importProperties( + const css::uno::Reference< css::embed::XStorage >& rxSource, + const css::uno::Reference< css::document::XDocumentProperties >& rxDocumentProperties ) override; + virtual css::uno::Reference < com::sun::star::io::XInputStream > SAL_CALL getCorePropertiesStream( + const css::uno::Reference< css::embed::XStorage >& rxSource) override; + virtual css::uno::Reference < com::sun::star::io::XInputStream > SAL_CALL getExtendedPropertiesStream( + const css::uno::Reference< css::embed::XStorage >& rxSource) override; + virtual css::uno::Sequence< css::uno::Reference< com::sun::star::io::XInputStream > > SAL_CALL getCustomPropertiesStreams( + const css::uno::Reference< css::embed::XStorage >& rxSource) override; + +private: + css::uno::Reference< css::uno::XComponentContext > mxContext; +}; + +} // namespace oox::docprop + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/drawingml/ThemeOverrideFragmentHandler.cxx b/oox/source/drawingml/ThemeOverrideFragmentHandler.cxx new file mode 100644 index 000000000..1be56980c --- /dev/null +++ b/oox/source/drawingml/ThemeOverrideFragmentHandler.cxx @@ -0,0 +1,47 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#include +#include +#include +#include + +using namespace ::oox::core; + +namespace oox::drawingml { + +ThemeOverrideFragmentHandler::ThemeOverrideFragmentHandler( XmlFilterBase& rFilter, const OUString& rFragmentPath, Theme& rTheme ) : + FragmentHandler2( rFilter, rFragmentPath ), + mrTheme( rTheme ) +{ +} + +ThemeOverrideFragmentHandler::~ThemeOverrideFragmentHandler() +{ +} + +ContextHandlerRef ThemeOverrideFragmentHandler::onCreateContext( sal_Int32 nElement, const AttributeList& ) +{ + // CT_OfficeStyleSheet + switch( getCurrentElement() ) + { + case XML_ROOT_CONTEXT: + switch( nElement ) + { + case A_TOKEN( themeOverride ): // CT_BaseStylesOverride + return new ThemeElementsContext( *this, mrTheme ); + } + break; + } + return nullptr; +} + +} // namespace oox::drawingml + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/drawingml/chart/axiscontext.cxx b/oox/source/drawingml/chart/axiscontext.cxx new file mode 100644 index 000000000..b90857785 --- /dev/null +++ b/oox/source/drawingml/chart/axiscontext.cxx @@ -0,0 +1,298 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace oox::drawingml::chart { + +using ::oox::core::ContextHandlerRef; +using ::oox::core::ContextHandler2Helper; + +AxisDispUnitsContext::AxisDispUnitsContext( ContextHandler2Helper& rParent, AxisDispUnitsModel& rModel ) : + ContextBase< AxisDispUnitsModel >( rParent, rModel ) +{ +} + +AxisDispUnitsContext::~AxisDispUnitsContext() +{ +} + +ContextHandlerRef AxisDispUnitsContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ) +{ + switch( getCurrentElement() ) + { + case C_TOKEN( dispUnits ): + switch( nElement ) + { + case C_TOKEN( builtInUnit ): + mrModel.mnBuiltInUnit = rAttribs.getString( XML_val, "thousands" ); + return nullptr; + case C_TOKEN( custUnit ): + mrModel.mfCustomUnit = rAttribs.getDouble( XML_val, 0.0 ); + return nullptr; + case C_TOKEN( dispUnitsLbl ): + return this; + } + break; + + case C_TOKEN( dispUnitsLbl ): + switch( nElement ) + { + case C_TOKEN( layout ): + return new LayoutContext( *this, mrModel.mxLayout.create() ); + case C_TOKEN( spPr ): + return new ShapePropertiesContext( *this, mrModel.mxShapeProp.create() ); + case C_TOKEN( tx ): + return new TextContext( *this, mrModel.mxText.create() ); + case C_TOKEN( txPr ): + return new TextBodyContext( *this, mrModel.mxTextProp.create() ); + } + break; + } + return nullptr; +} + +AxisContextBase::AxisContextBase( ContextHandler2Helper& rParent, AxisModel& rModel ) : + ContextBase< AxisModel >( rParent, rModel ) +{ +} + +AxisContextBase::~AxisContextBase() +{ +} + +ContextHandlerRef AxisContextBase::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ) +{ + bool bMSO2007Doc = getFilter().isMSO2007Document(); + switch( getCurrentElement() ) + { + case C_TOKEN( catAx ): + case C_TOKEN( dateAx ): + case C_TOKEN( serAx ): + case C_TOKEN( valAx ): + switch( nElement ) + { + case C_TOKEN( axId ): + mrModel.mnAxisId = rAttribs.getInteger( XML_val, -1 ); + return nullptr; + case C_TOKEN( crossAx ): + mrModel.mnCrossAxisId = rAttribs.getInteger( XML_val, -1 ); + return nullptr; + case C_TOKEN( crosses ): + mrModel.mnCrossMode = rAttribs.getToken( XML_val, XML_autoZero ); + return nullptr; + case C_TOKEN( crossesAt ): + mrModel.mofCrossesAt = rAttribs.getDouble( XML_val, 0.0 ); + return nullptr; + case C_TOKEN( delete ): + mrModel.mbDeleted = rAttribs.getBool( XML_val, !bMSO2007Doc ); + return nullptr; + case C_TOKEN( majorGridlines ): + return new ShapePrWrapperContext( *this, mrModel.mxMajorGridLines.create() ); + case C_TOKEN( majorTickMark ): + mrModel.mnMajorTickMark = rAttribs.getToken( XML_val, bMSO2007Doc ? XML_out : XML_cross ); + return nullptr; + case C_TOKEN(axPos): + mrModel.mnAxisPos = rAttribs.getToken( XML_val, XML_TOKEN_INVALID ); + return nullptr; + case C_TOKEN( minorGridlines ): + return new ShapePrWrapperContext( *this, mrModel.mxMinorGridLines.create() ); + case C_TOKEN( minorTickMark ): + mrModel.mnMinorTickMark = rAttribs.getToken( XML_val, bMSO2007Doc ? XML_none : XML_cross ); + return nullptr; + case C_TOKEN( numFmt ): + mrModel.maNumberFormat.setAttributes( rAttribs ); + return nullptr; + case C_TOKEN( scaling ): + return this; + case C_TOKEN( spPr ): + return new ShapePropertiesContext( *this, mrModel.mxShapeProp.create() ); + case C_TOKEN( tickLblPos ): + mrModel.mnTickLabelPos = rAttribs.getToken( XML_val, XML_nextTo ); + return nullptr; + case C_TOKEN( title ): + { + bool bVerticalDefault = mrModel.mnAxisPos == XML_l || mrModel.mnAxisPos == XML_r; + sal_Int32 nDefaultRotation = bVerticalDefault ? -5400000 : 0; + return new TitleContext( *this, mrModel.mxTitle.create(nDefaultRotation) ); + } + case C_TOKEN( txPr ): + return new TextBodyContext( *this, mrModel.mxTextProp.create() ); + } + break; + + case C_TOKEN( scaling ): + switch( nElement ) + { + case C_TOKEN( logBase ): + mrModel.mofLogBase = rAttribs.getDouble( XML_val, 0.0 ); + return nullptr; + case C_TOKEN( max ): + mrModel.mofMax = rAttribs.getDouble( XML_val, 0.0 ); + return nullptr; + case C_TOKEN( min ): + mrModel.mofMin = rAttribs.getDouble( XML_val, 0.0 ); + return nullptr; + case C_TOKEN( orientation ): + mrModel.mnOrientation = rAttribs.getToken( XML_val, XML_minMax ); + return nullptr; + } + break; + } + return nullptr; +} + +CatAxisContext::CatAxisContext( ContextHandler2Helper& rParent, AxisModel& rModel ) : + AxisContextBase( rParent, rModel ) +{ +} + +CatAxisContext::~CatAxisContext() +{ +} + +ContextHandlerRef CatAxisContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ) +{ + bool bMSO2007Doc = getFilter().isMSO2007Document(); + if( isRootElement() ) switch( nElement ) + { + case C_TOKEN( auto ): + mrModel.mbAuto = rAttribs.getBool( XML_val, !bMSO2007Doc ); + return nullptr; + case C_TOKEN( lblAlgn ): + mrModel.mnLabelAlign = rAttribs.getToken( XML_val, XML_ctr ); + return nullptr; + case C_TOKEN( lblOffset ): + mrModel.mnLabelOffset = rAttribs.getInteger( XML_val, 100 ); + return nullptr; + case C_TOKEN( noMultiLvlLbl ): + mrModel.mbNoMultiLevel = rAttribs.getBool( XML_val, !bMSO2007Doc ); + return nullptr; + case C_TOKEN( tickLblSkip ): + mrModel.mnTickLabelSkip = rAttribs.getInteger( XML_val, 0 ); + return nullptr; + case C_TOKEN( tickMarkSkip ): + mrModel.mnTickMarkSkip = rAttribs.getInteger( XML_val, 0 ); + return nullptr; + } + return AxisContextBase::onCreateContext( nElement, rAttribs ); +} + +DateAxisContext::DateAxisContext( ContextHandler2Helper& rParent, AxisModel& rModel ) : + AxisContextBase( rParent, rModel ) +{ +} + +DateAxisContext::~DateAxisContext() +{ +} + +ContextHandlerRef DateAxisContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ) +{ + bool bMSO2007Doc = getFilter().isMSO2007Document(); + if( isRootElement() ) switch( nElement ) + { + case C_TOKEN( auto ): + mrModel.mbAuto = rAttribs.getBool( XML_val, !bMSO2007Doc ); + return nullptr; + case C_TOKEN( baseTimeUnit ): + mrModel.monBaseTimeUnit = rAttribs.getToken( XML_val, XML_days ); + return nullptr; + case C_TOKEN( lblOffset ): + mrModel.mnLabelOffset = rAttribs.getInteger( XML_val, 100 ); + return nullptr; + case C_TOKEN( majorTimeUnit ): + mrModel.mnMajorTimeUnit = rAttribs.getToken( XML_val, XML_days ); + return nullptr; + case C_TOKEN( majorUnit ): + mrModel.mofMajorUnit = rAttribs.getDouble( XML_val, 0.0 ); + return nullptr; + case C_TOKEN( minorTimeUnit ): + mrModel.mnMinorTimeUnit = rAttribs.getToken( XML_val, XML_days ); + return nullptr; + case C_TOKEN( minorUnit ): + mrModel.mofMinorUnit = rAttribs.getDouble( XML_val, 0.0 ); + return nullptr; + } + return AxisContextBase::onCreateContext( nElement, rAttribs ); +} + +SerAxisContext::SerAxisContext( ContextHandler2Helper& rParent, AxisModel& rModel ) : + AxisContextBase( rParent, rModel ) +{ +} + +SerAxisContext::~SerAxisContext() +{ +} + +ContextHandlerRef SerAxisContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ) +{ + if( isRootElement() ) switch( nElement ) + { + case C_TOKEN( tickLblSkip ): + mrModel.mnTickLabelSkip = rAttribs.getInteger( XML_val, 0 ); + return nullptr; + case C_TOKEN( tickMarkSkip ): + mrModel.mnTickMarkSkip = rAttribs.getInteger( XML_val, 0 ); + return nullptr; + } + return AxisContextBase::onCreateContext( nElement, rAttribs ); +} + +ValAxisContext::ValAxisContext( ContextHandler2Helper& rParent, AxisModel& rModel ) : + AxisContextBase( rParent, rModel ) +{ +} + +ValAxisContext::~ValAxisContext() +{ +} + +ContextHandlerRef ValAxisContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ) +{ + if( isRootElement() ) switch( nElement ) + { + case C_TOKEN( crossBetween ): + mrModel.mnCrossBetween = rAttribs.getToken( XML_val, -1 ); + return nullptr; + case C_TOKEN( dispUnits ): + return new AxisDispUnitsContext( *this, mrModel.mxDispUnits.create() ); + case C_TOKEN( majorUnit ): + mrModel.mofMajorUnit = rAttribs.getDouble( XML_val, 0.0 ); + return nullptr; + case C_TOKEN( minorUnit ): + mrModel.mofMinorUnit = rAttribs.getDouble( XML_val, 0.0 ); + return nullptr; + } + return AxisContextBase::onCreateContext( nElement, rAttribs ); +} + +} // namespace oox::drawingml::chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/drawingml/chart/axisconverter.cxx b/oox/source/drawingml/chart/axisconverter.cxx new file mode 100644 index 000000000..a8ccc6cdf --- /dev/null +++ b/oox/source/drawingml/chart/axisconverter.cxx @@ -0,0 +1,437 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace oox::drawingml::chart { + +using namespace ::com::sun::star::beans; +using namespace ::com::sun::star::chart2; +using namespace ::com::sun::star::uno; + +namespace { + +void lclSetValueOrClearAny( Any& orAny, const OptValue< double >& rofValue ) +{ + if( rofValue.has() ) orAny <<= rofValue.get(); else orAny.clear(); +} + +bool lclIsLogarithmicScale( const AxisModel& rAxisModel ) +{ + return rAxisModel.mofLogBase.has() && (2.0 <= rAxisModel.mofLogBase.get()) && (rAxisModel.mofLogBase.get() <= 1000.0); +} + +sal_Int32 lclGetApiTimeUnit( sal_Int32 nTimeUnit ) +{ + using namespace ::com::sun::star::chart; + switch( nTimeUnit ) + { + case XML_days: return TimeUnit::DAY; + case XML_months: return TimeUnit::MONTH; + case XML_years: return TimeUnit::YEAR; + default: OSL_ENSURE( false, "lclGetApiTimeUnit - unexpected time unit" ); + } + return TimeUnit::DAY; +} + +void lclConvertTimeInterval( Any& orInterval, const OptValue< double >& rofUnit, sal_Int32 nTimeUnit ) +{ + if( rofUnit.has() && (1.0 <= rofUnit.get()) && (rofUnit.get() <= SAL_MAX_INT32) ) + orInterval <<= css::chart::TimeInterval( static_cast< sal_Int32 >( rofUnit.get() ), lclGetApiTimeUnit( nTimeUnit ) ); + else + orInterval.clear(); +} + +css::chart::ChartAxisLabelPosition lclGetLabelPosition( sal_Int32 nToken ) +{ + using namespace ::com::sun::star::chart; + switch( nToken ) + { + case XML_high: return ChartAxisLabelPosition_OUTSIDE_END; + case XML_low: return ChartAxisLabelPosition_OUTSIDE_START; + case XML_nextTo: return ChartAxisLabelPosition_NEAR_AXIS; + } + return ChartAxisLabelPosition_NEAR_AXIS; +} + +sal_Int32 lclGetTickMark( sal_Int32 nToken ) +{ + using namespace ::com::sun::star::chart2::TickmarkStyle; + switch( nToken ) + { + case XML_in: return INNER; + case XML_out: return OUTER; + case XML_cross: return INNER | OUTER; + } + return css::chart2::TickmarkStyle::NONE; +} + +/** + * The groups is of percent type only when all of its members are of percent + * type. + */ +bool isPercent( const RefVector& rTypeGroups ) +{ + if (rTypeGroups.empty()) + return false; + + for (auto const& typeGroup : rTypeGroups) + { + TypeGroupConverter& rConv = *typeGroup; + if (!rConv.isPercent()) + return false; + } + + return true; +} + +} // namespace + +AxisConverter::AxisConverter( const ConverterRoot& rParent, AxisModel& rModel ) : + ConverterBase< AxisModel >( rParent, rModel ) +{ +} + +AxisConverter::~AxisConverter() +{ +} + +void AxisConverter::convertFromModel(const Reference& rxCoordSystem, + RefVector& rTypeGroups, + const AxisModel* pCrossingAxis, sal_Int32 nAxesSetIdx, + sal_Int32 nAxisIdx, bool bUseFixedInnerSize) +{ + if (rTypeGroups.empty()) + return; + + Reference< XAxis > xAxis; + try + { + namespace cssc = ::com::sun::star::chart; + namespace cssc2 = ::com::sun::star::chart2; + + const TypeGroupInfo& rTypeInfo = rTypeGroups.front()->getTypeInfo(); + ObjectFormatter& rFormatter = getFormatter(); + + // create the axis object (always) + xAxis.set( createInstance( "com.sun.star.chart2.Axis" ), UNO_QUERY_THROW ); + PropertySet aAxisProp( xAxis ); + // #i58688# axis enabled + aAxisProp.setProperty( PROP_Show, !mrModel.mbDeleted ); + + // axis line, tick, and gridline properties --------------------------- + + // show axis labels + aAxisProp.setProperty( PROP_DisplayLabels, mrModel.mnTickLabelPos != XML_none ); + aAxisProp.setProperty( PROP_LabelPosition, lclGetLabelPosition( mrModel.mnTickLabelPos ) ); + // no X axis line in radar charts + if( (nAxisIdx == API_X_AXIS) && (rTypeInfo.meTypeCategory == TYPECATEGORY_RADAR) ) + mrModel.mxShapeProp.getOrCreate().getLineProperties().maLineFill.moFillType = XML_noFill; + // axis line and tick label formatting + rFormatter.convertFormatting( aAxisProp, mrModel.mxShapeProp, mrModel.mxTextProp, OBJECTTYPE_AXIS ); + // tick label rotation + ObjectFormatter::convertTextRotation( aAxisProp, mrModel.mxTextProp, true ); + + // tick mark style + aAxisProp.setProperty( PROP_MajorTickmarks, lclGetTickMark( mrModel.mnMajorTickMark ) ); + aAxisProp.setProperty( PROP_MinorTickmarks, lclGetTickMark( mrModel.mnMinorTickMark ) ); + aAxisProp.setProperty( PROP_MarkPosition, cssc::ChartAxisMarkPosition_AT_AXIS ); + + // main grid + PropertySet aGridProp( xAxis->getGridProperties() ); + aGridProp.setProperty( PROP_Show, mrModel.mxMajorGridLines.is() ); + if( mrModel.mxMajorGridLines.is() ) + rFormatter.convertFrameFormatting( aGridProp, mrModel.mxMajorGridLines, OBJECTTYPE_MAJORGRIDLINE ); + + // sub grid + Sequence< Reference< XPropertySet > > aSubGridPropSeq = xAxis->getSubGridProperties(); + if( aSubGridPropSeq.hasElements() ) + { + PropertySet aSubGridProp( aSubGridPropSeq[ 0 ] ); + aSubGridProp.setProperty( PROP_Show, mrModel.mxMinorGridLines.is() ); + if( mrModel.mxMinorGridLines.is() ) + rFormatter.convertFrameFormatting( aSubGridProp, mrModel.mxMinorGridLines, OBJECTTYPE_MINORGRIDLINE ); + } + + // axis type and X axis categories ------------------------------------ + + ScaleData aScaleData = xAxis->getScaleData(); + // set axis type + switch( nAxisIdx ) + { + case API_X_AXIS: + if( rTypeInfo.mbCategoryAxis ) + { + OSL_ENSURE( (mrModel.mnTypeId == C_TOKEN( catAx )) || (mrModel.mnTypeId == C_TOKEN( dateAx )), + "AxisConverter::convertFromModel - unexpected axis model type (must: c:catAx or c:dateAx)" ); + bool bDateAxis = mrModel.mnTypeId == C_TOKEN( dateAx ); + // tdf#132076: set axis type to date, if it is a date axis! + aScaleData.AxisType = bDateAxis ? cssc2::AxisType::DATE : cssc2::AxisType::CATEGORY; + aScaleData.AutoDateAxis = mrModel.mbAuto; + /* TODO: create main category axis labels once, while InternalDataProvider + can not handle different category names on the primary and secondary category axis. */ + if( nAxesSetIdx == 0 ) + aScaleData.Categories = rTypeGroups.front()->createCategorySequence(); + /* set default ShiftedCategoryPosition values for some charttype, + because the XML can contain wrong CrossBetween value, if came from MSO */ + if( rTypeGroups.front()->is3dChart() && (rTypeInfo.meTypeId == TYPEID_BAR || rTypeInfo.meTypeId == TYPEID_HORBAR || rTypeInfo.meTypeId == TYPEID_STOCK) ) + aScaleData.ShiftedCategoryPosition = true; + else if( rTypeInfo.meTypeId == TYPEID_RADARLINE || rTypeInfo.meTypeId == TYPEID_RADARAREA ) + aScaleData.ShiftedCategoryPosition = false; + else if( pCrossingAxis->mnCrossBetween != -1 ) /*because of backwards compatibility*/ + aScaleData.ShiftedCategoryPosition = pCrossingAxis->mnCrossBetween == XML_between; + else if( rTypeInfo.meTypeCategory == TYPECATEGORY_BAR || rTypeInfo.meTypeId == TYPEID_LINE || rTypeInfo.meTypeId == TYPEID_STOCK ) + aScaleData.ShiftedCategoryPosition = true; + } + else + { + OSL_ENSURE( mrModel.mnTypeId == C_TOKEN( valAx ), "AxisConverter::convertFromModel - unexpected axis model type (must: c:valAx)" ); + aScaleData.AxisType = cssc2::AxisType::REALNUMBER; + } + break; + case API_Y_AXIS: + OSL_ENSURE( mrModel.mnTypeId == C_TOKEN( valAx ), "AxisConverter::convertFromModel - unexpected axis model type (must: c:valAx)" ); + aScaleData.AxisType = isPercent(rTypeGroups) ? cssc2::AxisType::PERCENT : cssc2::AxisType::REALNUMBER; + break; + case API_Z_AXIS: + OSL_ENSURE( mrModel.mnTypeId == C_TOKEN( serAx ), "AxisConverter::convertFromModel - unexpected axis model type (must: c:serAx)" ); + OSL_ENSURE( rTypeGroups.front()->isDeep3dChart(), "AxisConverter::convertFromModel - series axis not supported by this chart type" ); + aScaleData.AxisType = cssc2::AxisType::SERIES; + break; + } + + // axis scaling and increment ----------------------------------------- + + switch( aScaleData.AxisType ) + { + case cssc2::AxisType::CATEGORY: + case cssc2::AxisType::SERIES: + case cssc2::AxisType::DATE: + { + /* Determine date axis type from XML type identifier, and not + via aScaleData.AxisType, as this value sticks to CATEGORY + for automatic category/date axes). */ + if( mrModel.mnTypeId == C_TOKEN( dateAx ) ) + { + // scaling algorithm + aScaleData.Scaling = LinearScaling::create( comphelper::getProcessComponentContext() ); + // min/max + lclSetValueOrClearAny( aScaleData.Minimum, mrModel.mofMin ); + lclSetValueOrClearAny( aScaleData.Maximum, mrModel.mofMax ); + // major/minor increment + lclConvertTimeInterval( aScaleData.TimeIncrement.MajorTimeInterval, mrModel.mofMajorUnit, mrModel.mnMajorTimeUnit ); + lclConvertTimeInterval( aScaleData.TimeIncrement.MinorTimeInterval, mrModel.mofMinorUnit, mrModel.mnMinorTimeUnit ); + // base time unit + if( mrModel.monBaseTimeUnit.has() ) + aScaleData.TimeIncrement.TimeResolution <<= lclGetApiTimeUnit( mrModel.monBaseTimeUnit.get() ); + else + aScaleData.TimeIncrement.TimeResolution.clear(); + } + else + { + // do not overlap text unless the rotation is 0 in xml + bool bTextOverlap = false; + if (mrModel.mxTextProp.is() + && mrModel.mxTextProp->getTextProperties().moRotation.has()) + bTextOverlap + = mrModel.mxTextProp->getTextProperties().moRotation.get() == 0; + aAxisProp.setProperty(PROP_TextOverlap, bTextOverlap); + /* do not break text into several lines unless the rotation is 0 degree, + or the rotation is 90 degree and the inner size of the chart is not fixed, + or the rotation is 270 degree and the inner size of the chart is not fixed */ + bool bTextBreak = true; + double fRotationAngle = 0.0; + if (aAxisProp.getProperty(fRotationAngle, PROP_TextRotation) + && fRotationAngle != 0.0) + bTextBreak = !bUseFixedInnerSize + && (fRotationAngle == 90.0 || fRotationAngle == 270.0); + aAxisProp.setProperty(PROP_TextBreak, bTextBreak); + // do not stagger labels in two lines + aAxisProp.setProperty( PROP_ArrangeOrder, cssc::ChartAxisArrangeOrderType_SIDE_BY_SIDE ); + //! TODO #i58731# show n-th category + } + } + break; + case cssc2::AxisType::REALNUMBER: + case cssc2::AxisType::PERCENT: + { + // scaling algorithm + const bool bLogScale = lclIsLogarithmicScale( mrModel ); + if( bLogScale ) + aScaleData.Scaling = LogarithmicScaling::create( comphelper::getProcessComponentContext() ); + else + aScaleData.Scaling = LinearScaling::create( comphelper::getProcessComponentContext() ); + // min/max + lclSetValueOrClearAny( aScaleData.Minimum, mrModel.mofMin ); + lclSetValueOrClearAny( aScaleData.Maximum, mrModel.mofMax ); + // major increment + IncrementData& rIncrementData = aScaleData.IncrementData; + if( mrModel.mofMajorUnit.has() && aScaleData.Scaling.is() ) + rIncrementData.Distance <<= aScaleData.Scaling->doScaling( mrModel.mofMajorUnit.get() ); + else + lclSetValueOrClearAny( rIncrementData.Distance, mrModel.mofMajorUnit ); + // minor increment + Sequence< SubIncrement >& rSubIncrementSeq = rIncrementData.SubIncrements; + rSubIncrementSeq.realloc( 1 ); + Any& rIntervalCount = rSubIncrementSeq.getArray()[ 0 ].IntervalCount; + rIntervalCount.clear(); + if( bLogScale ) + { + if( mrModel.mofMinorUnit.has() ) + rIntervalCount <<= sal_Int32( 9 ); + } + else if( mrModel.mofMajorUnit.has() && mrModel.mofMinorUnit.has() && (0.0 < mrModel.mofMinorUnit.get()) && (mrModel.mofMinorUnit.get() <= mrModel.mofMajorUnit.get()) ) + { + double fCount = mrModel.mofMajorUnit.get() / mrModel.mofMinorUnit.get() + 0.5; + if( (1.0 <= fCount) && (fCount < 1001.0) ) + rIntervalCount <<= static_cast< sal_Int32 >( fCount ); + } + else if( !mrModel.mofMinorUnit.has() ) + { + // tdf#114168 If minor unit is not set then set interval to 5, as MS Excel do. + rIntervalCount <<= static_cast< sal_Int32 >( 5 ); + } + } + break; + default: + OSL_FAIL( "AxisConverter::convertFromModel - unknown axis type" ); + } + + /* Do not set a value to the Origin member anymore (already done via + new axis properties 'CrossoverPosition' and 'CrossoverValue'). */ + aScaleData.Origin.clear(); + + // axis orientation --------------------------------------------------- + + // #i85167# pie/donut charts need opposite direction at Y axis + // #i87747# radar charts need opposite direction at X axis + bool bMirrorDirection = + ((nAxisIdx == API_Y_AXIS) && (rTypeInfo.meTypeCategory == TYPECATEGORY_PIE)) || + ((nAxisIdx == API_X_AXIS) && (rTypeInfo.meTypeCategory == TYPECATEGORY_RADAR)); + bool bReverse = (mrModel.mnOrientation == XML_maxMin) != bMirrorDirection; + aScaleData.Orientation = bReverse ? cssc2::AxisOrientation_REVERSE : cssc2::AxisOrientation_MATHEMATICAL; + + // write back scaling data + xAxis->setScaleData( aScaleData ); + + // number format ------------------------------------------------------ + if( !mrModel.mbDeleted && aScaleData.AxisType != cssc2::AxisType::SERIES ) + { + getFormatter().convertNumberFormat(aAxisProp, mrModel.maNumberFormat, true); + } + + // position of crossing axis ------------------------------------------ + + bool bManualCrossing = mrModel.mofCrossesAt.has(); + cssc::ChartAxisPosition eAxisPos = cssc::ChartAxisPosition_VALUE; + if( !bManualCrossing ) switch( mrModel.mnCrossMode ) + { + case XML_min: eAxisPos = cssc::ChartAxisPosition_START; break; + case XML_max: eAxisPos = cssc::ChartAxisPosition_END; break; + case XML_autoZero: eAxisPos = cssc::ChartAxisPosition_ZERO; break; + } + + aAxisProp.setProperty( PROP_CrossoverPosition, eAxisPos ); + + // calculate automatic origin depending on scaling mode of crossing axis + bool bCrossingLogScale = pCrossingAxis && lclIsLogarithmicScale( *pCrossingAxis ); + double fCrossingPos = bManualCrossing ? mrModel.mofCrossesAt.get() : (bCrossingLogScale ? 1.0 : 0.0); + aAxisProp.setProperty( PROP_CrossoverValue, fCrossingPos ); + + // axis title --------------------------------------------------------- + + // in radar charts, title objects may exist, but are not shown + if( mrModel.mxTitle.is() && (rTypeGroups.front()->getTypeInfo().meTypeCategory != TYPECATEGORY_RADAR) ) + { + Reference< XTitled > xTitled( xAxis, UNO_QUERY_THROW ); + if (((nAxisIdx == API_X_AXIS && rTypeInfo.meTypeId != TYPEID_HORBAR) + || (nAxisIdx == API_Y_AXIS && rTypeInfo.meTypeId == TYPEID_HORBAR)) + && (mrModel.mnAxisPos == XML_l || mrModel.mnAxisPos == XML_r)) + mrModel.mxTitle->mnDefaultRotation = 0; + TitleConverter aTitleConv( *this, *mrModel.mxTitle ); + aTitleConv.convertFromModel( xTitled, OoxResId(STR_DIAGRAM_AXISTITLE), OBJECTTYPE_AXISTITLE, nAxesSetIdx, nAxisIdx ); + } + + // axis data unit label ----------------------------------------------- + AxisDispUnitsConverter axisDispUnitsConverter (*this, mrModel.mxDispUnits.getOrCreate()); + axisDispUnitsConverter.convertFromModel(xAxis); + } + catch( Exception& ) + { + } + + if( xAxis.is() && rxCoordSystem.is() ) try + { + // insert axis into coordinate system + rxCoordSystem->setAxisByDimension( nAxisIdx, xAxis, nAxesSetIdx ); + } + catch( Exception& ) + { + OSL_FAIL( "AxisConverter::convertFromModel - cannot insert axis into coordinate system" ); + } +} + +AxisDispUnitsConverter::AxisDispUnitsConverter( const ConverterRoot& rParent, AxisDispUnitsModel& rModel ) : + ConverterBase< AxisDispUnitsModel >( rParent, rModel ) +{ +} + +AxisDispUnitsConverter::~AxisDispUnitsConverter() +{ +} + +void AxisDispUnitsConverter::convertFromModel( const Reference< XAxis >& rxAxis ) +{ + PropertySet aPropSet( rxAxis ); + if (!mrModel.mnBuiltInUnit.isEmpty() ) + { + aPropSet.setProperty(PROP_DisplayUnits, true); + aPropSet.setProperty( PROP_BuiltInUnit, mrModel.mnBuiltInUnit ); + } +} + +} // namespace oox::drawingml::chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/drawingml/chart/axismodel.cxx b/oox/source/drawingml/chart/axismodel.cxx new file mode 100644 index 000000000..0159810df --- /dev/null +++ b/oox/source/drawingml/chart/axismodel.cxx @@ -0,0 +1,63 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include +#include + +namespace oox::drawingml::chart { + +AxisDispUnitsModel::AxisDispUnitsModel() : + mfCustomUnit( 0.0 ) +{ +} + +AxisDispUnitsModel::~AxisDispUnitsModel() +{ +} + +AxisModel::AxisModel( sal_Int32 nTypeId, bool bMSO2007Doc ) : + mnAxisId( -1 ), + mnAxisPos( XML_TOKEN_INVALID ), + mnCrossAxisId( -1 ), + mnCrossBetween( -1 ), + mnCrossMode( XML_autoZero ), + mnLabelAlign( XML_ctr ), + mnLabelOffset( 100 ), + mnMajorTickMark( bMSO2007Doc ? XML_out : XML_cross ), + mnMajorTimeUnit( XML_days ), + mnMinorTickMark( bMSO2007Doc ? XML_none : XML_cross ), + mnMinorTimeUnit( XML_days ), + mnOrientation( XML_minMax ), + mnTickLabelPos( XML_nextTo ), + mnTickLabelSkip( 0 ), + mnTickMarkSkip( 0 ), + mnTypeId( nTypeId ), + mbAuto( false ), + mbDeleted( false ), + mbNoMultiLevel( false ) +{ +} + +AxisModel::~AxisModel() +{ +} + +} // namespace oox::drawingml::chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/drawingml/chart/chartcontextbase.cxx b/oox/source/drawingml/chart/chartcontextbase.cxx new file mode 100644 index 000000000..5423c52b3 --- /dev/null +++ b/oox/source/drawingml/chart/chartcontextbase.cxx @@ -0,0 +1,107 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include + +#include +#include +#include +#include +#include + +namespace oox::drawingml::chart { + +using ::oox::core::ContextHandler2Helper; +using ::oox::core::ContextHandlerRef; + +ShapePrWrapperContext::ShapePrWrapperContext( ContextHandler2Helper& rParent, Shape& rModel ) : + ContextBase< Shape >( rParent, rModel ) +{ +} + +ShapePrWrapperContext::~ShapePrWrapperContext() +{ +} + +ContextHandlerRef ShapePrWrapperContext::onCreateContext( sal_Int32 nElement, const AttributeList& ) +{ + return (isRootElement() && (nElement == C_TOKEN( spPr ))) ? new ShapePropertiesContext( *this, mrModel ) : nullptr; +} + +LayoutContext::LayoutContext( ContextHandler2Helper& rParent, LayoutModel& rModel ) : + ContextBase< LayoutModel >( rParent, rModel ) +{ +} + +LayoutContext::~LayoutContext() +{ +} + +ContextHandlerRef LayoutContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ) +{ + switch( getCurrentElement() ) + { + case C_TOKEN( layout ): + switch( nElement ) + { + case C_TOKEN( manualLayout ): + mrModel.mbAutoLayout = false; + return this; + } + break; + + case C_TOKEN( manualLayout ): + switch( nElement ) + { + case C_TOKEN( x ): + mrModel.mfX = rAttribs.getDouble( XML_val, 0.0 ); + return nullptr; + case C_TOKEN( y ): + mrModel.mfY = rAttribs.getDouble( XML_val, 0.0 ); + return nullptr; + case C_TOKEN( w ): + mrModel.mfW = rAttribs.getDouble( XML_val, 0.0 ); + return nullptr; + case C_TOKEN( h ): + mrModel.mfH = rAttribs.getDouble( XML_val, 0.0 ); + return nullptr; + case C_TOKEN( xMode ): + mrModel.mnXMode = rAttribs.getToken( XML_val, XML_factor ); + return nullptr; + case C_TOKEN( yMode ): + mrModel.mnYMode = rAttribs.getToken( XML_val, XML_factor ); + return nullptr; + case C_TOKEN( wMode ): + mrModel.mnWMode = rAttribs.getToken( XML_val, XML_factor ); + return nullptr; + case C_TOKEN( hMode ): + mrModel.mnHMode = rAttribs.getToken( XML_val, XML_factor ); + return nullptr; + case C_TOKEN( layoutTarget ): + mrModel.mnTarget = rAttribs.getToken( XML_val, XML_outer ); + return nullptr; + } + break; + } + return nullptr; +} + +} // namespace oox::drawingml::chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/drawingml/chart/chartconverter.cxx b/oox/source/drawingml/chart/chartconverter.cxx new file mode 100644 index 000000000..e3b2abe6b --- /dev/null +++ b/oox/source/drawingml/chart/chartconverter.cxx @@ -0,0 +1,157 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +using ::oox::drawingml::chart::DataSequenceModel; +using ::com::sun::star::uno::Any; +namespace oox::drawingml::chart { + +using namespace ::com::sun::star; +using namespace ::com::sun::star::chart2; +using namespace ::com::sun::star::chart2::data; +using namespace ::com::sun::star::drawing; +using namespace ::com::sun::star::uno; + +using ::oox::core::XmlFilterBase; + +const sal_Unicode API_TOKEN_ARRAY_OPEN = '{'; +const sal_Unicode API_TOKEN_ARRAY_CLOSE = '}'; +const sal_Unicode API_TOKEN_ARRAY_COLSEP = ';'; + +// Code similar to oox/source/xls/formulabase.cxx +static OUString lclGenerateApiString( const OUString& rString ) +{ + OUString aRetString = rString; + sal_Int32 nQuotePos = aRetString.getLength(); + while( (nQuotePos = aRetString.lastIndexOf( '"', nQuotePos )) >= 0 ) + aRetString = aRetString.replaceAt( nQuotePos, 1, u"\"\"" ); + return "\"" + aRetString + "\""; +} + +static OUString lclGenerateApiArray(const std::vector& rRow, sal_Int32 nStart, sal_Int32 nCount) +{ + OSL_ENSURE( !rRow.empty(), "ChartConverter::lclGenerateApiArray - missing matrix values" ); + OUStringBuffer aBuffer; + aBuffer.append( API_TOKEN_ARRAY_OPEN ); + for (auto aBeg = rRow.begin() + nStart, aIt = aBeg, aEnd = aBeg + nCount; aIt != aEnd; ++aIt) + { + double fValue = 0.0; + OUString aString; + if( aIt != aBeg ) + aBuffer.append( API_TOKEN_ARRAY_COLSEP ); + if( *aIt >>= fValue ) + aBuffer.append( fValue ); + else if( *aIt >>= aString ) + aBuffer.append( lclGenerateApiString( aString ) ); + else + aBuffer.append( "\"\"" ); + } + aBuffer.append( API_TOKEN_ARRAY_CLOSE ); + return aBuffer.makeStringAndClear(); +} + +ChartConverter::ChartConverter() +{ +} + +ChartConverter::~ChartConverter() +{ +} + +void ChartConverter::convertFromModel( XmlFilterBase& rFilter, + ChartSpaceModel& rChartModel, const Reference< XChartDocument >& rxChartDoc, + const Reference< XShapes >& rxExternalPage, const awt::Point& rChartPos, const awt::Size& rChartSize ) +{ + OSL_ENSURE( rxChartDoc.is(), "ChartConverter::convertFromModel - missing chart document" ); + if( rxChartDoc.is() ) + { + Reference< data::XDataReceiver > xDataReceiver( rxChartDoc, uno::UNO_QUERY_THROW ); + Reference< util::XNumberFormatsSupplier > xNumberFormatsSupplier( rFilter.getModel(), uno::UNO_QUERY ); + if (xNumberFormatsSupplier.is()) + xDataReceiver->attachNumberFormatsSupplier( xNumberFormatsSupplier ); + + ConverterRoot aConvBase( rFilter, *this, rChartModel, rxChartDoc, rChartSize ); + ChartSpaceConverter aSpaceConv( aConvBase, rChartModel ); + aSpaceConv.convertFromModel( rxExternalPage, rChartPos ); + } +} + +void ChartConverter::createDataProvider( const Reference< XChartDocument >& rxChartDoc ) +{ + try + { + if( !rxChartDoc->hasInternalDataProvider() ) + rxChartDoc->createInternalDataProvider( false ); + } + catch( Exception& ) + { + } +} + +Reference< XDataSequence > ChartConverter::createDataSequence( + const Reference< XDataProvider >& rxDataProvider, const DataSequenceModel& rDataSeq, + const OUString& rRole, const OUString& rRoleQualifier ) +{ + Reference< XDataSequence > xDataSeq; + if( rxDataProvider.is() ) + { + OUString aRangeRep; + if( !rDataSeq.maData.empty() || (rRole == "values-y" && rDataSeq.mnPointCount > 0) ) try + { + // create a single-row array from constant source data + // (multiple levels in the case of complex categories) + std::vector aRow(rDataSeq.mnLevelCount * rDataSeq.mnPointCount); + for (auto const& elem : rDataSeq.maData) + aRow.at(elem.first) = elem.second; + + for (sal_Int32 i = rDataSeq.mnLevelCount-1; i >= 0; i--) + { + aRangeRep = lclGenerateApiArray( aRow, i * rDataSeq.mnPointCount, rDataSeq.mnPointCount); + + if (!aRangeRep.isEmpty()) + { + // create or add a new level to the data sequence + xDataSeq = rxDataProvider->createDataSequenceByValueArray(rRole, aRangeRep, rRoleQualifier); + if (i == 0) + return xDataSeq; + } + } + } + catch( Exception& ) + { + OSL_FAIL( "ChartConverter::createDataSequence - cannot create data sequence" ); + } + } + + return nullptr; +} + +} // namespace oox::drawingml::chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/drawingml/chart/chartdrawingfragment.cxx b/oox/source/drawingml/chart/chartdrawingfragment.cxx new file mode 100644 index 000000000..b9977c933 --- /dev/null +++ b/oox/source/drawingml/chart/chartdrawingfragment.cxx @@ -0,0 +1,244 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace oox::drawingml::chart { + +using namespace ::com::sun::star; +using namespace ::com::sun::star::drawing; +using namespace ::com::sun::star::uno; +using namespace ::oox::core; + +ShapeAnchor::ShapeAnchor( bool bRelSize ) : + mbRelSize( bRelSize ) +{ +} + +void ShapeAnchor::importExt( const AttributeList& rAttribs ) +{ + OSL_ENSURE( !mbRelSize, "ShapeAnchor::importExt - unexpected 'cdr:ext' element" ); + maSize.Width = rAttribs.getHyper( XML_cx, 0 ); + maSize.Height = rAttribs.getHyper( XML_cy, 0 ); +} + +void ShapeAnchor::setPos( sal_Int32 nElement, sal_Int32 nParentContext, std::u16string_view rValue ) +{ + AnchorPosModel* pAnchorPos = nullptr; + switch( nParentContext ) + { + case CDR_TOKEN( from ): + pAnchorPos = &maFrom; + break; + case CDR_TOKEN( to ): + OSL_ENSURE( mbRelSize, "ShapeAnchor::setPos - unexpected 'cdr:to' element" ); + pAnchorPos = &maTo; + break; + default: + OSL_FAIL( "ShapeAnchor::setPos - unexpected parent element" ); + } + if( pAnchorPos ) switch( nElement ) + { + case CDR_TOKEN( x ): pAnchorPos->mfX = o3tl::toDouble(rValue); break; + case CDR_TOKEN( y ): pAnchorPos->mfY = o3tl::toDouble(rValue); break; + default: OSL_FAIL( "ShapeAnchor::setPos - unexpected element" ); + } +} + +EmuRectangle ShapeAnchor::calcAnchorRectEmu( const EmuRectangle& rChartRect ) const +{ + EmuRectangle aAnchorRect( -1, -1, -1, -1 ); + + OSL_ENSURE( maFrom.isValid(), "ShapeAnchor::calcAnchorRectEmu - invalid from position" ); + OSL_ENSURE( mbRelSize ? maTo.isValid() : maSize.isValid(), "ShapeAnchor::calcAnchorRectEmu - invalid to/size" ); + if( maFrom.isValid() && (mbRelSize ? maTo.isValid() : maSize.isValid()) ) + { + // calculate shape position + aAnchorRect.X = static_cast< sal_Int64 >( maFrom.mfX * rChartRect.Width + 0.5 ); + aAnchorRect.Y = static_cast< sal_Int64 >( maFrom.mfY * rChartRect.Height + 0.5 ); + + // calculate shape size + if( mbRelSize ) + { + aAnchorRect.Width = static_cast< sal_Int64 >( maTo.mfX * rChartRect.Width + 0.5 ) - aAnchorRect.X; + if( aAnchorRect.Width < 0 ) + { + aAnchorRect.X += aAnchorRect.Width; + aAnchorRect.Width *= -1; + } + aAnchorRect.Height = static_cast< sal_Int64 >( maTo.mfY * rChartRect.Height + 0.5 ) - aAnchorRect.Y; + if( aAnchorRect.Height < 0 ) + { + aAnchorRect.Y += aAnchorRect.Height; + aAnchorRect.Height *= -1; + } + } + else + { + aAnchorRect.setSize( maSize ); + } + } + + return aAnchorRect; +} + +ChartDrawingFragment::ChartDrawingFragment( XmlFilterBase& rFilter, + const OUString& rFragmentPath, const Reference< XShapes >& rxDrawPage, + const awt::Size& rChartSize, const awt::Point& rShapesOffset, bool bOleSupport ) : + FragmentHandler2( rFilter, rFragmentPath ), + mxDrawPage( rxDrawPage ), + mbOleSupport( bOleSupport ) +{ + maChartRectEmu.X = convertHmmToEmu( rShapesOffset.X ); + maChartRectEmu.Y = convertHmmToEmu( rShapesOffset.Y ); + maChartRectEmu.Width = convertHmmToEmu( rChartSize.Width ); + maChartRectEmu.Height = convertHmmToEmu( rChartSize.Height ); +} + +ChartDrawingFragment::~ChartDrawingFragment() +{ +} + +ContextHandlerRef ChartDrawingFragment::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ) +{ + switch( getCurrentElement() ) + { + case XML_ROOT_CONTEXT: + if( nElement == C_TOKEN( userShapes ) ) return this; + break; + + case C_TOKEN( userShapes ): + switch( nElement ) + { + case CDR_TOKEN( absSizeAnchor ): + mxAnchor = std::make_shared( false ); + return this; + case CDR_TOKEN( relSizeAnchor ): + mxAnchor = std::make_shared( true ); + return this; + } + break; + + case CDR_TOKEN( absSizeAnchor ): + case CDR_TOKEN( relSizeAnchor ): + switch( nElement ) + { + case CDR_TOKEN( sp ): + mxShape = std::make_shared( "com.sun.star.drawing.CustomShape" ); + return new ShapeContext( *this, ShapePtr(), mxShape ); + case CDR_TOKEN( cxnSp ): + mxShape = std::make_shared( "com.sun.star.drawing.ConnectorShape" ); + return new ConnectorShapeContext(*this, ShapePtr(), mxShape, + mxShape->getConnectorShapeProperties()); + case CDR_TOKEN( pic ): + mxShape = std::make_shared( "com.sun.star.drawing.GraphicObjectShape" ); + return new GraphicShapeContext( *this, ShapePtr(), mxShape ); + case CDR_TOKEN( graphicFrame ): + if( !mbOleSupport ) + return nullptr; + mxShape = std::make_shared( "com.sun.star.drawing.GraphicObjectShape" ); + return new GraphicalObjectFrameContext( *this, ShapePtr(), mxShape, true ); + case CDR_TOKEN( grpSp ): + mxShape = std::make_shared( "com.sun.star.drawing.GroupShape" ); + return new ShapeGroupContext( *this, ShapePtr(), mxShape ); + + case CDR_TOKEN( from ): + case CDR_TOKEN( to ): + return this; + + case CDR_TOKEN( ext ): + if( mxAnchor ) mxAnchor->importExt( rAttribs ); + return nullptr; + } + break; + + case CDR_TOKEN( from ): + case CDR_TOKEN( to ): + switch( nElement ) + { + case CDR_TOKEN( x ): + case CDR_TOKEN( y ): + return this; // collect value in onEndElement() + } + break; + } + return nullptr; +} + +void ChartDrawingFragment::onCharacters( const OUString& rChars ) +{ + if( isCurrentElement( CDR_TOKEN( x ), CDR_TOKEN( y ) ) && mxAnchor ) + mxAnchor->setPos( getCurrentElement(), getParentElement(), rChars ); +} + +void ChartDrawingFragment::onEndElement() +{ + if( !isCurrentElement( CDR_TOKEN( absSizeAnchor ), CDR_TOKEN( relSizeAnchor ) ) ) + return; + + if( mxDrawPage.is() && mxShape && mxAnchor ) + { + EmuRectangle aShapeRectEmu = mxAnchor->calcAnchorRectEmu( maChartRectEmu ); + if( (aShapeRectEmu.X >= 0) && (aShapeRectEmu.Y >= 0) && (aShapeRectEmu.Width >= 0) && (aShapeRectEmu.Height >= 0) ) + { + const sal_Int32 aRotation = mxShape->getRotation(); + if( (aRotation >= 45 * PER_DEGREE && aRotation < 135 * PER_DEGREE) || (aRotation >= 225 * PER_DEGREE && aRotation < 315 * PER_DEGREE) ) + { + sal_Int64 nHalfWidth = aShapeRectEmu.Width / 2; + sal_Int64 nHalfHeight = aShapeRectEmu.Height / 2; + aShapeRectEmu.X = aShapeRectEmu.X + nHalfWidth - nHalfHeight; + aShapeRectEmu.Y = aShapeRectEmu.Y + nHalfHeight - nHalfWidth; + std::swap(aShapeRectEmu.Width, aShapeRectEmu.Height); + } + // TODO: DrawingML implementation expects 32-bit coordinates for EMU rectangles (change that to EmuRectangle) + awt::Rectangle aShapeRectEmu32( + getLimitedValue< sal_Int32, sal_Int64 >( aShapeRectEmu.X, 0, SAL_MAX_INT32 ), + getLimitedValue< sal_Int32, sal_Int64 >( aShapeRectEmu.Y, 0, SAL_MAX_INT32 ), + getLimitedValue< sal_Int32, sal_Int64 >( aShapeRectEmu.Width, 0, SAL_MAX_INT32 ), + getLimitedValue< sal_Int32, sal_Int64 >( aShapeRectEmu.Height, 0, SAL_MAX_INT32 ) ); + + // Set the position and size before calling addShape(). + mxShape->setPosition(awt::Point(aShapeRectEmu32.X, aShapeRectEmu32.Y)); + mxShape->setSize(awt::Size(aShapeRectEmu32.Width, aShapeRectEmu32.Height)); + + basegfx::B2DHomMatrix aMatrix; + mxShape->addShape( getFilter(), getFilter().getCurrentTheme(), mxDrawPage, aMatrix, mxShape->getFillProperties() ); + } + } + mxShape.reset(); + mxAnchor.reset(); +} + +} // namespace oox::drawingml::chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/drawingml/chart/chartspaceconverter.cxx b/oox/source/drawingml/chart/chartspaceconverter.cxx new file mode 100644 index 000000000..774d784a6 --- /dev/null +++ b/oox/source/drawingml/chart/chartspaceconverter.cxx @@ -0,0 +1,308 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +using namespace ::com::sun::star; +using ::com::sun::star::uno::Reference; +using ::com::sun::star::uno::Exception; +using ::com::sun::star::uno::UNO_QUERY; +using ::com::sun::star::uno::UNO_QUERY_THROW; +using ::com::sun::star::uno::Any; +using ::com::sun::star::drawing::XDrawPageSupplier; +using ::com::sun::star::drawing::XShapes; +using ::com::sun::star::chart2::XDiagram; +using ::com::sun::star::chart2::XTitled; + +namespace oox::drawingml::chart { + +using namespace ::com::sun::star::awt; +using namespace ::com::sun::star::chart2; +using namespace ::com::sun::star::chart2::data; +using namespace ::com::sun::star::drawing; +using namespace ::com::sun::star::uno; +using namespace ::com::sun::star::util; + +ChartSpaceConverter::ChartSpaceConverter( const ConverterRoot& rParent, ChartSpaceModel& rModel ) : + ConverterBase< ChartSpaceModel >( rParent, rModel ) +{ +} + +ChartSpaceConverter::~ChartSpaceConverter() +{ +} + +// Formulas with no numeric values and strings are zeroes in OOXML line charts also in the mode DispBlanksAs=gap, +// unlike in OpenDocument LEAVE_GAP mode. As a workaround, we will use the OpenDocument mode USE_ZERO, if the OOXML +// line chart has got formulas with no numeric values and strings, but it doesn't have empty cells, showing the +// same chart as in MSO. (Empty cells need gaps, so in that case, we cannot use this workaround). +static bool lcl_useWorkaroundForNoGapInOOXML( Reference< chart2::XChartDocument > const & xChartDoc) +{ + Reference xDiagram = xChartDoc->getFirstDiagram(); + if ( !xDiagram.is() ) + return false; + + Reference< chart2::XCoordinateSystemContainer > xCooSysContainer( xDiagram, UNO_QUERY_THROW ); + + Sequence< Reference< chart2::XCoordinateSystem > > xCooSysSequence( xCooSysContainer->getCoordinateSystems()); + if ( !xCooSysSequence.hasElements() ) + return false; + + Reference< chart2::XChartTypeContainer > xChartTypeContainer( xCooSysSequence[0], UNO_QUERY_THROW ); + + Sequence< Reference< chart2::XChartType > > xChartTypeSequence( xChartTypeContainer->getChartTypes() ); + if ( !xChartTypeSequence.hasElements() ) + return false; + + const Reference& xCT = xChartTypeSequence[0]; + + if ( xCT->getChartType() != "com.sun.star.chart2.LineChartType" ) + return false; + + Reference xDSCont(xCT, uno::UNO_QUERY); + + if (!xDSCont.is()) + return false; + + const Sequence > aDataSeriesSeq = xDSCont->getDataSeries(); + + bool bHasNoGapBlankValue = false; + bool bHasEmptyCell = false; + + for (const auto& rDataSeries : aDataSeriesSeq) + { + uno::Reference xDSrc(rDataSeries, uno::UNO_QUERY); + if (!xDSrc.is()) + return false; + + const uno::Sequence > aDataSeqs = xDSrc->getDataSequences(); + for (const auto& rDataSeq : aDataSeqs) + { + Reference xValues = rDataSeq->getValues(); + if(!xValues.is()) + return false; + Reference xPropSet(xValues, uno::UNO_QUERY); + if (!xPropSet.is()) + continue; + + OUString aRoleName; + xPropSet->getPropertyValue("Role") >>= aRoleName; + if (aRoleName == "values-y") + { + const uno::Sequence aData = xValues->getData(); + for (const auto& rVal : aData) + { + double fVal; + OUString sStr; + if (rVal >>= fVal) + continue; + else if (rVal >>= sStr) + bHasNoGapBlankValue = true; + else + bHasEmptyCell = true; + } + } + } + } + + return bHasNoGapBlankValue && !bHasEmptyCell; +} + +void ChartSpaceConverter::convertFromModel( const Reference< XShapes >& rxExternalPage, const awt::Point& rChartPos ) +{ + /* create data provider (virtual function in the ChartConverter class, + derived converters may create an external data provider) */ + getChartConverter().createDataProvider( getChartDocument() ); + + // formatting of the chart background. The default fill style varies with applications. + PropertySet aBackPropSet( getChartDocument()->getPageBackground() ); + getFormatter().convertFrameFormatting( aBackPropSet, mrModel.mxShapeProp, OBJECTTYPE_CHARTSPACE ); + + bool bMSO2007Doc = getFilter().isMSO2007Document(); + // convert plot area (container of all chart type groups) + PlotAreaConverter aPlotAreaConv( *this, mrModel.mxPlotArea.getOrCreate() ); + aPlotAreaConv.convertFromModel( mrModel.mxView3D.getOrCreate(bMSO2007Doc) ); + + // plot area converter has created the diagram object + Reference< XDiagram > xDiagram = getChartDocument()->getFirstDiagram(); + + // convert wall and floor formatting in 3D charts + if( xDiagram.is() && aPlotAreaConv.isWall3dChart() ) + { + WallFloorConverter aFloorConv( *this, mrModel.mxFloor.getOrCreate() ); + aFloorConv.convertFromModel( xDiagram, OBJECTTYPE_FLOOR ); + + WallFloorConverter aWallConv( *this, mrModel.mxBackWall.getOrCreate() ); + aWallConv.convertFromModel( xDiagram, OBJECTTYPE_WALL ); + } + + // chart title + /* tdf#119138 autoTitleDeleted might be omitted by generators other than Excel + while providing custom title. mbAutoTitleDel is set only based on the attribute value + and the default also varies on whether MSO 2007 or newer is the generator, see tdf#78080 */ + if( !mrModel.mbAutoTitleDel || mrModel.mxTitle.is() ) try + { + /* If the title model is missing, but the chart shows exactly one + series, the series title is shown as chart title. */ + OUString aAutoTitle = aPlotAreaConv.getAutomaticTitle(); + if( mrModel.mxTitle.is() || !aAutoTitle.isEmpty() ) + { + if( aAutoTitle.isEmpty() ) + aAutoTitle = OoxResId(STR_DIAGRAM_TITLE); + Reference< XTitled > xTitled( getChartDocument(), UNO_QUERY_THROW ); + TitleConverter aTitleConv( *this, mrModel.mxTitle.getOrCreate() ); + aTitleConv.convertFromModel( xTitled, aAutoTitle, OBJECTTYPE_CHARTTITLE ); + } + } + catch( Exception& ) + { + } + + // legend + if( xDiagram.is() && mrModel.mxLegend.is() ) + { + LegendConverter aLegendConv( *this, *mrModel.mxLegend ); + aLegendConv.convertFromModel( xDiagram ); + } + + // treatment of missing values + if( xDiagram.is() ) + { + using namespace ::com::sun::star::chart::MissingValueTreatment; + sal_Int32 nMissingValues = LEAVE_GAP; + + // tdf#134118 leave gap if the time unit is month + bool bIsMonthBasedTimeUnit = false; + if( mrModel.mxPlotArea.is() && mrModel.mxPlotArea->maAxes.size() > 0 && + mrModel.mxPlotArea->maAxes[0]->monBaseTimeUnit.has() ) + { + bIsMonthBasedTimeUnit = mrModel.mxPlotArea->maAxes[0]->monBaseTimeUnit.get() == XML_months; + } + + if (!bIsMonthBasedTimeUnit) switch( mrModel.mnDispBlanksAs ) + { + case XML_gap: nMissingValues = LEAVE_GAP; break; + case XML_zero: nMissingValues = USE_ZERO; break; + case XML_span: nMissingValues = CONTINUE; break; + } + + // use a workaround, if it's possible for the difference of OOXML and OpenDocument + if ( nMissingValues == LEAVE_GAP && lcl_useWorkaroundForNoGapInOOXML(getChartDocument()) ) + nMissingValues = USE_ZERO; + + PropertySet aDiaProp( xDiagram ); + aDiaProp.setProperty( PROP_MissingValueTreatment, nMissingValues ); + } + + /* Following all conversions needing the old Chart1 API that involves full + initialization of the chart view. */ + namespace cssc = ::com::sun::star::chart; + Reference< cssc::XChartDocument > xChart1Doc( getChartDocument(), UNO_QUERY ); + if( xChart1Doc.is() ) + { + /* Set the IncludeHiddenCells property via the old API as only this + ensures that the data provider and all created sequences get this + flag correctly. */ + PropertySet aDiaProp( xChart1Doc->getDiagram() ); + aDiaProp.setProperty( PROP_IncludeHiddenCells, !mrModel.mbPlotVisOnly ); + + // plot area position and size + aPlotAreaConv.convertPositionFromModel(); + + // positions of main title and all axis titles + convertTitlePositions(); + } + + // embedded drawing shapes + if( !mrModel.maDrawingPath.isEmpty() ) try + { + /* Get the internal draw page of the chart document, if no external + drawing page has been passed. */ + Reference< XShapes > xShapes; + awt::Point aShapesOffset( 0, 0 ); + if( rxExternalPage.is() ) + { + xShapes = rxExternalPage; + // offset for embedded shapes to move them inside the chart area + aShapesOffset = rChartPos; + } + else + { + Reference< XDrawPageSupplier > xDrawPageSupp( getChartDocument(), UNO_QUERY_THROW ); + xShapes.set( xDrawPageSupp->getDrawPage(), UNO_QUERY_THROW ); + } + + /* If an external drawing page is passed, all embedded shapes will be + inserted there (used e.g. with 'chart sheets' in spreadsheet + documents). In this case, all types of shapes including OLE objects + are supported. If the shapes are inserted into the internal chart + drawing page instead, it is not possible to embed OLE objects. */ + bool bOleSupport = rxExternalPage.is(); + + awt::Size aChartSize = getChartSize(); + if( aChartSize.Width <= 0 || aChartSize.Height <= 0 ) + aChartSize = getDefaultPageSize(); + + // now, xShapes is not null anymore + getFilter().importFragment( new ChartDrawingFragment( + getFilter(), mrModel.maDrawingPath, xShapes, aChartSize, aShapesOffset, bOleSupport ) ); + } + catch( Exception& ) + { + } + + // pivot chart + if ( mrModel.mbPivotChart ) + { + PropertySet aProps( getChartDocument() ); + aProps.setProperty( PROP_DisableDataTableDialog , true ); + aProps.setProperty( PROP_DisableComplexChartTypes , true ); + } + + if(!mrModel.maSheetPath.isEmpty() ) + { + Reference< css::chart::XChartDocument > xChartDoc( getChartDocument(), UNO_QUERY ); + PropertySet aProps( xChartDoc->getDiagram() ); + aProps.setProperty( PROP_ExternalData , uno::Any(mrModel.maSheetPath) ); + } +} + +} // namespace oox::drawingml::chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/drawingml/chart/chartspacefragment.cxx b/oox/source/drawingml/chart/chartspacefragment.cxx new file mode 100644 index 000000000..aa045d4a5 --- /dev/null +++ b/oox/source/drawingml/chart/chartspacefragment.cxx @@ -0,0 +1,124 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace oox::drawingml::chart { + +using namespace ::oox::core; + +ChartSpaceFragment::ChartSpaceFragment( XmlFilterBase& rFilter, const OUString& rFragmentPath, ChartSpaceModel& rModel ) : + FragmentBase< ChartSpaceModel >( rFilter, rFragmentPath, rModel ) +{ +} + +ChartSpaceFragment::~ChartSpaceFragment() +{ +} + +ContextHandlerRef ChartSpaceFragment::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ) +{ + bool bMSO2007Document = getFilter().isMSO2007Document(); + switch( getCurrentElement() ) + { + case XML_ROOT_CONTEXT: + switch( nElement ) + { + case C_TOKEN( chartSpace ): + return this; + } + break; + + case C_TOKEN( chartSpace ): + switch( nElement ) + { + case C_TOKEN( chart ): + return this; + case C_TOKEN( spPr ): + return new ShapePropertiesContext( *this, mrModel.mxShapeProp.create() ); + case C_TOKEN( style ): + mrModel.mnStyle = rAttribs.getInteger( XML_val, 2 ); + return nullptr; + case C_TOKEN( txPr ): + return new TextBodyContext( *this, mrModel.mxTextProp.create() ); + case C_TOKEN( userShapes ): + mrModel.maDrawingPath = getFragmentPathFromRelId( rAttribs.getString( R_TOKEN( id ), OUString() ) ); + return nullptr; + case C_TOKEN( pivotSource ): + mrModel.mbPivotChart = true; + return nullptr; + case C_TOKEN (externalData): + mrModel.maSheetPath = getFragmentPathFromRelId(rAttribs.getString(R_TOKEN(id),OUString())); + return nullptr; + } + break; + + case C_TOKEN( chart ): + switch( nElement ) + { + case C_TOKEN( autoTitleDeleted ): + { + + mrModel.mbAutoTitleDel = rAttribs.getBool( XML_val, !bMSO2007Document ); + return nullptr; + } + case C_TOKEN( backWall ): + return new WallFloorContext( *this, mrModel.mxBackWall.create() ); + case C_TOKEN( dispBlanksAs ): + { + // default value is XML_gap for MSO 2007 and XML_zero in OOXML + mrModel.mnDispBlanksAs = rAttribs.getToken( XML_val, bMSO2007Document ? XML_gap : XML_zero ); + return nullptr; + } + case C_TOKEN( floor ): + return new WallFloorContext( *this, mrModel.mxFloor.create() ); + case C_TOKEN( legend ): + return new LegendContext( *this, mrModel.mxLegend.create() ); + case C_TOKEN( plotArea ): + return new PlotAreaContext( *this, mrModel.mxPlotArea.create() ); + case C_TOKEN( plotVisOnly ): + mrModel.mbPlotVisOnly = rAttribs.getBool( XML_val, !bMSO2007Document ); + return nullptr; + case C_TOKEN( showDLblsOverMax ): + mrModel.mbShowLabelsOverMax = rAttribs.getBool( XML_val, !bMSO2007Document ); + return nullptr; + case C_TOKEN( sideWall ): + return new WallFloorContext( *this, mrModel.mxSideWall.create() ); + case C_TOKEN( title ): + return new TitleContext( *this, mrModel.mxTitle.create() ); + case C_TOKEN( view3D ): + return new View3DContext( *this, mrModel.mxView3D.create(bMSO2007Document) ); + } + break; + } + return nullptr; +} + +} // namespace oox::drawingml::chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/drawingml/chart/chartspacemodel.cxx b/oox/source/drawingml/chart/chartspacemodel.cxx new file mode 100644 index 000000000..3aa7366ff --- /dev/null +++ b/oox/source/drawingml/chart/chartspacemodel.cxx @@ -0,0 +1,41 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include +#include + +namespace oox::drawingml::chart { + +ChartSpaceModel::ChartSpaceModel(bool bMSO2007Doc) : + mnDispBlanksAs( bMSO2007Doc ? XML_gap : XML_zero ), // difference between OOXML spec and MSO 2007 + mnStyle( 2 ), + mbAutoTitleDel( !bMSO2007Doc ), // difference between OOXML spec and MSO 2007 + mbPlotVisOnly( !bMSO2007Doc ), + mbShowLabelsOverMax( !bMSO2007Doc ), + mbPivotChart( false ) +{ +} + +ChartSpaceModel::~ChartSpaceModel() +{ +} + +} // namespace oox::drawingml::chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/drawingml/chart/converterbase.cxx b/oox/source/drawingml/chart/converterbase.cxx new file mode 100644 index 000000000..d7130ec97 --- /dev/null +++ b/oox/source/drawingml/chart/converterbase.cxx @@ -0,0 +1,446 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +namespace oox::drawingml::chart { + +namespace cssc = ::com::sun::star::chart; + +using namespace ::com::sun::star; +using namespace ::com::sun::star::chart2; +using namespace ::com::sun::star::drawing; +using namespace ::com::sun::star::lang; +using namespace ::com::sun::star::uno; + +using ::oox::core::XmlFilterBase; + +namespace { + +struct TitleKey : public ::std::pair< ObjectType, ::std::pair< sal_Int32, sal_Int32 > > +{ + explicit TitleKey( ObjectType eObjType, sal_Int32 nMainIdx = -1, sal_Int32 nSubIdx = -1 ) + { first = eObjType; second.first = nMainIdx; second.second = nSubIdx; } +}; + +/** A helper structure to store all data related to title objects. Needed for + the conversion of manual title positions that needs the old Chart1 API. + */ +struct TitleLayoutInfo +{ + typedef Reference< XShape > (*GetShapeFunc)( const Reference< cssc::XChartDocument >& ); + + Reference< XTitle > mxTitle; /// The API title object. + ModelRef< LayoutModel > mxLayout; /// The layout model, if existing. + GetShapeFunc mpGetShape; /// Helper function to receive the title shape. + + explicit TitleLayoutInfo() : mpGetShape( nullptr ) {} + + void convertTitlePos( + ConverterRoot const & rRoot, + const Reference< cssc::XChartDocument >& rxChart1Doc ); +}; + +void TitleLayoutInfo::convertTitlePos( ConverterRoot const & rRoot, const Reference< cssc::XChartDocument >& rxChart1Doc ) +{ + if( !(mxTitle.is() && mpGetShape) ) + return; + + try + { + // try to get the title shape + Reference< XShape > xTitleShape = mpGetShape( rxChart1Doc ); + if (!xTitleShape) + { + SAL_WARN("oox", "failed to get a TitleShape"); + return; + } + // get title rotation angle, needed for correction of position of top-left edge + double fAngle = 0.0; + PropertySet aTitleProp( mxTitle ); + aTitleProp.getProperty( fAngle, PROP_TextRotation ); + // convert the position + LayoutModel& rLayout = mxLayout.getOrCreate(); + LayoutConverter aLayoutConv( rRoot, rLayout ); + aLayoutConv.convertFromModel( xTitleShape, fAngle ); + } + catch( Exception& ) + { + } +} + +/* The following local functions implement getting the XShape interface of all + supported title objects (chart and axes). This needs some effort due to the + design of the old Chart1 API used to access these objects. */ + +/** A code fragment that returns a shape object from the passed shape supplier + using the specified interface function. Checks a boolean property first. */ +#define OOX_FRAGMENT_GETTITLESHAPE( shape_supplier, supplier_func, property_name ) \ + PropertySet aPropSet( shape_supplier ); \ + if( shape_supplier.is() && aPropSet.getBoolProperty( PROP_##property_name ) ) \ + return shape_supplier->supplier_func(); \ + return Reference< XShape >(); \ + +/** Implements a function returning the drawing shape of an axis title, if + existing, using the specified API interface and its function. */ +#define OOX_DEFINEFUNC_GETAXISTITLESHAPE( func_name, interface_type, supplier_func, property_name ) \ +Reference< XShape > func_name( const Reference< cssc::XChartDocument >& rxChart1Doc ) \ +{ \ + Reference< cssc::interface_type > xAxisSupp( rxChart1Doc->getDiagram(), UNO_QUERY ); \ + OOX_FRAGMENT_GETTITLESHAPE( xAxisSupp, supplier_func, property_name ) \ +} + +/** Returns the drawing shape of the main title, if existing. */ +Reference< XShape > lclGetMainTitleShape( const Reference< cssc::XChartDocument >& rxChart1Doc ) +{ + OOX_FRAGMENT_GETTITLESHAPE( rxChart1Doc, getTitle, HasMainTitle ) +} + +OOX_DEFINEFUNC_GETAXISTITLESHAPE( lclGetXAxisTitleShape, XAxisXSupplier, getXAxisTitle, HasXAxisTitle ) +OOX_DEFINEFUNC_GETAXISTITLESHAPE( lclGetYAxisTitleShape, XAxisYSupplier, getYAxisTitle, HasYAxisTitle ) +OOX_DEFINEFUNC_GETAXISTITLESHAPE( lclGetZAxisTitleShape, XAxisZSupplier, getZAxisTitle, HasZAxisTitle ) +OOX_DEFINEFUNC_GETAXISTITLESHAPE( lclGetSecXAxisTitleShape, XSecondAxisTitleSupplier, getSecondXAxisTitle, HasSecondaryXAxisTitle ) +OOX_DEFINEFUNC_GETAXISTITLESHAPE( lclGetSecYAxisTitleShape, XSecondAxisTitleSupplier, getSecondYAxisTitle, HasSecondaryYAxisTitle ) + +#undef OOX_DEFINEFUNC_GETAXISTITLESHAPE +#undef OOX_IMPLEMENT_GETTITLESHAPE + +} // namespace + +struct ConverterData +{ + ObjectFormatter maFormatter; + std::map< TitleKey, TitleLayoutInfo > + maTitles; + XmlFilterBase& mrFilter; + ChartConverter& mrConverter; + Reference< XChartDocument > mxDoc; + awt::Size maSize; + + explicit ConverterData( + XmlFilterBase& rFilter, + ChartConverter& rChartConverter, + const ChartSpaceModel& rChartModel, + const Reference< XChartDocument >& rxChartDoc, + const awt::Size& rChartSize ); + ~ConverterData(); +}; + +ConverterData::ConverterData( + XmlFilterBase& rFilter, + ChartConverter& rChartConverter, + const ChartSpaceModel& rChartModel, + const Reference< XChartDocument >& rxChartDoc, + const awt::Size& rChartSize ) : + maFormatter( rFilter, rxChartDoc, rChartModel ), + mrFilter( rFilter ), + mrConverter( rChartConverter ), + mxDoc( rxChartDoc ), + maSize( rChartSize ) +{ + OSL_ENSURE( mxDoc.is(), "ConverterData::ConverterData - missing chart document" ); + // lock the model to suppress internal updates during conversion + try + { + mxDoc->lockControllers(); + } + catch( Exception& ) + { + } + + // prepare conversion of title positions + maTitles[ TitleKey( OBJECTTYPE_CHARTTITLE ) ].mpGetShape = lclGetMainTitleShape; + maTitles[ TitleKey( OBJECTTYPE_AXISTITLE, API_PRIM_AXESSET, API_X_AXIS ) ].mpGetShape = lclGetXAxisTitleShape; + maTitles[ TitleKey( OBJECTTYPE_AXISTITLE, API_PRIM_AXESSET, API_Y_AXIS ) ].mpGetShape = lclGetYAxisTitleShape; + maTitles[ TitleKey( OBJECTTYPE_AXISTITLE, API_PRIM_AXESSET, API_Z_AXIS ) ].mpGetShape = lclGetZAxisTitleShape; + maTitles[ TitleKey( OBJECTTYPE_AXISTITLE, API_SECN_AXESSET, API_X_AXIS ) ].mpGetShape = lclGetSecXAxisTitleShape; + maTitles[ TitleKey( OBJECTTYPE_AXISTITLE, API_SECN_AXESSET, API_Y_AXIS ) ].mpGetShape = lclGetSecYAxisTitleShape; +} + +ConverterData::~ConverterData() +{ + // unlock the model + try + { + mxDoc->unlockControllers(); + } + catch( Exception& ) + { + } +} + +ConverterRoot::ConverterRoot( + XmlFilterBase& rFilter, + ChartConverter& rChartConverter, + const ChartSpaceModel& rChartModel, + const Reference< XChartDocument >& rxChartDoc, + const awt::Size& rChartSize ) : + mxData( std::make_shared( rFilter, rChartConverter, rChartModel, rxChartDoc, rChartSize ) ) +{ +} + +ConverterRoot::~ConverterRoot() +{ +} + +Reference< XInterface > ConverterRoot::createInstance( const OUString& rServiceName ) const +{ + Reference< XInterface > xInt; + try + { + Reference xMSF(getComponentContext()->getServiceManager(), uno::UNO_QUERY_THROW); + + xInt = xMSF->createInstance( rServiceName ); + } + catch( Exception& ) + { + } + OSL_ENSURE( xInt.is(), "ConverterRoot::createInstance - cannot create instance" ); + return xInt; +} + +Reference< XComponentContext > const & ConverterRoot::getComponentContext() const +{ + return mxData->mrFilter.getComponentContext(); +} + +XmlFilterBase& ConverterRoot::getFilter() const +{ + return mxData->mrFilter; +} + +ChartConverter& ConverterRoot::getChartConverter() const +{ + return mxData->mrConverter; +} + +Reference< XChartDocument > const & ConverterRoot::getChartDocument() const +{ + return mxData->mxDoc; +} + +const awt::Size& ConverterRoot::getChartSize() const +{ + return mxData->maSize; +} + +ObjectFormatter& ConverterRoot::getFormatter() const +{ + return mxData->maFormatter; +} + +void ConverterRoot::registerTitleLayout( const Reference< XTitle >& rxTitle, + const ModelRef< LayoutModel >& rxLayout, ObjectType eObjType, sal_Int32 nMainIdx, sal_Int32 nSubIdx ) +{ + OSL_ENSURE( rxTitle.is(), "ConverterRoot::registerTitleLayout - missing title object" ); + TitleLayoutInfo& rTitleInfo = mxData->maTitles[ TitleKey( eObjType, nMainIdx, nSubIdx ) ]; + OSL_ENSURE( rTitleInfo.mpGetShape, "ConverterRoot::registerTitleLayout - invalid title key" ); + rTitleInfo.mxTitle = rxTitle; + rTitleInfo.mxLayout = rxLayout; +} + +void ConverterRoot::convertTitlePositions() +{ + try + { + Reference< cssc::XChartDocument > xChart1Doc( mxData->mxDoc, UNO_QUERY_THROW ); + for (auto & title : mxData->maTitles) + title.second.convertTitlePos( *this, xChart1Doc ); + } + catch( Exception& ) + { + } +} + +namespace { + +/** Returns a position value in the chart area in 1/100 mm. */ +sal_Int32 lclCalcPosition( sal_Int32 nChartSize, double fPos, sal_Int32 nPosMode ) +{ + switch( nPosMode ) + { + case XML_edge: // absolute start position as factor of chart size + return getLimitedValue< sal_Int32, double >( nChartSize * fPos + 0.5, 0, nChartSize ); + case XML_factor: // position relative to object default position + OSL_FAIL( "lclCalcPosition - relative positioning not supported" ); + return -1; + }; + + OSL_FAIL( "lclCalcPosition - unknown positioning mode" ); + return -1; +} + +/** Returns a size value in the chart area in 1/100 mm. */ +sal_Int32 lclCalcSize( sal_Int32 nPos, sal_Int32 nChartSize, double fSize, sal_Int32 nSizeMode ) +{ + sal_Int32 nValue = getLimitedValue< sal_Int32, double >( nChartSize * fSize + 0.5, 0, nChartSize ); + switch( nSizeMode ) + { + case XML_factor: // passed value is width/height + return nValue; + case XML_edge: // passed value is right/bottom position + return nValue - nPos + 1; + }; + + OSL_FAIL( "lclCalcSize - unknown size mode" ); + return -1; +} + +/** Returns a relative size value in the chart area. */ +double lclCalcRelSize( double fPos, double fSize, sal_Int32 nSizeMode ) +{ + switch( nSizeMode ) + { + case XML_factor: // passed value is width/height + break; + case XML_edge: // passed value is right/bottom position + fSize -= fPos; + break; + default: + OSL_ENSURE( false, "lclCalcRelSize - unknown size mode" ); + fSize = 0.0; + }; + return getLimitedValue< double, double >( fSize, 0.0, 1.0 - fPos ); +} + +} // namespace + +LayoutConverter::LayoutConverter( const ConverterRoot& rParent, LayoutModel& rModel ) : + ConverterBase< LayoutModel >( rParent, rModel ) +{ +} + +LayoutConverter::~LayoutConverter() +{ +} + +bool LayoutConverter::calcAbsRectangle( awt::Rectangle& orRect ) const +{ + if( !mrModel.mbAutoLayout ) + { + awt::Size aChartSize = getChartSize(); + if( aChartSize.Width <= 0 || aChartSize.Height <= 0 ) + { + aChartSize = getDefaultPageSize(); + } + orRect.X = lclCalcPosition( aChartSize.Width, mrModel.mfX, mrModel.mnXMode ); + orRect.Y = lclCalcPosition( aChartSize.Height, mrModel.mfY, mrModel.mnYMode ); + if( (orRect.X >= 0) && (orRect.Y >= 0) ) + { + orRect.Width = lclCalcSize( orRect.X, aChartSize.Width, mrModel.mfW, mrModel.mnWMode ); + orRect.Height = lclCalcSize( orRect.Y, aChartSize.Height, mrModel.mfH, mrModel.mnHMode ); + return (orRect.Width > 0) && (orRect.Height > 0); + } + } + return false; +} + +bool LayoutConverter::convertFromModel( PropertySet& rPropSet ) +{ + if( !mrModel.mbAutoLayout && + (mrModel.mnXMode == XML_edge) && (mrModel.mfX >= 0.0) && + (mrModel.mnYMode == XML_edge) && (mrModel.mfY >= 0.0) ) + { + RelativePosition aPos( + getLimitedValue< double, double >( mrModel.mfX, 0.0, 1.0 ), + getLimitedValue< double, double >( mrModel.mfY, 0.0, 1.0 ), + Alignment_TOP_LEFT ); + rPropSet.setProperty( PROP_RelativePosition, aPos ); + + RelativeSize aSize( + lclCalcRelSize( aPos.Primary, mrModel.mfW, mrModel.mnWMode ), + lclCalcRelSize( aPos.Secondary, mrModel.mfH, mrModel.mnHMode ) ); + if( (aSize.Primary > 0.0) && (aSize.Secondary > 0.0) ) + { + rPropSet.setProperty( PROP_RelativeSize, aSize ); + return true; + } + } + return false; +} + +void LayoutConverter::convertFromModel( const Reference< XShape >& rxShape, double fRotationAngle ) +{ + if( mrModel.mbAutoLayout ) + return; + + awt::Size aChartSize = getChartSize(); + if( aChartSize.Width <= 0 || aChartSize.Height <= 0 ) + { + aChartSize = getDefaultPageSize(); + } + awt::Point aShapePos( + lclCalcPosition( aChartSize.Width, mrModel.mfX, mrModel.mnXMode ), + lclCalcPosition( aChartSize.Height, mrModel.mfY, mrModel.mnYMode ) ); + if( (aShapePos.X < 0) || (aShapePos.Y < 0) ) + return; + + bool bPropSet = false; + // the call to XShape.getSize() may recalc the chart view + awt::Size aShapeSize = rxShape->getSize(); + // rotated shapes need special handling... + if( aShapeSize.Height > 0 || aShapeSize.Width > 0 ) + { + double fSin = fabs(sin(basegfx::deg2rad(fRotationAngle))); + // add part of height to X direction, if title is rotated down + if( fRotationAngle > 180.0 ) + aShapePos.X += static_cast(fSin * aShapeSize.Height + 0.5); + // add part of width to Y direction, if title is rotated up + else if( fRotationAngle > 0.0 ) + aShapePos.Y += static_cast(fSin * aShapeSize.Width + 0.5); + } + else if( fRotationAngle == 90.0 || fRotationAngle == 270.0 ) + { + PropertySet aShapeProp( rxShape ); + RelativePosition aPos( + getLimitedValue< double, double >(mrModel.mfX, 0.0, 1.0), + getLimitedValue< double, double >(mrModel.mfY, 0.0, 1.0), + fRotationAngle == 90.0 ? Alignment_TOP_RIGHT : Alignment_BOTTOM_LEFT ); + // set the resulting position at the shape + if( aShapeProp.setProperty(PROP_RelativePosition, aPos) ) + bPropSet = true; + } + // set the resulting position at the shape + if( !bPropSet ) + rxShape->setPosition( aShapePos ); +} + +} // namespace oox + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/drawingml/chart/datasourcecontext.cxx b/oox/source/drawingml/chart/datasourcecontext.cxx new file mode 100644 index 000000000..f4660f5db --- /dev/null +++ b/oox/source/drawingml/chart/datasourcecontext.cxx @@ -0,0 +1,335 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include + +#include + +#include +#include +#include +#include +#include +#include +#include + +namespace oox::drawingml::chart { + +using ::oox::core::ContextHandler2Helper; +using ::oox::core::ContextHandlerRef; + +using namespace ::com::sun::star; + +DoubleSequenceContext::DoubleSequenceContext( ContextHandler2Helper& rParent, DataSequenceModel& rModel ) : + DataSequenceContextBase( rParent, rModel ), + mnPtIndex( -1 ) +{ +} + +DoubleSequenceContext::~DoubleSequenceContext() +{ +} + +ContextHandlerRef DoubleSequenceContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ) +{ + switch( getCurrentElement() ) + { + case C_TOKEN( numRef ): + switch( nElement ) + { + case C_TOKEN( f ): + case C_TOKEN( numCache ): + return this; + } + break; + + case C_TOKEN( numCache ): + case C_TOKEN( numLit ): + switch( nElement ) + { + case C_TOKEN( formatCode ): + return this; + case C_TOKEN( ptCount ): + mrModel.mnPointCount = rAttribs.getInteger( XML_val, -1 ); + return nullptr; + case C_TOKEN( pt ): + mnPtIndex = rAttribs.getInteger( XML_idx, -1 ); + return this; + } + break; + + case C_TOKEN( pt ): + switch( nElement ) + { + case C_TOKEN( v ): + return this; + } + break; + } + return nullptr; +} + +void DoubleSequenceContext::onCharacters( const OUString& rChars ) +{ + switch( getCurrentElement() ) + { + case C_TOKEN( f ): + mrModel.maFormula = rChars; + break; + case C_TOKEN( formatCode ): + mrModel.maFormatCode = rChars; + break; + case C_TOKEN( v ): + if( mnPtIndex >= 0 ) + { + /* Import categories as String even though it could + * be values except when the format code indicates that they are dates. + * n#810508: xVal needs to be imported as double + * TODO: NumberFormat conversion, remove the check then. + */ + if( isParentElement( C_TOKEN( cat ), 4 ) ) + { + // workaround for bug n#889755 + SvNumberFormatter* pNumFrmt = getNumberFormatter(); + if( pNumFrmt ) + { + sal_uInt32 nKey = pNumFrmt->GetEntryKey( mrModel.maFormatCode ); + bool bNoKey = ( nKey == NUMBERFORMAT_ENTRY_NOT_FOUND ); + if( bNoKey ) + { + OUString aFormatCode = mrModel.maFormatCode; + sal_Int32 nCheckPos = 0; + SvNumFormatType nType; + pNumFrmt->PutEntry( aFormatCode, nCheckPos, nType, nKey ); + bNoKey = (nCheckPos != 0); + if (!bNoKey) + mrModel.meFormatType = nType; + } + if( bNoKey ) + { + mrModel.maData[ mnPtIndex ] <<= rChars; + } + else + { + double fValue = rChars.toDouble(); + if (mrModel.meFormatType == SvNumFormatType::DATE) + mrModel.maData[ mnPtIndex ] <<= fValue; + else + { + const ::Color* pColor = nullptr; + OUString aFormattedValue; + // tdf#91250: use UNLIMITED_PRECISION in case of GENERAL Number Format of category axis labels + if( pNumFrmt->GetStandardPrec() != SvNumberFormatter::UNLIMITED_PRECISION ) + pNumFrmt->ChangeStandardPrec(SvNumberFormatter::UNLIMITED_PRECISION); + pNumFrmt->GetOutputString( fValue, nKey, aFormattedValue, &pColor ); + mrModel.maData[ mnPtIndex ] <<= aFormattedValue; + } + } + } + else + { + mrModel.maData[ mnPtIndex ] <<= rChars; + } + } + else + { + mrModel.maData[ mnPtIndex ] <<= rChars.toDouble(); + } + } + break; + } +} + + +SvNumberFormatter* DoubleSequenceContext::getNumberFormatter() +{ + if( mpNumberFormatter == nullptr ) + { + uno::Reference rContext = + getFilter().getComponentContext(); + mpNumberFormatter.reset( + new SvNumberFormatter(rContext, LANGUAGE_SYSTEM) ); + } + return mpNumberFormatter.get(); +} + + +StringSequenceContext::StringSequenceContext( ContextHandler2Helper& rParent, DataSequenceModel& rModel ) + : DataSequenceContextBase( rParent, rModel ) + , mnPtIndex(-1) + , mbReadC15(false) +{ +} + +StringSequenceContext::~StringSequenceContext() +{ +} + +ContextHandlerRef StringSequenceContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ) +{ + switch( getCurrentElement() ) + { + case C_TOKEN( multiLvlStrRef ): + switch( nElement ) + { + case C_TOKEN( f ): + case C_TOKEN( multiLvlStrCache ): + return this; + } + break; + + case C15_TOKEN( datalabelsRange ): + mbReadC15 = true; + switch( nElement ) + { + case C15_TOKEN( f ): + case C15_TOKEN( dlblRangeCache ): + return this; + } + break; + + case C_TOKEN( strRef ): + switch( nElement ) + { + case C_TOKEN( f ): + case C_TOKEN( strCache ): + return this; + } + break; + + case C_TOKEN( strCache ): + case C_TOKEN( strLit ): + case C15_TOKEN( dlblRangeCache ): + if (nElement == C15_TOKEN( dlblRangeCache ) && !mbReadC15) + break; + + switch( nElement ) + { + case C_TOKEN( ptCount ): + mrModel.mnPointCount = rAttribs.getInteger( XML_val, -1 ); + return nullptr; + case C_TOKEN( pt ): + mnPtIndex = rAttribs.getInteger( XML_idx, -1 ); + return this; + } + break; + + case C_TOKEN( multiLvlStrCache ): + switch (nElement) + { + case C_TOKEN( ptCount ): + mrModel.mnPointCount = rAttribs.getInteger(XML_val, -1); + mrModel.mnLevelCount--; // normalize level count + return nullptr; + case C_TOKEN( lvl ): + mrModel.mnLevelCount++; + return this; + } + break; + + case C_TOKEN( lvl ): + switch (nElement) + { + case C_TOKEN(pt): + mnPtIndex = rAttribs.getInteger(XML_idx, -1); + return this; + } + break; + + case C_TOKEN( pt ): + switch( nElement ) + { + case C_TOKEN( v ): + return this; + } + break; + } + return nullptr; +} + +void StringSequenceContext::onCharacters( const OUString& rChars ) +{ + switch( getCurrentElement() ) + { + case C_TOKEN( f ): + mrModel.maFormula = rChars; + break; + case C15_TOKEN( f ): + if (mbReadC15) + mrModel.maFormula = rChars; + break; + case C_TOKEN( v ): + if( mnPtIndex >= 0 ) + mrModel.maData[ (mrModel.mnLevelCount-1) * mrModel.mnPointCount + mnPtIndex ] <<= rChars; + break; + } +} + +DataSourceContext::DataSourceContext( ContextHandler2Helper& rParent, DataSourceModel& rModel ) : + ContextBase< DataSourceModel >( rParent, rModel ) +{ +} + +DataSourceContext::~DataSourceContext() +{ +} + +ContextHandlerRef DataSourceContext::onCreateContext( sal_Int32 nElement, const AttributeList& ) +{ + switch( getCurrentElement() ) + { + case C_TOKEN( cat ): + case C_TOKEN( xVal ): + case C_TOKEN( ext ): + switch( nElement ) + { + case C_TOKEN( multiLvlStrRef ): + case C_TOKEN( strLit ): + case C_TOKEN( strRef ): + case C15_TOKEN( datalabelsRange ): + OSL_ENSURE( !mrModel.mxDataSeq, "DataSourceContext::onCreateContext - multiple data sequences" ); + return new StringSequenceContext( *this, mrModel.mxDataSeq.create() ); + + case C_TOKEN( numLit ): + case C_TOKEN( numRef ): + OSL_ENSURE( !mrModel.mxDataSeq, "DataSourceContext::onCreateContext - multiple data sequences" ); + return new DoubleSequenceContext( *this, mrModel.mxDataSeq.create() ); + } + break; + + case C_TOKEN( plus ): + case C_TOKEN( minus ): + case C_TOKEN( val ): + case C_TOKEN( yVal ): + case C_TOKEN( bubbleSize ): + switch( nElement ) + { + case C_TOKEN( numLit ): + case C_TOKEN( numRef ): + OSL_ENSURE( !mrModel.mxDataSeq, "DataSourceContext::onCreateContext - multiple data sequences" ); + return new DoubleSequenceContext( *this, mrModel.mxDataSeq.create() ); + } + break; + } + return nullptr; +} + +} // namespace oox::drawingml::chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/drawingml/chart/datasourceconverter.cxx b/oox/source/drawingml/chart/datasourceconverter.cxx new file mode 100644 index 000000000..92cacb428 --- /dev/null +++ b/oox/source/drawingml/chart/datasourceconverter.cxx @@ -0,0 +1,106 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include + +#include +#include +#include +#include +#include + +namespace oox::drawingml::chart { + +using namespace ::com::sun::star::chart2::data; +using namespace ::com::sun::star::uno; + +DataSequenceConverter::DataSequenceConverter( const ConverterRoot& rParent, DataSequenceModel& rModel ) : + ConverterBase< DataSequenceModel >( rParent, rModel ) +{ +} + +DataSequenceConverter::~DataSequenceConverter() +{ +} + +Reference< XDataSequence > DataSequenceConverter::createDataSequence( const OUString& rRole ) +{ + // create data sequence from data source model (virtual call at chart converter) + Reference< XDataSequence > xDataSeq; + // the internal data table does not support complex labels + // this is only supported in Calc!!! + // merge the labels into a single one + if(rRole == "label") + { + mrModel.mnPointCount = std::min(mrModel.mnPointCount, 1); + OUStringBuffer aTitle; + bool bFirst = true; + for (auto const& elem : mrModel.maData) + { + Any aAny = elem.second; + if(aAny.has()) + { + if(!bFirst) + aTitle.append(" "); + + aTitle.append(aAny.get()); + bFirst = false; + } + } + + if(!bFirst) + { + mrModel.maData.clear(); + mrModel.maData.insert(std::make_pair(0, Any(aTitle.makeStringAndClear()))); + } + } + + bool bDateCategories = (mrModel.meFormatType == SvNumFormatType::DATE) && (rRole == "categories"); + xDataSeq = getChartConverter().createDataSequence(getChartDocument()->getDataProvider(), mrModel, + rRole, bDateCategories ? OUString("date") : OUString("")); + + // set sequence role + PropertySet aSeqProp( xDataSeq ); + aSeqProp.setProperty( PROP_Role, rRole ); + return xDataSeq; +} + +DataSourceConverter::DataSourceConverter( const ConverterRoot& rParent, DataSourceModel& rModel ) : + ConverterBase< DataSourceModel >( rParent, rModel ) +{ +} + +DataSourceConverter::~DataSourceConverter() +{ +} + +Reference< XDataSequence > DataSourceConverter::createDataSequence( const OUString& rRole ) +{ + Reference< XDataSequence > xDataSeq; + if( mrModel.mxDataSeq.is() ) + { + DataSequenceConverter aDataSeqConv( *this, *mrModel.mxDataSeq ); + xDataSeq = aDataSeqConv.createDataSequence( rRole ); + } + return xDataSeq; +} + +} // namespace oox::drawingml::chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/drawingml/chart/datasourcemodel.cxx b/oox/source/drawingml/chart/datasourcemodel.cxx new file mode 100644 index 000000000..51514437d --- /dev/null +++ b/oox/source/drawingml/chart/datasourcemodel.cxx @@ -0,0 +1,46 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include +#include + +namespace oox::drawingml::chart { + +DataSequenceModel::DataSequenceModel() : + mnPointCount( -1 ), + mnLevelCount( 1 ), + meFormatType( SvNumFormatType::UNDEFINED ) +{ +} + +DataSequenceModel::~DataSequenceModel() +{ +} + +DataSourceModel::DataSourceModel() +{ +} + +DataSourceModel::~DataSourceModel() +{ +} + +} // namespace oox::drawingml::chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/drawingml/chart/datatablecontext.cxx b/oox/source/drawingml/chart/datatablecontext.cxx new file mode 100644 index 000000000..0813a6424 --- /dev/null +++ b/oox/source/drawingml/chart/datatablecontext.cxx @@ -0,0 +1,68 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include + +#include +#include +#include +#include +#include + +namespace oox::drawingml::chart +{ +using ::oox::core::ContextHandler2Helper; +using ::oox::core::ContextHandlerRef; + +DataTableContext::DataTableContext(ContextHandler2Helper& rParent, DataTableModel& rModel) + : ContextBase(rParent, rModel) +{ +} + +DataTableContext::~DataTableContext() {} + +ContextHandlerRef DataTableContext::onCreateContext(sal_Int32 nElement, + const AttributeList& rAttribs) +{ + switch (getCurrentElement()) + { + case C_TOKEN(dTable): + switch (nElement) + { + case C_TOKEN(showHorzBorder): + mrModel.mbShowHBorder = rAttribs.getBool(XML_val, false); + break; + case C_TOKEN(showVertBorder): + mrModel.mbShowVBorder = rAttribs.getBool(XML_val, false); + break; + case C_TOKEN(showOutline): + mrModel.mbShowOutline = rAttribs.getBool(XML_val, false); + break; + case C_TOKEN(showKeys): + mrModel.mbShowKeys = rAttribs.getBool(XML_val, false); + break; + } + break; + } + return nullptr; +} + +} // namespace oox::drawingml::chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/drawingml/chart/datatableconverter.cxx b/oox/source/drawingml/chart/datatableconverter.cxx new file mode 100644 index 000000000..802edc946 --- /dev/null +++ b/oox/source/drawingml/chart/datatableconverter.cxx @@ -0,0 +1,50 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include + +#include +#include +#include + +using namespace css; + +namespace oox::drawingml::chart +{ +DataTableConverter::DataTableConverter(const ConverterRoot& rParent, DataTableModel& rModel) + : ConverterBase(rParent, rModel) +{ +} + +DataTableConverter::~DataTableConverter() = default; + +void DataTableConverter::convertFromModel(uno::Reference const& rxDiagram) +{ + PropertySet aPropSet(rxDiagram); + if (mrModel.mbShowHBorder) + aPropSet.setProperty(PROP_DataTableHBorder, mrModel.mbShowHBorder); + if (mrModel.mbShowVBorder) + aPropSet.setProperty(PROP_DataTableVBorder, mrModel.mbShowVBorder); + if (mrModel.mbShowOutline) + aPropSet.setProperty(PROP_DataTableOutline, mrModel.mbShowOutline); +} + +} // namespace oox + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/drawingml/chart/modelbase.cxx b/oox/source/drawingml/chart/modelbase.cxx new file mode 100644 index 000000000..b897d9306 --- /dev/null +++ b/oox/source/drawingml/chart/modelbase.cxx @@ -0,0 +1,54 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include + +#include +#include + +namespace oox::drawingml::chart { + +NumberFormat::NumberFormat() : + mbSourceLinked( true ) +{ +} + +void NumberFormat::setAttributes( const AttributeList& rAttribs ) +{ + mbSourceLinked = rAttribs.getBool( XML_sourceLinked, true); + maFormatCode = rAttribs.getString( XML_formatCode, OUString() ); +} + +LayoutModel::LayoutModel() : + mfX( 0.0 ), + mfY( 0.0 ), + mfW( 0.0 ), + mfH( 0.0 ), + mnXMode( XML_factor ), + mnYMode( XML_factor ), + mnWMode( XML_factor ), + mnHMode( XML_factor ), + mnTarget( XML_outer ), + mbAutoLayout( true ) +{ +} + +} // namespace oox::drawingml::chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/drawingml/chart/objectformatter.cxx b/oox/source/drawingml/chart/objectformatter.cxx new file mode 100644 index 000000000..1df1c48a0 --- /dev/null +++ b/oox/source/drawingml/chart/objectformatter.cxx @@ -0,0 +1,1151 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +namespace oox::drawingml::chart { + +using namespace ::com::sun::star::chart2; +using namespace ::com::sun::star::graphic; +using namespace ::com::sun::star::lang; +using namespace ::com::sun::star::uno; +using namespace ::com::sun::star::util; + +using ::oox::core::XmlFilterBase; + +namespace { + +struct AutoFormatPatternEntry +{ + sal_Int32 mnColorToken; /// Theme color token. + sal_Int32 mnModToken; /// Color modification token. + sal_Int32 mnModValue; /// Color modification value. +}; + +#define AUTOFORMAT_PATTERN_COLOR( color_token ) \ + { color_token, XML_TOKEN_INVALID, 0 } + +#define AUTOFORMAT_PATTERN_COLORMOD( color_token, mod_token, mod_value ) \ + { color_token, mod_token, mod_value } + +#define AUTOFORMAT_PATTERN_END() \ + AUTOFORMAT_PATTERN_COLOR( XML_TOKEN_INVALID ) + +const AutoFormatPatternEntry spAutoFormatPattern1[] = +{ + AUTOFORMAT_PATTERN_COLORMOD( XML_dk1, XML_tint, 88500 ), + AUTOFORMAT_PATTERN_COLORMOD( XML_dk1, XML_tint, 55000 ), + AUTOFORMAT_PATTERN_COLORMOD( XML_dk1, XML_tint, 78000 ), + AUTOFORMAT_PATTERN_COLORMOD( XML_dk1, XML_tint, 92500 ), + AUTOFORMAT_PATTERN_COLORMOD( XML_dk1, XML_tint, 70000 ), + AUTOFORMAT_PATTERN_COLORMOD( XML_dk1, XML_tint, 30000 ), + AUTOFORMAT_PATTERN_END() +}; + +const AutoFormatPatternEntry spAutoFormatPattern2[] = +{ + AUTOFORMAT_PATTERN_COLOR( XML_accent1 ), + AUTOFORMAT_PATTERN_COLOR( XML_accent2 ), + AUTOFORMAT_PATTERN_COLOR( XML_accent3 ), + AUTOFORMAT_PATTERN_COLOR( XML_accent4 ), + AUTOFORMAT_PATTERN_COLOR( XML_accent5 ), + AUTOFORMAT_PATTERN_COLOR( XML_accent6 ), + AUTOFORMAT_PATTERN_END() +}; + +const AutoFormatPatternEntry spAutoFormatPattern3[] = +{ + AUTOFORMAT_PATTERN_COLORMOD( XML_accent1, XML_shade, 50000 ), + AUTOFORMAT_PATTERN_COLORMOD( XML_accent2, XML_shade, 50000 ), + AUTOFORMAT_PATTERN_COLORMOD( XML_accent3, XML_shade, 50000 ), + AUTOFORMAT_PATTERN_COLORMOD( XML_accent4, XML_shade, 50000 ), + AUTOFORMAT_PATTERN_COLORMOD( XML_accent5, XML_shade, 50000 ), + AUTOFORMAT_PATTERN_COLORMOD( XML_accent6, XML_shade, 50000 ), + AUTOFORMAT_PATTERN_END() +}; + +const AutoFormatPatternEntry spAutoFormatPattern4[] = +{ + AUTOFORMAT_PATTERN_COLORMOD( XML_dk1, XML_tint, 5000 ), + AUTOFORMAT_PATTERN_COLORMOD( XML_dk1, XML_tint, 55000 ), + AUTOFORMAT_PATTERN_COLORMOD( XML_dk1, XML_tint, 78000 ), + AUTOFORMAT_PATTERN_COLORMOD( XML_dk1, XML_tint, 15000 ), + AUTOFORMAT_PATTERN_COLORMOD( XML_dk1, XML_tint, 70000 ), + AUTOFORMAT_PATTERN_COLORMOD( XML_dk1, XML_tint, 30000 ), + AUTOFORMAT_PATTERN_END() +}; + +#undef AUTOFORMAT_PATTERN_COLOR +#undef AUTOFORMAT_PATTERN_COLORMOD +#undef AUTOFORMAT_PATTERN_END + +struct AutoFormatEntry +{ + sal_Int32 mnFirstStyleIdx; /// First chart style index. + sal_Int32 mnLastStyleIdx; /// Last chart style index. + sal_Int32 mnThemedIdx; /// Themed style index. + sal_Int32 mnColorToken; /// Theme color token. + sal_Int32 mnModToken; /// Color modification token. + sal_Int32 mnModValue; /// Color modification value. + sal_Int32 mnRelLineWidth; /// Relative line width (percent). + const AutoFormatPatternEntry* mpPattern;/// Color cycling pattern for data series. + bool mbFadedColor; /// True = Faded color for data series. +}; + +#define AUTOFORMAT_COLOR( first, last, themed_style, color_token ) \ + { first, last, themed_style, color_token, XML_TOKEN_INVALID, 0, 100, nullptr, false } + +#define AUTOFORMAT_COLORMOD( first, last, themed_style, color_token, mod_token, mod_value ) \ + { first, last, themed_style, color_token, mod_token, mod_value, 100, nullptr, false } + +#define AUTOFORMAT_ACCENTSMOD( first, themed_style, mod_token, mod_value ) \ + AUTOFORMAT_COLORMOD( first, first, themed_style, XML_accent1, mod_token, mod_value ), \ + AUTOFORMAT_COLORMOD( first + 1, first + 1, themed_style, XML_accent2, mod_token, mod_value ), \ + AUTOFORMAT_COLORMOD( first + 2, first + 2, themed_style, XML_accent3, mod_token, mod_value ), \ + AUTOFORMAT_COLORMOD( first + 3, first + 3, themed_style, XML_accent4, mod_token, mod_value ), \ + AUTOFORMAT_COLORMOD( first + 4, first + 4, themed_style, XML_accent5, mod_token, mod_value ), \ + AUTOFORMAT_COLORMOD( first + 5, first + 5, themed_style, XML_accent6, mod_token, mod_value ) + +#define AUTOFORMAT_PATTERN( first, last, themed_style, line_width, pattern ) \ + { first, last, themed_style, XML_TOKEN_INVALID, XML_TOKEN_INVALID, 0, line_width, pattern, false } + +#define AUTOFORMAT_FADED( first, last, themed_style, color_token, line_width ) \ + { first, last, themed_style, color_token, XML_TOKEN_INVALID, 0, line_width, nullptr, true } + +#define AUTOFORMAT_FADEDACCENTS( first, themed_style, line_width ) \ + AUTOFORMAT_FADED( first, first, themed_style, XML_accent1, line_width ), \ + AUTOFORMAT_FADED( first + 1, first + 1, themed_style, XML_accent2, line_width ), \ + AUTOFORMAT_FADED( first + 2, first + 2, themed_style, XML_accent3, line_width ), \ + AUTOFORMAT_FADED( first + 3, first + 3, themed_style, XML_accent4, line_width ), \ + AUTOFORMAT_FADED( first + 4, first + 4, themed_style, XML_accent5, line_width ), \ + AUTOFORMAT_FADED( first + 5, first + 5, themed_style, XML_accent6, line_width ) + +#define AUTOFORMAT_INVISIBLE( first, last ) \ + AUTOFORMAT_COLOR( first, last, -1, XML_TOKEN_INVALID ) + +#define AUTOFORMAT_END() \ + AUTOFORMAT_INVISIBLE( -1, -1 ) + +const AutoFormatEntry spNoFormats[] = +{ + AUTOFORMAT_INVISIBLE( 1, 48 ), + AUTOFORMAT_END() +}; + +const AutoFormatEntry spChartSpaceFill[] = +{ + AUTOFORMAT_COLOR( 1, 32, THEMED_STYLE_SUBTLE, XML_bg1 ), + AUTOFORMAT_COLOR( 33, 40, THEMED_STYLE_SUBTLE, XML_lt1 ), + AUTOFORMAT_COLOR( 41, 48, THEMED_STYLE_SUBTLE, XML_dk1 ), + AUTOFORMAT_END() +}; + +const AutoFormatEntry spDataTableLines[] = +{ + AUTOFORMAT_COLORMOD( 1, 32, THEMED_STYLE_SUBTLE, XML_tx1, XML_tint, 75000 ), + AUTOFORMAT_COLORMOD( 33, 40, THEMED_STYLE_SUBTLE, XML_dk1, XML_tint, 75000 ), + // 41...48: no line, same as Chart2 + AUTOFORMAT_END() +}; + +const AutoFormatEntry spPlotArea2dFills[] = +{ + AUTOFORMAT_COLOR( 1, 32, THEMED_STYLE_SUBTLE, XML_bg1 ), + AUTOFORMAT_COLORMOD( 33, 34, THEMED_STYLE_SUBTLE, XML_dk1, XML_tint, 20000 ), + AUTOFORMAT_ACCENTSMOD( 35, THEMED_STYLE_SUBTLE, XML_tint, 20000 ), // tint not documented!? + AUTOFORMAT_COLORMOD( 41, 48, THEMED_STYLE_SUBTLE, XML_dk1, XML_tint, 95000 ), + AUTOFORMAT_END() +}; + +const AutoFormatEntry spWallFloorLines[] = +{ + AUTOFORMAT_COLORMOD( 1, 32, THEMED_STYLE_SUBTLE, XML_tx1, XML_tint, 75000 ), + AUTOFORMAT_COLORMOD( 33, 40, THEMED_STYLE_SUBTLE, XML_dk1, XML_tint, 75000 ), + // 41...48: no line, same as Chart2 + AUTOFORMAT_END() +}; + +const AutoFormatEntry spWallFloorFills[] = +{ + AUTOFORMAT_INVISIBLE( 1, 32 ), + AUTOFORMAT_COLORMOD( 33, 34, THEMED_STYLE_SUBTLE, XML_dk1, XML_tint, 20000 ), + AUTOFORMAT_ACCENTSMOD( 35, THEMED_STYLE_SUBTLE, XML_tint, 20000 ), // tint not documented!? + AUTOFORMAT_COLORMOD( 41, 48, THEMED_STYLE_SUBTLE, XML_dk1, XML_tint, 95000 ), + AUTOFORMAT_END() +}; + +const AutoFormatEntry spAxisLines[] = +{ + AUTOFORMAT_COLORMOD( 1, 32, THEMED_STYLE_SUBTLE, XML_tx1, XML_tint, 75000 ), // tint not documented!? + AUTOFORMAT_COLORMOD( 33, 48, THEMED_STYLE_SUBTLE, XML_dk1, XML_tint, 75000 ), // tint not documented!? + AUTOFORMAT_END() +}; + +const AutoFormatEntry spMajorGridLines[] = +{ + AUTOFORMAT_COLORMOD( 1, 32, THEMED_STYLE_SUBTLE, XML_tx1, XML_tint, 75000 ), // tint not documented!? + AUTOFORMAT_COLORMOD( 33, 48, THEMED_STYLE_SUBTLE, XML_dk1, XML_tint, 75000 ), // tint not documented!? + AUTOFORMAT_END() +}; + +const AutoFormatEntry spMinorGridLines[] = +{ + AUTOFORMAT_COLORMOD( 1, 40, THEMED_STYLE_SUBTLE, XML_tx1, XML_tint, 50000 ), + AUTOFORMAT_COLORMOD( 41, 48, THEMED_STYLE_SUBTLE, XML_tx1, XML_tint, 90000 ), + AUTOFORMAT_END() +}; + +const AutoFormatEntry spOtherLines[] = +{ + AUTOFORMAT_COLOR( 1, 32, THEMED_STYLE_SUBTLE, XML_tx1 ), + AUTOFORMAT_COLOR( 33, 34, THEMED_STYLE_SUBTLE, XML_dk1 ), + AUTOFORMAT_COLORMOD( 35, 40, THEMED_STYLE_SUBTLE, XML_dk1, XML_shade, 25000 ), + AUTOFORMAT_COLOR( 41, 48, THEMED_STYLE_SUBTLE, XML_lt1 ), + AUTOFORMAT_END() +}; + +const AutoFormatEntry spLinearSeriesLines[] = +{ + AUTOFORMAT_PATTERN( 1, 1, THEMED_STYLE_SUBTLE, 300, spAutoFormatPattern1 ), + AUTOFORMAT_PATTERN( 2, 2, THEMED_STYLE_SUBTLE, 300, spAutoFormatPattern2 ), + AUTOFORMAT_FADEDACCENTS( 3, THEMED_STYLE_SUBTLE, 300 ), + AUTOFORMAT_PATTERN( 9, 9, THEMED_STYLE_SUBTLE, 500, spAutoFormatPattern1 ), + AUTOFORMAT_PATTERN( 10, 10, THEMED_STYLE_SUBTLE, 500, spAutoFormatPattern2 ), + AUTOFORMAT_FADEDACCENTS( 11, THEMED_STYLE_SUBTLE, 500 ), + AUTOFORMAT_PATTERN( 17, 17, THEMED_STYLE_SUBTLE, 500, spAutoFormatPattern1 ), + AUTOFORMAT_PATTERN( 18, 18, THEMED_STYLE_SUBTLE, 500, spAutoFormatPattern2 ), + AUTOFORMAT_FADEDACCENTS( 19, THEMED_STYLE_SUBTLE, 500 ), + AUTOFORMAT_PATTERN( 25, 25, THEMED_STYLE_SUBTLE, 700, spAutoFormatPattern1 ), + AUTOFORMAT_PATTERN( 26, 26, THEMED_STYLE_SUBTLE, 700, spAutoFormatPattern2 ), + AUTOFORMAT_FADEDACCENTS( 27, THEMED_STYLE_SUBTLE, 700 ), + AUTOFORMAT_PATTERN( 33, 33, THEMED_STYLE_SUBTLE, 500, spAutoFormatPattern1 ), + AUTOFORMAT_PATTERN( 34, 34, THEMED_STYLE_SUBTLE, 500, spAutoFormatPattern2 ), + AUTOFORMAT_FADEDACCENTS( 35, THEMED_STYLE_SUBTLE, 500 ), + AUTOFORMAT_PATTERN( 41, 42, THEMED_STYLE_SUBTLE, 500, spAutoFormatPattern4 ), + AUTOFORMAT_PATTERN( 42, 42, THEMED_STYLE_SUBTLE, 500, spAutoFormatPattern2 ), + AUTOFORMAT_FADEDACCENTS( 43, THEMED_STYLE_SUBTLE, 500 ), + AUTOFORMAT_END() +}; + +const AutoFormatEntry spFilledSeriesLines[] = +{ + AUTOFORMAT_INVISIBLE( 1, 8 ), + AUTOFORMAT_COLOR( 9, 16, THEMED_STYLE_SUBTLE, XML_lt1 ), + AUTOFORMAT_INVISIBLE( 17, 32 ), + AUTOFORMAT_COLORMOD( 33, 33, THEMED_STYLE_SUBTLE, XML_dk1, XML_shade, 50000 ), + AUTOFORMAT_PATTERN( 34, 34, THEMED_STYLE_SUBTLE, 100, spAutoFormatPattern3 ), + AUTOFORMAT_ACCENTSMOD( 35, THEMED_STYLE_SUBTLE, XML_shade, 50000 ), + AUTOFORMAT_INVISIBLE( 41, 48 ), + AUTOFORMAT_END() +}; + +const AutoFormatEntry spFilledSeries2dFills[] = +{ + AUTOFORMAT_PATTERN( 1, 1, THEMED_STYLE_SUBTLE, 100, spAutoFormatPattern1 ), + AUTOFORMAT_PATTERN( 2, 2, THEMED_STYLE_SUBTLE, 100, spAutoFormatPattern2 ), + AUTOFORMAT_FADEDACCENTS( 3, THEMED_STYLE_SUBTLE, 100 ), + AUTOFORMAT_PATTERN( 9, 9, THEMED_STYLE_SUBTLE, 100, spAutoFormatPattern1 ), + AUTOFORMAT_PATTERN( 10, 10, THEMED_STYLE_SUBTLE, 100, spAutoFormatPattern2 ), + AUTOFORMAT_FADEDACCENTS( 11, THEMED_STYLE_SUBTLE, 100 ), + AUTOFORMAT_PATTERN( 17, 17, THEMED_STYLE_INTENSE, 100, spAutoFormatPattern1 ), + AUTOFORMAT_PATTERN( 18, 18, THEMED_STYLE_INTENSE, 100, spAutoFormatPattern2 ), + AUTOFORMAT_FADEDACCENTS( 19, THEMED_STYLE_INTENSE, 100 ), + AUTOFORMAT_PATTERN( 25, 25, THEMED_STYLE_INTENSE, 100, spAutoFormatPattern1 ), + AUTOFORMAT_PATTERN( 26, 26, THEMED_STYLE_INTENSE, 100, spAutoFormatPattern2 ), + AUTOFORMAT_FADEDACCENTS( 27, THEMED_STYLE_INTENSE, 100 ), + AUTOFORMAT_PATTERN( 33, 33, THEMED_STYLE_SUBTLE, 100, spAutoFormatPattern1 ), + AUTOFORMAT_PATTERN( 34, 34, THEMED_STYLE_SUBTLE, 100, spAutoFormatPattern2 ), + AUTOFORMAT_FADEDACCENTS( 35, THEMED_STYLE_SUBTLE, 100 ), + AUTOFORMAT_PATTERN( 41, 42, THEMED_STYLE_INTENSE, 100, spAutoFormatPattern4 ), + AUTOFORMAT_PATTERN( 42, 42, THEMED_STYLE_INTENSE, 100, spAutoFormatPattern2 ), + AUTOFORMAT_FADEDACCENTS( 43, THEMED_STYLE_INTENSE, 100 ), + AUTOFORMAT_END() +}; + +const AutoFormatEntry spFilledSeries3dFills[] = +{ + AUTOFORMAT_PATTERN( 1, 1, THEMED_STYLE_SUBTLE, 100, spAutoFormatPattern1 ), + AUTOFORMAT_PATTERN( 2, 2, THEMED_STYLE_SUBTLE, 100, spAutoFormatPattern2 ), + AUTOFORMAT_FADEDACCENTS( 3, THEMED_STYLE_SUBTLE, 100 ), + AUTOFORMAT_PATTERN( 9, 9, THEMED_STYLE_SUBTLE, 100, spAutoFormatPattern1 ), + AUTOFORMAT_PATTERN( 10, 10, THEMED_STYLE_SUBTLE, 100, spAutoFormatPattern2 ), + AUTOFORMAT_FADEDACCENTS( 11, THEMED_STYLE_SUBTLE, 100 ), + AUTOFORMAT_PATTERN( 17, 17, THEMED_STYLE_SUBTLE, 100, spAutoFormatPattern1 ), + AUTOFORMAT_PATTERN( 18, 18, THEMED_STYLE_INTENSE, 100, spAutoFormatPattern2 ), + AUTOFORMAT_FADEDACCENTS( 19, THEMED_STYLE_SUBTLE, 100 ), + AUTOFORMAT_PATTERN( 25, 25, THEMED_STYLE_SUBTLE, 100, spAutoFormatPattern1 ), + AUTOFORMAT_PATTERN( 26, 26, THEMED_STYLE_INTENSE, 100, spAutoFormatPattern2 ), + AUTOFORMAT_FADEDACCENTS( 27, THEMED_STYLE_SUBTLE, 100 ), + AUTOFORMAT_PATTERN( 33, 33, THEMED_STYLE_SUBTLE, 100, spAutoFormatPattern1 ), + AUTOFORMAT_PATTERN( 34, 34, THEMED_STYLE_SUBTLE, 100, spAutoFormatPattern2 ), + AUTOFORMAT_FADEDACCENTS( 35, THEMED_STYLE_SUBTLE, 100 ), + AUTOFORMAT_PATTERN( 41, 42, THEMED_STYLE_SUBTLE, 100, spAutoFormatPattern4 ), + AUTOFORMAT_PATTERN( 42, 42, THEMED_STYLE_INTENSE, 100, spAutoFormatPattern2 ), + AUTOFORMAT_FADEDACCENTS( 43, THEMED_STYLE_SUBTLE, 100 ), + AUTOFORMAT_END() +}; + +const AutoFormatEntry spUpDownBarLines[] = +{ + AUTOFORMAT_COLOR( 1, 16, THEMED_STYLE_SUBTLE, XML_tx1 ), + AUTOFORMAT_INVISIBLE( 17, 32 ), + AUTOFORMAT_COLOR( 33, 34, THEMED_STYLE_SUBTLE, XML_dk1 ), + AUTOFORMAT_ACCENTSMOD( 35, THEMED_STYLE_SUBTLE, XML_shade, 25000 ), + AUTOFORMAT_INVISIBLE( 41, 48 ), + AUTOFORMAT_END() +}; + +const AutoFormatEntry spUpBarFills[] = +{ + AUTOFORMAT_COLORMOD( 1, 1, THEMED_STYLE_SUBTLE, XML_dk1, XML_tint, 25000 ), + AUTOFORMAT_COLORMOD( 2, 2, THEMED_STYLE_SUBTLE, XML_dk1, XML_tint, 5000 ), + AUTOFORMAT_ACCENTSMOD( 3, THEMED_STYLE_SUBTLE, XML_tint, 25000 ), + AUTOFORMAT_COLORMOD( 9, 9, THEMED_STYLE_SUBTLE, XML_dk1, XML_tint, 25000 ), + AUTOFORMAT_COLORMOD( 10, 10, THEMED_STYLE_SUBTLE, XML_dk1, XML_tint, 5000 ), + AUTOFORMAT_ACCENTSMOD( 11, THEMED_STYLE_SUBTLE, XML_tint, 25000 ), + AUTOFORMAT_COLORMOD( 17, 17, THEMED_STYLE_INTENSE, XML_dk1, XML_tint, 25000 ), + AUTOFORMAT_COLORMOD( 18, 18, THEMED_STYLE_INTENSE, XML_dk1, XML_tint, 5000 ), + AUTOFORMAT_ACCENTSMOD( 19, THEMED_STYLE_INTENSE, XML_tint, 25000 ), + AUTOFORMAT_COLORMOD( 25, 25, THEMED_STYLE_INTENSE, XML_dk1, XML_tint, 25000 ), + AUTOFORMAT_COLORMOD( 26, 26, THEMED_STYLE_INTENSE, XML_dk1, XML_tint, 5000 ), + AUTOFORMAT_ACCENTSMOD( 27, THEMED_STYLE_INTENSE, XML_tint, 25000 ), + AUTOFORMAT_COLOR( 33, 40, THEMED_STYLE_SUBTLE, XML_lt1 ), + AUTOFORMAT_COLORMOD( 41, 41, THEMED_STYLE_INTENSE, XML_dk1, XML_tint, 25000 ), + AUTOFORMAT_COLOR( 42, 42, THEMED_STYLE_INTENSE, XML_lt1 ), + AUTOFORMAT_ACCENTSMOD( 43, THEMED_STYLE_INTENSE, XML_tint, 25000 ), + AUTOFORMAT_END() +}; + +const AutoFormatEntry spDownBarFills[] = +{ + AUTOFORMAT_COLORMOD( 1, 1, THEMED_STYLE_SUBTLE, XML_dk1, XML_tint, 85000 ), + AUTOFORMAT_COLORMOD( 2, 2, THEMED_STYLE_SUBTLE, XML_dk1, XML_tint, 95000 ), + AUTOFORMAT_ACCENTSMOD( 3, THEMED_STYLE_SUBTLE, XML_shade, 25000 ), + AUTOFORMAT_COLORMOD( 9, 9, THEMED_STYLE_SUBTLE, XML_dk1, XML_tint, 85000 ), + AUTOFORMAT_COLORMOD( 10, 10, THEMED_STYLE_SUBTLE, XML_dk1, XML_tint, 95000 ), + AUTOFORMAT_ACCENTSMOD( 11, THEMED_STYLE_SUBTLE, XML_shade, 25000 ), + AUTOFORMAT_COLORMOD( 17, 17, THEMED_STYLE_INTENSE, XML_dk1, XML_tint, 85000 ), + AUTOFORMAT_COLORMOD( 18, 18, THEMED_STYLE_INTENSE, XML_dk1, XML_tint, 95000 ), + AUTOFORMAT_ACCENTSMOD( 19, THEMED_STYLE_INTENSE, XML_shade, 25000 ), + AUTOFORMAT_COLORMOD( 25, 25, THEMED_STYLE_INTENSE, XML_dk1, XML_tint, 85000 ), + AUTOFORMAT_COLORMOD( 26, 26, THEMED_STYLE_INTENSE, XML_dk1, XML_tint, 95000 ), + AUTOFORMAT_ACCENTSMOD( 27, THEMED_STYLE_INTENSE, XML_shade, 25000 ), + AUTOFORMAT_COLORMOD( 33, 33, THEMED_STYLE_SUBTLE, XML_dk1, XML_tint, 85000 ), + AUTOFORMAT_COLORMOD( 34, 34, THEMED_STYLE_SUBTLE, XML_dk1, XML_tint, 95000 ), + AUTOFORMAT_ACCENTSMOD( 35, THEMED_STYLE_SUBTLE, XML_shade, 25000 ), + AUTOFORMAT_COLORMOD( 41, 41, THEMED_STYLE_INTENSE, XML_dk1, XML_tint, 85000 ), + AUTOFORMAT_COLOR( 42, 42, THEMED_STYLE_INTENSE, XML_dk1 ), + AUTOFORMAT_ACCENTSMOD( 43, THEMED_STYLE_INTENSE, XML_shade, 25000 ), + AUTOFORMAT_END() +}; + +#undef AUTOFORMAT_COLOR +#undef AUTOFORMAT_COLORMOD +#undef AUTOFORMAT_ACCENTSMOD +#undef AUTOFORMAT_PATTERN +#undef AUTOFORMAT_FADED +#undef AUTOFORMAT_FADEDACCENTS +#undef AUTOFORMAT_INVISIBLE +#undef AUTOFORMAT_END + +const AutoFormatEntry* lclGetAutoFormatEntry( const AutoFormatEntry* pEntries, sal_Int32 nStyle ) +{ + for( ; pEntries && (pEntries->mnFirstStyleIdx >= 0); ++pEntries ) + if( (pEntries->mnFirstStyleIdx <= nStyle) && (nStyle <= pEntries->mnLastStyleIdx) ) + return pEntries; + return nullptr; +} + +struct AutoTextEntry +{ + sal_Int32 mnFirstStyleIdx; /// First chart style index. + sal_Int32 mnLastStyleIdx; /// Last chart style index. + sal_Int32 mnThemedFont; /// Themed font (minor/major). + sal_Int32 mnColorToken; /// Theme color token. + sal_Int32 mnDefFontSize; /// Default font size (1/100 points). + sal_Int32 mnRelFontSize; /// Font size relative to chart global font (percent). + bool mbBold; /// True = bold font. +}; + +#define AUTOTEXT_COLOR( first, last, themed_font, color_token, def_font_size, rel_font_size, bold ) \ + { first, last, themed_font, color_token, def_font_size, rel_font_size, bold } + +#define AUTOTEXT_END() \ + AUTOTEXT_COLOR( -1, -1, XML_none, XML_TOKEN_INVALID, 1000, 100, false ) + +const AutoTextEntry spChartTitleTexts[] = +{ + AUTOTEXT_COLOR( 1, 40, XML_minor, XML_tx1, 1800, 120, true ), + AUTOTEXT_COLOR( 41, 48, XML_minor, XML_lt1, 1800, 120, true ), + AUTOTEXT_END() +}; + +const AutoTextEntry spAxisTitleTexts[] = +{ + AUTOTEXT_COLOR( 1, 40, XML_minor, XML_tx1, 1000, 100, true ), + AUTOTEXT_COLOR( 41, 48, XML_minor, XML_lt1, 1000, 100, true ), + AUTOTEXT_END() +}; + +const AutoTextEntry spOtherTexts[] = +{ + AUTOTEXT_COLOR( 1, 40, XML_minor, XML_tx1, 1000, 100, false ), + AUTOTEXT_COLOR( 41, 48, XML_minor, XML_lt1, 1000, 100, false ), + AUTOTEXT_END() +}; + +#undef AUTOTEXT_COLOR +#undef AUTOTEXT_END + +const AutoTextEntry* lclGetAutoTextEntry( const AutoTextEntry* pEntries, sal_Int32 nStyle ) +{ + for( ; pEntries && (pEntries->mnFirstStyleIdx >= 0); ++pEntries ) + if( (pEntries->mnFirstStyleIdx <= nStyle) && (nStyle <= pEntries->mnLastStyleIdx) ) + return pEntries; + return nullptr; +} + +// These PropIds arrays will be indexed into using a ShapeProperty enum + +const ShapePropertyIds spnCommonPropIds = +{ + PROP_LineStyle, PROP_LineWidth, PROP_LineColor, PROP_LineTransparence, PROP_LineDashName, + PROP_LineCap, PROP_INVALID, PROP_INVALID, PROP_INVALID, PROP_INVALID, PROP_INVALID, PROP_INVALID, PROP_INVALID, + PROP_FillStyle, PROP_FillColor, PROP_FillTransparence, PROP_FillTransparenceGradientName, PROP_FillGradientName, + PROP_FillBitmapName, PROP_FillBitmapMode, PROP_FillBitmapSizeX, PROP_FillBitmapSizeY, + PROP_FillBitmapPositionOffsetX, PROP_FillBitmapPositionOffsetY, PROP_FillBitmapRectanglePoint, + PROP_FillHatchName, PROP_FillBackground +}; + +const ShapePropertyIds spnLinearPropIds = +{ + PROP_LineStyle, PROP_LineWidth, PROP_Color, PROP_Transparency, PROP_LineDashName, + PROP_LineCap, PROP_INVALID, PROP_INVALID, PROP_INVALID, PROP_INVALID, PROP_INVALID, PROP_INVALID, PROP_INVALID, + PROP_INVALID, PROP_INVALID, PROP_INVALID, PROP_INVALID, PROP_INVALID, + PROP_INVALID, PROP_INVALID, PROP_INVALID, PROP_INVALID, + PROP_INVALID, PROP_INVALID, PROP_INVALID, + PROP_INVALID, PROP_INVALID +}; + +const ShapePropertyIds spnFilledPropIds = +{ + PROP_BorderStyle, + PROP_BorderWidth, + PROP_BorderColor, + PROP_BorderTransparency, + PROP_BorderDashName, + PROP_LineCap, + PROP_INVALID, + PROP_INVALID, + PROP_INVALID, + PROP_INVALID, + PROP_INVALID, + PROP_INVALID, + PROP_INVALID, + PROP_FillStyle, + PROP_Color, + PROP_Transparency, + PROP_FillTransparenceGradientName, + PROP_GradientName, + PROP_FillBitmapName, + PROP_FillBitmapMode, + PROP_FillBitmapSizeX, + PROP_FillBitmapSizeY, + PROP_FillBitmapPositionOffsetX, + PROP_FillBitmapPositionOffsetY, + PROP_FillBitmapRectanglePoint, + PROP_HatchName, + PROP_FillBackground +}; + +/** Property info for common chart objects, to be used in ShapePropertyMap. */ +const ShapePropertyInfo saCommonPropInfo( spnCommonPropIds, false, true, true, true, true ); +/** Property info for linear data series, to be used in ShapePropertyMap. */ +const ShapePropertyInfo saLinearPropInfo( spnLinearPropIds, false, true, true, true, true ); +/** Property info for filled data series, to be used in ShapePropertyMap. */ +const ShapePropertyInfo saFilledPropInfo( spnFilledPropIds, false, true, true, true, true ); + +/** Contains information about formatting of a specific chart object type. */ +struct ObjectTypeFormatEntry +{ + ObjectType meObjType; /// Object type for automatic format. + const ShapePropertyInfo& mrPropInfo; /// Property info for the ShapePropertyMap class. + const AutoFormatEntry* mpAutoLines; /// Automatic line formatting for all chart styles. + const AutoFormatEntry* mpAutoFills; /// Automatic fill formatting for all chart styles. + const AutoTextEntry* mpAutoTexts; /// Automatic text attributes for all chart styles. + bool mbIsFrame; /// True = object is a frame, false = object is a line. + ObjectTypeFormatEntry(ObjectType eObjType, const ShapePropertyInfo& rPropInfo, + const AutoFormatEntry* pAutoLines, + const AutoFormatEntry* pAutoFills, + const AutoTextEntry* pAutoTexts, + bool bIsFrame) + :meObjType(eObjType), mrPropInfo(rPropInfo), mpAutoLines(pAutoLines) + ,mpAutoFills(pAutoFills), mpAutoTexts(pAutoTexts), mbIsFrame(bIsFrame) + {} // prevent creation of implicit default ctor which fails in MSVC +}; + +#define TYPEFORMAT_FRAME( obj_type, prop_type, auto_texts, auto_lines, auto_fills ) \ + { obj_type, prop_type, auto_lines, auto_fills, auto_texts, true } + +#define TYPEFORMAT_LINE( obj_type, prop_type, auto_texts, auto_lines ) \ + { obj_type, prop_type, auto_lines, nullptr, auto_texts, false } + +const ObjectTypeFormatEntry spObjTypeFormatEntries[] = +{ + // object type property info auto text auto line auto fill + TYPEFORMAT_FRAME( OBJECTTYPE_CHARTSPACE, saCommonPropInfo, nullptr, spNoFormats, spChartSpaceFill ), + TYPEFORMAT_FRAME( OBJECTTYPE_CHARTTITLE, saCommonPropInfo, spChartTitleTexts, nullptr /* eq to Ch2 */, nullptr /* eq to Ch2 */), + TYPEFORMAT_FRAME( OBJECTTYPE_LEGEND, saCommonPropInfo, spOtherTexts, spNoFormats, spNoFormats ), + TYPEFORMAT_FRAME( OBJECTTYPE_PLOTAREA2D, saCommonPropInfo, nullptr, nullptr /* eq to Ch2 */, spPlotArea2dFills ), + TYPEFORMAT_FRAME( OBJECTTYPE_PLOTAREA3D, saCommonPropInfo, nullptr, nullptr /* eq to Ch2 */, nullptr /* eq to Ch2 */ ), + TYPEFORMAT_FRAME( OBJECTTYPE_WALL, saCommonPropInfo, nullptr, spWallFloorLines, spWallFloorFills ), + TYPEFORMAT_FRAME( OBJECTTYPE_FLOOR, saCommonPropInfo, nullptr, spWallFloorLines, spWallFloorFills ), + TYPEFORMAT_LINE( OBJECTTYPE_AXIS, saCommonPropInfo, spOtherTexts, spAxisLines ), + TYPEFORMAT_FRAME( OBJECTTYPE_AXISTITLE, saCommonPropInfo, spAxisTitleTexts, nullptr /* eq to Ch2 */, nullptr /* eq to Ch2 */ ), + TYPEFORMAT_FRAME( OBJECTTYPE_AXISUNIT, saCommonPropInfo, spAxisTitleTexts, nullptr /* eq in Ch2 */, nullptr /* eq in Ch2 */ ), + TYPEFORMAT_LINE( OBJECTTYPE_MAJORGRIDLINE, saCommonPropInfo, nullptr, spMajorGridLines ), + TYPEFORMAT_LINE( OBJECTTYPE_MINORGRIDLINE, saCommonPropInfo, nullptr, spMinorGridLines ), + TYPEFORMAT_LINE( OBJECTTYPE_LINEARSERIES2D, saLinearPropInfo, nullptr, spLinearSeriesLines ), + TYPEFORMAT_FRAME( OBJECTTYPE_FILLEDSERIES2D, saFilledPropInfo, nullptr, spFilledSeriesLines, spFilledSeries2dFills ), + TYPEFORMAT_FRAME( OBJECTTYPE_FILLEDSERIES3D, saFilledPropInfo, nullptr, spFilledSeriesLines, spFilledSeries3dFills ), + TYPEFORMAT_FRAME( OBJECTTYPE_DATALABEL, saCommonPropInfo, spOtherTexts, nullptr /* eq to Ch2 */, nullptr /* eq to Ch2 */ ), + TYPEFORMAT_LINE( OBJECTTYPE_TRENDLINE, saCommonPropInfo, nullptr, spOtherLines ), + TYPEFORMAT_FRAME( OBJECTTYPE_TRENDLINELABEL, saCommonPropInfo, spOtherTexts, nullptr /* eq to Ch2 */, nullptr /* eq to Ch2 */ ), + TYPEFORMAT_LINE( OBJECTTYPE_ERRORBAR, saCommonPropInfo, nullptr, spOtherLines ), + TYPEFORMAT_LINE( OBJECTTYPE_SERLINE, saCommonPropInfo, nullptr, spOtherLines ), + TYPEFORMAT_LINE( OBJECTTYPE_LEADERLINE, saCommonPropInfo, nullptr, spOtherLines ), + TYPEFORMAT_LINE( OBJECTTYPE_DROPLINE, saCommonPropInfo, nullptr, spOtherLines ), + TYPEFORMAT_LINE( OBJECTTYPE_HILOLINE, saLinearPropInfo, nullptr, spOtherLines ), + TYPEFORMAT_FRAME( OBJECTTYPE_UPBAR, saCommonPropInfo, nullptr, spUpDownBarLines, spUpBarFills ), + TYPEFORMAT_FRAME( OBJECTTYPE_DOWNBAR, saCommonPropInfo, nullptr, spUpDownBarLines, spDownBarFills ), + TYPEFORMAT_LINE( OBJECTTYPE_DATATABLE, saCommonPropInfo, spOtherTexts, spDataTableLines ) +}; + +#undef TYPEFORMAT_FRAME +#undef TYPEFORMAT_LINE + +void lclConvertPictureOptions( FillProperties& orFillProps, const PictureOptionsModel& rPicOptions ) +{ + bool bStacked = (rPicOptions.mnPictureFormat == XML_stack) || (rPicOptions.mnPictureFormat == XML_stackScale); + orFillProps.maBlipProps.moBitmapMode = bStacked ? XML_tile : XML_stretch; +} + +} // namespace + +struct ObjectFormatterData; + +namespace { + +class DetailFormatterBase +{ +public: + explicit DetailFormatterBase( + ObjectFormatterData& rData, + const AutoFormatEntry* pAutoFormatEntry ); + explicit DetailFormatterBase( + ObjectFormatterData& rData, + const AutoTextEntry* pAutoTextEntry ); + +protected: + /** Returns the placeholder color which may depend on the passed series index. */ + ::Color getPhColor( sal_Int32 nSeriesIdx ) const; + +private: + /** Resolves and returns the scheme color with the passed transformation. */ + ::Color getSchemeColor( sal_Int32 nColorToken, sal_Int32 nModToken, sal_Int32 nModValue ) const; + +protected: + typedef ::std::vector< ::Color > ColorPatternVec; + + ObjectFormatterData& mrData; /// Shared formatter data. + ::Color mnPhClr; /// RGB placeholder color for themed style. + ColorPatternVec maColorPattern; /// Different cycling colors for data series. +}; + +class LineFormatter : public DetailFormatterBase +{ +public: + explicit LineFormatter( + ObjectFormatterData& rData, + const AutoFormatEntry* pAutoFormatEntry, + const ObjectType eObjType ); + + /** Converts line formatting to the passed property set. */ + void convertFormatting( + ShapePropertyMap& rPropMap, + const ModelRef< Shape >& rxShapeProp, + sal_Int32 nSeriesIdx ); + +private: + LinePropertiesPtr mxAutoLine; /// Automatic line properties. +}; + +class FillFormatter : public DetailFormatterBase +{ +public: + explicit FillFormatter( + ObjectFormatterData& rData, + const AutoFormatEntry* pAutoFormatEntry, + const ObjectType eObjType ); + + /** Converts area formatting to the passed property set. */ + void convertFormatting( + ShapePropertyMap& rPropMap, + const ModelRef< Shape >& rxShapeProp, + const PictureOptionsModel* pPicOptions, + sal_Int32 nSeriesIdx ); + +private: + FillPropertiesPtr mxAutoFill; /// Automatic fill properties. +}; + +class TextFormatter : public DetailFormatterBase +{ +public: + explicit TextFormatter( + ObjectFormatterData& rData, + const AutoTextEntry* pAutoTextEntry, + const ModelRef< TextBody >& rxGlobalTextProp ); + + /** Converts text formatting to the passed property set. */ + void convertFormatting( + PropertySet& rPropSet, + const TextCharacterProperties* pTextProps ); + /** Converts text formatting to the passed property set. */ + void convertFormatting( + PropertySet& rPropSet, + const ModelRef< TextBody >& rxTextProp ); + +private: + TextCharacterPropertiesPtr mxAutoText; /// Automatic text properties. +}; + +/** Formatter for a specific object type. */ +class ObjectTypeFormatter +{ +public: + explicit ObjectTypeFormatter( + ObjectFormatterData& rData, + const ObjectTypeFormatEntry& rEntry, + const ChartSpaceModel& rChartSpace, + const ObjectType eObjType ); + + /** Sets frame formatting properties to the passed property set. */ + void convertFrameFormatting( + PropertySet& rPropSet, + const ModelRef< Shape >& rxShapeProp, + const PictureOptionsModel* pPicOptions, + sal_Int32 nSeriesIdx ); + + /** Sets text formatting properties to the passed property set. */ + void convertTextFormatting( + PropertySet& rPropSet, + const ModelRef< TextBody >& rxTextProp ); + + /** Sets frame/text formatting properties to the passed property set. */ + void convertFormatting( + PropertySet& rPropSet, + const ModelRef< Shape >& rxShapeProp, + const ModelRef< TextBody >& rxTextProp ); + + /** Sets text formatting properties to the passed property set. */ + void convertTextFormatting( + PropertySet& rPropSet, + const TextCharacterProperties& rTextProps ); + + /** Sets automatic fill properties to the passed property set. */ + void convertAutomaticFill( + PropertySet& rPropSet, + sal_Int32 nSeriesIdx ); + +private: + LineFormatter maLineFormatter; /// Converter for line formatting. + FillFormatter maFillFormatter; /// Converter for fill formatting. + TextFormatter maTextFormatter; /// Converter for text formatting. + ModelObjectHelper& mrModelObjHelper; /// Helper for named drawing formatting. + const ObjectTypeFormatEntry& mrEntry; /// Additional settings. +}; + +} + +struct ObjectFormatterData +{ + typedef RefMap< ObjectType, ObjectTypeFormatter > ObjectTypeFormatterMap; + + const XmlFilterBase& mrFilter; /// Base filter object. + ObjectTypeFormatterMap maTypeFormatters; /// Formatters for all types of objects in a chart. + ModelObjectHelper maModelObjHelper; /// Helper for named drawing formatting (dashes, gradients, bitmaps). + Reference< XNumberFormats > mxNumFmts; /// Number formats collection of container document. + Reference< XNumberFormatTypes > mxNumTypes; /// Number format types collection of container document. + Locale maEnUsLocale; /// Locale struct containing en-US. + Locale maFromLocale; /// Empty locale struct. + sal_Int32 mnMaxSeriesIdx; /// Maximum series index used for color cycling/fading. + + explicit ObjectFormatterData( + const XmlFilterBase& rFilter, + const Reference< XChartDocument >& rxChartDoc, + const ChartSpaceModel& rChartSpace ); + + ObjectTypeFormatter* getTypeFormatter( ObjectType eObjType ); +}; + +DetailFormatterBase::DetailFormatterBase( ObjectFormatterData& rData, const AutoFormatEntry* pAutoFormatEntry ) : + mrData( rData ), + mnPhClr( ColorTransparency, 0xffffffff ) +{ + if( !pAutoFormatEntry ) + return; + + if( pAutoFormatEntry->mpPattern ) + { + // prepare multi-color pattern + for( const AutoFormatPatternEntry* pPatternEntry = pAutoFormatEntry->mpPattern; pPatternEntry->mnColorToken != XML_TOKEN_INVALID; ++pPatternEntry ) + maColorPattern.push_back( getSchemeColor( pPatternEntry->mnColorToken, pPatternEntry->mnModToken, pPatternEntry->mnModValue ) ); + } + else if( pAutoFormatEntry->mnColorToken != XML_TOKEN_INVALID ) + { + // prepare color or single-color pattern (color fading) + mnPhClr = getSchemeColor( pAutoFormatEntry->mnColorToken, pAutoFormatEntry->mnModToken, pAutoFormatEntry->mnModValue ); + if( pAutoFormatEntry->mbFadedColor ) + maColorPattern.push_back( mnPhClr ); + } +} + +DetailFormatterBase::DetailFormatterBase( ObjectFormatterData& rData, const AutoTextEntry* pAutoTextEntry ) : + mrData( rData ), + mnPhClr( ColorTransparency, 0xffffffff ) +{ + if( pAutoTextEntry && (pAutoTextEntry->mnColorToken != XML_TOKEN_INVALID) ) + mnPhClr = getSchemeColor( pAutoTextEntry->mnColorToken, XML_TOKEN_INVALID, 0 ); +} + +::Color DetailFormatterBase::getPhColor( sal_Int32 nSeriesIdx ) const +{ + if( maColorPattern.empty() || (mrData.mnMaxSeriesIdx < 0) || (nSeriesIdx < 0) ) + return mnPhClr; + + /* Apply tint/shade depending on the cycle index. The colors of leading + series are darkened (color shade), the colors of trailing series are + lightened (color tint). Shade/tint is applied in an exclusive range of + -70% to 70%. + + Example 1: 3 data series using single-color shading with accent color 1 + (e.g. automatic chart style #3). Shade/tint is applied per series. + Shade/tint changes in steps of 140%/( Not used. + Step 2: -35% -> Series 1 has 35% shade of accent color 1. + Step 3: 0% -> Series 2 has pure accent color 1. + Step 4: 35% -> Series 3 has 35% tint of accent color 1. + Step 5: 70% -> Not used. + + Example 2: 20 data series using accent color pattern (e.g. automatic + chart style #2). Each color cycle has a size of 6 series (accent colors + 1 to 6). Shade/tint is applied per color cycle. + Cycle #1: Series 1...6 are based on accent colors 1 to 6. + Cycle #2: Series 7...12 are based on accent colors 1 to 6. + Cycle #3: Series 13...18 are based on accent colors 1 to 6. + Cycle #4: Series 19...20 are based on accent colors 1 to 2. + Shade/tint changes in steps of 140%/(cycle_count+1) = 140%/5 = 28%, + starting at -70%: + Step 1: -70% -> Not used. + Step 2: -42% -> Cycle #1 has 42% shade of accent colors 1...6 + step 3: -14% -> Cycle #2 has 14% shade of accent colors 1...6 + step 4: 14% -> Cycle #3 has 14% tint of accent colors 1...6 + step 5: 42% -> Cycle #4 has 42% tint of accent colors 1...6 + step 6: 70% -> Not used. + */ + ::Color nPhClr = maColorPattern[ static_cast< size_t >( nSeriesIdx % maColorPattern.size() ) ]; + size_t nCycleIdx = static_cast< size_t >( nSeriesIdx / maColorPattern.size() ); + size_t nMaxCycleIdx = static_cast< size_t >( mrData.mnMaxSeriesIdx / maColorPattern.size() ); + double fShadeTint = static_cast< double >( nCycleIdx + 1 ) / (nMaxCycleIdx + 2) * 1.4 - 0.7; + if( fShadeTint != 0.0 ) + { + Color aColor; + aColor.setSrgbClr( nPhClr ); + aColor.addChartTintTransformation( fShadeTint ); + nPhClr = aColor.getColor( mrData.mrFilter.getGraphicHelper() ); + } + + return nPhClr; +} + +::Color DetailFormatterBase::getSchemeColor( sal_Int32 nColorToken, sal_Int32 nModToken, sal_Int32 nModValue ) const +{ + Color aColor; + aColor.setSchemeClr( nColorToken ); + if( nModToken != XML_TOKEN_INVALID ) + aColor.addTransformation( nModToken, nModValue ); + return aColor.getColor( mrData.mrFilter.getGraphicHelper() ); +} + +LineFormatter::LineFormatter( ObjectFormatterData& rData, const AutoFormatEntry* pAutoFormatEntry, const ObjectType eObjType ) : + DetailFormatterBase(rData, pAutoFormatEntry) +{ + if( !pAutoFormatEntry ) + return; + + mxAutoLine = std::make_shared(); + mxAutoLine->maLineFill.moFillType = XML_noFill; + if( const Theme* pTheme = mrData.mrFilter.getCurrentTheme() ) + if( const LineProperties* pLineProps = pTheme->getLineStyle( pAutoFormatEntry->mnThemedIdx ) ) + *mxAutoLine = *pLineProps; + // set automatic border property for chartarea, because of tdf#81437 and tdf#82217, except for Impress (tdf#150176) + if ( eObjType == OBJECTTYPE_CHARTSPACE ) + { + OUString aFilterName; + rData.mrFilter.getMediaDescriptor()[utl::MediaDescriptor::PROP_FILTERNAME] >>= aFilterName; + if (!aFilterName.startsWithIgnoreAsciiCase("Impress")) + { + mxAutoLine->maLineFill.moFillType = oox::GraphicHelper::getDefaultChartAreaLineStyle(); + mxAutoLine->moLineWidth = oox::GraphicHelper::getDefaultChartAreaLineWidth(); + // this value is what MSO 2016 use as a default color for chartspace border + mxAutoLine->maLineFill.maFillColor.setSrgbClr(0xD9D9D9); + } + } + // change line width according to chart auto style + if( mxAutoLine->moLineWidth.has() ) + mxAutoLine->moLineWidth = mxAutoLine->moLineWidth.get() * pAutoFormatEntry->mnRelLineWidth / 100; +} + +void LineFormatter::convertFormatting( ShapePropertyMap& rPropMap, const ModelRef< Shape >& rxShapeProp, sal_Int32 nSeriesIdx ) +{ + LineProperties aLineProps; + if( mxAutoLine ) + aLineProps.assignUsed( *mxAutoLine ); + if( rxShapeProp.is() ) + aLineProps.assignUsed( rxShapeProp->getLineProperties() ); + aLineProps.pushToPropMap( rPropMap, mrData.mrFilter.getGraphicHelper(), getPhColor( nSeriesIdx ) ); +} + +FillFormatter::FillFormatter( ObjectFormatterData& rData, const AutoFormatEntry* pAutoFormatEntry, const ObjectType eObjType ) : + DetailFormatterBase( rData, pAutoFormatEntry ) +{ + if( !pAutoFormatEntry ) + return; + + mxAutoFill = std::make_shared(); + if( eObjType != OBJECTTYPE_CHARTSPACE ) + mxAutoFill->moFillType = XML_noFill; + if( const Theme* pTheme = mrData.mrFilter.getCurrentTheme() ) + if( const FillProperties* pFillProps = pTheme->getFillStyle( pAutoFormatEntry->mnThemedIdx ) ) + *mxAutoFill = *pFillProps; + + if (eObjType == OBJECTTYPE_CHARTSPACE) + { + mxAutoFill->moFillType = rData.mrFilter.getGraphicHelper().getDefaultChartAreaFillStyle(); + } +} + +void FillFormatter::convertFormatting( ShapePropertyMap& rPropMap, const ModelRef< Shape >& rxShapeProp, const PictureOptionsModel* pPicOptions, sal_Int32 nSeriesIdx ) +{ + FillProperties aFillProps; + if( mxAutoFill ) + aFillProps.assignUsed( *mxAutoFill ); + if (rxShapeProp) + aFillProps.assignUsed( rxShapeProp->getFillProperties() ); + if( pPicOptions ) + lclConvertPictureOptions( aFillProps, *pPicOptions ); + aFillProps.pushToPropMap( rPropMap, mrData.mrFilter.getGraphicHelper(), 0, getPhColor( nSeriesIdx ) ); +} + +namespace { + +const TextCharacterProperties* lclGetTextProperties( const ModelRef< TextBody >& rxTextProp ) +{ + return (rxTextProp.is() && !rxTextProp->getParagraphs().empty()) ? + &rxTextProp->getParagraphs().front()->getProperties().getTextCharacterProperties() : nullptr; +} + +} // namespace + +TextFormatter::TextFormatter( ObjectFormatterData& rData, const AutoTextEntry* pAutoTextEntry, const ModelRef< TextBody >& rxGlobalTextProp ) : + DetailFormatterBase( rData, pAutoTextEntry ) +{ + if( !pAutoTextEntry ) + return; + + mxAutoText = std::make_shared(); + if( const Theme* pTheme = mrData.mrFilter.getCurrentTheme() ) + if( const TextCharacterProperties* pTextProps = pTheme->getFontStyle( pAutoTextEntry->mnThemedFont ) ) + *mxAutoText = *pTextProps; + ::Color nTextColor = getPhColor( -1 ); + if( sal_Int32(nTextColor) >= 0 ) { + mxAutoText->maFillProperties.maFillColor.setSrgbClr( nTextColor ); + mxAutoText->maFillProperties.moFillType.set(XML_solidFill); + } + mxAutoText->moHeight = pAutoTextEntry->mnDefFontSize; + mxAutoText->moBold = pAutoTextEntry->mbBold; + + if( const TextCharacterProperties* pTextProps = lclGetTextProperties( rxGlobalTextProp ) ) + { + mxAutoText->assignUsed( *pTextProps ); + if( pTextProps->moHeight.has() ) + mxAutoText->moHeight = pTextProps->moHeight.get() * pAutoTextEntry->mnRelFontSize / 100; + } +} + +void TextFormatter::convertFormatting( PropertySet& rPropSet, const TextCharacterProperties* pTextProps ) +{ + TextCharacterProperties aTextProps; + if( mxAutoText ) + aTextProps.assignUsed( *mxAutoText ); + if( pTextProps ) + aTextProps.assignUsed( *pTextProps ); + aTextProps.pushToPropSet( rPropSet, mrData.mrFilter ); +} + +void TextFormatter::convertFormatting( PropertySet& rPropSet, const ModelRef< TextBody >& rxTextProp ) +{ + convertFormatting( rPropSet, lclGetTextProperties( rxTextProp ) ); +} + +ObjectTypeFormatter::ObjectTypeFormatter( ObjectFormatterData& rData, const ObjectTypeFormatEntry& rEntry, const ChartSpaceModel& rChartSpace, const ObjectType eObjType ) : + maLineFormatter( rData, lclGetAutoFormatEntry( rEntry.mpAutoLines, rChartSpace.mnStyle ), eObjType ), + maFillFormatter( rData, lclGetAutoFormatEntry( rEntry.mpAutoFills, rChartSpace.mnStyle ), eObjType ), + maTextFormatter( rData, lclGetAutoTextEntry( rEntry.mpAutoTexts, rChartSpace.mnStyle ), rChartSpace.mxTextProp ), + mrModelObjHelper( rData.maModelObjHelper ), + mrEntry( rEntry ) +{ +} + +void ObjectTypeFormatter::convertFrameFormatting( PropertySet& rPropSet, const ModelRef< Shape >& rxShapeProp, const PictureOptionsModel* pPicOptions, sal_Int32 nSeriesIdx ) +{ + ShapePropertyMap aPropMap( mrModelObjHelper, mrEntry.mrPropInfo ); + maLineFormatter.convertFormatting( aPropMap, rxShapeProp, nSeriesIdx ); + if( mrEntry.mbIsFrame ) + maFillFormatter.convertFormatting( aPropMap, rxShapeProp, pPicOptions, nSeriesIdx ); + rPropSet.setProperties( aPropMap ); +} + +void ObjectTypeFormatter::convertTextFormatting( PropertySet& rPropSet, const ModelRef< TextBody >& rxTextProp ) +{ + maTextFormatter.convertFormatting( rPropSet, rxTextProp ); +} + +void ObjectTypeFormatter::convertFormatting( PropertySet& rPropSet, const ModelRef< Shape >& rxShapeProp, const ModelRef< TextBody >& rxTextProp ) +{ + convertFrameFormatting( rPropSet, rxShapeProp, nullptr, -1 ); + convertTextFormatting( rPropSet, rxTextProp ); +} + +void ObjectTypeFormatter::convertTextFormatting( PropertySet& rPropSet, const TextCharacterProperties& rTextProps ) +{ + maTextFormatter.convertFormatting( rPropSet, &rTextProps ); +} + +void ObjectTypeFormatter::convertAutomaticFill( PropertySet& rPropSet, sal_Int32 nSeriesIdx ) +{ + ShapePropertyMap aPropMap( mrModelObjHelper, mrEntry.mrPropInfo ); + ModelRef< Shape > xShapeProp; + maFillFormatter.convertFormatting( aPropMap, xShapeProp, nullptr, nSeriesIdx ); + rPropSet.setProperties( aPropMap ); +} + +ObjectFormatterData::ObjectFormatterData( const XmlFilterBase& rFilter, const Reference< XChartDocument >& rxChartDoc, const ChartSpaceModel& rChartSpace ) : + mrFilter( rFilter ), + maModelObjHelper( Reference< XMultiServiceFactory >( rxChartDoc, UNO_QUERY ) ), + maEnUsLocale( "en", "US", OUString() ), + mnMaxSeriesIdx( -1 ) +{ + for(auto const &rEntry : spObjTypeFormatEntries) + maTypeFormatters[ rEntry.meObjType ] = std::make_shared( *this, rEntry, rChartSpace, rEntry.meObjType ); + + try + { + Reference< XNumberFormatsSupplier > xNumFmtsSupp( rxChartDoc, UNO_QUERY_THROW ); + mxNumFmts = xNumFmtsSupp->getNumberFormats(); + mxNumTypes.set( mxNumFmts, UNO_QUERY ); + } + catch( Exception& ) + { + } + OSL_ENSURE( mxNumFmts.is() && mxNumTypes.is(), "ObjectFormatterData::ObjectFormatterData - cannot get number formats" ); +} + +ObjectTypeFormatter* ObjectFormatterData::getTypeFormatter( ObjectType eObjType ) +{ + OSL_ENSURE( maTypeFormatters.has( eObjType ), "ObjectFormatterData::getTypeFormatter - unknown object type" ); + return maTypeFormatters.get( eObjType ).get(); +} + +ObjectFormatter::ObjectFormatter( const XmlFilterBase& rFilter, const Reference< XChartDocument >& rxChartDoc, const ChartSpaceModel& rChartSpace ) : + mxData( std::make_shared( rFilter, rxChartDoc, rChartSpace ) ) +{ +} + +ObjectFormatter::~ObjectFormatter() +{ +} + +void ObjectFormatter::setMaxSeriesIndex( sal_Int32 nMaxSeriesIdx ) +{ + mxData->mnMaxSeriesIdx = nMaxSeriesIdx; +} + +sal_Int32 ObjectFormatter::getMaxSeriesIndex() const +{ + return mxData->mnMaxSeriesIdx; +} + +void ObjectFormatter::convertFrameFormatting( PropertySet& rPropSet, const ModelRef< Shape >& rxShapeProp, ObjectType eObjType, sal_Int32 nSeriesIdx ) +{ + if( ObjectTypeFormatter* pFormat = mxData->getTypeFormatter( eObjType ) ) + pFormat->convertFrameFormatting( rPropSet, rxShapeProp, nullptr, nSeriesIdx ); +} + +void ObjectFormatter::convertFrameFormatting( PropertySet& rPropSet, const ModelRef< Shape >& rxShapeProp, const PictureOptionsModel& rPicOptions, ObjectType eObjType, sal_Int32 nSeriesIdx ) +{ + if( ObjectTypeFormatter* pFormat = mxData->getTypeFormatter( eObjType ) ) + pFormat->convertFrameFormatting( rPropSet, rxShapeProp, &rPicOptions, nSeriesIdx ); +} + +void ObjectFormatter::convertTextFormatting( PropertySet& rPropSet, const ModelRef< TextBody >& rxTextProp, ObjectType eObjType ) +{ + if( ObjectTypeFormatter* pFormat = mxData->getTypeFormatter( eObjType ) ) + pFormat->convertTextFormatting( rPropSet, rxTextProp ); +} + +void ObjectFormatter::convertFormatting( PropertySet& rPropSet, const ModelRef< Shape >& rxShapeProp, const ModelRef< TextBody >& rxTextProp, ObjectType eObjType ) +{ + if( ObjectTypeFormatter* pFormat = mxData->getTypeFormatter( eObjType ) ) + pFormat->convertFormatting( rPropSet, rxShapeProp, rxTextProp ); +} + +void ObjectFormatter::convertTextFormatting( PropertySet& rPropSet, const TextCharacterProperties& rTextProps, ObjectType eObjType ) +{ + if( ObjectTypeFormatter* pFormat = mxData->getTypeFormatter( eObjType ) ) + pFormat->convertTextFormatting( rPropSet, rTextProps ); +} + +void ObjectFormatter::convertTextRotation( PropertySet& rPropSet, const ModelRef< TextBody >& rxTextProp, bool bSupportsStacked, sal_Int32 nDefaultRotation ) +{ + if( !rxTextProp.is() ) + return; + + bool bStacked = false; + if( bSupportsStacked ) + { + sal_Int32 nVert = rxTextProp->getTextProperties().moVert.get( XML_horz ); + bStacked = (nVert == XML_wordArtVert) || (nVert == XML_wordArtVertRtl); + rPropSet.setProperty( PROP_StackCharacters, bStacked ); + } + + /* Chart2 expects rotation angle as double value in range of [0,360). + OOXML counts clockwise, Chart2 counts counterclockwise. */ + double fAngle = static_cast< double >( bStacked ? 0 : rxTextProp->getTextProperties().moRotation.get( nDefaultRotation ) ); + // MS Office UI allows values only in range of [-90,90]. + if ( fAngle < -5400000.0 || fAngle > 5400000.0 ) + { + fAngle = 0.0; + } + fAngle = getDoubleIntervalValue< double >( -fAngle / 60000.0, 0.0, 360.0 ); + rPropSet.setProperty( PROP_TextRotation, fAngle ); +} + +void ObjectFormatter::convertTextWrap( PropertySet& rPropSet, const ModelRef< TextBody >& rxTextProp ) +{ + if( !rxTextProp.is() ) + { + // set default value (in OOXML the default value is true) + rPropSet.setProperty( PROP_TextWordWrap, true ); + return; + } + + PropertyMap& aPropMap = rxTextProp->getTextProperties().maPropertyMap; + if( aPropMap.hasProperty(PROP_TextWordWrap) ) + { + Any aValue = aPropMap.getProperty( PROP_TextWordWrap ); + if( aValue.hasValue() ) + { + bool bValue = false; + aValue >>= bValue; + rPropSet.setProperty( PROP_TextWordWrap, bValue ); + } + } +} + +void ObjectFormatter::convertNumberFormat( PropertySet& rPropSet, const NumberFormat& rNumberFormat, bool bAxis, bool bShowPercent ) +{ + if( !mxData->mxNumFmts.is() ) + return; + + const bool bGeneral = rNumberFormat.maFormatCode.equalsIgnoreAsciiCase("general"); + const bool bPercent = !bAxis && bShowPercent && !rNumberFormat.mbSourceLinked; + sal_Int32 nPropId = bPercent ? PROP_PercentageNumberFormat : PROP_NumberFormat; + OUString sFormatCode(rNumberFormat.maFormatCode); + if (bPercent && bGeneral) + sFormatCode = "0%"; + try + { + sal_Int32 nIndex = bGeneral && !bPercent ? + mxData->mxNumTypes->getStandardIndex( mxData->maFromLocale ) : + mxData->mxNumFmts->addNewConverted( sFormatCode, mxData->maEnUsLocale, mxData->maFromLocale ); + if( nIndex >= 0 ) + rPropSet.setProperty( nPropId, nIndex ); + } + catch( Exception& ) + { + OSL_FAIL( OStringBuffer( "ObjectFormatter::convertNumberFormat - cannot create number format '" + + OUStringToOString( rNumberFormat.maFormatCode, osl_getThreadTextEncoding() ) + "'" ).getStr() ); + } + + // Setting "LinkNumberFormatToSource" does not really work, at least not for axis :-/ + if (!bAxis) + rPropSet.setProperty(PROP_LinkNumberFormatToSource, Any(rNumberFormat.mbSourceLinked)); + else + rPropSet.setProperty(PROP_LinkNumberFormatToSource, Any(rNumberFormat.maFormatCode.isEmpty())); +} + +void ObjectFormatter::convertAutomaticFill( PropertySet& rPropSet, ObjectType eObjType, sal_Int32 nSeriesIdx ) +{ + if( ObjectTypeFormatter* pFormat = mxData->getTypeFormatter( eObjType ) ) + pFormat->convertAutomaticFill( rPropSet, nSeriesIdx ); +} + +bool ObjectFormatter::isAutomaticFill( const ModelRef< Shape >& rxShapeProp ) +{ + return !rxShapeProp || !rxShapeProp->getFillProperties().moFillType.has(); +} + +} // namespace oox + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/drawingml/chart/plotareacontext.cxx b/oox/source/drawingml/chart/plotareacontext.cxx new file mode 100644 index 000000000..4afddee47 --- /dev/null +++ b/oox/source/drawingml/chart/plotareacontext.cxx @@ -0,0 +1,175 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace oox::drawingml::chart { + +using ::oox::core::ContextHandler2Helper; +using ::oox::core::ContextHandlerRef; + +View3DContext::View3DContext( ContextHandler2Helper& rParent, View3DModel& rModel ) : + ContextBase< View3DModel >( rParent, rModel ) +{ +} + +View3DContext::~View3DContext() +{ +} + +ContextHandlerRef View3DContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ) +{ + bool bMSO2007Doc = getFilter().isMSO2007Document(); + switch( getCurrentElement() ) + { + case C_TOKEN( view3D ): + switch( nElement ) + { + case C_TOKEN( depthPercent ): + mrModel.mnDepthPercent = rAttribs.getInteger( XML_val, 100 ); + return nullptr; + case C_TOKEN( hPercent ): + mrModel.monHeightPercent = rAttribs.getInteger( XML_val, 100 ); + return nullptr; + case C_TOKEN( perspective ): + mrModel.mnPerspective = rAttribs.getInteger( XML_val, 30 ); + return nullptr; + case C_TOKEN( rAngAx ): + mrModel.mbRightAngled = rAttribs.getBool( XML_val, !bMSO2007Doc ); + return nullptr; + case C_TOKEN( rotX ): + // default value dependent on chart type + mrModel.monRotationX = rAttribs.getInteger( XML_val ); + return nullptr; + case C_TOKEN( rotY ): + // default value dependent on chart type + mrModel.monRotationY = rAttribs.getInteger( XML_val ); + return nullptr; + } + break; + } + return nullptr; +} + +WallFloorContext::WallFloorContext( ContextHandler2Helper& rParent, WallFloorModel& rModel ) : + ContextBase< WallFloorModel >( rParent, rModel ) +{ +} + +WallFloorContext::~WallFloorContext() +{ +} + +ContextHandlerRef WallFloorContext::onCreateContext( sal_Int32 nElement, const AttributeList& ) +{ + bool bMSO2007Doc = getFilter().isMSO2007Document(); + switch( getCurrentElement() ) + { + case C_TOKEN( backWall ): + case C_TOKEN( floor ): + case C_TOKEN( sideWall ): + switch( nElement ) + { + case C_TOKEN( pictureOptions ): + return new PictureOptionsContext( *this, mrModel.mxPicOptions.create(bMSO2007Doc) ); + case C_TOKEN( spPr ): + return new ShapePropertiesContext( *this, mrModel.mxShapeProp.create() ); + } + break; + } + return nullptr; +} + +PlotAreaContext::PlotAreaContext( ContextHandler2Helper& rParent, PlotAreaModel& rModel ) : + ContextBase< PlotAreaModel >( rParent, rModel ) +{ +} + +PlotAreaContext::~PlotAreaContext() +{ +} + +ContextHandlerRef PlotAreaContext::onCreateContext( sal_Int32 nElement, const AttributeList& ) +{ + bool bMSO2007Doc = getFilter().isMSO2007Document(); + switch( getCurrentElement() ) + { + case C_TOKEN( plotArea ): + switch( nElement ) + { + case C_TOKEN( area3DChart ): + case C_TOKEN( areaChart ): + return new AreaTypeGroupContext( *this, mrModel.maTypeGroups.create( nElement, bMSO2007Doc ) ); + case C_TOKEN( bar3DChart ): + case C_TOKEN( barChart ): + return new BarTypeGroupContext( *this, mrModel.maTypeGroups.create( nElement, bMSO2007Doc ) ); + case C_TOKEN( bubbleChart ): + return new BubbleTypeGroupContext( *this, mrModel.maTypeGroups.create( nElement, bMSO2007Doc ) ); + case C_TOKEN( line3DChart ): + case C_TOKEN( lineChart ): + case C_TOKEN( stockChart ): + return new LineTypeGroupContext( *this, mrModel.maTypeGroups.create( nElement, bMSO2007Doc ) ); + case C_TOKEN( doughnutChart ): + case C_TOKEN( ofPieChart ): + case C_TOKEN( pie3DChart ): + case C_TOKEN( pieChart ): + return new PieTypeGroupContext( *this, mrModel.maTypeGroups.create( nElement, bMSO2007Doc ) ); + case C_TOKEN( radarChart ): + return new RadarTypeGroupContext( *this, mrModel.maTypeGroups.create( nElement, bMSO2007Doc ) ); + case C_TOKEN( scatterChart ): + return new ScatterTypeGroupContext( *this, mrModel.maTypeGroups.create( nElement, bMSO2007Doc ) ); + case C_TOKEN( surface3DChart ): + case C_TOKEN( surfaceChart ): + return new SurfaceTypeGroupContext( *this, mrModel.maTypeGroups.create( nElement, bMSO2007Doc ) ); + + case C_TOKEN( catAx ): + return new CatAxisContext( *this, mrModel.maAxes.create( nElement, bMSO2007Doc ) ); + case C_TOKEN( dateAx ): + return new DateAxisContext( *this, mrModel.maAxes.create( nElement, bMSO2007Doc ) ); + case C_TOKEN( serAx ): + return new SerAxisContext( *this, mrModel.maAxes.create( nElement, bMSO2007Doc ) ); + case C_TOKEN( valAx ): + return new ValAxisContext( *this, mrModel.maAxes.create( nElement, bMSO2007Doc ) ); + + case C_TOKEN( layout ): + return new LayoutContext( *this, mrModel.mxLayout.create() ); + case C_TOKEN( spPr ): + return new ShapePropertiesContext( *this, mrModel.mxShapeProp.getOrCreate() ); + case C_TOKEN(dTable): + return new DataTableContext( *this, mrModel.mxDataTable.create() ); + } + break; + } + return nullptr; +} + +} // namespace oox::drawingml::chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/drawingml/chart/plotareaconverter.cxx b/oox/source/drawingml/chart/plotareaconverter.cxx new file mode 100644 index 000000000..afbb28ade --- /dev/null +++ b/oox/source/drawingml/chart/plotareaconverter.cxx @@ -0,0 +1,481 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace oox::drawingml::chart { + +using namespace ::com::sun::star; +using namespace ::com::sun::star::chart2; +using namespace ::com::sun::star::uno; + +namespace { + +/** Axes set model. This is a helper for the plot area converter collecting all + type groups and axes of the primary or secondary axes set. */ +struct AxesSetModel +{ + typedef ModelVector< TypeGroupModel > TypeGroupVector; + typedef ModelMap< sal_Int32, AxisModel > AxisMap; + + TypeGroupVector maTypeGroups; /// All type groups containing data series. + AxisMap maAxes; /// All axes mapped by API axis type. + + explicit AxesSetModel() {} +}; + +/** Axes set converter. This is a helper class for the plot area converter. */ +class AxesSetConverter : public ConverterBase< AxesSetModel > +{ +public: + explicit AxesSetConverter( const ConverterRoot& rParent, AxesSetModel& rModel ); + + /** Converts the axes set model to a chart2 diagram. Returns an automatic + chart title from a single series title, if possible. */ + void convertFromModel( + const Reference< XDiagram >& rxDiagram, + View3DModel& rView3DModel, + sal_Int32 nAxesSetIdx, + bool bSupportsVaryColorsByPoint, + bool bUseFixedInnerSize ); + + /** Returns the automatic chart title if the axes set contains only one series. */ + const OUString& getAutomaticTitle() const { return maAutoTitle; } + /** Returns true, if the chart is three-dimensional. */ + bool is3dChart() const { return mb3dChart; } + /** Returns true, if chart type supports wall and floor format in 3D mode. */ + bool isWall3dChart() const { return mbWall3dChart; } + /** Returns true, if chart is a pie chart or doughnut chart. */ + bool isPieChart() const { return mbPieChart; } + +private: + OUString maAutoTitle; + bool mb3dChart; + bool mbWall3dChart; + bool mbPieChart; +}; + +AxesSetConverter::AxesSetConverter( const ConverterRoot& rParent, AxesSetModel& rModel ) : + ConverterBase< AxesSetModel >( rParent, rModel ), + mb3dChart( false ), + mbWall3dChart( false ), + mbPieChart( false ) +{ +} + +ModelRef< AxisModel > lclGetOrCreateAxis( const AxesSetModel::AxisMap& rFromAxes, sal_Int32 nAxisIdx, sal_Int32 nDefTypeId, bool bMSO2007Doc ) +{ + ModelRef< AxisModel > xAxis = rFromAxes.get( nAxisIdx ); + if( !xAxis ) + xAxis.create( nDefTypeId, bMSO2007Doc ).mbDeleted = true; // missing axis is invisible + return xAxis; +} + +void AxesSetConverter::convertFromModel( const Reference< XDiagram >& rxDiagram, + View3DModel& rView3DModel, sal_Int32 nAxesSetIdx, + bool bSupportsVaryColorsByPoint, bool bUseFixedInnerSize) +{ + // create type group converter objects for all type groups + typedef RefVector< TypeGroupConverter > TypeGroupConvVector; + TypeGroupConvVector aTypeGroups; + for (auto const& typeGroup : mrModel.maTypeGroups) + aTypeGroups.push_back( std::make_shared( *this, *typeGroup ) ); + + OSL_ENSURE( !aTypeGroups.empty(), "AxesSetConverter::convertFromModel - no type groups in axes set" ); + if( aTypeGroups.empty() ) + return; + + try + { + // first type group needed for coordinate system and axis conversion + TypeGroupConverter& rFirstTypeGroup = *aTypeGroups.front(); + + // get automatic chart title, if there is only one type group + if( aTypeGroups.size() == 1 ) + maAutoTitle = rFirstTypeGroup.getSingleSeriesTitle(); + + /* Create a coordinate system. For now, all type groups from all axes sets + have to be inserted into one coordinate system. Later, chart2 should + support using one coordinate system for each axes set. */ + Reference< XCoordinateSystem > xCoordSystem; + Reference< XCoordinateSystemContainer > xCoordSystemCont( rxDiagram, UNO_QUERY_THROW ); + Sequence< Reference< XCoordinateSystem > > aCoordSystems = xCoordSystemCont->getCoordinateSystems(); + if( aCoordSystems.hasElements() ) + { + OSL_ENSURE( aCoordSystems.getLength() == 1, "AxesSetConverter::convertFromModel - too many coordinate systems" ); + xCoordSystem = aCoordSystems[ 0 ]; + OSL_ENSURE( xCoordSystem.is(), "AxesSetConverter::convertFromModel - invalid coordinate system" ); + } + else + { + xCoordSystem = rFirstTypeGroup.createCoordinateSystem(); + if( xCoordSystem.is() ) + xCoordSystemCont->addCoordinateSystem( xCoordSystem ); + } + + // 3D view settings + mb3dChart = rFirstTypeGroup.is3dChart(); + mbWall3dChart = rFirstTypeGroup.isWall3dChart(); + mbPieChart = rFirstTypeGroup.getTypeInfo().meTypeCategory == TYPECATEGORY_PIE; + if( mb3dChart ) + { + View3DConverter aView3DConv( *this, rView3DModel ); + aView3DConv.convertFromModel( rxDiagram, rFirstTypeGroup ); + } + + /* Convert all chart type groups. Each type group will add its series + to the data provider attached to the chart document. */ + if( xCoordSystem.is() ) + { + bool bMSO2007Doc = getFilter().isMSO2007Document(); + // convert all axes (create missing axis models) + ModelRef< AxisModel > xXAxis = lclGetOrCreateAxis( mrModel.maAxes, API_X_AXIS, rFirstTypeGroup.getTypeInfo().mbCategoryAxis ? C_TOKEN( catAx ) : C_TOKEN( valAx ), bMSO2007Doc ); + ModelRef< AxisModel > xYAxis = lclGetOrCreateAxis( mrModel.maAxes, API_Y_AXIS, C_TOKEN( valAx ), bMSO2007Doc ); + + AxisConverter aXAxisConv( *this, *xXAxis ); + aXAxisConv.convertFromModel(xCoordSystem, aTypeGroups, xYAxis.get(), nAxesSetIdx, + API_X_AXIS, bUseFixedInnerSize); + AxisConverter aYAxisConv( *this, *xYAxis ); + aYAxisConv.convertFromModel(xCoordSystem, aTypeGroups, xXAxis.get(), nAxesSetIdx, + API_Y_AXIS, bUseFixedInnerSize); + + if( rFirstTypeGroup.isDeep3dChart() ) + { + ModelRef< AxisModel > xZAxis = lclGetOrCreateAxis( mrModel.maAxes, API_Z_AXIS, C_TOKEN( serAx ), bMSO2007Doc ); + AxisConverter aZAxisConv( *this, *xZAxis ); + aZAxisConv.convertFromModel(xCoordSystem, aTypeGroups, nullptr, nAxesSetIdx, + API_Z_AXIS, bUseFixedInnerSize); + } + + // convert all chart type groups, this converts all series data and formatting + for (auto const& typeGroup : aTypeGroups) + typeGroup->convertFromModel( rxDiagram, xCoordSystem, nAxesSetIdx, bSupportsVaryColorsByPoint ); + } + } + catch( Exception& ) + { + } +} + +} // namespace + +View3DConverter::View3DConverter( const ConverterRoot& rParent, View3DModel& rModel ) : + ConverterBase< View3DModel >( rParent, rModel ) +{ +} + +View3DConverter::~View3DConverter() +{ +} + +void View3DConverter::convertFromModel( const Reference< XDiagram >& rxDiagram, TypeGroupConverter const & rTypeGroup ) +{ + namespace cssd = ::com::sun::star::drawing; + PropertySet aPropSet( rxDiagram ); + + sal_Int32 nRotationY = 0; + sal_Int32 nRotationX = 0; + bool bRightAngled = false; + sal_Int32 nAmbientColor = 0; + sal_Int32 nLightColor = 0; + + if( rTypeGroup.getTypeInfo().meTypeCategory == TYPECATEGORY_PIE ) + { + // Y rotation used as 'first pie slice angle' in 3D pie charts + rTypeGroup.convertPieRotation( aPropSet, mrModel.monRotationY.get( 0 ) ); + // X rotation a.k.a. elevation (map OOXML [0..90] to Chart2 [-90,0]) + nRotationX = getLimitedValue< sal_Int32, sal_Int32 >( mrModel.monRotationX.get( 15 ), 0, 90 ) - 90; + // no right-angled axes in pie charts + bRightAngled = false; + // ambient color (Gray 30%) + nAmbientColor = 0xB3B3B3; + // light color (Gray 70%) + nLightColor = 0x4C4C4C; + } + else // 3D bar/area/line charts + { + // Y rotation (OOXML [0..359], Chart2 [-179,180]) + nRotationY = mrModel.monRotationY.get( 20 ); + // X rotation a.k.a. elevation (OOXML [-90..90], Chart2 [-179,180]) + nRotationX = getLimitedValue< sal_Int32, sal_Int32 >( mrModel.monRotationX.get( 15 ), -90, 90 ); + // right-angled axes + bRightAngled = mrModel.mbRightAngled; + // ambient color (Gray 20%) + nAmbientColor = 0xCCCCCC; + // light color (Gray 60%) + nLightColor = 0x666666; + } + + // Y rotation (map OOXML [0..359] to Chart2 [-179,180]) + nRotationY = NormAngle180(nRotationY); + /* Perspective (map OOXML [0..200] to Chart2 [0,100]). Seems that MSO 2007 is + buggy here, the XML plugin of MSO 2003 writes the correct perspective in + the range from 0 to 100. We will emulate the wrong behaviour of MSO 2007. */ + sal_Int32 nPerspective = getLimitedValue< sal_Int32, sal_Int32 >( mrModel.mnPerspective / 2, 0, 100 ); + // projection mode (parallel axes, if right-angled, #i90360# or if perspective is at 0%) + bool bParallel = bRightAngled || (nPerspective == 0); + cssd::ProjectionMode eProjMode = bParallel ? cssd::ProjectionMode_PARALLEL : cssd::ProjectionMode_PERSPECTIVE; + + // set rotation properties + aPropSet.setProperty( PROP_RightAngledAxes, bRightAngled ); + aPropSet.setProperty( PROP_RotationVertical, nRotationY ); + aPropSet.setProperty( PROP_RotationHorizontal, nRotationX ); + aPropSet.setProperty( PROP_Perspective, nPerspective ); + aPropSet.setProperty( PROP_D3DScenePerspective, eProjMode ); + + // set light settings + aPropSet.setProperty( PROP_D3DSceneShadeMode, cssd::ShadeMode_FLAT ); + aPropSet.setProperty( PROP_D3DSceneAmbientColor, nAmbientColor ); + aPropSet.setProperty( PROP_D3DSceneLightOn1, false ); + aPropSet.setProperty( PROP_D3DSceneLightOn2, true ); + aPropSet.setProperty( PROP_D3DSceneLightColor2, nLightColor ); + aPropSet.setProperty( PROP_D3DSceneLightDirection2, cssd::Direction3D( 0.2, 0.4, 1.0 ) ); +} + +WallFloorConverter::WallFloorConverter( const ConverterRoot& rParent, WallFloorModel& rModel ) : + ConverterBase< WallFloorModel >( rParent, rModel ) +{ +} + +WallFloorConverter::~WallFloorConverter() +{ +} + +void WallFloorConverter::convertFromModel( const Reference< XDiagram >& rxDiagram, ObjectType eObjType ) +{ + bool bMSO2007Doc = getFilter().isMSO2007Document(); + if( rxDiagram.is() ) + { + PropertySet aPropSet; + switch( eObjType ) + { + case OBJECTTYPE_FLOOR: aPropSet.set( rxDiagram->getFloor() ); break; + case OBJECTTYPE_WALL: aPropSet.set( rxDiagram->getWall() ); break; + default: OSL_FAIL( "WallFloorConverter::convertFromModel - invalid object type" ); + } + if( aPropSet.is() ) + getFormatter().convertFrameFormatting( aPropSet, mrModel.mxShapeProp, mrModel.mxPicOptions.getOrCreate(bMSO2007Doc), eObjType ); + } +} + +PlotAreaConverter::PlotAreaConverter( const ConverterRoot& rParent, PlotAreaModel& rModel ) : + ConverterBase< PlotAreaModel >( rParent, rModel ), + mb3dChart( false ), + mbWall3dChart( false ), + mbPieChart( false ) +{ +} + +PlotAreaConverter::~PlotAreaConverter() +{ +} + +void PlotAreaConverter::convertFromModel( View3DModel& rView3DModel ) +{ + /* Create the diagram object and attach it to the chart document. One + diagram is used to carry all coordinate systems and data series. */ + Reference< XDiagram > xDiagram; + try + { + xDiagram.set( createInstance( "com.sun.star.chart2.Diagram" ), UNO_QUERY_THROW ); + getChartDocument()->setFirstDiagram( xDiagram ); + } + catch( Exception& ) + { + } + + // store all axis models in a map, keyed by axis identifier + typedef ModelMap< sal_Int32, AxisModel > AxisMap; + AxisMap aAxisMap; + std::vectorrValAxisIds; + std::vectorrRealValAxisIds; + + for (auto const& atypeGroup : mrModel.maTypeGroups) + { + if (atypeGroup->maAxisIds.size() > 1) + { + // let's collect which axId belongs to the Y Axis according to maTypeGroups + rRealValAxisIds.push_back(atypeGroup->maAxisIds[1]); + } + } + + for (auto const& axis : mrModel.maAxes) + { + OSL_ENSURE( axis->mnAxisId >= 0, "PlotAreaConverter::convertFromModel - invalid axis identifier" ); + OSL_ENSURE( !aAxisMap.has( axis->mnAxisId ), "PlotAreaConverter::convertFromModel - axis identifiers not unique" ); + if( axis->mnAxisId != -1 ) + aAxisMap[ axis->mnAxisId ] = axis; + + if ( axis->mnAxisId != -1 && axis->mnTypeId == C_TOKEN(valAx) ) + { + for (size_t i = 0; i < rRealValAxisIds.size(); i++) + { + if (axis->mnAxisId == rRealValAxisIds[i]) + { + // let's collect which axId belongs to the Y Axis according to maAxes + rValAxisIds.push_back(axis->mnAxisId); + } + } + } + } + + // group the type group models into different axes sets + typedef ModelVector< AxesSetModel > AxesSetVector; + AxesSetVector aAxesSets; + sal_Int32 nMaxSeriesIdx = -1; + for (auto const& typeGroup : mrModel.maTypeGroups) + { + if( !typeGroup->maSeries.empty() ) + { + // try to find a compatible axes set for the type group + AxesSetModel* pAxesSet = nullptr; + for (auto const& axesSet : aAxesSets) + { + if( axesSet->maTypeGroups.front()->maAxisIds == typeGroup->maAxisIds ) + { + pAxesSet = axesSet.get(); + if (pAxesSet) + break; + } + } + + // not possible to insert into an existing axes set -> start a new axes set + if( !pAxesSet ) + { + pAxesSet = &aAxesSets.create(); + // find axis models used by the type group + const std::vector& rAxisIds = typeGroup->maAxisIds; + if( !rAxisIds.empty() ) + pAxesSet->maAxes[ API_X_AXIS ] = aAxisMap.get( rAxisIds[ 0 ] ); + if( rAxisIds.size() >= 2 ) + pAxesSet->maAxes[ API_Y_AXIS ] = aAxisMap.get( rAxisIds[ 1 ] ); + if( rAxisIds.size() >= 3 ) + pAxesSet->maAxes[ API_Z_AXIS ] = aAxisMap.get( rAxisIds[ 2 ] ); + } + + // insert the type group model + pAxesSet->maTypeGroups.push_back( typeGroup ); + + // collect the maximum series index for automatic series formatting + for (auto const& elemSeries : typeGroup->maSeries) + nMaxSeriesIdx = ::std::max( nMaxSeriesIdx, elemSeries->mnIndex ); + } + } + getFormatter().setMaxSeriesIndex( nMaxSeriesIdx ); + + // varying point colors only for single series in single chart type + bool bSupportsVaryColorsByPoint = mrModel.maTypeGroups.size() == 1; + + bool bIsCombinedChart = mrModel.maTypeGroups.size() == 2 && + mrModel.maTypeGroups[0]->mnTypeId != mrModel.maTypeGroups[1]->mnTypeId; + + // convert all axes sets, and check which axis is attached to the first maTypeGroups + sal_Int32 nStartAxesSetIdx = bIsCombinedChart ? ((rValAxisIds.size() > 1 && aAxesSets.size() > 0 && aAxesSets[0]->maAxes.count( API_Y_AXIS ) + && aAxesSets[0]->maAxes[ API_Y_AXIS ]->mnAxisId != rValAxisIds[0] ) ? 1 : 0) + : 0; + sal_Int32 nAxesSetIdx = nStartAxesSetIdx; + + bool bUseFixedInnerSize = false; + if (mrModel.mxLayout && !mrModel.mxLayout->mbAutoLayout) + bUseFixedInnerSize = mrModel.mxLayout->mnTarget == XML_inner; + + for (auto const& axesSet : aAxesSets) + { + AxesSetConverter aAxesSetConv(*this, *axesSet); + aAxesSetConv.convertFromModel(xDiagram, rView3DModel, nAxesSetIdx, + bSupportsVaryColorsByPoint, bUseFixedInnerSize); + if(nAxesSetIdx == nStartAxesSetIdx) + { + maAutoTitle = aAxesSetConv.getAutomaticTitle(); + mb3dChart = aAxesSetConv.is3dChart(); + mbWall3dChart = aAxesSetConv.isWall3dChart(); + mbPieChart = aAxesSetConv.isPieChart(); + } + else + { + maAutoTitle.clear(); + } + nAxesSetIdx = 1 - nAxesSetIdx; + } + + DataTableConverter dataTableConverter (*this, mrModel.mxDataTable.getOrCreate()); + dataTableConverter.convertFromModel(xDiagram); + + // plot area formatting + if( xDiagram.is() && !mb3dChart ) + { + PropertySet aPropSet( xDiagram->getWall() ); + getFormatter().convertFrameFormatting( aPropSet, mrModel.mxShapeProp, OBJECTTYPE_PLOTAREA2D ); + } +} + +void PlotAreaConverter::convertPositionFromModel() +{ + LayoutModel& rLayout = mrModel.mxLayout.getOrCreate(); + LayoutConverter aLayoutConv( *this, rLayout ); + awt::Rectangle aDiagramRect; + if( !aLayoutConv.calcAbsRectangle( aDiagramRect ) ) + return; + + try + { + namespace cssc = ::com::sun::star::chart; + Reference< cssc::XChartDocument > xChart1Doc( getChartDocument(), UNO_QUERY_THROW ); + Reference< cssc::XDiagramPositioning > xPositioning( xChart1Doc->getDiagram(), UNO_QUERY_THROW ); + // for pie charts, always set inner plot area size to exclude the data labels as Excel does + sal_Int32 nTarget = (mbPieChart && (rLayout.mnTarget == XML_outer)) ? XML_inner : rLayout.mnTarget; + switch( nTarget ) + { + case XML_inner: + xPositioning->setDiagramPositionExcludingAxes( aDiagramRect ); + break; + case XML_outer: + xPositioning->setDiagramPositionIncludingAxes( aDiagramRect ); + break; + default: + OSL_FAIL( "PlotAreaConverter::convertPositionFromModel - unknown positioning target" ); + } + } + catch( Exception& ) + { + } +} + +} // namespace oox + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/drawingml/chart/plotareamodel.cxx b/oox/source/drawingml/chart/plotareamodel.cxx new file mode 100644 index 000000000..cb4f6383d --- /dev/null +++ b/oox/source/drawingml/chart/plotareamodel.cxx @@ -0,0 +1,52 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include +#include +#include + +namespace oox::drawingml::chart { + +View3DModel::View3DModel(bool bMSO2007Doc) : + mnDepthPercent( 100 ), + mnPerspective( 30 ), + mbRightAngled( !bMSO2007Doc ) +{ +} + +WallFloorModel::WallFloorModel() +{ +} + +WallFloorModel::~WallFloorModel() +{ +} + +PlotAreaModel::PlotAreaModel() +{ + mxShapeProp.create().getFillProperties().moFillType = XML_noFill; +} + +PlotAreaModel::~PlotAreaModel() +{ +} + +} // namespace oox::drawingml::chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/drawingml/chart/seriescontext.cxx b/oox/source/drawingml/chart/seriescontext.cxx new file mode 100644 index 000000000..5afc32c14 --- /dev/null +++ b/oox/source/drawingml/chart/seriescontext.cxx @@ -0,0 +1,749 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace oox::drawingml::chart { + +using ::oox::core::ContextHandler2; +using ::oox::core::ContextHandler2Helper; +using ::oox::core::ContextHandlerRef; + +namespace { + +ContextHandlerRef lclDataLabelSharedCreateContext( ContextHandler2& rContext, + sal_Int32 nElement, const AttributeList& rAttribs, DataLabelModelBase& orModel, bool bMSO2007 ) +{ + if( rContext.isRootElement() ) switch( nElement ) + { + case C_TOKEN( delete ): + orModel.mbDeleted = rAttribs.getBool( XML_val, !bMSO2007 ); + return nullptr; + case C_TOKEN( dLblPos ): + orModel.monLabelPos = rAttribs.getToken( XML_val, XML_TOKEN_INVALID ); + return nullptr; + case C_TOKEN( numFmt ): + orModel.maNumberFormat.setAttributes( rAttribs ); + return nullptr; + case C_TOKEN( showBubbleSize ): + orModel.mobShowBubbleSize = rAttribs.getBool( XML_val ); + return nullptr; + case C_TOKEN( showCatName ): + orModel.mobShowCatName = rAttribs.getBool( XML_val ); + return nullptr; + case C_TOKEN( showLegendKey ): + orModel.mobShowLegendKey = rAttribs.getBool( XML_val ); + return nullptr; + case C_TOKEN( showPercent ): + orModel.mobShowPercent = rAttribs.getBool( XML_val ); + return nullptr; + case C_TOKEN( showSerName ): + orModel.mobShowSerName = rAttribs.getBool( XML_val ); + return nullptr; + case C_TOKEN( showVal ): + orModel.mobShowVal = rAttribs.getBool( XML_val ); + return nullptr; + case C_TOKEN( separator ): + // collect separator text in onCharacters() + return &rContext; + case C_TOKEN( spPr ): + return new ShapePropertiesContext( rContext, orModel.mxShapeProp.create() ); + case C_TOKEN( txPr ): + return new TextBodyContext( rContext, orModel.mxTextProp.create() ); + } + return nullptr; +} + +void lclDataLabelSharedCharacters( ContextHandler2 const & rContext, const OUString& rChars, DataLabelModelBase& orModel ) +{ + if( rContext.isCurrentElement( C_TOKEN( separator ) ) ) + orModel.moaSeparator = rChars; +} + +} // namespace + +DataLabelContext::DataLabelContext( ContextHandler2Helper& rParent, DataLabelModel& rModel ) : + ContextBase< DataLabelModel >( rParent, rModel ) +{ + mrModel.mbDeleted = false; +} + +DataLabelContext::~DataLabelContext() +{ +} + +ContextHandlerRef DataLabelContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ) +{ + if( isRootElement() ) + { + switch( nElement ) + { + case C_TOKEN( idx ): + mrModel.mnIndex = rAttribs.getInteger( XML_val, -1 ); + return nullptr; + case C_TOKEN( layout ): + return new LayoutContext( *this, mrModel.mxLayout.create() ); + case C_TOKEN( tx ): + return new TextContext( *this, mrModel.mxText.create() ); + case C_TOKEN( extLst ): + return this; + } + } + else + { + switch( getCurrentElement() ) + { + case C_TOKEN( extLst ): + if ( nElement == C_TOKEN( ext ) ) + return this; + break; + case C_TOKEN( ext ): + if ( nElement == C15_TOKEN( showDataLabelsRange ) ) + { + mrModel.mobShowDataLabelsRange = rAttribs.getBool( XML_val ); + return nullptr; + } + break; + } + } + bool bMSO2007 = getFilter().isMSO2007Document(); + return lclDataLabelSharedCreateContext( *this, nElement, rAttribs, mrModel, bMSO2007 ); +} + +void DataLabelContext::onCharacters( const OUString& rChars ) +{ + lclDataLabelSharedCharacters( *this, rChars, mrModel ); +} + +DataLabelsContext::DataLabelsContext( ContextHandler2Helper& rParent, DataLabelsModel& rModel ) : + ContextBase< DataLabelsModel >( rParent, rModel ) +{ + mrModel.mbDeleted = false; +} + +DataLabelsContext::~DataLabelsContext() +{ +} + +ContextHandlerRef DataLabelsContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ) +{ + bool bMSO2007Doc = getFilter().isMSO2007Document(); + if( isRootElement() ) switch( nElement ) + { + case C_TOKEN( dLbl ): + return new DataLabelContext( *this, mrModel.maPointLabels.create(mrModel, bMSO2007Doc) ); + case C_TOKEN( leaderLines ): + return new ShapePrWrapperContext( *this, mrModel.mxLeaderLines.create() ); + case C_TOKEN( showLeaderLines ): + case C15_TOKEN( showLeaderLines ): + mrModel.mbShowLeaderLines = rAttribs.getBool( XML_val, true ); + return nullptr; + case C_TOKEN( extLst ): + case C_TOKEN( ext ): + return new DataLabelsContext( *this, mrModel ); + } + return lclDataLabelSharedCreateContext( *this, nElement, rAttribs, mrModel, bMSO2007Doc ); +} + +void DataLabelsContext::onCharacters( const OUString& rChars ) +{ + lclDataLabelSharedCharacters( *this, rChars, mrModel ); +} + +PictureOptionsContext::PictureOptionsContext( ContextHandler2Helper& rParent, PictureOptionsModel& rModel ) : + ContextBase< PictureOptionsModel >( rParent, rModel ) +{ +} + +PictureOptionsContext::~PictureOptionsContext() +{ +} + +ContextHandlerRef PictureOptionsContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ) +{ + bool bMSO2007Doc = getFilter().isMSO2007Document(); + if( isRootElement() ) switch( nElement ) + { + case C_TOKEN( applyToEnd ): + mrModel.mbApplyToEnd = rAttribs.getBool( XML_val, !bMSO2007Doc ); + return nullptr; + case C_TOKEN( applyToFront ): + mrModel.mbApplyToFront = rAttribs.getBool( XML_val, !bMSO2007Doc ); + return nullptr; + case C_TOKEN( applyToSides ): + mrModel.mbApplyToSides = rAttribs.getBool( XML_val, !bMSO2007Doc ); + return nullptr; + case C_TOKEN( pictureFormat ): + mrModel.mnPictureFormat = rAttribs.getToken( XML_val, XML_stretch ); + return nullptr; + case C_TOKEN( pictureStackUnit ): + mrModel.mfStackUnit = rAttribs.getDouble( XML_val, 1.0 ); + return nullptr; + } + return nullptr; +} + +ErrorBarContext::ErrorBarContext( ContextHandler2Helper& rParent, ErrorBarModel& rModel ) : + ContextBase< ErrorBarModel >( rParent, rModel ) +{ +} + +ErrorBarContext::~ErrorBarContext() +{ +} + +ContextHandlerRef ErrorBarContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ) +{ + bool bMSO2007Doc = getFilter().isMSO2007Document(); + if( isRootElement() ) switch( nElement ) + { + case C_TOKEN( errBarType ): + mrModel.mnTypeId = rAttribs.getToken( XML_val, XML_both ); + return nullptr; + case C_TOKEN( errDir ): + mrModel.mnDirection = rAttribs.getToken( XML_val, XML_TOKEN_INVALID ); + return nullptr; + case C_TOKEN( errValType ): + mrModel.mnValueType = rAttribs.getToken( XML_val, XML_fixedVal ); + return nullptr; + case C_TOKEN( minus ): + return new DataSourceContext( *this, mrModel.maSources.create( ErrorBarModel::MINUS ) ); + case C_TOKEN( noEndCap ): + mrModel.mbNoEndCap = rAttribs.getBool( XML_val, !bMSO2007Doc ); + return nullptr; + case C_TOKEN( plus ): + return new DataSourceContext( *this, mrModel.maSources.create( ErrorBarModel::PLUS ) ); + case C_TOKEN( spPr ): + return new ShapePropertiesContext( *this, mrModel.mxShapeProp.create() ); + case C_TOKEN( val ): + mrModel.mfValue = rAttribs.getDouble( XML_val, 0.0 ); + return nullptr; + } + return nullptr; +} + +TrendlineLabelContext::TrendlineLabelContext( ContextHandler2Helper& rParent, TrendlineLabelModel& rModel ) : + ContextBase< TrendlineLabelModel >( rParent, rModel ) +{ +} + +TrendlineLabelContext::~TrendlineLabelContext() +{ +} + +ContextHandlerRef TrendlineLabelContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ) +{ + if( isRootElement() ) switch( nElement ) + { + case C_TOKEN( layout ): + return new LayoutContext( *this, mrModel.mxLayout.create() ); + case C_TOKEN( numFmt ): + mrModel.maNumberFormat.setAttributes( rAttribs ); + return nullptr; + case C_TOKEN( spPr ): + return new ShapePropertiesContext( *this, mrModel.mxShapeProp.create() ); + case C_TOKEN( tx ): + return new TextContext( *this, mrModel.mxText.create() ); + case C_TOKEN( txPr ): + return new TextBodyContext( *this, mrModel.mxTextProp.create() ); + } + return nullptr; +} + +TrendlineContext::TrendlineContext( ContextHandler2Helper& rParent, TrendlineModel& rModel ) : + ContextBase< TrendlineModel >( rParent, rModel ) +{ +} + +TrendlineContext::~TrendlineContext() +{ +} + +ContextHandlerRef TrendlineContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ) +{ + bool bMSO2007Doc = getFilter().isMSO2007Document(); + if( isRootElement() ) switch( nElement ) + { + case C_TOKEN( backward ): + mrModel.mfBackward = rAttribs.getDouble( XML_val, 0.0 ); + return nullptr; + case C_TOKEN( dispEq ): + mrModel.mbDispEquation = rAttribs.getBool( XML_val, !bMSO2007Doc ); + return nullptr; + case C_TOKEN( dispRSqr ): + mrModel.mbDispRSquared = rAttribs.getBool( XML_val, !bMSO2007Doc ); + return nullptr; + case C_TOKEN( forward ): + mrModel.mfForward = rAttribs.getDouble( XML_val, 0.0 ); + return nullptr; + case C_TOKEN( intercept ): + mrModel.mfIntercept = rAttribs.getDouble( XML_val, 0.0 ); + return nullptr; + case C_TOKEN( name ): + return this; // collect name in onCharacters() + case C_TOKEN( order ): + mrModel.mnOrder = rAttribs.getInteger( XML_val, 2 ); + return nullptr; + case C_TOKEN( period ): + mrModel.mnPeriod = rAttribs.getInteger( XML_val, 2 ); + return nullptr; + case C_TOKEN( spPr ): + return new ShapePropertiesContext( *this, mrModel.mxShapeProp.create() ); + case C_TOKEN( trendlineLbl ): + return new TrendlineLabelContext( *this, mrModel.mxLabel.create() ); + case C_TOKEN( trendlineType ): + mrModel.mnTypeId = rAttribs.getToken( XML_val, XML_linear ); + return nullptr; + } + return nullptr; +} + +void TrendlineContext::onCharacters( const OUString& rChars ) +{ + if( isCurrentElement( C_TOKEN( name ) ) ) + mrModel.maName = rChars; +} + +DataPointContext::DataPointContext( ContextHandler2Helper& rParent, DataPointModel& rModel ) : + ContextBase< DataPointModel >( rParent, rModel ) +{ +} + +DataPointContext::~DataPointContext() +{ +} + +ContextHandlerRef DataPointContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ) +{ + bool bMSO2007Doc = getFilter().isMSO2007Document(); + switch( getCurrentElement() ) + { + case C_TOKEN( dPt ): + switch( nElement ) + { + case C_TOKEN( bubble3D ): + mrModel.mobBubble3d = rAttribs.getBool( XML_val ); + return nullptr; + case C_TOKEN( explosion ): + // if the 'val' attribute is missing, series explosion remains unchanged + mrModel.monExplosion = rAttribs.getInteger( XML_val ); + return nullptr; + case C_TOKEN( idx ): + mrModel.mnIndex = rAttribs.getInteger( XML_val, -1 ); + return nullptr; + case C_TOKEN( invertIfNegative ): + mrModel.mbInvertNeg = rAttribs.getBool( XML_val, !bMSO2007Doc ); + return nullptr; + case C_TOKEN( marker ): + return this; + case C_TOKEN( pictureOptions ): + return new PictureOptionsContext( *this, mrModel.mxPicOptions.create(bMSO2007Doc) ); + case C_TOKEN( spPr ): + return new ShapePropertiesContext( *this, mrModel.mxShapeProp.create() ); + } + break; + + case C_TOKEN( marker ): + switch( nElement ) + { + case C_TOKEN( size ): + mrModel.monMarkerSize = rAttribs.getInteger( XML_val, 5 ); + return nullptr; + case C_TOKEN( spPr ): + return new ShapePropertiesContext( *this, mrModel.mxMarkerProp.create() ); + case C_TOKEN( symbol ): + mrModel.monMarkerSymbol = rAttribs.getToken( XML_val, XML_none ); + return nullptr; + } + break; + } + return nullptr; +} + +SeriesContextBase::SeriesContextBase( ContextHandler2Helper& rParent, SeriesModel& rModel ) : + ContextBase< SeriesModel >( rParent, rModel ) +{ +} + +SeriesContextBase::~SeriesContextBase() +{ +} + +ContextHandlerRef SeriesContextBase::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ) +{ + switch( getCurrentElement() ) + { + case C_TOKEN( ser ): + switch( nElement ) + { + case C_TOKEN( idx ): + mrModel.mnIndex = rAttribs.getInteger( XML_val, -1 ); + return nullptr; + case C_TOKEN( order ): + mrModel.mnOrder = rAttribs.getInteger( XML_val, -1 ); + return nullptr; + case C_TOKEN( spPr ): + return new ShapePropertiesContext( *this, mrModel.mxShapeProp.create() ); + case C_TOKEN( tx ): + return new TextContext( *this, mrModel.mxText.create() ); + case C_TOKEN( extLst ): + return this; + } + break; + + case C_TOKEN( marker ): + switch( nElement ) + { + case C_TOKEN( size ): + mrModel.mnMarkerSize = rAttribs.getInteger( XML_val, 5 ); + return nullptr; + case C_TOKEN( spPr ): + return new ShapePropertiesContext( *this, mrModel.mxMarkerProp.create() ); + case C_TOKEN( symbol ): + mrModel.mnMarkerSymbol = rAttribs.getToken( XML_val, XML_none ); + return nullptr; + } + break; + + case C_TOKEN( extLst ): + switch( nElement ) + { + case C_TOKEN( ext ): + if (mrModel.maSources.has( SeriesModel::DATALABELS )) + break; + + DataSourceModel& rLabelsSource = mrModel.maSources.create( SeriesModel::DATALABELS ); + if (mrModel.mxLabels.is()) + mrModel.mxLabels->mpLabelsSource = &rLabelsSource; + return new DataSourceContext( *this, rLabelsSource ); + } + } + return nullptr; +} + +AreaSeriesContext::AreaSeriesContext( ContextHandler2Helper& rParent, SeriesModel& rModel ) : + SeriesContextBase( rParent, rModel ) +{ +} + +AreaSeriesContext::~AreaSeriesContext() +{ +} + +ContextHandlerRef AreaSeriesContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ) +{ + bool bMSO2007Doc = getFilter().isMSO2007Document(); + switch( getCurrentElement() ) + { + case C_TOKEN( ser ): + switch( nElement ) + { + case C_TOKEN( cat ): + return new DataSourceContext( *this, mrModel.maSources.create( SeriesModel::CATEGORIES ) ); + case C_TOKEN( errBars ): + return new ErrorBarContext( *this, mrModel.maErrorBars.create(bMSO2007Doc) ); + case C_TOKEN( dLbls ): + return new DataLabelsContext( *this, mrModel.mxLabels.create(bMSO2007Doc) ); + case C_TOKEN( dPt ): + return new DataPointContext( *this, mrModel.maPoints.create(bMSO2007Doc) ); + case C_TOKEN( trendline ): + return new TrendlineContext( *this, mrModel.maTrendlines.create(bMSO2007Doc) ); + case C_TOKEN( val ): + return new DataSourceContext( *this, mrModel.maSources.create( SeriesModel::VALUES ) ); + } + break; + } + return SeriesContextBase::onCreateContext( nElement, rAttribs ); +} + +BarSeriesContext::BarSeriesContext( ContextHandler2Helper& rParent, SeriesModel& rModel ) : + SeriesContextBase( rParent, rModel ) +{ +} + +BarSeriesContext::~BarSeriesContext() +{ +} + +ContextHandlerRef BarSeriesContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ) +{ + bool bMSO2007Doc = getFilter().isMSO2007Document(); + switch( getCurrentElement() ) + { + case C_TOKEN( ser ): + switch( nElement ) + { + case C_TOKEN( cat ): + return new DataSourceContext( *this, mrModel.maSources.create( SeriesModel::CATEGORIES ) ); + case C_TOKEN( dLbls ): + return new DataLabelsContext( *this, mrModel.mxLabels.create(bMSO2007Doc) ); + case C_TOKEN( dPt ): + return new DataPointContext( *this, mrModel.maPoints.create(bMSO2007Doc) ); + case C_TOKEN( errBars ): + return new ErrorBarContext( *this, mrModel.maErrorBars.create(bMSO2007Doc) ); + case C_TOKEN( invertIfNegative ): + mrModel.mbInvertNeg = rAttribs.getBool( XML_val, !bMSO2007Doc ); + return nullptr; + case C_TOKEN( pictureOptions ): + return new PictureOptionsContext( *this, mrModel.mxPicOptions.create(bMSO2007Doc) ); + case C_TOKEN( shape ): + mrModel.monShape = rAttribs.getToken(XML_val); + return nullptr; + case C_TOKEN( trendline ): + return new TrendlineContext( *this, mrModel.maTrendlines.create(bMSO2007Doc) ); + case C_TOKEN( val ): + return new DataSourceContext( *this, mrModel.maSources.create( SeriesModel::VALUES ) ); + } + break; + } + return SeriesContextBase::onCreateContext( nElement, rAttribs ); +} + +BubbleSeriesContext::BubbleSeriesContext( ContextHandler2Helper& rParent, SeriesModel& rModel ) : + SeriesContextBase( rParent, rModel ) +{ +} + +BubbleSeriesContext::~BubbleSeriesContext() +{ +} + +ContextHandlerRef BubbleSeriesContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ) +{ + bool bMSO2007Doc = getFilter().isMSO2007Document(); + switch( getCurrentElement() ) + { + case C_TOKEN( ser ): + switch( nElement ) + { + case C_TOKEN( bubble3D ): + mrModel.mbBubble3d = rAttribs.getBool( XML_val, !bMSO2007Doc ); + return nullptr; + case C_TOKEN( bubbleSize ): + return new DataSourceContext( *this, mrModel.maSources.create( SeriesModel::POINTS ) ); + case C_TOKEN( dLbls ): + return new DataLabelsContext( *this, mrModel.mxLabels.create(bMSO2007Doc) ); + case C_TOKEN( dPt ): + return new DataPointContext( *this, mrModel.maPoints.create(bMSO2007Doc) ); + case C_TOKEN( errBars ): + return new ErrorBarContext( *this, mrModel.maErrorBars.create(bMSO2007Doc) ); + case C_TOKEN( invertIfNegative ): + mrModel.mbInvertNeg = rAttribs.getBool( XML_val, !bMSO2007Doc ); + return nullptr; + case C_TOKEN( trendline ): + return new TrendlineContext( *this, mrModel.maTrendlines.create(bMSO2007Doc) ); + case C_TOKEN( xVal ): + return new DataSourceContext( *this, mrModel.maSources.create( SeriesModel::CATEGORIES ) ); + case C_TOKEN( yVal ): + return new DataSourceContext( *this, mrModel.maSources.create( SeriesModel::VALUES ) ); + } + break; + } + return SeriesContextBase::onCreateContext( nElement, rAttribs ); +} + +LineSeriesContext::LineSeriesContext( ContextHandler2Helper& rParent, SeriesModel& rModel ) : + SeriesContextBase( rParent, rModel ) +{ +} + +LineSeriesContext::~LineSeriesContext() +{ +} + +ContextHandlerRef LineSeriesContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ) +{ + bool bMSO2007Doc = getFilter().isMSO2007Document(); + switch( getCurrentElement() ) + { + case C_TOKEN( ser ): + switch( nElement ) + { + case C_TOKEN( cat ): + return new DataSourceContext( *this, mrModel.maSources.create( SeriesModel::CATEGORIES ) ); + case C_TOKEN( dLbls ): + return new DataLabelsContext( *this, mrModel.mxLabels.create(bMSO2007Doc) ); + case C_TOKEN( dPt ): + return new DataPointContext( *this, mrModel.maPoints.create(bMSO2007Doc) ); + case C_TOKEN( errBars ): + return new ErrorBarContext( *this, mrModel.maErrorBars.create(bMSO2007Doc) ); + case C_TOKEN( marker ): + return this; + case C_TOKEN( smooth ): + mrModel.mbSmooth = rAttribs.getBool( XML_val, !bMSO2007Doc ); + return nullptr; + case C_TOKEN( trendline ): + return new TrendlineContext( *this, mrModel.maTrendlines.create(bMSO2007Doc) ); + case C_TOKEN( val ): + return new DataSourceContext( *this, mrModel.maSources.create( SeriesModel::VALUES ) ); + } + break; + } + return SeriesContextBase::onCreateContext( nElement, rAttribs ); +} + +PieSeriesContext::PieSeriesContext( ContextHandler2Helper& rParent, SeriesModel& rModel ) : + SeriesContextBase( rParent, rModel ) +{ +} + +PieSeriesContext::~PieSeriesContext() +{ +} + +ContextHandlerRef PieSeriesContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ) +{ + bool bMSO2007Doc = getFilter().isMSO2007Document(); + switch( getCurrentElement() ) + { + case C_TOKEN( ser ): + switch( nElement ) + { + case C_TOKEN( cat ): + return new DataSourceContext( *this, mrModel.maSources.create( SeriesModel::CATEGORIES ) ); + case C_TOKEN( dLbls ): + return new DataLabelsContext( *this, mrModel.mxLabels.create(bMSO2007Doc) ); + case C_TOKEN( dPt ): + return new DataPointContext( *this, mrModel.maPoints.create(bMSO2007Doc) ); + case C_TOKEN( explosion ): + mrModel.mnExplosion = rAttribs.getInteger( XML_val, 0 ); + return nullptr; + case C_TOKEN( val ): + return new DataSourceContext( *this, mrModel.maSources.create( SeriesModel::VALUES ) ); + } + break; + } + return SeriesContextBase::onCreateContext( nElement, rAttribs ); +} + +RadarSeriesContext::RadarSeriesContext( ContextHandler2Helper& rParent, SeriesModel& rModel ) : + SeriesContextBase( rParent, rModel ) +{ +} + +RadarSeriesContext::~RadarSeriesContext() +{ +} + +ContextHandlerRef RadarSeriesContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ) +{ + bool bMSO2007Doc = getFilter().isMSO2007Document(); + switch( getCurrentElement() ) + { + case C_TOKEN( ser ): + switch( nElement ) + { + case C_TOKEN( cat ): + return new DataSourceContext( *this, mrModel.maSources.create( SeriesModel::CATEGORIES ) ); + case C_TOKEN( dLbls ): + return new DataLabelsContext( *this, mrModel.mxLabels.create(bMSO2007Doc) ); + case C_TOKEN( dPt ): + return new DataPointContext( *this, mrModel.maPoints.create(bMSO2007Doc) ); + case C_TOKEN( marker ): + return this; + case C_TOKEN( smooth ): + mrModel.mbSmooth = rAttribs.getBool( XML_val, bMSO2007Doc ); + return nullptr; + case C_TOKEN( val ): + return new DataSourceContext( *this, mrModel.maSources.create( SeriesModel::VALUES ) ); + } + break; + } + return SeriesContextBase::onCreateContext( nElement, rAttribs ); +} + +ScatterSeriesContext::ScatterSeriesContext( ContextHandler2Helper& rParent, SeriesModel& rModel ) : + SeriesContextBase( rParent, rModel ) +{ +} + +ScatterSeriesContext::~ScatterSeriesContext() +{ +} + +ContextHandlerRef ScatterSeriesContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ) +{ + bool bMSO2007Doc = getFilter().isMSO2007Document(); + switch( getCurrentElement() ) + { + case C_TOKEN( ser ): + switch( nElement ) + { + case C_TOKEN( dLbls ): + return new DataLabelsContext( *this, mrModel.mxLabels.create(bMSO2007Doc) ); + case C_TOKEN( dPt ): + return new DataPointContext( *this, mrModel.maPoints.create(bMSO2007Doc) ); + case C_TOKEN( errBars ): + return new ErrorBarContext( *this, mrModel.maErrorBars.create(bMSO2007Doc) ); + case C_TOKEN( marker ): + return this; + case C_TOKEN( smooth ): + mrModel.mbSmooth = rAttribs.getBool( XML_val, !bMSO2007Doc ); + return nullptr; + case C_TOKEN( trendline ): + return new TrendlineContext( *this, mrModel.maTrendlines.create(bMSO2007Doc) ); + case C_TOKEN( xVal ): + return new DataSourceContext( *this, mrModel.maSources.create( SeriesModel::CATEGORIES ) ); + case C_TOKEN( yVal ): + return new DataSourceContext( *this, mrModel.maSources.create( SeriesModel::VALUES ) ); + } + break; + } + return SeriesContextBase::onCreateContext( nElement, rAttribs ); +} + +SurfaceSeriesContext::SurfaceSeriesContext( ContextHandler2Helper& rParent, SeriesModel& rModel ) : + SeriesContextBase( rParent, rModel ) +{ +} + +SurfaceSeriesContext::~SurfaceSeriesContext() +{ +} + +ContextHandlerRef SurfaceSeriesContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ) +{ + switch( getCurrentElement() ) + { + case C_TOKEN( ser ): + switch( nElement ) + { + case C_TOKEN( cat ): + return new DataSourceContext( *this, mrModel.maSources.create( SeriesModel::CATEGORIES ) ); + case C_TOKEN( val ): + return new DataSourceContext( *this, mrModel.maSources.create( SeriesModel::VALUES ) ); + } + break; + } + return SeriesContextBase::onCreateContext( nElement, rAttribs ); +} + +} // namespace oox + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/drawingml/chart/seriesconverter.cxx b/oox/source/drawingml/chart/seriesconverter.cxx new file mode 100644 index 000000000..3ace8e9a7 --- /dev/null +++ b/oox/source/drawingml/chart/seriesconverter.cxx @@ -0,0 +1,920 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace oox::drawingml::chart { + +using namespace com::sun::star; +using namespace ::com::sun::star::beans; +using namespace ::com::sun::star::chart2; +using namespace ::com::sun::star::chart2::data; +using namespace ::com::sun::star::uno; + +namespace { + +Reference< XLabeledDataSequence > lclCreateLabeledDataSequence( + const ConverterRoot& rParent, + DataSourceModel* pValues, const OUString& rRole, + TextModel* pTitle = nullptr ) +{ + // create data sequence for values + Reference< XDataSequence > xValueSeq; + if( pValues ) + { + DataSourceConverter aSourceConv( rParent, *pValues ); + xValueSeq = aSourceConv.createDataSequence( rRole ); + } + + // create data sequence for title + Reference< XDataSequence > xTitleSeq; + if( pTitle ) + { + TextConverter aTextConv( rParent, *pTitle ); + xTitleSeq = aTextConv.createDataSequence( "label" ); + } + + // create the labeled data sequence, if values or title are present + Reference< XLabeledDataSequence > xLabeledSeq; + if( xValueSeq.is() || xTitleSeq.is() ) + { + xLabeledSeq = LabeledDataSequence::create(rParent.getComponentContext()); + if( xLabeledSeq.is() ) + { + xLabeledSeq->setValues( xValueSeq ); + xLabeledSeq->setLabel( xTitleSeq ); + } + } + return xLabeledSeq; +} + +void convertTextProperty(PropertySet& rPropSet, ObjectFormatter& rFormatter, + DataLabelModelBase::TextBodyRef xTextProps) +{ + rFormatter.convertTextFormatting( rPropSet, xTextProps, OBJECTTYPE_DATALABEL ); + ObjectFormatter::convertTextRotation( rPropSet, xTextProps, false ); + ObjectFormatter::convertTextWrap( rPropSet, xTextProps ); +} + +void lclConvertLabelFormatting( PropertySet& rPropSet, ObjectFormatter& rFormatter, + DataLabelModelBase& rDataLabel, const TypeGroupConverter& rTypeGroup, + bool bDataSeriesLabel, bool bCustomLabelField, bool bHasInternalData, bool bMSO2007Doc ) +{ + const TypeGroupInfo& rTypeInfo = rTypeGroup.getTypeInfo(); + + /* Excel 2007 does not change the series setting for a single data point, + if none of some specific elements occur. But only one existing element + in a data point will reset most other of these elements from the series + (e.g.: series has , data point has , this + will reset for this point, unless is repeated + in the data point). The elements , , + , , and are not affected at all. */ + bool bHasAnyElement = true; + if (bMSO2007Doc) + { + bHasAnyElement = rDataLabel.moaSeparator.has() || rDataLabel.monLabelPos.has() || + rDataLabel.mobShowCatName.has() || rDataLabel.mobShowLegendKey.has() || + rDataLabel.mobShowPercent.has() || rDataLabel.mobShowSerName.has() || + rDataLabel.mobShowVal.has(); + } + + bool bShowValue = !rDataLabel.mbDeleted && rDataLabel.mobShowVal.get( !bMSO2007Doc ); + bool bShowPercent = !rDataLabel.mbDeleted && rDataLabel.mobShowPercent.get( !bMSO2007Doc ) && (rTypeInfo.meTypeCategory == TYPECATEGORY_PIE); + bool bShowCateg = !rDataLabel.mbDeleted && rDataLabel.mobShowCatName.get( !bMSO2007Doc ); + bool bShowSerName = !rDataLabel.mbDeleted && rDataLabel.mobShowSerName.get( !bMSO2007Doc ); + bool bShowSymbol = !rDataLabel.mbDeleted && rDataLabel.mobShowLegendKey.get( !bMSO2007Doc ); + + // tdf#132174, tdf#136650: the inner data table has no own cell number format. + if( bHasInternalData && bShowValue && !bShowPercent ) + rDataLabel.maNumberFormat.mbSourceLinked = false; + + // type of attached label + if( bHasAnyElement || rDataLabel.mbDeleted ) + { + DataPointLabel aPointLabel( bShowValue, bShowPercent, bShowCateg, bShowSymbol, bCustomLabelField, bShowSerName ); + rPropSet.setProperty( PROP_Label, aPointLabel ); + } + + if( rDataLabel.mbDeleted ) + return; + + // data label number format (percentage format wins over value format) + rFormatter.convertNumberFormat( rPropSet, rDataLabel.maNumberFormat, false, bShowPercent ); + + // data label text formatting (frame formatting not supported by Chart2) + if( bDataSeriesLabel || (rDataLabel.mxTextProp.is() && !rDataLabel.mxTextProp->getParagraphs().empty()) ) + convertTextProperty(rPropSet, rFormatter, rDataLabel.mxTextProp); + + // data label separator (do not overwrite series separator, if no explicit point separator is present) + // Set the data label separator to "new line" if the value is shown as percentage with a category name, + // just like in MS-Office. In any other case the default separator will be a semicolon. + if( bShowPercent && !bShowValue && ( bDataSeriesLabel || rDataLabel.moaSeparator.has() ) ) + rPropSet.setProperty( PROP_LabelSeparator, rDataLabel.moaSeparator.get( "\n" ) ); + else if( bDataSeriesLabel || rDataLabel.moaSeparator.has() ) + rPropSet.setProperty( PROP_LabelSeparator, rDataLabel.moaSeparator.get( "; " ) ); + + // data label placement (do not overwrite series placement, if no explicit point placement is present) + if( !(bDataSeriesLabel || rDataLabel.monLabelPos.has()) ) + return; + + namespace csscd = ::com::sun::star::chart::DataLabelPlacement; + sal_Int32 nPlacement = -1; + switch( rDataLabel.monLabelPos.get( XML_TOKEN_INVALID ) ) + { + case XML_outEnd: nPlacement = csscd::OUTSIDE; break; + case XML_inEnd: nPlacement = csscd::INSIDE; break; + case XML_ctr: nPlacement = csscd::CENTER; break; + case XML_inBase: nPlacement = csscd::NEAR_ORIGIN; break; + case XML_t: nPlacement = csscd::TOP; break; + case XML_b: nPlacement = csscd::BOTTOM; break; + case XML_l: nPlacement = csscd::LEFT; break; + case XML_r: nPlacement = csscd::RIGHT; break; + case XML_bestFit: nPlacement = csscd::AVOID_OVERLAP; break; + } + + if( !bDataSeriesLabel && nPlacement == -1 ) + return; + + if( nPlacement == -1 ) + nPlacement = rTypeInfo.mnDefLabelPos; + + rPropSet.setProperty( PROP_LabelPlacement, nPlacement ); +} + +void importBorderProperties( PropertySet& rPropSet, Shape& rShape, const GraphicHelper& rGraphicHelper ) +{ + LineProperties& rLP = rShape.getLineProperties(); + // no fill has the same effect as no border so skip it + if (rLP.maLineFill.moFillType.get() == XML_noFill) + return; + + if (rLP.moLineWidth.has()) + { + sal_Int32 nWidth = convertEmuToHmm(rLP.moLineWidth.get()); + rPropSet.setProperty(PROP_LabelBorderWidth, uno::Any(nWidth)); + rPropSet.setProperty(PROP_LabelBorderStyle, uno::Any(drawing::LineStyle_SOLID)); + } + const Color& aColor = rLP.maLineFill.maFillColor; + ::Color nColor = aColor.getColor(rGraphicHelper); + rPropSet.setProperty(PROP_LabelBorderColor, uno::Any(nColor)); +} + +void importFillProperties( PropertySet& rPropSet, Shape& rShape, const GraphicHelper& rGraphicHelper, ModelObjectHelper& rModelObjHelper ) +{ + FillProperties& rFP = rShape.getFillProperties(); + + if (rFP.moFillType.has() && rFP.moFillType.get() == XML_solidFill) + { + rPropSet.setProperty(PROP_LabelFillStyle, drawing::FillStyle_SOLID); + + const Color& aColor = rFP.maFillColor; + ::Color nColor = aColor.getColor(rGraphicHelper); + rPropSet.setProperty(PROP_LabelFillColor, uno::Any(nColor)); + } + else if(rFP.moFillType.has() && rFP.moFillType.get() == XML_pattFill) + { + rPropSet.setProperty(PROP_LabelFillStyle, drawing::FillStyle_HATCH); + rPropSet.setProperty(PROP_LabelFillBackground, true); + + Color aHatchColor( rFP.maPatternProps.maPattFgColor ); + drawing::Hatch aHatch = createHatch(rFP.maPatternProps.moPattPreset.get(), aHatchColor.getColor(rGraphicHelper, 0)); + + OUString sHatchName = rModelObjHelper.insertFillHatch(aHatch); + rPropSet.setProperty(PROP_LabelFillHatchName, sHatchName); + + const Color& aColor = rFP.maPatternProps.maPattBgColor; + ::Color nColor = aColor.getColor(rGraphicHelper); + rPropSet.setProperty(PROP_LabelFillColor, uno::Any(nColor)); + } + +} + +DataPointCustomLabelFieldType lcl_ConvertFieldNameToFieldEnum( std::u16string_view rField ) +{ + if (rField == u"VALUE") + return DataPointCustomLabelFieldType::DataPointCustomLabelFieldType_VALUE; + else if (rField == u"SERIESNAME") + return DataPointCustomLabelFieldType::DataPointCustomLabelFieldType_SERIESNAME; + else if (rField == u"CATEGORYNAME") + return DataPointCustomLabelFieldType::DataPointCustomLabelFieldType_CATEGORYNAME; + else if (rField == u"CELLREF") + return DataPointCustomLabelFieldType::DataPointCustomLabelFieldType_CELLREF; + else if (rField == u"CELLRANGE") + return DataPointCustomLabelFieldType::DataPointCustomLabelFieldType_CELLRANGE; + else if (rField == u"PERCENTAGE") + return DataPointCustomLabelFieldType::DataPointCustomLabelFieldType_PERCENTAGE; + else + return DataPointCustomLabelFieldType::DataPointCustomLabelFieldType_TEXT; +} + +} // namespace + +DataLabelConverter::DataLabelConverter( const ConverterRoot& rParent, DataLabelModel& rModel ) : + ConverterBase< DataLabelModel >( rParent, rModel ) +{ +} + +DataLabelConverter::~DataLabelConverter() +{ +} + +void DataLabelConverter::convertFromModel( const Reference< XDataSeries >& rxDataSeries, const TypeGroupConverter& rTypeGroup ) +{ + if (!rxDataSeries.is()) + return; + + try + { + bool bMSO2007Doc = getFilter().isMSO2007Document(); + bool bHasInternalData = getChartDocument()->hasInternalDataProvider(); + bool bCustomLabelField = mrModel.mxText && mrModel.mxText->mxTextBody && !mrModel.mxText->mxTextBody->getParagraphs().empty(); + PropertySet aPropSet( rxDataSeries->getDataPointByIndex( mrModel.mnIndex ) ); + + lclConvertLabelFormatting( aPropSet, getFormatter(), mrModel, rTypeGroup, false, bCustomLabelField, bHasInternalData, bMSO2007Doc ); + + const TypeGroupInfo& rTypeInfo = rTypeGroup.getTypeInfo(); + bool bIsPie = rTypeInfo.meTypeCategory == TYPECATEGORY_PIE; + + if( mrModel.mxLayout && !mrModel.mxLayout->mbAutoLayout ) + { + RelativePosition aPos(mrModel.mxLayout->mfX, mrModel.mxLayout->mfY, css::drawing::Alignment_TOP_LEFT); + aPropSet.setProperty(PROP_CustomLabelPosition, aPos); + sal_Int32 nPlacement = -1; + if (bIsPie && aPropSet.getProperty(nPlacement, PROP_LabelPlacement) + && nPlacement == css::chart::DataLabelPlacement::AVOID_OVERLAP) + aPropSet.setProperty(PROP_LabelPlacement, css::chart::DataLabelPlacement::CUSTOM); + } + + if (mrModel.mxShapeProp) + { + importBorderProperties(aPropSet, *mrModel.mxShapeProp, getFilter().getGraphicHelper()); + uno::Reference xFactory(getChartDocument(), uno::UNO_QUERY); + ModelObjectHelper& rHelper = getFilter().getModelObjectHelperForModel(xFactory); + importFillProperties(aPropSet, *mrModel.mxShapeProp, getFilter().getGraphicHelper(), + rHelper); + } + if( bCustomLabelField ) + { + css::uno::Reference< XComponentContext > xContext = getComponentContext(); + + auto& rParagraphs = mrModel.mxText->mxTextBody->getParagraphs(); + + int nSequenceSize = 0; + for( auto& pParagraph : rParagraphs ) + nSequenceSize += pParagraph->getRuns().size(); + + int nParagraphs = rParagraphs.size(); + if( nParagraphs > 1 ) + nSequenceSize += nParagraphs - 1; + + OptValue< OUString > oaLabelText; + OptValue< OUString > oaCellRange; + if (mrModel.mobShowDataLabelsRange.get(false)) + { + const DataSourceModel* pLabelSource = mrModel.mrParent.mpLabelsSource; + if (pLabelSource && pLabelSource->mxDataSeq.is()) + { + oaCellRange = pLabelSource->mxDataSeq->maFormula; + const auto& rLabelMap = pLabelSource->mxDataSeq->maData; + const auto& rKV = rLabelMap.find(mrModel.mnIndex); + if (rKV != rLabelMap.end()) + rKV->second >>= oaLabelText.use(); + } + } + + uno::Sequence< css::uno::Reference< XDataPointCustomLabelField > > aSequence( nSequenceSize ); + auto aSequenceRange = asNonConstRange(aSequence); + + int nPos = 0; + + for( auto& pParagraph : rParagraphs ) + { + for( auto& pRun : pParagraph->getRuns() ) + { + css::uno::Reference< XDataPointCustomLabelField > xCustomLabel = DataPointCustomLabelField::create( xContext ); + + // Store properties + oox::PropertySet aPropertySet( xCustomLabel ); + convertTextProperty( aPropertySet, getFormatter(), mrModel.mxText->mxTextBody ); + pRun->getTextCharacterProperties().pushToPropSet( aPropertySet, getFilter() ); + + TextField* pField = nullptr; + if( ( pField = dynamic_cast< TextField* >( pRun.get() ) ) ) + { + DataPointCustomLabelFieldType eType = lcl_ConvertFieldNameToFieldEnum( pField->getType() ); + + if (eType == DataPointCustomLabelFieldType::DataPointCustomLabelFieldType_CELLRANGE && oaCellRange.has()) + { + xCustomLabel->setCellRange( oaCellRange.get() ); + xCustomLabel->setString( oaLabelText.get() ); + xCustomLabel->setDataLabelsRange( true ); + } + else + xCustomLabel->setString( pField->getText() ); + + xCustomLabel->setFieldType( eType ); + xCustomLabel->setGuid( pField->getUuid() ); + } + else if( pRun ) + { + xCustomLabel->setString( pRun->getText() ); + xCustomLabel->setFieldType( DataPointCustomLabelFieldType::DataPointCustomLabelFieldType_TEXT ); + } + aSequenceRange[ nPos++ ] = xCustomLabel; + } + + if( nParagraphs > 1 && nPos < nSequenceSize ) + { + css::uno::Reference< XDataPointCustomLabelField > xCustomLabel = DataPointCustomLabelField::create( xContext ); + xCustomLabel->setFieldType( DataPointCustomLabelFieldType::DataPointCustomLabelFieldType_NEWLINE ); + xCustomLabel->setString("\n"); + aSequenceRange[ nPos++ ] = xCustomLabel; + } + } + + aPropSet.setProperty( PROP_CustomLabelFields, Any( aSequence ) ); + convertTextProperty(aPropSet, getFormatter(), mrModel.mxText->mxTextBody); + } + } + catch( Exception& ) + { + } +} + +DataLabelsConverter::DataLabelsConverter( const ConverterRoot& rParent, DataLabelsModel& rModel ) : + ConverterBase< DataLabelsModel >( rParent, rModel ) +{ +} + +DataLabelsConverter::~DataLabelsConverter() +{ +} + +namespace +{ +/// Inherit text props (if not set) from text props (if set). +void InheritFromDataLabelsTextProps(const DataLabelsModel& rLabels, const DataLabelModel& rLabel) +{ + // See if contains text properties to inherit. + if (!rLabels.mxTextProp.is() || rLabels.mxTextProp->getParagraphs().empty()) + { + return; + } + + const std::shared_ptr& rLabelsParagraph = rLabels.mxTextProp->getParagraphs()[0]; + + // See if lacks text properties. + if (rLabel.mxTextProp.is()) + { + return; + } + + if (!rLabel.mxText || !rLabel.mxText->mxTextBody + || rLabel.mxText->mxTextBody->getParagraphs().empty()) + { + return; + } + + const std::shared_ptr& rLabelParagraph + = rLabel.mxText->mxTextBody->getParagraphs()[0]; + + // Inherit rLabel.mxText's char props from rLabels.mxTextProp's char props. + TextCharacterProperties aCharProps; + aCharProps.assignUsed(rLabelsParagraph->getProperties().getTextCharacterProperties()); + aCharProps.assignUsed(rLabelParagraph->getProperties().getTextCharacterProperties()); + rLabelParagraph->getProperties().getTextCharacterProperties().assignUsed(aCharProps); +} +} + +void DataLabelsConverter::convertFromModel( const Reference< XDataSeries >& rxDataSeries, const TypeGroupConverter& rTypeGroup ) +{ + PropertySet aPropSet( rxDataSeries ); + if( !mrModel.mbDeleted ) + { + bool bMSO2007Doc = getFilter().isMSO2007Document(); + bool bHasInternalData = getChartDocument()->hasInternalDataProvider(); + + lclConvertLabelFormatting( aPropSet, getFormatter(), mrModel, rTypeGroup, true, false, bHasInternalData, bMSO2007Doc ); + + if (mrModel.mxShapeProp) + { + // Import baseline border properties for these data labels. + importBorderProperties(aPropSet, *mrModel.mxShapeProp, getFilter().getGraphicHelper()); + uno::Reference xFactory(getChartDocument(), uno::UNO_QUERY); + ModelObjectHelper& rHelper = getFilter().getModelObjectHelperForModel(xFactory); + importFillProperties(aPropSet, *mrModel.mxShapeProp, getFilter().getGraphicHelper(), + rHelper); + } + } + // import leaderline of data labels + if( !mrModel.mbShowLeaderLines ) + aPropSet.setProperty( PROP_ShowCustomLeaderLines, false ); + + // data point label settings + for (auto const& pointLabel : mrModel.maPointLabels) + { + if (pointLabel->maNumberFormat.maFormatCode.isEmpty()) + pointLabel->maNumberFormat = mrModel.maNumberFormat; + InheritFromDataLabelsTextProps(mrModel, *pointLabel); + + DataLabelConverter aLabelConv(*this, *pointLabel); + aLabelConv.convertFromModel( rxDataSeries, rTypeGroup ); + } +} + +ErrorBarConverter::ErrorBarConverter( const ConverterRoot& rParent, ErrorBarModel& rModel ) : + ConverterBase< ErrorBarModel >( rParent, rModel ) +{ +} + +ErrorBarConverter::~ErrorBarConverter() +{ +} + +void ErrorBarConverter::convertFromModel( const Reference< XDataSeries >& rxDataSeries ) +{ + bool bShowPos = (mrModel.mnTypeId == XML_plus) || (mrModel.mnTypeId == XML_both); + bool bShowNeg = (mrModel.mnTypeId == XML_minus) || (mrModel.mnTypeId == XML_both); + if( !(bShowPos || bShowNeg) ) + return; + + try + { + Reference< XPropertySet > xErrorBar( createInstance( "com.sun.star.chart2.ErrorBar" ), UNO_QUERY_THROW ); + PropertySet aBarProp( xErrorBar ); + + // plus/minus bars + aBarProp.setProperty( PROP_ShowPositiveError, bShowPos ); + aBarProp.setProperty( PROP_ShowNegativeError, bShowNeg ); + + // type of displayed error + namespace cssc = ::com::sun::star::chart; + switch( mrModel.mnValueType ) + { + case XML_cust: + { + // #i87806# manual error bars + aBarProp.setProperty( PROP_ErrorBarStyle, cssc::ErrorBarStyle::FROM_DATA ); + // attach data sequences to error bar + Reference< XDataSink > xDataSink( xErrorBar, UNO_QUERY ); + if( xDataSink.is() ) + { + // create vector of all value sequences + ::std::vector< Reference< XLabeledDataSequence > > aLabeledSeqVec; + // add positive values + if( bShowPos ) + { + Reference< XLabeledDataSequence > xValueSeq = createLabeledDataSequence( ErrorBarModel::PLUS ); + if( xValueSeq.is() ) + aLabeledSeqVec.push_back( xValueSeq ); + } + // add negative values + if( bShowNeg ) + { + Reference< XLabeledDataSequence > xValueSeq = createLabeledDataSequence( ErrorBarModel::MINUS ); + if( xValueSeq.is() ) + aLabeledSeqVec.push_back( xValueSeq ); + } + // attach labeled data sequences to series + if( aLabeledSeqVec.empty() ) + xErrorBar.clear(); + else + xDataSink->setData( comphelper::containerToSequence( aLabeledSeqVec ) ); + } + } + break; + case XML_fixedVal: + aBarProp.setProperty( PROP_ErrorBarStyle, cssc::ErrorBarStyle::ABSOLUTE ); + aBarProp.setProperty( PROP_PositiveError, mrModel.mfValue ); + aBarProp.setProperty( PROP_NegativeError, mrModel.mfValue ); + break; + case XML_percentage: + aBarProp.setProperty( PROP_ErrorBarStyle, cssc::ErrorBarStyle::RELATIVE ); + aBarProp.setProperty( PROP_PositiveError, mrModel.mfValue ); + aBarProp.setProperty( PROP_NegativeError, mrModel.mfValue ); + break; + case XML_stdDev: + aBarProp.setProperty( PROP_ErrorBarStyle, cssc::ErrorBarStyle::STANDARD_DEVIATION ); + aBarProp.setProperty( PROP_Weight, mrModel.mfValue ); + break; + case XML_stdErr: + aBarProp.setProperty( PROP_ErrorBarStyle, cssc::ErrorBarStyle::STANDARD_ERROR ); + break; + default: + OSL_FAIL( "ErrorBarConverter::convertFromModel - unknown error bar type" ); + xErrorBar.clear(); + } + + // error bar formatting + getFormatter().convertFrameFormatting( aBarProp, mrModel.mxShapeProp, OBJECTTYPE_ERRORBAR ); + + if( xErrorBar.is() ) + { + PropertySet aSeriesProp( rxDataSeries ); + switch( mrModel.mnDirection ) + { + case XML_x: aSeriesProp.setProperty( PROP_ErrorBarX, xErrorBar ); break; + case XML_y: aSeriesProp.setProperty( PROP_ErrorBarY, xErrorBar ); break; + default: OSL_FAIL( "ErrorBarConverter::convertFromModel - invalid error bar direction" ); + } + } + } + catch( Exception& ) + { + OSL_FAIL( "ErrorBarConverter::convertFromModel - error while creating error bars" ); + } +} + +Reference< XLabeledDataSequence > ErrorBarConverter::createLabeledDataSequence( ErrorBarModel::SourceType eSourceType ) +{ + OUString aRole; + switch( eSourceType ) + { + case ErrorBarModel::PLUS: + switch( mrModel.mnDirection ) + { + case XML_x: aRole = "error-bars-x-positive"; break; + case XML_y: aRole = "error-bars-y-positive"; break; + } + break; + case ErrorBarModel::MINUS: + switch( mrModel.mnDirection ) + { + case XML_x: aRole = "error-bars-x-negative"; break; + case XML_y: aRole = "error-bars-y-negative"; break; + } + break; + } + OSL_ENSURE( !aRole.isEmpty(), "ErrorBarConverter::createLabeledDataSequence - invalid error bar direction" ); + return lclCreateLabeledDataSequence( *this, mrModel.maSources.get( eSourceType ).get(), aRole ); +} + +TrendlineLabelConverter::TrendlineLabelConverter( const ConverterRoot& rParent, TrendlineLabelModel& rModel ) : + ConverterBase< TrendlineLabelModel >( rParent, rModel ) +{ +} + +TrendlineLabelConverter::~TrendlineLabelConverter() +{ +} + +void TrendlineLabelConverter::convertFromModel( PropertySet& rPropSet ) +{ + // formatting + getFormatter().convertFormatting( rPropSet, mrModel.mxShapeProp, mrModel.mxTextProp, OBJECTTYPE_TRENDLINELABEL ); +} + +TrendlineConverter::TrendlineConverter( const ConverterRoot& rParent, TrendlineModel& rModel ) : + ConverterBase< TrendlineModel >( rParent, rModel ) +{ +} + +TrendlineConverter::~TrendlineConverter() +{ +} + +void TrendlineConverter::convertFromModel( const Reference< XDataSeries >& rxDataSeries ) +{ + try + { + // trend line type + OUString aServiceName; + switch( mrModel.mnTypeId ) + { + case XML_exp: + aServiceName = "com.sun.star.chart2.ExponentialRegressionCurve"; + break; + case XML_linear: + aServiceName = "com.sun.star.chart2.LinearRegressionCurve"; + break; + case XML_log: + aServiceName = "com.sun.star.chart2.LogarithmicRegressionCurve"; + break; + case XML_movingAvg: + aServiceName = "com.sun.star.chart2.MovingAverageRegressionCurve"; + break; + case XML_poly: + aServiceName = "com.sun.star.chart2.PolynomialRegressionCurve"; + break; + case XML_power: + aServiceName = "com.sun.star.chart2.PotentialRegressionCurve"; + break; + default: + OSL_FAIL( "TrendlineConverter::convertFromModel - unknown trendline type" ); + } + if( !aServiceName.isEmpty() ) + { + Reference< XRegressionCurve > xRegCurve( createInstance( aServiceName ), UNO_QUERY_THROW ); + PropertySet aPropSet( xRegCurve ); + + // Name + aPropSet.setProperty( PROP_CurveName, mrModel.maName ); + aPropSet.setProperty( PROP_PolynomialDegree, mrModel.mnOrder ); + aPropSet.setProperty( PROP_MovingAveragePeriod, mrModel.mnPeriod ); + + // Intercept + bool hasIntercept = mrModel.mfIntercept.has(); + aPropSet.setProperty( PROP_ForceIntercept, hasIntercept); + if (hasIntercept) + aPropSet.setProperty( PROP_InterceptValue, mrModel.mfIntercept.get()); + + // Extrapolation + if (mrModel.mfForward.has()) + aPropSet.setProperty( PROP_ExtrapolateForward, mrModel.mfForward.get() ); + if (mrModel.mfBackward.has()) + aPropSet.setProperty( PROP_ExtrapolateBackward, mrModel.mfBackward.get() ); + + // trendline formatting + getFormatter().convertFrameFormatting( aPropSet, mrModel.mxShapeProp, OBJECTTYPE_TRENDLINE ); + + // #i83100# show equation and correlation coefficient + PropertySet aLabelProp( xRegCurve->getEquationProperties() ); + aLabelProp.setProperty( PROP_ShowEquation, mrModel.mbDispEquation ); + aLabelProp.setProperty( PROP_ShowCorrelationCoefficient, mrModel.mbDispRSquared ); + + // #i83100# formatting of the equation text box + if( mrModel.mbDispEquation || mrModel.mbDispRSquared ) + { + TrendlineLabelConverter aLabelConv( *this, mrModel.mxLabel.getOrCreate() ); + aLabelConv.convertFromModel( aLabelProp ); + } + + // unsupported: #i5085# manual trendline size + // unsupported: #i34093# manual crossing point + + Reference< XRegressionCurveContainer > xRegCurveCont( rxDataSeries, UNO_QUERY_THROW ); + xRegCurveCont->addRegressionCurve( xRegCurve ); + } + } + catch( Exception& ) + { + OSL_FAIL( "TrendlineConverter::convertFromModel - error while creating trendline" ); + } +} + +DataPointConverter::DataPointConverter( const ConverterRoot& rParent, DataPointModel& rModel ) : + ConverterBase< DataPointModel >( rParent, rModel ) +{ +} + +DataPointConverter::~DataPointConverter() +{ +} + +void DataPointConverter::convertFromModel( const Reference< XDataSeries >& rxDataSeries, + const TypeGroupConverter& rTypeGroup, const SeriesModel& rSeries ) +{ + bool bMSO2007Doc = getFilter().isMSO2007Document(); + try + { + PropertySet aPropSet( rxDataSeries->getDataPointByIndex( mrModel.mnIndex ) ); + + // data point marker + if( mrModel.monMarkerSymbol.differsFrom( rSeries.mnMarkerSymbol ) || mrModel.monMarkerSize.differsFrom( rSeries.mnMarkerSize ) ) + rTypeGroup.convertMarker( aPropSet, mrModel.monMarkerSymbol.get( rSeries.mnMarkerSymbol ), + mrModel.monMarkerSize.get( rSeries.mnMarkerSize ), mrModel.mxMarkerProp ); + + // data point pie explosion + if( mrModel.monExplosion.differsFrom( rSeries.mnExplosion ) ) + rTypeGroup.convertPieExplosion( aPropSet, mrModel.monExplosion.get() ); + + // point formatting + if( mrModel.mxShapeProp.is() ) + { + if( rTypeGroup.getTypeInfo().mbPictureOptions ) + getFormatter().convertFrameFormatting( aPropSet, mrModel.mxShapeProp, mrModel.mxPicOptions.getOrCreate(bMSO2007Doc), rTypeGroup.getSeriesObjectType(), rSeries.mnIndex ); + else + getFormatter().convertFrameFormatting( aPropSet, mrModel.mxShapeProp, rTypeGroup.getSeriesObjectType(), rSeries.mnIndex ); + } + else if (rSeries.mxShapeProp.is()) + { + getFormatter().convertFrameFormatting( aPropSet, rSeries.mxShapeProp, rTypeGroup.getSeriesObjectType(), rSeries.mnIndex ); + } + } + catch( Exception& ) + { + } +} + +SeriesConverter::SeriesConverter( const ConverterRoot& rParent, SeriesModel& rModel ) : + ConverterBase< SeriesModel >( rParent, rModel ) +{ +} + +SeriesConverter::~SeriesConverter() +{ +} + +Reference< XLabeledDataSequence > SeriesConverter::createCategorySequence( const OUString& rRole ) +{ + return createLabeledDataSequence(SeriesModel::CATEGORIES, rRole, false); +} + +Reference< XLabeledDataSequence > SeriesConverter::createValueSequence( const OUString& rRole ) +{ + return createLabeledDataSequence( SeriesModel::VALUES, rRole, true ); +} + +Reference< XDataSeries > SeriesConverter::createDataSeries( const TypeGroupConverter& rTypeGroup, bool bVaryColorsByPoint ) +{ + const TypeGroupInfo& rTypeInfo = rTypeGroup.getTypeInfo(); + + // create the data series object + Reference< XDataSeries > xDataSeries( createInstance( "com.sun.star.chart2.DataSeries" ), UNO_QUERY ); + PropertySet aSeriesProp( xDataSeries ); + + // attach data and title sequences to series + sal_Int32 nDataPointCount = 0; + Reference< XDataSink > xDataSink( xDataSeries, UNO_QUERY ); + if( xDataSink.is() ) + { + // create vector of all value sequences + ::std::vector< Reference< XLabeledDataSequence > > aLabeledSeqVec; + // add Y values + Reference< XLabeledDataSequence > xYValueSeq = createValueSequence( "values-y" ); + if( xYValueSeq.is() ) + { + aLabeledSeqVec.push_back( xYValueSeq ); + Reference< XDataSequence > xValues = xYValueSeq->getValues(); + if( xValues.is() ) + nDataPointCount = xValues->getData().getLength(); + + if (!nDataPointCount) + // No values present. Don't create a data series. + return Reference(); + } + // add X values of scatter and bubble charts + if( !rTypeInfo.mbCategoryAxis ) + { + Reference< XLabeledDataSequence > xXValueSeq = createCategorySequence( "values-x" ); + if( xXValueSeq.is() ) + aLabeledSeqVec.push_back( xXValueSeq ); + // add size values of bubble charts + if( rTypeInfo.meTypeId == TYPEID_BUBBLE ) + { + Reference< XLabeledDataSequence > xSizeValueSeq = createLabeledDataSequence( SeriesModel::POINTS, "values-size", true ); + if( xSizeValueSeq.is() ) + aLabeledSeqVec.push_back( xSizeValueSeq ); + } + } + // attach labeled data sequences to series + if( !aLabeledSeqVec.empty() ) + xDataSink->setData( comphelper::containerToSequence( aLabeledSeqVec ) ); + } + + // error bars + for (auto const& errorBar : mrModel.maErrorBars) + { + ErrorBarConverter aErrorBarConv(*this, *errorBar); + aErrorBarConv.convertFromModel( xDataSeries ); + } + + // trendlines + for (auto const& trendLine : mrModel.maTrendlines) + { + TrendlineConverter aTrendlineConv(*this, *trendLine); + aTrendlineConv.convertFromModel( xDataSeries ); + } + + // data point markers + rTypeGroup.convertMarker( aSeriesProp, mrModel.mnMarkerSymbol, mrModel.mnMarkerSize, mrModel.mxMarkerProp ); +#if OOX_CHART_SMOOTHED_PER_SERIES + // #i66858# smoothed series lines + rTypeGroup.convertLineSmooth( aSeriesProp, mrModel.mbSmooth ); +#endif + // 3D bar style (not possible to set at chart type -> set at all series) + rTypeGroup.convertBarGeometry( aSeriesProp, mrModel.monShape.get( rTypeGroup.getModel().mnShape ) ); + // pie explosion (restricted to [0%,100%] in Chart2) + rTypeGroup.convertPieExplosion( aSeriesProp, mrModel.mnExplosion ); + + // series formatting + ObjectFormatter& rFormatter = getFormatter(); + ObjectType eObjType = rTypeGroup.getSeriesObjectType(); + bool bMSO2007Doc = getFilter().isMSO2007Document(); + if( rTypeInfo.mbPictureOptions ) + rFormatter.convertFrameFormatting( aSeriesProp, mrModel.mxShapeProp, mrModel.mxPicOptions.getOrCreate(bMSO2007Doc), eObjType, mrModel.mnIndex ); + else + rFormatter.convertFrameFormatting( aSeriesProp, mrModel.mxShapeProp, eObjType, mrModel.mnIndex ); + + // set the (unused) property default value used by the Chart2 templates (true for pie/doughnut charts) + bool bIsPie = rTypeInfo.meTypeCategory == TYPECATEGORY_PIE; + aSeriesProp.setProperty( PROP_VaryColorsByPoint, bVaryColorsByPoint ); + + // own area formatting for every data point (TODO: varying line color not supported) + // #i91271# always set area formatting for every point in pie/doughnut charts to override their automatic point formatting + if( bIsPie || (bVaryColorsByPoint && rTypeGroup.isSeriesFrameFormat() && ObjectFormatter::isAutomaticFill( mrModel.mxShapeProp )) ) + { + /* Set the series point number as color cycle size at the object + formatter to get correct start-shade/end-tint. TODO: in doughnut + charts, the sizes of the series may vary, need to use the maximum + point count of all series. */ + sal_Int32 nOldMax = rFormatter.getMaxSeriesIndex(); + if( bVaryColorsByPoint ) + rFormatter.setMaxSeriesIndex( nDataPointCount - 1 ); + for( sal_Int32 nIndex = 0; nIndex < nDataPointCount; ++nIndex ) + { + try + { + PropertySet aPointProp( xDataSeries->getDataPointByIndex( nIndex ) ); + rFormatter.convertAutomaticFill( aPointProp, eObjType, bVaryColorsByPoint ? nIndex : mrModel.mnIndex ); + } + catch( Exception& ) + { + } + } + rFormatter.setMaxSeriesIndex( nOldMax ); + } + + // data point settings + for (auto const& point : mrModel.maPoints) + { + DataPointConverter aPointConv(*this, *point); + aPointConv.convertFromModel( xDataSeries, rTypeGroup, mrModel ); + } + + /* Series data label settings. If and only if the series does not contain + a c:dLbls element, then the c:dLbls element of the parent chart type is + used (data label settings of the parent chart type are *not* merged + into own existing data label settings). */ + ModelRef< DataLabelsModel > xLabels = mrModel.mxLabels.is() ? mrModel.mxLabels : rTypeGroup.getModel().mxLabels; + if( xLabels.is() ) + { + if( xLabels->maNumberFormat.maFormatCode.isEmpty() ) + { + // Use number format code from Value series + DataSourceModel* pValues = mrModel.maSources.get( SeriesModel::VALUES ).get(); + if( pValues ) + xLabels->maNumberFormat.maFormatCode = pValues->mxDataSeq->maFormatCode; + } + DataLabelsConverter aLabelsConv( *this, *xLabels ); + aLabelsConv.convertFromModel( xDataSeries, rTypeGroup ); + } + + return xDataSeries; +} + +// private -------------------------------------------------------------------- + +Reference< XLabeledDataSequence > SeriesConverter::createLabeledDataSequence( + SeriesModel::SourceType eSourceType, const OUString& rRole, bool bUseTextLabel ) +{ + DataSourceModel* pValues = mrModel.maSources.get( eSourceType ).get(); + TextModel* pTitle = bUseTextLabel ? mrModel.mxText.get() : nullptr; + return lclCreateLabeledDataSequence( *this, pValues, rRole, pTitle ); +} + +} // namespace oox + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/drawingml/chart/seriesmodel.cxx b/oox/source/drawingml/chart/seriesmodel.cxx new file mode 100644 index 000000000..95b0deb22 --- /dev/null +++ b/oox/source/drawingml/chart/seriesmodel.cxx @@ -0,0 +1,127 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include +#include + +namespace oox::drawingml::chart { + +DataLabelModelBase::DataLabelModelBase(bool bMSO2007Doc) : + mbDeleted( !bMSO2007Doc ) +{ +} + +DataLabelModelBase::~DataLabelModelBase() +{ +} + +DataLabelModel::DataLabelModel(const DataLabelsModel& rParent, bool bMSO2007Doc) : + DataLabelModelBase(bMSO2007Doc), + mrParent( rParent ), + mnIndex( -1 ) +{ +} + +DataLabelModel::~DataLabelModel() +{ +} + +DataLabelsModel::DataLabelsModel(bool bMSO2007Doc) : + DataLabelModelBase(bMSO2007Doc), + mpLabelsSource( nullptr ), + mbShowLeaderLines( !bMSO2007Doc ) +{ +} + +DataLabelsModel::~DataLabelsModel() +{ +} + +PictureOptionsModel::PictureOptionsModel(bool bMSO2007Doc) : + mfStackUnit( 1.0 ), + mnPictureFormat( XML_stretch ), + mbApplyToFront( !bMSO2007Doc ), + mbApplyToSides( !bMSO2007Doc ), + mbApplyToEnd( !bMSO2007Doc ) +{ +} + +ErrorBarModel::ErrorBarModel(bool bMSO2007Doc) : + mfValue( 0.0 ), + mnDirection( XML_y ), + mnTypeId( XML_both ), + mnValueType( XML_fixedVal ), + mbNoEndCap( !bMSO2007Doc ) +{ +} + +ErrorBarModel::~ErrorBarModel() +{ +} + +TrendlineLabelModel::TrendlineLabelModel() +{ +} + +TrendlineLabelModel::~TrendlineLabelModel() +{ +} + +TrendlineModel::TrendlineModel(bool bMSO2007Doc) : + mnOrder( 2 ), + mnPeriod( 2 ), + mnTypeId( XML_linear ), + mbDispEquation( !bMSO2007Doc ), + mbDispRSquared( !bMSO2007Doc ) +{ +} + +TrendlineModel::~TrendlineModel() +{ +} + +DataPointModel::DataPointModel(bool bMSO2007Doc) : + mnIndex( -1 ), + mbInvertNeg( !bMSO2007Doc ) +{ +} + +DataPointModel::~DataPointModel() +{ +} + +SeriesModel::SeriesModel(bool bMSO2007Doc) : + mnExplosion( 0 ), + mnIndex( -1 ), + mnMarkerSize( 5 ), + mnMarkerSymbol( XML_auto ), + mnOrder( -1 ), + mbBubble3d( !bMSO2007Doc ), + mbInvertNeg( !bMSO2007Doc ), + mbSmooth( !bMSO2007Doc ) +{ +} + +SeriesModel::~SeriesModel() +{ +} + +} // namespace oox::drawingml::chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/drawingml/chart/titlecontext.cxx b/oox/source/drawingml/chart/titlecontext.cxx new file mode 100644 index 000000000..04a4ea706 --- /dev/null +++ b/oox/source/drawingml/chart/titlecontext.cxx @@ -0,0 +1,176 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include + +#include +#include +#include +#include +#include +#include +#include + +#include + + +namespace oox::drawingml::chart { + +using ::oox::core::ContextHandler2Helper; +using ::oox::core::ContextHandlerRef; + +TextContext::TextContext( ContextHandler2Helper& rParent, TextModel& rModel ) : + ContextBase< TextModel >( rParent, rModel ) +{ +} + +TextContext::~TextContext() +{ +} + +ContextHandlerRef TextContext::onCreateContext( sal_Int32 nElement, const AttributeList& ) +{ + // this context handler is used for and embedded elements + if( isCurrentElement( C_TOKEN( tx ) ) ) switch( nElement ) + { + case C_TOKEN( rich ): + return new TextBodyContext( *this, mrModel.mxTextBody.create() ); + + case C_TOKEN( strRef ): + OSL_ENSURE( !mrModel.mxDataSeq, "TextContext::onCreateContext - multiple data sequences" ); + return new StringSequenceContext( *this, mrModel.mxDataSeq.create() ); + + case C_TOKEN( v ): + OSL_ENSURE( !mrModel.mxDataSeq, "TextContext::onCreateContext - multiple data sequences" ); + return this; // collect value in onCharacters() + } + return nullptr; +} + +void TextContext::onCharacters( const OUString& rChars ) +{ + if( isCurrentElement( C_TOKEN( v ) ) ) + { + // Static text is stored as a single string formula token for Excel document. + mrModel.mxDataSeq.create().maFormula = "\"" + rChars + "\""; + + // Also store it as a single element type for non-Excel document. + mrModel.mxDataSeq->maData[0] <<= rChars; + mrModel.mxDataSeq->mnPointCount = 1; + } +} + +TitleContext::TitleContext( ContextHandler2Helper& rParent, TitleModel& rModel ) : + ContextBase< TitleModel >( rParent, rModel ) +{ +} + +TitleContext::~TitleContext() +{ +} + +ContextHandlerRef TitleContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ) +{ + // this context handler is used for only + switch( nElement ) + { + case C_TOKEN( layout ): + return new LayoutContext( *this, mrModel.mxLayout.create() ); + + case C_TOKEN( overlay ): + mrModel.mbOverlay = rAttribs.getBool( XML_val, true ); + return nullptr; + + case C_TOKEN( spPr ): + return new ShapePropertiesContext( *this, mrModel.mxShapeProp.create() ); + + case C_TOKEN( tx ): + return new TextContext( *this, mrModel.mxText.create() ); + + case C_TOKEN( txPr ): + return new TextBodyContext( *this, mrModel.mxTextProp.create() ); + } + return nullptr; +} + +LegendEntryContext::LegendEntryContext( ContextHandler2Helper& rParent, LegendEntryModel& rModel ) : + ContextBase< LegendEntryModel >( rParent, rModel ) +{ +} + +LegendEntryContext::~LegendEntryContext() +{ +} + +ContextHandlerRef LegendEntryContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ) +{ + // this context handler is used for only + switch( nElement ) + { + case C_TOKEN( idx ): + mrModel.mnLegendEntryIdx = rAttribs.getInteger( XML_val, -1 ); + return nullptr; + + case C_TOKEN( delete ): + mrModel.mbLabelDeleted = rAttribs.getBool( XML_val, true ); + return nullptr; + } + return nullptr; +} + +LegendContext::LegendContext( ContextHandler2Helper& rParent, LegendModel& rModel ) : + ContextBase< LegendModel >( rParent, rModel ) +{ +} + +LegendContext::~LegendContext() +{ +} + +ContextHandlerRef LegendContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ) +{ + // this context handler is used for only + switch( nElement ) + { + case C_TOKEN( layout ): + return new LayoutContext( *this, mrModel.mxLayout.create() ); + + case C_TOKEN( legendPos ): + mrModel.mnPosition = rAttribs.getToken( XML_val, XML_r ); + return nullptr; + + case C_TOKEN( legendEntry ): + return new LegendEntryContext( *this, mrModel.maLegendEntries.create() ); + + case C_TOKEN( overlay ): + mrModel.mbOverlay = rAttribs.getBool( XML_val, true ); + return nullptr; + + case C_TOKEN( spPr ): + return new ShapePropertiesContext( *this, mrModel.mxShapeProp.create() ); + + case C_TOKEN( txPr ): + return new TextBodyContext( *this, mrModel.mxTextProp.create() ); + } + return nullptr; +} + +} // namespace oox::drawingml::chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/drawingml/chart/titleconverter.cxx b/oox/source/drawingml/chart/titleconverter.cxx new file mode 100644 index 000000000..91684393c --- /dev/null +++ b/oox/source/drawingml/chart/titleconverter.cxx @@ -0,0 +1,363 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +namespace oox::drawingml::chart { + +using namespace ::com::sun::star::awt; +using namespace ::com::sun::star::chart2; +using namespace ::com::sun::star::chart2::data; +using namespace ::com::sun::star::drawing; +using namespace ::com::sun::star::uno; + + +TextConverter::TextConverter( const ConverterRoot& rParent, TextModel& rModel ) : + ConverterBase< TextModel >( rParent, rModel ) +{ +} + +TextConverter::~TextConverter() +{ +} + +Reference< XDataSequence > TextConverter::createDataSequence( const OUString& rRole ) +{ + Reference< XDataSequence > xDataSeq; + if( mrModel.mxDataSeq.is() ) + { + DataSequenceConverter aDataSeqConv( *this, *mrModel.mxDataSeq ); + xDataSeq = aDataSeqConv.createDataSequence( rRole ); + } + return xDataSeq; +} + +Sequence< Reference< XFormattedString > > TextConverter::createStringSequence( + const OUString& rDefaultText, const ModelRef< TextBody >& rxTextProp, ObjectType eObjType ) +{ + OSL_ENSURE( !mrModel.mxDataSeq || !mrModel.mxTextBody, "TextConverter::createStringSequence - linked string and rich text found" ); + ::std::vector< Reference< XFormattedString > > aStringVec; + if( mrModel.mxTextBody.is() ) + { + // rich-formatted text objects can be created, but currently Chart2 is not able to show them + const TextParagraphVector& rTextParas = mrModel.mxTextBody->getParagraphs(); + for( TextParagraphVector::const_iterator aPIt = rTextParas.begin(), aPEnd = rTextParas.end(); aPIt != aPEnd; ++aPIt ) + { + const TextParagraph& rTextPara = **aPIt; + const TextCharacterProperties& rParaProps = rTextPara.getProperties().getTextCharacterProperties(); + for( TextRunVector::const_iterator aRIt = rTextPara.getRuns().begin(), aREnd = rTextPara.getRuns().end(); aRIt != aREnd; ++aRIt ) + { + const TextRun& rTextRun = **aRIt; + bool bAddNewLine = ((aRIt + 1 == aREnd) && (aPIt + 1 != aPEnd)) || rTextRun.isLineBreak(); + Reference< XFormattedString > xFmtStr = appendFormattedString( aStringVec, rTextRun.getText(), bAddNewLine ); + PropertySet aPropSet( xFmtStr ); + TextCharacterProperties aRunProps( rParaProps ); + aRunProps.assignUsed( rTextRun.getTextCharacterProperties() ); + getFormatter().convertTextFormatting( aPropSet, aRunProps, eObjType ); + } + } + } + else + { + OUString aString; + // try to create string from linked data + if( mrModel.mxDataSeq.is() && !mrModel.mxDataSeq->maData.empty() ) + mrModel.mxDataSeq->maData.begin()->second >>= aString; + // no linked string -> fall back to default string + if( aString.isEmpty() ) + aString = rDefaultText; + + // create formatted string object + if( !aString.isEmpty() ) + { + Reference< XFormattedString > xFmtStr = appendFormattedString( aStringVec, aString, false ); + PropertySet aPropSet( xFmtStr ); + getFormatter().convertTextFormatting( aPropSet, rxTextProp, eObjType ); + } + } + + return comphelper::containerToSequence( aStringVec ); +} + +Reference< XFormattedString > TextConverter::appendFormattedString( + ::std::vector< Reference< XFormattedString > >& orStringVec, const OUString& rString, bool bAddNewLine ) const +{ + Reference< XFormattedString2 > xFmtStr; + try + { + xFmtStr = FormattedString::create( ConverterRoot::getComponentContext() ); + xFmtStr->setString( bAddNewLine ? (rString + "\n") : rString ); + orStringVec.emplace_back(xFmtStr ); + } + catch( Exception& ) + { + } + return xFmtStr; +} + +TitleConverter::TitleConverter( const ConverterRoot& rParent, TitleModel& rModel ) : + ConverterBase< TitleModel >( rParent, rModel ) +{ +} + +TitleConverter::~TitleConverter() +{ +} + +void TitleConverter::convertFromModel( const Reference< XTitled >& rxTitled, const OUString& rAutoTitle, ObjectType eObjType, sal_Int32 nMainIdx, sal_Int32 nSubIdx ) +{ + if( !rxTitled.is() ) + return; + + // create the formatted strings + TextModel& rText = mrModel.mxText.getOrCreate(); + TextConverter aTextConv( *this, rText ); + Sequence< Reference< XFormattedString > > aStringSeq = aTextConv.createStringSequence( rAutoTitle, mrModel.mxTextProp, eObjType ); + if( !aStringSeq.hasElements() ) + return; + + try + { + // create the title object and set the string data + Reference< XTitle > xTitle( createInstance( "com.sun.star.chart2.Title" ), UNO_QUERY_THROW ); + xTitle->setText( aStringSeq ); + rxTitled->setTitleObject( xTitle ); + + // frame formatting (text formatting already done in TextConverter::createStringSequence()) + PropertySet aPropSet( xTitle ); + getFormatter().convertFrameFormatting( aPropSet, mrModel.mxShapeProp, eObjType ); + + // frame rotation + OSL_ENSURE( !mrModel.mxTextProp || !rText.mxTextBody, "TitleConverter::convertFromModel - multiple text properties" ); + ModelRef< TextBody > xTextProp = mrModel.mxTextProp.is() ? mrModel.mxTextProp : rText.mxTextBody; + ObjectFormatter::convertTextRotation( aPropSet, xTextProp, true, mrModel.mnDefaultRotation ); + + // register the title and layout data for conversion of position + registerTitleLayout( xTitle, mrModel.mxLayout, eObjType, nMainIdx, nSubIdx ); + } + catch( Exception& ) + { + } +} + +LegendConverter::LegendConverter( const ConverterRoot& rParent, LegendModel& rModel ) : + ConverterBase< LegendModel >( rParent, rModel ) +{ +} + +LegendConverter::~LegendConverter() +{ +} + +void LegendConverter::convertFromModel( const Reference< XDiagram >& rxDiagram ) +{ + if( !rxDiagram.is() ) + return; + + try + { + namespace cssc = ::com::sun::star::chart; + namespace cssc2 = ::com::sun::star::chart2; + + // create the legend + Reference< XLegend > xLegend( createInstance( "com.sun.star.chart2.Legend" ), UNO_QUERY_THROW ); + rxDiagram->setLegend( xLegend ); + PropertySet aPropSet( xLegend ); + aPropSet.setProperty( PROP_Show, true ); + + // legend formatting + getFormatter().convertFormatting( aPropSet, mrModel.mxShapeProp, mrModel.mxTextProp, OBJECTTYPE_LEGEND ); + + // predefined legend position and expansion + cssc2::LegendPosition eLegendPos = cssc2::LegendPosition_LINE_END; + cssc::ChartLegendExpansion eLegendExpand = cssc::ChartLegendExpansion_CUSTOM; + RelativePosition eRelPos; + bool bTopRight=false; + switch( mrModel.mnPosition ) + { + case XML_l: + eLegendPos = cssc2::LegendPosition_LINE_START; + eLegendExpand = cssc::ChartLegendExpansion_HIGH; + break; + case XML_r: + eLegendPos = cssc2::LegendPosition_LINE_END; + eLegendExpand = cssc::ChartLegendExpansion_HIGH; + break; + case XML_tr: // top-right not supported + eRelPos.Primary = 1; + eRelPos.Secondary =0; + eRelPos.Anchor = Alignment_TOP_RIGHT; + bTopRight=true; + break; + case XML_t: + eLegendPos = cssc2::LegendPosition_PAGE_START; + eLegendExpand = cssc::ChartLegendExpansion_WIDE; + break; + case XML_b: + eLegendPos = cssc2::LegendPosition_PAGE_END; + eLegendExpand = cssc::ChartLegendExpansion_WIDE; + break; + } + bool bManualLayout=false; + // manual positioning and size + if( mrModel.mxLayout ) + { + LayoutConverter aLayoutConv( *this, *mrModel.mxLayout ); + // manual size needs ChartLegendExpansion_CUSTOM + if( aLayoutConv.convertFromModel( aPropSet ) ) + { + eLegendExpand = cssc::ChartLegendExpansion_CUSTOM; + } + bManualLayout = !aLayoutConv.getAutoLayout(); + } + + // set position and expansion properties + aPropSet.setProperty( PROP_AnchorPosition, eLegendPos ); + aPropSet.setProperty( PROP_Expansion, eLegendExpand ); + + if (bTopRight && !bManualLayout) + aPropSet.setProperty( PROP_RelativePosition , Any(eRelPos)); + + aPropSet.setProperty(PROP_Overlay, mrModel.mbOverlay); + + if (mrModel.maLegendEntries.size() > 0) + legendEntriesFormatting(rxDiagram); + } + catch( Exception& ) + { + } +} + +void LegendConverter::legendEntriesFormatting(const Reference& rxDiagram) +{ + Reference xCooSysContainer(rxDiagram, UNO_QUERY_THROW); + const Sequence> xCooSysSequence(xCooSysContainer->getCoordinateSystems()); + if (!xCooSysSequence.hasElements()) + return; + + sal_Int32 nIndex = 0; + for (const auto& rCooSys : xCooSysSequence) + { + PropertySet aCooSysProp(rCooSys); + bool bSwapXAndY = aCooSysProp.getBoolProperty(PROP_SwapXAndYAxis); + + Reference xChartTypeContainer(rCooSys, UNO_QUERY_THROW); + const Sequence> xChartTypeSequence(xChartTypeContainer->getChartTypes()); + if (!xChartTypeSequence.hasElements()) + continue; + + for (const auto& rCT : xChartTypeSequence) + { + Reference xDSCont(rCT, UNO_QUERY); + if (!xDSCont.is()) + continue; + + bool bIsPie + = rCT->getChartType().equalsIgnoreAsciiCase("com.sun.star.chart2.PieChartType"); + if (bIsPie) + { + PropertySet xChartTypeProp(rCT); + bIsPie = !xChartTypeProp.getBoolProperty(PROP_UseRings); + } + const Sequence> aDataSeriesSeq = xDSCont->getDataSeries(); + if (bSwapXAndY) + nIndex += aDataSeriesSeq.getLength() - 1; + for (const auto& rDataSeries : aDataSeriesSeq) + { + PropertySet aSeriesProp(rDataSeries); + bool bVaryColorsByPoint = aSeriesProp.getBoolProperty(PROP_VaryColorsByPoint); + + if (bVaryColorsByPoint || bIsPie) + { + Reference xDSrc(rDataSeries, UNO_QUERY); + if (!xDSrc.is()) + continue; + + const Sequence > aDataSeqs = xDSrc->getDataSequences(); + std::vector deletedLegendEntries; + sal_Int32 j = 0; + for (const auto& rDataSeq : aDataSeqs) + { + Reference xValues = rDataSeq->getValues(); + if (!xValues.is()) + continue; + + sal_Int32 nDataSeqSize = xValues->getData().getLength(); + for (sal_Int32 i = 0; i < nDataSeqSize; ++i) + { + for (const auto& rLegendEntry : mrModel.maLegendEntries) + { + if (nIndex == rLegendEntry->mnLegendEntryIdx && rLegendEntry->mbLabelDeleted) + { + deletedLegendEntries.push_back(j + i); + break; + } + } + nIndex++; + } + j += nDataSeqSize; + } + if (deletedLegendEntries.size() > 0) + aSeriesProp.setProperty(PROP_DeletedLegendEntries, comphelper::containerToSequence(deletedLegendEntries)); + } + else + { + for (const auto& rLegendEntry : mrModel.maLegendEntries) + { + if (nIndex == rLegendEntry->mnLegendEntryIdx) + { + aSeriesProp.setProperty(PROP_ShowLegendEntry, !rLegendEntry->mbLabelDeleted); + break; + } + } + bSwapXAndY ? nIndex-- : nIndex++; + } + } + if (bSwapXAndY) + nIndex += aDataSeriesSeq.getLength() + 1; + } + } +} + +} // namespace oox::drawingml::chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/drawingml/chart/titlemodel.cxx b/oox/source/drawingml/chart/titlemodel.cxx new file mode 100644 index 000000000..0bbaa7ee6 --- /dev/null +++ b/oox/source/drawingml/chart/titlemodel.cxx @@ -0,0 +1,61 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include +#include + +namespace oox::drawingml::chart { + +TextModel::TextModel() +{ +} + +TextModel::~TextModel() +{ +} + +TitleModel::TitleModel(sal_Int32 nDefaultRotation) : + mbOverlay( false ), + mnDefaultRotation(nDefaultRotation) +{ +} + +TitleModel::~TitleModel() +{ +} + +LegendEntryModel::LegendEntryModel() : + mnLegendEntryIdx( -1 ), + mbLabelDeleted( false ) +{ +} + +LegendModel::LegendModel() : + mnPosition( XML_r ), + mbOverlay( false ) +{ +} + +LegendModel::~LegendModel() +{ +} + +} // namespace oox::drawingml::chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/drawingml/chart/typegroupcontext.cxx b/oox/source/drawingml/chart/typegroupcontext.cxx new file mode 100644 index 000000000..96c4d6fc2 --- /dev/null +++ b/oox/source/drawingml/chart/typegroupcontext.cxx @@ -0,0 +1,371 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include + +#include +#include +#include +#include +#include +#include + +namespace oox::drawingml::chart { + +using ::oox::core::ContextHandler2Helper; +using ::oox::core::ContextHandlerRef; + +UpDownBarsContext::UpDownBarsContext( ContextHandler2Helper& rParent, UpDownBarsModel& rModel ) : + ContextBase< UpDownBarsModel >( rParent, rModel ) +{ +} + +UpDownBarsContext::~UpDownBarsContext() +{ +} + +ContextHandlerRef UpDownBarsContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ) +{ + switch( getCurrentElement() ) + { + case C_TOKEN( upDownBars ): + switch( nElement ) + { + case C_TOKEN( downBars ): + return new ShapePrWrapperContext( *this, mrModel.mxDownBars.create() ); + case C_TOKEN( gapWidth ): + mrModel.mnGapWidth = rAttribs.getInteger( XML_val, 150 ); + return nullptr; + case C_TOKEN( upBars ): + return new ShapePrWrapperContext( *this, mrModel.mxUpBars.create() ); + } + break; + } + return nullptr; +} + +AreaTypeGroupContext::AreaTypeGroupContext( ContextHandler2Helper& rParent, TypeGroupModel& rModel ) : + TypeGroupContextBase( rParent, rModel ) +{ +} + +AreaTypeGroupContext::~AreaTypeGroupContext() +{ +} + +ContextHandlerRef AreaTypeGroupContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ) +{ + bool bMSO2007Doc = getFilter().isMSO2007Document(); + if( isRootElement() ) switch( nElement ) + { + case C_TOKEN( axId ): + mrModel.maAxisIds.push_back( rAttribs.getInteger( XML_val, -1 ) ); + return nullptr; + case C_TOKEN( dLbls ): + return new DataLabelsContext( *this, mrModel.mxLabels.create(bMSO2007Doc) ); + case C_TOKEN( dropLines ): + return new ShapePrWrapperContext( *this, mrModel.mxDropLines.create() ); + case C_TOKEN( gapDepth ): + mrModel.mnGapDepth = rAttribs.getInteger( XML_val, 150 ); + return nullptr; + case C_TOKEN( grouping ): + mrModel.mnGrouping = rAttribs.getToken( XML_val, bMSO2007Doc ? XML_standard : XML_clustered ); + return nullptr; + case C_TOKEN( ser ): + return new AreaSeriesContext( *this, mrModel.maSeries.create(bMSO2007Doc) ); + case C_TOKEN( varyColors ): + mrModel.mbVaryColors = rAttribs.getBool( XML_val, !bMSO2007Doc ); + return nullptr; + } + return nullptr; +} + +BarTypeGroupContext::BarTypeGroupContext( ContextHandler2Helper& rParent, TypeGroupModel& rModel ) : + TypeGroupContextBase( rParent, rModel ) +{ +} + +BarTypeGroupContext::~BarTypeGroupContext() +{ +} + +ContextHandlerRef BarTypeGroupContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ) +{ + bool bMSO2007Doc = getFilter().isMSO2007Document(); + if( isRootElement() ) switch( nElement ) + { + case C_TOKEN( axId ): + mrModel.maAxisIds.push_back( rAttribs.getInteger( XML_val, -1 ) ); + return nullptr; + case C_TOKEN( barDir ): + mrModel.mnBarDir = rAttribs.getToken( XML_val, XML_col ); + return nullptr; + case C_TOKEN( dLbls ): + return new DataLabelsContext( *this, mrModel.mxLabels.create(bMSO2007Doc) ); + case C_TOKEN( gapDepth ): + mrModel.mnGapDepth = rAttribs.getInteger( XML_val, 150 ); + return nullptr; + case C_TOKEN( gapWidth ): + mrModel.mnGapWidth = rAttribs.getInteger( XML_val, 150 ); + return nullptr; + case C_TOKEN( grouping ): + mrModel.mnGrouping = rAttribs.getToken( XML_val, bMSO2007Doc ? XML_standard : XML_clustered ); + return nullptr; + case C_TOKEN( overlap ): + mrModel.mnOverlap = rAttribs.getInteger( XML_val, 0 ); + return nullptr; + case C_TOKEN( ser ): + return new BarSeriesContext( *this, mrModel.maSeries.create(bMSO2007Doc) ); + case C_TOKEN( serLines ): + return new ShapePrWrapperContext( *this, mrModel.mxSerLines.create() ); + case C_TOKEN( shape ): + mrModel.mnShape = rAttribs.getToken( XML_val, XML_box ); + return nullptr; + case C_TOKEN( varyColors ): + mrModel.mbVaryColors = rAttribs.getBool( XML_val, !bMSO2007Doc ); + return nullptr; + } + return nullptr; +} + +BubbleTypeGroupContext::BubbleTypeGroupContext( ContextHandler2Helper& rParent, TypeGroupModel& rModel ) : + TypeGroupContextBase( rParent, rModel ) +{ +} + +BubbleTypeGroupContext::~BubbleTypeGroupContext() +{ +} + +ContextHandlerRef BubbleTypeGroupContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ) +{ + bool bMSO2007Doc = getFilter().isMSO2007Document(); + if( isRootElement() ) switch( nElement ) + { + case C_TOKEN( axId ): + mrModel.maAxisIds.push_back( rAttribs.getInteger( XML_val, -1 ) ); + return nullptr; + case C_TOKEN( bubble3D ): + mrModel.mbBubble3d = rAttribs.getBool( XML_val, !bMSO2007Doc ); + return nullptr; + case C_TOKEN( bubbleScale ): + mrModel.mnBubbleScale = rAttribs.getInteger( XML_val, 100 ); + return nullptr; + case C_TOKEN( dLbls ): + return new DataLabelsContext( *this, mrModel.mxLabels.create(bMSO2007Doc) ); + case C_TOKEN( ser ): + return new BubbleSeriesContext( *this, mrModel.maSeries.create(bMSO2007Doc) ); + case C_TOKEN( showNegBubbles ): + mrModel.mbShowNegBubbles = rAttribs.getBool( XML_val, !bMSO2007Doc ); + return nullptr; + case C_TOKEN( sizeRepresents ): + mrModel.mnSizeRepresents = rAttribs.getToken( XML_val, XML_area ); + return nullptr; + case C_TOKEN( varyColors ): + mrModel.mbVaryColors = rAttribs.getBool( XML_val, !bMSO2007Doc ); + return nullptr; + } + return nullptr; +} + +LineTypeGroupContext::LineTypeGroupContext( ContextHandler2Helper& rParent, TypeGroupModel& rModel ) : + TypeGroupContextBase( rParent, rModel ) +{ +} + +LineTypeGroupContext::~LineTypeGroupContext() +{ +} + +ContextHandlerRef LineTypeGroupContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ) +{ + bool bMSO2007Doc = getFilter().isMSO2007Document(); + if( isRootElement() ) switch( nElement ) + { + case C_TOKEN( axId ): + mrModel.maAxisIds.push_back( rAttribs.getInteger( XML_val, -1 ) ); + return nullptr; + case C_TOKEN( dLbls ): + return new DataLabelsContext( *this, mrModel.mxLabels.create(bMSO2007Doc) ); + case C_TOKEN( dropLines ): + return new ShapePrWrapperContext( *this, mrModel.mxDropLines.create() ); + case C_TOKEN( gapDepth ): + mrModel.mnGapDepth = rAttribs.getInteger( XML_val, 150 ); + return nullptr; + case C_TOKEN( grouping ): + mrModel.mnGrouping = rAttribs.getToken( XML_val, bMSO2007Doc ? XML_standard : XML_clustered ); + return nullptr; + case C_TOKEN( hiLowLines ): + return new ShapePrWrapperContext( *this, mrModel.mxHiLowLines.create() ); + case C_TOKEN( marker ): + mrModel.mbShowMarker = rAttribs.getBool( XML_val, !bMSO2007Doc ); + return nullptr; + case C_TOKEN( ser ): + return new LineSeriesContext( *this, mrModel.maSeries.create(bMSO2007Doc) ); + case C_TOKEN( smooth ): + mrModel.mbSmooth = rAttribs.getBool( XML_val, !bMSO2007Doc ); + return nullptr; + case C_TOKEN( upDownBars ): + return new UpDownBarsContext( *this, mrModel.mxUpDownBars.create() ); + case C_TOKEN( varyColors ): + mrModel.mbVaryColors = rAttribs.getBool( XML_val, !bMSO2007Doc ); + return nullptr; + } + return nullptr; +} + +PieTypeGroupContext::PieTypeGroupContext( ContextHandler2Helper& rParent, TypeGroupModel& rModel ) : + TypeGroupContextBase( rParent, rModel ) +{ +} + +PieTypeGroupContext::~PieTypeGroupContext() +{ +} + +ContextHandlerRef PieTypeGroupContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ) +{ + bool bMSO2007Doc = getFilter().isMSO2007Document(); + if( isRootElement() ) switch( nElement ) + { + case C_TOKEN( dLbls ): + return new DataLabelsContext( *this, mrModel.mxLabels.create(bMSO2007Doc) ); + case C_TOKEN( firstSliceAng ): + mrModel.mnFirstAngle = rAttribs.getInteger( XML_val, 0 ); + return nullptr; + case C_TOKEN( gapWidth ): + mrModel.mnGapWidth = rAttribs.getInteger( XML_val, 150 ); + return nullptr; + case C_TOKEN( holeSize ): + mrModel.mnHoleSize = rAttribs.getInteger( XML_val, 10 ); + return nullptr; + case C_TOKEN( ofPieType ): + mrModel.mnOfPieType = rAttribs.getToken( XML_val, XML_pie ); + return nullptr; + case C_TOKEN( secondPieSize ): + mrModel.mnSecondPieSize = rAttribs.getInteger( XML_val, 75 ); + return nullptr; + case C_TOKEN( ser ): + return new PieSeriesContext( *this, mrModel.maSeries.create(bMSO2007Doc) ); + case C_TOKEN( serLines ): + return new ShapePrWrapperContext( *this, mrModel.mxSerLines.create() ); + case C_TOKEN( splitPos ): + mrModel.mfSplitPos = rAttribs.getDouble( XML_val, 0.0 ); + return nullptr; + case C_TOKEN( splitType ): + mrModel.mnSplitType = rAttribs.getToken( XML_val, XML_auto ); + return nullptr; + case C_TOKEN( varyColors ): + mrModel.mbVaryColors = rAttribs.getBool( XML_val, !bMSO2007Doc ); + return nullptr; + } + return nullptr; +} + +RadarTypeGroupContext::RadarTypeGroupContext( ContextHandler2Helper& rParent, TypeGroupModel& rModel ) : + TypeGroupContextBase( rParent, rModel ) +{ +} + +RadarTypeGroupContext::~RadarTypeGroupContext() +{ +} + +ContextHandlerRef RadarTypeGroupContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ) +{ + bool bMSO2007Doc = getFilter().isMSO2007Document(); + if( isRootElement() ) switch( nElement ) + { + case C_TOKEN( axId ): + mrModel.maAxisIds.push_back( rAttribs.getInteger( XML_val, -1 ) ); + return nullptr; + case C_TOKEN( dLbls ): + return new DataLabelsContext( *this, mrModel.mxLabels.create(bMSO2007Doc) ); + case C_TOKEN( radarStyle ): + mrModel.mnRadarStyle = rAttribs.getToken( XML_val, XML_standard ); + return nullptr; + case C_TOKEN( ser ): + return new RadarSeriesContext( *this, mrModel.maSeries.create(bMSO2007Doc) ); + case C_TOKEN( varyColors ): + mrModel.mbVaryColors = rAttribs.getBool( XML_val, !bMSO2007Doc ); + return nullptr; + } + return nullptr; +} + +ScatterTypeGroupContext::ScatterTypeGroupContext( ContextHandler2Helper& rParent, TypeGroupModel& rModel ) : + TypeGroupContextBase( rParent, rModel ) +{ +} + +ScatterTypeGroupContext::~ScatterTypeGroupContext() +{ +} + +ContextHandlerRef ScatterTypeGroupContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ) +{ + bool bMSO2007Doc = getFilter().isMSO2007Document(); + if( isRootElement() ) switch( nElement ) + { + case C_TOKEN( axId ): + mrModel.maAxisIds.push_back( rAttribs.getInteger( XML_val, -1 ) ); + return nullptr; + case C_TOKEN( dLbls ): + return new DataLabelsContext( *this, mrModel.mxLabels.create(bMSO2007Doc) ); + case C_TOKEN( scatterStyle ): + mrModel.mnScatterStyle = rAttribs.getInteger( XML_val, XML_marker ); + return nullptr; + case C_TOKEN( ser ): + return new ScatterSeriesContext( *this, mrModel.maSeries.create(bMSO2007Doc) ); + case C_TOKEN( varyColors ): + mrModel.mbVaryColors = rAttribs.getBool( XML_val, !bMSO2007Doc ); + return nullptr; + } + return nullptr; +} + +SurfaceTypeGroupContext::SurfaceTypeGroupContext( ContextHandler2Helper& rParent, TypeGroupModel& rModel ) : + TypeGroupContextBase( rParent, rModel ) +{ +} + +SurfaceTypeGroupContext::~SurfaceTypeGroupContext() +{ +} + +ContextHandlerRef SurfaceTypeGroupContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ) +{ + bool bMSO2007Doc = getFilter().isMSO2007Document(); + if( isRootElement() ) switch( nElement ) + { + case C_TOKEN( axId ): + mrModel.maAxisIds.push_back( rAttribs.getInteger( XML_val, -1 ) ); + return nullptr; + case C_TOKEN( ser ): + return new SurfaceSeriesContext( *this, mrModel.maSeries.create(bMSO2007Doc) ); + case C_TOKEN( wireframe ): + mrModel.mbWireframe = rAttribs.getBool( XML_val, !bMSO2007Doc ); + return nullptr; + } + return nullptr; +} + +} // namespace oox::drawingml::chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/drawingml/chart/typegroupconverter.cxx b/oox/source/drawingml/chart/typegroupconverter.cxx new file mode 100644 index 000000000..e8d8bb47b --- /dev/null +++ b/oox/source/drawingml/chart/typegroupconverter.cxx @@ -0,0 +1,605 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace oox::drawingml::chart { + +using namespace ::com::sun::star::beans; +using namespace ::com::sun::star::chart2; +using namespace ::com::sun::star::chart2::data; +using namespace ::com::sun::star::uno; + +namespace { + +// chart type service names +const char SERVICE_CHART2_AREA[] = "com.sun.star.chart2.AreaChartType"; +const char SERVICE_CHART2_CANDLE[] = "com.sun.star.chart2.CandleStickChartType"; +const char SERVICE_CHART2_COLUMN[] = "com.sun.star.chart2.ColumnChartType"; +const char SERVICE_CHART2_LINE[] = "com.sun.star.chart2.LineChartType"; +const char SERVICE_CHART2_NET[] = "com.sun.star.chart2.NetChartType"; +const char SERVICE_CHART2_FILLEDNET[] = "com.sun.star.chart2.FilledNetChartType"; +const char SERVICE_CHART2_PIE[] = "com.sun.star.chart2.PieChartType"; +const char SERVICE_CHART2_SCATTER[] = "com.sun.star.chart2.ScatterChartType"; +const char SERVICE_CHART2_BUBBLE[] = "com.sun.star.chart2.BubbleChartType"; +const char SERVICE_CHART2_SURFACE[] = "com.sun.star.chart2.ColumnChartType"; // Todo + +namespace csscd = ::com::sun::star::chart::DataLabelPlacement; + +const TypeGroupInfo spTypeInfos[] = +{ + // type-id type-category service varied-point-color default label pos polar area2d 1stvis xcateg swap stack picopt + { TYPEID_BAR, TYPECATEGORY_BAR, SERVICE_CHART2_COLUMN, VARPOINTMODE_SINGLE, csscd::OUTSIDE, false, true, false, true, false, true, true }, + { TYPEID_HORBAR, TYPECATEGORY_BAR, SERVICE_CHART2_COLUMN, VARPOINTMODE_SINGLE, csscd::OUTSIDE, false, true, false, true, true, true, true }, + { TYPEID_LINE, TYPECATEGORY_LINE, SERVICE_CHART2_LINE, VARPOINTMODE_SINGLE, csscd::RIGHT, false, false, false, true, false, true, false }, + { TYPEID_AREA, TYPECATEGORY_LINE, SERVICE_CHART2_AREA, VARPOINTMODE_NONE, csscd::CENTER, false, true, false, true, false, true, false }, + { TYPEID_STOCK, TYPECATEGORY_LINE, SERVICE_CHART2_CANDLE, VARPOINTMODE_NONE, csscd::RIGHT, false, false, false, true, false, true, false }, + { TYPEID_RADARLINE, TYPECATEGORY_RADAR, SERVICE_CHART2_NET, VARPOINTMODE_SINGLE, csscd::OUTSIDE, true, false, false, true, false, false, false }, + { TYPEID_RADARAREA, TYPECATEGORY_RADAR, SERVICE_CHART2_FILLEDNET, VARPOINTMODE_NONE, csscd::OUTSIDE, true, true, false, true, false, false, false }, + { TYPEID_PIE, TYPECATEGORY_PIE, SERVICE_CHART2_PIE, VARPOINTMODE_MULTI, csscd::AVOID_OVERLAP, true, true, true, true, false, false, false }, + { TYPEID_DOUGHNUT, TYPECATEGORY_PIE, SERVICE_CHART2_PIE, VARPOINTMODE_MULTI, csscd::AVOID_OVERLAP, true, true, false, true, false, false, false }, + { TYPEID_OFPIE, TYPECATEGORY_PIE, SERVICE_CHART2_PIE, VARPOINTMODE_MULTI, csscd::AVOID_OVERLAP, true, true, true, true, false, false, false }, + { TYPEID_SCATTER, TYPECATEGORY_SCATTER, SERVICE_CHART2_SCATTER, VARPOINTMODE_SINGLE, csscd::RIGHT, false, false, false, false, false, false, false }, + { TYPEID_BUBBLE, TYPECATEGORY_SCATTER, SERVICE_CHART2_BUBBLE, VARPOINTMODE_SINGLE, csscd::RIGHT, false, true, false, false, false, false, false }, + { TYPEID_SURFACE, TYPECATEGORY_SURFACE, SERVICE_CHART2_SURFACE, VARPOINTMODE_NONE, csscd::RIGHT, false, true, false, true, false, false, false } +}; + +const TypeGroupInfo saUnknownTypeInfo = + { TYPEID_UNKNOWN, TYPECATEGORY_BAR, SERVICE_CHART2_COLUMN, VARPOINTMODE_SINGLE, csscd::OUTSIDE, false, true, false, true, false, true, true }; + +const TypeGroupInfo& lclGetTypeInfoFromTypeId( TypeId eTypeId ) +{ + for( auto const &rIt : spTypeInfos) + { + if( rIt.meTypeId == eTypeId ) + return rIt; + } + OSL_ENSURE( eTypeId == TYPEID_UNKNOWN, "lclGetTypeInfoFromTypeId - unexpected chart type identifier" ); + return saUnknownTypeInfo; +} + +} // namespace + +const TypeGroupInfo& GetTypeGroupInfo( TypeId eType ) +{ + return lclGetTypeInfoFromTypeId(eType); +} + +UpDownBarsConverter::UpDownBarsConverter( const ConverterRoot& rParent, UpDownBarsModel& rModel ) : + ConverterBase< UpDownBarsModel >( rParent, rModel ) +{ +} + +UpDownBarsConverter::~UpDownBarsConverter() +{ +} + +void UpDownBarsConverter::convertFromModel( const Reference< XChartType >& rxChartType ) +{ + PropertySet aTypeProp( rxChartType ); + + // upbar format + Reference< XPropertySet > xWhitePropSet; + if( aTypeProp.getProperty( xWhitePropSet, PROP_WhiteDay ) ) + { + PropertySet aPropSet( xWhitePropSet ); + getFormatter().convertFrameFormatting( aPropSet, mrModel.mxUpBars, OBJECTTYPE_UPBAR ); + } + + // downbar format + Reference< XPropertySet > xBlackPropSet; + if( aTypeProp.getProperty( xBlackPropSet, PROP_BlackDay ) ) + { + PropertySet aPropSet( xBlackPropSet ); + getFormatter().convertFrameFormatting( aPropSet, mrModel.mxDownBars, OBJECTTYPE_DOWNBAR ); + } +} + +TypeGroupConverter::TypeGroupConverter( const ConverterRoot& rParent, TypeGroupModel& rModel ) : + ConverterBase< TypeGroupModel >( rParent, rModel ), + mb3dChart( false ) +{ + TypeId eTypeId = TYPEID_UNKNOWN; + switch( mrModel.mnTypeId ) + { +#define ENSURE_AXESCOUNT( min, max ) OSL_ENSURE( (min <= static_cast(mrModel.maAxisIds.size())) && (static_cast(mrModel.maAxisIds.size()) <= max), "TypeGroupConverter::TypeGroupConverter - invalid axes count" ) + case C_TOKEN( area3DChart ): ENSURE_AXESCOUNT( 2, 3 ); eTypeId = TYPEID_AREA; mb3dChart = true; break; + case C_TOKEN( areaChart ): ENSURE_AXESCOUNT( 2, 2 ); eTypeId = TYPEID_AREA; mb3dChart = false; break; + case C_TOKEN( bar3DChart ): ENSURE_AXESCOUNT( 2, 3 ); eTypeId = TYPEID_BAR; mb3dChart = true; break; + case C_TOKEN( barChart ): ENSURE_AXESCOUNT( 2, 2 ); eTypeId = TYPEID_BAR; mb3dChart = false; break; + case C_TOKEN( bubbleChart ): ENSURE_AXESCOUNT( 2, 2 ); eTypeId = TYPEID_BUBBLE; mb3dChart = false; break; + case C_TOKEN( doughnutChart ): ENSURE_AXESCOUNT( 0, 0 ); eTypeId = TYPEID_DOUGHNUT; mb3dChart = false; break; + case C_TOKEN( line3DChart ): ENSURE_AXESCOUNT( 3, 3 ); eTypeId = TYPEID_LINE; mb3dChart = true; break; + case C_TOKEN( lineChart ): ENSURE_AXESCOUNT( 2, 2 ); eTypeId = TYPEID_LINE; mb3dChart = false; break; + case C_TOKEN( ofPieChart ): ENSURE_AXESCOUNT( 0, 0 ); eTypeId = TYPEID_OFPIE; mb3dChart = false; break; + case C_TOKEN( pie3DChart ): ENSURE_AXESCOUNT( 0, 0 ); eTypeId = TYPEID_PIE; mb3dChart = true; break; + case C_TOKEN( pieChart ): ENSURE_AXESCOUNT( 0, 0 ); eTypeId = TYPEID_PIE; mb3dChart = false; break; + case C_TOKEN( radarChart ): ENSURE_AXESCOUNT( 2, 2 ); eTypeId = TYPEID_RADARLINE; mb3dChart = false; break; + case C_TOKEN( scatterChart ): ENSURE_AXESCOUNT( 2, 2 ); eTypeId = TYPEID_SCATTER; mb3dChart = false; break; + case C_TOKEN( stockChart ): ENSURE_AXESCOUNT( 2, 2 ); eTypeId = TYPEID_STOCK; mb3dChart = false; break; + case C_TOKEN( surface3DChart ): ENSURE_AXESCOUNT( 3, 3 ); eTypeId = TYPEID_SURFACE; mb3dChart = true; break; + case C_TOKEN( surfaceChart ): ENSURE_AXESCOUNT( 2, 3 ); eTypeId = TYPEID_SURFACE; mb3dChart = true; break; // 3D bar chart from all surface charts + default: OSL_FAIL( "TypeGroupConverter::TypeGroupConverter - unknown chart type" ); +#undef ENSURE_AXESCOUNT + } + + // special handling for some chart types + switch( eTypeId ) + { + case TYPEID_BAR: + if( mrModel.mnBarDir == XML_bar ) + eTypeId = TYPEID_HORBAR; + break; + case TYPEID_RADARLINE: + if( mrModel.mnRadarStyle == XML_filled ) + eTypeId = TYPEID_RADARAREA; + break; + case TYPEID_SURFACE: + // create a deep 3D bar chart from surface charts + mrModel.mnGrouping = XML_standard; + break; + default:; + } + + // set the chart type info struct for the current chart type + maTypeInfo = lclGetTypeInfoFromTypeId( eTypeId ); +} + +TypeGroupConverter::~TypeGroupConverter() +{ +} + +bool TypeGroupConverter::isStacked() const +{ + return maTypeInfo.mbSupportsStacking && (mrModel.mnGrouping == XML_stacked); +} + +bool TypeGroupConverter::isPercent() const +{ + return maTypeInfo.mbSupportsStacking && (mrModel.mnGrouping == XML_percentStacked); +} + +bool TypeGroupConverter::isWall3dChart() const +{ + return mb3dChart && (maTypeInfo.meTypeCategory != TYPECATEGORY_PIE); +} + +bool TypeGroupConverter::isDeep3dChart() const +{ + return isWall3dChart() && (mrModel.mnGrouping == XML_standard); +} + +bool TypeGroupConverter::isSeriesFrameFormat() const +{ + return mb3dChart || maTypeInfo.mbSeriesIsFrame2d; +} + +ObjectType TypeGroupConverter::getSeriesObjectType() const +{ + return mb3dChart ? OBJECTTYPE_FILLEDSERIES3D : + (maTypeInfo.mbSeriesIsFrame2d ? OBJECTTYPE_FILLEDSERIES2D : OBJECTTYPE_LINEARSERIES2D); +} + +OUString TypeGroupConverter::getSingleSeriesTitle() const +{ + OUString aSeriesTitle; + if( !mrModel.maSeries.empty() && (maTypeInfo.mbSingleSeriesVis || (mrModel.maSeries.size() == 1)) ) + if( const TextModel* pText = mrModel.maSeries.front()->mxText.get() ) + if( const DataSequenceModel* pDataSeq = pText->mxDataSeq.get() ) + if( !pDataSeq->maData.empty() ) + pDataSeq->maData.begin()->second >>= aSeriesTitle; + return aSeriesTitle; +} + +Reference< XCoordinateSystem > TypeGroupConverter::createCoordinateSystem() +{ + // create the coordinate system object + Reference< css::uno::XComponentContext > xContext = getComponentContext(); + Reference< XCoordinateSystem > xCoordSystem; + if( maTypeInfo.mbPolarCoordSystem ) + { + if( mb3dChart ) + xCoordSystem = css::chart2::PolarCoordinateSystem3d::create(xContext); + else + xCoordSystem = css::chart2::PolarCoordinateSystem2d::create(xContext); + } + else + { + if( mb3dChart ) + xCoordSystem = css::chart2::CartesianCoordinateSystem3d::create(xContext); + else + xCoordSystem = css::chart2::CartesianCoordinateSystem2d::create(xContext); + } + + // swap X and Y axis + if( maTypeInfo.mbSwappedAxesSet ) + { + PropertySet aPropSet( xCoordSystem ); + aPropSet.setProperty( PROP_SwapXAndYAxis, true ); + } + + return xCoordSystem; +} + +Reference< XLabeledDataSequence > TypeGroupConverter::createCategorySequence() +{ + sal_Int32 nMaxValues = 0; + Reference< XLabeledDataSequence > xLabeledSeq; + /* Find first existing category sequence. The behaviour of Excel 2007 is + different to Excel 2003, which always used the category sequence of the + first series, even if it was empty. */ + for (auto const& elem : mrModel.maSeries) + { + if( elem->maSources.has( SeriesModel::CATEGORIES ) ) + { + SeriesConverter aSeriesConv(*this, *elem); + xLabeledSeq = aSeriesConv.createCategorySequence( "categories" ); + if (xLabeledSeq.is()) + break; + } + else if( nMaxValues <= 0 && elem->maSources.has( SeriesModel::VALUES ) ) + { + DataSourceModel *pValues = elem->maSources.get( SeriesModel::VALUES ).get(); + if( pValues->mxDataSeq.is() ) + nMaxValues = pValues->mxDataSeq->maData.size(); + } + } + /* n#839727 Create Category Sequence when none are found */ + if( !xLabeledSeq.is() && !mrModel.maSeries.empty() ) { + if( nMaxValues < 0 ) + nMaxValues = 2; + SeriesModel &aModel = *mrModel.maSeries.get(0); + if (!aModel.maSources.has(SeriesModel::CATEGORIES)) + { + DataSourceModel &aSrc = aModel.maSources.create( SeriesModel::CATEGORIES ); + DataSequenceModel &aSeq = aSrc.mxDataSeq.create(); + aSeq.mnPointCount = nMaxValues; + for( sal_Int32 i = 0; i < nMaxValues; i++ ) + aSeq.maData[ i ] <<= OUString::number( i + 1 ); + } + SeriesConverter aSeriesConv( *this, aModel ); + xLabeledSeq = aSeriesConv.createCategorySequence( "categories" ); + } + return xLabeledSeq; +} + +void TypeGroupConverter::convertFromModel( const Reference< XDiagram >& rxDiagram, + const Reference< XCoordinateSystem >& rxCoordSystem, + sal_Int32 nAxesSetIdx, bool bSupportsVaryColorsByPoint ) +{ + try + { + // create the chart type object + OUString aService = OUString::createFromAscii( maTypeInfo.mpcServiceName ); + Reference< XChartType > xChartType( createInstance( aService ), UNO_QUERY_THROW ); + + Reference< XChartTypeContainer > xChartTypeContOld( rxCoordSystem, UNO_QUERY_THROW ); + Sequence< Reference< XChartType > > xOldChartTypes( xChartTypeContOld->getChartTypes() ); + sal_Int32 nOldChartTypeIdx = -1; + + // additional properties + PropertySet aDiaProp( rxDiagram ); + PropertySet aTypeProp( xChartType ); + switch( maTypeInfo.meTypeCategory ) + { + case TYPECATEGORY_BAR: + { + Sequence< sal_Int32 > aInt32Seq{ mrModel.mnOverlap, mrModel.mnOverlap }; + aTypeProp.setProperty( PROP_OverlapSequence, aInt32Seq ); + aInt32Seq = { mrModel.mnGapWidth, mrModel.mnGapWidth }; + aTypeProp.setProperty( PROP_GapwidthSequence, aInt32Seq ); + } + break; + case TYPECATEGORY_PIE: + { + aTypeProp.setProperty( PROP_UseRings, maTypeInfo.meTypeId == TYPEID_DOUGHNUT ); + /* #i85166# starting angle of first pie slice. 3D pie charts + use Y rotation setting in view3D element. Of-pie charts do + not support pie rotation. */ + if( !is3dChart() && (maTypeInfo.meTypeId != TYPEID_OFPIE) ) + convertPieRotation( aDiaProp, mrModel.mnFirstAngle ); + } + break; + default:; + } + + // create converter objects for all series models + typedef RefVector< SeriesConverter > SeriesConvVector; + SeriesConvVector aSeries; + for (auto const& elemSeries : mrModel.maSeries) + aSeries.push_back( std::make_shared(*this, *elemSeries) ); + + // decide whether to use varying colors for each data point + bool bVaryColorsByPoint = bSupportsVaryColorsByPoint && mrModel.mbVaryColors; + switch( maTypeInfo.meVarPointMode ) + { + case VARPOINTMODE_NONE: bVaryColorsByPoint = false; break; + case VARPOINTMODE_SINGLE: bVaryColorsByPoint &= (mrModel.maSeries.size() == 1); break; + case VARPOINTMODE_MULTI: break; + } + + /* Stock chart needs special processing. Create one 'big' series with + data sequences of different roles. */ + if( maTypeInfo.meTypeId == TYPEID_STOCK ) + { + // create the data series object + Reference< XDataSeries > xDataSeries( createInstance( "com.sun.star.chart2.DataSeries" ), UNO_QUERY ); + Reference< XDataSink > xDataSink( xDataSeries, UNO_QUERY ); + if( xDataSink.is() ) + { + // create a list of data sequences from all series + ::std::vector< Reference< XLabeledDataSequence > > aLabeledSeqVec; + OSL_ENSURE( aSeries.size() >= 3, "TypeGroupConverter::convertFromModel - too few stock chart series" ); + int nRoleIdx = (aSeries.size() == 3) ? 1 : 0; + for( auto& rxSeriesConv : aSeries ) + { + // create a data sequence with a specific role + OUString aRole; + switch( nRoleIdx ) + { + case 0: aRole = "values-first"; break; + case 1: aRole = "values-max"; break; + case 2: aRole = "values-min"; break; + case 3: aRole = "values-last"; break; + } + Reference< XLabeledDataSequence > xDataSeq = rxSeriesConv->createValueSequence( aRole ); + if( xDataSeq.is() ) + aLabeledSeqVec.push_back( xDataSeq ); + + ++nRoleIdx; + if (nRoleIdx >= 4) + break; + } + + // attach labeled data sequences to series and insert series into chart type + xDataSink->setData( comphelper::containerToSequence( aLabeledSeqVec ) ); + + // formatting of high/low lines + aTypeProp.setProperty( PROP_ShowHighLow, true ); + PropertySet aSeriesProp( xDataSeries ); + if( mrModel.mxHiLowLines.is() ) + getFormatter().convertFrameFormatting( aSeriesProp, mrModel.mxHiLowLines, OBJECTTYPE_HILOLINE ); + else + // hi/low-lines cannot be switched off via "ShowHighLow" property (?) + aSeriesProp.setProperty( PROP_LineStyle, css::drawing::LineStyle_NONE ); + + // formatting of up/down bars + bool bUpDownBars = mrModel.mxUpDownBars.is(); + aTypeProp.setProperty( PROP_Japanese, bUpDownBars ); + aTypeProp.setProperty( PROP_ShowFirst, bUpDownBars ); + if( bUpDownBars ) + { + UpDownBarsConverter aUpDownConv( *this, *mrModel.mxUpDownBars ); + aUpDownConv.convertFromModel( xChartType ); + } + + // insert the series into the chart type object + insertDataSeries( xChartType, xDataSeries, nAxesSetIdx ); + } + } + else + { + for( sal_Int32 nCTIdx=0; nCTIdxgetChartType() == xOldChartTypes[nCTIdx]->getChartType() ) + { + nOldChartTypeIdx = nCTIdx; + } + } + + for (auto const& elem : aSeries) + { + SeriesConverter& rSeriesConv = *elem; + Reference< XDataSeries > xDataSeries = rSeriesConv.createDataSeries( *this, bVaryColorsByPoint ); + insertDataSeries( nOldChartTypeIdx == -1 ? xChartType : xOldChartTypes[nOldChartTypeIdx], xDataSeries, nAxesSetIdx ); + + /* Excel does not use the value of the c:smooth element of the + chart type to set a default line smoothing for the data + series. Line smoothing is always controlled by the c:smooth + element of the respective data series. If the element in the + data series is missing, line smoothing is off, regardless of + the c:smooth element of the chart type. */ +#if !OOX_CHART_SMOOTHED_PER_SERIES + if( rSeriesConv.getModel().mbSmooth ) + convertLineSmooth( aTypeProp, true ); +#endif + } + } + + // add chart type object to coordinate system + Reference< XChartTypeContainer > xChartTypeCont( rxCoordSystem, UNO_QUERY_THROW ); + if (nOldChartTypeIdx == -1) + { + xChartTypeCont->addChartType(xChartType); + } + + // set existence of bar connector lines at diagram (only in stacked 2D bar charts) + if( mrModel.mxSerLines.is() && !mb3dChart && (maTypeInfo.meTypeCategory == TYPECATEGORY_BAR) && (isStacked() || isPercent()) ) + aDiaProp.setProperty( PROP_ConnectBars, true ); + } + catch( Exception& ) + { + OSL_FAIL( "TypeGroupConverter::convertFromModel - cannot add chart type" ); + } +} + +void TypeGroupConverter::convertMarker( PropertySet& rPropSet, sal_Int32 nOoxSymbol, sal_Int32 nOoxSize, + const ModelRef< Shape >& xShapeProps ) const +{ + if( isSeriesFrameFormat() ) + return; + + namespace cssc = ::com::sun::star::chart2; + + // symbol style + cssc::Symbol aSymbol; + aSymbol.Style = cssc::SymbolStyle_STANDARD; + switch( nOoxSymbol ) // compare with XclChPropSetHelper::WriteMarkerProperties in xlchart.cxx + { + case XML_auto: aSymbol.Style = cssc::SymbolStyle_AUTO; break; + case XML_none: aSymbol.Style = cssc::SymbolStyle_NONE; break; + case XML_square: aSymbol.StandardSymbol = 0; break; // square + case XML_diamond: aSymbol.StandardSymbol = 1; break; // diamond + case XML_triangle: aSymbol.StandardSymbol = 3; break; // arrow up + case XML_x: aSymbol.StandardSymbol = 10; break; // X, legacy bow tie + case XML_star: aSymbol.StandardSymbol = 12; break; // asterisk, legacy sand glass + case XML_dot: aSymbol.StandardSymbol = 4; break; // arrow right + case XML_dash: aSymbol.StandardSymbol = 13; break; // horizontal bar, legacy arrow down + case XML_circle: aSymbol.StandardSymbol = 8; break; // circle, legacy arrow right + case XML_plus: aSymbol.StandardSymbol = 11; break; // plus, legacy arrow left + } + + // symbol size (points in OOXML, 1/100 mm in Chart2) + sal_Int32 nSize = convertPointToMm100(nOoxSize); + aSymbol.Size.Width = aSymbol.Size.Height = nSize; + + if(xShapeProps.is()) + { + Color aFillColor = xShapeProps->getFillProperties().maFillColor; + aSymbol.FillColor = sal_Int32(aFillColor.getColor(getFilter().getGraphicHelper())); + // tdf#124817: if there is no fill color, use line color of the symbol + if( aSymbol.FillColor < 0 ) + { + Color aLineColor = xShapeProps->getLineProperties().maLineFill.maFillColor; + aSymbol.BorderColor = sal_Int32(aLineColor.getColor(getFilter().getGraphicHelper())); + rPropSet.setProperty(PROP_Color, aSymbol.BorderColor); + } + else + rPropSet.setProperty(PROP_Color, aSymbol.FillColor); + } + + // set the property + rPropSet.setProperty( PROP_Symbol, aSymbol ); +} + +void TypeGroupConverter::convertLineSmooth( PropertySet& rPropSet, bool bOoxSmooth ) const +{ + if( !isSeriesFrameFormat() && (maTypeInfo.meTypeCategory != TYPECATEGORY_RADAR) ) + { + namespace cssc = ::com::sun::star::chart2; + cssc::CurveStyle eCurveStyle = bOoxSmooth ? cssc::CurveStyle_CUBIC_SPLINES : cssc::CurveStyle_LINES; + rPropSet.setProperty( PROP_CurveStyle, eCurveStyle ); + } +} + +void TypeGroupConverter::convertBarGeometry( PropertySet& rPropSet, sal_Int32 nOoxShape ) const +{ + if( !(mb3dChart && (maTypeInfo.meTypeCategory == TYPECATEGORY_BAR)) ) + return; + + namespace cssc = ::com::sun::star::chart2; + + sal_Int32 nGeom3d = cssc::DataPointGeometry3D::CUBOID; + switch( nOoxShape ) + { + case XML_box: nGeom3d = cssc::DataPointGeometry3D::CUBOID; break; + case XML_cone: nGeom3d = cssc::DataPointGeometry3D::CONE; break; + case XML_coneToMax: nGeom3d = cssc::DataPointGeometry3D::CONE; break; + case XML_cylinder: nGeom3d = cssc::DataPointGeometry3D::CYLINDER; break; + case XML_pyramid: nGeom3d = cssc::DataPointGeometry3D::PYRAMID; break; + case XML_pyramidToMax: nGeom3d = cssc::DataPointGeometry3D::PYRAMID; break; + default: OSL_FAIL( "TypeGroupConverter::convertBarGeometry - unknown 3D bar shape type" ); + } + rPropSet.setProperty( PROP_Geometry3D, nGeom3d ); +} + +void TypeGroupConverter::convertPieRotation( PropertySet& rPropSet, sal_Int32 nOoxAngle ) const +{ + if( maTypeInfo.meTypeCategory == TYPECATEGORY_PIE ) + { + // map OOXML [0,360] clockwise (0deg top) to Chart2 counterclockwise (0deg left) + sal_Int32 nAngle = (450 - nOoxAngle) % 360; + rPropSet.setProperty( PROP_StartingAngle, nAngle ); + } +} + +void TypeGroupConverter::convertPieExplosion( PropertySet& rPropSet, sal_Int32 nOoxExplosion ) const +{ + if( maTypeInfo.meTypeCategory == TYPECATEGORY_PIE ) + { + // pie explosion restricted to 100% in Chart2, set as double in range [0,1] + double fOffset = getLimitedValue< double >( nOoxExplosion / 100.0, 0.0, 1.0 ); + rPropSet.setProperty( PROP_Offset, fOffset ); + } +} + +// private -------------------------------------------------------------------- + +void TypeGroupConverter::insertDataSeries( const Reference< XChartType >& rxChartType, const Reference< XDataSeries >& rxSeries, sal_Int32 nAxesSetIdx ) +{ + if( !rxSeries.is() ) + return; + + PropertySet aSeriesProp( rxSeries ); + + // series stacking mode + namespace cssc = ::com::sun::star::chart2; + cssc::StackingDirection eStacking = cssc::StackingDirection_NO_STACKING; + // stacked overrides deep-3d + if( isStacked() || isPercent() ) + eStacking = cssc::StackingDirection_Y_STACKING; + else if( isDeep3dChart() ) + eStacking = cssc::StackingDirection_Z_STACKING; + aSeriesProp.setProperty( PROP_StackingDirection, eStacking ); + + // additional series properties + aSeriesProp.setProperty( PROP_AttachedAxisIndex, nAxesSetIdx ); + + // insert series into container + try + { + Reference< XDataSeriesContainer > xSeriesCont( rxChartType, UNO_QUERY_THROW ); + xSeriesCont->addDataSeries( rxSeries ); + } + catch( Exception& ) + { + OSL_FAIL( "TypeGroupConverter::insertDataSeries - cannot add data series" ); + } +} + +} // namespace oox + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/drawingml/chart/typegroupmodel.cxx b/oox/source/drawingml/chart/typegroupmodel.cxx new file mode 100644 index 000000000..9479f93c4 --- /dev/null +++ b/oox/source/drawingml/chart/typegroupmodel.cxx @@ -0,0 +1,67 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include +#include + +namespace oox::drawingml::chart { + +UpDownBarsModel::UpDownBarsModel() : + mnGapWidth( 150 ) +{ +} + +UpDownBarsModel::~UpDownBarsModel() +{ +} + +TypeGroupModel::TypeGroupModel( sal_Int32 nTypeId, bool bMSO2007Doc ) : + mfSplitPos( 0.0 ), + mnBarDir( XML_col ), + mnBubbleScale( 100 ), + mnFirstAngle( 0 ), + mnGapDepth( 150 ), + mnGapWidth( 150 ), + mnGrouping( bMSO2007Doc ? XML_standard : XML_clustered ), + mnHoleSize( 10 ), + mnOfPieType( XML_pie ), + mnOverlap( 0 ), + mnRadarStyle( XML_standard ), + mnScatterStyle( XML_marker ), + mnSecondPieSize( 75 ), + mnShape( XML_box ), + mnSizeRepresents( XML_area ), + mnSplitType( XML_auto ), + mnTypeId( nTypeId ), + mbBubble3d( !bMSO2007Doc ), + mbShowMarker( !bMSO2007Doc ), + mbShowNegBubbles( !bMSO2007Doc ), + mbSmooth( !bMSO2007Doc ), + mbVaryColors( false ), + mbWireframe( !bMSO2007Doc ) +{ +} + +TypeGroupModel::~TypeGroupModel() +{ +} + +} // namespace oox::drawingml::chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/drawingml/clrscheme.cxx b/oox/source/drawingml/clrscheme.cxx new file mode 100644 index 000000000..19c0afd44 --- /dev/null +++ b/oox/source/drawingml/clrscheme.cxx @@ -0,0 +1,125 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include + +#include +#include + +#include +#include +#include +#include + +using namespace com::sun::star; + +namespace oox::drawingml { + +bool ClrMap::getColorMap( sal_Int32& nClrToken ) +{ + sal_Int32 nMapped = 0; + std::map < sal_Int32, sal_Int32 >::const_iterator aIter( maClrMap.find( nClrToken ) ); + if ( aIter != maClrMap.end() ) + nMapped = (*aIter).second; + if ( nMapped ) + { + nClrToken = nMapped; + return true; + } + else + return false; +} + +void ClrMap::setColorMap( sal_Int32 nClrToken, sal_Int32 nMappedClrToken ) +{ + maClrMap[ nClrToken ] = nMappedClrToken; +} + +namespace { + +struct find_by_token +{ + explicit find_by_token(sal_Int32 token): + m_token(token) + { + } + + bool operator()(const std::pair& r) + { + return r.first == m_token; + } + +private: + sal_Int32 m_token; +}; + +} + +bool ClrScheme::getColor( sal_Int32 nSchemeClrToken, ::Color& rColor ) const +{ + OSL_ASSERT((nSchemeClrToken & sal_Int32(0xFFFF0000))==0); + switch( nSchemeClrToken ) + { + case XML_bg1 : nSchemeClrToken = XML_lt1; break; + case XML_bg2 : nSchemeClrToken = XML_lt2; break; + case XML_tx1 : nSchemeClrToken = XML_dk1; break; + case XML_tx2 : nSchemeClrToken = XML_dk2; break; + } + + auto aIter = std::find_if(maClrScheme.begin(), maClrScheme.end(), find_by_token(nSchemeClrToken) ); + + if ( aIter != maClrScheme.end() ) + rColor = aIter->second; + + return aIter != maClrScheme.end(); +} + +void ClrScheme::setColor( sal_Int32 nSchemeClrToken, ::Color nColor ) +{ + const auto aIter = std::find_if(maClrScheme.begin(), maClrScheme.end(), find_by_token(nSchemeClrToken) ); + if ( aIter != maClrScheme.end() ) + aIter->second = nColor; + else + maClrScheme.emplace_back(nSchemeClrToken, nColor); +} + +bool ClrScheme::getColorByIndex(size_t nIndex, ::Color& rColor) const +{ + if (nIndex >= maClrScheme.size()) + return false; + + rColor = maClrScheme[nIndex].second; + return true; +} + +void ClrScheme::ToAny(css::uno::Any& rVal) const +{ + std::vector aRet; + + for (const auto& rIndexAndColor : maClrScheme) + { + aRet.push_back(static_cast(rIndexAndColor.second)); + } + + rVal <<= comphelper::containerToSequence(aRet); +} + +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/drawingml/clrschemecontext.cxx b/oox/source/drawingml/clrschemecontext.cxx new file mode 100644 index 000000000..e8850974c --- /dev/null +++ b/oox/source/drawingml/clrschemecontext.cxx @@ -0,0 +1,102 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include +#include +#include +#include +#include + +using namespace ::oox::core; +using namespace ::com::sun::star::uno; +using namespace ::com::sun::star::xml::sax; + +namespace oox::drawingml { + +static void setClrMap( const ::oox::AttributeList& rAttributes, + ClrMap& rClrMap, sal_Int32 nToken ) +{ + if ( rAttributes.hasAttribute( nToken ) ) + { + sal_Int32 nMappedToken = rAttributes.getToken( nToken, 0 ); + rClrMap.setColorMap( nToken, nMappedToken ); + } +} + +clrMapContext::clrMapContext( ContextHandler2Helper const & rParent, + const ::oox::AttributeList& rAttributes, ClrMap& rClrMap ) +: ContextHandler2( rParent ) +{ + setClrMap( rAttributes, rClrMap, XML_bg1 ); + setClrMap( rAttributes, rClrMap, XML_tx1 ); + setClrMap( rAttributes, rClrMap, XML_bg2 ); + setClrMap( rAttributes, rClrMap, XML_tx2 ); + setClrMap( rAttributes, rClrMap, XML_accent1 ); + setClrMap( rAttributes, rClrMap, XML_accent2 ); + setClrMap( rAttributes, rClrMap, XML_accent3 ); + setClrMap( rAttributes, rClrMap, XML_accent4 ); + setClrMap( rAttributes, rClrMap, XML_accent5 ); + setClrMap( rAttributes, rClrMap, XML_accent6 ); + setClrMap( rAttributes, rClrMap, XML_hlink ); + setClrMap( rAttributes, rClrMap, XML_folHlink ); +} + +clrSchemeColorContext::clrSchemeColorContext( ContextHandler2Helper const & rParent, ClrScheme& rClrScheme, sal_Int32 nColorToken ) : + ColorContext( rParent, *this ), + mrClrScheme( rClrScheme ), + mnColorToken( nColorToken ) +{ +} + +clrSchemeColorContext::~clrSchemeColorContext() +{ + mrClrScheme.setColor( mnColorToken, getColor( getFilter().getGraphicHelper() ) ); +} + +clrSchemeContext::clrSchemeContext( ContextHandler2Helper const & rParent, ClrScheme& rClrScheme ) : + ContextHandler2( rParent ), + mrClrScheme( rClrScheme ) +{ +} + +ContextHandlerRef clrSchemeContext::onCreateContext( + sal_Int32 nElement, const AttributeList& ) +{ + switch( nElement ) + { + case A_TOKEN( dk1 ): + case A_TOKEN( lt1 ): + case A_TOKEN( dk2 ): + case A_TOKEN( lt2 ): + case A_TOKEN( accent1 ): + case A_TOKEN( accent2 ): + case A_TOKEN( accent3 ): + case A_TOKEN( accent4 ): + case A_TOKEN( accent5 ): + case A_TOKEN( accent6 ): + case A_TOKEN( hlink ): + case A_TOKEN( folHlink ): + return new clrSchemeColorContext( *this, mrClrScheme, getBaseToken( nElement ) ); + } + return nullptr; +} + +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/drawingml/color.cxx b/oox/source/drawingml/color.cxx new file mode 100644 index 000000000..f810deecf --- /dev/null +++ b/oox/source/drawingml/color.cxx @@ -0,0 +1,873 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace oox::drawingml { + +namespace { + +/** Global storage for predefined color values used in OOXML file formats. */ +struct PresetColorsPool +{ + typedef ::std::vector< ::Color > ColorVector; + + ColorVector maDmlColors; /// Predefined colors in DrawingML, indexed by XML token. + ColorVector maVmlColors; /// Predefined colors in VML, indexed by XML token. + ColorVector maHighlightColors; /// Predefined colors in DrawingML for highlight, indexed by XML token. + + explicit PresetColorsPool(); +}; + +PresetColorsPool::PresetColorsPool() : + maDmlColors( static_cast< size_t >( XML_TOKEN_COUNT ), API_RGB_TRANSPARENT ), + maVmlColors( static_cast< size_t >( XML_TOKEN_COUNT ), API_RGB_TRANSPARENT ), + maHighlightColors( static_cast(XML_TOKEN_COUNT), API_RGB_TRANSPARENT ) +{ + // predefined colors in DrawingML (map XML token identifiers to RGB values) + static const std::pair spnDmlColors[] = + { + {XML_aliceBlue, ::Color(0xF0F8FF)}, {XML_antiqueWhite, ::Color(0xFAEBD7)}, + {XML_aqua, ::Color(0x00FFFF)}, {XML_aquamarine, ::Color(0x7FFFD4)}, + {XML_azure, ::Color(0xF0FFFF)}, {XML_beige, ::Color(0xF5F5DC)}, + {XML_bisque, ::Color(0xFFE4C4)}, {XML_black, ::Color(0x000000)}, + {XML_blanchedAlmond, ::Color(0xFFEBCD)}, {XML_blue, ::Color(0x0000FF)}, + {XML_blueViolet, ::Color(0x8A2BE2)}, {XML_brown, ::Color(0xA52A2A)}, + {XML_burlyWood, ::Color(0xDEB887)}, {XML_cadetBlue, ::Color(0x5F9EA0)}, + {XML_chartreuse, ::Color(0x7FFF00)}, {XML_chocolate, ::Color(0xD2691E)}, + {XML_coral, ::Color(0xFF7F50)}, {XML_cornflowerBlue, ::Color(0x6495ED)}, + {XML_cornsilk, ::Color(0xFFF8DC)}, {XML_crimson, ::Color(0xDC143C)}, + {XML_cyan, ::Color(0x00FFFF)}, {XML_deepPink, ::Color(0xFF1493)}, + {XML_deepSkyBlue, ::Color(0x00BFFF)}, {XML_dimGray, ::Color(0x696969)}, + {XML_dkBlue, ::Color(0x00008B)}, {XML_dkCyan, ::Color(0x008B8B)}, + {XML_dkGoldenrod, ::Color(0xB8860B)}, {XML_dkGray, ::Color(0xA9A9A9)}, + {XML_dkGreen, ::Color(0x006400)}, {XML_dkKhaki, ::Color(0xBDB76B)}, + {XML_dkMagenta, ::Color(0x8B008B)}, {XML_dkOliveGreen, ::Color(0x556B2F)}, + {XML_dkOrange, ::Color(0xFF8C00)}, {XML_dkOrchid, ::Color(0x9932CC)}, + {XML_dkRed, ::Color(0x8B0000)}, {XML_dkSalmon, ::Color(0xE9967A)}, + {XML_dkSeaGreen, ::Color(0x8FBC8B)}, {XML_dkSlateBlue, ::Color(0x483D8B)}, + {XML_dkSlateGray, ::Color(0x2F4F4F)}, {XML_dkTurquoise, ::Color(0x00CED1)}, + {XML_dkViolet, ::Color(0x9400D3)}, {XML_dodgerBlue, ::Color(0x1E90FF)}, + {XML_firebrick, ::Color(0xB22222)}, {XML_floralWhite, ::Color(0xFFFAF0)}, + {XML_forestGreen, ::Color(0x228B22)}, {XML_fuchsia, ::Color(0xFF00FF)}, + {XML_gainsboro, ::Color(0xDCDCDC)}, {XML_ghostWhite, ::Color(0xF8F8FF)}, + {XML_gold, ::Color(0xFFD700)}, {XML_goldenrod, ::Color(0xDAA520)}, + {XML_gray, ::Color(0x808080)}, {XML_green, ::Color(0x008000)}, + {XML_greenYellow, ::Color(0xADFF2F)}, {XML_honeydew, ::Color(0xF0FFF0)}, + {XML_hotPink, ::Color(0xFF69B4)}, {XML_indianRed, ::Color(0xCD5C5C)}, + {XML_indigo, ::Color(0x4B0082)}, {XML_ivory, ::Color(0xFFFFF0)}, + {XML_khaki, ::Color(0xF0E68C)}, {XML_lavender, ::Color(0xE6E6FA)}, + {XML_lavenderBlush, ::Color(0xFFF0F5)}, {XML_lawnGreen, ::Color(0x7CFC00)}, + {XML_lemonChiffon, ::Color(0xFFFACD)}, {XML_lime, ::Color(0x00FF00)}, + {XML_limeGreen, ::Color(0x32CD32)}, {XML_linen, ::Color(0xFAF0E6)}, + {XML_ltBlue, ::Color(0xADD8E6)}, {XML_ltCoral, ::Color(0xF08080)}, + {XML_ltCyan, ::Color(0xE0FFFF)}, {XML_ltGoldenrodYellow, ::Color(0xFAFA78)}, + {XML_ltGray, ::Color(0xD3D3D3)}, {XML_ltGreen, ::Color(0x90EE90)}, + {XML_ltPink, ::Color(0xFFB6C1)}, {XML_ltSalmon, ::Color(0xFFA07A)}, + {XML_ltSeaGreen, ::Color(0x20B2AA)}, {XML_ltSkyBlue, ::Color(0x87CEFA)}, + {XML_ltSlateGray, ::Color(0x778899)}, {XML_ltSteelBlue, ::Color(0xB0C4DE)}, + {XML_ltYellow, ::Color(0xFFFFE0)}, {XML_magenta, ::Color(0xFF00FF)}, + {XML_maroon, ::Color(0x800000)}, {XML_medAquamarine, ::Color(0x66CDAA)}, + {XML_medBlue, ::Color(0x0000CD)}, {XML_medOrchid, ::Color(0xBA55D3)}, + {XML_medPurple, ::Color(0x9370DB)}, {XML_medSeaGreen, ::Color(0x3CB371)}, + {XML_medSlateBlue, ::Color(0x7B68EE)}, {XML_medSpringGreen, ::Color(0x00FA9A)}, + {XML_medTurquoise, ::Color(0x48D1CC)}, {XML_medVioletRed, ::Color(0xC71585)}, + {XML_midnightBlue, ::Color(0x191970)}, {XML_mintCream, ::Color(0xF5FFFA)}, + {XML_mistyRose, ::Color(0xFFE4E1)}, {XML_moccasin, ::Color(0xFFE4B5)}, + {XML_navajoWhite, ::Color(0xFFDEAD)}, {XML_navy, ::Color(0x000080)}, + {XML_oldLace, ::Color(0xFDF5E6)}, {XML_olive, ::Color(0x808000)}, + {XML_oliveDrab, ::Color(0x6B8E23)}, {XML_orange, ::Color(0xFFA500)}, + {XML_orangeRed, ::Color(0xFF4500)}, {XML_orchid, ::Color(0xDA70D6)}, + {XML_paleGoldenrod, ::Color(0xEEE8AA)}, {XML_paleGreen, ::Color(0x98FB98)}, + {XML_paleTurquoise, ::Color(0xAFEEEE)}, {XML_paleVioletRed, ::Color(0xDB7093)}, + {XML_papayaWhip, ::Color(0xFFEFD5)}, {XML_peachPuff, ::Color(0xFFDAB9)}, + {XML_peru, ::Color(0xCD853F)}, {XML_pink, ::Color(0xFFC0CB)}, + {XML_plum, ::Color(0xDDA0DD)}, {XML_powderBlue, ::Color(0xB0E0E6)}, + {XML_purple, ::Color(0x800080)}, {XML_red, ::Color(0xFF0000)}, + {XML_rosyBrown, ::Color(0xBC8F8F)}, {XML_royalBlue, ::Color(0x4169E1)}, + {XML_saddleBrown, ::Color(0x8B4513)}, {XML_salmon, ::Color(0xFA8072)}, + {XML_sandyBrown, ::Color(0xF4A460)}, {XML_seaGreen, ::Color(0x2E8B57)}, + {XML_seaShell, ::Color(0xFFF5EE)}, {XML_sienna, ::Color(0xA0522D)}, + {XML_silver, ::Color(0xC0C0C0)}, {XML_skyBlue, ::Color(0x87CEEB)}, + {XML_slateBlue, ::Color(0x6A5ACD)}, {XML_slateGray, ::Color(0x708090)}, + {XML_snow, ::Color(0xFFFAFA)}, {XML_springGreen, ::Color(0x00FF7F)}, + {XML_steelBlue, ::Color(0x4682B4)}, {XML_tan, ::Color(0xD2B48C)}, + {XML_teal, ::Color(0x008080)}, {XML_thistle, ::Color(0xD8BFD8)}, + {XML_tomato, ::Color(0xFF6347)}, {XML_turquoise, ::Color(0x40E0D0)}, + {XML_violet, ::Color(0xEE82EE)}, {XML_wheat, ::Color(0xF5DEB3)}, + {XML_white, ::Color(0xFFFFFF)}, {XML_whiteSmoke, ::Color(0xF5F5F5)}, + {XML_yellow, ::Color(0xFFFF00)}, {XML_yellowGreen, ::Color(0x9ACD32)} + }; + for(auto const& nEntry : spnDmlColors) + maDmlColors[ static_cast< size_t >(nEntry.first) ] = nEntry.second; + + // predefined colors in VML (map XML token identifiers to RGB values) + static const std::pair spnVmlColors[] = + { + {XML_aqua, ::Color(0x00FFFF)}, {XML_black, ::Color(0x000000)}, + {XML_blue, ::Color(0x0000FF)}, {XML_fuchsia, ::Color(0xFF00FF)}, + {XML_gray, ::Color(0x808080)}, {XML_green, ::Color(0x008000)}, + {XML_lime, ::Color(0x00FF00)}, {XML_maroon, ::Color(0x800000)}, + {XML_navy, ::Color(0x000080)}, {XML_olive, ::Color(0x808000)}, + {XML_purple, ::Color(0x800080)}, {XML_red, ::Color(0xFF0000)}, + {XML_silver, ::Color(0xC0C0C0)}, {XML_teal, ::Color(0x008080)}, + {XML_white, ::Color(0xFFFFFF)}, {XML_yellow, ::Color(0xFFFF00)} + }; + for(auto const& nEntry : spnVmlColors) + maVmlColors[ static_cast< size_t >(nEntry.first) ] = nEntry.second; + + // predefined highlight colors in DML (map XML token identifiers to RGB values) + static const std::pair spnHighlightColors[] = + { + // tdf#131841 Predefined color for OOXML highlight. + {XML_black, ::Color(0x000000)}, {XML_blue, ::Color(0x0000FF)}, + {XML_cyan, ::Color(0x00FFFF)}, {XML_darkBlue, ::Color(0x00008B)}, + {XML_darkCyan, ::Color(0x008B8B)}, {XML_darkGray, ::Color(0xA9A9A9)}, + {XML_darkGreen, ::Color(0x006400)}, {XML_darkMagenta, ::Color(0x800080)}, + {XML_darkRed, ::Color(0x8B0000)}, {XML_darkYellow, ::Color(0x808000)}, + {XML_green, ::Color(0x00FF00)}, {XML_lightGray, ::Color(0xD3D3D3)}, + {XML_magenta, ::Color(0xFF00FF)}, {XML_red, ::Color(0xFF0000)}, + {XML_white, ::Color(0xFFFFFF)}, {XML_yellow, ::Color(0xFFFF00)} + }; + for (auto const& nEntry : spnHighlightColors) + maHighlightColors[static_cast(nEntry.first)] = nEntry.second; +} + +struct StaticPresetColorsPool : public ::rtl::Static< PresetColorsPool, StaticPresetColorsPool > {}; + +const double DEC_GAMMA = 2.3; +const double INC_GAMMA = 1.0 / DEC_GAMMA; + +void lclRgbToRgbComponents( sal_Int32& ornR, sal_Int32& ornG, sal_Int32& ornB, ::Color nRgb ) +{ + ornR = nRgb.GetRed(); + ornG = nRgb.GetGreen(); + ornB = nRgb.GetBlue(); +} + +sal_Int32 lclRgbComponentsToRgb( sal_Int32 nR, sal_Int32 nG, sal_Int32 nB ) +{ + return static_cast< sal_Int32 >( (nR << 16) | (nG << 8) | nB ); +} + +sal_Int32 lclRgbCompToCrgbComp( sal_Int32 nRgbComp ) +{ + return static_cast< sal_Int32 >( nRgbComp * MAX_PERCENT / 255 ); +} + +sal_Int32 lclCrgbCompToRgbComp( sal_Int32 nCrgbComp ) +{ + return static_cast< sal_Int32 >( nCrgbComp * 255 / MAX_PERCENT ); +} + +sal_Int32 lclGamma( sal_Int32 nComp, double fGamma ) +{ + return static_cast< sal_Int32 >( pow( static_cast< double >( nComp ) / MAX_PERCENT, fGamma ) * MAX_PERCENT + 0.5 ); +} + +void lclSetValue( sal_Int32& ornValue, sal_Int32 nNew, sal_Int32 nMax = MAX_PERCENT ) +{ + OSL_ENSURE( (0 <= nNew) && (nNew <= nMax), "lclSetValue - invalid value" ); + if( (0 <= nNew) && (nNew <= nMax) ) + ornValue = nNew; +} + +void lclModValue( sal_Int32& ornValue, sal_Int32 nMod, sal_Int32 nMax = MAX_PERCENT ) +{ + OSL_ENSURE( (0 <= nMod), "lclModValue - invalid modificator" ); + ornValue = getLimitedValue< sal_Int32, double >( static_cast< double >( ornValue ) * nMod / MAX_PERCENT, 0, nMax ); +} + +void lclOffValue( sal_Int32& ornValue, sal_Int32 nOff, sal_Int32 nMax = MAX_PERCENT ) +{ + OSL_ENSURE( (-nMax <= nOff) && (nOff <= nMax), "lclOffValue - invalid offset" ); + ornValue = getLimitedValue< sal_Int32, sal_Int32 >( ornValue + nOff, 0, nMax ); +} + +} // namespace + +Color::Color() : + meMode( COLOR_UNUSED ), + mnC1( 0 ), + mnC2( 0 ), + mnC3( 0 ), + mnAlpha( MAX_PERCENT ) +{ +} + +::Color Color::getDmlPresetColor( sal_Int32 nToken, ::Color nDefaultRgb ) +{ + /* Do not pass nDefaultRgb to ContainerHelper::getVectorElement(), to be + able to catch the existing vector entries without corresponding XML + token identifier. */ + ::Color nRgbValue = ContainerHelper::getVectorElement( StaticPresetColorsPool::get().maDmlColors, nToken, API_RGB_TRANSPARENT ); + return (sal_Int32(nRgbValue) >= 0) ? nRgbValue : nDefaultRgb; +} + +::Color Color::getVmlPresetColor( sal_Int32 nToken, ::Color nDefaultRgb ) +{ + /* Do not pass nDefaultRgb to ContainerHelper::getVectorElement(), to be + able to catch the existing vector entries without corresponding XML + token identifier. */ + ::Color nRgbValue = ContainerHelper::getVectorElement( StaticPresetColorsPool::get().maVmlColors, nToken, API_RGB_TRANSPARENT ); + return (sal_Int32(nRgbValue) >= 0) ? nRgbValue : nDefaultRgb; +} + +::Color Color::getHighlightColor(sal_Int32 nToken, ::Color nDefaultRgb) +{ + /* Do not pass nDefaultRgb to ContainerHelper::getVectorElement(), to be + able to catch the existing vector entries without corresponding XML + token identifier. */ + ::Color nRgbValue = ContainerHelper::getVectorElement( StaticPresetColorsPool::get().maHighlightColors, nToken, API_RGB_TRANSPARENT ); + return (sal_Int32(nRgbValue) >= 0) ? nRgbValue : nDefaultRgb; +} + +void Color::setUnused() +{ + meMode = COLOR_UNUSED; +} + +void Color::setSrgbClr( ::Color nRgb ) +{ + setSrgbClr(sal_Int32(nRgb)); +} + +void Color::setSrgbClr( sal_Int32 nRgb ) +{ + OSL_ENSURE( (0 <= nRgb) && (nRgb <= 0xFFFFFF), "Color::setSrgbClr - invalid RGB value" ); + meMode = COLOR_RGB; + lclRgbToRgbComponents( mnC1, mnC2, mnC3, ::Color(ColorTransparency, nRgb) ); +} + +void Color::setScrgbClr( sal_Int32 nR, sal_Int32 nG, sal_Int32 nB ) +{ + OSL_ENSURE( (0 <= nR) && (nR <= MAX_PERCENT), "Color::setScrgbClr - invalid red value" ); + OSL_ENSURE( (0 <= nG) && (nG <= MAX_PERCENT), "Color::setScrgbClr - invalid green value" ); + OSL_ENSURE( (0 <= nB) && (nB <= MAX_PERCENT), "Color::setScrgbClr - invalid blue value" ); + meMode = COLOR_CRGB; + mnC1 = getLimitedValue< sal_Int32, sal_Int32 >( nR, 0, MAX_PERCENT ); + mnC2 = getLimitedValue< sal_Int32, sal_Int32 >( nG, 0, MAX_PERCENT ); + mnC3 = getLimitedValue< sal_Int32, sal_Int32 >( nB, 0, MAX_PERCENT ); +} + +void Color::setHslClr( sal_Int32 nHue, sal_Int32 nSat, sal_Int32 nLum ) +{ + OSL_ENSURE( (0 <= nHue) && (nHue <= MAX_DEGREE), "Color::setHslClr - invalid hue value" ); + OSL_ENSURE( (0 <= nSat) && (nSat <= MAX_PERCENT), "Color::setHslClr - invalid saturation value" ); + OSL_ENSURE( (0 <= nLum) && (nLum <= MAX_PERCENT), "Color::setHslClr - invalid luminance value" ); + meMode = COLOR_HSL; + mnC1 = getLimitedValue< sal_Int32, sal_Int32 >( nHue, 0, MAX_DEGREE ); + mnC2 = getLimitedValue< sal_Int32, sal_Int32 >( nSat, 0, MAX_PERCENT ); + mnC3 = getLimitedValue< sal_Int32, sal_Int32 >( nLum, 0, MAX_PERCENT ); +} + +void Color::setPrstClr( sal_Int32 nToken ) +{ + ::Color nRgbValue = getDmlPresetColor( nToken, API_RGB_TRANSPARENT ); + OSL_ENSURE( sal_Int32(nRgbValue) >= 0, "Color::setPrstClr - invalid preset color token" ); + if( sal_Int32(nRgbValue) >= 0 ) + setSrgbClr( nRgbValue ); +} + +void Color::setHighlight(sal_Int32 nToken) +{ + ::Color nRgbValue = getHighlightColor(nToken, API_RGB_TRANSPARENT); + OSL_ENSURE( sal_Int32(nRgbValue) >= 0, "Color::setPrstClr - invalid preset color token" ); + if ( sal_Int32(nRgbValue) >= 0 ) + setSrgbClr( nRgbValue ); +} + +void Color::setSchemeClr( sal_Int32 nToken ) +{ + OSL_ENSURE( nToken != XML_TOKEN_INVALID, "Color::setSchemeClr - invalid color token" ); + meMode = (nToken == XML_phClr) ? COLOR_PH : COLOR_SCHEME; + mnC1 = nToken; +} + +void Color::setPaletteClr( sal_Int32 nPaletteIdx ) +{ + OSL_ENSURE( nPaletteIdx >= 0, "Color::setPaletteClr - invalid palette index" ); + meMode = COLOR_PALETTE; + mnC1 = nPaletteIdx; +} + +void Color::setSysClr( sal_Int32 nToken, sal_Int32 nLastRgb ) +{ + OSL_ENSURE( (-1 <= nLastRgb) && (nLastRgb <= 0xFFFFFF), "Color::setSysClr - invalid RGB value" ); + meMode = COLOR_SYSTEM; + mnC1 = nToken; + mnC2 = nLastRgb; +} + +void Color::addTransformation( sal_Int32 nElement, sal_Int32 nValue ) +{ + /* Execute alpha transformations directly, store other transformations in + a vector, they may depend on a scheme base color which will be resolved + in Color::getColor(). */ + sal_Int32 nToken = getBaseToken( nElement ); + switch( nToken ) + { + case XML_alpha: lclSetValue( mnAlpha, nValue ); break; + case XML_alphaMod: lclModValue( mnAlpha, nValue ); break; + case XML_alphaOff: lclOffValue( mnAlpha, nValue ); break; + default: maTransforms.emplace_back( nToken, nValue ); + } + sal_Int32 nSize = maInteropTransformations.getLength(); + maInteropTransformations.realloc(nSize + 1); + auto pInteropTransformations = maInteropTransformations.getArray(); + pInteropTransformations[nSize].Name = getColorTransformationName( nToken ); + pInteropTransformations[nSize].Value <<= nValue; +} + +void Color::addChartTintTransformation( double fTint ) +{ + sal_Int32 nValue = getLimitedValue< sal_Int32, double >( fTint * MAX_PERCENT + 0.5, -MAX_PERCENT, MAX_PERCENT ); + if( nValue < 0 ) + maTransforms.emplace_back( XML_shade, nValue + MAX_PERCENT ); + else if( nValue > 0 ) + maTransforms.emplace_back( XML_tint, MAX_PERCENT - nValue ); +} + +void Color::addExcelTintTransformation( double fTint ) +{ + sal_Int32 nValue = getLimitedValue< sal_Int32, double >( fTint * MAX_PERCENT + 0.5, -MAX_PERCENT, MAX_PERCENT ); + maTransforms.emplace_back( XLS_TOKEN( tint ), nValue ); +} + +void Color::clearTransformations() +{ + maTransforms.clear(); + maInteropTransformations.realloc(0); + clearTransparence(); +} + +OUString Color::getColorTransformationName( sal_Int32 nElement ) +{ + switch( nElement ) + { + case XML_red: return "red"; + case XML_redMod: return "redMod"; + case XML_redOff: return "redOff"; + case XML_green: return "green"; + case XML_greenMod: return "greenMod"; + case XML_greenOff: return "greenOff"; + case XML_blue: return "blue"; + case XML_blueMod: return "blueMod"; + case XML_blueOff: return "blueOff"; + case XML_alpha: return "alpha"; + case XML_alphaMod: return "alphaMod"; + case XML_alphaOff: return "alphaOff"; + case XML_hue: return "hue"; + case XML_hueMod: return "hueMod"; + case XML_hueOff: return "hueOff"; + case XML_sat: return "sat"; + case XML_satMod: return "satMod"; + case XML_satOff: return "satOff"; + case XML_lum: return "lum"; + case XML_lumMod: return "lumMod"; + case XML_lumOff: return "lumOff"; + case XML_shade: return "shade"; + case XML_tint: return "tint"; + case XML_gray: return "gray"; + case XML_comp: return "comp"; + case XML_inv: return "inv"; + case XML_gamma: return "gamma"; + case XML_invGamma: return "invGamma"; + } + SAL_WARN( "oox.drawingml", "Color::getColorTransformationName - unexpected transformation type" ); + return OUString(); +} + +sal_Int32 Color::getColorTransformationToken( std::u16string_view sName ) +{ + if( sName == u"red" ) + return XML_red; + else if( sName == u"redMod" ) + return XML_redMod; + else if( sName == u"redOff" ) + return XML_redOff; + else if( sName == u"green" ) + return XML_green; + else if( sName == u"greenMod" ) + return XML_greenMod; + else if( sName == u"greenOff" ) + return XML_greenOff; + else if( sName == u"blue" ) + return XML_blue; + else if( sName == u"blueMod" ) + return XML_blueMod; + else if( sName == u"blueOff" ) + return XML_blueOff; + else if( sName == u"alpha" ) + return XML_alpha; + else if( sName == u"alphaMod" ) + return XML_alphaMod; + else if( sName == u"alphaOff" ) + return XML_alphaOff; + else if( sName == u"hue" ) + return XML_hue; + else if( sName == u"hueMod" ) + return XML_hueMod; + else if( sName == u"hueOff" ) + return XML_hueOff; + else if( sName == u"sat" ) + return XML_sat; + else if( sName == u"satMod" ) + return XML_satMod; + else if( sName == u"satOff" ) + return XML_satOff; + else if( sName == u"lum" ) + return XML_lum; + else if( sName == u"lumMod" ) + return XML_lumMod; + else if( sName == u"lumOff" ) + return XML_lumOff; + else if( sName == u"shade" ) + return XML_shade; + else if( sName == u"tint" ) + return XML_tint; + else if( sName == u"gray" ) + return XML_gray; + else if( sName == u"comp" ) + return XML_comp; + else if( sName == u"inv" ) + return XML_inv; + else if( sName == u"gamma" ) + return XML_gamma; + else if( sName == u"invGamma" ) + return XML_invGamma; + + SAL_WARN( "oox.drawingml", "Color::getColorTransformationToken - unexpected transformation type" ); + return XML_TOKEN_INVALID; +} + +bool Color::equals(const Color& rOther, const GraphicHelper& rGraphicHelper, ::Color nPhClr) const +{ + if (getColor(rGraphicHelper, nPhClr) != rOther.getColor(rGraphicHelper, nPhClr)) + return false; + + return getTransparency() == rOther.getTransparency(); +} + +void Color::clearTransparence() +{ + mnAlpha = MAX_PERCENT; +} + +sal_Int16 Color::getTintOrShade() const +{ + for(auto const& aTransform : maTransforms) + { + switch(aTransform.mnToken) + { + case XML_tint: + // from 1000th percent to 100th percent... + return aTransform.mnValue/10; + case XML_shade: + // from 1000th percent to 100th percent... + return -aTransform.mnValue/10; + } + } + return 0; +} + +sal_Int16 Color::getLumMod() const +{ + for (const auto& rTransform : maTransforms) + { + if (rTransform.mnToken != XML_lumMod) + { + continue; + } + + // From 1000th percent to 100th percent. + return rTransform.mnValue / 10; + } + + return 10000; +} + +sal_Int16 Color::getLumOff() const +{ + for (const auto& rTransform : maTransforms) + { + if (rTransform.mnToken != XML_lumOff) + { + continue; + } + + // From 1000th percent to 100th percent. + return rTransform.mnValue / 10; + } + + return 0; +} + +::Color Color::getColor( const GraphicHelper& rGraphicHelper, ::Color nPhClr ) const +{ + const sal_Int32 nTempC1 = mnC1; + const sal_Int32 nTempC2 = mnC2; + const sal_Int32 nTempC3 = mnC3; + const ColorMode eTempMode = meMode; + + switch( meMode ) + { + case COLOR_UNUSED: mnC1 = sal_Int32(API_RGB_TRANSPARENT); break; + + case COLOR_RGB: break; // nothing to do + case COLOR_CRGB: break; // nothing to do + case COLOR_HSL: break; // nothing to do + + case COLOR_SCHEME: setResolvedRgb( rGraphicHelper.getSchemeColor( mnC1 ) ); break; + case COLOR_PALETTE: setResolvedRgb( rGraphicHelper.getPaletteColor( mnC1 ) ); break; + case COLOR_SYSTEM: setResolvedRgb( rGraphicHelper.getSystemColor( mnC1, ::Color(ColorTransparency, mnC2) ) ); break; + case COLOR_PH: setResolvedRgb( nPhClr ); break; + + case COLOR_FINAL: return ::Color(ColorTransparency, mnC1); + } + + // if color is UNUSED or turns to UNUSED in setResolvedRgb, do not perform transformations + if( meMode != COLOR_UNUSED ) + { + for (auto const& transform : maTransforms) + { + switch( transform.mnToken ) + { + case XML_red: toCrgb(); lclSetValue( mnC1, transform.mnValue ); break; + case XML_redMod: toCrgb(); lclModValue( mnC1, transform.mnValue ); break; + case XML_redOff: toCrgb(); lclOffValue( mnC1, transform.mnValue ); break; + case XML_green: toCrgb(); lclSetValue( mnC2, transform.mnValue ); break; + case XML_greenMod: toCrgb(); lclModValue( mnC2, transform.mnValue ); break; + case XML_greenOff: toCrgb(); lclOffValue( mnC2, transform.mnValue ); break; + case XML_blue: toCrgb(); lclSetValue( mnC3, transform.mnValue ); break; + case XML_blueMod: toCrgb(); lclModValue( mnC3, transform.mnValue ); break; + case XML_blueOff: toCrgb(); lclOffValue( mnC3, transform.mnValue ); break; + + case XML_hue: toHsl(); lclSetValue( mnC1, transform.mnValue, MAX_DEGREE ); break; + case XML_hueMod: toHsl(); lclModValue( mnC1, transform.mnValue, MAX_DEGREE ); break; + case XML_hueOff: toHsl(); lclOffValue( mnC1, transform.mnValue, MAX_DEGREE ); break; + case XML_sat: toHsl(); lclSetValue( mnC2, transform.mnValue ); break; + case XML_satMod: toHsl(); lclModValue( mnC2, transform.mnValue ); break; + case XML_satOff: toHsl(); lclOffValue( mnC2, transform.mnValue ); break; + + case XML_lum: + toHsl(); + lclSetValue( mnC3, transform.mnValue ); + // if color changes to black or white, it will stay gray if luminance changes again + if( (mnC3 == 0) || (mnC3 == MAX_PERCENT) ) mnC2 = 0; + break; + case XML_lumMod: + toHsl(); + lclModValue( mnC3, transform.mnValue ); + // if color changes to black or white, it will stay gray if luminance changes again + if( (mnC3 == 0) || (mnC3 == MAX_PERCENT) ) mnC2 = 0; + break; + case XML_lumOff: + toHsl(); + lclOffValue( mnC3, transform.mnValue ); + // if color changes to black or white, it will stay gray if luminance changes again + if( (mnC3 == 0) || (mnC3 == MAX_PERCENT) ) mnC2 = 0; + break; + + case XML_shade: + // shade: 0% = black, 100% = original color + toCrgb(); + OSL_ENSURE( (0 <= transform.mnValue) && (transform.mnValue <= MAX_PERCENT), "Color::getColor - invalid shade value" ); + if( (0 <= transform.mnValue) && (transform.mnValue <= MAX_PERCENT) ) + { + double fFactor = static_cast< double >( transform.mnValue ) / MAX_PERCENT; + mnC1 = static_cast< sal_Int32 >( mnC1 * fFactor ); + mnC2 = static_cast< sal_Int32 >( mnC2 * fFactor ); + mnC3 = static_cast< sal_Int32 >( mnC3 * fFactor ); + } + break; + case XML_tint: + // tint: 0% = white, 100% = original color + toCrgb(); + OSL_ENSURE( (0 <= transform.mnValue) && (transform.mnValue <= MAX_PERCENT), "Color::getColor - invalid tint value" ); + if( (0 <= transform.mnValue) && (transform.mnValue <= MAX_PERCENT) ) + { + double fFactor = static_cast< double >( transform.mnValue ) / MAX_PERCENT; + mnC1 = static_cast< sal_Int32 >( MAX_PERCENT - (MAX_PERCENT - mnC1) * fFactor ); + mnC2 = static_cast< sal_Int32 >( MAX_PERCENT - (MAX_PERCENT - mnC2) * fFactor ); + mnC3 = static_cast< sal_Int32 >( MAX_PERCENT - (MAX_PERCENT - mnC3) * fFactor ); + } + break; + case XLS_TOKEN( tint ): + // Excel tint: move luminance relative to current value + toHsl(); + OSL_ENSURE( (-MAX_PERCENT <= transform.mnValue) && (transform.mnValue <= MAX_PERCENT), "Color::getColor - invalid tint value" ); + if( (-MAX_PERCENT <= transform.mnValue) && (transform.mnValue < 0) ) + { + // negative: luminance towards 0% (black) + lclModValue( mnC3, transform.mnValue + MAX_PERCENT ); + } + else if( (0 < transform.mnValue) && (transform.mnValue <= MAX_PERCENT) ) + { + // positive: luminance towards 100% (white) + mnC3 = MAX_PERCENT - mnC3; + lclModValue( mnC3, MAX_PERCENT - transform.mnValue ); + mnC3 = MAX_PERCENT - mnC3; + } + break; + + case XML_gray: + // change color to gray, weighted RGB: 22% red, 72% green, 6% blue + toRgb(); + mnC1 = mnC2 = mnC3 = (mnC1 * 22 + mnC2 * 72 + mnC3 * 6) / 100; + break; + + case XML_comp: + // comp: rotate hue by 180 degrees, do not change lum/sat + toHsl(); + mnC1 = (mnC1 + (180 * PER_DEGREE)) % MAX_DEGREE; + break; + case XML_inv: + // invert percentual RGB values + toCrgb(); + mnC1 = MAX_PERCENT - mnC1; + mnC2 = MAX_PERCENT - mnC2; + mnC3 = MAX_PERCENT - mnC3; + break; + + case XML_gamma: + // increase gamma of color + toCrgb(); + mnC1 = lclGamma( mnC1, INC_GAMMA ); + mnC2 = lclGamma( mnC2, INC_GAMMA ); + mnC3 = lclGamma( mnC3, INC_GAMMA ); + break; + case XML_invGamma: + // decrease gamma of color + toCrgb(); + mnC1 = lclGamma( mnC1, DEC_GAMMA ); + mnC2 = lclGamma( mnC2, DEC_GAMMA ); + mnC3 = lclGamma( mnC3, DEC_GAMMA ); + break; + } + } + + // store resulting RGB value in mnC1 + toRgb(); + mnC1 = lclRgbComponentsToRgb( mnC1, mnC2, mnC3 ); + } + else // if( meMode != COLOR_UNUSED ) + { + mnC1 = sal_Int32(API_RGB_TRANSPARENT); + } + + sal_Int32 nRet = mnC1; + // Restore the original values when the color depends on one of the input + // parameters (rGraphicHelper or nPhClr) + if( eTempMode >= COLOR_SCHEME && eTempMode <= COLOR_PH ) + { + mnC1 = nTempC1; + mnC2 = nTempC2; + mnC3 = nTempC3; + meMode = eTempMode; + } + else + { + meMode = COLOR_FINAL; + } + if( meMode == COLOR_FINAL ) + maTransforms.clear(); + return ::Color(ColorTransparency, nRet); +} + +bool Color::hasTransparency() const +{ + return mnAlpha < MAX_PERCENT; +} + +sal_Int16 Color::getTransparency() const +{ + return sal_Int16(std::round( (1.0 * (MAX_PERCENT - mnAlpha)) / PER_PERCENT) ); +} + +sal_Int16 Color::getSchemeColorIndex() const +{ + static std::map const aSchemeColorNameToIndex{ + { "dk1", 0 }, { "lt1", 1 }, { "dk2", 2 }, { "lt2", 3 }, + { "accent1", 4 }, { "accent2", 5 }, { "accent3", 6 }, { "accent4", 7 }, + { "accent5", 8 }, { "accent6", 9 }, { "hlink", 10 }, { "folHlink", 11 } + }; + + auto aIt = aSchemeColorNameToIndex.find(msSchemeName); + if( aIt == aSchemeColorNameToIndex.end() ) + return -1; + else + return aIt->second; +} + +// private -------------------------------------------------------------------- + +void Color::setResolvedRgb( ::Color nRgb ) const +{ + meMode = (sal_Int32(nRgb) < 0) ? COLOR_UNUSED : COLOR_RGB; + lclRgbToRgbComponents( mnC1, mnC2, mnC3, nRgb ); +} + +void Color::toRgb() const +{ + switch( meMode ) + { + case COLOR_RGB: + // nothing to do + break; + case COLOR_CRGB: + meMode = COLOR_RGB; + mnC1 = lclCrgbCompToRgbComp( lclGamma( mnC1, INC_GAMMA ) ); + mnC2 = lclCrgbCompToRgbComp( lclGamma( mnC2, INC_GAMMA ) ); + mnC3 = lclCrgbCompToRgbComp( lclGamma( mnC3, INC_GAMMA ) ); + break; + case COLOR_HSL: + { + meMode = COLOR_RGB; + double fR = 0.0, fG = 0.0, fB = 0.0; + if( (mnC2 == 0) || (mnC3 == MAX_PERCENT) ) + { + fR = fG = fB = static_cast< double >( mnC3 ) / MAX_PERCENT; + } + else if( mnC3 > 0 ) + { + // base color from hue + double fHue = static_cast< double >( mnC1 ) / MAX_DEGREE * 6.0; // interval [0.0, 6.0) + if( fHue <= 1.0 ) { fR = 1.0; fG = fHue; } // red...yellow + else if( fHue <= 2.0 ) { fR = 2.0 - fHue; fG = 1.0; } // yellow...green + else if( fHue <= 3.0 ) { fG = 1.0; fB = fHue - 2.0; } // green...cyan + else if( fHue <= 4.0 ) { fG = 4.0 - fHue; fB = 1.0; } // cyan...blue + else if( fHue <= 5.0 ) { fR = fHue - 4.0; fB = 1.0; } // blue...magenta + else { fR = 1.0; fB = 6.0 - fHue; } // magenta...red + + // apply saturation + double fSat = static_cast< double >( mnC2 ) / MAX_PERCENT; + fR = (fR - 0.5) * fSat + 0.5; + fG = (fG - 0.5) * fSat + 0.5; + fB = (fB - 0.5) * fSat + 0.5; + + // apply luminance + double fLum = 2.0 * static_cast< double >( mnC3 ) / MAX_PERCENT - 1.0; // interval [-1.0, 1.0] + if( fLum < 0.0 ) + { + double fShade = fLum + 1.0; // interval [0.0, 1.0] (black...full color) + fR *= fShade; + fG *= fShade; + fB *= fShade; + } + else if( fLum > 0.0 ) + { + double fTint = 1.0 - fLum; // interval [0.0, 1.0] (white...full color) + fR = 1.0 - ((1.0 - fR) * fTint); + fG = 1.0 - ((1.0 - fG) * fTint); + fB = 1.0 - ((1.0 - fB) * fTint); + } + } + mnC1 = static_cast< sal_Int32 >( fR * 255.0 + 0.5 ); + mnC2 = static_cast< sal_Int32 >( fG * 255.0 + 0.5 ); + mnC3 = static_cast< sal_Int32 >( fB * 255.0 + 0.5 ); + } + break; + default: + OSL_FAIL( "Color::toRgb - unexpected color mode" ); + } +} + +void Color::toCrgb() const +{ + switch( meMode ) + { + case COLOR_HSL: + toRgb(); + [[fallthrough]]; + case COLOR_RGB: + meMode = COLOR_CRGB; + mnC1 = lclGamma( lclRgbCompToCrgbComp( mnC1 ), DEC_GAMMA ); + mnC2 = lclGamma( lclRgbCompToCrgbComp( mnC2 ), DEC_GAMMA ); + mnC3 = lclGamma( lclRgbCompToCrgbComp( mnC3 ), DEC_GAMMA ); + break; + case COLOR_CRGB: + // nothing to do + break; + default: + OSL_FAIL( "Color::toCrgb - unexpected color mode" ); + } +} + +void Color::toHsl() const +{ + switch( meMode ) + { + case COLOR_CRGB: + toRgb(); + [[fallthrough]]; + case COLOR_RGB: + { + meMode = COLOR_HSL; + double fR = static_cast< double >( mnC1 ) / 255.0; // red [0.0, 1.0] + double fG = static_cast< double >( mnC2 ) / 255.0; // green [0.0, 1.0] + double fB = static_cast< double >( mnC3 ) / 255.0; // blue [0.0, 1.0] + double fMin = ::std::min( ::std::min( fR, fG ), fB ); + double fMax = ::std::max( ::std::max( fR, fG ), fB ); + double fD = fMax - fMin; + + using ::rtl::math::approxEqual; + + // hue: 0deg = red, 120deg = green, 240deg = blue + if( fD == 0.0 ) // black/gray/white + mnC1 = 0; + else if( approxEqual(fMax, fR, 64) ) // magenta...red...yellow + mnC1 = static_cast< sal_Int32 >( ((fG - fB) / fD * 60.0 + 360.0) * PER_DEGREE + 0.5 ) % MAX_DEGREE; + else if( approxEqual(fMax, fG, 64) ) // yellow...green...cyan + mnC1 = static_cast< sal_Int32 >( ((fB - fR) / fD * 60.0 + 120.0) * PER_DEGREE + 0.5 ); + else // cyan...blue...magenta + mnC1 = static_cast< sal_Int32 >( ((fR - fG) / fD * 60.0 + 240.0) * PER_DEGREE + 0.5 ); + + // luminance: 0% = black, 50% = full color, 100% = white + mnC3 = static_cast< sal_Int32 >( (fMin + fMax) / 2.0 * MAX_PERCENT + 0.5 ); + + // saturation: 0% = gray, 100% = full color + if( (mnC3 == 0) || (mnC3 == MAX_PERCENT) ) // black/white + mnC2 = 0; + else if( mnC3 <= 50 * PER_PERCENT ) // dark...full color + mnC2 = static_cast< sal_Int32 >( fD / (fMin + fMax) * MAX_PERCENT + 0.5 ); + else // full color...light + mnC2 = static_cast< sal_Int32 >( fD / (2.0 - fMax - fMin) * MAX_PERCENT + 0.5 ); + } + break; + case COLOR_HSL: + // nothing to do + break; + default: + OSL_FAIL( "Color::toHsl - unexpected color mode" ); + } +} + +} // namespace oox + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/drawingml/colorchoicecontext.cxx b/oox/source/drawingml/colorchoicecontext.cxx new file mode 100644 index 000000000..fc93b460a --- /dev/null +++ b/oox/source/drawingml/colorchoicecontext.cxx @@ -0,0 +1,178 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include +#include +#include +#include +#include +#include + +namespace oox::drawingml { + +ColorValueContext::ColorValueContext( ContextHandler2Helper const & rParent, Color& rColor ) : + ContextHandler2( rParent ), + mrColor( rColor ) +{ +} + +void ColorValueContext::onStartElement( const AttributeList& rAttribs ) +{ + switch( getCurrentElement() ) + { + case A_TOKEN( scrgbClr ): + mrColor.setScrgbClr( + rAttribs.getInteger( XML_r, 0 ), + rAttribs.getInteger( XML_g, 0 ), + rAttribs.getInteger( XML_b, 0 ) ); + break; + + case A_TOKEN( srgbClr ): + mrColor.setSrgbClr( rAttribs.getIntegerHex( XML_val, 0 ) ); + break; + + case A_TOKEN( hslClr ): + mrColor.setHslClr( + rAttribs.getInteger( XML_hue, 0 ), + rAttribs.getInteger( XML_sat, 0 ), + rAttribs.getInteger( XML_lum, 0 ) ); + break; + + case A_TOKEN( sysClr ): + mrColor.setSysClr( + rAttribs.getToken( XML_val, XML_TOKEN_INVALID ), + rAttribs.getIntegerHex( XML_lastClr, -1 ) ); + break; + + case A_TOKEN( schemeClr ): + { + mrColor.setSchemeClr( rAttribs.getToken( XML_val, XML_TOKEN_INVALID ) ); + oox::OptValue sSchemeName = rAttribs.getString( XML_val ); + if( sSchemeName.has() ) + mrColor.setSchemeName( sSchemeName.use() ); + } + break; + + case A_TOKEN( prstClr ): + mrColor.setPrstClr( rAttribs.getToken( XML_val, XML_TOKEN_INVALID ) ); + break; + } +} + +::oox::core::ContextHandlerRef ColorValueContext::onCreateContext( + sal_Int32 nElement, const AttributeList& rAttribs ) +{ + switch( nElement ) + { + case A_TOKEN( alpha ): + case A_TOKEN( alphaMod ): + case A_TOKEN( alphaOff ): + case A_TOKEN( blue ): + case A_TOKEN( blueMod ): + case A_TOKEN( blueOff ): + case A_TOKEN( hue ): + case A_TOKEN( hueMod ): + case A_TOKEN( hueOff ): + case A_TOKEN( lum ): + case A_TOKEN( lumMod ): + case A_TOKEN( lumOff ): + case A_TOKEN( green ): + case A_TOKEN( greenMod ): + case A_TOKEN( greenOff ): + case A_TOKEN( red ): + case A_TOKEN( redMod ): + case A_TOKEN( redOff ): + case A_TOKEN( sat ): + case A_TOKEN( satMod ): + case A_TOKEN( satOff ): + case A_TOKEN( shade ): + case A_TOKEN( tint ): + { + OUString aValue = rAttribs.getString( XML_val, OUString() ); + sal_Int32 nVal = 0; + if (aValue.endsWith("%")) + { + nVal = aValue.toDouble() * PER_PERCENT; + } + else + nVal = rAttribs.getInteger(XML_val, 0); + mrColor.addTransformation( nElement, nVal ); + } + break; + case A_TOKEN( comp ): + case A_TOKEN( gamma ): + case A_TOKEN( gray ): + case A_TOKEN( inv ): + case A_TOKEN( invGamma ): + mrColor.addTransformation( nElement ); + break; + } + return nullptr; +} + +ColorContext::ColorContext( ContextHandler2Helper const & rParent, Color& rColor ) : + ContextHandler2( rParent ), + mrColor( rColor ) +{ +} + +::oox::core::ContextHandlerRef ColorContext::onCreateContext( + sal_Int32 nElement, const AttributeList& ) +{ + switch( nElement ) + { + case A_TOKEN( scrgbClr ): + case A_TOKEN( srgbClr ): + case A_TOKEN( hslClr ): + case A_TOKEN( sysClr ): + case A_TOKEN( schemeClr ): + case A_TOKEN( prstClr ): + return new ColorValueContext( *this, mrColor ); + } + return nullptr; +} + +ColorsContext::ColorsContext(ContextHandler2Helper const& rParent, std::vector& rColors) + : ContextHandler2(rParent) + , mrColors(rColors) +{ +} + +::oox::core::ContextHandlerRef ColorsContext::onCreateContext(sal_Int32 nElement, + const AttributeList&) +{ + switch (nElement) + { + case A_TOKEN(scrgbClr): + case A_TOKEN(srgbClr): + case A_TOKEN(hslClr): + case A_TOKEN(sysClr): + case A_TOKEN(schemeClr): + case A_TOKEN(prstClr): + { + mrColors.emplace_back(); + return new ColorValueContext(*this, mrColors.back()); + } + } + return nullptr; +} + +} // namespace oox::drawingml + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/drawingml/connectorshapecontext.cxx b/oox/source/drawingml/connectorshapecontext.cxx new file mode 100644 index 000000000..b1ea90c35 --- /dev/null +++ b/oox/source/drawingml/connectorshapecontext.cxx @@ -0,0 +1,128 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include +#include + +#include +#include +#include +#include +#include +#include + +using namespace oox::core; +using namespace ::com::sun::star; +using namespace ::com::sun::star::uno; +using namespace ::com::sun::star::drawing; +using namespace ::com::sun::star::beans; +using namespace ::com::sun::star::xml::sax; + +namespace oox::drawingml { + +namespace +{ +class ConnectorShapePropertiesContext : public ::oox::core::ContextHandler2 +{ + std::vector& mrConnectorShapePropertiesList; + ShapePtr mpConnectorShapePtr; + +public: + ConnectorShapePropertiesContext( + ::oox::core::ContextHandler2Helper const& rParent, ShapePtr& pShapePtr, + std::vector& rConnectorShapePropertiesList); + + virtual ::oox::core::ContextHandlerRef onCreateContext(sal_Int32 aElementToken, + const AttributeList& rAttribs) override; +}; +} + +ConnectorShapePropertiesContext::ConnectorShapePropertiesContext( + ContextHandler2Helper const& rParent, ShapePtr& pShapePtr, + std::vector& rConnectorShapePropertiesList) + : ContextHandler2(rParent) + , mrConnectorShapePropertiesList(rConnectorShapePropertiesList) + , mpConnectorShapePtr(pShapePtr) +{ + mpConnectorShapePtr->setConnectorShape(true); +} + +::oox::core::ContextHandlerRef +ConnectorShapePropertiesContext::onCreateContext(sal_Int32 aElementToken, + const AttributeList& rAttribs) +{ + switch (getBaseToken(aElementToken)) + { + case XML_cNvPr: + mpConnectorShapePtr->setId(rAttribs.getString(XML_id).get()); + mpConnectorShapePtr->setName(rAttribs.getString(XML_name).get()); + break; + case XML_stCxn: + { + ConnectorShapeProperties aConnectorShapeProps; + aConnectorShapeProps.mbStartShape = true; + aConnectorShapeProps.maDestShapeId = rAttribs.getString(XML_id).get(); + aConnectorShapeProps.mnDestGlueId = rAttribs.getInteger(XML_idx).get(); + mrConnectorShapePropertiesList.push_back(aConnectorShapeProps); + break; + } + case XML_endCxn: + { + ConnectorShapeProperties aConnectorShapeProps; + aConnectorShapeProps.mbStartShape = false; + aConnectorShapeProps.maDestShapeId = rAttribs.getString(XML_id).get(); + aConnectorShapeProps.mnDestGlueId = rAttribs.getInteger(XML_idx).get(); + mrConnectorShapePropertiesList.push_back(aConnectorShapeProps); + break; + } + default: + break; + } + + return this; +} + +ConnectorShapeContext::ConnectorShapeContext( + ContextHandler2Helper const& rParent, const ShapePtr& pMasterShapePtr, + const ShapePtr& pGroupShapePtr, + std::vector& rConnectorShapePropertiesList) + : ShapeContext(rParent, pMasterShapePtr, pGroupShapePtr) + , mrConnectorShapePropertiesList(rConnectorShapePropertiesList) + , mpConnectorShapePtr(pGroupShapePtr) +{ +} + +ConnectorShapeContext::~ConnectorShapeContext() {} + +ContextHandlerRef ConnectorShapeContext::onCreateContext(sal_Int32 aElementToken, + const AttributeList& rAttribs) +{ + switch (getBaseToken(aElementToken)) + { + case XML_nvCxnSpPr: + return new ConnectorShapePropertiesContext(*this, mpConnectorShapePtr, + mrConnectorShapePropertiesList); + } + + return ShapeContext::onCreateContext(aElementToken, rAttribs); +} + +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/drawingml/customshapegeometry.cxx b/oox/source/drawingml/customshapegeometry.cxx new file mode 100644 index 000000000..2f508382c --- /dev/null +++ b/oox/source/drawingml/customshapegeometry.cxx @@ -0,0 +1,1296 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +using namespace ::oox::core; +using namespace ::com::sun::star::uno; +using namespace ::com::sun::star::drawing; +using namespace ::com::sun::star::xml::sax; + +namespace oox::drawingml { + +namespace { + +enum FormulaCommand +{ + FC_MULDIV = 0, + FC_PLUSMINUS, + FC_PLUSDIV, + FC_IFELSE, + FC_IFELSE1, + FC_ABS, + FC_AT2, + FC_CAT2, + FC_COS, + FC_MAX, + FC_MIN, + FC_MOD, + FC_PIN, + FC_SAT2, + FC_SIN, + FC_SQRT, + FC_TAN, + FC_VAL +}; + +struct FormulaCommandNameTable +{ + const char* pS; + FormulaCommand pE; +}; + +} + +const FormulaCommandNameTable pFormulaCommandNameTable[] = +{ + { "*/", FC_MULDIV }, + { "+-", FC_PLUSMINUS }, + { "+/", FC_PLUSDIV }, + { "ifelse", FC_IFELSE }, + { "?:", FC_IFELSE1 }, + { "abs", FC_ABS }, + { "at2", FC_AT2 }, + { "cat2", FC_CAT2 }, + { "cos", FC_COS }, + { "max", FC_MAX }, + { "min", FC_MIN }, + { "mod", FC_MOD }, + { "pin", FC_PIN }, + { "sat2", FC_SAT2 }, + { "sin", FC_SIN }, + { "sqrt", FC_SQRT }, + { "tan", FC_TAN }, + { "val", FC_VAL } + +}; +typedef std::unordered_map< OUString, FormulaCommand > FormulaCommandHMap; + +static const FormulaCommandHMap* pCommandHashMap; + +static OUString GetFormulaParameter( const EnhancedCustomShapeParameter& rParameter ) +{ + OUString aRet; + switch( rParameter.Type ) + { + case EnhancedCustomShapeParameterType::NORMAL : + { + if ( rParameter.Value.getValueTypeClass() == TypeClass_DOUBLE ) + { + double fValue = 0.0; + if ( rParameter.Value >>= fValue ) + aRet = OUString::number( fValue ); + } + else + { + sal_Int32 nValue = 0; + if ( rParameter.Value >>= nValue ) + aRet = OUString::number( nValue ); + } + } + break; + case EnhancedCustomShapeParameterType::EQUATION : + { + if ( rParameter.Value.getValueTypeClass() == TypeClass_LONG ) + { + sal_Int32 nFormulaIndex; + if ( rParameter.Value >>= nFormulaIndex ) + { + aRet = "?" + + OUString::number( nFormulaIndex ) + + " "; + } + } + else + { + // ups... we should have an index here and not the formula name + } + } + break; + case EnhancedCustomShapeParameterType::ADJUSTMENT : + { + if ( rParameter.Value.getValueTypeClass() == TypeClass_LONG ) + { + sal_Int32 nAdjustmentIndex; + if ( rParameter.Value >>= nAdjustmentIndex ) + { + aRet = "$" + + OUString::number( nAdjustmentIndex ) + + " "; + } + } + else + { + // ups... we should have an index here and not the formula name + } + } + break; + case EnhancedCustomShapeParameterType::LEFT : + aRet = "left"; + break; + case EnhancedCustomShapeParameterType::TOP : + aRet = "top"; + break; + case EnhancedCustomShapeParameterType::RIGHT : + aRet = "right"; + break; + case EnhancedCustomShapeParameterType::BOTTOM : + aRet = "bottom"; + break; + case EnhancedCustomShapeParameterType::XSTRETCH : + aRet = "xstretch"; + break; + case EnhancedCustomShapeParameterType::YSTRETCH : + aRet = "ystretch"; + break; + case EnhancedCustomShapeParameterType::HASSTROKE : + aRet = "hasstroke"; + break; + case EnhancedCustomShapeParameterType::HASFILL : + aRet = "hasfill"; + break; + case EnhancedCustomShapeParameterType::WIDTH : + aRet = "width"; + break; + case EnhancedCustomShapeParameterType::HEIGHT : + aRet = "height"; + break; + case EnhancedCustomShapeParameterType::LOGWIDTH : + aRet = "logwidth"; + break; + case EnhancedCustomShapeParameterType::LOGHEIGHT : + aRet = "logheight"; + break; + } + return aRet; +} + +static EnhancedCustomShapeParameter GetAdjCoordinate( CustomShapeProperties& rCustomShapeProperties, const OUString& rValue, bool bNoSymbols = true ) +{ + css::drawing::EnhancedCustomShapeParameter aRet; + if ( !rValue.isEmpty() ) + { + bool bConstant = true; + sal_Int32 nConstant = -1; + sal_Int32 nIntVal = 0; + + // first check if it's a constant value + switch( AttributeConversion::decodeToken( rValue ) ) + { + case XML_3cd4 : nConstant = 270 * 60000; break; + case XML_3cd8 : nConstant = 135 * 60000; break; + case XML_5cd8 : nConstant = 225 * 60000; break; + case XML_7cd8 : nConstant = 315 * 60000; break; + case XML_cd2 : nConstant = 180 * 60000; break; + case XML_cd3 : nConstant = 120 * 60000; break; + case XML_cd4 : nConstant = 90 * 60000; break; + case XML_cd8 : nConstant = 45 * 60000; break; + + case XML_b : // variable height of the shape defined in spPr + case XML_h : + { + if ( bNoSymbols ) + { + CustomShapeGuide aGuide; + aGuide.maName = rValue; + aGuide.maFormula = "logheight" ; + + aRet.Value <<= CustomShapeProperties::SetCustomShapeGuideValue( rCustomShapeProperties.getGuideList(), aGuide ); + aRet.Type = EnhancedCustomShapeParameterType::EQUATION; + } + else + aRet.Type = EnhancedCustomShapeParameterType::LOGHEIGHT; // TODO: HEIGHT needs to be implemented + } + break; + + case XML_hd10 : + nIntVal += 2; // */ h 1.0 10.0 + [[fallthrough]]; + case XML_hd8 : // */ h 1.0 8.0 + nIntVal += 2; + [[fallthrough]]; + case XML_hd6 : // */ h 1.0 6.0 + nIntVal++; + [[fallthrough]]; + case XML_hd5 : // */ h 1.0 5.0 + nIntVal++; + [[fallthrough]]; + case XML_hd4 : // */ h 1.0 4.0 + nIntVal++; + [[fallthrough]]; + case XML_hd3 : // */ h 1.0 3.0 + nIntVal++; + [[fallthrough]]; + case XML_hd2 : // */ h 1.0 2.0 + case XML_vc : // */ h 1.0 2.0 + { + nIntVal += 2; + + CustomShapeGuide aGuide; + aGuide.maName = rValue; + aGuide.maFormula = "logheight/" + OUString::number( nIntVal ); + + aRet.Value <<= CustomShapeProperties::SetCustomShapeGuideValue( rCustomShapeProperties.getGuideList(), aGuide ); + aRet.Type = EnhancedCustomShapeParameterType::EQUATION; + } + break; + + case XML_t : + case XML_l : + { + nConstant = 0; + aRet.Type = EnhancedCustomShapeParameterType::NORMAL; + } + break; + + case XML_ls : // longest side: max w h + { + CustomShapeGuide aGuide; + aGuide.maName = rValue; + aGuide.maFormula = "max(logwidth,logheight)"; + + aRet.Value <<= CustomShapeProperties::SetCustomShapeGuideValue( rCustomShapeProperties.getGuideList(), aGuide ); + aRet.Type = EnhancedCustomShapeParameterType::EQUATION; + } + break; + case XML_ss : // shortest side: min w h + { + CustomShapeGuide aGuide; + aGuide.maName = rValue; + aGuide.maFormula = "min(logwidth,logheight)"; + + aRet.Value <<= CustomShapeProperties::SetCustomShapeGuideValue( rCustomShapeProperties.getGuideList(), aGuide ); + aRet.Type = EnhancedCustomShapeParameterType::EQUATION; + } + break; + case XML_ssd32 : // */ ss 1.0 32.0 + nIntVal += 16; + [[fallthrough]]; + case XML_ssd16 : // */ ss 1.0 16.0 + nIntVal += 8; + [[fallthrough]]; + case XML_ssd8 : // */ ss 1.0 8.0 + nIntVal += 2; + [[fallthrough]]; + case XML_ssd6 : // */ ss 1.0 6.0 + nIntVal += 2; + [[fallthrough]]; + case XML_ssd4 : // */ ss 1.0 4.0 + nIntVal += 2; + [[fallthrough]]; + case XML_ssd2 : // */ ss 1.0 2.0 + { + nIntVal += 2; + + CustomShapeGuide aGuide; + aGuide.maName = rValue; + aGuide.maFormula = "min(logwidth,logheight)/" + OUString::number( nIntVal ); + + aRet.Value <<= CustomShapeProperties::SetCustomShapeGuideValue( rCustomShapeProperties.getGuideList(), aGuide ); + aRet.Type = EnhancedCustomShapeParameterType::EQUATION; + } + break; + + case XML_r : // variable width of the shape defined in spPr + case XML_w : + { + if ( bNoSymbols ) + { + CustomShapeGuide aGuide; + aGuide.maName = rValue; + aGuide.maFormula = "logwidth" ; + + aRet.Value <<= CustomShapeProperties::SetCustomShapeGuideValue( rCustomShapeProperties.getGuideList(), aGuide ); + aRet.Type = EnhancedCustomShapeParameterType::EQUATION; + } + else + aRet.Type = EnhancedCustomShapeParameterType::LOGWIDTH; + } + break; + + case XML_wd32 : // */ w 1.0 32.0 + nIntVal += 20; + [[fallthrough]]; + case XML_wd12 : // */ w 1.0 12.0 + nIntVal += 2; + [[fallthrough]]; + case XML_wd10 : // */ w 1.0 10.0 + nIntVal += 2; + [[fallthrough]]; + case XML_wd8 : // */ w 1.0 8.0 + nIntVal += 2; + [[fallthrough]]; + case XML_wd6 : // */ w 1.0 6.0 + nIntVal++; + [[fallthrough]]; + case XML_wd5 : // */ w 1.0 5.0 + nIntVal++; + [[fallthrough]]; + case XML_wd4 : // */ w 1.0 4.0 + nIntVal++; + [[fallthrough]]; + case XML_wd3 : // */ w 1.0 3.0 + nIntVal++; + [[fallthrough]]; + case XML_hc : // */ w 1.0 2.0 + case XML_wd2 : // */ w 1.0 2.0 + { + nIntVal += 2; + + CustomShapeGuide aGuide; + aGuide.maName = rValue; + aGuide.maFormula = "logwidth/" + OUString::number( nIntVal ); + + aRet.Value <<= CustomShapeProperties::SetCustomShapeGuideValue( rCustomShapeProperties.getGuideList(), aGuide ); + aRet.Type = EnhancedCustomShapeParameterType::EQUATION; + } + break; + + default: + bConstant = false; + break; + } + if ( bConstant ) + { + if (nConstant != -1) { + aRet.Value <<= nConstant; + aRet.Type = EnhancedCustomShapeParameterType::NORMAL; + } + } + else + { + sal_Unicode n = rValue[ 0 ]; + if ( ( n == '+' ) || ( n == '-' ) ) + { + if ( rValue.getLength() > 1 ) + n = rValue[ 1 ]; + } + if ( ( n >= '0' ) && ( n <= '9' ) ) + { // seems to be a ST_Coordinate + aRet.Value <<= rValue.toInt32(); + aRet.Type = EnhancedCustomShapeParameterType::NORMAL; + } + else + { + sal_Int32 nGuideIndex = CustomShapeProperties::GetCustomShapeGuideValue( rCustomShapeProperties.getAdjustmentGuideList(), rValue ); + if ( nGuideIndex >= 0 ) + { + aRet.Value <<= nGuideIndex; + aRet.Type = EnhancedCustomShapeParameterType::ADJUSTMENT; + } + else + { + nGuideIndex = CustomShapeProperties::GetCustomShapeGuideValue( rCustomShapeProperties.getGuideList(), rValue ); + if ( nGuideIndex >= 0 ) + { + aRet.Value <<= nGuideIndex; + aRet.Type = EnhancedCustomShapeParameterType::EQUATION; + } + else + { + SAL_WARN("oox", "error: unhandled value " << rValue); + aRet.Value <<= rValue; + } + } + } + } + } + return aRet; +} + +namespace { + +// CT_GeomGuideList +class GeomGuideListContext : public ContextHandler2 +{ +public: + GeomGuideListContext( ContextHandler2Helper const & rParent, CustomShapeProperties& rCustomShapeProperties, std::vector< CustomShapeGuide >& rGuideList ); + virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 aElementToken, const ::oox::AttributeList& rAttribs ) override; + +protected: + std::vector< CustomShapeGuide >& mrGuideList; + CustomShapeProperties& mrCustomShapeProperties; +}; + +} + +GeomGuideListContext::GeomGuideListContext( ContextHandler2Helper const & rParent, CustomShapeProperties& rCustomShapeProperties, std::vector< CustomShapeGuide >& rGuideList ) +: ContextHandler2( rParent ) +, mrGuideList( rGuideList ) +, mrCustomShapeProperties( rCustomShapeProperties ) +{ +} + +static OUString convertToOOEquation( CustomShapeProperties& rCustomShapeProperties, std::u16string_view rSource ) +{ + if ( !pCommandHashMap ) + { + FormulaCommandHMap* pHM = new FormulaCommandHMap; + for(const FormulaCommandNameTable& i : pFormulaCommandNameTable) + (*pHM)[ OUString::createFromAscii( i.pS ) ] = i.pE; + pCommandHashMap = pHM; + } + + std::vector< OUString > aTokens; + sal_Int32 nIndex = 0; + do + { + OUString aToken( o3tl::getToken(rSource, 0, ' ', nIndex ) ); + if ( !aToken.isEmpty() ) + aTokens.push_back( aToken ); + } + while ( nIndex >= 0 ); + + OUString aEquation; + if ( !aTokens.empty() ) + { + sal_Int32 i, nParameters = aTokens.size() - 1; + if ( nParameters > 3 ) + nParameters = 3; + + OUString sParameters[ 3 ]; + + for ( i = 0; i < nParameters; i++ ) + sParameters[ i ] = GetFormulaParameter( GetAdjCoordinate( rCustomShapeProperties, aTokens[ i + 1 ], false ) ); + + const FormulaCommandHMap::const_iterator aIter( pCommandHashMap->find( aTokens[ 0 ] ) ); + if ( aIter != pCommandHashMap->end() ) + { + switch( aIter->second ) + { + case FC_MULDIV : + { + if ( nParameters == 3 ) + aEquation = sParameters[ 0 ] + "*" + sParameters[ 1 ] + + "/" + sParameters[ 2 ]; + } + break; + case FC_PLUSMINUS : + { + if ( nParameters == 3 ) + aEquation = sParameters[ 0 ] + "+" + sParameters[ 1 ] + + "-" + sParameters[ 2 ]; + } + break; + case FC_PLUSDIV : + { + if ( nParameters == 3 ) + aEquation = "(" + sParameters[ 0 ] + "+" + + sParameters[ 1 ] + ")/" + sParameters[ 2 ]; + } + break; + case FC_IFELSE : + case FC_IFELSE1 : + { + if ( nParameters == 3 ) + aEquation = "if(" + sParameters[ 0 ] + "," + + sParameters[ 1 ] + "," + sParameters[ 2 ] + ")"; + } + break; + case FC_ABS : + { + if ( nParameters == 1 ) + aEquation = "abs(" + sParameters[ 0 ] + ")"; + } + break; + case FC_AT2 : + { + if ( nParameters == 2 ) + aEquation = "(10800000*atan2(" + sParameters[ 1 ] + "," + + sParameters[ 0 ] + "))/pi"; + } + break; + case FC_CAT2 : + { + if ( nParameters == 3 ) + aEquation = sParameters[ 0 ] + "*(cos(atan2(" + + sParameters[ 2 ] + "," + sParameters[ 1 ] + ")))"; + } + break; + case FC_COS : + { + if ( nParameters == 2 ) + aEquation = sParameters[ 0 ] + "*cos(pi*(" + + sParameters[ 1 ] + ")/10800000)"; + } + break; + case FC_MAX : + { + if ( nParameters == 2 ) + aEquation = "max(" + sParameters[ 0 ] + "," + + sParameters[ 1 ] + ")"; + } + break; + case FC_MIN : + { + if ( nParameters == 2 ) + aEquation = "min(" + sParameters[ 0 ] + "," + + sParameters[ 1 ] + ")"; + } + break; + case FC_MOD : + { + if ( nParameters == 3 ) + aEquation = "sqrt(" + + sParameters[ 0 ] + "*" + sParameters[ 0 ] + "+" + + sParameters[ 1 ] + "*" + sParameters[ 1 ] + "+" + + sParameters[ 2 ] + "*" + sParameters[ 2 ] + ")"; + } + break; + case FC_PIN : + { + if ( nParameters == 3 ) // if(x-y,x,if(y-z,z,y)) + aEquation = "if(" + sParameters[ 0 ] + "-" + sParameters[ 1 ] + + "," + sParameters[ 0 ] + ",if(" + sParameters[ 2 ] + + "-" + sParameters[ 1 ] + "," + sParameters[ 1 ] + + "," + sParameters[ 2 ] + "))"; + } + break; + case FC_SAT2 : + { + if ( nParameters == 3 ) + aEquation = sParameters[ 0 ] + "*(sin(atan2(" + + sParameters[ 2 ] + "," + sParameters[ 1 ] + ")))"; + } + break; + case FC_SIN : + { + if ( nParameters == 2 ) + aEquation = sParameters[ 0 ] + "*sin(pi*(" + + sParameters[ 1 ] + ")/10800000)"; + } + break; + case FC_SQRT : + { + if ( nParameters == 1 ) + aEquation = "sqrt(" + sParameters[ 0 ] + ")"; + } + break; + case FC_TAN : + { + if ( nParameters == 2 ) + aEquation = sParameters[ 0 ] + "*tan(pi*(" + + sParameters[ 1 ] + ")/10800000)"; + } + break; + case FC_VAL : + { + if ( nParameters == 1 ) + aEquation = sParameters[ 0 ]; + } + break; + default : + break; + } + } + } + return aEquation; +} + +ContextHandlerRef GeomGuideListContext::onCreateContext( sal_Int32 aElementToken, const AttributeList& rAttribs ) +{ + if ( aElementToken == A_TOKEN( gd ) ) // CT_GeomGuide + { + CustomShapeGuide aGuide; + aGuide.maName = rAttribs.getString( XML_name ).get(); + aGuide.maFormula = convertToOOEquation( mrCustomShapeProperties, rAttribs.getString( XML_fmla ).get() ); + mrGuideList.push_back( aGuide ); + } + return this; +} + +static const OUString& GetGeomGuideName( const OUString& rValue ) +{ + return rValue; +} + +namespace { + +// CT_AdjPoint2D +class AdjPoint2DContext : public ContextHandler2 +{ +public: + AdjPoint2DContext( ContextHandler2Helper const & rParent, const AttributeList& rAttribs, CustomShapeProperties& rCustomShapeProperties, EnhancedCustomShapeParameterPair& rAdjPoint2D ); +}; + +} + +AdjPoint2DContext::AdjPoint2DContext( ContextHandler2Helper const & rParent, const AttributeList& rAttribs, CustomShapeProperties& rCustomShapeProperties, EnhancedCustomShapeParameterPair& rAdjPoint2D ) +: ContextHandler2( rParent ) +{ + rAdjPoint2D.First = GetAdjCoordinate( rCustomShapeProperties, rAttribs.getString( XML_x ).get() ); + rAdjPoint2D.Second = GetAdjCoordinate( rCustomShapeProperties, rAttribs.getString( XML_y ).get() ); +} + +namespace { + +// CT_XYAdjustHandle +class XYAdjustHandleContext : public ContextHandler2 +{ +public: + XYAdjustHandleContext( ContextHandler2Helper const & rParent, const AttributeList& rAttribs, CustomShapeProperties& rCustomShapeProperties, AdjustHandle& rAdjustHandle ); + virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 aElementToken, const ::oox::AttributeList& rAttribs ) override; + +protected: + AdjustHandle& mrAdjustHandle; + CustomShapeProperties& mrCustomShapeProperties; +}; + +} + +XYAdjustHandleContext::XYAdjustHandleContext( ContextHandler2Helper const & rParent, const AttributeList& rAttribs, CustomShapeProperties& rCustomShapeProperties, AdjustHandle& rAdjustHandle ) +: ContextHandler2( rParent ) +, mrAdjustHandle( rAdjustHandle ) +, mrCustomShapeProperties( rCustomShapeProperties ) +{ + if ( rAttribs.hasAttribute( XML_gdRefX ) ) + { + mrAdjustHandle.gdRef1 = GetGeomGuideName( rAttribs.getString( XML_gdRefX, "" ) ); + } + if ( rAttribs.hasAttribute( XML_minX ) ) + { + mrAdjustHandle.min1 = GetAdjCoordinate( mrCustomShapeProperties, rAttribs.getString( XML_minX, "" ) ); + } + if ( rAttribs.hasAttribute( XML_maxX ) ) + { + mrAdjustHandle.max1 = GetAdjCoordinate( mrCustomShapeProperties, rAttribs.getString( XML_maxX, "" ) ); + } + if ( rAttribs.hasAttribute( XML_gdRefY ) ) + { + mrAdjustHandle.gdRef2 = GetGeomGuideName( rAttribs.getString( XML_gdRefY, "" ) ); + } + if ( rAttribs.hasAttribute( XML_minY ) ) + { + mrAdjustHandle.min2 = GetAdjCoordinate( mrCustomShapeProperties, rAttribs.getString( XML_minY, "" ) ); + } + if ( rAttribs.hasAttribute( XML_maxY ) ) + { + mrAdjustHandle.max2 = GetAdjCoordinate( mrCustomShapeProperties, rAttribs.getString( XML_maxY, "" ) ); + } +} + +ContextHandlerRef XYAdjustHandleContext::onCreateContext( sal_Int32 aElementToken, const AttributeList& rAttribs ) +{ + if ( aElementToken == A_TOKEN( pos ) ) + return new AdjPoint2DContext( *this, rAttribs, mrCustomShapeProperties, mrAdjustHandle.pos ); // CT_AdjPoint2D + return nullptr; +} + +namespace { + +// CT_PolarAdjustHandle +class PolarAdjustHandleContext : public ContextHandler2 +{ +public: + PolarAdjustHandleContext( ContextHandler2Helper const & rParent, const AttributeList& rAttribs, CustomShapeProperties& rCustomShapeProperties, AdjustHandle& rAdjustHandle ); + virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 aElementToken, const ::oox::AttributeList& rAttribs ) override; + +protected: + AdjustHandle& mrAdjustHandle; + CustomShapeProperties& mrCustomShapeProperties; +}; + +} + +PolarAdjustHandleContext::PolarAdjustHandleContext( ContextHandler2Helper const & rParent, const AttributeList& rAttribs, CustomShapeProperties& rCustomShapeProperties, AdjustHandle& rAdjustHandle ) +: ContextHandler2( rParent ) +, mrAdjustHandle( rAdjustHandle ) +, mrCustomShapeProperties( rCustomShapeProperties ) +{ + if ( rAttribs.hasAttribute( XML_gdRefR ) ) + { + mrAdjustHandle.polar = true ; + mrAdjustHandle.gdRef1 = GetGeomGuideName( rAttribs.getString( XML_gdRefR, "" ) ); + } + if ( rAttribs.hasAttribute( XML_minR ) ) + { + mrAdjustHandle.min1 = GetAdjCoordinate( mrCustomShapeProperties, rAttribs.getString( XML_minR, "" ) ); + } + if ( rAttribs.hasAttribute( XML_maxR ) ) + { + mrAdjustHandle.max1 = GetAdjCoordinate( mrCustomShapeProperties, rAttribs.getString( XML_maxR, "" ) ); + } + if ( rAttribs.hasAttribute( XML_gdRefAng ) ) + { + mrAdjustHandle.polar = true ; + mrAdjustHandle.gdRef2 = GetGeomGuideName( rAttribs.getString( XML_gdRefAng, "" ) ); + } + if ( rAttribs.hasAttribute( XML_minAng ) ) + { + mrAdjustHandle.min2 = GetAdjCoordinate( mrCustomShapeProperties, rAttribs.getString( XML_minAng, "" ) ); + } + if ( rAttribs.hasAttribute( XML_maxAng ) ) + { + mrAdjustHandle.max2 = GetAdjCoordinate( mrCustomShapeProperties, rAttribs.getString( XML_maxAng, "" ) ); + } +} + +ContextHandlerRef PolarAdjustHandleContext::onCreateContext( sal_Int32 aElementToken, const AttributeList& rAttribs ) +{ + // mrAdjustHandle.pos uses planar coordinates. + if ( aElementToken == A_TOKEN( pos ) ) + return new AdjPoint2DContext( *this, rAttribs, mrCustomShapeProperties, mrAdjustHandle.pos ); // CT_AdjPoint2D + return nullptr; +} + +namespace { + +// CT_AdjustHandleList +class AdjustHandleListContext : public ContextHandler2 +{ +public: + AdjustHandleListContext( ContextHandler2Helper const & rParent, CustomShapeProperties& rCustomShapeProperties, std::vector< AdjustHandle >& rAdjustHandleList ); + virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 aElementToken, const ::oox::AttributeList& rAttribs ) override; + +protected: + std::vector< AdjustHandle >& mrAdjustHandleList; + CustomShapeProperties& mrCustomShapeProperties; +}; + +} + +AdjustHandleListContext::AdjustHandleListContext( ContextHandler2Helper const & rParent, CustomShapeProperties& rCustomShapeProperties, std::vector< AdjustHandle >& rAdjustHandleList ) +: ContextHandler2( rParent ) +, mrAdjustHandleList( rAdjustHandleList ) +, mrCustomShapeProperties( rCustomShapeProperties ) +{ +} + +ContextHandlerRef AdjustHandleListContext::onCreateContext( sal_Int32 aElementToken, const AttributeList& rAttribs ) +{ + if ( aElementToken == A_TOKEN( ahXY ) ) // CT_XYAdjustHandle + { + AdjustHandle aAdjustHandle( false ); + mrAdjustHandleList.push_back( aAdjustHandle ); + return new XYAdjustHandleContext( *this, rAttribs, mrCustomShapeProperties, mrAdjustHandleList.back() ); + } + else if ( aElementToken == A_TOKEN( ahPolar ) ) // CT_PolarAdjustHandle + { + AdjustHandle aAdjustHandle( true ); + mrAdjustHandleList.push_back( aAdjustHandle ); + return new PolarAdjustHandleContext( *this, rAttribs, mrCustomShapeProperties, mrAdjustHandleList.back() ); + } + return nullptr; +} + +namespace { + +// CT_ConnectionSite +class ConnectionSiteContext : public ContextHandler2 +{ +public: + ConnectionSiteContext( ContextHandler2Helper const & rParent, const AttributeList& rAttribs, CustomShapeProperties& rCustomShapeProperties, ConnectionSite& rConnectionSite ); + virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 aElementToken, const ::oox::AttributeList& rAttribs ) override; + +protected: + ConnectionSite& mrConnectionSite; + CustomShapeProperties& mrCustomShapeProperties; +}; + +} + +ConnectionSiteContext::ConnectionSiteContext( ContextHandler2Helper const & rParent, const AttributeList& rAttribs, CustomShapeProperties& rCustomShapeProperties, ConnectionSite& rConnectionSite ) +: ContextHandler2( rParent ) +, mrConnectionSite( rConnectionSite ) +, mrCustomShapeProperties( rCustomShapeProperties ) +{ + mrConnectionSite.ang = GetAdjCoordinate( mrCustomShapeProperties, rAttribs.getString( XML_ang ).get() ); +} + +ContextHandlerRef ConnectionSiteContext::onCreateContext( sal_Int32 aElementToken, const AttributeList& rAttribs ) +{ + if ( aElementToken == A_TOKEN( pos ) ) + return new AdjPoint2DContext( *this, rAttribs, mrCustomShapeProperties, mrConnectionSite.pos ); // CT_AdjPoint2D + return nullptr; +} + +namespace { + +// CT_Path2DMoveTo +class Path2DMoveToContext : public ContextHandler2 +{ +public: + Path2DMoveToContext( ContextHandler2Helper const & rParent, CustomShapeProperties& rCustomShapeProperties, EnhancedCustomShapeParameterPair& rAdjPoint2D ); + virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 aElementToken, const ::oox::AttributeList& rAttribs ) override; + +protected: + EnhancedCustomShapeParameterPair& mrAdjPoint2D; + CustomShapeProperties& mrCustomShapeProperties; +}; + +} + +Path2DMoveToContext::Path2DMoveToContext( ContextHandler2Helper const & rParent, CustomShapeProperties& rCustomShapeProperties, EnhancedCustomShapeParameterPair& rAdjPoint2D ) +: ContextHandler2( rParent ) +, mrAdjPoint2D( rAdjPoint2D ) +, mrCustomShapeProperties( rCustomShapeProperties ) +{ +} + +ContextHandlerRef Path2DMoveToContext::onCreateContext( sal_Int32 aElementToken, const AttributeList& rAttribs ) +{ + if ( aElementToken == A_TOKEN( pt ) ) + return new AdjPoint2DContext( *this, rAttribs, mrCustomShapeProperties, mrAdjPoint2D ); // CT_AdjPoint2D + return nullptr; +} + +namespace { + +// CT_Path2DLineTo +class Path2DLineToContext : public ContextHandler2 +{ +public: + Path2DLineToContext( ContextHandler2Helper const & rParent, CustomShapeProperties& rCustomShapeProperties, EnhancedCustomShapeParameterPair& rAdjPoint2D ); + virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 aElementToken, const ::oox::AttributeList& rAttribs ) override; + +protected: + EnhancedCustomShapeParameterPair& mrAdjPoint2D; + CustomShapeProperties& mrCustomShapeProperties; +}; + +} + +Path2DLineToContext::Path2DLineToContext( ContextHandler2Helper const & rParent, CustomShapeProperties& rCustomShapeProperties, EnhancedCustomShapeParameterPair& rAdjPoint2D ) +: ContextHandler2( rParent ) +, mrAdjPoint2D( rAdjPoint2D ) +, mrCustomShapeProperties( rCustomShapeProperties ) +{ +} + +ContextHandlerRef Path2DLineToContext::onCreateContext( sal_Int32 aElementToken, const AttributeList& rAttribs ) +{ + if ( aElementToken == A_TOKEN( pt ) ) + return new AdjPoint2DContext( *this, rAttribs, mrCustomShapeProperties, mrAdjPoint2D ); // CT_AdjPoint2D + return nullptr; +} + +namespace { + +// CT_Path2DQuadBezierTo +class Path2DQuadBezierToContext : public ContextHandler2 +{ +public: + Path2DQuadBezierToContext( ContextHandler2Helper const & rParent, CustomShapeProperties& rCustomShapeProperties, EnhancedCustomShapeParameterPair& rPt1, EnhancedCustomShapeParameterPair& rPt2 ); + virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 aElementToken, const ::oox::AttributeList& rAttribs ) override; + +protected: + EnhancedCustomShapeParameterPair& mrPt1; + EnhancedCustomShapeParameterPair& mrPt2; + int nCount; + CustomShapeProperties& mrCustomShapeProperties; +}; + +} + +Path2DQuadBezierToContext::Path2DQuadBezierToContext( ContextHandler2Helper const & rParent, + CustomShapeProperties& rCustomShapeProperties, + EnhancedCustomShapeParameterPair& rPt1, + EnhancedCustomShapeParameterPair& rPt2 ) +: ContextHandler2( rParent ) +, mrPt1( rPt1 ) +, mrPt2( rPt2 ) +, nCount( 0 ) +, mrCustomShapeProperties( rCustomShapeProperties ) +{ +} + +ContextHandlerRef Path2DQuadBezierToContext::onCreateContext( sal_Int32 aElementToken, const AttributeList& rAttribs ) +{ + if ( aElementToken == A_TOKEN( pt ) ) + return new AdjPoint2DContext( *this, rAttribs, mrCustomShapeProperties, nCount++ ? mrPt2 : mrPt1 ); // CT_AdjPoint2D + return nullptr; +} + +namespace { + +// CT_Path2DCubicBezierTo +class Path2DCubicBezierToContext : public ContextHandler2 +{ +public: + Path2DCubicBezierToContext( ContextHandler2Helper const & rParent, CustomShapeProperties& rCustomShapeProperties, + EnhancedCustomShapeParameterPair&, EnhancedCustomShapeParameterPair&, EnhancedCustomShapeParameterPair& ); + virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 aElementToken, const ::oox::AttributeList& rAttribs ) override; + +protected: + CustomShapeProperties& mrCustomShapeProperties; + EnhancedCustomShapeParameterPair& mrControlPt1; + EnhancedCustomShapeParameterPair& mrControlPt2; + EnhancedCustomShapeParameterPair& mrEndPt; + int nCount; +}; + +} + +Path2DCubicBezierToContext::Path2DCubicBezierToContext( ContextHandler2Helper const & rParent, CustomShapeProperties& rCustomShapeProperties, + EnhancedCustomShapeParameterPair& rControlPt1, + EnhancedCustomShapeParameterPair& rControlPt2, + EnhancedCustomShapeParameterPair& rEndPt ) +: ContextHandler2( rParent ) +, mrCustomShapeProperties( rCustomShapeProperties ) +, mrControlPt1( rControlPt1 ) +, mrControlPt2( rControlPt2 ) +, mrEndPt( rEndPt ) +, nCount( 0 ) +{ +} + +ContextHandlerRef Path2DCubicBezierToContext::onCreateContext( sal_Int32 aElementToken, const AttributeList& rAttribs ) +{ + if ( aElementToken == A_TOKEN( pt ) ) + return new AdjPoint2DContext( *this, rAttribs, mrCustomShapeProperties, + nCount++ ? nCount == 2 ? mrControlPt2 : mrEndPt : mrControlPt1 ); // CT_AdjPoint2D + return nullptr; +} + +namespace { + +// CT_Path2DContext +class Path2DContext : public ContextHandler2 +{ +public: + Path2DContext( ContextHandler2Helper const & rParent, const AttributeList& rAttribs, CustomShapeProperties& rCustomShapeProperties, std::vector< css::drawing::EnhancedCustomShapeSegment >& rSegments, Path2D& rPath2D ); + virtual void onEndElement() override; + virtual ::oox::core::ContextHandlerRef + onCreateContext( sal_Int32 aElementToken, const ::oox::AttributeList& rAttribs ) override; + +protected: + Path2D& mrPath2D; + std::vector< css::drawing::EnhancedCustomShapeSegment >& mrSegments; + CustomShapeProperties& mrCustomShapeProperties; +}; + +} + +Path2DContext::Path2DContext( ContextHandler2Helper const & rParent, const AttributeList& rAttribs, CustomShapeProperties& rCustomShapeProperties, std::vector< css::drawing::EnhancedCustomShapeSegment >& rSegments, Path2D& rPath2D ) +: ContextHandler2( rParent ) +, mrPath2D( rPath2D ) +, mrSegments( rSegments ) +, mrCustomShapeProperties( rCustomShapeProperties ) +{ + rPath2D.w = rAttribs.getString( XML_w, "" ).toInt64(); + rPath2D.h = rAttribs.getString( XML_h, "" ).toInt64(); + rPath2D.fill = rAttribs.getToken( XML_fill, XML_norm ); + rPath2D.stroke = rAttribs.getBool( XML_stroke, true ); + rPath2D.extrusionOk = rAttribs.getBool( XML_extrusionOk, true ); +} + +void Path2DContext::onEndElement() +{ + EnhancedCustomShapeSegment aNewSegment; + switch ( mrPath2D.fill ) + { + case XML_none: + aNewSegment.Command = EnhancedCustomShapeSegmentCommand::NOFILL; + break; + case XML_darken: + aNewSegment.Command = EnhancedCustomShapeSegmentCommand::DARKEN; + break; + case XML_darkenLess: + aNewSegment.Command = EnhancedCustomShapeSegmentCommand::DARKENLESS; + break; + case XML_lighten: + aNewSegment.Command = EnhancedCustomShapeSegmentCommand::LIGHTEN; + break; + case XML_lightenLess: + aNewSegment.Command = EnhancedCustomShapeSegmentCommand::LIGHTENLESS; + break; + } + if (mrPath2D.fill != XML_norm) { + aNewSegment.Count = 0; + mrSegments.push_back( aNewSegment ); + } + if ( !mrPath2D.stroke ) + { + aNewSegment.Command = EnhancedCustomShapeSegmentCommand::NOSTROKE; + aNewSegment.Count = 0; + mrSegments.push_back( aNewSegment ); + } + aNewSegment.Command = EnhancedCustomShapeSegmentCommand::ENDSUBPATH; + aNewSegment.Count = 0; + mrSegments.push_back( aNewSegment ); +} + + +ContextHandlerRef Path2DContext::onCreateContext( sal_Int32 aElementToken, + const AttributeList& rAttribs ) +{ + switch( aElementToken ) + { + case A_TOKEN( close ) : + { + // ignore close after move to (ppt does seems to do the same, see accentCallout2 preset for example) + if ( mrSegments.empty() || ( mrSegments.back().Command != EnhancedCustomShapeSegmentCommand::MOVETO ) ) { + EnhancedCustomShapeSegment aNewSegment; + aNewSegment.Command = EnhancedCustomShapeSegmentCommand::CLOSESUBPATH; + aNewSegment.Count = 0; + mrSegments.push_back( aNewSegment ); + } + } + break; + case A_TOKEN( moveTo ) : + { + EnhancedCustomShapeSegment aNewSegment; + aNewSegment.Command = EnhancedCustomShapeSegmentCommand::MOVETO; + aNewSegment.Count = 1; + mrSegments.push_back( aNewSegment ); + + EnhancedCustomShapeParameterPair aAdjPoint2D; + mrPath2D.parameter.push_back( aAdjPoint2D ); + return new Path2DMoveToContext( *this, mrCustomShapeProperties, mrPath2D.parameter.back() ); + } + break; + case A_TOKEN( lnTo ) : + { + if ( !mrSegments.empty() && ( mrSegments.back().Command == EnhancedCustomShapeSegmentCommand::LINETO ) ) + mrSegments.back().Count++; + else + { + EnhancedCustomShapeSegment aSegment; + aSegment.Command = EnhancedCustomShapeSegmentCommand::LINETO; + aSegment.Count = 1; + mrSegments.push_back( aSegment ); + } + EnhancedCustomShapeParameterPair aAdjPoint2D; + mrPath2D.parameter.push_back( aAdjPoint2D ); + return new Path2DLineToContext( *this, mrCustomShapeProperties, mrPath2D.parameter.back() ); + } + break; + case A_TOKEN( arcTo ) : // CT_Path2DArcTo + { + if ( !mrSegments.empty() && ( mrSegments.back().Command == EnhancedCustomShapeSegmentCommand::ARCANGLETO ) ) + mrSegments.back().Count++; + else + { + EnhancedCustomShapeSegment aSegment; + aSegment.Command = EnhancedCustomShapeSegmentCommand::ARCANGLETO; + aSegment.Count = 1; + mrSegments.push_back( aSegment ); + } + + EnhancedCustomShapeParameterPair aScale; + EnhancedCustomShapeParameterPair aAngles; + + aScale.First = GetAdjCoordinate( mrCustomShapeProperties, rAttribs.getString( XML_wR ).get() ); + aScale.Second = GetAdjCoordinate( mrCustomShapeProperties, rAttribs.getString( XML_hR ).get() ); + + CustomShapeGuide aGuide; + sal_Int32 nArcNum = mrCustomShapeProperties.getArcNum(); + + // start angle + aGuide.maName = "arctosa" + OUString::number( nArcNum ); + aGuide.maFormula = "(" + + GetFormulaParameter( GetAdjCoordinate( mrCustomShapeProperties, rAttribs.getString( XML_stAng ).get() ) ) + + ")/60000.0"; + aAngles.First.Value <<= CustomShapeProperties::SetCustomShapeGuideValue( mrCustomShapeProperties.getGuideList(), aGuide ); + aAngles.First.Type = EnhancedCustomShapeParameterType::EQUATION; + + // swing angle + aGuide.maName = "arctosw" + OUString::number( nArcNum ); + aGuide.maFormula = "(" + + GetFormulaParameter( GetAdjCoordinate( mrCustomShapeProperties, rAttribs.getString( XML_swAng ).get() ) ) + + ")/60000.0"; + aAngles.Second.Value <<= CustomShapeProperties::SetCustomShapeGuideValue( mrCustomShapeProperties.getGuideList(), aGuide ); + aAngles.Second.Type = EnhancedCustomShapeParameterType::EQUATION; + + mrPath2D.parameter.push_back( aScale ); + mrPath2D.parameter.push_back( aAngles ); + } + break; + case A_TOKEN( quadBezTo ) : + { + if ( !mrSegments.empty() && ( mrSegments.back().Command == EnhancedCustomShapeSegmentCommand::QUADRATICCURVETO ) ) + mrSegments.back().Count++; + else + { + EnhancedCustomShapeSegment aSegment; + aSegment.Command = EnhancedCustomShapeSegmentCommand::QUADRATICCURVETO; + aSegment.Count = 1; + mrSegments.push_back( aSegment ); + } + EnhancedCustomShapeParameterPair aPt1; + EnhancedCustomShapeParameterPair aPt2; + mrPath2D.parameter.push_back( aPt1 ); + mrPath2D.parameter.push_back( aPt2 ); + return new Path2DQuadBezierToContext( *this, mrCustomShapeProperties, + mrPath2D.parameter[ mrPath2D.parameter.size() - 2 ], + mrPath2D.parameter.back() ); + } + break; + case A_TOKEN( cubicBezTo ) : + { + if ( !mrSegments.empty() && ( mrSegments.back().Command == EnhancedCustomShapeSegmentCommand::CURVETO ) ) + mrSegments.back().Count++; + else + { + EnhancedCustomShapeSegment aSegment; + aSegment.Command = EnhancedCustomShapeSegmentCommand::CURVETO; + aSegment.Count = 1; + mrSegments.push_back( aSegment ); + } + EnhancedCustomShapeParameterPair aControlPt1; + EnhancedCustomShapeParameterPair aControlPt2; + EnhancedCustomShapeParameterPair aEndPt; + mrPath2D.parameter.push_back( aControlPt1 ); + mrPath2D.parameter.push_back( aControlPt2 ); + mrPath2D.parameter.push_back( aEndPt ); + return new Path2DCubicBezierToContext( *this, mrCustomShapeProperties, + mrPath2D.parameter[ mrPath2D.parameter.size() - 3 ], + mrPath2D.parameter[ mrPath2D.parameter.size() - 2 ], + mrPath2D.parameter.back() ); + } + break; + } + return nullptr; +} + +namespace { + +// CT_Path2DList +class Path2DListContext : public ContextHandler2 +{ +public: + Path2DListContext( ContextHandler2Helper const & rParent, CustomShapeProperties & rCustomShapeProperties, std::vector< EnhancedCustomShapeSegment >& rSegments, + std::vector< Path2D >& rPath2DList ); + + virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 aElementToken, const ::oox::AttributeList& rAttribs ) override; + +protected: + + CustomShapeProperties& mrCustomShapeProperties; + std::vector< css::drawing::EnhancedCustomShapeSegment >& mrSegments; + std::vector< Path2D >& mrPath2DList; +}; + +} + +Path2DListContext:: Path2DListContext( ContextHandler2Helper const & rParent, CustomShapeProperties& rCustomShapeProperties, std::vector< EnhancedCustomShapeSegment >& rSegments, + std::vector< Path2D >& rPath2DList ) +: ContextHandler2( rParent ) +, mrCustomShapeProperties( rCustomShapeProperties ) +, mrSegments( rSegments ) +, mrPath2DList( rPath2DList ) +{ +} + +ContextHandlerRef Path2DListContext::onCreateContext( sal_Int32 aElementToken, const AttributeList& rAttribs ) +{ + if ( aElementToken == A_TOKEN( path ) ) + { + Path2D aPath2D; + mrPath2DList.push_back( aPath2D ); + return new Path2DContext( *this, rAttribs, mrCustomShapeProperties, mrSegments, mrPath2DList.back() ); + } + return nullptr; +} + +// CT_CustomGeometry2D +CustomShapeGeometryContext::CustomShapeGeometryContext( ContextHandler2Helper const & rParent, CustomShapeProperties& rCustomShapeProperties ) +: ContextHandler2( rParent ) +, mrCustomShapeProperties( rCustomShapeProperties ) +{ +} + +ContextHandlerRef CustomShapeGeometryContext::onCreateContext( sal_Int32 aElementToken, const AttributeList& rAttribs ) +{ + switch( aElementToken ) + { + case A_TOKEN( avLst ): // CT_GeomGuideList adjust value list + return new GeomGuideListContext( *this, mrCustomShapeProperties, mrCustomShapeProperties.getAdjustmentGuideList() ); + case A_TOKEN( gdLst ): // CT_GeomGuideList guide list + return new GeomGuideListContext( *this, mrCustomShapeProperties, mrCustomShapeProperties.getGuideList() ); + case A_TOKEN( ahLst ): // CT_AdjustHandleList adjust handle list + return new AdjustHandleListContext( *this, mrCustomShapeProperties, mrCustomShapeProperties.getAdjustHandleList() ); + case A_TOKEN( cxnLst ): // CT_ConnectionSiteList connection site list + return this; + case A_TOKEN( rect ): // CT_GeomRectList geometry rect list + { + GeomRect aGeomRect; + aGeomRect.l = GetAdjCoordinate( mrCustomShapeProperties, rAttribs.getString( XML_l ).get() ); + aGeomRect.t = GetAdjCoordinate( mrCustomShapeProperties, rAttribs.getString( XML_t ).get() ); + aGeomRect.r = GetAdjCoordinate( mrCustomShapeProperties, rAttribs.getString( XML_r ).get() ); + aGeomRect.b = GetAdjCoordinate( mrCustomShapeProperties, rAttribs.getString( XML_b ).get() ); + mrCustomShapeProperties.getTextRect() = aGeomRect; + } + break; + case A_TOKEN( pathLst ): // CT_Path2DList 2d path list + return new Path2DListContext( *this, mrCustomShapeProperties, mrCustomShapeProperties.getSegments(), mrCustomShapeProperties.getPath2DList() ); + + // from cxnLst: + case A_TOKEN( cxn ): // CT_ConnectionSite + { + ConnectionSite aConnectionSite; + mrCustomShapeProperties.getConnectionSiteList().push_back( aConnectionSite ); + return new ConnectionSiteContext( *this, rAttribs, mrCustomShapeProperties, mrCustomShapeProperties.getConnectionSiteList().back() ); + } + } + return nullptr; +} + +// CT_PresetGeometry2D +PresetShapeGeometryContext::PresetShapeGeometryContext( ContextHandler2Helper const & rParent, const AttributeList& rAttribs, CustomShapeProperties& rCustomShapeProperties ) +: ContextHandler2( rParent ) +, mrCustomShapeProperties( rCustomShapeProperties ) +{ + sal_Int32 nShapeType = rAttribs.getToken( XML_prst, FastToken::DONTKNOW ); + OSL_ENSURE( nShapeType != FastToken::DONTKNOW, "oox::drawingml::CustomShapeCustomGeometryContext::CustomShapeCustomGeometryContext(), unknown shape type" ); + mrCustomShapeProperties.setShapePresetType( nShapeType ); +} + +ContextHandlerRef PresetShapeGeometryContext::onCreateContext( sal_Int32 aElementToken, const AttributeList& ) +{ + if ( aElementToken == A_TOKEN( avLst ) ) + return new GeomGuideListContext( *this, mrCustomShapeProperties, mrCustomShapeProperties.getAdjustmentGuideList() ); + else + return this; +} + +// CT_PresetTextShape +PresetTextShapeContext::PresetTextShapeContext( ContextHandler2Helper const & rParent, const AttributeList& rAttribs, CustomShapeProperties& rCustomShapeProperties ) +: ContextHandler2( rParent ) +, mrCustomShapeProperties( rCustomShapeProperties ) +{ + sal_Int32 nShapeType = rAttribs.getToken( XML_prst, FastToken::DONTKNOW ); + OSL_ENSURE( nShapeType != FastToken::DONTKNOW, "oox::drawingml::CustomShapeCustomGeometryContext::CustomShapeCustomGeometryContext(), unknown shape type" ); + mrCustomShapeProperties.setShapePresetType( nShapeType ); +} + +ContextHandlerRef PresetTextShapeContext::onCreateContext( sal_Int32 aElementToken, const AttributeList& ) +{ + if ( aElementToken == A_TOKEN( avLst ) ) + return new GeomGuideListContext( *this, mrCustomShapeProperties, mrCustomShapeProperties.getAdjustmentGuideList() ); + else + return this; +} + +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/drawingml/customshapepresetdata.cxx b/oox/source/drawingml/customshapepresetdata.cxx new file mode 100644 index 000000000..3215b9834 --- /dev/null +++ b/oox/source/drawingml/customshapepresetdata.cxx @@ -0,0 +1,974 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +using namespace ::com::sun::star; + +namespace +{ +// Parses a string like: Value = (any) { (long) 19098 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj" +void lcl_parseAdjustmentValue( + std::vector& rAdjustmentValues, + std::string_view rValue) +{ + sal_Int32 nIndex = 0; + drawing::EnhancedCustomShapeAdjustmentValue aAdjustmentValue; + do + { + OString aToken(o3tl::trim(o3tl::getToken(rValue, 0, ',', nIndex))); + static const char aNamePrefix[] = "Name = \""; + static const char aValuePrefix[] = "Value = (any) { (long) "; + if (o3tl::starts_with(aToken, aNamePrefix)) + { + OString aName = aToken.copy(strlen(aNamePrefix), + aToken.getLength() - strlen(aNamePrefix) - strlen("\"")); + aAdjustmentValue.Name = OUString::fromUtf8(aName); + } + else if (o3tl::starts_with(aToken, aValuePrefix)) + { + OString aValue = aToken.copy(strlen(aValuePrefix), + aToken.getLength() - strlen(aValuePrefix) - strlen(" }")); + aAdjustmentValue.Value <<= aValue.toInt32(); + } + else if (!o3tl::starts_with(aToken, "State = ")) + SAL_WARN("oox", "lcl_parseAdjustmentValue: unexpected prefix: " << aToken); + } while (nIndex >= 0); + rAdjustmentValues.push_back(aAdjustmentValue); +} + +// Parses a string like: { Value = (any) { (long) 19098 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj" }, { Value = ..., State = ..., Name = ... } +void lcl_parseAdjustmentValues( + std::vector& rAdjustmentValues, + std::string_view rValue) +{ + sal_Int32 nLevel = 0; + sal_Int32 nStart = 0; + for (size_t i = 0; i < rValue.size(); ++i) + { + if (rValue[i] == '{') + { + if (!nLevel) + nStart = i; + nLevel++; + } + else if (rValue[i] == '}') + { + nLevel--; + if (!nLevel) + { + lcl_parseAdjustmentValue( + rAdjustmentValues, + rValue.substr(nStart + strlen("{ "), i - nStart - strlen(" },"))); + } + } + } +} + +drawing::EnhancedCustomShapeParameterPair +lcl_parseEnhancedCustomShapeParameterPair(std::string_view rValue) +{ + drawing::EnhancedCustomShapeParameterPair aPair; + // We expect the following here: First.Value, First.Type, Second.Value, Second.Type + static const char aExpectedFVPrefix[] + = "First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) "; + assert(o3tl::starts_with(rValue, aExpectedFVPrefix)); + sal_Int32 nIndex = strlen(aExpectedFVPrefix); + aPair.First.Value + <<= static_cast(o3tl::toInt32(o3tl::getToken(rValue, 0, '}', nIndex))); + + static const char aExpectedFTPrefix[] = ", Type = (short) "; + assert(nIndex >= 0 && o3tl::starts_with(rValue.substr(nIndex), aExpectedFTPrefix)); + nIndex += strlen(aExpectedFTPrefix); + aPair.First.Type + = static_cast(o3tl::toInt32(o3tl::getToken(rValue, 0, '}', nIndex))); + + static const char aExpectedSVPrefix[] = ", Second = " + "(com.sun.star.drawing.EnhancedCustomShapeParameter) { " + "Value = (any) { (long) "; + assert(nIndex >= 0 && o3tl::starts_with(rValue.substr(nIndex), aExpectedSVPrefix)); + nIndex += strlen(aExpectedSVPrefix); + aPair.Second.Value + <<= static_cast(o3tl::toInt32(o3tl::getToken(rValue, 0, '}', nIndex))); + + static const char aExpectedSTPrefix[] = ", Type = (short) "; + assert(nIndex >= 0 && o3tl::starts_with(rValue.substr(nIndex), aExpectedSTPrefix)); + nIndex += strlen(aExpectedSTPrefix); + aPair.Second.Type + = static_cast(o3tl::toInt32(o3tl::getToken(rValue, 0, '}', nIndex))); + return aPair; +} + +drawing::EnhancedCustomShapeSegment lcl_parseEnhancedCustomShapeSegment(std::string_view rValue) +{ + drawing::EnhancedCustomShapeSegment aSegment; + // We expect the following here: Command, Count + static const char aExpectedCommandPrefix[] = "Command = (short) "; + assert(o3tl::starts_with(rValue, aExpectedCommandPrefix)); + sal_Int32 nIndex = strlen(aExpectedCommandPrefix); + aSegment.Command + = static_cast(o3tl::toInt32(o3tl::getToken(rValue, 0, ',', nIndex))); + + static const char aExpectedCountPrefix[] = " Count = (short) "; + assert(nIndex >= 0 && o3tl::starts_with(rValue.substr(nIndex), aExpectedCountPrefix)); + nIndex += strlen(aExpectedCountPrefix); + aSegment.Count = static_cast(o3tl::toInt32(o3tl::getToken(rValue, 0, '}', nIndex))); + return aSegment; +} + +awt::Rectangle lcl_parseRectangle(std::string_view rValue) +{ + awt::Rectangle aRectangle; + // We expect the following here: X, Y, Width, Height + static const char aExpectedXPrefix[] = "X = (long) "; + assert(o3tl::starts_with(rValue, aExpectedXPrefix)); + sal_Int32 nIndex = strlen(aExpectedXPrefix); + aRectangle.X = o3tl::toInt32(o3tl::getToken(rValue, 0, ',', nIndex)); + + static const char aExpectedYPrefix[] = " Y = (long) "; + assert(nIndex >= 0 && o3tl::starts_with(rValue.substr(nIndex), aExpectedYPrefix)); + nIndex += strlen(aExpectedYPrefix); + aRectangle.Y = o3tl::toInt32(o3tl::getToken(rValue, 0, ',', nIndex)); + + static const char aExpectedWidthPrefix[] = " Width = (long) "; + assert(nIndex >= 0 && o3tl::starts_with(rValue.substr(nIndex), aExpectedWidthPrefix)); + nIndex += strlen(aExpectedWidthPrefix); + aRectangle.Width = o3tl::toInt32(o3tl::getToken(rValue, 0, ',', nIndex)); + + static const char aExpectedHeightPrefix[] = " Height = (long) "; + assert(nIndex >= 0 && o3tl::starts_with(rValue.substr(nIndex), aExpectedHeightPrefix)); + nIndex += strlen(aExpectedHeightPrefix); + aRectangle.Height = o3tl::toInt32(rValue.substr(nIndex)); + + return aRectangle; +} + +awt::Size lcl_parseSize(std::string_view rValue) +{ + awt::Size aSize; + // We expect the following here: Width, Height + static const char aExpectedWidthPrefix[] = "Width = (long) "; + assert(o3tl::starts_with(rValue, aExpectedWidthPrefix)); + sal_Int32 nIndex = strlen(aExpectedWidthPrefix); + aSize.Width = o3tl::toInt32(o3tl::getToken(rValue, 0, ',', nIndex)); + + static const char aExpectedHeightPrefix[] = " Height = (long) "; + assert(nIndex >= 0 && o3tl::starts_with(rValue.substr(nIndex), aExpectedHeightPrefix)); + nIndex += strlen(aExpectedHeightPrefix); + aSize.Height = o3tl::toInt32(rValue.substr(nIndex)); + + return aSize; +} + +drawing::EnhancedCustomShapeTextFrame lcl_parseEnhancedCustomShapeTextFrame(std::string_view rValue) +{ + drawing::EnhancedCustomShapeTextFrame aTextFrame; + sal_Int32 nLevel = 0; + bool bIgnore = false; + sal_Int32 nStart = 0; + for (size_t i = 0; i < rValue.size(); ++i) + { + if (rValue[i] == '{') + { + if (!nLevel) + bIgnore = true; + nLevel++; + } + else if (rValue[i] == '}') + { + nLevel--; + if (!nLevel) + bIgnore = false; + } + else if (rValue[i] == ',' && !bIgnore) + { + std::string_view aToken = rValue.substr(nStart, i - nStart); + static const char aExpectedPrefix[] + = "TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { "; + if (o3tl::starts_with(aToken, aExpectedPrefix)) + { + aToken = aToken.substr(strlen(aExpectedPrefix), + aToken.size() - strlen(aExpectedPrefix) - strlen(" }")); + aTextFrame.TopLeft = lcl_parseEnhancedCustomShapeParameterPair(aToken); + } + else + SAL_WARN("oox", + "lcl_parseEnhancedCustomShapeTextFrame: unexpected token: " << aToken); + nStart = i + strlen(", "); + } + } + + std::string_view aToken = rValue.substr(nStart); + static const char aExpectedPrefix[] + = "BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { "; + if (o3tl::starts_with(aToken, aExpectedPrefix)) + { + aToken = aToken.substr(strlen(aExpectedPrefix), + aToken.size() - strlen(aExpectedPrefix) - strlen(" }")); + aTextFrame.BottomRight = lcl_parseEnhancedCustomShapeParameterPair(aToken); + } + else + SAL_WARN("oox", + "lcl_parseEnhancedCustomShapeTextFrame: unexpected token at the end: " << aToken); + + return aTextFrame; +} + +// Parses a string like: Name = "Position", Handle = (long) 0, Value = (any) { ... }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE +// where "{ ... }" may contain "," as well. +void lcl_parseHandlePosition(std::vector& rHandle, std::string_view rValue) +{ + sal_Int32 nLevel = 0; + bool bIgnore = false; + sal_Int32 nStart = 0; + for (size_t i = 0; i < rValue.size(); ++i) + { + if (rValue[i] == '{') + { + if (!nLevel) + bIgnore = true; + nLevel++; + } + else if (rValue[i] == '}') + { + nLevel--; + if (!nLevel) + bIgnore = false; + } + else if (rValue[i] == ',' && !bIgnore) + { + std::string_view aToken = rValue.substr(nStart, i - nStart); + static const char aExpectedPrefix[] + = "Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { "; + if (o3tl::starts_with(aToken, aExpectedPrefix)) + { + aToken = aToken.substr(strlen(aExpectedPrefix), + aToken.size() - strlen(aExpectedPrefix) - strlen(" } }")); + + beans::PropertyValue aPropertyValue; + aPropertyValue.Name = "Position"; + aPropertyValue.Value <<= lcl_parseEnhancedCustomShapeParameterPair(aToken); + rHandle.push_back(aPropertyValue); + } + else if (!o3tl::starts_with(aToken, "Name =") && !o3tl::starts_with(aToken, "Handle =")) + SAL_WARN("oox", "lcl_parseHandlePosition: unexpected token: " << aToken); + nStart = i + strlen(", "); + } + } +} + +// Parses a string like: Name = "RangeYMaximum", Handle = (long) 0, Value = (any) { ... }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE +// where "{ ... }" may contain "," as well. +void lcl_parseHandleRange(std::vector& rHandle, std::string_view rValue, + const OUString& rName) +{ + sal_Int32 nLevel = 0; + bool bIgnore = false; + sal_Int32 nStart = 0; + for (size_t i = 0; i < rValue.size(); ++i) + { + if (rValue[i] == '{') + { + if (!nLevel) + bIgnore = true; + nLevel++; + } + else if (rValue[i] == '}') + { + nLevel--; + if (!nLevel) + bIgnore = false; + } + else if (rValue[i] == ',' && !bIgnore) + { + static const char aExpectedPrefix[] + = "Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { "; + if (o3tl::starts_with(rValue.substr(nStart), aExpectedPrefix)) + { + drawing::EnhancedCustomShapeParameter aParameter; + sal_Int32 nIndex{ nStart + static_cast(strlen(aExpectedPrefix)) }; + // We expect the following here: Value and Type + static const char aExpectedVPrefix[] = "Value = (any) { (long) "; + assert(o3tl::starts_with(rValue.substr(nIndex), aExpectedVPrefix)); + nIndex += strlen(aExpectedVPrefix); + aParameter.Value <<= o3tl::toInt32(o3tl::getToken(rValue, 0, '}', nIndex)); + + static const char aExpectedTPrefix[] = ", Type = (short) "; + assert(nIndex >= 0 && o3tl::starts_with(rValue.substr(nIndex), aExpectedTPrefix)); + nIndex += strlen(aExpectedTPrefix); + aParameter.Type + = static_cast(o3tl::toInt32(o3tl::getToken(rValue, 0, '}', nIndex))); + + beans::PropertyValue aPropertyValue; + aPropertyValue.Name = rName; + aPropertyValue.Value <<= aParameter; + rHandle.push_back(aPropertyValue); + } + else if (!o3tl::starts_with(rValue.substr(nStart), "Name =") + && !o3tl::starts_with(rValue.substr(nStart), "Handle =")) + SAL_WARN("oox", "lcl_parseHandleRange: unexpected token: " + << rValue.substr(nStart, i - nStart)); + nStart = i + strlen(", "); + } + } +} + +// Parses a string like: Name = "RefY", Handle = (long) 0, Value = (any) { (long) 0 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE +void lcl_parseHandleRef(std::vector& rHandle, std::string_view rValue, + const OUString& rName) +{ + static constexpr std::string_view aPrefix = "\", Handle = (long) 0, Value = (any) { (long) "; + const sal_Int32 nStart = SAL_N_ELEMENTS("Name = \"") - 1 + rName.getLength(); + + if (rValue.substr(nStart, aPrefix.size()) == aPrefix) + { + sal_Int32 nIndex = nStart + aPrefix.size(); + beans::PropertyValue aPropertyValue; + aPropertyValue.Name = rName; + // We only expect a Value here + aPropertyValue.Value <<= o3tl::toInt32(o3tl::getToken(rValue, 0, '}', nIndex)); + rHandle.push_back(aPropertyValue); + } + else + SAL_WARN("oox", "lcl_parseHandleRef: unexpected value: " << rValue); +} + +uno::Sequence lcl_parseHandle(std::string_view rValue) +{ + std::vector aRet; + sal_Int32 nLevel = 0; + sal_Int32 nStart = 0; + for (size_t i = 0; i < rValue.size(); ++i) + { + if (rValue[i] == '{') + { + if (!nLevel) + nStart = i; + nLevel++; + } + else if (rValue[i] == '}') + { + nLevel--; + if (!nLevel) + { + std::string_view aToken + = rValue.substr(nStart + strlen("{ "), i - nStart - strlen(" },")); + if (o3tl::starts_with(aToken, "Name = \"Position\"")) + lcl_parseHandlePosition(aRet, aToken); + else if (o3tl::starts_with(aToken, "Name = \"RangeXMaximum\"")) + lcl_parseHandleRange(aRet, aToken, "RangeXMaximum"); + else if (o3tl::starts_with(aToken, "Name = \"RangeXMinimum\"")) + lcl_parseHandleRange(aRet, aToken, "RangeXMinimum"); + else if (o3tl::starts_with(aToken, "Name = \"RangeYMaximum\"")) + lcl_parseHandleRange(aRet, aToken, "RangeYMaximum"); + else if (o3tl::starts_with(aToken, "Name = \"RangeYMinimum\"")) + lcl_parseHandleRange(aRet, aToken, "RangeYMinimum"); + else if (o3tl::starts_with(aToken, "Name = \"RadiusRangeMaximum\"")) + lcl_parseHandleRange(aRet, aToken, "RadiusRangeMaximum"); + else if (o3tl::starts_with(aToken, "Name = \"RadiusRangeMinimum\"")) + lcl_parseHandleRange(aRet, aToken, "RadiusRangeMinimum"); + else if (o3tl::starts_with(aToken, "Name = \"RefX\"")) + lcl_parseHandleRef(aRet, aToken, "RefX"); + else if (o3tl::starts_with(aToken, "Name = \"RefY\"")) + lcl_parseHandleRef(aRet, aToken, "RefY"); + else if (o3tl::starts_with(aToken, "Name = \"RefR\"")) + lcl_parseHandleRef(aRet, aToken, "RefR"); + else if (o3tl::starts_with(aToken, "Name = \"RefAngle\"")) + lcl_parseHandleRef(aRet, aToken, "RefAngle"); + else + SAL_WARN("oox", "lcl_parseHandle: unexpected token: " << aToken); + } + } + } + return comphelper::containerToSequence(aRet); +} + +void lcl_parseHandles(std::vector>& rHandles, + std::string_view rValue) +{ + sal_Int32 nLevel = 0; + sal_Int32 nStart = 0; + for (size_t i = 0; i < rValue.size(); ++i) + { + if (rValue[i] == '{') + { + if (!nLevel) + nStart = i; + nLevel++; + } + else if (rValue[i] == '}') + { + nLevel--; + if (!nLevel) + { + uno::Sequence aHandle = lcl_parseHandle( + rValue.substr(nStart + strlen("{ "), i - nStart - strlen(" },"))); + rHandles.push_back(aHandle); + } + } + } +} + +void lcl_parseEquations(std::vector& rEquations, std::string_view rValue) +{ + bool bInString = false; + sal_Int32 nStart = 0; + for (size_t i = 0; i < rValue.size(); ++i) + { + if (rValue[i] == '"' && !bInString) + { + nStart = i; + bInString = true; + } + else if (rValue[i] == '"' && bInString) + { + bInString = false; + rEquations.push_back(OUString::fromUtf8( + rValue.substr(nStart + strlen("\""), i - nStart - strlen("\"")))); + } + } +} + +void lcl_parsePathCoordinateValues(std::vector& rPath, + std::string_view rValue) +{ + std::vector aPairs; + sal_Int32 nLevel = 0; + sal_Int32 nStart = 0; + for (size_t i = 0; i < rValue.size(); ++i) + { + if (rValue[i] == '{') + { + if (!nLevel) + nStart = i; + nLevel++; + } + else if (rValue[i] == '}') + { + nLevel--; + if (!nLevel) + aPairs.push_back(lcl_parseEnhancedCustomShapeParameterPair( + rValue.substr(nStart + strlen("{ "), i - nStart - strlen(" },")))); + } + } + + beans::PropertyValue aPropertyValue; + aPropertyValue.Name = "Coordinates"; + aPropertyValue.Value <<= comphelper::containerToSequence(aPairs); + rPath.push_back(aPropertyValue); +} + +// Parses a string like: Name = "Coordinates", Handle = (long) 0, Value = (any) { ... }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE +// where "{ ... }" may contain "," as well. +void lcl_parsePathCoordinates(std::vector& rPath, std::string_view rValue) +{ + sal_Int32 nLevel = 0; + bool bIgnore = false; + sal_Int32 nStart = 0; + for (size_t i = 0; i < rValue.size(); ++i) + { + if (rValue[i] == '{') + { + if (!nLevel) + bIgnore = true; + nLevel++; + } + else if (rValue[i] == '}') + { + nLevel--; + if (!nLevel) + bIgnore = false; + } + else if (rValue[i] == ',' && !bIgnore) + { + std::string_view aToken = rValue.substr(nStart, i - nStart); + static const char aExpectedPrefix[] + = "Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { "; + if (o3tl::starts_with(aToken, aExpectedPrefix)) + { + aToken = aToken.substr(strlen(aExpectedPrefix), + aToken.size() - strlen(aExpectedPrefix) - strlen(" } }")); + lcl_parsePathCoordinateValues(rPath, aToken); + } + else if (!o3tl::starts_with(aToken, "Name =") && !o3tl::starts_with(aToken, "Handle =")) + SAL_WARN("oox", "lcl_parsePathCoordinates: unexpected token: " << aToken); + nStart = i + strlen(", "); + } + } +} + +void lcl_parsePathGluePointsValues(std::vector& rPath, + std::string_view rValue) +{ + std::vector aPairs; + sal_Int32 nLevel = 0; + sal_Int32 nStart = 0; + for (size_t i = 0; i < rValue.size(); ++i) + { + if (rValue[i] == '{') + { + if (!nLevel) + nStart = i; + nLevel++; + } + else if (rValue[i] == '}') + { + nLevel--; + if (!nLevel) + aPairs.push_back(lcl_parseEnhancedCustomShapeParameterPair( + rValue.substr(nStart + strlen("{ "), i - nStart - strlen(" },")))); + } + } + + beans::PropertyValue aPropertyValue; + aPropertyValue.Name = "GluePoints"; + aPropertyValue.Value <<= comphelper::containerToSequence(aPairs); + rPath.push_back(aPropertyValue); +} + +void lcl_parsePathGluePoints(std::vector& rPath, std::string_view rValue) +{ + sal_Int32 nLevel = 0; + bool bIgnore = false; + sal_Int32 nStart = 0; + for (size_t i = 0; i < rValue.size(); ++i) + { + if (rValue[i] == '{') + { + if (!nLevel) + bIgnore = true; + nLevel++; + } + else if (rValue[i] == '}') + { + nLevel--; + if (!nLevel) + bIgnore = false; + } + else if (rValue[i] == ',' && !bIgnore) + { + std::string_view aToken = rValue.substr(nStart, i - nStart); + static const char aExpectedPrefix[] + = "Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { "; + if (o3tl::starts_with(aToken, aExpectedPrefix)) + { + aToken = aToken.substr(strlen(aExpectedPrefix), + aToken.size() - strlen(aExpectedPrefix) - strlen(" } }")); + lcl_parsePathGluePointsValues(rPath, aToken); + } + else if (!o3tl::starts_with(aToken, "Name =") && !o3tl::starts_with(aToken, "Handle =")) + SAL_WARN("oox", "lcl_parsePathGluePoints: unexpected token: " << aToken); + nStart = i + strlen(", "); + } + } +} + +void lcl_parsePathSegmentValues(std::vector& rPath, std::string_view rValue) +{ + std::vector aSegments; + sal_Int32 nLevel = 0; + sal_Int32 nStart = 0; + for (size_t i = 0; i < rValue.size(); ++i) + { + if (rValue[i] == '{') + { + if (!nLevel) + nStart = i; + nLevel++; + } + else if (rValue[i] == '}') + { + nLevel--; + if (!nLevel) + aSegments.push_back(lcl_parseEnhancedCustomShapeSegment( + rValue.substr(nStart + strlen("{ "), i - nStart - strlen(" },")))); + } + } + + beans::PropertyValue aPropertyValue; + aPropertyValue.Name = "Segments"; + aPropertyValue.Value <<= comphelper::containerToSequence(aSegments); + rPath.push_back(aPropertyValue); +} + +// Parses a string like: Name = "Segments", Handle = (long) 0, Value = (any) { ... }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE +// where "{ ... }" may contain "," as well. +void lcl_parsePathSegments(std::vector& rPath, std::string_view rValue) +{ + sal_Int32 nLevel = 0; + bool bIgnore = false; + sal_Int32 nStart = 0; + for (size_t i = 0; i < rValue.size(); ++i) + { + if (rValue[i] == '{') + { + if (!nLevel) + bIgnore = true; + nLevel++; + } + else if (rValue[i] == '}') + { + nLevel--; + if (!nLevel) + bIgnore = false; + } + else if (rValue[i] == ',' && !bIgnore) + { + std::string_view aToken = rValue.substr(nStart, i - nStart); + static const char aExpectedPrefix[] + = "Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { "; + if (o3tl::starts_with(aToken, aExpectedPrefix)) + { + aToken = aToken.substr(strlen(aExpectedPrefix), + aToken.size() - strlen(aExpectedPrefix) - strlen(" } }")); + lcl_parsePathSegmentValues(rPath, aToken); + } + else if (!o3tl::starts_with(aToken, "Name =") && !o3tl::starts_with(aToken, "Handle =")) + SAL_WARN("oox", "lcl_parsePathSegments: unexpected token: " << aToken); + nStart = i + strlen(", "); + } + } +} + +void lcl_parsePathTextFrameValues(std::vector& rPath, std::string_view rValue) +{ + std::vector aTextFrames; + sal_Int32 nLevel = 0; + sal_Int32 nStart = 0; + for (size_t i = 0; i < rValue.size(); ++i) + { + if (rValue[i] == '{') + { + if (!nLevel) + nStart = i; + nLevel++; + } + else if (rValue[i] == '}') + { + nLevel--; + if (!nLevel) + aTextFrames.push_back(lcl_parseEnhancedCustomShapeTextFrame( + rValue.substr(nStart + strlen("{ "), i - nStart - strlen(" },")))); + } + } + + beans::PropertyValue aPropertyValue; + aPropertyValue.Name = "TextFrames"; + aPropertyValue.Value <<= comphelper::containerToSequence(aTextFrames); + rPath.push_back(aPropertyValue); +} + +// Parses a string like: Name = "TextFrames", Handle = (long) 0, Value = (any) { ... }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE +// where "{ ... }" may contain "," as well. +void lcl_parsePathTextFrames(std::vector& rPath, std::string_view rValue) +{ + sal_Int32 nLevel = 0; + bool bIgnore = false; + sal_Int32 nStart = 0; + for (size_t i = 0; i < rValue.size(); ++i) + { + if (rValue[i] == '{') + { + if (!nLevel) + bIgnore = true; + nLevel++; + } + else if (rValue[i] == '}') + { + nLevel--; + if (!nLevel) + bIgnore = false; + } + else if (rValue[i] == ',' && !bIgnore) + { + std::string_view aToken = rValue.substr(nStart, i - nStart); + static const char aExpectedPrefix[] + = "Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { "; + if (o3tl::starts_with(aToken, aExpectedPrefix)) + { + aToken = aToken.substr(strlen(aExpectedPrefix), + aToken.size() - strlen(aExpectedPrefix) - strlen(" } }")); + lcl_parsePathTextFrameValues(rPath, aToken); + } + else if (!o3tl::starts_with(aToken, "Name =") && !o3tl::starts_with(aToken, "Handle =")) + SAL_WARN("oox", "lcl_parsePathTextFrames: unexpected token: " << aToken); + nStart = i + strlen(", "); + } + } +} + +void lcl_parsePathSubViewSizeValues(std::vector& rPath, + std::string_view rValue) +{ + std::vector aSizes; + sal_Int32 nLevel = 0; + sal_Int32 nStart = 0; + for (size_t i = 0; i < rValue.size(); ++i) + { + if (rValue[i] == '{') + { + if (!nLevel) + nStart = i; + nLevel++; + } + else if (rValue[i] == '}') + { + nLevel--; + if (!nLevel) + aSizes.push_back(lcl_parseSize( + rValue.substr(nStart + strlen("{ "), i - nStart - strlen(" },")))); + } + } + + beans::PropertyValue aPropertyValue; + aPropertyValue.Name = "SubViewSize"; + aPropertyValue.Value <<= comphelper::containerToSequence(aSizes); + rPath.push_back(aPropertyValue); +} + +void lcl_parsePathSubViewSize(std::vector& rPath, std::string_view rValue) +{ + sal_Int32 nLevel = 0; + bool bIgnore = false; + sal_Int32 nStart = 0; + for (size_t i = 0; i < rValue.size(); ++i) + { + if (rValue[i] == '{') + { + if (!nLevel) + bIgnore = true; + nLevel++; + } + else if (rValue[i] == '}') + { + nLevel--; + if (!nLevel) + bIgnore = false; + } + else if (rValue[i] == ',' && !bIgnore) + { + std::string_view aToken = rValue.substr(nStart, i - nStart); + static const char aExpectedPrefix[] = "Value = (any) { ([]com.sun.star.awt.Size) { "; + if (o3tl::starts_with(aToken, aExpectedPrefix)) + { + aToken = aToken.substr(strlen(aExpectedPrefix), + aToken.size() - strlen(aExpectedPrefix) - strlen(" } }")); + lcl_parsePathSubViewSizeValues(rPath, aToken); + } + else if (!o3tl::starts_with(aToken, "Name =") && !o3tl::starts_with(aToken, "Handle =")) + SAL_WARN("oox", "lcl_parsePathSubViewSize: unexpected token: " << aToken); + nStart = i + strlen(", "); + } + } +} + +void lcl_parsePath(std::vector& rPath, std::string_view rValue) +{ + sal_Int32 nLevel = 0; + sal_Int32 nStart = 0; + for (size_t i = 0; i < rValue.size(); ++i) + { + if (rValue[i] == '{') + { + if (!nLevel) + nStart = i; + nLevel++; + } + else if (rValue[i] == '}') + { + nLevel--; + if (!nLevel) + { + std::string_view aToken + = rValue.substr(nStart + strlen("{ "), i - nStart - strlen(" },")); + if (o3tl::starts_with(aToken, "Name = \"Coordinates\"")) + lcl_parsePathCoordinates(rPath, aToken); + else if (o3tl::starts_with(aToken, "Name = \"GluePoints\"")) + lcl_parsePathGluePoints(rPath, aToken); + else if (o3tl::starts_with(aToken, "Name = \"Segments\"")) + lcl_parsePathSegments(rPath, aToken); + else if (o3tl::starts_with(aToken, "Name = \"TextFrames\"")) + lcl_parsePathTextFrames(rPath, aToken); + else if (o3tl::starts_with(aToken, "Name = \"SubViewSize\"")) + lcl_parsePathSubViewSize(rPath, aToken); + else + SAL_WARN("oox", "lcl_parsePath: unexpected token: " << aToken); + } + } + } +} +} + +namespace oox::drawingml +{ +void CustomShapeProperties::initializePresetDataMap() +{ + OUString aPath("$BRAND_BASE_DIR/" LIBO_SHARE_FOLDER "/filter/oox-drawingml-cs-presets"); + rtl::Bootstrap::expandMacros(aPath); + SvFileStream aStream(aPath, StreamMode::READ); + if (aStream.GetError() != ERRCODE_NONE) + SAL_WARN("oox", "failed to open oox-drawingml-cs-presets"); + OStringBuffer aLine; + OUString aName; + bool bNotDone = aStream.ReadLine(aLine); + PropertyMap aPropertyMap; + bool bFirst = true; + while (bNotDone) + { + static const char aCommentPrefix[] = "/* "; + if (o3tl::starts_with(aLine, aCommentPrefix)) + { + if (bFirst) + bFirst = false; + else + maPresetDataMap[TokenMap::getTokenFromUnicode(aName)] = aPropertyMap; + aName = OUString::fromUtf8(std::string_view(aLine).substr( + strlen(aCommentPrefix), + aLine.getLength() - strlen(aCommentPrefix) - strlen(" */"))); + } + else + { + if (std::string_view(aLine) == "AdjustmentValues") + { + aStream.ReadLine(aLine); + if (std::string_view(aLine) + != "([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) {}") + { + std::vector aAdjustmentValues; + static constexpr std::string_view aExpectedPrefix( + "([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) { "); + assert(o3tl::starts_with(aLine, aExpectedPrefix)); + + std::string_view aValue = std::string_view(aLine).substr( + aExpectedPrefix.size(), + aLine.getLength() - aExpectedPrefix.size() - strlen(" }")); + lcl_parseAdjustmentValues(aAdjustmentValues, aValue); + aPropertyMap.setProperty(PROP_AdjustmentValues, + comphelper::containerToSequence(aAdjustmentValues)); + } + else + aPropertyMap.setProperty(PROP_AdjustmentValues, uno::Sequence(0)); + } + else if (std::string_view(aLine) == "Equations") + { + aStream.ReadLine(aLine); + if (std::string_view(aLine) != "([]string) {}") + { + std::vector aEquations; + static constexpr std::string_view aExpectedPrefix("([]string) { "); + assert(o3tl::starts_with(aLine, aExpectedPrefix)); + + std::string_view aValue = std::string_view(aLine).substr( + aExpectedPrefix.size(), + aLine.getLength() - aExpectedPrefix.size() - strlen(" }")); + lcl_parseEquations(aEquations, aValue); + aPropertyMap.setProperty(PROP_Equations, + comphelper::containerToSequence(aEquations)); + } + else + aPropertyMap.setProperty(PROP_Equations, uno::Sequence(0)); + } + else if (std::string_view(aLine) == "Handles") + { + aStream.ReadLine(aLine); + if (std::string_view(aLine) != "([][]com.sun.star.beans.PropertyValue) {}") + { + std::vector> aHandles; + static constexpr std::string_view aExpectedPrefix( + "([][]com.sun.star.beans.PropertyValue) { "); + assert(o3tl::starts_with(aLine, aExpectedPrefix)); + + std::string_view aValue = std::string_view(aLine).substr( + aExpectedPrefix.size(), + aLine.getLength() - aExpectedPrefix.size() - strlen(" }")); + lcl_parseHandles(aHandles, aValue); + aPropertyMap.setProperty(PROP_Handles, + comphelper::containerToSequence(aHandles)); + } + else + aPropertyMap.setProperty(PROP_Handles, uno::Sequence(0)); + } + else if (std::string_view(aLine) == "MirroredX") + { + aStream.ReadLine(aLine); + if (std::string_view(aLine) == "true" || std::string_view(aLine) == "false") + { + aPropertyMap.setProperty(PROP_MirroredX, std::string_view(aLine) == "true"); + } + else + SAL_WARN("oox", "CustomShapeProperties::initializePresetDataMap: unexpected " + "MirroredX parameter"); + } + else if (std::string_view(aLine) == "MirroredY") + { + aStream.ReadLine(aLine); + if (std::string_view(aLine) == "true" || std::string_view(aLine) == "false") + { + aPropertyMap.setProperty(PROP_MirroredY, std::string_view(aLine) == "true"); + } + else + SAL_WARN("oox", "CustomShapeProperties::initializePresetDataMap: unexpected " + "MirroredY parameter"); + } + else if (std::string_view(aLine) == "Path") + { + aStream.ReadLine(aLine); + static constexpr std::string_view aExpectedPrefix( + "([]com.sun.star.beans.PropertyValue) { "); + assert(o3tl::starts_with(aLine, aExpectedPrefix)); + + std::vector aPathValue; + std::string_view aValue = std::string_view(aLine).substr( + aExpectedPrefix.size(), + aLine.getLength() - aExpectedPrefix.size() - strlen(" }")); + lcl_parsePath(aPathValue, aValue); + aPropertyMap.setProperty(PROP_Path, comphelper::containerToSequence(aPathValue)); + } + else if (std::string_view(aLine) == "Type") + { + // Just ignore the line here, we already know the correct type. + aStream.ReadLine(aLine); + aPropertyMap.setProperty(PROP_Type, "ooxml-" + aName); + } + else if (std::string_view(aLine) == "ViewBox") + { + aStream.ReadLine(aLine); + static constexpr std::string_view aExpectedPrefix( + "(com.sun.star.awt.Rectangle) { "); + assert(o3tl::starts_with(aLine, aExpectedPrefix)); + + std::string_view aValue = std::string_view(aLine).substr( + aExpectedPrefix.size(), + aLine.getLength() - aExpectedPrefix.size() - strlen(" }")); + aPropertyMap.setProperty(PROP_ViewBox, lcl_parseRectangle(aValue)); + } + else + SAL_WARN("oox", "CustomShapeProperties::initializePresetDataMap: unhandled line: " + << std::string_view(aLine)); + } + bNotDone = aStream.ReadLine(aLine); + } + maPresetDataMap[TokenMap::getTokenFromUnicode(aName)] = aPropertyMap; +} +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/drawingml/customshapeproperties.cxx b/oox/source/drawingml/customshapeproperties.cxx new file mode 100644 index 000000000..f56b8bfb1 --- /dev/null +++ b/oox/source/drawingml/customshapeproperties.cxx @@ -0,0 +1,364 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +using namespace ::com::sun::star; +using namespace ::com::sun::star::uno; +using namespace ::com::sun::star::beans; +using namespace ::com::sun::star::drawing; + +namespace oox::drawingml { + +CustomShapeProperties::CustomShapeProperties() +: mnShapePresetType ( -1 ) +, mbShapeTypeOverride(false) +, mbMirroredX ( false ) +, mbMirroredY ( false ) +, mnTextRotateAngle ( 0 ) +, mnTextCameraZRotateAngle ( 0 ) +, mnArcNum ( 0 ) +{ +} + +uno::Sequence< sal_Int8 > const & CustomShapeProperties::getShapePresetTypeName() const +{ + return StaticTokenMap().getUtf8TokenName( mnShapePresetType ); +} + +sal_Int32 CustomShapeProperties::SetCustomShapeGuideValue( std::vector< CustomShapeGuide >& rGuideList, const CustomShapeGuide& rGuide ) +{ + std::vector::size_type nIndex = 0; + for( ; nIndex < rGuideList.size(); nIndex++ ) + { + if ( rGuideList[ nIndex ].maName == rGuide.maName ) + break; + } + if ( nIndex == rGuideList.size() ) + rGuideList.push_back( rGuide ); + return static_cast< sal_Int32 >( nIndex ); +} + +// returns the index into the guidelist for a given formula name, +// if the return value is < 0 then the guide value could not be found +sal_Int32 CustomShapeProperties::GetCustomShapeGuideValue( const std::vector< CustomShapeGuide >& rGuideList, std::u16string_view rFormulaName ) +{ + // traverse the list from the end, because guide names can be reused + // and current is the last one + // see a1 guide in gear6 custom shape preset as example + sal_Int32 nIndex = static_cast< sal_Int32 >( rGuideList.size() ) - 1; + for( ; nIndex >= 0; nIndex-- ) + { + if ( rGuideList[ nIndex ].maName == rFormulaName ) + break; + } + + return nIndex; +} + +bool CustomShapeProperties::representsDefaultShape() const +{ + return !((getShapePresetType() >= 0 || maPath2DList.size() > 0) && + getShapePresetType() != XML_Rect && + getShapePresetType() != XML_rect); +} + +CustomShapeProperties::PresetDataMap CustomShapeProperties::maPresetDataMap; + +void CustomShapeProperties::pushToPropSet( + const Reference < XPropertySet >& xPropSet, const awt::Size &aSize ) +{ + if ( mnShapePresetType >= 0 ) + { + SAL_INFO("oox.drawingml", "preset: " << mnShapePresetType); + + if (maPresetDataMap.empty()) + initializePresetDataMap(); + + PropertyMap aPropertyMap; + PropertySet aPropSet( xPropSet ); + + if (maPresetDataMap.find(mnShapePresetType) != maPresetDataMap.end()) + { + SAL_INFO( + "oox.drawingml", + "found property map for preset: " << mnShapePresetType); + + aPropertyMap = maPresetDataMap[mnShapePresetType]; +#ifdef DEBUG + aPropertyMap.dumpCode( aPropertyMap.makePropertySet() ); +#endif + } + + aPropertyMap.setProperty( PROP_MirroredX, mbMirroredX ); + aPropertyMap.setProperty( PROP_MirroredY, mbMirroredY ); + aPropertyMap.setProperty( PROP_TextPreRotateAngle, mnTextRotateAngle ); + aPropertyMap.setProperty( PROP_TextCameraZRotateAngle, mnTextCameraZRotateAngle ); + Sequence< PropertyValue > aSeq = aPropertyMap.makePropertyValueSequence(); + aPropSet.setProperty( PROP_CustomShapeGeometry, aSeq ); + + if ( !maAdjustmentGuideList.empty() ) + { + static const OUStringLiteral sCustomShapeGeometry(u"CustomShapeGeometry"); + static const OUStringLiteral sAdjustmentValues(u"AdjustmentValues"); + uno::Any aGeoPropSet = xPropSet->getPropertyValue( sCustomShapeGeometry ); + uno::Sequence< beans::PropertyValue > aGeoPropSeq; + if ( aGeoPropSet >>= aGeoPropSeq ) + { + for ( auto& rGeoProp : asNonConstRange(aGeoPropSeq) ) + { + if ( rGeoProp.Name == sAdjustmentValues ) + { + uno::Sequence< css::drawing::EnhancedCustomShapeAdjustmentValue > aAdjustmentSeq; + if ( rGeoProp.Value >>= aAdjustmentSeq ) + { + auto aAdjustmentSeqRange = asNonConstRange(aAdjustmentSeq); + int nIndex=0; + for (auto const& adjustmentGuide : maAdjustmentGuideList) + { + if ( adjustmentGuide.maName.getLength() > 3 ) + { + sal_Int32 nAdjustmentIndex = o3tl::toInt32(adjustmentGuide.maName.subView( 3 )) - 1; + if ( ( nAdjustmentIndex >= 0 ) && ( nAdjustmentIndex < aAdjustmentSeq.getLength() ) ) + { + EnhancedCustomShapeAdjustmentValue aAdjustmentVal; + aAdjustmentVal.Value <<= adjustmentGuide.maFormula.toInt32(); + aAdjustmentVal.State = PropertyState_DIRECT_VALUE; + aAdjustmentVal.Name = adjustmentGuide.maName; + aAdjustmentSeqRange[ nAdjustmentIndex ] = aAdjustmentVal; + } + } else if ( aAdjustmentSeq.hasElements() ) { + EnhancedCustomShapeAdjustmentValue aAdjustmentVal; + aAdjustmentVal.Value <<= adjustmentGuide.maFormula.toInt32(); + aAdjustmentVal.State = PropertyState_DIRECT_VALUE; + aAdjustmentVal.Name = adjustmentGuide.maName; + if (nIndex < aAdjustmentSeq.getLength()) + { + aAdjustmentSeqRange[nIndex] = aAdjustmentVal; + ++nIndex; + } + } + } + rGeoProp.Value <<= aAdjustmentSeq; + xPropSet->setPropertyValue( sCustomShapeGeometry, Any( aGeoPropSeq ) ); + break; + } + } + } + } + } + } + else + { + PropertyMap aPropertyMap; + aPropertyMap.setProperty( PROP_Type, OUString( "ooxml-non-primitive" )); + aPropertyMap.setProperty( PROP_MirroredX, mbMirroredX ); + aPropertyMap.setProperty( PROP_MirroredY, mbMirroredY ); + if( mnTextRotateAngle ) + aPropertyMap.setProperty( PROP_TextPreRotateAngle, mnTextRotateAngle ); + // Note 1: If Equations are defined - they are processed using internal div by 360 coordinates + // while if they are not, standard ooxml coordinates are used. + // This size specifically affects scaling. + // Note 2: Width and Height are set to 0 to force scaling to 1. + awt::Rectangle aViewBox( 0, 0, aSize.Width, aSize.Height ); + // tdf#113187 Each ArcTo introduces two additional equations for converting start and swing + // angles. They do not count for test for use of standard ooxml coordinates + if (maGuideList.size() - 2 * countArcTo() > 0) + aViewBox = awt::Rectangle( 0, 0, 0, 0 ); + aPropertyMap.setProperty( PROP_ViewBox, aViewBox); + + Sequence< EnhancedCustomShapeAdjustmentValue > aAdjustmentValues( maAdjustmentGuideList.size() ); + auto aAdjustmentValuesRange = asNonConstRange(aAdjustmentValues); + for ( std::vector::size_type i = 0; i < maAdjustmentGuideList.size(); i++ ) + { + EnhancedCustomShapeAdjustmentValue aAdjustmentVal; + aAdjustmentVal.Value <<= maAdjustmentGuideList[ i ].maFormula.toInt32(); + aAdjustmentVal.State = PropertyState_DIRECT_VALUE; + aAdjustmentVal.Name = maAdjustmentGuideList[ i ].maName; + aAdjustmentValuesRange[ i ] = aAdjustmentVal; + } + aPropertyMap.setProperty( PROP_AdjustmentValues, aAdjustmentValues); + + PropertyMap aPath; + + aPath.setProperty( PROP_Segments, comphelper::containerToSequence(maSegments) ); + + if ( maTextRect.has() ) { + Sequence< EnhancedCustomShapeTextFrame > aTextFrames{ + { /* tl */ { maTextRect.get().l, maTextRect.get().t }, + /* br */ { maTextRect.get().r, maTextRect.get().b } } + }; + aPath.setProperty( PROP_TextFrames, aTextFrames); + } + + sal_uInt32 nParameterPairs = 0; + for ( auto const & i: maPath2DList ) + nParameterPairs += i.parameter.size(); + + Sequence< EnhancedCustomShapeParameterPair > aParameterPairs( nParameterPairs ); + auto aParameterPairsRange = asNonConstRange(aParameterPairs); + sal_uInt32 k = 0; + for ( auto const & i: maPath2DList ) + for ( auto const & j: i.parameter ) + aParameterPairsRange[ k++ ] = j; + aPath.setProperty( PROP_Coordinates, aParameterPairs); + + if ( !maPath2DList.empty() ) + { + bool bAllZero = true; + for ( auto const & i: maPath2DList ) + { + if ( i.w || i.h ) { + bAllZero = false; + break; + } + } + + if ( !bAllZero ) { + Sequence< awt::Size > aSubViewSize( maPath2DList.size() ); + std::transform(maPath2DList.begin(), maPath2DList.end(), aSubViewSize.getArray(), + [](const auto& p2d) + { + SAL_INFO("oox.cscode", + "set subpath; size: " << p2d.w << " x " << p2d.h); + return awt::Size(p2d.w, p2d.h); + }); + aPath.setProperty( PROP_SubViewSize, aSubViewSize); + } + } + + Sequence< PropertyValue > aPathSequence = aPath.makePropertyValueSequence(); + aPropertyMap.setProperty( PROP_Path, aPathSequence); + + Sequence< OUString > aEquations( maGuideList.size() ); + std::transform(maGuideList.begin(), maGuideList.end(), aEquations.getArray(), + [](const auto& g) { return g.maFormula; }); + aPropertyMap.setProperty( PROP_Equations, aEquations); + + Sequence< PropertyValues > aHandles( maAdjustHandleList.size() ); + auto aHandlesRange = asNonConstRange(aHandles); + for ( std::vector::size_type i = 0; i < maAdjustHandleList.size(); i++ ) + { + PropertyMap aHandle; + // maAdjustmentHandle[ i ].gdRef1 ... maAdjustmentHandle[ i ].gdRef2 ... :( + // gdRef1 && gdRef2 -> we do not offer such reference, so it is difficult + // to determine the correct adjustment handle that should be updated with the adjustment + // position. here is the solution: the adjustment value that is used within the position + // has to be updated, in case the position is a formula the first usage of a + // adjustment value is decisive + if ( maAdjustHandleList[ i ].polar ) + { + // Polar handles in DrawingML + // 1. don't have reference center, so PROP_Polar isn't needed. + // 2. position always use planar coordinates. + // 3. use RefAngle and RefR to specify adjustment value to be updated. + // 4. The unit of angular adjustment values are 6000th degree. + + aHandle.setProperty( PROP_Position, maAdjustHandleList[ i ].pos); + if ( maAdjustHandleList[ i ].gdRef1.has() ) + { + sal_Int32 nIndex = GetCustomShapeGuideValue( maAdjustmentGuideList, maAdjustHandleList[ i ].gdRef1.get() ); + if ( nIndex >= 0 ) + aHandle.setProperty( PROP_RefR, nIndex); + } + if ( maAdjustHandleList[ i ].gdRef2.has() ) + { + sal_Int32 nIndex = GetCustomShapeGuideValue( maAdjustmentGuideList, maAdjustHandleList[ i ].gdRef2.get() ); + if ( nIndex >= 0 ) + aHandle.setProperty( PROP_RefAngle, nIndex); + } + if ( maAdjustHandleList[ i ].min1.has() ) + aHandle.setProperty( PROP_RadiusRangeMinimum, maAdjustHandleList[ i ].min1.get()); + if ( maAdjustHandleList[ i ].max1.has() ) + aHandle.setProperty( PROP_RadiusRangeMaximum, maAdjustHandleList[ i ].max1.get()); + + /* TODO: AngleMin & AngleMax + if ( maAdjustHandleList[ i ].min2.has() ) + aHandle.setProperty( PROP_ ] = maAdjustHandleList[ i ].min2.get()); + if ( maAdjustHandleList[ i ].max2.has() ) + aHandle.setProperty( PROP_ ] = maAdjustHandleList[ i ].max2.get()); + */ + } + else + { + aHandle.setProperty( PROP_Position, maAdjustHandleList[ i ].pos); + if ( maAdjustHandleList[ i ].gdRef1.has() ) + { + // TODO: PROP_RefX and PROP_RefY are not yet part of our file format, + // so the handles will not work after save/reload + sal_Int32 nIndex = GetCustomShapeGuideValue( maAdjustmentGuideList, maAdjustHandleList[ i ].gdRef1.get() ); + if ( nIndex >= 0 ) + aHandle.setProperty( PROP_RefX, nIndex); + } + if ( maAdjustHandleList[ i ].gdRef2.has() ) + { + sal_Int32 nIndex = GetCustomShapeGuideValue( maAdjustmentGuideList, maAdjustHandleList[ i ].gdRef2.get() ); + if ( nIndex >= 0 ) + aHandle.setProperty( PROP_RefY, nIndex); + } + if ( maAdjustHandleList[ i ].min1.has() ) + aHandle.setProperty( PROP_RangeXMinimum, maAdjustHandleList[ i ].min1.get()); + if ( maAdjustHandleList[ i ].max1.has() ) + aHandle.setProperty( PROP_RangeXMaximum, maAdjustHandleList[ i ].max1.get()); + if ( maAdjustHandleList[ i ].min2.has() ) + aHandle.setProperty( PROP_RangeYMinimum, maAdjustHandleList[ i ].min2.get()); + if ( maAdjustHandleList[ i ].max2.has() ) + aHandle.setProperty( PROP_RangeYMaximum, maAdjustHandleList[ i ].max2.get()); + } + aHandlesRange[ i ] = aHandle.makePropertyValueSequence(); + } + aPropertyMap.setProperty( PROP_Handles, aHandles); + +#ifdef DEBUG + // Note that the script oox/source/drawingml/customshapes/generatePresetsData.pl looks + // for these ==cscode== and ==csdata== markers, so don't "clean up" these SAL_INFOs. + SAL_INFO("oox.cscode", "==cscode== begin"); + aPropertyMap.dumpCode( aPropertyMap.makePropertySet() ); + SAL_INFO("oox.cscode", "==cscode== end"); + SAL_INFO("oox.csdata", "==csdata== begin"); + aPropertyMap.dumpData( aPropertyMap.makePropertySet() ); + SAL_INFO("oox.csdata", "==csdata== end"); +#endif + // converting the vector to a sequence + Sequence< PropertyValue > aSeq = aPropertyMap.makePropertyValueSequence(); + PropertySet aPropSet( xPropSet ); + aPropSet.setProperty( PROP_CustomShapeGeometry, aSeq ); + } +} + +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/drawingml/customshapes/README.md b/oox/source/drawingml/customshapes/README.md new file mode 100644 index 000000000..4b79fefc6 --- /dev/null +++ b/oox/source/drawingml/customshapes/README.md @@ -0,0 +1,19 @@ +# Generating Custom Shape Presets + +The Perl code (`generatePresetsData.pl` and `generatePresetsPPTXs.pl`) is used +to generate the custom shape presets. + +The `generate.sh` script which invokes the above Perl files, should be invoked +from the libreoffice core top-level source folder: +``` +oox/source/drawingml/customshapes/generate.sh +``` +The logs will be created in the file: +``` +oox/source/drawingml/customshapes/custom-shapes.log +``` + +The output would be placed in this folder: +``` +oox/source/drawingml/customshapes/pptx/ +``` \ No newline at end of file diff --git a/oox/source/drawingml/customshapes/cshape.pptx b/oox/source/drawingml/customshapes/cshape.pptx new file mode 100644 index 000000000..ec42eb93f Binary files /dev/null and b/oox/source/drawingml/customshapes/cshape.pptx differ diff --git a/oox/source/drawingml/customshapes/generate.sh b/oox/source/drawingml/customshapes/generate.sh new file mode 100755 index 000000000..b0e661ec1 --- /dev/null +++ b/oox/source/drawingml/customshapes/generate.sh @@ -0,0 +1,38 @@ +#!/usr/bin/env bash + +# This script is used to generate the custom shape presets + +# We want to exit on errors... + +set -o errexit + +# oox needs to be build with dbglevel=2 so that DEBUG is defined. + +make oox.clean && make oox dbglevel=2 + +# This reads the +# oox/source/drawingml/customshapes/presetShapeDefinitions.xml file. +# It will produce the file +# oox/source/drawingml/customshapes/pptx/cshape-all.ppx and a whole +# bunch of other files that aren't needed further. + +(cd oox/source/drawingml/customshapes && ./generatePresetsPPTXs.pl) + + +# Then load it and store the debugging output. +# We need only the SAL_INFO output with tag "oox.csdata", plus stderr +# for PropertyMap::dumpData() output. + +SAL_LOG='+INFO.oox.csdata-WARN' instdir/program/soffice --headless --convert-to odp --outdir oox/source/drawingml/customshapes/ oox/source/drawingml/customshapes/pptx/cshape-all.pptx > oox/source/drawingml/customshapes/custom-shapes.log 2>&1 + + +# Now run a script that reads the above log file and generates the +# oox-drawingml-cs-presets data: + +(cd oox/source/drawingml/customshapes && ./generatePresetsData.pl) + + +echo +echo "To see what has been done, run git diff --patience oox/source/drawingml" +echo + diff --git a/oox/source/drawingml/customshapes/generatePresetsData.pl b/oox/source/drawingml/customshapes/generatePresetsData.pl new file mode 100755 index 000000000..99b2ff153 --- /dev/null +++ b/oox/source/drawingml/customshapes/generatePresetsData.pl @@ -0,0 +1,74 @@ +#!/usr/bin/env perl +# +# This file is part of the LibreOffice project. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# + +sub loadData() +{ + open (IN, ") + { + if (/==csdata== /) + { + if (/shape name: '/) + { + chop; + s/.*shape name: '([^']+)'.*/$1/; + $name = $_; + } + else + { + if (/==csdata== begin/) + { + $inside = true; + @code = (); + } + else + { + if (/==csdata== end/) + { + s/^ <\/([^>]+)>/$1/; + undef $inside; + $sources{$name} = [ @code ]; + } + } + } + } + else + { + if ($inside) + { + push @code, $_; + } + } + } + + close (IN); + + return \%sources; +} + +sub generateData +{ + my $sources = shift; + open (OUT, ">oox-drawingml-cs-presets"); + + foreach $shape (sort(keys %$sources)) + { + printf OUT "/* %s */\n", $shape; + print OUT @{$sources->{$shape}}; + } + + close OUT; +} + +generateData(loadData()); + +# vim:set ft=perl shiftwidth=4 softtabstop=4 expandtab: # diff --git a/oox/source/drawingml/customshapes/generatePresetsPPTXs.pl b/oox/source/drawingml/customshapes/generatePresetsPPTXs.pl new file mode 100755 index 000000000..246bfddcd --- /dev/null +++ b/oox/source/drawingml/customshapes/generatePresetsPPTXs.pl @@ -0,0 +1,193 @@ +#!/usr/bin/env perl +# +# This file is part of the LibreOffice project. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# + +use IO::Handle; + +$shapes = loadShapes (); + +generatePPTXs($shapes); +exit; + + +sub generatePPTXs +{ + $shapes = shift; + + foreach $shape (keys %$shapes) + { + generatePPTX ($shapes, $shape); + } + + generatePPTX ($shapes); +} + +sub generatePPTX +{ + $shapes = shift; + $type = shift; + + mkdir ("cshape"); + mkdir ("pptx"); + system ("unzip -qq -o -d cshape cshape.pptx"); + + # custom shape(s) slide with preset definition + generateSlide ($shapes, $type, ">cshape/ppt/slides/slide1.xml", 0); + + $pptx = "../pptx/cshape-" . (defined $type ? $type : "all") . ".pptx"; + system ("cd cshape\nrm -rf ". $pptx . "\nzip -q -r " . $pptx . " .\ncd .."); + + # preset(s) slide, for testing + generateSlide ($shapes, $type, ">cshape/ppt/slides/slide1.xml", 1); + + $pptx = "../pptx/preset-cshape-" . (defined $type ? $type : "all") . ".pptx"; + system ("cd cshape\nrm -rf ". $pptx . "\nzip -q -r " . $pptx . " .\ncd .."); +} + +sub loadShapes() +{ + open (IN, ") + { + if (/^ <[^\/]/) + { + $inside = true; + @definition = (); + } + else + { + if (/^ <\//) + { + chomp; + s/^ <\/([^>]+)>.*/$1/; + undef $inside; + $shapes{$_} = [ @definition ]; + #print "added ", $_, "\n"; + } + else + { + if ($inside) + { + push @definition, $_; + } + } + } + } + + close (IN); + + return \%shapes; +} + +sub generateSlide +{ + $shapes = shift; + $type = shift; + $file = shift; + $preset = shift; + + open (OUT, $file); + + print OUT " + + + + + + + + + + + + + + + + +"; + + $id = 16; + $col = 0; + $row = 0; + $size = 500000; + foreach $shape (keys %$shapes) + { + if (defined $type) { + if ($shape ne $type) { next; } +# +# + $size *= 10; + $col = 0.5; + $row = 0.25; + } + + if ($col > 15) { + $col = 0; + $row ++; + } + + print OUT " + + + + + + + + + + +"; + if ($preset) { + print OUT " +"; + } else { + print OUT " +"; + print OUT @{$shapes->{$shape}}; + print OUT " +"; + } + print OUT " + + + + + + + + + + + + +"; + } + + print OUT " + + + + + + + + + + + + +"; + + close (OUT); +} diff --git a/oox/source/drawingml/customshapes/oox-drawingml-cs-presets b/oox/source/drawingml/customshapes/oox-drawingml-cs-presets new file mode 100644 index 000000000..a88d30040 --- /dev/null +++ b/oox/source/drawingml/customshapes/oox-drawingml-cs-presets @@ -0,0 +1,3179 @@ +/* accentBorderCallout1 */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) { { Value = (any) { (long) 18750 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj1" }, { Value = (any) { (long) -8333 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj2" }, { Value = (any) { (long) 112500 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj3" }, { Value = (any) { (long) -38333 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj4" } } +Equations +([]string) { "logheight*$0 /100000", "logwidth*$1 /100000", "logheight*$2 /100000", "logwidth*$3 /100000", "logwidth", "logheight/2", "logwidth/2", "logheight" } +Handles +([][]com.sun.star.beans.PropertyValue) { { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) -2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) -2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefX", Handle = (long) 0, Value = (any) { (long) 1 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefY", Handle = (long) 0, Value = (any) { (long) 0 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } }, { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) -2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) -2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefX", Handle = (long) 0, Value = (any) { (long) 3 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefY", Handle = (long) 0, Value = (any) { (long) 2 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } } +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 3 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 6, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 6, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* accentBorderCallout2 */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) { { Value = (any) { (long) 18750 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj1" }, { Value = (any) { (long) -8333 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj2" }, { Value = (any) { (long) 18750 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj3" }, { Value = (any) { (long) -16667 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj4" }, { Value = (any) { (long) 112500 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj5" }, { Value = (any) { (long) -46667 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj6" } } +Equations +([]string) { "logheight*$0 /100000", "logwidth*$1 /100000", "logheight*$2 /100000", "logwidth*$3 /100000", "logheight*$4 /100000", "logwidth*$5 /100000", "logwidth", "logheight/2", "logwidth/2", "logheight" } +Handles +([][]com.sun.star.beans.PropertyValue) { { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) -2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) -2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefX", Handle = (long) 0, Value = (any) { (long) 1 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefY", Handle = (long) 0, Value = (any) { (long) 0 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } }, { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) -2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) -2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefX", Handle = (long) 0, Value = (any) { (long) 3 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefY", Handle = (long) 0, Value = (any) { (long) 2 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } }, { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) -2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) -2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefX", Handle = (long) 0, Value = (any) { (long) 5 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefY", Handle = (long) 0, Value = (any) { (long) 4 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } } +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 3 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 6, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 2 }, { Command = (short) 6, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* accentBorderCallout3 */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) { { Value = (any) { (long) 18750 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj1" }, { Value = (any) { (long) -8333 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj2" }, { Value = (any) { (long) 18750 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj3" }, { Value = (any) { (long) -16667 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj4" }, { Value = (any) { (long) 100000 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj5" }, { Value = (any) { (long) -16667 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj6" }, { Value = (any) { (long) 112963 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj7" }, { Value = (any) { (long) -8333 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj8" } } +Equations +([]string) { "logheight*$0 /100000", "logwidth*$1 /100000", "logheight*$2 /100000", "logwidth*$3 /100000", "logheight*$4 /100000", "logwidth*$5 /100000", "logheight*$6 /100000", "logwidth*$7 /100000", "logwidth", "logheight/2", "logwidth/2", "logheight" } +Handles +([][]com.sun.star.beans.PropertyValue) { { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) -2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) -2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefX", Handle = (long) 0, Value = (any) { (long) 1 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefY", Handle = (long) 0, Value = (any) { (long) 0 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } }, { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) -2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) -2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefX", Handle = (long) 0, Value = (any) { (long) 3 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefY", Handle = (long) 0, Value = (any) { (long) 2 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } }, { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) -2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) -2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefX", Handle = (long) 0, Value = (any) { (long) 5 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefY", Handle = (long) 0, Value = (any) { (long) 4 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } }, { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) -2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) -2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefX", Handle = (long) 0, Value = (any) { (long) 7 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefY", Handle = (long) 0, Value = (any) { (long) 6 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } } +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 3 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 6, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 3 }, { Command = (short) 6, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* accentCallout1 */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) { { Value = (any) { (long) 18750 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj1" }, { Value = (any) { (long) -8333 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj2" }, { Value = (any) { (long) 112500 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj3" }, { Value = (any) { (long) -38333 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj4" } } +Equations +([]string) { "logheight*$0 /100000", "logwidth*$1 /100000", "logheight*$2 /100000", "logwidth*$3 /100000", "logwidth", "logheight/2", "logwidth/2", "logheight" } +Handles +([][]com.sun.star.beans.PropertyValue) { { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) -2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) -2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefX", Handle = (long) 0, Value = (any) { (long) 1 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefY", Handle = (long) 0, Value = (any) { (long) 0 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } }, { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) -2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) -2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefX", Handle = (long) 0, Value = (any) { (long) 3 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefY", Handle = (long) 0, Value = (any) { (long) 2 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } } +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 3 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 7, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 6, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 6, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* accentCallout2 */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) { { Value = (any) { (long) 18750 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj1" }, { Value = (any) { (long) -8333 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj2" }, { Value = (any) { (long) 18750 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj3" }, { Value = (any) { (long) -16667 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj4" }, { Value = (any) { (long) 112500 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj5" }, { Value = (any) { (long) -46667 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj6" } } +Equations +([]string) { "logheight*$0 /100000", "logwidth*$1 /100000", "logheight*$2 /100000", "logwidth*$3 /100000", "logheight*$4 /100000", "logwidth*$5 /100000", "logwidth", "logheight/2", "logwidth/2", "logheight" } +Handles +([][]com.sun.star.beans.PropertyValue) { { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) -2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) -2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefX", Handle = (long) 0, Value = (any) { (long) 1 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefY", Handle = (long) 0, Value = (any) { (long) 0 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } }, { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) -2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) -2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefX", Handle = (long) 0, Value = (any) { (long) 3 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefY", Handle = (long) 0, Value = (any) { (long) 2 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } }, { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) -2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) -2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefX", Handle = (long) 0, Value = (any) { (long) 5 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefY", Handle = (long) 0, Value = (any) { (long) 4 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } } +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 3 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 7, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 6, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 2 }, { Command = (short) 6, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* accentCallout3 */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) { { Value = (any) { (long) 18750 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj1" }, { Value = (any) { (long) -8333 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj2" }, { Value = (any) { (long) 18750 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj3" }, { Value = (any) { (long) -16667 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj4" }, { Value = (any) { (long) 100000 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj5" }, { Value = (any) { (long) -16667 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj6" }, { Value = (any) { (long) 112963 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj7" }, { Value = (any) { (long) -8333 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj8" } } +Equations +([]string) { "logheight*$0 /100000", "logwidth*$1 /100000", "logheight*$2 /100000", "logwidth*$3 /100000", "logheight*$4 /100000", "logwidth*$5 /100000", "logheight*$6 /100000", "logwidth*$7 /100000", "logwidth", "logheight/2", "logwidth/2", "logheight" } +Handles +([][]com.sun.star.beans.PropertyValue) { { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) -2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) -2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefX", Handle = (long) 0, Value = (any) { (long) 1 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefY", Handle = (long) 0, Value = (any) { (long) 0 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } }, { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) -2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) -2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefX", Handle = (long) 0, Value = (any) { (long) 3 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefY", Handle = (long) 0, Value = (any) { (long) 2 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } }, { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) -2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) -2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefX", Handle = (long) 0, Value = (any) { (long) 5 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefY", Handle = (long) 0, Value = (any) { (long) 4 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } }, { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) -2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) -2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefX", Handle = (long) 0, Value = (any) { (long) 7 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefY", Handle = (long) 0, Value = (any) { (long) 6 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } } +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 3 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 7, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 6, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 3 }, { Command = (short) 6, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* actionButtonBackPrevious */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) {} +Equations +([]string) { "min(logwidth,logheight)", "?0 *3/8", "logheight/2", "?2 +0-?1 ", "?2 +?1 -0", "logwidth/2", "?5 +0-?1 ", "?5 +?1 -0", "logwidth", "logheight" } +Handles +([][]com.sun.star.beans.PropertyValue) {} +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 3 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 2 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 7, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 2 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 18, Count = (short) 0 }, { Command = (short) 7, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 2 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 6, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 3 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 6, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* actionButtonBeginning */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) {} +Equations +([]string) { "min(logwidth,logheight)", "?0 *3/8", "logheight/2", "?2 +0-?1 ", "?2 +?1 -0", "logwidth/2", "?5 +0-?1 ", "?5 +?1 -0", "?0 *3/4", "?8 *1/8", "?8 *1/4", "?6 +?9 -0", "?6 +?10 -0", "logwidth", "logheight" } +Handles +([][]com.sun.star.beans.PropertyValue) {} +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 3 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 2 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 3 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 7, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 2 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 3 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 18, Count = (short) 0 }, { Command = (short) 7, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 2 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 3 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 6, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 3 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 6, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* actionButtonBlank */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) {} +Equations +([]string) { "logwidth", "logheight/2", "logwidth/2", "logheight" } +Handles +([][]com.sun.star.beans.PropertyValue) {} +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 3 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* actionButtonDocument */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) {} +Equations +([]string) { "min(logwidth,logheight)", "?0 *3/8", "logheight/2", "?2 +0-?1 ", "?2 +?1 -0", "?0 *9/32", "logwidth/2", "?6 +0-?5 ", "?6 +?5 -0", "?0 *3/16", "?8 +0-?9 ", "?3 +?9 -0", "logwidth", "logheight" } +Handles +([][]com.sun.star.beans.PropertyValue) {} +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 3 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 4 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 7, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 5 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 19, Count = (short) 0 }, { Command = (short) 7, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 2 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 18, Count = (short) 0 }, { Command = (short) 7, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 4 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 2 }, { Command = (short) 6, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 3 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 6, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* actionButtonEnd */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) {} +Equations +([]string) { "min(logwidth,logheight)", "?0 *3/8", "logheight/2", "?2 +0-?1 ", "?2 +?1 -0", "logwidth/2", "?5 +0-?1 ", "?5 +?1 -0", "?0 *3/4", "?8 *3/4", "?8 *7/8", "?6 +?9 -0", "?6 +?10 -0", "logwidth", "logheight" } +Handles +([][]com.sun.star.beans.PropertyValue) {} +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 3 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 2 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 3 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 7, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 2 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 3 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 18, Count = (short) 0 }, { Command = (short) 7, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 2 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 3 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 6, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 3 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 6, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* actionButtonForwardNext */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) {} +Equations +([]string) { "min(logwidth,logheight)", "?0 *3/8", "logheight/2", "?2 +0-?1 ", "?2 +?1 -0", "logwidth/2", "?5 +0-?1 ", "?5 +?1 -0", "logwidth", "logheight" } +Handles +([][]com.sun.star.beans.PropertyValue) {} +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 3 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 2 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 7, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 2 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 18, Count = (short) 0 }, { Command = (short) 7, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 2 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 6, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 3 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 6, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* actionButtonHelp */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) {} +Equations +([]string) { "min(logwidth,logheight)", "?0 *3/8", "logheight/2", "?2 +0-?1 ", "logwidth/2", "?4 +0-?1 ", "?0 *3/4", "?6 *1/7", "?6 *3/14", "?6 *2/7", "?6 *3/7", "?6 *4/7", "?6 *17/28", "?6 *21/28", "?6 *11/14", "?3 +?9 -0", "?3 +?12 -0", "?3 +?13 -0", "?3 +?14 -0", "?5 +?8 -0", "?5 +?10 -0", "?5 +?11 -0", "?6 *1/14", "?6 *3/28", "logwidth", "logheight", "(10800000)/60000.0", "(10800000)/60000.0", "(0)/60000.0", "(5400000)/60000.0", "(16200000)/60000.0", "(-5400000)/60000.0", "(10800000)/60000.0", "(5400000)/60000.0", "(5400000)/60000.0", "(-5400000)/60000.0", "(0)/60000.0", "(-10800000)/60000.0", "(16200000)/60000.0", "(21600000)/60000.0", "(10800000)/60000.0", "(10800000)/60000.0", "(0)/60000.0", "(5400000)/60000.0", "(16200000)/60000.0", "(-5400000)/60000.0", "(10800000)/60000.0", "(5400000)/60000.0", "(5400000)/60000.0", "(-5400000)/60000.0", "(0)/60000.0", "(-10800000)/60000.0", "(16200000)/60000.0", "(21600000)/60000.0", "(10800000)/60000.0", "(10800000)/60000.0", "(0)/60000.0", "(5400000)/60000.0", "(16200000)/60000.0", "(-5400000)/60000.0", "(10800000)/60000.0", "(5400000)/60000.0", "(5400000)/60000.0", "(-5400000)/60000.0", "(0)/60000.0", "(-10800000)/60000.0", "(16200000)/60000.0", "(21600000)/60000.0" } +Handles +([][]com.sun.star.beans.PropertyValue) {} +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 24 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 24 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 25 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 25 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 26 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 27 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 28 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 29 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 22 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 23 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 30 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 31 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 21 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 17 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 20 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 17 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 20 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 32 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 33 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 22 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 23 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 34 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 35 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 36 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 37 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 18 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 23 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 23 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 38 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 39 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 40 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 41 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 42 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 43 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 22 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 23 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 44 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 45 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 21 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 17 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 20 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 17 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 20 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 46 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 47 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 22 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 23 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 48 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 49 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 50 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 51 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 18 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 23 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 23 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 52 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 53 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 54 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 55 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 56 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 57 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 22 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 23 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 58 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 59 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 21 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 17 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 20 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 17 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 20 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 60 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 61 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 22 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 23 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 62 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 63 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 64 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 65 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 18 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 23 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 23 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 66 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 67 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 24 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 24 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 25 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 25 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 3 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 17, Count = (short) 3 }, { Command = (short) 2, Count = (short) 3 }, { Command = (short) 17, Count = (short) 3 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 7, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 17, Count = (short) 3 }, { Command = (short) 2, Count = (short) 3 }, { Command = (short) 17, Count = (short) 3 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 18, Count = (short) 0 }, { Command = (short) 7, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 17, Count = (short) 3 }, { Command = (short) 2, Count = (short) 3 }, { Command = (short) 17, Count = (short) 3 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 6, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 3 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 6, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 24 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 25 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* actionButtonHome */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) {} +Equations +([]string) { "min(logwidth,logheight)", "?0 *3/8", "logheight/2", "?2 +0-?1 ", "?2 +?1 -0", "logwidth/2", "?5 +0-?1 ", "?5 +?1 -0", "?0 *3/4", "?8 *1/16", "?8 *1/8", "?8 *3/16", "?8 *5/16", "?8 *7/16", "?8 *9/16", "?8 *11/16", "?8 *3/4", "?8 *13/16", "?8 *7/8", "?3 +?9 -0", "?3 +?11 -0", "?3 +?12 -0", "?3 +?16 -0", "?6 +?10 -0", "?6 +?13 -0", "?6 +?14 -0", "?6 +?15 -0", "?6 +?17 -0", "?6 +?18 -0", "logwidth", "logheight" } +Handles +([][]com.sun.star.beans.PropertyValue) {} +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 29 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 29 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 30 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 30 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 23 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 23 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 28 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 28 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 27 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 21 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 27 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 26 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 26 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 20 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 27 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 21 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 27 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 26 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 26 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 20 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 23 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 23 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 24 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 24 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 22 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 25 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 22 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 25 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 28 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 28 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 24 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 22 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 25 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 22 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 25 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 24 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 26 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 20 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 26 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 27 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 27 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 21 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 28 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 28 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 23 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 23 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 26 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 20 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 27 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 21 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 28 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 23 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 24 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 24 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 22 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 25 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 22 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 25 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 29 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 29 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 30 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 30 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 3 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 10 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 7, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 3 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 7 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 19, Count = (short) 0 }, { Command = (short) 7, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 2 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 3 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 18, Count = (short) 0 }, { Command = (short) 7, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 10 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 3 }, { Command = (short) 6, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 3 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 6, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 29 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 30 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* actionButtonInformation */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) {} +Equations +([]string) { "min(logwidth,logheight)", "?0 *3/8", "logheight/2", "?2 +0-?1 ", "logwidth/2", "?4 +0-?1 ", "?0 *3/4", "?6 *1/32", "?6 *5/16", "?6 *3/8", "?6 *13/32", "?6 *19/32", "?6 *11/16", "?6 *13/16", "?6 *7/8", "?3 +?7 -0", "?3 +?8 -0", "?3 +?9 -0", "?3 +?13 -0", "?3 +?14 -0", "?5 +?8 -0", "?5 +?10 -0", "?5 +?11 -0", "?5 +?12 -0", "?6 *3/32", "logwidth", "logheight", "(16200000)/60000.0", "(21600000)/60000.0", "(16200000)/60000.0", "(21600000)/60000.0", "(16200000)/60000.0", "(21600000)/60000.0", "(16200000)/60000.0", "(21600000)/60000.0", "(16200000)/60000.0", "(21600000)/60000.0", "(16200000)/60000.0", "(21600000)/60000.0" } +Handles +([][]com.sun.star.beans.PropertyValue) {} +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 25 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 25 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 26 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 26 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 27 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 28 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 29 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 30 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 24 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 24 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 31 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 32 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 20 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 20 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 17 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 21 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 17 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 21 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 18 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 20 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 18 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 20 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 23 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 23 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 18 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 22 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 18 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 22 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 24 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 24 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 33 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 34 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 20 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 22 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 22 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 18 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 23 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 18 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 23 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 20 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 20 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 18 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 21 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 18 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 21 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 17 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 20 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 17 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 35 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 36 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 24 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 24 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 37 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 38 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 20 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 22 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 22 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 18 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 23 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 18 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 23 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 20 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 20 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 18 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 21 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 18 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 21 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 17 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 20 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 17 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 25 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 25 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 26 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 26 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 3 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 7, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 9 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 18, Count = (short) 0 }, { Command = (short) 7, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 9 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 20, Count = (short) 0 }, { Command = (short) 7, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 9 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 6, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 3 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 6, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 25 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 26 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* actionButtonMovie */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) {} +Equations +([]string) { "min(logwidth,logheight)", "?0 *3/8", "logheight/2", "?2 +0-?1 ", "?2 +?1 -0", "logwidth/2", "?5 +0-?1 ", "?5 +?1 -0", "?0 *3/4", "?8 *1455/21600", "?8 *1905/21600", "?8 *2325/21600", "?8 *16155/21600", "?8 *17010/21600", "?8 *19335/21600", "?8 *19725/21600", "?8 *20595/21600", "?8 *5280/21600", "?8 *5730/21600", "?8 *6630/21600", "?8 *7492/21600", "?8 *9067/21600", "?8 *9555/21600", "?8 *13342/21600", "?8 *14580/21600", "?8 *15592/21600", "?6 +?9 -0", "?6 +?10 -0", "?6 +?11 -0", "?6 +?12 -0", "?6 +?13 -0", "?6 +?14 -0", "?6 +?15 -0", "?6 +?16 -0", "?3 +?17 -0", "?3 +?18 -0", "?3 +?19 -0", "?3 +?20 -0", "?3 +?21 -0", "?3 +?22 -0", "?3 +?23 -0", "?3 +?24 -0", "?3 +?25 -0", "?3 +?26 -0", "logwidth", "logheight" } +Handles +([][]com.sun.star.beans.PropertyValue) {} +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 44 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 44 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 45 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 45 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 34 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 39 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 26 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 39 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 27 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 38 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 28 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 38 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 28 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 42 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 30 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 42 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 30 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 40 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 31 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 40 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 33 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 41 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 41 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 36 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 33 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 36 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 32 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 37 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 30 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 37 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 30 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 36 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 29 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 35 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 27 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 35 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 26 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 34 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 34 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 39 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 26 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 39 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 27 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 38 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 28 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 38 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 28 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 42 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 30 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 42 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 30 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 40 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 31 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 40 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 33 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 41 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 41 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 36 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 33 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 36 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 32 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 37 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 30 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 37 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 30 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 36 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 29 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 35 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 27 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 35 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 26 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 34 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 34 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 26 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 34 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 27 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 35 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 29 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 35 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 30 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 36 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 30 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 37 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 32 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 37 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 33 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 36 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 36 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 41 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 33 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 41 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 31 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 40 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 30 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 40 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 30 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 42 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 28 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 42 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 28 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 38 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 27 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 38 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 26 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 39 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 39 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 44 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 44 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 45 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 45 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 3 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 18 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 7, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 18 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 18, Count = (short) 0 }, { Command = (short) 7, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 18 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 6, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 3 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 6, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 44 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 45 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* actionButtonReturn */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) {} +Equations +([]string) { "min(logwidth,logheight)", "?0 *3/8", "logheight/2", "?2 +0-?1 ", "?2 +?1 -0", "logwidth/2", "?5 +0-?1 ", "?5 +?1 -0", "?0 *3/4", "?8 *7/8", "?8 *3/4", "?8 *5/8", "?8 *3/8", "?8 *1/4", "?3 +?10 -0", "?3 +?11 -0", "?3 +?13 -0", "?6 +?9 -0", "?6 +?10 -0", "?6 +?11 -0", "?6 +?12 -0", "?6 +?13 -0", "?8 *1/8", "logwidth", "logheight", "(0)/60000.0", "(5400000)/60000.0", "(5400000)/60000.0", "(5400000)/60000.0", "(10800000)/60000.0", "(-5400000)/60000.0", "(5400000)/60000.0", "(-5400000)/60000.0", "(0)/60000.0", "(5400000)/60000.0", "(5400000)/60000.0", "(5400000)/60000.0", "(10800000)/60000.0", "(-5400000)/60000.0", "(5400000)/60000.0", "(-5400000)/60000.0", "(0)/60000.0", "(5400000)/60000.0", "(5400000)/60000.0", "(5400000)/60000.0", "(10800000)/60000.0", "(-5400000)/60000.0", "(5400000)/60000.0", "(-5400000)/60000.0" } +Handles +([][]com.sun.star.beans.PropertyValue) {} +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 23 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 23 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 24 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 24 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 18 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 22 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 22 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 25 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 26 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 20 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 22 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 22 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 27 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 28 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 21 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 29 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 30 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 31 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 32 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 17 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 18 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 22 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 22 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 33 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 34 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 20 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 22 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 22 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 35 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 36 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 21 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 37 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 38 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 39 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 40 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 17 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 17 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 17 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 41 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 42 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 20 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 43 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 44 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 21 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 21 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 22 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 22 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 45 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 46 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 22 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 22 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 47 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 48 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 18 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 23 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 23 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 24 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 24 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 3 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 4 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 2, Count = (short) 3 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 7, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 4 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 2, Count = (short) 3 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 18, Count = (short) 0 }, { Command = (short) 7, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 2 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 2, Count = (short) 3 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 2, Count = (short) 3 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 6, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 3 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 6, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 23 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 24 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* actionButtonSound */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) {} +Equations +([]string) { "min(logwidth,logheight)", "?0 *3/8", "logheight/2", "?2 +0-?1 ", "?2 +?1 -0", "logwidth/2", "?5 +0-?1 ", "?5 +?1 -0", "?0 *3/4", "?8 *1/8", "?8 *5/16", "?8 *5/8", "?8 *11/16", "?8 *3/4", "?8 *7/8", "?3 +?9 -0", "?3 +?10 -0", "?3 +?12 -0", "?3 +?14 -0", "?6 +?10 -0", "?6 +?11 -0", "?6 +?13 -0", "logwidth", "logheight" } +Handles +([][]com.sun.star.beans.PropertyValue) {} +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 22 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 22 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 23 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 23 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 17 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 17 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 20 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 20 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 17 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 17 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 20 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 20 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 20 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 20 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 17 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 17 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 21 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 21 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 21 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 17 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 18 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 22 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 22 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 23 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 23 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 3 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 5 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 7, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 5 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 18, Count = (short) 0 }, { Command = (short) 7, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 5 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 6, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 3 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 6, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 22 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 23 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* arc */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) { { Value = (any) { (long) 16200000 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj1" }, { Value = (any) { (long) 0 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj2" } } +Equations +([]string) { "if(0-$0 ,0,if(21599999-$0 ,$0 ,21599999))", "if(0-$1 ,0,if(21599999-$1 ,$1 ,21599999))", "?1 +0-?0 ", "?2 +21600000-0", "if(?2 ,?2 ,?3 )", "logwidth/2", "?5 *sin(pi*(?0 )/10800000)", "logheight/2", "?7 *cos(pi*(?0 )/10800000)", "?5 *(cos(atan2(?6 ,?8 )))", "?7 *(sin(atan2(?6 ,?8 )))", "?5 *sin(pi*(?1 )/10800000)", "?7 *cos(pi*(?1 )/10800000)", "?5 *(cos(atan2(?11 ,?12 )))", "?7 *(sin(atan2(?11 ,?12 )))", "logwidth/2", "?15 +?9 -0", "logheight/2", "?17 +?10 -0", "?15 +?13 -0", "?17 +?14 -0", "21600000+0-?0 ", "?4 +0-?21 ", "max(?16 ,?19 )", "if(?22 ,logwidth,?23 )", "5400000+0-?0 ", "27000000+0-?0 ", "if(?25 ,?25 ,?26 )", "?4 +0-?27 ", "max(?18 ,?20 )", "if(?28 ,logheight,?29 )", "10800000+0-?0 ", "32400000+0-?0 ", "if(?31 ,?31 ,?32 )", "?4 +0-?33 ", "min(?16 ,?19 )", "if(?34 ,0,?35 )", "16200000+0-?0 ", "37800000+0-?0 ", "if(?37 ,?37 ,?38 )", "?4 +0-?39 ", "min(?18 ,?20 )", "if(?40 ,0,?41 )", "?0 +0-5400000", "?1 +5400000-0", "(?43 +?44 )/2", "(?0 )/60000.0", "(?4 )/60000.0", "(?0 )/60000.0", "(?4 )/60000.0" } +Handles +([][]com.sun.star.beans.PropertyValue) { { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 18 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefAngle", Handle = (long) 0, Value = (any) { (long) 0 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } }, { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 20 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefAngle", Handle = (long) 0, Value = (any) { (long) 1 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } } +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 18 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 46 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 47 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 17 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 18 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 48 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 49 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 7, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 6, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 36 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 42 }, Type = (short) 1 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 24 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 30 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* bentArrow */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) { { Value = (any) { (long) 25000 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj1" }, { Value = (any) { (long) 25000 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj2" }, { Value = (any) { (long) 25000 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj3" }, { Value = (any) { (long) 43750 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj4" } } +Equations +([]string) { "if(0-$1 ,0,if(50000-$1 ,$1 ,50000))", "?0 *2/1", "if(0-$0 ,0,if(?1 -$0 ,$0 ,?1 ))", "if(0-$2 ,0,if(50000-$2 ,$2 ,50000))", "min(logwidth,logheight)", "?4 *?2 /100000", "?4 *?0 /100000", "?5 *1/2", "?6 +0-?7 ", "?4 *?3 /100000", "logwidth+0-?9 ", "logheight+0-?8 ", "min(?10 ,?11 )", "100000*?12 /?4 ", "if(0-$3 ,0,if(?13 -$3 ,$3 ,?13 ))", "?4 *?14 /100000", "?15 +0-?5 ", "max(?16 ,0)", "?5 +?17 -0", "logwidth+0-?9 ", "?8 +?5 -0", "?20 +?8 -0", "?8 +?15 -0", "?20 +?17 -0", "logheight", "logwidth", "(10800000)/60000.0", "(5400000)/60000.0", "(16200000)/60000.0", "(-5400000)/60000.0" } +Handles +([][]com.sun.star.beans.PropertyValue) { { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 24 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 1 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefX", Handle = (long) 0, Value = (any) { (long) 0 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } }, { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 25 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 21 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 50000 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefY", Handle = (long) 0, Value = (any) { (long) 1 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } }, { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 50000 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefX", Handle = (long) 0, Value = (any) { (long) 2 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } }, { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefX", Handle = (long) 0, Value = (any) { (long) 3 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } } +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 24 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 22 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 26 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 27 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 25 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 21 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 20 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 18 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 20 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 17 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 17 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 28 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 29 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 24 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 2, Count = (short) 6 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 25 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 24 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* bentConnector2 */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) {} +Equations +([]string) { "logwidth", "logheight" } +Handles +([][]com.sun.star.beans.PropertyValue) {} +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 2 }, { Command = (short) 6, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* bentConnector3 */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) { { Value = (any) { (long) 50000 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj1" } } +Equations +([]string) { "logwidth*$0 /100000", "logheight/2", "logwidth", "logheight" } +Handles +([][]com.sun.star.beans.PropertyValue) { { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) -2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefX", Handle = (long) 0, Value = (any) { (long) 0 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } } +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 3 }, { Command = (short) 6, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* bentConnector4 */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) { { Value = (any) { (long) 50000 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj1" }, { Value = (any) { (long) 50000 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj2" } } +Equations +([]string) { "logwidth*$0 /100000", "(?0 +logwidth)/2", "logheight*$1 /100000", "(0+?2 )/2", "logwidth", "logheight" } +Handles +([][]com.sun.star.beans.PropertyValue) { { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) -2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefX", Handle = (long) 0, Value = (any) { (long) 0 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } }, { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) -2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefY", Handle = (long) 0, Value = (any) { (long) 1 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } } +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 4 }, { Command = (short) 6, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* bentConnector5 */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) { { Value = (any) { (long) 50000 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj1" }, { Value = (any) { (long) 50000 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj2" }, { Value = (any) { (long) 50000 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj3" } } +Equations +([]string) { "logwidth*$0 /100000", "logwidth*$2 /100000", "(?0 +?1 )/2", "logheight*$1 /100000", "(0+?3 )/2", "(logheight+?3 )/2", "logwidth", "logheight" } +Handles +([][]com.sun.star.beans.PropertyValue) { { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) -2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefX", Handle = (long) 0, Value = (any) { (long) 0 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } }, { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) -2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefY", Handle = (long) 0, Value = (any) { (long) 1 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } }, { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) -2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefX", Handle = (long) 0, Value = (any) { (long) 2 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } } +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 5 }, { Command = (short) 6, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* bentUpArrow */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) { { Value = (any) { (long) 25000 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj1" }, { Value = (any) { (long) 25000 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj2" }, { Value = (any) { (long) 25000 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj3" } } +Equations +([]string) { "if(0-$0 ,0,if(50000-$0 ,$0 ,50000))", "if(0-$1 ,0,if(50000-$1 ,$1 ,50000))", "if(0-$2 ,0,if(50000-$2 ,$2 ,50000))", "min(logwidth,logheight)", "?3 *?2 /100000", "?3 *?1 /50000", "logwidth+0-?5 ", "?3 *?1 /100000", "logwidth+0-?7 ", "?3 *?0 /200000", "?8 +0-?9 ", "?8 +?9 -0", "?3 *?0 /100000", "logheight+0-?12 ", "?11 *1/2", "(?13 +logheight)/2", "(?4 +logheight)/2", "logheight", "logwidth" } +Handles +([][]com.sun.star.beans.PropertyValue) { { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 50000 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefY", Handle = (long) 0, Value = (any) { (long) 0 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } }, { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 50000 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefX", Handle = (long) 0, Value = (any) { (long) 1 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } }, { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 50000 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefY", Handle = (long) 0, Value = (any) { (long) 2 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } } +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 18 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 17 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 17 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 8 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 17 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* bevel */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) { { Value = (any) { (long) 12500 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj" } } +Equations +([]string) { "if(0-$0 ,0,if(50000-$0 ,$0 ,50000))", "min(logwidth,logheight)", "?1 *?0 /100000", "logwidth+0-?2 ", "logheight+0-?2 ", "logwidth", "logheight/2", "logwidth/2", "logheight" } +Handles +([][]com.sun.star.beans.PropertyValue) { { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 50000 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefX", Handle = (long) 0, Value = (any) { (long) 0 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } } +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 3 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 7, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 3 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 21, Count = (short) 0 }, { Command = (short) 7, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 3 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 19, Count = (short) 0 }, { Command = (short) 7, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 3 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 20, Count = (short) 0 }, { Command = (short) 7, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 3 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 18, Count = (short) 0 }, { Command = (short) 7, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 3 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 3 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 6, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* blockArc */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) { { Value = (any) { (long) 10800000 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj1" }, { Value = (any) { (long) 0 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj2" }, { Value = (any) { (long) 25000 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj3" } } +Equations +([]string) { "if(0-$0 ,0,if(21599999-$0 ,$0 ,21599999))", "if(0-$1 ,0,if(21599999-$1 ,$1 ,21599999))", "if(0-$2 ,0,if(50000-$2 ,$2 ,50000))", "?1 +0-?0 ", "?3 +21600000-0", "if(?3 ,?3 ,?4 )", "0+0-?5 ", "logwidth/2", "?7 *sin(pi*(?0 )/10800000)", "logheight/2", "?9 *cos(pi*(?0 )/10800000)", "?7 *sin(pi*(?1 )/10800000)", "?9 *cos(pi*(?1 )/10800000)", "?7 *(cos(atan2(?8 ,?10 )))", "?9 *(sin(atan2(?8 ,?10 )))", "?7 *(cos(atan2(?11 ,?12 )))", "?9 *(sin(atan2(?11 ,?12 )))", "logwidth/2", "?17 +?13 -0", "logheight/2", "?19 +?14 -0", "?17 +?15 -0", "?19 +?16 -0", "min(logwidth,logheight)", "?23 *?2 /100000", "?7 +0-?24 ", "?9 +0-?24 ", "?25 *sin(pi*(?1 )/10800000)", "?26 *cos(pi*(?1 )/10800000)", "?25 *sin(pi*(?0 )/10800000)", "?26 *cos(pi*(?0 )/10800000)", "?25 *(cos(atan2(?27 ,?28 )))", "?26 *(sin(atan2(?27 ,?28 )))", "?25 *(cos(atan2(?29 ,?30 )))", "?26 *(sin(atan2(?29 ,?30 )))", "?17 +?31 -0", "?19 +?32 -0", "?17 +?33 -0", "?19 +?34 -0", "21600000+0-?0 ", "?5 +0-?39 ", "max(?18 ,?35 )", "max(?21 ,?37 )", "max(?41 ,?42 )", "if(?40 ,logwidth,?43 )", "5400000+0-?0 ", "27000000+0-?0 ", "if(?45 ,?45 ,?46 )", "?5 +0-?47 ", "max(?20 ,?36 )", "max(?22 ,?38 )", "max(?49 ,?50 )", "if(?48 ,logheight,?51 )", "10800000+0-?0 ", "32400000+0-?0 ", "if(?53 ,?53 ,?54 )", "?5 +0-?55 ", "min(?18 ,?35 )", "min(?21 ,?37 )", "min(?57 ,?58 )", "if(?56 ,0,?59 )", "16200000+0-?0 ", "37800000+0-?0 ", "if(?61 ,?61 ,?62 )", "?5 +0-?63 ", "min(?20 ,?36 )", "min(?22 ,?38 )", "min(?65 ,?66 )", "if(?64 ,0,?67 )", "(?18 +?37 )/2", "(?20 +?38 )/2", "(?21 +?35 )/2", "(?22 +?36 )/2", "?0 +0-5400000", "?1 +5400000-0", "(?73 +?74 )/2", "(?0 )/60000.0", "(?5 )/60000.0", "(?1 )/60000.0", "(?6 )/60000.0" } +Handles +([][]com.sun.star.beans.PropertyValue) { { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 18 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 20 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefAngle", Handle = (long) 0, Value = (any) { (long) 0 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } }, { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 35 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 36 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RadiusRangeMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 50000 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RadiusRangeMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefAngle", Handle = (long) 0, Value = (any) { (long) 1 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefR", Handle = (long) 0, Value = (any) { (long) 2 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } } +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 18 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 20 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 76 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 77 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 35 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 36 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 25 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 26 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 78 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 79 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 60 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 68 }, Type = (short) 1 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 44 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 52 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* borderCallout1 */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) { { Value = (any) { (long) 18750 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj1" }, { Value = (any) { (long) -8333 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj2" }, { Value = (any) { (long) 112500 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj3" }, { Value = (any) { (long) -38333 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj4" } } +Equations +([]string) { "logheight*$0 /100000", "logwidth*$1 /100000", "logheight*$2 /100000", "logwidth*$3 /100000", "logwidth", "logheight/2", "logwidth/2", "logheight" } +Handles +([][]com.sun.star.beans.PropertyValue) { { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) -2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) -2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefX", Handle = (long) 0, Value = (any) { (long) 1 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefY", Handle = (long) 0, Value = (any) { (long) 0 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } }, { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) -2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) -2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefX", Handle = (long) 0, Value = (any) { (long) 3 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefY", Handle = (long) 0, Value = (any) { (long) 2 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } } +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 3 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 6, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* borderCallout2 */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) { { Value = (any) { (long) 18750 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj1" }, { Value = (any) { (long) -8333 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj2" }, { Value = (any) { (long) 18750 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj3" }, { Value = (any) { (long) -16667 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj4" }, { Value = (any) { (long) 112500 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj5" }, { Value = (any) { (long) -46667 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj6" } } +Equations +([]string) { "logheight*$0 /100000", "logwidth*$1 /100000", "logheight*$2 /100000", "logwidth*$3 /100000", "logheight*$4 /100000", "logwidth*$5 /100000", "logwidth", "logheight/2", "logwidth/2", "logheight" } +Handles +([][]com.sun.star.beans.PropertyValue) { { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) -2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) -2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefX", Handle = (long) 0, Value = (any) { (long) 1 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefY", Handle = (long) 0, Value = (any) { (long) 0 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } }, { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) -2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) -2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefX", Handle = (long) 0, Value = (any) { (long) 3 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefY", Handle = (long) 0, Value = (any) { (long) 2 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } }, { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) -2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) -2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefX", Handle = (long) 0, Value = (any) { (long) 5 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefY", Handle = (long) 0, Value = (any) { (long) 4 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } } +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 3 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 2 }, { Command = (short) 6, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* borderCallout3 */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) { { Value = (any) { (long) 18750 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj1" }, { Value = (any) { (long) -8333 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj2" }, { Value = (any) { (long) 18750 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj3" }, { Value = (any) { (long) -16667 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj4" }, { Value = (any) { (long) 100000 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj5" }, { Value = (any) { (long) -16667 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj6" }, { Value = (any) { (long) 112963 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj7" }, { Value = (any) { (long) -8333 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj8" } } +Equations +([]string) { "logheight*$0 /100000", "logwidth*$1 /100000", "logheight*$2 /100000", "logwidth*$3 /100000", "logheight*$4 /100000", "logwidth*$5 /100000", "logheight*$6 /100000", "logwidth*$7 /100000", "logwidth", "logheight/2", "logwidth/2", "logheight" } +Handles +([][]com.sun.star.beans.PropertyValue) { { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) -2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) -2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefX", Handle = (long) 0, Value = (any) { (long) 1 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefY", Handle = (long) 0, Value = (any) { (long) 0 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } }, { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) -2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) -2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefX", Handle = (long) 0, Value = (any) { (long) 3 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefY", Handle = (long) 0, Value = (any) { (long) 2 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } }, { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) -2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) -2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefX", Handle = (long) 0, Value = (any) { (long) 5 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefY", Handle = (long) 0, Value = (any) { (long) 4 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } }, { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) -2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) -2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefX", Handle = (long) 0, Value = (any) { (long) 7 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefY", Handle = (long) 0, Value = (any) { (long) 6 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } } +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 3 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 3 }, { Command = (short) 6, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* bracePair */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) { { Value = (any) { (long) 8333 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj" } } +Equations +([]string) { "if(0-$0 ,0,if(25000-$0 ,$0 ,25000))", "min(logwidth,logheight)", "?1 *?0 /100000", "?1 *?0 /50000", "logwidth+0-?3 ", "logwidth+0-?2 ", "logheight/2", "?6 +0-?2 ", "?6 +?2 -0", "logheight+0-?2 ", "?2 *29289/100000", "?2 +?10 -0", "logwidth+0-?11 ", "logheight+0-?10 ", "logwidth/2", "logheight", "logwidth", "(5400000)/60000.0", "(5400000)/60000.0", "(0)/60000.0", "(-5400000)/60000.0", "(5400000)/60000.0", "(-5400000)/60000.0", "(10800000)/60000.0", "(5400000)/60000.0", "(16200000)/60000.0", "(5400000)/60000.0", "(10800000)/60000.0", "(-5400000)/60000.0", "(16200000)/60000.0", "(-5400000)/60000.0", "(0)/60000.0", "(5400000)/60000.0", "(5400000)/60000.0", "(5400000)/60000.0", "(0)/60000.0", "(-5400000)/60000.0", "(5400000)/60000.0", "(-5400000)/60000.0", "(10800000)/60000.0", "(5400000)/60000.0", "(16200000)/60000.0", "(5400000)/60000.0", "(10800000)/60000.0", "(-5400000)/60000.0", "(16200000)/60000.0", "(-5400000)/60000.0", "(0)/60000.0", "(5400000)/60000.0" } +Handles +([][]com.sun.star.beans.PropertyValue) { { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 25000 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefY", Handle = (long) 0, Value = (any) { (long) 0 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } } +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 17 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 18 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 20 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 21 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 22 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 23 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 24 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 25 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 26 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 27 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 28 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 29 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 30 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 31 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 32 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 33 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 34 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 35 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 36 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 37 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 38 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 39 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 40 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 41 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 42 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 43 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 44 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 45 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 46 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 47 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 48 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 17, Count = (short) 2 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 17, Count = (short) 2 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 7, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 17, Count = (short) 2 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 17, Count = (short) 2 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 6, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* bracketPair */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) { { Value = (any) { (long) 16667 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj" } } +Equations +([]string) { "if(0-$0 ,0,if(50000-$0 ,$0 ,50000))", "min(logwidth,logheight)", "?1 *?0 /100000", "logwidth+0-?2 ", "logheight+0-?2 ", "?2 *29289/100000", "logwidth+0-?5 ", "logheight+0-?5 ", "logwidth/2", "logheight/2", "logheight", "logwidth", "(10800000)/60000.0", "(5400000)/60000.0", "(16200000)/60000.0", "(5400000)/60000.0", "(0)/60000.0", "(5400000)/60000.0", "(5400000)/60000.0", "(5400000)/60000.0", "(5400000)/60000.0", "(5400000)/60000.0", "(10800000)/60000.0", "(5400000)/60000.0", "(16200000)/60000.0", "(5400000)/60000.0", "(0)/60000.0", "(5400000)/60000.0" } +Handles +([][]com.sun.star.beans.PropertyValue) { { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 50000 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefY", Handle = (long) 0, Value = (any) { (long) 0 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } } +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 17 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 18 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 20 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 21 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 22 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 23 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 24 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 25 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 26 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 27 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 7, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 6, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* callout1 */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) { { Value = (any) { (long) 18750 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj1" }, { Value = (any) { (long) -8333 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj2" }, { Value = (any) { (long) 112500 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj3" }, { Value = (any) { (long) -38333 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj4" } } +Equations +([]string) { "logheight*$0 /100000", "logwidth*$1 /100000", "logheight*$2 /100000", "logwidth*$3 /100000", "logwidth", "logheight/2", "logwidth/2", "logheight" } +Handles +([][]com.sun.star.beans.PropertyValue) { { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) -2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) -2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefX", Handle = (long) 0, Value = (any) { (long) 1 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefY", Handle = (long) 0, Value = (any) { (long) 0 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } }, { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) -2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) -2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefX", Handle = (long) 0, Value = (any) { (long) 3 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefY", Handle = (long) 0, Value = (any) { (long) 2 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } } +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 3 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 7, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 6, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* callout2 */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) { { Value = (any) { (long) 18750 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj1" }, { Value = (any) { (long) -8333 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj2" }, { Value = (any) { (long) 18750 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj3" }, { Value = (any) { (long) -16667 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj4" }, { Value = (any) { (long) 112500 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj5" }, { Value = (any) { (long) -46667 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj6" } } +Equations +([]string) { "logheight*$0 /100000", "logwidth*$1 /100000", "logheight*$2 /100000", "logwidth*$3 /100000", "logheight*$4 /100000", "logwidth*$5 /100000", "logwidth", "logheight/2", "logwidth/2", "logheight" } +Handles +([][]com.sun.star.beans.PropertyValue) { { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) -2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) -2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefX", Handle = (long) 0, Value = (any) { (long) 1 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefY", Handle = (long) 0, Value = (any) { (long) 0 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } }, { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) -2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) -2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefX", Handle = (long) 0, Value = (any) { (long) 3 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefY", Handle = (long) 0, Value = (any) { (long) 2 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } }, { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) -2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) -2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefX", Handle = (long) 0, Value = (any) { (long) 5 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefY", Handle = (long) 0, Value = (any) { (long) 4 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } } +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 3 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 7, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 2 }, { Command = (short) 6, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* callout3 */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) { { Value = (any) { (long) 18750 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj1" }, { Value = (any) { (long) -8333 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj2" }, { Value = (any) { (long) 18750 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj3" }, { Value = (any) { (long) -16667 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj4" }, { Value = (any) { (long) 100000 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj5" }, { Value = (any) { (long) -16667 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj6" }, { Value = (any) { (long) 112963 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj7" }, { Value = (any) { (long) -8333 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj8" } } +Equations +([]string) { "logheight*$0 /100000", "logwidth*$1 /100000", "logheight*$2 /100000", "logwidth*$3 /100000", "logheight*$4 /100000", "logwidth*$5 /100000", "logheight*$6 /100000", "logwidth*$7 /100000", "logwidth", "logheight/2", "logwidth/2", "logheight" } +Handles +([][]com.sun.star.beans.PropertyValue) { { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) -2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) -2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefX", Handle = (long) 0, Value = (any) { (long) 1 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefY", Handle = (long) 0, Value = (any) { (long) 0 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } }, { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) -2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) -2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefX", Handle = (long) 0, Value = (any) { (long) 3 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefY", Handle = (long) 0, Value = (any) { (long) 2 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } }, { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) -2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) -2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefX", Handle = (long) 0, Value = (any) { (long) 5 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefY", Handle = (long) 0, Value = (any) { (long) 4 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } }, { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) -2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) -2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefX", Handle = (long) 0, Value = (any) { (long) 7 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefY", Handle = (long) 0, Value = (any) { (long) 6 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } } +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 3 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 7, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 3 }, { Command = (short) 6, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* can */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) { { Value = (any) { (long) 25000 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj" } } +Equations +([]string) { "min(logwidth,logheight)", "50000*logheight/?0 ", "if(0-$0 ,0,if(?1 -$0 ,$0 ,?1 ))", "?0 *?2 /200000", "?3 +?3 -0", "logheight+0-?3 ", "logwidth/2", "logheight/2", "logheight", "logwidth", "logwidth/2", "(10800000)/60000.0", "(-10800000)/60000.0", "(0)/60000.0", "(10800000)/60000.0", "(10800000)/60000.0", "(10800000)/60000.0", "(0)/60000.0", "(10800000)/60000.0", "(0)/60000.0", "(10800000)/60000.0", "(10800000)/60000.0", "(10800000)/60000.0", "(0)/60000.0", "(10800000)/60000.0" } +Handles +([][]com.sun.star.beans.PropertyValue) { { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 1 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefY", Handle = (long) 0, Value = (any) { (long) 0 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } } +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 17 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 18 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 20 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 21 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 22 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 23 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 24 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 7, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 17, Count = (short) 2 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 20, Count = (short) 0 }, { Command = (short) 7, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 17, Count = (short) 2 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 6, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* chartPlus */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) {} +Equations +([]string) {} +Handles +([][]com.sun.star.beans.PropertyValue) {} +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 6, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 3 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 7, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "SubViewSize", Handle = (long) 0, Value = (any) { ([]com.sun.star.awt.Size) { { Width = (long) 10, Height = (long) 10 }, { Width = (long) 10, Height = (long) 10 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 400000, Height = (long) 400000 } +/* chartStar */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) {} +Equations +([]string) {} +Handles +([][]com.sun.star.beans.PropertyValue) {} +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 6, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 3 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 7, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "SubViewSize", Handle = (long) 0, Value = (any) { ([]com.sun.star.awt.Size) { { Width = (long) 10, Height = (long) 10 }, { Width = (long) 10, Height = (long) 10 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 400000, Height = (long) 400000 } +/* chartX */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) {} +Equations +([]string) {} +Handles +([][]com.sun.star.beans.PropertyValue) {} +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 6, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 3 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 7, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "SubViewSize", Handle = (long) 0, Value = (any) { ([]com.sun.star.awt.Size) { { Width = (long) 10, Height = (long) 10 }, { Width = (long) 10, Height = (long) 10 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 400000, Height = (long) 400000 } +/* chevron */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) { { Value = (any) { (long) 50000 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj" } } +Equations +([]string) { "min(logwidth,logheight)", "100000*logwidth/?0 ", "if(0-$0 ,0,if(?1 -$0 ,$0 ,?1 ))", "?0 *?2 /100000", "logwidth+0-?3 ", "?4 *1/2", "?4 +0-?3 ", "if(?6 ,?3 ,0)", "if(?6 ,?4 ,logwidth)", "logheight/2", "logheight", "logwidth" } +Handles +([][]com.sun.star.beans.PropertyValue) { { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 1 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefX", Handle = (long) 0, Value = (any) { (long) 0 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } } +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 5 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* chord */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) { { Value = (any) { (long) 2700000 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj1" }, { Value = (any) { (long) 16200000 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj2" } } +Equations +([]string) { "if(0-$0 ,0,if(21599999-$0 ,$0 ,21599999))", "if(0-$1 ,0,if(21599999-$1 ,$1 ,21599999))", "?1 +0-?0 ", "?2 +21600000-0", "if(?2 ,?2 ,?3 )", "logwidth/2", "?5 *sin(pi*(?0 )/10800000)", "logheight/2", "?7 *cos(pi*(?0 )/10800000)", "?5 *(cos(atan2(?6 ,?8 )))", "?7 *(sin(atan2(?6 ,?8 )))", "?5 *sin(pi*(?1 )/10800000)", "?7 *cos(pi*(?1 )/10800000)", "?5 *(cos(atan2(?11 ,?12 )))", "?7 *(sin(atan2(?11 ,?12 )))", "logwidth/2", "?15 +?9 -0", "logheight/2", "?17 +?10 -0", "?15 +?13 -0", "?17 +?14 -0", "(?16 +?19 )/2", "(?18 +?20 )/2", "?4 *1/2", "?0 +?23 -10800000", "?5 *cos(pi*(2700000)/10800000)", "?7 *sin(pi*(2700000)/10800000)", "?15 +0-?25 ", "?15 +?25 -0", "?17 +0-?26 ", "?17 +?26 -0", "(?0 )/60000.0", "(?4 )/60000.0" } +Handles +([][]com.sun.star.beans.PropertyValue) { { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 18 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefAngle", Handle = (long) 0, Value = (any) { (long) 0 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } }, { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 20 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefAngle", Handle = (long) 0, Value = (any) { (long) 1 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } } +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 18 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 31 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 32 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 27 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 29 }, Type = (short) 1 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 28 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 30 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* circularArrow */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) { { Value = (any) { (long) 12500 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj1" }, { Value = (any) { (long) 1142319 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj2" }, { Value = (any) { (long) 20457681 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj3" }, { Value = (any) { (long) 10800000 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj4" }, { Value = (any) { (long) 12500 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj5" } } +Equations +([]string) { "if(0-$4 ,0,if(25000-$4 ,$4 ,25000))", "?0 *2/1", "if(0-$0 ,0,if(?1 -$0 ,$0 ,?1 ))", "if(1-$2 ,1,if(21599999-$2 ,$2 ,21599999))", "if(0-$3 ,0,if(21599999-$3 ,$3 ,21599999))", "min(logwidth,logheight)", "?5 *?2 /100000", "?5 *?0 /100000", "?6 *1/2", "logwidth/2", "?9 +?8 -?7 ", "logheight/2", "?11 +?8 -?7 ", "?10 +0-?6 ", "?12 +0-?6 ", "?13 +?8 -0", "?14 +?8 -0", "?15 *sin(pi*(?3 )/10800000)", "?16 *cos(pi*(?3 )/10800000)", "?15 *(cos(atan2(?17 ,?18 )))", "?16 *(sin(atan2(?17 ,?18 )))", "logwidth/2", "?21 +?19 -0", "logheight/2", "?23 +?20 -0", "min(?13 ,?14 )", "?19 *?19 /1", "?20 *?20 /1", "?25 *?25 /1", "?26 +0-?28 ", "?27 +0-?28 ", "?29 *?30 /?26 ", "?31 *1/?27 ", "1+0-?32 ", "sqrt(?33 )", "?29 *1/?19 ", "?35 *1/?20 ", "(1+?34 )/?36 ", "(10800000*atan2(?37 ,1))/pi", "?38 +21600000-0", "if(?38 ,?38 ,?39 )", "?40 +0-?3 ", "?41 +21600000-0", "if(?41 ,?41 ,?42 )", "?43 +0-10800000", "?43 +0-21600000", "if(?44 ,?45 ,?43 )", "abs(?46 )", "if(0-$1 ,0,if(?47 -$1 ,$1 ,?47 ))", "?3 +?48 -0", "?15 *sin(pi*(?49 )/10800000)", "?16 *cos(pi*(?49 )/10800000)", "?15 *(cos(atan2(?50 ,?51 )))", "?16 *(sin(atan2(?50 ,?51 )))", "?21 +?52 -0", "?23 +?53 -0", "?10 *sin(pi*(?4 )/10800000)", "?12 *cos(pi*(?4 )/10800000)", "?10 *(cos(atan2(?56 ,?57 )))", "?12 *(sin(atan2(?56 ,?57 )))", "?21 +?58 -0", "?23 +?59 -0", "?7 *cos(pi*(?49 )/10800000)", "?7 *sin(pi*(?49 )/10800000)", "?22 +?62 -0", "?24 +?63 -0", "?7 *cos(pi*(?49 )/10800000)", "?7 *sin(pi*(?49 )/10800000)", "?22 +0-?66 ", "?24 +0-?67 ", "?68 +0-?21 ", "?69 +0-?23 ", "?64 +0-?21 ", "?65 +0-?23 ", "min(?10 ,?12 )", "?70 *?74 /?10 ", "?71 *?74 /?12 ", "?72 *?74 /?10 ", "?73 *?74 /?12 ", "?77 +0-?75 ", "?78 +0-?76 ", "sqrt(?79 *?79 +?80 *?80 +0*0)", "?75 *?78 /1", "?77 *?76 /1", "?82 +0-?83 ", "?74 *?74 /1", "?81 *?81 /1", "?85 *?86 /1", "?84 *?84 /1", "?87 +0-?88 ", "max(?89 ,0)", "sqrt(?90 )", "?80 *-1/1", "if(?92 ,-1,1)", "?93 *?79 /1", "?94 *?91 /1", "?84 *?80 /1", "(?96 +?95 )/?86 ", "?96 +0-?95 ", "?98 *1/?86 ", "abs(?80 )", "?100 *?91 /1", "?84 *?79 /-1", "(?102 +?101 )/?86 ", "?102 +0-?101 ", "?104 *1/?86 ", "?77 +0-?97 ", "?77 +0-?99 ", "?78 +0-?103 ", "?78 +0-?105 ", "sqrt(?106 *?106 +?108 *?108 +0*0)", "sqrt(?107 *?107 +?109 *?109 +0*0)", "?111 +0-?110 ", "if(?112 ,?97 ,?99 )", "if(?112 ,?103 ,?105 )", "?113 *?10 /?74 ", "?114 *?12 /?74 ", "?21 +?115 -0", "?23 +?116 -0", "?70 *?25 /?13 ", "?71 *?25 /?14 ", "?72 *?25 /?13 ", "?73 *?25 /?14 ", "?121 +0-?119 ", "?122 +0-?120 ", "sqrt(?123 *?123 +?124 *?124 +0*0)", "?119 *?122 /1", "?121 *?120 /1", "?126 +0-?127 ", "?25 *?25 /1", "?125 *?125 /1", "?129 *?130 /1", "?128 *?128 /1", "?131 +0-?132 ", "max(?133 ,0)", "sqrt(?134 )", "?93 *?123 /1", "?136 *?135 /1", "?128 *?124 /1", "(?138 +?137 )/?130 ", "?138 +0-?137 ", "?140 *1/?130 ", "abs(?124 )", "?142 *?135 /1", "?128 *?123 /-1", "(?144 +?143 )/?130 ", "?144 +0-?143 ", "?146 *1/?130 ", "?119 +0-?139 ", "?119 +0-?141 ", "?120 +0-?145 ", "?120 +0-?147 ", "sqrt(?148 *?148 +?150 *?150 +0*0)", "sqrt(?149 *?149 +?151 *?151 +0*0)", "?153 +0-?152 ", "if(?154 ,?139 ,?141 )", "if(?154 ,?145 ,?147 )", "?155 *?13 /?25 ", "?156 *?14 /?25 ", "?21 +?157 -0", "?23 +?158 -0", "(10800000*atan2(?158 ,?157 ))/pi", "?161 +21600000-0", "if(?161 ,?161 ,?162 )", "?4 +0-?163 ", "?164 +0-21600000", "if(?164 ,?165 ,?164 )", "?117 +0-?159 ", "?118 +0-?160 ", "sqrt(?167 *?167 +?168 *?168 +0*0)", "?169 *1/2", "?170 +0-?7 ", "if(?171 ,?117 ,?64 )", "if(?171 ,?118 ,?65 )", "if(?171 ,?159 ,?68 )", "if(?171 ,?160 ,?69 )", "(10800000*atan2(?116 ,?115 ))/pi", "?176 +21600000-0", "if(?176 ,?176 ,?177 )", "?178 +0-?4 ", "?179 +21600000-0", "if(?179 ,?179 ,?180 )", "?15 *sin(pi*(?4 )/10800000)", "?16 *cos(pi*(?4 )/10800000)", "?15 *(cos(atan2(?182 ,?183 )))", "?16 *(sin(atan2(?182 ,?183 )))", "?21 +?184 -0", "?23 +?185 -0", "?4 +0-5400000", "?49 +5400000-0", "?49 +10800000-0", "?10 *cos(pi*(2700000)/10800000)", "?12 *sin(pi*(2700000)/10800000)", "?21 +0-?191 ", "?21 +?191 -0", "?23 +0-?192 ", "?23 +?192 -0", "(?4 )/60000.0", "(?181 )/60000.0", "(?163 )/60000.0", "(?166 )/60000.0" } +Handles +([][]com.sun.star.beans.PropertyValue) { { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 54 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 55 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefAngle", Handle = (long) 0, Value = (any) { (long) 1 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } }, { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 60 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 61 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefAngle", Handle = (long) 0, Value = (any) { (long) 3 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } }, { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 117 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 118 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RadiusRangeMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 1 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RadiusRangeMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefAngle", Handle = (long) 0, Value = (any) { (long) 2 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefR", Handle = (long) 0, Value = (any) { (long) 0 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } }, { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 68 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 69 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RadiusRangeMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 25000 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RadiusRangeMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefR", Handle = (long) 0, Value = (any) { (long) 4 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } } +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 60 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 61 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 197 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 198 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 172 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 173 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 54 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 55 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 174 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 175 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 159 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 160 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 199 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 200 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 2, Count = (short) 4 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 193 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 195 }, Type = (short) 1 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 194 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 196 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* cloud */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) {} +Equations +([]string) { "logwidth*2977/21600", "logheight*3262/21600", "logwidth*17087/21600", "logheight*17337/21600", "logwidth*67/21600", "logheight*21577/21600", "logwidth*21582/21600", "logheight*1235/21600", "logheight/2", "logwidth/2", "(-11429249)/60000.0", "(7426832)/60000.0", "(-8646143)/60000.0", "(5396714)/60000.0", "(-8748475)/60000.0", "(5983381)/60000.0", "(-7859164)/60000.0", "(7034504)/60000.0", "(-4722533)/60000.0", "(6541615)/60000.0", "(-2776035)/60000.0", "(7816140)/60000.0", "(37501)/60000.0", "(6842000)/60000.0", "(1347096)/60000.0", "(6910353)/60000.0", "(3974558)/60000.0", "(4542661)/60000.0", "(-16496525)/60000.0", "(8804134)/60000.0", "(-14809710)/60000.0", "(9151131)/60000.0", "(5204520)/60000.0", "(1585770)/60000.0", "(4416628)/60000.0", "(686848)/60000.0", "(8257449)/60000.0", "(844866)/60000.0", "(387196)/60000.0", "(959901)/60000.0", "(-4217541)/60000.0", "(4255042)/60000.0", "(1819082)/60000.0", "(1665090)/60000.0", "(-824660)/60000.0", "(891534)/60000.0", "(-8950887)/60000.0", "(1091722)/60000.0", "(-9809656)/60000.0", "(1061181)/60000.0", "(-4002417)/60000.0", "(739161)/60000.0", "(9459261)/60000.0", "(711490)/60000.0" } +Handles +([][]com.sun.star.beans.PropertyValue) {} +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3900 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14370 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6753 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9190 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5333 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7267 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4365 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5945 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4857 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6595 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 17 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5333 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7273 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 18 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6775 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9220 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 20 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 21 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5785 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7867 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 22 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 23 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6752 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9215 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 24 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 25 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7720 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10543 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 26 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 27 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4360 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5918 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 28 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 29 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4345 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5945 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 30 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 31 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4693 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 26177 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4345 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5945 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 32 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 33 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6928 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 34899 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4360 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5918 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 34 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 35 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16478 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 39090 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6752 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9215 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 36 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 37 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 28827 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 34751 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6752 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9215 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 38 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 39 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 34129 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 22954 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5785 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7867 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 40 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 41 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 41798 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15354 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5333 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7273 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 42 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 43 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 38324 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5426 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4857 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6595 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 44 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 45 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 29078 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3952 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4857 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6595 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 46 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 47 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 22141 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4720 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4365 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5945 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 48 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 49 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14000 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5192 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6753 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9190 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 50 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 51 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4127 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15789 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6753 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9190 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 52 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 53 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 17, Count = (short) 11 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 6, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "SubViewSize", Handle = (long) 0, Value = (any) { ([]com.sun.star.awt.Size) { { Width = (long) 43200, Height = (long) 43200 }, { Width = (long) 43200, Height = (long) 43200 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 1 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* cloudCallout */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) { { Value = (any) { (long) -20833 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj1" }, { Value = (any) { (long) 62500 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj2" } } +Equations +([]string) { "logwidth*$0 /100000", "logheight*$1 /100000", "logwidth/2", "?2 +?0 -0", "logheight/2", "?4 +?1 -0", "logheight/2", "?6 *(cos(atan2(?1 ,?0 )))", "logwidth/2", "?8 *(sin(atan2(?1 ,?0 )))", "?8 *(cos(atan2(?9 ,?7 )))", "?6 *(sin(atan2(?9 ,?7 )))", "?2 +?10 -0", "?4 +?11 -0", "?12 +0-?3 ", "?13 +0-?5 ", "sqrt(?14 *?14 +?15 *?15 +0*0)", "min(logwidth,logheight)", "?17 *6600/21600", "?16 +0-?18 ", "?19 *1/3", "?17 *1800/21600", "?20 +?21 -0", "?22 *?14 /?16 ", "?22 *?15 /?16 ", "?23 +?3 -0", "?24 +?5 -0", "?17 *4800/21600", "?20 *2/1", "?27 +?28 -0", "?29 *?14 /?16 ", "?29 *?15 /?16 ", "?30 +?3 -0", "?31 +?5 -0", "?17 *1200/21600", "?17 *600/21600", "?3 +?35 -0", "?25 +?34 -0", "?32 +?21 -0", "logwidth*2977/21600", "logheight*3262/21600", "logwidth*17087/21600", "logheight*17337/21600", "logwidth*67/21600", "logheight*21577/21600", "logwidth*21582/21600", "logheight*1235/21600", "(10800000*atan2(?1 ,?0 ))/pi", "(-11429249)/60000.0", "(7426832)/60000.0", "(-8646143)/60000.0", "(5396714)/60000.0", "(-8748475)/60000.0", "(5983381)/60000.0", "(-7859164)/60000.0", "(7034504)/60000.0", "(-4722533)/60000.0", "(6541615)/60000.0", "(-2776035)/60000.0", "(7816140)/60000.0", "(37501)/60000.0", "(6842000)/60000.0", "(1347096)/60000.0", "(6910353)/60000.0", "(3974558)/60000.0", "(4542661)/60000.0", "(-16496525)/60000.0", "(8804134)/60000.0", "(-14809710)/60000.0", "(9151131)/60000.0", "(0)/60000.0", "(21600000)/60000.0", "(0)/60000.0", "(21600000)/60000.0", "(0)/60000.0", "(21600000)/60000.0", "(5204520)/60000.0", "(1585770)/60000.0", "(4416628)/60000.0", "(686848)/60000.0", "(8257449)/60000.0", "(844866)/60000.0", "(387196)/60000.0", "(959901)/60000.0", "(-4217541)/60000.0", "(4255042)/60000.0", "(1819082)/60000.0", "(1665090)/60000.0", "(-824660)/60000.0", "(891534)/60000.0", "(-8950887)/60000.0", "(1091722)/60000.0", "(-9809656)/60000.0", "(1061181)/60000.0", "(-4002417)/60000.0", "(739161)/60000.0", "(9459261)/60000.0", "(711490)/60000.0" } +Handles +([][]com.sun.star.beans.PropertyValue) { { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) -2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) -2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefX", Handle = (long) 0, Value = (any) { (long) 0 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefY", Handle = (long) 0, Value = (any) { (long) 1 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } } +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3900 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14370 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6753 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9190 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 48 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 49 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5333 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7267 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 50 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 51 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4365 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5945 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 52 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 53 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4857 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6595 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 54 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 55 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5333 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7273 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 56 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 57 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6775 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9220 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 58 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 59 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5785 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7867 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 60 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 61 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6752 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9215 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 62 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 63 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7720 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10543 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 64 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 65 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4360 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5918 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 66 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 67 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4345 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5945 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 68 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 69 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 36 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 35 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 35 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 70 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 71 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 37 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 26 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 34 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 34 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 72 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 73 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 38 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 33 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 21 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 21 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 74 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 75 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4693 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 26177 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4345 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5945 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 76 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 77 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6928 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 34899 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4360 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5918 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 78 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 79 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16478 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 39090 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6752 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9215 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 80 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 81 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 28827 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 34751 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6752 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9215 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 82 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 83 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 34129 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 22954 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5785 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7867 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 84 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 85 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 41798 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15354 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5333 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7273 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 86 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 87 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 38324 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5426 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4857 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6595 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 88 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 89 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 29078 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3952 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4857 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6595 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 90 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 91 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 22141 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4720 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4365 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5945 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 92 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 93 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14000 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5192 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6753 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9190 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 94 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 95 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4127 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15789 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6753 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9190 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 96 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 97 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 17, Count = (short) 11 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 6, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "SubViewSize", Handle = (long) 0, Value = (any) { ([]com.sun.star.awt.Size) { { Width = (long) 43200, Height = (long) 43200 }, { Width = (long) 0, Height = (long) 0 }, { Width = (long) 0, Height = (long) 0 }, { Width = (long) 0, Height = (long) 0 }, { Width = (long) 43200, Height = (long) 43200 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 39 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 40 }, Type = (short) 1 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 41 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 42 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* corner */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) { { Value = (any) { (long) 50000 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj1" }, { Value = (any) { (long) 50000 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj2" } } +Equations +([]string) { "min(logwidth,logheight)", "100000*logheight/?0 ", "100000*logwidth/?0 ", "if(0-$0 ,0,if(?1 -$0 ,$0 ,?1 ))", "if(0-$1 ,0,if(?2 -$1 ,$1 ,?2 ))", "?0 *?4 /100000", "?0 *?3 /100000", "logheight+0-?6 ", "?5 *1/2", "(?7 +logheight)/2", "logwidth+0-logheight", "if(?10 ,?7 ,0)", "if(?10 ,logwidth,?5 )", "logwidth", "logwidth/2", "logheight", "logheight/2" } +Handles +([][]com.sun.star.beans.PropertyValue) { { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 1 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefY", Handle = (long) 0, Value = (any) { (long) 0 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } }, { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefX", Handle = (long) 0, Value = (any) { (long) 1 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } } +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 5 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* cornerTabs */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) {} +Equations +([]string) { "sqrt(logwidth*logwidth+logheight*logheight+0*0)", "1*?0 /20", "0+logheight-?1 ", "0+logwidth-?1 ", "logheight", "logwidth" } +Handles +([][]com.sun.star.beans.PropertyValue) {} +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 2 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 2 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 2 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 2 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 1 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* cube */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) { { Value = (any) { (long) 25000 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj" } } +Equations +([]string) { "if(0-$0 ,0,if(100000-$0 ,$0 ,100000))", "min(logwidth,logheight)", "?1 *?0 /100000", "logheight+0-?2 ", "?3 *1/2", "(?2 +logheight)/2", "logwidth+0-?2 ", "?6 *1/2", "(?2 +logwidth)/2", "logheight", "logwidth" } +Handles +([][]com.sun.star.beans.PropertyValue) { { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 100000 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefY", Handle = (long) 0, Value = (any) { (long) 0 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } } +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 3 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 7, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 3 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 19, Count = (short) 0 }, { Command = (short) 7, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 3 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 21, Count = (short) 0 }, { Command = (short) 7, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 5 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 2 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 6, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* curvedConnector2 */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) {} +Equations +([]string) { "logwidth", "logheight", "logwidth/2", "logheight/2" } +Handles +([][]com.sun.star.beans.PropertyValue) {} +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 3, Count = (short) 1 }, { Command = (short) 6, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* curvedConnector3 */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) { { Value = (any) { (long) 50000 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj1" } } +Equations +([]string) { "logwidth*$0 /100000", "(0+?0 )/2", "(logwidth+?0 )/2", "logheight*3/4", "logheight/2", "logwidth", "logheight", "logheight/4" } +Handles +([][]com.sun.star.beans.PropertyValue) { { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) -2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefX", Handle = (long) 0, Value = (any) { (long) 0 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } } +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 3, Count = (short) 2 }, { Command = (short) 6, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* curvedConnector4 */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) { { Value = (any) { (long) 50000 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj1" }, { Value = (any) { (long) 50000 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj2" } } +Equations +([]string) { "logwidth*$0 /100000", "(0+?0 )/2", "(logwidth+?0 )/2", "(?0 +?2 )/2", "(?2 +logwidth)/2", "logheight*$1 /100000", "(0+?5 )/2", "(0+?6 )/2", "(?6 +?5 )/2", "(logheight+?5 )/2", "logwidth", "logheight" } +Handles +([][]com.sun.star.beans.PropertyValue) { { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) -2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefX", Handle = (long) 0, Value = (any) { (long) 0 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } }, { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) -2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefY", Handle = (long) 0, Value = (any) { (long) 1 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } } +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 3, Count = (short) 3 }, { Command = (short) 6, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* curvedConnector5 */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) { { Value = (any) { (long) 50000 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj1" }, { Value = (any) { (long) 50000 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj2" }, { Value = (any) { (long) 50000 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj3" } } +Equations +([]string) { "logwidth*$0 /100000", "logwidth*$2 /100000", "(?0 +?1 )/2", "(0+?0 )/2", "(?0 +?2 )/2", "(?1 +?2 )/2", "(?1 +logwidth)/2", "logheight*$1 /100000", "(0+?7 )/2", "(0+?8 )/2", "(?8 +?7 )/2", "(logheight+?7 )/2", "(?11 +?7 )/2", "(?11 +logheight)/2", "logwidth", "logheight" } +Handles +([][]com.sun.star.beans.PropertyValue) { { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) -2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefX", Handle = (long) 0, Value = (any) { (long) 0 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } }, { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) -2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefY", Handle = (long) 0, Value = (any) { (long) 1 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } }, { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) -2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefX", Handle = (long) 0, Value = (any) { (long) 2 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } } +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 3, Count = (short) 4 }, { Command = (short) 6, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* curvedDownArrow */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) { { Value = (any) { (long) 25000 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj1" }, { Value = (any) { (long) 50000 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj2" }, { Value = (any) { (long) 25000 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj3" } } +Equations +([]string) { "min(logwidth,logheight)", "50000*logwidth/?0 ", "if(0-$1 ,0,if(?1 -$1 ,$1 ,?1 ))", "if(0-$0 ,0,if(100000-$0 ,$0 ,100000))", "?0 *?3 /100000", "?0 *?2 /100000", "(?4 +?5 )/4", "logwidth/2", "?7 +0-?6 ", "?8 *2/1", "?9 *?9 /1", "?4 *?4 /1", "?10 +0-?11 ", "sqrt(?12 )", "?13 *logheight/?9 ", "100000*?14 /?0 ", "if(0-$2 ,0,if(?15 -$2 ,$2 ,?15 ))", "?0 *$2 /100000", "?8 +?4 -0", "logheight*logheight/1", "?17 *?17 /1", "?19 +0-?20 ", "sqrt(?21 )", "?22 *?8 /logheight", "?8 +?23 -0", "?18 +?23 -0", "?5 +0-?4 ", "?26 *1/2", "?24 +0-?27 ", "?25 +?27 -0", "?5 *1/2", "logwidth+0-?30 ", "logheight+0-?17 ", "(10800000*atan2(?23 ,?17 ))/pi", "0+0-?33 ", "logheight+0-?14 ", "(?8 +?18 )/2", "?4 *1/2", "(10800000*atan2(?37 ,?14 ))/pi", "16200000+?33 -0", "16200000+0-?38 ", "?38 +0-5400000", "5400000+?38 -0", "logheight", "logwidth", "logheight", "(?39 )/60000.0", "(?34 )/60000.0", "(16200000)/60000.0", "(?33 )/60000.0", "(?40 )/60000.0", "(?41 )/60000.0", "(10800000)/60000.0", "(?42 )/60000.0", "(?40 )/60000.0", "(?41 )/60000.0", "(10800000)/60000.0", "(5400000)/60000.0", "(16200000)/60000.0", "(?33 )/60000.0", "(?39 )/60000.0", "(?34 )/60000.0" } +Handles +([][]com.sun.star.beans.PropertyValue) { { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 25 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 32 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 2 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefX", Handle = (long) 0, Value = (any) { (long) 0 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } }, { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 28 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 43 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 1 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefX", Handle = (long) 0, Value = (any) { (long) 1 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } }, { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 44 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 32 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15 }, Type = (short) 1 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefY", Handle = (long) 0, Value = (any) { (long) 2 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } } +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 31 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 43 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 28 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 32 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 24 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 32 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 45 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 46 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 47 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 18 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 45 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 48 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 49 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 29 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 32 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 36 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 35 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 45 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 50 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 51 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 43 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 45 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 52 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 53 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 36 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 35 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 45 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 54 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 55 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 43 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 45 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 56 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 57 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 18 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 45 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 58 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 59 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 29 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 32 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 31 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 43 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 28 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 32 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 24 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 32 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 45 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 60 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 61 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 2 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 7, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 19, Count = (short) 0 }, { Command = (short) 7, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 2, Count = (short) 4 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 6, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 44 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 43 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* curvedLeftArrow */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) { { Value = (any) { (long) 25000 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj1" }, { Value = (any) { (long) 50000 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj2" }, { Value = (any) { (long) 25000 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj3" } } +Equations +([]string) { "min(logwidth,logheight)", "50000*logheight/?0 ", "if(0-$1 ,0,if(?1 -$1 ,$1 ,?1 ))", "if(0-$0 ,0,if(?2 -$0 ,$0 ,?2 ))", "?0 *?3 /100000", "?0 *?2 /100000", "(?4 +?5 )/4", "logheight/2", "?7 +0-?6 ", "?8 *2/1", "?9 *?9 /1", "?4 *?4 /1", "?10 +0-?11 ", "sqrt(?12 )", "?13 *logwidth/?9 ", "100000*?14 /?0 ", "if(0-$2 ,0,if(?15 -$2 ,$2 ,?15 ))", "?0 *?16 /100000", "?8 +?4 -0", "logwidth*logwidth/1", "?17 *?17 /1", "?19 +0-?20 ", "sqrt(?21 )", "?22 *?8 /logwidth", "?8 +?23 -0", "?18 +?23 -0", "?5 +0-?4 ", "?26 *1/2", "?24 +0-?27 ", "?25 +?27 -0", "?5 *1/2", "logheight+0-?30 ", "0+?17 -0", "(10800000*atan2(?23 ,?17 ))/pi", "0+0-?33 ", "0+?14 -0", "(?8 +?18 )/2", "?4 *1/2", "(10800000*atan2(?37 ,?14 ))/pi", "?38 +0-?33 ", "?33 +?38 -0", "0+0-?38 ", "logwidth", "logheight", "logwidth", "(?33 )/60000.0", "(?39 )/60000.0", "(?41 )/60000.0", "(?40 )/60000.0", "(0)/60000.0", "(-5400000)/60000.0", "(16200000)/60000.0", "(5400000)/60000.0", "(0)/60000.0", "(-5400000)/60000.0", "(16200000)/60000.0", "(5400000)/60000.0", "(0)/60000.0", "(?33 )/60000.0", "(?33 )/60000.0", "(?39 )/60000.0" } +Handles +([][]com.sun.star.beans.PropertyValue) { { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 32 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 24 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefY", Handle = (long) 0, Value = (any) { (long) 0 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } }, { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 42 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 28 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 1 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefY", Handle = (long) 0, Value = (any) { (long) 1 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } }, { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 32 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 43 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15 }, Type = (short) 1 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefX", Handle = (long) 0, Value = (any) { (long) 2 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } } +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 31 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 32 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 28 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 32 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 24 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 44 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 45 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 46 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 44 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 47 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 48 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 32 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 29 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 42 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 18 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 44 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 49 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 50 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 44 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 51 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 52 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 42 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 18 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 44 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 53 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 54 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 44 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 55 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 56 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 42 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 18 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 44 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 57 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 58 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 32 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 29 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 31 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 32 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 28 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 32 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 24 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 44 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 59 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 60 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 2 }, { Command = (short) 17, Count = (short) 2 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 7, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 19, Count = (short) 0 }, { Command = (short) 7, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 2, Count = (short) 4 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 6, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 42 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 43 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* curvedRightArrow */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) { { Value = (any) { (long) 25000 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj1" }, { Value = (any) { (long) 50000 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj2" }, { Value = (any) { (long) 25000 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj3" } } +Equations +([]string) { "min(logwidth,logheight)", "50000*logheight/?0 ", "if(0-$1 ,0,if(?1 -$1 ,$1 ,?1 ))", "if(0-$0 ,0,if(?2 -$0 ,$0 ,?2 ))", "?0 *?3 /100000", "?0 *?2 /100000", "(?4 +?5 )/4", "logheight/2", "?7 +0-?6 ", "?8 *2/1", "?9 *?9 /1", "?4 *?4 /1", "?10 +0-?11 ", "sqrt(?12 )", "?13 *logwidth/?9 ", "100000*?14 /?0 ", "if(0-$2 ,0,if(?15 -$2 ,$2 ,?15 ))", "?0 *?16 /100000", "?8 +?4 -0", "logwidth*logwidth/1", "?17 *?17 /1", "?19 +0-?20 ", "sqrt(?21 )", "?22 *?8 /logwidth", "?8 +?23 -0", "?18 +?23 -0", "?5 +0-?4 ", "?26 *1/2", "?24 +0-?27 ", "?25 +?27 -0", "?5 *1/2", "logheight+0-?30 ", "logwidth+0-?17 ", "(10800000*atan2(?23 ,?17 ))/pi", "10800000+0-?33 ", "0+0-?33 ", "logwidth+0-?14 ", "(?8 +?18 )/2", "?4 *1/2", "(10800000*atan2(?38 ,?14 ))/pi", "?39 +0-5400000", "5400000+?39 -0", "10800000+0-?39 ", "logwidth", "logheight", "logwidth", "(10800000)/60000.0", "(?35 )/60000.0", "(?34 )/60000.0", "(?33 )/60000.0", "(16200000)/60000.0", "(?40 )/60000.0", "(?42 )/60000.0", "(?41 )/60000.0", "(10800000)/60000.0", "(?35 )/60000.0", "(?34 )/60000.0", "(?33 )/60000.0", "(10800000)/60000.0", "(5400000)/60000.0", "(16200000)/60000.0", "(?40 )/60000.0" } +Handles +([][]com.sun.star.beans.PropertyValue) { { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 32 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 24 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefY", Handle = (long) 0, Value = (any) { (long) 0 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } }, { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 43 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 28 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 1 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefY", Handle = (long) 0, Value = (any) { (long) 1 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } }, { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 32 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 44 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15 }, Type = (short) 1 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefX", Handle = (long) 0, Value = (any) { (long) 2 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } } +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 45 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 46 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 47 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 32 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 28 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 43 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 31 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 32 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 29 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 32 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 25 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 45 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 48 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 49 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 43 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 45 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 50 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 51 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 45 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 52 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 53 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 45 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 54 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 55 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 32 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 28 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 43 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 31 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 32 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 29 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 32 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 25 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 45 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 56 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 57 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 45 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 58 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 59 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 43 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 45 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 60 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 61 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 2, Count = (short) 4 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 7, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 17, Count = (short) 2 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 19, Count = (short) 0 }, { Command = (short) 7, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 2, Count = (short) 4 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 6, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 43 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 44 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* curvedUpArrow */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) { { Value = (any) { (long) 25000 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj1" }, { Value = (any) { (long) 50000 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj2" }, { Value = (any) { (long) 25000 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj3" } } +Equations +([]string) { "min(logwidth,logheight)", "50000*logwidth/?0 ", "if(0-$1 ,0,if(?1 -$1 ,$1 ,?1 ))", "if(0-$0 ,0,if(100000-$0 ,$0 ,100000))", "?0 *?3 /100000", "?0 *?2 /100000", "(?4 +?5 )/4", "logwidth/2", "?7 +0-?6 ", "?8 *2/1", "?9 *?9 /1", "?4 *?4 /1", "?10 +0-?11 ", "sqrt(?12 )", "?13 *logheight/?9 ", "100000*?14 /?0 ", "if(0-$2 ,0,if(?15 -$2 ,$2 ,?15 ))", "?0 *$2 /100000", "?8 +?4 -0", "logheight*logheight/1", "?17 *?17 /1", "?19 +0-?20 ", "sqrt(?21 )", "?22 *?8 /logheight", "?8 +?23 -0", "?18 +?23 -0", "?5 +0-?4 ", "?26 *1/2", "?24 +0-?27 ", "?25 +?27 -0", "?5 *1/2", "logwidth+0-?30 ", "0+?17 -0", "(10800000*atan2(?23 ,?17 ))/pi", "0+0-?33 ", "0+?14 -0", "(?8 +?18 )/2", "?4 *1/2", "(10800000*atan2(?37 ,?14 ))/pi", "?38 +0-?33 ", "0+0-?39 ", "5400000+0-?33 ", "?33 +?38 -0", "5400000+0-?38 ", "logwidth", "logheight", "logheight", "(?41 )/60000.0", "(?42 )/60000.0", "(?43 )/60000.0", "(?39 )/60000.0", "(5400000)/60000.0", "(5400000)/60000.0", "(10800000)/60000.0", "(-5400000)/60000.0", "(?43 )/60000.0", "(?39 )/60000.0", "(?41 )/60000.0", "(?33 )/60000.0", "(5400000)/60000.0", "(5400000)/60000.0", "(10800000)/60000.0", "(-5400000)/60000.0" } +Handles +([][]com.sun.star.beans.PropertyValue) { { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 25 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 32 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefX", Handle = (long) 0, Value = (any) { (long) 0 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } }, { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 28 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 1 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefX", Handle = (long) 0, Value = (any) { (long) 1 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } }, { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 44 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 32 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15 }, Type = (short) 1 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefY", Handle = (long) 0, Value = (any) { (long) 2 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } } +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 31 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 29 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 32 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 25 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 32 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 46 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 47 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 48 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 46 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 49 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 50 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 28 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 32 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 45 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 46 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 51 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 52 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 46 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 53 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 54 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 36 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 35 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 46 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 55 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 56 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 28 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 32 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 31 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 29 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 32 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 25 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 32 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 46 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 57 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 58 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 45 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 46 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 59 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 60 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 46 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 61 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 62 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 2 }, { Command = (short) 17, Count = (short) 2 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 7, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 19, Count = (short) 0 }, { Command = (short) 7, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 2, Count = (short) 4 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 6, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 44 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 45 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* decagon */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) { { Value = (any) { (long) 105146 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "vf" } } +Equations +([]string) { "logheight/2", "?0 *$0 /100000", "logwidth/2", "?2 *cos(pi*(2160000)/10800000)", "?2 *cos(pi*(4320000)/10800000)", "logwidth/2", "?5 +0-?3 ", "?5 +0-?4 ", "?5 +?4 -0", "?5 +?3 -0", "?1 *sin(pi*(4320000)/10800000)", "?1 *sin(pi*(2160000)/10800000)", "logheight/2", "?12 +0-?10 ", "?12 +0-?11 ", "?12 +?11 -0", "?12 +?10 -0", "logwidth" } +Handles +([][]com.sun.star.beans.PropertyValue) {} +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 17 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 9 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* diagStripe */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) { { Value = (any) { (long) 50000 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj" } } +Equations +([]string) { "if(0-$0 ,0,if(100000-$0 ,$0 ,100000))", "logwidth*?0 /100000", "?1 *1/2", "(?1 +logwidth)/2", "logheight*?0 /100000", "?4 *1/2", "(?4 +logheight)/2", "logwidth/2", "logheight/2", "logwidth", "logheight" } +Handles +([][]com.sun.star.beans.PropertyValue) { { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 100000 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefY", Handle = (long) 0, Value = (any) { (long) 0 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } } +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 3 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* diamond */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) {} +Equations +([]string) { "logwidth*3/4", "logheight*3/4", "logwidth/2", "logheight/2", "logheight", "logwidth", "logwidth/4", "logheight/4" } +Handles +([][]com.sun.star.beans.PropertyValue) {} +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "GluePoints", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 3 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* dodecagon */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) {} +Equations +([]string) { "logwidth*2894/21600", "logwidth*7906/21600", "logwidth*13694/21600", "logwidth*18706/21600", "logheight*2894/21600", "logheight*7906/21600", "logheight*13694/21600", "logheight*18706/21600", "logwidth", "logheight" } +Handles +([][]com.sun.star.beans.PropertyValue) {} +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 11 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* donut */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) { { Value = (any) { (long) 25000 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj" } } +Equations +([]string) { "if(0-$0 ,0,if(50000-$0 ,$0 ,50000))", "min(logwidth,logheight)", "?1 *?0 /100000", "logwidth/2", "?3 +0-?2 ", "logheight/2", "?5 +0-?2 ", "?3 *cos(pi*(2700000)/10800000)", "?5 *sin(pi*(2700000)/10800000)", "logwidth/2", "?9 +0-?7 ", "?9 +?7 -0", "logheight/2", "?12 +0-?8 ", "?12 +?8 -0", "logheight", "logwidth", "(10800000)/60000.0", "(5400000)/60000.0", "(16200000)/60000.0", "(5400000)/60000.0", "(0)/60000.0", "(5400000)/60000.0", "(5400000)/60000.0", "(5400000)/60000.0", "(10800000)/60000.0", "(-5400000)/60000.0", "(5400000)/60000.0", "(-5400000)/60000.0", "(0)/60000.0", "(-5400000)/60000.0", "(16200000)/60000.0", "(-5400000)/60000.0" } +Handles +([][]com.sun.star.beans.PropertyValue) { { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RadiusRangeMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 50000 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RadiusRangeMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefR", Handle = (long) 0, Value = (any) { (long) 0 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } } +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 17 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 18 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 20 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 21 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 22 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 23 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 24 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 25 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 26 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 27 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 28 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 29 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 30 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 31 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 32 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 17, Count = (short) 4 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 17, Count = (short) 4 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* doubleWave */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) { { Value = (any) { (long) 6250 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj1" }, { Value = (any) { (long) 0 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj2" } } +Equations +([]string) { "if(0-$0 ,0,if(12500-$0 ,$0 ,12500))", "if(-10000-$1 ,-10000,if(10000-$1 ,$1 ,10000))", "logheight*?0 /100000", "?2 *10/3", "?2 +0-?3 ", "?2 +?3 -0", "logheight+0-?2 ", "?6 +0-?3 ", "?6 +?3 -0", "logwidth*?1 /100000", "logwidth*?1 /50000", "abs(?9 )", "if(?10 ,0,?10 )", "0+0-?12 ", "if(?10 ,?10 ,0)", "logwidth+0-?14 ", "(?12 +?15 )/6", "?13 +?16 -0", "(?12 +?15 )/3", "?13 +?18 -0", "(?13 +?15 )/2", "?20 +?16 -0", "(?21 +?15 )/2", "0+?14 -0", "logwidth+?12 -0", "?23 +?16 -0", "?23 +?18 -0", "(?23 +?24 )/2", "?27 +?16 -0", "(?28 +?24 )/2", "logwidth+0-?11 ", "logwidth/2", "?31 +?9 -0", "max(?13 ,?23 )", "min(?15 ,?24 )", "logheight*?0 /50000", "logheight+0-?35 ", "logheight", "logheight/2" } +Handles +([][]com.sun.star.beans.PropertyValue) { { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12500 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefY", Handle = (long) 0, Value = (any) { (long) 0 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } }, { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 32 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 37 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10000 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) -10000 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefX", Handle = (long) 0, Value = (any) { (long) 1 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } } +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 17 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 20 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 21 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 22 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 24 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 29 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 28 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 27 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 26 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 25 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 23 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 3, Count = (short) 2 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 3, Count = (short) 2 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 33 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 35 }, Type = (short) 1 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 34 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 36 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* downArrow */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) { { Value = (any) { (long) 50000 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj1" }, { Value = (any) { (long) 50000 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj2" } } +Equations +([]string) { "min(logwidth,logheight)", "100000*logheight/?0 ", "if(0-$0 ,0,if(100000-$0 ,$0 ,100000))", "if(0-$1 ,0,if(?1 -$1 ,$1 ,?1 ))", "?0 *?3 /100000", "logheight+0-?4 ", "logwidth*?2 /200000", "logwidth/2", "?7 +0-?6 ", "?7 +?6 -0", "logwidth/2", "?8 *?4 /?10 ", "?5 +?11 -0", "logheight", "logwidth" } +Handles +([][]com.sun.star.beans.PropertyValue) { { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 100000 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefX", Handle = (long) 0, Value = (any) { (long) 0 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } }, { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 1 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefY", Handle = (long) 0, Value = (any) { (long) 1 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } } +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 6 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* downArrowCallout */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) { { Value = (any) { (long) 25000 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj1" }, { Value = (any) { (long) 25000 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj2" }, { Value = (any) { (long) 25000 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj3" }, { Value = (any) { (long) 64977 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj4" } } +Equations +([]string) { "min(logwidth,logheight)", "50000*logwidth/?0 ", "if(0-$1 ,0,if(?1 -$1 ,$1 ,?1 ))", "?2 *2/1", "if(0-$0 ,0,if(?3 -$0 ,$0 ,?3 ))", "100000*logheight/?0 ", "if(0-$2 ,0,if(?5 -$2 ,$2 ,?5 ))", "?6 *?0 /logheight", "100000+0-?7 ", "if(0-$3 ,0,if(?8 -$3 ,$3 ,?8 ))", "?0 *?2 /100000", "?0 *?4 /200000", "logwidth/2", "?12 +0-?10 ", "?12 +0-?11 ", "?12 +?11 -0", "?12 +?10 -0", "?0 *?6 /100000", "logheight+0-?17 ", "logheight*?9 /100000", "?19 *1/2", "logheight", "logwidth" } +Handles +([][]com.sun.star.beans.PropertyValue) { { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 18 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefX", Handle = (long) 0, Value = (any) { (long) 0 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } }, { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 21 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 1 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefX", Handle = (long) 0, Value = (any) { (long) 1 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } }, { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 22 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 18 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefY", Handle = (long) 0, Value = (any) { (long) 2 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } }, { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefY", Handle = (long) 0, Value = (any) { (long) 3 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } } +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 22 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 22 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 18 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 18 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 21 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 18 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 18 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 10 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 22 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* ellipse */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) {} +Equations +([]string) { "logwidth/2", "?0 *cos(pi*(2700000)/10800000)", "logheight/2", "?2 *sin(pi*(2700000)/10800000)", "logwidth/2", "?4 +0-?1 ", "?4 +?1 -0", "logheight/2", "?7 +0-?3 ", "?7 +?3 -0", "logheight", "logwidth", "(10800000)/60000.0", "(5400000)/60000.0", "(16200000)/60000.0", "(5400000)/60000.0", "(0)/60000.0", "(5400000)/60000.0", "(5400000)/60000.0", "(5400000)/60000.0" } +Handles +([][]com.sun.star.beans.PropertyValue) {} +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 17 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 18 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "GluePoints", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 17, Count = (short) 4 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* ellipseRibbon */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) { { Value = (any) { (long) 25000 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj1" }, { Value = (any) { (long) 50000 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj2" }, { Value = (any) { (long) 12500 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj3" } } +Equations +([]string) { "if(0-$0 ,0,if(100000-$0 ,$0 ,100000))", "if(25000-$1 ,25000,if(75000-$1 ,$1 ,75000))", "100000+0-?0 ", "?2 *1/2", "?0 +0-?3 ", "max(0,?4 )", "if(?5 -$2 ,?5 ,if(?0 -$2 ,$2 ,?0 ))", "logwidth*?1 /200000", "logwidth/2", "?8 +0-?7 ", "logwidth/8", "?9 +?10 -0", "logwidth+0-?11 ", "logwidth+0-?9 ", "logwidth+0-?10 ", "logheight*?6 /100000", "4*?15 /logwidth", "?11 *?11 /logwidth", "?11 +0-?17 ", "?16 *?18 /1", "?11 *1/2", "?16 *?20 /1", "logwidth+0-?20 ", "logheight*?0 /100000", "?23 +0-?15 ", "?9 *?9 /logwidth", "?9 +0-?25 ", "?16 *?26 /1", "?27 +?24 -0", "?15 +?24 -?28 ", "?29 +?15 -0", "?30 +?24 -0", "logheight+0-?23 ", "?15 *14/16", "(?33 +?32 )/2", "?27 +?32 -0", "?28 +?32 -0", "?9 *1/2", "?16 *?37 /1", "?38 +?32 -0", "logwidth+0-?37 ", "?31 +?32 -0", "?19 +?24 -0", "?23 +?23 -?42 ", "logheight+0-?15 ", "logheight", "logwidth" } +Handles +([][]com.sun.star.beans.PropertyValue) { { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 23 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 100000 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefY", Handle = (long) 0, Value = (any) { (long) 0 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } }, { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 45 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 75000 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 25000 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefX", Handle = (long) 0, Value = (any) { (long) 1 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } }, { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 44 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 1 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefY", Handle = (long) 0, Value = (any) { (long) 2 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } } +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 20 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 21 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 28 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 31 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 28 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 22 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 21 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 46 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 34 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 46 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 32 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 40 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 39 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 35 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 36 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 41 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 36 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 35 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 37 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 39 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 32 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 34 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 42 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 28 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 31 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 28 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 42 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 43 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 42 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 20 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 21 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 28 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 31 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 28 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 22 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 21 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 46 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 34 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 46 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 32 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 40 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 39 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 35 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 36 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 41 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 36 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 35 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 37 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 39 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 32 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 34 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 35 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 28 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 28 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 35 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 42 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 42 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 16, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 16, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 16, Count = (short) 1 }, { Command = (short) 2, Count = (short) 2 }, { Command = (short) 16, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 16, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 16, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 7, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 2 }, { Command = (short) 16, Count = (short) 1 }, { Command = (short) 2, Count = (short) 2 }, { Command = (short) 16, Count = (short) 1 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 19, Count = (short) 0 }, { Command = (short) 7, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 16, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 16, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 16, Count = (short) 1 }, { Command = (short) 2, Count = (short) 2 }, { Command = (short) 16, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 16, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 16, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 6, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 23 }, Type = (short) 1 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 36 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* ellipseRibbon2 */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) { { Value = (any) { (long) 25000 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj1" }, { Value = (any) { (long) 50000 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj2" }, { Value = (any) { (long) 12500 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj3" } } +Equations +([]string) { "if(0-$0 ,0,if(100000-$0 ,$0 ,100000))", "if(25000-$1 ,25000,if(75000-$1 ,$1 ,75000))", "100000+0-?0 ", "?2 *1/2", "?0 +0-?3 ", "max(0,?4 )", "if(?5 -$2 ,?5 ,if(?0 -$2 ,$2 ,?0 ))", "logwidth*?1 /200000", "logwidth/2", "?8 +0-?7 ", "logwidth/8", "?9 +?10 -0", "logwidth+0-?11 ", "logwidth+0-?9 ", "logwidth+0-?10 ", "logheight*?6 /100000", "4*?15 /logwidth", "?11 *?11 /logwidth", "?11 +0-?17 ", "?16 *?18 /1", "logheight+0-?19 ", "?11 *1/2", "?16 *?21 /1", "logheight+0-?22 ", "logwidth+0-?21 ", "logheight*?0 /100000", "?25 +0-?15 ", "?9 *?9 /logwidth", "?9 +0-?27 ", "?16 *?28 /1", "?29 +?26 -0", "logheight+0-?30 ", "?15 +?26 -?30 ", "?32 +?15 -0", "?33 +?26 -0", "logheight+0-?34 ", "logheight+0-?25 ", "?15 *14/16", "(?37 +?36 )/2", "logheight+0-?38 ", "?29 +?36 -0", "logheight+0-?40 ", "?30 +?36 -0", "logheight+0-?42 ", "?9 *1/2", "?16 *?44 /1", "?45 +?36 -0", "logheight+0-?46 ", "logwidth+0-?44 ", "?34 +?36 -0", "logheight+0-?49 ", "?19 +?26 -0", "logheight+0-?51 ", "?25 +?25 -?51 ", "logheight+0-?53 ", "logheight", "logwidth" } +Handles +([][]com.sun.star.beans.PropertyValue) { { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 36 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 100000 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefY", Handle = (long) 0, Value = (any) { (long) 0 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } }, { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 100000 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 25000 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefX", Handle = (long) 0, Value = (any) { (long) 1 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } }, { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 1 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefY", Handle = (long) 0, Value = (any) { (long) 2 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } } +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 55 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 21 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 23 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 20 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 31 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 35 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 31 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 20 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 24 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 23 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 56 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 55 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 39 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 56 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 25 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 48 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 47 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 41 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 43 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 50 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 43 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 41 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 44 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 47 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 25 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 39 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 52 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 20 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 31 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 35 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 31 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 20 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 52 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 54 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 52 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 55 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 39 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 25 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 44 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 47 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 41 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 43 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 50 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 43 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 41 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 48 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 47 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 56 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 25 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 39 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 56 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 55 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 24 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 23 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 20 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 31 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 35 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 31 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 20 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 21 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 23 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 55 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 31 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 41 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 41 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 31 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 52 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 20 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 20 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 52 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 16, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 16, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 16, Count = (short) 1 }, { Command = (short) 2, Count = (short) 2 }, { Command = (short) 16, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 16, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 16, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 7, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 2 }, { Command = (short) 16, Count = (short) 1 }, { Command = (short) 2, Count = (short) 2 }, { Command = (short) 16, Count = (short) 1 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 19, Count = (short) 0 }, { Command = (short) 7, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 2 }, { Command = (short) 16, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 16, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 16, Count = (short) 1 }, { Command = (short) 2, Count = (short) 2 }, { Command = (short) 16, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 16, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 16, Count = (short) 1 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 6, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 43 }, Type = (short) 1 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 36 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* flowChartAlternateProcess */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) {} +Equations +([]string) { "min(logwidth,logheight)/6", "logwidth+0-?0 ", "logheight+0-?0 ", "?0 *29289/100000", "logwidth+0-?3 ", "logheight+0-?3 ", "logwidth/2", "logheight/2", "logheight", "logwidth", "(10800000)/60000.0", "(5400000)/60000.0", "(16200000)/60000.0", "(5400000)/60000.0", "(0)/60000.0", "(5400000)/60000.0", "(5400000)/60000.0", "(5400000)/60000.0" } +Handles +([][]com.sun.star.beans.PropertyValue) {} +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 17 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* flowChartCollate */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) {} +Equations +([]string) { "logwidth*3/4", "logheight*3/4", "logwidth/2", "logheight/2", "logheight", "logwidth/4", "logheight/4" } +Handles +([][]com.sun.star.beans.PropertyValue) {} +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 0 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 5 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "SubViewSize", Handle = (long) 0, Value = (any) { ([]com.sun.star.awt.Size) { { Width = (long) 2, Height = (long) 2 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* flowChartConnector */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) {} +Equations +([]string) { "logwidth/2", "?0 *cos(pi*(2700000)/10800000)", "logheight/2", "?2 *sin(pi*(2700000)/10800000)", "logwidth/2", "?4 +0-?1 ", "?4 +?1 -0", "logheight/2", "?7 +0-?3 ", "?7 +?3 -0", "logheight", "logwidth", "(10800000)/60000.0", "(5400000)/60000.0", "(16200000)/60000.0", "(5400000)/60000.0", "(0)/60000.0", "(5400000)/60000.0", "(5400000)/60000.0", "(5400000)/60000.0" } +Handles +([][]com.sun.star.beans.PropertyValue) {} +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 17 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 18 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 17, Count = (short) 4 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* flowChartDecision */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) {} +Equations +([]string) { "logwidth*3/4", "logheight*3/4", "logwidth/2", "logheight/2", "logheight", "logwidth", "logwidth/4", "logheight/4" } +Handles +([][]com.sun.star.beans.PropertyValue) {} +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 0 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 3 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "SubViewSize", Handle = (long) 0, Value = (any) { ([]com.sun.star.awt.Size) { { Width = (long) 2, Height = (long) 2 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* flowChartDelay */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) {} +Equations +([]string) { "logwidth/2", "?0 *cos(pi*(2700000)/10800000)", "logheight/2", "?2 *sin(pi*(2700000)/10800000)", "logwidth/2", "?4 +?1 -0", "logheight/2", "?6 +0-?3 ", "?6 +?3 -0", "logheight", "logwidth", "(16200000)/60000.0", "(10800000)/60000.0" } +Handles +([][]com.sun.star.beans.PropertyValue) {} +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* flowChartDisplay */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) {} +Equations +([]string) { "logwidth*5/6", "logwidth/2", "logheight/2", "logheight", "logwidth", "logwidth/6", "(16200000)/60000.0", "(10800000)/60000.0" } +Handles +([][]com.sun.star.beans.PropertyValue) {} +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 0 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 2 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "SubViewSize", Handle = (long) 0, Value = (any) { ([]com.sun.star.awt.Size) { { Width = (long) 6, Height = (long) 6 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* flowChartDocument */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) {} +Equations +([]string) { "logheight*17322/21600", "logheight*20172/21600", "logwidth/2", "logheight/2", "logwidth" } +Handles +([][]com.sun.star.beans.PropertyValue) {} +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 21600 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 21600 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 17322 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10800 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 17322 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10800 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 23922 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 20172 }, Type = (short) 0 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 2 }, { Command = (short) 3, Count = (short) 1 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "SubViewSize", Handle = (long) 0, Value = (any) { ([]com.sun.star.awt.Size) { { Width = (long) 21600, Height = (long) 21600 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* flowChartExtract */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) {} +Equations +([]string) { "logwidth*3/4", "logwidth/2", "logwidth/4", "logheight/2", "logheight" } +Handles +([][]com.sun.star.beans.PropertyValue) {} +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 0 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 2 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "SubViewSize", Handle = (long) 0, Value = (any) { ([]com.sun.star.awt.Size) { { Width = (long) 2, Height = (long) 2 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* flowChartInputOutput */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) {} +Equations +([]string) { "logwidth*2/5", "logwidth*3/5", "logwidth*4/5", "logwidth*9/10", "logwidth/2", "logwidth/10", "logheight/2", "logheight", "logwidth/5" } +Handles +([][]com.sun.star.beans.PropertyValue) {} +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 0 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 3 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "SubViewSize", Handle = (long) 0, Value = (any) { ([]com.sun.star.awt.Size) { { Width = (long) 5, Height = (long) 5 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* flowChartInternalStorage */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) {} +Equations +([]string) { "logwidth/2", "logheight/2", "logheight", "logwidth", "logwidth/8", "logheight/8" } +Handles +([][]com.sun.star.beans.PropertyValue) {} +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 0 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 3 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 7, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 6, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 3 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 6, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "SubViewSize", Handle = (long) 0, Value = (any) { ([]com.sun.star.awt.Size) { { Width = (long) 1, Height = (long) 1 }, { Width = (long) 8, Height = (long) 8 }, { Width = (long) 1, Height = (long) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* flowChartMagneticDisk */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) {} +Equations +([]string) { "logheight*5/6", "logwidth/2", "logheight/3", "logheight/2", "logheight", "logwidth", "(10800000)/60000.0", "(10800000)/60000.0", "(0)/60000.0", "(10800000)/60000.0", "(0)/60000.0", "(10800000)/60000.0", "(10800000)/60000.0", "(10800000)/60000.0", "(0)/60000.0", "(10800000)/60000.0" } +Handles +([][]com.sun.star.beans.PropertyValue) {} +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 7, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 6, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 6, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "SubViewSize", Handle = (long) 0, Value = (any) { ([]com.sun.star.awt.Size) { { Width = (long) 6, Height = (long) 6 }, { Width = (long) 6, Height = (long) 6 }, { Width = (long) 6, Height = (long) 6 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* flowChartMagneticDrum */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) {} +Equations +([]string) { "logwidth*2/3", "logwidth/2", "logheight/2", "logheight", "logwidth", "logwidth/6", "(16200000)/60000.0", "(10800000)/60000.0", "(5400000)/60000.0", "(10800000)/60000.0", "(5400000)/60000.0", "(10800000)/60000.0", "(16200000)/60000.0", "(10800000)/60000.0", "(5400000)/60000.0", "(10800000)/60000.0" } +Handles +([][]com.sun.star.beans.PropertyValue) {} +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 7, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 6, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 6, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "SubViewSize", Handle = (long) 0, Value = (any) { ([]com.sun.star.awt.Size) { { Width = (long) 6, Height = (long) 6 }, { Width = (long) 6, Height = (long) 6 }, { Width = (long) 6, Height = (long) 6 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* flowChartMagneticTape */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) {} +Equations +([]string) { "logwidth/2", "?0 *cos(pi*(2700000)/10800000)", "logheight/2", "?2 *sin(pi*(2700000)/10800000)", "logwidth/2", "?4 +0-?1 ", "?4 +?1 -0", "logheight/2", "?7 +0-?3 ", "?7 +?3 -0", "(10800000*atan2(logheight,logwidth))/pi", "logheight", "logwidth", "(5400000)/60000.0", "(5400000)/60000.0", "(10800000)/60000.0", "(5400000)/60000.0", "(16200000)/60000.0", "(5400000)/60000.0", "(0)/60000.0", "(?10 )/60000.0" } +Handles +([][]com.sun.star.beans.PropertyValue) {} +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 17 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 18 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 20 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 17, Count = (short) 4 }, { Command = (short) 2, Count = (short) 2 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* flowChartManualInput */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) {} +Equations +([]string) { "logwidth/2", "logheight/10", "logheight/2", "logheight", "logwidth", "logheight/5" } +Handles +([][]com.sun.star.beans.PropertyValue) {} +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 0 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 3 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "SubViewSize", Handle = (long) 0, Value = (any) { ([]com.sun.star.awt.Size) { { Width = (long) 5, Height = (long) 5 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* flowChartManualOperation */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) {} +Equations +([]string) { "logwidth*4/5", "logwidth*9/10", "logwidth/2", "logwidth/10", "logheight/2", "logheight", "logwidth/5" } +Handles +([][]com.sun.star.beans.PropertyValue) {} +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 0 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 3 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "SubViewSize", Handle = (long) 0, Value = (any) { ([]com.sun.star.awt.Size) { { Width = (long) 5, Height = (long) 5 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* flowChartMerge */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) {} +Equations +([]string) { "logwidth*3/4", "logwidth/2", "logwidth/4", "logheight/2", "logheight" } +Handles +([][]com.sun.star.beans.PropertyValue) {} +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 0 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 2 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "SubViewSize", Handle = (long) 0, Value = (any) { ([]com.sun.star.awt.Size) { { Width = (long) 2, Height = (long) 2 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* flowChartMultidocument */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) {} +Equations +([]string) { "logheight*3675/21600", "logheight*20782/21600", "logwidth*9298/21600", "logwidth*12286/21600", "logwidth*18595/21600", "logheight/2", "logwidth" } +Handles +([][]com.sun.star.beans.PropertyValue) {} +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 20782 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9298 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 23542 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9298 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 18022 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 18595 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 18022 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 18595 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3675 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3675 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1532 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3675 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1532 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1815 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 20000 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1815 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 20000 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16252 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19298 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16252 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 18595 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16352 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 18595 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16352 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 18595 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3675 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2972 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1815 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2972 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 21600 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 21600 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14392 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 20800 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14392 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 20000 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14467 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 20000 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14467 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 20000 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1815 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3675 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 18595 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3675 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 18595 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 18022 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9298 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 18022 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9298 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 23542 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 20782 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1532 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3675 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1532 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1815 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 20000 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1815 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 20000 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16252 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19298 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16252 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 18595 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16352 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 18595 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16352 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2972 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1815 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2972 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 21600 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 21600 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14392 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 20800 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14392 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 20000 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14467 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 20000 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14467 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 20782 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9298 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 23542 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9298 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 18022 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 18595 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 18022 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 18595 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16352 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 18595 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16352 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19298 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16252 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 20000 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16252 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 20000 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14467 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 20000 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14467 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 20800 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14392 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 21600 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14392 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 21600 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2972 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2972 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1815 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1532 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1815 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1532 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3675 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3675 }, Type = (short) 0 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 3, Count = (short) 1 }, { Command = (short) 2, Count = (short) 2 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 3 }, { Command = (short) 3, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 3 }, { Command = (short) 3, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 7, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 2 }, { Command = (short) 3, Count = (short) 1 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 3 }, { Command = (short) 3, Count = (short) 1 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 3 }, { Command = (short) 3, Count = (short) 1 }, { Command = (short) 6, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 3, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 3, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 3, Count = (short) 1 }, { Command = (short) 2, Count = (short) 6 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 6, Count = (short) 0 }, { Command = (short) 7, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "SubViewSize", Handle = (long) 0, Value = (any) { ([]com.sun.star.awt.Size) { { Width = (long) 21600, Height = (long) 21600 }, { Width = (long) 21600, Height = (long) 21600 }, { Width = (long) 21600, Height = (long) 21600 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 1 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* flowChartOfflineStorage */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) {} +Equations +([]string) { "logwidth*3/4", "logheight/2", "logwidth/2", "logheight", "logwidth/4" } +Handles +([][]com.sun.star.beans.PropertyValue) {} +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 0 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 2 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 7, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 6, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 2 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 6, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "SubViewSize", Handle = (long) 0, Value = (any) { ([]com.sun.star.awt.Size) { { Width = (long) 2, Height = (long) 2 }, { Width = (long) 5, Height = (long) 5 }, { Width = (long) 2, Height = (long) 2 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* flowChartOffpageConnector */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) {} +Equations +([]string) { "logheight*4/5", "logwidth/2", "logheight/2", "logheight", "logwidth" } +Handles +([][]com.sun.star.beans.PropertyValue) {} +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 0 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 4 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "SubViewSize", Handle = (long) 0, Value = (any) { ([]com.sun.star.awt.Size) { { Width = (long) 10, Height = (long) 10 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* flowChartOnlineStorage */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) {} +Equations +([]string) { "logwidth*5/6", "logwidth/2", "logheight/2", "logheight", "logwidth/6", "(16200000)/60000.0", "(-10800000)/60000.0", "(5400000)/60000.0", "(10800000)/60000.0" } +Handles +([][]com.sun.star.beans.PropertyValue) {} +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "SubViewSize", Handle = (long) 0, Value = (any) { ([]com.sun.star.awt.Size) { { Width = (long) 6, Height = (long) 6 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* flowChartOr */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) {} +Equations +([]string) { "logwidth/2", "?0 *cos(pi*(2700000)/10800000)", "logheight/2", "?2 *sin(pi*(2700000)/10800000)", "logwidth/2", "?4 +0-?1 ", "?4 +?1 -0", "logheight/2", "?7 +0-?3 ", "?7 +?3 -0", "logheight", "logwidth", "(10800000)/60000.0", "(5400000)/60000.0", "(16200000)/60000.0", "(5400000)/60000.0", "(0)/60000.0", "(5400000)/60000.0", "(5400000)/60000.0", "(5400000)/60000.0", "(10800000)/60000.0", "(5400000)/60000.0", "(16200000)/60000.0", "(5400000)/60000.0", "(0)/60000.0", "(5400000)/60000.0", "(5400000)/60000.0", "(5400000)/60000.0" } +Handles +([][]com.sun.star.beans.PropertyValue) {} +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 17 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 18 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 20 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 21 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 22 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 23 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 24 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 25 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 26 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 27 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 17, Count = (short) 4 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 7, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 6, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 17, Count = (short) 4 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 6, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* flowChartPredefinedProcess */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) {} +Equations +([]string) { "logwidth*7/8", "logwidth/2", "logheight/2", "logheight", "logwidth", "logwidth/8" } +Handles +([][]com.sun.star.beans.PropertyValue) {} +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 0 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 3 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 7, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 6, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 3 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 6, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "SubViewSize", Handle = (long) 0, Value = (any) { ([]com.sun.star.awt.Size) { { Width = (long) 1, Height = (long) 1 }, { Width = (long) 8, Height = (long) 8 }, { Width = (long) 1, Height = (long) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* flowChartPreparation */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) {} +Equations +([]string) { "logwidth*4/5", "logwidth/2", "logheight/2", "logheight", "logwidth", "logwidth/5" } +Handles +([][]com.sun.star.beans.PropertyValue) {} +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 0 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 5 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "SubViewSize", Handle = (long) 0, Value = (any) { ([]com.sun.star.awt.Size) { { Width = (long) 10, Height = (long) 10 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* flowChartProcess */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) {} +Equations +([]string) { "logwidth/2", "logheight/2", "logheight", "logwidth" } +Handles +([][]com.sun.star.beans.PropertyValue) {} +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 0 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 3 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "SubViewSize", Handle = (long) 0, Value = (any) { ([]com.sun.star.awt.Size) { { Width = (long) 1, Height = (long) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* flowChartPunchedCard */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) {} +Equations +([]string) { "logwidth/2", "logheight/2", "logheight", "logwidth", "logheight/5" } +Handles +([][]com.sun.star.beans.PropertyValue) {} +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 0 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 4 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "SubViewSize", Handle = (long) 0, Value = (any) { ([]com.sun.star.awt.Size) { { Width = (long) 5, Height = (long) 5 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* flowChartPunchedTape */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) {} +Equations +([]string) { "logheight*9/10", "logheight*4/5", "logwidth/2", "logheight/10", "logheight/2", "logwidth", "logheight/5", "(10800000)/60000.0", "(-10800000)/60000.0", "(10800000)/60000.0", "(10800000)/60000.0", "(0)/60000.0", "(-10800000)/60000.0", "(0)/60000.0", "(10800000)/60000.0" } +Handles +([][]com.sun.star.beans.PropertyValue) {} +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 20 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 18 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 17, Count = (short) 2 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 17, Count = (short) 2 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "SubViewSize", Handle = (long) 0, Value = (any) { ([]com.sun.star.awt.Size) { { Width = (long) 20, Height = (long) 20 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* flowChartSort */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) {} +Equations +([]string) { "logwidth*3/4", "logheight*3/4", "logwidth/2", "logheight/2", "logheight", "logwidth", "logwidth/4", "logheight/4" } +Handles +([][]com.sun.star.beans.PropertyValue) {} +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 0 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 3 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 7, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 6, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 3 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 6, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "SubViewSize", Handle = (long) 0, Value = (any) { ([]com.sun.star.awt.Size) { { Width = (long) 2, Height = (long) 2 }, { Width = (long) 2, Height = (long) 2 }, { Width = (long) 2, Height = (long) 2 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* flowChartSummingJunction */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) {} +Equations +([]string) { "logwidth/2", "?0 *cos(pi*(2700000)/10800000)", "logheight/2", "?2 *sin(pi*(2700000)/10800000)", "logwidth/2", "?4 +0-?1 ", "?4 +?1 -0", "logheight/2", "?7 +0-?3 ", "?7 +?3 -0", "logheight", "logwidth", "(10800000)/60000.0", "(5400000)/60000.0", "(16200000)/60000.0", "(5400000)/60000.0", "(0)/60000.0", "(5400000)/60000.0", "(5400000)/60000.0", "(5400000)/60000.0", "(10800000)/60000.0", "(5400000)/60000.0", "(16200000)/60000.0", "(5400000)/60000.0", "(0)/60000.0", "(5400000)/60000.0", "(5400000)/60000.0", "(5400000)/60000.0" } +Handles +([][]com.sun.star.beans.PropertyValue) {} +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 17 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 18 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 20 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 21 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 22 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 23 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 24 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 25 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 26 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 27 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 17, Count = (short) 4 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 7, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 6, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 17, Count = (short) 4 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 6, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* flowChartTerminator */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) {} +Equations +([]string) { "logwidth*1018/21600", "logwidth*20582/21600", "logheight*3163/21600", "logheight*18437/21600", "logwidth/2", "logheight/2", "logheight", "logwidth", "(16200000)/60000.0", "(10800000)/60000.0", "(5400000)/60000.0", "(10800000)/60000.0" } +Handles +([][]com.sun.star.beans.PropertyValue) {} +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3475 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 18125 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3475 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10800 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3475 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 21600 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3475 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10800 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "SubViewSize", Handle = (long) 0, Value = (any) { ([]com.sun.star.awt.Size) { { Width = (long) 21600, Height = (long) 21600 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* foldedCorner */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) { { Value = (any) { (long) 16667 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj" } } +Equations +([]string) { "if(0-$0 ,0,if(50000-$0 ,$0 ,50000))", "min(logwidth,logheight)", "?1 *?0 /100000", "?2 *1/5", "logwidth+0-?2 ", "?4 +?3 -0", "logheight+0-?2 ", "?6 +?3 -0", "logheight", "logwidth/2", "logheight/2", "logwidth" } +Handles +([][]com.sun.star.beans.PropertyValue) { { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 50000 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefX", Handle = (long) 0, Value = (any) { (long) 0 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } } +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 4 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 7, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 2 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 19, Count = (short) 0 }, { Command = (short) 7, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 7 }, { Command = (short) 6, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* frame */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) { { Value = (any) { (long) 12500 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj1" } } +Equations +([]string) { "if(0-$0 ,0,if(50000-$0 ,$0 ,50000))", "min(logwidth,logheight)", "?1 *?0 /100000", "logwidth+0-?2 ", "logheight+0-?2 ", "logwidth/2", "logheight/2", "logheight", "logwidth" } +Handles +([][]com.sun.star.beans.PropertyValue) { { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 50000 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefX", Handle = (long) 0, Value = (any) { (long) 0 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } } +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 3 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 3 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* funnel */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) {} +Equations +([]string) { "min(logwidth,logheight)", "?0 *1/20", "logwidth/2", "?2 +0-?1 ", "logheight/4", "?4 +0-?1 ", "?2 *cos(pi*(480000)/10800000)", "?4 *sin(pi*(480000)/10800000)", "(10800000*atan2(?7 ,?6 ))/pi", "?8 *2/1", "10800000+0-?8 ", "10800000+2-0", "10800000+0-2", "?2 *1/4", "?4 *1/4", "?4 *cos(pi*(?10 )/10800000)", "?2 *sin(pi*(?10 )/10800000)", "sqrt(?15 *?15 +?16 *?16 +0*0)", "?2 *?4 /?17 ", "?18 *cos(pi*(?10 )/10800000)", "?18 *sin(pi*(?10 )/10800000)", "logwidth/2", "?21 +?19 -0", "?4 +?20 -0", "?14 *cos(pi*(?8 )/10800000)", "?13 *sin(pi*(?8 )/10800000)", "sqrt(?24 *?24 +?25 *?25 +0*0)", "?13 *?14 /?26 ", "?27 *cos(pi*(?8 )/10800000)", "?27 *sin(pi*(?8 )/10800000)", "?21 +?28 -0", "logheight+0-?14 ", "?31 +?29 -0", "?2 +0-?3 ", "10800000*2/1", "logwidth", "logheight", "(?10 )/60000.0", "(?11 )/60000.0", "(?8 )/60000.0", "(?12 )/60000.0", "(10800000)/60000.0", "(-21600000)/60000.0" } +Handles +([][]com.sun.star.beans.PropertyValue) {} +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 22 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 23 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 37 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 38 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 30 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 32 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 39 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 40 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 33 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 41 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 42 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 35 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 36 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* gear6 */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) { { Value = (any) { (long) 15000 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj1" }, { Value = (any) { (long) 3526 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj2" } } +Equations +([]string) { "if(0-$0 ,0,if(20000-$0 ,$0 ,20000))", "if(0-$1 ,0,if(5358-$1 ,$1 ,5358))", "min(logwidth,logheight)", "?2 *?0 /100000", "?2 *?1 /100000", "?3 *1/2", "?4 *1/2", "?5 +?6 -0", "logheight/2", "?8 +0-?3 ", "logwidth/2", "?10 +0-?3 ", "?11 +0-?9 ", "if(?12 ,?9 ,?11 )", "(10800000*atan2(?7 ,?13 ))/pi", "19800000+0-?14 ", "19800000+?14 -0", "?11 *cos(pi*(?15 )/10800000)", "?9 *sin(pi*(?15 )/10800000)", "(10800000*atan2(?18 ,?17 ))/pi", "?9 *cos(pi*(?19 )/10800000)", "?11 *sin(pi*(?19 )/10800000)", "sqrt(?20 *?20 +?21 *?21 +0*0)", "?11 *?9 /?22 ", "?23 *cos(pi*(?19 )/10800000)", "?23 *sin(pi*(?19 )/10800000)", "logwidth/2", "?26 +?24 -0", "logheight/2", "?28 +?25 -0", "?11 *cos(pi*(?16 )/10800000)", "?9 *sin(pi*(?16 )/10800000)", "(10800000*atan2(?31 ,?30 ))/pi", "?9 *cos(pi*(?32 )/10800000)", "?11 *sin(pi*(?32 )/10800000)", "sqrt(?33 *?33 +?34 *?34 +0*0)", "?11 *?9 /?35 ", "?36 *cos(pi*(?32 )/10800000)", "?36 *sin(pi*(?32 )/10800000)", "?26 +?37 -0", "?28 +?38 -0", "?27 +0-?39 ", "?29 +0-?40 ", "sqrt(?41 *?41 +?42 *?42 +0*0)", "(10800000*atan2(?41 ,?42 ))/pi", "?4 *sin(pi*(?44 )/10800000)", "?4 *cos(pi*(?44 )/10800000)", "?39 +?45 -0", "?40 +?46 -0", "?27 +0-?45 ", "?29 +0-?46 ", "?3 *sin(pi*(?44 )/10800000)", "?3 *cos(pi*(?44 )/10800000)", "?48 +?51 -0", "?47 +0-?52 ", "?50 +?51 -0", "?49 +0-?52 ", "16200000+?14 -0", "?11 *cos(pi*(?57 )/10800000)", "?9 *sin(pi*(?57 )/10800000)", "(10800000*atan2(?59 ,?58 ))/pi", "?9 *cos(pi*(?60 )/10800000)", "?11 *sin(pi*(?60 )/10800000)", "sqrt(?61 *?61 +?62 *?62 +0*0)", "?11 *?9 /?63 ", "?64 *cos(pi*(?60 )/10800000)", "?64 *sin(pi*(?60 )/10800000)", "?26 +?65 -0", "?28 +?66 -0", "?26 +0-?65 ", "?67 +0-?4 ", "?69 +?4 -0", "?68 +0-?3 ", "?19 +0-?60 ", "1800000+0-?14 ", "1800000+?14 -0", "?11 *cos(pi*(?74 )/10800000)", "?9 *sin(pi*(?74 )/10800000)", "(10800000*atan2(?77 ,?76 ))/pi", "logheight+0-?40 ", "?11 *cos(pi*(?75 )/10800000)", "?9 *sin(pi*(?75 )/10800000)", "(10800000*atan2(?81 ,?80 ))/pi", "logheight+0-?29 ", "logheight+0-?55 ", "logheight+0-?53 ", "?54 ", "?78 +0-?32 ", "5400000+?14 -0", "?11 *cos(pi*(?88 )/10800000)", "?9 *sin(pi*(?88 )/10800000)", "(10800000*atan2(?90 ,?89 ))/pi", "logheight+0-?68 ", "logheight+0-?72 ", "9000000+?14 -0", "?11 *cos(pi*(?94 )/10800000)", "?9 *sin(pi*(?94 )/10800000)", "(10800000*atan2(?96 ,?95 ))/pi", "logwidth+0-?39 ", "logwidth+0-?54 ", "logwidth+0-?56 ", "12600000+?14 -0", "?11 *cos(pi*(?101 )/10800000)", "?9 *sin(pi*(?101 )/10800000)", "(10800000*atan2(?103 ,?102 ))/pi", "logwidth+0-?27 ", "logwidth+0-?56 ", "logwidth+0-?54 ", "(?56 +?54 )/2", "(?55 +?53 )/2", "logheight+0-?109 ", "(logwidth+0)/?108 ", "(?32 )/60000.0", "(?87 )/60000.0", "(?82 )/60000.0", "(?73 )/60000.0", "(?91 )/60000.0", "(?73 )/60000.0", "(?97 )/60000.0", "(?87 )/60000.0", "(?104 )/60000.0", "(?73 )/60000.0", "(?60 )/60000.0", "(?73 )/60000.0" } +Handles +([][]com.sun.star.beans.PropertyValue) { { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 67 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 68 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 20000 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefY", Handle = (long) 0, Value = (any) { (long) 0 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } }, { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 69 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 68 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5358 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefX", Handle = (long) 0, Value = (any) { (long) 1 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } } +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 27 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 29 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 56 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 55 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 54 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 53 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 39 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 40 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 112 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 113 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 54 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 85 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 56 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 84 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 27 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 83 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 114 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 115 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 70 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 93 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 71 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 93 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 69 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 92 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 116 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 117 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 100 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 84 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 99 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 85 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 98 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 79 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 118 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 119 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 107 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 53 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 106 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 55 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 105 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 29 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 120 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 121 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 71 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 72 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 70 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 72 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 67 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 68 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 122 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 123 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 3 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 2, Count = (short) 3 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 2, Count = (short) 3 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 2, Count = (short) 3 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 2, Count = (short) 3 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 2, Count = (short) 3 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 105 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 29 }, Type = (short) 1 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 27 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 83 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* gear9 */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) { { Value = (any) { (long) 10000 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj1" }, { Value = (any) { (long) 1763 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj2" } } +Equations +([]string) { "if(0-$0 ,0,if(20000-$0 ,$0 ,20000))", "if(0-$1 ,0,if(2679-$1 ,$1 ,2679))", "min(logwidth,logheight)", "?2 *?0 /100000", "?2 *?1 /100000", "?3 *1/2", "?4 *1/2", "?5 +?6 -0", "logheight/2", "?8 +0-?3 ", "logwidth/2", "?10 +0-?3 ", "?11 +0-?9 ", "if(?12 ,?9 ,?11 )", "(10800000*atan2(?7 ,?13 ))/pi", "18600000+0-?14 ", "18600000+?14 -0", "?11 *cos(pi*(?15 )/10800000)", "?9 *sin(pi*(?15 )/10800000)", "(10800000*atan2(?18 ,?17 ))/pi", "?9 *cos(pi*(?19 )/10800000)", "?11 *sin(pi*(?19 )/10800000)", "sqrt(?20 *?20 +?21 *?21 +0*0)", "?11 *?9 /?22 ", "?23 *cos(pi*(?19 )/10800000)", "?23 *sin(pi*(?19 )/10800000)", "logwidth/2", "?26 +?24 -0", "logheight/2", "?28 +?25 -0", "?11 *cos(pi*(?16 )/10800000)", "?9 *sin(pi*(?16 )/10800000)", "(10800000*atan2(?31 ,?30 ))/pi", "?9 *cos(pi*(?32 )/10800000)", "?11 *sin(pi*(?32 )/10800000)", "sqrt(?33 *?33 +?34 *?34 +0*0)", "?11 *?9 /?35 ", "?36 *cos(pi*(?32 )/10800000)", "?36 *sin(pi*(?32 )/10800000)", "?26 +?37 -0", "?28 +?38 -0", "?27 +0-?39 ", "?29 +0-?40 ", "sqrt(?41 *?41 +?42 *?42 +0*0)", "(10800000*atan2(?41 ,?42 ))/pi", "?4 *sin(pi*(?44 )/10800000)", "?4 *cos(pi*(?44 )/10800000)", "?39 +?45 -0", "?40 +?46 -0", "?27 +0-?45 ", "?29 +0-?46 ", "?3 *sin(pi*(?44 )/10800000)", "?3 *cos(pi*(?44 )/10800000)", "?48 +?51 -0", "?47 +0-?52 ", "?50 +?51 -0", "?49 +0-?52 ", "21000000+0-?14 ", "21000000+?14 -0", "?11 *cos(pi*(?57 )/10800000)", "?9 *sin(pi*(?57 )/10800000)", "(10800000*atan2(?60 ,?59 ))/pi", "?9 *cos(pi*(?61 )/10800000)", "?11 *sin(pi*(?61 )/10800000)", "sqrt(?62 *?62 +?63 *?63 +0*0)", "?11 *?9 /?64 ", "?65 *cos(pi*(?61 )/10800000)", "?65 *sin(pi*(?61 )/10800000)", "?26 +?66 -0", "?28 +?67 -0", "?11 *cos(pi*(?58 )/10800000)", "?9 *sin(pi*(?58 )/10800000)", "(10800000*atan2(?71 ,?70 ))/pi", "?9 *cos(pi*(?72 )/10800000)", "?11 *sin(pi*(?72 )/10800000)", "sqrt(?73 *?73 +?74 *?74 +0*0)", "?11 *?9 /?75 ", "?76 *cos(pi*(?72 )/10800000)", "?76 *sin(pi*(?72 )/10800000)", "?26 +?77 -0", "?28 +?78 -0", "?68 +0-?79 ", "?69 +0-?80 ", "sqrt(?81 *?81 +?82 *?82 +0*0)", "(10800000*atan2(?81 ,?82 ))/pi", "?4 *sin(pi*(?84 )/10800000)", "?4 *cos(pi*(?84 )/10800000)", "?79 +?85 -0", "?80 +?86 -0", "?68 +0-?85 ", "?69 +0-?86 ", "?3 *sin(pi*(?84 )/10800000)", "?3 *cos(pi*(?84 )/10800000)", "?88 +?91 -0", "?87 +0-?92 ", "?90 +?91 -0", "?89 +0-?92 ", "?61 +0-?32 ", "1800000+0-?14 ", "1800000+?14 -0", "?11 *cos(pi*(?98 )/10800000)", "?9 *sin(pi*(?98 )/10800000)", "(10800000*atan2(?101 ,?100 ))/pi", "?9 *cos(pi*(?102 )/10800000)", "?11 *sin(pi*(?102 )/10800000)", "sqrt(?103 *?103 +?104 *?104 +0*0)", "?11 *?9 /?105 ", "?106 *cos(pi*(?102 )/10800000)", "?106 *sin(pi*(?102 )/10800000)", "?26 +?107 -0", "?28 +?108 -0", "?11 *cos(pi*(?99 )/10800000)", "?9 *sin(pi*(?99 )/10800000)", "(10800000*atan2(?112 ,?111 ))/pi", "?9 *cos(pi*(?113 )/10800000)", "?11 *sin(pi*(?113 )/10800000)", "sqrt(?114 *?114 +?115 *?115 +0*0)", "?11 *?9 /?116 ", "?117 *cos(pi*(?113 )/10800000)", "?117 *sin(pi*(?113 )/10800000)", "?26 +?118 -0", "?28 +?119 -0", "?109 +0-?120 ", "?110 +0-?121 ", "sqrt(?122 *?122 +?123 *?123 +0*0)", "(10800000*atan2(?122 ,?123 ))/pi", "?4 *sin(pi*(?125 )/10800000)", "?4 *cos(pi*(?125 )/10800000)", "?120 +?126 -0", "?121 +?127 -0", "?109 +0-?126 ", "?110 +0-?127 ", "?3 *sin(pi*(?125 )/10800000)", "?3 *cos(pi*(?125 )/10800000)", "?129 +?132 -0", "?128 +0-?133 ", "?131 +?132 -0", "?130 +0-?133 ", "?102 +0-?72 ", "4200000+0-?14 ", "4200000+?14 -0", "?11 *cos(pi*(?139 )/10800000)", "?9 *sin(pi*(?139 )/10800000)", "(10800000*atan2(?142 ,?141 ))/pi", "?9 *cos(pi*(?143 )/10800000)", "?11 *sin(pi*(?143 )/10800000)", "sqrt(?144 *?144 +?145 *?145 +0*0)", "?11 *?9 /?146 ", "?147 *cos(pi*(?143 )/10800000)", "?147 *sin(pi*(?143 )/10800000)", "?26 +?148 -0", "?28 +?149 -0", "?11 *cos(pi*(?140 )/10800000)", "?9 *sin(pi*(?140 )/10800000)", "(10800000*atan2(?153 ,?152 ))/pi", "?9 *cos(pi*(?154 )/10800000)", "?11 *sin(pi*(?154 )/10800000)", "sqrt(?155 *?155 +?156 *?156 +0*0)", "?11 *?9 /?157 ", "?158 *cos(pi*(?154 )/10800000)", "?158 *sin(pi*(?154 )/10800000)", "?26 +?159 -0", "?28 +?160 -0", "?150 +0-?161 ", "?151 +0-?162 ", "sqrt(?163 *?163 +?164 *?164 +0*0)", "(10800000*atan2(?163 ,?164 ))/pi", "?4 *sin(pi*(?166 )/10800000)", "?4 *cos(pi*(?166 )/10800000)", "?161 +?167 -0", "?162 +?168 -0", "?150 +0-?167 ", "?151 +0-?168 ", "?3 *sin(pi*(?166 )/10800000)", "?3 *cos(pi*(?166 )/10800000)", "?170 +?173 -0", "?169 +0-?174 ", "?172 +?173 -0", "?171 +0-?174 ", "?143 +0-?113 ", "6600000+0-?14 ", "6600000+?14 -0", "?11 *cos(pi*(?180 )/10800000)", "?9 *sin(pi*(?180 )/10800000)", "(10800000*atan2(?183 ,?182 ))/pi", "?11 *cos(pi*(?181 )/10800000)", "?9 *sin(pi*(?181 )/10800000)", "(10800000*atan2(?186 ,?185 ))/pi", "logwidth+0-?150 ", "logwidth+0-?178 ", "logwidth+0-?176 ", "?184 +0-?154 ", "9000000+?14 -0", "?11 *cos(pi*(?192 )/10800000)", "?9 *sin(pi*(?192 )/10800000)", "(10800000*atan2(?194 ,?193 ))/pi", "logwidth+0-?109 ", "logwidth+0-?137 ", "logwidth+0-?135 ", "11400000+?14 -0", "?11 *cos(pi*(?199 )/10800000)", "?9 *sin(pi*(?199 )/10800000)", "(10800000*atan2(?201 ,?200 ))/pi", "logwidth+0-?68 ", "logwidth+0-?96 ", "logwidth+0-?94 ", "13800000+?14 -0", "?11 *cos(pi*(?206 )/10800000)", "?9 *sin(pi*(?206 )/10800000)", "(10800000*atan2(?208 ,?207 ))/pi", "logwidth+0-?39 ", "logwidth+0-?27 ", "logwidth+0-?56 ", "logwidth+0-?54 ", "16200000+0-?14 ", "16200000+?14 -0", "?11 *cos(pi*(?215 )/10800000)", "?9 *sin(pi*(?215 )/10800000)", "(10800000*atan2(?217 ,?216 ))/pi", "?9 *cos(pi*(?218 )/10800000)", "?11 *sin(pi*(?218 )/10800000)", "sqrt(?219 *?219 +?220 *?220 +0*0)", "?11 *?9 /?221 ", "?222 *cos(pi*(?218 )/10800000)", "?222 *sin(pi*(?218 )/10800000)", "?26 +?223 -0", "?28 +?224 -0", "?11 *cos(pi*(?214 )/10800000)", "?9 *sin(pi*(?214 )/10800000)", "(10800000*atan2(?228 ,?227 ))/pi", "?26 +0-?223 ", "?225 +0-?4 ", "?230 +?4 -0", "?226 +0-?3 ", "?229 +0-?209 ", "(?56 +?54 )/2", "(?55 +?53 )/2", "(?96 +?94 )/2", "(?95 +?93 )/2", "(?137 +?135 )/2", "(?136 +?134 )/2", "(?178 +?176 )/2", "(?177 +?175 )/2", "(logwidth+0)/?241 ", "(logwidth+0)/?239 ", "(logwidth+0)/?237 ", "(logwidth+0)/?235 ", "(?32 )/60000.0", "(?97 )/60000.0", "(?72 )/60000.0", "(?138 )/60000.0", "(?113 )/60000.0", "(?179 )/60000.0", "(?154 )/60000.0", "(?191 )/60000.0", "(?187 )/60000.0", "(?179 )/60000.0", "(?195 )/60000.0", "(?138 )/60000.0", "(?202 )/60000.0", "(?97 )/60000.0", "(?209 )/60000.0", "(?234 )/60000.0", "(?218 )/60000.0", "(?234 )/60000.0" } +Handles +([][]com.sun.star.beans.PropertyValue) { { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 225 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 226 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 20000 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefY", Handle = (long) 0, Value = (any) { (long) 0 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } }, { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 230 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 226 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2679 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefX", Handle = (long) 0, Value = (any) { (long) 1 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } } +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 27 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 29 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 56 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 55 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 54 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 53 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 39 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 40 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 247 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 248 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 96 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 95 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 94 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 93 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 79 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 80 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 249 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 250 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 137 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 136 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 135 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 134 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 120 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 121 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 251 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 252 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 178 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 177 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 176 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 175 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 161 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 162 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 253 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 254 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 190 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 175 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 189 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 177 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 188 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 151 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 255 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 256 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 198 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 134 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 197 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 136 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 196 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 110 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 257 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 258 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 205 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 93 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 204 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 95 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 203 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 69 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 259 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 260 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 213 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 53 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 212 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 55 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 211 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 29 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 261 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 262 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 232 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 233 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 231 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 233 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 225 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 226 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 263 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 264 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 3 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 2, Count = (short) 3 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 2, Count = (short) 3 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 2, Count = (short) 3 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 2, Count = (short) 3 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 2, Count = (short) 3 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 2, Count = (short) 3 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 2, Count = (short) 3 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 2, Count = (short) 3 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 210 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 40 }, Type = (short) 1 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 39 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 121 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* halfFrame */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) { { Value = (any) { (long) 33333 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj1" }, { Value = (any) { (long) 33333 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj2" } } +Equations +([]string) { "min(logwidth,logheight)", "100000*logwidth/?0 ", "if(0-$1 ,0,if(?1 -$1 ,$1 ,?1 ))", "?0 *?2 /100000", "logheight*?3 /logwidth", "logheight+0-?4 ", "100000*?5 /?0 ", "if(0-$0 ,0,if(?6 -$0 ,$0 ,?6 ))", "?0 *?7 /100000", "?8 *logwidth/logheight", "logwidth+0-?9 ", "?3 *logheight/logwidth", "logheight+0-?11 ", "?3 *1/2", "(?12 +logheight)/2", "(?10 +logwidth)/2", "?8 *1/2", "logheight/2", "logwidth/2", "logwidth", "logheight" } +Handles +([][]com.sun.star.beans.PropertyValue) { { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefY", Handle = (long) 0, Value = (any) { (long) 0 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } }, { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 1 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefX", Handle = (long) 0, Value = (any) { (long) 1 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } } +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 20 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 5 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 20 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* heart */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) {} +Equations +([]string) { "logwidth*49/48", "logwidth*10/48", "logwidth/2", "?2 +0-?0 ", "?2 +0-?1 ", "?2 +?1 -0", "?2 +?0 -0", "logheight/3", "0+0-?7 ", "logwidth*1/6", "logwidth*5/6", "logheight*2/3", "logheight/4", "logheight" } +Handles +([][]com.sun.star.beans.PropertyValue) {} +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 3, Count = (short) 2 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12 }, Type = (short) 1 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* heptagon */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) { { Value = (any) { (long) 102572 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "hf" }, { Value = (any) { (long) 105210 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "vf" } } +Equations +([]string) { "logwidth/2", "?0 *$0 /100000", "logheight/2", "?2 *$1 /100000", "logheight/2", "?4 *$1 /100000", "?1 *97493/100000", "?1 *78183/100000", "?1 *43388/100000", "?3 *62349/100000", "?3 *22252/100000", "?3 *90097/100000", "logwidth/2", "?12 +0-?6 ", "?12 +0-?7 ", "?12 +0-?8 ", "?12 +?8 -0", "?12 +?7 -0", "?12 +?6 -0", "?5 +0-?9 ", "?5 +?10 -0", "?5 +?11 -0", "logheight+0-?19 " } +Handles +([][]com.sun.star.beans.PropertyValue) {} +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 20 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 17 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 18 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 20 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 21 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 21 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "GluePoints", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 17 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 18 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 20 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 21 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 21 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 20 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 6 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 17 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 22 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* hexagon */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) { { Value = (any) { (long) 25000 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj" }, { Value = (any) { (long) 115470 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "vf" } } +Equations +([]string) { "min(logwidth,logheight)", "50000*logwidth/?0 ", "if(0-$0 ,0,if(?1 -$0 ,$0 ,?1 ))", "logheight/2", "?3 *$1 /100000", "?0 *?2 /100000", "logwidth+0-?5 ", "?4 *sin(pi*(3600000)/10800000)", "logheight/2", "?8 +0-?7 ", "?8 +?7 -0", "?1 *-1/2", "?2 +?11 -0", "if(?12 ,4,2)", "if(?12 ,3,2)", "if(?12 ,?11 ,0)", "(?2 +?15 )/?11 ", "?16 *?14 /-1", "?13 +?17 -0", "logwidth*?18 /24", "logheight*?18 /24", "logwidth+0-?19 ", "logheight+0-?20 ", "logwidth" } +Handles +([][]com.sun.star.beans.PropertyValue) { { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 1 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefX", Handle = (long) 0, Value = (any) { (long) 0 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } } +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 23 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "GluePoints", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 23 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 5 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 20 }, Type = (short) 1 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 21 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 22 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* homePlate */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) { { Value = (any) { (long) 50000 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj" } } +Equations +([]string) { "min(logwidth,logheight)", "100000*logwidth/?0 ", "if(0-$0 ,0,if(?1 -$0 ,$0 ,?1 ))", "?0 *?2 /100000", "logwidth+0-?3 ", "(?4 +logwidth)/2", "?4 *1/2", "logheight/2", "logheight", "logwidth" } +Handles +([][]com.sun.star.beans.PropertyValue) { { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 1 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefX", Handle = (long) 0, Value = (any) { (long) 0 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } } +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 4 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* horizontalScroll */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) { { Value = (any) { (long) 12500 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj" } } +Equations +([]string) { "if(0-$0 ,0,if(25000-$0 ,$0 ,25000))", "min(logwidth,logheight)", "?1 *?0 /100000", "?2 *1/2", "?2 *1/4", "?2 +?3 -0", "?2 +?2 -0", "logheight+0-?2 ", "logheight+0-?3 ", "?7 +0-?3 ", "logwidth+0-?2 ", "logwidth+0-?3 ", "logwidth/2", "logheight/2", "logwidth", "(0)/60000.0", "(5400000)/60000.0", "(0)/60000.0", "(10800000)/60000.0", "(16200000)/60000.0", "(-5400000)/60000.0", "(10800000)/60000.0", "(-10800000)/60000.0", "(5400000)/60000.0", "(-5400000)/60000.0", "(5400000)/60000.0", "(-5400000)/60000.0", "(0)/60000.0", "(-10800000)/60000.0", "(5400000)/60000.0", "(-5400000)/60000.0", "(0)/60000.0", "(-10800000)/60000.0", "(5400000)/60000.0", "(-16200000)/60000.0", "(10800000)/60000.0", "(-10800000)/60000.0", "(10800000)/60000.0", "(5400000)/60000.0", "(10800000)/60000.0", "(10800000)/60000.0", "(0)/60000.0", "(5400000)/60000.0", "(0)/60000.0", "(10800000)/60000.0", "(5400000)/60000.0", "(-5400000)/60000.0", "(0)/60000.0", "(10800000)/60000.0", "(10800000)/60000.0", "(10800000)/60000.0", "(0)/60000.0", "(10800000)/60000.0" } +Handles +([][]com.sun.star.beans.PropertyValue) { { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 25000 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefX", Handle = (long) 0, Value = (any) { (long) 0 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } } +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 17 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 18 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 20 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 21 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 22 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 23 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 24 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 25 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 26 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 27 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 28 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 29 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 30 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 31 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 32 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 33 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 34 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 35 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 36 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 37 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 38 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 39 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 40 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 41 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 42 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 43 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 44 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 45 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 46 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 47 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 48 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 49 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 50 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 51 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 52 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 2, Count = (short) 2 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 2, Count = (short) 2 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 17, Count = (short) 2 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 7, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 17, Count = (short) 2 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 17, Count = (short) 2 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 19, Count = (short) 0 }, { Command = (short) 7, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 2, Count = (short) 2 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 2, Count = (short) 2 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 17, Count = (short) 2 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 6, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* irregularSeal1 */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) {} +Equations +([]string) { "logwidth*4627/21600", "logwidth*8485/21600", "logwidth*16702/21600", "logwidth*14522/21600", "logheight*6320/21600", "logheight*8615/21600", "logheight*13937/21600", "logheight*13290/21600", "logheight", "logwidth" } +Handles +([][]com.sun.star.beans.PropertyValue) {} +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10800 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5800 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14522 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14155 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5325 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 18380 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4457 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16702 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7315 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 21097 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8137 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 17607 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10475 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 21600 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13290 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16837 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12942 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 18145 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 18095 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14020 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14457 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13247 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19737 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10532 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14935 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8485 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 21600 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7715 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15627 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4762 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 17617 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5667 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13937 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 135 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14587 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3722 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11775 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8615 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4627 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7617 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 370 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2295 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7312 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6320 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8352 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2295 }, Type = (short) 0 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 23 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "SubViewSize", Handle = (long) 0, Value = (any) { ([]com.sun.star.awt.Size) { { Width = (long) 21600, Height = (long) 21600 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* irregularSeal2 */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) {} +Equations +([]string) { "logwidth*9722/21600", "logwidth*5372/21600", "logwidth*11612/21600", "logwidth*14640/21600", "logheight*1887/21600", "logheight*6382/21600", "logheight*12877/21600", "logheight*19712/21600", "logheight*18842/21600", "logheight*15935/21600", "logheight*6645/21600", "logwidth" } +Handles +([][]com.sun.star.beans.PropertyValue) {} +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11462 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4342 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14790 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14525 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5777 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 18007 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3172 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16380 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6532 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 21600 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6645 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16985 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9402 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 18270 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11290 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16380 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12310 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 18877 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15632 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14640 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14350 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14942 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 17370 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12180 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15935 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11612 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 18842 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9872 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 17370 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8700 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19712 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7527 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 18125 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4917 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 21600 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4805 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 18240 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1285 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 17825 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3330 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15370 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12877 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3935 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11592 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1172 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8270 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5372 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7817 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4502 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3625 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8550 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6382 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9722 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1887 }, Type = (short) 0 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 27 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "SubViewSize", Handle = (long) 0, Value = (any) { ([]com.sun.star.awt.Size) { { Width = (long) 21600, Height = (long) 21600 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* leftArrow */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) { { Value = (any) { (long) 50000 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj1" }, { Value = (any) { (long) 50000 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj2" } } +Equations +([]string) { "min(logwidth,logheight)", "100000*logwidth/?0 ", "if(0-$0 ,0,if(100000-$0 ,$0 ,100000))", "if(0-$1 ,0,if(?1 -$1 ,$1 ,?1 ))", "?0 *?3 /100000", "0+?4 -0", "logheight*?2 /200000", "logheight/2", "?7 +0-?6 ", "?7 +?6 -0", "logheight/2", "?8 *?4 /?10 ", "?5 +0-?11 ", "logwidth", "logheight" } +Handles +([][]com.sun.star.beans.PropertyValue) { { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 100000 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefY", Handle = (long) 0, Value = (any) { (long) 0 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } }, { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 1 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefX", Handle = (long) 0, Value = (any) { (long) 1 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } } +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 6 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* leftArrowCallout */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) { { Value = (any) { (long) 25000 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj1" }, { Value = (any) { (long) 25000 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj2" }, { Value = (any) { (long) 25000 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj3" }, { Value = (any) { (long) 64977 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj4" } } +Equations +([]string) { "min(logwidth,logheight)", "50000*logheight/?0 ", "if(0-$1 ,0,if(?1 -$1 ,$1 ,?1 ))", "?2 *2/1", "if(0-$0 ,0,if(?3 -$0 ,$0 ,?3 ))", "100000*logwidth/?0 ", "if(0-$2 ,0,if(?5 -$2 ,$2 ,?5 ))", "?6 *?0 /logwidth", "100000+0-?7 ", "if(0-$3 ,0,if(?8 -$3 ,$3 ,?8 ))", "?0 *?2 /100000", "?0 *?4 /200000", "logheight/2", "?12 +0-?10 ", "?12 +0-?11 ", "?12 +?11 -0", "?12 +?10 -0", "?0 *?6 /100000", "logwidth*?9 /100000", "logwidth+0-?18 ", "(?19 +logwidth)/2", "logheight", "logwidth" } +Handles +([][]com.sun.star.beans.PropertyValue) { { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 17 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefY", Handle = (long) 0, Value = (any) { (long) 0 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } }, { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 1 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefY", Handle = (long) 0, Value = (any) { (long) 1 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } }, { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 17 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefX", Handle = (long) 0, Value = (any) { (long) 2 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } }, { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 21 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefX", Handle = (long) 0, Value = (any) { (long) 3 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } } +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 17 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 17 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 22 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 22 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 21 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 21 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 17 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 17 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 10 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 22 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 21 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* leftBrace */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) { { Value = (any) { (long) 8333 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj1" }, { Value = (any) { (long) 50000 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj2" } } +Equations +([]string) { "if(0-$1 ,0,if(100000-$1 ,$1 ,100000))", "100000+0-?0 ", "min(?1 ,?0 )", "?2 *1/2", "min(logwidth,logheight)", "?3 *logheight/?4 ", "if(0-$0 ,0,if(?5 -$0 ,$0 ,?5 ))", "?4 *?6 /100000", "logheight*?0 /100000", "?8 +?7 -0", "logwidth/2", "?10 *cos(pi*(2700000)/10800000)", "?7 *sin(pi*(2700000)/10800000)", "logwidth+0-?11 ", "?7 +0-?12 ", "logheight+?12 -?7 ", "logwidth/2", "logwidth", "logheight", "(5400000)/60000.0", "(5400000)/60000.0", "(0)/60000.0", "(-5400000)/60000.0", "(5400000)/60000.0", "(-5400000)/60000.0", "(10800000)/60000.0", "(5400000)/60000.0", "(5400000)/60000.0", "(5400000)/60000.0", "(0)/60000.0", "(-5400000)/60000.0", "(5400000)/60000.0", "(-5400000)/60000.0", "(10800000)/60000.0", "(5400000)/60000.0" } +Handles +([][]com.sun.star.beans.PropertyValue) { { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefY", Handle = (long) 0, Value = (any) { (long) 0 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } }, { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 100000 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefY", Handle = (long) 0, Value = (any) { (long) 1 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } } +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 17 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 18 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 20 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 21 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 22 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 23 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 24 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 25 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 26 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 17 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 18 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 27 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 28 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 29 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 30 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 31 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 32 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 33 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 34 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 17, Count = (short) 2 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 7, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 17, Count = (short) 2 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 6, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 17 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* leftBracket */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) { { Value = (any) { (long) 8333 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj" } } +Equations +([]string) { "min(logwidth,logheight)", "50000*logheight/?0 ", "if(0-$0 ,0,if(?1 -$0 ,$0 ,?1 ))", "?0 *?2 /100000", "logheight+0-?3 ", "logwidth*cos(pi*(2700000)/10800000)", "?3 *sin(pi*(2700000)/10800000)", "logwidth+0-?5 ", "?3 +0-?6 ", "logheight+?6 -?3 ", "logwidth", "logheight/2", "logheight", "logwidth", "(5400000)/60000.0", "(5400000)/60000.0", "(10800000)/60000.0", "(5400000)/60000.0", "(5400000)/60000.0", "(5400000)/60000.0", "(10800000)/60000.0", "(5400000)/60000.0" } +Handles +([][]com.sun.star.beans.PropertyValue) { { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 1 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefY", Handle = (long) 0, Value = (any) { (long) 0 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } } +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 17 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 18 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 20 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 21 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 7, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 6, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* leftCircularArrow */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) { { Value = (any) { (long) 12500 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj1" }, { Value = (any) { (long) -1142319 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj2" }, { Value = (any) { (long) 1142319 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj3" }, { Value = (any) { (long) 10800000 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj4" }, { Value = (any) { (long) 12500 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj5" } } +Equations +([]string) { "if(0-$4 ,0,if(25000-$4 ,$4 ,25000))", "?0 *2/1", "if(0-$0 ,0,if(?1 -$0 ,$0 ,?1 ))", "if(1-$2 ,1,if(21599999-$2 ,$2 ,21599999))", "if(0-$3 ,0,if(21599999-$3 ,$3 ,21599999))", "min(logwidth,logheight)", "?5 *?2 /100000", "?5 *?0 /100000", "?6 *1/2", "logwidth/2", "?9 +?8 -?7 ", "logheight/2", "?11 +?8 -?7 ", "?10 +0-?6 ", "?12 +0-?6 ", "?13 +?8 -0", "?14 +?8 -0", "?15 *sin(pi*(?3 )/10800000)", "?16 *cos(pi*(?3 )/10800000)", "?15 *(cos(atan2(?17 ,?18 )))", "?16 *(sin(atan2(?17 ,?18 )))", "logwidth/2", "?21 +?19 -0", "logheight/2", "?23 +?20 -0", "min(?13 ,?14 )", "?19 *?19 /1", "?20 *?20 /1", "?25 *?25 /1", "?26 +0-?28 ", "?27 +0-?28 ", "?29 *?30 /?26 ", "?31 *1/?27 ", "1+0-?32 ", "sqrt(?33 )", "?29 *1/?19 ", "?35 *1/?20 ", "(1+?34 )/?36 ", "(10800000*atan2(?37 ,1))/pi", "?38 +21600000-0", "if(?38 ,?38 ,?39 )", "?40 +0-?3 ", "?41 +21600000-0", "if(?41 ,?41 ,?42 )", "?43 +0-10800000", "?43 +0-21600000", "if(?44 ,?45 ,?43 )", "abs(?46 )", "?47 *-1/1", "abs($1 )", "?49 *-1/1", "if(?48 -?50 ,?48 ,if(0-?50 ,?50 ,0))", "?3 +?51 -0", "?15 *sin(pi*(?52 )/10800000)", "?16 *cos(pi*(?52 )/10800000)", "?15 *(cos(atan2(?53 ,?54 )))", "?16 *(sin(atan2(?53 ,?54 )))", "?21 +?55 -0", "?23 +?56 -0", "?10 *sin(pi*(?4 )/10800000)", "?12 *cos(pi*(?4 )/10800000)", "?10 *(cos(atan2(?59 ,?60 )))", "?12 *(sin(atan2(?59 ,?60 )))", "?21 +?61 -0", "?23 +?62 -0", "?13 *sin(pi*(?4 )/10800000)", "?14 *cos(pi*(?4 )/10800000)", "?13 *(cos(atan2(?65 ,?66 )))", "?14 *(sin(atan2(?65 ,?66 )))", "?21 +?67 -0", "?23 +?68 -0", "?7 *cos(pi*(?52 )/10800000)", "?7 *sin(pi*(?52 )/10800000)", "?22 +?71 -0", "?24 +?72 -0", "?7 *cos(pi*(?52 )/10800000)", "?7 *sin(pi*(?52 )/10800000)", "?22 +0-?75 ", "?24 +0-?76 ", "?77 +0-?21 ", "?78 +0-?23 ", "?73 +0-?21 ", "?74 +0-?23 ", "min(?10 ,?12 )", "?79 *?83 /?10 ", "?80 *?83 /?12 ", "?81 *?83 /?10 ", "?82 *?83 /?12 ", "?86 +0-?84 ", "?87 +0-?85 ", "sqrt(?88 *?88 +?89 *?89 +0*0)", "?84 *?87 /1", "?86 *?85 /1", "?91 +0-?92 ", "?83 *?83 /1", "?90 *?90 /1", "?94 *?95 /1", "?93 *?93 /1", "?96 +0-?97 ", "max(?98 ,0)", "sqrt(?99 )", "?89 *-1/1", "if(?101 ,-1,1)", "?102 *?88 /1", "?103 *?100 /1", "?93 *?89 /1", "(?105 +?104 )/?95 ", "?105 +0-?104 ", "?107 *1/?95 ", "abs(?89 )", "?109 *?100 /1", "?93 *?88 /-1", "(?111 +?110 )/?95 ", "?111 +0-?110 ", "?113 *1/?95 ", "?86 +0-?106 ", "?86 +0-?108 ", "?87 +0-?112 ", "?87 +0-?114 ", "sqrt(?115 *?115 +?117 *?117 +0*0)", "sqrt(?116 *?116 +?118 *?118 +0*0)", "?120 +0-?119 ", "if(?121 ,?106 ,?108 )", "if(?121 ,?112 ,?114 )", "?122 *?10 /?83 ", "?123 *?12 /?83 ", "?21 +?124 -0", "?23 +?125 -0", "?79 *?25 /?13 ", "?80 *?25 /?14 ", "?81 *?25 /?13 ", "?82 *?25 /?14 ", "?130 +0-?128 ", "?131 +0-?129 ", "sqrt(?132 *?132 +?133 *?133 +0*0)", "?128 *?131 /1", "?130 *?129 /1", "?135 +0-?136 ", "?25 *?25 /1", "?134 *?134 /1", "?138 *?139 /1", "?137 *?137 /1", "?140 +0-?141 ", "max(?142 ,0)", "sqrt(?143 )", "?102 *?132 /1", "?145 *?144 /1", "?137 *?133 /1", "(?147 +?146 )/?139 ", "?147 +0-?146 ", "?149 *1/?139 ", "abs(?133 )", "?151 *?144 /1", "?137 *?132 /-1", "(?153 +?152 )/?139 ", "?153 +0-?152 ", "?155 *1/?139 ", "?128 +0-?148 ", "?128 +0-?150 ", "?129 +0-?154 ", "?129 +0-?156 ", "sqrt(?157 *?157 +?159 *?159 +0*0)", "sqrt(?158 *?158 +?160 *?160 +0*0)", "?162 +0-?161 ", "if(?163 ,?148 ,?150 )", "if(?163 ,?154 ,?156 )", "?164 *?13 /?25 ", "?165 *?14 /?25 ", "?21 +?166 -0", "?23 +?167 -0", "(10800000*atan2(?167 ,?166 ))/pi", "?170 +21600000-0", "if(?170 ,?170 ,?171 )", "?4 +0-?172 ", "?173 +21600000-0", "if(?173 ,?173 ,?174 )", "?172 +?175 -0", "0+0-?175 ", "?126 +0-?168 ", "?127 +0-?169 ", "sqrt(?178 *?178 +?179 *?179 +0*0)", "?180 *1/2", "?181 +0-?7 ", "if(?182 ,?126 ,?73 )", "if(?182 ,?127 ,?74 )", "if(?182 ,?168 ,?77 )", "if(?182 ,?169 ,?78 )", "(10800000*atan2(?125 ,?124 ))/pi", "?187 +21600000-0", "if(?187 ,?187 ,?188 )", "?189 +0-?4 ", "?190 +0-21600000", "if(?190 ,?191 ,?190 )", "?4 +?192 -0", "0+0-?192 ", "?15 *sin(pi*(?4 )/10800000)", "?16 *cos(pi*(?4 )/10800000)", "?15 *(cos(atan2(?195 ,?196 )))", "?16 *(sin(atan2(?195 ,?196 )))", "?21 +?197 -0", "?23 +?198 -0", "?4 +5400000-0", "?52 +0-5400000", "?52 +10800000-0", "?10 *cos(pi*(2700000)/10800000)", "?12 *sin(pi*(2700000)/10800000)", "?21 +0-?204 ", "?21 +?204 -0", "?23 +0-?205 ", "?23 +?205 -0", "(?176 )/60000.0", "(?177 )/60000.0", "(?193 )/60000.0", "(?194 )/60000.0" } +Handles +([][]com.sun.star.beans.PropertyValue) { { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 57 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 58 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefAngle", Handle = (long) 0, Value = (any) { (long) 1 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } }, { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 63 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 64 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefAngle", Handle = (long) 0, Value = (any) { (long) 3 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } }, { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 126 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 127 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RadiusRangeMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 1 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RadiusRangeMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefAngle", Handle = (long) 0, Value = (any) { (long) 2 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefR", Handle = (long) 0, Value = (any) { (long) 0 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } }, { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 77 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 78 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RadiusRangeMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 25000 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RadiusRangeMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefR", Handle = (long) 0, Value = (any) { (long) 4 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } } +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 63 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 64 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 69 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 70 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 210 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 211 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 185 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 186 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 57 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 58 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 183 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 184 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 126 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 127 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 212 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 213 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 2, Count = (short) 4 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 206 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 208 }, Type = (short) 1 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 207 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 209 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* leftRightArrow */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) { { Value = (any) { (long) 50000 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj1" }, { Value = (any) { (long) 50000 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj2" } } +Equations +([]string) { "min(logwidth,logheight)", "50000*logwidth/?0 ", "if(0-$0 ,0,if(100000-$0 ,$0 ,100000))", "if(0-$1 ,0,if(?1 -$1 ,$1 ,?1 ))", "?0 *?3 /100000", "logwidth+0-?4 ", "logheight*?2 /200000", "logheight/2", "?7 +0-?6 ", "?7 +?6 -0", "logheight/2", "?8 *?4 /?10 ", "?4 +0-?11 ", "?5 +?11 -0", "logwidth", "logheight" } +Handles +([][]com.sun.star.beans.PropertyValue) { { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 100000 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefY", Handle = (long) 0, Value = (any) { (long) 0 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } }, { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 1 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefX", Handle = (long) 0, Value = (any) { (long) 1 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } } +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 9 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* leftRightArrowCallout */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) { { Value = (any) { (long) 25000 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj1" }, { Value = (any) { (long) 25000 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj2" }, { Value = (any) { (long) 25000 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj3" }, { Value = (any) { (long) 48123 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj4" } } +Equations +([]string) { "min(logwidth,logheight)", "50000*logheight/?0 ", "if(0-$1 ,0,if(?1 -$1 ,$1 ,?1 ))", "?2 *2/1", "if(0-$0 ,0,if(?3 -$0 ,$0 ,?3 ))", "50000*logwidth/?0 ", "if(0-$2 ,0,if(?5 -$2 ,$2 ,?5 ))", "logwidth/2", "?6 *?0 /?7 ", "100000+0-?8 ", "if(0-$3 ,0,if(?9 -$3 ,$3 ,?9 ))", "?0 *?2 /100000", "?0 *?4 /200000", "logheight/2", "?13 +0-?11 ", "?13 +0-?12 ", "?13 +?12 -0", "?13 +?11 -0", "?0 *?6 /100000", "logwidth+0-?18 ", "logwidth*?10 /200000", "logwidth/2", "?21 +0-?20 ", "?21 +?20 -0", "logheight", "logwidth" } +Handles +([][]com.sun.star.beans.PropertyValue) { { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 18 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefY", Handle = (long) 0, Value = (any) { (long) 0 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } }, { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 1 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefY", Handle = (long) 0, Value = (any) { (long) 1 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } }, { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 18 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefX", Handle = (long) 0, Value = (any) { (long) 2 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } }, { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 22 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 24 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefX", Handle = (long) 0, Value = (any) { (long) 3 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } } +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 18 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 18 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 22 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 22 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 23 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 23 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 25 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 17 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 23 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 23 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 24 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 22 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 24 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 22 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 18 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 18 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 17 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 17 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 22 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 23 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 24 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* leftRightCircularArrow */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) { { Value = (any) { (long) 12500 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj1" }, { Value = (any) { (long) 1142319 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj2" }, { Value = (any) { (long) 20457681 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj3" }, { Value = (any) { (long) 11942319 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj4" }, { Value = (any) { (long) 12500 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj5" } } +Equations +([]string) { "if(0-$4 ,0,if(25000-$4 ,$4 ,25000))", "?0 *2/1", "if(0-$0 ,0,if(?1 -$0 ,$0 ,?1 ))", "if(1-$2 ,1,if(21599999-$2 ,$2 ,21599999))", "if(0-$3 ,0,if(21599999-$3 ,$3 ,21599999))", "min(logwidth,logheight)", "?5 *?2 /100000", "?5 *?0 /100000", "?6 *1/2", "logwidth/2", "?9 +?8 -?7 ", "logheight/2", "?11 +?8 -?7 ", "?10 +0-?6 ", "?12 +0-?6 ", "?13 +?8 -0", "?14 +?8 -0", "?15 *sin(pi*(?3 )/10800000)", "?16 *cos(pi*(?3 )/10800000)", "?15 *(cos(atan2(?17 ,?18 )))", "?16 *(sin(atan2(?17 ,?18 )))", "logwidth/2", "?21 +?19 -0", "logheight/2", "?23 +?20 -0", "min(?13 ,?14 )", "?19 *?19 /1", "?20 *?20 /1", "?25 *?25 /1", "?26 +0-?28 ", "?27 +0-?28 ", "?29 *?30 /?26 ", "?31 *1/?27 ", "1+0-?32 ", "sqrt(?33 )", "?29 *1/?19 ", "?35 *1/?20 ", "(1+?34 )/?36 ", "(10800000*atan2(?37 ,1))/pi", "?38 +21600000-0", "if(?38 ,?38 ,?39 )", "?40 +0-?3 ", "?41 +21600000-0", "if(?41 ,?41 ,?42 )", "?43 +0-10800000", "?43 +0-21600000", "if(?44 ,?45 ,?43 )", "abs(?46 )", "if(0-$1 ,0,if(?47 -$1 ,$1 ,?47 ))", "?3 +?48 -0", "?15 *sin(pi*(?49 )/10800000)", "?16 *cos(pi*(?49 )/10800000)", "?15 *(cos(atan2(?50 ,?51 )))", "?16 *(sin(atan2(?50 ,?51 )))", "?21 +?52 -0", "?23 +?53 -0", "?7 *cos(pi*(?49 )/10800000)", "?7 *sin(pi*(?49 )/10800000)", "?22 +?56 -0", "?24 +?57 -0", "?7 *cos(pi*(?49 )/10800000)", "?7 *sin(pi*(?49 )/10800000)", "?22 +0-?60 ", "?24 +0-?61 ", "?62 +0-?21 ", "?63 +0-?23 ", "?58 +0-?21 ", "?59 +0-?23 ", "min(?10 ,?12 )", "?64 *?68 /?10 ", "?65 *?68 /?12 ", "?66 *?68 /?10 ", "?67 *?68 /?12 ", "?71 +0-?69 ", "?72 +0-?70 ", "sqrt(?73 *?73 +?74 *?74 +0*0)", "?69 *?72 /1", "?71 *?70 /1", "?76 +0-?77 ", "?68 *?68 /1", "?75 *?75 /1", "?79 *?80 /1", "?78 *?78 /1", "?81 +0-?82 ", "max(?83 ,0)", "sqrt(?84 )", "?74 *-1/1", "if(?86 ,-1,1)", "?87 *?73 /1", "?88 *?85 /1", "?78 *?74 /1", "(?90 +?89 )/?80 ", "?90 +0-?89 ", "?92 *1/?80 ", "abs(?74 )", "?94 *?85 /1", "?78 *?73 /-1", "(?96 +?95 )/?80 ", "?96 +0-?95 ", "?98 *1/?80 ", "?71 +0-?91 ", "?71 +0-?93 ", "?72 +0-?97 ", "?72 +0-?99 ", "sqrt(?100 *?100 +?102 *?102 +0*0)", "sqrt(?101 *?101 +?103 *?103 +0*0)", "?105 +0-?104 ", "if(?106 ,?91 ,?93 )", "if(?106 ,?97 ,?99 )", "?107 *?10 /?68 ", "?108 *?12 /?68 ", "?21 +?109 -0", "?23 +?110 -0", "?64 *?25 /?13 ", "?65 *?25 /?14 ", "?66 *?25 /?13 ", "?67 *?25 /?14 ", "?115 +0-?113 ", "?116 +0-?114 ", "sqrt(?117 *?117 +?118 *?118 +0*0)", "?113 *?116 /1", "?115 *?114 /1", "?120 +0-?121 ", "?25 *?25 /1", "?119 *?119 /1", "?123 *?124 /1", "?122 *?122 /1", "?125 +0-?126 ", "max(?127 ,0)", "sqrt(?128 )", "?87 *?117 /1", "?130 *?129 /1", "?122 *?118 /1", "(?132 +?131 )/?124 ", "?132 +0-?131 ", "?134 *1/?124 ", "abs(?118 )", "?136 *?129 /1", "?122 *?117 /-1", "(?138 +?137 )/?124 ", "?138 +0-?137 ", "?140 *1/?124 ", "?113 +0-?133 ", "?113 +0-?135 ", "?114 +0-?139 ", "?114 +0-?141 ", "sqrt(?142 *?142 +?144 *?144 +0*0)", "sqrt(?143 *?143 +?145 *?145 +0*0)", "?147 +0-?146 ", "if(?148 ,?133 ,?135 )", "if(?148 ,?139 ,?141 )", "?149 *?13 /?25 ", "?150 *?14 /?25 ", "?21 +?151 -0", "?23 +?152 -0", "?15 *sin(pi*(?4 )/10800000)", "?16 *cos(pi*(?4 )/10800000)", "?15 *(cos(atan2(?155 ,?156 )))", "?16 *(sin(atan2(?155 ,?156 )))", "?21 +?157 -0", "?23 +?158 -0", "?4 +0-?48 ", "?15 *sin(pi*(?161 )/10800000)", "?16 *cos(pi*(?161 )/10800000)", "?15 *(cos(atan2(?162 ,?163 )))", "?16 *(sin(atan2(?162 ,?163 )))", "?21 +?164 -0", "?23 +?165 -0", "?7 *cos(pi*(?161 )/10800000)", "?7 *sin(pi*(?161 )/10800000)", "?159 +?168 -0", "?160 +?169 -0", "?7 *cos(pi*(?161 )/10800000)", "?7 *sin(pi*(?161 )/10800000)", "?159 +0-?172 ", "?160 +0-?173 ", "?111 +0-?153 ", "?112 +0-?154 ", "sqrt(?176 *?176 +?177 *?177 +0*0)", "?178 *1/2", "?179 +0-?7 ", "if(?180 ,?111 ,?58 )", "if(?180 ,?112 ,?59 )", "if(?180 ,?153 ,?62 )", "if(?180 ,?154 ,?63 )", "(10800000*atan2(?110 ,?109 ))/pi", "?185 +21600000-0", "if(?185 ,?185 ,?186 )", "?187 +0-?3 ", "?188 +21600000-0", "if(?188 ,?188 ,?189 )", "?4 +0-?190 ", "?191 +21600000-0", "if(?191 ,?191 ,?192 )", "?187 +0-?193 ", "?194 +21600000-0", "if(?194 ,?194 ,?195 )", "(10800000*atan2(?152 ,?151 ))/pi", "?197 +21600000-0", "if(?197 ,?197 ,?198 )", "?199 +0-?3 ", "?200 +0-21600000", "if(?200 ,?201 ,?200 )", "?4 +0-?202 ", "?203 +0-21600000", "if(?204 ,?204 ,?203 )", "?205 +0-?199 ", "?206 +0-21600000", "if(?206 ,?207 ,?206 )", "?10 *sin(pi*(?193 )/10800000)", "?12 *cos(pi*(?193 )/10800000)", "?10 *(cos(atan2(?209 ,?210 )))", "?12 *(sin(atan2(?209 ,?210 )))", "?21 +?211 -0", "?23 +?212 -0", "?13 *sin(pi*(?205 )/10800000)", "?14 *cos(pi*(?205 )/10800000)", "?13 *(cos(atan2(?215 ,?216 )))", "?14 *(sin(atan2(?215 ,?216 )))", "?21 +?217 -0", "?23 +?218 -0", "if(?180 ,?213 ,?170 )", "if(?180 ,?214 ,?171 )", "if(?180 ,?219 ,?174 )", "if(?180 ,?220 ,?175 )", "?161 +0-5400000", "?49 +5400000-0", "?49 +10800000-0", "?161 +10800000-0", "?10 *cos(pi*(2700000)/10800000)", "?12 *sin(pi*(2700000)/10800000)", "?21 +0-?229 ", "?21 +?229 -0", "?23 +0-?230 ", "?23 +?230 -0", "(?193 )/60000.0", "(?196 )/60000.0", "(?199 )/60000.0", "(?208 )/60000.0" } +Handles +([][]com.sun.star.beans.PropertyValue) { { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 54 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 55 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefAngle", Handle = (long) 0, Value = (any) { (long) 1 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } }, { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 213 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 214 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefAngle", Handle = (long) 0, Value = (any) { (long) 3 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } }, { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 111 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 112 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RadiusRangeMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 1 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RadiusRangeMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefAngle", Handle = (long) 0, Value = (any) { (long) 2 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefR", Handle = (long) 0, Value = (any) { (long) 0 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } }, { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 62 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 63 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RadiusRangeMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 25000 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RadiusRangeMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefR", Handle = (long) 0, Value = (any) { (long) 4 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } } +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 166 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 167 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 221 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 222 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 213 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 214 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 235 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 236 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 181 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 182 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 54 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 55 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 183 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 184 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 153 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 154 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 237 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 238 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 223 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 224 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 2 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 2, Count = (short) 4 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 231 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 233 }, Type = (short) 1 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 232 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 234 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* leftRightRibbon */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) { { Value = (any) { (long) 50000 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj1" }, { Value = (any) { (long) 50000 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj2" }, { Value = (any) { (long) 16667 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj3" } } +Equations +([]string) { "if(0-$2 ,0,if(33333-$2 ,$2 ,33333))", "100000+0-?0 ", "if(0-$0 ,0,if(?1 -$0 ,$0 ,?1 ))", "logwidth/2", "logwidth/32", "?3 +0-?4 ", "min(logwidth,logheight)", "100000*?5 /?6 ", "if(0-$1 ,0,if(?7 -$1 ,$1 ,?7 ))", "?6 *?8 /100000", "logwidth+0-?9 ", "logheight*?2 /200000", "logheight*?0 /-200000", "logheight/2", "?13 +?12 -?11 ", "?13 +?11 -?12 ", "?14 +?11 -0", "logheight+0-?16 ", "?16 *2/1", "logheight+0-?18 ", "?18 +0-?14 ", "logheight+0-?20 ", "?0 *?6 /400000", "logwidth/2", "?23 +0-?4 ", "?23 +?4 -0", "?14 +?22 -0", "?21 +0-?22 ", "logwidth", "logheight", "(16200000)/60000.0", "(10800000)/60000.0", "(16200000)/60000.0", "(-10800000)/60000.0", "(5400000)/60000.0", "(5400000)/60000.0", "(0)/60000.0", "(5400000)/60000.0", "(16200000)/60000.0", "(-10800000)/60000.0", "(16200000)/60000.0", "(10800000)/60000.0", "(16200000)/60000.0", "(-10800000)/60000.0", "(5400000)/60000.0", "(5400000)/60000.0" } +Handles +([][]com.sun.star.beans.PropertyValue) { { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 21 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 1 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefY", Handle = (long) 0, Value = (any) { (long) 0 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } }, { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefX", Handle = (long) 0, Value = (any) { (long) 1 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } }, { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 25 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 21 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 33333 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefY", Handle = (long) 0, Value = (any) { (long) 2 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } } +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 23 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 22 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 30 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 31 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 22 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 32 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 33 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 21 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 28 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 17 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 29 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 23 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 22 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 34 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 35 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 24 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 20 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 20 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 18 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 25 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 26 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 22 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 36 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 37 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 22 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 38 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 39 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 25 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 21 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 23 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 22 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 40 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 41 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 22 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 42 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 43 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 21 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 28 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 17 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 29 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 23 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 22 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 44 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 45 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 24 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 20 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 20 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 18 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 25 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 26 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 25 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 21 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 24 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 27 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 24 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 20 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 3 }, { Command = (short) 17, Count = (short) 2 }, { Command = (short) 2, Count = (short) 6 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 2, Count = (short) 3 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 7, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 17, Count = (short) 2 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 19, Count = (short) 0 }, { Command = (short) 7, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 3 }, { Command = (short) 17, Count = (short) 2 }, { Command = (short) 2, Count = (short) 6 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 2, Count = (short) 3 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 6, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* leftRightUpArrow */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) { { Value = (any) { (long) 25000 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj1" }, { Value = (any) { (long) 25000 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj2" }, { Value = (any) { (long) 25000 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj3" } } +Equations +([]string) { "if(0-$1 ,0,if(50000-$1 ,$1 ,50000))", "?0 *2/1", "if(0-$0 ,0,if(?1 -$0 ,$0 ,?1 ))", "100000+0-?1 ", "?3 *1/2", "if(0-$2 ,0,if(?4 -$2 ,$2 ,?4 ))", "min(logwidth,logheight)", "?6 *?5 /100000", "?6 *?0 /100000", "logwidth/2", "?9 +0-?8 ", "?9 +?8 -0", "?6 *?2 /200000", "?9 +0-?12 ", "?9 +?12 -0", "logwidth+0-?7 ", "?6 *?0 /50000", "logheight+0-?16 ", "logheight+0-?8 ", "?18 +0-?12 ", "?18 +?12 -0", "?12 *?7 /?8 ", "logwidth+0-?21 ", "logwidth", "logheight" } +Handles +([][]com.sun.star.beans.PropertyValue) { { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 1 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefX", Handle = (long) 0, Value = (any) { (long) 0 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } }, { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 50000 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefX", Handle = (long) 0, Value = (any) { (long) 1 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } }, { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 23 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefY", Handle = (long) 0, Value = (any) { (long) 2 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } } +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 18 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 17 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 17 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 23 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 18 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 24 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 20 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 20 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 24 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 16 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 21 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 22 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 20 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* leftUpArrow */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) { { Value = (any) { (long) 25000 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj1" }, { Value = (any) { (long) 25000 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj2" }, { Value = (any) { (long) 25000 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj3" } } +Equations +([]string) { "if(0-$1 ,0,if(50000-$1 ,$1 ,50000))", "?0 *2/1", "if(0-$0 ,0,if(?1 -$0 ,$0 ,?1 ))", "100000+0-?1 ", "if(0-$2 ,0,if(?3 -$2 ,$2 ,?3 ))", "min(logwidth,logheight)", "?5 *?4 /100000", "?5 *?0 /50000", "logwidth+0-?7 ", "logheight+0-?7 ", "?5 *?0 /100000", "logwidth+0-?10 ", "logheight+0-?10 ", "?5 *?2 /200000", "?11 +0-?13 ", "?11 +?13 -0", "?12 +0-?13 ", "?12 +?13 -0", "?13 *?6 /?10 ", "(?6 +?15 )/2", "(?6 +?17 )/2", "logheight", "logwidth" } +Handles +([][]com.sun.star.beans.PropertyValue) { { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 1 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefY", Handle = (long) 0, Value = (any) { (long) 0 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } }, { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 50000 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefX", Handle = (long) 0, Value = (any) { (long) 1 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } }, { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefY", Handle = (long) 0, Value = (any) { (long) 2 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } } +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 22 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 17 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 17 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 21 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 11 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 18 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16 }, Type = (short) 1 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 17 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* lightningBolt */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) {} +Equations +([]string) { "logwidth*5022/21600", "logwidth*8472/21600", "logwidth*8757/21600", "logwidth*10012/21600", "logwidth*12860/21600", "logwidth*13917/21600", "logwidth*16577/21600", "logheight*3890/21600", "logheight*6080/21600", "logheight*7437/21600", "logheight*9705/21600", "logheight*12007/21600", "logheight*14277/21600", "logheight*14915/21600", "logwidth", "logheight" } +Handles +([][]com.sun.star.beans.PropertyValue) {} +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8472 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12860 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6080 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11050 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6797 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16577 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12007 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14767 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12877 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 21600 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 21600 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10012 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14915 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12222 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13987 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5022 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9705 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7602 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8382 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3890 }, Type = (short) 0 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 10 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "SubViewSize", Handle = (long) 0, Value = (any) { ([]com.sun.star.awt.Size) { { Width = (long) 21600, Height = (long) 21600 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* line */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) {} +Equations +([]string) { "logwidth", "logheight" } +Handles +([][]com.sun.star.beans.PropertyValue) {} +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* lineInv */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) {} +Equations +([]string) { "logheight", "logwidth" } +Handles +([][]com.sun.star.beans.PropertyValue) {} +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* mathDivide */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) { { Value = (any) { (long) 23520 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj1" }, { Value = (any) { (long) 5880 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj2" }, { Value = (any) { (long) 11760 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj3" } } +Equations +([]string) { "if(1000-$0 ,1000,if(36745-$0 ,$0 ,36745))", "0+0-?0 ", "(73490+?1 )/4", "36745*logwidth/logheight", "min(?2 ,?3 )", "if(1000-$2 ,1000,if(?4 -$2 ,$2 ,?4 ))", "-4*?5 /1", "73490+?6 -?0 ", "if(0-$1 ,0,if(?7 -$1 ,$1 ,?7 ))", "logheight*?0 /200000", "logheight*?8 /100000", "logheight*?5 /100000", "logwidth*73490/200000", "logheight/2", "?13 +0-?9 ", "?13 +?9 -0", "?10 +?11 -0", "?14 +0-?16 ", "?17 +0-?11 ", "logheight+0-?18 ", "logwidth/2", "?20 +0-?12 ", "?20 +?12 -0", "?20 +0-?11 ", "logwidth", "(16200000)/60000.0", "(21600000)/60000.0", "(5400000)/60000.0", "(21600000)/60000.0" } +Handles +([][]com.sun.star.beans.PropertyValue) { { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 36745 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1000 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefY", Handle = (long) 0, Value = (any) { (long) 0 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } }, { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 24 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 17 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefY", Handle = (long) 0, Value = (any) { (long) 1 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } }, { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 23 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1000 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefX", Handle = (long) 0, Value = (any) { (long) 2 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } } +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 20 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 18 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 25 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 26 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 20 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 27 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 28 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 21 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 22 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 22 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 21 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 3 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 21 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 22 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* mathEqual */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) { { Value = (any) { (long) 23520 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj1" }, { Value = (any) { (long) 11760 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj2" } } +Equations +([]string) { "if(0-$0 ,0,if(36745-$0 ,$0 ,36745))", "?0 *2/1", "100000+0-2", "if(0-$1 ,0,if(?2 -$1 ,$1 ,?2 ))", "logheight*?0 /100000", "logheight*?3 /200000", "logwidth*73490/200000", "logheight/2", "?7 +0-?5 ", "?7 +?5 -0", "?8 +0-?4 ", "?9 +?4 -0", "logwidth/2", "?12 +0-?6 ", "?12 +?6 -0", "(?10 +?8 )/2", "(?9 +?11 )/2", "logwidth" } +Handles +([][]com.sun.star.beans.PropertyValue) { { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 36745 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefY", Handle = (long) 0, Value = (any) { (long) 0 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } }, { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 17 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefY", Handle = (long) 0, Value = (any) { (long) 1 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } } +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 3 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 3 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 1 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* mathMinus */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) { { Value = (any) { (long) 23520 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj1" } } +Equations +([]string) { "if(0-$0 ,0,if(100000-$0 ,$0 ,100000))", "logheight*?0 /200000", "logwidth*73490/200000", "logheight/2", "?3 +0-?1 ", "?3 +?1 -0", "logwidth/2", "?6 +0-?2 ", "?6 +?2 -0" } +Handles +([][]com.sun.star.beans.PropertyValue) { { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 100000 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefY", Handle = (long) 0, Value = (any) { (long) 0 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } } +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 3 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* mathMultiply */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) { { Value = (any) { (long) 23520 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj1" } } +Equations +([]string) { "if(0-$0 ,0,if(51965-$0 ,$0 ,51965))", "min(logwidth,logheight)", "?1 *?0 /100000", "(10800000*atan2(logheight,logwidth))/pi", "1*sin(pi*(?3 )/10800000)", "1*cos(pi*(?3 )/10800000)", "1*tan(pi*(?3 )/10800000)", "sqrt(logwidth*logwidth+logheight*logheight+0*0)", "?7 *51965/100000", "?7 +0-?8 ", "?5 *?9 /2", "?4 *?9 /2", "?4 *?2 /2", "?5 *?2 /2", "?10 +0-?12 ", "?11 +?13 -0", "?10 +?12 -0", "?11 +0-?13 ", "logwidth/2", "?18 +0-?16 ", "?19 *?6 /1", "?20 +?17 -0", "logwidth+0-?16 ", "logwidth+0-?14 ", "logheight/2", "?24 +0-?15 ", "?25 *1/?6 ", "?23 +0-?26 ", "?14 +?26 -0", "logheight+0-?15 ", "logheight+0-?17 ", "logheight+0-?21 ", "logwidth+0-?10 ", "logheight+0-?11 " } +Handles +([][]com.sun.star.beans.PropertyValue) { { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 51965 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefY", Handle = (long) 0, Value = (any) { (long) 0 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } } +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 17 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 18 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 21 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 22 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 17 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 23 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 27 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 24 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 23 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 29 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 22 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 30 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 18 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 31 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 30 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 29 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 28 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 24 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 11 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 17 }, Type = (short) 1 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 23 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 30 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* mathNotEqual */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) { { Value = (any) { (long) 23520 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj1" }, { Value = (any) { (long) 6600000 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj2" }, { Value = (any) { (long) 11760 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj3" } } +Equations +([]string) { "if(0-$0 ,0,if(50000-$0 ,$0 ,50000))", "if(4200000-$1 ,4200000,if(6600000-$1 ,$1 ,6600000))", "?0 *2/1", "100000+0-2", "if(0-$2 ,0,if(?3 -$2 ,$2 ,?3 ))", "logheight*?0 /100000", "logheight*?4 /200000", "logwidth*73490/200000", "logwidth/2", "?8 +0-?7 ", "?8 +?7 -0", "logheight/2", "?11 +0-?6 ", "?11 +?6 -0", "?12 +0-?5 ", "?13 +?5 -0", "?1 +0-5400000", "logheight/2", "?17 *tan(pi*(?16 )/10800000)", "sqrt(?18 *?18 +?17 *?17 +0*0)", "?19 *?5 /?17 ", "?20 *1/2", "?8 +?18 -?21 ", "?18 *?14 /?17 ", "?22 +0-?23 ", "?18 *?12 /?17 ", "?22 +0-?25 ", "?18 *?13 /?17 ", "?22 +0-?27 ", "?18 *?15 /?17 ", "?22 +0-?29 ", "?18 *2/1", "?22 +0-?31 ", "?22 +?20 -0", "?24 +?20 -0", "?26 +?20 -0", "?28 +?20 -0", "?30 +?20 -0", "?32 +?20 -0", "?5 *?17 /?19 ", "?22 +?39 -0", "?33 +0-?39 ", "if(?16 ,?40 ,?33 )", "if(?16 ,?22 ,?41 )", "?5 *?18 /?19 ", "0+0-?44 ", "if(?16 ,?44 ,0)", "if(?16 ,0,?45 )", "logwidth+0-?42 ", "logwidth+0-?43 ", "logheight+0-?46 ", "logheight+0-?47 ", "(?42 +?43 )/2", "(?49 +?48 )/2", "(?46 +?47 )/2", "(?14 +?12 )/2", "(?13 +?15 )/2", "(?51 +?50 )/2", "logwidth" } +Handles +([][]com.sun.star.beans.PropertyValue) { { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 50000 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefY", Handle = (long) 0, Value = (any) { (long) 0 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } }, { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 43 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefAngle", Handle = (long) 0, Value = (any) { (long) 1 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } }, { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 58 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefY", Handle = (long) 0, Value = (any) { (long) 2 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } } +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 24 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 43 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 47 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 42 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 46 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 34 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 35 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 36 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 37 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 49 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 51 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 48 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 50 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 30 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 28 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 26 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 19 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* mathPlus */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) { { Value = (any) { (long) 23520 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj1" } } +Equations +([]string) { "if(0-$0 ,0,if(73490-$0 ,$0 ,73490))", "logwidth*73490/200000", "logheight*73490/200000", "min(logwidth,logheight)", "?3 *?0 /200000", "logwidth/2", "?5 +0-?1 ", "?5 +0-?4 ", "?5 +?4 -0", "?5 +?1 -0", "logheight/2", "?10 +0-?2 ", "?10 +0-?4 ", "?10 +?4 -0", "?10 +?2 -0" } +Handles +([][]com.sun.star.beans.PropertyValue) { { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 73490 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefY", Handle = (long) 0, Value = (any) { (long) 0 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } } +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 11 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12 }, Type = (short) 1 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* moon */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) { { Value = (any) { (long) 50000 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj" } } +Equations +([]string) { "if(0-$0 ,0,if(87500-$0 ,$0 ,87500))", "min(logwidth,logheight)", "?1 *?0 /100000", "?2 *logwidth/?1 ", "?1 +0-?2 ", "?2 *?2 /?4 ", "?1 *?1 /?4 ", "?6 *2/1", "?7 +0-?5 ", "?8 +0-?2 ", "?9 *logwidth/?1 ", "?8 *1/2", "?11 +0-?2 ", "logheight/2", "?12 *?13 /?1 ", "logheight/2", "?15 +0-?14 ", "?15 +?14 -0", "?2 *9598/32768", "?18 *logwidth/?1 ", "?1 +0-?18 ", "?1 *?1 /1", "?20 *?20 /1", "?21 +0-?22 ", "sqrt(?23 )", "?24 *?13 /?1 ", "?15 +0-?25 ", "?15 +?25 -0", "?10 +0-?3 ", "?28 *1/2", "?3 +?29 -logwidth", "?30 *-1/1", "?13 *-1/1", "(10800000*atan2(?32 ,?31 ))/pi", "(10800000*atan2(?13 ,?31 ))/pi", "?34 +0-21600000", "?35 +0-?33 ", "logwidth", "logheight", "logwidth", "(5400000)/60000.0", "(10800000)/60000.0", "(?33 )/60000.0", "(?36 )/60000.0" } +Handles +([][]com.sun.star.beans.PropertyValue) { { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 87500 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefX", Handle = (long) 0, Value = (any) { (long) 0 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } } +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 37 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 38 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 39 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 40 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 41 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 29 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 42 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 43 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 17, Count = (short) 2 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 26 }, Type = (short) 1 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 27 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* noSmoking */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) { { Value = (any) { (long) 18750 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj" } } +Equations +([]string) { "if(0-$0 ,0,if(50000-$0 ,$0 ,50000))", "min(logwidth,logheight)", "?1 *?0 /100000", "logwidth/2", "?3 +0-?2 ", "logheight/2", "?5 +0-?2 ", "(10800000*atan2(logheight,logwidth))/pi", "?6 *cos(pi*(?7 )/10800000)", "?4 *sin(pi*(?7 )/10800000)", "sqrt(?8 *?8 +?9 *?9 +0*0)", "?4 *?6 /?10 ", "?2 *1/2", "(10800000*atan2(?12 ,?11 ))/pi", "?13 *2/1", "-10800000+?14 -0", "(10800000*atan2(logheight,logwidth))/pi", "?16 +0-?13 ", "?17 +0-10800000", "?6 *cos(pi*(?17 )/10800000)", "?4 *sin(pi*(?17 )/10800000)", "sqrt(?19 *?19 +?20 *?20 +0*0)", "?4 *?6 /?21 ", "?22 *cos(pi*(?17 )/10800000)", "?22 *sin(pi*(?17 )/10800000)", "logwidth/2", "?25 +?23 -0", "logheight/2", "?27 +?24 -0", "?25 +0-?23 ", "?27 +0-?24 ", "?3 *cos(pi*(2700000)/10800000)", "?5 *sin(pi*(2700000)/10800000)", "?25 +0-?31 ", "?25 +?31 -0", "?27 +0-?32 ", "?27 +?32 -0", "logheight", "logwidth", "(10800000)/60000.0", "(5400000)/60000.0", "(16200000)/60000.0", "(5400000)/60000.0", "(0)/60000.0", "(5400000)/60000.0", "(5400000)/60000.0", "(5400000)/60000.0", "(?17 )/60000.0", "(?15 )/60000.0", "(?18 )/60000.0", "(?15 )/60000.0" } +Handles +([][]com.sun.star.beans.PropertyValue) { { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 27 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RadiusRangeMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 50000 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RadiusRangeMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefR", Handle = (long) 0, Value = (any) { (long) 0 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } } +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 27 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 39 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 40 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 41 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 42 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 43 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 44 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 45 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 46 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 26 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 28 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 47 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 48 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 29 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 30 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 49 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 50 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 17, Count = (short) 4 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 33 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 35 }, Type = (short) 1 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 34 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 36 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* nonIsoscelesTrapezoid */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) { { Value = (any) { (long) 25000 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj1" }, { Value = (any) { (long) 25000 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj2" } } +Equations +([]string) { "min(logwidth,logheight)", "50000*logwidth/?0 ", "if(0-$0 ,0,if(?1 -$0 ,$0 ,?1 ))", "if(0-$1 ,0,if(?1 -$1 ,$1 ,?1 ))", "?0 *?2 /200000", "?0 *?2 /100000", "?0 *?3 /100000", "logwidth+0-?6 ", "(logwidth+?7 )/2", "logwidth/3", "?9 *?2 /?1 ", "max(?2 ,?3 )", "logheight/3", "?12 *?11 /?1 ", "?9 *?3 /?1 ", "logwidth+0-?14 ", "logheight/2", "logwidth/2", "logheight", "logwidth" } +Handles +([][]com.sun.star.beans.PropertyValue) { { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 1 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefX", Handle = (long) 0, Value = (any) { (long) 0 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } }, { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 1 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefX", Handle = (long) 0, Value = (any) { (long) 1 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } } +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 18 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 18 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 3 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 18 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* notchedRightArrow */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) { { Value = (any) { (long) 50000 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj1" }, { Value = (any) { (long) 50000 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj2" } } +Equations +([]string) { "min(logwidth,logheight)", "100000*logwidth/?0 ", "if(0-$0 ,0,if(100000-$0 ,$0 ,100000))", "if(0-$1 ,0,if(?1 -$1 ,$1 ,?1 ))", "?0 *?3 /100000", "logwidth+0-?4 ", "logheight*?2 /200000", "logheight/2", "?7 +0-?6 ", "?7 +?6 -0", "logheight/2", "?6 *?4 /?10 ", "logwidth+0-?11 ", "logwidth", "logheight" } +Handles +([][]com.sun.star.beans.PropertyValue) { { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 100000 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefY", Handle = (long) 0, Value = (any) { (long) 0 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } }, { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 1 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefX", Handle = (long) 0, Value = (any) { (long) 1 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } } +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 7 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* octagon */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) { { Value = (any) { (long) 29289 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj" } } +Equations +([]string) { "if(0-$0 ,0,if(50000-$0 ,$0 ,50000))", "min(logwidth,logheight)", "?1 *?0 /100000", "logwidth+0-?2 ", "logheight+0-?2 ", "?2 *1/2", "logwidth+0-?5 ", "logheight+0-?5 ", "logwidth", "logheight" } +Handles +([][]com.sun.star.beans.PropertyValue) { { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 50000 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefX", Handle = (long) 0, Value = (any) { (long) 0 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } } +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "GluePoints", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 7 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* parallelogram */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) { { Value = (any) { (long) 25000 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj" } } +Equations +([]string) { "min(logwidth,logheight)", "100000*logwidth/?0 ", "if(0-$0 ,0,if(?1 -$0 ,$0 ,?1 ))", "?0 *?2 /200000", "?0 *?2 /100000", "logwidth+0-?3 ", "logwidth+0-?4 ", "?6 *1/2", "logwidth+0-?7 ", "logwidth/2", "?9 *?2 /?1 ", "5*?2 /?1 ", "(1+?11 )/12", "?12 *logwidth/1", "?12 *logheight/1", "logwidth+0-?13 ", "logheight+0-?14 ", "logwidth/2", "logheight*?17 /?4 ", "if(0-?18 ,0,if(logheight-?18 ,?18 ,logheight))", "logheight+0-?19 ", "logheight/2", "logheight", "logwidth" } +Handles +([][]com.sun.star.beans.PropertyValue) { { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 1 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefX", Handle = (long) 0, Value = (any) { (long) 0 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } } +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 22 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 23 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 22 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "GluePoints", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 21 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 22 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 22 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 21 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 3 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* pentagon */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) { { Value = (any) { (long) 105146 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "hf" }, { Value = (any) { (long) 110557 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "vf" } } +Equations +([]string) { "logwidth/2", "?0 *$0 /100000", "logheight/2", "?2 *$1 /100000", "logheight/2", "?4 *$1 /100000", "?1 *cos(pi*(1080000)/10800000)", "?1 *cos(pi*(18360000)/10800000)", "?3 *sin(pi*(1080000)/10800000)", "?3 *sin(pi*(18360000)/10800000)", "logwidth/2", "?10 +0-?6 ", "?10 +0-?7 ", "?10 +?7 -0", "?10 +?6 -0", "?5 +0-?8 ", "?5 +0-?9 ", "?15 *?7 /?6 ", "logheight" } +Handles +([][]com.sun.star.beans.PropertyValue) {} +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "GluePoints", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 4 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 17 }, Type = (short) 1 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* pie */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) { { Value = (any) { (long) 0 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj1" }, { Value = (any) { (long) 16200000 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj2" } } +Equations +([]string) { "if(0-$0 ,0,if(21599999-$0 ,$0 ,21599999))", "if(0-$1 ,0,if(21599999-$1 ,$1 ,21599999))", "?1 +0-?0 ", "?2 +21600000-0", "if(?2 ,?2 ,?3 )", "logwidth/2", "?5 *sin(pi*(?0 )/10800000)", "logheight/2", "?7 *cos(pi*(?0 )/10800000)", "?5 *(cos(atan2(?6 ,?8 )))", "?7 *(sin(atan2(?6 ,?8 )))", "logwidth/2", "?11 +?9 -0", "logheight/2", "?13 +?10 -0", "?5 *sin(pi*(?1 )/10800000)", "?7 *cos(pi*(?1 )/10800000)", "?5 *(cos(atan2(?15 ,?16 )))", "?7 *(sin(atan2(?15 ,?16 )))", "?11 +?17 -0", "?13 +?18 -0", "?5 *cos(pi*(2700000)/10800000)", "?7 *sin(pi*(2700000)/10800000)", "?11 +0-?21 ", "?11 +?21 -0", "?13 +0-?22 ", "?13 +?22 -0", "logwidth", "logheight", "(?0 )/60000.0", "(?4 )/60000.0" } +Handles +([][]com.sun.star.beans.PropertyValue) { { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefAngle", Handle = (long) 0, Value = (any) { (long) 0 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } }, { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 20 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefAngle", Handle = (long) 0, Value = (any) { (long) 1 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } } +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 29 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 30 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "GluePoints", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 23 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 24 }, Type = (short) 1 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 25 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 26 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* pieWedge */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) {} +Equations +([]string) { "logwidth*cos(pi*(13500000)/10800000)", "logheight*sin(pi*(13500000)/10800000)", "logwidth+?0 -0", "logheight+?1 -0", "logwidth", "logheight/2", "logwidth/2", "logheight", "logwidth", "logheight", "(10800000)/60000.0", "(5400000)/60000.0" } +Handles +([][]com.sun.star.beans.PropertyValue) {} +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* plaque */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) { { Value = (any) { (long) 16667 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj" } } +Equations +([]string) { "if(0-$0 ,0,if(50000-$0 ,$0 ,50000))", "min(logwidth,logheight)", "?1 *?0 /100000", "logwidth+0-?2 ", "logheight+0-?2 ", "?2 *70711/100000", "logwidth+0-?5 ", "logheight+0-?5 ", "logwidth/2", "logheight/2", "logheight", "logwidth", "(5400000)/60000.0", "(-5400000)/60000.0", "(10800000)/60000.0", "(-5400000)/60000.0", "(16200000)/60000.0", "(-5400000)/60000.0", "(0)/60000.0", "(-5400000)/60000.0" } +Handles +([][]com.sun.star.beans.PropertyValue) { { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 50000 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefX", Handle = (long) 0, Value = (any) { (long) 0 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } } +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 17 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 18 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* plaqueTabs */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) {} +Equations +([]string) { "sqrt(logwidth*logwidth+logheight*logheight+0*0)", "1*?0 /20", "0+logheight-?1 ", "0+logwidth-?1 ", "logheight", "logwidth", "(0)/60000.0", "(5400000)/60000.0", "(16200000)/60000.0", "(5400000)/60000.0", "(5400000)/60000.0", "(5400000)/60000.0", "(10800000)/60000.0", "(5400000)/60000.0" } +Handles +([][]com.sun.star.beans.PropertyValue) {} +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 1 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* plus */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) { { Value = (any) { (long) 25000 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj" } } +Equations +([]string) { "if(0-$0 ,0,if(50000-$0 ,$0 ,50000))", "min(logwidth,logheight)", "?1 *?0 /100000", "logwidth+0-?2 ", "logheight+0-?2 ", "logwidth+0-logheight", "if(?5 ,0,?2 )", "if(?5 ,logwidth,?3 )", "if(?5 ,?2 ,0)", "if(?5 ,?4 ,logheight)", "logwidth/2", "logheight/2", "logheight", "logwidth" } +Handles +([][]com.sun.star.beans.PropertyValue) { { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 50000 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefX", Handle = (long) 0, Value = (any) { (long) 0 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } } +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 11 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* quadArrow */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) { { Value = (any) { (long) 22500 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj1" }, { Value = (any) { (long) 22500 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj2" }, { Value = (any) { (long) 22500 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj3" } } +Equations +([]string) { "if(0-$1 ,0,if(50000-$1 ,$1 ,50000))", "?0 *2/1", "if(0-$0 ,0,if(?1 -$0 ,$0 ,?1 ))", "100000+0-?1 ", "?3 *1/2", "if(0-$2 ,0,if(?4 -$2 ,$2 ,?4 ))", "min(logwidth,logheight)", "?6 *?5 /100000", "?6 *?0 /100000", "logwidth/2", "?9 +0-?8 ", "?9 +?8 -0", "?6 *?2 /200000", "?9 +0-?12 ", "?9 +?12 -0", "logwidth+0-?7 ", "logheight/2", "?16 +0-?8 ", "?16 +?8 -0", "?16 +0-?12 ", "?16 +?12 -0", "logheight+0-?7 ", "?12 *?7 /?8 ", "logwidth+0-?22 ", "logwidth", "logheight" } +Handles +([][]com.sun.star.beans.PropertyValue) { { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 1 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefX", Handle = (long) 0, Value = (any) { (long) 0 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } }, { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 50000 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefX", Handle = (long) 0, Value = (any) { (long) 1 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } }, { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 24 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefY", Handle = (long) 0, Value = (any) { (long) 2 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } } +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 17 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 17 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 24 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 18 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 20 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 20 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 21 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 21 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 25 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 21 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 21 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 20 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 20 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 18 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 23 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 22 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 23 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 20 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* quadArrowCallout */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) { { Value = (any) { (long) 18515 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj1" }, { Value = (any) { (long) 18515 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj2" }, { Value = (any) { (long) 18515 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj3" }, { Value = (any) { (long) 48123 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj4" } } +Equations +([]string) { "if(0-$1 ,0,if(50000-$1 ,$1 ,50000))", "?0 *2/1", "if(0-$0 ,0,if(?1 -$0 ,$0 ,?1 ))", "50000+0-?0 ", "if(0-$2 ,0,if(?3 -$2 ,$2 ,?3 ))", "?4 *2/1", "100000+0-?5 ", "if(?2 -$3 ,?2 ,if(?6 -$3 ,$3 ,?6 ))", "min(logwidth,logheight)", "?8 *?0 /100000", "?8 *?2 /200000", "?8 *?4 /100000", "logwidth*?7 /200000", "logheight*?7 /200000", "logwidth+0-?11 ", "logwidth/2", "?15 +0-?12 ", "?15 +?12 -0", "?15 +0-?9 ", "?15 +?9 -0", "?15 +0-?10 ", "?15 +?10 -0", "logheight+0-?11 ", "logheight/2", "?23 +0-?13 ", "?23 +?13 -0", "?23 +0-?9 ", "?23 +?9 -0", "?23 +0-?10 ", "?23 +?10 -0", "logwidth", "logheight" } +Handles +([][]com.sun.star.beans.PropertyValue) { { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 20 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 1 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefX", Handle = (long) 0, Value = (any) { (long) 0 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } }, { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 18 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 50000 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefX", Handle = (long) 0, Value = (any) { (long) 1 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } }, { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 30 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefY", Handle = (long) 0, Value = (any) { (long) 2 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } }, { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 24 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefY", Handle = (long) 0, Value = (any) { (long) 3 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } } +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 23 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 26 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 28 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 28 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 24 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 20 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 24 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 20 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 18 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 21 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 21 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 24 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 17 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 24 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 17 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 28 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 28 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 26 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 30 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 23 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 27 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 29 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 17 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 29 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 17 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 25 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 21 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 25 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 21 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 22 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 22 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 31 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 18 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 22 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 20 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 22 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 20 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 25 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 25 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 29 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 29 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 27 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 31 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 24 }, Type = (short) 1 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 17 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 25 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* rect */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) {} +Equations +([]string) { "logwidth/2", "logheight/2", "logheight", "logwidth" } +Handles +([][]com.sun.star.beans.PropertyValue) {} +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 3 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* ribbon */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) { { Value = (any) { (long) 16667 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj1" }, { Value = (any) { (long) 50000 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj2" } } +Equations +([]string) { "if(0-$0 ,0,if(33333-$0 ,$0 ,33333))", "if(25000-$1 ,25000,if(75000-$1 ,$1 ,75000))", "logwidth/8", "logwidth+0-?2 ", "logwidth*?1 /200000", "logwidth/2", "?5 +0-?4 ", "?5 +?4 -0", "logwidth/32", "?6 +?8 -0", "?7 +0-?8 ", "?6 +?2 -0", "?7 +0-?2 ", "?11 +0-?8 ", "?12 +?8 -0", "logheight*?0 /200000", "logheight*?0 /100000", "logheight+0-?16 ", "?17 *1/2", "logheight*?0 /400000", "logheight+0-?19 ", "?16 +0-?19 ", "logheight", "(16200000)/60000.0", "(10800000)/60000.0", "(16200000)/60000.0", "(-10800000)/60000.0", "(5400000)/60000.0", "(-10800000)/60000.0", "(5400000)/60000.0", "(10800000)/60000.0", "logwidth", "(0)/60000.0", "(5400000)/60000.0", "(5400000)/60000.0", "(5400000)/60000.0", "(0)/60000.0", "(5400000)/60000.0", "(16200000)/60000.0", "(-10800000)/60000.0", "(10800000)/60000.0", "(-5400000)/60000.0", "(16200000)/60000.0", "(10800000)/60000.0", "(16200000)/60000.0", "(10800000)/60000.0", "(16200000)/60000.0", "(-10800000)/60000.0", "(5400000)/60000.0", "(-10800000)/60000.0", "(5400000)/60000.0", "(10800000)/60000.0", "(0)/60000.0", "(5400000)/60000.0", "(5400000)/60000.0", "(5400000)/60000.0" } +Handles +([][]com.sun.star.beans.PropertyValue) { { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 33333 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefY", Handle = (long) 0, Value = (any) { (long) 0 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } }, { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 75000 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 25000 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefX", Handle = (long) 0, Value = (any) { (long) 1 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } } +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 23 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 24 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 25 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 26 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 27 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 28 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 29 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 30 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 31 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 18 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 31 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 17 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 17 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 20 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 32 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 33 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 22 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 34 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 35 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 17 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 17 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 18 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 36 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 37 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 38 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 39 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 40 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 41 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 42 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 43 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 44 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 45 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 46 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 47 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 48 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 49 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 50 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 51 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 31 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 18 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 31 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 17 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 17 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 20 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 52 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 53 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 22 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 54 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 55 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 17 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 17 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 18 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 17 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 21 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 21 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 17 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 2, Count = (short) 5 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 2, Count = (short) 3 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 7, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 19, Count = (short) 0 }, { Command = (short) 7, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 2, Count = (short) 5 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 2, Count = (short) 3 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 6, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16 }, Type = (short) 1 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 22 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* ribbon2 */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) { { Value = (any) { (long) 16667 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj1" }, { Value = (any) { (long) 50000 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj2" } } +Equations +([]string) { "if(0-$0 ,0,if(33333-$0 ,$0 ,33333))", "if(25000-$1 ,25000,if(75000-$1 ,$1 ,75000))", "logwidth/8", "logwidth+0-?2 ", "logwidth*?1 /200000", "logwidth/2", "?5 +0-?4 ", "?5 +?4 -0", "logwidth/32", "?6 +?8 -0", "?7 +0-?8 ", "?6 +?2 -0", "?7 +0-?2 ", "?11 +0-?8 ", "?12 +?8 -0", "logheight*?0 /200000", "logheight+0-?15 ", "logheight*?0 /100000", "logheight+0-?17 ", "0+?17 -0", "(?19 +logheight)/2", "logheight*?0 /400000", "logheight+0-?21 ", "?16 +0-?21 ", "logheight", "(5400000)/60000.0", "(-10800000)/60000.0", "(5400000)/60000.0", "(10800000)/60000.0", "(16200000)/60000.0", "(10800000)/60000.0", "(16200000)/60000.0", "(-10800000)/60000.0", "logwidth", "(0)/60000.0", "(-5400000)/60000.0", "(16200000)/60000.0", "(-5400000)/60000.0", "(0)/60000.0", "(-5400000)/60000.0", "(5400000)/60000.0", "(10800000)/60000.0", "(10800000)/60000.0", "(5400000)/60000.0", "(5400000)/60000.0", "(-10800000)/60000.0", "(10800000)/60000.0", "(5400000)/60000.0", "(16200000)/60000.0", "(5400000)/60000.0", "(5400000)/60000.0", "(10800000)/60000.0", "(5400000)/60000.0", "(-10800000)/60000.0", "(16200000)/60000.0", "(-10800000)/60000.0", "(16200000)/60000.0", "(10800000)/60000.0" } +Handles +([][]com.sun.star.beans.PropertyValue) { { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 18 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 33333 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefY", Handle = (long) 0, Value = (any) { (long) 0 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } }, { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 24 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 75000 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 25000 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefX", Handle = (long) 0, Value = (any) { (long) 1 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } } +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 24 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 24 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 21 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 25 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 26 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 21 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 27 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 28 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 18 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 21 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 29 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 30 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 21 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 31 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 32 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 33 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 24 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 20 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 33 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 21 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 21 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 34 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 35 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 21 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 36 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 37 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 20 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 22 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 21 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 38 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 39 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 21 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 40 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 41 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 18 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 22 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 21 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 42 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 43 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 21 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 44 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 45 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 18 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 24 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 20 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 21 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 21 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 46 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 47 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 21 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 48 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 49 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 33 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 20 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 33 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 24 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 24 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 21 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 50 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 51 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 21 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 52 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 53 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 18 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 21 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 54 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 55 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 21 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 56 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 57 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 18 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 22 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 22 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 18 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 23 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 23 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 2, Count = (short) 5 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 2, Count = (short) 3 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 7, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 19, Count = (short) 0 }, { Command = (short) 7, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 4 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 2, Count = (short) 6 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 6, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 18 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* rightArrow */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) { { Value = (any) { (long) 50000 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj1" }, { Value = (any) { (long) 50000 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj2" } } +Equations +([]string) { "min(logwidth,logheight)", "100000*logwidth/?0 ", "if(0-$0 ,0,if(100000-$0 ,$0 ,100000))", "if(0-$1 ,0,if(?1 -$1 ,$1 ,?1 ))", "?0 *?3 /100000", "logwidth+0-?4 ", "logheight*?2 /200000", "logheight/2", "?7 +0-?6 ", "?7 +?6 -0", "logheight/2", "?8 *?4 /?10 ", "?5 +?11 -0", "logheight", "logwidth" } +Handles +([][]com.sun.star.beans.PropertyValue) { { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 100000 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefY", Handle = (long) 0, Value = (any) { (long) 0 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } }, { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 1 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefX", Handle = (long) 0, Value = (any) { (long) 1 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } } +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 6 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* rightArrowCallout */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) { { Value = (any) { (long) 25000 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj1" }, { Value = (any) { (long) 25000 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj2" }, { Value = (any) { (long) 25000 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj3" }, { Value = (any) { (long) 64977 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj4" } } +Equations +([]string) { "min(logwidth,logheight)", "50000*logheight/?0 ", "if(0-$1 ,0,if(?1 -$1 ,$1 ,?1 ))", "?2 *2/1", "if(0-$0 ,0,if(?3 -$0 ,$0 ,?3 ))", "100000*logwidth/?0 ", "if(0-$2 ,0,if(?5 -$2 ,$2 ,?5 ))", "?6 *?0 /logwidth", "100000+0-?7 ", "if(0-$3 ,0,if(?8 -$3 ,$3 ,?8 ))", "?0 *?2 /100000", "?0 *?4 /200000", "logheight/2", "?12 +0-?10 ", "?12 +0-?11 ", "?12 +?11 -0", "?12 +?10 -0", "?0 *?6 /100000", "logwidth+0-?17 ", "logwidth*?9 /100000", "?19 *1/2", "logwidth", "logheight" } +Handles +([][]com.sun.star.beans.PropertyValue) { { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 18 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefY", Handle = (long) 0, Value = (any) { (long) 0 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } }, { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 21 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 1 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefY", Handle = (long) 0, Value = (any) { (long) 1 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } }, { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 18 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefX", Handle = (long) 0, Value = (any) { (long) 2 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } }, { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 22 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefX", Handle = (long) 0, Value = (any) { (long) 3 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } } +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 18 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 18 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 21 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 18 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 18 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 22 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 22 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 10 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 22 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* rightBrace */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) { { Value = (any) { (long) 8333 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj1" }, { Value = (any) { (long) 50000 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj2" } } +Equations +([]string) { "if(0-$1 ,0,if(100000-$1 ,$1 ,100000))", "100000+0-?0 ", "min(?1 ,?0 )", "?2 *1/2", "min(logwidth,logheight)", "?3 *logheight/?4 ", "if(0-$0 ,0,if(?5 -$0 ,$0 ,?5 ))", "?4 *?6 /100000", "logheight*?0 /100000", "?8 +0-?7 ", "logheight+0-?7 ", "logwidth/2", "?11 *cos(pi*(2700000)/10800000)", "?7 *sin(pi*(2700000)/10800000)", "0+?12 -0", "?7 +0-?13 ", "logheight+?13 -?7 ", "logwidth/2", "logwidth", "logheight", "(16200000)/60000.0", "(5400000)/60000.0", "(10800000)/60000.0", "(-5400000)/60000.0", "(16200000)/60000.0", "(-5400000)/60000.0", "(0)/60000.0", "(5400000)/60000.0", "(16200000)/60000.0", "(5400000)/60000.0", "(10800000)/60000.0", "(-5400000)/60000.0", "(16200000)/60000.0", "(-5400000)/60000.0", "(0)/60000.0", "(5400000)/60000.0" } +Handles +([][]com.sun.star.beans.PropertyValue) { { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 17 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefY", Handle = (long) 0, Value = (any) { (long) 0 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } }, { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 18 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 100000 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefY", Handle = (long) 0, Value = (any) { (long) 1 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } } +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 20 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 21 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 17 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 22 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 23 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 24 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 25 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 17 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 26 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 27 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 28 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 29 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 17 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 30 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 31 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 32 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 33 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 17 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 34 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 35 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 17, Count = (short) 2 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 7, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 17, Count = (short) 2 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 6, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15 }, Type = (short) 1 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* rightBracket */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) { { Value = (any) { (long) 8333 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj" } } +Equations +([]string) { "min(logwidth,logheight)", "50000*logheight/?0 ", "if(0-$0 ,0,if(?1 -$0 ,$0 ,?1 ))", "?0 *?2 /100000", "logheight+0-?3 ", "logwidth*cos(pi*(2700000)/10800000)", "?3 *sin(pi*(2700000)/10800000)", "0+?5 -0", "?3 +0-?6 ", "logheight+?6 -?3 ", "logwidth", "logheight", "logheight/2", "logwidth", "(16200000)/60000.0", "(5400000)/60000.0", "(0)/60000.0", "(5400000)/60000.0", "(16200000)/60000.0", "(5400000)/60000.0", "(0)/60000.0", "(5400000)/60000.0" } +Handles +([][]com.sun.star.beans.PropertyValue) { { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 1 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefY", Handle = (long) 0, Value = (any) { (long) 0 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } } +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 17 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 18 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 20 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 21 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 7, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 6, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* round1Rect */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) { { Value = (any) { (long) 16667 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj" } } +Equations +([]string) { "if(0-$0 ,0,if(50000-$0 ,$0 ,50000))", "min(logwidth,logheight)", "?1 *?0 /100000", "logwidth+0-?2 ", "?2 *29289/100000", "logwidth+0-?4 ", "logwidth/2", "logheight/2", "logheight", "logwidth", "(16200000)/60000.0", "(5400000)/60000.0" } +Handles +([][]com.sun.star.beans.PropertyValue) { { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 50000 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefX", Handle = (long) 0, Value = (any) { (long) 0 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } } +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 2, Count = (short) 2 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* round2DiagRect */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) { { Value = (any) { (long) 16667 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj1" }, { Value = (any) { (long) 0 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj2" } } +Equations +([]string) { "if(0-$0 ,0,if(50000-$0 ,$0 ,50000))", "if(0-$1 ,0,if(50000-$1 ,$1 ,50000))", "min(logwidth,logheight)", "?2 *?0 /100000", "logheight+0-?3 ", "?2 *?1 /100000", "logwidth+0-?5 ", "logheight+0-?5 ", "?3 *29289/100000", "?5 *29289/100000", "?8 +0-?9 ", "if(?10 ,?8 ,?9 )", "logwidth+0-?11 ", "logheight+0-?11 ", "logwidth", "logheight/2", "logwidth/2", "logheight", "(16200000)/60000.0", "(5400000)/60000.0", "(0)/60000.0", "(5400000)/60000.0", "(5400000)/60000.0", "(5400000)/60000.0", "(10800000)/60000.0", "(5400000)/60000.0" } +Handles +([][]com.sun.star.beans.PropertyValue) { { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 50000 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefX", Handle = (long) 0, Value = (any) { (long) 0 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } }, { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 50000 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefX", Handle = (long) 0, Value = (any) { (long) 1 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } } +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 18 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 20 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 21 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 17 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 22 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 23 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 24 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 25 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* round2SameRect */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) { { Value = (any) { (long) 16667 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj1" }, { Value = (any) { (long) 0 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj2" } } +Equations +([]string) { "if(0-$0 ,0,if(50000-$0 ,$0 ,50000))", "if(0-$1 ,0,if(50000-$1 ,$1 ,50000))", "min(logwidth,logheight)", "?2 *?0 /100000", "logwidth+0-?3 ", "?2 *?1 /100000", "logwidth+0-?5 ", "logheight+0-?5 ", "?3 +0-?5 ", "?3 *29289/100000", "?5 *29289/100000", "if(?8 ,?9 ,?10 )", "logwidth+0-?11 ", "logheight+0-?10 ", "logheight", "logwidth", "logheight/2", "logwidth/2", "(16200000)/60000.0", "(5400000)/60000.0", "(0)/60000.0", "(5400000)/60000.0", "(5400000)/60000.0", "(5400000)/60000.0", "(10800000)/60000.0", "(5400000)/60000.0" } +Handles +([][]com.sun.star.beans.PropertyValue) { { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 50000 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefX", Handle = (long) 0, Value = (any) { (long) 0 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } }, { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 50000 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefX", Handle = (long) 0, Value = (any) { (long) 1 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } } +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 18 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 20 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 21 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 22 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 23 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 24 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 25 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* roundRect */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) { { Value = (any) { (long) 16667 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj" } } +Equations +([]string) { "if(0-$0 ,0,if(50000-$0 ,$0 ,50000))", "min(logwidth,logheight)", "?1 *?0 /100000", "logwidth+0-?2 ", "logheight+0-?2 ", "?2 *29289/100000", "logwidth+0-?5 ", "logheight+0-?5 ", "logwidth/2", "logheight/2", "logheight", "logwidth", "(10800000)/60000.0", "(5400000)/60000.0", "(16200000)/60000.0", "(5400000)/60000.0", "(0)/60000.0", "(5400000)/60000.0", "(5400000)/60000.0", "(5400000)/60000.0" } +Handles +([][]com.sun.star.beans.PropertyValue) { { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 50000 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefX", Handle = (long) 0, Value = (any) { (long) 0 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } } +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 17 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 18 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* rtTriangle */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) {} +Equations +([]string) { "logheight*7/12", "logwidth*7/12", "logheight*11/12", "logheight/2", "logheight", "logwidth/2", "logwidth", "logwidth/12" } +Handles +([][]com.sun.star.beans.PropertyValue) {} +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "GluePoints", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, , { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 2 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 1 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* smileyFace */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) { { Value = (any) { (long) 4653 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj" } } +Equations +([]string) { "if(-4653-$0 ,-4653,if(4653-$0 ,$0 ,4653))", "logwidth*4969/21699", "logwidth*6215/21600", "logwidth*13135/21600", "logwidth*16640/21600", "logheight*7570/21600", "logheight*16515/21600", "logheight*?0 /100000", "?6 +0-?7 ", "?6 +?7 -0", "logheight*?0 /50000", "?9 +?10 -0", "logwidth/2", "?12 *cos(pi*(2700000)/10800000)", "logheight/2", "?14 *sin(pi*(2700000)/10800000)", "logwidth/2", "?16 +0-?13 ", "?16 +?13 -0", "logheight/2", "?19 +0-?15 ", "?19 +?15 -0", "logwidth*1125/21600", "logheight*1125/21600", "logheight", "logwidth", "(10800000)/60000.0", "(21600000)/60000.0", "(10800000)/60000.0", "(21600000)/60000.0", "(10800000)/60000.0", "(21600000)/60000.0", "(10800000)/60000.0", "(21600000)/60000.0" } +Handles +([][]com.sun.star.beans.PropertyValue) { { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4653 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) -4653 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefY", Handle = (long) 0, Value = (any) { (long) 0 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } } +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 26 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 27 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 22 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 23 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 28 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 29 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 22 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 23 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 30 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 31 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 32 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 33 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 7, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 19, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 16, Count = (short) 1 }, { Command = (short) 6, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 6, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 17 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 20 }, Type = (short) 1 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 18 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 21 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* snip1Rect */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) { { Value = (any) { (long) 16667 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj" } } +Equations +([]string) { "if(0-$0 ,0,if(50000-$0 ,$0 ,50000))", "min(logwidth,logheight)", "?1 *?0 /100000", "logwidth+0-?2 ", "?2 *1/2", "(?3 +logwidth)/2", "logwidth", "logheight/2", "logwidth/2", "logheight" } +Handles +([][]com.sun.star.beans.PropertyValue) { { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 50000 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefX", Handle = (long) 0, Value = (any) { (long) 0 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } } +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 4 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* snip2DiagRect */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) { { Value = (any) { (long) 0 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj1" }, { Value = (any) { (long) 16667 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj2" } } +Equations +([]string) { "if(0-$0 ,0,if(50000-$0 ,$0 ,50000))", "if(0-$1 ,0,if(50000-$1 ,$1 ,50000))", "min(logwidth,logheight)", "?2 *?0 /100000", "logwidth+0-?3 ", "logheight+0-?3 ", "?2 *?1 /100000", "logwidth+0-?6 ", "logheight+0-?6 ", "?3 +0-?6 ", "if(?9 ,?3 ,?6 )", "?10 *1/2", "logwidth+0-?11 ", "logheight+0-?11 ", "logwidth", "logheight/2", "logwidth/2", "logheight" } +Handles +([][]com.sun.star.beans.PropertyValue) { { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 50000 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefX", Handle = (long) 0, Value = (any) { (long) 0 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } }, { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 50000 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefX", Handle = (long) 0, Value = (any) { (long) 1 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } } +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 17 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 17 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 7 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* snip2SameRect */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) { { Value = (any) { (long) 16667 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj1" }, { Value = (any) { (long) 0 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj2" } } +Equations +([]string) { "if(0-$0 ,0,if(50000-$0 ,$0 ,50000))", "if(0-$1 ,0,if(50000-$1 ,$1 ,50000))", "min(logwidth,logheight)", "?2 *?0 /100000", "logwidth+0-?3 ", "?2 *?1 /100000", "logwidth+0-?5 ", "logheight+0-?5 ", "?3 +0-?5 ", "if(?8 ,?3 ,?5 )", "?9 *1/2", "logwidth+0-?10 ", "?3 *1/2", "(?7 +logheight)/2", "logheight", "logwidth", "logheight/2", "logwidth/2" } +Handles +([][]com.sun.star.beans.PropertyValue) { { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 50000 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefX", Handle = (long) 0, Value = (any) { (long) 0 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } }, { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 50000 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefX", Handle = (long) 0, Value = (any) { (long) 1 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } } +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 7 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12 }, Type = (short) 1 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* snipRoundRect */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) { { Value = (any) { (long) 16667 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj1" }, { Value = (any) { (long) 16667 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj2" } } +Equations +([]string) { "if(0-$0 ,0,if(50000-$0 ,$0 ,50000))", "if(0-$1 ,0,if(50000-$1 ,$1 ,50000))", "min(logwidth,logheight)", "?2 *?0 /100000", "?2 *?1 /100000", "logwidth+0-?4 ", "?3 *29289/100000", "(?5 +logwidth)/2", "logwidth", "logheight/2", "logwidth/2", "logheight", "(10800000)/60000.0", "(5400000)/60000.0" } +Handles +([][]com.sun.star.beans.PropertyValue) { { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 50000 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefX", Handle = (long) 0, Value = (any) { (long) 0 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } }, { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 50000 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefX", Handle = (long) 0, Value = (any) { (long) 1 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } } +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 5 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* squareTabs */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) {} +Equations +([]string) { "sqrt(logwidth*logwidth+logheight*logheight+0*0)", "1*?0 /20", "0+logheight-?1 ", "0+logwidth-?1 ", "logheight", "logwidth" } +Handles +([][]com.sun.star.beans.PropertyValue) {} +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 3 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 3 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 3 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 3 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 1 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* star10 */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) { { Value = (any) { (long) 42533 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj" }, { Value = (any) { (long) 105146 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "hf" } } +Equations +([]string) { "if(0-$0 ,0,if(50000-$0 ,$0 ,50000))", "logwidth/2", "?1 *$1 /100000", "?2 *95106/100000", "?2 *58779/100000", "logwidth/2", "?5 +0-?3 ", "?5 +0-?4 ", "?5 +?4 -0", "?5 +?3 -0", "logheight/2", "?10 *80902/100000", "?10 *30902/100000", "logheight/2", "?13 +0-?11 ", "?13 +0-?12 ", "?13 +?12 -0", "?13 +?11 -0", "?2 *?0 /50000", "?10 *?0 /50000", "?18 *80902/100000", "?18 *30902/100000", "?19 *95106/100000", "?19 *58779/100000", "?5 +0-?18 ", "?5 +0-?20 ", "?5 +0-?21 ", "?5 +?21 -0", "?5 +?20 -0", "?5 +?18 -0", "?13 +0-?22 ", "?13 +0-?23 ", "?13 +?23 -0", "?13 +?22 -0", "?13 +0-?19 ", "logheight" } +Handles +([][]com.sun.star.beans.PropertyValue) { { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 34 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 50000 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefY", Handle = (long) 0, Value = (any) { (long) 0 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } } +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 25 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 31 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 26 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 30 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 27 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 30 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 28 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 31 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 29 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 28 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 32 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 17 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 27 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 33 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 35 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 26 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 33 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 17 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 25 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 32 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 24 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 19 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 25 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 31 }, Type = (short) 1 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 28 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 32 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* star12 */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) { { Value = (any) { (long) 37500 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj" } } +Equations +([]string) { "if(0-$0 ,0,if(50000-$0 ,$0 ,50000))", "logwidth/2", "?1 *cos(pi*(1800000)/10800000)", "logheight/2", "?3 *sin(pi*(3600000)/10800000)", "logwidth/2", "?5 +0-?2 ", "logwidth*3/4", "?5 +?2 -0", "logheight/2", "?9 +0-?4 ", "logheight*3/4", "?9 +?4 -0", "?1 *?0 /50000", "?3 *?0 /50000", "?13 *cos(pi*(900000)/10800000)", "?13 *cos(pi*(2700000)/10800000)", "?13 *cos(pi*(4500000)/10800000)", "?14 *sin(pi*(4500000)/10800000)", "?14 *sin(pi*(2700000)/10800000)", "?14 *sin(pi*(900000)/10800000)", "?5 +0-?15 ", "?5 +0-?16 ", "?5 +0-?17 ", "?5 +?17 -0", "?5 +?16 -0", "?5 +?15 -0", "?9 +0-?18 ", "?9 +0-?19 ", "?9 +0-?20 ", "?9 +?20 -0", "?9 +?19 -0", "?9 +?18 -0", "?9 +0-?14 ", "logheight/4", "logwidth", "logheight", "logwidth/4" } +Handles +([][]com.sun.star.beans.PropertyValue) { { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 33 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 50000 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefY", Handle = (long) 0, Value = (any) { (long) 0 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } } +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 21 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 29 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 34 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 22 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 28 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 37 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 23 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 27 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 24 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 27 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 25 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 28 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 34 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 26 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 29 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 35 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 26 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 30 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 25 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 31 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 24 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 32 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 36 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 23 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 32 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 37 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 22 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 31 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 21 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 30 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 23 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 22 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 28 }, Type = (short) 1 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 25 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 31 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* star16 */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) { { Value = (any) { (long) 37500 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj" } } +Equations +([]string) { "if(0-$0 ,0,if(50000-$0 ,$0 ,50000))", "logwidth/2", "?1 *92388/100000", "?1 *70711/100000", "?1 *38268/100000", "logheight/2", "?5 *92388/100000", "?5 *70711/100000", "?5 *38268/100000", "logwidth/2", "?9 +0-?2 ", "?9 +0-?3 ", "?9 +0-?4 ", "?9 +?4 -0", "?9 +?3 -0", "?9 +?2 -0", "logheight/2", "?16 +0-?6 ", "?16 +0-?7 ", "?16 +0-?8 ", "?16 +?8 -0", "?16 +?7 -0", "?16 +?6 -0", "?1 *?0 /50000", "?5 *?0 /50000", "?23 *98079/100000", "?23 *83147/100000", "?23 *55557/100000", "?23 *19509/100000", "?24 *98079/100000", "?24 *83147/100000", "?24 *55557/100000", "?24 *19509/100000", "?9 +0-?25 ", "?9 +0-?26 ", "?9 +0-?27 ", "?9 +0-?28 ", "?9 +?28 -0", "?9 +?27 -0", "?9 +?26 -0", "?9 +?25 -0", "?16 +0-?29 ", "?16 +0-?30 ", "?16 +0-?31 ", "?16 +0-?32 ", "?16 +?32 -0", "?16 +?31 -0", "?16 +?30 -0", "?16 +?29 -0", "?23 *cos(pi*(2700000)/10800000)", "?24 *sin(pi*(2700000)/10800000)", "?9 +0-?49 ", "?16 +0-?50 ", "?9 +?49 -0", "?16 +?50 -0", "?16 +0-?24 ", "logwidth", "logheight" } +Handles +([][]com.sun.star.beans.PropertyValue) { { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 55 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 50000 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefY", Handle = (long) 0, Value = (any) { (long) 0 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } } +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 33 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 44 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 34 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 43 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 18 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 35 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 42 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 17 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 36 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 41 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 37 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 41 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 17 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 38 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 42 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 18 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 39 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 43 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 40 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 44 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 56 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 40 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 45 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 20 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 39 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 46 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 21 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 38 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 47 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 22 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 37 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 48 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 57 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 36 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 48 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 22 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 35 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 47 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 21 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 34 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 46 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 20 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 33 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 45 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 31 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 51 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 52 }, Type = (short) 1 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 53 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 54 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* star24 */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) { { Value = (any) { (long) 37500 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj" } } +Equations +([]string) { "if(0-$0 ,0,if(50000-$0 ,$0 ,50000))", "logwidth/2", "?1 *cos(pi*(900000)/10800000)", "?1 *cos(pi*(1800000)/10800000)", "?1 *cos(pi*(2700000)/10800000)", "logwidth/4", "?5 ", "?1 *cos(pi*(4500000)/10800000)", "logheight/2", "?8 *sin(pi*(4500000)/10800000)", "?8 *sin(pi*(3600000)/10800000)", "?8 *sin(pi*(2700000)/10800000)", "logheight/4", "?12 ", "?8 *sin(pi*(900000)/10800000)", "logwidth/2", "?15 +0-?2 ", "?15 +0-?3 ", "?15 +0-?4 ", "?15 +0-?6 ", "?15 +0-?7 ", "?15 +?7 -0", "?15 +?6 -0", "?15 +?4 -0", "?15 +?3 -0", "?15 +?2 -0", "logheight/2", "?26 +0-?9 ", "?26 +0-?10 ", "?26 +0-?11 ", "?26 +0-?13 ", "?26 +0-?14 ", "?26 +?14 -0", "?26 +?13 -0", "?26 +?11 -0", "?26 +?10 -0", "?26 +?9 -0", "?1 *?0 /50000", "?8 *?0 /50000", "?37 *99144/100000", "?37 *92388/100000", "?37 *79335/100000", "?37 *60876/100000", "?37 *38268/100000", "?37 *13053/100000", "?38 *99144/100000", "?38 *92388/100000", "?38 *79335/100000", "?38 *60876/100000", "?38 *38268/100000", "?38 *13053/100000", "?15 +0-?39 ", "?15 +0-?40 ", "?15 +0-?41 ", "?15 +0-?42 ", "?15 +0-?43 ", "?15 +0-?44 ", "?15 +?44 -0", "?15 +?43 -0", "?15 +?42 -0", "?15 +?41 -0", "?15 +?40 -0", "?15 +?39 -0", "?26 +0-?45 ", "?26 +0-?46 ", "?26 +0-?47 ", "?26 +0-?48 ", "?26 +0-?49 ", "?26 +0-?50 ", "?26 +?50 -0", "?26 +?49 -0", "?26 +?48 -0", "?26 +?47 -0", "?26 +?46 -0", "?26 +?45 -0", "?37 *cos(pi*(2700000)/10800000)", "?38 *sin(pi*(2700000)/10800000)", "?15 +0-?75 ", "?26 +0-?76 ", "?15 +?75 -0", "?26 +?76 -0", "?26 +0-?38 ", "logheight", "logwidth" } +Handles +([][]com.sun.star.beans.PropertyValue) { { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 81 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 50000 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefY", Handle = (long) 0, Value = (any) { (long) 0 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } } +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 26 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 51 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 68 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 31 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 52 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 67 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 17 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 30 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 53 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 66 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 18 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 29 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 54 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 65 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 28 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 55 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 64 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 20 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 27 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 56 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 63 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 57 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 63 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 21 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 27 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 58 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 64 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 22 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 28 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 59 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 65 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 23 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 29 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 60 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 66 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 24 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 30 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 61 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 67 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 25 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 31 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 62 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 68 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 83 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 26 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 62 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 69 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 25 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 32 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 61 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 70 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 24 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 33 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 60 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 71 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 23 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 34 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 59 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 72 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 22 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 35 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 58 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 73 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 21 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 36 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 57 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 74 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 82 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 56 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 74 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 20 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 36 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 55 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 73 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 35 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 54 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 72 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 18 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 34 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 53 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 71 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 17 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 33 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 52 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 70 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 32 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 51 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 69 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 47 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 77 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 78 }, Type = (short) 1 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 79 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 80 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* star32 */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) { { Value = (any) { (long) 37500 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj" } } +Equations +([]string) { "if(0-$0 ,0,if(50000-$0 ,$0 ,50000))", "logwidth/2", "?1 *98079/100000", "?1 *92388/100000", "?1 *83147/100000", "?1 *cos(pi*(2700000)/10800000)", "?1 *55557/100000", "?1 *38268/100000", "?1 *19509/100000", "logheight/2", "?9 *98079/100000", "?9 *92388/100000", "?9 *83147/100000", "?9 *sin(pi*(2700000)/10800000)", "?9 *55557/100000", "?9 *38268/100000", "?9 *19509/100000", "logwidth/2", "?17 +0-?2 ", "?17 +0-?3 ", "?17 +0-?4 ", "?17 +0-?5 ", "?17 +0-?6 ", "?17 +0-?7 ", "?17 +0-?8 ", "?17 +?8 -0", "?17 +?7 -0", "?17 +?6 -0", "?17 +?5 -0", "?17 +?4 -0", "?17 +?3 -0", "?17 +?2 -0", "logheight/2", "?32 +0-?10 ", "?32 +0-?11 ", "?32 +0-?12 ", "?32 +0-?13 ", "?32 +0-?14 ", "?32 +0-?15 ", "?32 +0-?16 ", "?32 +?16 -0", "?32 +?15 -0", "?32 +?14 -0", "?32 +?13 -0", "?32 +?12 -0", "?32 +?11 -0", "?32 +?10 -0", "?1 *?0 /50000", "?9 *?0 /50000", "?47 *99518/100000", "?47 *95694/100000", "?47 *88192/100000", "?47 *77301/100000", "?47 *63439/100000", "?47 *47140/100000", "?47 *29028/100000", "?47 *9802/100000", "?48 *99518/100000", "?48 *95694/100000", "?48 *88192/100000", "?48 *77301/100000", "?48 *63439/100000", "?48 *47140/100000", "?48 *29028/100000", "?48 *9802/100000", "?17 +0-?49 ", "?17 +0-?50 ", "?17 +0-?51 ", "?17 +0-?52 ", "?17 +0-?53 ", "?17 +0-?54 ", "?17 +0-?55 ", "?17 +0-?56 ", "?17 +?56 -0", "?17 +?55 -0", "?17 +?54 -0", "?17 +?53 -0", "?17 +?52 -0", "?17 +?51 -0", "?17 +?50 -0", "?17 +?49 -0", "?32 +0-?57 ", "?32 +0-?58 ", "?32 +0-?59 ", "?32 +0-?60 ", "?32 +0-?61 ", "?32 +0-?62 ", "?32 +0-?63 ", "?32 +0-?64 ", "?32 +?64 -0", "?32 +?63 -0", "?32 +?62 -0", "?32 +?61 -0", "?32 +?60 -0", "?32 +?59 -0", "?32 +?58 -0", "?32 +?57 -0", "?47 *cos(pi*(2700000)/10800000)", "?48 *sin(pi*(2700000)/10800000)", "?17 +0-?97 ", "?32 +0-?98 ", "?17 +?97 -0", "?32 +?98 -0", "?32 +0-?48 ", "logheight", "logwidth" } +Handles +([][]com.sun.star.beans.PropertyValue) { { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 17 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 103 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 50000 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefY", Handle = (long) 0, Value = (any) { (long) 0 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } } +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 32 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 65 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 88 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 18 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 39 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 66 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 87 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 38 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 67 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 86 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 20 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 37 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 68 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 85 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 21 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 36 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 69 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 84 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 22 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 35 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 70 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 83 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 23 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 34 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 71 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 82 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 24 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 33 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 72 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 81 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 17 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 73 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 81 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 25 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 33 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 74 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 82 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 26 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 34 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 75 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 83 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 27 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 35 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 76 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 84 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 28 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 36 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 77 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 85 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 29 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 37 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 78 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 86 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 30 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 38 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 79 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 87 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 31 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 39 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 80 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 88 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 105 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 32 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 80 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 89 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 31 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 40 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 79 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 90 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 30 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 41 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 78 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 91 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 29 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 42 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 77 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 92 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 28 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 43 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 76 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 93 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 27 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 44 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 75 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 94 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 26 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 45 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 74 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 95 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 25 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 46 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 73 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 96 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 17 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 104 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 72 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 96 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 24 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 46 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 71 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 95 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 23 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 45 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 70 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 94 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 22 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 44 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 69 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 93 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 21 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 43 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 68 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 92 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 20 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 42 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 67 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 91 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 41 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 66 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 90 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 18 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 40 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 65 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 89 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 63 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 99 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 100 }, Type = (short) 1 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 101 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 102 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* star4 */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) { { Value = (any) { (long) 12500 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj" } } +Equations +([]string) { "if(0-$0 ,0,if(50000-$0 ,$0 ,50000))", "logwidth/2", "?1 *?0 /50000", "logheight/2", "?3 *?0 /50000", "?2 *cos(pi*(2700000)/10800000)", "?4 *sin(pi*(2700000)/10800000)", "logwidth/2", "?7 +0-?5 ", "?7 +?5 -0", "logheight/2", "?10 +0-?6 ", "?10 +?6 -0", "?10 +0-?4 ", "logheight", "logwidth" } +Handles +([][]com.sun.star.beans.PropertyValue) { { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 50000 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefY", Handle = (long) 0, Value = (any) { (long) 0 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } } +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 7 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* star5 */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) { { Value = (any) { (long) 19098 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj" }, { Value = (any) { (long) 105146 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "hf" }, { Value = (any) { (long) 110557 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "vf" } } +Equations +([]string) { "if(0-$0 ,0,if(50000-$0 ,$0 ,50000))", "logwidth/2", "?1 *$1 /100000", "logheight/2", "?3 *$2 /100000", "logheight/2", "?5 *$2 /100000", "?2 *cos(pi*(1080000)/10800000)", "?2 *cos(pi*(18360000)/10800000)", "?4 *sin(pi*(1080000)/10800000)", "?4 *sin(pi*(18360000)/10800000)", "logwidth/2", "?11 +0-?7 ", "?11 +0-?8 ", "?11 +?8 -0", "?11 +?7 -0", "?6 +0-?9 ", "?6 +0-?10 ", "?2 *?0 /50000", "?4 *?0 /50000", "?18 *cos(pi*(20520000)/10800000)", "?18 *cos(pi*(3240000)/10800000)", "?19 *sin(pi*(3240000)/10800000)", "?19 *sin(pi*(20520000)/10800000)", "?11 +0-?20 ", "?11 +0-?21 ", "?11 +?21 -0", "?11 +?20 -0", "?6 +0-?22 ", "?6 +0-?23 ", "?6 +?19 -0", "?6 +0-?19 " } +Handles +([][]com.sun.star.beans.PropertyValue) { { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 31 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 50000 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefY", Handle = (long) 0, Value = (any) { (long) 0 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } } +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 25 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 28 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 26 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 28 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 27 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 29 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 17 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 30 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 17 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 24 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 29 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 9 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 24 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 28 }, Type = (short) 1 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 27 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 30 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* star6 */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) { { Value = (any) { (long) 28868 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj" }, { Value = (any) { (long) 115470 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "hf" } } +Equations +([]string) { "if(0-$0 ,0,if(50000-$0 ,$0 ,50000))", "logwidth/2", "?1 *$1 /100000", "?2 *cos(pi*(1800000)/10800000)", "logwidth/2", "?4 +0-?3 ", "?4 +?3 -0", "logheight/2", "logheight/4", "?7 +?8 -0", "?2 *?0 /50000", "logheight/2", "?11 *?0 /50000", "?10 *1/2", "?4 +0-?10 ", "?4 +0-?13 ", "?4 +?13 -0", "?4 +?10 -0", "?12 *sin(pi*(3600000)/10800000)", "?7 +0-?18 ", "?7 +?18 -0", "?7 +0-?12 ", "logheight" } +Handles +([][]com.sun.star.beans.PropertyValue) { { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 21 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 50000 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefY", Handle = (long) 0, Value = (any) { (long) 0 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } } +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 17 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 20 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 22 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 20 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 11 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 17 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 20 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* star7 */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) { { Value = (any) { (long) 34601 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj" }, { Value = (any) { (long) 102572 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "hf" }, { Value = (any) { (long) 105210 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "vf" } } +Equations +([]string) { "if(0-$0 ,0,if(50000-$0 ,$0 ,50000))", "logwidth/2", "?1 *$1 /100000", "logheight/2", "?3 *$2 /100000", "logheight/2", "?5 *$2 /100000", "?2 *97493/100000", "?2 *78183/100000", "?2 *43388/100000", "?4 *62349/100000", "?4 *22252/100000", "?4 *90097/100000", "logwidth/2", "?13 +0-?7 ", "?13 +0-?8 ", "?13 +0-?9 ", "?13 +?9 -0", "?13 +?8 -0", "?13 +?7 -0", "?6 +0-?10 ", "?6 +?11 -0", "?6 +?12 -0", "?2 *?0 /50000", "?4 *?0 /50000", "?23 *97493/100000", "?23 *78183/100000", "?23 *43388/100000", "?13 +0-?25 ", "?13 +0-?26 ", "?13 +0-?27 ", "?13 +?27 -0", "?13 +?26 -0", "?13 +?25 -0", "?24 *90097/100000", "?24 *22252/100000", "?24 *62349/100000", "?6 +0-?34 ", "?6 +0-?35 ", "?6 +?36 -0", "?6 +?24 -0", "?6 +0-?24 " } +Handles +([][]com.sun.star.beans.PropertyValue) { { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 41 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 50000 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefY", Handle = (long) 0, Value = (any) { (long) 0 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } } +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 21 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 28 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 38 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 20 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 30 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 37 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 31 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 37 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 18 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 20 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 33 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 38 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 21 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 32 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 39 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 17 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 22 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 40 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 22 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 29 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 39 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 13 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 29 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 37 }, Type = (short) 1 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 32 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 39 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* star8 */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) { { Value = (any) { (long) 37500 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj" } } +Equations +([]string) { "if(0-$0 ,0,if(50000-$0 ,$0 ,50000))", "logwidth/2", "?1 *cos(pi*(2700000)/10800000)", "logwidth/2", "?3 +0-?2 ", "?3 +?2 -0", "logheight/2", "?6 *sin(pi*(2700000)/10800000)", "logheight/2", "?8 +0-?7 ", "?8 +?7 -0", "?1 *?0 /50000", "?6 *?0 /50000", "?11 *92388/100000", "?11 *38268/100000", "?12 *92388/100000", "?12 *38268/100000", "?3 +0-?13 ", "?3 +0-?14 ", "?3 +?14 -0", "?3 +?13 -0", "?8 +0-?15 ", "?8 +0-?16 ", "?8 +?16 -0", "?8 +?15 -0", "?8 +0-?12 ", "logwidth", "logheight" } +Handles +([][]com.sun.star.beans.PropertyValue) { { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 25 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 50000 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefY", Handle = (long) 0, Value = (any) { (long) 0 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } } +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 17 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 22 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 18 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 21 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 21 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 20 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 22 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 26 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 20 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 23 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 24 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 27 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 18 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 24 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 17 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 23 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 15 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 17 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 21 }, Type = (short) 1 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 20 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 24 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* straightConnector1 */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) {} +Equations +([]string) { "logwidth", "logheight" } +Handles +([][]com.sun.star.beans.PropertyValue) {} +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 6, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* stripedRightArrow */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) { { Value = (any) { (long) 50000 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj1" }, { Value = (any) { (long) 50000 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj2" } } +Equations +([]string) { "min(logwidth,logheight)", "84375*logwidth/?0 ", "if(0-$0 ,0,if(100000-$0 ,$0 ,100000))", "if(0-$1 ,0,if(?1 -$1 ,$1 ,?1 ))", "?0 *5/32", "?0 *?3 /100000", "logwidth+0-?5 ", "logheight*?2 /200000", "logheight/2", "?8 +0-?7 ", "?8 +?7 -0", "logheight/2", "?7 *?5 /?11 ", "logwidth+0-?12 ", "logheight", "logwidth", "min(logwidth,logheight)/32", "min(logwidth,logheight)/16", "min(logwidth,logheight)/8" } +Handles +([][]com.sun.star.beans.PropertyValue) { { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 100000 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefY", Handle = (long) 0, Value = (any) { (long) 0 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } }, { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 1 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefX", Handle = (long) 0, Value = (any) { (long) 1 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } } +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 17 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 18 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 18 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 17 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 3 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 3 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 6 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* sun */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) { { Value = (any) { (long) 25000 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj" } } +Equations +([]string) { "if(12500-$0 ,12500,if(46875-$0 ,$0 ,46875))", "50000+0-?0 ", "?1 *30274/32768", "?1 *12540/32768", "?2 +50000-0", "?3 +50000-0", "50000+0-?2 ", "50000+0-?3 ", "?1 *23170/32768", "50000+?8 -0", "50000+0-?8 ", "?6 *3/4", "?7 *3/4", "?11 +3662-0", "?12 +3662-0", "?12 +12500-0", "100000+0-?11 ", "100000+0-?13 ", "100000+0-?14 ", "100000+0-?15 ", "logwidth*18436/21600", "logheight*3163/21600", "logwidth*3163/21600", "logheight*18436/21600", "logwidth*?9 /100000", "logwidth*?10 /100000", "logwidth*?11 /100000", "logwidth*?13 /100000", "logwidth*?14 /100000", "logwidth*?15 /100000", "logwidth*?16 /100000", "logwidth*?17 /100000", "logwidth*?18 /100000", "logwidth*?19 /100000", "logwidth*?0 /100000", "logwidth*?1 /100000", "logheight*?1 /100000", "logheight*?9 /100000", "logheight*?10 /100000", "logheight*?11 /100000", "logheight*?13 /100000", "logheight*?14 /100000", "logheight*?15 /100000", "logheight*?16 /100000", "logheight*?17 /100000", "logheight*?18 /100000", "logheight*?19 /100000", "logheight/2", "logwidth/2", "logheight", "logwidth", "(10800000)/60000.0", "(21600000)/60000.0" } +Handles +([][]com.sun.star.beans.PropertyValue) { { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 34 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 47 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 46875 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12500 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefX", Handle = (long) 0, Value = (any) { (long) 0 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } } +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 50 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 47 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 30 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 46 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 30 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 42 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 20 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 21 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 31 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 41 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 32 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 40 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 48 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 33 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 39 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 29 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 39 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 22 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 21 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 28 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 40 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 27 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 41 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 47 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 26 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 42 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 26 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 46 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 22 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 23 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 27 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 45 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 28 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 44 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 48 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 49 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 29 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 43 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 33 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 43 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 20 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 23 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 32 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 44 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 31 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 45 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 34 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 47 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 35 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 36 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 51 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 52 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 2 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 2 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 2 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 2 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 2 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 2 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 2 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 2 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 25 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 38 }, Type = (short) 1 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 24 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 37 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* swooshArrow */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) { { Value = (any) { (long) 25000 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj1" }, { Value = (any) { (long) 16667 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj2" } } +Equations +([]string) { "if(1-$0 ,1,if(75000-$0 ,$0 ,75000))", "min(logwidth,logheight)", "70000*logwidth/?1 ", "if(0-$1 ,0,if(?2 -$1 ,$1 ,?2 ))", "logheight*?0 /100000", "?1 *?3 /100000", "logwidth+0-?5 ", "min(logwidth,logheight)/8", "0+?7 -0", "5400000*1/14", "?7 *tan(pi*(?9 )/10800000)", "?6 +0-?10 ", "?4 *tan(pi*(?9 )/10800000)", "?8 +?4 -0", "?6 +?12 -0", "?14 +?10 -0", "?13 +?7 -0", "?16 +0-0", "?17 *1/2", "logheight*1/20", "0+?18 -?19 ", "logheight/6", "?21 *1/1", "?21 +?22 -0", "logwidth/6", "?24 ", "?21 *1/2", "?13 +?26 -0", "logwidth/4", "?28 ", "logheight", "logwidth" } +Handles +([][]com.sun.star.beans.PropertyValue) { { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 75000 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefY", Handle = (long) 0, Value = (any) { (long) 0 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } }, { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefX", Handle = (long) 0, Value = (any) { (long) 1 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } } +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 30 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 25 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 23 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 31 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 20 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 29 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 27 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 30 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 16, Count = (short) 1 }, { Command = (short) 2, Count = (short) 4 }, { Command = (short) 16, Count = (short) 1 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 31 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 30 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* teardrop */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) { { Value = (any) { (long) 100000 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj" } } +Equations +([]string) { "if(0-$0 ,0,if(200000-$0 ,$0 ,200000))", "sqrt(2)", "logwidth/2", "?2 *?1 /1", "logheight/2", "?4 *?1 /1", "?3 *?0 /100000", "?5 *?0 /100000", "?6 *cos(pi*(2700000)/10800000)", "?7 *sin(pi*(2700000)/10800000)", "logwidth/2", "?10 +?8 -0", "logheight/2", "?12 +0-?9 ", "(?10 +?11 )/2", "(?12 +?13 )/2", "?2 *cos(pi*(2700000)/10800000)", "?4 *sin(pi*(2700000)/10800000)", "?10 +0-?16 ", "?10 +?16 -0", "?12 +0-?17 ", "?12 +?17 -0", "logwidth", "logheight", "(10800000)/60000.0", "(5400000)/60000.0", "(0)/60000.0", "(5400000)/60000.0", "(5400000)/60000.0", "(5400000)/60000.0" } +Handles +([][]com.sun.star.beans.PropertyValue) { { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 200000 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefX", Handle = (long) 0, Value = (any) { (long) 0 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } } +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 24 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 25 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 22 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 22 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 26 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 27 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 28 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 29 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 16, Count = (short) 2 }, { Command = (short) 17, Count = (short) 2 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 18 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 20 }, Type = (short) 1 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 21 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* trapezoid */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) { { Value = (any) { (long) 25000 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj" } } +Equations +([]string) { "min(logwidth,logheight)", "50000*logwidth/?0 ", "if(0-$0 ,0,if(?1 -$0 ,$0 ,?1 ))", "?0 *?2 /200000", "?0 *?2 /100000", "logwidth+0-?4 ", "logwidth+0-?3 ", "logwidth/3", "?7 *?2 /?1 ", "logheight/3", "?9 *?2 /?1 ", "logwidth+0-?8 ", "logwidth/2", "logheight/2", "logheight", "logwidth" } +Handles +([][]com.sun.star.beans.PropertyValue) { { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 1 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefX", Handle = (long) 0, Value = (any) { (long) 0 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } } +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "GluePoints", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 3 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 1 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* triangle */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) { { Value = (any) { (long) 50000 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj" } } +Equations +([]string) { "if(0-$0 ,0,if(100000-$0 ,$0 ,100000))", "logwidth*?0 /200000", "logwidth*?0 /100000", "logwidth/2", "?1 +?3 -0", "logheight/2", "logheight", "logwidth" } +Handles +([][]com.sun.star.beans.PropertyValue) { { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 100000 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefX", Handle = (long) 0, Value = (any) { (long) 0 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } } +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "GluePoints", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 2 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* upArrow */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) { { Value = (any) { (long) 50000 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj1" }, { Value = (any) { (long) 50000 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj2" } } +Equations +([]string) { "min(logwidth,logheight)", "100000*logheight/?0 ", "if(0-$0 ,0,if(100000-$0 ,$0 ,100000))", "if(0-$1 ,0,if(?1 -$1 ,$1 ,?1 ))", "?0 *?3 /100000", "0+?4 -0", "logwidth*?2 /200000", "logwidth/2", "?7 +0-?6 ", "?7 +?6 -0", "logwidth/2", "?8 *?4 /?10 ", "?5 +0-?11 ", "logheight", "logwidth" } +Handles +([][]com.sun.star.beans.PropertyValue) { { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 100000 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefX", Handle = (long) 0, Value = (any) { (long) 0 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } }, { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 1 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefY", Handle = (long) 0, Value = (any) { (long) 1 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } } +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 6 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12 }, Type = (short) 1 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* upArrowCallout */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) { { Value = (any) { (long) 25000 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj1" }, { Value = (any) { (long) 25000 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj2" }, { Value = (any) { (long) 25000 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj3" }, { Value = (any) { (long) 64977 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj4" } } +Equations +([]string) { "min(logwidth,logheight)", "50000*logwidth/?0 ", "if(0-$1 ,0,if(?1 -$1 ,$1 ,?1 ))", "?2 *2/1", "if(0-$0 ,0,if(?3 -$0 ,$0 ,?3 ))", "100000*logheight/?0 ", "if(0-$2 ,0,if(?5 -$2 ,$2 ,?5 ))", "?6 *?0 /logheight", "100000+0-?7 ", "if(0-$3 ,0,if(?8 -$3 ,$3 ,?8 ))", "?0 *?2 /100000", "?0 *?4 /200000", "logwidth/2", "?12 +0-?10 ", "?12 +0-?11 ", "?12 +?11 -0", "?12 +?10 -0", "?0 *?6 /100000", "logheight*?9 /100000", "logheight+0-?18 ", "(?19 +logheight)/2", "logwidth", "logheight" } +Handles +([][]com.sun.star.beans.PropertyValue) { { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 17 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefX", Handle = (long) 0, Value = (any) { (long) 0 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } }, { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 1 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefX", Handle = (long) 0, Value = (any) { (long) 1 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } }, { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 21 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 17 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefY", Handle = (long) 0, Value = (any) { (long) 2 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } }, { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefY", Handle = (long) 0, Value = (any) { (long) 3 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } } +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 17 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 17 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 17 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 17 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 21 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 21 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 22 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 22 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 10 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 21 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 22 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* upDownArrow */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) { { Value = (any) { (long) 50000 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj1" }, { Value = (any) { (long) 50000 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj2" } } +Equations +([]string) { "min(logwidth,logheight)", "50000*logheight/?0 ", "if(0-$0 ,0,if(100000-$0 ,$0 ,100000))", "if(0-$1 ,0,if(?1 -$1 ,$1 ,?1 ))", "?0 *?3 /100000", "logheight+0-?4 ", "logwidth*?2 /200000", "logwidth/2", "?7 +0-?6 ", "?7 +?6 -0", "logwidth/2", "?8 *?4 /?10 ", "?4 +0-?11 ", "?5 +?11 -0", "logheight/2", "logheight", "logwidth" } +Handles +([][]com.sun.star.beans.PropertyValue) { { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 100000 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefX", Handle = (long) 0, Value = (any) { (long) 0 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } }, { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 1 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefY", Handle = (long) 0, Value = (any) { (long) 1 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } } +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 9 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12 }, Type = (short) 1 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* upDownArrowCallout */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) { { Value = (any) { (long) 25000 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj1" }, { Value = (any) { (long) 25000 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj2" }, { Value = (any) { (long) 25000 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj3" }, { Value = (any) { (long) 48123 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj4" } } +Equations +([]string) { "min(logwidth,logheight)", "50000*logwidth/?0 ", "if(0-$1 ,0,if(?1 -$1 ,$1 ,?1 ))", "?2 *2/1", "if(0-$0 ,0,if(?3 -$0 ,$0 ,?3 ))", "50000*logheight/?0 ", "if(0-$2 ,0,if(?5 -$2 ,$2 ,?5 ))", "logheight/2", "?6 *?0 /?7 ", "100000+0-?8 ", "if(0-$3 ,0,if(?9 -$3 ,$3 ,?9 ))", "?0 *?2 /100000", "?0 *?4 /200000", "logwidth/2", "?13 +0-?11 ", "?13 +0-?12 ", "?13 +?12 -0", "?13 +?11 -0", "?0 *?6 /100000", "logheight+0-?18 ", "logheight*?10 /200000", "logheight/2", "?21 +0-?20 ", "?21 +?20 -0", "logwidth", "logheight" } +Handles +([][]com.sun.star.beans.PropertyValue) { { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 18 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefX", Handle = (long) 0, Value = (any) { (long) 0 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } }, { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 1 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefX", Handle = (long) 0, Value = (any) { (long) 1 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } }, { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 24 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 18 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefY", Handle = (long) 0, Value = (any) { (long) 2 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } }, { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 22 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefY", Handle = (long) 0, Value = (any) { (long) 3 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } } +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 22 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 22 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 18 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 18 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 17 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 18 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 18 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 22 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 24 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 22 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 24 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 23 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 23 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 17 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 25 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 23 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 23 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 17 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 22 }, Type = (short) 1 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 24 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 23 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* uturnArrow */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) { { Value = (any) { (long) 25000 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj1" }, { Value = (any) { (long) 25000 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj2" }, { Value = (any) { (long) 25000 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj3" }, { Value = (any) { (long) 43750 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj4" }, { Value = (any) { (long) 75000 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj5" } } +Equations +([]string) { "if(0-$1 ,0,if(25000-$1 ,$1 ,25000))", "?0 *2/1", "if(0-$0 ,0,if(?1 -$0 ,$0 ,?1 ))", "min(logwidth,logheight)", "?2 *?3 /logheight", "100000+0-?4 ", "?5 *logheight/?3 ", "if(0-$2 ,0,if(?6 -$2 ,$2 ,?6 ))", "?7 +?2 -0", "?8 *?3 /logheight", "if(?9 -$4 ,?9 ,if(100000-$4 ,$4 ,100000))", "?3 *?2 /100000", "?3 *?0 /100000", "?11 *1/2", "?12 +0-?13 ", "logheight*?10 /100000", "?3 *?7 /100000", "?15 +0-?16 ", "logwidth+0-?14 ", "?18 *1/2", "min(?19 ,?17 )", "?20 *100000/?3 ", "if(0-$3 ,0,if(?21 -$3 ,$3 ,?21 ))", "?3 *?22 /100000", "?23 +0-?11 ", "max(?24 ,0)", "?11 +?25 -0", "logwidth+0-?12 ", "?27 +0-?12 ", "?28 +?14 -0", "?18 +0-?23 ", "?29 +0-?25 ", "(?11 +?29 )/2", "logheight", "logwidth", "(10800000)/60000.0", "(5400000)/60000.0", "(16200000)/60000.0", "(5400000)/60000.0", "(0)/60000.0", "(-5400000)/60000.0", "(16200000)/60000.0", "(-5400000)/60000.0" } +Handles +([][]com.sun.star.beans.PropertyValue) { { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 33 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 1 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefX", Handle = (long) 0, Value = (any) { (long) 0 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } }, { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 28 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 33 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 25000 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefX", Handle = (long) 0, Value = (any) { (long) 1 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } }, { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 28 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 17 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefY", Handle = (long) 0, Value = (any) { (long) 2 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } }, { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 23 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 21 }, Type = (short) 1 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefX", Handle = (long) 0, Value = (any) { (long) 3 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } }, { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 34 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 100000 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefY", Handle = (long) 0, Value = (any) { (long) 4 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } } +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 33 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 23 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 23 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 23 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 35 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 36 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 30 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 23 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 23 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 37 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 38 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 18 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 17 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 34 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 17 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 27 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 28 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 17 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 29 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 17 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 29 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 26 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 25 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 25 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 39 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 40 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 26 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 25 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 25 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 41 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 42 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 33 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 2, Count = (short) 6 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 34 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 33 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* verticalScroll */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) { { Value = (any) { (long) 12500 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj" } } +Equations +([]string) { "if(0-$0 ,0,if(25000-$0 ,$0 ,25000))", "min(logwidth,logheight)", "?1 *?0 /100000", "?2 *1/2", "?2 *1/4", "?2 +?3 -0", "?2 +?2 -0", "logwidth+0-?2 ", "logwidth+0-?3 ", "?7 +0-?3 ", "logheight+0-?2 ", "logheight+0-?3 ", "logwidth/2", "logheight/2", "logheight", "(5400000)/60000.0", "(-5400000)/60000.0", "(5400000)/60000.0", "(-10800000)/60000.0", "(10800000)/60000.0", "(5400000)/60000.0", "(16200000)/60000.0", "(10800000)/60000.0", "(0)/60000.0", "(5400000)/60000.0", "(0)/60000.0", "(5400000)/60000.0", "(5400000)/60000.0", "(10800000)/60000.0", "(0)/60000.0", "(5400000)/60000.0", "(5400000)/60000.0", "(10800000)/60000.0", "(0)/60000.0", "(16200000)/60000.0", "(16200000)/60000.0", "(10800000)/60000.0", "(10800000)/60000.0", "(5400000)/60000.0", "(16200000)/60000.0", "(10800000)/60000.0", "(0)/60000.0", "(5400000)/60000.0", "(5400000)/60000.0", "(10800000)/60000.0", "(16200000)/60000.0", "(10800000)/60000.0", "(5400000)/60000.0", "(10800000)/60000.0", "(16200000)/60000.0", "(10800000)/60000.0", "(5400000)/60000.0", "(-5400000)/60000.0" } +Handles +([][]com.sun.star.beans.PropertyValue) { { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 25000 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefY", Handle = (long) 0, Value = (any) { (long) 0 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } } +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 17 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 18 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 20 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 21 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 22 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 23 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 24 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 25 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 26 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 27 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 28 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 29 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 30 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 31 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 32 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 33 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 34 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 35 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 36 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 37 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 38 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 39 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 40 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 41 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 42 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 43 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 44 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 45 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 46 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 47 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 48 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 49 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 50 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 51 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 52 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 2, Count = (short) 2 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 2, Count = (short) 2 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 17, Count = (short) 2 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 7, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 17, Count = (short) 2 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 17, Count = (short) 2 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 19, Count = (short) 0 }, { Command = (short) 7, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 2, Count = (short) 2 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 17, Count = (short) 2 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 1, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 6, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* wave */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) { { Value = (any) { (long) 12500 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj1" }, { Value = (any) { (long) 0 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj2" } } +Equations +([]string) { "if(0-$0 ,0,if(20000-$0 ,$0 ,20000))", "if(-10000-$1 ,-10000,if(10000-$1 ,$1 ,10000))", "logheight*?0 /100000", "?2 *10/3", "?2 +0-?3 ", "?2 +?3 -0", "logheight+0-?2 ", "?6 +0-?3 ", "?6 +?3 -0", "logwidth*?1 /100000", "logwidth*?1 /50000", "abs(?9 )", "if(?10 ,0,?10 )", "0+0-?12 ", "if(?10 ,?10 ,0)", "logwidth+0-?14 ", "(?12 +?15 )/3", "?13 +?16 -0", "(?17 +?15 )/2", "0+?14 -0", "logwidth+?12 -0", "?19 +?16 -0", "(?21 +?20 )/2", "logwidth+0-?11 ", "logwidth/2", "?24 +?9 -0", "?24 +0-?9 ", "max(?13 ,?19 )", "min(?15 ,?20 )", "logheight*?0 /50000", "logheight+0-?29 ", "logheight", "logheight/2" } +Handles +([][]com.sun.star.beans.PropertyValue) { { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 20000 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefY", Handle = (long) 0, Value = (any) { (long) 0 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } }, { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 25 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 31 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10000 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) -10000 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefX", Handle = (long) 0, Value = (any) { (long) 1 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } } +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 17 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 18 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 20 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 22 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 21 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 3, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 3, Count = (short) 1 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 27 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 29 }, Type = (short) 1 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 28 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 30 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* wedgeEllipseCallout */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) { { Value = (any) { (long) -20833 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj1" }, { Value = (any) { (long) 62500 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj2" } } +Equations +([]string) { "logwidth*$0 /100000", "logheight*$1 /100000", "logwidth/2", "?2 +?0 -0", "logheight/2", "?4 +?1 -0", "?0 *logheight/1", "?1 *logwidth/1", "(10800000*atan2(?7 ,?6 ))/pi", "?8 +660000-0", "?8 +0-660000", "logwidth/2", "?11 *cos(pi*(?9 )/10800000)", "logheight/2", "?13 *sin(pi*(?9 )/10800000)", "?2 +?12 -0", "?4 +?14 -0", "?11 *cos(pi*(?10 )/10800000)", "?13 *sin(pi*(?10 )/10800000)", "?2 +?17 -0", "?4 +?18 -0", "(10800000*atan2(?14 ,?12 ))/pi", "(10800000*atan2(?18 ,?17 ))/pi", "?22 +0-?21 ", "?23 +21600000-0", "if(?23 ,?23 ,?24 )", "?11 *cos(pi*(2700000)/10800000)", "?13 *sin(pi*(2700000)/10800000)", "?2 +0-?26 ", "?2 +?26 -0", "?4 +0-?27 ", "?4 +?27 -0", "logheight", "logwidth", "(?21 )/60000.0", "(?25 )/60000.0" } +Handles +([][]com.sun.star.beans.PropertyValue) { { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) -2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) -2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefX", Handle = (long) 0, Value = (any) { (long) 0 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefY", Handle = (long) 0, Value = (any) { (long) 1 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } } +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 34 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 35 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 28 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 30 }, Type = (short) 1 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 29 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 31 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* wedgeRectCallout */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) { { Value = (any) { (long) -20833 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj1" }, { Value = (any) { (long) 62500 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj2" } } +Equations +([]string) { "logwidth*$0 /100000", "logheight*$1 /100000", "logwidth/2", "?2 +?0 -0", "logheight/2", "?4 +?1 -0", "?3 +0-?2 ", "?5 +0-?4 ", "?0 *logheight/logwidth", "abs(?1 )", "abs(?8 )", "?9 +0-?10 ", "if(?0 ,7,2)", "if(?0 ,10,5)", "logwidth*?12 /12", "logwidth*?13 /12", "if(?1 ,7,2)", "if(?1 ,10,5)", "logheight*?16 /12", "logheight*?17 /12", "if(?0 ,0,?3 )", "if(?11 ,0,?20 )", "if(?1 ,?14 ,?3 )", "if(?11 ,?22 ,?14 )", "if(?0 ,?3 ,logwidth)", "if(?11 ,logwidth,?24 )", "if(?1 ,?3 ,?14 )", "if(?11 ,?26 ,?14 )", "if(?0 ,?18 ,?5 )", "if(?11 ,?18 ,?28 )", "if(?1 ,0,?5 )", "if(?11 ,?30 ,0)", "if(?0 ,?5 ,?18 )", "if(?11 ,?18 ,?32 )", "if(?1 ,?5 ,logheight)", "if(?11 ,?34 ,logheight)", "logheight", "logwidth" } +Handles +([][]com.sun.star.beans.PropertyValue) { { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) -2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) -2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefX", Handle = (long) 0, Value = (any) { (long) 0 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefY", Handle = (long) 0, Value = (any) { (long) 1 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } } +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 23 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 31 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 37 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 37 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 18 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 25 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 33 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 37 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 37 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 36 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 36 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 27 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 35 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 36 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 36 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 21 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 29 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 18 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 15 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 37 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 36 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } +/* wedgeRoundRectCallout */ +AdjustmentValues +([]com.sun.star.drawing.EnhancedCustomShapeAdjustmentValue) { { Value = (any) { (long) -20833 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj1" }, { Value = (any) { (long) 62500 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj2" }, { Value = (any) { (long) 16667 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE, Name = "adj3" } } +Equations +([]string) { "logwidth*$0 /100000", "logheight*$1 /100000", "logwidth/2", "?2 +?0 -0", "logheight/2", "?4 +?1 -0", "?0 *logheight/logwidth", "abs(?1 )", "abs(?6 )", "?7 +0-?8 ", "if(?0 ,7,2)", "if(?0 ,10,5)", "logwidth*?10 /12", "logwidth*?11 /12", "if(?1 ,7,2)", "if(?1 ,10,5)", "logheight*?14 /12", "logheight*?15 /12", "if(?0 ,0,?3 )", "if(?9 ,0,?18 )", "if(?1 ,?12 ,?3 )", "if(?9 ,?20 ,?12 )", "if(?0 ,?3 ,logwidth)", "if(?9 ,logwidth,?22 )", "if(?1 ,?3 ,?12 )", "if(?9 ,?24 ,?12 )", "if(?0 ,?16 ,?5 )", "if(?9 ,?16 ,?26 )", "if(?1 ,0,?5 )", "if(?9 ,?28 ,0)", "if(?0 ,?5 ,?16 )", "if(?9 ,?16 ,?30 )", "if(?1 ,?5 ,logheight)", "if(?9 ,?32 ,logheight)", "min(logwidth,logheight)", "?34 *$2 /100000", "logwidth+0-?35 ", "logheight+0-?35 ", "?35 *29289/100000", "logwidth+0-?38 ", "logheight+0-?38 ", "logheight", "logwidth", "(10800000)/60000.0", "(5400000)/60000.0", "(16200000)/60000.0", "(5400000)/60000.0", "(0)/60000.0", "(5400000)/60000.0", "(5400000)/60000.0", "(5400000)/60000.0" } +Handles +([][]com.sun.star.beans.PropertyValue) { { { Name = "Position", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeXMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) -2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMaximum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RangeYMinimum", Handle = (long) 0, Value = (any) { (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) -2147483647 }, Type = (short) 0 } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefX", Handle = (long) 0, Value = (any) { (long) 0 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "RefY", Handle = (long) 0, Value = (any) { (long) 1 }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } } +MirroredX +false +MirroredY +false +Path +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 35 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 35 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 35 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 43 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 44 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 21 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 29 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 36 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 35 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 35 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 45 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 46 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 42 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 23 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 31 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 42 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 17 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 42 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 37 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 35 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 35 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 47 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 48 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 41 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 25 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 33 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 41 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 35 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 41 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 35 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 35 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 49 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 50 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 17 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 27 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 2, Count = (short) 4 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 2, Count = (short) 4 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 2, Count = (short) 4 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 2, Count = (short) 3 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 38 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 38 }, Type = (short) 1 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 39 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 40 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +Type +"ooxml-non-primitive" +ViewBox +(com.sun.star.awt.Rectangle) { X = (long) 0, Y = (long) 0, Width = (long) 0, Height = (long) 0 } diff --git a/oox/source/drawingml/customshapes/presetShapeDefinitions.xml b/oox/source/drawingml/customshapes/presetShapeDefinitions.xml new file mode 100644 index 000000000..7123e27cc --- /dev/null +++ b/oox/source/drawingml/customshapes/presetShapeDefinitions.xml @@ -0,0 +1,19898 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/oox/source/drawingml/diagram/constraintlistcontext.cxx b/oox/source/drawingml/diagram/constraintlistcontext.cxx new file mode 100644 index 000000000..cc1f13026 --- /dev/null +++ b/oox/source/drawingml/diagram/constraintlistcontext.cxx @@ -0,0 +1,78 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include "constraintlistcontext.hxx" +#include +#include +#include + +using namespace ::oox::core; +using namespace ::com::sun::star::uno; +using namespace ::com::sun::star::xml::sax; + +namespace oox::drawingml { + +// CT_ConstraintLists +ConstraintListContext::ConstraintListContext( ContextHandler2Helper const & rParent, + const LayoutAtomPtr &pNode ) + : ContextHandler2( rParent ) + , mpNode( pNode ) +{ + assert( pNode && "Node must NOT be NULL" ); +} + +ConstraintListContext::~ConstraintListContext() +{ +} + +ContextHandlerRef +ConstraintListContext::onCreateContext( ::sal_Int32 aElement, + const AttributeList& rAttribs ) +{ + switch( aElement ) + { + case DGM_TOKEN( constr ): + { + auto pNode = std::make_shared(mpNode->getLayoutNode()); + LayoutAtom::connect(mpNode, pNode); + + Constraint& rConstraint = pNode->getConstraint(); + rConstraint.mnFor = rAttribs.getToken( XML_for, XML_none ); + rConstraint.msForName = rAttribs.getString( XML_forName, "" ); + rConstraint.mnPointType = rAttribs.getToken( XML_ptType, XML_none ); + rConstraint.mnType = rAttribs.getToken( XML_type, XML_none ); + rConstraint.mnRefFor = rAttribs.getToken( XML_refFor, XML_none ); + rConstraint.msRefForName = rAttribs.getString( XML_refForName, "" ); + rConstraint.mnRefType = rAttribs.getToken( XML_refType, XML_none ); + rConstraint.mnRefPointType = rAttribs.getToken( XML_refPtType, XML_none ); + rConstraint.mfFactor = rAttribs.getDouble( XML_fact, 1.0 ); + rConstraint.mfValue = rAttribs.getDouble( XML_val, 0.0 ); + rConstraint.mnOperator = rAttribs.getToken( XML_op, XML_none ); + break; + } + default: + break; + } + + return this; +} + +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/drawingml/diagram/constraintlistcontext.hxx b/oox/source/drawingml/diagram/constraintlistcontext.hxx new file mode 100644 index 000000000..ba3b59355 --- /dev/null +++ b/oox/source/drawingml/diagram/constraintlistcontext.hxx @@ -0,0 +1,43 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_OOX_SOURCE_DRAWINGML_DIAGRAM_CONSTRAINTLISTCONTEXT_HXX +#define INCLUDED_OOX_SOURCE_DRAWINGML_DIAGRAM_CONSTRAINTLISTCONTEXT_HXX + +#include +#include "diagramlayoutatoms.hxx" + +namespace oox::drawingml { + +class ConstraintListContext : public ::oox::core::ContextHandler2 +{ +public: + ConstraintListContext( ContextHandler2Helper const & rParent, const LayoutAtomPtr &pNode ); + virtual ~ConstraintListContext() override; + + virtual ::oox::core::ContextHandlerRef onCreateContext( ::sal_Int32 Element, const AttributeList& rAttribs ) override; +private: + LayoutAtomPtr mpNode; +}; + +} + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/drawingml/diagram/datamodel.cxx b/oox/source/drawingml/diagram/datamodel.cxx new file mode 100644 index 000000000..97691af43 --- /dev/null +++ b/oox/source/drawingml/diagram/datamodel.cxx @@ -0,0 +1,468 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include "datamodel.hxx" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +using namespace ::com::sun::star; + +namespace oox::drawingml { + +Shape* DiagramData::getOrCreateAssociatedShape(const svx::diagram::Point& rPoint, bool bCreateOnDemand) const +{ + if(maPointShapeMap.end() == maPointShapeMap.find(rPoint.msModelId)) + { + const_cast(this)->maPointShapeMap[rPoint.msModelId] = ShapePtr(); + } + + const ShapePtr& rShapePtr = maPointShapeMap.find(rPoint.msModelId)->second; + + if(!rShapePtr && bCreateOnDemand) + { + const_cast(rShapePtr) = std::make_shared(); + + // If we did create a new oox::drawingml::Shape, directly apply + // available data from the Diagram ModelData to it as preparation + restoreDataFromModelToShapeAfterReCreation(rPoint, *rShapePtr); + } + + return rShapePtr.get(); +} + +void DiagramData::restoreDataFromModelToShapeAfterReCreation(const svx::diagram::Point& rPoint, Shape& rNewShape) +{ + // If we did create a new oox::drawingml::Shape, directly apply + // available data from the Diagram ModelData to it as preparation + + // This is e.g. the Text, but may get more (styles?) + if(!rPoint.msTextBody->msText.isEmpty()) + { + TextBodyPtr aNewTextBody(std::make_shared()); + rNewShape.setTextBody(aNewTextBody); + TextRunPtr pTextRun = std::make_shared(); + pTextRun->getText() = rPoint.msTextBody->msText; + aNewTextBody->addParagraph().addRun(pTextRun); + + if(!rPoint.msTextBody->maTextProps.empty()) + { + oox::PropertyMap& rTargetMap(aNewTextBody->getTextProperties().maPropertyMap); + + for (auto const& prop : rPoint.msTextBody->maTextProps) + { + const sal_Int32 nPropId(oox::PropertyMap::getPropertyId(prop.first)); + if(nPropId > 0) + rTargetMap.setAnyProperty(nPropId, prop.second); + } + } + } +} + +static void addProperty(const OUString& rName, + const css::uno::Reference< css::beans::XPropertySetInfo >& xInfo, + std::vector< std::pair< OUString, css::uno::Any >>& rTarget, + const css::uno::Reference< css::beans::XPropertySet >& xPropSet ) +{ + if(xInfo->hasPropertyByName(rName)) + rTarget.push_back(std::pair(OUString(rName), xPropSet->getPropertyValue(rName))); +} + +void DiagramData::secureStyleDataFromShapeToModel(::oox::drawingml::Shape& rShape) +{ + const std::vector< ShapePtr >& rChildren(rShape.getChildren()); + + if(!rChildren.empty()) + { + // group shape + for (auto& child : rChildren) + { + secureStyleDataFromShapeToModel(*child); + } + + // if group shape we are done. Do not secure properties for group shapes + return; + } + + // we need a XShape + const css::uno::Reference< css::drawing::XShape > &rXShape(rShape.getXShape()); + if(!rXShape) + return; + + // we need a ModelID for association + if(rShape.getDiagramDataModelID().isEmpty()) + return; + + // define target to save to + svx::diagram::PointStyle* pTarget(nullptr); + const bool bIsBackgroundShape(rShape.getDiagramDataModelID() == msBackgroundShapeModelID); + + if(bIsBackgroundShape) + { + // if BackgroundShape, create properties & set as target + if(!maBackgroundShapeStyle) + maBackgroundShapeStyle = std::make_shared< svx::diagram::PointStyle >(); + pTarget = maBackgroundShapeStyle.get(); + } + else + { + // if Shape, seek association + for (auto & point : maPoints) + { + if(point.msModelId == rShape.getDiagramDataModelID()) + { + // found - create properties & set as target + pTarget = point.msPointStylePtr.get(); + + // we are done, there is no 2nd shape with the same ModelID by definition + break; + } + } + } + + // no target -> nothing to do + if(nullptr == pTarget) + return; + +#ifdef DBG_UTIL + // to easier decide which additional properties may/should be preserved, + // create a full list of set properties to browse/decide (in debugger) + const css::uno::Reference< css::beans::XPropertyState > xAllPropStates(rXShape, css::uno::UNO_QUERY); + const css::uno::Reference< css::beans::XPropertySet > xAllPropSet( rXShape, css::uno::UNO_QUERY ); + const css::uno::Sequence< css::beans::Property > allSequence(xAllPropSet->getPropertySetInfo()->getProperties()); + std::vector< std::pair< OUString, css::uno::Any >> allSetProps; + for (auto& rProp : allSequence) + { + try + { + if (xAllPropStates->getPropertyState(rProp.Name) == css::beans::PropertyState::PropertyState_DIRECT_VALUE) + { + css::uno::Any aValue(xAllPropSet->getPropertyValue(rProp.Name)); + if(aValue.hasValue()) + allSetProps.push_back(std::pair(rProp.Name, aValue)); + } + } + catch (...) + { + } + } +#endif + + const css::uno::Reference< css::beans::XPropertySet > xPropSet( rXShape, css::uno::UNO_QUERY ); + if(!xPropSet) + return; + + const css::uno::Reference< css::lang::XServiceInfo > xServiceInfo( rXShape, css::uno::UNO_QUERY ); + if(!xServiceInfo) + return; + + const css::uno::Reference< css::beans::XPropertySetInfo > xInfo(xPropSet->getPropertySetInfo()); + if (!xInfo.is()) + return; + + // Note: The Text may also be secured here, so it may also be possible to + // secure/store it at PointStyle instead of at TextBody, same maybe evaluated + // for the text attributes - where when securing here the attributes would be + // in our UNO API format already. + // if(xServiceInfo->supportsService("com.sun.star.drawing.Text")) + // { + // css::uno::Reference< css::text::XText > xText(rXShape, css::uno::UNO_QUERY); + // const OUString aText(xText->getString()); + // + // if(!aText.isEmpty()) + // { + // } + // } + + // Add all kinds of properties that are needed to re-create the XShape. + // For now this is a minimal example-selection, it will need to be extended + // over time for all kind of cases/properties + + // text properties + if(!bIsBackgroundShape + && xServiceInfo->supportsService("com.sun.star.drawing.TextProperties")) + { + addProperty(UNO_NAME_CHAR_COLOR, xInfo, pTarget->maProperties, xPropSet); + addProperty(UNO_NAME_CHAR_HEIGHT, xInfo, pTarget->maProperties, xPropSet); + addProperty(UNO_NAME_CHAR_SHADOWED, xInfo, pTarget->maProperties, xPropSet); + addProperty(UNO_NAME_CHAR_WEIGHT, xInfo, pTarget->maProperties, xPropSet); + } + + // fill properties + if(xServiceInfo->supportsService("com.sun.star.drawing.FillProperties")) + { + css::drawing::FillStyle eFillStyle(css::drawing::FillStyle_NONE); + if (xInfo->hasPropertyByName(UNO_NAME_FILLSTYLE)) + xPropSet->getPropertyValue(UNO_NAME_FILLSTYLE) >>= eFillStyle; + + if(css::drawing::FillStyle_NONE != eFillStyle) + { + addProperty(UNO_NAME_FILLSTYLE, xInfo, pTarget->maProperties, xPropSet); + + switch(eFillStyle) + { + case css::drawing::FillStyle_SOLID: + { + addProperty(UNO_NAME_FILLCOLOR, xInfo, pTarget->maProperties, xPropSet); + break; + } + default: + case css::drawing::FillStyle_NONE: + case css::drawing::FillStyle_GRADIENT: + case css::drawing::FillStyle_HATCH: + case css::drawing::FillStyle_BITMAP: + break; + } + } + } + + // line properties + if(!bIsBackgroundShape + && xServiceInfo->supportsService("com.sun.star.drawing.LineProperties")) + { + css::drawing::LineStyle eLineStyle(css::drawing::LineStyle_NONE); + if (xInfo->hasPropertyByName(UNO_NAME_LINESTYLE)) + xPropSet->getPropertyValue(UNO_NAME_LINESTYLE) >>= eLineStyle; + + if(css::drawing::LineStyle_NONE != eLineStyle) + { + addProperty(UNO_NAME_LINESTYLE, xInfo, pTarget->maProperties, xPropSet); + addProperty(UNO_NAME_LINECOLOR, xInfo, pTarget->maProperties, xPropSet); + addProperty(UNO_NAME_LINEWIDTH, xInfo, pTarget->maProperties, xPropSet); + + switch(eLineStyle) + { + case css::drawing::LineStyle_SOLID: + break; + default: + case css::drawing::LineStyle_NONE: + case css::drawing::LineStyle_DASH: + break; + } + } + } +} + +void DiagramData::secureDataFromShapeToModelAfterDiagramImport(::oox::drawingml::Shape& rRootShape) +{ + const std::vector< ShapePtr >& rChildren(rRootShape.getChildren()); + + for (auto& child : rChildren) + { + secureStyleDataFromShapeToModel(*child); + } + + // After Diagram import, parts of the Diagram ModelData is at the + // oox::drawingml::Shape. Since these objects are temporary helpers, + // secure that data at the Diagram ModelData by copying. + + // This is currently mainly the Text, but may get more (styles?) + for (auto & point : maPoints) + { + Shape* pShapeCandidate(getOrCreateAssociatedShape(point)); + + if(nullptr != pShapeCandidate) + { + if(pShapeCandidate->getTextBody() && !pShapeCandidate->getTextBody()->isEmpty()) + { + point.msTextBody->msText = pShapeCandidate->getTextBody()->toString(); + + const uno::Sequence< beans::PropertyValue > aTextProps( + pShapeCandidate->getTextBody()->getTextProperties().maPropertyMap.makePropertyValueSequence()); + + for (auto const& prop : aTextProps) + point.msTextBody->maTextProps.push_back(std::pair(prop.Name, prop.Value)); + } + + // At this place a mechanism to find missing data should be added: + // Create a Shape from so-far secured data & compare it with the + // imported one. Report differences to allow extending the mechanism + // more easily. +#ifdef DBG_UTIL + // The original is pShapeCandidate, re-create potential new oox::drawingml::Shape + // as aNew to be able to compare these + ShapePtr aNew(std::make_shared()); + restoreDataFromModelToShapeAfterReCreation(point, *aNew); + + // Unfortunately oox::drawingml::Shape has no operator==. I tried to add + // one, but that is too expensive. I stopped at oox::drawingml::Color. + // To compare it is necessary to use the debugger, or for single aspects + // of the oox data it might be possible to call local dump() methods at + // both instances to compare them/their output + + // bool bSame(aNew.get() == pShapeCandidate); +#endif + } + } +} + +void DiagramData::restoreStyleDataFromShapeToModel(::oox::drawingml::Shape& rShape) +{ + const std::vector< ShapePtr >& rChildren(rShape.getChildren()); + + if(!rChildren.empty()) + { + // group shape + for (auto& child : rChildren) + { + restoreStyleDataFromShapeToModel(*child); + } + + // if group shape we are done. Do not restore properties for group shapes + return; + } + + // we need a XShape + const css::uno::Reference< css::drawing::XShape > &rXShape(rShape.getXShape()); + if(!rXShape) + return; + + // we need a ModelID for association + if(rShape.getDiagramDataModelID().isEmpty()) + return; + + // define source to save to + svx::diagram::PointStyle* pSource(nullptr); + + if(rShape.getDiagramDataModelID() == msBackgroundShapeModelID) + { + // if BackgroundShape, set BackgroundShapeStyle as source + if(maBackgroundShapeStyle) + pSource = maBackgroundShapeStyle.get(); + } + else + { + // if Shape, seek association + for (auto & point : maPoints) + { + if(point.msModelId == rShape.getDiagramDataModelID()) + { + // found - create properties & set as source + pSource = point.msPointStylePtr.get(); + + // we are done, there is no 2nd shape with the same ModelID by definition + break; + } + } + } + + // no source -> nothing to do + if(nullptr == pSource) + return; + + // get target PropertySet of new XShape + css::uno::Reference xPropSet(rXShape, css::uno::UNO_QUERY); + if(!xPropSet) + return; + + // apply properties + for (auto const& prop : pSource->maProperties) + { + xPropSet->setPropertyValue(prop.first, prop.second); + } +} + +void DiagramData::restoreDataFromShapeToModelAfterDiagramImport(::oox::drawingml::Shape& rRootShape) +{ + const std::vector< ShapePtr >& rChildren(rRootShape.getChildren()); + + for (auto& child : rChildren) + { + restoreStyleDataFromShapeToModel(*child); + } +} + +DiagramData::DiagramData() +: svx::diagram::DiagramData() +, mpBackgroundShapeFillProperties( std::make_shared() ) +{ +} + +DiagramData::~DiagramData() +{ +} + +static void Connection_dump(const svx::diagram::Connection& rConnection) +{ + SAL_INFO( + "oox.drawingml", + "cnx modelId " << rConnection.msModelId << ", srcId " << rConnection.msSourceId << ", dstId " + << rConnection.msDestId << ", parTransId " << rConnection.msParTransId << ", presId " + << rConnection.msPresId << ", sibTransId " << rConnection.msSibTransId << ", srcOrd " + << rConnection.mnSourceOrder << ", dstOrd " << rConnection.mnDestOrder); +} + +static void Point_dump(const svx::diagram::Point& rPoint, const Shape* pShape) +{ + SAL_INFO( + "oox.drawingml", + "pt text " << pShape << ", cnxId " << rPoint.msCnxId << ", modelId " + << rPoint.msModelId << ", type " << rPoint.mnXMLType); +} + +void DiagramData::dump() const +{ + SAL_INFO("oox.drawingml", "Dgm: DiagramData # of cnx: " << maConnections.size() ); + for (const auto& rConnection : maConnections) + Connection_dump(rConnection); + + SAL_INFO("oox.drawingml", "Dgm: DiagramData # of pt: " << maPoints.size() ); + for (const auto& rPoint : maPoints) + Point_dump(rPoint, getOrCreateAssociatedShape(rPoint)); +} + +void DiagramData::buildDiagramDataModel(bool bClearOoxShapes) +{ + if(bClearOoxShapes) + { + // Delete/remove all existing oox::drawingml::Shape + maPointShapeMap.clear(); + } + + // call parent + svx::diagram::DiagramData::buildDiagramDataModel(bClearOoxShapes); + + if(bClearOoxShapes) + { + // re-create all existing oox::drawingml::Shape + svx::diagram::Points& rPoints = getPoints(); + + for (auto & point : rPoints) + { + // Create/get shape. Re-create here, that may also set needed + // and available data from the Diagram ModelData at the Shape + getOrCreateAssociatedShape(point, true); + } + } +} + +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/drawingml/diagram/datamodel.hxx b/oox/source/drawingml/diagram/datamodel.hxx new file mode 100644 index 000000000..21137f6e0 --- /dev/null +++ b/oox/source/drawingml/diagram/datamodel.hxx @@ -0,0 +1,80 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_OOX_SOURCE_DRAWINGML_DIAGRAM_DATAMODEL_HXX +#define INCLUDED_OOX_SOURCE_DRAWINGML_DIAGRAM_DATAMODEL_HXX + +#include +#include +#include + +#include + +#include +#include +#include +#include + +namespace oox::drawingml { + +class DiagramData : public svx::diagram::DiagramData +{ +public: + typedef std::map< OUString, ShapePtr > PointShapeMap; + + DiagramData(); + virtual ~DiagramData(); + + // creates temporary processing data from model data + virtual void buildDiagramDataModel(bool bClearOoxShapes); + + FillPropertiesPtr& getBackgroundShapeFillProperties() { return mpBackgroundShapeFillProperties; } + virtual void dump() const; + + Shape* getOrCreateAssociatedShape(const svx::diagram::Point& rPoint, bool bCreateOnDemand = false) const; + + // get/set data between Diagram DataModel and oox::drawingml::Shape + void secureDataFromShapeToModelAfterDiagramImport(::oox::drawingml::Shape& rRootShape); + void restoreDataFromShapeToModelAfterDiagramImport(::oox::drawingml::Shape& rRootShape); + static void restoreDataFromModelToShapeAfterReCreation(const svx::diagram::Point& rPoint, Shape& rNewShape); + +protected: + void secureStyleDataFromShapeToModel(::oox::drawingml::Shape& rShape); + void restoreStyleDataFromShapeToModel(::oox::drawingml::Shape& rShape); + + // The model definition, the parts *only* available in oox. Also look for already + // defined ModelData in svx::diagram::DiagramData + + // - FillStyle for Diagram Background (empty constructed, may stay empty) + FillPropertiesPtr mpBackgroundShapeFillProperties; + + // temporary processing data, deleted when using build(). Association + // map between oox::drawingml::Shape and svx::diagram::Point ModelData + PointShapeMap maPointShapeMap; +}; + +// Oox-local definition of DiagramData. Doing and using this on Oox +// allows to do much less static_cast(s) - if at all from svx::diagram::DiagramData +typedef std::shared_ptr< DiagramData > OoxDiagramDataPtr; + +} + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/drawingml/diagram/datamodelcontext.cxx b/oox/source/drawingml/diagram/datamodelcontext.cxx new file mode 100644 index 000000000..4f0e3f047 --- /dev/null +++ b/oox/source/drawingml/diagram/datamodelcontext.cxx @@ -0,0 +1,385 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include "datamodelcontext.hxx" +#include +#include +#include +#include +#include +#include + +using namespace ::oox::core; +using namespace ::com::sun::star::xml::sax; +using namespace ::com::sun::star::uno; + +namespace oox::drawingml { + +namespace { + +// CT_CxnList +class CxnListContext + : public ContextHandler2 +{ +public: + CxnListContext( ContextHandler2Helper const & rParent, + svx::diagram::Connections & aConnections ) + : ContextHandler2( rParent ) + , mrConnection( aConnections ) + { + } + + virtual ContextHandlerRef + onCreateContext( sal_Int32 aElementToken, + const AttributeList& rAttribs ) override + { + switch( aElementToken ) + { + case DGM_TOKEN( cxn ): + { + mrConnection.emplace_back( ); + svx::diagram::Connection& rConnection=mrConnection.back(); + + rConnection.mnXMLType = static_cast(rAttribs.getToken( XML_type, XML_parOf )); + rConnection.msModelId = rAttribs.getString( XML_modelId ).get(); + rConnection.msSourceId = rAttribs.getString( XML_srcId ).get(); + rConnection.msDestId = rAttribs.getString( XML_destId ).get(); + rConnection.msPresId = rAttribs.getString( XML_presId ).get(); + rConnection.msSibTransId = rAttribs.getString( XML_sibTransId ).get(); + rConnection.msParTransId = rAttribs.getString( XML_parTransId ).get(); + rConnection.mnSourceOrder = rAttribs.getInteger( XML_srcOrd, 0 ); + rConnection.mnDestOrder = rAttribs.getInteger( XML_destOrd, 0 ); + + // skip CT_extLst + return nullptr; + } + default: + break; + } + + return this; + } +private: + svx::diagram::Connections& mrConnection; +}; + +// CT_presLayoutVars +class PresLayoutVarsContext + : public ContextHandler2 +{ +public: + PresLayoutVarsContext( ContextHandler2Helper const & rParent, + svx::diagram::Point & rPoint ) : + ContextHandler2( rParent ), + mrPoint( rPoint ) + { + } + virtual ContextHandlerRef + onCreateContext( sal_Int32 aElementToken, + const AttributeList& rAttribs ) override + { + switch( aElementToken ) + { + // TODO + case DGM_TOKEN( animLvl ): + case DGM_TOKEN( animOne ): + break; + case DGM_TOKEN( bulletEnabled ): + mrPoint.mbBulletEnabled = rAttribs.getBool( XML_val, false ); + break; + case DGM_TOKEN( chMax ): + mrPoint.mnMaxChildren = rAttribs.getInteger( XML_val, -1 ); + break; + case DGM_TOKEN( chPref ): + mrPoint.mnPreferredChildren = rAttribs.getInteger( XML_val, -1 ); + break; + case DGM_TOKEN( dir ): + mrPoint.mnDirection = rAttribs.getToken( XML_val, XML_norm ); + break; + case DGM_TOKEN( hierBranch ): + { + // need to convert from oox::OptValue to std::optional since 1st is not available in svx + const OptValue< sal_Int32 > aOptVal(rAttribs.getToken( XML_val )); + if(aOptVal.has()) + mrPoint.moHierarchyBranch = aOptVal.get(); + break; + } + case DGM_TOKEN( orgChart ): + mrPoint.mbOrgChartEnabled = rAttribs.getBool( XML_val, false ); + break; + case DGM_TOKEN( resizeHandles ): + mrPoint.mnResizeHandles = rAttribs.getToken( XML_val, XML_rel ); + break; + default: + break; + } + + return this; + } + +private: + svx::diagram::Point& mrPoint; +}; + +// CT_prSet +class PropertiesContext + : public ContextHandler2 +{ +public: + PropertiesContext( ContextHandler2Helper const & rParent, + svx::diagram::Point & rPoint, + const AttributeList& rAttribs ) : + ContextHandler2( rParent ), + mrPoint( rPoint ) + { + mrPoint.msColorTransformCategoryId = rAttribs.getString( XML_csCatId, "" ); + mrPoint.msColorTransformTypeId = rAttribs.getString( XML_csTypeId, "" ); + mrPoint.msLayoutCategoryId = rAttribs.getString( XML_loCatId, "" ); + mrPoint.msLayoutTypeId = rAttribs.getString( XML_loTypeId, "" ); + mrPoint.msPlaceholderText = rAttribs.getString( XML_phldrT, "" ); + mrPoint.msPresentationAssociationId = rAttribs.getString( XML_presAssocID, "" ); + mrPoint.msPresentationLayoutName = rAttribs.getString( XML_presName, "" ); + mrPoint.msPresentationLayoutStyleLabel = rAttribs.getString( XML_presStyleLbl, "" ); + mrPoint.msQuickStyleCategoryId = rAttribs.getString( XML_qsCatId, "" ); + mrPoint.msQuickStyleTypeId = rAttribs.getString( XML_qsTypeId, "" ); + + mrPoint.mnCustomAngle = rAttribs.getInteger( XML_custAng, -1 ); + mrPoint.mnPercentageNeighbourWidth = rAttribs.getInteger( XML_custLinFactNeighborX, -1 ); + mrPoint.mnPercentageNeighbourHeight = rAttribs.getInteger( XML_custLinFactNeighborY, -1 ); + mrPoint.mnPercentageOwnWidth = rAttribs.getInteger( XML_custLinFactX, -1 ); + mrPoint.mnPercentageOwnHeight = rAttribs.getInteger( XML_custLinFactY, -1 ); + mrPoint.mnIncludeAngleScale = rAttribs.getInteger( XML_custRadScaleInc, -1 ); + mrPoint.mnRadiusScale = rAttribs.getInteger( XML_custRadScaleRad, -1 ); + mrPoint.mnWidthScale = rAttribs.getInteger( XML_custScaleX, -1 ); + mrPoint.mnHeightScale = rAttribs.getInteger( XML_custScaleY, -1 ); + mrPoint.mnWidthOverride = rAttribs.getInteger( XML_custSzX, -1 ); + mrPoint.mnHeightOverride = rAttribs.getInteger( XML_custSzY, -1 ); + mrPoint.mnLayoutStyleCount = rAttribs.getInteger( XML_presStyleCnt, -1 ); + mrPoint.mnLayoutStyleIndex = rAttribs.getInteger( XML_presStyleIdx, -1 ); + + mrPoint.mbCoherent3DOffset = rAttribs.getBool( XML_coherent3DOff, false ); + mrPoint.mbCustomHorizontalFlip = rAttribs.getBool( XML_custFlipHor, false ); + mrPoint.mbCustomVerticalFlip = rAttribs.getBool( XML_custFlipVert, false ); + mrPoint.mbCustomText = rAttribs.getBool( XML_custT, false ); + mrPoint.mbIsPlaceholder = rAttribs.getBool( XML_phldr, false ); + } + + virtual ContextHandlerRef + onCreateContext( sal_Int32 aElementToken, + const AttributeList& ) override + { + switch( aElementToken ) + { + case DGM_TOKEN( presLayoutVars ): + return new PresLayoutVarsContext( *this, mrPoint ); + case DGM_TOKEN( style ): + // skip CT_shapeStyle + return nullptr; + default: + break; + } + return this; + } + +private: + svx::diagram::Point& mrPoint; +}; + +// CL_Pt +class PtContext + : public ContextHandler2 +{ +public: + PtContext( ContextHandler2Helper const& rParent, + const AttributeList& rAttribs, + svx::diagram::Point& rPoint, + DiagramData& rDiagramData): + ContextHandler2( rParent ), + mrPoint( rPoint ), + mrDiagramData( rDiagramData ) + { + mrPoint.msModelId = rAttribs.getString( XML_modelId ).get(); + + // the default type is XML_node + const sal_Int32 nType = rAttribs.getToken( XML_type, XML_node ); + mrPoint.mnXMLType = static_cast(nType); + + // ignore the cxnId unless it is this type. See 5.15.3.1.3 in Primer + if( ( nType == XML_parTrans ) || ( nType == XML_sibTrans ) ) + mrPoint.msCnxId = rAttribs.getString( XML_cxnId ).get(); + } + + virtual ContextHandlerRef + onCreateContext( sal_Int32 aElementToken, + const AttributeList& rAttribs ) override + { + switch( aElementToken ) + { + case DGM_TOKEN( extLst ): + return nullptr; + case DGM_TOKEN( prSet ): + return new PropertiesContext( *this, mrPoint, rAttribs ); + case DGM_TOKEN( spPr ): + { + Shape* pShape(mrDiagramData.getOrCreateAssociatedShape(mrPoint, true)); + return new ShapePropertiesContext( *this, *pShape ); + } + case DGM_TOKEN( t ): + { + Shape* pShape(mrDiagramData.getOrCreateAssociatedShape(mrPoint, true)); + TextBodyPtr xTextBody = std::make_shared(); + pShape->setTextBody( xTextBody ); + return new TextBodyContext( *this, *xTextBody ); + } + default: + break; + } + return this; + } + +private: + svx::diagram::Point& mrPoint; + DiagramData& mrDiagramData; +}; + +// CT_PtList +class PtListContext + : public ContextHandler2 +{ +public: + PtListContext( ContextHandler2Helper const & rParent, svx::diagram::Points& rPoints, DiagramData& rDiagramData) : + ContextHandler2( rParent ), + mrPoints( rPoints ), + mrDiagramData( rDiagramData ) + {} + virtual ContextHandlerRef + onCreateContext( sal_Int32 aElementToken, + const AttributeList& rAttribs ) override + { + switch( aElementToken ) + { + case DGM_TOKEN( pt ): + { + // CT_Pt + mrPoints.emplace_back( ); + return new PtContext( *this, rAttribs, mrPoints.back(), mrDiagramData ); + } + default: + break; + } + return this; + } + +private: + svx::diagram::Points& mrPoints; + DiagramData& mrDiagramData; +}; + +// CT_BackgroundFormatting +class BackgroundFormattingContext + : public ContextHandler2 +{ +public: + BackgroundFormattingContext( ContextHandler2Helper const & rParent, OoxDiagramDataPtr const& pModel ) + : ContextHandler2( rParent ) + , mpDataModel( pModel ) + { + assert( pModel && "the data model MUST NOT be NULL" ); + } + + virtual ContextHandlerRef + onCreateContext( sal_Int32 aElementToken, + const AttributeList& rAttribs ) override + { + switch( aElementToken ) + { + case A_TOKEN( blipFill ): + case A_TOKEN( gradFill ): + case A_TOKEN( grpFill ): + case A_TOKEN( noFill ): + case A_TOKEN( pattFill ): + case A_TOKEN( solidFill ): + // EG_FillProperties + return FillPropertiesContext::createFillContext( + *this, aElementToken, rAttribs, *mpDataModel->getBackgroundShapeFillProperties() ); + case A_TOKEN( effectDag ): + case A_TOKEN( effectLst ): + // TODO + // EG_EffectProperties + break; + default: + break; + } + return this; + } +private: + OoxDiagramDataPtr mpDataModel; +}; + +} + +DataModelContext::DataModelContext( ContextHandler2Helper const& rParent, + const OoxDiagramDataPtr& pDataModel ) + : ContextHandler2( rParent ) + , mpDataModel( pDataModel ) +{ + assert( pDataModel && "Data Model must not be NULL" ); +} + +DataModelContext::~DataModelContext() +{ + // some debug + mpDataModel->dump(); +} + +ContextHandlerRef +DataModelContext::onCreateContext( ::sal_Int32 aElement, + const AttributeList& rAttribs ) +{ + switch( aElement ) + { + case DGM_TOKEN( cxnLst ): + // CT_CxnList + return new CxnListContext( *this, mpDataModel->getConnections() ); + case DGM_TOKEN( ptLst ): + // CT_PtList + return new PtListContext( *this, mpDataModel->getPoints(), *mpDataModel ); + case DGM_TOKEN( bg ): + // CT_BackgroundFormatting + return new BackgroundFormattingContext( *this, mpDataModel ); + case DGM_TOKEN( whole ): + // CT_WholeE2oFormatting + // TODO + return nullptr; + case DGM_TOKEN( extLst ): + case A_TOKEN( ext ): + break; + case DSP_TOKEN( dataModelExt ): + mpDataModel->getExtDrawings().push_back( rAttribs.getString( XML_relId ).get() ); + break; + default: + break; + } + + return this; +} + +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/drawingml/diagram/datamodelcontext.hxx b/oox/source/drawingml/diagram/datamodelcontext.hxx new file mode 100644 index 000000000..9a5c323de --- /dev/null +++ b/oox/source/drawingml/diagram/datamodelcontext.hxx @@ -0,0 +1,45 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_OOX_SOURCE_DRAWINGML_DIAGRAM_DATAMODELCONTEXT_HXX +#define INCLUDED_OOX_SOURCE_DRAWINGML_DIAGRAM_DATAMODELCONTEXT_HXX + +#include +#include "datamodel.hxx" + +namespace oox::drawingml { + +// CT_DataModel +class DataModelContext final : public ::oox::core::ContextHandler2 +{ +public: + DataModelContext( ::oox::core::ContextHandler2Helper const& rParent, const OoxDiagramDataPtr& pDataModelPtr ); + virtual ~DataModelContext() override; + + virtual ::oox::core::ContextHandlerRef onCreateContext( ::sal_Int32 Element, const ::oox::AttributeList& rAttribs ) override; + +private: + OoxDiagramDataPtr mpDataModel; +}; + +} + +#endif // INCLUDED_OOX_SOURCE_DRAWINGML_DIAGRAM_DATAMODELCONTEXT_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/drawingml/diagram/diagram.cxx b/oox/source/drawingml/diagram/diagram.cxx new file mode 100644 index 000000000..efba958fa --- /dev/null +++ b/oox/source/drawingml/diagram/diagram.cxx @@ -0,0 +1,444 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include +#include "diagram.hxx" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "diagramlayoutatoms.hxx" +#include "layoutatomvisitors.hxx" +#include "diagramfragmenthandler.hxx" + +using namespace ::com::sun::star; + +namespace oox::drawingml { + +static void sortChildrenByZOrder(const ShapePtr& pShape) +{ + std::vector& rChildren = pShape->getChildren(); + + // Offset the children from their default z-order stacking, if necessary. + for (size_t i = 0; i < rChildren.size(); ++i) + rChildren[i]->setZOrder(i); + + for (size_t i = 0; i < rChildren.size(); ++i) + { + const ShapePtr& pChild = rChildren[i]; + sal_Int32 nZOrderOff = pChild->getZOrderOff(); + if (nZOrderOff <= 0) + continue; + + // Increase my ZOrder by nZOrderOff. + pChild->setZOrder(pChild->getZOrder() + nZOrderOff); + pChild->setZOrderOff(0); + + for (sal_Int32 j = 0; j < nZOrderOff; ++j) + { + size_t nIndex = i + j + 1; + if (nIndex >= rChildren.size()) + break; + + // Decrease the ZOrder of the next nZOrderOff elements by one. + const ShapePtr& pNext = rChildren[nIndex]; + pNext->setZOrder(pNext->getZOrder() - 1); + } + } + + // Now that the ZOrders are adjusted, sort the children. + std::sort(rChildren.begin(), rChildren.end(), + [](const ShapePtr& a, const ShapePtr& b) { return a->getZOrder() < b->getZOrder(); }); + + // Apply also for children. + for (const auto& rChild : rChildren) + sortChildrenByZOrder(rChild); +} + +/// Removes empty group shapes, now that their spacing influenced the layout. +static void removeUnneededGroupShapes(const ShapePtr& pShape) +{ + std::vector& rChildren = pShape->getChildren(); + + rChildren.erase(std::remove_if(rChildren.begin(), rChildren.end(), + [](const ShapePtr& aChild) { + return aChild->getServiceName() + == "com.sun.star.drawing.GroupShape" + && aChild->getChildren().empty(); + }), + rChildren.end()); + + for (const auto& pChild : rChildren) + { + removeUnneededGroupShapes(pChild); + } +} + + +void Diagram::addTo( const ShapePtr & pParentShape ) +{ + if (pParentShape->getSize().Width == 0 || pParentShape->getSize().Height == 0) + SAL_WARN("oox.drawingml", "Diagram cannot be correctly laid out. Size: " + << pParentShape->getSize().Width << "x" << pParentShape->getSize().Height); + + pParentShape->setChildSize(pParentShape->getSize()); + + const svx::diagram::Point* pRootPoint = mpData->getRootPoint(); + if (mpLayout->getNode() && pRootPoint) + { + // create Shape hierarchy + ShapeCreationVisitor aCreationVisitor(*this, pRootPoint, pParentShape); + mpLayout->getNode()->setExistingShape(pParentShape); + mpLayout->getNode()->accept(aCreationVisitor); + + // layout shapes - now all shapes are created + ShapeLayoutingVisitor aLayoutingVisitor(*this, pRootPoint); + mpLayout->getNode()->accept(aLayoutingVisitor); + + sortChildrenByZOrder(pParentShape); + removeUnneededGroupShapes(pParentShape); + } + + ShapePtr pBackground = std::make_shared("com.sun.star.drawing.CustomShape"); + pBackground->setSubType(XML_rect); + pBackground->getCustomShapeProperties()->setShapePresetType(XML_rect); + pBackground->setSize(pParentShape->getSize()); + pBackground->getFillProperties() = *mpData->getBackgroundShapeFillProperties(); + pBackground->setLocked(true); + + // create and set ModelID for BackgroundShape to allow later association + getData()->setBackgroundShapeModelID(OStringToOUString(comphelper::xml::generateGUIDString(), RTL_TEXTENCODING_UTF8)); + pBackground->setDiagramDataModelID(getData()->getBackgroundShapeModelID()); + + auto& aChildren = pParentShape->getChildren(); + aChildren.insert(aChildren.begin(), pBackground); +} + +Diagram::Diagram() +: maDiagramFontHeights() +{ +} + +uno::Sequence Diagram::getDomsAsPropertyValues() const +{ + sal_Int32 length = maMainDomMap.size(); + + if (maDataRelsMap.hasElements()) + ++length; + + uno::Sequence aValue(length); + beans::PropertyValue* pValue = aValue.getArray(); + for (auto const& mainDom : maMainDomMap) + { + pValue->Name = mainDom.first; + pValue->Value <<= mainDom.second; + ++pValue; + } + + if (maDataRelsMap.hasElements()) + { + pValue->Name = "OOXDiagramDataRels"; + pValue->Value <<= maDataRelsMap; + ++pValue; + } + + return aValue; +} + +using ShapePairs + = std::map, css::uno::Reference>; + +void Diagram::syncDiagramFontHeights() +{ + // Each name represents a group of shapes, for which the font height should have the same + // scaling. + for (const auto& rNameAndPairs : maDiagramFontHeights) + { + // Find out the minimum scale within this group. + const ShapePairs& rShapePairs = rNameAndPairs.second; + sal_Int16 nMinScale = 100; + for (const auto& rShapePair : rShapePairs) + { + uno::Reference xPropertySet(rShapePair.second, uno::UNO_QUERY); + if (xPropertySet.is()) + { + sal_Int16 nTextFitToSizeScale = 0; + xPropertySet->getPropertyValue("TextFitToSizeScale") >>= nTextFitToSizeScale; + if (nTextFitToSizeScale > 0 && nTextFitToSizeScale < nMinScale) + { + nMinScale = nTextFitToSizeScale; + } + } + } + + // Set that minimum scale for all members of the group. + if (nMinScale < 100) + { + for (const auto& rShapePair : rShapePairs) + { + uno::Reference xPropertySet(rShapePair.second, uno::UNO_QUERY); + if (xPropertySet.is()) + { + xPropertySet->setPropertyValue("TextFitToSizeScale", uno::Any(nMinScale)); + } + } + } + } + + // no longer needed after processing + maDiagramFontHeights.clear(); +} + +static uno::Reference loadFragment( + core::XmlFilterBase& rFilter, + const OUString& rFragmentPath ) +{ + // load diagramming fragments into DOM representation, that later + // gets serialized back to SAX events and parsed + return rFilter.importFragment( rFragmentPath ); +} + +static uno::Reference loadFragment( + core::XmlFilterBase& rFilter, + const rtl::Reference< core::FragmentHandler >& rxHandler ) +{ + return loadFragment( rFilter, rxHandler->getFragmentPath() ); +} + +static void importFragment( core::XmlFilterBase& rFilter, + const uno::Reference& rXDom, + const OUString& rDocName, + const DiagramPtr& pDiagram, + const rtl::Reference< core::FragmentHandler >& rxHandler ) +{ + DiagramDomMap& rMainDomMap = pDiagram->getDomMap(); + rMainDomMap[rDocName] = rXDom; + + uno::Reference xSerializer( + rXDom, uno::UNO_QUERY_THROW); + + // now serialize DOM tree into internal data structures + rFilter.importFragment( rxHandler, xSerializer ); +} + +namespace +{ +/** + * A fragment handler that just counts the number of elements in a + * fragment. + */ +class DiagramShapeCounter : public oox::core::FragmentHandler2 +{ +public: + DiagramShapeCounter(oox::core::XmlFilterBase& rFilter, const OUString& rFragmentPath, + sal_Int32& nCounter); + oox::core::ContextHandlerRef onCreateContext(sal_Int32 nElement, + const AttributeList& rAttribs) override; + +private: + sal_Int32& m_nCounter; +}; + +DiagramShapeCounter::DiagramShapeCounter(oox::core::XmlFilterBase& rFilter, + const OUString& rFragmentPath, sal_Int32& nCounter) + : FragmentHandler2(rFilter, rFragmentPath) + , m_nCounter(nCounter) +{ +} + +oox::core::ContextHandlerRef DiagramShapeCounter::onCreateContext(sal_Int32 nElement, + const AttributeList& /*rAttribs*/) +{ + switch (nElement) + { + case DSP_TOKEN(drawing): + case DSP_TOKEN(spTree): + return this; + case DSP_TOKEN(sp): + ++m_nCounter; + break; + default: + break; + } + + return nullptr; +} +} + +void loadDiagram( ShapePtr const & pShape, + core::XmlFilterBase& rFilter, + const OUString& rDataModelPath, + const OUString& rLayoutPath, + const OUString& rQStylePath, + const OUString& rColorStylePath, + const oox::core::Relations& rRelations ) +{ + DiagramPtr pDiagram = std::make_shared(); + + OoxDiagramDataPtr pData = std::make_shared(); + pDiagram->setData( pData ); + + DiagramLayoutPtr pLayout = std::make_shared(*pDiagram); + pDiagram->setLayout( pLayout ); + + // set DiagramFontHeights at filter + rFilter.setDiagramFontHeights(&pDiagram->getDiagramFontHeights()); + + // data + if( !rDataModelPath.isEmpty() ) + { + rtl::Reference< core::FragmentHandler > xRefDataModel( + new DiagramDataFragmentHandler( rFilter, rDataModelPath, pData )); + + importFragment(rFilter, + loadFragment(rFilter,xRefDataModel), + "OOXData", + pDiagram, + xRefDataModel); + + pDiagram->getDataRelsMap() = pShape->resolveRelationshipsOfTypeFromOfficeDoc( rFilter, + xRefDataModel->getFragmentPath(), u"image" ); + + // Pass the info to pShape + for (auto const& extDrawing : pData->getExtDrawings()) + { + OUString aFragmentPath = rRelations.getFragmentPathFromRelId(extDrawing); + // Ignore RelIds which don't resolve to a fragment path. + if (aFragmentPath.isEmpty()) + continue; + + sal_Int32 nCounter = 0; + rtl::Reference xCounter( + new DiagramShapeCounter(rFilter, aFragmentPath, nCounter)); + rFilter.importFragment(xCounter); + // Ignore ext drawings which don't actually have any shapes. + if (nCounter == 0) + continue; + + pShape->addExtDrawingRelId(extDrawing); + } + } + + // extLst is present, lets bet on that and ignore the rest of the data from here + if( pShape->getExtDrawings().empty() ) + { + // layout + if( !rLayoutPath.isEmpty() ) + { + rtl::Reference< core::FragmentHandler > xRefLayout( + new DiagramLayoutFragmentHandler( rFilter, rLayoutPath, pLayout )); + + importFragment(rFilter, + loadFragment(rFilter,xRefLayout), + "OOXLayout", + pDiagram, + xRefLayout); + } + + // style + if( !rQStylePath.isEmpty() ) + { + rtl::Reference< core::FragmentHandler > xRefQStyle( + new DiagramQStylesFragmentHandler( rFilter, rQStylePath, pDiagram->getStyles() )); + + importFragment(rFilter, + loadFragment(rFilter,xRefQStyle), + "OOXStyle", + pDiagram, + xRefQStyle); + } + } + else + { + // We still want to add the XDocuments to the DiagramDomMap + DiagramDomMap& rMainDomMap = pDiagram->getDomMap(); + rMainDomMap[OUString("OOXLayout")] = loadFragment(rFilter,rLayoutPath); + rMainDomMap[OUString("OOXStyle")] = loadFragment(rFilter,rQStylePath); + } + + // colors + if( !rColorStylePath.isEmpty() ) + { + rtl::Reference< core::FragmentHandler > xRefColorStyle( + new ColorFragmentHandler( rFilter, rColorStylePath, pDiagram->getColors() )); + + importFragment(rFilter, + loadFragment(rFilter,xRefColorStyle), + "OOXColor", + pDiagram, + xRefColorStyle); + } + + if( !pData->getExtDrawings().empty() ) + { + const DiagramColorMap::const_iterator aColor = pDiagram->getColors().find("node0"); + if( aColor != pDiagram->getColors().end() && !aColor->second.maTextFillColors.empty()) + { + // TODO(F1): well, actually, there might be *several* color + // definitions in it, after all it's called list. + pShape->setFontRefColorForNodes(DiagramColor::getColorByIndex(aColor->second.maTextFillColors, -1)); + } + } + + // collect data, init maps + // for Diagram import, do - for now - NOT clear all oox::drawingml::Shape + pData->buildDiagramDataModel(false); + + // diagram loaded. now lump together & attach to shape + pDiagram->addTo(pShape); + pShape->setDiagramDoms(pDiagram->getDomsAsPropertyValues()); + + // Get the oox::Theme definition and - if available - move/secure the + // original ImportData directly to the Diagram ModelData + std::shared_ptr<::oox::drawingml::Theme> aTheme(rFilter.getCurrentThemePtr()); + if(aTheme) + pData->setThemeDocument(aTheme->getFragment()); //getTempFile()); + + // Prepare support for the advanced DiagramHelper using Diagram & Theme data + pShape->prepareDiagramHelper(pDiagram, rFilter.getCurrentThemePtr()); +} + +const oox::drawingml::Color& +DiagramColor::getColorByIndex(const std::vector& rColors, sal_Int32 nIndex) +{ + assert(!rColors.empty()); + if (nIndex == -1) + { + return rColors[rColors.size() - 1]; + } + + return rColors[nIndex % rColors.size()]; +} +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/drawingml/diagram/diagram.hxx b/oox/source/drawingml/diagram/diagram.hxx new file mode 100644 index 000000000..f58c762f6 --- /dev/null +++ b/oox/source/drawingml/diagram/diagram.hxx @@ -0,0 +1,171 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_OOX_SOURCE_DRAWINGML_DIAGRAM_DIAGRAM_HXX +#define INCLUDED_OOX_SOURCE_DRAWINGML_DIAGRAM_DIAGRAM_HXX + +#include +#include +#include + +#include + +#include "datamodel.hxx" +#include + +namespace com::sun::star { + namespace xml::dom { class XDocument; } +} + +namespace oox::drawingml { + +class Diagram; +class LayoutNode; +typedef std::shared_ptr< LayoutNode > LayoutNodePtr; +class LayoutAtom; +typedef std::shared_ptr< LayoutAtom > LayoutAtomPtr; +typedef std::map< OUString, css::uno::Reference > DiagramDomMap; +typedef std::map< OUString, LayoutAtomPtr > LayoutAtomMap; +typedef std::map< const svx::diagram::Point*, ShapePtr > PresPointShapeMap; + +class DiagramLayout +{ +public: + DiagramLayout(Diagram& rDgm) + : mrDgm(rDgm) + { + } + void setDefStyle( const OUString & sDefStyle ) + { msDefStyle = sDefStyle; } + void setMinVer( const OUString & sMinVer ) + { msMinVer = sMinVer; } + void setUniqueId( const OUString & sUniqueId ) + { msUniqueId = sUniqueId; } + void setTitle( const OUString & sTitle ) + { msTitle = sTitle; } + void setDesc( const OUString & sDesc ) + { msDesc = sDesc; } + Diagram& getDiagram() { return mrDgm; } + LayoutNodePtr & getNode() + { return mpNode; } + const LayoutNodePtr & getNode() const + { return mpNode; } + OoxDiagramDataPtr& getSampData() + { return mpSampData; } + const OoxDiagramDataPtr& getSampData() const + { return mpSampData; } + OoxDiagramDataPtr& getStyleData() + { return mpStyleData; } + const OoxDiagramDataPtr& getStyleData() const + { return mpStyleData; } + LayoutAtomMap & getLayoutAtomMap() + { return maLayoutAtomMap; } + PresPointShapeMap & getPresPointShapeMap() + { return maPresPointShapeMap; } + +private: + Diagram& mrDgm; + OUString msDefStyle; + OUString msMinVer; + OUString msUniqueId; + + OUString msTitle; + OUString msDesc; + LayoutNodePtr mpNode; + OoxDiagramDataPtr mpSampData; + OoxDiagramDataPtr mpStyleData; + // TODO + // catLst + // clrData + + LayoutAtomMap maLayoutAtomMap; + PresPointShapeMap maPresPointShapeMap; +}; + +typedef std::shared_ptr< DiagramLayout > DiagramLayoutPtr; + +struct DiagramStyle +{ + ShapeStyleRef maFillStyle; + ShapeStyleRef maLineStyle; + ShapeStyleRef maEffectStyle; + ShapeStyleRef maTextStyle; +}; + +typedef std::map DiagramQStyleMap; + +struct DiagramColor +{ + std::vector maFillColors; + std::vector maLineColors; + std::vector maEffectColors; + std::vector maTextFillColors; + std::vector maTextLineColors; + std::vector maTextEffectColors; + + static const oox::drawingml::Color& + getColorByIndex(const std::vector& rColors, sal_Int32 nIndex); +}; + +typedef std::map DiagramColorMap; + +class Diagram +{ +public: + explicit Diagram(); + void setData( OoxDiagramDataPtr& pData ) + { mpData = pData; } + const OoxDiagramDataPtr& getData() const + { return mpData; } + void setLayout( const DiagramLayoutPtr & pLayout ) + { mpLayout = pLayout; } + const DiagramLayoutPtr& getLayout() const + { return mpLayout; } + + DiagramQStyleMap& getStyles() { return maStyles; } + const DiagramQStyleMap& getStyles() const { return maStyles; } + DiagramColorMap& getColors() { return maColors; } + const DiagramColorMap& getColors() const { return maColors; } + DiagramDomMap & getDomMap() { return maMainDomMap; } + css::uno::Sequence< css::uno::Sequence< css::uno::Any > > & getDataRelsMap() { return maDataRelsMap; } + void addTo( const ShapePtr & pShape ); + + css::uno::Sequence getDomsAsPropertyValues() const; + oox::core::NamedShapePairs& getDiagramFontHeights() { return maDiagramFontHeights; } + void syncDiagramFontHeights(); + +private: + // This contains groups of shapes: automatic font size is the same in each group. + oox::core::NamedShapePairs maDiagramFontHeights; + + OoxDiagramDataPtr mpData; + DiagramLayoutPtr mpLayout; + DiagramQStyleMap maStyles; + DiagramColorMap maColors; + DiagramDomMap maMainDomMap; + css::uno::Sequence< css::uno::Sequence< css::uno::Any > > maDataRelsMap; +}; + +typedef std::shared_ptr< Diagram > DiagramPtr; + +} + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/drawingml/diagram/diagramdefinitioncontext.cxx b/oox/source/drawingml/diagram/diagramdefinitioncontext.cxx new file mode 100644 index 000000000..02d377703 --- /dev/null +++ b/oox/source/drawingml/diagram/diagramdefinitioncontext.cxx @@ -0,0 +1,99 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include "diagramdefinitioncontext.hxx" +#include "datamodel.hxx" +#include "datamodelcontext.hxx" +#include "layoutnodecontext.hxx" +#include +#include + +using namespace ::oox::core; +using namespace ::com::sun::star::uno; +using namespace ::com::sun::star::xml::sax; + +namespace oox::drawingml { + +// CT_DiagramDefinition +DiagramDefinitionContext::DiagramDefinitionContext( ContextHandler2Helper const & rParent, + const AttributeList& rAttributes, + const DiagramLayoutPtr &pLayout ) + : ContextHandler2( rParent ) + , mpLayout( pLayout ) +{ + mpLayout->setDefStyle( rAttributes.getString( XML_defStyle ).get() ); + OUString sValue = rAttributes.getString( XML_minVer ).get(); + if( sValue.isEmpty() ) + { + sValue = "http://schemas.openxmlformats.org/drawingml/2006/diagram"; + } + mpLayout->setMinVer( sValue ); + mpLayout->setUniqueId( rAttributes.getString( XML_uniqueId ).get() ); +} + +DiagramDefinitionContext::~DiagramDefinitionContext() +{ + LayoutNodePtr node = mpLayout->getNode(); + if (node) + node->dump(); +} + +ContextHandlerRef +DiagramDefinitionContext::onCreateContext( ::sal_Int32 aElement, + const AttributeList& rAttribs ) +{ + switch( aElement ) + { + case DGM_TOKEN( title ): + mpLayout->setTitle( rAttribs.getString( XML_val ).get() ); + break; + case DGM_TOKEN( desc ): + mpLayout->setDesc( rAttribs.getString( XML_val ).get() ); + break; + case DGM_TOKEN( layoutNode ): + { + LayoutNodePtr pNode = std::make_shared(mpLayout->getDiagram()); + mpLayout->getNode() = pNode; + pNode->setChildOrder( rAttribs.getToken( XML_chOrder, XML_b ) ); + pNode->setMoveWith( rAttribs.getString( XML_moveWith ).get() ); + pNode->setStyleLabel( rAttribs.getString( XML_styleLbl ).get() ); + return new LayoutNodeContext( *this, rAttribs, pNode ); + } + case DGM_TOKEN( clrData ): + // TODO, does not matter for the UI. skip. + return nullptr; + case DGM_TOKEN( sampData ): + mpLayout->getSampData() = std::make_shared(); + return new DataModelContext( *this, mpLayout->getSampData() ); + case DGM_TOKEN( styleData ): + mpLayout->getStyleData() = std::make_shared(); + return new DataModelContext( *this, mpLayout->getStyleData() ); + case DGM_TOKEN( cat ): + case DGM_TOKEN( catLst ): + // TODO, does not matter for the UI + default: + break; + } + + return this; +} + +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/drawingml/diagram/diagramdefinitioncontext.hxx b/oox/source/drawingml/diagram/diagramdefinitioncontext.hxx new file mode 100644 index 000000000..e92460f5d --- /dev/null +++ b/oox/source/drawingml/diagram/diagramdefinitioncontext.hxx @@ -0,0 +1,44 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_OOX_SOURCE_DRAWINGML_DIAGRAM_DIAGRAMDEFINITIONCONTEXT_HXX +#define INCLUDED_OOX_SOURCE_DRAWINGML_DIAGRAM_DIAGRAMDEFINITIONCONTEXT_HXX + +#include +#include "diagram.hxx" + +namespace oox::drawingml { + +class DiagramDefinitionContext : public ::oox::core::ContextHandler2 +{ +public: + DiagramDefinitionContext( ::oox::core::ContextHandler2Helper const & rParent, const ::oox::AttributeList& rAttributes, const DiagramLayoutPtr &pLayout ); + virtual ~DiagramDefinitionContext() override; + + virtual ::oox::core::ContextHandlerRef onCreateContext( ::sal_Int32 Element, const ::oox::AttributeList& rAttribs ) override; + +private: + DiagramLayoutPtr mpLayout; +}; + +} + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/drawingml/diagram/diagramfragmenthandler.cxx b/oox/source/drawingml/diagram/diagramfragmenthandler.cxx new file mode 100644 index 000000000..8ff4af7f0 --- /dev/null +++ b/oox/source/drawingml/diagram/diagramfragmenthandler.cxx @@ -0,0 +1,234 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + + +#include "diagramdefinitioncontext.hxx" +#include "diagramfragmenthandler.hxx" +#include "datamodelcontext.hxx" +#include +#include +#include + +using namespace ::oox::core; +using namespace ::com::sun::star::xml::sax; +using namespace ::com::sun::star::uno; + +namespace oox::drawingml { + +DiagramDataFragmentHandler::DiagramDataFragmentHandler( XmlFilterBase& rFilter, + const OUString& rFragmentPath, + const OoxDiagramDataPtr& rDataPtr ) + : FragmentHandler2( rFilter, rFragmentPath ) + , mpDataPtr( rDataPtr ) +{ +} + +DiagramDataFragmentHandler::~DiagramDataFragmentHandler( ) noexcept +{ + +} + +void SAL_CALL DiagramDataFragmentHandler::endDocument() +{ + +} + +ContextHandlerRef +DiagramDataFragmentHandler::onCreateContext( ::sal_Int32 aElement, + const AttributeList& ) +{ + switch( aElement ) + { + case DGM_TOKEN( dataModel ): + return new DataModelContext( *this, mpDataPtr ); + default: + break; + } + + return this; +} + +DiagramLayoutFragmentHandler::DiagramLayoutFragmentHandler( XmlFilterBase& rFilter, + const OUString& rFragmentPath, + const DiagramLayoutPtr& rDataPtr ) + : FragmentHandler2( rFilter, rFragmentPath ) + , mpDataPtr( rDataPtr ) +{ +} + +DiagramLayoutFragmentHandler::~DiagramLayoutFragmentHandler( ) noexcept +{ + +} + +void SAL_CALL DiagramLayoutFragmentHandler::endDocument() +{ + +} + +ContextHandlerRef +DiagramLayoutFragmentHandler::onCreateContext( ::sal_Int32 aElement, + const AttributeList& rAttribs ) +{ + switch( aElement ) + { + case DGM_TOKEN( layoutDef ): + return new DiagramDefinitionContext( *this, rAttribs, mpDataPtr ); + default: + break; + } + + return this; +} + +DiagramQStylesFragmentHandler::DiagramQStylesFragmentHandler( XmlFilterBase& rFilter, + const OUString& rFragmentPath, + DiagramQStyleMap& rStylesMap ) : + FragmentHandler2( rFilter, rFragmentPath ), + maStyleEntry(), + mrStylesMap( rStylesMap ) +{} + +::oox::core::ContextHandlerRef DiagramQStylesFragmentHandler::createStyleMatrixContext( + sal_Int32 nElement, + const AttributeList& rAttribs, + ShapeStyleRef& o_rStyle ) +{ + o_rStyle.mnThemedIdx = (nElement == A_TOKEN(fontRef)) ? + rAttribs.getToken( XML_idx, XML_none ) : rAttribs.getInteger( XML_idx, 0 ); + return new ColorContext( *this, o_rStyle.maPhClr ); +} + +::oox::core::ContextHandlerRef DiagramQStylesFragmentHandler::onCreateContext( sal_Int32 nElement, + const AttributeList& rAttribs ) +{ + // state-table like way of navigating the color fragment. we + // currently ignore everything except styleLbl in the styleDef + // element + switch( getCurrentElement() ) + { + case XML_ROOT_CONTEXT: + return nElement == DGM_TOKEN(styleDef) ? this : nullptr; + case DGM_TOKEN(styleDef): + return nElement == DGM_TOKEN(styleLbl) ? this : nullptr; + case DGM_TOKEN(styleLbl): + return nElement == DGM_TOKEN(style) ? this : nullptr; + case DGM_TOKEN(style): + { + switch( nElement ) + { + case A_TOKEN(lnRef): // CT_StyleMatrixReference + return createStyleMatrixContext(nElement,rAttribs, + maStyleEntry.maLineStyle); + case A_TOKEN(fillRef): // CT_StyleMatrixReference + return createStyleMatrixContext(nElement,rAttribs, + maStyleEntry.maFillStyle); + case A_TOKEN(effectRef): // CT_StyleMatrixReference + return createStyleMatrixContext(nElement,rAttribs, + maStyleEntry.maEffectStyle); + case A_TOKEN(fontRef): // CT_FontReference + return createStyleMatrixContext(nElement,rAttribs, + maStyleEntry.maTextStyle); + } + return nullptr; + } + } + + return nullptr; +} + +void DiagramQStylesFragmentHandler::onStartElement( const AttributeList& rAttribs ) +{ + if( getCurrentElement() == DGM_TOKEN( styleLbl ) ) + { + maStyleName = rAttribs.getString( XML_name, OUString() ); + maStyleEntry = mrStylesMap[maStyleName]; + } +} + +void DiagramQStylesFragmentHandler::onEndElement( ) +{ + if( getCurrentElement() == DGM_TOKEN(styleLbl) ) + mrStylesMap[maStyleName] = maStyleEntry; +} + +ColorFragmentHandler::ColorFragmentHandler( ::oox::core::XmlFilterBase& rFilter, + const OUString& rFragmentPath, + DiagramColorMap& rColorsMap ) : + FragmentHandler2(rFilter,rFragmentPath), + maColorEntry(), + mrColorsMap(rColorsMap) +{} + +::oox::core::ContextHandlerRef ColorFragmentHandler::onCreateContext( sal_Int32 nElement, + const AttributeList& /*rAttribs*/ ) +{ + // state-table like way of navigating the color fragment. we + // currently ignore everything except styleLbl in the colorsDef + // element + switch( getCurrentElement() ) + { + case XML_ROOT_CONTEXT: + return nElement == DGM_TOKEN(colorsDef) ? this : nullptr; + case DGM_TOKEN(colorsDef): + return nElement == DGM_TOKEN(styleLbl) ? this : nullptr; + case DGM_TOKEN(styleLbl): + { + switch( nElement ) + { + // the actual colors - defer to color fragment handlers. + + case DGM_TOKEN(fillClrLst): + return new ColorsContext( *this, maColorEntry.maFillColors ); + case DGM_TOKEN(linClrLst): + return new ColorsContext( *this, maColorEntry.maLineColors ); + case DGM_TOKEN(effectClrLst): + return new ColorsContext( *this, maColorEntry.maEffectColors ); + case DGM_TOKEN(txFillClrLst): + return new ColorsContext( *this, maColorEntry.maTextFillColors ); + case DGM_TOKEN(txLinClrLst): + return new ColorsContext( *this, maColorEntry.maTextLineColors ); + case DGM_TOKEN(txEffectClrLst): + return new ColorsContext( *this, maColorEntry.maTextEffectColors ); + } + break; + } + } + + return nullptr; +} + +void ColorFragmentHandler::onStartElement( const AttributeList& rAttribs ) +{ + if( getCurrentElement() == DGM_TOKEN(styleLbl) ) + { + maColorName = rAttribs.getString( XML_name, OUString() ); + maColorEntry = mrColorsMap[maColorName]; + } +} + +void ColorFragmentHandler::onEndElement( ) +{ + if( getCurrentElement() == DGM_TOKEN(styleLbl) ) + mrColorsMap[maColorName] = maColorEntry; +} + +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/drawingml/diagram/diagramfragmenthandler.hxx b/oox/source/drawingml/diagram/diagramfragmenthandler.hxx new file mode 100644 index 000000000..eb51d6407 --- /dev/null +++ b/oox/source/drawingml/diagram/diagramfragmenthandler.hxx @@ -0,0 +1,103 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_OOX_SOURCE_DRAWINGML_DIAGRAM_DIAGRAMFRAGMENTHANDLER_HXX +#define INCLUDED_OOX_SOURCE_DRAWINGML_DIAGRAM_DIAGRAMFRAGMENTHANDLER_HXX + +#include + +#include "diagram.hxx" + +namespace oox::drawingml { + +class DiagramDataFragmentHandler : public ::oox::core::FragmentHandler2 +{ +public: + DiagramDataFragmentHandler(oox::core::XmlFilterBase& rFilter, const OUString& rFragmentPath, const OoxDiagramDataPtr& rDataPtr); + virtual ~DiagramDataFragmentHandler() noexcept override; + + virtual void SAL_CALL endDocument() override; + virtual ::oox::core::ContextHandlerRef onCreateContext( ::sal_Int32 Element, const ::oox::AttributeList& rAttribs ) override; + +private: + + OoxDiagramDataPtr mpDataPtr; +}; + +class DiagramLayoutFragmentHandler : public ::oox::core::FragmentHandler2 +{ +public: + DiagramLayoutFragmentHandler(oox::core::XmlFilterBase& rFilter, const OUString& rFragmentPath, const DiagramLayoutPtr& rDataPtr); + virtual ~DiagramLayoutFragmentHandler() noexcept override; + + virtual void SAL_CALL endDocument() override; + virtual ::oox::core::ContextHandlerRef onCreateContext( ::sal_Int32 Element, const ::oox::AttributeList& rAttribs ) override; + +private: + + DiagramLayoutPtr mpDataPtr; +}; + +class DiagramQStylesFragmentHandler : public ::oox::core::FragmentHandler2 +{ +public: + DiagramQStylesFragmentHandler( + oox::core::XmlFilterBase& rFilter, + const OUString& rFragmentPath, + DiagramQStyleMap& rStylesMap ); + + virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ) override; + + virtual void onStartElement( const AttributeList& rAttribs ) override; + virtual void onEndElement() override; + +private: + ::oox::core::ContextHandlerRef createStyleMatrixContext(sal_Int32 nElement, + const AttributeList& rAttribs, + ShapeStyleRef& o_rStyle); + + OUString maStyleName; + DiagramStyle maStyleEntry; + DiagramQStyleMap& mrStylesMap; +}; + +class ColorFragmentHandler : public ::oox::core::FragmentHandler2 +{ +public: + ColorFragmentHandler( + ::oox::core::XmlFilterBase& rFilter, + const OUString& rFragmentPath, + DiagramColorMap& rColorMap ); + + virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ) override; + + virtual void onStartElement( const AttributeList& rAttribs ) override; + virtual void onEndElement() override; + +private: + OUString maColorName; + DiagramColor maColorEntry; + DiagramColorMap& mrColorsMap; +}; + +} + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/drawingml/diagram/diagramhelper.cxx b/oox/source/drawingml/diagram/diagramhelper.cxx new file mode 100644 index 000000000..7b746e067 --- /dev/null +++ b/oox/source/drawingml/diagram/diagramhelper.cxx @@ -0,0 +1,269 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include "diagramhelper.hxx" +#include "diagram.hxx" + +#include +#include +#include +#include +#include +#include +#include +#include + +using namespace ::com::sun::star; + +namespace oox::drawingml { + +bool AdvancedDiagramHelper::hasDiagramData() const +{ + return mpDiagramPtr && mpDiagramPtr->getData(); +} + +AdvancedDiagramHelper::AdvancedDiagramHelper( + const std::shared_ptr< Diagram >& rDiagramPtr, + const std::shared_ptr<::oox::drawingml::Theme>& rTheme, + css::awt::Size aImportSize) +: svx::diagram::IDiagramHelper() +, mpDiagramPtr(rDiagramPtr) +, mpThemePtr(rTheme) +, maImportSize(aImportSize) +{ +} + +AdvancedDiagramHelper::~AdvancedDiagramHelper() +{ +} + +void AdvancedDiagramHelper::reLayout(SdrObjGroup& rTarget) +{ + if(!mpDiagramPtr) + { + return; + } + + // Rescue/remember geometric transformation of existing Diagram + basegfx::B2DHomMatrix aTransformation; + basegfx::B2DPolyPolygon aPolyPolygon; + rTarget.TRGetBaseGeometry(aTransformation, aPolyPolygon); + + // create temporary oox::Shape as target. No longer needed is to keep/remember + // the original oox::Shape to do that. Use original Size and Pos from initial import + // to get the same layout(s) + oox::drawingml::ShapePtr pShapePtr = std::make_shared( "com.sun.star.drawing.GroupShape" ); + pShapePtr->setDiagramType(); + pShapePtr->setSize(maImportSize); + + // Re-create the oox::Shapes for the diagram content + mpDiagramPtr->addTo(pShapePtr); + + // Delete all existing shapes in that group to prepare re-creation + rTarget.getChildrenOfSdrObject()->ClearSdrObjList(); + + // For re-creation we need to use ::addShape functionality from the + // oox import filter since currently Shape import is very tightly + // coupled to Shape creation. It converts a oox::Shape representation + // combined with an oox::Theme to incarnated XShapes representing the + // Diagram. + // To use that functionality, we have to create a temporary filter + // (based on ShapeFilterBase). Problems are that this needs to know + // the oox:Theme and a ComponentModel from TargetDocument. + // The DiagramHelper holds/delivers the oox::Theme to use, so + // it does not need to be re-imported from oox repeatedly. + // The ComponentModel can be derived from the existing XShape/GroupShape + // when knowing where to get it from, making it independent from app. + // + // NOTE: Using another (buffered) oox::Theme would allow to re-create + // using another theming in the future. + // NOTE: The incarnation of import filter (ShapeFilterBase) is only + // used for XShape creation, no xml snippets/data gets imported + // here. XShape creation may be isolated in the future. + SdrModel& rModel(rTarget.getSdrModelFromSdrObject()); + uno::Reference< uno::XInterface > const & rUnoModel(rModel.getUnoModel()); + css::uno::Reference xContext(comphelper::getProcessComponentContext()); + rtl::Reference xFilter(new oox::shape::ShapeFilterBase(xContext)); + + // set oox::Theme at Filter. All LineStyle/FillStyle/Colors/Attributes + // will be taken from there + if(UseDiagramThemeData()) + xFilter->setCurrentTheme(getOrCreateThemePtr(xFilter)); + + css::uno::Reference< css::lang::XComponent > aComponentModel( rUnoModel, uno::UNO_QUERY ); + xFilter->setTargetDocument(aComponentModel); + + // set DiagramFontHeights + xFilter->setDiagramFontHeights(&mpDiagramPtr->getDiagramFontHeights()); + + // Prepare the target for the to-be-created XShapes + uno::Reference xShapes(rTarget.getUnoShape(), uno::UNO_QUERY_THROW); + + for (auto const& child : pShapePtr->getChildren()) + { + // Create all sub-shapes. This will recursively create needed geometry using + // filter-internal ::createShapes + child->addShape( + *xFilter, + xFilter->getCurrentTheme(), + xShapes, + aTransformation, + pShapePtr->getFillProperties()); + } + + // sync FontHeights + mpDiagramPtr->syncDiagramFontHeights(); + + // re-apply secured data from ModelData + if(UseDiagramModelData()) + mpDiagramPtr->getData()->restoreDataFromShapeToModelAfterDiagramImport(*pShapePtr); + + // Re-apply remembered geometry + rTarget.TRSetBaseGeometry(aTransformation, aPolyPolygon); +} + +OUString AdvancedDiagramHelper::getString() const +{ + if(hasDiagramData()) + { + return mpDiagramPtr->getData()->getString(); + } + + return OUString(); +} + +std::vector> AdvancedDiagramHelper::getChildren(const OUString& rParentId) const +{ + if(hasDiagramData()) + { + return mpDiagramPtr->getData()->getChildren(rParentId); + } + + return std::vector>(); +} + +OUString AdvancedDiagramHelper::addNode(const OUString& rText) +{ + OUString aRetval; + + if(hasDiagramData()) + { + aRetval = mpDiagramPtr->getData()->addNode(rText); + + // reset temporary buffered ModelData association lists & rebuild them + // and the Diagram DataModel + mpDiagramPtr->getData()->buildDiagramDataModel(true); + + // also reset temporary buffered layout data - that might + // still refer to changed oox::Shape data + mpDiagramPtr->getLayout()->getPresPointShapeMap().clear(); + } + + return aRetval; +} + +bool AdvancedDiagramHelper::removeNode(const OUString& rNodeId) +{ + bool bRetval(false); + + if(hasDiagramData()) + { + bRetval = mpDiagramPtr->getData()->removeNode(rNodeId); + + // reset temporary buffered ModelData association lists & rebuild them + // and the Diagram DataModel + mpDiagramPtr->getData()->buildDiagramDataModel(true); + + // also reset temporary buffered layout data - that might + // still refer to changed oox::Shape data + mpDiagramPtr->getLayout()->getPresPointShapeMap().clear(); + } + + return bRetval; +} + +svx::diagram::DiagramDataStatePtr AdvancedDiagramHelper::extractDiagramDataState() const +{ + if(!mpDiagramPtr) + { + return svx::diagram::DiagramDataStatePtr(); + } + + return mpDiagramPtr->getData()->extractDiagramDataState(); +} + +void AdvancedDiagramHelper::applyDiagramDataState(const svx::diagram::DiagramDataStatePtr& rState) +{ + if(!mpDiagramPtr) + { + return; + } + + mpDiagramPtr->getData()->applyDiagramDataState(rState); +} + +void AdvancedDiagramHelper::doAnchor(SdrObjGroup& rTarget, ::oox::drawingml::Shape& rRootShape) +{ + if(!mpDiagramPtr) + { + return; + } + + mpDiagramPtr->syncDiagramFontHeights(); + + // After Diagram import, parts of the Diagram ModelData is at the + // oox::drawingml::Shape. Since these objects are temporary helpers, + // secure that data at the Diagram ModelData by copying. + mpDiagramPtr->getData()->secureDataFromShapeToModelAfterDiagramImport(rRootShape); + + anchorToSdrObjGroup(rTarget); +} + +std::shared_ptr< ::oox::drawingml::Theme > AdvancedDiagramHelper::getOrCreateThemePtr( + rtl::Reference< oox::shape::ShapeFilterBase >& rxFilter) const +{ + // (Re-)Use already existing Theme if existing/imported if possible. + // If not, re-import Theme if data is available and thus possible + if(hasDiagramData() && (ForceThemePtrRecreation() || !mpThemePtr)) + { + // get the originally imported dom::XDocument + const uno::Reference< css::xml::dom::XDocument >& xThemeDocument(mpDiagramPtr->getData()->getThemeDocument()); + + if(xThemeDocument) + { + // reset local Theme ModelData *always* to get rid of former data that would + // else be added additionally + const_cast(this)->mpThemePtr = std::make_shared(); + + // import Theme ModelData + rxFilter->importFragment( + new ThemeFragmentHandler( + *rxFilter, OUString(), *mpThemePtr ), + uno::Reference< css::xml::sax::XFastSAXSerializable >( + xThemeDocument, + uno::UNO_QUERY_THROW)); + } + } + + return mpThemePtr; +} + +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/drawingml/diagram/diagramhelper.hxx b/oox/source/drawingml/diagram/diagramhelper.hxx new file mode 100644 index 000000000..85ca4c457 --- /dev/null +++ b/oox/source/drawingml/diagram/diagramhelper.hxx @@ -0,0 +1,94 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_OOX_DRAWINGML_DIAGRAM_DIAGRAMHELPER_HXX +#define INCLUDED_OOX_DRAWINGML_DIAGRAM_DIAGRAMHELPER_HXX + +#include +#include +#include +#include +#include + +namespace svx { namespace diagram { + class DiagramDataState; +}} + +namespace oox::drawingml { + +class Diagram; + +// Advanced DiagramHelper +// +// This helper tries to hold all necessary data to re-layout +// all XShapes/SdrObjects of an already imported Diagram. The +// Diagram holds the SmarArt model data before it gets layouted, +// while Theme holds the oox Fill/Line/Style definitions to +// apply. +// Re-Layouting (re-creating) is rather complex, for detailed +// information see ::reLayout implementation. +// This helper class may/should be extended to: +// - deliver representative data from the Diagram-Model +// - modify it eventually +// - im/export Diagram model to other representations +class AdvancedDiagramHelper final : public svx::diagram::IDiagramHelper +{ + const std::shared_ptr< Diagram > mpDiagramPtr; + std::shared_ptr<::oox::drawingml::Theme> mpThemePtr; + + css::awt::Size maImportSize; + + bool hasDiagramData() const; + +public: + AdvancedDiagramHelper( + const std::shared_ptr< Diagram >& rDiagramPtr, + const std::shared_ptr<::oox::drawingml::Theme>& rTheme, + css::awt::Size aImportSize); + virtual ~AdvancedDiagramHelper(); + + // re-create XShapes + virtual void reLayout(SdrObjGroup& rTarget) override; + + // get text representation of data tree + virtual OUString getString() const override; + + // get children of provided data node + // use empty string for top-level nodes + // returns vector of (id, text) + virtual std::vector> getChildren(const OUString& rParentId) const override; + + // add/remove new top-level node to data model, returns its id + virtual OUString addNode(const OUString& rText) override; + virtual bool removeNode(const OUString& rNodeId) override; + + // Undo/Redo helpers to extract/restore Diagram-defining data + virtual std::shared_ptr< svx::diagram::DiagramDataState > extractDiagramDataState() const override; + virtual void applyDiagramDataState(const std::shared_ptr< svx::diagram::DiagramDataState >& rState) override; + + void doAnchor(SdrObjGroup& rTarget, ::oox::drawingml::Shape& rRootShape); + std::shared_ptr< ::oox::drawingml::Theme > getOrCreateThemePtr( + rtl::Reference< oox::shape::ShapeFilterBase>& rxFilter ) const; +}; + +} + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/drawingml/diagram/diagramlayoutatoms.cxx b/oox/source/drawingml/diagram/diagramlayoutatoms.cxx new file mode 100644 index 000000000..a904797a4 --- /dev/null +++ b/oox/source/drawingml/diagram/diagramlayoutatoms.cxx @@ -0,0 +1,2047 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include "diagramlayoutatoms.hxx" + +#include + +#include "layoutatomvisitorbase.hxx" + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +using namespace ::com::sun::star; +using namespace ::com::sun::star::uno; +using namespace ::com::sun::star::xml::sax; +using namespace ::oox::core; + +namespace +{ +/// Looks up the value of the rInternalName -> nProperty key in rProperties. +oox::OptValue findProperty(const oox::drawingml::LayoutPropertyMap& rProperties, + const OUString& rInternalName, sal_Int32 nProperty) +{ + oox::OptValue oRet; + + auto it = rProperties.find(rInternalName); + if (it != rProperties.end()) + { + const oox::drawingml::LayoutProperty& rProperty = it->second; + auto itProperty = rProperty.find(nProperty); + if (itProperty != rProperty.end()) + oRet = itProperty->second; + } + + return oRet; +} + +/** + * Determines if nUnit is a font unit (measured in points) or not (measured in + * millimeters). + */ +bool isFontUnit(sal_Int32 nUnit) +{ + return nUnit == oox::XML_primFontSz || nUnit == oox::XML_secFontSz; +} + +/// Determines which UNO property should be set for a given constraint type. +sal_Int32 getPropertyFromConstraint(sal_Int32 nConstraint) +{ + switch (nConstraint) + { + case oox::XML_lMarg: + return oox::PROP_TextLeftDistance; + case oox::XML_rMarg: + return oox::PROP_TextRightDistance; + case oox::XML_tMarg: + return oox::PROP_TextUpperDistance; + case oox::XML_bMarg: + return oox::PROP_TextLowerDistance; + } + + return 0; +} + +/** + * Determines if pShape is (or contains) a presentation of a data node of type + * nType. + */ +bool containsDataNodeType(const oox::drawingml::ShapePtr& pShape, sal_Int32 nType) +{ + if (pShape->getDataNodeType() == nType) + return true; + + for (const auto& pChild : pShape->getChildren()) + { + if (containsDataNodeType(pChild, nType)) + return true; + } + + return false; +} +} + +namespace oox::drawingml { +void SnakeAlg::layoutShapeChildren(const AlgAtom& rAlg, const ShapePtr& rShape, + const std::vector& rConstraints) +{ + if (rShape->getChildren().empty() || rShape->getSize().Width == 0 + || rShape->getSize().Height == 0) + return; + + // Parse constraints. + double fChildAspectRatio = rShape->getChildren()[0]->getAspectRatio(); + double fShapeHeight = rShape->getSize().Height; + double fShapeWidth = rShape->getSize().Width; + // Check if we have a child aspect ratio. If so, need to shrink one dimension to + // achieve that ratio. + if (fChildAspectRatio && fShapeHeight && fChildAspectRatio < (fShapeWidth / fShapeHeight)) + { + fShapeWidth = fShapeHeight * fChildAspectRatio; + } + + double fSpaceFromConstraint = 1.0; + LayoutPropertyMap aPropertiesByName; + std::map aPropertiesByType; + LayoutProperty& rParent = aPropertiesByName[""]; + rParent[XML_w] = fShapeWidth; + rParent[XML_h] = fShapeHeight; + for (const auto& rConstr : rConstraints) + { + if (rConstr.mnRefType == XML_w || rConstr.mnRefType == XML_h) + { + if (rConstr.mnType == XML_sp && rConstr.msForName.isEmpty()) + fSpaceFromConstraint = rConstr.mfFactor; + } + + auto itRefForName = aPropertiesByName.find(rConstr.msRefForName); + if (itRefForName == aPropertiesByName.end()) + { + continue; + } + + auto it = itRefForName->second.find(rConstr.mnRefType); + if (it == itRefForName->second.end()) + { + continue; + } + + if (rConstr.mfValue != 0.0) + { + continue; + } + + sal_Int32 nValue = it->second * rConstr.mfFactor; + + if (rConstr.mnPointType == XML_none) + { + aPropertiesByName[rConstr.msForName][rConstr.mnType] = nValue; + } + else + { + aPropertiesByType[rConstr.mnPointType][rConstr.mnType] = nValue; + } + } + + std::vector aShapeWidths(rShape->getChildren().size()); + for (size_t i = 0; i < rShape->getChildren().size(); ++i) + { + ShapePtr pChild = rShape->getChildren()[i]; + if (!pChild->getDataNodeType()) + { + // TODO handle the case when the requirement applies by name, not by point type. + aShapeWidths[i] = fShapeWidth; + continue; + } + + auto itNodeType = aPropertiesByType.find(pChild->getDataNodeType()); + if (itNodeType == aPropertiesByType.end()) + { + aShapeWidths[i] = fShapeWidth; + continue; + } + + auto it = itNodeType->second.find(XML_w); + if (it == itNodeType->second.end()) + { + aShapeWidths[i] = fShapeWidth; + continue; + } + + aShapeWidths[i] = it->second; + } + + bool bSpaceFromConstraints = fSpaceFromConstraint != 1.0; + + const AlgAtom::ParamMap& rMap = rAlg.getMap(); + const sal_Int32 nDir = rMap.count(XML_grDir) ? rMap.find(XML_grDir)->second : XML_tL; + sal_Int32 nIncX = 1; + sal_Int32 nIncY = 1; + bool bHorizontal = true; + switch (nDir) + { + case XML_tL: + nIncX = 1; + nIncY = 1; + break; + case XML_tR: + nIncX = -1; + nIncY = 1; + break; + case XML_bL: + nIncX = 1; + nIncY = -1; + bHorizontal = false; + break; + case XML_bR: + nIncX = -1; + nIncY = -1; + bHorizontal = false; + break; + } + + sal_Int32 nCount = rShape->getChildren().size(); + // Defaults in case not provided by constraints. + double fSpace = bSpaceFromConstraints ? fSpaceFromConstraint : 0.3; + double fAspectRatio = 0.54; // diagram should not spill outside, earlier it was 0.6 + + sal_Int32 nCol = 1; + sal_Int32 nRow = 1; + sal_Int32 nMaxRowWidth = 0; + if (nCount <= fChildAspectRatio) + // Child aspect ratio request (width/height) is N, and we have at most N shapes. + // This means we don't need multiple columns. + nRow = nCount; + else + { + for (; nRow < nCount; nRow++) + { + nCol = std::ceil(static_cast(nCount) / nRow); + sal_Int32 nRowWidth = 0; + for (sal_Int32 i = 0; i < nCol; ++i) + { + if (i >= nCount) + { + break; + } + + nRowWidth += aShapeWidths[i]; + } + double fTotalShapesHeight = fShapeHeight * nRow; + if (nRowWidth && fTotalShapesHeight / nRowWidth >= fAspectRatio) + { + if (nRowWidth > nMaxRowWidth) + { + nMaxRowWidth = nRowWidth; + } + break; + } + } + } + + SAL_INFO("oox.drawingml", "Snake layout grid: " << nCol << "x" << nRow); + + sal_Int32 nWidth = rShape->getSize().Width / (nCol + (nCol - 1) * fSpace); + awt::Size aChildSize(nWidth, nWidth * fAspectRatio); + if (nCol == 1 && nRow > 1) + { + // We have a single column, so count the height based on the parent height, not + // based on width. + // Space occurs inside children; also double amount of space is needed outside (on + // both sides), if the factor comes from a constraint. + sal_Int32 nNumSpaces = -1; + if (bSpaceFromConstraints) + nNumSpaces += 4; + sal_Int32 nHeight = rShape->getSize().Height / (nRow + (nRow + nNumSpaces) * fSpace); + + if (fChildAspectRatio > 1) + { + // Shrink width if the aspect ratio requires it. + nWidth = std::min(rShape->getSize().Width, + static_cast(nHeight * fChildAspectRatio)); + aChildSize = awt::Size(nWidth, nHeight); + } + + bHorizontal = false; + } + + awt::Point aCurrPos(0, 0); + if (nIncX == -1) + aCurrPos.X = rShape->getSize().Width - aChildSize.Width; + if (nIncY == -1) + aCurrPos.Y = rShape->getSize().Height - aChildSize.Height; + else if (bSpaceFromConstraints) + { + if (!bHorizontal) + { + // Initial vertical offset to have upper spacing (outside, so double amount). + aCurrPos.Y = aChildSize.Height * fSpace * 2; + } + } + + sal_Int32 nStartX = aCurrPos.X; + sal_Int32 nColIdx = 0, index = 0; + + const sal_Int32 aContDir + = rMap.count(XML_contDir) ? rMap.find(XML_contDir)->second : XML_sameDir; + + switch (aContDir) + { + case XML_sameDir: + { + sal_Int32 nRowHeight = 0; + for (auto& aCurrShape : rShape->getChildren()) + { + aCurrShape->setPosition(aCurrPos); + awt::Size aCurrSize(aChildSize); + // aShapeWidths items are a portion of nMaxRowWidth. We want the same ratio, + // based on the original parent width, ignoring the aspect ratio request. + bool bWidthsFromConstraints + = nCount >= 2 && rShape->getChildren()[1]->getDataNodeType() == XML_sibTrans; + if (bWidthsFromConstraints && nMaxRowWidth) + { + double fWidthFactor = static_cast(aShapeWidths[index]) / nMaxRowWidth; + // We can only work from constraints if spacing is represented by a real + // child shape. + aCurrSize.Width = rShape->getSize().Width * fWidthFactor; + } + if (fChildAspectRatio) + { + aCurrSize.Height = aCurrSize.Width / fChildAspectRatio; + + // Child shapes are not allowed to leave their parent. + aCurrSize.Height = std::min( + aCurrSize.Height, rShape->getSize().Height / (nRow + (nRow - 1) * fSpace)); + } + if (aCurrSize.Height > nRowHeight) + { + nRowHeight = aCurrSize.Height; + } + aCurrShape->setSize(aCurrSize); + aCurrShape->setChildSize(aCurrSize); + + index++; // counts index of child, helpful for positioning. + + if (index % nCol == 0 || ((index / nCol) + 1) != nRow) + aCurrPos.X += nIncX * (aCurrSize.Width + fSpace * aCurrSize.Width); + + if (++nColIdx == nCol) // condition for next row + { + // if last row, then position children according to number of shapes. + if ((index + 1) % nCol != 0 && (index + 1) >= 3 + && ((index + 1) / nCol + 1) == nRow && nCount != nRow * nCol) + { + // position first child of last row + if (bWidthsFromConstraints) + { + aCurrPos.X = nStartX; + } + else + { + // Can assume that all child shape has the same width. + aCurrPos.X + = nStartX + + (nIncX * (aCurrSize.Width + fSpace * aCurrSize.Width)) / 2; + } + } + else + // if not last row, positions first child of that row + aCurrPos.X = nStartX; + aCurrPos.Y += nIncY * (nRowHeight + fSpace * nRowHeight); + nColIdx = 0; + nRowHeight = 0; + } + + // positions children in the last row. + if (index % nCol != 0 && index >= 3 && ((index / nCol) + 1) == nRow) + aCurrPos.X += (nIncX * (aCurrSize.Width + fSpace * aCurrSize.Width)); + } + break; + } + case XML_revDir: + for (auto& aCurrShape : rShape->getChildren()) + { + aCurrShape->setPosition(aCurrPos); + aCurrShape->setSize(aChildSize); + aCurrShape->setChildSize(aChildSize); + + index++; // counts index of child, helpful for positioning. + + /* + index%col -> tests node is at last column + ((index/nCol)+1)!=nRow) -> tests node is at last row or not + ((index/nCol)+1)%2!=0 -> tests node is at row which is multiple of 2, important for revDir + num!=nRow*nCol -> tests how last row nodes should be spread. + */ + + if ((index % nCol == 0 || ((index / nCol) + 1) != nRow) + && ((index / nCol) + 1) % 2 != 0) + aCurrPos.X += (aChildSize.Width + fSpace * aChildSize.Width); + else if (index % nCol != 0 + && ((index / nCol) + 1) != nRow) // child other than placed at last column + aCurrPos.X -= (aChildSize.Width + fSpace * aChildSize.Width); + + if (++nColIdx == nCol) // condition for next row + { + // if last row, then position children according to number of shapes. + if ((index + 1) % nCol != 0 && (index + 1) >= 4 + && ((index + 1) / nCol + 1) == nRow && nCount != nRow * nCol + && ((index / nCol) + 1) % 2 == 0) + // position first child of last row + aCurrPos.X -= aChildSize.Width * 3 / 2; + else if ((index + 1) % nCol != 0 && (index + 1) >= 4 + && ((index + 1) / nCol + 1) == nRow && nCount != nRow * nCol + && ((index / nCol) + 1) % 2 != 0) + aCurrPos.X = nStartX + + (nIncX * (aChildSize.Width + fSpace * aChildSize.Width)) / 2; + else if (((index / nCol) + 1) % 2 != 0) + aCurrPos.X = nStartX; + + aCurrPos.Y += nIncY * (aChildSize.Height + fSpace * aChildSize.Height); + nColIdx = 0; + } + + // positions children in the last row. + if (index % nCol != 0 && index >= 3 && ((index / nCol) + 1) == nRow + && ((index / nCol) + 1) % 2 == 0) + //if row%2=0 then start from left else + aCurrPos.X -= (nIncX * (aChildSize.Width + fSpace * aChildSize.Width)); + else if (index % nCol != 0 && index >= 3 && ((index / nCol) + 1) == nRow + && ((index / nCol) + 1) % 2 != 0) + // start from right + aCurrPos.X += (nIncX * (aChildSize.Width + fSpace * aChildSize.Width)); + } + break; + } +} + +void PyraAlg::layoutShapeChildren(const ShapePtr& rShape) +{ + if (rShape->getChildren().empty() || rShape->getSize().Width == 0 + || rShape->getSize().Height == 0) + return; + + // const sal_Int32 nDir = maMap.count(XML_linDir) ? maMap.find(XML_linDir)->second : XML_fromT; + // const sal_Int32 npyraAcctPos = maMap.count(XML_pyraAcctPos) ? maMap.find(XML_pyraAcctPos)->second : XML_bef; + // const sal_Int32 ntxDir = maMap.count(XML_txDir) ? maMap.find(XML_txDir)->second : XML_fromT; + // const sal_Int32 npyraLvlNode = maMap.count(XML_pyraLvlNode) ? maMap.find(XML_pyraLvlNode)->second : XML_level; + // uncomment when use in code. + + sal_Int32 nCount = rShape->getChildren().size(); + double fAspectRatio = 0.32; + + awt::Size aChildSize = rShape->getSize(); + aChildSize.Width /= nCount; + aChildSize.Height /= nCount; + + awt::Point aCurrPos(0, 0); + aCurrPos.X = fAspectRatio * aChildSize.Width * (nCount - 1); + aCurrPos.Y = fAspectRatio * aChildSize.Height; + + for (auto& aCurrShape : rShape->getChildren()) + { + aCurrShape->setPosition(aCurrPos); + if (nCount > 1) + { + aCurrPos.X -= aChildSize.Height / (nCount - 1); + } + aChildSize.Width += aChildSize.Height; + aCurrShape->setSize(aChildSize); + aCurrShape->setChildSize(aChildSize); + aCurrPos.Y += (aChildSize.Height); + } +} + +bool CompositeAlg::inferFromLayoutProperty(const LayoutProperty& rMap, sal_Int32 nRefType, + sal_Int32& rValue) +{ + switch (nRefType) + { + case XML_r: + { + auto it = rMap.find(XML_l); + if (it == rMap.end()) + { + return false; + } + sal_Int32 nLeft = it->second; + it = rMap.find(XML_w); + if (it == rMap.end()) + { + return false; + } + rValue = nLeft + it->second; + return true; + } + default: + break; + } + + return false; +} + +void CompositeAlg::applyConstraintToLayout(const Constraint& rConstraint, + LayoutPropertyMap& rProperties) +{ + // TODO handle the case when we have ptType="...", not forName="...". + if (rConstraint.msForName.isEmpty()) + { + return; + } + + const LayoutPropertyMap::const_iterator aRef = rProperties.find(rConstraint.msRefForName); + if (aRef == rProperties.end()) + return; + + const LayoutProperty::const_iterator aRefType = aRef->second.find(rConstraint.mnRefType); + sal_Int32 nInferredValue = 0; + if (aRefType != aRef->second.end()) + { + // Reference is found directly. + rProperties[rConstraint.msForName][rConstraint.mnType] + = aRefType->second * rConstraint.mfFactor; + } + else if (inferFromLayoutProperty(aRef->second, rConstraint.mnRefType, nInferredValue)) + { + // Reference can be inferred. + rProperties[rConstraint.msForName][rConstraint.mnType] + = nInferredValue * rConstraint.mfFactor; + } + else + { + // Reference not found, assume a fixed value. + // Values are never in EMU, while oox::drawingml::Shape position and size are always in + // EMU. + const double fValue = o3tl::convert(rConstraint.mfValue, + isFontUnit(rConstraint.mnRefType) ? o3tl::Length::pt + : o3tl::Length::mm, + o3tl::Length::emu); + rProperties[rConstraint.msForName][rConstraint.mnType] = fValue; + } +} + +void CompositeAlg::layoutShapeChildren(AlgAtom& rAlg, const ShapePtr& rShape, + const std::vector& rConstraints) +{ + LayoutPropertyMap aProperties; + LayoutProperty& rParent = aProperties[""]; + + sal_Int32 nParentXOffset = 0; + + // Track min/max vertical positions, so we can center everything at the end, if needed. + sal_Int32 nVertMin = std::numeric_limits::max(); + sal_Int32 nVertMax = 0; + + if (rAlg.getAspectRatio() != 1.0) + { + rParent[XML_w] = rShape->getSize().Width; + rParent[XML_h] = rShape->getSize().Height; + rParent[XML_l] = 0; + rParent[XML_t] = 0; + rParent[XML_r] = rShape->getSize().Width; + rParent[XML_b] = rShape->getSize().Height; + } + else + { + // Shrink width to be only as large as height. + rParent[XML_w] = std::min(rShape->getSize().Width, rShape->getSize().Height); + rParent[XML_h] = rShape->getSize().Height; + if (rParent[XML_w] < rShape->getSize().Width) + nParentXOffset = (rShape->getSize().Width - rParent[XML_w]) / 2; + rParent[XML_l] = nParentXOffset; + rParent[XML_t] = 0; + rParent[XML_r] = rShape->getSize().Width - rParent[XML_l]; + rParent[XML_b] = rShape->getSize().Height; + } + + for (const auto& rConstr : rConstraints) + { + // Apply direct constraints for all layout nodes. + applyConstraintToLayout(rConstr, aProperties); + } + + for (auto& aCurrShape : rShape->getChildren()) + { + // Apply constraints from the current layout node for this child shape. + // Previous child shapes may have changed aProperties. + for (const auto& rConstr : rConstraints) + { + if (rConstr.msForName != aCurrShape->getInternalName()) + { + continue; + } + + applyConstraintToLayout(rConstr, aProperties); + } + + // Apply constraints from the child layout node for this child shape. + // This builds on top of the own parent state + the state of previous shapes in the + // same composite algorithm. + const LayoutNode& rLayoutNode = rAlg.getLayoutNode(); + for (const auto& pDirectChild : rLayoutNode.getChildren()) + { + auto pLayoutNode = dynamic_cast(pDirectChild.get()); + if (!pLayoutNode) + { + continue; + } + + if (pLayoutNode->getName() != aCurrShape->getInternalName()) + { + continue; + } + + for (const auto& pChild : pLayoutNode->getChildren()) + { + auto pConstraintAtom = dynamic_cast(pChild.get()); + if (!pConstraintAtom) + { + continue; + } + + const Constraint& rConstraint = pConstraintAtom->getConstraint(); + if (!rConstraint.msForName.isEmpty()) + { + continue; + } + + if (!rConstraint.msRefForName.isEmpty()) + { + continue; + } + + // Either an absolute value or a factor of a property. + if (rConstraint.mfValue == 0.0 && rConstraint.mnRefType == XML_none) + { + continue; + } + + Constraint aConstraint(rConstraint); + aConstraint.msForName = pLayoutNode->getName(); + aConstraint.msRefForName = pLayoutNode->getName(); + + applyConstraintToLayout(aConstraint, aProperties); + } + } + + awt::Size aSize = rShape->getSize(); + awt::Point aPos(0, 0); + + const LayoutPropertyMap::const_iterator aPropIt + = aProperties.find(aCurrShape->getInternalName()); + if (aPropIt != aProperties.end()) + { + const LayoutProperty& rProp = aPropIt->second; + LayoutProperty::const_iterator it, it2; + + if ((it = rProp.find(XML_w)) != rProp.end()) + aSize.Width = std::min(it->second, rShape->getSize().Width); + if ((it = rProp.find(XML_h)) != rProp.end()) + aSize.Height = std::min(it->second, rShape->getSize().Height); + + if ((it = rProp.find(XML_l)) != rProp.end()) + aPos.X = it->second; + else if ((it = rProp.find(XML_ctrX)) != rProp.end()) + aPos.X = it->second - aSize.Width / 2; + else if ((it = rProp.find(XML_r)) != rProp.end()) + aPos.X = it->second - aSize.Width; + + if ((it = rProp.find(XML_t)) != rProp.end()) + aPos.Y = it->second; + else if ((it = rProp.find(XML_ctrY)) != rProp.end()) + aPos.Y = it->second - aSize.Height / 2; + else if ((it = rProp.find(XML_b)) != rProp.end()) + aPos.Y = it->second - aSize.Height; + + if ((it = rProp.find(XML_l)) != rProp.end() && (it2 = rProp.find(XML_r)) != rProp.end()) + aSize.Width = it2->second - it->second; + if ((it = rProp.find(XML_t)) != rProp.end() && (it2 = rProp.find(XML_b)) != rProp.end()) + aSize.Height = it2->second - it->second; + + aPos.X += nParentXOffset; + aSize.Width = std::min(aSize.Width, rShape->getSize().Width - aPos.X); + aSize.Height = std::min(aSize.Height, rShape->getSize().Height - aPos.Y); + } + else + SAL_WARN("oox.drawingml", "composite layout properties not found for shape " + << aCurrShape->getInternalName()); + + aCurrShape->setSize(aSize); + aCurrShape->setChildSize(aSize); + aCurrShape->setPosition(aPos); + + nVertMin = std::min(aPos.Y, nVertMin); + nVertMax = std::max(aPos.Y + aSize.Height, nVertMax); + + NamedShapePairs& rDiagramFontHeights + = rAlg.getLayoutNode().getDiagram().getDiagramFontHeights(); + auto it = rDiagramFontHeights.find(aCurrShape->getInternalName()); + if (it != rDiagramFontHeights.end()) + { + // Internal name matches: put drawingml::Shape to the relevant group, for + // synchronized font height handling. + it->second.insert({ aCurrShape, {} }); + } + } + + // See if all vertical space is used or we have to center the content. + if (!(nVertMin >= 0 && nVertMin <= nVertMax && nVertMax <= rParent[XML_h])) + return; + + sal_Int32 nDiff = rParent[XML_h] - (nVertMax - nVertMin); + if (nDiff > 0) + { + for (auto& aCurrShape : rShape->getChildren()) + { + awt::Point aPosition = aCurrShape->getPosition(); + aPosition.Y += nDiff / 2; + aCurrShape->setPosition(aPosition); + } + } +} + +IteratorAttr::IteratorAttr( ) + : mnCnt( -1 ) + , mbHideLastTrans( true ) + , mnPtType( 0 ) + , mnSt( 0 ) + , mnStep( 1 ) +{ +} + +void IteratorAttr::loadFromXAttr( const Reference< XFastAttributeList >& xAttr ) +{ + AttributeList attr( xAttr ); + maAxis = attr.getTokenList(XML_axis); + mnCnt = attr.getInteger( XML_cnt, -1 ); + mbHideLastTrans = attr.getBool( XML_hideLastTrans, true ); + mnSt = attr.getInteger( XML_st, 0 ); + mnStep = attr.getInteger( XML_step, 1 ); + + // better to keep first token instead of error when multiple values + std::vector aPtTypes = attr.getTokenList(XML_ptType); + mnPtType = aPtTypes.empty() ? XML_all : aPtTypes.front(); +} + +ConditionAttr::ConditionAttr() + : mnFunc( 0 ) + , mnArg( 0 ) + , mnOp( 0 ) + , mnVal( 0 ) +{ +} + +void ConditionAttr::loadFromXAttr( const Reference< XFastAttributeList >& xAttr ) +{ + mnFunc = xAttr->getOptionalValueToken( XML_func, 0 ); + mnArg = xAttr->getOptionalValueToken( XML_arg, XML_none ); + mnOp = xAttr->getOptionalValueToken( XML_op, 0 ); + msVal = xAttr->getOptionalValue( XML_val ); + mnVal = xAttr->getOptionalValueToken( XML_val, 0 ); +} + +void LayoutAtom::dump(int level) +{ + SAL_INFO("oox.drawingml", "level = " << level << " - " << msName << " of type " << typeid(*this).name() ); + for (const auto& pAtom : getChildren()) + pAtom->dump(level + 1); +} + +ForEachAtom::ForEachAtom(LayoutNode& rLayoutNode, const Reference< XFastAttributeList >& xAttributes) : + LayoutAtom(rLayoutNode) +{ + maIter.loadFromXAttr(xAttributes); +} + +void ForEachAtom::accept( LayoutAtomVisitor& rVisitor ) +{ + rVisitor.visit(*this); +} + +LayoutAtomPtr ForEachAtom::getRefAtom() +{ + if (!msRef.isEmpty()) + { + const LayoutAtomMap& rLayoutAtomMap = getLayoutNode().getDiagram().getLayout()->getLayoutAtomMap(); + LayoutAtomMap::const_iterator pRefAtom = rLayoutAtomMap.find(msRef); + if (pRefAtom != rLayoutAtomMap.end()) + return pRefAtom->second; + else + SAL_WARN("oox.drawingml", "ForEach reference \"" << msRef << "\" not found"); + } + return LayoutAtomPtr(); +} + +void ChooseAtom::accept( LayoutAtomVisitor& rVisitor ) +{ + rVisitor.visit(*this); +} + +ConditionAtom::ConditionAtom(LayoutNode& rLayoutNode, bool isElse, const Reference< XFastAttributeList >& xAttributes) : + LayoutAtom(rLayoutNode), + mIsElse(isElse) +{ + maIter.loadFromXAttr( xAttributes ); + maCond.loadFromXAttr( xAttributes ); +} + +bool ConditionAtom::compareResult(sal_Int32 nOperator, sal_Int32 nFirst, sal_Int32 nSecond) +{ + switch (nOperator) + { + case XML_equ: return nFirst == nSecond; + case XML_gt: return nFirst > nSecond; + case XML_gte: return nFirst >= nSecond; + case XML_lt: return nFirst < nSecond; + case XML_lte: return nFirst <= nSecond; + case XML_neq: return nFirst != nSecond; + default: + SAL_WARN("oox.drawingml", "unsupported operator: " << nOperator); + return false; + } +} + +namespace +{ +/** + * Takes the connection list from rLayoutNode, navigates from rFrom on an edge + * of type nType, using a direction determined by bSourceToDestination. + */ +OUString navigate(LayoutNode& rLayoutNode, svx::diagram::TypeConstant nType, std::u16string_view rFrom, + bool bSourceToDestination) +{ + for (const auto& rConnection : rLayoutNode.getDiagram().getData()->getConnections()) + { + if (rConnection.mnXMLType != nType) + continue; + + if (bSourceToDestination) + { + if (rConnection.msSourceId == rFrom) + return rConnection.msDestId; + } + else + { + if (rConnection.msDestId == rFrom) + return rConnection.msSourceId; + } + } + + return OUString(); +} + +sal_Int32 calcMaxDepth(std::u16string_view rNodeName, const svx::diagram::Connections& rConnections) +{ + sal_Int32 nMaxLength = 0; + for (auto const& aCxn : rConnections) + if (aCxn.mnXMLType == svx::diagram::TypeConstant::XML_parOf && aCxn.msSourceId == rNodeName) + nMaxLength = std::max(nMaxLength, calcMaxDepth(aCxn.msDestId, rConnections) + 1); + + return nMaxLength; +} +} + +sal_Int32 ConditionAtom::getNodeCount(const svx::diagram::Point* pPresPoint) const +{ + sal_Int32 nCount = 0; + OUString sNodeId = pPresPoint->msPresentationAssociationId; + + // HACK: special case - count children of first child + if (maIter.maAxis.size() == 2 && maIter.maAxis[0] == XML_ch && maIter.maAxis[1] == XML_ch) + sNodeId = navigate(mrLayoutNode, svx::diagram::TypeConstant::XML_parOf, sNodeId, /*bSourceToDestination*/ true); + + if (!sNodeId.isEmpty()) + { + for (const auto& aCxn : mrLayoutNode.getDiagram().getData()->getConnections()) + if (aCxn.mnXMLType == svx::diagram::TypeConstant::XML_parOf && aCxn.msSourceId == sNodeId) + nCount++; + } + + return nCount; +} + +bool ConditionAtom::getDecision(const svx::diagram::Point* pPresPoint) const +{ + if (mIsElse) + return true; + if (!pPresPoint) + return false; + + switch (maCond.mnFunc) + { + case XML_var: + { + if (maCond.mnArg == XML_dir) + return compareResult(maCond.mnOp, pPresPoint->mnDirection, maCond.mnVal); + else if (maCond.mnArg == XML_hierBranch) + { + sal_Int32 nHierarchyBranch = pPresPoint->moHierarchyBranch.value_or(XML_std); + if (!pPresPoint->moHierarchyBranch.has_value()) + { + // If is missing in the current presentation + // point, ask the parent. + OUString aParent = navigate(mrLayoutNode, svx::diagram::TypeConstant::XML_presParOf, pPresPoint->msModelId, + /*bSourceToDestination*/ false); + DiagramData::PointNameMap& rPointNameMap + = mrLayoutNode.getDiagram().getData()->getPointNameMap(); + auto it = rPointNameMap.find(aParent); + if (it != rPointNameMap.end()) + { + const svx::diagram::Point* pParent = it->second; + if (pParent->moHierarchyBranch.has_value()) + nHierarchyBranch = pParent->moHierarchyBranch.value(); + } + } + return compareResult(maCond.mnOp, nHierarchyBranch, maCond.mnVal); + } + break; + } + + case XML_cnt: + return compareResult(maCond.mnOp, getNodeCount(pPresPoint), maCond.msVal.toInt32()); + + case XML_maxDepth: + { + sal_Int32 nMaxDepth = calcMaxDepth(pPresPoint->msPresentationAssociationId, mrLayoutNode.getDiagram().getData()->getConnections()); + return compareResult(maCond.mnOp, nMaxDepth, maCond.msVal.toInt32()); + } + + case XML_depth: + case XML_pos: + case XML_revPos: + case XML_posEven: + case XML_posOdd: + // TODO + default: + SAL_WARN("oox.drawingml", "unknown function " << maCond.mnFunc); + break; + } + + return true; +} + +void ConditionAtom::accept( LayoutAtomVisitor& rVisitor ) +{ + rVisitor.visit(*this); +} + +void ConstraintAtom::accept( LayoutAtomVisitor& rVisitor ) +{ + rVisitor.visit(*this); +} + +void RuleAtom::accept( LayoutAtomVisitor& rVisitor ) +{ + rVisitor.visit(*this); +} + +void ConstraintAtom::parseConstraint(std::vector& rConstraints, + bool bRequireForName) const +{ + // Allowlist for cases where empty forName is handled. + if (bRequireForName) + { + switch (maConstraint.mnType) + { + case XML_sp: + case XML_lMarg: + case XML_rMarg: + case XML_tMarg: + case XML_bMarg: + bRequireForName = false; + break; + } + switch (maConstraint.mnPointType) + { + case XML_sibTrans: + bRequireForName = false; + break; + } + } + + if (bRequireForName && maConstraint.msForName.isEmpty()) + return; + + // accepting only basic equality constraints + if ((maConstraint.mnOperator == XML_none || maConstraint.mnOperator == XML_equ) + && maConstraint.mnType != XML_none) + { + rConstraints.push_back(maConstraint); + } +} + +void RuleAtom::parseRule(std::vector& rRules) const +{ + if (!maRule.msForName.isEmpty()) + { + rRules.push_back(maRule); + } +} + +void AlgAtom::accept( LayoutAtomVisitor& rVisitor ) +{ + rVisitor.visit(*this); +} + +sal_Int32 AlgAtom::getConnectorType() +{ + sal_Int32 nConnRout = 0; + sal_Int32 nBegSty = 0; + sal_Int32 nEndSty = 0; + if (maMap.count(oox::XML_connRout)) + nConnRout = maMap.find(oox::XML_connRout)->second; + if (maMap.count(oox::XML_begSty)) + nBegSty = maMap.find(oox::XML_begSty)->second; + if (maMap.count(oox::XML_endSty)) + nEndSty = maMap.find(oox::XML_endSty)->second; + + if (nConnRout == oox::XML_bend) + return 0; // was oox::XML_bentConnector3 - connectors are hidden in org chart as they don't work anyway + if (nBegSty == oox::XML_arr && nEndSty == oox::XML_arr) + return oox::XML_leftRightArrow; + if (nBegSty == oox::XML_arr) + return oox::XML_leftArrow; + if (nEndSty == oox::XML_arr) + return oox::XML_rightArrow; + + return oox::XML_rightArrow; +} + +sal_Int32 AlgAtom::getVerticalShapesCount(const ShapePtr& rShape) +{ + if (rShape->getChildren().empty()) + return (rShape->getSubType() != XML_conn) ? 1 : 0; + + sal_Int32 nDir = XML_fromL; + if (mnType == XML_hierRoot) + nDir = XML_fromT; + else if (maMap.count(XML_linDir)) + nDir = maMap.find(XML_linDir)->second; + + const sal_Int32 nSecDir = maMap.count(XML_secLinDir) ? maMap.find(XML_secLinDir)->second : 0; + + sal_Int32 nCount = 0; + if (nDir == XML_fromT || nDir == XML_fromB) + { + for (const ShapePtr& pChild : rShape->getChildren()) + nCount += pChild->getVerticalShapesCount(); + } + else if ((nDir == XML_fromL || nDir == XML_fromR) && nSecDir == XML_fromT) + { + for (const ShapePtr& pChild : rShape->getChildren()) + nCount += pChild->getVerticalShapesCount(); + nCount = (nCount + 1) / 2; + } + else + { + for (const ShapePtr& pChild : rShape->getChildren()) + nCount = std::max(nCount, pChild->getVerticalShapesCount()); + } + + return nCount; +} + +namespace +{ +/// Does the first data node of this shape have customized text properties? +bool HasCustomText(const ShapePtr& rShape, LayoutNode& rLayoutNode) +{ + const PresPointShapeMap& rPresPointShapeMap + = rLayoutNode.getDiagram().getLayout()->getPresPointShapeMap(); + const DiagramData::StringMap& rPresOfNameMap + = rLayoutNode.getDiagram().getData()->getPresOfNameMap(); + const DiagramData::PointNameMap& rPointNameMap + = rLayoutNode.getDiagram().getData()->getPointNameMap(); + // Get the first presentation node of the shape. + const svx::diagram::Point* pPresNode = nullptr; + for (const auto& rPair : rPresPointShapeMap) + { + if (rPair.second == rShape) + { + pPresNode = rPair.first; + break; + } + } + // Get the first data node of the presentation node. + svx::diagram::Point* pDataNode = nullptr; + if (pPresNode) + { + auto itPresToData = rPresOfNameMap.find(pPresNode->msModelId); + if (itPresToData != rPresOfNameMap.end()) + { + for (const auto& rPair : itPresToData->second) + { + const DiagramData::SourceIdAndDepth& rItem = rPair.second; + auto it = rPointNameMap.find(rItem.msSourceId); + if (it != rPointNameMap.end()) + { + pDataNode = it->second; + break; + } + } + } + } + + // If we have a data node, see if its text is customized or not. + if (pDataNode) + { + return pDataNode->mbCustomText; + } + + return false; +} +} + +void AlgAtom::layoutShape(const ShapePtr& rShape, const std::vector& rConstraints, + const std::vector& rRules) +{ + if (mnType != XML_lin) + { + // TODO Handle spacing from constraints for non-lin algorithms as well. + rShape->getChildren().erase( + std::remove_if(rShape->getChildren().begin(), rShape->getChildren().end(), + [](const ShapePtr& aChild) { + return aChild->getServiceName() == "com.sun.star.drawing.GroupShape" + && aChild->getChildren().empty(); + }), + rShape->getChildren().end()); + } + + switch(mnType) + { + case XML_composite: + { + CompositeAlg::layoutShapeChildren(*this, rShape, rConstraints); + break; + } + + case XML_conn: + { + if (rShape->getSubType() == XML_conn) + { + // There is no shape type "conn", replace it by an arrow based + // on the direction of the parent linear layout. + sal_Int32 nType = getConnectorType(); + + rShape->setSubType(nType); + rShape->getCustomShapeProperties()->setShapePresetType(nType); + } + + // Parse constraints to adjust the size. + std::vector aDirectConstraints; + const LayoutNode& rLayoutNode = getLayoutNode(); + for (const auto& pChild : rLayoutNode.getChildren()) + { + auto pConstraintAtom = dynamic_cast(pChild.get()); + if (pConstraintAtom) + pConstraintAtom->parseConstraint(aDirectConstraints, /*bRequireForName=*/false); + } + + LayoutPropertyMap aProperties; + LayoutProperty& rParent = aProperties[""]; + rParent[XML_w] = rShape->getSize().Width; + rParent[XML_h] = rShape->getSize().Height; + rParent[XML_l] = 0; + rParent[XML_t] = 0; + rParent[XML_r] = rShape->getSize().Width; + rParent[XML_b] = rShape->getSize().Height; + for (const auto& rConstr : aDirectConstraints) + { + const LayoutPropertyMap::const_iterator aRef + = aProperties.find(rConstr.msRefForName); + if (aRef != aProperties.end()) + { + const LayoutProperty::const_iterator aRefType + = aRef->second.find(rConstr.mnRefType); + if (aRefType != aRef->second.end()) + aProperties[rConstr.msForName][rConstr.mnType] + = aRefType->second * rConstr.mfFactor; + } + } + awt::Size aSize; + aSize.Width = rParent[XML_w]; + aSize.Height = rParent[XML_h]; + // keep center position + awt::Point aPos = rShape->getPosition(); + aPos.X += (rShape->getSize().Width - aSize.Width) / 2; + aPos.Y += (rShape->getSize().Height - aSize.Height) / 2; + rShape->setPosition(aPos); + rShape->setSize(aSize); + break; + } + + case XML_cycle: + { + if (rShape->getChildren().empty()) + break; + + const sal_Int32 nStartAngle = maMap.count(XML_stAng) ? maMap.find(XML_stAng)->second : 0; + const sal_Int32 nSpanAngle = maMap.count(XML_spanAng) ? maMap.find(XML_spanAng)->second : 360; + const sal_Int32 nRotationPath = maMap.count(XML_rotPath) ? maMap.find(XML_rotPath)->second : XML_none; + const sal_Int32 nctrShpMap = maMap.count(XML_ctrShpMap) ? maMap.find(XML_ctrShpMap)->second : XML_none; + const awt::Size aCenter(rShape->getSize().Width / 2, rShape->getSize().Height / 2); + const awt::Size aChildSize(rShape->getSize().Width / 4, rShape->getSize().Height / 4); + const awt::Size aConnectorSize(rShape->getSize().Width / 12, rShape->getSize().Height / 12); + const sal_Int32 nRadius = std::min( + (rShape->getSize().Width - aChildSize.Width) / 2, + (rShape->getSize().Height - aChildSize.Height) / 2); + + std::vector aCycleChildren = rShape->getChildren(); + + if (nctrShpMap == XML_fNode) + { + // first node placed in center, others around + oox::drawingml::ShapePtr pCenterShape = aCycleChildren.front(); + aCycleChildren.erase(aCycleChildren.begin()); + const awt::Point aCurrPos(aCenter.Width - aChildSize.Width / 2, + aCenter.Height - aChildSize.Height / 2); + pCenterShape->setPosition(aCurrPos); + pCenterShape->setSize(aChildSize); + pCenterShape->setChildSize(aChildSize); + } + + const sal_Int32 nShapes = aCycleChildren.size(); + if (nShapes) + { + const sal_Int32 nConnectorRadius = nRadius * cos(basegfx::deg2rad(nSpanAngle / nShapes)); + const sal_Int32 nConnectorAngle = nSpanAngle > 0 ? 0 : 180; + + sal_Int32 idx = 0; + for (auto & aCurrShape : aCycleChildren) + { + const double fAngle = static_cast(idx)*nSpanAngle/nShapes + nStartAngle; + awt::Size aCurrSize = aChildSize; + sal_Int32 nCurrRadius = nRadius; + if (aCurrShape->getSubType() == XML_conn) + { + aCurrSize = aConnectorSize; + nCurrRadius = nConnectorRadius; + } + const awt::Point aCurrPos( + aCenter.Width + nCurrRadius*sin(basegfx::deg2rad(fAngle)) - aCurrSize.Width/2, + aCenter.Height - nCurrRadius*cos(basegfx::deg2rad(fAngle)) - aCurrSize.Height/2); + + aCurrShape->setPosition(aCurrPos); + aCurrShape->setSize(aCurrSize); + aCurrShape->setChildSize(aCurrSize); + + if (nRotationPath == XML_alongPath) + aCurrShape->setRotation(fAngle * PER_DEGREE); + + // connectors should be handled in conn, but we don't have + // reference to previous and next child, so it's easier here + if (aCurrShape->getSubType() == XML_conn) + aCurrShape->setRotation((nConnectorAngle + fAngle) * PER_DEGREE); + + idx++; + } + } + break; + } + + case XML_hierChild: + case XML_hierRoot: + { + if (rShape->getChildren().empty() || rShape->getSize().Width == 0 || rShape->getSize().Height == 0) + break; + + // hierRoot is the manager -> employees vertical linear path, + // hierChild is the first employee -> last employee horizontal + // linear path. + sal_Int32 nDir = XML_fromL; + if (mnType == XML_hierRoot) + nDir = XML_fromT; + else if (maMap.count(XML_linDir)) + nDir = maMap.find(XML_linDir)->second; + + const sal_Int32 nSecDir = maMap.count(XML_secLinDir) ? maMap.find(XML_secLinDir)->second : 0; + + sal_Int32 nCount = rShape->getChildren().size(); + + if (mnType == XML_hierChild) + { + // Connectors should not influence the size of non-connect shapes. + nCount = std::count_if( + rShape->getChildren().begin(), rShape->getChildren().end(), + [](const ShapePtr& pShape) { return pShape->getSubType() != XML_conn; }); + } + + const double fSpaceWidth = 0.1; + const double fSpaceHeight = 0.3; + + if (mnType == XML_hierRoot && nCount == 3) + { + // Order assistant nodes above employee nodes. + std::vector& rChildren = rShape->getChildren(); + if (!containsDataNodeType(rChildren[1], XML_asst) + && containsDataNodeType(rChildren[2], XML_asst)) + std::swap(rChildren[1], rChildren[2]); + } + + sal_Int32 nHorizontalShapesCount = 1; + if (nSecDir == XML_fromT) + nHorizontalShapesCount = 2; + else if (nDir == XML_fromL || nDir == XML_fromR) + nHorizontalShapesCount = nCount; + + awt::Size aChildSize = rShape->getSize(); + aChildSize.Height /= (rShape->getVerticalShapesCount() + (rShape->getVerticalShapesCount() - 1) * fSpaceHeight); + aChildSize.Width /= (nHorizontalShapesCount + (nHorizontalShapesCount - 1) * fSpaceWidth); + + awt::Size aConnectorSize = aChildSize; + aConnectorSize.Width = 1; + + awt::Point aChildPos(0, 0); + + // indent children to show they are descendants, not siblings + if (mnType == XML_hierChild && nHorizontalShapesCount == 1) + { + const double fChildIndent = 0.1; + aChildPos.X = aChildSize.Width * fChildIndent; + aChildSize.Width *= (1 - 2 * fChildIndent); + } + + sal_Int32 nIdx = 0; + sal_Int32 nRowHeight = 0; + for (auto& pChild : rShape->getChildren()) + { + pChild->setPosition(aChildPos); + + if (mnType == XML_hierChild && pChild->getSubType() == XML_conn) + { + // Connectors should not influence the position of + // non-connect shapes. + pChild->setSize(aConnectorSize); + pChild->setChildSize(aConnectorSize); + continue; + } + + awt::Size aCurrSize = aChildSize; + aCurrSize.Height *= pChild->getVerticalShapesCount() + (pChild->getVerticalShapesCount() - 1) * fSpaceHeight; + + pChild->setSize(aCurrSize); + pChild->setChildSize(aCurrSize); + + if (nDir == XML_fromT || nDir == XML_fromB) + aChildPos.Y += aCurrSize.Height + aChildSize.Height * fSpaceHeight; + else + aChildPos.X += aCurrSize.Width + aCurrSize.Width * fSpaceWidth; + + nRowHeight = std::max(nRowHeight, aCurrSize.Height); + + if (nSecDir == XML_fromT && nIdx % 2 == 1) + { + aChildPos.X = 0; + aChildPos.Y += nRowHeight + aChildSize.Height * fSpaceHeight; + nRowHeight = 0; + } + + nIdx++; + } + + break; + } + + case XML_lin: + { + // spread children evenly across one axis, stretch across second + + if (rShape->getChildren().empty() || rShape->getSize().Width == 0 || rShape->getSize().Height == 0) + break; + + const sal_Int32 nDir = maMap.count(XML_linDir) ? maMap.find(XML_linDir)->second : XML_fromL; + const sal_Int32 nIncX = nDir==XML_fromL ? 1 : (nDir==XML_fromR ? -1 : 0); + const sal_Int32 nIncY = nDir==XML_fromT ? 1 : (nDir==XML_fromB ? -1 : 0); + + double fCount = rShape->getChildren().size(); + sal_Int32 nConnectorAngle = 0; + switch (nDir) + { + case XML_fromL: nConnectorAngle = 0; break; + case XML_fromR: nConnectorAngle = 180; break; + case XML_fromT: nConnectorAngle = 270; break; + case XML_fromB: nConnectorAngle = 90; break; + } + + awt::Size aSpaceSize; + + // Find out which constraint is relevant for which (internal) name. + LayoutPropertyMap aProperties; + for (const auto& rConstraint : rConstraints) + { + if (rConstraint.msForName.isEmpty()) + continue; + + LayoutProperty& rProperty = aProperties[rConstraint.msForName]; + if (rConstraint.mnType == XML_w) + { + rProperty[XML_w] = rShape->getSize().Width * rConstraint.mfFactor; + if (rProperty[XML_w] > rShape->getSize().Width) + { + rProperty[XML_w] = rShape->getSize().Width; + } + } + if (rConstraint.mnType == XML_h) + { + rProperty[XML_h] = rShape->getSize().Height * rConstraint.mfFactor; + if (rProperty[XML_h] > rShape->getSize().Height) + { + rProperty[XML_h] = rShape->getSize().Height; + } + } + + if (rConstraint.mnType == XML_primFontSz && rConstraint.mnFor == XML_des + && rConstraint.mnOperator == XML_equ) + { + NamedShapePairs& rDiagramFontHeights + = getLayoutNode().getDiagram().getDiagramFontHeights(); + auto it = rDiagramFontHeights.find(rConstraint.msForName); + if (it == rDiagramFontHeights.end()) + { + // Start tracking all shapes with this internal name: they'll have the same + // font height. + rDiagramFontHeights[rConstraint.msForName] = {}; + } + } + + // TODO: get values from differently named constraints as well + if (rConstraint.msForName == "sp" || rConstraint.msForName == "space" || rConstraint.msForName == "sibTrans") + { + if (rConstraint.mnType == XML_w) + aSpaceSize.Width = rShape->getSize().Width * rConstraint.mfFactor; + if (rConstraint.mnType == XML_h) + aSpaceSize.Height = rShape->getSize().Height * rConstraint.mfFactor; + } + } + + // first approximation of children size + std::set aChildrenToShrink; + for (const auto& rRule : rRules) + { + // Consider rules: when scaling down, only change children where the rule allows + // doing so. + aChildrenToShrink.insert(rRule.msForName); + } + + if (nDir == XML_fromT || nDir == XML_fromB) + { + // TODO consider rules for vertical linear layout as well. + aChildrenToShrink.clear(); + } + + if (!aChildrenToShrink.empty()) + { + // Have scaling info from rules: then only count scaled children. + // Also count children which are a fraction of a scaled child. + std::set aChildrenToShrinkDeps; + for (auto& aCurrShape : rShape->getChildren()) + { + if (aChildrenToShrink.find(aCurrShape->getInternalName()) + == aChildrenToShrink.end()) + { + if (fCount > 1.0) + { + fCount -= 1.0; + + bool bIsDependency = false; + double fFactor = 0; + for (const auto& rConstraint : rConstraints) + { + if (rConstraint.msForName != aCurrShape->getInternalName()) + { + continue; + } + + if ((nDir == XML_fromL || nDir == XML_fromR) && rConstraint.mnType != XML_w) + { + continue; + } + if ((nDir == XML_fromL || nDir == XML_fromR) && rConstraint.mnType == XML_w) + { + fFactor = rConstraint.mfFactor; + } + + if ((nDir == XML_fromT || nDir == XML_fromB) && rConstraint.mnType != XML_h) + { + continue; + } + if ((nDir == XML_fromT || nDir == XML_fromB) && rConstraint.mnType == XML_h) + { + fFactor = rConstraint.mfFactor; + } + + if (aChildrenToShrink.find(rConstraint.msRefForName) == aChildrenToShrink.end()) + { + continue; + } + + // At this point we have a child with a size which is a factor of an + // other child which will be scaled. + fCount += rConstraint.mfFactor; + aChildrenToShrinkDeps.insert(aCurrShape->getInternalName()); + bIsDependency = true; + break; + } + + if (!bIsDependency && aCurrShape->getServiceName() == "com.sun.star.drawing.GroupShape") + { + bool bScaleDownEmptySpacing = false; + if (nDir == XML_fromL || nDir == XML_fromR) + { + oox::OptValue oWidth = findProperty(aProperties, aCurrShape->getInternalName(), XML_w); + bScaleDownEmptySpacing = oWidth.has() && oWidth.get() > 0; + } + if (!bScaleDownEmptySpacing && (nDir == XML_fromT || nDir == XML_fromB)) + { + oox::OptValue oHeight = findProperty(aProperties, aCurrShape->getInternalName(), XML_h); + bScaleDownEmptySpacing = oHeight.has() && oHeight.get() > 0; + } + if (bScaleDownEmptySpacing && aCurrShape->getChildren().empty()) + { + fCount += fFactor; + aChildrenToShrinkDeps.insert(aCurrShape->getInternalName()); + } + } + } + } + } + + aChildrenToShrink.insert(aChildrenToShrinkDeps.begin(), aChildrenToShrinkDeps.end()); + + // No manual spacing: spacings are children as well. + aSpaceSize = awt::Size(); + } + else + { + // TODO Handle spacing from constraints without rules as well. + rShape->getChildren().erase( + std::remove_if(rShape->getChildren().begin(), rShape->getChildren().end(), + [](const ShapePtr& aChild) { + return aChild->getServiceName() + == "com.sun.star.drawing.GroupShape" + && aChild->getChildren().empty(); + }), + rShape->getChildren().end()); + fCount = rShape->getChildren().size(); + } + awt::Size aChildSize = rShape->getSize(); + if (nDir == XML_fromL || nDir == XML_fromR) + aChildSize.Width /= fCount; + else if (nDir == XML_fromT || nDir == XML_fromB) + aChildSize.Height /= fCount; + + awt::Point aCurrPos(0, 0); + if (nIncX == -1) + aCurrPos.X = rShape->getSize().Width - aChildSize.Width; + if (nIncY == -1) + aCurrPos.Y = rShape->getSize().Height - aChildSize.Height; + + // See if children requested more than 100% space in total: scale + // down in that case. + awt::Size aTotalSize; + for (const auto & aCurrShape : rShape->getChildren()) + { + oox::OptValue oWidth = findProperty(aProperties, aCurrShape->getInternalName(), XML_w); + oox::OptValue oHeight = findProperty(aProperties, aCurrShape->getInternalName(), XML_h); + awt::Size aSize = aChildSize; + if (oWidth.has()) + aSize.Width = oWidth.get(); + if (oHeight.has()) + aSize.Height = oHeight.get(); + aTotalSize.Width += aSize.Width; + aTotalSize.Height += aSize.Height; + } + + aTotalSize.Width += (fCount-1) * aSpaceSize.Width; + aTotalSize.Height += (fCount-1) * aSpaceSize.Height; + + double fWidthScale = 1.0; + double fHeightScale = 1.0; + if (nIncX && aTotalSize.Width > rShape->getSize().Width) + fWidthScale = static_cast(rShape->getSize().Width) / aTotalSize.Width; + if (nIncY && aTotalSize.Height > rShape->getSize().Height) + fHeightScale = static_cast(rShape->getSize().Height) / aTotalSize.Height; + aSpaceSize.Width *= fWidthScale; + aSpaceSize.Height *= fHeightScale; + + for (auto& aCurrShape : rShape->getChildren()) + { + // Extract properties relevant for this shape from constraints. + oox::OptValue oWidth = findProperty(aProperties, aCurrShape->getInternalName(), XML_w); + oox::OptValue oHeight = findProperty(aProperties, aCurrShape->getInternalName(), XML_h); + + awt::Size aSize = aChildSize; + if (oWidth.has()) + aSize.Width = oWidth.get(); + if (oHeight.has()) + aSize.Height = oHeight.get(); + if (aChildrenToShrink.empty() + || aChildrenToShrink.find(aCurrShape->getInternalName()) + != aChildrenToShrink.end()) + { + aSize.Width *= fWidthScale; + } + if (aChildrenToShrink.empty() + || aChildrenToShrink.find(aCurrShape->getInternalName()) + != aChildrenToShrink.end()) + { + aSize.Height *= fHeightScale; + } + aCurrShape->setSize(aSize); + aCurrShape->setChildSize(aSize); + + // center in the other axis - probably some parameter controls it + if (nIncX) + aCurrPos.Y = (rShape->getSize().Height - aSize.Height) / 2; + if (nIncY) + aCurrPos.X = (rShape->getSize().Width - aSize.Width) / 2; + if (aCurrPos.X < 0) + { + aCurrPos.X = 0; + } + if (aCurrPos.Y < 0) + { + aCurrPos.Y = 0; + } + + aCurrShape->setPosition(aCurrPos); + + aCurrPos.X += nIncX * (aSize.Width + aSpaceSize.Width); + aCurrPos.Y += nIncY * (aSize.Height + aSpaceSize.Height); + + // connectors should be handled in conn, but we don't have + // reference to previous and next child, so it's easier here + if (aCurrShape->getSubType() == XML_conn) + aCurrShape->setRotation(nConnectorAngle * PER_DEGREE); + } + + // Newer shapes are behind older ones by default. Reverse this if requested. + sal_Int32 nChildOrder = XML_b; + const LayoutNode* pParentLayoutNode = nullptr; + for (LayoutAtomPtr pAtom = getParent(); pAtom; pAtom = pAtom->getParent()) + { + auto pLayoutNode = dynamic_cast(pAtom.get()); + if (pLayoutNode) + { + pParentLayoutNode = pLayoutNode; + break; + } + } + if (pParentLayoutNode) + { + nChildOrder = pParentLayoutNode->getChildOrder(); + } + if (nChildOrder == XML_t) + { + std::reverse(rShape->getChildren().begin(), rShape->getChildren().end()); + } + + break; + } + + case XML_pyra: + { + PyraAlg::layoutShapeChildren(rShape); + break; + } + + case XML_snake: + { + SnakeAlg::layoutShapeChildren(*this, rShape, rConstraints); + break; + } + + case XML_sp: + { + // HACK: Handled one level higher. Or rather, planned to + // HACK: text should appear only in tx node; we're assigning it earlier, so let's remove it here + rShape->setTextBody(TextBodyPtr()); + break; + } + + case XML_tx: + { + // adjust text alignment + + // Parse constraints, only self margins as a start. + double fFontSize = 0; + for (const auto& rConstr : rConstraints) + { + if (rConstr.mnRefType == XML_w) + { + if (!rConstr.msForName.isEmpty()) + continue; + + sal_Int32 nProperty = getPropertyFromConstraint(rConstr.mnType); + if (!nProperty) + continue; + + // PowerPoint takes size as points, but gives margin as MMs. + double fFactor = convertPointToMms(rConstr.mfFactor); + + // DrawingML works in EMUs, UNO API works in MM100s. + sal_Int32 nValue = o3tl::convert(rShape->getSize().Width * fFactor, + o3tl::Length::emu, o3tl::Length::mm100); + + rShape->getShapeProperties().setProperty(nProperty, nValue); + } + if (rConstr.mnType == XML_primFontSz) + fFontSize = rConstr.mfValue; + } + + TextBodyPtr pTextBody = rShape->getTextBody(); + if (!pTextBody || pTextBody->isEmpty()) + break; + + // adjust text size to fit shape + if (fFontSize != 0) + { + for (auto& aParagraph : pTextBody->getParagraphs()) + for (auto& aRun : aParagraph->getRuns()) + if (!aRun->getTextCharacterProperties().moHeight.has()) + aRun->getTextCharacterProperties().moHeight = fFontSize * 100; + } + + if (!HasCustomText(rShape, getLayoutNode())) + { + // No customized text properties: enable autofit. + pTextBody->getTextProperties().maPropertyMap.setProperty( + PROP_TextFitToSize, drawing::TextFitToSizeType_AUTOFIT); + } + + // ECMA-376-1:2016 21.4.7.5 ST_AutoTextRotation (Auto Text Rotation) + const sal_Int32 nautoTxRot = maMap.count(XML_autoTxRot) ? maMap.find(XML_autoTxRot)->second : XML_upr; + sal_Int32 nShapeRot = rShape->getRotation(); + while (nShapeRot < 0) + nShapeRot += 360 * PER_DEGREE; + while (nShapeRot > 360 * PER_DEGREE) + nShapeRot -= 360 * PER_DEGREE; + + switch(nautoTxRot) + { + case XML_upr: + { + int n90x = 0; + if (nShapeRot >= 315 * PER_DEGREE) + /* keep 0 */; + else if (nShapeRot > 225 * PER_DEGREE) + n90x = -3; + else if (nShapeRot >= 135 * PER_DEGREE) + n90x = -2; + else if (nShapeRot > 45 * PER_DEGREE) + n90x = -1; + pTextBody->getTextProperties().moRotation = n90x * 90 * PER_DEGREE; + } + break; + case XML_grav: + { + if (nShapeRot > (90 * PER_DEGREE) && nShapeRot < (270 * PER_DEGREE)) + pTextBody->getTextProperties().moRotation = -180 * PER_DEGREE; + } + break; + case XML_none: + break; + } + + const sal_Int32 atxAnchorVert = maMap.count(XML_txAnchorVert) ? maMap.find(XML_txAnchorVert)->second : XML_mid; + + switch(atxAnchorVert) + { + case XML_t: + pTextBody->getTextProperties().meVA = css::drawing::TextVerticalAdjust_TOP; + break; + case XML_b: + pTextBody->getTextProperties().meVA = css::drawing::TextVerticalAdjust_BOTTOM; + break; + case XML_mid: + // text centered vertically by default + default: + pTextBody->getTextProperties().meVA = css::drawing::TextVerticalAdjust_CENTER; + break; + } + + pTextBody->getTextProperties().maPropertyMap.setProperty(PROP_TextVerticalAdjust, pTextBody->getTextProperties().meVA); + + // normalize list level + sal_Int32 nBaseLevel = pTextBody->getParagraphs().front()->getProperties().getLevel(); + for (auto & aParagraph : pTextBody->getParagraphs()) + { + if (aParagraph->getProperties().getLevel() < nBaseLevel) + nBaseLevel = aParagraph->getProperties().getLevel(); + } + + // Start bullets at: + // 1 - top level + // 2 - with children (default) + int nStartBulletsAtLevel = 2; + ParamMap::const_iterator aBulletLvl = maMap.find(XML_stBulletLvl); + if (aBulletLvl != maMap.end()) + nStartBulletsAtLevel = aBulletLvl->second; + nStartBulletsAtLevel--; + + bool isBulletList = false; + for (auto & aParagraph : pTextBody->getParagraphs()) + { + sal_Int32 nLevel = aParagraph->getProperties().getLevel() - nBaseLevel; + aParagraph->getProperties().setLevel(nLevel); + if (nLevel >= nStartBulletsAtLevel) + { + if (!aParagraph->getProperties().getParaLeftMargin().has_value()) + { + sal_Int32 nLeftMargin + = o3tl::convert(285750 * (nLevel - nStartBulletsAtLevel + 1), + o3tl::Length::emu, o3tl::Length::mm100); + aParagraph->getProperties().getParaLeftMargin() = nLeftMargin; + } + + if (!aParagraph->getProperties().getFirstLineIndentation().has_value()) + aParagraph->getProperties().getFirstLineIndentation() + = o3tl::convert(-285750, o3tl::Length::emu, o3tl::Length::mm100); + + // It is not possible to change the bullet style for text. + aParagraph->getProperties().getBulletList().setBulletChar(u"•"); + aParagraph->getProperties().getBulletList().setSuffixNone(); + isBulletList = true; + } + } + + // explicit alignment + ParamMap::const_iterator aDir = maMap.find(XML_parTxLTRAlign); + // TODO: XML_parTxRTLAlign + if (aDir != maMap.end()) + { + css::style::ParagraphAdjust aAlignment = GetParaAdjust(aDir->second); + for (auto & aParagraph : pTextBody->getParagraphs()) + aParagraph->getProperties().setParaAdjust(aAlignment); + } + else if (!isBulletList) + { + // if not list use default alignment - centered + for (auto & aParagraph : pTextBody->getParagraphs()) + aParagraph->getProperties().setParaAdjust(css::style::ParagraphAdjust::ParagraphAdjust_CENTER); + } + break; + } + + default: + break; + } + + SAL_INFO( + "oox.drawingml", + "Layouting shape " << rShape->getInternalName() << ", alg type: " << mnType << ", (" + << rShape->getPosition().X << "," << rShape->getPosition().Y << "," + << rShape->getSize().Width << "," << rShape->getSize().Height << ")"); +} + +void LayoutNode::accept( LayoutAtomVisitor& rVisitor ) +{ + rVisitor.visit(*this); +} + +bool LayoutNode::setupShape( const ShapePtr& rShape, const svx::diagram::Point* pPresNode, sal_Int32 nCurrIdx ) const +{ + SAL_INFO( + "oox.drawingml", + "Filling content from layout node named \"" << msName + << "\", modelId \"" << pPresNode->msModelId << "\""); + + // have the presentation node - now, need the actual data node: + const DiagramData::StringMap::const_iterator aNodeName = mrDgm.getData()->getPresOfNameMap().find( + pPresNode->msModelId); + if( aNodeName != mrDgm.getData()->getPresOfNameMap().end() ) + { + // Calculate the depth of what is effectively the topmost element. + sal_Int32 nMinDepth = std::numeric_limits::max(); + for (const auto& rPair : aNodeName->second) + { + if (rPair.second.mnDepth < nMinDepth) + nMinDepth = rPair.second.mnDepth; + } + + for (const auto& rPair : aNodeName->second) + { + const DiagramData::SourceIdAndDepth& rItem = rPair.second; + DiagramData::PointNameMap& rMap = mrDgm.getData()->getPointNameMap(); + // pPresNode is the presentation node of the aDataNode2 data node. + DiagramData::PointNameMap::const_iterator aDataNode2 = rMap.find(rItem.msSourceId); + if (aDataNode2 == rMap.end()) + { + //busted, skip it + continue; + } + + Shape* pDataNode2Shape(mrDgm.getData()->getOrCreateAssociatedShape(*aDataNode2->second)); + if (nullptr == pDataNode2Shape) + { + //busted, skip it + continue; + } + + rShape->setDataNodeType(aDataNode2->second->mnXMLType); + + if (rItem.mnDepth == 0) + { + // grab shape attr from topmost element(s) + rShape->getShapeProperties() = pDataNode2Shape->getShapeProperties(); + rShape->getLineProperties() = pDataNode2Shape->getLineProperties(); + rShape->getFillProperties() = pDataNode2Shape->getFillProperties(); + rShape->getCustomShapeProperties() = pDataNode2Shape->getCustomShapeProperties(); + rShape->setMasterTextListStyle( pDataNode2Shape->getMasterTextListStyle() ); + + SAL_INFO( + "oox.drawingml", + "Custom shape with preset type " + << (rShape->getCustomShapeProperties() + ->getShapePresetType()) + << " added for layout node named \"" << msName + << "\""); + } + else if (rItem.mnDepth == nMinDepth) + { + // If no real topmost element, then take properties from the one that's the closest + // to topmost. + rShape->getLineProperties() = pDataNode2Shape->getLineProperties(); + rShape->getFillProperties() = pDataNode2Shape->getFillProperties(); + } + + // append text with right outline level + if( pDataNode2Shape->getTextBody() && + !pDataNode2Shape->getTextBody()->getParagraphs().empty() && + !pDataNode2Shape->getTextBody()->getParagraphs().front()->getRuns().empty() ) + { + TextBodyPtr pTextBody=rShape->getTextBody(); + if( !pTextBody ) + { + pTextBody = std::make_shared(); + + // also copy text attrs + pTextBody->getTextListStyle() = + pDataNode2Shape->getTextBody()->getTextListStyle(); + pTextBody->getTextProperties() = + pDataNode2Shape->getTextBody()->getTextProperties(); + + rShape->setTextBody(pTextBody); + } + + const TextParagraphVector& rSourceParagraphs + = pDataNode2Shape->getTextBody()->getParagraphs(); + for (const auto& pSourceParagraph : rSourceParagraphs) + { + TextParagraph& rPara = pTextBody->addParagraph(); + if (rItem.mnDepth != -1) + rPara.getProperties().setLevel(rItem.mnDepth); + + for (const auto& pRun : pSourceParagraph->getRuns()) + rPara.addRun(pRun); + const TextBodyPtr& rBody = pDataNode2Shape->getTextBody(); + rPara.getProperties().apply(rBody->getParagraphs().front()->getProperties()); + } + } + } + } + else + { + SAL_INFO( + "oox.drawingml", + "ShapeCreationVisitor::visit: no data node name found while" + " processing shape type " + << rShape->getCustomShapeProperties()->getShapePresetType() + << " for layout node named \"" << msName << "\""); + Shape* pPresNodeShape(mrDgm.getData()->getOrCreateAssociatedShape(*pPresNode)); + if (nullptr != pPresNodeShape) + rShape->getFillProperties().assignUsed(pPresNodeShape->getFillProperties()); + } + + // TODO(Q1): apply styling & coloring - take presentation + // point's presStyleLbl for both style & color + // if not found use layout node's styleLbl + // however, docs are a bit unclear on this + OUString aStyleLabel = pPresNode->msPresentationLayoutStyleLabel; + if (aStyleLabel.isEmpty()) + aStyleLabel = msStyleLabel; + if( !aStyleLabel.isEmpty() ) + { + const DiagramQStyleMap::const_iterator aStyle = mrDgm.getStyles().find(aStyleLabel); + if( aStyle != mrDgm.getStyles().end() ) + { + const DiagramStyle& rStyle = aStyle->second; + rShape->getShapeStyleRefs()[XML_fillRef] = rStyle.maFillStyle; + rShape->getShapeStyleRefs()[XML_lnRef] = rStyle.maLineStyle; + rShape->getShapeStyleRefs()[XML_effectRef] = rStyle.maEffectStyle; + rShape->getShapeStyleRefs()[XML_fontRef] = rStyle.maTextStyle; + } + else + { + SAL_WARN("oox.drawingml", "Style " << aStyleLabel << " not found"); + } + + const DiagramColorMap::const_iterator aColor = mrDgm.getColors().find(aStyleLabel); + if( aColor != mrDgm.getColors().end() ) + { + // Take the nth color from the color list in case we are the nth shape in a + // loop. + const DiagramColor& rColor=aColor->second; + if( !rColor.maFillColors.empty() ) + rShape->getShapeStyleRefs()[XML_fillRef].maPhClr = DiagramColor::getColorByIndex(rColor.maFillColors, nCurrIdx); + if( !rColor.maLineColors.empty() ) + rShape->getShapeStyleRefs()[XML_lnRef].maPhClr = DiagramColor::getColorByIndex(rColor.maLineColors, nCurrIdx); + if( !rColor.maEffectColors.empty() ) + rShape->getShapeStyleRefs()[XML_effectRef].maPhClr = DiagramColor::getColorByIndex(rColor.maEffectColors, nCurrIdx); + if( !rColor.maTextFillColors.empty() ) + rShape->getShapeStyleRefs()[XML_fontRef].maPhClr = DiagramColor::getColorByIndex(rColor.maTextFillColors, nCurrIdx); + } + } + + // even if no data node found, successful anyway. it's + // contained at the layoutnode + return true; +} + +const LayoutNode* LayoutNode::getParentLayoutNode() const +{ + for (LayoutAtomPtr pAtom = getParent(); pAtom; pAtom = pAtom->getParent()) + { + auto pLayoutNode = dynamic_cast(pAtom.get()); + if (pLayoutNode) + return pLayoutNode; + } + + return nullptr; +} + +void ShapeAtom::accept( LayoutAtomVisitor& rVisitor ) +{ + rVisitor.visit(*this); +} + +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/drawingml/diagram/diagramlayoutatoms.hxx b/oox/source/drawingml/diagram/diagramlayoutatoms.hxx new file mode 100644 index 000000000..cf8078923 --- /dev/null +++ b/oox/source/drawingml/diagram/diagramlayoutatoms.hxx @@ -0,0 +1,372 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_OOX_SOURCE_DRAWINGML_DIAGRAM_DIAGRAMLAYOUTATOMS_HXX +#define INCLUDED_OOX_SOURCE_DRAWINGML_DIAGRAM_DIAGRAMLAYOUTATOMS_HXX + +#include +#include + +#include + +#include "diagram.hxx" + +namespace oox::drawingml { + +class DiagramLayout; +typedef std::shared_ptr< DiagramLayout > DiagramLayoutPtr; + +// AG_IteratorAttributes +struct IteratorAttr +{ + IteratorAttr(); + + // not sure this belong here, but wth + void loadFromXAttr( const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttributes ); + + std::vector maAxis; + sal_Int32 mnCnt; + bool mbHideLastTrans; + sal_Int32 mnPtType; + sal_Int32 mnSt; + sal_Int32 mnStep; +}; + +struct ConditionAttr +{ + ConditionAttr(); + + // not sure this belong here, but wth + void loadFromXAttr( const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttributes ); + + OUString msVal; + sal_Int32 mnFunc; + sal_Int32 mnArg; + sal_Int32 mnOp; + sal_Int32 mnVal; +}; + +/// Constraints allow you to specify an ideal (or starting point) size for each shape. +struct Constraint +{ + OUString msForName; + OUString msRefForName; + double mfFactor; + double mfValue; + sal_Int32 mnFor; + sal_Int32 mnPointType; + sal_Int32 mnType; + sal_Int32 mnRefFor; + sal_Int32 mnRefType; + sal_Int32 mnRefPointType; + sal_Int32 mnOperator; +}; + +/// Rules allow you to specify what to do when constraints can't be fully satisfied. +struct Rule +{ + OUString msForName; +}; + +typedef std::map LayoutProperty; +typedef std::map LayoutPropertyMap; + +struct LayoutAtomVisitor; +class LayoutAtom; +class LayoutNode; + +typedef std::shared_ptr< LayoutAtom > LayoutAtomPtr; + +/** abstract Atom for the layout */ +class LayoutAtom +{ +public: + LayoutAtom(LayoutNode& rLayoutNode) : mrLayoutNode(rLayoutNode) {} + virtual ~LayoutAtom() { } + + LayoutNode& getLayoutNode() + { return mrLayoutNode; } + + /** visitor acceptance + */ + virtual void accept( LayoutAtomVisitor& ) = 0; + + void setName( const OUString& sName ) + { msName = sName; } + const OUString& getName() const + { return msName; } + +private: + void addChild( const LayoutAtomPtr & pNode ) + { mpChildNodes.push_back( pNode ); } + void setParent(const LayoutAtomPtr& pParent) { mpParent = pParent; } + +public: + const std::vector& getChildren() const + { return mpChildNodes; } + + LayoutAtomPtr getParent() const { return mpParent.lock(); } + + static void connect(const LayoutAtomPtr& pParent, const LayoutAtomPtr& pChild) + { + pParent->addChild(pChild); + pChild->setParent(pParent); + } + + // dump for debug + void dump(int level = 0); + +protected: + LayoutNode& mrLayoutNode; + std::vector< LayoutAtomPtr > mpChildNodes; + std::weak_ptr mpParent; + OUString msName; +}; + +class ConstraintAtom + : public LayoutAtom +{ +public: + ConstraintAtom(LayoutNode& rLayoutNode) : LayoutAtom(rLayoutNode) {} + virtual void accept( LayoutAtomVisitor& ) override; + Constraint& getConstraint() + { return maConstraint; } + void parseConstraint(std::vector& rConstraints, bool bRequireForName) const; +private: + Constraint maConstraint; +}; + +/// Represents one element. +class RuleAtom + : public LayoutAtom +{ +public: + RuleAtom(LayoutNode& rLayoutNode) : LayoutAtom(rLayoutNode) {} + virtual void accept( LayoutAtomVisitor& ) override; + Rule& getRule() + { return maRule; } + void parseRule(std::vector& rRules) const; +private: + Rule maRule; +}; + +class AlgAtom + : public LayoutAtom +{ +public: + AlgAtom(LayoutNode& rLayoutNode) : LayoutAtom(rLayoutNode), mnType(0), maMap() {} + + typedef std::map ParamMap; + + virtual void accept( LayoutAtomVisitor& ) override; + + void setType( sal_Int32 nToken ) + { mnType = nToken; } + const ParamMap& getMap() const { return maMap; } + void addParam( sal_Int32 nType, sal_Int32 nVal ) + { maMap[nType]=nVal; } + sal_Int32 getVerticalShapesCount(const ShapePtr& rShape); + void layoutShape( const ShapePtr& rShape, + const std::vector& rConstraints, + const std::vector& rRules ); + + void setAspectRatio(double fAspectRatio) { mfAspectRatio = fAspectRatio; } + + double getAspectRatio() const { return mfAspectRatio; } + +private: + sal_Int32 mnType; + ParamMap maMap; + /// Aspect ratio is not integer, so not part of maMap. + double mfAspectRatio = 0; + + /// Determines the connector shape type for conn algorithm + sal_Int32 getConnectorType(); +}; + +typedef std::shared_ptr< AlgAtom > AlgAtomPtr; + +/// Finds optimal grid to layout children that have fixed aspect ratio. +class SnakeAlg +{ +public: + static void layoutShapeChildren(const AlgAtom& rAlg, const ShapePtr& rShape, + const std::vector& rConstraints); +}; + +/** + * Lays out child layout nodes along a vertical path and works with the trapezoid shape to create a + * pyramid. + */ +class PyraAlg +{ +public: + static void layoutShapeChildren(const ShapePtr& rShape); +}; + +/** + * Specifies the size and position for all child layout nodes. + */ +class CompositeAlg +{ +public: + static void layoutShapeChildren(AlgAtom& rAlg, const ShapePtr& rShape, + const std::vector& rConstraints); + +private: + /** + * Apply rConstraint to the rProperties shared layout state. + * + * Note that the order in which constraints are applied matters, given that constraints can refer to + * each other, and in case A depends on B and A is applied before B, the effect of A won't be + * updated when B is applied. + */ + static void applyConstraintToLayout(const Constraint& rConstraint, + LayoutPropertyMap& rProperties); + + /** + * Decides if a certain reference type (e.g. "right") can be inferred from the available properties + * in rMap (e.g. left and width). Returns true if rValue is written to. + */ + static bool inferFromLayoutProperty(const LayoutProperty& rMap, sal_Int32 nRefType, + sal_Int32& rValue); +}; + +class ForEachAtom + : public LayoutAtom +{ +public: + explicit ForEachAtom(LayoutNode& rLayoutNode, const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttributes); + + IteratorAttr & iterator() + { return maIter; } + void setRef(const OUString& rsRef) + { msRef = rsRef; } + const OUString& getRef() const + { return msRef; } + virtual void accept( LayoutAtomVisitor& ) override; + LayoutAtomPtr getRefAtom(); + +private: + IteratorAttr maIter; + OUString msRef; +}; + +typedef std::shared_ptr< ForEachAtom > ForEachAtomPtr; + +class ConditionAtom + : public LayoutAtom +{ +public: + explicit ConditionAtom(LayoutNode& rLayoutNode, bool isElse, const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttributes); + virtual void accept( LayoutAtomVisitor& ) override; + bool getDecision(const svx::diagram::Point* pPresPoint) const; + +private: + static bool compareResult(sal_Int32 nOperator, sal_Int32 nFirst, sal_Int32 nSecond); + sal_Int32 getNodeCount(const svx::diagram::Point* pPresPoint) const; + + bool mIsElse; + IteratorAttr maIter; + ConditionAttr maCond; +}; + +typedef std::shared_ptr< ConditionAtom > ConditionAtomPtr; + +/** "choose" statements. Atoms will be tested in order. */ +class ChooseAtom + : public LayoutAtom +{ +public: + ChooseAtom(LayoutNode& rLayoutNode) + : LayoutAtom(rLayoutNode) + {} + virtual void accept( LayoutAtomVisitor& ) override; +}; + +class LayoutNode + : public LayoutAtom +{ +public: + typedef std::map VarMap; + + LayoutNode(Diagram& rDgm) + : LayoutAtom(*this) + , mrDgm(rDgm) + , mnChildOrder(0) + { + } + Diagram& getDiagram() { return mrDgm; } + virtual void accept( LayoutAtomVisitor& ) override; + VarMap & variables() + { return mVariables; } + void setMoveWith( const OUString & sName ) + { msMoveWith = sName; } + void setStyleLabel( const OUString & sLabel ) + { msStyleLabel = sLabel; } + void setChildOrder( sal_Int32 nOrder ) + { mnChildOrder = nOrder; } + sal_Int32 getChildOrder() const { return mnChildOrder; } + void setExistingShape( const ShapePtr& pShape ) + { mpExistingShape = pShape; } + const ShapePtr& getExistingShape() const + { return mpExistingShape; } + const std::vector & getNodeShapes() const + { return mpNodeShapes; } + void addNodeShape(const ShapePtr& pShape) + { mpNodeShapes.push_back(pShape); } + + bool setupShape( const ShapePtr& rShape, + const svx::diagram::Point* pPresNode, + sal_Int32 nCurrIdx ) const; + + const LayoutNode* getParentLayoutNode() const; + +private: + Diagram& mrDgm; + VarMap mVariables; + OUString msMoveWith; + OUString msStyleLabel; + ShapePtr mpExistingShape; + std::vector mpNodeShapes; + sal_Int32 mnChildOrder; +}; + +typedef std::shared_ptr< LayoutNode > LayoutNodePtr; + +class ShapeAtom + : public LayoutAtom +{ +public: + ShapeAtom(LayoutNode& rLayoutNode, const ShapePtr& pShape) : LayoutAtom(rLayoutNode), mpShapeTemplate(pShape) {} + virtual void accept( LayoutAtomVisitor& ) override; + const ShapePtr& getShapeTemplate() const + { return mpShapeTemplate; } + +private: + ShapePtr mpShapeTemplate; +}; + +typedef std::shared_ptr< ShapeAtom > ShapeAtomPtr; + +} + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/drawingml/diagram/layoutatomvisitorbase.cxx b/oox/source/drawingml/diagram/layoutatomvisitorbase.cxx new file mode 100644 index 000000000..b7f5a5963 --- /dev/null +++ b/oox/source/drawingml/diagram/layoutatomvisitorbase.cxx @@ -0,0 +1,176 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include "layoutatomvisitorbase.hxx" + +#include + +using namespace ::com::sun::star; +using namespace ::com::sun::star::uno; + +namespace oox::drawingml { + +void LayoutAtomVisitorBase::defaultVisit(LayoutAtom const& rAtom) +{ + for (const auto& pAtom : rAtom.getChildren()) + pAtom->accept(*this); +} + +void LayoutAtomVisitorBase::visit(ChooseAtom& rAtom) +{ + for (const auto& pChild : rAtom.getChildren()) + { + const ConditionAtomPtr pCond = std::dynamic_pointer_cast(pChild); + if (pCond && pCond->getDecision(mpCurrentNode)) + { + SAL_INFO("oox.drawingml", "Entering if node: " << pCond->getName()); + pCond->accept(*this); + break; + } + } +} + +void LayoutAtomVisitorBase::visit(ConditionAtom& rAtom) +{ + defaultVisit(rAtom); +} + +void LayoutAtomVisitorBase::visit(ForEachAtom& rAtom) +{ + if (!rAtom.getRef().isEmpty()) + { + if (LayoutAtomPtr pRefAtom = rAtom.getRefAtom()) + pRefAtom->accept(*this); + return; + } + + if (rAtom.iterator().mbHideLastTrans && !rAtom.iterator().maAxis.empty() && rAtom.iterator().maAxis[0] == XML_followSib) + { + // If last transition is hidden and the axis is the follow sibling, + // then the last atom should not be visited. + if (mnCurrIdx + mnCurrStep >= mnCurrCnt) + return; + } + + sal_Int32 nChildren = 1; + // Approximate the non-assistant type with the node type. + if (rAtom.iterator().mnPtType == XML_node || rAtom.iterator().mnPtType == XML_nonAsst) + { + // count child data nodes - check all child Atoms for "name" + // attribute that is contained in diagram's + // getPointsPresNameMap() + ShallowPresNameVisitor aVisitor(mrDgm, mpCurrentNode); + for (const auto& pAtom : rAtom.getChildren()) + pAtom->accept(aVisitor); + nChildren = aVisitor.getCount(); + } + + const sal_Int32 nCnt = std::min( + nChildren, + rAtom.iterator().mnCnt==-1 ? nChildren : rAtom.iterator().mnCnt); + + const sal_Int32 nOldIdx = mnCurrIdx; + const sal_Int32 nOldStep = mnCurrStep; + const sal_Int32 nOldCnt = mnCurrCnt; + const sal_Int32 nStep = rAtom.iterator().mnStep; + mnCurrStep = nStep; + mnCurrCnt = nCnt; + for( mnCurrIdx=0; mnCurrIdx0; mnCurrIdx+=nStep ) + { + // TODO there is likely some conditions + for (const auto& pAtom : rAtom.getChildren()) + pAtom->accept(*this); + } + + // and restore idx + mnCurrIdx = nOldIdx; + mnCurrStep = nOldStep; + mnCurrCnt = nOldCnt; +} + +void LayoutAtomVisitorBase::visit(LayoutNode& rAtom) +{ + // TODO: deduplicate code in descendants + + // stop processing if it's not a child of previous LayoutNode + + const DiagramData::PointsNameMap::const_iterator aDataNode + = mrDgm.getData()->getPointsPresNameMap().find(rAtom.getName()); + if (aDataNode == mrDgm.getData()->getPointsPresNameMap().end() + || mnCurrIdx >= static_cast(aDataNode->second.size())) + return; + + const svx::diagram::Point* pNewNode = aDataNode->second.at(mnCurrIdx); + if (!mpCurrentNode || !pNewNode) + return; + + bool bIsChild = false; + for (const auto& aConnection : mrDgm.getData()->getConnections()) + if (aConnection.msSourceId == mpCurrentNode->msModelId + && aConnection.msDestId == pNewNode->msModelId) + bIsChild = true; + + if (!bIsChild) + return; + + const svx::diagram::Point* pPreviousNode = mpCurrentNode; + mpCurrentNode = pNewNode; + + defaultVisit(rAtom); + + mpCurrentNode = pPreviousNode; +} + +void ShallowPresNameVisitor::visit(ConstraintAtom& /*rAtom*/) +{ + // stop processing +} + +void ShallowPresNameVisitor::visit(RuleAtom& /*rAtom*/) +{ + // stop processing +} + +void ShallowPresNameVisitor::visit(AlgAtom& /*rAtom*/) +{ + // stop processing +} + +void ShallowPresNameVisitor::visit(ForEachAtom& rAtom) +{ + defaultVisit(rAtom); +} + +void ShallowPresNameVisitor::visit(LayoutNode& rAtom) +{ + DiagramData::PointsNameMap::const_iterator aDataNode = + mrDgm.getData()->getPointsPresNameMap().find(rAtom.getName()); + if( aDataNode != mrDgm.getData()->getPointsPresNameMap().end() ) + mnCnt = std::max(mnCnt, + aDataNode->second.size()); +} + +void ShallowPresNameVisitor::visit(ShapeAtom& /*rAtom*/) +{ + // stop processing +} + +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/drawingml/diagram/layoutatomvisitorbase.hxx b/oox/source/drawingml/diagram/layoutatomvisitorbase.hxx new file mode 100644 index 000000000..49c83f674 --- /dev/null +++ b/oox/source/drawingml/diagram/layoutatomvisitorbase.hxx @@ -0,0 +1,98 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_OOX_SOURCE_DRAWINGML_DIAGRAM_LAYOUTATOMVISITORBASE_HXX +#define INCLUDED_OOX_SOURCE_DRAWINGML_DIAGRAM_LAYOUTATOMVISITORBASE_HXX + +#include "diagram.hxx" +#include "diagramlayoutatoms.hxx" + +namespace oox::drawingml { + +struct LayoutAtomVisitor +{ + virtual ~LayoutAtomVisitor() {} + virtual void visit(ConstraintAtom& rAtom) = 0; + virtual void visit(RuleAtom& rAtom) = 0; + virtual void visit(AlgAtom& rAtom) = 0; + virtual void visit(ForEachAtom& rAtom) = 0; + virtual void visit(ConditionAtom& rAtom) = 0; + virtual void visit(ChooseAtom& rAtom) = 0; + virtual void visit(LayoutNode& rAtom) = 0; + virtual void visit(ShapeAtom& rAtom) = 0; +}; + +// basic visitor implementation that follows if/else and for-each nodes +// and keeps track of current position in data tree +class LayoutAtomVisitorBase : public LayoutAtomVisitor +{ +public: + LayoutAtomVisitorBase(const Diagram& rDgm, const svx::diagram::Point* pRootPoint) : + mrDgm(rDgm), + mpCurrentNode(pRootPoint), + mnCurrIdx(0), + mnCurrStep(0), + mnCurrCnt(0), + meLookFor(LAYOUT_NODE) + {} + + void defaultVisit(LayoutAtom const& rAtom); + + using LayoutAtomVisitor::visit; + virtual void visit(ForEachAtom& rAtom) override; + virtual void visit(ConditionAtom& rAtom) override; + virtual void visit(ChooseAtom& rAtom) override; + virtual void visit(LayoutNode& rAtom) override; + +protected: + const Diagram& mrDgm; + const svx::diagram::Point* mpCurrentNode; + sal_Int32 mnCurrIdx; + sal_Int32 mnCurrStep; + sal_Int32 mnCurrCnt; + enum {LAYOUT_NODE, CONSTRAINT, ALGORITHM, RULE} meLookFor; +}; + +class ShallowPresNameVisitor : public LayoutAtomVisitorBase +{ +public: + explicit ShallowPresNameVisitor(const Diagram& rDgm, const svx::diagram::Point* pRootPoint) : + LayoutAtomVisitorBase(rDgm, pRootPoint), + mnCnt(0) + {} + + using LayoutAtomVisitorBase::visit; + virtual void visit(ConstraintAtom& rAtom) override; + virtual void visit(RuleAtom& rAtom) override; + virtual void visit(AlgAtom& rAtom) override; + virtual void visit(ForEachAtom& rAtom) override; + virtual void visit(LayoutNode& rAtom) override; + virtual void visit(ShapeAtom& rAtom) override; + + size_t getCount() const { return mnCnt; } + +private: + size_t mnCnt; +}; + +} + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/drawingml/diagram/layoutatomvisitors.cxx b/oox/source/drawingml/diagram/layoutatomvisitors.cxx new file mode 100644 index 000000000..f34d93d98 --- /dev/null +++ b/oox/source/drawingml/diagram/layoutatomvisitors.cxx @@ -0,0 +1,269 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include "layoutatomvisitors.hxx" + +#include + +#include + +using namespace ::com::sun::star; +using namespace ::com::sun::star::uno; +using namespace ::com::sun::star::xml::sax; +using namespace ::oox::core; + +namespace oox::drawingml +{ +void ShapeCreationVisitor::visit(ConstraintAtom& /*rAtom*/) +{ + // stop processing +} + +void ShapeCreationVisitor::visit(RuleAtom& /*rAtom*/) +{ + // stop processing +} + +void ShapeCreationVisitor::visit(AlgAtom& rAtom) +{ + if (meLookFor == ALGORITHM) + { + mpParentShape->setAspectRatio(rAtom.getAspectRatio()); + mpParentShape->setVerticalShapesCount(rAtom.getVerticalShapesCount(mpParentShape)); + } +} + +void ShapeCreationVisitor::visit(LayoutNode& rAtom) +{ + if (meLookFor != LAYOUT_NODE) + return; + + // stop processing if it's not a child of previous LayoutNode + + const DiagramData::PointsNameMap::const_iterator aDataNode + = mrDgm.getData()->getPointsPresNameMap().find(rAtom.getName()); + if (aDataNode == mrDgm.getData()->getPointsPresNameMap().end() + || mnCurrIdx >= static_cast(aDataNode->second.size())) + return; + + const svx::diagram::Point* pNewNode = aDataNode->second.at(mnCurrIdx); + if (!mpCurrentNode || !pNewNode) + return; + + bool bIsChild = false; + for (const auto& aConnection : mrDgm.getData()->getConnections()) + if (aConnection.msSourceId == mpCurrentNode->msModelId + && aConnection.msDestId == pNewNode->msModelId) + bIsChild = true; + + if (!bIsChild) + return; + + ShapePtr pCurrParent(mpParentShape); + + if (rAtom.getExistingShape()) + { + // reuse existing shape + ShapePtr pShape = rAtom.getExistingShape(); + if (rAtom.setupShape(pShape, pNewNode, mnCurrIdx)) + { + pShape->setInternalName(rAtom.getName()); + rAtom.addNodeShape(pShape); + mrDgm.getLayout()->getPresPointShapeMap()[pNewNode] = pShape; + } + } + else + { + ShapeTemplateVisitor aTemplateVisitor(mrDgm, pNewNode); + aTemplateVisitor.defaultVisit(rAtom); + ShapePtr pShape = aTemplateVisitor.getShapeCopy(); + + if (pShape) + { + SAL_INFO("oox.drawingml", + "processing shape type " + << (pShape->getCustomShapeProperties()->getShapePresetType())); + + if (rAtom.setupShape(pShape, pNewNode, mnCurrIdx)) + { + pShape->setInternalName(rAtom.getName()); + pCurrParent->addChild(pShape); + pCurrParent = pShape; + rAtom.addNodeShape(pShape); + mrDgm.getLayout()->getPresPointShapeMap()[pNewNode] = pShape; + } + } + else + { + SAL_WARN("oox.drawingml", + "ShapeCreationVisitor::visit: no shape set while processing layoutnode named " + << rAtom.getName()); + } + } + + const svx::diagram::Point* pPreviousNode = mpCurrentNode; + mpCurrentNode = pNewNode; + + // set new parent for children + ShapePtr pPreviousParent(mpParentShape); + mpParentShape = pCurrParent; + + // process children + meLookFor = LAYOUT_NODE; + defaultVisit(rAtom); + + meLookFor = ALGORITHM; + defaultVisit(rAtom); + meLookFor = LAYOUT_NODE; + + // restore parent + mpParentShape = pPreviousParent; + mpCurrentNode = pPreviousNode; +} + +void ShapeCreationVisitor::visit(ShapeAtom& /*rAtom*/) +{ + // stop processing +} + +void ShapeTemplateVisitor::visit(ConstraintAtom& /*rAtom*/) +{ + // stop processing +} + +void ShapeTemplateVisitor::visit(RuleAtom& /*rAtom*/) +{ + // stop processing +} + +void ShapeTemplateVisitor::visit(AlgAtom& /*rAtom*/) +{ + // stop processing +} + +void ShapeTemplateVisitor::visit(ForEachAtom& /*rAtom*/) +{ + // stop processing +} + +void ShapeTemplateVisitor::visit(LayoutNode& /*rAtom*/) +{ + // stop processing - only traverse Condition/Choose atoms +} + +void ShapeTemplateVisitor::visit(ShapeAtom& rAtom) +{ + if (mpShape) + { + SAL_WARN("oox.drawingml", "multiple shapes encountered inside LayoutNode"); + return; + } + + const ShapePtr& pCurrShape(rAtom.getShapeTemplate()); + + // TODO(F3): cloned shape shares all properties by reference, + // don't change them! + mpShape = std::make_shared(pCurrShape); + // Fill properties have to be changed as sometimes only the presentation node contains the blip + // fill, unshare those. + mpShape->cloneFillProperties(); + + // add/set ModelID from current node to allow later association + if (mpCurrentNode) + mpShape->setDiagramDataModelID(mpCurrentNode->msModelId); +} + +void ShapeLayoutingVisitor::visit(ConstraintAtom& rAtom) +{ + if (meLookFor == CONSTRAINT) + rAtom.parseConstraint(maConstraints, /*bRequireForName=*/true); +} + +void ShapeLayoutingVisitor::visit(RuleAtom& rAtom) +{ + if (meLookFor == RULE) + rAtom.parseRule(maRules); +} + +void ShapeLayoutingVisitor::visit(AlgAtom& rAtom) +{ + if (meLookFor == ALGORITHM) + { + const PresPointShapeMap aMap + = rAtom.getLayoutNode().getDiagram().getLayout()->getPresPointShapeMap(); + auto pShape = aMap.find(mpCurrentNode); + if (pShape != aMap.end()) + rAtom.layoutShape(pShape->second, maConstraints, maRules); + } +} + +void ShapeLayoutingVisitor::visit(LayoutNode& rAtom) +{ + if (meLookFor != LAYOUT_NODE) + return; + + // stop processing if it's not a child of previous LayoutNode + + const DiagramData::PointsNameMap::const_iterator aDataNode + = mrDgm.getData()->getPointsPresNameMap().find(rAtom.getName()); + if (aDataNode == mrDgm.getData()->getPointsPresNameMap().end() + || mnCurrIdx >= static_cast(aDataNode->second.size())) + return; + + const svx::diagram::Point* pNewNode = aDataNode->second.at(mnCurrIdx); + if (!mpCurrentNode || !pNewNode) + return; + + bool bIsChild = false; + for (const auto& aConnection : mrDgm.getData()->getConnections()) + if (aConnection.msSourceId == mpCurrentNode->msModelId + && aConnection.msDestId == pNewNode->msModelId) + bIsChild = true; + + if (!bIsChild) + return; + + size_t nParentConstraintsNumber = maConstraints.size(); + + const svx::diagram::Point* pPreviousNode = mpCurrentNode; + mpCurrentNode = pNewNode; + + // process alg atoms first, nested layout nodes afterwards + meLookFor = CONSTRAINT; + defaultVisit(rAtom); + meLookFor = RULE; + defaultVisit(rAtom); + meLookFor = ALGORITHM; + defaultVisit(rAtom); + meLookFor = LAYOUT_NODE; + defaultVisit(rAtom); + + mpCurrentNode = pPreviousNode; + + // delete added constraints, keep parent constraints + maConstraints.erase(maConstraints.begin() + nParentConstraintsNumber, maConstraints.end()); +} + +void ShapeLayoutingVisitor::visit(ShapeAtom& /*rAtom*/) +{ + // stop processing +} +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/drawingml/diagram/layoutatomvisitors.hxx b/oox/source/drawingml/diagram/layoutatomvisitors.hxx new file mode 100644 index 000000000..c04fb1d97 --- /dev/null +++ b/oox/source/drawingml/diagram/layoutatomvisitors.hxx @@ -0,0 +1,96 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_OOX_SOURCE_DRAWINGML_DIAGRAM_LAYOUTATOMVISITORS_HXX +#define INCLUDED_OOX_SOURCE_DRAWINGML_DIAGRAM_LAYOUTATOMVISITORS_HXX + +#include +#include "diagram.hxx" +#include "diagramlayoutatoms.hxx" +#include "layoutatomvisitorbase.hxx" + +namespace oox::drawingml { + +class ShapeCreationVisitor : public LayoutAtomVisitorBase +{ +public: + ShapeCreationVisitor(const Diagram& rDgm, + const svx::diagram::Point* pRootPoint, + const ShapePtr& rParentShape) : + LayoutAtomVisitorBase(rDgm, pRootPoint), + mpParentShape(rParentShape) + {} + + using LayoutAtomVisitorBase::visit; + virtual void visit(ConstraintAtom& rAtom) override; + virtual void visit(RuleAtom& rAtom) override; + virtual void visit(AlgAtom& rAtom) override; + virtual void visit(LayoutNode& rAtom) override; + virtual void visit(ShapeAtom& rAtom) override; + +private: + ShapePtr mpParentShape; +}; + +class ShapeTemplateVisitor : public LayoutAtomVisitorBase +{ +public: + ShapeTemplateVisitor(const Diagram& rDgm, const svx::diagram::Point* pRootPoint) + : LayoutAtomVisitorBase(rDgm, pRootPoint) + {} + + using LayoutAtomVisitorBase::visit; + virtual void visit(ConstraintAtom& rAtom) override; + virtual void visit(RuleAtom& rAtom) override; + virtual void visit(AlgAtom& rAtom) override; + virtual void visit(ForEachAtom& rAtom) override; + virtual void visit(LayoutNode& rAtom) override; + virtual void visit(ShapeAtom& rAtom) override; + + ShapePtr const & getShapeCopy() const + { return mpShape; } + +private: + ShapePtr mpShape; +}; + +class ShapeLayoutingVisitor : public LayoutAtomVisitorBase +{ +public: + ShapeLayoutingVisitor(const Diagram& rDgm, const svx::diagram::Point* pRootPoint) : + LayoutAtomVisitorBase(rDgm, pRootPoint) + {} + + using LayoutAtomVisitorBase::visit; + virtual void visit(ConstraintAtom& rAtom) override; + virtual void visit(RuleAtom& rAtom) override; + virtual void visit(AlgAtom& rAtom) override; + virtual void visit(LayoutNode& rAtom) override; + virtual void visit(ShapeAtom& rAtom) override; + +private: + std::vector maConstraints; + std::vector maRules; +}; + +} + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/drawingml/diagram/layoutnodecontext.cxx b/oox/source/drawingml/diagram/layoutnodecontext.cxx new file mode 100644 index 000000000..93f927531 --- /dev/null +++ b/oox/source/drawingml/diagram/layoutnodecontext.cxx @@ -0,0 +1,309 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include "layoutnodecontext.hxx" + +#include +#include +#include +#include "constraintlistcontext.hxx" +#include "rulelistcontext.hxx" +#include +#include +#include + +using namespace ::oox::core; +using namespace ::com::sun::star::uno; +using namespace ::com::sun::star::xml::sax; + +namespace oox::drawingml { + +namespace { + +class IfContext + : public LayoutNodeContext +{ +public: + IfContext( ContextHandler2Helper const & rParent, + const AttributeList& rAttribs, + const ConditionAtomPtr& pAtom ) + : LayoutNodeContext( rParent, rAttribs, pAtom ) + {} +}; + +class AlgorithmContext + : public ContextHandler2 +{ +public: + AlgorithmContext( ContextHandler2Helper const & rParent, const AttributeList& rAttribs, const AlgAtomPtr & pNode ) + : ContextHandler2( rParent ) + , mnRevision( 0 ) + , mpNode( pNode ) + { + mnRevision = rAttribs.getInteger( XML_rev, 0 ); + pNode->setType(rAttribs.getToken(XML_type, 0)); + } + + virtual ContextHandlerRef + onCreateContext( ::sal_Int32 aElement, + const AttributeList& rAttribs ) override + { + switch( aElement ) + { + case DGM_TOKEN( param ): + { + sal_Int32 nType = rAttribs.getToken(XML_type, 0); + switch (nType) + { + case XML_ar: + mpNode->setAspectRatio(rAttribs.getDouble(XML_val, 0)); + break; + default: + const sal_Int32 nValTok = rAttribs.getToken(XML_val, 0); + mpNode->addParam(nType, nValTok > 0 ? nValTok + : rAttribs.getInteger(XML_val, 0)); + break; + } + break; + } + default: + break; + } + + return this; + } + +private: + sal_Int32 mnRevision; + AlgAtomPtr mpNode; +}; + +class ChooseContext + : public ContextHandler2 +{ +public: + ChooseContext( ContextHandler2Helper const & rParent, const AttributeList& rAttribs, const LayoutAtomPtr & pNode ) + : ContextHandler2( rParent ) + , mpNode( pNode ) + { + msName = rAttribs.getString( XML_name ).get(); + } + + virtual ContextHandlerRef + onCreateContext( ::sal_Int32 aElement, + const AttributeList& rAttribs ) override + { + switch( aElement ) + { + case DGM_TOKEN( if ): + { + // CT_When + ConditionAtomPtr pNode = std::make_shared(mpNode->getLayoutNode(), false, rAttribs.getFastAttributeList()); + LayoutAtom::connect(mpNode, pNode); + return new IfContext( *this, rAttribs, pNode ); + } + case DGM_TOKEN( else ): + { + // CT_Otherwise + ConditionAtomPtr pNode = std::make_shared(mpNode->getLayoutNode(), true, rAttribs.getFastAttributeList()); + LayoutAtom::connect(mpNode, pNode); + return new IfContext( *this, rAttribs, pNode ); + } + default: + break; + } + + return this; + } +private: + OUString msName; + LayoutAtomPtr mpNode; +}; + +class ForEachContext + : public LayoutNodeContext +{ +public: + ForEachContext( ContextHandler2Helper const & rParent, const AttributeList& rAttribs, const ForEachAtomPtr& pAtom ) + : LayoutNodeContext( rParent, rAttribs, pAtom ) + { + pAtom->setRef(rAttribs.getString(XML_ref).get()); + pAtom->iterator().loadFromXAttr( rAttribs.getFastAttributeList() ); + + LayoutAtomMap& rLayoutAtomMap = pAtom->getLayoutNode().getDiagram().getLayout()->getLayoutAtomMap(); + rLayoutAtomMap[pAtom->getName()] = pAtom; + } +}; + +// CT_LayoutVariablePropertySet +class LayoutVariablePropertySetContext + : public ContextHandler2 +{ +public: + LayoutVariablePropertySetContext( ContextHandler2Helper const & rParent, LayoutNode::VarMap & aVar ) + : ContextHandler2( rParent ) + , mVariables( aVar ) + { + } + + virtual ContextHandlerRef onCreateContext( ::sal_Int32 aElement, const AttributeList& rAttribs ) override + { + mVariables[ getBaseToken(aElement) ] = rAttribs.getString( XML_val ).get(); + return this; + } +private: + LayoutNode::VarMap & mVariables; +}; + +} + +// CT_LayoutNode +LayoutNodeContext::LayoutNodeContext( ContextHandler2Helper const & rParent, + const AttributeList& rAttribs, + const LayoutAtomPtr& pAtom ) + : ContextHandler2( rParent ) + , mpNode( pAtom ) +{ + assert( pAtom && "Node must NOT be NULL" ); + mpNode->setName( rAttribs.getString( XML_name ).get() ); +} + +LayoutNodeContext::~LayoutNodeContext() +{ +} + +ContextHandlerRef +LayoutNodeContext::onCreateContext( ::sal_Int32 aElement, + const AttributeList& rAttribs ) +{ + switch( aElement ) + { + case DGM_TOKEN( layoutNode ): + { + LayoutNodePtr pNode = std::make_shared(mpNode->getLayoutNode().getDiagram()); + LayoutAtom::connect(mpNode, pNode); + + if (rAttribs.hasAttribute(XML_chOrder)) + { + pNode->setChildOrder(rAttribs.getToken(XML_chOrder, XML_b)); + } + else + { + for (LayoutAtomPtr pAtom = mpNode; pAtom; pAtom = pAtom->getParent()) + { + auto pLayoutNode = dynamic_cast(pAtom.get()); + if (pLayoutNode) + { + pNode->setChildOrder(pLayoutNode->getChildOrder()); + break; + } + } + } + + pNode->setMoveWith( rAttribs.getString( XML_moveWith ).get() ); + pNode->setStyleLabel( rAttribs.getString( XML_styleLbl ).get() ); + return new LayoutNodeContext( *this, rAttribs, pNode ); + } + case DGM_TOKEN( shape ): + { + ShapePtr pShape; + + if( rAttribs.hasAttribute( XML_type ) ) + { + pShape = std::make_shared("com.sun.star.drawing.CustomShape"); + if (!rAttribs.getBool(XML_hideGeom, false)) + { + const sal_Int32 nType(rAttribs.getToken( XML_type, XML_obj )); + pShape->setSubType( nType ); + pShape->getCustomShapeProperties()->setShapePresetType( nType ); + } + } + else + { + pShape = std::make_shared("com.sun.star.drawing.GroupShape"); + } + + pShape->setDiagramRotation(rAttribs.getInteger(XML_rot, 0) * PER_DEGREE); + + pShape->setZOrderOff(rAttribs.getInteger(XML_zOrderOff, 0)); + + ShapeAtomPtr pAtom = std::make_shared(mpNode->getLayoutNode(), pShape); + LayoutAtom::connect(mpNode, pAtom); + return new ShapeContext( *this, ShapePtr(), pShape ); + } + case DGM_TOKEN( extLst ): + return nullptr; + case DGM_TOKEN( alg ): + { + // CT_Algorithm + AlgAtomPtr pAtom = std::make_shared(mpNode->getLayoutNode()); + LayoutAtom::connect(mpNode, pAtom); + return new AlgorithmContext( *this, rAttribs, pAtom ); + } + case DGM_TOKEN( choose ): + { + // CT_Choose + LayoutAtomPtr pAtom = std::make_shared(mpNode->getLayoutNode()); + LayoutAtom::connect(mpNode, pAtom); + return new ChooseContext( *this, rAttribs, pAtom ); + } + case DGM_TOKEN( forEach ): + { + // CT_ForEach + ForEachAtomPtr pAtom = std::make_shared(mpNode->getLayoutNode(), rAttribs.getFastAttributeList()); + LayoutAtom::connect(mpNode, pAtom); + return new ForEachContext( *this, rAttribs, pAtom ); + } + case DGM_TOKEN( constrLst ): + // CT_Constraints + return new ConstraintListContext( *this, mpNode ); + case DGM_TOKEN( presOf ): + { + // CT_PresentationOf + // TODO + IteratorAttr aIterator; + aIterator.loadFromXAttr(rAttribs.getFastAttributeList()); + break; + } + case DGM_TOKEN( ruleLst ): + // CT_Rules + return new RuleListContext( *this, mpNode ); + case DGM_TOKEN( varLst ): + { + LayoutNodePtr pNode(std::dynamic_pointer_cast(mpNode)); + if( pNode ) + { + return new LayoutVariablePropertySetContext( *this, pNode->variables() ); + } + else + { + SAL_WARN("oox", "OOX: encountered a varLst in a non layoutNode context" ); + } + break; + } + default: + break; + } + + return this; +} + +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/drawingml/diagram/layoutnodecontext.hxx b/oox/source/drawingml/diagram/layoutnodecontext.hxx new file mode 100644 index 000000000..3499f5704 --- /dev/null +++ b/oox/source/drawingml/diagram/layoutnodecontext.hxx @@ -0,0 +1,43 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_OOX_SOURCE_DRAWINGML_DIAGRAM_LAYOUTNODECONTEXT_HXX +#define INCLUDED_OOX_SOURCE_DRAWINGML_DIAGRAM_LAYOUTNODECONTEXT_HXX + +#include +#include "diagramlayoutatoms.hxx" + +namespace oox::drawingml { + +class LayoutNodeContext : public ::oox::core::ContextHandler2 +{ +public: + LayoutNodeContext( ::oox::core::ContextHandler2Helper const & rParent, const ::oox::AttributeList& rAttributes, const LayoutAtomPtr &pNode ); + virtual ~LayoutNodeContext() override; + + virtual ::oox::core::ContextHandlerRef onCreateContext( ::sal_Int32 Element, const ::oox::AttributeList& rAttribs ) override; +private: + LayoutAtomPtr mpNode; +}; + +} + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/drawingml/diagram/rulelistcontext.cxx b/oox/source/drawingml/diagram/rulelistcontext.cxx new file mode 100644 index 000000000..76518ca9e --- /dev/null +++ b/oox/source/drawingml/diagram/rulelistcontext.cxx @@ -0,0 +1,58 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include "rulelistcontext.hxx" +#include +#include +#include + +namespace oox::drawingml +{ +RuleListContext::RuleListContext(ContextHandler2Helper const& rParent, const LayoutAtomPtr& pNode) + : ContextHandler2(rParent) + , mpNode(pNode) +{ + assert(pNode); +} + +RuleListContext::~RuleListContext() = default; + +core::ContextHandlerRef RuleListContext::onCreateContext(sal_Int32 nElement, + const AttributeList& rAttribs) +{ + switch (nElement) + { + case DGM_TOKEN(rule): + { + auto pNode = std::make_shared(mpNode->getLayoutNode()); + LayoutAtom::connect(mpNode, pNode); + + Rule& rRule = pNode->getRule(); + rRule.msForName = rAttribs.getString(XML_forName, ""); + break; + } + default: + break; + } + + return this; +} +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/drawingml/diagram/rulelistcontext.hxx b/oox/source/drawingml/diagram/rulelistcontext.hxx new file mode 100644 index 000000000..83a86c49e --- /dev/null +++ b/oox/source/drawingml/diagram/rulelistcontext.hxx @@ -0,0 +1,42 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#pragma once + +#include +#include "diagramlayoutatoms.hxx" + +namespace oox::drawingml +{ +/// Handles one element. +class RuleListContext : public oox::core::ContextHandler2 +{ +public: + RuleListContext(ContextHandler2Helper const& rParent, const LayoutAtomPtr& pNode); + ~RuleListContext() override; + + oox::core::ContextHandlerRef onCreateContext(sal_Int32 nElement, + const AttributeList& rAttribs) override; + +private: + LayoutAtomPtr mpNode; +}; +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/drawingml/drawingmltypes.cxx b/oox/source/drawingml/drawingmltypes.cxx new file mode 100644 index 000000000..fc2f28d90 --- /dev/null +++ b/oox/source/drawingml/drawingmltypes.cxx @@ -0,0 +1,419 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +using ::com::sun::star::uno::Reference; +using ::com::sun::star::xml::sax::XFastAttributeList; +using namespace ::com::sun::star; +using namespace ::com::sun::star::drawing; +using namespace ::com::sun::star::geometry; +using namespace ::com::sun::star::style; + +namespace oox::drawingml { + +/** converts EMUs into 1/100th mmm */ +sal_Int32 GetCoordinate( sal_Int32 nValue ) +{ + return o3tl::convert(nValue, o3tl::Length::emu, o3tl::Length::mm100); +} + +/** converts an emu string into 1/100th mmm */ +sal_Int32 GetCoordinate( std::u16string_view sValue ) +{ + sal_Int32 nRet = 0; + if( !::sax::Converter::convertNumber( nRet, sValue ) ) + nRet = 0; + return GetCoordinate( nRet ); +} + +/** converts 1/100mm to EMU */ +sal_Int32 GetPointFromCoordinate( sal_Int32 nValue ) +{ + return o3tl::convert(nValue, o3tl::Length::mm100, o3tl::Length::emu); +} + +/** converts a ST_Percentage % string into 1/1000th of % */ +sal_Int32 GetPercent( std::u16string_view sValue ) +{ + sal_Int32 nRet = 0; + if( !::sax::Converter::convertNumber( nRet, sValue ) ) + nRet = 0; + + return nRet; +} + +double GetPositiveFixedPercentage( const OUString& sValue ) +{ + double fPercent = sValue.toFloat() / 100000.; + return fPercent; +} + +/** converts the attributes from a CT_TLPoint into an awt Point with 1/1000% */ +awt::Point GetPointPercent( const Reference< XFastAttributeList >& xAttribs ) +{ + return awt::Point(GetPercent(xAttribs->getOptionalValue(XML_x)), GetPercent(xAttribs->getOptionalValue(XML_y))); +} + +/** converts the ST_TextFontSize to point */ +float GetTextSize( std::u16string_view sValue ) +{ + float fRet = 0; + sal_Int32 nRet; + if( ::sax::Converter::convertNumber( nRet, sValue ) ) + fRet = static_cast< float >( static_cast< double >( nRet ) / 100.0 ); + return fRet; +} + +/** converts the ST_TextSpacingPoint to 1/100mm */ +sal_Int32 GetTextSpacingPoint( std::u16string_view sValue ) +{ + sal_Int32 nRet; + if( ::sax::Converter::convertNumber( nRet, sValue, (SAL_MIN_INT32 + 360) / 254, (SAL_MAX_INT32 - 360) / 254 ) ) + nRet = GetTextSpacingPoint( nRet ); + return nRet; +} + +sal_Int32 GetTextSpacingPoint(sal_Int32 nValue) +{ + if (nValue > 0) + nValue = (nValue * 254 + 360); + else if (nValue < 0) + nValue = (nValue * 254 - 360); + return nValue / 720; +} + +float GetFontHeight( sal_Int32 nHeight ) +{ + // convert 1/100 points to points + return static_cast< float >( nHeight / 100.0 ); +} + +sal_Int16 GetFontUnderline( sal_Int32 nToken ) +{ + OSL_ASSERT((nToken & sal_Int32(0xFFFF0000))==0); + switch( nToken ) + { + case XML_none: return awt::FontUnderline::NONE; + case XML_dash: return awt::FontUnderline::DASH; + case XML_dashHeavy: return awt::FontUnderline::BOLDDASH; + case XML_dashLong: return awt::FontUnderline::LONGDASH; + case XML_dashLongHeavy: return awt::FontUnderline::BOLDLONGDASH; + case XML_dbl: return awt::FontUnderline::DOUBLE; + case XML_dotDash: return awt::FontUnderline::DASHDOT; + case XML_dotDashHeavy: return awt::FontUnderline::BOLDDASHDOT; + case XML_dotDotDash: return awt::FontUnderline::DASHDOTDOT; + case XML_dotDotDashHeavy: return awt::FontUnderline::BOLDDASHDOTDOT; + case XML_dotted: return awt::FontUnderline::DOTTED; + case XML_dottedHeavy: return awt::FontUnderline::BOLDDOTTED; + case XML_heavy: return awt::FontUnderline::BOLD; + case XML_sng: return awt::FontUnderline::SINGLE; + case XML_wavy: return awt::FontUnderline::WAVE; + case XML_wavyDbl: return awt::FontUnderline::DOUBLEWAVE; + case XML_wavyHeavy: return awt::FontUnderline::BOLDWAVE; +// case XML_words: // TODO + } + return awt::FontUnderline::DONTKNOW; +} + +sal_Int16 GetFontStrikeout( sal_Int32 nToken ) +{ + OSL_ASSERT((nToken & sal_Int32(0xFFFF0000))==0); + switch( nToken ) + { + case XML_dblStrike: return awt::FontStrikeout::DOUBLE; + case XML_noStrike: return awt::FontStrikeout::NONE; + case XML_sngStrike: return awt::FontStrikeout::SINGLE; + } + return awt::FontStrikeout::DONTKNOW; +} + +sal_Int16 GetCaseMap( sal_Int32 nToken ) +{ + switch( nToken ) + { + case XML_all: return CaseMap::UPPERCASE; + case XML_small: return CaseMap::SMALLCAPS; + } + return CaseMap::NONE; +} + +/** converts a paragraph align to a ParaAdjust */ +ParagraphAdjust GetParaAdjust( sal_Int32 nAlign ) +{ + OSL_ASSERT((nAlign & sal_Int32(0xFFFF0000))==0); + ParagraphAdjust nEnum; + switch( nAlign ) + { + case XML_ctr: + nEnum = ParagraphAdjust_CENTER; + break; + case XML_just: + case XML_justLow: + nEnum = ParagraphAdjust_BLOCK; + break; + case XML_r: + nEnum = ParagraphAdjust_RIGHT; + break; + case XML_thaiDist: + case XML_dist: + nEnum = ParagraphAdjust_STRETCH; + break; + case XML_l: + default: + nEnum = ParagraphAdjust_LEFT; + break; + } + return nEnum; +} + +TextVerticalAdjust GetTextVerticalAdjust( sal_Int32 nToken ) +{ + TextVerticalAdjust aVertAdjust; + switch( nToken ) + { + case XML_b: + aVertAdjust = TextVerticalAdjust_BOTTOM; + break; + case XML_dist: + case XML_just: + case XML_ctr: + aVertAdjust = TextVerticalAdjust_CENTER; + break; + case XML_t: + default: + aVertAdjust = TextVerticalAdjust_TOP; + break; + } + return aVertAdjust; +} + +const char* GetTextVerticalAdjust( TextVerticalAdjust eAdjust ) +{ + const char* sVerticalAdjust = nullptr; + switch( eAdjust ) + { + case TextVerticalAdjust_BOTTOM: + sVerticalAdjust = "b"; + break; + case TextVerticalAdjust_CENTER: + sVerticalAdjust = "ctr"; + break; + case TextVerticalAdjust_TOP: + default: + sVerticalAdjust = "t"; + break; + } + return sVerticalAdjust; +} + +TabAlign GetTabAlign( sal_Int32 aToken ) +{ + OSL_ASSERT((aToken & sal_Int32(0xFFFF0000))==0); + TabAlign nEnum; + switch( aToken ) + { + case XML_ctr: + nEnum = TabAlign_CENTER; + break; + case XML_dec: + nEnum = TabAlign_DECIMAL; + break; + case XML_l: + nEnum = TabAlign_LEFT; + break; + case XML_r: + nEnum = TabAlign_RIGHT; + break; + default: + nEnum = TabAlign_DEFAULT; + break; + } + return nEnum; +} + +const char* GetHatchPattern( const drawing::Hatch& rHatch ) +{ + const char* sPattern = nullptr; + const sal_Int32 nAngle = rHatch.Angle > 1800 ? rHatch.Angle - 1800 : rHatch.Angle; + // Angle ~ 0° (horizontal) + if( (nAngle >= 0 && nAngle < 225) || nAngle >= 1575 ) + { + switch( rHatch.Style ) + { + case drawing::HatchStyle_SINGLE: + { + if( rHatch.Distance < 75 ) + sPattern = "ltHorz"; + else + sPattern = "horz"; + + break; + } + case drawing::HatchStyle_DOUBLE: + case drawing::HatchStyle_TRIPLE: + { + if( rHatch.Distance < 75 ) + sPattern = "smGrid"; + else + sPattern = "lgGrid"; + + break; + } + default: break; + } + } + // Angle ~ 45° (upward diagonal) + else if( nAngle < 675 ) + { + switch( rHatch.Style ) + { + case drawing::HatchStyle_SINGLE: + { + if( rHatch.Distance < 75 ) + sPattern = "ltUpDiag"; + else + sPattern = "wdUpDiag"; + + break; + } + case drawing::HatchStyle_DOUBLE: + case drawing::HatchStyle_TRIPLE: + { + if( rHatch.Distance < 75 ) + sPattern = "smCheck"; + else + sPattern = "openDmnd"; + + break; + } + default: break; + } + } + // Angle ~ 90° (vertical) + else if( nAngle < 1125 ) + { + switch( rHatch.Style ) + { + case drawing::HatchStyle_SINGLE: + { + // dkVert is imported as Distance = 25, ltVert as Distance = 50, export them accordingly. + if( rHatch.Distance < 50 ) + sPattern = "dkVert"; + else if( rHatch.Distance < 75 ) + sPattern = "ltVert"; + else + sPattern = "vert"; + + break; + } + case drawing::HatchStyle_DOUBLE: + case drawing::HatchStyle_TRIPLE: + { + if( rHatch.Distance < 75 ) + sPattern = "smGrid"; + else + sPattern = "lgGrid"; + + break; + } + default: break; + } + } + // Angle ~ 135° (downward diagonal) + else if( nAngle < 1575 ) + { + switch( rHatch.Style ) + { + case drawing::HatchStyle_SINGLE: + { + if( rHatch.Distance < 75 ) + sPattern = "ltDnDiag"; + else + sPattern = "wdDnDiag"; + + break; + } + case drawing::HatchStyle_DOUBLE: + case drawing::HatchStyle_TRIPLE: + { + if( rHatch.Distance < 75 ) + sPattern = "smCheck"; + else + sPattern = "openDmnd"; + + break; + } + default: break; + } + } + return sPattern; +} + +namespace +{ +// ISO/IEC-29500 Part 1 ST_Percentage, and [MS-OI29500] 2.1.1324 +sal_Int32 GetST_Percentage(std::u16string_view s) +{ + if (o3tl::ends_with(s, u"%")) + return std::round(o3tl::toDouble(s) * 1000); + return o3tl::toInt32(s); +} +} + +/** converts the attributes from a CT_RelativeRect to an IntegerRectangle2D */ +IntegerRectangle2D GetRelativeRect( const Reference< XFastAttributeList >& xAttribs ) +{ + IntegerRectangle2D r; + + r.X1 = GetST_Percentage(xAttribs->getOptionalValue( XML_l )); + r.Y1 = GetST_Percentage(xAttribs->getOptionalValue( XML_t )); + r.X2 = GetST_Percentage(xAttribs->getOptionalValue( XML_r )); + r.Y2 = GetST_Percentage(xAttribs->getOptionalValue( XML_b )); + + return r; +} + +/** converts the attributes from a CT_Size2D into an awt Size with 1/100thmm */ +awt::Size GetSize2D( const Reference< XFastAttributeList >& xAttribs ) +{ + return awt::Size( GetCoordinate( xAttribs->getOptionalValue( XML_cx ) ), GetCoordinate( xAttribs->getOptionalValue( XML_cy ) ) ); +} + +IndexRange GetIndexRange( const Reference< XFastAttributeList >& xAttributes ) +{ + IndexRange range; + range.start = xAttributes->getOptionalValue( XML_st ).toInt32(); + range.end = xAttributes->getOptionalValue( XML_end ).toInt32(); + return range; +} + +} // namespace oox::drawingml + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/drawingml/effectproperties.cxx b/oox/source/drawingml/effectproperties.cxx new file mode 100644 index 000000000..88d69a16d --- /dev/null +++ b/oox/source/drawingml/effectproperties.cxx @@ -0,0 +1,132 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#include "effectproperties.hxx" +#include +#include +#include + +#include +#include + +#include + +namespace oox::drawingml { + +void EffectGlowProperties ::assignUsed(const EffectGlowProperties& rSourceProps) +{ + moGlowRad.assignIfUsed( rSourceProps.moGlowRad ); + moGlowColor.assignIfUsed( rSourceProps.moGlowColor ); +} + +void EffectSoftEdgeProperties::assignUsed(const EffectSoftEdgeProperties& rSourceProps) +{ + moRad.assignIfUsed(rSourceProps.moRad); +} + +void EffectShadowProperties::assignUsed(const EffectShadowProperties& rSourceProps) +{ + moShadowDist.assignIfUsed( rSourceProps.moShadowDist ); + moShadowDir.assignIfUsed( rSourceProps.moShadowDir ); + moShadowSx.assignIfUsed( rSourceProps.moShadowSx ); + moShadowSy.assignIfUsed( rSourceProps.moShadowSy ); + moShadowColor.assignIfUsed( rSourceProps.moShadowColor ); + moShadowBlur.assignIfUsed( rSourceProps.moShadowBlur ); + +} + +void EffectProperties::assignUsed( const EffectProperties& rSourceProps ) +{ + maShadow.assignUsed(rSourceProps.maShadow); + maGlow.assignUsed(rSourceProps.maGlow); + maSoftEdge.assignUsed(rSourceProps.maSoftEdge); + if (!rSourceProps.m_Effects.empty()) + { + m_Effects.clear(); + m_Effects.reserve(rSourceProps.m_Effects.size()); + for (auto const& it : rSourceProps.m_Effects) + { + m_Effects.push_back(std::make_unique(*it)); + } + } +} + +void EffectProperties::pushToPropMap( PropertyMap& rPropMap, + const GraphicHelper& rGraphicHelper ) const +{ + for (auto const& it : m_Effects) + { + if( it->msName == "outerShdw" ) + { + sal_Int32 nAttrDir = 0, nAttrDist = 0; + sal_Int32 nAttrSizeX = 100000, nAttrSizeY = 100000; // If shadow size is %100=100000 (means equal to object's size), sx sy is not exists, + // Default values of sx, sy should be 100000 in this case. + sal_Int32 nAttrBlur = 0; + + std::map< OUString, css::uno::Any >::const_iterator attribIt = it->maAttribs.find( "dir" ); + if( attribIt != it->maAttribs.end() ) + attribIt->second >>= nAttrDir; + + attribIt = it->maAttribs.find( "dist" ); + if( attribIt != it->maAttribs.end() ) + attribIt->second >>= nAttrDist; + + attribIt = it->maAttribs.find( "sx" ); + if( attribIt != it->maAttribs.end() ) + attribIt->second >>= nAttrSizeX; + + attribIt = it->maAttribs.find( "sy" ); + if( attribIt != it->maAttribs.end() ) + attribIt->second >>= nAttrSizeY; + + attribIt = it->maAttribs.find( "blurRad" ); + if( attribIt != it->maAttribs.end() ) + attribIt->second >>= nAttrBlur; + + // Negative X or Y dist indicates left or up, respectively + // Negative X or Y dist indicates left or up, respectively + double nAngle = basegfx::deg2rad(static_cast(nAttrDir) / PER_DEGREE); + sal_Int32 nDist = convertEmuToHmm( nAttrDist ); + sal_Int32 nXDist = cos(nAngle) * nDist; + sal_Int32 nYDist = sin(nAngle) * nDist; + + + rPropMap.setProperty( PROP_Shadow, true ); + rPropMap.setProperty( PROP_ShadowXDistance, nXDist); + rPropMap.setProperty( PROP_ShadowYDistance, nYDist); + rPropMap.setProperty( PROP_ShadowSizeX, nAttrSizeX); + rPropMap.setProperty( PROP_ShadowSizeY, nAttrSizeY); + rPropMap.setProperty( PROP_ShadowColor, it->moColor.getColor(rGraphicHelper ) ); + rPropMap.setProperty( PROP_ShadowTransparence, it->moColor.getTransparency()); + rPropMap.setProperty( PROP_ShadowBlur, convertEmuToHmm(nAttrBlur)); + + } + } +} + +css::beans::PropertyValue Effect::getEffect() +{ + css::beans::PropertyValue aRet; + if( msName.isEmpty() ) + return aRet; + + css::uno::Sequence< css::beans::PropertyValue > aSeq( maAttribs.size() ); + std::transform(maAttribs.begin(), maAttribs.end(), aSeq.getArray(), + [](const auto& attrib) + { return comphelper::makePropertyValue(attrib.first, attrib.second); }); + + aRet.Name = msName; + aRet.Value <<= aSeq; + + return aRet; +} + +} // namespace oox::drawingml + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/drawingml/effectproperties.hxx b/oox/source/drawingml/effectproperties.hxx new file mode 100644 index 000000000..b588b9f7c --- /dev/null +++ b/oox/source/drawingml/effectproperties.hxx @@ -0,0 +1,88 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_OOX_DRAWINGML_EFFECTPROPERTIES_HXX +#define INCLUDED_OOX_DRAWINGML_EFFECTPROPERTIES_HXX + +#include +#include + +#include +#include +#include + +namespace oox::drawingml { + +struct EffectGlowProperties +{ + OptValue< sal_Int64 > moGlowRad; // size of glow effect + Color moGlowColor; + // TODO saturation and luminance missing + + void assignUsed( const EffectGlowProperties& rSourceProps ); +}; + +struct EffectSoftEdgeProperties +{ + OptValue moRad; // size of effect + + void assignUsed(const EffectSoftEdgeProperties& rSourceProps); +}; + +struct EffectShadowProperties +{ + OptValue< sal_Int64 > moShadowDist; + OptValue< sal_Int64 > moShadowDir; + OptValue< sal_Int64 > moShadowSx; + OptValue< sal_Int64 > moShadowSy; + Color moShadowColor; + OptValue< sal_Int64 > moShadowBlur; // size of blur effect + + /** Overwrites all members that are explicitly set in rSourceProps. */ + void assignUsed( const EffectShadowProperties& rSourceProps ); +}; + +struct Effect +{ + OUString msName; + std::map< OUString, css::uno::Any > maAttribs; + Color moColor; + + css::beans::PropertyValue getEffect(); +}; + +struct EffectProperties +{ + EffectShadowProperties maShadow; + EffectGlowProperties maGlow; + EffectSoftEdgeProperties maSoftEdge; + + /** Stores all effect properties, including those not supported by core yet */ + std::vector> m_Effects; + + EffectProperties() {} + EffectProperties(EffectProperties const& rOther) + { + assignUsed(rOther); + } + + /** Overwrites all members that are explicitly set in rSourceProps. */ + void assignUsed( const EffectProperties& rSourceProps ); + + /** Writes the properties to the passed property map. */ + void pushToPropMap( + PropertyMap& rPropMap, + const GraphicHelper& rGraphicHelper ) const; +}; + +} // namespace oox::drawingml + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/drawingml/effectpropertiescontext.cxx b/oox/source/drawingml/effectpropertiescontext.cxx new file mode 100644 index 000000000..ea972c742 --- /dev/null +++ b/oox/source/drawingml/effectpropertiescontext.cxx @@ -0,0 +1,133 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#include +#include "effectproperties.hxx" +#include +#include +#include +#include + +using namespace ::oox::core; +using namespace ::com::sun::star::uno; +using namespace ::com::sun::star::xml::sax; + +// CT_EffectProperties + +namespace oox::drawingml { + +EffectPropertiesContext::EffectPropertiesContext( ContextHandler2Helper const& rParent, + EffectProperties& rEffectProperties ) noexcept +: ContextHandler2( rParent ) +, mrEffectProperties( rEffectProperties ) +{ +} + +EffectPropertiesContext::~EffectPropertiesContext() +{ +} + +void EffectPropertiesContext::saveUnsupportedAttribs( Effect& rEffect, const AttributeList& rAttribs ) +{ + if( rAttribs.hasAttribute( XML_algn ) ) + rEffect.maAttribs["algn"] <<= rAttribs.getString( XML_algn, "" ); + if( rAttribs.hasAttribute( XML_blurRad ) ) + rEffect.maAttribs["blurRad"] <<= rAttribs.getInteger( XML_blurRad, 0 ); + if( rAttribs.hasAttribute( XML_dir ) ) + rEffect.maAttribs["dir"] <<= rAttribs.getInteger( XML_dir, 0 ); + if( rAttribs.hasAttribute( XML_dist ) ) + rEffect.maAttribs["dist"] <<= rAttribs.getInteger( XML_dist, 0 ); + if( rAttribs.hasAttribute( XML_kx ) ) + rEffect.maAttribs["kx"] <<= rAttribs.getInteger( XML_kx, 0 ); + if( rAttribs.hasAttribute( XML_ky ) ) + rEffect.maAttribs["ky"] <<= rAttribs.getInteger( XML_ky, 0 ); + if( rAttribs.hasAttribute( XML_rotWithShape ) ) + rEffect.maAttribs["rotWithShape"] <<= rAttribs.getInteger( XML_rotWithShape, 0 ); + if( rAttribs.hasAttribute( XML_sx ) ) + rEffect.maAttribs["sx"] <<= rAttribs.getInteger( XML_sx, 0 ); + if( rAttribs.hasAttribute( XML_sy ) ) + rEffect.maAttribs["sy"] <<= rAttribs.getInteger( XML_sy, 0 ); + if( rAttribs.hasAttribute( XML_rad ) ) + rEffect.maAttribs["rad"] <<= rAttribs.getInteger( XML_rad, 0 ); + if( rAttribs.hasAttribute( XML_endA ) ) + rEffect.maAttribs["endA"] <<= rAttribs.getInteger( XML_endA, 0 ); + if( rAttribs.hasAttribute( XML_endPos ) ) + rEffect.maAttribs["endPos"] <<= rAttribs.getInteger( XML_endPos, 0 ); + if( rAttribs.hasAttribute( XML_fadeDir ) ) + rEffect.maAttribs["fadeDir"] <<= rAttribs.getInteger( XML_fadeDir, 0 ); + if( rAttribs.hasAttribute( XML_stA ) ) + rEffect.maAttribs["stA"] <<= rAttribs.getInteger( XML_stA, 0 ); + if( rAttribs.hasAttribute( XML_stPos ) ) + rEffect.maAttribs["stPos"] <<= rAttribs.getInteger( XML_stPos, 0 ); + if( rAttribs.hasAttribute( XML_grow ) ) + rEffect.maAttribs["grow"] <<= rAttribs.getInteger( XML_grow, 0 ); +} + +ContextHandlerRef EffectPropertiesContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ) +{ + sal_Int32 nPos = mrEffectProperties.m_Effects.size(); + mrEffectProperties.m_Effects.push_back(std::make_unique()); + switch( nElement ) + { + case A_TOKEN( outerShdw ): + { + mrEffectProperties.m_Effects[nPos]->msName = "outerShdw"; + saveUnsupportedAttribs(*mrEffectProperties.m_Effects[nPos], rAttribs); + + mrEffectProperties.maShadow.moShadowDist = rAttribs.getInteger( XML_dist, 0 ); + mrEffectProperties.maShadow.moShadowDir = rAttribs.getInteger( XML_dir, 0 ); + mrEffectProperties.maShadow.moShadowSx = rAttribs.getInteger( XML_sx, 0 ); + mrEffectProperties.maShadow.moShadowSy = rAttribs.getInteger( XML_sy, 0 ); + mrEffectProperties.maShadow.moShadowBlur = rAttribs.getInteger( XML_blurRad, 0 ); + return new ColorContext(*this, mrEffectProperties.m_Effects[nPos]->moColor); + } + break; + case A_TOKEN( innerShdw ): + { + mrEffectProperties.m_Effects[nPos]->msName = "innerShdw"; + saveUnsupportedAttribs(*mrEffectProperties.m_Effects[nPos], rAttribs); + + mrEffectProperties.maShadow.moShadowDist = rAttribs.getInteger( XML_dist, 0 ); + mrEffectProperties.maShadow.moShadowDir = rAttribs.getInteger( XML_dir, 0 ); + return new ColorContext(*this, mrEffectProperties.m_Effects[nPos]->moColor); + } + break; + case A_TOKEN( glow ): + { + mrEffectProperties.maGlow.moGlowRad = rAttribs.getInteger( XML_rad, 0 ); + // undo push_back to effects + mrEffectProperties.m_Effects.pop_back(); + return new ColorContext(*this, mrEffectProperties.maGlow.moGlowColor); + + } + case A_TOKEN( softEdge ): + { + mrEffectProperties.maSoftEdge.moRad = rAttribs.getInteger(XML_rad, 0); + return this; // no inner elements + } + case A_TOKEN( reflection ): + case A_TOKEN( blur ): + { + if (nElement == A_TOKEN(reflection)) + mrEffectProperties.m_Effects[nPos]->msName = "reflection"; + else if( nElement == A_TOKEN( blur ) ) + mrEffectProperties.m_Effects[nPos]->msName = "blur"; + saveUnsupportedAttribs(*mrEffectProperties.m_Effects[nPos], rAttribs); + return new ColorContext(*this, mrEffectProperties.m_Effects[nPos]->moColor); + } + break; + } + + mrEffectProperties.m_Effects.pop_back(); + return nullptr; +} + +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/drawingml/embeddedwavaudiofile.cxx b/oox/source/drawingml/embeddedwavaudiofile.cxx new file mode 100644 index 000000000..613e34ccb --- /dev/null +++ b/oox/source/drawingml/embeddedwavaudiofile.cxx @@ -0,0 +1,37 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include +#include +#include +#include + +namespace oox::drawingml +{ +// CT_EmbeddedWAVAudioFile +OUString getEmbeddedWAVAudioFile(const core::Relations& rRelations, const AttributeList& rAttribs) +{ + if (rAttribs.getBool(XML_builtIn, false)) + return rAttribs.getString(XML_name).get(); + else + return rRelations.getFragmentPathFromRelId(rAttribs.getString(R_TOKEN(embed)).get()); +} +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/drawingml/fillproperties.cxx b/oox/source/drawingml/fillproperties.cxx new file mode 100644 index 000000000..9ae39b8cf --- /dev/null +++ b/oox/source/drawingml/fillproperties.cxx @@ -0,0 +1,1257 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include + +#include + +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +using namespace ::com::sun::star; +using namespace ::com::sun::star::drawing; +using namespace ::com::sun::star::graphic; + +using ::com::sun::star::uno::Reference; +using ::com::sun::star::uno::Exception; +using ::com::sun::star::uno::UNO_QUERY_THROW; +using ::com::sun::star::geometry::IntegerRectangle2D; + +namespace oox::drawingml { + +namespace { + +Reference< XGraphic > lclCheckAndApplyDuotoneTransform(const BlipFillProperties& aBlipProps, uno::Reference const & xGraphic, + const GraphicHelper& rGraphicHelper, const ::Color nPhClr) +{ + if (aBlipProps.maDuotoneColors[0].isUsed() && aBlipProps.maDuotoneColors[1].isUsed()) + { + ::Color nColor1 = aBlipProps.maDuotoneColors[0].getColor( rGraphicHelper, nPhClr ); + ::Color nColor2 = aBlipProps.maDuotoneColors[1].getColor( rGraphicHelper, nPhClr ); + + uno::Reference xTransformer(aBlipProps.mxFillGraphic, uno::UNO_QUERY); + if (xTransformer.is()) + return xTransformer->applyDuotone(xGraphic, sal_Int32(nColor1), sal_Int32(nColor2)); + } + return xGraphic; +} + +Reference< XGraphic > lclRotateGraphic(uno::Reference const & xGraphic, Degree10 nRotation) +{ + ::Graphic aGraphic(xGraphic); + ::Graphic aReturnGraphic; + + assert (aGraphic.GetType() == GraphicType::Bitmap); + + BitmapEx aBitmapEx(aGraphic.GetBitmapEx()); + const ::Color& aColor = ::Color(0x00); + aBitmapEx.Rotate(nRotation, aColor); + aReturnGraphic = ::Graphic(aBitmapEx); + aReturnGraphic.setOriginURL(aGraphic.getOriginURL()); + + return aReturnGraphic.GetXGraphic(); +} + +using Quotients = std::tuple; +Quotients getQuotients(geometry::IntegerRectangle2D aRelRect, double hDiv, double vDiv) +{ + return { aRelRect.X1 / hDiv, aRelRect.Y1 / vDiv, aRelRect.X2 / hDiv, aRelRect.Y2 / vDiv }; +} + +// ECMA-376 Part 1 20.1.8.55 srcRect (Source Rectangle) +std::optional CropQuotientsFromSrcRect(geometry::IntegerRectangle2D aSrcRect) +{ + aSrcRect.X1 = std::max(aSrcRect.X1, sal_Int32(0)); + aSrcRect.X2 = std::max(aSrcRect.X2, sal_Int32(0)); + aSrcRect.Y1 = std::max(aSrcRect.Y1, sal_Int32(0)); + aSrcRect.Y2 = std::max(aSrcRect.Y2, sal_Int32(0)); + if (aSrcRect.X1 + aSrcRect.X2 >= 100'000 || aSrcRect.Y1 + aSrcRect.Y2 >= 100'000) + return {}; // Cropped everything + return getQuotients(aSrcRect, 100'000.0, 100'000.0); +} + +// ECMA-376 Part 1 20.1.8.30 fillRect (Fill Rectangle) +std::optional CropQuotientsFromFillRect(geometry::IntegerRectangle2D aFillRect) +{ + aFillRect.X1 = std::min(aFillRect.X1, sal_Int32(0)); + aFillRect.X2 = std::min(aFillRect.X2, sal_Int32(0)); + aFillRect.Y1 = std::min(aFillRect.Y1, sal_Int32(0)); + aFillRect.Y2 = std::min(aFillRect.Y2, sal_Int32(0)); + // Negative divisor and negative relative offset give positive value wanted in lclCropGraphic + return getQuotients(aFillRect, -100'000.0 + aFillRect.X1 + aFillRect.X2, + -100'000.0 + aFillRect.Y1 + aFillRect.Y2); +} + +// Crops a piece of the bitmap. lclCropGraphic doesn't handle growing. +Reference lclCropGraphic(uno::Reference const& xGraphic, + std::optional quotients) +{ + ::Graphic aGraphic(xGraphic); + assert (aGraphic.GetType() == GraphicType::Bitmap); + + BitmapEx aBitmapEx; + if (quotients) + { + aBitmapEx = aGraphic.GetBitmapEx(); + + const Size bmpSize = aBitmapEx.GetSizePixel(); + const auto& [qx1, qy1, qx2, qy2] = *quotients; + const tools::Long l = std::round(bmpSize.Width() * qx1); + const tools::Long t = std::round(bmpSize.Height() * qy1); + const tools::Long r = std::round(bmpSize.Width() * qx2); + const tools::Long b = std::round(bmpSize.Height() * qy2); + + aBitmapEx.Crop({ l, t, bmpSize.Width() - r - 1, bmpSize.Height() - b - 1 }); + } + + ::Graphic aReturnGraphic(aBitmapEx); + aReturnGraphic.setOriginURL(aGraphic.getOriginURL()); + + return aReturnGraphic.GetXGraphic(); +} + +Reference< XGraphic > lclMirrorGraphic(uno::Reference const & xGraphic, bool bFlipH, bool bFlipV) +{ + ::Graphic aGraphic(xGraphic); + ::Graphic aReturnGraphic; + + assert (aGraphic.GetType() == GraphicType::Bitmap); + + BitmapEx aBitmapEx(aGraphic.GetBitmapEx()); + BmpMirrorFlags nMirrorFlags = BmpMirrorFlags::NONE; + + if(bFlipH) + nMirrorFlags |= BmpMirrorFlags::Horizontal; + if(bFlipV) + nMirrorFlags |= BmpMirrorFlags::Vertical; + + aBitmapEx.Mirror(nMirrorFlags); + + aReturnGraphic = ::Graphic(aBitmapEx); + aReturnGraphic.setOriginURL(aGraphic.getOriginURL()); + + return aReturnGraphic.GetXGraphic(); +} + +Reference< XGraphic > lclGreysScaleGraphic(uno::Reference const & xGraphic) +{ + ::Graphic aGraphic(xGraphic); + ::Graphic aReturnGraphic; + + assert (aGraphic.GetType() == GraphicType::Bitmap); + + BitmapEx aBitmapEx(aGraphic.GetBitmapEx()); + aBitmapEx.Convert(BmpConversion::N8BitGreys); + + aReturnGraphic = ::Graphic(aBitmapEx); + aReturnGraphic.setOriginURL(aGraphic.getOriginURL()); + + return aReturnGraphic.GetXGraphic(); +} + +/// Applies the graphic Black&White (Monochrome) effect with the imported threshold +Reference lclApplyBlackWhiteEffect(const BlipFillProperties& aBlipProps, + const uno::Reference& xGraphic) +{ + const auto& oBiLevelThreshold = aBlipProps.moBiLevelThreshold; + if (oBiLevelThreshold.has()) + { + sal_uInt8 nThreshold + = static_cast(oBiLevelThreshold.get() * 255 / MAX_PERCENT); + + ::Graphic aGraphic(xGraphic); + ::Graphic aReturnGraphic; + + BitmapEx aBitmapEx(aGraphic.GetBitmapEx()); + AlphaMask aMask(aBitmapEx.GetAlpha()); + + BitmapEx aTmpBmpEx(aBitmapEx.GetBitmap()); + BitmapFilter::Filter(aTmpBmpEx, BitmapMonochromeFilter{ nThreshold }); + + aReturnGraphic = ::Graphic(BitmapEx(aTmpBmpEx.GetBitmap(), aMask)); + aReturnGraphic.setOriginURL(aGraphic.getOriginURL()); + return aReturnGraphic.GetXGraphic(); + } + return xGraphic; +} + +Reference< XGraphic > lclCheckAndApplyChangeColorTransform(const BlipFillProperties &aBlipProps, uno::Reference const & xGraphic, + const GraphicHelper& rGraphicHelper, const ::Color nPhClr) +{ + if( aBlipProps.maColorChangeFrom.isUsed() && aBlipProps.maColorChangeTo.isUsed() ) + { + ::Color nFromColor = aBlipProps.maColorChangeFrom.getColor( rGraphicHelper, nPhClr ); + ::Color nToColor = aBlipProps.maColorChangeTo.getColor( rGraphicHelper, nPhClr ); + if ( (nFromColor != nToColor) || aBlipProps.maColorChangeTo.hasTransparency() ) + { + sal_Int16 nToTransparence = aBlipProps.maColorChangeTo.getTransparency(); + sal_Int8 nToAlpha = static_cast< sal_Int8 >( (100 - nToTransparence) * 2.55 ); + + sal_uInt8 nTolerance = 9; + Graphic aGraphic{ xGraphic }; + if( aGraphic.IsGfxLink() ) + { + // tdf#149670: Try to guess tolerance depending on image format + switch (aGraphic.GetGfxLink().GetType()) + { + case GfxLinkType::NativeJpg: + nTolerance = 15; + break; + case GfxLinkType::NativePng: + case GfxLinkType::NativeTif: + nTolerance = 1; + break; + case GfxLinkType::NativeBmp: + nTolerance = 0; + break; + default: + break; + } + } + + uno::Reference xTransformer(aBlipProps.mxFillGraphic, uno::UNO_QUERY); + if (xTransformer.is()) + return xTransformer->colorChange(xGraphic, sal_Int32(nFromColor), nTolerance, sal_Int32(nToColor), nToAlpha); + } + } + return xGraphic; +} + +uno::Reference applyBrightnessContrast(uno::Reference const & xGraphic, sal_Int32 brightness, sal_Int32 contrast) +{ + uno::Reference xTransformer(xGraphic, uno::UNO_QUERY); + if (xTransformer.is()) + return xTransformer->applyBrightnessContrast(xGraphic, brightness, contrast, true); + return xGraphic; +} + +BitmapMode lclGetBitmapMode( sal_Int32 nToken ) +{ + OSL_ASSERT((nToken & sal_Int32(0xFFFF0000))==0); + switch( nToken ) + { + case XML_tile: return BitmapMode_REPEAT; + case XML_stretch: return BitmapMode_STRETCH; + } + + // tdf#128596 Default value is XML_tile for MSO. + return BitmapMode_REPEAT; +} + +RectanglePoint lclGetRectanglePoint( sal_Int32 nToken ) +{ + OSL_ASSERT((nToken & sal_Int32(0xFFFF0000))==0); + switch( nToken ) + { + case XML_tl: return RectanglePoint_LEFT_TOP; + case XML_t: return RectanglePoint_MIDDLE_TOP; + case XML_tr: return RectanglePoint_RIGHT_TOP; + case XML_l: return RectanglePoint_LEFT_MIDDLE; + case XML_ctr: return RectanglePoint_MIDDLE_MIDDLE; + case XML_r: return RectanglePoint_RIGHT_MIDDLE; + case XML_bl: return RectanglePoint_LEFT_BOTTOM; + case XML_b: return RectanglePoint_MIDDLE_BOTTOM; + case XML_br: return RectanglePoint_RIGHT_BOTTOM; + } + return RectanglePoint_LEFT_TOP; +} + +awt::Size lclGetOriginalSize( const GraphicHelper& rGraphicHelper, const Reference< XGraphic >& rxGraphic ) +{ + awt::Size aSizeHmm( 0, 0 ); + try + { + Reference< beans::XPropertySet > xGraphicPropertySet( rxGraphic, UNO_QUERY_THROW ); + if( xGraphicPropertySet->getPropertyValue( "Size100thMM" ) >>= aSizeHmm ) + { + if( !aSizeHmm.Width && !aSizeHmm.Height ) + { // MAPMODE_PIXEL USED :-( + awt::Size aSourceSizePixel( 0, 0 ); + if( xGraphicPropertySet->getPropertyValue( "SizePixel" ) >>= aSourceSizePixel ) + aSizeHmm = rGraphicHelper.convertScreenPixelToHmm( aSourceSizePixel ); + } + } + } + catch( Exception& ) + { + } + return aSizeHmm; +} + +/** + * Looks for a last gradient transition and possibly sets a gradient border + * based on that. + */ +void extractGradientBorderFromStops(const GradientFillProperties& rGradientProps, + const GraphicHelper& rGraphicHelper, ::Color nPhClr, + awt::Gradient& rGradient) +{ + if (rGradientProps.maGradientStops.size() <= 1) + return; + + auto it = rGradientProps.maGradientStops.rbegin(); + double fLastPos = it->first; + Color aLastColor = it->second; + ++it; + double fLastButOnePos = it->first; + Color aLastButOneColor = it->second; + if (!aLastColor.equals(aLastButOneColor, rGraphicHelper, nPhClr)) + return; + + // Last transition has the same color, we can map that to a border. + rGradient.Border = rtl::math::round((fLastPos - fLastButOnePos) * 100); +} + +} // namespace + +void GradientFillProperties::assignUsed( const GradientFillProperties& rSourceProps ) +{ + if( !rSourceProps.maGradientStops.empty() ) + maGradientStops = rSourceProps.maGradientStops; + moFillToRect.assignIfUsed( rSourceProps.moFillToRect ); + moTileRect.assignIfUsed( rSourceProps.moTileRect ); + moGradientPath.assignIfUsed( rSourceProps.moGradientPath ); + moShadeAngle.assignIfUsed( rSourceProps.moShadeAngle ); + moShadeFlip.assignIfUsed( rSourceProps.moShadeFlip ); + moShadeScaled.assignIfUsed( rSourceProps.moShadeScaled ); + moRotateWithShape.assignIfUsed( rSourceProps.moRotateWithShape ); +} + +void PatternFillProperties::assignUsed( const PatternFillProperties& rSourceProps ) +{ + maPattFgColor.assignIfUsed( rSourceProps.maPattFgColor ); + maPattBgColor.assignIfUsed( rSourceProps.maPattBgColor ); + moPattPreset.assignIfUsed( rSourceProps.moPattPreset ); +} + +void BlipFillProperties::assignUsed( const BlipFillProperties& rSourceProps ) +{ + if(rSourceProps.mxFillGraphic.is()) + mxFillGraphic = rSourceProps.mxFillGraphic; + moBitmapMode.assignIfUsed( rSourceProps.moBitmapMode ); + moFillRect.assignIfUsed( rSourceProps.moFillRect ); + moTileOffsetX.assignIfUsed( rSourceProps.moTileOffsetX ); + moTileOffsetY.assignIfUsed( rSourceProps.moTileOffsetY ); + moTileScaleX.assignIfUsed( rSourceProps.moTileScaleX ); + moTileScaleY.assignIfUsed( rSourceProps.moTileScaleY ); + moTileAlign.assignIfUsed( rSourceProps.moTileAlign ); + moTileFlip.assignIfUsed( rSourceProps.moTileFlip ); + moRotateWithShape.assignIfUsed( rSourceProps.moRotateWithShape ); + moColorEffect.assignIfUsed( rSourceProps.moColorEffect ); + moBrightness.assignIfUsed( rSourceProps.moBrightness ); + moContrast.assignIfUsed( rSourceProps.moContrast ); + moBiLevelThreshold.assignIfUsed( rSourceProps.moBiLevelThreshold ); + maColorChangeFrom.assignIfUsed( rSourceProps.maColorChangeFrom ); + maColorChangeTo.assignIfUsed( rSourceProps.maColorChangeTo ); + maDuotoneColors[0].assignIfUsed( rSourceProps.maDuotoneColors[0] ); + maDuotoneColors[1].assignIfUsed( rSourceProps.maDuotoneColors[1] ); + maEffect.assignUsed( rSourceProps.maEffect ); + moAlphaModFix.assignIfUsed(rSourceProps.moAlphaModFix); +} + +void FillProperties::assignUsed( const FillProperties& rSourceProps ) +{ + moFillType.assignIfUsed( rSourceProps.moFillType ); + maFillColor.assignIfUsed( rSourceProps.maFillColor ); + moUseBgFill.assignIfUsed( rSourceProps.moUseBgFill ); + maGradientProps.assignUsed( rSourceProps.maGradientProps ); + maPatternProps.assignUsed( rSourceProps.maPatternProps ); + maBlipProps.assignUsed( rSourceProps.maBlipProps ); +} + +Color FillProperties::getBestSolidColor() const +{ + Color aSolidColor; + if( moFillType.has() ) switch( moFillType.get() ) + { + case XML_solidFill: + aSolidColor = maFillColor; + break; + case XML_gradFill: + if( !maGradientProps.maGradientStops.empty() ) + { + GradientFillProperties::GradientStopMap::const_iterator aGradientStop = + maGradientProps.maGradientStops.begin(); + if (maGradientProps.maGradientStops.size() > 2) + ++aGradientStop; + aSolidColor = aGradientStop->second; + } + break; + case XML_pattFill: + aSolidColor = maPatternProps.maPattBgColor.isUsed() ? maPatternProps.maPattBgColor : maPatternProps.maPattFgColor; + break; + } + return aSolidColor; +} + +void FillProperties::pushToPropMap( ShapePropertyMap& rPropMap, + const GraphicHelper& rGraphicHelper, sal_Int32 nShapeRotation, ::Color nPhClr, sal_Int16 nPhClrTheme, + bool bFlipH, bool bFlipV, bool bIsCustomShape) const +{ + if( !moFillType.has() ) + return; + + FillStyle eFillStyle = FillStyle_NONE; + OSL_ASSERT((moFillType.get() & sal_Int32(0xFFFF0000))==0); + switch( moFillType.get() ) + { + case XML_noFill: + { + eFillStyle = FillStyle_NONE; + rPropMap.setProperty(ShapeProperty::FillUseSlideBackground, moUseBgFill.get(false)); + } + break; + + case XML_solidFill: + if( maFillColor.isUsed() ) + { + ::Color aFillColor = maFillColor.getColor(rGraphicHelper, nPhClr); + rPropMap.setProperty(ShapeProperty::FillColor, aFillColor); + if( maFillColor.hasTransparency() ) + rPropMap.setProperty( ShapeProperty::FillTransparency, maFillColor.getTransparency() ); + + if (aFillColor == nPhClr) + { + rPropMap.setProperty(PROP_FillColorTheme, nPhClrTheme); + } + else if (maFillColor.getTintOrShade() == 0) + { + rPropMap.setProperty(PROP_FillColorTheme, maFillColor.getSchemeColorIndex()); + rPropMap.setProperty(PROP_FillColorLumMod, maFillColor.getLumMod()); + rPropMap.setProperty(PROP_FillColorLumOff, maFillColor.getLumOff()); + } + + eFillStyle = FillStyle_SOLID; + } + break; + + case XML_gradFill: + // do not create gradient struct if property is not supported... + if( rPropMap.supportsProperty( ShapeProperty::FillGradient ) ) + { + sal_Int32 nEndTrans = 0; + sal_Int32 nStartTrans = 0; + awt::Gradient aGradient; + aGradient.Angle = 900; + aGradient.StartIntensity = 100; + aGradient.EndIntensity = 100; + + // Old code, values in aGradient overwritten in many cases by newer code below + if( maGradientProps.maGradientStops.size() > 1 ) + { + aGradient.StartColor = sal_Int32(maGradientProps.maGradientStops.begin()->second.getColor( rGraphicHelper, nPhClr )); + aGradient.EndColor = sal_Int32(maGradientProps.maGradientStops.rbegin()->second.getColor( rGraphicHelper, nPhClr )); + if( maGradientProps.maGradientStops.rbegin()->second.hasTransparency() ) + nEndTrans = maGradientProps.maGradientStops.rbegin()->second.getTransparency()*255/100; + if( maGradientProps.maGradientStops.begin()->second.hasTransparency() ) + nStartTrans = maGradientProps.maGradientStops.begin()->second.getTransparency()*255/100; + } + + // "rotate with shape" set to false -> do not rotate + if ( !maGradientProps.moRotateWithShape.get( true ) ) + nShapeRotation = 0; + + if( maGradientProps.moGradientPath.has() ) + { + IntegerRectangle2D aFillToRect = maGradientProps.moFillToRect.get( IntegerRectangle2D( 0, 0, MAX_PERCENT, MAX_PERCENT ) ); + sal_Int32 nCenterX = (MAX_PERCENT + aFillToRect.X1 - aFillToRect.X2) / 2; + aGradient.XOffset = getLimitedValue( + nCenterX / PER_PERCENT, 0, 100); + sal_Int32 nCenterY = (MAX_PERCENT + aFillToRect.Y1 - aFillToRect.Y2) / 2; + aGradient.YOffset = getLimitedValue( + nCenterY / PER_PERCENT, 0, 100); + + if( maGradientProps.moGradientPath.get() == XML_circle ) + { + // Style should be radial at least when the horizontal center is at 50%. + // Otherwise import as a linear gradient, because it is the most similar to the MSO radial style. + aGradient.Style = awt::GradientStyle_LINEAR; + if( aGradient.XOffset == 100 && aGradient.YOffset == 100 ) + aGradient.Angle = 450; + else if( aGradient.XOffset == 0 && aGradient.YOffset == 100 ) + aGradient.Angle = 3150; + else if( aGradient.XOffset == 100 && aGradient.YOffset == 0 ) + aGradient.Angle = 1350; + else if( aGradient.XOffset == 0 && aGradient.YOffset == 0 ) + aGradient.Angle = 2250; + else + aGradient.Style = awt::GradientStyle_RADIAL; + } + else + { + aGradient.Style = awt::GradientStyle_RECT; + } + + ::std::swap( aGradient.StartColor, aGradient.EndColor ); + ::std::swap( nStartTrans, nEndTrans ); + + extractGradientBorderFromStops(maGradientProps, rGraphicHelper, nPhClr, + aGradient); + } + else if (!maGradientProps.maGradientStops.empty()) + { + // A copy of the gradient stops for local modification + GradientFillProperties::GradientStopMap aGradientStops(maGradientProps.maGradientStops); + + // Add a fake gradient stop at 0% and 100% if necessary, so that the gradient always starts + // at 0% and ends at 100%, to make following logic clearer (?). + auto a0 = aGradientStops.find( 0.0 ); + if( a0 == aGradientStops.end() ) + { + // temp variable required + Color aFirstColor(aGradientStops.begin()->second); + aGradientStops.emplace( 0.0, aFirstColor ); + } + + auto a1 = aGradientStops.find( 1.0 ); + if( a1 == aGradientStops.end() ) + { + // ditto + Color aLastColor(aGradientStops.rbegin()->second); + aGradientStops.emplace( 1.0, aLastColor ); + } + + // Check if the gradient is symmetric, which we will emulate with an "axial" gradient. + bool bSymmetric(true); + { + GradientFillProperties::GradientStopMap::const_iterator aItA( aGradientStops.begin() ); + GradientFillProperties::GradientStopMap::const_iterator aItZ(std::prev(aGradientStops.end())); + assert(aItZ != aGradientStops.end()); + while( bSymmetric && aItA->first < aItZ->first ) + { + if (!aItA->second.equals(aItZ->second, rGraphicHelper, nPhClr)) + bSymmetric = false; + else + { + ++aItA; + aItZ = std::prev(aItZ); + } + } + // Don't be fooled if the middlemost stop isn't at 0.5. + if( bSymmetric && aItA == aItZ && aItA->first != 0.5 ) + bSymmetric = false; + + // If symmetric, do the rest of the logic for just a half. + if( bSymmetric ) + { + // aItZ already points to the colour for the middle, but insert a fake stop at the + // exact middle if necessary. + if( aItA->first != aItZ->first ) + { + Color aMiddleColor = aItZ->second; + auto a05 = aGradientStops.find( 0.5 ); + + if( a05 != aGradientStops.end() ) + a05->second = aMiddleColor; + else + aGradientStops.emplace( 0.5, aMiddleColor ); + } + // Drop the rest of the stops + while( aGradientStops.rbegin()->first > 0.5 ) + aGradientStops.erase( aGradientStops.rbegin()->first ); + } + } + + SAL_INFO("oox.drawingml.gradient", "symmetric: " << (bSymmetric ? "YES" : "NO") << + ", number of stops: " << aGradientStops.size()); + size_t nIndex = 0; + for (auto const& gradientStop : aGradientStops) + SAL_INFO("oox.drawingml.gradient", " " << nIndex++ << ": " << + gradientStop.first << ": " << + std::hex << sal_Int32(gradientStop.second.getColor( rGraphicHelper, nPhClr )) << std::dec << + "@" << (100 - gradientStop.second.getTransparency()) << "%"); + + // Now estimate the simple LO style gradient (only two stops, at n% and 100%, where n == + // the "border") that best emulates the gradient between begin() and prior(end()). + + // First look for the largest segment in the gradient. + GradientFillProperties::GradientStopMap::iterator aIt(aGradientStops.begin()); + double nWidestWidth = -1; + GradientFillProperties::GradientStopMap::iterator aWidestSegmentStart; + ++aIt; + while( aIt != aGradientStops.end() ) + { + if (aIt->first - std::prev(aIt)->first > nWidestWidth) + { + nWidestWidth = aIt->first - std::prev(aIt)->first; + aWidestSegmentStart = std::prev(aIt); + } + ++aIt; + } + assert( nWidestWidth > 0 ); + + double nBorder = 0; + bool bSwap(false); + + // Do we have just two segments, and either one is of uniform colour, or three or more + // segments, and the widest one is the first or last one, and is it of uniform colour? If + // so, deduce the border from it, and drop that segment. + if( aGradientStops.size() == 3 && + aGradientStops.begin()->second.getColor(rGraphicHelper, nPhClr) == std::next(aGradientStops.begin())->second.getColor(rGraphicHelper, nPhClr) && + aGradientStops.begin()->second.getTransparency() == std::next(aGradientStops.begin())->second.getTransparency()) + { + // Two segments, first is uniformly coloured + SAL_INFO("oox.drawingml.gradient", "two segments, first is uniformly coloured"); + nBorder = std::next(aGradientStops.begin())->first - aGradientStops.begin()->first; + aGradientStops.erase(aGradientStops.begin()); + aWidestSegmentStart = aGradientStops.begin(); + } + else if( !bSymmetric && + aGradientStops.size() == 3 && + std::next(aGradientStops.begin())->second.getColor(rGraphicHelper, nPhClr) == std::prev(aGradientStops.end())->second.getColor(rGraphicHelper, nPhClr) && + std::next(aGradientStops.begin())->second.getTransparency() == std::prev(aGradientStops.end())->second.getTransparency()) + { + // Two segments, second is uniformly coloured + SAL_INFO("oox.drawingml.gradient", "two segments, second is uniformly coloured"); + auto aNext = std::next(aGradientStops.begin()); + auto aPrev = std::prev(aGradientStops.end()); + assert(aPrev != aGradientStops.end()); + nBorder = aPrev->first - aNext->first; + aGradientStops.erase(aNext); + aWidestSegmentStart = aGradientStops.begin(); + bSwap = true; + nShapeRotation = 180*60000 - nShapeRotation; + } + else if( !bSymmetric && + aGradientStops.size() >= 4 && + aWidestSegmentStart->second.getColor( rGraphicHelper, nPhClr ) == std::next(aWidestSegmentStart)->second.getColor(rGraphicHelper, nPhClr) && + aWidestSegmentStart->second.getTransparency() == std::next(aWidestSegmentStart)->second.getTransparency() && + ( aWidestSegmentStart == aGradientStops.begin() || + std::next(aWidestSegmentStart) == std::prev(aGradientStops.end()))) + { + // Not symmetric, three or more segments, the widest is first or last and is uniformly coloured + SAL_INFO("oox.drawingml.gradient", "first or last segment is widest and is uniformly coloured"); + nBorder = std::next(aWidestSegmentStart)->first - aWidestSegmentStart->first; + + // If it's the last segment that is uniformly coloured, rotate the gradient 180 + // degrees and swap start and end colours + if (std::next(aWidestSegmentStart) == std::prev(aGradientStops.end())) + { + bSwap = true; + nShapeRotation = 180*60000 - nShapeRotation; + } + + aGradientStops.erase( aWidestSegmentStart++ ); + + // Look for which is widest now + aIt = std::next(aGradientStops.begin()); + nWidestWidth = -1; + while( aIt != aGradientStops.end() ) + { + if (aIt->first - std::prev(aIt)->first > nWidestWidth) + { + nWidestWidth = aIt->first - std::prev(aIt)->first; + aWidestSegmentStart = std::prev(aIt); + } + ++aIt; + } + } + SAL_INFO("oox.drawingml.gradient", "widest segment start: " << aWidestSegmentStart->first << ", border: " << nBorder); + assert( (!bSymmetric && !bSwap) || !(bSymmetric && bSwap) ); + + // Now we have a potential border and a largest segment. Use those. + + aGradient.Style = bSymmetric ? awt::GradientStyle_AXIAL : awt::GradientStyle_LINEAR; + sal_Int32 nShadeAngle = maGradientProps.moShadeAngle.get( 0 ); + // Adjust for flips + if ( bFlipH ) + nShadeAngle = 180*60000 - nShadeAngle; + if ( bFlipV ) + nShadeAngle = -nShadeAngle; + sal_Int32 nDmlAngle = nShadeAngle + nShapeRotation; + // convert DrawingML angle (in 1/60000 degrees) to API angle (in 1/10 degrees) + aGradient.Angle = static_cast< sal_Int16 >( (8100 - (nDmlAngle / (PER_DEGREE / 10))) % 3600 ); + Color aStartColor, aEndColor; + + // Make a note where the widest segment stops, because we will try to grow it next. + auto aWidestSegmentEnd = std::next(aWidestSegmentStart); + + // Try to grow the widest segment backwards: if a previous segment has the same + // color, just different transparency, include it. + while (aWidestSegmentStart != aGradientStops.begin()) + { + auto it = std::prev(aWidestSegmentStart); + if (it->second.getColor(rGraphicHelper, nPhClr) + != aWidestSegmentStart->second.getColor(rGraphicHelper, nPhClr)) + { + break; + } + + aWidestSegmentStart = it; + } + + // Try to grow the widest segment forward: if a next segment has the same + // color, just different transparency, include it. + while (aWidestSegmentEnd != std::prev(aGradientStops.end())) + { + auto it = std::next(aWidestSegmentEnd); + if (it->second.getColor(rGraphicHelper, nPhClr) + != aWidestSegmentEnd->second.getColor(rGraphicHelper, nPhClr)) + { + break; + } + + aWidestSegmentEnd = it; + } + + assert(aWidestSegmentEnd != aGradientStops.end()); + + if( bSymmetric ) + { + aStartColor = aWidestSegmentEnd->second; + aEndColor = aWidestSegmentStart->second; + nBorder *= 2; + } + else if( bSwap ) + { + aStartColor = aWidestSegmentEnd->second; + aEndColor = aWidestSegmentStart->second; + } + else + { + aStartColor = aWidestSegmentStart->second; + aEndColor = aWidestSegmentEnd->second; + } + + SAL_INFO("oox.drawingml.gradient", "start color: " << std::hex << sal_Int32(aStartColor.getColor( rGraphicHelper, nPhClr )) << std::dec << + "@" << (100-aStartColor.getTransparency()) << "%" + ", end color: " << std::hex << sal_Int32(aEndColor.getColor( rGraphicHelper, nPhClr )) << std::dec << + "@" << (100-aEndColor.getTransparency()) << "%"); + + aGradient.StartColor = sal_Int32(aStartColor.getColor( rGraphicHelper, nPhClr )); + aGradient.EndColor = sal_Int32(aEndColor.getColor( rGraphicHelper, nPhClr )); + + nStartTrans = aStartColor.hasTransparency() ? aStartColor.getTransparency()*255/100 : 0; + nEndTrans = aEndColor.hasTransparency() ? aEndColor.getTransparency()*255/100 : 0; + + aGradient.Border = rtl::math::round(100*nBorder); + } + + // push gradient or named gradient to property map + if( rPropMap.setProperty( ShapeProperty::FillGradient, aGradient ) ) + eFillStyle = FillStyle_GRADIENT; + + // push gradient transparency to property map + if( nStartTrans != 0 || nEndTrans != 0 ) + { + awt::Gradient aGrad(aGradient); + uno::Any aVal; + aGrad.EndColor = static_cast( nEndTrans | nEndTrans << 8 | nEndTrans << 16 ); + aGrad.StartColor = static_cast( nStartTrans | nStartTrans << 8 | nStartTrans << 16 ); + aVal <<= aGrad; + rPropMap.setProperty( ShapeProperty::GradientTransparency, aGrad ); + } + + } + break; + + case XML_blipFill: + // do not start complex graphic transformation if property is not supported... + if (maBlipProps.mxFillGraphic.is() && rPropMap.supportsProperty(ShapeProperty::FillBitmap)) + { + uno::Reference xGraphic = lclCheckAndApplyDuotoneTransform(maBlipProps, maBlipProps.mxFillGraphic, rGraphicHelper, nPhClr); + // TODO: "rotate with shape" is not possible with our current core + + if (xGraphic.is()) + { + if (maBlipProps.moColorEffect.get(XML_TOKEN_INVALID) == XML_grayscl) + xGraphic = lclGreysScaleGraphic(xGraphic); + + if (rPropMap.supportsProperty(ShapeProperty::FillBitmapName) && + rPropMap.setProperty(ShapeProperty::FillBitmapName, xGraphic)) + { + eFillStyle = FillStyle_BITMAP; + } + else if (rPropMap.setProperty(ShapeProperty::FillBitmap, xGraphic)) + { + eFillStyle = FillStyle_BITMAP; + } + } + + // set other bitmap properties, if bitmap has been inserted into the map + if( eFillStyle == FillStyle_BITMAP ) + { + // bitmap mode (single, repeat, stretch) + BitmapMode eBitmapMode = lclGetBitmapMode( maBlipProps.moBitmapMode.get( XML_TOKEN_INVALID ) ); + rPropMap.setProperty( ShapeProperty::FillBitmapMode, eBitmapMode ); + + // additional settings for repeated bitmap + if( eBitmapMode == BitmapMode_REPEAT ) + { + // anchor position inside bitmap + RectanglePoint eRectPoint = lclGetRectanglePoint( maBlipProps.moTileAlign.get( XML_tl ) ); + rPropMap.setProperty( ShapeProperty::FillBitmapRectanglePoint, eRectPoint ); + + awt::Size aOriginalSize = lclGetOriginalSize(rGraphicHelper, maBlipProps.mxFillGraphic); + if( (aOriginalSize.Width > 0) && (aOriginalSize.Height > 0) ) + { + // size of one bitmap tile (given as 1/1000 percent of bitmap size), convert to 1/100 mm + double fScaleX = maBlipProps.moTileScaleX.get( MAX_PERCENT ) / static_cast< double >( MAX_PERCENT ); + sal_Int32 nFillBmpSizeX = getLimitedValue< sal_Int32, double >( aOriginalSize.Width * fScaleX, 1, SAL_MAX_INT32 ); + rPropMap.setProperty( ShapeProperty::FillBitmapSizeX, nFillBmpSizeX ); + double fScaleY = maBlipProps.moTileScaleY.get( MAX_PERCENT ) / static_cast< double >( MAX_PERCENT ); + sal_Int32 nFillBmpSizeY = getLimitedValue< sal_Int32, double >( aOriginalSize.Height * fScaleY, 1, SAL_MAX_INT32 ); + rPropMap.setProperty( ShapeProperty::FillBitmapSizeY, nFillBmpSizeY ); + + // offset of the first bitmap tile (given as EMUs), convert to percent + sal_Int16 nTileOffsetX = getDoubleIntervalValue< sal_Int16 >( std::round( maBlipProps.moTileOffsetX.get( 0 ) / 3.6 / aOriginalSize.Width ), 0, 100 ); + rPropMap.setProperty( ShapeProperty::FillBitmapOffsetX, nTileOffsetX ); + sal_Int16 nTileOffsetY = getDoubleIntervalValue< sal_Int16 >( std::round( maBlipProps.moTileOffsetY.get( 0 ) / 3.6 / aOriginalSize.Height ), 0, 100 ); + rPropMap.setProperty( ShapeProperty::FillBitmapOffsetY, nTileOffsetY ); + } + } + else if ( eBitmapMode == BitmapMode_STRETCH && maBlipProps.moFillRect.has() ) + { + geometry::IntegerRectangle2D aFillRect( maBlipProps.moFillRect.get() ); + awt::Size aOriginalSize( rGraphicHelper.getOriginalSize( xGraphic ) ); + if ( aOriginalSize.Width && aOriginalSize.Height ) + { + text::GraphicCrop aGraphCrop( 0, 0, 0, 0 ); + if ( aFillRect.X1 ) + aGraphCrop.Left = static_cast< sal_Int32 >( ( static_cast< double >( aOriginalSize.Width ) * aFillRect.X1 ) / 100000 ); + if ( aFillRect.Y1 ) + aGraphCrop.Top = static_cast< sal_Int32 >( ( static_cast< double >( aOriginalSize.Height ) * aFillRect.Y1 ) / 100000 ); + if ( aFillRect.X2 ) + aGraphCrop.Right = static_cast< sal_Int32 >( ( static_cast< double >( aOriginalSize.Width ) * aFillRect.X2 ) / 100000 ); + if ( aFillRect.Y2 ) + aGraphCrop.Bottom = static_cast< sal_Int32 >( ( static_cast< double >( aOriginalSize.Height ) * aFillRect.Y2 ) / 100000 ); + + bool bHasCropValues = aGraphCrop.Left != 0 || aGraphCrop.Right !=0 || aGraphCrop.Top != 0 || aGraphCrop.Bottom != 0; + // Negative GraphicCrop values means "crop" here. + bool bNeedCrop = aGraphCrop.Left <= 0 && aGraphCrop.Right <= 0 && aGraphCrop.Top <= 0 && aGraphCrop.Bottom <= 0; + + if(bIsCustomShape && bHasCropValues && bNeedCrop) + { + // Physically crop the image + // In this case, don't set the PROP_GraphicCrop because that + // would lead to applying the crop twice after roundtrip + xGraphic = lclCropGraphic(xGraphic, CropQuotientsFromFillRect(aFillRect)); + if (rPropMap.supportsProperty(ShapeProperty::FillBitmapName)) + rPropMap.setProperty(ShapeProperty::FillBitmapName, xGraphic); + else + rPropMap.setProperty(ShapeProperty::FillBitmap, xGraphic); + } + else + rPropMap.setProperty(PROP_GraphicCrop, aGraphCrop); + } + } + } + + if (maBlipProps.moAlphaModFix.has()) + rPropMap.setProperty(ShapeProperty::FillTransparency, static_cast(100 - (maBlipProps.moAlphaModFix.get() / PER_PERCENT))); + } + break; + + case XML_pattFill: + { + if( rPropMap.supportsProperty( ShapeProperty::FillHatch ) ) + { + Color aColor( maPatternProps.maPattFgColor ); + if( aColor.isUsed() && maPatternProps.moPattPreset.has() ) + { + eFillStyle = FillStyle_HATCH; + rPropMap.setProperty( ShapeProperty::FillHatch, createHatch( maPatternProps.moPattPreset.get(), aColor.getColor( rGraphicHelper, nPhClr ) ) ); + if( aColor.hasTransparency() ) + rPropMap.setProperty( ShapeProperty::FillTransparency, aColor.getTransparency() ); + + // Set background color for hatch + if(maPatternProps.maPattBgColor.isUsed()) + { + aColor = maPatternProps.maPattBgColor; + rPropMap.setProperty( ShapeProperty::FillBackground, aColor.getTransparency() != 100 ); + rPropMap.setProperty( ShapeProperty::FillColor, aColor.getColor( rGraphicHelper, nPhClr ) ); + } + } + else if ( maPatternProps.maPattBgColor.isUsed() ) + { + aColor = maPatternProps.maPattBgColor; + rPropMap.setProperty( ShapeProperty::FillColor, aColor.getColor( rGraphicHelper, nPhClr ) ); + if( aColor.hasTransparency() ) + rPropMap.setProperty( ShapeProperty::FillTransparency, aColor.getTransparency() ); + eFillStyle = FillStyle_SOLID; + } + } + } + break; + + case XML_grpFill: + // todo + eFillStyle = FillStyle_NONE; + break; + } + + // set final fill style property + rPropMap.setProperty( ShapeProperty::FillStyle, eFillStyle ); +} + +void GraphicProperties::pushToPropMap( PropertyMap& rPropMap, const GraphicHelper& rGraphicHelper, bool bFlipH, bool bFlipV) const +{ + sal_Int16 nBrightness = getLimitedValue< sal_Int16, sal_Int32 >( maBlipProps.moBrightness.get( 0 ) / PER_PERCENT, -100, 100 ); + sal_Int16 nContrast = getLimitedValue< sal_Int16, sal_Int32 >( maBlipProps.moContrast.get( 0 ) / PER_PERCENT, -100, 100 ); + ColorMode eColorMode = ColorMode_STANDARD; + + switch( maBlipProps.moColorEffect.get( XML_TOKEN_INVALID ) ) + { + case XML_biLevel: eColorMode = ColorMode_MONO; break; + case XML_grayscl: eColorMode = ColorMode_GREYS; break; + } + + if (maBlipProps.mxFillGraphic.is()) + { + // created transformed graphic + uno::Reference xGraphic = lclCheckAndApplyChangeColorTransform(maBlipProps, maBlipProps.mxFillGraphic, rGraphicHelper, API_RGB_TRANSPARENT); + xGraphic = lclCheckAndApplyDuotoneTransform(maBlipProps, xGraphic, rGraphicHelper, API_RGB_TRANSPARENT); + + if( eColorMode == ColorMode_MONO ) + { + // ColorMode_MONO is the same with MSO's biLevel with 50000 (50%) threshold, + // when threshold isn't 50000 bake the effect instead. + if( maBlipProps.moBiLevelThreshold.get() != 50000 ) + { + xGraphic = lclApplyBlackWhiteEffect(maBlipProps, xGraphic); + eColorMode = ColorMode_STANDARD; + } + } + + if (eColorMode == ColorMode_STANDARD && nBrightness == 70 && nContrast == -70) + { + // map MSO 'washout' to our Watermark colormode + eColorMode = ColorMode_WATERMARK; + nBrightness = 0; + nContrast = 0; + } + else if( nBrightness != 0 && nContrast != 0 ) + { + // MSO uses a different algorithm for contrast+brightness, LO applies contrast before brightness, + // while MSO apparently applies half of brightness before contrast and half after. So if only + // contrast or brightness need to be altered, the result is the same, but if both are involved, + // there's no way to map that, so just force a conversion of the image. + xGraphic = applyBrightnessContrast( xGraphic, nBrightness, nContrast ); + nBrightness = 0; + nContrast = 0; + } + + // cropping + if ( maBlipProps.moClipRect.has() ) + { + geometry::IntegerRectangle2D oClipRect( maBlipProps.moClipRect.get() ); + awt::Size aOriginalSize( rGraphicHelper.getOriginalSize( xGraphic ) ); + if ( aOriginalSize.Width && aOriginalSize.Height ) + { + text::GraphicCrop aGraphCrop( 0, 0, 0, 0 ); + if ( oClipRect.X1 ) + aGraphCrop.Left = rtl::math::round( ( static_cast< double >( aOriginalSize.Width ) * oClipRect.X1 ) / 100000 ); + if ( oClipRect.Y1 ) + aGraphCrop.Top = rtl::math::round( ( static_cast< double >( aOriginalSize.Height ) * oClipRect.Y1 ) / 100000 ); + if ( oClipRect.X2 ) + aGraphCrop.Right = rtl::math::round( ( static_cast< double >( aOriginalSize.Width ) * oClipRect.X2 ) / 100000 ); + if ( oClipRect.Y2 ) + aGraphCrop.Bottom = rtl::math::round( ( static_cast< double >( aOriginalSize.Height ) * oClipRect.Y2 ) / 100000 ); + rPropMap.setProperty(PROP_GraphicCrop, aGraphCrop); + + bool bHasCropValues = aGraphCrop.Left != 0 || aGraphCrop.Right !=0 || aGraphCrop.Top != 0 || aGraphCrop.Bottom != 0; + // Positive GraphicCrop values means "crop" here. + bool bNeedCrop = aGraphCrop.Left >= 0 && aGraphCrop.Right >= 0 && aGraphCrop.Top >= 0 && aGraphCrop.Bottom >= 0; + + if(mbIsCustomShape && bHasCropValues && bNeedCrop) + { + xGraphic = lclCropGraphic(xGraphic, CropQuotientsFromSrcRect(oClipRect)); + } + } + } + + if(mbIsCustomShape) + { + // it is a cropped graphic. + rPropMap.setProperty(PROP_FillStyle, FillStyle_BITMAP); + rPropMap.setProperty(PROP_FillBitmapMode, BitmapMode_STRETCH); + + // It is a bitmap filled and rotated graphic. + // When custom shape is rotated, bitmap have to be rotated too. + if(rPropMap.hasProperty(PROP_RotateAngle)) + { + tools::Long nAngle = rPropMap.getProperty(PROP_RotateAngle).get(); + xGraphic = lclRotateGraphic(xGraphic, Degree10(nAngle/10) ); + } + + // We have not core feature that flips graphic in the shape. + // Here we are applying flip property to bitmap directly. + if(bFlipH || bFlipV) + xGraphic = lclMirrorGraphic(xGraphic, bFlipH, bFlipV ); + + if(eColorMode == ColorMode_GREYS) + xGraphic = lclGreysScaleGraphic( xGraphic ); + + rPropMap.setProperty(PROP_FillBitmap, xGraphic); + } + else + rPropMap.setProperty(PROP_Graphic, xGraphic); + + + if ( maBlipProps.moAlphaModFix.has() ) + { + rPropMap.setProperty(PROP_Transparency, static_cast(100 - (maBlipProps.moAlphaModFix.get() / PER_PERCENT))); + } + } + rPropMap.setProperty(PROP_GraphicColorMode, eColorMode); + + // brightness and contrast + if( nBrightness != 0 ) + rPropMap.setProperty(PROP_AdjustLuminance, nBrightness); + if( nContrast != 0 ) + rPropMap.setProperty(PROP_AdjustContrast, nContrast); + + // Media content + if (!m_sMediaPackageURL.isEmpty()) + { + rPropMap.setProperty(PROP_MediaURL, m_sMediaPackageURL); + if (m_xMediaStream.is()) + rPropMap.setProperty(PROP_PrivateStream, m_xMediaStream); + } +} + +bool ArtisticEffectProperties::isEmpty() const +{ + return msName.isEmpty(); +} + +css::beans::PropertyValue ArtisticEffectProperties::getEffect() +{ + css::beans::PropertyValue aRet; + if( msName.isEmpty() ) + return aRet; + + css::uno::Sequence< css::beans::PropertyValue > aSeq( maAttribs.size() + 1 ); + auto pSeq = aSeq.getArray(); + sal_uInt32 i = 0; + for (auto const& attrib : maAttribs) + { + pSeq[i].Name = attrib.first; + pSeq[i].Value = attrib.second; + i++; + } + + if( mrOleObjectInfo.maEmbeddedData.hasElements() ) + { + css::uno::Sequence< css::beans::PropertyValue > aGraphicSeq{ + comphelper::makePropertyValue("Id", mrOleObjectInfo.maProgId), + comphelper::makePropertyValue("Data", mrOleObjectInfo.maEmbeddedData) + }; + + pSeq[i].Name = "OriginalGraphic"; + pSeq[i].Value <<= aGraphicSeq; + } + + aRet.Name = msName; + aRet.Value <<= aSeq; + + return aRet; +} + +void ArtisticEffectProperties::assignUsed( const ArtisticEffectProperties& rSourceProps ) +{ + if( !rSourceProps.isEmpty() ) + { + msName = rSourceProps.msName; + maAttribs = rSourceProps.maAttribs; + } +} + +OUString ArtisticEffectProperties::getEffectString( sal_Int32 nToken ) +{ + switch( nToken ) + { + // effects + case OOX_TOKEN( a14, artisticBlur ): return "artisticBlur"; + case OOX_TOKEN( a14, artisticCement ): return "artisticCement"; + case OOX_TOKEN( a14, artisticChalkSketch ): return "artisticChalkSketch"; + case OOX_TOKEN( a14, artisticCrisscrossEtching ): return "artisticCrisscrossEtching"; + case OOX_TOKEN( a14, artisticCutout ): return "artisticCutout"; + case OOX_TOKEN( a14, artisticFilmGrain ): return "artisticFilmGrain"; + case OOX_TOKEN( a14, artisticGlass ): return "artisticGlass"; + case OOX_TOKEN( a14, artisticGlowDiffused ): return "artisticGlowDiffused"; + case OOX_TOKEN( a14, artisticGlowEdges ): return "artisticGlowEdges"; + case OOX_TOKEN( a14, artisticLightScreen ): return "artisticLightScreen"; + case OOX_TOKEN( a14, artisticLineDrawing ): return "artisticLineDrawing"; + case OOX_TOKEN( a14, artisticMarker ): return "artisticMarker"; + case OOX_TOKEN( a14, artisticMosiaicBubbles ): return "artisticMosiaicBubbles"; + case OOX_TOKEN( a14, artisticPaintStrokes ): return "artisticPaintStrokes"; + case OOX_TOKEN( a14, artisticPaintBrush ): return "artisticPaintBrush"; + case OOX_TOKEN( a14, artisticPastelsSmooth ): return "artisticPastelsSmooth"; + case OOX_TOKEN( a14, artisticPencilGrayscale ): return "artisticPencilGrayscale"; + case OOX_TOKEN( a14, artisticPencilSketch ): return "artisticPencilSketch"; + case OOX_TOKEN( a14, artisticPhotocopy ): return "artisticPhotocopy"; + case OOX_TOKEN( a14, artisticPlasticWrap ): return "artisticPlasticWrap"; + case OOX_TOKEN( a14, artisticTexturizer ): return "artisticTexturizer"; + case OOX_TOKEN( a14, artisticWatercolorSponge ): return "artisticWatercolorSponge"; + case OOX_TOKEN( a14, brightnessContrast ): return "brightnessContrast"; + case OOX_TOKEN( a14, colorTemperature ): return "colorTemperature"; + case OOX_TOKEN( a14, saturation ): return "saturation"; + case OOX_TOKEN( a14, sharpenSoften ): return "sharpenSoften"; + + // attributes + case XML_visible: return "visible"; + case XML_trans: return "trans"; + case XML_crackSpacing: return "crackSpacing"; + case XML_pressure: return "pressure"; + case XML_numberOfShades: return "numberOfShades"; + case XML_grainSize: return "grainSize"; + case XML_intensity: return "intensity"; + case XML_smoothness: return "smoothness"; + case XML_gridSize: return "gridSize"; + case XML_pencilSize: return "pencilSize"; + case XML_size: return "size"; + case XML_brushSize: return "brushSize"; + case XML_scaling: return "scaling"; + case XML_detail: return "detail"; + case XML_bright: return "bright"; + case XML_contrast: return "contrast"; + case XML_colorTemp: return "colorTemp"; + case XML_sat: return "sat"; + case XML_amount: return "amount"; + } + SAL_WARN( "oox.drawingml", "ArtisticEffectProperties::getEffectString: unexpected token " << nToken ); + return OUString(); +} + +sal_Int32 ArtisticEffectProperties::getEffectToken( const OUString& sName ) +{ + // effects + if( sName == "artisticBlur" ) + return XML_artisticBlur; + else if( sName == "artisticCement" ) + return XML_artisticCement; + else if( sName == "artisticChalkSketch" ) + return XML_artisticChalkSketch; + else if( sName == "artisticCrisscrossEtching" ) + return XML_artisticCrisscrossEtching; + else if( sName == "artisticCutout" ) + return XML_artisticCutout; + else if( sName == "artisticFilmGrain" ) + return XML_artisticFilmGrain; + else if( sName == "artisticGlass" ) + return XML_artisticGlass; + else if( sName == "artisticGlowDiffused" ) + return XML_artisticGlowDiffused; + else if( sName == "artisticGlowEdges" ) + return XML_artisticGlowEdges; + else if( sName == "artisticLightScreen" ) + return XML_artisticLightScreen; + else if( sName == "artisticLineDrawing" ) + return XML_artisticLineDrawing; + else if( sName == "artisticMarker" ) + return XML_artisticMarker; + else if( sName == "artisticMosiaicBubbles" ) + return XML_artisticMosiaicBubbles; + else if( sName == "artisticPaintStrokes" ) + return XML_artisticPaintStrokes; + else if( sName == "artisticPaintBrush" ) + return XML_artisticPaintBrush; + else if( sName == "artisticPastelsSmooth" ) + return XML_artisticPastelsSmooth; + else if( sName == "artisticPencilGrayscale" ) + return XML_artisticPencilGrayscale; + else if( sName == "artisticPencilSketch" ) + return XML_artisticPencilSketch; + else if( sName == "artisticPhotocopy" ) + return XML_artisticPhotocopy; + else if( sName == "artisticPlasticWrap" ) + return XML_artisticPlasticWrap; + else if( sName == "artisticTexturizer" ) + return XML_artisticTexturizer; + else if( sName == "artisticWatercolorSponge" ) + return XML_artisticWatercolorSponge; + else if( sName == "brightnessContrast" ) + return XML_brightnessContrast; + else if( sName == "colorTemperature" ) + return XML_colorTemperature; + else if( sName == "saturation" ) + return XML_saturation; + else if( sName == "sharpenSoften" ) + return XML_sharpenSoften; + + // attributes + else if( sName == "visible" ) + return XML_visible; + else if( sName == "trans" ) + return XML_trans; + else if( sName == "crackSpacing" ) + return XML_crackSpacing; + else if( sName == "pressure" ) + return XML_pressure; + else if( sName == "numberOfShades" ) + return XML_numberOfShades; + else if( sName == "grainSize" ) + return XML_grainSize; + else if( sName == "intensity" ) + return XML_intensity; + else if( sName == "smoothness" ) + return XML_smoothness; + else if( sName == "gridSize" ) + return XML_gridSize; + else if( sName == "pencilSize" ) + return XML_pencilSize; + else if( sName == "size" ) + return XML_size; + else if( sName == "brushSize" ) + return XML_brushSize; + else if( sName == "scaling" ) + return XML_scaling; + else if( sName == "detail" ) + return XML_detail; + else if( sName == "bright" ) + return XML_bright; + else if( sName == "contrast" ) + return XML_contrast; + else if( sName == "colorTemp" ) + return XML_colorTemp; + else if( sName == "sat" ) + return XML_sat; + else if( sName == "amount" ) + return XML_amount; + + SAL_WARN( "oox.drawingml", "ArtisticEffectProperties::getEffectToken - unexpected token name: " << sName ); + return XML_none; +} + +} // namespace oox + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/drawingml/graphicshapecontext.cxx b/oox/source/drawingml/graphicshapecontext.cxx new file mode 100644 index 000000000..2e5ce5dc4 --- /dev/null +++ b/oox/source/drawingml/graphicshapecontext.cxx @@ -0,0 +1,341 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include + +#include + +#include + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +using namespace ::com::sun::star; +using namespace ::com::sun::star::io; +using namespace ::com::sun::star::uno; +using namespace ::com::sun::star::lang; +using namespace ::com::sun::star::beans; +using namespace ::com::sun::star::xml::sax; +using namespace ::oox::core; + +static uno::Reference +lcl_GetMediaStream(const OUString& rStream, const oox::core::XmlFilterBase& rFilter) +{ + if (rStream.isEmpty()) + return nullptr; + + Reference< XInputStream > xInStrm( rFilter.openInputStream(rStream), UNO_SET_THROW ); + return xInStrm; +} + +static OUString lcl_GetMediaReference(std::u16string_view rStream) +{ + return rStream.empty() ? OUString() : OUString::Concat("vnd.sun.star.Package:") + rStream; +} + +namespace oox::drawingml { + +// CT_Picture + +GraphicShapeContext::GraphicShapeContext( ContextHandler2Helper const & rParent, const ShapePtr& pMasterShapePtr, const ShapePtr& pShapePtr ) +: ShapeContext( rParent, pMasterShapePtr, pShapePtr ) +{ +} + +ContextHandlerRef GraphicShapeContext::onCreateContext( sal_Int32 aElementToken, const AttributeList& rAttribs ) +{ + switch( getBaseToken( aElementToken ) ) + { + // CT_ShapeProperties + case XML_xfrm: + return new Transform2DContext( *this, rAttribs, *mpShapePtr ); + case XML_blipFill: + return new BlipFillContext( *this, rAttribs, mpShapePtr->getGraphicProperties().maBlipProps ); + case XML_wavAudioFile: + { + OUString const path(getEmbeddedWAVAudioFile(getRelations(), rAttribs)); + Reference xMediaStream = lcl_GetMediaStream(path, getFilter()); + if (xMediaStream.is()) + { + mpShapePtr->getGraphicProperties().m_xMediaStream = xMediaStream; + mpShapePtr->getGraphicProperties().m_sMediaPackageURL = lcl_GetMediaReference(path); + } + } + break; + case XML_audioFile: + case XML_videoFile: + { + OUString rPath = getRelations().getFragmentPathFromRelId( + rAttribs.getString(R_TOKEN(link)).get() ); + if (!rPath.isEmpty()) + { + Reference xMediaStream = lcl_GetMediaStream(rPath, getFilter()); + if (xMediaStream.is()) // embedded media file + { + mpShapePtr->getGraphicProperties().m_xMediaStream = xMediaStream; + mpShapePtr->getGraphicProperties().m_sMediaPackageURL + = lcl_GetMediaReference(rPath); + } + } + else + { + rPath = getRelations().getExternalTargetFromRelId( + rAttribs.getString(R_TOKEN(link)).get()); + if (!rPath.isEmpty()) // linked media file + mpShapePtr->getGraphicProperties().m_sMediaPackageURL + = getFilter().getAbsoluteUrl(rPath); + } + } + break; + } + + if ((getNamespace( aElementToken ) == NMSP_vml) && mpShapePtr) + { + mpShapePtr->setServiceName("com.sun.star.drawing.CustomShape"); + CustomShapePropertiesPtr pCstmShpProps + (mpShapePtr->getCustomShapeProperties()); + + pCstmShpProps->setShapePresetType( getBaseToken( aElementToken ) ); + } + + return ShapeContext::onCreateContext( aElementToken, rAttribs ); +} + +// CT_GraphicalObjectFrameContext + +GraphicalObjectFrameContext::GraphicalObjectFrameContext( ContextHandler2Helper& rParent, const ShapePtr& pMasterShapePtr, const ShapePtr& pShapePtr, bool bEmbedShapesInChart ) : + ShapeContext( rParent, pMasterShapePtr, pShapePtr ), + mbEmbedShapesInChart( bEmbedShapesInChart ), + mpParent(&rParent) +{ +} + +ContextHandlerRef GraphicalObjectFrameContext::onCreateContext( sal_Int32 aElementToken, const AttributeList& rAttribs ) +{ + switch( getBaseToken( aElementToken ) ) + { + // CT_ShapeProperties + case XML_nvGraphicFramePr: // CT_GraphicalObjectFrameNonVisual + break; + case XML_xfrm: // CT_Transform2D + return new Transform2DContext( *this, rAttribs, *mpShapePtr ); + case XML_graphic: // CT_GraphicalObject + return this; + + case XML_graphicData : // CT_GraphicalObjectData + { + OUString sUri( rAttribs.getString( XML_uri ).get() ); + if ( sUri == "http://schemas.openxmlformats.org/presentationml/2006/ole" || + sUri == "http://purl.oclc.org/ooxml/presentationml/ole" ) + return new OleObjectGraphicDataContext( *this, mpShapePtr ); + else if ( sUri == "http://schemas.openxmlformats.org/drawingml/2006/diagram" || + sUri == "http://purl.oclc.org/ooxml/drawingml/diagram" ) + return new DiagramGraphicDataContext( *this, mpShapePtr ); + else if ( sUri == "http://schemas.openxmlformats.org/drawingml/2006/chart" || + sUri == "http://purl.oclc.org/ooxml/drawingml/chart" ) + return new ChartGraphicDataContext( *this, mpShapePtr, mbEmbedShapesInChart ); + else if ( sUri == "http://schemas.openxmlformats.org/drawingml/2006/table" || + sUri == "http://purl.oclc.org/ooxml/drawingml/table" ) + return new table::TableContext( *this, mpShapePtr ); + else + { + SAL_WARN("oox.drawingml", "OOX: Ignore graphicsData of :" << sUri ); + return nullptr; + } + } + break; + } + + return ShapeContext::onCreateContext( aElementToken, rAttribs ); +} + +void GraphicalObjectFrameContext::onEndElement() +{ + if( getCurrentElement() == PPT_TOKEN( graphicFrame ) && mpParent ) + { + oox::ppt::PPTShapeGroupContext* pParent = dynamic_cast(mpParent); + if( pParent ) + pParent->importExtDrawings(); + } +} + +OleObjectGraphicDataContext::OleObjectGraphicDataContext( ContextHandler2Helper const & rParent, const ShapePtr& xShape ) : + ShapeContext( rParent, ShapePtr(), xShape ), + mrOleObjectInfo( xShape->setOleObjectType() ) +{ +} + +OleObjectGraphicDataContext::~OleObjectGraphicDataContext() +{ + /* Register the OLE shape at the VML drawing, this prevents that the + related VML shape converts the OLE object by itself. */ + if( !mrOleObjectInfo.maShapeId.isEmpty() ) + if( ::oox::vml::Drawing* pVmlDrawing = getFilter().getVmlDrawing() ) + pVmlDrawing->registerOleObject( mrOleObjectInfo ); +} + +ContextHandlerRef OleObjectGraphicDataContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ) +{ + switch( nElement ) + { + case PPT_TOKEN( oleObj ): + { + mrOleObjectInfo.maShapeId = rAttribs.getXString( XML_spid, OUString() ); + const Relation* pRelation = getRelations().getRelationFromRelId( rAttribs.getString( R_TOKEN( id ), OUString() ) ); + OSL_ENSURE( pRelation, "OleObjectGraphicDataContext::createFastChildContext - missing relation for OLE object" ); + if( pRelation ) + { + mrOleObjectInfo.mbLinked = pRelation->mbExternal; + if( pRelation->mbExternal ) + { + mrOleObjectInfo.maTargetLink = getFilter().getAbsoluteUrl( pRelation->maTarget ); + } + else + { + OUString aFragmentPath = getFragmentPathFromRelation( *pRelation ); + if( !aFragmentPath.isEmpty() ) + getFilter().importBinaryData( mrOleObjectInfo.maEmbeddedData, aFragmentPath ); + } + } + mrOleObjectInfo.maName = rAttribs.getXString( XML_name, OUString() ); + mrOleObjectInfo.maProgId = rAttribs.getXString( XML_progId, OUString() ); + mrOleObjectInfo.mbShowAsIcon = rAttribs.getBool( XML_showAsIcon, false ); + mrOleObjectInfo.mbHasPicture = false; // Initialize as false + return this; + } + break; + + case PPT_TOKEN( embed ): + OSL_ENSURE( !mrOleObjectInfo.mbLinked, "OleObjectGraphicDataContext::createFastChildContext - unexpected child element" ); + break; + + case PPT_TOKEN( link ): + OSL_ENSURE( mrOleObjectInfo.mbLinked, "OleObjectGraphicDataContext::createFastChildContext - unexpected child element" ); + mrOleObjectInfo.mbAutoUpdate = rAttribs.getBool( XML_updateAutomatic, false ); + break; + case PPT_TOKEN( pic ): + mrOleObjectInfo.mbHasPicture = true; // Set true if ole object has picture element. + return new GraphicShapeContext( *this, mpMasterShapePtr, mpShapePtr ); + } + SAL_WARN("oox", "OleObjectGraphicDataContext::onCreateContext: unhandled element: " + << getBaseToken(nElement)); + return nullptr; +} + +void OleObjectGraphicDataContext::onEndElement() +{ + if( getCurrentElement() == PPT_TOKEN( oleObj ) && !isMCEStateEmpty() ) + { + if (getMCEState() == MCE_STATE::FoundChoice && !mrOleObjectInfo.mbHasPicture + && mrOleObjectInfo.maShapeId.isEmpty()) + setMCEState( MCE_STATE::Started ); + } +} + +DiagramGraphicDataContext::DiagramGraphicDataContext( ContextHandler2Helper const & rParent, const ShapePtr& pShapePtr ) +: ShapeContext( rParent, ShapePtr(), pShapePtr ) +{ + pShapePtr->setDiagramType(); +} + +DiagramGraphicDataContext::~DiagramGraphicDataContext() +{ +} + +ContextHandlerRef DiagramGraphicDataContext::onCreateContext( ::sal_Int32 aElementToken, const AttributeList& rAttribs ) +{ + switch( aElementToken ) + { + case DGM_TOKEN( relIds ): + { + msDm = rAttribs.getString( R_TOKEN( dm ) ).get(); + msLo = rAttribs.getString( R_TOKEN( lo ) ).get(); + msQs = rAttribs.getString( R_TOKEN( qs ) ).get(); + msCs = rAttribs.getString( R_TOKEN( cs ) ).get(); + loadDiagram(mpShapePtr, + getFilter(), + getFragmentPathFromRelId( msDm ), + getFragmentPathFromRelId( msLo ), + getFragmentPathFromRelId( msQs ), + getFragmentPathFromRelId( msCs ), + getRelations()); + SAL_INFO("oox.drawingml", "DiagramGraphicDataContext::onCreateContext: added shape " << mpShapePtr->getName() + << " of type " << mpShapePtr->getServiceName() + << ", position: " << mpShapePtr->getPosition().X + << "," << mpShapePtr->getPosition().Y + << ", size: " << mpShapePtr->getSize().Width + << "x" << mpShapePtr->getSize().Height); + + // No DrawingML fallback, need to warn the user at the end. + if (mpShapePtr->getExtDrawings().empty()) + getFilter().setMissingExtDrawing(); + else + { + for (const auto& rRelId : mpShapePtr->getExtDrawings()) + { + // An invalid fallback reference is as bad as a missing one. + if (getFragmentPathFromRelId(rRelId).isEmpty()) + { + getFilter().setMissingExtDrawing(); + break; + } + } + } + + break; + } + default: + break; + } + + return ShapeContext::onCreateContext( aElementToken, rAttribs ); +} + +ChartGraphicDataContext::ChartGraphicDataContext( ContextHandler2Helper const & rParent, const ShapePtr& rxShape, bool bEmbedShapes ) : + ShapeContext( rParent, ShapePtr(), rxShape ), + mrChartShapeInfo( rxShape->setChartType( bEmbedShapes ) ) +{ +} + +ContextHandlerRef ChartGraphicDataContext::onCreateContext( ::sal_Int32 nElement, const AttributeList& rAttribs ) +{ + if( nElement == C_TOKEN( chart ) ) + { + mrChartShapeInfo.maFragmentPath = getFragmentPathFromRelId( rAttribs.getString( R_TOKEN( id ), OUString() ) ); + } + return nullptr; +} + +} // namespace oox::drawingml + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/drawingml/guidcontext.cxx b/oox/source/drawingml/guidcontext.cxx new file mode 100644 index 000000000..022359562 --- /dev/null +++ b/oox/source/drawingml/guidcontext.cxx @@ -0,0 +1,40 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include + +using namespace ::oox::core; +using namespace ::com::sun::star::uno; +using namespace ::com::sun::star::xml::sax; + +namespace oox::drawingml { + +GuidContext::GuidContext( ContextHandler2Helper const & rParent, OUString& rGuidId ) +: ContextHandler2( rParent ) +, mrGuidId( rGuidId ) +{ +} +void GuidContext::onCharacters( const OUString& aChars ) +{ + mrGuidId += aChars; +} + +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/drawingml/hyperlinkcontext.cxx b/oox/source/drawingml/hyperlinkcontext.cxx new file mode 100644 index 000000000..352eb7bf5 --- /dev/null +++ b/oox/source/drawingml/hyperlinkcontext.cxx @@ -0,0 +1,166 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include "hyperlinkcontext.hxx" + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +using namespace ::oox::core; +using namespace ::com::sun::star::uno; +using namespace ::com::sun::star::xml::sax; + +namespace oox::drawingml { + +HyperLinkContext::HyperLinkContext( ContextHandler2Helper const & rParent, + const AttributeList& rAttribs, PropertyMap& aProperties ) + : ContextHandler2( rParent ) + , maProperties(aProperties) +{ + OUString sURL, sHref; + OUString aRelId = rAttribs.getString( R_TOKEN( id ) ).get(); + if ( !aRelId.isEmpty() ) + { + sHref = getRelations().getExternalTargetFromRelId( aRelId ); + if( !sHref.isEmpty() ) + { + sURL = getFilter().getAbsoluteUrl( sHref ); + } + else + { + // not sure if we also need to set sHref to the internal target + sURL = getRelations().getInternalTargetFromRelId( aRelId ); + } + } + OUString sTooltip = rAttribs.getString( R_TOKEN( tooltip ) ).get(); + if ( !sTooltip.isEmpty() ) + maProperties.setProperty(PROP_Representation, sTooltip); + OUString sFrame = rAttribs.getString( R_TOKEN( tgtFrame ) ).get(); + if( !sFrame.isEmpty() ) + maProperties.setProperty(PROP_TargetFrame, sFrame); + OUString aAction = rAttribs.getString( XML_action ).get(); + if ( !aAction.isEmpty() ) + { + // reserved values of the unrestricted string aAction: + // ppaction://customshow?id=SHOW_ID // custom presentation + // ppaction://hlinkfile // external file via r:id + // ppaction://hlinkpres?slideindex=SLIDE_NUM // external presentation via r:id + // ppaction://hlinkshowjump?jump=endshow + // ppaction://hlinkshowjump?jump=firstslide + // ppaction://hlinkshowjump?jump=lastslide + // ppaction://hlinkshowjump?jump=lastslideviewed + // ppaction://hlinkshowjump?jump=nextslide + // ppaction://hlinkshowjump?jump=previousslide + // ppaction://hlinksldjump + // ppaction://macro?name=MACRO_NAME + // ppaction://program + + static const OUStringLiteral sPPAction( u"ppaction://" ); + if ( aAction.matchIgnoreAsciiCase( sPPAction ) ) + { + OUString aPPAct( aAction.copy( sPPAction.getLength() ) ); + sal_Int32 nIndex = aPPAct.indexOf( '?' ); + OUString aPPAction( nIndex > 0 ? aPPAct.copy( 0, nIndex ) : aPPAct ); + + if ( aPPAction.match( "hlinkshowjump" ) ) + { + static const OUStringLiteral sJump( u"jump=" ); + if ( aPPAct.match( sJump, nIndex + 1 ) ) + { + std::u16string_view aDestination( aPPAct.subView( nIndex + 1 + sJump.getLength() ) ); + sURL += OUString::Concat("#action?jump=") + aDestination; + } + } + else if ( aPPAction.match( "hlinksldjump" ) ) + { + sHref = sURL; + + sal_Int32 nIndex2 = 0; + while ( nIndex2 < sHref.getLength() ) + { + sal_Unicode nChar = sHref[ nIndex2 ]; + if ( ( nChar >= '0' ) && ( nChar <= '9' ) ) + break; + nIndex2++; + } + if ( nIndex2 && ( nIndex2 != sHref.getLength() ) ) + { + sal_Int32 nLength = 1; + while( ( nIndex2 + nLength ) < sHref.getLength() ) + { + sal_Unicode nChar = sHref[ nIndex2 + nLength ]; + if ( ( nChar < '0' ) || ( nChar > '9' ) ) + break; + nLength++; + } + sal_Int32 nPageNumber = o3tl::toInt32(sHref.subView( nIndex2, nLength )); + if ( nPageNumber ) + { + const OUString aSlideType( sHref.copy( 0, nIndex2 ) ); + if ( aSlideType.match( "slide" ) ) + sURL = "#Slide " + OUString::number( nPageNumber ); + else if ( aSlideType.match( "notesSlide" ) ) + sURL = "#Notes " + OUString::number( nPageNumber ); +// else: todo for other types such as notesMaster or slideMaster as they can't be referenced easily + } + } + } + } + } + if ( !sURL.isEmpty() ) + maProperties.setProperty(PROP_URL, sURL); + + // TODO unhandled + // XML_invalidUrl + // XML_history + // XML_highlightClick + // XML_endSnd +} + +HyperLinkContext::~HyperLinkContext() +{ +} + +ContextHandlerRef HyperLinkContext::onCreateContext( + ::sal_Int32 aElement, const AttributeList& ) +{ + switch( aElement ) + { + case A_TOKEN( extLst ): + maProperties.setProperty(PROP_CharColor, XML_fillcolor); + break; + case A_TOKEN( snd ): + // TODO use getEmbeddedWAVAudioFile() here + break; + } + + return this; +} + +} // namespace oox::drawingml + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/drawingml/hyperlinkcontext.hxx b/oox/source/drawingml/hyperlinkcontext.hxx new file mode 100644 index 000000000..6c7fe6c80 --- /dev/null +++ b/oox/source/drawingml/hyperlinkcontext.hxx @@ -0,0 +1,48 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_OOX_SOURCE_DRAWINGML_HYPERLINKCONTEXT_HXX +#define INCLUDED_OOX_SOURCE_DRAWINGML_HYPERLINKCONTEXT_HXX + +#include + +namespace oox { class PropertyMap; } + +namespace oox::drawingml { + +class HyperLinkContext final : public ::oox::core::ContextHandler2 +{ +public: + HyperLinkContext( + ::oox::core::ContextHandler2Helper const & rParent, + const ::oox::AttributeList& rAttribs, + PropertyMap& aProperties ); + virtual ~HyperLinkContext() override; + + virtual ::oox::core::ContextHandlerRef onCreateContext( ::sal_Int32 Element, const ::oox::AttributeList& rAttribs ) override; + +private: + PropertyMap& maProperties; +}; + +} // namespace oox::drawingml + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/drawingml/lineproperties.cxx b/oox/source/drawingml/lineproperties.cxx new file mode 100644 index 000000000..2d10e8287 --- /dev/null +++ b/oox/source/drawingml/lineproperties.cxx @@ -0,0 +1,538 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +using namespace ::com::sun::star; +using namespace ::com::sun::star::beans; +using namespace ::com::sun::star::drawing; + + +namespace oox::drawingml { + +namespace { + +void lclSetDashData( LineDash& orLineDash, sal_Int16 nDots, sal_Int32 nDotLen, + sal_Int16 nDashes, sal_Int32 nDashLen, sal_Int32 nDistance ) +{ + orLineDash.Dots = nDots; + orLineDash.DotLen = nDotLen; + orLineDash.Dashes = nDashes; + orLineDash.DashLen = nDashLen; + orLineDash.Distance = nDistance; +} + +/** Converts the specified preset dash to API dash. + */ +void lclConvertPresetDash(LineDash& orLineDash, sal_Int32 nPresetDash) +{ + switch( nPresetDash ) + { + case XML_dot: lclSetDashData( orLineDash, 1, 1, 0, 0, 3 ); break; + case XML_dash: lclSetDashData( orLineDash, 1, 4, 0, 0, 3 ); break; + case XML_dashDot: lclSetDashData( orLineDash, 1, 4, 1, 1, 3 ); break; + + case XML_lgDash: lclSetDashData( orLineDash, 1, 8, 0, 0, 3 ); break; + case XML_lgDashDot: lclSetDashData( orLineDash, 1, 8, 1, 1, 3 ); break; + case XML_lgDashDotDot: lclSetDashData( orLineDash, 1, 8, 2, 1, 3 ); break; + + case XML_sysDot: lclSetDashData( orLineDash, 1, 1, 0, 0, 1 ); break; + case XML_sysDash: lclSetDashData( orLineDash, 1, 3, 0, 0, 1 ); break; + case XML_sysDashDot: lclSetDashData( orLineDash, 1, 3, 1, 1, 1 ); break; + case XML_sysDashDotDot: lclSetDashData( orLineDash, 1, 3, 2, 1, 1 ); break; + + default: + OSL_FAIL( "lclConvertPresetDash - unsupported preset dash" ); + lclSetDashData( orLineDash, 1, 4, 0, 0, 3 ); + } + orLineDash.DotLen *= 100; + orLineDash.DashLen *= 100; + orLineDash.Distance *= 100; +} + +/** Converts the passed custom dash to API dash. rCustomDash should not be empty. + * We assume, that there exist only two length values and the distance is the same + * for all dashes. Other kind of dash stop sequences cannot be represented, neither + * in model nor in ODF. + */ +void lclConvertCustomDash(LineDash& orLineDash, const LineProperties::DashStopVector& rCustomDash) +{ + OSL_ASSERT(!rCustomDash.empty()); + // Assume all dash stops have the same sp values. + orLineDash.Distance = rCustomDash[0].second; + // First kind of dashes go to "Dots" + orLineDash.DotLen = rCustomDash[0].first; + orLineDash.Dots = 0; + for(const auto& rIt : rCustomDash) + { + if (rIt.first != orLineDash.DotLen) + break; + ++orLineDash.Dots; + } + // All others go to "Dashes", we cannot handle more than two kinds. + orLineDash.Dashes = rCustomDash.size() - orLineDash.Dots; + if (orLineDash.Dashes > 0) + orLineDash.DashLen = rCustomDash[orLineDash.Dots].first; + else + orLineDash.DashLen = 0; + + // convert to API, e.g. 123% is 123000 in MS Office and 123 in our API + orLineDash.DotLen = orLineDash.DotLen / 1000; + orLineDash.DashLen = orLineDash.DashLen / 1000; + orLineDash.Distance = orLineDash.Distance / 1000; +} + +/** LibreOffice uses value 0, if a length attribute is missing in the + * style definition, but treats it as 100%. + * LibreOffice uses absolute values in some style definitions. Try to + * reconstruct them from the imported relative values. + */ +void lclRecoverStandardDashStyles(LineDash& orLineDash, sal_Int32 nLineWidth) +{ + sal_uInt16 nDots = orLineDash.Dots; + sal_uInt16 nDashes = orLineDash.Dashes; + sal_uInt32 nDotLen = orLineDash.DotLen; + sal_uInt32 nDashLen = orLineDash.DashLen; + sal_uInt32 nDistance = orLineDash.Distance; + // Use same ersatz for hairline as in export. + double fWidthHelp = nLineWidth == 0 ? 26.95/100.0 : nLineWidth / 100.0; + // start with (var) cases, because they have no rounding problems + // "Fine Dashed", "Line Style 9" and "Dashed (var)" need no recover + if (nDots == 3 && nDotLen == 197 &&nDashes == 3 && nDashLen == 100 && nDistance == 100) + { // "3 Dashes 3 Dots (var)" + orLineDash.DashLen = 0; + } + else if (nDots == 1 && nDotLen == 100 && nDashes == 0 && nDistance == 50) + { // "Ultrafine Dotted (var)" + orLineDash.DotLen = 0; + } + else if (nDots == 2 && nDashes == 0 && nDotLen == nDistance + && std::abs(nDistance * fWidthHelp - 51.0) < fWidthHelp) + { // "Ultrafine Dashed" + orLineDash.Dots = 1; + orLineDash.DotLen = 51; + orLineDash.Dashes = 1; + orLineDash.DashLen = 51; + orLineDash.Distance = 51; + orLineDash.Style = orLineDash.Style == DashStyle_ROUNDRELATIVE ? DashStyle_ROUND : DashStyle_RECT; + } + else if (nDots == 2 && nDashes == 3 && std::abs(nDotLen * fWidthHelp - 51.0) < fWidthHelp + && std::abs(nDashLen * fWidthHelp - 254.0) < fWidthHelp + && std::abs(nDistance * fWidthHelp - 127.0) < fWidthHelp) + { // "Ultrafine 2 Dots 3 Dashes" + orLineDash.DotLen = 51; + orLineDash.DashLen = 254; + orLineDash.Distance = 127; + orLineDash.Style = orLineDash.Style == DashStyle_ROUNDRELATIVE ? DashStyle_ROUND : DashStyle_RECT; + } + else if (nDots == 1 && nDotLen == 100 && nDashes == 0 + && std::abs(nDistance * fWidthHelp - 457.0) < fWidthHelp) + { // "Fine Dotted" + orLineDash.DotLen = 0; + orLineDash.Distance = 457; + orLineDash.Style = orLineDash.Style == DashStyle_ROUNDRELATIVE ? DashStyle_ROUND : DashStyle_RECT; + } + else if (nDots == 1 && nDashes == 10 && nDashLen == 100 + && std::abs(nDistance * fWidthHelp - 152.0) < fWidthHelp) + { // "Line with Fine Dots" + orLineDash.DotLen = 2007; + orLineDash.DashLen = 0; + orLineDash.Distance = 152; + orLineDash.Style = orLineDash.Style == DashStyle_ROUNDRELATIVE ? DashStyle_ROUND : DashStyle_RECT; + } + else if (nDots == 2 && nDotLen == 100 && nDashes == 1 && nDashLen == nDistance + && std::abs(nDistance * fWidthHelp - 203.0) < fWidthHelp) + { // "2 Dots 1 Dash" + orLineDash.DotLen = 0; + orLineDash.DashLen = 203; + orLineDash.Distance = 203; + orLineDash.Style = orLineDash.Style == DashStyle_ROUNDRELATIVE ? DashStyle_ROUND : DashStyle_RECT; + } +} + +DashStyle lclGetDashStyle( sal_Int32 nToken ) +{ + OSL_ASSERT((nToken & sal_Int32(0xFFFF0000))==0); + // MS Office dashing is always relative to line width + switch( nToken ) + { + case XML_rnd: return DashStyle_ROUNDRELATIVE; + case XML_sq: return DashStyle_RECTRELATIVE; // default in OOXML + case XML_flat: return DashStyle_RECTRELATIVE; // default in MS Office + } + return DashStyle_RECTRELATIVE; +} + +LineCap lclGetLineCap( sal_Int32 nToken ) +{ + OSL_ASSERT((nToken & sal_Int32(0xFFFF0000))==0); + switch( nToken ) + { + case XML_rnd: return LineCap_ROUND; + case XML_sq: return LineCap_SQUARE; // default in OOXML + case XML_flat: return LineCap_BUTT; // default in MS Office + } + return LineCap_BUTT; +} + +LineJoint lclGetLineJoint( sal_Int32 nToken ) +{ + OSL_ASSERT((nToken & sal_Int32(0xFFFF0000))==0); + switch( nToken ) + { + case XML_round: return LineJoint_ROUND; + case XML_bevel: return LineJoint_BEVEL; + case XML_miter: return LineJoint_MITER; + } + return LineJoint_ROUND; +} + +const sal_Int32 OOX_ARROWSIZE_SMALL = 0; +const sal_Int32 OOX_ARROWSIZE_MEDIUM = 1; +const sal_Int32 OOX_ARROWSIZE_LARGE = 2; + +sal_Int32 lclGetArrowSize( sal_Int32 nToken ) +{ + OSL_ASSERT((nToken & sal_Int32(0xFFFF0000))==0); + switch( nToken ) + { + case XML_sm: return OOX_ARROWSIZE_SMALL; + case XML_med: return OOX_ARROWSIZE_MEDIUM; + case XML_lg: return OOX_ARROWSIZE_LARGE; + } + return OOX_ARROWSIZE_MEDIUM; +} + +void lclPushMarkerProperties( ShapePropertyMap& rPropMap, + const LineArrowProperties& rArrowProps, sal_Int32 nLineWidth, bool bLineEnd ) +{ + /* Store the marker polygon and the marker name in a single value, to be + able to pass both to the ShapePropertyMap::setProperty() function. */ + NamedValue aNamedMarker; + + OUStringBuffer aBuffer; + sal_Int32 nMarkerWidth = 0; + bool bMarkerCenter = false; + sal_Int32 nArrowType = rArrowProps.moArrowType.get( XML_none ); + OSL_ASSERT((nArrowType & sal_Int32(0xFFFF0000))==0); + switch( nArrowType ) + { + case XML_triangle: + aBuffer.append( "msArrowEnd" ); + break; + case XML_arrow: + aBuffer.append( "msArrowOpenEnd" ); + break; + case XML_stealth: + aBuffer.append( "msArrowStealthEnd" ); + break; + case XML_diamond: + aBuffer.append( "msArrowDiamondEnd" ); + bMarkerCenter = true; + break; + case XML_oval: + aBuffer.append( "msArrowOvalEnd" ); + bMarkerCenter = true; + break; + } + + if( !aBuffer.isEmpty() ) + { + bool bIsArrow = nArrowType == XML_arrow; + sal_Int32 nLength = lclGetArrowSize( rArrowProps.moArrowLength.get( XML_med ) ); + sal_Int32 nWidth = lclGetArrowSize( rArrowProps.moArrowWidth.get( XML_med ) ); + + sal_Int32 nNameIndex = nWidth * 3 + nLength + 1; + aBuffer.append( ' ' ).append( nNameIndex ); + if (bIsArrow) + { + // Arrow marker form depends also on line width + aBuffer.append(' ').append(nLineWidth); + } + OUString aMarkerName = aBuffer.makeStringAndClear(); + + double fArrowLength = 1.0; + switch( nLength ) + { + case OOX_ARROWSIZE_SMALL: fArrowLength = (bIsArrow ? 2.5 : 2.0); break; + case OOX_ARROWSIZE_MEDIUM: fArrowLength = (bIsArrow ? 3.5 : 3.0); break; + case OOX_ARROWSIZE_LARGE: fArrowLength = (bIsArrow ? 5.5 : 5.0); break; + } + double fArrowWidth = 1.0; + switch( nWidth ) + { + case OOX_ARROWSIZE_SMALL: fArrowWidth = (bIsArrow ? 2.5 : 2.0); break; + case OOX_ARROWSIZE_MEDIUM: fArrowWidth = (bIsArrow ? 3.5 : 3.0); break; + case OOX_ARROWSIZE_LARGE: fArrowWidth = (bIsArrow ? 5.5 : 5.0); break; + } + // set arrow width relative to line width + sal_Int32 nBaseLineWidth = ::std::max< sal_Int32 >( nLineWidth, 70 ); + nMarkerWidth = static_cast( fArrowWidth * nBaseLineWidth ); + + /* Test if the marker already exists in the marker table, do not + create it again in this case. If markers are inserted explicitly + instead by their name, the polygon will be created always. + TODO: this can be optimized by using a map. */ + if( !rPropMap.hasNamedLineMarkerInTable( aMarkerName ) ) + { + // pass X and Y as percentage to OOX_ARROW_POINT + auto OOX_ARROW_POINT = [fArrowLength, fArrowWidth]( double x, double y ) { return awt::Point( static_cast< sal_Int32 >( fArrowWidth * x ), static_cast< sal_Int32 >( fArrowLength * y ) ); }; + // tdf#100491 Arrow line marker, unlike other markers, depends on line width. + // So calculate width of half line (more convenient during drawing) taking into account + // further conversions/scaling done in OOX_ARROW_POINT and scaling to nMarkerWidth. + const double fArrowLineHalfWidth = ::std::max< double >( 100.0 * 0.5 * nLineWidth / nMarkerWidth, 1 ); + + ::std::vector< awt::Point > aPoints; + OSL_ASSERT((rArrowProps.moArrowType.get() & sal_Int32(0xFFFF0000))==0); + switch( rArrowProps.moArrowType.get() ) + { + case XML_triangle: + aPoints.push_back( OOX_ARROW_POINT( 50, 0 ) ); + aPoints.push_back( OOX_ARROW_POINT( 100, 100 ) ); + aPoints.push_back( OOX_ARROW_POINT( 0, 100 ) ); + aPoints.push_back( OOX_ARROW_POINT( 50, 0 ) ); + break; + case XML_arrow: + aPoints.push_back( OOX_ARROW_POINT( 50, 0 ) ); + aPoints.push_back( OOX_ARROW_POINT( 100, 100 - fArrowLineHalfWidth * 1.5) ); + aPoints.push_back( OOX_ARROW_POINT( 100 - fArrowLineHalfWidth * 1.5, 100 ) ); + aPoints.push_back( OOX_ARROW_POINT( 50.0 + fArrowLineHalfWidth, 5.5 * fArrowLineHalfWidth) ); + aPoints.push_back( OOX_ARROW_POINT( 50.0 + fArrowLineHalfWidth, 100 ) ); + aPoints.push_back( OOX_ARROW_POINT( 50.0 - fArrowLineHalfWidth, 100 ) ); + aPoints.push_back( OOX_ARROW_POINT( 50.0 - fArrowLineHalfWidth, 5.5 * fArrowLineHalfWidth) ); + aPoints.push_back( OOX_ARROW_POINT( fArrowLineHalfWidth * 1.5, 100 ) ); + aPoints.push_back( OOX_ARROW_POINT( 0, 100 - fArrowLineHalfWidth * 1.5) ); + aPoints.push_back( OOX_ARROW_POINT( 50, 0 ) ); + break; + case XML_stealth: + aPoints.push_back( OOX_ARROW_POINT( 50, 0 ) ); + aPoints.push_back( OOX_ARROW_POINT( 100, 100 ) ); + aPoints.push_back( OOX_ARROW_POINT( 50, 60 ) ); + aPoints.push_back( OOX_ARROW_POINT( 0, 100 ) ); + aPoints.push_back( OOX_ARROW_POINT( 50, 0 ) ); + break; + case XML_diamond: + aPoints.push_back( OOX_ARROW_POINT( 50, 0 ) ); + aPoints.push_back( OOX_ARROW_POINT( 100, 50 ) ); + aPoints.push_back( OOX_ARROW_POINT( 50, 100 ) ); + aPoints.push_back( OOX_ARROW_POINT( 0, 50 ) ); + aPoints.push_back( OOX_ARROW_POINT( 50, 0 ) ); + break; + case XML_oval: + aPoints.push_back( OOX_ARROW_POINT( 50, 0 ) ); + aPoints.push_back( OOX_ARROW_POINT( 75, 7 ) ); + aPoints.push_back( OOX_ARROW_POINT( 93, 25 ) ); + aPoints.push_back( OOX_ARROW_POINT( 100, 50 ) ); + aPoints.push_back( OOX_ARROW_POINT( 93, 75 ) ); + aPoints.push_back( OOX_ARROW_POINT( 75, 93 ) ); + aPoints.push_back( OOX_ARROW_POINT( 50, 100 ) ); + aPoints.push_back( OOX_ARROW_POINT( 25, 93 ) ); + aPoints.push_back( OOX_ARROW_POINT( 7, 75 ) ); + aPoints.push_back( OOX_ARROW_POINT( 0, 50 ) ); + aPoints.push_back( OOX_ARROW_POINT( 7, 25 ) ); + aPoints.push_back( OOX_ARROW_POINT( 25, 7 ) ); + aPoints.push_back( OOX_ARROW_POINT( 50, 0 ) ); + break; + } + + OSL_ENSURE( !aPoints.empty(), "lclPushMarkerProperties - missing arrow coordinates" ); + if( !aPoints.empty() ) + { + PolyPolygonBezierCoords aMarkerCoords; + aMarkerCoords.Coordinates = { comphelper::containerToSequence( aPoints ) }; + + ::std::vector< PolygonFlags > aFlags( aPoints.size(), PolygonFlags_NORMAL ); + aMarkerCoords.Flags = { comphelper::containerToSequence( aFlags ) }; + + aNamedMarker.Name = aMarkerName; + aNamedMarker.Value <<= aMarkerCoords; + } + } + else + { + /* Named marker object exists already in the marker table, pass + its name only. This will set the name as property value, but + does not create a new object in the marker table. */ + aNamedMarker.Name = aMarkerName; + } + } + + // push the properties (filled aNamedMarker.Name indicates valid marker) + if( aNamedMarker.Name.isEmpty() ) + return; + + if( bLineEnd ) + { + rPropMap.setProperty( ShapeProperty::LineEnd, aNamedMarker ); + rPropMap.setProperty( ShapeProperty::LineEndWidth, nMarkerWidth ); + rPropMap.setProperty( ShapeProperty::LineEndCenter, bMarkerCenter ); + } + else + { + rPropMap.setProperty( ShapeProperty::LineStart, aNamedMarker ); + rPropMap.setProperty( ShapeProperty::LineStartWidth, nMarkerWidth ); + rPropMap.setProperty( ShapeProperty::LineStartCenter, bMarkerCenter ); + } +} + +} // namespace + +void LineArrowProperties::assignUsed( const LineArrowProperties& rSourceProps ) +{ + moArrowType.assignIfUsed( rSourceProps.moArrowType ); + moArrowWidth.assignIfUsed( rSourceProps.moArrowWidth ); + moArrowLength.assignIfUsed( rSourceProps.moArrowLength ); +} + +void LineProperties::assignUsed( const LineProperties& rSourceProps ) +{ + maStartArrow.assignUsed( rSourceProps.maStartArrow ); + maEndArrow.assignUsed( rSourceProps.maEndArrow ); + maLineFill.assignUsed( rSourceProps.maLineFill ); + if( !rSourceProps.maCustomDash.empty() ) + maCustomDash = rSourceProps.maCustomDash; + moLineWidth.assignIfUsed( rSourceProps.moLineWidth ); + moPresetDash.assignIfUsed( rSourceProps.moPresetDash ); + moLineCompound.assignIfUsed( rSourceProps.moLineCompound ); + moLineCap.assignIfUsed( rSourceProps.moLineCap ); + moLineJoint.assignIfUsed( rSourceProps.moLineJoint ); +} + +void LineProperties::pushToPropMap( ShapePropertyMap& rPropMap, + const GraphicHelper& rGraphicHelper, ::Color nPhClr ) const +{ + // line fill type must exist, otherwise ignore other properties + if( !maLineFill.moFillType.has() ) + return; + + // line style (our core only supports none and solid) + drawing::LineStyle eLineStyle = (maLineFill.moFillType.get() == XML_noFill) ? drawing::LineStyle_NONE : drawing::LineStyle_SOLID; + + // line width in 1/100mm + sal_Int32 nLineWidth = getLineWidth(); // includes conversion from EMUs to 1/100mm + rPropMap.setProperty( ShapeProperty::LineWidth, nLineWidth ); + + // line cap type + LineCap eLineCap = moLineCap.has() ? lclGetLineCap( moLineCap.get() ) : LineCap_BUTT; + if( moLineCap.has() ) + rPropMap.setProperty( ShapeProperty::LineCap, eLineCap ); + + // create line dash from preset dash token or dash stop vector (not for invisible line) + if( (eLineStyle != drawing::LineStyle_NONE) && (moPresetDash.differsFrom( XML_solid ) || !maCustomDash.empty()) ) + { + LineDash aLineDash; + aLineDash.Style = lclGetDashStyle( moLineCap.get( XML_flat ) ); + + if(moPresetDash.differsFrom(XML_solid)) + lclConvertPresetDash(aLineDash, moPresetDash.get(XML_dash)); + else // !maCustomDash.empty() + { + lclConvertCustomDash(aLineDash, maCustomDash); + lclRecoverStandardDashStyles(aLineDash, nLineWidth); + } + + // In MS Office (2020) for preset dash style line caps round and square are included in dash length. + // For custom dash style round line cap is included, square line cap is added. In ODF line caps are + // always added to dash length. Tweak the length accordingly. + if (eLineCap == LineCap_ROUND || (eLineCap == LineCap_SQUARE && maCustomDash.empty())) + { + // Cannot use -100 because that results in 0 length in some cases and + // LibreOffice interprets 0 length as 100%. + if (aLineDash.DotLen >= 100 || aLineDash.DashLen >= 100) + aLineDash.Distance += 99; + if (aLineDash.DotLen >= 100) + aLineDash.DotLen -= 99; + if (aLineDash.DashLen >= 100) + aLineDash.DashLen -= 99; + } + + if( rPropMap.setProperty( ShapeProperty::LineDash, aLineDash ) ) + eLineStyle = drawing::LineStyle_DASH; + } + + // set final line style property + rPropMap.setProperty( ShapeProperty::LineStyle, eLineStyle ); + + // line joint type + if( moLineJoint.has() ) + rPropMap.setProperty( ShapeProperty::LineJoint, lclGetLineJoint( moLineJoint.get() ) ); + + // line color and transparence + Color aLineColor = maLineFill.getBestSolidColor(); + if( aLineColor.isUsed() ) + { + rPropMap.setProperty( ShapeProperty::LineColor, aLineColor.getColor( rGraphicHelper, nPhClr ) ); + if( aLineColor.hasTransparency() ) + rPropMap.setProperty( ShapeProperty::LineTransparency, aLineColor.getTransparency() ); + } + + // line markers + lclPushMarkerProperties( rPropMap, maStartArrow, nLineWidth, false ); + lclPushMarkerProperties( rPropMap, maEndArrow, nLineWidth, true ); +} + +drawing::LineStyle LineProperties::getLineStyle() const +{ + // rules to calculate the line style inferred from the code in LineProperties::pushToPropMap + return (maLineFill.moFillType.get() == XML_noFill) ? + drawing::LineStyle_NONE : + (moPresetDash.differsFrom( XML_solid ) || (!moPresetDash && !maCustomDash.empty())) ? + drawing::LineStyle_DASH : + drawing::LineStyle_SOLID; +} + +drawing::LineCap LineProperties::getLineCap() const +{ + if( moLineCap.has() ) + return lclGetLineCap( moLineCap.get() ); + + return drawing::LineCap_BUTT; +} + +drawing::LineJoint LineProperties::getLineJoint() const +{ + if( moLineJoint.has() ) + return lclGetLineJoint( moLineJoint.get() ); + + return drawing::LineJoint_NONE; +} + +sal_Int32 LineProperties::getLineWidth() const +{ + return convertEmuToHmm( moLineWidth.get( 0 ) ); +} + +} // namespace oox + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/drawingml/linepropertiescontext.cxx b/oox/source/drawingml/linepropertiescontext.cxx new file mode 100644 index 000000000..19f713421 --- /dev/null +++ b/oox/source/drawingml/linepropertiescontext.cxx @@ -0,0 +1,137 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include +#include +#include +#include +#include +#include + +using namespace ::oox::core; +using namespace ::com::sun::star::uno; +using namespace ::com::sun::star::xml::sax; + +// CT_LineProperties + +namespace oox::drawingml { + +LinePropertiesContext::LinePropertiesContext( ContextHandler2Helper const & rParent, const AttributeList& rAttribs, + LineProperties& rLineProperties ) noexcept +: ContextHandler2( rParent ) +, mrLineProperties( rLineProperties ) +{ + mrLineProperties.moLineWidth = rAttribs.getInteger( XML_w ); + mrLineProperties.moLineCompound = rAttribs.getToken( XML_cmpd ); + mrLineProperties.moLineCap = rAttribs.getToken( XML_cap ); +} + +LinePropertiesContext::~LinePropertiesContext() +{ +} + +ContextHandlerRef LinePropertiesContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ) +{ + switch( nElement ) + { + // LineFillPropertiesGroup + case A_TOKEN( noFill ): + case A_TOKEN( solidFill ): + case A_TOKEN( gradFill ): + case A_TOKEN( pattFill ): + return FillPropertiesContext::createFillContext( *this, nElement, rAttribs, mrLineProperties.maLineFill ); + break; + + // LineDashPropertiesGroup + case A_TOKEN( prstDash ): // CT_PresetLineDashProperties + mrLineProperties.moPresetDash = rAttribs.getToken( XML_val ); + break; + case A_TOKEN( custDash ): // CT_DashStopList + return this; + case A_TOKEN( ds ): + { + // 'a:ds' has 2 attributes : 'd' and 'sp' + // both are of type 'a:ST_PositivePercentage' + // according to the specs Office will read percentages formatted with a trailing percent sign + // or formatted as 1000th of a percent without a trailing percent sign, but only write percentages + // as 1000th's of a percent without a trailing percent sign. + // The code below takes care of both scenarios by converting to '1000th of a percent' always + OUString aStr; + sal_Int32 nDash = 0; + aStr = rAttribs.getString( XML_d, "" ); + if ( aStr.endsWith("%") ) + { + // Ends with a '%' + aStr = aStr.copy(0, aStr.getLength() - 1); + aStr = aStr.trim(); + nDash = aStr.toInt32(); + + // Convert to 1000th of a percent + nDash *= 1000; + } + else + { + nDash = rAttribs.getInteger( XML_d, 0 ); + } + + sal_Int32 nSp = 0; + aStr = rAttribs.getString( XML_sp, "" ); + if ( aStr.endsWith("%") ) + { + // Ends with a '%' + aStr = aStr.copy(0, aStr.getLength() - 1); + aStr = aStr.trim(); + nSp = aStr.toInt32(); + + // Convert to 1000th of a percent + nSp *= 1000; + } + else + { + nSp = rAttribs.getInteger( XML_sp, 0 ); + } + + mrLineProperties.maCustomDash.emplace_back( nDash, nSp ); + } + break; + + // LineJoinPropertiesGroup + case A_TOKEN( round ): + case A_TOKEN( bevel ): + case A_TOKEN( miter ): + mrLineProperties.moLineJoint = getBaseToken( nElement ); + break; + + case A_TOKEN( headEnd ): // CT_LineEndProperties + case A_TOKEN( tailEnd ): // CT_LineEndProperties + { // ST_LineEndType + bool bTailEnd = nElement == A_TOKEN( tailEnd ); + LineArrowProperties& rArrowProps = bTailEnd ? mrLineProperties.maEndArrow : mrLineProperties.maStartArrow; + rArrowProps.moArrowType = rAttribs.getToken( XML_type ); + rArrowProps.moArrowWidth = rAttribs.getToken( XML_w ); + rArrowProps.moArrowLength = rAttribs.getToken( XML_len ); + } + break; + } + return nullptr; +} + +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/drawingml/misccontexts.cxx b/oox/source/drawingml/misccontexts.cxx new file mode 100644 index 000000000..66d92ec06 --- /dev/null +++ b/oox/source/drawingml/misccontexts.cxx @@ -0,0 +1,386 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +using namespace ::com::sun::star; +using namespace ::com::sun::star::uno; +using namespace ::com::sun::star::xml::sax; +using ::oox::core::ContextHandler2; +using ::oox::core::ContextHandlerRef; + +namespace oox::drawingml { + +SolidFillContext::SolidFillContext( ContextHandler2Helper const & rParent, + FillProperties& rFillProps ) : + ColorContext( rParent, rFillProps.maFillColor ) +{ +} + +GradientFillContext::GradientFillContext( ContextHandler2Helper const & rParent, + const AttributeList& rAttribs, GradientFillProperties& rGradientProps ) : + ContextHandler2( rParent ), + mrGradientProps( rGradientProps ) +{ + mrGradientProps.moShadeFlip = rAttribs.getToken( XML_flip ); + mrGradientProps.moRotateWithShape = rAttribs.getBool( XML_rotWithShape ); +} + +ContextHandlerRef GradientFillContext::onCreateContext( + sal_Int32 nElement, const AttributeList& rAttribs ) +{ + switch( nElement ) + { + case A_TOKEN( gsLst ): + return this; // for gs elements + + case A_TOKEN( gs ): + if( rAttribs.hasAttribute( XML_pos ) ) + { + double fPosition = getLimitedValue< double >( rAttribs.getDouble( XML_pos, 0.0 ) / 100000.0, 0.0, 1.0 ); + auto aElement = mrGradientProps.maGradientStops.emplace( fPosition, Color() ); + return new ColorContext( *this, aElement->second ); + } + break; + + case A_TOKEN( lin ): + mrGradientProps.moShadeAngle = rAttribs.getInteger( XML_ang ); + mrGradientProps.moShadeScaled = rAttribs.getBool( XML_scaled ); + break; + + case A_TOKEN( path ): + // always set a path type, this disables linear gradient in conversion + mrGradientProps.moGradientPath = rAttribs.getToken( XML_path, XML_rect ); + return this; // for fillToRect element + + case A_TOKEN( fillToRect ): + mrGradientProps.moFillToRect = GetRelativeRect( rAttribs.getFastAttributeList() ); + break; + + case A_TOKEN( tileRect ): + mrGradientProps.moTileRect = GetRelativeRect( rAttribs.getFastAttributeList() ); + break; + } + return nullptr; +} + +PatternFillContext::PatternFillContext( ContextHandler2Helper const & rParent, + const AttributeList& rAttribs, PatternFillProperties& rPatternProps ) : + ContextHandler2( rParent ), + mrPatternProps( rPatternProps ) +{ + mrPatternProps.moPattPreset = rAttribs.getToken( XML_prst ); +} + +ContextHandlerRef PatternFillContext::onCreateContext( + sal_Int32 nElement, const AttributeList& ) +{ + switch( nElement ) + { + case A_TOKEN( bgClr ): + return new ColorContext( *this, mrPatternProps.maPattBgColor ); + case A_TOKEN( fgClr ): + return new ColorContext( *this, mrPatternProps.maPattFgColor ); + } + return nullptr; +} + +ColorChangeContext::ColorChangeContext( ContextHandler2Helper const & rParent, + const AttributeList& rAttribs, BlipFillProperties& rBlipProps ) : + ContextHandler2( rParent ), + mrBlipProps( rBlipProps ) +{ + mrBlipProps.maColorChangeFrom.setUnused(); + mrBlipProps.maColorChangeTo.setUnused(); + mbUseAlpha = rAttribs.getBool( XML_useA, true ); +} + +ColorChangeContext::~ColorChangeContext() +{ + if( !mbUseAlpha ) + mrBlipProps.maColorChangeTo.clearTransparence(); +} + +ContextHandlerRef ColorChangeContext::onCreateContext( + sal_Int32 nElement, const AttributeList& ) +{ + switch( nElement ) + { + case A_TOKEN( clrFrom ): + return new ColorContext( *this, mrBlipProps.maColorChangeFrom ); + case A_TOKEN( clrTo ): + return new ColorContext( *this, mrBlipProps.maColorChangeTo ); + } + return nullptr; +} + +BlipContext::BlipContext( ContextHandler2Helper const & rParent, + const AttributeList& rAttribs, BlipFillProperties& rBlipProps ) : + ContextHandler2( rParent ), + mrBlipProps( rBlipProps ) +{ + if( rAttribs.hasAttribute( R_TOKEN( embed ) ) ) + { + // internal picture URL + OUString aFragmentPath = getFragmentPathFromRelId( rAttribs.getString( R_TOKEN( embed ), OUString() ) ); + if (!aFragmentPath.isEmpty()) + mrBlipProps.mxFillGraphic = getFilter().getGraphicHelper().importEmbeddedGraphic( aFragmentPath ); + } + else if( rAttribs.hasAttribute( R_TOKEN( link ) ) ) + { + // external URL + + // we will embed this link, this is better than just doing nothing... + // TODO: import this graphic as real link, but this requires some + // code rework. + OUString aRelId = rAttribs.getString( R_TOKEN( link ), OUString() ); + OUString aTargetLink = getFilter().getAbsoluteUrl( getRelations().getExternalTargetFromRelId( aRelId ) ); + GraphicExternalLink aLink(aTargetLink); + Graphic aGraphic(aLink); + mrBlipProps.mxFillGraphic = aGraphic.GetXGraphic(); + } +} + +ContextHandlerRef BlipContext::onCreateContext( + sal_Int32 nElement, const AttributeList& rAttribs ) +{ + switch( nElement ) + { + case A_TOKEN( biLevel ): + mrBlipProps.moBiLevelThreshold = rAttribs.getInteger( XML_thresh ); + mrBlipProps.moColorEffect = getBaseToken(nElement); + break; + + case A_TOKEN( grayscl ): + mrBlipProps.moColorEffect = getBaseToken( nElement ); + break; + + case A_TOKEN( clrChange ): + return new ColorChangeContext( *this, rAttribs, mrBlipProps ); + + case A_TOKEN( duotone ): + return new DuotoneContext( *this, mrBlipProps ); + + case A_TOKEN( extLst ): + return new BlipExtensionContext( *this, mrBlipProps ); + + case A_TOKEN( lum ): + mrBlipProps.moBrightness = rAttribs.getInteger( XML_bright ); + mrBlipProps.moContrast = rAttribs.getInteger( XML_contrast ); + break; + case A_TOKEN( alphaModFix ): + mrBlipProps.moAlphaModFix = rAttribs.getInteger(XML_amt); + break; + } + return nullptr; +} + +DuotoneContext::DuotoneContext( ContextHandler2Helper const & rParent, + BlipFillProperties& rBlipProps ) : + ContextHandler2( rParent ), + mrBlipProps( rBlipProps ), + mnColorIndex( 0 ) +{ + mrBlipProps.maDuotoneColors[0].setUnused(); + mrBlipProps.maDuotoneColors[1].setUnused(); +} + +DuotoneContext::~DuotoneContext() +{ +} + +::oox::core::ContextHandlerRef DuotoneContext::onCreateContext( + sal_Int32 /*nElement*/, const AttributeList& /*rAttribs*/ ) +{ + if( mnColorIndex < 2 ) + return new ColorValueContext( *this, mrBlipProps.maDuotoneColors[mnColorIndex++] ); + return nullptr; +} + +BlipFillContext::BlipFillContext( ContextHandler2Helper const & rParent, + const AttributeList& rAttribs, BlipFillProperties& rBlipProps ) : + ContextHandler2( rParent ), + mrBlipProps( rBlipProps ) +{ + mrBlipProps.moRotateWithShape = rAttribs.getBool( XML_rotWithShape ); +} + +ContextHandlerRef BlipFillContext::onCreateContext( + sal_Int32 nElement, const AttributeList& rAttribs ) +{ + switch( nElement ) + { + case A_TOKEN( blip ): + return new BlipContext( *this, rAttribs, mrBlipProps ); + + case A_TOKEN( srcRect ): + mrBlipProps.moClipRect = GetRelativeRect( rAttribs.getFastAttributeList() ); + break; + + case A_TOKEN( tile ): + mrBlipProps.moBitmapMode = getBaseToken( nElement ); + mrBlipProps.moTileOffsetX = rAttribs.getInteger( XML_tx ); + mrBlipProps.moTileOffsetY = rAttribs.getInteger( XML_ty ); + mrBlipProps.moTileScaleX = rAttribs.getInteger( XML_sx ); + mrBlipProps.moTileScaleY = rAttribs.getInteger( XML_sy ); + mrBlipProps.moTileAlign = rAttribs.getToken( XML_algn ); + mrBlipProps.moTileFlip = rAttribs.getToken( XML_flip ); + break; + + case A_TOKEN( stretch ): + mrBlipProps.moBitmapMode = getBaseToken( nElement ); + return this; // for fillRect element + + case A_TOKEN( fillRect ): + mrBlipProps.moFillRect = GetRelativeRect( rAttribs.getFastAttributeList() ); + break; + } + return nullptr; +} + +FillPropertiesContext::FillPropertiesContext( ContextHandler2Helper const & rParent, FillProperties& rFillProps ) : + ContextHandler2( rParent ), + mrFillProps( rFillProps ) +{ +} + +ContextHandlerRef FillPropertiesContext::onCreateContext( + sal_Int32 nElement, const AttributeList& rAttribs ) +{ + return createFillContext( *this, nElement, rAttribs, mrFillProps ); +} + +ContextHandlerRef FillPropertiesContext::createFillContext( + ContextHandler2Helper const & rParent, sal_Int32 nElement, + const AttributeList& rAttribs, FillProperties& rFillProps ) +{ + switch( nElement ) + { + case A_TOKEN( noFill ): { rFillProps.moFillType = getBaseToken( nElement ); return nullptr; }; + case A_TOKEN( solidFill ): { rFillProps.moFillType = getBaseToken( nElement ); return new SolidFillContext( rParent, rFillProps ); }; + case A_TOKEN( gradFill ): { rFillProps.moFillType = getBaseToken( nElement ); return new GradientFillContext( rParent, rAttribs, rFillProps.maGradientProps ); }; + case A_TOKEN( pattFill ): { rFillProps.moFillType = getBaseToken( nElement ); return new PatternFillContext( rParent, rAttribs, rFillProps.maPatternProps ); }; + case A_TOKEN( blipFill ): { rFillProps.moFillType = getBaseToken( nElement ); return new BlipFillContext( rParent, rAttribs, rFillProps.maBlipProps ); }; + case A_TOKEN( grpFill ): { rFillProps.moFillType = getBaseToken( nElement ); return nullptr; }; // TODO + } + return nullptr; +} + +SimpleFillPropertiesContext::SimpleFillPropertiesContext( ContextHandler2Helper const & rParent, Color& rColor ) : + FillPropertiesContext( rParent, *this ), + mrColor( rColor ) +{ +} + +SimpleFillPropertiesContext::~SimpleFillPropertiesContext() +{ + mrColor = getBestSolidColor(); +} + +BlipExtensionContext::BlipExtensionContext( ContextHandler2Helper const & rParent, BlipFillProperties& rBlipProps ) : + ContextHandler2( rParent ), + mrBlipProps( rBlipProps ) +{ +} + +BlipExtensionContext::~BlipExtensionContext() +{ +} + +ContextHandlerRef BlipExtensionContext::onCreateContext( + sal_Int32 nElement, const AttributeList& ) +{ + switch( nElement ) + { + case A_TOKEN( ext ): + return new BlipExtensionContext( *this, mrBlipProps ); + + case OOX_TOKEN( a14, imgProps ): + return new ArtisticEffectContext( *this, mrBlipProps.maEffect ); + } + return nullptr; +} + +ArtisticEffectContext::ArtisticEffectContext( ContextHandler2Helper const & rParent, ArtisticEffectProperties& rEffect ) : + ContextHandler2( rParent ), + maEffect( rEffect ) +{ +} + +ArtisticEffectContext::~ArtisticEffectContext() +{ +} + +ContextHandlerRef ArtisticEffectContext::onCreateContext( + sal_Int32 nElement, const AttributeList& rAttribs ) +{ + // containers + if( nElement == OOX_TOKEN( a14, imgLayer ) ) + { + if( rAttribs.hasAttribute( R_TOKEN( embed ) ) ) + { + OUString aFragmentPath = getFragmentPathFromRelId( rAttribs.getString( R_TOKEN( embed ), OUString() ) ); + if( !aFragmentPath.isEmpty() ) + { + getFilter().importBinaryData( maEffect.mrOleObjectInfo.maEmbeddedData, aFragmentPath ); + maEffect.mrOleObjectInfo.maProgId = aFragmentPath; + } + } + return new ArtisticEffectContext( *this, maEffect ); + } + if( nElement == OOX_TOKEN( a14, imgEffect ) ) + return new ArtisticEffectContext( *this, maEffect ); + + // effects + maEffect.msName = ArtisticEffectProperties::getEffectString( nElement ); + if( maEffect.isEmpty() ) + return nullptr; + + // effect attributes + sal_Int32 const aAttribs[19] = { + XML_visible, XML_trans, XML_crackSpacing, XML_pressure, XML_numberOfShades, + XML_grainSize, XML_intensity, XML_smoothness, XML_gridSize, XML_pencilSize, + XML_size, XML_brushSize, XML_scaling, XML_detail, XML_bright, XML_contrast, + XML_colorTemp, XML_sat, XML_amount + }; + for(sal_Int32 nAttrib : aAttribs) + { + if( rAttribs.hasAttribute( nAttrib ) ) + { + OUString sName = ArtisticEffectProperties::getEffectString( nAttrib ); + if( !sName.isEmpty() ) + maEffect.maAttribs[sName] <<= rAttribs.getInteger( nAttrib, 0 ); + } + } + + return nullptr; +} + +} // namespace oox::drawingml + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/drawingml/objectdefaultcontext.cxx b/oox/source/drawingml/objectdefaultcontext.cxx new file mode 100644 index 000000000..bdb30090e --- /dev/null +++ b/oox/source/drawingml/objectdefaultcontext.cxx @@ -0,0 +1,53 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include +#include +#include +#include + +using namespace ::oox::core; +using namespace ::com::sun::star::uno; +using namespace ::com::sun::star::xml::sax; + +namespace oox::drawingml { + +objectDefaultContext::objectDefaultContext( ContextHandler2Helper const & rParent, Theme& rTheme ) +: ContextHandler2( rParent ) +, mrTheme( rTheme ) +{ +} + +ContextHandlerRef objectDefaultContext::onCreateContext( sal_Int32 aElementToken, const AttributeList& /* rAttribs */ ) +{ + switch( aElementToken ) + { + case A_TOKEN( spDef ): + return new spDefContext( *this, mrTheme.getSpDef() ); + case A_TOKEN( lnDef ): + return new spDefContext( *this, mrTheme.getLnDef() ); + case A_TOKEN( txDef ): + return new spDefContext( *this, mrTheme.getTxDef() ); + } + return nullptr; +} + +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/drawingml/presetgeometrynames.cxx b/oox/source/drawingml/presetgeometrynames.cxx new file mode 100644 index 000000000..04dff605c --- /dev/null +++ b/oox/source/drawingml/presetgeometrynames.cxx @@ -0,0 +1,114 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#include +#include +#include +#include +#include +#include + +namespace +{ +typedef std::unordered_map + PresetGeometryHashMap; + +struct PresetGeometryName +{ + const char* pMsoName; + const char* pFontworkType; +}; + +const PresetGeometryName pPresetGeometryNameArray[] + = { { "textNoShape", "" }, + { "textPlain", "fontwork-plain-text" }, + { "textStop", "fontwork-stop" }, + { "textTriangle", "fontwork-triangle-up" }, + { "textTriangleInverted", "fontwork-triangle-down" }, + { "textChevron", "fontwork-chevron-up" }, + { "textChevronInverted", "fontwork-chevron-down" }, + { "textRingInside", "mso-spt142" }, + { "textRingOutside", "mso-spt143" }, + { "textArchUp", "fontwork-arch-up-curve" }, + { "textArchDown", "fontwork-arch-down-curve" }, + { "textCircle", "fontwork-circle-curve" }, + { "textButton", "fontwork-open-circle-curve" }, + { "textArchUpPour", "fontwork-arch-up-pour" }, + { "textArchDownPour", "fontwork-arch-down-pour" }, + { "textCirclePour", "fontwork-circle-pour" }, + { "textButtonPour", "fontwork-open-circle-pour" }, + { "textCurveUp", "fontwork-curve-up" }, + { "textCurveDown", "fontwork-curve-down" }, + { "textCanUp", "mso-spt174" }, + { "textCanDown", "mso-spt175" }, + { "textWave1", "fontwork-wave" }, + { "textWave2", "mso-spt157" }, + { "textDoubleWave1", "mso-spt158" }, + { "textWave4", "mso-spt159" }, + { "textInflate", "fontwork-inflate" }, + { "textDeflate", "mso-spt161" }, + { "textInflateBottom", "mso-spt162" }, + { "textDeflateBottom", "mso-spt163" }, + { "textInflateTop", "mso-spt164" }, + { "textDeflateTop", "mso-spt165" }, + { "textDeflateInflate", "mso-spt166" }, + { "textDeflateInflateDeflate", "mso-spt167" }, + { "textFadeRight", "fontwork-fade-right" }, + { "textFadeLeft", "fontwork-fade-left" }, + { "textFadeUp", "fontwork-fade-up" }, + { "textFadeDown", "fontwork-fade-down" }, + { "textSlantUp", "fontwork-slant-up" }, + { "textSlantDown", "fontwork-slant-down" }, + { "textCascadeUp", "fontwork-fade-up-and-right" }, + { "textCascadeDown", "fontwork-fade-up-and-left" } }; +} + +OUString PresetGeometryTypeNames::GetFontworkType(const OUString& rMsoType) +{ + static const PresetGeometryHashMap s_HashMap = []() { + PresetGeometryHashMap aH; + for (const auto& item : pPresetGeometryNameArray) + aH[item.pMsoName] = item.pFontworkType; + return aH; + }(); + const char* pRetValue = ""; + int i, nLen = rMsoType.getLength(); + std::unique_ptr pBuf(new char[nLen + 1]); + for (i = 0; i < nLen; i++) + pBuf[i] = static_cast(rMsoType[i]); + pBuf[i] = 0; + PresetGeometryHashMap::const_iterator aHashIter(s_HashMap.find(pBuf.get())); + if (aHashIter != s_HashMap.end()) + pRetValue = (*aHashIter).second; + + return OUString(pRetValue, strlen(pRetValue), RTL_TEXTENCODING_ASCII_US); +} + +OUString PresetGeometryTypeNames::GetMsoName(const OUString& rFontworkType) +{ + static const PresetGeometryHashMap s_HashMapInv = []() { + PresetGeometryHashMap aHInv; + for (const auto& item : pPresetGeometryNameArray) + aHInv[item.pFontworkType] = item.pMsoName; + return aHInv; + }(); + const char* pRetValue = ""; + int i, nLen = rFontworkType.getLength(); + std::unique_ptr pBuf(new char[nLen + 1]); + for (i = 0; i < nLen; i++) + pBuf[i] = static_cast(rFontworkType[i]); + pBuf[i] = 0; + PresetGeometryHashMap::const_iterator aHashIter(s_HashMapInv.find(pBuf.get())); + if (aHashIter != s_HashMapInv.end()) + pRetValue = (*aHashIter).second; + + return OUString(pRetValue, strlen(pRetValue), RTL_TEXTENCODING_ASCII_US); +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/oox/source/drawingml/scene3dcontext.cxx b/oox/source/drawingml/scene3dcontext.cxx new file mode 100644 index 000000000..e17893472 --- /dev/null +++ b/oox/source/drawingml/scene3dcontext.cxx @@ -0,0 +1,189 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include +#include +#include +#include +#include + +using namespace ::oox::core; +using namespace ::com::sun::star; +using namespace ::com::sun::star::uno; +using namespace ::com::sun::star::xml::sax; + +namespace oox::drawingml { + +Scene3DPropertiesContext::Scene3DPropertiesContext( ContextHandler2Helper const & rParent, Shape3DProperties& r3DProperties ) noexcept +: ContextHandler2( rParent ) +, mr3DProperties( r3DProperties ) +{ +} + +ContextHandlerRef Scene3DPropertiesContext::onCreateContext( sal_Int32 aElementToken, const AttributeList& rAttribs ) +{ + switch( aElementToken ) + { + case A_TOKEN( camera ): + if( rAttribs.hasAttribute( XML_fov ) ) + mr3DProperties.mfFieldOfVision = rAttribs.getInteger( XML_fov, 0 ) / 60000.0; // 60000ths of degree + if( rAttribs.hasAttribute( XML_zoom ) ) + mr3DProperties.mfZoom = rAttribs.getInteger( XML_zoom, 100000 ) / 100000.0; + if( rAttribs.hasAttribute( XML_prst ) ) + mr3DProperties.mnPreset = rAttribs.getToken( XML_prst, XML_none ); + + return new Scene3DRotationPropertiesContext( *this, mr3DProperties.maCameraRotation ); + + case A_TOKEN( lightRig ): + mr3DProperties.mnLightRigDirection = rAttribs.getToken( XML_dir, XML_none ); + mr3DProperties.mnLightRigType = rAttribs.getToken( XML_rig, XML_none ); + + return new Scene3DRotationPropertiesContext( *this, mr3DProperties.maLightRigRotation ); + + case A_TOKEN( backdrop ): + case A_TOKEN( extLst ): + return nullptr; // TODO: later (backdrop is not supported by core anyway) + } + return nullptr; +} + +SceneText3DPropertiesContext::SceneText3DPropertiesContext( ContextHandler2Helper const & rParent, Text3DProperties& r3DProperties ) noexcept +: ContextHandler2( rParent ) +, mr3DProperties( r3DProperties ) +{ +} + +ContextHandlerRef SceneText3DPropertiesContext::onCreateContext( sal_Int32 aElementToken, const AttributeList& rAttribs ) +{ + switch( aElementToken ) + { + case A_TOKEN( camera ): + if( rAttribs.hasAttribute( XML_fov ) ) + mr3DProperties.mfFieldOfVision = rAttribs.getInteger( XML_fov, 0 ) / 60000.0; // 60000ths of degree + if( rAttribs.hasAttribute( XML_zoom ) ) + mr3DProperties.mfZoom = rAttribs.getInteger( XML_zoom, 100000 ) / 100000.0; + if( rAttribs.hasAttribute( XML_prst ) ) + mr3DProperties.mnPreset = rAttribs.getToken( XML_prst, XML_none ); + + return new Scene3DRotationPropertiesContext( *this, mr3DProperties.maCameraRotation ); + + case A_TOKEN( lightRig ): + mr3DProperties.mnLightRigDirection = rAttribs.getToken( XML_dir, XML_none ); + mr3DProperties.mnLightRigType = rAttribs.getToken( XML_rig, XML_none ); + + return new Scene3DRotationPropertiesContext( *this, mr3DProperties.maLightRigRotation ); + + case A_TOKEN( backdrop ): + case A_TOKEN( extLst ): + return nullptr; // TODO: later (backdrop is not supported by core anyway) + + case A_TOKEN( bevelT ): + case A_TOKEN( bevelB ): + { + BevelProperties aProps; + if( rAttribs.hasAttribute( XML_w ) ) + aProps.mnWidth = rAttribs.getInteger( XML_w, 0 ); + if( rAttribs.hasAttribute( XML_h ) ) + aProps.mnHeight = rAttribs.getInteger( XML_h, 0 ); + if( rAttribs.hasAttribute( XML_prst ) ) + aProps.mnPreset = rAttribs.getToken( XML_prst, XML_none ); + + if( aElementToken == A_TOKEN( bevelT ) ) + mr3DProperties.maTopBevelProperties.set( aProps ); + else + mr3DProperties.maBottomBevelProperties.set( aProps ); + break; + } + + case A_TOKEN( extrusionClr ): + return new ColorContext( *this, mr3DProperties.maExtrusionColor ); + + case A_TOKEN( contourClr ): + return new ColorContext( *this, mr3DProperties.maContourColor ); + } + return nullptr; +} + +Shape3DPropertiesContext::Shape3DPropertiesContext( ContextHandler2Helper const & rParent, const AttributeList& rAttribs, Shape3DProperties& r3DProperties ) noexcept +: ContextHandler2( rParent ) +, mr3DProperties( r3DProperties ) +{ + if( rAttribs.hasAttribute( XML_extrusionH ) ) + mr3DProperties.mnExtrusionH = rAttribs.getInteger( XML_extrusionH, 0 ); + if( rAttribs.hasAttribute( XML_contourW ) ) + mr3DProperties.mnContourW = rAttribs.getInteger( XML_contourW, 0 ); + if( rAttribs.hasAttribute( XML_z ) ) + mr3DProperties.mnShapeZ = rAttribs.getInteger( XML_z, 0 ); + if( rAttribs.hasAttribute( XML_prstMaterial ) ) + mr3DProperties.mnMaterial = rAttribs.getToken( XML_prstMaterial, XML_none ); +} + +ContextHandlerRef Shape3DPropertiesContext::onCreateContext( sal_Int32 aElementToken, const AttributeList& rAttribs ) +{ + switch( aElementToken ) + { + case A_TOKEN( bevelT ): + case A_TOKEN( bevelB ): + { + BevelProperties aProps; + if( rAttribs.hasAttribute( XML_w ) ) + aProps.mnWidth = rAttribs.getInteger( XML_w, 0 ); + if( rAttribs.hasAttribute( XML_h ) ) + aProps.mnHeight = rAttribs.getInteger( XML_h, 0 ); + if( rAttribs.hasAttribute( XML_prst ) ) + aProps.mnPreset = rAttribs.getToken( XML_prst, XML_none ); + + if( aElementToken == A_TOKEN( bevelT ) ) + mr3DProperties.maTopBevelProperties.set( aProps ); + else + mr3DProperties.maBottomBevelProperties.set( aProps ); + + break; + } + case A_TOKEN( extrusionClr ): + return new ColorContext( *this, mr3DProperties.maExtrusionColor ); + + case A_TOKEN( contourClr ): + return new ColorContext( *this, mr3DProperties.maContourColor ); + } + return nullptr; +} + +Scene3DRotationPropertiesContext::Scene3DRotationPropertiesContext( ContextHandler2Helper const & rParent, RotationProperties& rRotationProperties ) noexcept +: ContextHandler2( rParent ) +, mrRotationProperties( rRotationProperties ) +{ +} + +ContextHandlerRef Scene3DRotationPropertiesContext::onCreateContext( sal_Int32 aElementToken, const AttributeList& rAttribs ) +{ + switch( aElementToken ) + { + case A_TOKEN( rot ): + mrRotationProperties.mnLatitude = rAttribs.getInteger( XML_lat, 0 ); + mrRotationProperties.mnLongitude = rAttribs.getInteger( XML_lon, 0 ); + mrRotationProperties.mnRevolution = rAttribs.getInteger( XML_rev, 0 ); + break; + } + return nullptr; +} + +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx new file mode 100644 index 000000000..8fefc18fd --- /dev/null +++ b/oox/source/drawingml/shape.cxx @@ -0,0 +1,2368 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include "effectproperties.hxx" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "diagram/datamodel.hxx" +#include "diagram/diagramhelper.hxx" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +using namespace ::oox::core; +using namespace ::com::sun::star; +using namespace ::com::sun::star::uno; +using namespace ::com::sun::star::beans; +using namespace ::com::sun::star::frame; +using namespace ::com::sun::star::text; +using namespace ::com::sun::star::drawing; +using namespace ::com::sun::star::style; + +namespace oox::drawingml { + +Shape::Shape( const char* pServiceName, bool bDefaultHeight ) +: mpLinePropertiesPtr( std::make_shared() ) +, mpShapeRefLinePropPtr( std::make_shared() ) +, mpFillPropertiesPtr( std::make_shared() ) +, mpShapeRefFillPropPtr( std::make_shared() ) +, mpGraphicPropertiesPtr( std::make_shared() ) +, mpCustomShapePropertiesPtr( std::make_shared() ) +, mp3DPropertiesPtr( std::make_shared() ) +, mpEffectPropertiesPtr( std::make_shared() ) +, mpShapeRefEffectPropPtr( std::make_shared() ) +, mpMasterTextListStyle( std::make_shared() ) +, mnSubType( 0 ) +, meFrameType( FRAMETYPE_GENERIC ) +, mnRotation( 0 ) +, mnDiagramRotation( 0 ) +, mbFlipH( false ) +, mbFlipV( false ) +, mbHidden( false ) +, mbHiddenMasterShape( false ) +, mbLocked( false ) +, mbWPGChild(false) +, mbLockedCanvas( false ) +, mbWps( false ) +, mbTextBox( false ) +, mbHasLinkedTxbx( false ) +, maDiagramDoms( 0 ) +, mpDiagramHelper( nullptr ) +{ + if ( pServiceName ) + msServiceName = OUString::createFromAscii( pServiceName ); + setDefaults(bDefaultHeight); +} + +Shape::Shape( const ShapePtr& pSourceShape ) +: mpTextBody(pSourceShape->mpTextBody) +, mpLinePropertiesPtr( pSourceShape->mpLinePropertiesPtr ) +, mpShapeRefLinePropPtr( pSourceShape->mpShapeRefLinePropPtr ) +, mpFillPropertiesPtr( pSourceShape->mpFillPropertiesPtr ) +, mpShapeRefFillPropPtr( pSourceShape->mpShapeRefFillPropPtr ) +, mpGraphicPropertiesPtr( pSourceShape->mpGraphicPropertiesPtr ) +, mpCustomShapePropertiesPtr( pSourceShape->mpCustomShapePropertiesPtr ) +, mpTablePropertiesPtr( pSourceShape->mpTablePropertiesPtr ) +, mp3DPropertiesPtr( pSourceShape->mp3DPropertiesPtr ) +, mpEffectPropertiesPtr (pSourceShape->mpEffectPropertiesPtr) +, mpShapeRefEffectPropPtr(pSourceShape->mpShapeRefEffectPropPtr) +, maShapeProperties( pSourceShape->maShapeProperties ) +, mpMasterTextListStyle( pSourceShape->mpMasterTextListStyle ) +, msServiceName( pSourceShape->msServiceName ) +, msName( pSourceShape->msName ) +, msInternalName( pSourceShape->msInternalName ) +, msId( pSourceShape->msId ) +, mnSubType( pSourceShape->mnSubType ) +, moSubTypeIndex( pSourceShape->moSubTypeIndex ) +, maShapeStyleRefs( pSourceShape->maShapeStyleRefs ) +, maSize( pSourceShape->maSize ) +, maPosition( pSourceShape->maPosition ) +, meFrameType( pSourceShape->meFrameType ) +, mnRotation( pSourceShape->mnRotation ) +, mnDiagramRotation( pSourceShape->mnDiagramRotation ) +, mbFlipH( pSourceShape->mbFlipH ) +, mbFlipV( pSourceShape->mbFlipV ) +, mbHidden( pSourceShape->mbHidden ) +, mbHiddenMasterShape( pSourceShape->mbHiddenMasterShape ) +, mbLocked( pSourceShape->mbLocked ) +, mbWPGChild( pSourceShape->mbWPGChild ) +, mbLockedCanvas( pSourceShape->mbLockedCanvas ) +, mbWps( pSourceShape->mbWps ) +, mbTextBox( pSourceShape->mbTextBox ) +, mbHasLinkedTxbx(false) +, maDiagramDoms( pSourceShape->maDiagramDoms ) +, mnZOrder(pSourceShape->mnZOrder) +, mnZOrderOff(pSourceShape->mnZOrderOff) +, mnDataNodeType(pSourceShape->mnDataNodeType) +, mfAspectRatio(pSourceShape->mfAspectRatio) +, mpDiagramHelper( nullptr ) +, msDiagramDataModelID(pSourceShape->msDiagramDataModelID) +{} + +Shape::~Shape() +{ + // DiagramHelper should not be set here anymore, see + // propagateDiagramHelper below (maybe assert..?) + delete mpDiagramHelper; +} + +void Shape::prepareDiagramHelper( + const std::shared_ptr< Diagram >& rDiagramPtr, + const std::shared_ptr<::oox::drawingml::Theme>& rTheme) +{ + // Prepare Diagram data collecting for this Shape + if( nullptr == mpDiagramHelper && FRAMETYPE_DIAGRAM == meFrameType ) + { + mpDiagramHelper = new AdvancedDiagramHelper( + rDiagramPtr, + rTheme, + getSize()); + } +} + +void Shape::propagateDiagramHelper() +{ + // Propagate collected Diagram data to data holder + if (FRAMETYPE_DIAGRAM == meFrameType && nullptr != mpDiagramHelper) + { + SdrObjGroup* pAnchorObj = dynamic_cast(SdrObject::getSdrObjectFromXShape(mxShape)); + + if(pAnchorObj) + { + static_cast(mpDiagramHelper)->doAnchor(*pAnchorObj, *this); + mpDiagramHelper = nullptr; + } + } + + // If propagation failed, delete/cleanup here. Since the DiagramHelper + // holds a Diagram and that this Shape it is necessary - the destructor + // will not be called and will be too late + if (nullptr != mpDiagramHelper) + { + delete mpDiagramHelper; + mpDiagramHelper = nullptr; + } +} + +void Shape::migrateDiagramHelperToNewShape(const ShapePtr& pTarget) +{ + if(!mpDiagramHelper) + { + return; + } + + if(!pTarget) + { + // no migrate target, but cleanup helper + delete mpDiagramHelper; + mpDiagramHelper = nullptr; + return; + } + + if(pTarget->mpDiagramHelper) + { + // this should no happen, but if there is already a helper, clean it up + delete pTarget->mpDiagramHelper; + pTarget->mpDiagramHelper = nullptr; + } + + // exchange and reset to nullptr + pTarget->mpDiagramHelper = mpDiagramHelper; + mpDiagramHelper = nullptr; +} + +table::TablePropertiesPtr const & Shape::getTableProperties() +{ + if ( !mpTablePropertiesPtr ) + mpTablePropertiesPtr = std::make_shared(); + return mpTablePropertiesPtr; +} + +void Shape::setDefaults(bool bHeight) +{ + maDefaultShapeProperties.setProperty(PROP_TextAutoGrowHeight, false); + maDefaultShapeProperties.setProperty(PROP_TextWordWrap, true); + maDefaultShapeProperties.setProperty(PROP_TextLeftDistance, static_cast< sal_Int32 >( 250 )); + maDefaultShapeProperties.setProperty(PROP_TextUpperDistance, static_cast< sal_Int32 >( 125 )); + maDefaultShapeProperties.setProperty(PROP_TextRightDistance, static_cast< sal_Int32 >( 250 )); + maDefaultShapeProperties.setProperty(PROP_TextLowerDistance, static_cast< sal_Int32 >( 125 )); + if (bHeight) + maDefaultShapeProperties.setProperty(PROP_CharHeight, static_cast< float >( 18.0 )); + maDefaultShapeProperties.setProperty(PROP_TextVerticalAdjust, TextVerticalAdjust_TOP); + maDefaultShapeProperties.setProperty(PROP_ParaAdjust, + static_cast(ParagraphAdjust_LEFT)); +} + +::oox::vml::OleObjectInfo& Shape::setOleObjectType() +{ + OSL_ENSURE( meFrameType == FRAMETYPE_GENERIC, "Shape::setOleObjectType - multiple frame types" ); + meFrameType = FRAMETYPE_OLEOBJECT; + mxOleObjectInfo = std::make_shared<::oox::vml::OleObjectInfo>( true ); + return *mxOleObjectInfo; +} + +ChartShapeInfo& Shape::setChartType( bool bEmbedShapes ) +{ + OSL_ENSURE( meFrameType == FRAMETYPE_GENERIC, "Shape::setChartType - multiple frame types" ); + meFrameType = FRAMETYPE_CHART; + if (mbWps) + msServiceName = "com.sun.star.drawing.temporaryForXMLImportOLE2Shape"; + else + msServiceName = "com.sun.star.drawing.OLE2Shape"; + mxChartShapeInfo = std::make_shared( bEmbedShapes ); + return *mxChartShapeInfo; +} + +void Shape::setDiagramType() +{ + OSL_ENSURE( meFrameType == FRAMETYPE_GENERIC, "Shape::setDiagramType - multiple frame types" ); + meFrameType = FRAMETYPE_DIAGRAM; + msServiceName = "com.sun.star.drawing.GroupShape"; + mnSubType = 0; +} + +void Shape::setTableType() +{ + OSL_ENSURE( meFrameType == FRAMETYPE_GENERIC, "Shape::setTableType - multiple frame types" ); + meFrameType = FRAMETYPE_TABLE; + msServiceName = "com.sun.star.drawing.TableShape"; + mnSubType = 0; +} + +void Shape::setServiceName( const char* pServiceName ) +{ + if ( pServiceName ) + msServiceName = OUString::createFromAscii( pServiceName ); +} + +const ShapeStyleRef* Shape::getShapeStyleRef( sal_Int32 nRefType ) const +{ + ShapeStyleRefMap::const_iterator aIt = maShapeStyleRefs.find( nRefType ); + return (aIt == maShapeStyleRefs.end()) ? nullptr : &aIt->second; +} + +void Shape::addShape( + ::oox::core::XmlFilterBase& rFilterBase, + const Theme* pTheme, + const Reference< XShapes >& rxShapes, + const basegfx::B2DHomMatrix& aTransformation, + const FillProperties& rShapeOrParentShapeFillProps, + ShapeIdMap* pShapeMap, + oox::drawingml::ShapePtr pParentGroupShape) +{ + SAL_INFO("oox.drawingml", "Shape::addShape: id='" << msId << "'"); + + try + { + OUString sServiceName( msServiceName ); + if( !sServiceName.isEmpty() ) + { + basegfx::B2DHomMatrix aMatrix( aTransformation ); + Reference< XShape > xShape( createAndInsert( rFilterBase, sServiceName, pTheme, rxShapes, false, false, aMatrix, rShapeOrParentShapeFillProps, pParentGroupShape) ); + + if( pShapeMap && !msId.isEmpty() ) + { + (*pShapeMap)[ msId ] = shared_from_this(); + } + + // if this is a group shape, we have to add also each child shape + Reference< XShapes > xShapes( xShape, UNO_QUERY ); + if ( xShapes.is() ) + addChildren( rFilterBase, *this, pTheme, xShapes, pShapeMap, aMatrix ); + + if (isWPGChild() && xShape) + { + // This is a wps shape and it is the child of the WPG, now copy the + // the text body properties to the xshape. + Reference xChildWPSProperties(xShape, uno::UNO_QUERY); + + if (getTextBody() && xChildWPSProperties) + { + xChildWPSProperties->setPropertyValue( + UNO_NAME_TEXT_VERTADJUST, + uno::Any(getTextBody()->getTextProperties().meVA)); + + xChildWPSProperties->setPropertyValue( + UNO_NAME_TEXT_LEFTDIST, + uno::Any(getTextBody()->getTextProperties().moInsets[0].has_value() + ? *getTextBody()->getTextProperties().moInsets[0] + : 0)); + xChildWPSProperties->setPropertyValue( + UNO_NAME_TEXT_UPPERDIST, + uno::Any(getTextBody()->getTextProperties().moInsets[1].has_value() + ? *getTextBody()->getTextProperties().moInsets[1] + : 0)); + xChildWPSProperties->setPropertyValue( + UNO_NAME_TEXT_RIGHTDIST, + uno::Any(getTextBody()->getTextProperties().moInsets[2].has_value() + ? *getTextBody()->getTextProperties().moInsets[2] + : 0)); + xChildWPSProperties->setPropertyValue( + UNO_NAME_TEXT_LOWERDIST, + uno::Any(getTextBody()->getTextProperties().moInsets[3].has_value() + ? *getTextBody()->getTextProperties().moInsets[3] + : 0)); + } + } + + if( meFrameType == FRAMETYPE_DIAGRAM ) + { + keepDiagramCompatibilityInfo(); + + // set DiagramHelper at SdrObjGroup + propagateDiagramHelper(); + + // Check if this is the PPTX import, so far converting SmartArt to a non-editable + // metafile is only implemented for DOCX. + bool bPowerPoint = dynamic_cast(&rFilterBase) != nullptr; + + if (!SvtFilterOptions::Get().IsSmartArt2Shape() && !bPowerPoint) + convertSmartArtToMetafile( rFilterBase ); + } + + NamedShapePairs* pNamedShapePairs = rFilterBase.getDiagramFontHeights(); + if (xShape.is() && pNamedShapePairs) + { + auto itPairs = pNamedShapePairs->find(getInternalName()); + if (itPairs != pNamedShapePairs->end()) + { + auto it = itPairs->second.find(shared_from_this()); + if (it != itPairs->second.end()) + { + // Our drawingml::Shape is in the list of an internal name, remember the now + // inserted XShape. + it->second = xShape; + } + } + } + } + } + catch( const Exception& ) + { + TOOLS_WARN_EXCEPTION( "oox.drawingml", "Shape::addShape" ); + } +} + +void Shape::setLockedCanvas(bool bLockedCanvas) +{ + mbLockedCanvas = bLockedCanvas; +} + +void Shape::setWPGChild(bool bWPG) +{ + mbWPGChild = bWPG; +} + +void Shape::setWps(bool bWps) +{ + mbWps = bWps; +} + +void Shape::setTextBox(bool bTextBox) +{ + mbTextBox = bTextBox; +} + +void Shape::applyShapeReference( const Shape& rReferencedShape, bool bUseText ) +{ + SAL_INFO("oox.drawingml", "Shape::applyShapeReference: apply '" << rReferencedShape.msId << "' to '" << msId << "'"); + + if ( rReferencedShape.mpTextBody && bUseText ) + mpTextBody = std::make_shared( *rReferencedShape.mpTextBody ); + else + mpTextBody.reset(); + maShapeProperties = rReferencedShape.maShapeProperties; + mpShapeRefLinePropPtr = std::make_shared( rReferencedShape.getActualLineProperties(nullptr) ); + mpShapeRefFillPropPtr = std::make_shared( rReferencedShape.getActualFillProperties(nullptr, nullptr) ); + mpCustomShapePropertiesPtr = std::make_shared( *rReferencedShape.mpCustomShapePropertiesPtr ); + mpTablePropertiesPtr = rReferencedShape.mpTablePropertiesPtr ? std::make_shared( *rReferencedShape.mpTablePropertiesPtr ) : nullptr; + mpShapeRefEffectPropPtr = std::make_shared( rReferencedShape.getActualEffectProperties(nullptr) ); + mpMasterTextListStyle = std::make_shared( *rReferencedShape.mpMasterTextListStyle ); + maSize = rReferencedShape.maSize; + maPosition = rReferencedShape.maPosition; + mnRotation = rReferencedShape.mnRotation; + mbFlipH = rReferencedShape.mbFlipH; + mbFlipV = rReferencedShape.mbFlipV; + mbHidden = rReferencedShape.mbHidden; + mbLocked = rReferencedShape.mbLocked; +} + +namespace { + +struct ActionLockGuard +{ + explicit ActionLockGuard(Reference const& xShape) + : m_xLockable(xShape, UNO_QUERY) + { + if (m_xLockable.is()) { + m_xLockable->addActionLock(); + } + } + ~ActionLockGuard() + { + if (m_xLockable.is()) { + m_xLockable->removeActionLock(); + } + } +private: + Reference m_xLockable; +}; + +} + +// for group shapes, the following method is also adding each child +void Shape::addChildren( + XmlFilterBase& rFilterBase, + Shape& rMaster, + const Theme* pTheme, + const Reference< XShapes >& rxShapes, + ShapeIdMap* pShapeMap, + const basegfx::B2DHomMatrix& aTransformation ) +{ + for (auto const& child : rMaster.maChildren) + { + child->setMasterTextListStyle( mpMasterTextListStyle ); + child->addShape( rFilterBase, pTheme, rxShapes, aTransformation, getFillProperties(), pShapeMap, rMaster.shared_from_this()); + } +} + +static void lcl_resetPropertyValue( std::vector& rPropVec, const OUString& rName ) +{ + auto aIterator = std::find_if( rPropVec.begin(), rPropVec.end(), + [rName]( const beans::PropertyValue& rValue ) { return rValue.Name == rName; } ); + + if (aIterator != rPropVec.end()) + rPropVec.erase( aIterator ); +} + +static void lcl_setPropertyValue( std::vector& rPropVec, + const OUString& rName, + const beans::PropertyValue& rPropertyValue ) +{ + lcl_resetPropertyValue( rPropVec, rName ); + + rPropVec.push_back( rPropertyValue ); +} + +static SdrTextHorzAdjust lcl_convertAdjust( ParagraphAdjust eAdjust ) +{ + if (eAdjust == ParagraphAdjust_LEFT) + return SDRTEXTHORZADJUST_LEFT; + else if (eAdjust == ParagraphAdjust_RIGHT) + return SDRTEXTHORZADJUST_RIGHT; + else if (eAdjust == ParagraphAdjust_CENTER) + return SDRTEXTHORZADJUST_CENTER; + return SDRTEXTHORZADJUST_LEFT; +} + +static void lcl_createPresetShape(const uno::Reference& xShape, + const OUString& rClass, const OUString& rPresetType, + const CustomShapePropertiesPtr& pCustomShapePropertiesPtr, + const TextBodyPtr& pTextBody, + const GraphicHelper& rGraphicHelper) +{ + if (!xShape.is() || !pCustomShapePropertiesPtr || !pTextBody) + return; + + uno::Reference xDefaulter( xShape, + uno::UNO_QUERY ); + + if (!xDefaulter.is() || rClass.isEmpty()) + return; + + Reference xSet( xShape, UNO_QUERY ); + if (!xSet.is()) + return; + + // The DrawingML shapes from the presetTextWarpDefinitions are mapped to the definitions + // in svx/../EnhancedCustomShapeGeometry.cxx, which are used for WordArt shapes from + // binary MS Office. Therefore all adjustment values need to be adapted. + auto aAdjGdList = pCustomShapePropertiesPtr->getAdjustmentGuideList(); + Sequence aAdjustment( + !aAdjGdList.empty() ? aAdjGdList.size() : 1 ); + auto pAdjustment = aAdjustment.getArray(); + int nIndex = 0; + for (const auto& aEntry : aAdjGdList) + { + double fValue = aEntry.maFormula.toDouble(); + // then: polar-handle, else: XY-handle + // There exist only 8 polar-handles at all in presetTextWarp. + if ((rClass == "fontwork-arch-down-curve") + || (rClass == "fontwork-arch-down-pour" && aEntry.maName == "adj1") + || (rClass == "fontwork-arch-up-curve") + || (rClass == "fontwork-arch-up-pour" && aEntry.maName == "adj1") + || (rClass == "fontwork-open-circle-curve") + || (rClass == "fontwork-open-circle-pour" && aEntry.maName == "adj1") + || (rClass == "fontwork-circle-curve") + || (rClass == "fontwork-circle-pour" && aEntry.maName == "adj1")) + { + // DrawingML has 1/60000 degree unit, but WordArt simple degree. Range [0..360[ + // or range ]-180..180] doesn't matter, because only cos(angle) and + // sin(angle) are used. + fValue = NormAngle360(fValue / 60000.0); + } + else + { + // DrawingML writes adjustment guides as relative value with 100% = 100000, + // but WordArt definitions use values absolute in viewBox 0 0 21600 21600, + // so scale with 21600/100000 = 0.216, with two exceptions: + // X-handles of waves describe increase/decrease relative to horizontal center. + // The gdRefR of pour-shapes is not relative to viewBox but to radius. + if ((rClass == "mso-spt158" && aEntry.maName == "adj2") // textDoubleWave1 + || (rClass == "fontwork-wave" && aEntry.maName == "adj2") // textWave1 + || (rClass == "mso-spt157" && aEntry.maName == "adj2") // textWave2 + || (rClass == "mso-spt159" && aEntry.maName == "adj2")) // textWave4 + { + fValue = (fValue + 50000.0) * 0.216; + } + else if ( (rClass == "fontwork-arch-down-pour" && aEntry.maName == "adj2") + || (rClass == "fontwork-arch-up-pour" && aEntry.maName == "adj2") + || (rClass == "fontwork-open-circle-pour" && aEntry.maName == "adj2") + || (rClass == "fontwork-circle-pour" && aEntry.maName == "adj2")) + { + fValue *= 0.108; + } + else + { + fValue *= 0.216; + } + } + + pAdjustment[nIndex].Value <<= fValue; + pAdjustment[nIndex++].State = css::beans::PropertyState_DIRECT_VALUE; + } + + // Set properties + xSet->setPropertyValue( UNO_NAME_TEXT_AUTOGROWHEIGHT, uno::Any( false ) ); + xSet->setPropertyValue( UNO_NAME_TEXT_AUTOGROWWIDTH, uno::Any( false ) ); + xSet->setPropertyValue( UNO_NAME_FILLSTYLE, uno::Any( drawing::FillStyle_SOLID ) ); + + // ToDo: Old binary WordArt does not allow different styles for different paragraphs, so it + // was not necessary to examine all paragraphs. Solution for DrawingML is needed. + // Currently different alignment of paragraphs are lost, for example. + const TextParagraphVector& rParagraphs = pTextBody->getParagraphs(); + if (!rParagraphs.empty() && !rParagraphs[0]->getRuns().empty()) + { + std::shared_ptr pParagraph = rParagraphs[0]; + std::shared_ptr pRun = pParagraph->getRuns()[0]; + TextCharacterProperties& pProperties = pRun->getTextCharacterProperties(); + + if (pProperties.moBold.has() && pProperties.moBold.get()) + { + xSet->setPropertyValue( UNO_NAME_CHAR_WEIGHT, uno::Any( css::awt::FontWeight::BOLD ) ); + } + if (pProperties.moItalic.has() && pProperties.moItalic.get()) + { + xSet->setPropertyValue( UNO_NAME_CHAR_POSTURE, uno::Any( css::awt::FontSlant::FontSlant_ITALIC ) ); + } + if (pProperties.moHeight.has()) + { + sal_Int32 nHeight = pProperties.moHeight.get() / 100; + xSet->setPropertyValue( UNO_NAME_CHAR_HEIGHT, uno::Any( nHeight ) ); + } + if (pProperties.maFillProperties.maFillColor.isUsed()) + { + const sal_Int32 aFillColor = static_cast( + pProperties.maFillProperties.maFillColor.getColor( rGraphicHelper ).GetRGBColor() ); + xSet->setPropertyValue( UNO_NAME_FILLCOLOR, uno::Any( aFillColor ) ); + + if (pProperties.maFillProperties.maFillColor.hasTransparency()) + { + const sal_Int16 aTransparence = pProperties.maFillProperties.maFillColor.getTransparency(); + xSet->setPropertyValue(UNO_NAME_FILL_TRANSPARENCE, uno::Any(aTransparence)); + } + } + else + { + // Set default color + xSet->setPropertyValue( UNO_NAME_FILLCOLOR, uno::Any( COL_BLACK ) ); + } + { + ParagraphAdjust eAdjust = ParagraphAdjust_LEFT; + if (pParagraph->getProperties().getParaAdjust()) + eAdjust = *pParagraph->getProperties().getParaAdjust(); + xSet->setPropertyValue( "ParaAdjust", uno::Any( eAdjust ) ); + SdrObject* pShape = SdrObject::getSdrObjectFromXShape( xShape ); + assert(pShape); + SdrTextHorzAdjust eHorzAdjust = lcl_convertAdjust( eAdjust ); + pShape->SetMergedItem( SdrTextHorzAdjustItem( eHorzAdjust ) ); + } + } + + // Apply vertical adjustment for text on arc + // ToDo: The property is currently not evaluated. + SdrObject* pShape = SdrObject::getSdrObjectFromXShape(xShape); + assert(pShape); + if (rClass == "fontwork-arch-up-curve" || rClass == "fontwork-circle-curve") + pShape->SetMergedItem( SdrTextVertAdjustItem( SdrTextVertAdjust::SDRTEXTVERTADJUST_BOTTOM ) ); + else if (rClass == "fontwork-arch-down-curve") + pShape->SetMergedItem( SdrTextVertAdjustItem( SdrTextVertAdjust::SDRTEXTVERTADJUST_TOP ) ); + + // Apply preset shape + xDefaulter->createCustomShapeDefaults( rClass ); + + auto aGeomPropSeq = xSet->getPropertyValue( "CustomShapeGeometry" ) + .get>(); + auto aGeomPropVec + = comphelper::sequenceToContainer>( + aGeomPropSeq ); + + // Reset old properties + static const OUStringLiteral sTextPath( u"TextPath" ); + static const OUStringLiteral sAdjustmentValues( u"AdjustmentValues" ); + static const OUStringLiteral sPresetTextWarp( u"PresetTextWarp" ); + + lcl_resetPropertyValue( aGeomPropVec, "CoordinateSize" ); + lcl_resetPropertyValue( aGeomPropVec, "Equations" ); + lcl_resetPropertyValue( aGeomPropVec, "Path" ); + lcl_resetPropertyValue( aGeomPropVec, sAdjustmentValues); + + bool bFromWordArt(false); + pTextBody->getTextProperties().maPropertyMap.getProperty(PROP_FromWordArt) >>= bFromWordArt; + + bool bScaleX(false); + if (!bFromWordArt + && (rPresetType == "textArchDown" || rPresetType == "textArchUp" + || rPresetType == "textCircle" || rPresetType == "textButton")) + { + bScaleX = true; + } + + // Apply geometry properties + uno::Sequence aPropertyValues( + comphelper::InitPropertySequence( + { { sTextPath, uno::Any( true ) }, + { "TextPathMode", + uno::Any( drawing::EnhancedCustomShapeTextPathMode_PATH ) }, + { "ScaleX", uno::Any(bScaleX) } } ) ); + + lcl_setPropertyValue( aGeomPropVec, sTextPath, + comphelper::makePropertyValue( sTextPath, aPropertyValues ) ); + + lcl_setPropertyValue( aGeomPropVec, sPresetTextWarp, + comphelper::makePropertyValue( sPresetTextWarp, rPresetType ) ); + + if (!aAdjGdList.empty()) + { + lcl_setPropertyValue( aGeomPropVec, sAdjustmentValues, + comphelper::makePropertyValue( sAdjustmentValues, aAdjustment ) ); + } + + xSet->setPropertyValue( + "CustomShapeGeometry", + uno::Any(comphelper::containerToSequence(aGeomPropVec))); +} + +// Some helper methods for createAndInsert +namespace +{ +// mirrors aTransformation at its center axis +// only valid if neither rotation or shear included +void lcl_mirrorAtCenter(basegfx::B2DHomMatrix& aTransformation, bool bFlipH, bool bFlipV) +{ + if (!bFlipH && !bFlipV) + return; + basegfx::B2DPoint aCenter(0.5, 0.5); + aCenter *= aTransformation; + aTransformation.translate(-aCenter); + aTransformation.scale(bFlipH ? -1.0 : 1.0, bFlipV ? -1.0 : 1.0); + aTransformation.translate(aCenter); + return; +} + +// only valid if neither rotation or shear included +void lcl_doSpecialMSOWidthHeightToggle(basegfx::B2DHomMatrix& aTransformation) +{ + // The values are directly set at the matrix without any matrix multiplication. + // That way it is valid for lines too. Those have zero width or height. + const double fSx(aTransformation.get(0, 0)); + const double fSy(aTransformation.get(1, 1)); + const double fTx(aTransformation.get(0, 2)); + const double fTy(aTransformation.get(1, 2)); + aTransformation.set(0, 0, fSy); + aTransformation.set(1, 1, fSx); + aTransformation.set(0, 2, fTx + 0.5 * (fSx - fSy)); + aTransformation.set(1, 2, fTy + 0.5 * (fSy - fSx)); + return; +} + +void lcl_RotateAtCenter(basegfx::B2DHomMatrix& aTransformation,sal_Int32 nMSORotationAngle) +{ + if (nMSORotationAngle == 0) + return; + double fRad = basegfx::deg2rad<60000>(nMSORotationAngle); + basegfx::B2DPoint aCenter(0.5, 0.5); + aCenter *= aTransformation; + aTransformation.translate(-aCenter); + aTransformation.rotate(fRad); + aTransformation.translate(aCenter); + return; +} +} + +Reference< XShape > const & Shape::createAndInsert( + ::oox::core::XmlFilterBase& rFilterBase, + const OUString& rServiceName, + const Theme* pTheme, + const css::uno::Reference< css::drawing::XShapes >& rxShapes, + bool bClearText, + bool bDoNotInsertEmptyTextBody, + basegfx::B2DHomMatrix& aParentTransformation, + const FillProperties& rShapeOrParentShapeFillProps, + oox::drawingml::ShapePtr pParentGroupShape) +{ + bool bIsEmbMedia = false; + SAL_INFO("oox.drawingml", "Shape::createAndInsert: id='" << msId << "' service='" << rServiceName << "'"); + + formulaimport::XmlStreamBuilder * pMathXml(nullptr); + if (mpTextBody) + { + for (auto const& it : mpTextBody->getParagraphs()) + { + if (it->HasMathXml()) + { + if (!mpTextBody->isEmpty() || pMathXml != nullptr) + { + SAL_WARN("oox.drawingml", "losing a Math object..."); + } + else + { + pMathXml = &it->GetMathXml(); + } + } + } + } + + // tdf#90403 PowerPoint ignores a:ext cx and cy values of p:xfrm, and uses real table width and height + if ( mpTablePropertiesPtr && rServiceName == "com.sun.star.drawing.TableShape" ) + { + maSize.Width = 0; + for (auto const& elem : mpTablePropertiesPtr->getTableGrid()) + { + maSize.Width = o3tl::saturating_add(maSize.Width, static_cast(elem)); + } + maSize.Height = 0; + for (auto const& elem : mpTablePropertiesPtr->getTableRows()) + { + // WARN: When less then minimum sized rows exist, calculated height here + // is corrected before layouting takes place + maSize.Height = o3tl::saturating_add(maSize.Height, elem.getHeight()); + } + } + + awt::Rectangle aShapeRectHmm( + o3tl::convert(maPosition.X, o3tl::Length::emu, o3tl::Length::mm100), + o3tl::convert(maPosition.Y, o3tl::Length::emu, o3tl::Length::mm100), + o3tl::convert(maSize.Width, o3tl::Length::emu, o3tl::Length::mm100), + o3tl::convert(maSize.Height, o3tl::Length::emu, o3tl::Length::mm100)); + + OUString aServiceName; + if (pMathXml) + { + // convert this shape to OLE + aServiceName = "com.sun.star.drawing.OLE2Shape"; + msServiceName = aServiceName; + meFrameType = FRAMETYPE_GENERIC; // not OLEOBJECT, no stream in package + mnSubType = 0; + } + else if (rServiceName == "com.sun.star.drawing.GraphicObjectShape" && + mpGraphicPropertiesPtr && !mpGraphicPropertiesPtr->m_sMediaPackageURL.isEmpty()) + { + aServiceName = finalizeServiceName( rFilterBase, "com.sun.star.presentation.MediaShape", aShapeRectHmm ); + bIsEmbMedia = true; + } + else + { + aServiceName = finalizeServiceName( rFilterBase, rServiceName, aShapeRectHmm ); + } + // Use custom shape instead of GraphicObjectShape if the image is cropped to + // shape. Except rectangle, which does not require further cropping + bool bIsCroppedGraphic = (aServiceName == "com.sun.star.drawing.GraphicObjectShape" && + !mpCustomShapePropertiesPtr->representsDefaultShape()); + + bool bIsCustomShape = (aServiceName == "com.sun.star.drawing.CustomShape" || bIsCroppedGraphic); + bool bIsConnectorShape = (aServiceName == "com.sun.star.drawing.ConnectorShape"); + if(bIsCroppedGraphic) + { + aServiceName = "com.sun.star.drawing.CustomShape"; + mpGraphicPropertiesPtr->mbIsCustomShape = true; + } + bool bUseRotationTransform = ( !mbWps || + aServiceName == "com.sun.star.drawing.LineShape" || + aServiceName == "com.sun.star.drawing.GroupShape" || + mbFlipH || + mbFlipV ); + + basegfx::B2DHomMatrix aTransformation; // will be cumulative transformation of this object + + // Special for SmartArt import. Rotate diagram's shape around object's center before sizing. + if (bUseRotationTransform && mnDiagramRotation != 0) + { + aTransformation.translate(-0.5, -0.5); + aTransformation.rotate(basegfx::deg2rad<60000>(mnDiagramRotation)); + aTransformation.translate(0.5, 0.5); + } + + // Build object matrix from shape size and position; corresponds to MSO ext and off + // Only LineShape and ConnectorShape may have zero width or height. + if (aServiceName == "com.sun.star.drawing.LineShape" + || aServiceName == "com.sun.star.drawing.ConnectorShape") + aTransformation.scale(maSize.Width, maSize.Height); + else + { + aTransformation.scale(maSize.Width ? maSize.Width : 1.0, + maSize.Height ? maSize.Height : 1.0); + } + + // Evaluate object flip. Other shapes than custom shapes have no attribute for flip but use + // negative scale. Flip in MSO is at object center. + if (!bIsCustomShape && (mbFlipH || mbFlipV)) + lcl_mirrorAtCenter(aTransformation, mbFlipH, mbFlipV); + + // Evaluate parent flip. + // A CustomShape has mirror not as negative scale, but as attributes. + basegfx::B2DVector aParentScale(1.0, 1.0); + basegfx::B2DVector aParentTranslate(0.0, 0.0); + double fParentRotate(0.0); + double fParentShearX(0.0); + if (pParentGroupShape) + { + aParentTransformation.decompose(aParentScale, aParentTranslate, fParentRotate, fParentShearX); + if (bIsCustomShape) + { + lcl_mirrorAtCenter(aTransformation, aParentScale.getX() < 0, aParentScale.getY() < 0); + if(aParentScale.getX() < 0) + mbFlipH = !mbFlipH; + if(aParentScale.getY() < 0) + mbFlipV = !mbFlipV; + } + } + + if (maPosition.X != 0 || maPosition.Y != 0) + { + // if global position is used, add it to transformation + if (mbWps && pParentGroupShape == nullptr) + aTransformation.translate( + o3tl::convert(maPosition.X, o3tl::Length::mm100, o3tl::Length::emu), + o3tl::convert(maPosition.Y, o3tl::Length::mm100, o3tl::Length::emu)); + else + aTransformation.translate(maPosition.X, maPosition.Y); + } + + // Apply further parent transformations. First scale object then rotate. Other way round would + // introduce shearing. + + // The attributes chExt and chOff of the group in oox file contain the values on which the size + // and position of the child is based on. If they differ from the actual size of the group as + // given in its ext and off attributes, the child has to be transformed according the new values. + if (pParentGroupShape) + { + // ToDo: A diagram in a group might need special handling because it cannot flip and only + // resize uniformly. But currently it is imported with zero size, see tdf#139575. That needs + // to be fixed beforehand. + + // Scaling is done from left/top edges of the group. So these need to become coordinate axes. + aTransformation.translate(-pParentGroupShape->maChPosition.X, + -pParentGroupShape->maChPosition.Y); + + // oox allows zero or missing attribute chExt. In that case the scaling factor is 1. + // Transform2DContext::onCreateContext has set maChSize to maSize for groups in oox file in + // such cases. For own made groups (e.g. diagrams) that is missing. + // The factors cumulate on the way through the parent groups, so we do not use maSize of the + // direct parent group but the cumulated value from aParentScale. + double fFactorX = 1.0; + double fFactorY = 1.0; + if (pParentGroupShape->maChSize.Width != 0) + fFactorX = aParentScale.getX() / pParentGroupShape->maChSize.Width; + if (pParentGroupShape->maChSize.Height != 0) + fFactorY = aParentScale.getY() / pParentGroupShape->maChSize.Height; + if (fFactorX != 1 || fFactorY != 1) + { + // It depends on the object rotation angle whether scaling is applied to switched + // width and height. MSO acts strange in that case (as of May 2021). + const sal_Int32 nDeg(mnRotation / 60000); + const bool bNeedsMSOWidhtHeightToggle + = (nDeg >= 45 && nDeg < 135) || (nDeg >= 225 && nDeg < 315); + if (bNeedsMSOWidhtHeightToggle) + lcl_doSpecialMSOWidthHeightToggle(aTransformation); + + aTransformation.scale(fFactorX, fFactorY); + + if (bNeedsMSOWidhtHeightToggle) + { + lcl_doSpecialMSOWidthHeightToggle(aTransformation); + // In case of flip the special case needs an additional 180deg rotation. + if ((aParentScale.getX() < 0) != (aParentScale.getY() < 0)) + lcl_RotateAtCenter(aTransformation, 10800000); + } + } + } + + // Apply object rotation at current object center + // The flip contained in aParentScale will affect orientation of object rotation angle. + sal_Int16 nOrientation = ((aParentScale.getX() < 0) != (aParentScale.getY() < 0)) ? -1 : 1; + // ToDo: Not sure about the restrictions given by bUseRotationTransform. + // Since LibreOffice doesn't have 3D camera options for 2D shapes, rotate the shape opposite of + // the camera Z axis rotation, in order to produce the same visual result from MSO + const sal_Int32 nCameraRotation = get3DProperties().maCameraRotation.mnRevolution.get(0); + if (bUseRotationTransform && (mnRotation != 0 || nCameraRotation != 0)) + lcl_RotateAtCenter(aTransformation, nOrientation * (mnRotation - nCameraRotation)); + + if (fParentRotate != 0.0) + aTransformation.rotate(fParentRotate); + if (!aParentTranslate.equalZero()) + aTransformation.translate(aParentTranslate); + + aParentTransformation = aTransformation; + + constexpr double fEmuToMm100 = o3tl::convert(1.0, o3tl::Length::emu, o3tl::Length::mm100); + aTransformation.scale(fEmuToMm100, fEmuToMm100); + + // OOXML flips shapes before rotating them, so the rotation needs to be inverted + if( bIsCustomShape && mbFlipH != mbFlipV ) + { + basegfx::B2DVector aScale, aTranslate; + double fRotate, fShearX; + aTransformation.decompose(aScale, aTranslate, fRotate, fShearX); + + if(fRotate != 0) + { + basegfx::B2DPoint aCenter(0.5, 0.5); + aCenter *= aTransformation; + aTransformation.translate( -aCenter.getX(), -aCenter.getY() ); + aTransformation.rotate( fRotate * -2.0 ); + aTransformation.translate( aCenter.getX(), aCenter.getY() ); + } + } + + // special for lineshape + if ( aServiceName == "com.sun.star.drawing.LineShape" ) + { + ::basegfx::B2DPolygon aPoly; + aPoly.insert( 0, ::basegfx::B2DPoint( 0, 0 ) ); + aPoly.insert( 1, ::basegfx::B2DPoint( maSize.Width ? 1 : 0, maSize.Height ? 1 : 0 ) ); + aPoly.transform( aTransformation ); + + // now creating the corresponding PolyPolygon + sal_Int32 i, nNumPoints = aPoly.count(); + uno::Sequence< awt::Point > aPointSequence( nNumPoints ); + awt::Point* pPoints = aPointSequence.getArray(); + for( i = 0; i < nNumPoints; ++i ) + { + basegfx::B2DPoint aPoint( aPoly.getB2DPoint( i ) ); + + // Guard against zero width or height. + if (i) + { + const basegfx::B2DPoint& rPreviousPoint = aPoly.getB2DPoint(i - 1); + if (aPoint.getX() - rPreviousPoint.getX() == 0) + aPoint.setX(aPoint.getX() + 1); + if (aPoint.getY() - rPreviousPoint.getY() == 0) + aPoint.setY(aPoint.getY() + 1); + } + + pPoints[i] = awt::Point(static_cast(aPoint.getX()), static_cast(aPoint.getY())); + } + uno::Sequence< uno::Sequence< awt::Point > > aPolyPolySequence( 1 ); + aPolyPolySequence.getArray()[ 0 ] = aPointSequence; + + maShapeProperties.setProperty(PROP_PolyPolygon, aPolyPolySequence); + } + else if ( aServiceName == "com.sun.star.drawing.ConnectorShape" ) + { + ::basegfx::B2DPolygon aPoly; + aPoly.insert( 0, ::basegfx::B2DPoint( 0, 0 ) ); + aPoly.insert( 1, ::basegfx::B2DPoint( maSize.Width ? 1 : 0, maSize.Height ? 1 : 0 ) ); + aPoly.transform( aTransformation ); + + basegfx::B2DPoint aStartPosition( aPoly.getB2DPoint( 0 ) ); + basegfx::B2DPoint aEndPosition( aPoly.getB2DPoint( 1 ) ); + awt::Point aAWTStartPosition( static_cast< sal_Int32 >( aStartPosition.getX() ), static_cast< sal_Int32 >( aStartPosition.getY() ) ); + awt::Point aAWTEndPosition( static_cast< sal_Int32 >( aEndPosition.getX() ), static_cast< sal_Int32 >( aEndPosition.getY() ) ); + + maShapeProperties.setProperty(PROP_StartPosition, aAWTStartPosition); + maShapeProperties.setProperty(PROP_EndPosition, aAWTEndPosition); + } + else + { + // now set transformation for this object + HomogenMatrix3 aMatrix; + + aMatrix.Line1.Column1 = aTransformation.get(0,0); + aMatrix.Line1.Column2 = aTransformation.get(0,1); + aMatrix.Line1.Column3 = aTransformation.get(0,2); + + aMatrix.Line2.Column1 = aTransformation.get(1,0); + aMatrix.Line2.Column2 = aTransformation.get(1,1); + aMatrix.Line2.Column3 = aTransformation.get(1,2); + + aMatrix.Line3.Column1 = aTransformation.get(2,0); + aMatrix.Line3.Column2 = aTransformation.get(2,1); + aMatrix.Line3.Column3 = aTransformation.get(2,2); + + maShapeProperties.setProperty(PROP_Transformation, aMatrix); + } + + Reference< lang::XMultiServiceFactory > xServiceFact( rFilterBase.getModel(), UNO_QUERY_THROW ); + if ( !mxShape.is() ) + { + mxShape.set( xServiceFact->createInstance( aServiceName ), UNO_QUERY_THROW ); + } + + Reference< XPropertySet > xSet( mxShape, UNO_QUERY ); + if (xSet.is()) + { + if( !msName.isEmpty() ) + { + Reference< container::XNamed > xNamed( mxShape, UNO_QUERY ); + if( xNamed.is() ) + xNamed->setName( msName ); + } + if( !msDescription.isEmpty() ) + { + xSet->setPropertyValue( "Description", Any( msDescription ) ); + } + if (aServiceName != "com.sun.star.text.TextFrame") + rxShapes->add( mxShape ); + + if ( mbHidden || mbHiddenMasterShape ) + { + SAL_INFO("oox.drawingml", "Shape::createAndInsert: invisible shape with id='" << msId << "'"); + xSet->setPropertyValue( "Visible", Any( false ) ); + // In Excel hidden means not printed, let's use visibility for now until that's handled separately + xSet->setPropertyValue( "Printable", Any( false ) ); + } + + if (mbLocked) + { + xSet->setPropertyValue("MoveProtect", Any(true)); + xSet->setPropertyValue("SizeProtect", Any(true)); + } + + ActionLockGuard const alg(mxShape); + + // sj: removing default text of placeholder objects such as SlideNumberShape or HeaderShape + if ( bClearText ) + { + uno::Reference< text::XText > xText( mxShape, uno::UNO_QUERY ); + if ( xText.is() ) + { + xText->setString( "" ); + } + } + + if (pMathXml) + { + // the "EmbeddedObject" property is read-only, so we have to create + // the shape first, and it can be read only after the shape is + // inserted into the document, so delay the actual import until here + SvGlobalName name(SO3_SM_CLASSID); + xSet->setPropertyValue("CLSID", uno::Any(name.GetHexName())); + uno::Reference const xObj( + xSet->getPropertyValue("EmbeddedObject"), uno::UNO_QUERY); + if (xObj.is()) + { + uno::Reference const xMathModel(xObj->getComponent()); + oox::FormulaImportBase *const pMagic( + dynamic_cast(xMathModel.get())); + assert(pMagic); + pMagic->readFormulaOoxml(*pMathXml); + } + } + + const GraphicHelper& rGraphicHelper = rFilterBase.getGraphicHelper(); + + ::Color nLinePhClr(ColorTransparency, 0xffffffff); + ::Color nFillPhClr(ColorTransparency, 0xffffffff); + sal_Int16 nFillPhClrTheme = -1; + // TODO: use ph color when applying effect properties + //sal_Int32 nEffectPhClr = -1; + + // dmapper needs the original rotation angle for calculating square wrap. This angle is not + // available as property there, so store it in InteropGrabBag. + putPropertyToGrabBag("mso-rotation-angle", Any(mnRotation)); + + if( pTheme ) + { + if( const ShapeStyleRef* pLineRef = getShapeStyleRef( XML_lnRef ) ) + { + LineProperties aLineProperties; + aLineProperties.maLineFill.moFillType = XML_noFill; + if( const LineProperties* pLineProps = pTheme->getLineStyle( pLineRef->mnThemedIdx ) ) + aLineProperties.assignUsed( *pLineProps ); + nLinePhClr = pLineRef->maPhClr.getColor( rGraphicHelper ); + + // Store style-related properties to InteropGrabBag to be able to export them back + uno::Sequence aProperties = comphelper::InitPropertySequence( + { + {"SchemeClr", uno::Any(pLineRef->maPhClr.getSchemeColorName())}, + {"Idx", uno::Any(pLineRef->mnThemedIdx)}, + {"Color", uno::Any(nLinePhClr)}, + {"LineStyle", uno::Any(aLineProperties.getLineStyle())}, + {"LineCap", uno::Any(aLineProperties.getLineCap())}, + {"LineJoint", uno::Any(aLineProperties.getLineJoint())}, + {"LineWidth", uno::Any(aLineProperties.getLineWidth())}, + {"Transformations", uno::Any(pLineRef->maPhClr.getTransformations())} + }); + putPropertyToGrabBag( "StyleLnRef", Any( aProperties ) ); + } + if( const ShapeStyleRef* pFillRef = getShapeStyleRef( XML_fillRef ) ) + { + if (!getFillProperties().moUseBgFill.get(false)) + { + nFillPhClr = pFillRef->maPhClr.getColor(rGraphicHelper); + nFillPhClrTheme = pFillRef->maPhClr.getSchemeColorIndex(); + } + + OUString sColorScheme = pFillRef->maPhClr.getSchemeColorName(); + if( !sColorScheme.isEmpty() ) + { + uno::Sequence aProperties = comphelper::InitPropertySequence( + { + {"SchemeClr", uno::Any(sColorScheme)}, + {"Idx", uno::Any(pFillRef->mnThemedIdx)}, + {"Color", uno::Any(nFillPhClr)}, + {"Transformations", uno::Any(pFillRef->maPhClr.getTransformations())} + }); + + putPropertyToGrabBag( "StyleFillRef", Any( aProperties ) ); + } + } + if( const ShapeStyleRef* pEffectRef = getShapeStyleRef( XML_effectRef ) ) + { + // TODO: use ph color when applying effect properties + // nEffectPhClr = pEffectRef->maPhClr.getColor( rGraphicHelper ); + + // Store style-related properties to InteropGrabBag to be able to export them back + uno::Sequence aProperties = comphelper::InitPropertySequence( + { + {"SchemeClr", uno::Any(pEffectRef->maPhClr.getSchemeColorName())}, + {"Idx", uno::Any(pEffectRef->mnThemedIdx)}, + {"Transformations", uno::Any(pEffectRef->maPhClr.getTransformations())} + }); + putPropertyToGrabBag( "StyleEffectRef", Any( aProperties ) ); + } + } + ShapePropertyMap aShapeProps( rFilterBase.getModelObjectHelper() ); + + // add properties from textbody to shape properties + if( mpTextBody ) + { + mpTextBody->getTextProperties().pushTextDistances(Size(aShapeRectHmm.Width, aShapeRectHmm.Height)); + aShapeProps.assignUsed( mpTextBody->getTextProperties().maPropertyMap ); + // Push char properties as well - specifically useful when this is a placeholder + if( mpMasterTextListStyle && mpMasterTextListStyle->getListStyle()[0].getTextCharacterProperties().moHeight.has() ) + aShapeProps.setProperty(PROP_CharHeight, GetFontHeight( mpMasterTextListStyle->getListStyle()[0].getTextCharacterProperties().moHeight.get() )); + } + + // applying properties + aShapeProps.assignUsed( getShapeProperties() ); + aShapeProps.assignUsed( maDefaultShapeProperties ); + if(mnRotation != 0 && bIsCustomShape) + aShapeProps.setProperty( PROP_RotateAngle, sal_Int32( NormAngle36000( Degree100(mnRotation / -600) ) )); + if( bIsEmbMedia || + bIsCustomShape || + aServiceName == "com.sun.star.drawing.GraphicObjectShape" || + aServiceName == "com.sun.star.drawing.OLE2Shape") + { + mpGraphicPropertiesPtr->pushToPropMap( aShapeProps, rGraphicHelper, mbFlipH, mbFlipV ); + } + if ( mpTablePropertiesPtr && aServiceName == "com.sun.star.drawing.TableShape" ) + { + mpTablePropertiesPtr->pushToPropSet( rFilterBase, xSet, mpMasterTextListStyle ); + if ( auto* pTableShape = dynamic_cast(SdrObject::getSdrObjectFromXShape(mxShape)) ) + { + // Disable layouting until an attempt at correcting faulty table height is made + pTableShape->SetSkipChangeLayout(true); + } + } + + FillProperties aFillProperties = getActualFillProperties(pTheme, &rShapeOrParentShapeFillProps); + if (getFillProperties().moFillType.has() && getFillProperties().moFillType.get() == XML_grpFill) + getFillProperties().assignUsed(aFillProperties); + if(!bIsCroppedGraphic) + aFillProperties.pushToPropMap( aShapeProps, rGraphicHelper, mnRotation, nFillPhClr, nFillPhClrTheme, mbFlipH, mbFlipV, bIsCustomShape ); + LineProperties aLineProperties = getActualLineProperties(pTheme); + aLineProperties.pushToPropMap( aShapeProps, rGraphicHelper, nLinePhClr ); + EffectProperties aEffectProperties = getActualEffectProperties(pTheme); + // TODO: use ph color when applying effect properties + aEffectProperties.pushToPropMap( aShapeProps, rGraphicHelper ); + + // applying autogrowheight property before setting shape size, because + // the shape size might be changed if currently autogrowheight is true + // we must also check that the PropertySet supports the property. + Reference< XPropertySetInfo > xSetInfo( xSet->getPropertySetInfo() ); + const OUString& rPropName = PropertyMap::getPropertyName( PROP_TextAutoGrowHeight ); + if( xSetInfo.is() && xSetInfo->hasPropertyByName( rPropName ) ) + if( aShapeProps.hasProperty( PROP_TextAutoGrowHeight ) ) + xSet->setPropertyValue( rPropName, Any( false ) ); + + // do not set properties at a group shape (this causes + // assertions from svx) ... + if( aServiceName != "com.sun.star.drawing.GroupShape" ) + { + if (aServiceName == "com.sun.star.text.TextFrame") + { + if (mpCustomShapePropertiesPtr && mpCustomShapePropertiesPtr->getShapeTypeOverride()) + { + uno::Reference propertySet (mxShape, uno::UNO_QUERY); + uno::Sequence aGrabBag; + propertySet->getPropertyValue("FrameInteropGrabBag") >>= aGrabBag; + sal_Int32 length = aGrabBag.getLength(); + aGrabBag.realloc( length+1); + auto pGrabBag = aGrabBag.getArray(); + pGrabBag[length].Name = "mso-orig-shape-type"; + uno::Sequence< sal_Int8 > const & aNameSeq = + mpCustomShapePropertiesPtr->getShapePresetTypeName(); + OUString sShapePresetTypeName(reinterpret_cast< const char* >( + aNameSeq.getConstArray()), aNameSeq.getLength(), RTL_TEXTENCODING_UTF8); + pGrabBag[length].Value <<= sShapePresetTypeName; + propertySet->setPropertyValue("FrameInteropGrabBag",uno::Any(aGrabBag)); + } + //If the text box has links then save the link information so that + //it can be accessed in DomainMapper_Impl.cxx while chaining the text frames. + if (isLinkedTxbx()) + { + uno::Reference propertySet (mxShape, uno::UNO_QUERY); + uno::Sequence aGrabBag; + propertySet->getPropertyValue("FrameInteropGrabBag") >>= aGrabBag; + sal_Int32 length = aGrabBag.getLength(); + aGrabBag.realloc( length + 3 ); + auto pGrabBag = aGrabBag.getArray(); + pGrabBag[length].Name = "TxbxHasLink"; + pGrabBag[length].Value <<= isLinkedTxbx(); + pGrabBag[length + 1 ].Name = "Txbx-Id"; + pGrabBag[length + 1 ].Value <<= getLinkedTxbxAttributes().id; + pGrabBag[length + 2 ].Name = "Txbx-Seq"; + pGrabBag[length + 2 ].Value <<= getLinkedTxbxAttributes().seq; + propertySet->setPropertyValue("FrameInteropGrabBag",uno::Any(aGrabBag)); + } + + // TextFrames have BackColor, not FillColor + if (aShapeProps.hasProperty(PROP_FillColor)) + { + aShapeProps.setAnyProperty(PROP_BackColor, aShapeProps.getProperty(PROP_FillColor)); + aShapeProps.erase(PROP_FillColor); + } + // TextFrames have BackColorTransparency, not FillTransparence + if (aShapeProps.hasProperty(PROP_FillTransparence)) + { + aShapeProps.setAnyProperty(PROP_BackColorTransparency, aShapeProps.getProperty(PROP_FillTransparence)); + aShapeProps.erase(PROP_FillTransparence); + } + // TextFrames have BackGraphic, not FillBitmap + if (aShapeProps.hasProperty(PROP_FillBitmap)) + { + aShapeProps.setAnyProperty(PROP_BackGraphic, aShapeProps.getProperty(PROP_FillBitmap)); + aShapeProps.erase(PROP_FillBitmap); + } + if (aShapeProps.hasProperty(PROP_FillBitmapName)) + { + uno::Any aAny = aShapeProps.getProperty(PROP_FillBitmapName); + OUString aFillBitmapName = aAny.get(); + uno::Reference xBitmap = rFilterBase.getModelObjectHelper().getFillBitmap(aFillBitmapName); + uno::Reference xGraphic(xBitmap, uno::UNO_QUERY); + aShapeProps.setProperty(PROP_BackGraphic, xGraphic); + // aShapeProps.erase(PROP_FillBitmapName); // Maybe, leave the name as well + } + // And no LineColor property; individual borders can have colors + if (aShapeProps.hasProperty(PROP_LineColor)) + { + uno::Reference xPropertySet(mxShape, uno::UNO_QUERY); + static const sal_Int32 aBorders[] = + { + PROP_TopBorder, PROP_LeftBorder, PROP_BottomBorder, PROP_RightBorder + }; + for (sal_Int32 nBorder : aBorders) + { + css::table::BorderLine2 aBorderLine = xPropertySet->getPropertyValue(PropertyMap::getPropertyName(nBorder)).get(); + aBorderLine.Color = aShapeProps.getProperty(PROP_LineColor).get(); + if (aLineProperties.moLineWidth.has()) + aBorderLine.LineWidth = convertEmuToHmm(aLineProperties.moLineWidth.get()); + aShapeProps.setProperty(nBorder, aBorderLine); + } + aShapeProps.erase(PROP_LineColor); + } + if(mnRotation) + { + uno::Reference xPropertySet(mxShape, uno::UNO_QUERY); + static const OUStringLiteral aGrabBagPropName = u"FrameInteropGrabBag"; + uno::Sequence aGrabBag; + xPropertySet->getPropertyValue(aGrabBagPropName) >>= aGrabBag; + beans::PropertyValue aPair(comphelper::makePropertyValue("mso-rotation-angle", + mnRotation)); + if (aGrabBag.hasElements()) + { + sal_Int32 nLength = aGrabBag.getLength(); + aGrabBag.realloc(nLength + 1); + aGrabBag.getArray()[nLength] = aPair; + } + else + { + aGrabBag = { aPair }; + } + xPropertySet->setPropertyValue(aGrabBagPropName, uno::Any(aGrabBag)); + } + // TextFrames have ShadowFormat, not individual shadow properties. + std::optional oShadowDistance; + if (aShapeProps.hasProperty(PROP_ShadowXDistance)) + { + oShadowDistance = aShapeProps.getProperty(PROP_ShadowXDistance).get(); + aShapeProps.erase(PROP_ShadowXDistance); + } + if (aShapeProps.hasProperty(PROP_ShadowYDistance)) + { + // There is a single 'dist' attribute, so no need to count the avg of x and y. + aShapeProps.erase(PROP_ShadowYDistance); + } + std::optional oShadowColor; + if (aShapeProps.hasProperty(PROP_ShadowColor)) + { + oShadowColor = aShapeProps.getProperty(PROP_ShadowColor).get(); + aShapeProps.erase(PROP_ShadowColor); + } + if (aShapeProps.hasProperty(PROP_Shadow)) + aShapeProps.erase(PROP_Shadow); + + if (oShadowDistance || oShadowColor || aEffectProperties.maShadow.moShadowDir.has()) + { + css::table::ShadowFormat aFormat; + if (oShadowColor) + aFormat.Color = *oShadowColor; + if (aEffectProperties.maShadow.moShadowDir.has()) + { + css::table::ShadowLocation nLocation = css::table::ShadowLocation_NONE; + switch (aEffectProperties.maShadow.moShadowDir.get()) + { + case 13500000: + nLocation = css::table::ShadowLocation_TOP_LEFT; + break; + case 18900000: + nLocation = css::table::ShadowLocation_TOP_RIGHT; + break; + case 8100000: + nLocation = css::table::ShadowLocation_BOTTOM_LEFT; + break; + case 2700000: + nLocation = css::table::ShadowLocation_BOTTOM_RIGHT; + break; + } + aFormat.Location = nLocation; + } + aFormat.ShadowWidth = *oShadowDistance; + aShapeProps.setProperty(PROP_ShadowFormat, aFormat); + } + + } + else if (mbTextBox) + { + aShapeProps.setProperty(PROP_TextBox, true); + } + + if (aServiceName != "com.sun.star.text.TextFrame" && isLinkedTxbx()) + { + uno::Reference propertySet (mxShape, uno::UNO_QUERY); + uno::Sequence aGrabBag; + propertySet->getPropertyValue("InteropGrabBag") >>= aGrabBag; + sal_Int32 length = aGrabBag.getLength(); + aGrabBag.realloc( length + 3 ); + auto pGrabBag = aGrabBag.getArray(); + pGrabBag[length].Name = "TxbxHasLink"; + pGrabBag[length].Value <<= isLinkedTxbx(); + pGrabBag[length + 1 ].Name = "Txbx-Id"; + pGrabBag[length + 1 ].Value <<= getLinkedTxbxAttributes().id; + pGrabBag[length + 2 ].Name = "Txbx-Seq"; + pGrabBag[length + 2 ].Value <<= getLinkedTxbxAttributes().seq; + propertySet->setPropertyValue("InteropGrabBag",uno::Any(aGrabBag)); + } + + // If the shape is a picture placeholder. + if (aServiceName == "com.sun.star.presentation.GraphicObjectShape" && !bClearText) + { + // Placeholder text should be in center of the shape. + aShapeProps.setProperty(PROP_TextContourFrame, false); + + /* Placeholder icon should be at the center of the parent shape. + * We use negative graphic crop property because of that we don't + * have padding support. + */ + uno::Reference xGraphic(xSet->getPropertyValue("Graphic"), uno::UNO_QUERY); + if (xGraphic.is()) + { + awt::Size aBitmapSize; + xGraphic->getPropertyValue("Size100thMM") >>= aBitmapSize; + sal_Int32 nXMargin = (aShapeRectHmm.Width - aBitmapSize.Width) / 2; + sal_Int32 nYMargin = (aShapeRectHmm.Height - aBitmapSize.Height) / 2; + if (nXMargin > 0 && nYMargin > 0) + { + text::GraphicCrop aGraphicCrop; + aGraphicCrop.Top = nYMargin * -1; + aGraphicCrop.Bottom = nYMargin * -1; + aGraphicCrop.Left = nXMargin * -1; + aGraphicCrop.Right = nXMargin * -1; + aShapeProps.setProperty(PROP_GraphicCrop, aGraphicCrop); + } + } + } + + PropertySet( xSet ).setProperties( aShapeProps ); + + if (mpTablePropertiesPtr && aServiceName == "com.sun.star.drawing.TableShape") + { + // Powerpoint sometimes export row heights less than the minimum size, + // which during import expanded to the minimum + if (auto* pTableShape = dynamic_cast(SdrObject::getSdrObjectFromXShape(mxShape))) + { + sal_Int32 nCorrectedHeight = pTableShape->getHeightWithoutFitting(); + const auto& aShapeSize = mxShape->getSize(); + if( nCorrectedHeight > aShapeSize.Height ) + mxShape->setSize( {aShapeSize.Width, nCorrectedHeight} ); + pTableShape->SetSkipChangeLayout(false); + } + } + + if (mbLockedCanvas) + { + putPropertyToGrabBag( "LockedCanvas", Any( true ) ); + if (aServiceName == "com.sun.star.drawing.LineShape") + { + // It seems the position and size for lines inside a locked canvas is absolute. + mxShape->setPosition(awt::Point(aShapeRectHmm.X, aShapeRectHmm.Y)); + mxShape->setSize(awt::Size(aShapeRectHmm.Width, aShapeRectHmm.Height)); + } + } + + // Store original fill and line colors of the shape and the theme color name to InteropGrabBag + std::vector aProperties + { + comphelper::makePropertyValue("EmuLineWidth", aLineProperties.moLineWidth.get(0)), + comphelper::makePropertyValue("OriginalSolidFillClr", aShapeProps.getProperty(PROP_FillColor)), + comphelper::makePropertyValue("OriginalLnSolidFillClr", aShapeProps.getProperty(PROP_LineColor)) + }; + OUString sColorFillScheme = aFillProperties.maFillColor.getSchemeColorName(); + if( !aFillProperties.maFillColor.isPlaceHolder() && !sColorFillScheme.isEmpty() ) + { + aProperties.push_back(comphelper::makePropertyValue("SpPrSolidFillSchemeClr", sColorFillScheme)); + aProperties.push_back(comphelper::makePropertyValue("SpPrSolidFillSchemeClrTransformations", aFillProperties.maFillColor.getTransformations())); + } + OUString sLnColorFillScheme = aLineProperties.maLineFill.maFillColor.getSchemeColorName(); + if( !aLineProperties.maLineFill.maFillColor.isPlaceHolder() && !sLnColorFillScheme.isEmpty() ) + { + aProperties.push_back(comphelper::makePropertyValue("SpPrLnSolidFillSchemeClr", sLnColorFillScheme)); + auto aResolvedSchemeClr = aLineProperties.maLineFill.maFillColor; + aResolvedSchemeClr.clearTransformations(); + aProperties.push_back(comphelper::makePropertyValue("SpPrLnSolidFillResolvedSchemeClr", aResolvedSchemeClr.getColor(rGraphicHelper, nFillPhClr))); + aProperties.push_back(comphelper::makePropertyValue("SpPrLnSolidFillSchemeClrTransformations", aLineProperties.maLineFill.maFillColor.getTransformations())); + } + putPropertiesToGrabBag(comphelper::containerToSequence(aProperties)); + + // Store original gradient fill of the shape to InteropGrabBag + // LibreOffice doesn't support all the kinds of gradient so we save its complete definition + if( aShapeProps.hasProperty( PROP_FillGradient ) ) + { + std::vector aGradientStops; + size_t i = 0; + for( const auto& [rPos, rColor] : aFillProperties.maGradientProps.maGradientStops ) + { // for each stop in the gradient definition: + + // save position + std::vector aGradientStop + { + comphelper::makePropertyValue("Pos", rPos) + }; + + OUString sStopColorScheme = rColor.getSchemeColorName(); + if( sStopColorScheme.isEmpty() ) + { + // save RGB color + aGradientStop.push_back(comphelper::makePropertyValue("RgbClr", rColor.getColor(rGraphicHelper, nFillPhClr))); + // in the case of a RGB color, transformations are already applied to + // the color with the exception of alpha transformations. We only need + // to keep the transparency value to calculate the alpha value later. + if( rColor.hasTransparency() ) + aGradientStop.push_back(comphelper::makePropertyValue("Transparency", rColor.getTransparency())); + } + else + { + // save color with scheme name + aGradientStop.push_back(comphelper::makePropertyValue("SchemeClr", sStopColorScheme)); + // save all color transformations + aGradientStop.push_back(comphelper::makePropertyValue("Transformations", rColor.getTransformations())); + } + + aGradientStops.push_back(comphelper::makePropertyValue(OUString::number(i), comphelper::containerToSequence(aGradientStop))); + ++i; + } + // If getFillProperties.moFillType is unused that means gradient is defined by a theme + // which is already saved into StyleFillRef property, so no need to save the explicit values too + if( getFillProperties().moFillType.has() ) + putPropertyToGrabBag( "GradFillDefinition", uno::Any(comphelper::containerToSequence(aGradientStops))); + putPropertyToGrabBag( "OriginalGradFill", aShapeProps.getProperty(PROP_FillGradient) ); + } + + // store unsupported effect attributes in the grab bag + if (!aEffectProperties.m_Effects.empty()) + { + std::vector aEffects; + for (auto const& it : aEffectProperties.m_Effects) + { + PropertyValue aEffect = it->getEffect(); + if( !aEffect.Name.isEmpty() ) + { + std::vector aEffectsGrabBag + { + comphelper::makePropertyValue("Attribs", aEffect.Value) + }; + + Color& aColor( it->moColor ); + OUString sColorScheme = aColor.getSchemeColorName(); + if( sColorScheme.isEmpty() ) + { + // RGB color and transparency value + aEffectsGrabBag.push_back(comphelper::makePropertyValue("RgbClr", aColor.getColor(rGraphicHelper, nFillPhClr))); + aEffectsGrabBag.push_back(comphelper::makePropertyValue("RgbClrTransparency", aColor.getTransparency())); + } + else + { + // scheme color with name and transformations + aEffectsGrabBag.push_back(comphelper::makePropertyValue("SchemeClr", sColorScheme)); + aEffectsGrabBag.push_back(comphelper::makePropertyValue("SchemeClrTransformations", aColor.getTransformations())); + } + aEffects.push_back(comphelper::makePropertyValue(aEffect.Name, comphelper::containerToSequence(aEffectsGrabBag))); + } + } + putPropertyToGrabBag("EffectProperties", uno::Any(comphelper::containerToSequence(aEffects))); + } + + // add 3D effects if any + Sequence< PropertyValue > aCamera3DEffects = get3DProperties().getCameraAttributes(); + Sequence< PropertyValue > aLightRig3DEffects = get3DProperties().getLightRigAttributes(); + Sequence< PropertyValue > aShape3DEffects = get3DProperties().getShape3DAttributes( rGraphicHelper, nFillPhClr ); + if( aCamera3DEffects.hasElements() || aLightRig3DEffects.hasElements() || aShape3DEffects.hasElements() ) + { + uno::Sequence a3DEffectsGrabBag = comphelper::InitPropertySequence( + { + {"Camera", uno::Any(aCamera3DEffects)}, + {"LightRig", uno::Any(aLightRig3DEffects)}, + {"Shape3D", uno::Any(aShape3DEffects)} + }); + putPropertyToGrabBag( "3DEffectProperties", Any( a3DEffectsGrabBag ) ); + } + + if( bIsCustomShape && getTextBody()) + { + + Sequence< PropertyValue > aTextCamera3DEffects = getTextBody()->get3DProperties().getCameraAttributes(); + Sequence< PropertyValue > aTextLightRig3DEffects = getTextBody()->get3DProperties().getLightRigAttributes(); + Sequence< PropertyValue > aTextShape3DEffects = getTextBody()->get3DProperties().getShape3DAttributes( rGraphicHelper, nFillPhClr ); + if( aTextCamera3DEffects.hasElements() || aTextLightRig3DEffects.hasElements() || aTextShape3DEffects.hasElements() ) + { + uno::Sequence aText3DEffectsGrabBag = comphelper::InitPropertySequence( + { + {"Camera", uno::Any(aTextCamera3DEffects)}, + {"LightRig", uno::Any(aTextLightRig3DEffects)}, + {"Shape3D", uno::Any(aTextShape3DEffects)} + }); + putPropertyToGrabBag( "Text3DEffectProperties", Any( aText3DEffectsGrabBag ) ); + } + } + + // store bitmap artistic effects in the grab bag + if( !mpGraphicPropertiesPtr->maBlipProps.maEffect.isEmpty() ) + putPropertyToGrabBag( "ArtisticEffectProperties", + Any( mpGraphicPropertiesPtr->maBlipProps.maEffect.getEffect() ) ); + } + + else if( mbLockedCanvas ) + { + //If we have aServiceName as "com.sun.star.drawing.GroupShape" and lockedCanvas + putPropertyToGrabBag( "LockedCanvas", Any( true ) ); + } + + // These can have a custom geometry, so position should be set here, + // after creation but before custom shape handling, using the position + // we got from the caller. + if (mbWps && aServiceName == "com.sun.star.drawing.LineShape" && !pParentGroupShape) + mxShape->setPosition(maPosition); + + if (bIsConnectorShape) + { + OUString sConnectorShapePresetTypeName( + reinterpret_cast( + mpCustomShapePropertiesPtr->getShapePresetTypeName().getConstArray()), + mpCustomShapePropertiesPtr->getShapePresetTypeName().getLength(), + RTL_TEXTENCODING_UTF8); + msConnectorName = sConnectorShapePresetTypeName; + + sal_Int32 nType = mpCustomShapePropertiesPtr->getShapePresetType(); + switch (nType) + { + case XML_line: + case XML_straightConnector1: + xSet->setPropertyValue("EdgeKind", Any(ConnectorType_LINE)); + break; + case XML_bentConnector2: + case XML_bentConnector3: + case XML_bentConnector4: + case XML_bentConnector5: + xSet->setPropertyValue("EdgeKind", Any(ConnectorType_STANDARD)); + break; + case XML_curvedConnector2: + case XML_curvedConnector3: + case XML_curvedConnector4: + case XML_curvedConnector5: + xSet->setPropertyValue("EdgeKind", Any(ConnectorType_CURVE)); + break; + default: + break; + } + } + + if( bIsCustomShape ) + { + if ( mbFlipH ) + mpCustomShapePropertiesPtr->setMirroredX( true ); + if ( mbFlipV ) + mpCustomShapePropertiesPtr->setMirroredY( true ); + if( getTextBody() ) + { + sal_Int32 nTextCameraZRotation = static_cast< sal_Int32 >( getTextBody()->get3DProperties().maCameraRotation.mnRevolution.get() ); + mpCustomShapePropertiesPtr->setTextCameraZRotateAngle( nTextCameraZRotation / 60000 ); + + sal_Int32 nTextRotateAngle = static_cast< sal_Int32 >( getTextBody()->getTextProperties().moRotation.get( 0 ) ); + + nTextRotateAngle -= mnDiagramRotation; + /* OOX measures text rotation clockwise in 1/60000th degrees, + relative to the containing shape. setTextRotateAngle wants degrees anticlockwise. */ + nTextRotateAngle = -1 * nTextRotateAngle / 60000; + + if (getTextBody()->getTextProperties().moUpright) + { + // When upright is set, we want the text without any rotation. + // But if we set 0 here, the text is still rotated if the + // shape containing it is rotated. + // Hence, we rotate the text into the opposite direction of + // the rotation of the shape, by as much as the shape was rotated. + mpCustomShapePropertiesPtr->setTextRotateAngle((mnRotation / 60000) + nTextRotateAngle); + // Also put the initial angles away in a GrabBag. + putPropertyToGrabBag("Upright", Any(true)); + putPropertyToGrabBag("nShapeRotationAtImport", Any(mnRotation / 60000)); + putPropertyToGrabBag("nTextRotationAtImport", Any(nTextRotateAngle)); + } + else + { + mpCustomShapePropertiesPtr->setTextRotateAngle(nTextRotateAngle); + } + + auto sHorzOverflow = getTextBody()->getTextProperties().msHorzOverflow; + if (!sHorzOverflow.isEmpty()) + putPropertyToGrabBag("horzOverflow", uno::Any(getTextBody()->getTextProperties().msHorzOverflow)); + auto nVertOverflow = getTextBody()->getTextProperties().msVertOverflow; + if (!nVertOverflow.isEmpty()) + putPropertyToGrabBag("vertOverflow", uno::Any(getTextBody()->getTextProperties().msVertOverflow)); + } + + // Note that the script oox/source/drawingml/customshapes/generatePresetsData.pl looks + // for these ==cscode== and ==csdata== markers, so don't "clean up" these SAL_INFOs + SAL_INFO("oox.cscode", "==cscode== shape name: '" << msName << "'"); + SAL_INFO("oox.csdata", "==csdata== shape name: '" << msName << "'"); + mpCustomShapePropertiesPtr->pushToPropSet(xSet, maSize); + + if (mpTextBody) + { + bool bIsPresetShape = !mpTextBody->getTextProperties().msPrst.isEmpty(); + if (bIsPresetShape) + { + OUString sClass; + const OUString sPresetType = mpTextBody->getTextProperties().msPrst; + sClass = PresetGeometryTypeNames::GetFontworkType( sPresetType ); + + lcl_createPresetShape( mxShape, sClass, sPresetType, mpCustomShapePropertiesPtr, mpTextBody, rGraphicHelper ); + } + } + } + else if( getTextBody() ) + getTextBody()->getTextProperties().pushVertSimulation(); + + // tdf#133037: a bit hackish: force Shape to rotate in the opposite direction the camera would rotate + PropertySet aPropertySet(mxShape); + if ( !bUseRotationTransform && (mnRotation != 0 || nCameraRotation != 0) ) + { + // use the same logic for rotation from VML exporter (SimpleShape::implConvertAndInsert at vmlshape.cxx) + Degree100 nAngle = NormAngle36000( Degree100((mnRotation - nCameraRotation) / -600) ); + aPropertySet.setAnyProperty( PROP_RotateAngle, Any( sal_Int32( nAngle.get() ) ) ); + aPropertySet.setAnyProperty( PROP_HoriOrientPosition, Any( maPosition.X ) ); + aPropertySet.setAnyProperty( PROP_VertOrientPosition, Any( maPosition.Y ) ); + } + + // in some cases, we don't have any text body. + if( mpTextBody && ( !bDoNotInsertEmptyTextBody || !mpTextBody->isEmpty() ) ) + { + Reference < XText > xText( mxShape, UNO_QUERY ); + if ( xText.is() ) // not every shape is supporting an XText interface (e.g. GroupShape) + { + TextCharacterProperties aCharStyleProperties; + if( const ShapeStyleRef* pFontRef = getShapeStyleRef( XML_fontRef ) ) + { + if( pFontRef->mnThemedIdx != 0 ) + { + if( pTheme ) + if( const TextCharacterProperties* pCharProps = pTheme->getFontStyle( pFontRef->mnThemedIdx ) ) + aCharStyleProperties.assignUsed( *pCharProps ); + SAL_INFO("oox.drawingml", "Shape::createAndInsert: use font color"); + if ( pFontRef->maPhClr.isUsed() ) + { + aCharStyleProperties.maFillProperties.maFillColor = pFontRef->maPhClr; + aCharStyleProperties.maFillProperties.moFillType.set(XML_solidFill); + } + } + } + xText->setString(""); + Reference < XTextCursor > xAt = xText->createTextCursor(); + getTextBody()->insertAt( rFilterBase, xText, xAt, aCharStyleProperties, mpMasterTextListStyle ); + + const TextParagraphVector& rParagraphs = getTextBody()->getParagraphs(); + if (!rParagraphs.empty()) + { + const std::shared_ptr& pParagraph = rParagraphs[0]; + if (pParagraph->getProperties().getParaAdjust()) + { + style::ParagraphAdjust eAdjust = *pParagraph->getProperties().getParaAdjust(); + if (eAdjust == style::ParagraphAdjust_CENTER) + { + // If the first paragraph is centered, then set the para adjustment of + // the shape itself to centered as well. + aPropertySet.setAnyProperty(PROP_ParaAdjust, uno::Any(eAdjust)); + } + } + + // tdf#144092 For empty textboxes push character styles & + // endParaRPr into the Shape's properties + if (rParagraphs.size() == 1 && pParagraph->getRuns().empty()) + { + TextCharacterProperties aTextCharacterProps{ pParagraph->getCharacterStyle( + aCharStyleProperties, *mpMasterTextListStyle, + getTextBody()->getTextListStyle()) }; + aTextCharacterProps.assignUsed(pParagraph->getEndProperties()); + aTextCharacterProps.pushToPropSet(aPropertySet, rFilterBase); + } + } + } + } + else if (mbTextBox) + { + // No drawingML text, but WPS text is expected: save the theme + // character color on the shape, then. + if(const ShapeStyleRef* pFontRef = getShapeStyleRef(XML_fontRef)) + { + ::Color nCharColor = pFontRef->maPhClr.getColor(rGraphicHelper); + aPropertySet.setAnyProperty(PROP_CharColor, uno::Any(nCharColor)); + } + } + + // Set glow effect properties + if ( aEffectProperties.maGlow.moGlowRad.has() ) + { + uno::Reference propertySet (mxShape, uno::UNO_QUERY); + propertySet->setPropertyValue("GlowEffectRadius", Any(convertEmuToHmm(aEffectProperties.maGlow.moGlowRad.get()))); + propertySet->setPropertyValue("GlowEffectColor", Any(aEffectProperties.maGlow.moGlowColor.getColor(rGraphicHelper))); + propertySet->setPropertyValue("GlowEffectTransparency", Any(aEffectProperties.maGlow.moGlowColor.getTransparency())); + } + + // Set soft edge effect properties + if (aEffectProperties.maSoftEdge.moRad.has()) + { + uno::Reference propertySet(mxShape, uno::UNO_QUERY); + propertySet->setPropertyValue( + "SoftEdgeRadius", Any(convertEmuToHmm(aEffectProperties.maSoftEdge.moRad.get()))); + } + + // Set the stroke and fill-color properties of the OLE shape + if (aServiceName == "com.sun.star.drawing.OLE2Shape" && mxOleObjectInfo + && !mxOleObjectInfo->maShapeId.isEmpty()) + if (::oox::vml::Drawing* pVmlDrawing = rFilterBase.getVmlDrawing()) + if (const ::oox::vml::ShapeBase* pVmlShape + = pVmlDrawing->getShapes().getShapeById(mxOleObjectInfo->maShapeId)) + { + // Apply stroke props from the type model of the related VML shape. + ShapePropertyMap aPropMap(rFilterBase.getModelObjectHelper()); + pVmlShape->getTypeModel().maStrokeModel.pushToPropMap( + aPropMap, rFilterBase.getGraphicHelper()); + // And, fill-color properties as well... + pVmlShape->getTypeModel().maFillModel.pushToPropMap( + aPropMap, rFilterBase.getGraphicHelper()); + PropertySet(xSet).setProperties(aPropMap); + } + } + + if (mxShape.is()) + { + finalizeXShape( rFilterBase, rxShapes ); + + if (mpTextBody) + mpTextBody->getTextProperties().readjustTextDistances(mxShape); + } + + return mxShape; +} + +void Shape::keepDiagramDrawing(XmlFilterBase& rFilterBase, const OUString& rFragmentPath) +{ + + sal_Int32 length = maDiagramDoms.getLength(); + maDiagramDoms.realloc(length + 1); + + // drawingValue[0] => dom, drawingValue[1] => Sequence of associated relationships + uno::Sequence diagramDrawing{ + uno::Any(rFilterBase.importFragment(rFragmentPath)), + uno::Any(resolveRelationshipsOfTypeFromOfficeDoc(rFilterBase, rFragmentPath, u"image")) + }; + + beans::PropertyValue* pValue = maDiagramDoms.getArray(); + pValue[length].Name = "OOXDrawing"; + pValue[length].Value <<= diagramDrawing; +} + +void Shape::keepDiagramCompatibilityInfo() +{ + try + { + if( !maDiagramDoms.hasElements() ) + return; + + Reference < XPropertySet > xSet( mxShape, UNO_QUERY_THROW ); + Reference < XPropertySetInfo > xSetInfo( xSet->getPropertySetInfo() ); + if ( !xSetInfo.is() ) + return; + + const OUString aGrabBagPropName = UNO_NAME_MISC_OBJ_INTEROPGRABBAG; + if( !xSetInfo->hasPropertyByName( aGrabBagPropName ) ) + return; + + Sequence < PropertyValue > aGrabBag; + xSet->getPropertyValue( aGrabBagPropName ) >>= aGrabBag; + + // We keep the previous items, if present + if ( aGrabBag.hasElements() ) + xSet->setPropertyValue( aGrabBagPropName, Any( comphelper::concatSequences(aGrabBag, maDiagramDoms) ) ); + else + xSet->setPropertyValue( aGrabBagPropName, Any( maDiagramDoms ) ); + } + catch( const Exception& ) + { + TOOLS_WARN_EXCEPTION( "oox.drawingml", "Shape::keepDiagramCompatibilityInfo" ); + } +} + +void Shape::convertSmartArtToMetafile(XmlFilterBase const & rFilterBase) +{ + try + { + Reference xSet(mxShape, UNO_QUERY_THROW); + + xSet->setPropertyValue("MoveProtect", Any(true)); + xSet->setPropertyValue("SizeProtect", Any(true)); + + // Replace existing shapes with a new Graphic Object rendered + // from them + Reference xShape(renderDiagramToGraphic(rFilterBase)); + Reference xShapes(mxShape, UNO_QUERY_THROW); + while (xShapes->hasElements()) + xShapes->remove(Reference(xShapes->getByIndex(0), UNO_QUERY_THROW)); + xShapes->add(xShape); + } + catch (const Exception&) + { + TOOLS_WARN_EXCEPTION("oox.drawingml", "Shape::convertSmartArtToMetafile"); + } +} + +Reference < XShape > Shape::renderDiagramToGraphic( XmlFilterBase const & rFilterBase ) +{ + Reference< XShape > xShape; + + try + { + if( !maDiagramDoms.hasElements() ) + return xShape; + + // Stream in which to place the rendered shape + SvMemoryStream aTempStream; + Reference < io::XStream > xStream( new utl::OStreamWrapper( aTempStream ) ); + Reference < io::XOutputStream > xOutputStream( xStream->getOutputStream() ); + + // Size of the rendering + awt::Size aActualSize = mxShape->getSize(); + Size aResolution(Application::GetDefaultDevice()->LogicToPixel(Size(100, 100), MapMode(MapUnit::MapCM))); + double fPixelsPer100thmm = static_cast < double > ( aResolution.Width() ) / 100000.0; + awt::Size aSize( static_cast < sal_Int32 > ( ( fPixelsPer100thmm * aActualSize.Width ) + 0.5 ), + static_cast < sal_Int32 > ( ( fPixelsPer100thmm * aActualSize.Height ) + 0.5 ) ); + + Sequence< PropertyValue > aFilterData{ + comphelper::makePropertyValue("PixelWidth", aSize.Width), + comphelper::makePropertyValue("PixelHeight", aSize.Height), + comphelper::makePropertyValue("LogicalWidth", aActualSize.Width), + comphelper::makePropertyValue("LogicalHeight", aActualSize.Height) + }; + + Sequence < PropertyValue > aDescriptor{ + comphelper::makePropertyValue("OutputStream", xOutputStream), + comphelper::makePropertyValue("FilterName", OUString("SVM")), // Rendering format + comphelper::makePropertyValue("FilterData", aFilterData) + }; + + Reference < lang::XComponent > xSourceDoc( mxShape, UNO_QUERY_THROW ); + Reference < XGraphicExportFilter > xGraphicExporter = GraphicExportFilter::create( rFilterBase.getComponentContext() ); + xGraphicExporter->setSourceDocument( xSourceDoc ); + xGraphicExporter->filter( aDescriptor ); + + aTempStream.Seek( STREAM_SEEK_TO_BEGIN ); + + Graphic aGraphic; + GraphicFilter aFilter( false ); + if ( aFilter.ImportGraphic( aGraphic, u"", aTempStream, GRFILTER_FORMAT_NOTFOUND, nullptr, GraphicFilterImportFlags::NONE ) != ERRCODE_NONE ) + { + SAL_WARN( "oox.drawingml", "Shape::renderDiagramToGraphic: Unable to import rendered stream into graphic object" ); + return xShape; + } + + Reference < graphic::XGraphic > xGraphic( aGraphic.GetXGraphic() ); + Reference < lang::XMultiServiceFactory > xServiceFact( rFilterBase.getModel(), UNO_QUERY_THROW ); + xShape.set( xServiceFact->createInstance( "com.sun.star.drawing.GraphicObjectShape" ), UNO_QUERY_THROW ); + Reference < XPropertySet > xPropSet( xShape, UNO_QUERY_THROW ); + xPropSet->setPropertyValue( "Graphic", Any( xGraphic ) ); + xPropSet->setPropertyValue( "MoveProtect", Any( true ) ); + xPropSet->setPropertyValue( "SizeProtect", Any( true ) ); + xPropSet->setPropertyValue( "Name", Any( OUString( "RenderedShapes" ) ) ); + } + catch( const Exception& ) + { + TOOLS_WARN_EXCEPTION( "oox.drawingml", "Shape::renderDiagramToGraphic" ); + } + + return xShape; +} + +void Shape::setTextBody(const TextBodyPtr & pTextBody) +{ + mpTextBody = pTextBody; +} + +void Shape::setMasterTextListStyle( const TextListStylePtr& pMasterTextListStyle ) +{ + SAL_INFO("oox.drawingml", "Shape::setMasterTextListStyle: Set master text list style to shape id='" << msId << "'"); + + mpMasterTextListStyle = pMasterTextListStyle; +} + +OUString Shape::finalizeServiceName( XmlFilterBase& rFilter, const OUString& rServiceName, const awt::Rectangle& rShapeRect ) +{ + OUString aServiceName = rServiceName; + switch( meFrameType ) + { + case FRAMETYPE_OLEOBJECT: + { + awt::Size aOleSize( rShapeRect.Width, rShapeRect.Height ); + if( rFilter.getOleObjectHelper().importOleObject( maShapeProperties, *mxOleObjectInfo, aOleSize ) ) + aServiceName = "com.sun.star.drawing.OLE2Shape"; + + // get the path to the representation graphic + OUString aGraphicPath; + if( !mxOleObjectInfo->maShapeId.isEmpty() ) + if( ::oox::vml::Drawing* pVmlDrawing = rFilter.getVmlDrawing() ) + if( const ::oox::vml::ShapeBase* pVmlShape = pVmlDrawing->getShapes().getShapeById( mxOleObjectInfo->maShapeId ) ) + aGraphicPath = pVmlShape->getGraphicPath(); + + // import and store the graphic + if( !aGraphicPath.isEmpty() ) + { + // Transfer shape's width and height to graphicsfilter (can be used by WMF/EMF) + WmfExternal aExtHeader; + aExtHeader.mapMode = 8; // MM_ANISOTROPIC + aExtHeader.xExt = rShapeRect.Width; + aExtHeader.yExt = rShapeRect.Height; + + Reference< graphic::XGraphic > xGraphic = rFilter.getGraphicHelper().importEmbeddedGraphic( aGraphicPath, &aExtHeader ); + if( xGraphic.is() ) + maShapeProperties.setProperty(PROP_Graphic, xGraphic); + } + } + break; + + default:; + } + return aServiceName; +} + +void Shape::finalizeXShape( XmlFilterBase& rFilter, const Reference< XShapes >& rxShapes ) +{ + switch( meFrameType ) + { + case FRAMETYPE_CHART: + { + OSL_ENSURE( !mxChartShapeInfo->maFragmentPath.isEmpty(), "Shape::finalizeXShape - missing chart fragment" ); + if( mxShape.is() && !mxChartShapeInfo->maFragmentPath.isEmpty() ) try + { + // set the chart2 OLE class ID at the OLE shape + PropertySet aShapeProp( mxShape ); + aShapeProp.setProperty( PROP_CLSID, OUString( "12dcae26-281f-416f-a234-c3086127382e" ) ); + + // get the XModel interface of the embedded object from the OLE shape + Reference< frame::XModel > xDocModel; + aShapeProp.getProperty( xDocModel, PROP_Model ); + Reference< chart2::XChartDocument > xChartDoc( xDocModel, UNO_QUERY_THROW ); + + // load the chart data from the XML fragment +#if ENABLE_WASM_STRIP_CHART + (void) rFilter; + (void) rxShapes; +#else + // WASM_CHART change + // TODO: Instead of using convertFromModel an alternative may be + // added to convert not to Chart/OLE SdrObejct, but to GraphicObject + // with the Chart visualization. There should be a preview available + // in the imported chart data + bool bMSO2007Doc = rFilter.isMSO2007Document(); + chart::ChartSpaceModel aModel(bMSO2007Doc); + rtl::Reference pChartSpaceFragment = new chart::ChartSpaceFragment( + rFilter, mxChartShapeInfo->maFragmentPath, aModel ); + const OUString aThemeOverrideFragmentPath( pChartSpaceFragment-> + getFragmentPathFromFirstTypeFromOfficeDoc(u"themeOverride") ); + rFilter.importFragment( pChartSpaceFragment ); + ::oox::ppt::PowerPointImport *pPowerPointImport = + dynamic_cast< ::oox::ppt::PowerPointImport* >(&rFilter); + + // The original theme. + ThemePtr pTheme; + + if (!aThemeOverrideFragmentPath.isEmpty() && pPowerPointImport) + { + // Handle theme override. + uno::Reference< xml::sax::XFastSAXSerializable > xDoc( + rFilter.importFragment(aThemeOverrideFragmentPath), uno::UNO_QUERY_THROW); + pTheme = pPowerPointImport->getActualSlidePersist()->getTheme(); + auto pThemeOverride = std::make_shared(*pTheme); + rFilter.importFragment( + new ThemeOverrideFragmentHandler(rFilter, aThemeOverrideFragmentPath, + *pThemeOverride), + xDoc); + pPowerPointImport->getActualSlidePersist()->setTheme(pThemeOverride); + } + + // convert imported chart model to chart document + Reference< drawing::XShapes > xExternalPage; + if( !mxChartShapeInfo->mbEmbedShapes ) + xExternalPage = rxShapes; + if( rFilter.getChartConverter() ) + { + rFilter.getChartConverter()->convertFromModel( rFilter, aModel, xChartDoc, xExternalPage, mxShape->getPosition(), mxShape->getSize() ); + if( !xChartDoc->hasInternalDataProvider() ) + { + Reference< chart2::data::XDataReceiver > xDataRec( xChartDoc, UNO_QUERY ); + Reference< chart2::data::XDataSource > xData = xDataRec->getUsedData(); + if( !xData->getDataSequences().hasElements() || !xData->getDataSequences()[0]->getValues().is() || + !xData->getDataSequences()[0]->getValues()->getData().hasElements() ) + { + rFilter.useInternalChartDataTable( true ); + rFilter.getChartConverter()->convertFromModel( rFilter, aModel, xChartDoc, xExternalPage, mxShape->getPosition(), mxShape->getSize() ); + rFilter.useInternalChartDataTable( false ); + } + } + + } + + if (!aThemeOverrideFragmentPath.isEmpty() && pPowerPointImport) + { + // Restore the original theme. + pPowerPointImport->getActualSlidePersist()->setTheme(pTheme); + } +#endif + } + catch( Exception& ) + { + } + } + break; + + default:; + } +} + +void Shape::putPropertyToGrabBag( const OUString& sPropertyName, const Any& aPropertyValue ) +{ + PropertyValue aNewProperty; + aNewProperty.Name = sPropertyName; + aNewProperty.Value = aPropertyValue; + putPropertyToGrabBag( aNewProperty ); +} + +void Shape::putPropertyToGrabBag( const PropertyValue& pProperty ) +{ + Reference< XPropertySet > xSet( mxShape, UNO_QUERY ); + Reference< XPropertySetInfo > xSetInfo( xSet->getPropertySetInfo() ); + const OUString aGrabBagPropName = UNO_NAME_MISC_OBJ_INTEROPGRABBAG; + if( mxShape.is() && xSet.is() && xSetInfo.is() && xSetInfo->hasPropertyByName( aGrabBagPropName ) ) + { + Sequence< PropertyValue > aGrabBag; + xSet->getPropertyValue( aGrabBagPropName ) >>= aGrabBag; + + sal_Int32 length = aGrabBag.getLength(); + aGrabBag.realloc( length + 1 ); + aGrabBag.getArray()[length] = pProperty; + + xSet->setPropertyValue( aGrabBagPropName, Any( aGrabBag ) ); + } +} + +void Shape::putPropertiesToGrabBag( const Sequence< PropertyValue >& aProperties ) +{ + Reference< XPropertySet > xSet( mxShape, UNO_QUERY ); + Reference< XPropertySetInfo > xSetInfo( xSet->getPropertySetInfo() ); + const OUString aGrabBagPropName = UNO_NAME_MISC_OBJ_INTEROPGRABBAG; + if( !(mxShape.is() && xSet.is() && xSetInfo.is() && xSetInfo->hasPropertyByName( aGrabBagPropName )) ) + return; + + // get existing grab bag + Sequence< PropertyValue > aGrabBag; + xSet->getPropertyValue( aGrabBagPropName ) >>= aGrabBag; + + std::vector aVec; + aVec.reserve(aProperties.getLength()); + + // put the new items + std::transform(aProperties.begin(), aProperties.end(), std::back_inserter(aVec), + [](const PropertyValue& rProp) { + PropertyValue aProp; + aProp.Name = rProp.Name; + aProp.Value = rProp.Value; + return aProp; + }); + + // put it back to the shape + xSet->setPropertyValue( aGrabBagPropName, Any( comphelper::concatSequences(aGrabBag, aVec) ) ); +} + +FillProperties Shape::getActualFillProperties(const Theme* pTheme, const FillProperties* pParentShapeFillProps) const +{ + FillProperties aFillProperties; + aFillProperties.moFillType = XML_noFill; + + // Reference shape properties + aFillProperties.assignUsed( *mpShapeRefFillPropPtr ); + + // Theme + if( pTheme != nullptr ) + { + if( const ShapeStyleRef* pFillRef = getShapeStyleRef( XML_fillRef ) ) + { + if( const FillProperties* pFillProps = pTheme->getFillStyle( pFillRef->mnThemedIdx ) ) + aFillProperties.assignUsed( *pFillProps ); + } + } + + // Properties specified directly for this shape + aFillProperties.assignUsed(getFillProperties()); + + // Parent shape's properties + if ( pParentShapeFillProps != nullptr) + if( getFillProperties().moFillType.has() && getFillProperties().moFillType.get() == XML_grpFill ) + aFillProperties.assignUsed( *pParentShapeFillProps ); + + return aFillProperties; +} + +LineProperties Shape::getActualLineProperties(const Theme* pTheme) const +{ + LineProperties aLineProperties; + aLineProperties.maLineFill.moFillType = XML_noFill; + + // Reference shape properties + aLineProperties.assignUsed( *mpShapeRefLinePropPtr ); + + // Theme + if( pTheme != nullptr ) + { + if( const ShapeStyleRef* pLineRef = getShapeStyleRef( XML_lnRef ) ) + { + if( const LineProperties* pLineProps = pTheme->getLineStyle( pLineRef->mnThemedIdx ) ) + aLineProperties.assignUsed( *pLineProps ); + } + } + + // Properties specified directly for this shape + aLineProperties.assignUsed( getLineProperties() ); + + return aLineProperties; +} + +EffectProperties Shape::getActualEffectProperties(const Theme* pTheme) const +{ + EffectProperties aEffectProperties; + + // Reference shape properties + aEffectProperties.assignUsed( *mpShapeRefEffectPropPtr ); + + // Theme + if( pTheme != nullptr ) + { + if( const ShapeStyleRef* pEffectRef = getShapeStyleRef( XML_effectRef ) ) + { + if( const EffectProperties* pEffectProps = pTheme->getEffectStyle( pEffectRef->mnThemedIdx ) ) + aEffectProperties.assignUsed( *pEffectProps ); + } + } + + // Properties specified directly for this shape + aEffectProperties.assignUsed ( getEffectProperties() ); + + return aEffectProperties; +} + +uno::Sequence< uno::Sequence< uno::Any > > Shape::resolveRelationshipsOfTypeFromOfficeDoc(core::XmlFilterBase& rFilter, const OUString& sFragment, std::u16string_view sType ) +{ + uno::Sequence< uno::Sequence< uno::Any > > xRelListTemp; + sal_Int32 counter = 0; + + core::RelationsRef xRels = rFilter.importRelations( sFragment ); + if ( xRels ) + { + core::RelationsRef xImageRels = xRels->getRelationsFromTypeFromOfficeDoc( sType ); + if ( xImageRels ) + { + xRelListTemp.realloc( xImageRels->size() ); + auto pxRelListTemp = xRelListTemp.getArray(); + for (auto const& imageRel : *xImageRels) + { + uno::Sequence< uno::Any > diagramRelTuple (3); + auto pdiagramRelTuple = diagramRelTuple.getArray(); + // [0] => RID, [1] => InputStream [2] => extension + OUString sRelId = imageRel.second.maId; + + pdiagramRelTuple[0] <<= sRelId; + OUString sTarget = xImageRels->getFragmentPathFromRelId( sRelId ); + + uno::Reference< io::XInputStream > xImageInputStrm( rFilter.openInputStream( sTarget ), uno::UNO_SET_THROW ); + StreamDataSequence dataSeq; + if ( rFilter.importBinaryData( dataSeq, sTarget ) ) + { + pdiagramRelTuple[1] <<= dataSeq; + } + + pdiagramRelTuple[2] <<= sTarget.copy( sTarget.lastIndexOf(".") ); + + pxRelListTemp[counter] = diagramRelTuple; + ++counter; + } + xRelListTemp.realloc(counter); + + } + } + return xRelListTemp; +} + +void Shape::cloneFillProperties() +{ + auto pFillProperties = std::make_shared(); + pFillProperties->assignUsed(*mpFillPropertiesPtr); + mpFillPropertiesPtr = pFillProperties; +} +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/drawingml/shape3dproperties.cxx b/oox/source/drawingml/shape3dproperties.cxx new file mode 100644 index 000000000..07ba56579 --- /dev/null +++ b/oox/source/drawingml/shape3dproperties.cxx @@ -0,0 +1,392 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include +#include +#include + +#include +#include +#include + +using namespace ::com::sun::star; +using namespace ::com::sun::star::drawing; +using namespace ::com::sun::star::graphic; + + +namespace oox::drawingml { + +OUString Generic3DProperties::getCameraPrstName( sal_Int32 nElement ) +{ + switch( nElement ) + { + case XML_legacyObliqueTopLeft: return "legacyObliqueTopLeft"; + case XML_legacyObliqueTop: return "legacyObliqueTop"; + case XML_legacyObliqueTopRight: return "legacyObliqueTopRight"; + case XML_legacyObliqueLeft: return "legacyObliqueLeft"; + case XML_legacyObliqueFront: return "legacyObliqueFront"; + case XML_legacyObliqueRight: return "legacyObliqueRight"; + case XML_legacyObliqueBottomLeft: return "legacyObliqueBottomLeft"; + case XML_legacyObliqueBottom: return "legacyObliqueBottom"; + case XML_legacyObliqueBottomRight: return "legacyObliqueBottomRight"; + case XML_legacyPerspectiveTopLeft: return "legacyPerspectiveTopLeft"; + case XML_legacyPerspectiveTop: return "legacyPerspectiveTop"; + case XML_legacyPerspectiveTopRight: return "legacyPerspectiveTopRight"; + case XML_legacyPerspectiveLeft: return "legacyPerspectiveLeft"; + case XML_legacyPerspectiveFront: return "legacyPerspectiveFront"; + case XML_legacyPerspectiveRight: return "legacyPerspectiveRight"; + case XML_legacyPerspectiveBottomLeft: return "legacyPerspectiveBottomLeft"; + case XML_legacyPerspectiveBottom: return "legacyPerspectiveBottom"; + case XML_legacyPerspectiveBottomRight: return "legacyPerspectiveBottomRight"; + case XML_orthographicFront: return "orthographicFront"; + case XML_isometricTopUp: return "isometricTopUp"; + case XML_isometricTopDown: return "isometricTopDown"; + case XML_isometricBottomUp: return "isometricBottomUp"; + case XML_isometricBottomDown: return "isometricBottomDown"; + case XML_isometricLeftUp: return "isometricLeftUp"; + case XML_isometricLeftDown: return "isometricLeftDown"; + case XML_isometricRightUp: return "isometricRightUp"; + case XML_isometricRightDown: return "isometricRightDown"; + case XML_isometricOffAxis1Left: return "isometricOffAxis1Left"; + case XML_isometricOffAxis1Right: return "isometricOffAxis1Right"; + case XML_isometricOffAxis1Top: return "isometricOffAxis1Top"; + case XML_isometricOffAxis2Left: return "isometricOffAxis2Left"; + case XML_isometricOffAxis2Right: return "isometricOffAxis2Right"; + case XML_isometricOffAxis2Top: return "isometricOffAxis2Top"; + case XML_isometricOffAxis3Left: return "isometricOffAxis3Left"; + case XML_isometricOffAxis3Right: return "isometricOffAxis3Right"; + case XML_isometricOffAxis3Bottom: return "isometricOffAxis3Bottom"; + case XML_isometricOffAxis4Left: return "isometricOffAxis4Left"; + case XML_isometricOffAxis4Right: return "isometricOffAxis4Right"; + case XML_isometricOffAxis4Bottom: return "isometricOffAxis4Bottom"; + case XML_obliqueTopLeft: return "obliqueTopLeft"; + case XML_obliqueTop: return "obliqueTop"; + case XML_obliqueTopRight: return "obliqueTopRight"; + case XML_obliqueLeft: return "obliqueLeft"; + case XML_obliqueRight: return "obliqueRight"; + case XML_obliqueBottomLeft: return "obliqueBottomLeft"; + case XML_obliqueBottom: return "obliqueBottom"; + case XML_obliqueBottomRight: return "obliqueBottomRight"; + case XML_perspectiveFront: return "perspectiveFront"; + case XML_perspectiveLeft: return "perspectiveLeft"; + case XML_perspectiveRight: return "perspectiveRight"; + case XML_perspectiveAbove: return "perspectiveAbove"; + case XML_perspectiveBelow: return "perspectiveBelow"; + case XML_perspectiveAboveLeftFacing: return "perspectiveAboveLeftFacing"; + case XML_perspectiveAboveRightFacing: return "perspectiveAboveRightFacing"; + case XML_perspectiveContrastingLeftFacing: return "perspectiveContrastingLeftFacing"; + case XML_perspectiveContrastingRightFacing: return "perspectiveContrastingRightFacing"; + case XML_perspectiveHeroicLeftFacing: return "perspectiveHeroicLeftFacing"; + case XML_perspectiveHeroicRightFacing: return "perspectiveHeroicRightFacing"; + case XML_perspectiveHeroicExtremeLeftFacing: return "perspectiveHeroicExtremeLeftFacing"; + case XML_perspectiveHeroicExtremeRightFacing: return "perspectiveHeroicExtremeRightFacing"; + case XML_perspectiveRelaxed: return "perspectiveRelaxed"; + case XML_perspectiveRelaxedModerately: return "perspectiveRelaxedModerately"; + } + SAL_WARN( "oox.drawingml", "Generic3DProperties::getCameraPrstName - unexpected prst type" ); + return OUString(); +} + +OUString Generic3DProperties::getLightRigName( sal_Int32 nElement ) +{ + switch( nElement ) + { + case XML_legacyFlat1: return "legacyFlat1"; + case XML_legacyFlat2: return "legacyFlat2"; + case XML_legacyFlat3: return "legacyFlat3"; + case XML_legacyFlat4: return "legacyFlat4"; + case XML_legacyNormal1: return "legacyNormal1"; + case XML_legacyNormal2: return "legacyNormal2"; + case XML_legacyNormal3: return "legacyNormal3"; + case XML_legacyNormal4: return "legacyNormal4"; + case XML_legacyHarsh1: return "legacyHarsh1"; + case XML_legacyHarsh2: return "legacyHarsh2"; + case XML_legacyHarsh3: return "legacyHarsh3"; + case XML_legacyHarsh4: return "legacyHarsh4"; + case XML_threePt: return "threePt"; + case XML_balanced: return "balanced"; + case XML_soft: return "soft"; + case XML_harsh: return "harsh"; + case XML_flood: return "flood"; + case XML_contrasting: return "contrasting"; + case XML_morning: return "morning"; + case XML_sunrise: return "sunrise"; + case XML_sunset: return "sunset"; + case XML_chilly: return "chilly"; + case XML_freezing: return "freezing"; + case XML_flat: return "flat"; + case XML_twoPt: return "twoPt"; + case XML_glow: return "glow"; + case XML_brightRoom: return "brightRoom"; + } + SAL_WARN( "oox.drawingml", "Generic3DProperties::getLightRigName - unexpected token" ); + return OUString(); +} + +OUString Generic3DProperties::getLightRigDirName( sal_Int32 nElement ) +{ + switch( nElement ) + { + case XML_tl: return "tl"; + case XML_t: return "t"; + case XML_tr: return "tr"; + case XML_l: return "l"; + case XML_r: return "r"; + case XML_bl: return "bl"; + case XML_b: return "b"; + case XML_br: return "br"; + } + SAL_WARN( "oox.drawingml", "Generic3DProperties::getLightRigDirName - unexpected token" ); + return OUString(); +} + +OUString Generic3DProperties::getBevelPresetTypeString( sal_Int32 nType ) +{ + switch (nType) + { + case XML_relaxedInset: return "relaxedInset"; + case XML_circle: return "circle"; + case XML_slope: return "slope"; + case XML_cross: return "cross"; + case XML_angle: return "angle"; + case XML_softRound: return "softRound"; + case XML_convex: return "convex"; + case XML_coolSlant: return "coolSlant"; + case XML_divot: return "divot"; + case XML_riblet: return "riblet"; + case XML_hardEdge: return "hardEdge"; + case XML_artDeco: return "artDeco"; + } + SAL_WARN( "oox.drawingml", "Generic3DProperties::getBevelPresetTypeString - unexpected token" ); + return OUString(); +} + +OUString Generic3DProperties::getPresetMaterialTypeString( sal_Int32 nType ) +{ + switch (nType) + { + case XML_legacyMatte: return "legacyMatte"; + case XML_legacyPlastic: return "legacyPlastic"; + case XML_legacyMetal: return "legacyMetal"; + case XML_legacyWireframe: return "legacyWireframe"; + case XML_matte: return "matte"; + case XML_plastic: return "plastic"; + case XML_metal: return "metal"; + case XML_warmMatte: return "warmMatte"; + case XML_translucentPowder: return "translucentPowder"; + case XML_powder: return "powder"; + case XML_dkEdge: return "dkEdge"; + case XML_softEdge: return "softEdge"; + case XML_clear: return "clear"; + case XML_flat: return "flat"; + case XML_softmetal: return "softmetal"; + case XML_none: return "none"; + } + SAL_WARN( "oox.drawingml", "Generic3DProperties::getPresetMaterialTypeString - unexpected token" ); + return OUString(); +} + +css::uno::Sequence< css::beans::PropertyValue > Generic3DProperties::getCameraAttributes() +{ + css::uno::Sequence aSeq(6); + auto pSeq = aSeq.getArray(); + sal_Int32 nSize = 0; + if( mfFieldOfVision.has() ) + { + pSeq[nSize].Name = "fov"; + pSeq[nSize].Value <<= mfFieldOfVision.use(); + nSize++; + } + if( mfZoom.has() ) + { + pSeq[nSize].Name = "zoom"; + pSeq[nSize].Value <<= mfZoom.use(); + nSize++; + } + if( mnPreset.has() ) + { + pSeq[nSize].Name = "prst"; + pSeq[nSize].Value <<= getCameraPrstName( mnPreset.use() ); + nSize++; + } + if( maCameraRotation.mnLatitude.has() ) + { + pSeq[nSize].Name = "rotLat"; + pSeq[nSize].Value <<= maCameraRotation.mnLatitude.use(); + nSize++; + } + if( maCameraRotation.mnLongitude.has() ) + { + pSeq[nSize].Name = "rotLon"; + pSeq[nSize].Value <<= maCameraRotation.mnLongitude.use(); + nSize++; + } + if( maCameraRotation.mnRevolution.has() ) + { + pSeq[nSize].Name = "rotRev"; + pSeq[nSize].Value <<= maCameraRotation.mnRevolution.use(); + nSize++; + } + aSeq.realloc( nSize ); + return aSeq; +} + +css::uno::Sequence< css::beans::PropertyValue > Generic3DProperties::getLightRigAttributes() +{ + css::uno::Sequence aSeq(5); + auto pSeq = aSeq.getArray(); + sal_Int32 nSize = 0; + if( mnLightRigDirection.has() ) + { + pSeq[nSize].Name = "dir"; + pSeq[nSize].Value <<= getLightRigDirName( mnLightRigDirection.use() ); + nSize++; + } + if( mnLightRigType.has() ) + { + pSeq[nSize].Name = "rig"; + pSeq[nSize].Value <<= getLightRigName( mnLightRigType.use() ); + nSize++; + } + if( maLightRigRotation.mnLatitude.has() ) + { + pSeq[nSize].Name = "rotLat"; + pSeq[nSize].Value <<= maLightRigRotation.mnLatitude.use(); + nSize++; + } + if( maLightRigRotation.mnLongitude.has() ) + { + pSeq[nSize].Name = "rotLon"; + pSeq[nSize].Value <<= maLightRigRotation.mnLongitude.use(); + nSize++; + } + if( maLightRigRotation.mnRevolution.has() ) + { + pSeq[nSize].Name = "rotRev"; + pSeq[nSize].Value <<= maLightRigRotation.mnRevolution.use(); + nSize++; + } + aSeq.realloc( nSize ); + return aSeq; +} + +css::uno::Sequence< css::beans::PropertyValue > Generic3DProperties::getBevelAttributes( BevelProperties rProps ) +{ + css::uno::Sequence aSeq(3); + auto pSeq = aSeq.getArray(); + sal_Int32 nSize = 0; + if( rProps.mnPreset.has() ) + { + pSeq[nSize].Name = "prst"; + pSeq[nSize].Value <<= getBevelPresetTypeString( rProps.mnPreset.use() ); + nSize++; + } + if( rProps.mnWidth.has() ) + { + pSeq[nSize].Name = "w"; + pSeq[nSize].Value <<= rProps.mnWidth.use(); + nSize++; + } + if( rProps.mnHeight.has() ) + { + pSeq[nSize].Name = "h"; + pSeq[nSize].Value <<= rProps.mnHeight.use(); + nSize++; + } + aSeq.realloc( nSize ); + return aSeq; +} + +css::uno::Sequence< css::beans::PropertyValue > Generic3DProperties::getColorAttributes( + const Color& rColor, const GraphicHelper& rGraphicHelper, ::Color rPhClr ) +{ + const OUString& sColorScheme = rColor.getSchemeColorName(); + if( sColorScheme.isEmpty() ) + { + // RGB color and transparency value + return { comphelper::makePropertyValue("rgbClr", rColor.getColor( rGraphicHelper, rPhClr )), + comphelper::makePropertyValue("rgbClrTransparency", rColor.getTransparency()) }; + } + // scheme color with name and transformations + return { comphelper::makePropertyValue("schemeClr", sColorScheme), + comphelper::makePropertyValue("schemeClrTransformations", + rColor.getTransformations()) }; +} + +css::uno::Sequence< css::beans::PropertyValue > Generic3DProperties::getShape3DAttributes( + const GraphicHelper& rGraphicHelper, ::Color rPhClr ) +{ + css::uno::Sequence aSeq(8); + auto pSeq = aSeq.getArray(); + sal_Int32 nSize = 0; + if( mnExtrusionH.has() ) + { + pSeq[nSize].Name = "extrusionH"; + pSeq[nSize].Value <<= mnExtrusionH.use(); + nSize++; + } + if( mnContourW.has() ) + { + pSeq[nSize].Name = "contourW"; + pSeq[nSize].Value <<= mnContourW.use(); + nSize++; + } + if( mnShapeZ.has() ) + { + pSeq[nSize].Name = "z"; + pSeq[nSize].Value <<= mnShapeZ.use(); + nSize++; + } + if( mnMaterial.has() ) + { + pSeq[nSize].Name = "prstMaterial"; + pSeq[nSize].Value <<= getPresetMaterialTypeString( mnMaterial.use() ); + nSize++; + } + if( maTopBevelProperties.has() ) + { + pSeq[nSize].Name = "bevelT"; + pSeq[nSize].Value <<= getBevelAttributes( maTopBevelProperties.use() ); + nSize++; + } + if( maBottomBevelProperties.has() ) + { + pSeq[nSize].Name = "bevelB"; + pSeq[nSize].Value <<= getBevelAttributes( maBottomBevelProperties.use() ); + nSize++; + } + if( maExtrusionColor.isUsed() ) + { + pSeq[nSize].Name = "extrusionClr"; + pSeq[nSize].Value <<= getColorAttributes( maExtrusionColor, rGraphicHelper, rPhClr ); + nSize++; + } + if( maContourColor.isUsed() ) + { + pSeq[nSize].Name = "contourClr"; + pSeq[nSize].Value <<= getColorAttributes( maContourColor, rGraphicHelper, rPhClr ); + nSize++; + } + aSeq.realloc( nSize ); + return aSeq; +} + +} // namespace oox + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/drawingml/shapecontext.cxx b/oox/source/drawingml/shapecontext.cxx new file mode 100644 index 000000000..e0cbf9343 --- /dev/null +++ b/oox/source/drawingml/shapecontext.cxx @@ -0,0 +1,134 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include "hyperlinkcontext.hxx" +#include +#include +#include + +using namespace oox::core; +using namespace ::com::sun::star; +using namespace ::com::sun::star::uno; +using namespace ::com::sun::star::drawing; +using namespace ::com::sun::star::beans; +using namespace ::com::sun::star::text; +using namespace ::com::sun::star::xml::sax; + +namespace oox::drawingml { + +// CT_Shape +ShapeContext::ShapeContext( ContextHandler2Helper const & rParent, ShapePtr const & pMasterShapePtr, ShapePtr const & pShapePtr ) +: ContextHandler2( rParent ) +, mpMasterShapePtr( pMasterShapePtr ) +, mpShapePtr( pShapePtr ) +{ + if( mpMasterShapePtr && mpShapePtr ) + mpMasterShapePtr->addChild( mpShapePtr ); +} + +ShapeContext::~ShapeContext() +{ +} + +ContextHandlerRef ShapeContext::onCreateContext( sal_Int32 aElementToken, const AttributeList& rAttribs ) +{ + switch( getBaseToken( aElementToken ) ) + { + // nvSpPr CT_ShapeNonVisual begin +// case XML_drElemPr: +// break; + case XML_cNvPr: + { + mpShapePtr->setHidden( rAttribs.getBool( XML_hidden, false ) ); + mpShapePtr->setId( rAttribs.getString( XML_id ).get() ); + mpShapePtr->setName( rAttribs.getString( XML_name ).get() ); + mpShapePtr->setDescription( rAttribs.getString( XML_descr ).get() ); + break; + } + case XML_hlinkMouseOver: + case XML_hlinkClick: + return new HyperLinkContext( *this, rAttribs, getShape()->getShapeProperties() ); + case XML_ph: + mpShapePtr->setSubType( rAttribs.getToken( XML_type, XML_obj ) ); + if( rAttribs.hasAttribute( XML_idx ) ) + mpShapePtr->setSubTypeIndex( rAttribs.getString( XML_idx ).get().toInt32() ); + break; + // nvSpPr CT_ShapeNonVisual end + + case XML_spPr: + return new ShapePropertiesContext( *this, *mpShapePtr ); + + case XML_style: + return new ShapeStyleContext( *this, *mpShapePtr ); + + case XML_txBody: + case XML_txbxContent: + { + if (!mpShapePtr->getTextBody()) + mpShapePtr->setTextBody( std::make_shared() ); + return new TextBodyContext( *this, mpShapePtr ); + } + case XML_txXfrm: + { + const TextBodyPtr& rShapePtr = mpShapePtr->getTextBody(); + if (rShapePtr) + rShapePtr->getTextProperties().moRotation = rAttribs.getInteger( XML_rot ); + return nullptr; + } + case XML_cNvSpPr: + break; + case XML_spLocks: + break; + case XML_bodyPr: + if (!mpShapePtr->getTextBody()) + mpShapePtr->setTextBody( std::make_shared() ); + return new TextBodyPropertiesContext( *this, rAttribs, mpShapePtr ); + case XML_txbx: + break; + case XML_cNvPicPr: + break; + case XML_nvPicPr: + case XML_picLocks: + break; + case XML_relIds: + break; + case XML_nvSpPr: + break; + default: + SAL_WARN("oox", "ShapeContext::onCreateContext: unhandled element: " << getBaseToken(aElementToken)); + break; + } + + return this; +} + +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/drawingml/shapegroupcontext.cxx b/oox/source/drawingml/shapegroupcontext.cxx new file mode 100644 index 000000000..1a9cb4113 --- /dev/null +++ b/oox/source/drawingml/shapegroupcontext.cxx @@ -0,0 +1,117 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +using namespace oox::core; +using namespace ::com::sun::star; +using namespace ::com::sun::star::uno; +using namespace ::com::sun::star::drawing; +using namespace ::com::sun::star::beans; +using namespace ::com::sun::star::xml::sax; + +namespace oox::drawingml { + +ShapeGroupContext::ShapeGroupContext( FragmentHandler2 const & rParent, ShapePtr const & pMasterShapePtr, ShapePtr const & pGroupShapePtr ) +: FragmentHandler2( rParent ) +, mpGroupShapePtr( pGroupShapePtr ) +{ + if( pMasterShapePtr ) + mpGroupShapePtr->setWps(pMasterShapePtr->getWps()); + if( pMasterShapePtr && mpGroupShapePtr ) + pMasterShapePtr->addChild( mpGroupShapePtr ); +} + +ShapeGroupContext::~ShapeGroupContext() +{ +} + +ContextHandlerRef ShapeGroupContext::onCreateContext( sal_Int32 aElementToken, const AttributeList& rAttribs ) +{ + switch( getBaseToken( aElementToken ) ) + { + case XML_cNvPr: + { + mpGroupShapePtr->setHidden( rAttribs.getBool( XML_hidden, false ) ); + mpGroupShapePtr->setId( rAttribs.getString( XML_id ).get() ); + mpGroupShapePtr->setName( rAttribs.getString( XML_name ).get() ); + break; + } + case XML_ph: + mpGroupShapePtr->setSubType( rAttribs.getToken( XML_type, FastToken::DONTKNOW ) ); + if( rAttribs.hasAttribute( XML_idx ) ) + mpGroupShapePtr->setSubTypeIndex( rAttribs.getString( XML_idx ).get().toInt32() ); + break; + // nvSpPr CT_ShapeNonVisual end + + case XML_grpSpPr: + return new ShapePropertiesContext( *this, *mpGroupShapePtr ); + case XML_nvGrpSpPr: + return this; + case XML_spPr: + return new ShapePropertiesContext( *this, *mpGroupShapePtr ); +/* + case XML_style: + return new ShapeStyleContext( getParser() ); +*/ + case XML_cxnSp: // connector shape + { + ShapePtr pShape = std::make_shared("com.sun.star.drawing.ConnectorShape"); + pShape->setLockedCanvas(mpGroupShapePtr->getLockedCanvas()); + return new ConnectorShapeContext(*this, mpGroupShapePtr, pShape, + pShape->getConnectorShapeProperties()); + } + case XML_grpSp: // group shape + return new ShapeGroupContext( *this, mpGroupShapePtr, std::make_shared( "com.sun.star.drawing.GroupShape" ) ); + case XML_sp: // shape + case XML_wsp: + // Don't set default character height for WPS shapes, Writer has its + // own way to set the default, and if we don't set it here, editing + // properly inherits it. + return new ShapeContext( *this, mpGroupShapePtr, std::make_shared( "com.sun.star.drawing.CustomShape", getBaseToken(aElementToken) == XML_sp ) ); + case XML_pic: // CT_Picture + return new GraphicShapeContext( *this, mpGroupShapePtr, std::make_shared( "com.sun.star.drawing.GraphicObjectShape" ) ); + case XML_graphicFrame: // CT_GraphicalObjectFrame + return new GraphicalObjectFrameContext( *this, mpGroupShapePtr, std::make_shared( "com.sun.star.drawing.GraphicObjectShape" ), true ); + case XML_cNvGrpSpPr: + break; + case XML_grpSpLocks: + break; + default: + SAL_WARN("oox", "ShapeGroupContext::onCreateContext: unhandled element: " << getBaseToken(aElementToken)); + break; + } + + return this; +} + +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/drawingml/shapepropertiescontext.cxx b/oox/source/drawingml/shapepropertiescontext.cxx new file mode 100644 index 000000000..935cc4970 --- /dev/null +++ b/oox/source/drawingml/shapepropertiescontext.cxx @@ -0,0 +1,103 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +using namespace oox::core; +using namespace ::com::sun::star; +using namespace ::com::sun::star::uno; +using namespace ::com::sun::star::drawing; +using namespace ::com::sun::star::beans; +using namespace ::com::sun::star::xml::sax; + +namespace oox::drawingml { + +// CT_ShapeProperties +ShapePropertiesContext::ShapePropertiesContext( ContextHandler2Helper const & rParent, Shape& rShape ) +: ContextHandler2( rParent ) +, mrShape( rShape ) +{ +} + +ContextHandlerRef ShapePropertiesContext::onCreateContext( sal_Int32 aElementToken, const AttributeList& rAttribs ) +{ + switch( aElementToken ) + { + // CT_Transform2D + case A_TOKEN( xfrm ): + return new Transform2DContext( *this, rAttribs, mrShape ); + + // GeometryGroup + case A_TOKEN( custGeom ): // custom geometry "CT_CustomGeometry2D" + return new CustomShapeGeometryContext( *this, *mrShape.getCustomShapeProperties() ); + + case A_TOKEN( prstGeom ): // preset geometry "CT_PresetGeometry2D" + { + sal_Int32 nToken = rAttribs.getToken( XML_prst, 0 ); + // TODO: Move the following checks to a separate place or as a separate function + if (nToken == XML_line && !mrShape.isConnectorShape()) + { + mrShape.getServiceName() = "com.sun.star.drawing.LineShape"; + } + + // We got a preset geometry, forget the geometry inherited from the placeholder shape. + mrShape.getCustomShapeProperties() = std::make_shared(); + + return new PresetShapeGeometryContext( *this, rAttribs, *(mrShape.getCustomShapeProperties()) ); + } + + case A_TOKEN( prstTxWarp ): + return new PresetTextShapeContext( *this, rAttribs, *(mrShape.getCustomShapeProperties()) ); + + // CT_LineProperties + case A_TOKEN( ln ): + return new LinePropertiesContext( *this, rAttribs, mrShape.getLineProperties() ); + + // EffectPropertiesGroup + // todo not supported by core + case A_TOKEN( effectLst ): // CT_EffectList + case A_TOKEN( effectDag ): // CT_EffectContainer + return new EffectPropertiesContext( *this, mrShape.getEffectProperties() ); + + // todo not supported by core, only for preservation via grab bags + case A_TOKEN( scene3d ): // CT_Scene3D + return new Scene3DPropertiesContext( *this, mrShape.get3DProperties() ); + + // todo not supported by core, only for preservation via grab bags + case A_TOKEN( sp3d ): // CT_Shape3D + return new Shape3DPropertiesContext( *this, rAttribs, mrShape.get3DProperties() ); + } + + return FillPropertiesContext::createFillContext( *this, aElementToken, rAttribs, mrShape.getFillProperties() ); +} + +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/drawingml/shapepropertymap.cxx b/oox/source/drawingml/shapepropertymap.cxx new file mode 100644 index 000000000..57014b478 --- /dev/null +++ b/oox/source/drawingml/shapepropertymap.cxx @@ -0,0 +1,238 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include + +#include +#include +#include +#include +#include +#include + +#include +#include + +namespace oox::drawingml { + +using namespace ::com::sun::star; +using namespace ::com::sun::star::beans; +using namespace ::com::sun::star::drawing; +using namespace ::com::sun::star::uno; + +namespace { + +const ShapePropertyIds spnDefaultShapeIds = +{ + PROP_LineStyle, PROP_LineWidth, PROP_LineColor, PROP_LineTransparence, PROP_LineDash, PROP_LineCap, PROP_LineJoint, + PROP_LineStartName, PROP_LineStartWidth, PROP_LineStartCenter, PROP_LineEndName, PROP_LineEndWidth, PROP_LineEndCenter, + PROP_FillStyle, PROP_FillColor, PROP_FillTransparence, PROP_FillTransparenceGradientName, PROP_FillGradient, + PROP_FillBitmap, PROP_FillBitmapMode, PROP_FillBitmapSizeX, PROP_FillBitmapSizeY, + PROP_FillBitmapPositionOffsetX, PROP_FillBitmapPositionOffsetY, PROP_FillBitmapRectanglePoint, + PROP_FillHatch, + PROP_FillBackground, + PROP_FillUseSlideBackground, + PROP_FillBitmapName, + PROP_ShadowXDistance, + PROP_ShadowSizeX, + PROP_ShadowSizeY +}; + +} // namespace + +ShapePropertyInfo ShapePropertyInfo::DEFAULT( spnDefaultShapeIds, true, false, false, false, false ); + +ShapePropertyInfo::ShapePropertyInfo( const ShapePropertyIds& rnPropertyIds, + bool bNamedLineMarker, bool bNamedLineDash, bool bNamedFillGradient, bool bNamedFillBitmap, bool bNamedFillHatch ) : + mrPropertyIds(rnPropertyIds), + mbNamedLineMarker( bNamedLineMarker ), + mbNamedLineDash( bNamedLineDash ), + mbNamedFillGradient( bNamedFillGradient ), + mbNamedFillBitmap( bNamedFillBitmap ), + mbNamedFillHatch( bNamedFillHatch ) +{ +} + +ShapePropertyMap::ShapePropertyMap( ModelObjectHelper& rModelObjHelper, const ShapePropertyInfo& rShapePropInfo ) : + mrModelObjHelper( rModelObjHelper ), + maShapePropInfo( rShapePropInfo ) +{ +} + +bool ShapePropertyMap::supportsProperty( ShapeProperty ePropId ) const +{ + return maShapePropInfo.has( ePropId ); +} + +bool ShapePropertyMap::hasNamedLineMarkerInTable( const OUString& rMarkerName ) const +{ + return maShapePropInfo.mbNamedLineMarker && mrModelObjHelper.hasLineMarker( rMarkerName ); +} + +bool ShapePropertyMap::setAnyProperty( ShapeProperty ePropId, const Any& rValue ) +{ + // get current property identifier for the specified property + sal_Int32 nPropId = maShapePropInfo[ ePropId ]; + if( nPropId < 0 ) return false; + + // special handling for properties supporting named objects in tables + switch( ePropId ) + { + case ShapeProperty::LineStart: + case ShapeProperty::LineEnd: + return setLineMarker( nPropId, rValue ); + + case ShapeProperty::LineDash: + return setLineDash( nPropId, rValue ); + + case ShapeProperty::FillGradient: + return setFillGradient( nPropId, rValue ); + + case ShapeProperty::GradientTransparency: + return setGradientTrans( nPropId, rValue ); + + case ShapeProperty::FillBitmap: + return setFillBitmap(nPropId, rValue); + + case ShapeProperty::FillBitmapName: + return setFillBitmapName(rValue); + + case ShapeProperty::FillHatch: + return setFillHatch( nPropId, rValue ); + + default:; // suppress compiler warnings + } + + // set plain property value + setAnyProperty( nPropId, rValue ); + return true; +} + +// private -------------------------------------------------------------------- + +bool ShapePropertyMap::setLineMarker( sal_Int32 nPropId, const Any& rValue ) +{ + NamedValue aNamedMarker; + if( (rValue >>= aNamedMarker) && !aNamedMarker.Name.isEmpty() ) + { + // push line marker explicitly + if( !maShapePropInfo.mbNamedLineMarker ) + return setAnyProperty( nPropId, aNamedMarker.Value ); + + // create named line marker (if coordinates have been passed) and push its name + bool bInserted = !aNamedMarker.Value.has< PolyPolygonBezierCoords >() || + mrModelObjHelper.insertLineMarker( aNamedMarker.Name, aNamedMarker.Value.get< PolyPolygonBezierCoords >() ); + return bInserted && setProperty( nPropId, aNamedMarker.Name ); + } + return false; +} + +bool ShapePropertyMap::setLineDash( sal_Int32 nPropId, const Any& rValue ) +{ + // push line dash explicitly + if( !maShapePropInfo.mbNamedLineDash ) + return setAnyProperty( nPropId, rValue ); + + // create named line dash and push its name + if( rValue.has< LineDash >() ) + { + OUString aDashName = mrModelObjHelper.insertLineDash( rValue.get< LineDash >() ); + return !aDashName.isEmpty() && setProperty( nPropId, aDashName ); + } + + return false; +} + +bool ShapePropertyMap::setFillGradient( sal_Int32 nPropId, const Any& rValue ) +{ + // push gradient explicitly + if( !maShapePropInfo.mbNamedFillGradient ) + return setAnyProperty( nPropId, rValue ); + + // create named gradient and push its name + if( rValue.has< awt::Gradient >() ) + { + OUString aGradientName = mrModelObjHelper.insertFillGradient( rValue.get< awt::Gradient >() ); + return !aGradientName.isEmpty() && setProperty( nPropId, aGradientName ); + } + + return false; +} + +bool ShapePropertyMap::setFillHatch( sal_Int32 nPropId, const Any& rValue ) +{ + // push hatch explicitly + if( !maShapePropInfo.mbNamedFillHatch ) + return setAnyProperty( nPropId, rValue ); + + // create named hatch and push its name + if (rValue.has()) + { + OUString aHatchName = mrModelObjHelper.insertFillHatch(rValue.get()); + return !aHatchName.isEmpty() && setProperty( nPropId, aHatchName ); + } + + return false; +} + +bool ShapePropertyMap::setGradientTrans( sal_Int32 nPropId, const Any& rValue ) +{ + // create named gradient and push its name + if( rValue.has< awt::Gradient >() ) + { + OUString aGradientName = mrModelObjHelper.insertTransGrandient( rValue.get< awt::Gradient >() ); + return !aGradientName.isEmpty() && setProperty( nPropId, aGradientName ); + } + + return false; +} + +bool ShapePropertyMap::setFillBitmap(sal_Int32 nPropId, const Any& rValue) +{ + // push bitmap explicitly + if (!maShapePropInfo.mbNamedFillBitmap) + { + return setAnyProperty(nPropId, rValue); + } + + // create named bitmap URL and push its name + if (rValue.has>()) + { + auto xGraphic = rValue.get>(); + OUString aBitmapName = mrModelObjHelper.insertFillBitmapXGraphic(xGraphic); + return !aBitmapName.isEmpty() && setProperty(nPropId, aBitmapName); + } + + return false; +} + +bool ShapePropertyMap::setFillBitmapName(const Any& rValue) +{ + if (rValue.has>()) + { + auto xGraphic = rValue.get>(); + OUString aBitmapUrlName = mrModelObjHelper.insertFillBitmapXGraphic(xGraphic); + return !aBitmapUrlName.isEmpty() && setProperty(PROP_FillBitmapName, aBitmapUrlName); + } + return false; +} + +} // namespace oox::drawingml + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/drawingml/shapestylecontext.cxx b/oox/source/drawingml/shapestylecontext.cxx new file mode 100644 index 000000000..f0bc061a5 --- /dev/null +++ b/oox/source/drawingml/shapestylecontext.cxx @@ -0,0 +1,70 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include + +#include +#include +#include +#include + +using namespace ::oox::core; +using namespace ::com::sun::star::uno; +using namespace ::com::sun::star::xml::sax; + +namespace oox::drawingml { + +// CT_ShapeStyle + +ShapeStyleContext::ShapeStyleContext( ContextHandler2Helper const & rParent, Shape& rShape ) +: ContextHandler2( rParent ) +, mrShape( rShape ) +{ +} + +ShapeStyleContext::~ShapeStyleContext() +{ +} + +ContextHandlerRef ShapeStyleContext::onCreateContext( sal_Int32 aElementToken, const AttributeList& rAttribs ) +{ + switch( aElementToken ) + { + case A_TOKEN( lnRef ) : // CT_StyleMatrixReference + case A_TOKEN( fillRef ) : // CT_StyleMatrixReference + case A_TOKEN( effectRef ) : // CT_StyleMatrixReference + case A_TOKEN( fontRef ) : // CT_FontReference + { + sal_Int32 nToken = getBaseToken( aElementToken ); + ShapeStyleRef& rStyleRef = mrShape.getShapeStyleRefs()[ nToken ]; + rStyleRef.mnThemedIdx = (nToken == XML_fontRef) ? rAttribs.getToken( XML_idx, XML_none ) : rAttribs.getInteger( XML_idx, 0 ); + // Set default Text Color. Some xml files don't seem + // to have color definitions inside fontRef - Use + // tx1 in such cases + if( nToken == XML_fontRef && !rStyleRef.maPhClr.isUsed() ) + rStyleRef.maPhClr.setSchemeClr(XML_tx1); + return new ColorContext( *this, rStyleRef.maPhClr ); + } + } + return nullptr; +} + +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/drawingml/spdefcontext.cxx b/oox/source/drawingml/spdefcontext.cxx new file mode 100644 index 000000000..3697bdfe8 --- /dev/null +++ b/oox/source/drawingml/spdefcontext.cxx @@ -0,0 +1,62 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include +#include +#include +#include +#include +#include + +using namespace ::oox::core; +using namespace ::com::sun::star::uno; +using namespace ::com::sun::star::xml::sax; + +namespace oox::drawingml { + +spDefContext::spDefContext( ContextHandler2Helper const & rParent, Shape& rDefaultObject ) +: ContextHandler2( rParent ) +, mrDefaultObject( rDefaultObject ) +{ +} + +ContextHandlerRef spDefContext::onCreateContext( sal_Int32 aElementToken, const AttributeList& rAttribs ) +{ + switch( aElementToken ) + { + case A_TOKEN( spPr ): + return new ShapePropertiesContext( *this, mrDefaultObject ); + case A_TOKEN( bodyPr ): + { + TextBodyPtr xTextBody = std::make_shared(); + mrDefaultObject.setTextBody( xTextBody ); + return new TextBodyPropertiesContext( *this, rAttribs, xTextBody->getTextProperties() ); + } + case A_TOKEN( lstStyle ): + return new TextListStyleContext( *this, *mrDefaultObject.getMasterTextListStyle() ); + case A_TOKEN( style ): + break; + } + + return this; +} + +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/drawingml/table/predefined-table-styles.cxx b/oox/source/drawingml/table/predefined-table-styles.cxx new file mode 100644 index 000000000..91eccdfc8 --- /dev/null +++ b/oox/source/drawingml/table/predefined-table-styles.cxx @@ -0,0 +1,975 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ +#include +#include + +using namespace oox; +using namespace oox::drawingml::table; + +/* tdf#107604 + * There are predefined table styles that have a + * style id (in ppt/slides/slidex.xml) but does not have + * corresponding style definition (ppt/tableStyles.xml). + * So we should create those styles here for this case. + * There are 74 predefined styles and many different + * variables. A style map was created by examining all + * 74 style properties. And table styles were coded according + * to that map. You can see that map in + * oox/documentation/predefined-styles-map.ods. We should + * define all of these variables to keep the code readable + * and change something easily when some styles change. + */ + +std::map> mStyleIdMap; + +// Create style-id map for using similar attributes of the groups. +// (style ids used from here: https://docs.microsoft.com/en-us/previous-versions/office/developer/office-2010/hh273476(v=office.14)?redirectedfrom=MSDN) +// and checked all of them. + +static void createStyleIdMap() +{ + mStyleIdMap[OUString("{2D5ABB26-0587-4C30-8999-92F81FD0307C}")] + = std::make_pair(OUString("Themed-Style-1"), OUString("")); + mStyleIdMap[OUString("{3C2FFA5D-87B4-456A-9821-1D502468CF0F}")] + = std::make_pair(OUString("Themed-Style-1"), OUString("Accent1")); + mStyleIdMap[OUString("{284E427A-3D55-4303-BF80-6455036E1DE7}")] + = std::make_pair(OUString("Themed-Style-1"), OUString("Accent2")); + mStyleIdMap[OUString("{69C7853C-536D-4A76-A0AE-DD22124D55A5}")] + = std::make_pair(OUString("Themed-Style-1"), OUString("Accent3")); + mStyleIdMap[OUString("{775DCB02-9BB8-47FD-8907-85C794F793BA}")] + = std::make_pair(OUString("Themed-Style-1"), OUString("Accent4")); + mStyleIdMap[OUString("{35758FB7-9AC5-4552-8A53-C91805E547FA}")] + = std::make_pair(OUString("Themed-Style-1"), OUString("Accent5")); + mStyleIdMap[OUString("{08FB837D-C827-4EFA-A057-4D05807E0F7C}")] + = std::make_pair(OUString("Themed-Style-1"), OUString("Accent6")); + + mStyleIdMap[OUString("{5940675A-B579-460E-94D1-54222C63F5DA}")] + = std::make_pair(OUString("Themed-Style-2"), OUString("")); + mStyleIdMap[OUString("{D113A9D2-9D6B-4929-AA2D-F23B5EE8CBE7}")] + = std::make_pair(OUString("Themed-Style-2"), OUString("Accent1")); + mStyleIdMap[OUString("{18603FDC-E32A-4AB5-989C-0864C3EAD2B8}")] + = std::make_pair(OUString("Themed-Style-2"), OUString("Accent2")); + mStyleIdMap[OUString("{306799F8-075E-4A3A-A7F6-7FBC6576F1A4}")] + = std::make_pair(OUString("Themed-Style-2"), OUString("Accent3")); + mStyleIdMap[OUString("{E269D01E-BC32-4049-B463-5C60D7B0CCD2}")] + = std::make_pair(OUString("Themed-Style-2"), OUString("Accent4")); + mStyleIdMap[OUString("{327F97BB-C833-4FB7-BDE5-3F7075034690}")] + = std::make_pair(OUString("Themed-Style-2"), OUString("Accent5")); + mStyleIdMap[OUString("{638B1855-1B75-4FBE-930C-398BA8C253C6}")] + = std::make_pair(OUString("Themed-Style-2"), OUString("Accent6")); + + mStyleIdMap[OUString("{9D7B26C5-4107-4FEC-AEDC-1716B250A1EF}")] + = std::make_pair(OUString("Light-Style-1"), OUString("")); + mStyleIdMap[OUString("{3B4B98B0-60AC-42C2-AFA5-B58CD77FA1E5}")] + = std::make_pair(OUString("Light-Style-1"), OUString("Accent1")); + mStyleIdMap[OUString("{0E3FDE45-AF77-4B5C-9715-49D594BDF05E}")] + = std::make_pair(OUString("Light-Style-1"), OUString("Accent2")); + mStyleIdMap[OUString("{C083E6E3-FA7D-4D7B-A595-EF9225AFEA82}")] + = std::make_pair(OUString("Light-Style-1"), OUString("Accent3")); + mStyleIdMap[OUString("{D27102A9-8310-4765-A935-A1911B00CA55}")] + = std::make_pair(OUString("Light-Style-1"), OUString("Accent4")); + mStyleIdMap[OUString("{5FD0F851-EC5A-4D38-B0AD-8093EC10F338}")] + = std::make_pair(OUString("Light-Style-1"), OUString("Accent5")); + mStyleIdMap[OUString("{68D230F3-CF80-4859-8CE7-A43EE81993B5}")] + = std::make_pair(OUString("Light-Style-1"), OUString("Accent6")); + + mStyleIdMap[OUString("{7E9639D4-E3E2-4D34-9284-5A2195B3D0D7}")] + = std::make_pair(OUString("Light-Style-2"), OUString("")); + mStyleIdMap[OUString("{69012ECD-51FC-41F1-AA8D-1B2483CD663E}")] + = std::make_pair(OUString("Light-Style-2"), OUString("Accent1")); + mStyleIdMap[OUString("{72833802-FEF1-4C79-8D5D-14CF1EAF98D9}")] + = std::make_pair(OUString("Light-Style-2"), OUString("Accent2")); + mStyleIdMap[OUString("{F2DE63D5-997A-4646-A377-4702673A728D}")] + = std::make_pair(OUString("Light-Style-2"), OUString("Accent3")); + mStyleIdMap[OUString("{17292A2E-F333-43FB-9621-5CBBE7FDCDCB}")] + = std::make_pair(OUString("Light-Style-2"), OUString("Accent4")); + mStyleIdMap[OUString("{5A111915-BE36-4E01-A7E5-04B1672EAD32}")] + = std::make_pair(OUString("Light-Style-2"), OUString("Accent5")); + mStyleIdMap[OUString("{912C8C85-51F0-491E-9774-3900AFEF0FD7}")] + = std::make_pair(OUString("Light-Style-2"), OUString("Accent6")); + + mStyleIdMap[OUString("{616DA210-FB5B-4158-B5E0-FEB733F419BA}")] + = std::make_pair(OUString("Light-Style-3"), OUString("")); + mStyleIdMap[OUString("{BC89EF96-8CEA-46FF-86C4-4CE0E7609802}")] + = std::make_pair(OUString("Light-Style-3"), OUString("Accent1")); + mStyleIdMap[OUString("{5DA37D80-6434-44D0-A028-1B22A696006F}")] + = std::make_pair(OUString("Light-Style-3"), OUString("Accent2")); + mStyleIdMap[OUString("{8799B23B-EC83-4686-B30A-512413B5E67A}")] + = std::make_pair(OUString("Light-Style-3"), OUString("Accent3")); + mStyleIdMap[OUString("{ED083AE6-46FA-4A59-8FB0-9F97EB10719F}")] + = std::make_pair(OUString("Light-Style-3"), OUString("Accent4")); + mStyleIdMap[OUString("{BDBED569-4797-4DF1-A0F4-6AAB3CD982D8}")] + = std::make_pair(OUString("Light-Style-3"), OUString("Accent5")); + mStyleIdMap[OUString("{E8B1032C-EA38-4F05-BA0D-38AFFFC7BED3}")] + = std::make_pair(OUString("Light-Style-3"), OUString("Accent6")); + + mStyleIdMap[OUString("{793D81CF-94F2-401A-BA57-92F5A7B2D0C5}")] + = std::make_pair(OUString("Medium-Style-1"), OUString("")); + mStyleIdMap[OUString("{B301B821-A1FF-4177-AEE7-76D212191A09}")] + = std::make_pair(OUString("Medium-Style-1"), OUString("Accent1")); + mStyleIdMap[OUString("{9DCAF9ED-07DC-4A11-8D7F-57B35C25682E}")] + = std::make_pair(OUString("Medium-Style-1"), OUString("Accent2")); + mStyleIdMap[OUString("{1FECB4D8-DB02-4DC6-A0A2-4F2EBAE1DC90}")] + = std::make_pair(OUString("Medium-Style-1"), OUString("Accent3")); + mStyleIdMap[OUString("{1E171933-4619-4E11-9A3F-F7608DF75F80}")] + = std::make_pair(OUString("Medium-Style-1"), OUString("Accent4")); + mStyleIdMap[OUString("{FABFCF23-3B69-468F-B69F-88F6DE6A72F2}")] + = std::make_pair(OUString("Medium-Style-1"), OUString("Accent5")); + mStyleIdMap[OUString("{10A1B5D5-9B99-4C35-A422-299274C87663}")] + = std::make_pair(OUString("Medium-Style-1"), OUString("Accent6")); + + mStyleIdMap[OUString("{073A0DAA-6AF3-43AB-8588-CEC1D06C72B9}")] + = std::make_pair(OUString("Medium-Style-2"), OUString("")); + mStyleIdMap[OUString("{5C22544A-7EE6-4342-B048-85BDC9FD1C3A}")] + = std::make_pair(OUString("Medium-Style-2"), OUString("Accent1")); + mStyleIdMap[OUString("{21E4AEA4-8DFA-4A89-87EB-49C32662AFE0}")] + = std::make_pair(OUString("Medium-Style-2"), OUString("Accent2")); + mStyleIdMap[OUString("{F5AB1C69-6EDB-4FF4-983F-18BD219EF322}")] + = std::make_pair(OUString("Medium-Style-2"), OUString("Accent3")); + mStyleIdMap[OUString("{00A15C55-8517-42AA-B614-E9B94910E393}")] + = std::make_pair(OUString("Medium-Style-2"), OUString("Accent4")); + mStyleIdMap[OUString("{7DF18680-E054-41AD-8BC1-D1AEF772440D}")] + = std::make_pair(OUString("Medium-Style-2"), OUString("Accent5")); + mStyleIdMap[OUString("{93296810-A885-4BE3-A3E7-6D5BEEA58F35}")] + = std::make_pair(OUString("Medium-Style-2"), OUString("Accent6")); + + mStyleIdMap[OUString("{8EC20E35-A176-4012-BC5E-935CFFF8708E}")] + = std::make_pair(OUString("Medium-Style-3"), OUString("")); + mStyleIdMap[OUString("{6E25E649-3F16-4E02-A733-19D2CDBF48F0}")] + = std::make_pair(OUString("Medium-Style-3"), OUString("Accent1")); + mStyleIdMap[OUString("{85BE263C-DBD7-4A20-BB59-AAB30ACAA65A}")] + = std::make_pair(OUString("Medium-Style-3"), OUString("Accent2")); + mStyleIdMap[OUString("{EB344D84-9AFB-497E-A393-DC336BA19D2E}")] + = std::make_pair(OUString("Medium-Style-3"), OUString("Accent3")); + mStyleIdMap[OUString("{EB9631B5-78F2-41C9-869B-9F39066F8104}")] + = std::make_pair(OUString("Medium-Style-3"), OUString("Accent4")); + mStyleIdMap[OUString("{74C1A8A3-306A-4EB7-A6B1-4F7E0EB9C5D6}")] + = std::make_pair(OUString("Medium-Style-3"), OUString("Accent5")); + mStyleIdMap[OUString("{2A488322-F2BA-4B5B-9748-0D474271808F}")] + = std::make_pair(OUString("Medium-Style-3"), OUString("Accent6")); + + mStyleIdMap[OUString("{D7AC3CCA-C797-4891-BE02-D94E43425B78}")] + = std::make_pair(OUString("Medium-Style-4"), OUString("")); + mStyleIdMap[OUString("{69CF1AB2-1976-4502-BF36-3FF5EA218861}")] + = std::make_pair(OUString("Medium-Style-4"), OUString("Accent1")); + mStyleIdMap[OUString("{8A107856-5554-42FB-B03E-39F5DBC370BA}")] + = std::make_pair(OUString("Medium-Style-4"), OUString("Accent2")); + mStyleIdMap[OUString("{0505E3EF-67EA-436B-97B2-0124C06EBD24}")] + = std::make_pair(OUString("Medium-Style-4"), OUString("Accent3")); + mStyleIdMap[OUString("{C4B1156A-380E-4F78-BDF5-A606A8083BF9}")] + = std::make_pair(OUString("Medium-Style-4"), OUString("Accent4")); + mStyleIdMap[OUString("{22838BEF-8BB2-4498-84A7-C5851F593DF1}")] + = std::make_pair(OUString("Medium-Style-4"), OUString("Accent5")); + mStyleIdMap[OUString("{16D9F66E-5EB9-4882-86FB-DCBF35E3C3E4}")] + = std::make_pair(OUString("Medium-Style-4"), OUString("Accent6")); + + mStyleIdMap[OUString("{E8034E78-7F5D-4C2E-B375-FC64B27BC917}")] + = std::make_pair(OUString("Dark-Style-1"), OUString("")); + mStyleIdMap[OUString("{125E5076-3810-47DD-B79F-674D7AD40C01}")] + = std::make_pair(OUString("Dark-Style-1"), OUString("Accent1")); + mStyleIdMap[OUString("{37CE84F3-28C3-443E-9E96-99CF82512B78}")] + = std::make_pair(OUString("Dark-Style-1"), OUString("Accent2")); + mStyleIdMap[OUString("{D03447BB-5D67-496B-8E87-E561075AD55C}")] + = std::make_pair(OUString("Dark-Style-1"), OUString("Accent3")); + mStyleIdMap[OUString("{E929F9F4-4A8F-4326-A1B4-22849713DDAB}")] + = std::make_pair(OUString("Dark-Style-1"), OUString("Accent4")); + mStyleIdMap[OUString("{8FD4443E-F989-4FC4-A0C8-D5A2AF1F390B}")] + = std::make_pair(OUString("Dark-Style-1"), OUString("Accent5")); + mStyleIdMap[OUString("{AF606853-7671-496A-8E4F-DF71F8EC918B}")] + = std::make_pair(OUString("Dark-Style-1"), OUString("Accent6")); + + mStyleIdMap[OUString("{5202B0CA-FC54-4496-8BCA-5EF66A818D29}")] + = std::make_pair(OUString("Dark-Style-2"), OUString("")); + mStyleIdMap[OUString("{0660B408-B3CF-4A94-85FC-2B1E0A45F4A2}")] + = std::make_pair(OUString("Dark-Style-2"), OUString("Accent1")); + mStyleIdMap[OUString("{91EBBBCC-DAD2-459C-BE2E-F6DE35CF9A28}")] + = std::make_pair(OUString("Dark-Style-2"), OUString("Accent3")); + mStyleIdMap[OUString("{46F890A9-2807-4EBB-B81D-B2AA78EC7F39}")] + = std::make_pair(OUString("Dark-Style-2"), OUString("Accent5")); +} + +static std::map tokens = { { "", XML_dk1 }, + { "Accent1", XML_accent1 }, + { "Accent2", XML_accent2 }, + { "Accent3", XML_accent3 }, + { "Accent4", XML_accent4 }, + { "Accent5", XML_accent5 }, + { "Accent6", XML_accent6 } }; + +void setBorderLineType(const oox::drawingml::LinePropertiesPtr& pLineProp, sal_Int32 nToken) +{ + pLineProp->maLineFill.moFillType.set(nToken); +} + +void insertBorderLine(TableStylePart& aTableStylePart, sal_Int32 nToken, + oox::drawingml::LinePropertiesPtr pLineProp) +{ + if (pLineProp->maLineFill.moFillType.has()) + { + aTableStylePart.getLineBorders().insert( + std::pair(nToken, pLineProp)); + } +} + +std::unique_ptr CreateTableStyle(const OUString& styleId) +{ + createStyleIdMap(); + std::unique_ptr pTableStyle; + pTableStyle.reset(new TableStyle()); + + // Text Color definitions for table parts + + ::oox::drawingml::Color wholeTblTextColor; + ::oox::drawingml::Color firstRowTextColor; + ::oox::drawingml::Color firstColTextColor; + ::oox::drawingml::Color lastRowTextColor; + ::oox::drawingml::Color lastColTextColor; + ::oox::drawingml::Color band1HTextColor; + ::oox::drawingml::Color band1VTextColor; + ::oox::drawingml::Color band2HTextColor; + ::oox::drawingml::Color band2VTextColor; + + // Fill properties definitions for table parts + + oox::drawingml::FillPropertiesPtr pWholeTblFillProperties + = std::make_shared(); + oox::drawingml::FillPropertiesPtr pFirstRowFillProperties + = std::make_shared(); + oox::drawingml::FillPropertiesPtr pFirstColFillProperties + = std::make_shared(); + oox::drawingml::FillPropertiesPtr pLastRowFillProperties + = std::make_shared(); + oox::drawingml::FillPropertiesPtr pLastColFillProperties + = std::make_shared(); + oox::drawingml::FillPropertiesPtr pBand1HFillProperties + = std::make_shared(); + oox::drawingml::FillPropertiesPtr pBand1VFillProperties + = std::make_shared(); + oox::drawingml::FillPropertiesPtr pBand2HFillProperties + = std::make_shared(); + oox::drawingml::FillPropertiesPtr pBand2VFillProperties + = std::make_shared(); + oox::drawingml::FillPropertiesPtr pTblBgFillProperties + = std::make_shared(); + + // Start table border line properties definitions for table parts + + oox::drawingml::LinePropertiesPtr pWholeTblLeftBorder + = std::make_shared(); + oox::drawingml::LinePropertiesPtr pWholeTblRightBorder + = std::make_shared(); + oox::drawingml::LinePropertiesPtr pWholeTblTopBorder + = std::make_shared(); + oox::drawingml::LinePropertiesPtr pWholeTblBottomBorder + = std::make_shared(); + oox::drawingml::LinePropertiesPtr pWholeTblInsideHBorder + = std::make_shared(); + oox::drawingml::LinePropertiesPtr pWholeTblInsideVBorder + = std::make_shared(); + + oox::drawingml::LinePropertiesPtr pFirstRowLeftBorder + = std::make_shared(); + oox::drawingml::LinePropertiesPtr pFirstRowRightBorder + = std::make_shared(); + oox::drawingml::LinePropertiesPtr pFirstRowTopBorder + = std::make_shared(); + oox::drawingml::LinePropertiesPtr pFirstRowBottomBorder + = std::make_shared(); + oox::drawingml::LinePropertiesPtr pFirstRowInsideHBorder + = std::make_shared(); + oox::drawingml::LinePropertiesPtr pFirstRowInsideVBorder + = std::make_shared(); + + oox::drawingml::LinePropertiesPtr pFirstColLeftBorder + = std::make_shared(); + oox::drawingml::LinePropertiesPtr pFirstColRightBorder + = std::make_shared(); + oox::drawingml::LinePropertiesPtr pFirstColTopBorder + = std::make_shared(); + oox::drawingml::LinePropertiesPtr pFirstColBottomBorder + = std::make_shared(); + oox::drawingml::LinePropertiesPtr pFirstColInsideHBorder + = std::make_shared(); + oox::drawingml::LinePropertiesPtr pFirstColInsideVBorder + = std::make_shared(); + + oox::drawingml::LinePropertiesPtr pLastColLeftBorder + = std::make_shared(); + oox::drawingml::LinePropertiesPtr pLastColRightBorder + = std::make_shared(); + oox::drawingml::LinePropertiesPtr pLastColTopBorder + = std::make_shared(); + oox::drawingml::LinePropertiesPtr pLastColBottomBorder + = std::make_shared(); + oox::drawingml::LinePropertiesPtr pLastColInsideHBorder + = std::make_shared(); + oox::drawingml::LinePropertiesPtr pLastColInsideVBorder + = std::make_shared(); + + oox::drawingml::LinePropertiesPtr pLastRowLeftBorder + = std::make_shared(); + oox::drawingml::LinePropertiesPtr pLastRowRightBorder + = std::make_shared(); + oox::drawingml::LinePropertiesPtr pLastRowTopBorder + = std::make_shared(); + oox::drawingml::LinePropertiesPtr pLastRowBottomBorder + = std::make_shared(); + oox::drawingml::LinePropertiesPtr pLastRowInsideHBorder + = std::make_shared(); + oox::drawingml::LinePropertiesPtr pLastRowInsideVBorder + = std::make_shared(); + + oox::drawingml::LinePropertiesPtr pBand1HLeftBorder + = std::make_shared(); + oox::drawingml::LinePropertiesPtr pBand1HRightBorder + = std::make_shared(); + oox::drawingml::LinePropertiesPtr pBand1HTopBorder + = std::make_shared(); + oox::drawingml::LinePropertiesPtr pBand1HBottomBorder + = std::make_shared(); + oox::drawingml::LinePropertiesPtr pBand1HInsideHBorder + = std::make_shared(); + oox::drawingml::LinePropertiesPtr pBand1HInsideVBorder + = std::make_shared(); + + oox::drawingml::LinePropertiesPtr pBand1VLeftBorder + = std::make_shared(); + oox::drawingml::LinePropertiesPtr pBand1VRightBorder + = std::make_shared(); + oox::drawingml::LinePropertiesPtr pBand1VTopBorder + = std::make_shared(); + oox::drawingml::LinePropertiesPtr pBand1VBottomBorder + = std::make_shared(); + oox::drawingml::LinePropertiesPtr pBand1VInsideHBorder + = std::make_shared(); + oox::drawingml::LinePropertiesPtr pBand1VInsideVBorder + = std::make_shared(); + + oox::drawingml::LinePropertiesPtr pBand2HLeftBorder + = std::make_shared(); + oox::drawingml::LinePropertiesPtr pBand2HRightBorder + = std::make_shared(); + oox::drawingml::LinePropertiesPtr pBand2HTopBorder + = std::make_shared(); + oox::drawingml::LinePropertiesPtr pBand2HBottomBorder + = std::make_shared(); + oox::drawingml::LinePropertiesPtr pBand2HInsideHBorder + = std::make_shared(); + oox::drawingml::LinePropertiesPtr pBand2HInsideVBorder + = std::make_shared(); + + oox::drawingml::LinePropertiesPtr pBand2VLeftBorder + = std::make_shared(); + oox::drawingml::LinePropertiesPtr pBand2VRightBorder + = std::make_shared(); + oox::drawingml::LinePropertiesPtr pBand2VTopBorder + = std::make_shared(); + oox::drawingml::LinePropertiesPtr pBand2VBottomBorder + = std::make_shared(); + oox::drawingml::LinePropertiesPtr pBand2VInsideHBorder + = std::make_shared(); + oox::drawingml::LinePropertiesPtr pBand2VInsideVBorder + = std::make_shared(); + + // End table border line properties definitions for table parts + + // Start to set fill types. + + pTblBgFillProperties->moFillType.set(XML_solidFill); + pWholeTblFillProperties->moFillType.set(XML_solidFill); + pFirstRowFillProperties->moFillType.set(XML_solidFill); + pFirstColFillProperties->moFillType.set(XML_solidFill); + pLastRowFillProperties->moFillType.set(XML_solidFill); + pLastColFillProperties->moFillType.set(XML_solidFill); + pBand1HFillProperties->moFillType.set(XML_solidFill); + pBand1VFillProperties->moFillType.set(XML_solidFill); + pBand2HFillProperties->moFillType.set(XML_solidFill); + pBand2VFillProperties->moFillType.set(XML_solidFill); + + // End to set fill types. + + // Define common properties. + + pWholeTblLeftBorder->moLineWidth = 12700; + pWholeTblRightBorder->moLineWidth = 12700; + pWholeTblTopBorder->moLineWidth = 12700; + pWholeTblBottomBorder->moLineWidth = 12700; + pWholeTblInsideHBorder->moLineWidth = 12700; + pWholeTblInsideVBorder->moLineWidth = 12700; + + pWholeTblLeftBorder->moPresetDash = XML_solid; + pWholeTblRightBorder->moPresetDash = XML_solid; + pWholeTblTopBorder->moPresetDash = XML_solid; + pWholeTblBottomBorder->moPresetDash = XML_solid; + pWholeTblInsideHBorder->moPresetDash = XML_solid; + pWholeTblInsideVBorder->moPresetDash = XML_solid; + + // Start to handle all style groups. + + OUString style_name = mStyleIdMap[styleId].first; + OUString accent_name = mStyleIdMap[styleId].second; + + if (style_name == "Themed-Style-1") + { + if (!accent_name.isEmpty()) + { + setBorderLineType(pWholeTblLeftBorder, XML_solidFill); + setBorderLineType(pWholeTblRightBorder, XML_solidFill); + setBorderLineType(pWholeTblTopBorder, XML_solidFill); + setBorderLineType(pWholeTblBottomBorder, XML_solidFill); + setBorderLineType(pWholeTblInsideHBorder, XML_solidFill); + setBorderLineType(pWholeTblInsideVBorder, XML_solidFill); + setBorderLineType(pFirstRowLeftBorder, XML_solidFill); + setBorderLineType(pFirstRowRightBorder, XML_solidFill); + setBorderLineType(pFirstRowTopBorder, XML_solidFill); + setBorderLineType(pFirstRowBottomBorder, XML_solidFill); + setBorderLineType(pLastRowLeftBorder, XML_solidFill); + setBorderLineType(pLastRowRightBorder, XML_solidFill); + setBorderLineType(pLastRowTopBorder, XML_solidFill); + setBorderLineType(pLastRowBottomBorder, XML_solidFill); + setBorderLineType(pFirstColLeftBorder, XML_solidFill); + setBorderLineType(pFirstColRightBorder, XML_solidFill); + setBorderLineType(pFirstColTopBorder, XML_solidFill); + setBorderLineType(pFirstColBottomBorder, XML_solidFill); + setBorderLineType(pFirstColInsideHBorder, XML_solidFill); + setBorderLineType(pLastColLeftBorder, XML_solidFill); + setBorderLineType(pLastColRightBorder, XML_solidFill); + setBorderLineType(pLastColTopBorder, XML_solidFill); + setBorderLineType(pLastColBottomBorder, XML_solidFill); + setBorderLineType(pLastColInsideHBorder, XML_solidFill); + + sal_Int32 accent_val = tokens[mStyleIdMap[styleId].second]; + + wholeTblTextColor.setSchemeClr(XML_dk1); + firstRowTextColor.setSchemeClr(XML_lt1); + + pWholeTblLeftBorder->maLineFill.maFillColor.setSchemeClr(accent_val); + pWholeTblRightBorder->maLineFill.maFillColor.setSchemeClr(accent_val); + pWholeTblTopBorder->maLineFill.maFillColor.setSchemeClr(accent_val); + pWholeTblBottomBorder->maLineFill.maFillColor.setSchemeClr(accent_val); + pWholeTblInsideHBorder->maLineFill.maFillColor.setSchemeClr(accent_val); + pWholeTblInsideVBorder->maLineFill.maFillColor.setSchemeClr(accent_val); + + pFirstRowLeftBorder->maLineFill.maFillColor.setSchemeClr(accent_val); + pFirstRowRightBorder->maLineFill.maFillColor.setSchemeClr(accent_val); + pFirstRowTopBorder->maLineFill.maFillColor.setSchemeClr(accent_val); + pFirstRowBottomBorder->maLineFill.maFillColor.setSchemeClr(XML_lt1); + pFirstRowFillProperties->maFillColor.setSchemeClr(accent_val); + + pLastRowLeftBorder->maLineFill.maFillColor.setSchemeClr(accent_val); + pLastRowRightBorder->maLineFill.maFillColor.setSchemeClr(accent_val); + pLastRowTopBorder->maLineFill.maFillColor.setSchemeClr(accent_val); + pLastRowBottomBorder->maLineFill.maFillColor.setSchemeClr(accent_val); + + pFirstColLeftBorder->maLineFill.maFillColor.setSchemeClr(accent_val); + pFirstColRightBorder->maLineFill.maFillColor.setSchemeClr(accent_val); + pFirstColTopBorder->maLineFill.maFillColor.setSchemeClr(accent_val); + pFirstColBottomBorder->maLineFill.maFillColor.setSchemeClr(accent_val); + pFirstColInsideHBorder->maLineFill.maFillColor.setSchemeClr(accent_val); + + pLastColLeftBorder->maLineFill.maFillColor.setSchemeClr(accent_val); + pLastColRightBorder->maLineFill.maFillColor.setSchemeClr(accent_val); + pLastColTopBorder->maLineFill.maFillColor.setSchemeClr(accent_val); + pLastColBottomBorder->maLineFill.maFillColor.setSchemeClr(accent_val); + pLastColInsideHBorder->maLineFill.maFillColor.setSchemeClr(accent_val); + + pBand1HFillProperties->maFillColor.setSchemeClr(accent_val); + pBand1VFillProperties->maFillColor.setSchemeClr(accent_val); + } + else + { + wholeTblTextColor.setSchemeClr(XML_tx1); + } + + pBand1HFillProperties->maFillColor.addTransformation(XML_alpha, 40000); + pBand1VFillProperties->maFillColor.addTransformation(XML_alpha, 40000); + } + else if (style_name == "Themed-Style-2") + { + setBorderLineType(pWholeTblLeftBorder, XML_solidFill); + setBorderLineType(pWholeTblRightBorder, XML_solidFill); + setBorderLineType(pWholeTblTopBorder, XML_solidFill); + setBorderLineType(pWholeTblBottomBorder, XML_solidFill); + + sal_Int32 accent_val; + + if (!accent_name.isEmpty()) + { + setBorderLineType(pFirstRowBottomBorder, XML_solidFill); + setBorderLineType(pLastRowTopBorder, XML_solidFill); + setBorderLineType(pFirstColRightBorder, XML_solidFill); + setBorderLineType(pLastColLeftBorder, XML_solidFill); + + wholeTblTextColor.setSchemeClr(XML_lt1); + firstRowTextColor.setSchemeClr(XML_lt1); + + accent_val = tokens[mStyleIdMap[styleId].second]; + + pTblBgFillProperties->maFillColor.setSchemeClr(accent_val); + pFirstRowBottomBorder->maLineFill.maFillColor.setSchemeClr(XML_lt1); + pLastRowTopBorder->maLineFill.maFillColor.setSchemeClr(XML_lt1); + pFirstColRightBorder->maLineFill.maFillColor.setSchemeClr(XML_lt1); + pLastColLeftBorder->maLineFill.maFillColor.setSchemeClr(XML_lt1); + pBand1HFillProperties->maFillColor.setSchemeClr(XML_lt1); + pBand1VFillProperties->maFillColor.setSchemeClr(XML_lt1); + } + else + { + setBorderLineType(pWholeTblInsideVBorder, XML_solidFill); + setBorderLineType(pWholeTblInsideHBorder, XML_solidFill); + + accent_val = XML_tx1; + + pWholeTblInsideVBorder->maLineFill.maFillColor.setSchemeClr(XML_tx1); + pWholeTblInsideHBorder->maLineFill.maFillColor.setSchemeClr(XML_tx1); + } + + pWholeTblLeftBorder->maLineFill.maFillColor.setSchemeClr(accent_val); + pWholeTblRightBorder->maLineFill.maFillColor.setSchemeClr(accent_val); + pWholeTblTopBorder->maLineFill.maFillColor.setSchemeClr(accent_val); + pWholeTblBottomBorder->maLineFill.maFillColor.setSchemeClr(accent_val); + + pBand1HFillProperties->maFillColor.addTransformation(XML_alpha, 20000); + pBand1VFillProperties->maFillColor.addTransformation(XML_alpha, 20000); + pWholeTblLeftBorder->maLineFill.maFillColor.addTransformation(XML_tint, 50000); + pWholeTblRightBorder->maLineFill.maFillColor.addTransformation(XML_tint, 50000); + pWholeTblTopBorder->maLineFill.maFillColor.addTransformation(XML_tint, 50000); + pWholeTblBottomBorder->maLineFill.maFillColor.addTransformation(XML_tint, 50000); + } + else if (style_name == "Light-Style-1") + { + setBorderLineType(pWholeTblTopBorder, XML_solidFill); + setBorderLineType(pWholeTblBottomBorder, XML_solidFill); + setBorderLineType(pFirstRowBottomBorder, XML_solidFill); + setBorderLineType(pLastRowTopBorder, XML_solidFill); + + wholeTblTextColor.setSchemeClr(XML_tx1); + + sal_Int32 accent_val; + + if (!accent_name.isEmpty()) + accent_val = tokens[mStyleIdMap[styleId].second]; + else + accent_val = XML_tx1; + + pWholeTblTopBorder->maLineFill.maFillColor.setSchemeClr(accent_val); + pWholeTblBottomBorder->maLineFill.maFillColor.setSchemeClr(accent_val); + pFirstRowBottomBorder->maLineFill.maFillColor.setSchemeClr(accent_val); + pLastRowTopBorder->maLineFill.maFillColor.setSchemeClr(accent_val); + + firstRowTextColor.setSchemeClr(accent_val); + + pBand1HFillProperties->maFillColor.setSchemeClr(accent_val); + pBand1VFillProperties->maFillColor.setSchemeClr(accent_val); + + pBand1HFillProperties->maFillColor.addTransformation(XML_alpha, 20000); + pBand1VFillProperties->maFillColor.addTransformation(XML_alpha, 20000); + } + else if (style_name == "Light-Style-2") + { + setBorderLineType(pWholeTblLeftBorder, XML_solidFill); + setBorderLineType(pWholeTblRightBorder, XML_solidFill); + setBorderLineType(pWholeTblTopBorder, XML_solidFill); + setBorderLineType(pWholeTblBottomBorder, XML_solidFill); + setBorderLineType(pLastRowTopBorder, XML_solidFill); + setBorderLineType(pBand1HTopBorder, XML_solidFill); + setBorderLineType(pBand1HBottomBorder, XML_solidFill); + setBorderLineType(pBand1VLeftBorder, XML_solidFill); + setBorderLineType(pBand1VRightBorder, XML_solidFill); + setBorderLineType(pBand2VLeftBorder, XML_solidFill); + setBorderLineType(pBand2VRightBorder, XML_solidFill); + + wholeTblTextColor.setSchemeClr(XML_tx1); + firstRowTextColor.setSchemeClr(XML_bg1); + + sal_Int32 accent_val; + + if (!accent_name.isEmpty()) + accent_val = tokens[mStyleIdMap[styleId].second]; + else + accent_val = XML_tx1; + + pWholeTblLeftBorder->maLineFill.maFillColor.setSchemeClr(accent_val); + pWholeTblRightBorder->maLineFill.maFillColor.setSchemeClr(accent_val); + pWholeTblTopBorder->maLineFill.maFillColor.setSchemeClr(accent_val); + pWholeTblBottomBorder->maLineFill.maFillColor.setSchemeClr(accent_val); + + pFirstRowFillProperties->maFillColor.setSchemeClr(accent_val); + pLastRowTopBorder->maLineFill.maFillColor.setSchemeClr(accent_val); + + pBand1HTopBorder->maLineFill.maFillColor.setSchemeClr(accent_val); + pBand1HBottomBorder->maLineFill.maFillColor.setSchemeClr(accent_val); + + pBand1VLeftBorder->maLineFill.maFillColor.setSchemeClr(accent_val); + pBand1VRightBorder->maLineFill.maFillColor.setSchemeClr(accent_val); + + pBand2VLeftBorder->maLineFill.maFillColor.setSchemeClr(accent_val); + pBand2VRightBorder->maLineFill.maFillColor.setSchemeClr(accent_val); + } + else if (style_name == "Light-Style-3") + { + setBorderLineType(pWholeTblLeftBorder, XML_solidFill); + setBorderLineType(pWholeTblRightBorder, XML_solidFill); + setBorderLineType(pWholeTblTopBorder, XML_solidFill); + setBorderLineType(pWholeTblBottomBorder, XML_solidFill); + setBorderLineType(pWholeTblInsideHBorder, XML_solidFill); + setBorderLineType(pWholeTblInsideVBorder, XML_solidFill); + setBorderLineType(pFirstRowBottomBorder, XML_solidFill); + setBorderLineType(pLastRowTopBorder, XML_solidFill); + + wholeTblTextColor.setSchemeClr(XML_tx1); + + sal_Int32 accent_val; + + if (!accent_name.isEmpty()) + accent_val = tokens[mStyleIdMap[styleId].second]; + else + accent_val = XML_tx1; + + pWholeTblLeftBorder->maLineFill.maFillColor.setSchemeClr(accent_val); + pWholeTblRightBorder->maLineFill.maFillColor.setSchemeClr(accent_val); + pWholeTblTopBorder->maLineFill.maFillColor.setSchemeClr(accent_val); + pWholeTblBottomBorder->maLineFill.maFillColor.setSchemeClr(accent_val); + pWholeTblInsideHBorder->maLineFill.maFillColor.setSchemeClr(accent_val); + pWholeTblInsideVBorder->maLineFill.maFillColor.setSchemeClr(accent_val); + + firstRowTextColor.setSchemeClr(accent_val); + pFirstRowBottomBorder->maLineFill.maFillColor.setSchemeClr(accent_val); + pLastRowTopBorder->maLineFill.maFillColor.setSchemeClr(accent_val); + pBand1HFillProperties->maFillColor.setSchemeClr(accent_val); + pBand1VFillProperties->maFillColor.setSchemeClr(accent_val); + + pBand1HFillProperties->maFillColor.addTransformation(XML_alpha, 20000); + pBand1VFillProperties->maFillColor.addTransformation(XML_alpha, 20000); + } + else if (style_name == "Medium-Style-1") + { + setBorderLineType(pWholeTblLeftBorder, XML_solidFill); + setBorderLineType(pWholeTblRightBorder, XML_solidFill); + setBorderLineType(pWholeTblTopBorder, XML_solidFill); + setBorderLineType(pWholeTblBottomBorder, XML_solidFill); + setBorderLineType(pWholeTblInsideHBorder, XML_solidFill); + setBorderLineType(pLastRowTopBorder, XML_solidFill); + + wholeTblTextColor.setSchemeClr(XML_dk1); + firstRowTextColor.setSchemeClr(XML_lt1); + pWholeTblFillProperties->maFillColor.setSchemeClr(XML_lt1); + pLastRowFillProperties->maFillColor.setSchemeClr(XML_lt1); + + sal_Int32 accent_val; + + if (!accent_name.isEmpty()) + accent_val = tokens[mStyleIdMap[styleId].second]; + else + accent_val = XML_dk1; + + pWholeTblLeftBorder->maLineFill.maFillColor.setSchemeClr(accent_val); + pWholeTblRightBorder->maLineFill.maFillColor.setSchemeClr(accent_val); + pWholeTblTopBorder->maLineFill.maFillColor.setSchemeClr(accent_val); + pWholeTblBottomBorder->maLineFill.maFillColor.setSchemeClr(accent_val); + pWholeTblInsideHBorder->maLineFill.maFillColor.setSchemeClr(accent_val); + + pFirstRowFillProperties->maFillColor.setSchemeClr(accent_val); + pBand1HFillProperties->maFillColor.setSchemeClr(accent_val); + pBand1VFillProperties->maFillColor.setSchemeClr(accent_val); + + pLastRowTopBorder->maLineFill.maFillColor.setSchemeClr(accent_val); + + pBand1HFillProperties->maFillColor.addTransformation(XML_tint, 20000); + pBand1VFillProperties->maFillColor.addTransformation(XML_tint, 20000); + } + else if (style_name == "Medium-Style-2") + { + setBorderLineType(pFirstRowBottomBorder, XML_solidFill); + setBorderLineType(pLastRowTopBorder, XML_solidFill); + setBorderLineType(pWholeTblLeftBorder, XML_solidFill); + setBorderLineType(pWholeTblRightBorder, XML_solidFill); + setBorderLineType(pWholeTblTopBorder, XML_solidFill); + setBorderLineType(pWholeTblBottomBorder, XML_solidFill); + setBorderLineType(pWholeTblInsideHBorder, XML_solidFill); + setBorderLineType(pWholeTblInsideVBorder, XML_solidFill); + + wholeTblTextColor.setSchemeClr(XML_dk1); + firstRowTextColor.setSchemeClr(XML_lt1); + lastRowTextColor.setSchemeClr(XML_lt1); + firstColTextColor.setSchemeClr(XML_lt1); + lastColTextColor.setSchemeClr(XML_lt1); + pFirstRowBottomBorder->maLineFill.maFillColor.setSchemeClr(XML_lt1); + pLastRowTopBorder->maLineFill.maFillColor.setSchemeClr(XML_lt1); + + pWholeTblLeftBorder->maLineFill.maFillColor.setSchemeClr(XML_lt1); + pWholeTblRightBorder->maLineFill.maFillColor.setSchemeClr(XML_lt1); + pWholeTblTopBorder->maLineFill.maFillColor.setSchemeClr(XML_lt1); + pWholeTblBottomBorder->maLineFill.maFillColor.setSchemeClr(XML_lt1); + pWholeTblInsideHBorder->maLineFill.maFillColor.setSchemeClr(XML_lt1); + pWholeTblInsideVBorder->maLineFill.maFillColor.setSchemeClr(XML_lt1); + + sal_Int32 accent_val; + + if (!accent_name.isEmpty()) + accent_val = tokens[mStyleIdMap[styleId].second]; + else + accent_val = XML_dk1; + + pWholeTblFillProperties->maFillColor.setSchemeClr(accent_val); + pFirstRowFillProperties->maFillColor.setSchemeClr(accent_val); + pLastRowFillProperties->maFillColor.setSchemeClr(accent_val); + pFirstColFillProperties->maFillColor.setSchemeClr(accent_val); + pLastColFillProperties->maFillColor.setSchemeClr(accent_val); + pBand1HFillProperties->maFillColor.setSchemeClr(accent_val); + pBand1VFillProperties->maFillColor.setSchemeClr(accent_val); + + pWholeTblFillProperties->maFillColor.addTransformation(XML_tint, 20000); + pBand1HFillProperties->maFillColor.addTransformation(XML_tint, 40000); + pBand1VFillProperties->maFillColor.addTransformation(XML_tint, 40000); + } + else if (style_name == "Medium-Style-3") + { + setBorderLineType(pWholeTblTopBorder, XML_solidFill); + setBorderLineType(pWholeTblBottomBorder, XML_solidFill); + setBorderLineType(pFirstRowBottomBorder, XML_solidFill); + setBorderLineType(pLastRowTopBorder, XML_solidFill); + + wholeTblTextColor.setSchemeClr(XML_dk1); + firstColTextColor.setSchemeClr(XML_lt1); + lastColTextColor.setSchemeClr(XML_lt1); + pWholeTblTopBorder->maLineFill.maFillColor.setSchemeClr(XML_dk1); + pWholeTblBottomBorder->maLineFill.maFillColor.setSchemeClr(XML_dk1); + pWholeTblFillProperties->maFillColor.setSchemeClr(XML_lt1); + pLastRowFillProperties->maFillColor.setSchemeClr(XML_lt1); + pBand1HFillProperties->maFillColor.setSchemeClr(XML_dk1); + pBand1VFillProperties->maFillColor.setSchemeClr(XML_dk1); + + firstRowTextColor.setSchemeClr(XML_lt1); + pFirstRowBottomBorder->maLineFill.maFillColor.setSchemeClr(XML_dk1); + pLastRowTopBorder->maLineFill.maFillColor.setSchemeClr(XML_dk1); + + sal_Int32 accent_val; + + if (!accent_name.isEmpty()) + accent_val = tokens[mStyleIdMap[styleId].second]; + else + accent_val = XML_dk1; + + pFirstRowFillProperties->maFillColor.setSchemeClr(accent_val); + pFirstColFillProperties->maFillColor.setSchemeClr(accent_val); + pLastColFillProperties->maFillColor.setSchemeClr(accent_val); + + pBand1HFillProperties->maFillColor.addTransformation(XML_tint, 20000); + pBand1VFillProperties->maFillColor.addTransformation(XML_tint, 20000); + } + else if (style_name == "Medium-Style-4") + { + setBorderLineType(pWholeTblLeftBorder, XML_solidFill); + setBorderLineType(pWholeTblRightBorder, XML_solidFill); + setBorderLineType(pWholeTblTopBorder, XML_solidFill); + setBorderLineType(pWholeTblBottomBorder, XML_solidFill); + setBorderLineType(pWholeTblInsideHBorder, XML_solidFill); + setBorderLineType(pWholeTblInsideVBorder, XML_solidFill); + + wholeTblTextColor.setSchemeClr(XML_dk1); + pLastRowTopBorder->maLineFill.maFillColor.setSchemeClr(XML_dk1); + pLastRowFillProperties->maFillColor.setSchemeClr(XML_dk1); + + sal_Int32 accent_val; + + if (!accent_name.isEmpty()) + accent_val = tokens[mStyleIdMap[styleId].second]; + else + accent_val = XML_dk1; + + pWholeTblLeftBorder->maLineFill.maFillColor.setSchemeClr(accent_val); + pWholeTblRightBorder->maLineFill.maFillColor.setSchemeClr(accent_val); + pWholeTblTopBorder->maLineFill.maFillColor.setSchemeClr(accent_val); + pWholeTblBottomBorder->maLineFill.maFillColor.setSchemeClr(accent_val); + pWholeTblInsideHBorder->maLineFill.maFillColor.setSchemeClr(accent_val); + pWholeTblInsideVBorder->maLineFill.maFillColor.setSchemeClr(accent_val); + pWholeTblFillProperties->maFillColor.setSchemeClr(accent_val); + + firstRowTextColor.setSchemeClr(accent_val); + pFirstRowFillProperties->maFillColor.setSchemeClr(accent_val); + pBand1HFillProperties->maFillColor.setSchemeClr(accent_val); + pBand1VFillProperties->maFillColor.setSchemeClr(accent_val); + + pFirstRowFillProperties->maFillColor.addTransformation(XML_tint, 20000); + pLastRowFillProperties->maFillColor.addTransformation(XML_tint, 20000); + pWholeTblFillProperties->maFillColor.addTransformation(XML_tint, 20000); + pBand1HFillProperties->maFillColor.addTransformation(XML_tint, 40000); + pBand1VFillProperties->maFillColor.addTransformation(XML_tint, 40000); + } + else if (style_name == "Dark-Style-1") + { + setBorderLineType(pFirstRowBottomBorder, XML_solidFill); + setBorderLineType(pFirstColRightBorder, XML_solidFill); + setBorderLineType(pLastColLeftBorder, XML_solidFill); + setBorderLineType(pLastRowTopBorder, XML_solidFill); + + sal_Int32 transform_val; + wholeTblTextColor.setSchemeClr(XML_dk1); + firstRowTextColor.setSchemeClr(XML_lt1); + pFirstRowBottomBorder->maLineFill.maFillColor.setSchemeClr(XML_lt1); + pFirstColRightBorder->maLineFill.maFillColor.setSchemeClr(XML_lt1); + pLastColLeftBorder->maLineFill.maFillColor.setSchemeClr(XML_lt1); + pFirstRowFillProperties->maFillColor.setSchemeClr(XML_dk1); + pLastRowTopBorder->maLineFill.maFillColor.setSchemeClr(XML_lt1); + + sal_Int32 accent_val; + + if (!accent_name.isEmpty()) + { + accent_val = tokens[mStyleIdMap[styleId].second]; + transform_val = XML_shade; + } + else + { + accent_val = XML_dk1; + transform_val = XML_tint; + } + + pWholeTblFillProperties->maFillColor.setSchemeClr(accent_val); + pLastRowFillProperties->maFillColor.setSchemeClr(accent_val); + pFirstColFillProperties->maFillColor.setSchemeClr(accent_val); + pLastColFillProperties->maFillColor.setSchemeClr(accent_val); + pBand1HFillProperties->maFillColor.setSchemeClr(accent_val); + pBand1VFillProperties->maFillColor.setSchemeClr(accent_val); + + pWholeTblFillProperties->maFillColor.addTransformation(transform_val, 20000); + pBand1HFillProperties->maFillColor.addTransformation(transform_val, 40000); + pBand1VFillProperties->maFillColor.addTransformation(transform_val, 40000); + pLastColFillProperties->maFillColor.addTransformation(transform_val, 60000); + pFirstColFillProperties->maFillColor.addTransformation(transform_val, 60000); + } + else if (style_name == "Dark-Style-2") + { + setBorderLineType(pLastRowTopBorder, XML_solidFill); + + wholeTblTextColor.setSchemeClr(XML_dk1); + firstRowTextColor.setSchemeClr(XML_lt1); + + pLastRowTopBorder->maLineFill.maFillColor.setSchemeClr(XML_dk1); + + if (accent_name.isEmpty()) + pFirstRowFillProperties->maFillColor.setSchemeClr(XML_dk1); + else if (accent_name == "Accent1") + pFirstRowFillProperties->maFillColor.setSchemeClr(XML_accent2); + else if (accent_name == "Accent3") + pFirstRowFillProperties->maFillColor.setSchemeClr(XML_accent4); + else if (accent_name == "Accent5") + pFirstRowFillProperties->maFillColor.setSchemeClr(XML_accent6); + + sal_Int32 accent_val; + + if (!accent_name.isEmpty()) + accent_val = tokens[mStyleIdMap[styleId].second]; + else + accent_val = XML_dk1; + + pWholeTblFillProperties->maFillColor.setSchemeClr(accent_val); + pLastRowFillProperties->maFillColor.setSchemeClr(accent_val); + pBand1HFillProperties->maFillColor.setSchemeClr(accent_val); + pBand1VFillProperties->maFillColor.setSchemeClr(accent_val); + + pWholeTblFillProperties->maFillColor.addTransformation(XML_tint, 20000); + pBand1HFillProperties->maFillColor.addTransformation(XML_tint, 40000); + pBand1VFillProperties->maFillColor.addTransformation(XML_tint, 40000); + pLastRowFillProperties->maFillColor.addTransformation(XML_tint, 20000); + } + + // End to handle all style groups. + + // Create a TableStyle from handled properties. + + pTableStyle->getWholeTbl().getTextColor() = wholeTblTextColor; + pTableStyle->getFirstRow().getTextColor() = firstRowTextColor; + pTableStyle->getFirstCol().getTextColor() = firstColTextColor; + pTableStyle->getLastRow().getTextColor() = lastRowTextColor; + pTableStyle->getLastCol().getTextColor() = lastColTextColor; + pTableStyle->getBand1H().getTextColor() = band1HTextColor; + pTableStyle->getBand1V().getTextColor() = band1VTextColor; + pTableStyle->getBand2H().getTextColor() = band2HTextColor; + pTableStyle->getBand2V().getTextColor() = band2VTextColor; + + pTableStyle->getBackgroundFillProperties() = pTblBgFillProperties; + pTableStyle->getWholeTbl().getFillProperties() = pWholeTblFillProperties; + pTableStyle->getFirstRow().getFillProperties() = pFirstRowFillProperties; + pTableStyle->getFirstCol().getFillProperties() = pFirstColFillProperties; + pTableStyle->getLastRow().getFillProperties() = pLastRowFillProperties; + pTableStyle->getLastCol().getFillProperties() = pLastColFillProperties; + pTableStyle->getBand1H().getFillProperties() = pBand1HFillProperties; + pTableStyle->getBand1V().getFillProperties() = pBand1VFillProperties; + pTableStyle->getBand2H().getFillProperties() = pBand2HFillProperties; + pTableStyle->getBand2V().getFillProperties() = pBand2VFillProperties; + + insertBorderLine(pTableStyle->getWholeTbl(), XML_left, pWholeTblLeftBorder); + insertBorderLine(pTableStyle->getWholeTbl(), XML_right, pWholeTblRightBorder); + insertBorderLine(pTableStyle->getWholeTbl(), XML_top, pWholeTblTopBorder); + insertBorderLine(pTableStyle->getWholeTbl(), XML_bottom, pWholeTblBottomBorder); + insertBorderLine(pTableStyle->getWholeTbl(), XML_insideV, pWholeTblInsideVBorder); + insertBorderLine(pTableStyle->getWholeTbl(), XML_insideH, pWholeTblInsideHBorder); + + insertBorderLine(pTableStyle->getFirstRow(), XML_left, pFirstRowLeftBorder); + insertBorderLine(pTableStyle->getFirstRow(), XML_right, pFirstRowRightBorder); + insertBorderLine(pTableStyle->getFirstRow(), XML_top, pFirstRowTopBorder); + insertBorderLine(pTableStyle->getFirstRow(), XML_bottom, pFirstRowBottomBorder); + insertBorderLine(pTableStyle->getFirstRow(), XML_insideV, pFirstRowInsideVBorder); + insertBorderLine(pTableStyle->getFirstRow(), XML_insideH, pFirstRowInsideHBorder); + + insertBorderLine(pTableStyle->getFirstCol(), XML_left, pFirstColLeftBorder); + insertBorderLine(pTableStyle->getFirstCol(), XML_right, pFirstColRightBorder); + insertBorderLine(pTableStyle->getFirstCol(), XML_top, pFirstColTopBorder); + insertBorderLine(pTableStyle->getFirstCol(), XML_bottom, pFirstColBottomBorder); + insertBorderLine(pTableStyle->getFirstCol(), XML_insideV, pFirstColInsideVBorder); + insertBorderLine(pTableStyle->getFirstCol(), XML_insideH, pFirstColInsideHBorder); + + insertBorderLine(pTableStyle->getLastRow(), XML_left, pLastRowLeftBorder); + insertBorderLine(pTableStyle->getLastRow(), XML_right, pLastRowRightBorder); + insertBorderLine(pTableStyle->getLastRow(), XML_top, pLastRowTopBorder); + insertBorderLine(pTableStyle->getLastRow(), XML_bottom, pLastRowBottomBorder); + insertBorderLine(pTableStyle->getLastRow(), XML_insideV, pLastRowInsideVBorder); + insertBorderLine(pTableStyle->getLastRow(), XML_insideH, pLastRowInsideHBorder); + + insertBorderLine(pTableStyle->getLastCol(), XML_left, pLastColLeftBorder); + insertBorderLine(pTableStyle->getLastCol(), XML_right, pLastColRightBorder); + insertBorderLine(pTableStyle->getLastCol(), XML_top, pLastColTopBorder); + insertBorderLine(pTableStyle->getLastCol(), XML_bottom, pLastColBottomBorder); + insertBorderLine(pTableStyle->getLastCol(), XML_insideV, pLastColInsideVBorder); + insertBorderLine(pTableStyle->getLastCol(), XML_insideH, pLastColInsideHBorder); + + insertBorderLine(pTableStyle->getBand1H(), XML_left, pBand1HLeftBorder); + insertBorderLine(pTableStyle->getBand1H(), XML_right, pBand1HRightBorder); + insertBorderLine(pTableStyle->getBand1H(), XML_top, pBand1HTopBorder); + insertBorderLine(pTableStyle->getBand1H(), XML_bottom, pBand1HBottomBorder); + insertBorderLine(pTableStyle->getBand1H(), XML_insideV, pBand1HInsideVBorder); + insertBorderLine(pTableStyle->getBand1H(), XML_insideH, pBand1HInsideHBorder); + + insertBorderLine(pTableStyle->getBand1V(), XML_left, pBand1VLeftBorder); + insertBorderLine(pTableStyle->getBand1V(), XML_right, pBand1VRightBorder); + insertBorderLine(pTableStyle->getBand1V(), XML_top, pBand1VTopBorder); + insertBorderLine(pTableStyle->getBand1V(), XML_bottom, pBand1VBottomBorder); + insertBorderLine(pTableStyle->getBand1V(), XML_insideV, pBand1VInsideVBorder); + insertBorderLine(pTableStyle->getBand1V(), XML_insideH, pBand1VInsideHBorder); + + insertBorderLine(pTableStyle->getBand2H(), XML_left, pBand2HLeftBorder); + insertBorderLine(pTableStyle->getBand2H(), XML_right, pBand2HRightBorder); + insertBorderLine(pTableStyle->getBand2H(), XML_top, pBand2HTopBorder); + insertBorderLine(pTableStyle->getBand2H(), XML_bottom, pBand2HBottomBorder); + insertBorderLine(pTableStyle->getBand2H(), XML_insideV, pBand2HInsideVBorder); + insertBorderLine(pTableStyle->getBand2H(), XML_insideH, pBand2HInsideHBorder); + + insertBorderLine(pTableStyle->getBand2V(), XML_left, pBand2VLeftBorder); + insertBorderLine(pTableStyle->getBand2V(), XML_right, pBand2VRightBorder); + insertBorderLine(pTableStyle->getBand2V(), XML_top, pBand2VTopBorder); + insertBorderLine(pTableStyle->getBand2V(), XML_bottom, pBand2VBottomBorder); + insertBorderLine(pTableStyle->getBand2V(), XML_insideV, pBand2VInsideVBorder); + insertBorderLine(pTableStyle->getBand2V(), XML_insideH, pBand2VInsideHBorder); + + return pTableStyle; +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/drawingml/table/tablebackgroundstylecontext.cxx b/oox/source/drawingml/table/tablebackgroundstylecontext.cxx new file mode 100644 index 000000000..ee48a8358 --- /dev/null +++ b/oox/source/drawingml/table/tablebackgroundstylecontext.cxx @@ -0,0 +1,74 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + + +#include +#include +#include +#include +#include + +using namespace ::oox::core; +using namespace ::com::sun::star; +using namespace ::com::sun::star::uno; +using namespace ::com::sun::star::xml::sax; + +namespace oox::drawingml::table { + +TableBackgroundStyleContext::TableBackgroundStyleContext( ContextHandler2Helper const & rParent, TableStyle& rTableStyle ) +: ContextHandler2( rParent ) +, mrTableStyle( rTableStyle ) +{ +} + +TableBackgroundStyleContext::~TableBackgroundStyleContext() +{ +} + +ContextHandlerRef +TableBackgroundStyleContext::onCreateContext( ::sal_Int32 aElementToken, const AttributeList& rAttribs ) +{ + switch( aElementToken ) + { + // EG_ThemeableFillStyle (choice) + case A_TOKEN( fill ): // CT_FillProperties + { + std::shared_ptr< FillProperties >& rxFillProperties = mrTableStyle.getBackgroundFillProperties(); + rxFillProperties = std::make_shared(); + return new FillPropertiesContext( *this, *rxFillProperties ); + } + case A_TOKEN( fillRef ): // CT_StyleMatrixReference + { + ShapeStyleRef& rStyleRef = mrTableStyle.getBackgroundFillStyleRef(); + rStyleRef.mnThemedIdx = rAttribs.getInteger( XML_idx, 0 ); + return new ColorContext( *this, rStyleRef.maPhClr ); + } + // EG_ThemeableEffectStyle (choice) + case A_TOKEN( effect ): // CT_EffectProperties + break; + case A_TOKEN( effectRef ): // CT_StyleMatrixReference + break; + } + + return this; +} + +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/drawingml/table/tablecell.cxx b/oox/source/drawingml/table/tablecell.cxx new file mode 100644 index 000000000..19347db21 --- /dev/null +++ b/oox/source/drawingml/table/tablecell.cxx @@ -0,0 +1,578 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +using namespace ::oox::core; +using namespace ::com::sun::star; +using namespace ::com::sun::star::uno; +using namespace ::com::sun::star::beans; +using ::com::sun::star::table::BorderLine2; + +namespace oox::drawingml::table { + +TableCell::TableCell() +: mpTextBody( std::make_shared() ) +, mnRowSpan ( 1 ) +, mnGridSpan( 1 ) +, mbhMerge( false ) +, mbvMerge( false ) +, mnMarL( 91440 ) +, mnMarR( 91440 ) +, mnMarT( 45720 ) +, mnMarB( 45720 ) +, mnVertToken( XML_horz ) +, mnAnchorToken( XML_t ) +, mbAnchorCtr( false ) +, mnHorzOverflowToken( XML_clip ) +{ +} + +static void applyLineAttributes( const ::oox::core::XmlFilterBase& rFilterBase, + Reference< XPropertySet > const & rxPropSet, oox::drawingml::LineProperties const & rLineProperties, + sal_Int32 nPropId ) +{ + BorderLine2 aBorderLine; + if ( rLineProperties.maLineFill.moFillType.differsFrom( XML_noFill )) + { + Color aColor = rLineProperties.maLineFill.getBestSolidColor(); + aBorderLine.Color = sal_Int32(aColor.getColor( rFilterBase.getGraphicHelper() )); + aBorderLine.OuterLineWidth = static_cast< sal_Int16 >( GetCoordinate( rLineProperties.moLineWidth.get( 0 ) ) / 4 ); + aBorderLine.InnerLineWidth = static_cast< sal_Int16 >( GetCoordinate( rLineProperties.moLineWidth.get( 0 ) ) / 4 ); + aBorderLine.LineWidth = static_cast< sal_Int16 >( GetCoordinate( rLineProperties.moLineWidth.get( 0 ) ) / 2 ); + aBorderLine.LineDistance = 0; + } + else + { + aBorderLine.Color = sal_Int32( COL_AUTO ); + aBorderLine.OuterLineWidth = static_cast< sal_Int16 >( GetCoordinate( rLineProperties.moLineWidth.get( 0 ) ) / 4 ); + aBorderLine.InnerLineWidth = static_cast< sal_Int16 >( GetCoordinate( rLineProperties.moLineWidth.get( 0 ) ) / 4 ); + aBorderLine.LineWidth = static_cast< sal_Int16 >( GetCoordinate( rLineProperties.moLineWidth.get( 0 ) ) / 2 ); + aBorderLine.LineDistance = 0; + } + + if ( rLineProperties.moPresetDash.has() ) + { + switch ( rLineProperties.moPresetDash.get() ) + { + case XML_dot: + case XML_sysDot: + aBorderLine.LineStyle = ::table::BorderLineStyle::DOTTED; + break; + case XML_dash: + case XML_lgDash: + case XML_sysDash: + aBorderLine.LineStyle = ::table::BorderLineStyle::DASHED; + break; + case XML_dashDot: + case XML_lgDashDot: + case XML_sysDashDot: + aBorderLine.LineStyle = ::table::BorderLineStyle::DASH_DOT; + break; + case XML_lgDashDotDot: + case XML_sysDashDotDot: + aBorderLine.LineStyle = ::table::BorderLineStyle::DASH_DOT_DOT; + break; + case XML_solid: + aBorderLine.LineStyle = ::table::BorderLineStyle::SOLID; + break; + default: + aBorderLine.LineStyle = ::table::BorderLineStyle::DASHED; + break; + } + } + else if ( !rLineProperties.maCustomDash.empty() ) + { + aBorderLine.LineStyle = ::table::BorderLineStyle::DASHED; + } + else + { + aBorderLine.LineStyle = ::table::BorderLineStyle::NONE; + } + + PropertySet aPropSet( rxPropSet ); + aPropSet.setProperty( nPropId, aBorderLine ); +} + +static void applyBorder( const ::oox::core::XmlFilterBase& rFilterBase, TableStylePart& rTableStylePart, sal_Int32 nLineType, oox::drawingml::LineProperties& rLineProperties ) +{ + std::map < sal_Int32, ::oox::drawingml::LinePropertiesPtr >& rPartLineBorders( rTableStylePart.getLineBorders() ); + ::oox::drawingml::ShapeStyleRef& rLineStyleRef = rTableStylePart.getStyleRefs()[ nLineType ]; + std::map < sal_Int32, ::oox::drawingml::LinePropertiesPtr >::const_iterator aIter( rPartLineBorders.find( nLineType ) ); + if ( ( aIter != rPartLineBorders.end() ) && aIter->second ) + rLineProperties.assignUsed( *aIter->second ); + else if (rLineStyleRef.mnThemedIdx != 0) + { + if (const Theme* pTheme = rFilterBase.getCurrentTheme()) + { + rLineProperties.assignUsed( *pTheme->getLineStyle(rLineStyleRef.mnThemedIdx) ); + ::Color nPhClr = rLineStyleRef.maPhClr.getColor( rFilterBase.getGraphicHelper() ); + rLineProperties.maLineFill.maFillColor.setSrgbClr( nPhClr ); + } + } +} + +static void applyTableStylePart( const ::oox::core::XmlFilterBase& rFilterBase, + oox::drawingml::FillProperties& rFillProperties, + TextCharacterProperties& aTextCharProps, + oox::drawingml::LineProperties& rLeftBorder, + oox::drawingml::LineProperties& rRightBorder, + oox::drawingml::LineProperties& rTopBorder, + oox::drawingml::LineProperties& rBottomBorder, + oox::drawingml::LineProperties& rInsideHBorder, + oox::drawingml::LineProperties& rInsideVBorder, + oox::drawingml::LineProperties& rTopLeftToBottomRightBorder, + oox::drawingml::LineProperties& rBottomLeftToTopRightBorder, + TableStylePart& rTableStylePart, + bool bIsWholeTable = false, + sal_Int32 nCol = 0, + sal_Int32 nMaxCol = 0, + sal_Int32 nRow = 0, + sal_Int32 nMaxRow = 0) +{ + ::oox::drawingml::FillPropertiesPtr& rPartFillPropertiesPtr( rTableStylePart.getFillProperties() ); + if ( rPartFillPropertiesPtr ) + rFillProperties.assignUsed( *rPartFillPropertiesPtr ); + else + { + ::oox::drawingml::ShapeStyleRef& rFillStyleRef = rTableStylePart.getStyleRefs()[ XML_fillRef ]; + const Theme* pTheme = rFilterBase.getCurrentTheme(); + if (pTheme && rFillStyleRef.mnThemedIdx != 0 ) + { + rFillProperties.assignUsed( *pTheme->getFillStyle( rFillStyleRef.mnThemedIdx ) ); + ::Color nPhClr = rFillStyleRef.maPhClr.getColor( rFilterBase.getGraphicHelper() ); + rFillProperties.maFillColor.setSrgbClr( nPhClr ); + } + } + + // Left, right, top and bottom side of the whole table should be mean outer frame of the whole table. + // Without this check it means left top right and bottom of whole cells of whole table. + if (bIsWholeTable) + { + if (nCol == 0) + applyBorder( rFilterBase, rTableStylePart, XML_left, rLeftBorder ); + if (nCol == nMaxCol) + applyBorder( rFilterBase, rTableStylePart, XML_right, rRightBorder ); + if (nRow == 0) + applyBorder( rFilterBase, rTableStylePart, XML_top, rTopBorder ); + if (nRow == nMaxRow) + applyBorder( rFilterBase, rTableStylePart, XML_bottom, rBottomBorder ); + + applyBorder( rFilterBase, rTableStylePart, XML_insideH, rInsideHBorder ); + applyBorder( rFilterBase, rTableStylePart, XML_insideV, rInsideVBorder ); + applyBorder( rFilterBase, rTableStylePart, XML_tl2br, rTopLeftToBottomRightBorder ); + applyBorder( rFilterBase, rTableStylePart, XML_tr2bl, rBottomLeftToTopRightBorder ); + } + else + { + applyBorder( rFilterBase, rTableStylePart, XML_left, rLeftBorder ); + applyBorder( rFilterBase, rTableStylePart, XML_right, rRightBorder ); + applyBorder( rFilterBase, rTableStylePart, XML_top, rTopBorder ); + applyBorder( rFilterBase, rTableStylePart, XML_bottom, rBottomBorder ); + applyBorder( rFilterBase, rTableStylePart, XML_tl2br, rTopLeftToBottomRightBorder ); + applyBorder( rFilterBase, rTableStylePart, XML_tr2bl, rBottomLeftToTopRightBorder ); + applyBorder( rFilterBase, rTableStylePart, XML_insideH, rInsideHBorder ); + applyBorder( rFilterBase, rTableStylePart, XML_insideV, rInsideVBorder ); + } + + aTextCharProps.maLatinFont = rTableStylePart.getLatinFont(); + aTextCharProps.maAsianFont = rTableStylePart.getAsianFont(); + aTextCharProps.maComplexFont = rTableStylePart.getComplexFont(); + aTextCharProps.maSymbolFont = rTableStylePart.getSymbolFont(); + if ( rTableStylePart.getTextColor().isUsed() ) + { + aTextCharProps.maFillProperties.maFillColor = rTableStylePart.getTextColor(); + aTextCharProps.maFillProperties.moFillType.set(XML_solidFill); + } + if( rTableStylePart.getTextBoldStyle() ) + aTextCharProps.moBold = *rTableStylePart.getTextBoldStyle(); + if( rTableStylePart.getTextItalicStyle() ) + aTextCharProps.moItalic = *rTableStylePart.getTextItalicStyle(); +} + +static void applyTableCellProperties( const Reference < css::table::XCell >& rxCell, const TableCell& rTableCell ) +{ + Reference< XPropertySet > xPropSet( rxCell, UNO_QUERY_THROW ); + xPropSet->setPropertyValue( "TextUpperDistance", Any( static_cast< sal_Int32 >( rTableCell.getTopMargin() / 360 ) ) ); + xPropSet->setPropertyValue( "TextRightDistance", Any( static_cast< sal_Int32 >( rTableCell.getRightMargin() / 360 ) ) ); + xPropSet->setPropertyValue( "TextLeftDistance", Any( static_cast< sal_Int32 >( rTableCell.getLeftMargin() / 360 ) ) ); + xPropSet->setPropertyValue( "TextLowerDistance", Any( static_cast< sal_Int32 >( rTableCell.getBottomMargin() / 360 ) ) ); + + drawing::TextVerticalAdjust eVA; + switch( rTableCell.getAnchorToken() ) + { + case XML_ctr: eVA = drawing::TextVerticalAdjust_CENTER; break; + case XML_b: eVA = drawing::TextVerticalAdjust_BOTTOM; break; + case XML_just: + case XML_dist: + default: + case XML_t: eVA = drawing::TextVerticalAdjust_TOP; break; + } + xPropSet->setPropertyValue( "TextVerticalAdjust", Any( eVA ) ); +} + +void TableCell::pushToXCell( const ::oox::core::XmlFilterBase& rFilterBase, const ::oox::drawingml::TextListStylePtr& pMasterTextListStyle, + const css::uno::Reference < css::table::XCell >& rxCell, const TableProperties& rTableProperties, + const TableStyle& rTableStyle, sal_Int32 nColumn, sal_Int32 nMaxColumn, sal_Int32 nRow, sal_Int32 nMaxRow ) +{ + TableStyle& rTable( const_cast< TableStyle& >( rTableStyle ) ); + TableProperties& rProperties( const_cast< TableProperties& >( rTableProperties ) ); + + Reference< text::XText > xText( rxCell, UNO_QUERY_THROW ); + Reference< text::XTextCursor > xAt = xText->createTextCursor(); + + applyTableCellProperties( rxCell, *this ); + TextCharacterProperties aTextStyleProps; + xAt->gotoStart( true ); + xAt->gotoEnd( true ); + + Reference< XPropertySet > xPropSet( rxCell, UNO_QUERY_THROW ); + oox::drawingml::FillProperties aFillProperties; + oox::drawingml::LineProperties aLinePropertiesLeft; + oox::drawingml::LineProperties aLinePropertiesRight; + oox::drawingml::LineProperties aLinePropertiesTop; + oox::drawingml::LineProperties aLinePropertiesBottom; + oox::drawingml::LineProperties aLinePropertiesInsideH; + oox::drawingml::LineProperties aLinePropertiesInsideV; + oox::drawingml::LineProperties aLinePropertiesTopLeftToBottomRight; + oox::drawingml::LineProperties aLinePropertiesBottomLeftToTopRight; + + applyTableStylePart( rFilterBase, aFillProperties, aTextStyleProps, + aLinePropertiesLeft, + aLinePropertiesRight, + aLinePropertiesTop, + aLinePropertiesBottom, + aLinePropertiesInsideH, + aLinePropertiesInsideV, + aLinePropertiesTopLeftToBottomRight, + aLinePropertiesBottomLeftToTopRight, + rTable.getWholeTbl(), + true, + nColumn, + nMaxColumn, + nRow, + nMaxRow ); + + if ( rProperties.isFirstRow() && ( nRow == 0 ) ) + { + applyTableStylePart( rFilterBase, aFillProperties, aTextStyleProps, + aLinePropertiesLeft, + aLinePropertiesRight, + aLinePropertiesTop, + aLinePropertiesBottom, + aLinePropertiesInsideH, + aLinePropertiesInsideV, + aLinePropertiesTopLeftToBottomRight, + aLinePropertiesBottomLeftToTopRight, + rTable.getFirstRow() ); + } + if ( rProperties.isLastRow() && ( nRow == nMaxRow ) ) + { + applyTableStylePart( rFilterBase, aFillProperties, aTextStyleProps, + aLinePropertiesLeft, + aLinePropertiesRight, + aLinePropertiesTop, + aLinePropertiesBottom, + aLinePropertiesInsideH, + aLinePropertiesInsideV, + aLinePropertiesTopLeftToBottomRight, + aLinePropertiesBottomLeftToTopRight, + rTable.getLastRow() ); + } + if ( rProperties.isFirstCol() && ( nColumn == 0 ) ) + { + applyTableStylePart( rFilterBase, aFillProperties, aTextStyleProps, + aLinePropertiesLeft, + aLinePropertiesRight, + aLinePropertiesTop, + aLinePropertiesBottom, + aLinePropertiesInsideH, + aLinePropertiesInsideV, + aLinePropertiesTopLeftToBottomRight, + aLinePropertiesBottomLeftToTopRight, + rTable.getFirstCol() ); + } + if ( rProperties.isLastCol() && ( nColumn == nMaxColumn ) ) + { + applyTableStylePart( rFilterBase, aFillProperties, aTextStyleProps, + aLinePropertiesLeft, + aLinePropertiesRight, + aLinePropertiesTop, + aLinePropertiesBottom, + aLinePropertiesInsideH, + aLinePropertiesInsideV, + aLinePropertiesTopLeftToBottomRight, + aLinePropertiesBottomLeftToTopRight, + rTable.getLastCol() ); + } + if ( rProperties.isBandRow() ) + { + if ( ( !rProperties.isFirstRow() || ( nRow != 0 ) ) && + ( !rProperties.isLastRow() || ( nRow != nMaxRow ) ) && + ( !rProperties.isFirstCol() || ( nColumn != 0 ) ) && + ( !rProperties.isLastCol() || ( nColumn != nMaxColumn ) ) ) + { + sal_Int32 nBand = nRow; + if ( rProperties.isFirstRow() ) + nBand++; + if ( nBand & 1 ) + { + applyTableStylePart( rFilterBase, aFillProperties, aTextStyleProps, + aLinePropertiesLeft, + aLinePropertiesRight, + aLinePropertiesTop, + aLinePropertiesBottom, + aLinePropertiesInsideH, + aLinePropertiesInsideV, + aLinePropertiesTopLeftToBottomRight, + aLinePropertiesBottomLeftToTopRight, + rTable.getBand2H() ); + } + else + { + applyTableStylePart( rFilterBase, aFillProperties, aTextStyleProps, + aLinePropertiesLeft, + aLinePropertiesRight, + aLinePropertiesTop, + aLinePropertiesBottom, + aLinePropertiesInsideH, + aLinePropertiesInsideV, + aLinePropertiesTopLeftToBottomRight, + aLinePropertiesBottomLeftToTopRight, + rTable.getBand1H() ); + } + } + } + if ( ( nRow == 0 ) && ( nColumn == 0 ) ) + { + applyTableStylePart( rFilterBase, aFillProperties, aTextStyleProps, + aLinePropertiesLeft, + aLinePropertiesRight, + aLinePropertiesTop, + aLinePropertiesBottom, + aLinePropertiesInsideH, + aLinePropertiesInsideV, + aLinePropertiesTopLeftToBottomRight, + aLinePropertiesBottomLeftToTopRight, + rTable.getNwCell() ); + } + if ( ( nRow == nMaxRow ) && ( nColumn == 0 ) ) + { + applyTableStylePart( rFilterBase, aFillProperties, aTextStyleProps, + aLinePropertiesLeft, + aLinePropertiesRight, + aLinePropertiesTop, + aLinePropertiesBottom, + aLinePropertiesInsideH, + aLinePropertiesInsideV, + aLinePropertiesTopLeftToBottomRight, + aLinePropertiesBottomLeftToTopRight, + rTable.getSwCell() ); + } + if ( ( nRow == 0 ) && ( nColumn == nMaxColumn ) ) + { + applyTableStylePart( rFilterBase, aFillProperties, aTextStyleProps, + aLinePropertiesLeft, + aLinePropertiesRight, + aLinePropertiesTop, + aLinePropertiesBottom, + aLinePropertiesInsideH, + aLinePropertiesInsideV, + aLinePropertiesTopLeftToBottomRight, + aLinePropertiesBottomLeftToTopRight, + rTable.getNeCell() ); + } + if ( ( nRow == nMaxRow ) && ( nColumn == nMaxColumn ) ) + { + applyTableStylePart( rFilterBase, aFillProperties, aTextStyleProps, + aLinePropertiesLeft, + aLinePropertiesRight, + aLinePropertiesTop, + aLinePropertiesBottom, + aLinePropertiesInsideH, + aLinePropertiesInsideV, + aLinePropertiesTopLeftToBottomRight, + aLinePropertiesBottomLeftToTopRight, + rTable.getSeCell() ); + } + if ( rProperties.isBandCol() ) + { + if ( ( !rProperties.isFirstRow() || ( nRow != 0 ) ) && + ( !rProperties.isLastRow() || ( nRow != nMaxRow ) ) && + ( !rProperties.isFirstCol() || ( nColumn != 0 ) ) && + ( !rProperties.isLastCol() || ( nColumn != nMaxColumn ) ) ) + { + sal_Int32 nBand = nColumn; + if ( rProperties.isFirstCol() ) + nBand++; + if ( nBand & 1 ) + { + applyTableStylePart( rFilterBase, aFillProperties, aTextStyleProps, + aLinePropertiesLeft, + aLinePropertiesRight, + aLinePropertiesTop, + aLinePropertiesBottom, + aLinePropertiesInsideH, + aLinePropertiesInsideV, + aLinePropertiesTopLeftToBottomRight, + aLinePropertiesBottomLeftToTopRight, + rTable.getBand2V() ); + } + else + { + applyTableStylePart( rFilterBase, aFillProperties, aTextStyleProps, + aLinePropertiesLeft, + aLinePropertiesRight, + aLinePropertiesTop, + aLinePropertiesBottom, + aLinePropertiesInsideH, + aLinePropertiesInsideV, + aLinePropertiesTopLeftToBottomRight, + aLinePropertiesBottomLeftToTopRight, + rTable.getBand1V() ); + } + } + } + aLinePropertiesLeft.assignUsed( maLinePropertiesLeft ); + aLinePropertiesRight.assignUsed( maLinePropertiesRight ); + aLinePropertiesTop.assignUsed( maLinePropertiesTop ); + aLinePropertiesBottom.assignUsed( maLinePropertiesBottom ); + aLinePropertiesInsideH.assignUsed( maLinePropertiesInsideH ); + aLinePropertiesInsideV.assignUsed( maLinePropertiesInsideV ); + aLinePropertiesTopLeftToBottomRight.assignUsed( maLinePropertiesTopLeftToBottomRight ); + aLinePropertiesBottomLeftToTopRight.assignUsed( maLinePropertiesBottomLeftToTopRight ); + + applyLineAttributes( rFilterBase, xPropSet, aLinePropertiesLeft, PROP_LeftBorder ); + applyLineAttributes( rFilterBase, xPropSet, aLinePropertiesRight, PROP_RightBorder ); + applyLineAttributes( rFilterBase, xPropSet, aLinePropertiesTop, PROP_TopBorder ); + applyLineAttributes( rFilterBase, xPropSet, aLinePropertiesBottom, PROP_BottomBorder ); + applyLineAttributes( rFilterBase, xPropSet, aLinePropertiesTopLeftToBottomRight, PROP_DiagonalTLBR ); + applyLineAttributes( rFilterBase, xPropSet, aLinePropertiesBottomLeftToTopRight, PROP_DiagonalBLTR ); + + // Convert insideH to Top and Bottom, InsideV to Left and Right. Exclude the outer borders. + if(nRow != 0) + { + aLinePropertiesInsideH.assignUsed( aLinePropertiesTop ); + applyLineAttributes( rFilterBase, xPropSet, aLinePropertiesInsideH, PROP_TopBorder ); + } + if(nRow != nMaxRow) + { + aLinePropertiesInsideH.assignUsed( aLinePropertiesBottom ); + applyLineAttributes( rFilterBase, xPropSet, aLinePropertiesInsideH, PROP_BottomBorder ); + } + if(nColumn != 0) + { + aLinePropertiesInsideV.assignUsed( aLinePropertiesLeft ); + applyLineAttributes( rFilterBase, xPropSet, aLinePropertiesInsideV, PROP_LeftBorder ); + } + if(nColumn != nMaxColumn) + { + aLinePropertiesInsideV.assignUsed( aLinePropertiesRight ); + applyLineAttributes( rFilterBase, xPropSet, aLinePropertiesInsideV, PROP_RightBorder ); + } + + if (rProperties.getBgColor().isUsed() && !maFillProperties.maFillColor.isUsed() && maFillProperties.moFillType.get() == XML_noFill) + { + maFillProperties.moFillType = XML_solidFill; + maFillProperties.maFillColor = rProperties.getBgColor(); + } + + aFillProperties.assignUsed( maFillProperties ); + ShapePropertyMap aPropMap( rFilterBase.getModelObjectHelper() ); + + Color aBgColor; + ::Color nPhClr = API_RGB_TRANSPARENT; + std::shared_ptr< ::oox::drawingml::FillProperties >& rBackgroundFillPropertiesPtr( rTable.getBackgroundFillProperties() ); + ::oox::drawingml::ShapeStyleRef& rBackgroundFillStyle( rTable.getBackgroundFillStyleRef() ); + if (rBackgroundFillPropertiesPtr) + aBgColor = rBackgroundFillPropertiesPtr->getBestSolidColor(); + else if (rBackgroundFillStyle.mnThemedIdx != 0) + { + if (const Theme* pTheme = rFilterBase.getCurrentTheme()) + { + aBgColor = pTheme->getFillStyle(rBackgroundFillStyle.mnThemedIdx)->getBestSolidColor(); + nPhClr = rBackgroundFillStyle.maPhClr.getColor(rFilterBase.getGraphicHelper()); + } + } + if (aBgColor.isUsed()) + { + const Color& rCellColor = aFillProperties.getBestSolidColor(); + const double fTransparency = rCellColor.isUsed() ? 0.01 * rCellColor.getTransparency() : 1.0; + ::Color nBgColor( aBgColor.getColor(rFilterBase.getGraphicHelper(), nPhClr) ); + ::Color nCellColor( rCellColor.getColor(rFilterBase.getGraphicHelper()) ); + ::Color aResult( basegfx::interpolate(nBgColor.getBColor(), nCellColor.getBColor(), 1.0 - fTransparency) ); + aFillProperties.maFillColor.clearTransformations(); + aFillProperties.maFillColor.setSrgbClr(sal_Int32(aResult.GetRGBColor())); + aFillProperties.moFillType.set(XML_solidFill); + } + if (!aFillProperties.moFillType.has()) + aFillProperties.moFillType.set(XML_noFill); + + // TODO: phClr? + aFillProperties.pushToPropMap( aPropMap, rFilterBase.getGraphicHelper() ); + PropertySet aPropSet{xPropSet}; + aPropSet.setProperties( aPropMap ); + + if ( getVertToken() == XML_eaVert ) + { + xPropSet->setPropertyValue("TextWritingMode", Any(css::text::WritingMode_TB_RL)); + } + + getTextBody()->insertAt( rFilterBase, xText, xAt, aTextStyleProps, pMasterTextListStyle ); + + // tdf#144092 For empty cells push character styles & endParaRPr to the Cell's properties + const TextParagraphVector& rParagraphs = getTextBody()->getParagraphs(); + if (rParagraphs.size() == 1) + { + const auto pFirstParagraph = rParagraphs.at(0); + if (pFirstParagraph->getRuns().empty()) + { + TextCharacterProperties aTextCharacterProps{ pFirstParagraph->getCharacterStyle( + aTextStyleProps, *pMasterTextListStyle, getTextBody()->getTextListStyle()) }; + aTextCharacterProps.assignUsed(pFirstParagraph->getEndProperties()); + aTextCharacterProps.pushToPropSet(aPropSet, rFilterBase); + } + } + + if (getVertToken() == XML_vert) + xPropSet->setPropertyValue("RotateAngle", Any(short(27000))); + else if (getVertToken() == XML_vert270) + xPropSet->setPropertyValue("RotateAngle", Any(short(9000))); +} + +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/drawingml/table/tablecellcontext.cxx b/oox/source/drawingml/table/tablecellcontext.cxx new file mode 100644 index 000000000..dde824fb7 --- /dev/null +++ b/oox/source/drawingml/table/tablecellcontext.cxx @@ -0,0 +1,103 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + + +#include +#include +#include +#include +#include +#include +#include + +using namespace ::oox::core; +using namespace ::com::sun::star; + +namespace oox::drawingml::table { + +TableCellContext::TableCellContext( ContextHandler2Helper const & rParent, const AttributeList& rAttribs, TableCell& rTableCell ) +: ContextHandler2( rParent ) +, mrTableCell( rTableCell ) +{ + if ( rAttribs.hasAttribute( XML_rowSpan ) ) + mrTableCell.setRowSpan( rAttribs.getString( XML_rowSpan ).get().toInt32() ); + if ( rAttribs.hasAttribute( XML_gridSpan ) ) + mrTableCell.setGridSpan( rAttribs.getString( XML_gridSpan ).get().toInt32() ); + + mrTableCell.sethMerge( rAttribs.getBool( XML_hMerge, false ) ); + mrTableCell.setvMerge( rAttribs.getBool( XML_vMerge, false ) ); +} + +TableCellContext::~TableCellContext() +{ +} + +ContextHandlerRef +TableCellContext::onCreateContext( ::sal_Int32 aElementToken, const AttributeList& rAttribs ) +{ + switch( aElementToken ) + { + case A_TOKEN( txBody ): // CT_TextBody + { + oox::drawingml::TextBodyPtr xTextBody = std::make_shared(); + mrTableCell.setTextBody( xTextBody ); + return new oox::drawingml::TextBodyContext( *this, *xTextBody ); + } + + case A_TOKEN( tcPr ): // CT_TableCellProperties + { + mrTableCell.setLeftMargin( rAttribs.getInteger( XML_marL, 91440 ) ); + mrTableCell.setRightMargin( rAttribs.getInteger( XML_marR, 91440 ) ); + mrTableCell.setTopMargin( rAttribs.getInteger( XML_marT, 45720 ) ); + mrTableCell.setBottomMargin( rAttribs.getInteger( XML_marB, 45720 ) ); + mrTableCell.setVertToken( rAttribs.getToken( XML_vert, XML_horz ) ); // ST_TextVerticalType + mrTableCell.setAnchorToken( rAttribs.getToken( XML_anchor, XML_t ) ); // ST_TextAnchoringType + mrTableCell.setAnchorCtr( rAttribs.getBool( XML_anchorCtr, false ) ); + mrTableCell.setHorzOverflowToken( rAttribs.getToken( XML_horzOverflow, XML_clip ) ); // ST_TextHorzOverflowType + } + break; + case A_TOKEN( lnL ): + return new oox::drawingml::LinePropertiesContext( *this, rAttribs, mrTableCell.maLinePropertiesLeft ); + case A_TOKEN( lnR ): + return new oox::drawingml::LinePropertiesContext( *this, rAttribs, mrTableCell.maLinePropertiesRight ); + case A_TOKEN( lnT ): + return new oox::drawingml::LinePropertiesContext( *this, rAttribs, mrTableCell.maLinePropertiesTop ); + case A_TOKEN( lnB ): + return new oox::drawingml::LinePropertiesContext( *this, rAttribs, mrTableCell.maLinePropertiesBottom ); + case A_TOKEN( lnTlToBr ): + return new oox::drawingml::LinePropertiesContext( *this, rAttribs, mrTableCell.maLinePropertiesTopLeftToBottomRight ); + case A_TOKEN( lnBlToTr ): + return new oox::drawingml::LinePropertiesContext( *this, rAttribs, mrTableCell.maLinePropertiesBottomLeftToTopRight ); + case A_TOKEN( cell3D ): // CT_Cell3D + break; + + case A_TOKEN( extLst ): // CT_OfficeArtExtensionList + break; + + default: + return FillPropertiesContext::createFillContext( *this, aElementToken, rAttribs, mrTableCell.maFillProperties ); + + } + + return this; +} + +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/drawingml/table/tablecontext.cxx b/oox/source/drawingml/table/tablecontext.cxx new file mode 100644 index 000000000..84e80dccd --- /dev/null +++ b/oox/source/drawingml/table/tablecontext.cxx @@ -0,0 +1,98 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +using namespace ::oox::core; +using namespace ::com::sun::star; + +namespace oox::drawingml::table { + +TableContext::TableContext( ContextHandler2Helper const & rParent, const ShapePtr& pShapePtr ) +: ShapeContext( rParent, ShapePtr(), pShapePtr ) +, mrTableProperties( *pShapePtr->getTableProperties() ) +{ + pShapePtr->setTableType(); +} + +TableContext::~TableContext() +{ +} + +ContextHandlerRef +TableContext::onCreateContext( ::sal_Int32 aElementToken, const AttributeList& rAttribs ) +{ + switch( aElementToken ) + { + case A_TOKEN( tblPr ): // CT_TableProperties + { + mrTableProperties.setFirstRow( rAttribs.getBool( XML_firstRow, false ) ); + mrTableProperties.setFirstCol( rAttribs.getBool( XML_firstCol, false ) ); + mrTableProperties.setLastRow( rAttribs.getBool( XML_lastRow, false ) ); + mrTableProperties.setLastCol( rAttribs.getBool( XML_lastCol, false ) ); + mrTableProperties.setBandRow( rAttribs.getBool( XML_bandRow, false ) ); + mrTableProperties.setBandCol( rAttribs.getBool( XML_bandCol, false ) ); + } + break; + case A_TOKEN(solidFill): + return new ColorContext(*this, mrTableProperties.getBgColor()); + case A_TOKEN( tableStyle ): // CT_TableStyle + { + std::shared_ptr< TableStyle >& rTableStyle = mrTableProperties.getTableStyle(); + rTableStyle = std::make_shared(); + return new TableStyleContext( *this, rAttribs, *rTableStyle ); + } + case A_TOKEN( effectLst ): // CT_EffectList + { + return new EffectPropertiesContext(*this, mpShapePtr->getEffectProperties()); + } + case A_TOKEN( tableStyleId ): // ST_Guid + return new oox::drawingml::GuidContext( *this, mrTableProperties.getStyleId() ); + + case A_TOKEN( tblGrid ): // CT_TableGrid + break; + case A_TOKEN( gridCol ): // CT_TableCol + { + std::vector< sal_Int32 >& rvTableGrid( mrTableProperties.getTableGrid() ); + rvTableGrid.push_back( rAttribs.getString( XML_w ).get().toInt32() ); + } + break; + case A_TOKEN( tr ): // CT_TableRow + { + std::vector< TableRow >& rvTableRows( mrTableProperties.getTableRows() ); + rvTableRows.emplace_back(); + return new TableRowContext( *this, rAttribs, rvTableRows.back() ); + } + } + + return this; +} + +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/drawingml/table/tablepartstylecontext.cxx b/oox/source/drawingml/table/tablepartstylecontext.cxx new file mode 100644 index 000000000..2d9717322 --- /dev/null +++ b/oox/source/drawingml/table/tablepartstylecontext.cxx @@ -0,0 +1,60 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + + +#include +#include +#include +#include + +using namespace ::oox::core; +using namespace ::com::sun::star; +using namespace ::com::sun::star::uno; +using namespace ::com::sun::star::xml::sax; + +namespace oox::drawingml::table { + +TablePartStyleContext::TablePartStyleContext( ContextHandler2Helper const & rParent, TableStylePart& rTableStylePart ) +: ContextHandler2( rParent ) +, mrTableStylePart( rTableStylePart ) +{ +} + +TablePartStyleContext::~TablePartStyleContext() +{ +} + +// CT_TablePartStyle +ContextHandlerRef +TablePartStyleContext::onCreateContext( ::sal_Int32 aElementToken, const AttributeList& rAttribs ) +{ + switch( aElementToken ) + { + case A_TOKEN( tcTxStyle ): // CT_TableStyleTextStyle + return new TableStyleTextStyleContext( *this, rAttribs, mrTableStylePart ); + case A_TOKEN( tcStyle ): // CT_TableStyleCellStyle + return new TableStyleCellStyleContext( *this, mrTableStylePart ); + } + + return this; +} + +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/drawingml/table/tableproperties.cxx b/oox/source/drawingml/table/tableproperties.cxx new file mode 100644 index 000000000..38f655af1 --- /dev/null +++ b/oox/source/drawingml/table/tableproperties.cxx @@ -0,0 +1,216 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include +#include +#include +#include +#include +#include +#include "predefined-table-styles.cxx" + +using namespace ::oox::core; +using namespace ::com::sun::star; +using namespace ::com::sun::star::uno; +using namespace ::com::sun::star::beans; +using namespace ::com::sun::star::table; + +namespace oox::drawingml::table { + +TableProperties::TableProperties() +: mbFirstRow( false ) +, mbFirstCol( false ) +, mbLastRow( false ) +, mbLastCol( false ) +, mbBandRow( false ) +, mbBandCol( false ) +{ + maBgColor.setUnused(); +} + +static void CreateTableRows( const uno::Reference< XTableRows >& xTableRows, const std::vector< TableRow >& rvTableRows ) +{ + if ( rvTableRows.size() > 1 ) + xTableRows->insertByIndex( 0, rvTableRows.size() - 1 ); + std::vector< TableRow >::const_iterator aTableRowIter( rvTableRows.begin() ); + uno::Reference< container::XIndexAccess > xIndexAccess( xTableRows, UNO_QUERY_THROW ); + sal_Int32 nCols = std::min(xIndexAccess->getCount(), rvTableRows.size()); + for (sal_Int32 n = 0; n < nCols; ++n) + { + Reference< XPropertySet > xPropSet( xIndexAccess->getByIndex( n ), UNO_QUERY_THROW ); + xPropSet->setPropertyValue( "Height", Any( static_cast< sal_Int32 >( aTableRowIter->getHeight() / 360 ) ) ); + ++aTableRowIter; + } +} + +static void CreateTableColumns( const Reference< XTableColumns >& xTableColumns, const std::vector< sal_Int32 >& rvTableGrid ) +{ + if ( rvTableGrid.size() > 1 ) + xTableColumns->insertByIndex( 0, rvTableGrid.size() - 1 ); + std::vector< sal_Int32 >::const_iterator aTableGridIter( rvTableGrid.begin() ); + uno::Reference< container::XIndexAccess > xIndexAccess( xTableColumns, UNO_QUERY_THROW ); + sal_Int32 nCols = std::min(xIndexAccess->getCount(), rvTableGrid.size()); + for (sal_Int32 n = 0; n < nCols; ++n) + { + Reference< XPropertySet > xPropSet( xIndexAccess->getByIndex( n ), UNO_QUERY_THROW ); + xPropSet->setPropertyValue( "Width", Any( static_cast< sal_Int32 >( *aTableGridIter++ / 360 ) ) ); + } +} + +static void MergeCells( const uno::Reference< XTable >& xTable, sal_Int32 nCol, sal_Int32 nRow, sal_Int32 nColSpan, sal_Int32 nRowSpan ) +{ + if( xTable.is() ) try + { + Reference< XMergeableCellRange > xRange( xTable->createCursorByRange( xTable->getCellRangeByPosition( nCol, nRow,nCol + nColSpan - 1, nRow + nRowSpan - 1 ) ), UNO_QUERY_THROW ); + if( xRange->isMergeable() ) + xRange->merge(); + } + catch( Exception& ) + { + } +} + +const TableStyle& TableProperties::getUsedTableStyle( const ::oox::core::XmlFilterBase& rFilterBase, std::unique_ptr& rTableStyleToDelete ) +{ + ::oox::core::XmlFilterBase& rBase( const_cast< ::oox::core::XmlFilterBase& >( rFilterBase ) ); + + TableStyle* pTableStyle = nullptr; + if ( mpTableStyle ) + pTableStyle = &*mpTableStyle; + else if ( !getStyleId().isEmpty() && rBase.getTableStyles() ) + { + const std::vector< TableStyle >& rTableStyles( rBase.getTableStyles()->getTableStyles() ); + const OUString aStyleId( getStyleId() ); + + for (auto const& tableStyle : rTableStyles) + { + if ( const_cast< TableStyle& >(tableStyle).getStyleId() == aStyleId ) + { + pTableStyle = &const_cast< TableStyle& >(tableStyle); + break; // we get the correct style + } + } + //if the pptx just has table style id, but no table style content, we will create the table style ourselves + if (!pTableStyle) + { + rTableStyleToDelete = CreateTableStyle(aStyleId); + pTableStyle = rTableStyleToDelete.get(); + } + } + + if ( !pTableStyle ) + { + static TableStyle theDefaultTableStyle; + return theDefaultTableStyle; + } + + return *pTableStyle; +} + +void TableProperties::pushToPropSet(const ::oox::core::XmlFilterBase& rFilterBase, + const Reference& xPropSet, + const TextListStylePtr& pMasterTextListStyle) +{ + uno::Reference xColumnRowRange(xPropSet->getPropertyValue("Model"), + uno::UNO_QUERY_THROW); + + CreateTableColumns(xColumnRowRange->getColumns(), mvTableGrid); + CreateTableRows(xColumnRowRange->getRows(), mvTableRows); + + std::unique_ptr xTableStyleToDelete; + const TableStyle& rTableStyle(getUsedTableStyle(rFilterBase, xTableStyleToDelete)); + sal_Int32 nRow = 0; + + for (auto& tableRow : mvTableRows) + { + sal_Int32 nColumn = 0; + sal_Int32 nColumnSize = tableRow.getTableCells().size(); + sal_Int32 nRemovedColumn = 0; + sal_Int32 nRemovedRow = 0; + + for (sal_Int32 nColIndex = 0; nColIndex < nColumnSize; nColIndex++) + { + TableCell& rTableCell(tableRow.getTableCells().at(nColIndex)); + + if (!rTableCell.getvMerge() && !rTableCell.gethMerge()) + { + uno::Reference xTable(xColumnRowRange, uno::UNO_QUERY_THROW); + bool bMerged = false; + + if ((rTableCell.getRowSpan() > 1) || (rTableCell.getGridSpan() > 1)) + { + MergeCells(xTable, nColumn, nRow, rTableCell.getGridSpan(), + rTableCell.getRowSpan()); + + if (rTableCell.getGridSpan() > 1) + { + nRemovedColumn = (rTableCell.getGridSpan() - 1); + // MergeCells removes columns. Our loop does not know about those + // removed columns and we skip handling those removed columns. + nColIndex += nRemovedColumn; + // It will adjust new column number after push current column's + // props with pushToXCell. + bMerged = true; + } + + if (rTableCell.getRowSpan() > 1) + nRemovedRow = (rTableCell.getRowSpan() - 1); + } + + Reference xCellRange(xTable, UNO_QUERY_THROW); + Reference xCell; + + if (nRemovedColumn) + { + try + { + xCell = xCellRange->getCellByPosition(nColumn, nRow); + } + // Exception can come from TableModel::getCellByPosition when a column + // is removed while merging columns. So adjust again here. + catch (Exception&) + { + xCell = xCellRange->getCellByPosition(nColumn - nRemovedColumn, nRow); + } + } + else + xCell = xCellRange->getCellByPosition(nColumn, nRow); + + + sal_Int32 nMaxCol = tableRow.getTableCells().size() - nRemovedColumn - 1; + sal_Int32 nMaxRow = mvTableRows.size() - nRemovedRow - 1; + + rTableCell.pushToXCell(rFilterBase, pMasterTextListStyle, xCell, *this, rTableStyle, + nColumn, nMaxCol, nRow, nMaxRow); + + if (bMerged) + nColumn += nRemovedColumn; + + nRemovedRow = 0; + } + ++nColumn; + } + ++nRow; + } + + xTableStyleToDelete.reset(); +} +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/drawingml/table/tablerow.cxx b/oox/source/drawingml/table/tablerow.cxx new file mode 100644 index 000000000..3284c7c84 --- /dev/null +++ b/oox/source/drawingml/table/tablerow.cxx @@ -0,0 +1,35 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include + +using namespace ::oox::core; +using namespace ::com::sun::star; +using namespace ::com::sun::star::uno; +using namespace ::com::sun::star::beans; + +namespace oox::drawingml::table +{ +TableRow::TableRow() + : mnHeight(0) +{ +} +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/drawingml/table/tablerowcontext.cxx b/oox/source/drawingml/table/tablerowcontext.cxx new file mode 100644 index 000000000..aafd13b00 --- /dev/null +++ b/oox/source/drawingml/table/tablerowcontext.cxx @@ -0,0 +1,65 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + + +#include +#include +#include +#include +#include +#include + +using namespace ::oox::core; +using namespace ::com::sun::star; + +namespace oox::drawingml::table { + +TableRowContext::TableRowContext( ContextHandler2Helper const & rParent, const AttributeList& rAttribs, TableRow& rTableRow ) +: ContextHandler2( rParent ) +, mrTableRow( rTableRow ) +{ + rTableRow.setHeight( rAttribs.getString( XML_h ).get().toInt32() ); +} + +TableRowContext::~TableRowContext() +{ +} + +ContextHandlerRef +TableRowContext::onCreateContext( ::sal_Int32 aElementToken, const AttributeList& rAttribs ) +{ + switch( aElementToken ) + { + case A_TOKEN( tc ): // CT_TableCell + { + std::vector< TableCell >& rvTableCells = mrTableRow.getTableCells(); + rvTableCells.emplace_back(); + return new TableCellContext( *this, rAttribs, rvTableCells.back() ); + } + case A_TOKEN( extLst ): // CT_OfficeArtExtensionList + default: + break; + } + + return this; +} + +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/drawingml/table/tablestyle.cxx b/oox/source/drawingml/table/tablestyle.cxx new file mode 100644 index 000000000..e0ae76e9a --- /dev/null +++ b/oox/source/drawingml/table/tablestyle.cxx @@ -0,0 +1,27 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include + +namespace oox::drawingml::table +{ +TableStyle::TableStyle() {} +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/drawingml/table/tablestylecellstylecontext.cxx b/oox/source/drawingml/table/tablestylecellstylecontext.cxx new file mode 100644 index 000000000..a3c86b238 --- /dev/null +++ b/oox/source/drawingml/table/tablestylecellstylecontext.cxx @@ -0,0 +1,110 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + + +#include +#include +#include +#include +#include +#include +#include + +using namespace ::oox::core; +using namespace ::com::sun::star; +using namespace ::com::sun::star::uno; +using namespace ::com::sun::star::xml::sax; + +namespace oox::drawingml::table { + +TableStyleCellStyleContext::TableStyleCellStyleContext( ContextHandler2Helper const & rParent, TableStylePart& rTableStylePart ) +: ContextHandler2( rParent ) +, mrTableStylePart( rTableStylePart ) +, mnLineType( XML_none ) +{ +} + +TableStyleCellStyleContext::~TableStyleCellStyleContext() +{ +} + +// CT_TableStyleCellStyle +ContextHandlerRef +TableStyleCellStyleContext::onCreateContext( ::sal_Int32 aElementToken, const AttributeList& rAttribs ) +{ + switch( aElementToken ) + { + case A_TOKEN( tcBdr ): // CT_TableCellBorderStyle + break; + case A_TOKEN( left ): // CT_ThemeableLineStyle + case A_TOKEN( right ): + case A_TOKEN( top ): + case A_TOKEN( bottom ): + case A_TOKEN( insideH ): + case A_TOKEN( insideV ): + case A_TOKEN( tl2br ): + case A_TOKEN( tr2bl ): + mnLineType = getBaseToken( aElementToken ); + break; + + case A_TOKEN( ln ): + { + if ( mnLineType != XML_none ) + { + std::map < sal_Int32, ::oox::drawingml::LinePropertiesPtr >& rLineBorders = mrTableStylePart.getLineBorders(); + ::oox::drawingml::LinePropertiesPtr pLineProperties = std::make_shared(); + rLineBorders[ mnLineType ] = pLineProperties; + return new LinePropertiesContext( *this, rAttribs, *pLineProperties ); + } + } + break; + case A_TOKEN( lnRef ): + { + if ( mnLineType != XML_none ) + { + ShapeStyleRef& rLineStyleRef = mrTableStylePart.getStyleRefs()[ mnLineType ]; + rLineStyleRef.mnThemedIdx = rAttribs.getInteger( XML_idx, 0 ); + return new ColorContext( *this, rLineStyleRef.maPhClr ); + } + } + break; + + // EG_ThemeableFillStyle (choice) + case A_TOKEN( fill ): // CT_FillProperties + { + FillPropertiesPtr& rxFillProperties = mrTableStylePart.getFillProperties(); + rxFillProperties = std::make_shared(); + return new FillPropertiesContext( *this, *rxFillProperties ); + } + case A_TOKEN( fillRef ): // CT_StyleMatrixReference + { + ShapeStyleRef& rStyleRef = mrTableStylePart.getStyleRefs()[ XML_fillRef ]; + rStyleRef.mnThemedIdx = rAttribs.getInteger( XML_idx, 0 ); + return new ColorContext( *this, rStyleRef.maPhClr ); + } + case A_TOKEN( cell3D ): // CT_Cell3D + break; + } + + return this; +} + +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/drawingml/table/tablestylecontext.cxx b/oox/source/drawingml/table/tablestylecontext.cxx new file mode 100644 index 000000000..7dc4ce468 --- /dev/null +++ b/oox/source/drawingml/table/tablestylecontext.cxx @@ -0,0 +1,89 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + + +#include +#include +#include +#include +#include +#include + +using namespace ::oox::core; +using namespace ::com::sun::star; +using namespace ::com::sun::star::uno; +using namespace ::com::sun::star::xml::sax; + +namespace oox::drawingml::table { + +TableStyleContext::TableStyleContext( ContextHandler2Helper const & rParent, + const AttributeList& rAttribs, TableStyle& rTableStyle ) +: ContextHandler2( rParent ) +, mrTableStyle( rTableStyle ) +{ + mrTableStyle.getStyleId() = rAttribs.getString( XML_styleId ).get(); + mrTableStyle.getStyleName() = rAttribs.getString( XML_styleName ).get(); +} + +TableStyleContext::~TableStyleContext() +{ +} + +ContextHandlerRef +TableStyleContext::onCreateContext( ::sal_Int32 aElementToken, const AttributeList& /* rAttribs */ ) +{ + switch( aElementToken ) + { + case A_TOKEN( tblBg ): // CT_TableBackgroundStyle + return new TableBackgroundStyleContext( *this, mrTableStyle ); + case A_TOKEN( wholeTbl ): // CT_TablePartStyle + return new TablePartStyleContext( *this, mrTableStyle.getWholeTbl() ); + case A_TOKEN( band1H ): // CT_TablePartStyle + return new TablePartStyleContext( *this, mrTableStyle.getBand1H() ); + case A_TOKEN( band2H ): // CT_TablePartStyle + return new TablePartStyleContext( *this, mrTableStyle.getBand2H() ); + case A_TOKEN( band1V ): // CT_TablePartStyle + return new TablePartStyleContext( *this, mrTableStyle.getBand1V() ); + case A_TOKEN( band2V ): // CT_TablePartStyle + return new TablePartStyleContext( *this, mrTableStyle.getBand2V() ); + case A_TOKEN( lastCol ): // CT_TablePartStyle + return new TablePartStyleContext( *this, mrTableStyle.getLastCol() ); + case A_TOKEN( firstCol ): // CT_TablePartStyle + return new TablePartStyleContext( *this, mrTableStyle.getFirstCol() ); + case A_TOKEN( lastRow ): // CT_TablePartStyle + return new TablePartStyleContext( *this, mrTableStyle.getLastRow() ); + case A_TOKEN( seCell ): // CT_TablePartStyle + return new TablePartStyleContext( *this, mrTableStyle.getSeCell() ); + case A_TOKEN( swCell ): // CT_TablePartStyle + return new TablePartStyleContext( *this, mrTableStyle.getSwCell() ); + case A_TOKEN( firstRow ): // CT_TablePartStyle + return new TablePartStyleContext( *this, mrTableStyle.getFirstRow() ); + case A_TOKEN( neCell ): // CT_TablePartStyle + return new TablePartStyleContext( *this, mrTableStyle.getNeCell() ); + case A_TOKEN( nwCell ): // CT_TablePartStyle + return new TablePartStyleContext( *this, mrTableStyle.getNwCell() ); + case A_TOKEN( extLst ): // CT_OfficeArtExtensionList + break; + } + return this; +} + +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/drawingml/table/tablestylelist.cxx b/oox/source/drawingml/table/tablestylelist.cxx new file mode 100644 index 000000000..57a0ba489 --- /dev/null +++ b/oox/source/drawingml/table/tablestylelist.cxx @@ -0,0 +1,30 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include +#include + +namespace oox::drawingml::table +{ +TableStyleList::TableStyleList() {} + +TableStyleList::~TableStyleList() {} +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/drawingml/table/tablestylelistfragmenthandler.cxx b/oox/source/drawingml/table/tablestylelistfragmenthandler.cxx new file mode 100644 index 000000000..77dc42677 --- /dev/null +++ b/oox/source/drawingml/table/tablestylelistfragmenthandler.cxx @@ -0,0 +1,63 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include +#include +#include +#include +#include + +using namespace ::oox::core; +using namespace ::com::sun::star; +using namespace ::oox::drawingml; +using namespace ::com::sun::star::uno; +using namespace ::com::sun::star::xml::sax; + +namespace oox::drawingml::table { + +TableStyleListFragmentHandler::TableStyleListFragmentHandler( XmlFilterBase& rFilter, const OUString& rFragmentPath, TableStyleList& rTableStyleList ): +FragmentHandler2( rFilter, rFragmentPath ), +mrTableStyleList( rTableStyleList ) +{ +} + +TableStyleListFragmentHandler::~TableStyleListFragmentHandler() +{ +} + +// CT_TableStyleList +ContextHandlerRef TableStyleListFragmentHandler::onCreateContext( + sal_Int32 aElementToken, const AttributeList& rAttribs ) +{ + switch( aElementToken ) + { + case A_TOKEN( tblStyleLst ): // CT_TableStyleList + mrTableStyleList.getDefaultStyleId() = rAttribs.getString( XML_def ).get(); + break; + case A_TOKEN( tblStyle ): // CT_TableStyle + std::vector< TableStyle >& rTableStyles = mrTableStyleList.getTableStyles(); + rTableStyles.emplace_back(); + return new TableStyleContext( *this, rAttribs, rTableStyles.back() ); + } + return this; +} + +} // namespace oox::drawingml::table + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/drawingml/table/tablestylepart.cxx b/oox/source/drawingml/table/tablestylepart.cxx new file mode 100644 index 000000000..729604f26 --- /dev/null +++ b/oox/source/drawingml/table/tablestylepart.cxx @@ -0,0 +1,33 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include +#include + +using namespace ::oox::core; +using namespace ::com::sun::star; +using namespace ::com::sun::star::uno; +using namespace ::com::sun::star::beans; + +namespace oox::drawingml::table +{ +TableStylePart::TableStylePart() {} +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/drawingml/table/tablestyletextstylecontext.cxx b/oox/source/drawingml/table/tablestyletextstylecontext.cxx new file mode 100644 index 000000000..d4206439f --- /dev/null +++ b/oox/source/drawingml/table/tablestyletextstylecontext.cxx @@ -0,0 +1,98 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + + +#include +#include +#include +#include +#include + +using namespace ::oox::core; +using namespace ::com::sun::star; +using namespace ::com::sun::star::uno; +using namespace ::com::sun::star::xml::sax; + +namespace oox::drawingml::table { + +TableStyleTextStyleContext::TableStyleTextStyleContext( ContextHandler2Helper const & rParent, + const AttributeList& rAttribs, TableStylePart& rTableStylePart ) +: ContextHandler2( rParent ) +, mrTableStylePart( rTableStylePart ) +{ + if( rAttribs.hasAttribute( XML_b ) ) { + sal_Int32 nB = rAttribs.getToken( XML_b, XML_def ); + if ( nB == XML_on ) + mrTableStylePart.getTextBoldStyle() = true; + else if ( nB == XML_off ) + mrTableStylePart.getTextBoldStyle() = false; + } + + if( rAttribs.hasAttribute( XML_i ) ) { + sal_Int32 nI = rAttribs.getToken( XML_i, XML_def ); + if ( nI == XML_on ) + mrTableStylePart.getTextItalicStyle() = true; + else if ( nI == XML_off ) + mrTableStylePart.getTextItalicStyle() = false; + } +} + +TableStyleTextStyleContext::~TableStyleTextStyleContext() +{ +} + +// CT_TableStyleTextStyle +ContextHandlerRef +TableStyleTextStyleContext::onCreateContext( ::sal_Int32 aElementToken, const AttributeList& rAttribs ) +{ + switch( aElementToken ) + { + // EG_ThemeableFontStyles (choice) + case A_TOKEN( font ): // CT_FontCollection + return this; + case A_TOKEN( ea ): // CT_TextFont + mrTableStylePart.getAsianFont().setAttributes( rAttribs ); + return nullptr; + case A_TOKEN( cs ): // CT_TextFont + mrTableStylePart.getComplexFont().setAttributes( rAttribs ); + return nullptr; + case A_TOKEN( sym ): // CT_TextFont + mrTableStylePart.getSymbolFont().setAttributes( rAttribs ); + return nullptr; + case A_TOKEN( latin ): // CT_TextFont + mrTableStylePart.getLatinFont().setAttributes( rAttribs ); + return nullptr; + + case A_TOKEN( fontRef ): // CT_FontReference + { + ShapeStyleRef& rFontStyle = mrTableStylePart.getStyleRefs()[ XML_fontRef ]; + rFontStyle.mnThemedIdx = rAttribs.getToken( XML_idx, XML_none ); + return new ColorContext( *this, rFontStyle.maPhClr ); + } + + case A_TOKEN( extLst ): // CT_OfficeArtExtensionList + break; + } + + return new ColorValueContext( *this, mrTableStylePart.getTextColor() ); +} + +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/drawingml/textbody.cxx b/oox/source/drawingml/textbody.cxx new file mode 100644 index 000000000..1be15c4f8 --- /dev/null +++ b/oox/source/drawingml/textbody.cxx @@ -0,0 +1,158 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include +#include +#include +#include +#include + +using namespace ::com::sun::star::uno; +using namespace ::com::sun::star::text; +using namespace ::com::sun::star::beans; + +namespace oox::drawingml { + +TextBody::TextBody() + : mbHasNoninheritedBodyProperties( false ) +{ +} + +TextBody::TextBody( const TextBodyPtr& pBody ) + : mbHasNoninheritedBodyProperties( false ) +{ + if( pBody ) { + maTextProperties = pBody->maTextProperties; + maTextListStyle = pBody->maTextListStyle; + } +} + +TextParagraph& TextBody::addParagraph() +{ + auto xPara = std::make_shared(); + maParagraphs.push_back( xPara ); + return *xPara; +} + +void TextBody::insertAt( + const ::oox::core::XmlFilterBase& rFilterBase, + const Reference < XText > & xText, + const Reference < XTextCursor > & xAt, + const TextCharacterProperties& rTextStyleProperties, + const TextListStylePtr& pMasterTextListStylePtr ) const +{ + TextListStyle aMasterTextStyle(*pMasterTextListStylePtr); + + Reference xPropertySet(xAt, UNO_QUERY); + float nCharHeight = xPropertySet->getPropertyValue("CharHeight").get(); + size_t nIndex = 0; + for (auto const& paragraph : maParagraphs) + { + paragraph->insertAt(rFilterBase, xText, xAt, rTextStyleProperties, aMasterTextStyle, + maTextListStyle, (nIndex == 0), nCharHeight, getTextProperties().mnFontScale); + ++nIndex; + } +} + +bool TextBody::isEmpty() const +{ + if (maParagraphs.empty()) + return true; + if ( maParagraphs.size() > 1 ) + return false; + + const TextRunVector& rRuns = maParagraphs[0]->getRuns(); + if ( rRuns.empty() ) + return true; + if ( rRuns.size() > 1 ) + return false; + + return rRuns[0]->getText().isEmpty(); +} + +OUString TextBody::toString() const +{ + if (!isEmpty()) + { + const TextRunVector& rRuns = maParagraphs.front()->getRuns(); + if(!rRuns.empty()) + return rRuns.front()->getText(); + } + return OUString(); +} + +bool TextBody::hasVisualRunProperties() const +{ + for ( auto& pTextParagraph : getParagraphs() ) + { + if ( pTextParagraph->hasVisualRunProperties() ) + return true; + } + return false; +} + +bool TextBody::hasParagraphProperties() const +{ + for ( auto& pTextParagraph : getParagraphs() ) + { + if ( pTextParagraph->hasProperties() ) + return true; + } + return false; +} + +void TextBody::ApplyStyleEmpty( + const ::oox::core::XmlFilterBase& rFilterBase, + const Reference < XText > & xText, + const TextCharacterProperties& rTextStyleProperties, + const TextListStylePtr& pMasterTextListStylePtr) const +{ + assert(isEmpty()); + + if (maParagraphs.empty()) + return; + + // Apply character properties + PropertySet aPropSet(xText); + TextCharacterProperties aTextCharacterProps(maParagraphs[0]->getCharacterStyle( + rTextStyleProperties, *pMasterTextListStylePtr, maTextListStyle)); + aTextCharacterProps.pushToPropSet(aPropSet, rFilterBase); + + // Apply paragraph properties + TextListStyle aCombinedTextStyle; + aCombinedTextStyle.apply(*pMasterTextListStylePtr); + aCombinedTextStyle.apply(maTextListStyle); + + TextParagraphProperties* pTextParagraphStyle = maParagraphs[0]->getParagraphStyle(aCombinedTextStyle); + if (pTextParagraphStyle) + { + Reference< XPropertySet > xProps(xText, UNO_QUERY); + PropertyMap aioBulletList; + aioBulletList.setProperty< sal_Int32 >(PROP_LeftMargin, 0); // Init bullets left margin to 0 (no bullets). + float nCharHeight = xProps->getPropertyValue("CharHeight").get(); + TextParagraphProperties aParaProp; + aParaProp.apply(*pTextParagraphStyle); + aParaProp.pushToPropSet(&rFilterBase, xProps, aioBulletList, &pTextParagraphStyle->getBulletList(), + true, nCharHeight, getTextProperties().mnFontScale, true); + } +} + +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/drawingml/textbodycontext.cxx b/oox/source/drawingml/textbodycontext.cxx new file mode 100644 index 000000000..b1e5241aa --- /dev/null +++ b/oox/source/drawingml/textbodycontext.cxx @@ -0,0 +1,221 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "hyperlinkcontext.hxx" + +#include + +#include + +using namespace ::oox::core; +using namespace ::com::sun::star::uno; +using namespace ::com::sun::star::text; +using namespace ::com::sun::star::xml::sax; + +namespace oox::drawingml { + +namespace { + +// CT_TextParagraph +class TextParagraphContext : public ContextHandler2 +{ +public: + TextParagraphContext( ContextHandler2Helper const & rParent, TextParagraph& rPara ); + + virtual ContextHandlerRef onCreateContext( sal_Int32 aElementToken, const AttributeList& rAttribs ) override; + +protected: + TextParagraph& mrParagraph; +}; + +} + +TextParagraphContext::TextParagraphContext( ContextHandler2Helper const & rParent, TextParagraph& rPara ) +: ContextHandler2( rParent ) +, mrParagraph( rPara ) +{ + mbEnableTrimSpace = false; +} + +ContextHandlerRef TextParagraphContext::onCreateContext( sal_Int32 aElementToken, const AttributeList& rAttribs ) +{ + // EG_TextRun + switch( aElementToken ) + { + case A_TOKEN( r ): // "CT_RegularTextRun" Regular Text Run. + case W_TOKEN( r ): + { + TextRunPtr pRun = std::make_shared(); + mrParagraph.addRun( pRun ); + return new RegularTextRunContext( *this, pRun ); + } + case A_TOKEN( br ): // "CT_TextLineBreak" Soft return line break (vertical tab). + { + TextRunPtr pRun = std::make_shared(); + pRun->setLineBreak(); + mrParagraph.addRun( pRun ); + return new RegularTextRunContext( *this, pRun ); + } + case A_TOKEN( fld ): // "CT_TextField" Text Field. + { + auto pField = std::make_shared(); + mrParagraph.addRun( pField ); + return new TextFieldContext( *this, rAttribs, *pField ); + } + case A_TOKEN( pPr ): + case W_TOKEN( pPr ): + mrParagraph.setHasProperties(); + return new TextParagraphPropertiesContext( *this, rAttribs, mrParagraph.getProperties() ); + case A_TOKEN( endParaRPr ): + return new TextCharacterPropertiesContext( *this, rAttribs, mrParagraph.getEndProperties() ); + case W_TOKEN( sdt ): + case W_TOKEN( sdtContent ): + return this; + case W_TOKEN( del ): + break; + case W_TOKEN( ins ): + return this; + case OOX_TOKEN(a14, m): + return CreateLazyMathBufferingContext(*this, mrParagraph); + case W_TOKEN( hyperlink ): + { + TextRunPtr pRun = std::make_shared(); + mrParagraph.addRun(pRun); + // parse hyperlink attributes: use HyperLinkContext for that + rtl::Reference pContext(new HyperLinkContext( + *this, rAttribs, pRun->getTextCharacterProperties().maHyperlinkPropertyMap)); + // but create text run context because HyperLinkContext can't process internal w:r, w:t, etc + return new RegularTextRunContext(*this, pRun); + } + default: + SAL_WARN("oox", "TextParagraphContext::onCreateContext: unhandled element: " << getBaseToken(aElementToken)); + } + + return nullptr; +} + +RegularTextRunContext::RegularTextRunContext( ContextHandler2Helper const & rParent, TextRunPtr const & pRunPtr ) +: ContextHandler2( rParent ) +, mpRunPtr( pRunPtr ) +, mbIsInText( false ) +{ +} + +void RegularTextRunContext::onEndElement( ) +{ + switch( getCurrentElement() ) + { + case A_TOKEN( t ): + case W_TOKEN( t ): + { + mbIsInText = false; + break; + } + case A_TOKEN( r ): + break; + } +} + +void RegularTextRunContext::onCharacters( const OUString& aChars ) +{ + if( mbIsInText ) + { + mpRunPtr->getText() += aChars; + } +} + +ContextHandlerRef RegularTextRunContext::onCreateContext( sal_Int32 aElementToken, const AttributeList& rAttribs) +{ + switch( aElementToken ) + { + case A_TOKEN( rPr ): // "CT_TextCharPropertyBag" The text char properties of this text run. + case W_TOKEN( rPr ): + return new TextCharacterPropertiesContext( *this, rAttribs, mpRunPtr->getTextCharacterProperties() ); + case A_TOKEN( t ): // "xsd:string" minOccurs="1" The actual text string. + case W_TOKEN( t ): + mbIsInText = true; + break; + case W_TOKEN( drawing ): + break; + default: + SAL_WARN("oox", "RegularTextRunContext::onCreateContext: unhandled element: " << getBaseToken(aElementToken)); + break; + } + + return this; +} + +TextBodyContext::TextBodyContext( ContextHandler2Helper const & rParent, TextBody& rTextBody ) +: ContextHandler2( rParent ) +, mrTextBody( rTextBody ) +{ +} + +TextBodyContext::TextBodyContext(ContextHandler2Helper const& rParent, const ShapePtr& pShapePtr) + : TextBodyContext(rParent, *pShapePtr->getTextBody()) +{ + mpShapePtr = pShapePtr; +} + +ContextHandlerRef TextBodyContext::onCreateContext( sal_Int32 aElementToken, const AttributeList& rAttribs ) +{ + switch( aElementToken ) + { + case A_TOKEN( bodyPr ): // CT_TextBodyPropertyBag + if (sax_fastparser::castToFastAttributeList(rAttribs.getFastAttributeList()).getFastAttributeTokens().size() > 0) + mrTextBody.setHasNoninheritedBodyProperties(); + if ( mpShapePtr ) + return new TextBodyPropertiesContext( *this, rAttribs, mpShapePtr ); + else + return new TextBodyPropertiesContext( *this, rAttribs, mrTextBody.getTextProperties() ); + case A_TOKEN( lstStyle ): // CT_TextListStyle + return new TextListStyleContext( *this, mrTextBody.getTextListStyle() ); + case A_TOKEN( p ): // CT_TextParagraph + case W_TOKEN( p ): + return new TextParagraphContext( *this, mrTextBody.addParagraph() ); + case W_TOKEN( sdt ): + case W_TOKEN( sdtContent ): + return this; + case W_TOKEN( sdtPr ): + case W_TOKEN( sdtEndPr ): + break; + case W_TOKEN( tbl ): + break; + default: + SAL_WARN("oox", "TextBodyContext::onCreateContext: unhandled element: " << getBaseToken(aElementToken)); + } + + return nullptr; +} + +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/drawingml/textbodyproperties.cxx b/oox/source/drawingml/textbodyproperties.cxx new file mode 100644 index 000000000..e44a103e3 --- /dev/null +++ b/oox/source/drawingml/textbodyproperties.cxx @@ -0,0 +1,190 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +using namespace ::com::sun::star::drawing; +using namespace ::com::sun::star::text; +using namespace css; + +namespace oox::drawingml { + +TextBodyProperties::TextBodyProperties() + : mbAnchorCtr(false) + , meVA( TextVerticalAdjust_TOP ) +{ +} + +/* For Legacy purposes: TODO: Check if it is required at all! */ +void TextBodyProperties::pushVertSimulation() +{ + sal_Int32 tVert = moVert.get( XML_horz ); + if( !(tVert == XML_vert || tVert == XML_eaVert || tVert == XML_vert270 || tVert == XML_mongolianVert) ) + return; + + // #160799# fake different vertical text modes by top-bottom writing mode + maPropertyMap.setProperty( PROP_TextWritingMode, WritingMode_TB_RL); + + // workaround for TB_LR as using WritingMode2 doesn't work + if( meVA != TextVerticalAdjust_CENTER ) + maPropertyMap.setProperty( PROP_TextHorizontalAdjust, + (tVert == XML_vert270) ? TextHorizontalAdjust_RIGHT : TextHorizontalAdjust_LEFT); + if( tVert == XML_vert270 ) + maPropertyMap.setProperty( PROP_TextVerticalAdjust, TextVerticalAdjust_BOTTOM); + if( ( tVert == XML_vert && meVA == TextVerticalAdjust_TOP ) || + ( tVert == XML_vert270 && meVA == TextVerticalAdjust_BOTTOM ) ) + maPropertyMap.setProperty( PROP_TextHorizontalAdjust, TextHorizontalAdjust_RIGHT); + else if( meVA == TextVerticalAdjust_CENTER ) + maPropertyMap.setProperty( PROP_TextHorizontalAdjust, TextHorizontalAdjust_CENTER); +} + +/* Push text distances / insets, taking into consideration Shape Rotation */ +void TextBodyProperties::pushTextDistances(Size const& rTextAreaSize) +{ + for (auto & rValue : maTextDistanceValues) + rValue.reset(); + + sal_Int32 nOff = 0; + static constexpr const std::array aProps { + PROP_TextLeftDistance, + PROP_TextUpperDistance, + PROP_TextRightDistance, + PROP_TextLowerDistance + }; + + switch (moRotation.get(0)) + { + case 90*1*60000: nOff = 3; break; + case 90*2*60000: nOff = 2; break; + case 90*3*60000: nOff = 1; break; + default: break; + } + + for (size_t i = 0; i < aProps.size(); i++) + { + sal_Int32 nVal = 0; + + // Hack for n#760986 + // TODO: Preferred method would be to have a textbox on top + // of the shape and the place it according to the (off,ext) + if (nOff == 0 && moTextOffLeft) + nVal = *moTextOffLeft; + + if (nOff == 1 && moTextOffUpper) + nVal = *moTextOffUpper; + + + if (nOff == 2 && moTextOffRight) + nVal = *moTextOffRight; + + if (nOff == 3 && moTextOffLower) + nVal = *moTextOffLower; + + + if( nVal < 0 ) + nVal = 0; + + sal_Int32 nTextOffsetValue = nVal; + + if (moInsets[i]) + { + nTextOffsetValue = *moInsets[i] + nVal; + } + + // if inset is set, then always set the value + // this prevents the default to be set (0 is a valid value) + if (moInsets[i] || nTextOffsetValue) + { + maTextDistanceValues[nOff] = nTextOffsetValue; + } + + nOff = (nOff + 1) % aProps.size(); + } + + // Check if bottom and top are set + if (maTextDistanceValues[1] && maTextDistanceValues[3]) + { + double nHeight = rTextAreaSize.getHeight(); + + double nTop = *maTextDistanceValues[1]; + double nBottom = *maTextDistanceValues[3]; + + // Check if top + bottom is more than text area height. + // If yes, we need to adjust the values as defined in OOXML. + if (nTop + nBottom >= nHeight) + { + double diffFactor = (nTop + nBottom - nHeight) / 2.0; + + maTextDistanceValues[1] = nTop - diffFactor; + maTextDistanceValues[3] = nBottom - diffFactor; + } + } + + for (size_t i = 0; i < aProps.size(); i++) + { + if (maTextDistanceValues[i]) + maPropertyMap.setProperty(aProps[i], *maTextDistanceValues[i]); + } +} + +/* Readjust the text distances / insets if necessary to take + the text area into account, not just the shape area*/ +void TextBodyProperties::readjustTextDistances(uno::Reference const& xShape) +{ + // Only for custom shapes (for now) + auto* pCustomShape = dynamic_cast(SdrObject::getSdrObjectFromXShape(xShape)); + if (pCustomShape) + { + sal_Int32 nLower = pCustomShape->GetTextLowerDistance(); + sal_Int32 nUpper = pCustomShape->GetTextUpperDistance(); + + pCustomShape->SetMergedItem(makeSdrTextUpperDistItem(0)); + pCustomShape->SetMergedItem(makeSdrTextLowerDistItem(0)); + + tools::Rectangle aAnchorRect; + pCustomShape->TakeTextAnchorRect(aAnchorRect); + Size aAnchorSize = aAnchorRect.GetSize(); + + pushTextDistances(aAnchorSize); + if (maTextDistanceValues[1] && maTextDistanceValues[3]) + { + nLower = *maTextDistanceValues[3]; + nUpper = *maTextDistanceValues[1]; + } + + pCustomShape->SetMergedItem(makeSdrTextLowerDistItem(nLower)); + pCustomShape->SetMergedItem(makeSdrTextUpperDistItem(nUpper)); + } +} + + +} // namespace oox::drawingml + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/drawingml/textbodypropertiescontext.cxx b/oox/source/drawingml/textbodypropertiescontext.cxx new file mode 100644 index 000000000..f7d4abd4e --- /dev/null +++ b/oox/source/drawingml/textbodypropertiescontext.cxx @@ -0,0 +1,220 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +using namespace ::oox::core; +using namespace ::com::sun::star; +using namespace ::com::sun::star::drawing; +using namespace ::com::sun::star::text; +using namespace ::com::sun::star::uno; +using namespace ::com::sun::star::xml::sax; + +namespace oox::drawingml { + +// CT_TextBodyProperties +TextBodyPropertiesContext::TextBodyPropertiesContext(ContextHandler2Helper const& rParent, + const AttributeList& rAttribs, + const ShapePtr& pShapePtr) + : TextBodyPropertiesContext(rParent, rAttribs, pShapePtr->getTextBody()->getTextProperties()) +{ + mpShapePtr = pShapePtr; +} + +TextBodyPropertiesContext::TextBodyPropertiesContext( ContextHandler2Helper const & rParent, + const AttributeList& rAttribs, TextBodyProperties& rTextBodyProp ) +: ContextHandler2( rParent ) +, mrTextBodyProp( rTextBodyProp ) +{ + // ST_TextWrappingType + sal_Int32 nWrappingType = rAttribs.getToken( XML_wrap, XML_square ); + mrTextBodyProp.maPropertyMap.setProperty( PROP_TextWordWrap, nWrappingType == XML_square ); + + // ST_Coordinate + OUString sValue; + sal_Int32 aIns[] = { XML_lIns, XML_tIns, XML_rIns, XML_bIns }; + for( sal_Int32 i = 0; i < sal_Int32(SAL_N_ELEMENTS( aIns )); i++) + { + sValue = rAttribs.getString( aIns[i] ).get(); + if( !sValue.isEmpty() ) + mrTextBodyProp.moInsets[i] = GetCoordinate( sValue ); + } + + mrTextBodyProp.mbAnchorCtr = rAttribs.getBool( XML_anchorCtr, false ); + if( mrTextBodyProp.mbAnchorCtr ) + mrTextBodyProp.maPropertyMap.setProperty( PROP_TextHorizontalAdjust, TextHorizontalAdjust_CENTER ); + +// bool bCompatLineSpacing = rAttribs.getBool( XML_compatLnSpc, false ); +// bool bForceAA = rAttribs.getBool( XML_forceAA, false ); + bool bFromWordArt = rAttribs.getBool(XML_fromWordArt, false); + mrTextBodyProp.maPropertyMap.setProperty(PROP_FromWordArt, bFromWordArt); + + // ST_TextHorzOverflowType + mrTextBodyProp.msHorzOverflow = rAttribs.getString(XML_horzOverflow, ""); + // ST_TextVertOverflowType + mrTextBodyProp.msVertOverflow = rAttribs.getString(XML_vertOverflow, ""); + + // ST_TextColumnCount + if (const sal_Int32 nColumns = rAttribs.getInteger(XML_numCol, 0); nColumns > 0) + { + css::uno::Reference xCols(SvxXTextColumns_createInstance(), + css::uno::UNO_QUERY_THROW); + xCols->setColumnCount(nColumns); + css::uno::Reference xProps(xCols, css::uno::UNO_QUERY_THROW); + // ST_PositiveCoordinate32 + const sal_Int32 nSpacing = o3tl::convert(rAttribs.getInteger(XML_spcCol, 0), + o3tl::Length::emu, o3tl::Length::mm100); + xProps->setPropertyValue("AutomaticDistance", css::uno::Any(nSpacing)); + mrTextBodyProp.maPropertyMap.setAnyProperty(PROP_TextColumns, css::uno::Any(xCols)); + } + + // ST_Angle + mrTextBodyProp.moRotation = rAttribs.getInteger( XML_rot ); + +// bool bRtlCol = rAttribs.getBool( XML_rtlCol, false ); + // ST_PositiveCoordinate +// sal_Int32 nSpcCol = rAttribs.getInteger( XML_spcCol, 0 ); +// bool bSpcFirstLastPara = rAttribs.getBool( XML_spcFirstLastPara, 0 ); + + bool bUpright = rAttribs.getBool(XML_upright, false); + if (bUpright) + mrTextBodyProp.moUpright = true; + + // ST_TextVerticalType + if( rAttribs.hasAttribute( XML_vert ) ) { + mrTextBodyProp.moVert = rAttribs.getToken( XML_vert ); + sal_Int32 tVert = mrTextBodyProp.moVert.get( XML_horz ); + if (tVert == XML_vert || tVert == XML_eaVert || tVert == XML_mongolianVert) + mrTextBodyProp.moRotation = 5400000; + else if (tVert == XML_vert270) + mrTextBodyProp.moRotation = 5400000 * 3; + else { + bool bRtl = rAttribs.getBool( XML_rtl, false ); + mrTextBodyProp.maPropertyMap.setProperty( PROP_TextWritingMode, + ( bRtl ? WritingMode_RL_TB : WritingMode_LR_TB )); + } + } + + // ST_TextAnchoringType + if( rAttribs.hasAttribute( XML_anchor ) ) + { + mrTextBodyProp.meVA = GetTextVerticalAdjust( rAttribs.getToken( XML_anchor, XML_t ) ); + mrTextBodyProp.maPropertyMap.setProperty( PROP_TextVerticalAdjust, mrTextBodyProp.meVA); + } + + // Push defaults + mrTextBodyProp.maPropertyMap.setProperty( PROP_TextAutoGrowHeight, false); + mrTextBodyProp.maPropertyMap.setProperty( PROP_TextFitToSize, drawing::TextFitToSizeType_NONE); +} + +ContextHandlerRef TextBodyPropertiesContext::onCreateContext( sal_Int32 aElementToken, const AttributeList& rAttribs ) +{ + switch( aElementToken ) + { + // Sequence + case A_TOKEN( prstTxWarp ): // CT_PresetTextShape + if( mpShapePtr ) + { + const OptValue sPrst = rAttribs.getString( XML_prst ); + if( sPrst.has() ) + { + mrTextBodyProp.msPrst = sPrst.get(); + if( mrTextBodyProp.msPrst != "textNoShape" ) + return new PresetTextShapeContext( *this, rAttribs, + *( mpShapePtr->getCustomShapeProperties() ) ); + } + } + break; + + case A_TOKEN( prot ): // CT_TextProtectionProperty + break; + + // EG_TextAutofit + case A_TOKEN( noAutofit ): + mrTextBodyProp.maPropertyMap.setProperty( PROP_TextAutoGrowHeight, false); // CT_TextNoAutofit + break; + case A_TOKEN( normAutofit ): // CT_TextNormalAutofit + { + mrTextBodyProp.maPropertyMap.setProperty( PROP_TextFitToSize, TextFitToSizeType_AUTOFIT); + mrTextBodyProp.maPropertyMap.setProperty( PROP_TextAutoGrowHeight, false); + mrTextBodyProp.mnFontScale = rAttribs.getInteger(XML_fontScale, 100000); + break; + } + case A_TOKEN( spAutoFit ): + { + const sal_Int32 tVert = mrTextBodyProp.moVert.get( XML_horz ); + if( tVert != XML_vert && tVert != XML_eaVert && tVert != XML_vert270 && tVert != XML_mongolianVert ) + mrTextBodyProp.maPropertyMap.setProperty( PROP_TextAutoGrowHeight, true); + } + break; + + case A_TOKEN( scene3d ): // CT_Scene3D + { + if(mpShapePtr && mpShapePtr->getServiceName() == "com.sun.star.drawing.CustomShape") + return new SceneText3DPropertiesContext( *this, mpShapePtr->getTextBody()->get3DProperties() ); + + break; + } + + // EG_Text3D + case A_TOKEN( sp3d ): // CT_Shape3D + { + if (mpShapePtr && mpShapePtr->getServiceName() == "com.sun.star.drawing.CustomShape") + { + if (rAttribs.hasAttribute(XML_extrusionH)) + mpShapePtr->getTextBody()->get3DProperties().mnExtrusionH = rAttribs.getInteger(XML_extrusionH, 0); + if (rAttribs.hasAttribute(XML_contourW)) + mpShapePtr->getTextBody()->get3DProperties().mnContourW = rAttribs.getInteger(XML_contourW, 0); + if (rAttribs.hasAttribute(XML_z)) + mpShapePtr->getTextBody()->get3DProperties().mnShapeZ = rAttribs.getInteger(XML_z, 0); + if (rAttribs.hasAttribute(XML_prstMaterial)) + mpShapePtr->getTextBody()->get3DProperties().mnMaterial = rAttribs.getToken(XML_prstMaterial, XML_none); + return new SceneText3DPropertiesContext(*this, mpShapePtr->getTextBody()->get3DProperties()); + } + break; + } + + case A_TOKEN( flatTx ): // CT_FlatText + + break; + } + + return nullptr; +} + +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/drawingml/textcharacterproperties.cxx b/oox/source/drawingml/textcharacterproperties.cxx new file mode 100644 index 000000000..e7bc36763 --- /dev/null +++ b/oox/source/drawingml/textcharacterproperties.cxx @@ -0,0 +1,248 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +using ::oox::core::XmlFilterBase; +using namespace ::com::sun::star; +using namespace ::com::sun::star::uno; +using namespace ::com::sun::star::beans; + +namespace oox::drawingml { + +void TextCharacterProperties::assignUsed( const TextCharacterProperties& rSourceProps ) +{ + // overwrite all properties existing in rSourceProps + maHyperlinkPropertyMap.assignUsed( rSourceProps.maHyperlinkPropertyMap ); + maLatinFont.assignIfUsed( rSourceProps.maLatinFont ); + maLatinThemeFont.assignIfUsed( rSourceProps.maLatinThemeFont ); + maAsianFont.assignIfUsed( rSourceProps.maAsianFont ); + maAsianThemeFont.assignIfUsed( rSourceProps.maAsianThemeFont ); + maComplexFont.assignIfUsed( rSourceProps.maComplexFont ); + maComplexThemeFont.assignIfUsed( rSourceProps.maComplexThemeFont ); + maSymbolFont.assignIfUsed( rSourceProps.maSymbolFont ); + maHighlightColor.assignIfUsed( rSourceProps.maHighlightColor ); + maUnderlineColor.assignIfUsed( rSourceProps.maUnderlineColor ); + moLang.assignIfUsed( rSourceProps.moLang ); + moHeight.assignIfUsed( rSourceProps.moHeight ); + moFontScale.assignIfUsed(rSourceProps.moFontScale); + moSpacing.assignIfUsed( rSourceProps.moSpacing ); + moUnderline.assignIfUsed( rSourceProps.moUnderline ); + moBaseline.assignIfUsed( rSourceProps.moBaseline ); + moStrikeout.assignIfUsed( rSourceProps.moStrikeout ); + moCaseMap.assignIfUsed( rSourceProps.moCaseMap ); + moBold.assignIfUsed( rSourceProps.moBold ); + moItalic.assignIfUsed( rSourceProps.moItalic ); + moUnderlineLineFollowText.assignIfUsed( rSourceProps.moUnderlineLineFollowText ); + moUnderlineFillFollowText.assignIfUsed( rSourceProps.moUnderlineFillFollowText ); + moTextOutlineProperties.assignIfUsed(rSourceProps.moTextOutlineProperties); + + maTextEffectsProperties = rSourceProps.maTextEffectsProperties; + maFillProperties.assignUsed( rSourceProps.maFillProperties ); +} + +void TextCharacterProperties::pushToPropMap( PropertyMap& rPropMap, const XmlFilterBase& rFilter ) const +{ + OUString aFontName; + sal_Int16 nFontPitch = 0; + sal_Int16 nFontFamily = 0; + + bool bRet = maLatinFont.getFontData( aFontName, nFontPitch, nFontFamily, rFilter ); + if (!bRet) + // In case there is no direct font, try to look it up as a theme reference. + bRet = maLatinThemeFont.getFontData( aFontName, nFontPitch, nFontFamily, rFilter ); + if (bRet) + { + rPropMap.setProperty( PROP_CharFontName, aFontName); + rPropMap.setProperty( PROP_CharFontPitch, nFontPitch); + rPropMap.setProperty( PROP_CharFontFamily, nFontFamily); + } + + bRet = maAsianFont.getFontData( aFontName, nFontPitch, nFontFamily, rFilter ); + if (!bRet) + bRet = maAsianThemeFont.getFontData( aFontName, nFontPitch, nFontFamily, rFilter ); + if (bRet) + { + rPropMap.setProperty( PROP_CharFontNameAsian, aFontName); + rPropMap.setProperty( PROP_CharFontPitchAsian, nFontFamily); + rPropMap.setProperty( PROP_CharFontFamilyAsian, nFontPitch); + } + + bRet = maComplexFont.getFontData( aFontName, nFontPitch, nFontFamily, rFilter ); + if (!bRet) + bRet = maComplexThemeFont.getFontData( aFontName, nFontPitch, nFontFamily, rFilter ); + if (bRet) + { + rPropMap.setProperty( PROP_CharFontNameComplex, aFontName); + rPropMap.setProperty( PROP_CharFontPitchComplex, nFontPitch); + rPropMap.setProperty( PROP_CharFontFamilyComplex, nFontFamily); + } + + if ( maFillProperties.moFillType.has() ) + { + Color aColor = maFillProperties.getBestSolidColor(); + bool bContoured = false; + + // noFill doesn't exist for characters. Map noFill to 99% transparency + if (maFillProperties.moFillType.get() == XML_noFill) + aColor.addTransformation(XML_alpha, 1000); + + // tdf#137438 Emulate text outline color/transparency. + // If the outline color dominates, then use it as the text color. + if (moTextOutlineProperties.has() + && moTextOutlineProperties.get().maLineFill.moFillType.has() + && moTextOutlineProperties.get().maLineFill.moFillType.get() != XML_noFill) + { + Color aLineColor = moTextOutlineProperties.get().maLineFill.getBestSolidColor(); + sal_Int16 nLineTransparency = aLineColor.getTransparency(); + + // tdf#127696 If the text color is white (and the outline color doesn't dominate), + // then this is contoured text in LO. + if (nLineTransparency < aColor.getTransparency() + || (bContoured = aColor.getColor(rFilter.getGraphicHelper()) == COL_WHITE)) + aColor = aLineColor; + } + rPropMap.setProperty(PROP_CharColor, aColor.getColor(rFilter.getGraphicHelper())); + // set color theme index + rPropMap.setProperty(PROP_CharColorTheme, aColor.getSchemeColorIndex()); + rPropMap.setProperty(PROP_CharColorTintOrShade, aColor.getTintOrShade()); + rPropMap.setProperty(PROP_CharColorLumMod, aColor.getLumMod()); + rPropMap.setProperty(PROP_CharColorLumOff, aColor.getLumOff()); + rPropMap.setProperty(PROP_CharContoured, bContoured); + + if (aColor.hasTransparency()) + { + const auto nTransparency = aColor.getTransparency(); + rPropMap.setProperty(PROP_CharTransparence, nTransparency); + + // WORKAROUND: Fully transparent white has the same value as COL_AUTO, avoid collision + if (nTransparency == 100 + && aColor.getColor(rFilter.getGraphicHelper()).GetRGBColor() == COL_AUTO.GetRGBColor()) + rPropMap.setProperty(PROP_CharColor, ::Color(ColorTransparency, 0xFFFFFFFE)); + } + } + + if( moLang.has() && !moLang.get().isEmpty() ) + { + LanguageTag aTag(moLang.get()); + lang::Locale aLocale(aTag.getLocale()); + switch(MsLangId::getScriptType(aTag.getLanguageType())) + { + case css::i18n::ScriptType::LATIN: + rPropMap.setProperty( PROP_CharLocale, aLocale);break; + case css::i18n::ScriptType::ASIAN: + rPropMap.setProperty( PROP_CharLocaleAsian, aLocale);break; + case css::i18n::ScriptType::COMPLEX: + rPropMap.setProperty( PROP_CharLocaleComplex, aLocale);break; + } + } + + if( moHeight.has() ) + { + float fHeight = GetFontHeight( moHeight.get() ); + if (moFontScale.has()) + fHeight *= (moFontScale.get() / 100000); + rPropMap.setProperty( PROP_CharHeight, fHeight); + rPropMap.setProperty( PROP_CharHeightAsian, fHeight); + rPropMap.setProperty( PROP_CharHeightComplex, fHeight); + } + + rPropMap.setProperty( PROP_CharKerning, static_cast(GetTextSpacingPoint( moSpacing.get( 0 ) ))); + + rPropMap.setProperty( PROP_CharUnderline, GetFontUnderline( moUnderline.get( XML_none ) )); + rPropMap.setProperty( PROP_CharStrikeout, GetFontStrikeout( moStrikeout.get( XML_noStrike ) )); + rPropMap.setProperty( PROP_CharCaseMap, GetCaseMap( moCaseMap.get( XML_none ) )); + + if( moBaseline.has() ) { + rPropMap.setProperty( PROP_CharEscapement, sal_Int16(moBaseline.get( 0 ) / 1000)); + rPropMap.setProperty( PROP_CharEscapementHeight, sal_Int8(DFLT_ESC_PROP)); + } else { + rPropMap.setProperty( PROP_CharEscapement, sal_Int16(0)); + rPropMap.setProperty( PROP_CharEscapementHeight, sal_Int8(100)); // 100% + } + + float fWeight = moBold.get( false ) ? awt::FontWeight::BOLD : awt::FontWeight::NORMAL; + rPropMap.setProperty( PROP_CharWeight, fWeight); + rPropMap.setProperty( PROP_CharWeightAsian, fWeight); + rPropMap.setProperty( PROP_CharWeightComplex, fWeight); + + awt::FontSlant eSlant = moItalic.get( false ) ? awt::FontSlant_ITALIC : awt::FontSlant_NONE; + rPropMap.setProperty( PROP_CharPosture, eSlant); + rPropMap.setProperty( PROP_CharPostureAsian, eSlant); + rPropMap.setProperty( PROP_CharPostureComplex, eSlant); + + bool bUnderlineFillFollowText = moUnderlineFillFollowText.get( false ); + if( moUnderline.has() && maUnderlineColor.isUsed() && !bUnderlineFillFollowText ) + { + rPropMap.setProperty( PROP_CharUnderlineHasColor, true); + rPropMap.setProperty( PROP_CharUnderlineColor, maUnderlineColor.getColor( rFilter.getGraphicHelper() )); + } + else + { + rPropMap.setProperty( PROP_CharUnderlineHasColor, false); + rPropMap.setProperty( PROP_CharUnderlineColor, sal_Int32(-1)); + } + + if (maHighlightColor.isUsed() && maHighlightColor.getTransparency() != 100) + rPropMap.setProperty( PROP_CharBackColor, maHighlightColor.getColor( rFilter.getGraphicHelper() )); + else + rPropMap.setProperty( PROP_CharBackColor, sal_Int32(-1)); +} + +static void pushToGrabBag( PropertySet& rPropSet, const std::vector& aVectorOfPropertyValues ) +{ + if (!rPropSet.hasProperty(PROP_CharInteropGrabBag) || aVectorOfPropertyValues.empty()) + return; + Sequence aGrabBag; + Any aAnyGrabBag = rPropSet.getAnyProperty(PROP_CharInteropGrabBag); + aAnyGrabBag >>= aGrabBag; + + rPropSet.setAnyProperty(PROP_CharInteropGrabBag, Any(comphelper::concatSequences(aGrabBag, aVectorOfPropertyValues))); +} + +void TextCharacterProperties::pushToPropSet( PropertySet& rPropSet, const XmlFilterBase& rFilter ) const +{ + PropertyMap aPropMap; + pushToPropMap( aPropMap, rFilter ); + rPropSet.setProperties( aPropMap ); + pushToGrabBag(rPropSet, maTextEffectsProperties); +} + +float TextCharacterProperties::getCharHeightPoints( float fDefault ) const +{ + return moHeight.has() ? GetFontHeight( moHeight.get() ) : fDefault; +} + +} // namespace oox::drawingml + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/drawingml/textcharacterpropertiescontext.cxx b/oox/source/drawingml/textcharacterpropertiescontext.cxx new file mode 100644 index 000000000..5ec22d45e --- /dev/null +++ b/oox/source/drawingml/textcharacterpropertiescontext.cxx @@ -0,0 +1,334 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include + +#include +#include +#include +#include +#include +#include +#include "hyperlinkcontext.hxx" +#include +#include +#include + +#include + +using namespace ::oox::core; +using namespace ::com::sun::star::uno; +using namespace ::com::sun::star::xml::sax; +using namespace ::com::sun::star::awt; + +namespace oox::drawingml { + +// CT_TextCharacterProperties +TextCharacterPropertiesContext::TextCharacterPropertiesContext( + ContextHandler2Helper const & rParent, + const AttributeList& rAttribs, + TextCharacterProperties& rTextCharacterProperties ) +: ContextHandler2( rParent ) +, mrTextCharacterProperties( rTextCharacterProperties ) +{ + int nVisualTokenAmount = sax_fastparser::castToFastAttributeList( + rAttribs.getFastAttributeList() ).getFastAttributeTokens().size(); + + if ( rAttribs.hasAttribute( XML_lang ) ) + { + mrTextCharacterProperties.moLang = rAttribs.getString( XML_lang ); + --nVisualTokenAmount; // Not a visual attribute + } + if ( rAttribs.hasAttribute( XML_altLang )) + { + --nVisualTokenAmount; // Not a visual attribute + } + if ( rAttribs.hasAttribute( XML_sz ) ) + mrTextCharacterProperties.moHeight = rAttribs.getInteger( XML_sz ); + if ( rAttribs.hasAttribute( XML_spc ) ) + mrTextCharacterProperties.moSpacing = rAttribs.getInteger( XML_spc ); + if ( rAttribs.hasAttribute( XML_u ) ) + mrTextCharacterProperties.moUnderline = rAttribs.getToken( XML_u ); + if ( rAttribs.hasAttribute( XML_strike ) ) + mrTextCharacterProperties.moStrikeout = rAttribs.getToken( XML_strike ); + if ( rAttribs.hasAttribute( XML_baseline ) && rAttribs.getInteger( XML_baseline ).get() != 0 ) + mrTextCharacterProperties.moBaseline = rAttribs.getInteger( XML_baseline ); + + if ( rAttribs.hasAttribute( XML_b ) ) + mrTextCharacterProperties.moBold = rAttribs.getBool( XML_b ); + if ( rAttribs.hasAttribute( XML_i ) ) + mrTextCharacterProperties.moItalic = rAttribs.getBool( XML_i ); + if( rAttribs.hasAttribute( XML_cap ) ) + mrTextCharacterProperties.moCaseMap = rAttribs.getToken( XML_cap ); + if ( rAttribs.hasAttribute( XML_dirty ) ) + { + --nVisualTokenAmount; // Not a visual attribute + } + if ( rAttribs.hasAttribute( XML_smtClean ) ) + { + --nVisualTokenAmount; // Not a visual attribute + } + + if ( nVisualTokenAmount > 0 ) + mrTextCharacterProperties.mbHasVisualRunProperties = true; + + /* TODO / unhandled so far: + A_TOKEN( kern ) + XML_altLang + A_TOKEN( kumimoji ) + A_TOKEN( spc ) + A_TOKEN( normalizeH ) + A_TOKEN( noProof ) + A_TOKEN( dirty ) + A_TOKEN( err ) + A_TOKEN( smtClean ) + A_TOKEN( smtId ) + */ +} + +TextCharacterPropertiesContext::~TextCharacterPropertiesContext() +{ +} + +ContextHandlerRef TextCharacterPropertiesContext::onCreateContext( sal_Int32 aElementToken, const AttributeList& rAttribs ) +{ + if( aElementToken != A_TOKEN(lang) ) + mrTextCharacterProperties.mbHasVisualRunProperties = true; + + switch( aElementToken ) + { + case A_TOKEN(ln): // CT_LineProperties + // TODO still largely unsupported + return new LinePropertiesContext(*this, rAttribs, mrTextCharacterProperties.moTextOutlineProperties.use()); + // EG_FillProperties + case A_TOKEN( noFill ): + case A_TOKEN( solidFill ): + case A_TOKEN( gradFill ): + case A_TOKEN( pattFill ): + return FillPropertiesContext::createFillContext( *this, aElementToken, rAttribs, mrTextCharacterProperties.maFillProperties ); + // EG_EffectProperties + case A_TOKEN( effectDag ): // CT_EffectContainer 5.1.10.25 + case A_TOKEN( effectLst ): // CT_EffectList 5.1.10.26 + break; + case A_TOKEN( highlight ): // CT_Color + return new ColorContext(*this, mrTextCharacterProperties.maHighlightColor); + case W_TOKEN( highlight ): + mrTextCharacterProperties.maHighlightColor = rAttribs.getHighlightColor(W_TOKEN(val)); + break; + // EG_TextUnderlineLine + case A_TOKEN( uLnTx ): // CT_TextUnderlineLineFollowText + mrTextCharacterProperties.moUnderlineLineFollowText = true; + break; +// TODO unsupported yet +// case A_TOKEN( uLn ): // CT_LineProperties +// return new LinePropertiesContext( getHandler(), rAttribs, maUnderlineProperties ); + + // EG_TextUnderlineFill + case A_TOKEN( uFillTx ): // CT_TextUnderlineFillFollowText + mrTextCharacterProperties.moUnderlineFillFollowText = true; + break; + case A_TOKEN( uFill ): // CT_TextUnderlineFillGroupWrapper->EG_FillProperties (not supported) + return new SimpleFillPropertiesContext( *this, mrTextCharacterProperties.maUnderlineColor ); + + // CT_FontCollection + case A_TOKEN( latin ): // CT_TextFont + mrTextCharacterProperties.maLatinFont.setAttributes( rAttribs ); + break; + case A_TOKEN( ea ): // CT_TextFont + mrTextCharacterProperties.maAsianFont.setAttributes( rAttribs ); + break; + case A_TOKEN( cs ): // CT_TextFont + mrTextCharacterProperties.maComplexFont.setAttributes( rAttribs ); + break; + case A_TOKEN( sym ): // CT_TextFont + mrTextCharacterProperties.maSymbolFont.setAttributes( rAttribs ); + break; + + case A_TOKEN( hlinkClick ): // CT_Hyperlink + case A_TOKEN( hlinkMouseOver ): // CT_Hyperlink + return new HyperLinkContext( *this, rAttribs, mrTextCharacterProperties.maHyperlinkPropertyMap ); + case W_TOKEN( rFonts ): + if( rAttribs.hasAttribute(W_TOKEN(ascii)) ) + { + mrTextCharacterProperties.maLatinFont.setAttributes(rAttribs.getString(W_TOKEN(ascii), OUString())); + } + if (rAttribs.hasAttribute(W_TOKEN(asciiTheme))) + { + mrTextCharacterProperties.maLatinThemeFont.setAttributes(rAttribs.getString(W_TOKEN(asciiTheme), OUString())); + } + if( rAttribs.hasAttribute(W_TOKEN(cs)) ) + { + mrTextCharacterProperties.maComplexFont.setAttributes(rAttribs.getString(W_TOKEN(cs), OUString())); + } + if (rAttribs.hasAttribute(W_TOKEN(cstheme))) + { + mrTextCharacterProperties.maComplexThemeFont.setAttributes(rAttribs.getString(W_TOKEN(cstheme), OUString())); + } + if( rAttribs.hasAttribute(W_TOKEN(eastAsia)) ) + { + mrTextCharacterProperties.maAsianFont.setAttributes(rAttribs.getString(W_TOKEN(eastAsia), OUString())); + } + if (rAttribs.hasAttribute(W_TOKEN(eastAsiaTheme))) + { + mrTextCharacterProperties.maAsianThemeFont.setAttributes(rAttribs.getString(W_TOKEN(eastAsiaTheme), OUString())); + } + break; + case W_TOKEN( u ): + { + // If you add here, check if it is in drawingmltypes.cxx 113. + auto attrib = rAttribs.getString(W_TOKEN(val), OUString()); + if (attrib == "single" || attrib == "words") // TODO: implement words properly. Now it is a single line. + mrTextCharacterProperties.moUnderline = XML_sng; + else if (attrib == "wavyHeavy") + mrTextCharacterProperties.moUnderline = XML_wavyHeavy; + else if (attrib == "wavyDouble") + mrTextCharacterProperties.moUnderline = XML_wavyDbl; + else if (attrib == "wave") + mrTextCharacterProperties.moUnderline = XML_wavy; + else if (attrib == "thick") + mrTextCharacterProperties.moUnderline = XML_heavy; + else if (attrib == "dottedHeavy") + mrTextCharacterProperties.moUnderline = XML_dottedHeavy; + else if (attrib == "dotted") + mrTextCharacterProperties.moUnderline = XML_dotted; + else if (attrib == "dashDotDotHeavy") + mrTextCharacterProperties.moUnderline = XML_dotDotDashHeavy; + else if (attrib == "dotDotDash") + mrTextCharacterProperties.moUnderline = XML_dotDotDash; + else if (attrib == "dashDotHeavy") + mrTextCharacterProperties.moUnderline = XML_dotDashHeavy; + else if (attrib == "dotDash") + mrTextCharacterProperties.moUnderline = XML_dotDash; + else if (attrib == "double") + mrTextCharacterProperties.moUnderline = XML_dbl; + else if (attrib == "dashLongHeavy") + mrTextCharacterProperties.moUnderline = XML_dashLongHeavy; + else if (attrib == "dashLong") + mrTextCharacterProperties.moUnderline = XML_dashLong; + else if (attrib == "dashedHeavy") + mrTextCharacterProperties.moUnderline = XML_dashHeavy; + else if (attrib == "dash") + mrTextCharacterProperties.moUnderline = XML_dash; + else if (attrib == "none") + mrTextCharacterProperties.moUnderline = XML_none; + auto colorAttrib = rAttribs.getIntegerHex(W_TOKEN(color)); + if (colorAttrib.has()) + { + oox::drawingml::Color theColor; + theColor.setSrgbClr(colorAttrib.get()); + mrTextCharacterProperties.maUnderlineColor = theColor; + } + break; + } + case W_TOKEN( spacing ): + { + auto attrib = rAttribs.getInteger(W_TOKEN( val ), 0); + mrTextCharacterProperties.moSpacing = attrib; + break; + } + case W_TOKEN( b ): + mrTextCharacterProperties.moBold = rAttribs.getBool(W_TOKEN( val ), true); + break; + case W_TOKEN( i ): + mrTextCharacterProperties.moItalic = rAttribs.getBool(W_TOKEN( val ), true); + break; + case W_TOKEN( bCs ): + break; + case W_TOKEN( strike ): + if (rAttribs.getBool(W_TOKEN(val), true)) + mrTextCharacterProperties.moStrikeout = XML_sngStrike; + break; + case W_TOKEN( dstrike ): + if (rAttribs.getBool(W_TOKEN(val), true)) + mrTextCharacterProperties.moStrikeout = XML_dblStrike; + break; + case W_TOKEN( color ): + if (rAttribs.getInteger(W_TOKEN(val)).has()) + { + mrTextCharacterProperties.maFillProperties.maFillColor.setSrgbClr(rAttribs.getIntegerHex(W_TOKEN(val)).get()); + mrTextCharacterProperties.maFillProperties.moFillType.set(XML_solidFill); + } + break; + case W_TOKEN( sz ): + if (rAttribs.getInteger(W_TOKEN(val)).has()) + { + sal_Int32 nVal = rAttribs.getInteger(W_TOKEN(val)).get(); + // wml has half points, dml has hundred points + mrTextCharacterProperties.moHeight = nVal * 50; + } + break; + case W_TOKEN( szCs ): + break; + case W_TOKEN( caps ): + { + if( rAttribs.getBool(W_TOKEN( val ), true) ) + mrTextCharacterProperties.moCaseMap = XML_all; + else + mrTextCharacterProperties.moCaseMap = XML_none; + } + break; + case W_TOKEN( smallCaps ): + { + if( rAttribs.getBool(W_TOKEN( val ), true) ) + mrTextCharacterProperties.moCaseMap = XML_small; + else + mrTextCharacterProperties.moCaseMap = XML_none; + } + break; + case W_TOKEN(vertAlign): + { + // Map wordprocessingML to drawingML + // . + sal_Int32 nVal = rAttribs.getToken(W_TOKEN(val), 0); + if (nVal == XML_superscript) + mrTextCharacterProperties.moBaseline = 30000; + else if (nVal == XML_subscript) + mrTextCharacterProperties.moBaseline = -25000; + break; + } + case W_TOKEN(lang): + mrTextCharacterProperties.moLang = rAttribs.getString(W_TOKEN(val), OUString()); + break; + case OOX_TOKEN(w14, glow): + case OOX_TOKEN(w14, shadow): + case OOX_TOKEN(w14, reflection): + case OOX_TOKEN(w14, textOutline): + case OOX_TOKEN(w14, textFill): + case OOX_TOKEN(w14, scene3d): + case OOX_TOKEN(w14, props3d): + case OOX_TOKEN(w14, ligatures): + case OOX_TOKEN(w14, numForm): + case OOX_TOKEN(w14, numSpacing): + case OOX_TOKEN(w14, stylisticSets): + case OOX_TOKEN(w14, cntxtAlts): + { + return new TextEffectsContext( *this, aElementToken, mrTextCharacterProperties.maTextEffectsProperties ); + } + break; + default: + SAL_WARN("oox", "TextCharacterPropertiesContext::onCreateContext: unhandled element: " << getBaseToken(aElementToken)); + break; + } + + return this; +} + +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/drawingml/texteffectscontext.cxx b/oox/source/drawingml/texteffectscontext.cxx new file mode 100644 index 000000000..e380b6425 --- /dev/null +++ b/oox/source/drawingml/texteffectscontext.cxx @@ -0,0 +1,318 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + */ + +#include +#include +#include + +#include + +namespace oox::drawingml { + +namespace +{ + +OUString const & lclGetNameForElementId(sal_uInt32 aId) +{ + static std::map const aIdMap + { + { OOX_TOKEN(w14, srgbClr) , "srgbClr" }, + { OOX_TOKEN(w14, schemeClr) , "schemeClr" }, + { OOX_TOKEN(w14, tint) , "tint" }, + { OOX_TOKEN(w14, shade) , "shade" }, + { OOX_TOKEN(w14, alpha) , "alpha" }, + { OOX_TOKEN(w14, hueMod) , "hueMod" }, + { OOX_TOKEN(w14, sat) , "sat" }, + { OOX_TOKEN(w14, satOff) , "satOff" }, + { OOX_TOKEN(w14, satMod) , "satMod" }, + { OOX_TOKEN(w14, lum) , "lum" }, + { OOX_TOKEN(w14, lumOff) , "lumOff" }, + { OOX_TOKEN(w14, lumMod) , "lumMod" }, + { OOX_TOKEN(w14, noFill) , "noFill" }, + { OOX_TOKEN(w14, solidFill) , "solidFill" }, + { OOX_TOKEN(w14, gradFill) , "gradFill" }, + { OOX_TOKEN(w14, gsLst) , "gsLst" }, + { OOX_TOKEN(w14, gs) , "gs" }, + { OOX_TOKEN(w14, pos) , "pos" }, + { OOX_TOKEN(w14, lin) , "lin" }, + { OOX_TOKEN(w14, path) , "path" }, + { OOX_TOKEN(w14, fillToRect) , "fillToRect" }, + { OOX_TOKEN(w14, prstDash) , "prstDash" }, + { OOX_TOKEN(w14, round) , "round" }, + { OOX_TOKEN(w14, bevel) , "bevel" }, + { OOX_TOKEN(w14, miter) , "miter" }, + { OOX_TOKEN(w14, camera) , "camera" }, + { OOX_TOKEN(w14, lightRig) , "lightRig" }, + { OOX_TOKEN(w14, rot) , "rot" }, + { OOX_TOKEN(w14, bevelT) , "bevelT" }, + { OOX_TOKEN(w14, bevelB) , "bevelB" }, + { OOX_TOKEN(w14, extrusionClr) , "extrusionClr" }, + { OOX_TOKEN(w14, contourClr) , "contourClr"} , + { OOX_TOKEN(w14, styleSet) , "styleSet" }, + + { OOX_TOKEN(w14, glow) , "glow" }, + { OOX_TOKEN(w14, shadow) , "shadow" }, + { OOX_TOKEN(w14, reflection) , "reflection" }, + { OOX_TOKEN(w14, textOutline) , "textOutline" }, + { OOX_TOKEN(w14, textFill) , "textFill" }, + { OOX_TOKEN(w14, scene3d) , "scene3d" }, + { OOX_TOKEN(w14, props3d) , "props3d" }, + { OOX_TOKEN(w14, ligatures) , "ligatures" }, + { OOX_TOKEN(w14, numForm) , "numForm" }, + { OOX_TOKEN(w14, numSpacing) , "numSpacing" }, + { OOX_TOKEN(w14, stylisticSets), "stylisticSets" }, + { OOX_TOKEN(w14, cntxtAlts) , "cntxtAlts" }, + }; + + return aIdMap.find(aId)->second; +} + +OUString const & lclGetGrabBagName(sal_uInt32 aId) +{ + static std::map const aGrabBagNameMap + { + { OOX_TOKEN(w14, glow) , "CharGlowTextEffect" }, + { OOX_TOKEN(w14, shadow) , "CharShadowTextEffect" }, + { OOX_TOKEN(w14, reflection) , "CharReflectionTextEffect" }, + { OOX_TOKEN(w14, textOutline) , "CharTextOutlineTextEffect" }, + { OOX_TOKEN(w14, textFill) , "CharTextFillTextEffect" }, + { OOX_TOKEN(w14, scene3d) , "CharScene3DTextEffect" }, + { OOX_TOKEN(w14, props3d) , "CharProps3DTextEffect" }, + { OOX_TOKEN(w14, ligatures) , "CharLigaturesTextEffect" }, + { OOX_TOKEN(w14, numForm) , "CharNumFormTextEffect" }, + { OOX_TOKEN(w14, numSpacing) , "CharNumSpacingTextEffect" }, + { OOX_TOKEN(w14, stylisticSets), "CharStylisticSetsTextEffect" }, + { OOX_TOKEN(w14, cntxtAlts) , "CharCntxtAltsTextEffect" }, + }; + + return aGrabBagNameMap.find(aId)->second; +} + +} + +using namespace oox::core; +using namespace com::sun::star::uno; +using namespace com::sun::star::beans; + +TextEffectsContext::TextEffectsContext( + ContextHandler2Helper const & rParent, + sal_Int32 aElementToken, + std::vector& rTextEffectsProperties) + : ContextHandler2(rParent) + , mrTextEffectsProperties(rTextEffectsProperties) + , mnCurrentElement(aElementToken) +{ +} + +TextEffectsContext::~TextEffectsContext() +{ +} + +void TextEffectsContext::pushAttributeToGrabBag (sal_Int32 aAttributeId, const OUString& rElementName, const AttributeList& rAttribs) +{ + if (!rAttribs.hasAttribute(aAttributeId)) + return; + OUString aString = rAttribs.getString(aAttributeId).get(); + mpGrabBagStack->addString(rElementName, aString); +} + +void TextEffectsContext::processAttributes(const AttributeList& rAttribs) +{ + mpGrabBagStack->push("attributes"); + switch(mnCurrentElement) + { + case OOX_TOKEN(w14, glow): + { + pushAttributeToGrabBag(OOX_TOKEN(w14, rad), "rad", rAttribs); + } + break; + case OOX_TOKEN(w14, srgbClr): + case OOX_TOKEN(w14, schemeClr): + case OOX_TOKEN(w14, tint): + case OOX_TOKEN(w14, shade): + case OOX_TOKEN(w14, alpha): + case OOX_TOKEN(w14, hueMod): + case OOX_TOKEN(w14, sat): + case OOX_TOKEN(w14, satOff): + case OOX_TOKEN(w14, satMod): + case OOX_TOKEN(w14, lum): + case OOX_TOKEN(w14, lumOff): + case OOX_TOKEN(w14, lumMod): + { + pushAttributeToGrabBag(OOX_TOKEN(w14, val), "val", rAttribs); + } + break; + case OOX_TOKEN(w14, shadow): + { + pushAttributeToGrabBag(OOX_TOKEN(w14, blurRad), "blurRad", rAttribs); + pushAttributeToGrabBag(OOX_TOKEN(w14, dist), "dist", rAttribs); + pushAttributeToGrabBag(OOX_TOKEN(w14, dir), "dir", rAttribs); + pushAttributeToGrabBag(OOX_TOKEN(w14, sx), "sx", rAttribs); + pushAttributeToGrabBag(OOX_TOKEN(w14, sy), "sy", rAttribs); + pushAttributeToGrabBag(OOX_TOKEN(w14, kx), "kx", rAttribs); + pushAttributeToGrabBag(OOX_TOKEN(w14, ky), "ky", rAttribs); + pushAttributeToGrabBag(OOX_TOKEN(w14, algn), "algn", rAttribs); + } + break; + case OOX_TOKEN(w14, reflection): + { + pushAttributeToGrabBag(OOX_TOKEN(w14, blurRad), "blurRad", rAttribs); + pushAttributeToGrabBag(OOX_TOKEN(w14, stA), "stA", rAttribs); + pushAttributeToGrabBag(OOX_TOKEN(w14, stPos), "stPos", rAttribs); + pushAttributeToGrabBag(OOX_TOKEN(w14, endA), "endA", rAttribs); + pushAttributeToGrabBag(OOX_TOKEN(w14, endPos), "endPos", rAttribs); + pushAttributeToGrabBag(OOX_TOKEN(w14, dist), "dist", rAttribs); + pushAttributeToGrabBag(OOX_TOKEN(w14, dir), "dir", rAttribs); + pushAttributeToGrabBag(OOX_TOKEN(w14, fadeDir), "fadeDir", rAttribs); + pushAttributeToGrabBag(OOX_TOKEN(w14, sx), "sx", rAttribs); + pushAttributeToGrabBag(OOX_TOKEN(w14, sy), "sy", rAttribs); + pushAttributeToGrabBag(OOX_TOKEN(w14, kx), "kx", rAttribs); + pushAttributeToGrabBag(OOX_TOKEN(w14, ky), "ky", rAttribs); + pushAttributeToGrabBag(OOX_TOKEN(w14, algn), "algn", rAttribs); + } + break; + case OOX_TOKEN(w14, textOutline): + { + pushAttributeToGrabBag(OOX_TOKEN(w14, w), "w", rAttribs); + pushAttributeToGrabBag(OOX_TOKEN(w14, cap), "cap", rAttribs); + pushAttributeToGrabBag(OOX_TOKEN(w14, cmpd), "cmpd", rAttribs); + pushAttributeToGrabBag(OOX_TOKEN(w14, algn), "algn", rAttribs); + } + break; + case OOX_TOKEN(w14, prstDash): + { + pushAttributeToGrabBag(OOX_TOKEN(w14, val), "val", rAttribs); + } + break; + case OOX_TOKEN(w14, gs): + { + pushAttributeToGrabBag(OOX_TOKEN(w14, pos), "pos", rAttribs); + } + break; + case OOX_TOKEN(w14, lin): + { + pushAttributeToGrabBag(OOX_TOKEN(w14, ang), "ang", rAttribs); + pushAttributeToGrabBag(OOX_TOKEN(w14, scaled), "scaled", rAttribs); + } + break; + case OOX_TOKEN(w14, path): + { + pushAttributeToGrabBag(OOX_TOKEN(w14, path), "path", rAttribs); + } + break; + case OOX_TOKEN(w14, fillToRect): + { + pushAttributeToGrabBag(OOX_TOKEN(w14, l), "l", rAttribs); + pushAttributeToGrabBag(OOX_TOKEN(w14, t), "t", rAttribs); + pushAttributeToGrabBag(OOX_TOKEN(w14, r), "r", rAttribs); + pushAttributeToGrabBag(OOX_TOKEN(w14, b), "b", rAttribs); + } + break; + case OOX_TOKEN(w14, miter): + { + pushAttributeToGrabBag(OOX_TOKEN(w14, lim), "lim", rAttribs); + } + break; + case OOX_TOKEN(w14, camera): + { + pushAttributeToGrabBag(OOX_TOKEN(w14, prst), "prst", rAttribs); + } + break; + case OOX_TOKEN(w14, lightRig): + { + pushAttributeToGrabBag(OOX_TOKEN(w14, rig), "rig", rAttribs); + pushAttributeToGrabBag(OOX_TOKEN(w14, dir), "dir", rAttribs); + } + break; + case OOX_TOKEN(w14, rot): + { + pushAttributeToGrabBag(OOX_TOKEN(w14, lat), "lat", rAttribs); + pushAttributeToGrabBag(OOX_TOKEN(w14, lon), "lon", rAttribs); + pushAttributeToGrabBag(OOX_TOKEN(w14, rev), "rev", rAttribs); + } + break; + case OOX_TOKEN(w14, props3d): + { + pushAttributeToGrabBag(OOX_TOKEN(w14, extrusionH), "extrusionH", rAttribs); + pushAttributeToGrabBag(OOX_TOKEN(w14, contourW), "contourW", rAttribs); + pushAttributeToGrabBag(OOX_TOKEN(w14, prstMaterial), "prstMaterial", rAttribs); + } + break; + case OOX_TOKEN(w14, bevelT): + case OOX_TOKEN(w14, bevelB): + { + pushAttributeToGrabBag(OOX_TOKEN(w14, w), "w", rAttribs); + pushAttributeToGrabBag(OOX_TOKEN(w14, h), "h", rAttribs); + pushAttributeToGrabBag(OOX_TOKEN(w14, prst), "prst", rAttribs); + } + break; + case OOX_TOKEN(w14, ligatures): + case OOX_TOKEN(w14, numForm): + case OOX_TOKEN(w14, numSpacing): + { + pushAttributeToGrabBag(OOX_TOKEN(w14, val), "val", rAttribs); + } + break; + case OOX_TOKEN(w14, styleSet): + { + pushAttributeToGrabBag(OOX_TOKEN(w14, id), "id", rAttribs); + pushAttributeToGrabBag(OOX_TOKEN(w14, val), "val", rAttribs); + } + break; + case OOX_TOKEN(w14, cntxtAlts): + { + pushAttributeToGrabBag(OOX_TOKEN(w14, val), "val", rAttribs); + } + break; + default: + break; + } + + mpGrabBagStack->pop(); +} + +void TextEffectsContext::onStartElement(const oox::AttributeList& rAttribs) +{ + if (mpGrabBagStack == nullptr) + { + OUString aGrabBagName = lclGetGrabBagName(mnCurrentElement); + mpGrabBagStack.reset(new GrabBagStack(aGrabBagName)); + } + + OUString aElementName = lclGetNameForElementId(mnCurrentElement); + mpGrabBagStack->push(aElementName); + processAttributes(rAttribs); +} + +void TextEffectsContext::onEndElement() +{ + mpGrabBagStack->pop(); + + if (mpGrabBagStack->isStackEmpty()) + { + Sequence aSeq; + PropertyValue aPropertyValue = mpGrabBagStack->getRootProperty(); + aPropertyValue.Value >>= aSeq; + aPropertyValue.Value <<= aSeq[0]; + + mrTextEffectsProperties.push_back(aPropertyValue); + } + +} + +ContextHandlerRef TextEffectsContext::onCreateContext(sal_Int32 aElementToken, const AttributeList& /*rAttribs*/) +{ + mnCurrentElement = aElementToken; + return this; +} + +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/drawingml/textfield.cxx b/oox/source/drawingml/textfield.cxx new file mode 100644 index 000000000..664c2dd37 --- /dev/null +++ b/oox/source/drawingml/textfield.cxx @@ -0,0 +1,274 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include + +#include + +#include + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +using namespace ::com::sun::star; +using namespace ::com::sun::star::uno; +using namespace ::com::sun::star::text; +using namespace ::com::sun::star::beans; +using namespace ::com::sun::star::frame; +using namespace ::com::sun::star::lang; + +namespace oox::drawingml { + +TextField::TextField() +{ +} + +namespace { + +/** instantiate the textfields. Because of semantics difference between + * OpenXML and OpenOffice, some OpenXML field might cause two fields to be created. + * @param aFields the created fields. The list is empty if no field has been created. + * @param xModel the model + * @param sType the OpenXML field type. + */ +void lclCreateTextFields( std::vector< Reference< XTextField > > & aFields, + const Reference< XModel > & xModel, std::u16string_view sType ) +{ + Reference< XInterface > xIface; + Reference< XMultiServiceFactory > xFactory( xModel, UNO_QUERY_THROW ); + if( o3tl::starts_with(sType, u"datetime")) + { + auto p = sType.substr(8); + try + { + if (o3tl::starts_with(p, u"'")) + { + xIface = xFactory->createInstance( "com.sun.star.text.TextField.Custom" ); + aFields.emplace_back( xIface, UNO_QUERY ); + return; + } + + SvxDateFormat eDateFormat = TextField::getLODateFormat(sType); + if (eDateFormat != SvxDateFormat::AppDefault) + { + xIface = xFactory->createInstance( "com.sun.star.text.TextField.DateTime" ); + aFields.emplace_back( xIface, UNO_QUERY ); + Reference< XPropertySet > xProps( xIface, UNO_QUERY_THROW ); + xProps->setPropertyValue("NumberFormat", Any(static_cast(eDateFormat))); + xProps->setPropertyValue("IsDate", Any(true)); + xProps->setPropertyValue("IsFixed", Any(false)); + } + + SvxTimeFormat eTimeFormat = TextField::getLOTimeFormat(sType); + if (eTimeFormat != SvxTimeFormat::AppDefault) + { + xIface = xFactory->createInstance( "com.sun.star.text.TextField.DateTime" ); + aFields.emplace_back( xIface, UNO_QUERY ); + Reference< XPropertySet > xProps( xIface, UNO_QUERY_THROW ); + xProps->setPropertyValue("NumberFormat", Any(static_cast(eTimeFormat))); + xProps->setPropertyValue("IsDate", Any(false)); + xProps->setPropertyValue("IsFixed", Any(false)); + } + } + catch(const Exception &) + { + TOOLS_WARN_EXCEPTION("oox", ""); + } + } + else if ( sType == u"slidenum" ) + { + xIface = xFactory->createInstance( "com.sun.star.text.TextField.PageNumber" ); + aFields.emplace_back( xIface, UNO_QUERY ); + } + else if ( sType == u"slidecount" ) + { + xIface = xFactory->createInstance( "com.sun.star.text.TextField.PageCount" ); + aFields.emplace_back( xIface, UNO_QUERY ); + } + else if ( sType == u"slidename" ) + { + xIface = xFactory->createInstance( "com.sun.star.text.TextField.PageName" ); + aFields.emplace_back( xIface, uno::UNO_QUERY ); + } + else if ( o3tl::starts_with(sType, u"file") ) + { + int idx = rtl_ustr_toInt32(sType.data() + 4, 10); + xIface = xFactory->createInstance( "com.sun.star.text.TextField.FileName" ); + aFields.emplace_back( xIface, UNO_QUERY ); + Reference< XPropertySet > xProps( xIface, UNO_QUERY_THROW ); + + switch( idx ) + { + case 1: // Path + xProps->setPropertyValue("FileFormat", Any(sal_Int16(1))); + break; + case 2: // File name without extension + xProps->setPropertyValue("FileFormat", Any(sal_Int16(2))); + break; + case 3: // File name with extension + xProps->setPropertyValue("FileFormat", Any(sal_Int16(3))); + break; + default: // Path/File name + xProps->setPropertyValue("FileFormat", Any(sal_Int16(0))); + } + } + else if( sType == u"author" ) + { + xIface = xFactory->createInstance( "com.sun.star.text.TextField.Author" ); + aFields.emplace_back( xIface, UNO_QUERY ); + } +} + +} // namespace + +sal_Int32 TextField::insertAt( + const ::oox::core::XmlFilterBase& rFilterBase, + const Reference < XText > & xText, + const Reference < XTextCursor > &xAt, + const TextCharacterProperties& rTextCharacterStyle, + float /*nDefaultCharHeight*/) const +{ + sal_Int32 nCharHeight = 0; + try + { + PropertyMap aioBulletList; + Reference< XPropertySet > xProps( xAt, UNO_QUERY); + PropertySet aPropSet( xProps ); + + maTextParagraphProperties.pushToPropSet( &rFilterBase, xProps, aioBulletList, nullptr, true, 18 ); + + TextCharacterProperties aTextCharacterProps( rTextCharacterStyle ); + aTextCharacterProps.assignUsed( maTextParagraphProperties.getTextCharacterProperties() ); + aTextCharacterProps.assignUsed( getTextCharacterProperties() ); + if ( aTextCharacterProps.moHeight.has() ) + nCharHeight = aTextCharacterProps.moHeight.get(); + aTextCharacterProps.pushToPropSet( aPropSet, rFilterBase ); + + std::vector< Reference< XTextField > > fields; + lclCreateTextFields( fields, rFilterBase.getModel(), msType ); + if( !fields.empty() ) + { + bool bFirst = true; + for (auto const& field : fields) + { + if( field.is() ) + { + Reference< XTextContent > xContent( field, UNO_QUERY); + if( bFirst) + { + bFirst = false; + } + else + { + xText->insertString( xAt, " ", false ); + } + xText->insertTextContent( xAt, xContent, false ); + } + } + } + else + { + xText->insertString( xAt, getText(), false ); + } + } + catch( const Exception& ) + { + TOOLS_WARN_EXCEPTION("oox", "OOX: TextField::insertAt()"); + } + + return nCharHeight; +} + +SvxDateFormat TextField::getLODateFormat(std::u16string_view rDateTimeType) +{ + auto aDateTimeNum = rDateTimeType.substr(8); + + if( aDateTimeNum.empty() ) // "datetime" + return SvxDateFormat::StdSmall; + + int nDateTimeNum = rtl_ustr_toInt32(aDateTimeNum.data(), 10); + + switch( nDateTimeNum ) + { + case 1: // Date dd/mm/yyyy + case 8: // DateTime dd/mm/yyyy H:MM PM + case 9: // DateTime dd/mm/yyyy H:MM:SS PM + return SvxDateFormat::B; + case 2: // Date Day, Month dd, yyyy + return SvxDateFormat::StdBig; + case 3: // Date dd Month yyyy + case 4: // Date Month dd, yyyy - no exact map + case 6: // Date Month yy - no exact map + return SvxDateFormat::D; + case 5: // Date dd-Mon-yy - no exact map + case 7: // Date Mon-yy - no exact map + return SvxDateFormat::C; + case 10: // Time H:MM - not a date format + case 11: // Time H:MM:SS - not a date format + case 12: // Time H:MM PM - not a date format + case 13: // Time H:MM:SS PM - not a date format + default: + return SvxDateFormat::AppDefault; + } +} + +SvxTimeFormat TextField::getLOTimeFormat(std::u16string_view rDateTimeType) +{ + auto aDateTimeNum = rDateTimeType.substr(8); + int nDateTimeNum = rtl_ustr_toInt32(aDateTimeNum.data(), 10); + + switch( nDateTimeNum ) + { + case 8: // DateTime dd/mm/yyyy H:MM PM + case 12: // Time H:MM PM + return SvxTimeFormat::HH12_MM; + case 9: // DateTime dd/mm/yyyy H:MM:SS PM + case 13: // Time H:MM:SS PM + return SvxTimeFormat::HH12_MM_SS; + case 10: // Time H:MM + return SvxTimeFormat::HH24_MM; + case 11: // Time H:MM:SS + return SvxTimeFormat::Standard; + case 1: // Date dd/mm/yyyy + case 2: // Date Day, Month dd, yyyy + case 3: // Date dd Month yyyy + case 4: // Date Month dd, yyyy + case 5: // Date dd-Mon-yy + case 6: // Date Month yy + case 7: // Date Mon-yy + default: + return SvxTimeFormat::AppDefault; + } +} +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/drawingml/textfieldcontext.cxx b/oox/source/drawingml/textfieldcontext.cxx new file mode 100644 index 000000000..8cfb17c08 --- /dev/null +++ b/oox/source/drawingml/textfieldcontext.cxx @@ -0,0 +1,78 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include +#include +#include +#include +#include +#include +#include + +using namespace ::oox::core; +using namespace ::com::sun::star::uno; +using namespace ::com::sun::star::xml::sax; + +namespace oox::drawingml { + +TextFieldContext::TextFieldContext( ContextHandler2Helper const & rParent, + const AttributeList& rAttributes, + TextField& rTextField) + : ContextHandler2( rParent ) + , mrTextField( rTextField ) + , mbIsInText( false ) +{ + mrTextField.setUuid( rAttributes.getString( XML_id ).get() ); + mrTextField.setType( rAttributes.getString( XML_type ).get() ); +} + +void TextFieldContext::onEndElement( ) +{ + if( getCurrentElement() == (A_TOKEN( t )) ) + { + mbIsInText = false; + } +} + +void TextFieldContext::onCharacters( const OUString& aChars ) +{ + if( mbIsInText ) + { + mrTextField.getText() += aChars; + } +} + +ContextHandlerRef TextFieldContext::onCreateContext( sal_Int32 aElementToken, const AttributeList& rAttribs ) +{ + switch( aElementToken ) + { + case A_TOKEN( rPr ): + return new TextCharacterPropertiesContext( *this, rAttribs, mrTextField.getTextCharacterProperties() ); + case A_TOKEN( pPr ): + return new TextParagraphPropertiesContext( *this, rAttribs, mrTextField.getTextParagraphProperties() ); + case A_TOKEN( t ): + mbIsInText = true; + break; + } + return this; +} + +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/drawingml/textfont.cxx b/oox/source/drawingml/textfont.cxx new file mode 100644 index 000000000..41dd0716a --- /dev/null +++ b/oox/source/drawingml/textfont.cxx @@ -0,0 +1,96 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include +#include +#include +#include +#include +#include +#include + +using ::oox::core::XmlFilterBase; + +namespace oox::drawingml { + +namespace { + +sal_Int16 lclGetFontPitch( sal_Int32 nOoxValue ) +{ + using namespace ::com::sun::star::awt::FontPitch; + static const sal_Int16 spnFontPitch[] = { DONTKNOW, FIXED, VARIABLE }; + return STATIC_ARRAY_SELECT( spnFontPitch, nOoxValue, DONTKNOW ); +} + +sal_Int16 lclGetFontFamily( sal_Int32 nOoxValue ) +{ + using namespace ::com::sun::star::awt::FontFamily; + static const sal_Int16 spnFontFamily[] = { DONTKNOW, ROMAN, SWISS, MODERN, SCRIPT, DECORATIVE }; + return STATIC_ARRAY_SELECT( spnFontFamily, nOoxValue, DONTKNOW ); +} + +} // namespace + +TextFont::TextFont() : + mnPitch( 0 ), + mnCharset( WINDOWS_CHARSET_ANSI ) +{ +} + +void TextFont::setAttributes( const AttributeList& rAttribs ) +{ + maTypeface = rAttribs.getString( XML_typeface, OUString() ); + maPanose = rAttribs.getString( XML_panose, OUString() ); + mnPitch = rAttribs.getInteger( XML_pitchFamily, 0 ); + mnCharset = rAttribs.getInteger( XML_charset, WINDOWS_CHARSET_DEFAULT ); +} + +void TextFont::setAttributes( const OUString& sFontName ) +{ + maTypeface = sFontName; + maPanose.clear(); + mnPitch = 0; + mnCharset = WINDOWS_CHARSET_DEFAULT; +} + +void TextFont::assignIfUsed( const TextFont& rTextFont ) +{ + if( !rTextFont.maTypeface.isEmpty() ) + *this = rTextFont; +} + +bool TextFont::getFontData( OUString& rFontName, sal_Int16& rnFontPitch, sal_Int16& rnFontFamily, const XmlFilterBase& rFilter ) const +{ + if( const Theme* pTheme = rFilter.getCurrentTheme() ) + if( const TextFont* pFont = pTheme->resolveFont( maTypeface ) ) + return pFont->implGetFontData( rFontName, rnFontPitch, rnFontFamily ); + return implGetFontData( rFontName, rnFontPitch, rnFontFamily ); +} + +bool TextFont::implGetFontData( OUString& rFontName, sal_Int16& rnFontPitch, sal_Int16& rnFontFamily ) const +{ + rFontName = maTypeface; + rnFontPitch = lclGetFontPitch( extractValue< sal_Int16 >( mnPitch, 0, 4 ) ); + rnFontFamily = lclGetFontFamily( extractValue< sal_Int16 >( mnPitch, 4, 4 ) ); + return !rFontName.isEmpty(); +} + +} // namespace oox::drawingml + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/drawingml/textliststyle.cxx b/oox/source/drawingml/textliststyle.cxx new file mode 100644 index 000000000..42679ad44 --- /dev/null +++ b/oox/source/drawingml/textliststyle.cxx @@ -0,0 +1,81 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include +#include + +namespace oox::drawingml { + +TextListStyle::TextListStyle() + : mbHasListStyleOnImport(false) +{ +} + +TextListStyle::~TextListStyle() +{ +} + +TextListStyle::TextListStyle(const TextListStyle& rStyle) + : mbHasListStyleOnImport(false) +{ + for ( size_t i = 0; i < NUM_TEXT_LIST_STYLE_ENTRIES; i++ ) + { + maListStyle[i] = rStyle.maListStyle[i]; + maAggregationListStyle[i] = rStyle.maAggregationListStyle[i]; + } +} + +TextListStyle& TextListStyle::operator=(const TextListStyle& rStyle) +{ + if(this != &rStyle) + { + for ( size_t i = 0; i < NUM_TEXT_LIST_STYLE_ENTRIES; i++ ) + { + maListStyle[i] = rStyle.maListStyle[i]; + maAggregationListStyle[i] = rStyle.maAggregationListStyle[i]; + } + } + return *this; +} + +static void applyStyleList( const TextParagraphPropertiesArray& rSourceListStyle, TextParagraphPropertiesArray& rDestListStyle ) +{ + for ( size_t i = 0; i < NUM_TEXT_LIST_STYLE_ENTRIES; i++ ) + rDestListStyle[i].apply(rSourceListStyle[i]); +} + +void TextListStyle::apply( const TextListStyle& rTextListStyle ) +{ + applyStyleList( rTextListStyle.getAggregationListStyle(), getAggregationListStyle() ); + applyStyleList( rTextListStyle.getListStyle(), getListStyle() ); +} + +#ifdef DBG_UTIL +void TextListStyle::dump() const +{ + for ( int i = 0; i < NUM_TEXT_LIST_STYLE_ENTRIES; i++ ) + { + SAL_INFO("oox.drawingml", "text list style level: " << i); + maListStyle[i].dump(); + } +} +#endif +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/drawingml/textliststylecontext.cxx b/oox/source/drawingml/textliststylecontext.cxx new file mode 100644 index 000000000..62d81f9c7 --- /dev/null +++ b/oox/source/drawingml/textliststylecontext.cxx @@ -0,0 +1,78 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include +#include +#include +#include + +using namespace ::oox::core; +using namespace ::com::sun::star::uno; +using namespace ::com::sun::star::xml::sax; + +namespace oox::drawingml { + +// CT_TextListStyle +TextListStyleContext::TextListStyleContext( ContextHandler2Helper const & rParent, TextListStyle& rTextListStyle ) +: ContextHandler2( rParent ) +, mrTextListStyle( rTextListStyle ) +{ +} + +TextListStyleContext::~TextListStyleContext() +{ +} + +ContextHandlerRef TextListStyleContext::onCreateContext( sal_Int32 aElementToken, const AttributeList& rAttribs ) +{ + mrTextListStyle.setHasListStyleOnImport(); + switch( aElementToken ) + { + case A_TOKEN( defPPr ): // CT_TextParagraphProperties + return new TextParagraphPropertiesContext( *this, rAttribs, mrTextListStyle.getListStyle()[ 0 ] ); + case A_TOKEN( outline1pPr ): + return new TextParagraphPropertiesContext( *this, rAttribs, mrTextListStyle.getAggregationListStyle()[ 0 ] ); + case A_TOKEN( outline2pPr ): + return new TextParagraphPropertiesContext( *this, rAttribs, mrTextListStyle.getAggregationListStyle()[ 1 ] ); + case A_TOKEN( lvl1pPr ): + return new TextParagraphPropertiesContext( *this, rAttribs, mrTextListStyle.getListStyle()[ 0 ] ); + case A_TOKEN( lvl2pPr ): + return new TextParagraphPropertiesContext( *this, rAttribs, mrTextListStyle.getListStyle()[ 1 ] ); + case A_TOKEN( lvl3pPr ): + return new TextParagraphPropertiesContext( *this, rAttribs, mrTextListStyle.getListStyle()[ 2 ] ); + case A_TOKEN( lvl4pPr ): + return new TextParagraphPropertiesContext( *this, rAttribs, mrTextListStyle.getListStyle()[ 3 ] ); + case A_TOKEN( lvl5pPr ): + return new TextParagraphPropertiesContext( *this, rAttribs, mrTextListStyle.getListStyle()[ 4 ] ); + case A_TOKEN( lvl6pPr ): + return new TextParagraphPropertiesContext( *this, rAttribs, mrTextListStyle.getListStyle()[ 5 ] ); + case A_TOKEN( lvl7pPr ): + return new TextParagraphPropertiesContext( *this, rAttribs, mrTextListStyle.getListStyle()[ 6 ] ); + case A_TOKEN( lvl8pPr ): + return new TextParagraphPropertiesContext( *this, rAttribs, mrTextListStyle.getListStyle()[ 7 ] ); + case A_TOKEN( lvl9pPr ): + return new TextParagraphPropertiesContext( *this, rAttribs, mrTextListStyle.getListStyle()[ 8 ] ); + } + + return this; +} + +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/drawingml/textparagraph.cxx b/oox/source/drawingml/textparagraph.cxx new file mode 100644 index 000000000..80f9fd373 --- /dev/null +++ b/oox/source/drawingml/textparagraph.cxx @@ -0,0 +1,220 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +using namespace ::com::sun::star::text; +using namespace ::com::sun::star::uno; +using namespace ::com::sun::star::beans; + +namespace oox::drawingml { + +TextParagraph::TextParagraph() + : mbHasProperties( false ) +{ +} + +TextParagraph::~TextParagraph() +{ +} + +TextCharacterProperties TextParagraph::getCharacterStyle ( + const TextCharacterProperties& rTextStyleProperties, + const TextListStyle& rMasterTextListStyle, + const TextListStyle& rTextListStyle) const +{ + const TextParagraphProperties* pMasterTextParagraphStyle = getParagraphStyle(rMasterTextListStyle); + const TextParagraphProperties* pTextParagraphStyle = getParagraphStyle(rTextListStyle); + + TextCharacterProperties aTextCharacterStyle; + if (pMasterTextParagraphStyle) + aTextCharacterStyle.assignUsed(pMasterTextParagraphStyle->getTextCharacterProperties()); + aTextCharacterStyle.assignUsed(rTextStyleProperties); + if (pTextParagraphStyle) + aTextCharacterStyle.assignUsed(pTextParagraphStyle->getTextCharacterProperties()); + aTextCharacterStyle.assignUsed(maProperties.getTextCharacterProperties()); + return aTextCharacterStyle; +} + +TextParagraphProperties* TextParagraph::getParagraphStyle( + const TextListStyle& rTextListStyle) const +{ + sal_Int16 nLevel = maProperties.getLevel(); + + SAL_INFO("oox", "TextParagraph::getParagraphStyle - level " << nLevel); + + const TextParagraphPropertiesArray& rListStyle = rTextListStyle.getListStyle(); + if (nLevel >= static_cast< sal_Int16 >(rListStyle.size())) + nLevel = 0; + const TextParagraphProperties* pTextParagraphStyle = nullptr; + if (!rListStyle.empty()) + pTextParagraphStyle = &rListStyle[nLevel]; + + return const_cast(pTextParagraphStyle); +} + +void TextParagraph::insertAt( + const ::oox::core::XmlFilterBase& rFilterBase, + const Reference < XText > &xText, + const Reference < XTextCursor > &xAt, + const TextCharacterProperties& rTextStyleProperties, + const TextListStyle& rMasterTextListStyle, + const TextListStyle& rTextListStyle, bool bFirst, + float nDefaultCharHeight, sal_Int32 nAutofitFontScale) const +{ + try { + sal_Int32 nParagraphSize = 0; + TextCharacterProperties aTextCharacterStyle + = getCharacterStyle(rTextStyleProperties, rMasterTextListStyle, rTextListStyle); + + if( !bFirst ) + { + xText->insertControlCharacter( xAt, ControlCharacter::APPEND_PARAGRAPH, false ); + xAt->gotoEnd( true ); + } + + sal_Int32 nCharHeight = 0; + sal_Int32 nCharHeightFirst = 0; + if ( maRuns.empty() ) + { + PropertySet aPropSet( xAt ); + + TextCharacterProperties aTextCharacterProps( aTextCharacterStyle ); + aTextCharacterProps.assignUsed( maEndProperties ); + if ( aTextCharacterProps.moHeight.has() ) + nCharHeight = nCharHeightFirst = aTextCharacterProps.moHeight.get(); + aTextCharacterProps.pushToPropSet( aPropSet, rFilterBase ); + } + else + { + for( TextRunVector::const_iterator aIt = maRuns.begin(), aEnd = maRuns.end(); aIt != aEnd; ++aIt ) + { + sal_Int32 nLen = (*aIt)->getText().getLength(); + // n#759180: Force use, maEndProperties for the last segment + // This is currently applied to only empty runs + if( !nLen && ( ( aIt + 1 ) == aEnd ) ) + (*aIt)->getTextCharacterProperties().assignUsed( maEndProperties ); + sal_Int32 nCharHeightCurrent = (*aIt)->insertAt( rFilterBase, xText, xAt, aTextCharacterStyle, nDefaultCharHeight ); + if(aIt == maRuns.begin()) + nCharHeightFirst = nCharHeightCurrent; + nCharHeight = std::max< sal_Int32 >( nCharHeight, nCharHeightCurrent); + nParagraphSize += nLen; + } + } + xAt->gotoEnd( true ); + + PropertyMap aioBulletList; + Reference< XPropertySet > xProps( xAt, UNO_QUERY); + + TextListStyle aCombinedTextStyle; + aCombinedTextStyle.apply(rMasterTextListStyle); + aCombinedTextStyle.apply(rTextListStyle); + TextParagraphProperties* pTextParagraphStyle = getParagraphStyle(aCombinedTextStyle); + if ( pTextParagraphStyle ) + { + TextParagraphProperties aParaProp; + aParaProp.apply( *pTextParagraphStyle ); + aParaProp.apply( maProperties ); + + // bullets have same color as following texts by default + if( !aioBulletList.hasProperty( PROP_BulletColor ) && !maRuns.empty() + && (*maRuns.begin())->getTextCharacterProperties().maFillProperties.moFillType.has() ) + aioBulletList.setProperty( PROP_BulletColor, (*maRuns.begin())->getTextCharacterProperties().maFillProperties.getBestSolidColor().getColor( rFilterBase.getGraphicHelper() )); + if( !aioBulletList.hasProperty( PROP_BulletColor ) && aTextCharacterStyle.maFillProperties.moFillType.has() ) + aioBulletList.setProperty( PROP_BulletColor, aTextCharacterStyle.maFillProperties.getBestSolidColor().getColor( rFilterBase.getGraphicHelper() )); + if( !aioBulletList.hasProperty( PROP_GraphicSize ) && !maRuns.empty() + && aParaProp.getBulletList().maGraphic.hasValue()) + { + tools::Long nFirstCharHeightMm = TransformMetric(nCharHeightFirst > 0 ? nCharHeightFirst : 1200, FieldUnit::POINT, FieldUnit::MM); + float fBulletSizeRel = 1.f; + double fBulletAspectRatio = 1.0; + + if( aParaProp.getBulletList().mnSize.hasValue() ) + fBulletSizeRel = aParaProp.getBulletList().mnSize.get() / 100.f; + + if( aParaProp.getBulletList().mnAspectRatio.hasValue() ) + fBulletAspectRatio = aParaProp.getBulletList().mnAspectRatio.get(); + + css::awt::Size aBulletSize; + if( fBulletAspectRatio != 1.0 ) + { + aBulletSize.Height = std::lround(fBulletSizeRel * nFirstCharHeightMm * OOX_BULLET_LIST_SCALE_FACTOR); + aBulletSize.Width = aBulletSize.Height * fBulletAspectRatio; + } + else + aBulletSize.Width = aBulletSize.Height = std::lround(fBulletSizeRel * nFirstCharHeightMm * OOX_BULLET_LIST_SCALE_FACTOR); + + aioBulletList.setProperty( PROP_GraphicSize, aBulletSize); + } + + float fCharacterSize = nCharHeight > 0 ? GetFontHeight ( nCharHeight ) : pTextParagraphStyle->getCharHeightPoints( 12 ); + aParaProp.pushToPropSet( &rFilterBase, xProps, aioBulletList, &pTextParagraphStyle->getBulletList(), true, fCharacterSize, nAutofitFontScale, true ); + } + + // empty paragraphs do not have bullets in ppt + if ( !nParagraphSize ) + { + xProps->setPropertyValue( "NumberingLevel", Any( static_cast< sal_Int16 >( -1 ) ) ); + } + +// FIXME this is causing a lot of disruption (ie does not work). I wonder what to do -- Hub +// Reference< XTextRange > xEnd( xAt, UNO_QUERY ); +// Reference< XPropertySet > xProps2( xEnd, UNO_QUERY ); +// mpEndProperties->pushToPropSet( xProps2 ); + } + catch( Exception & ) + { + SAL_INFO("oox", "exception in TextParagraph::insertAt"); + } +} + +formulaimport::XmlStreamBuilder & TextParagraph::GetMathXml() +{ + if (!m_pMathXml) + { + m_pMathXml.reset(new formulaimport::XmlStreamBuilder); + } + return *m_pMathXml; +} + +bool TextParagraph::hasVisualRunProperties() const +{ + for ( auto& pTextRun : getRuns() ) + { + if ( pTextRun->hasVisualRunProperties() ) + return true; + } + return false; +} + +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/drawingml/textparagraphproperties.cxx b/oox/source/drawingml/textparagraphproperties.cxx new file mode 100644 index 000000000..0006b7530 --- /dev/null +++ b/oox/source/drawingml/textparagraphproperties.cxx @@ -0,0 +1,553 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include + +#if OSL_DEBUG_LEVEL > 0 +#include +#include +#include +#include +#include +#endif + +using namespace ::oox::core; +using namespace ::com::sun::star::uno; +using namespace ::com::sun::star::beans; +using namespace ::com::sun::star::style; +using namespace ::com::sun::star::text; +using namespace ::com::sun::star::container; +using ::com::sun::star::awt::FontDescriptor; + +namespace oox::drawingml { + +BulletList::BulletList( ) +: maBulletColorPtr( std::make_shared() ), + mbBulletColorFollowText ( false ), + mbBulletFontFollowText ( false ), + mbBulletSizeFollowText ( false ) +{ +} + +bool BulletList::is() const +{ + return mnNumberingType.hasValue(); +} + +void BulletList::setBulletChar( const OUString & sChar ) +{ + mnNumberingType <<= NumberingType::CHAR_SPECIAL; + msBulletChar <<= sChar; +} + +void BulletList::setGraphic( css::uno::Reference< css::graphic::XGraphic > const & rXGraphic ) +{ + mnNumberingType <<= NumberingType::BITMAP; + maGraphic <<= rXGraphic; +} + +void BulletList::setNone( ) +{ + mnNumberingType <<= NumberingType::NUMBER_NONE; +} + +void BulletList::setSuffixParenBoth() +{ + msNumberingSuffix <<= OUString( ")" ); + msNumberingPrefix <<= OUString( "(" ); +} + +void BulletList::setSuffixParenRight() +{ + msNumberingSuffix <<= OUString( ")" ); + msNumberingPrefix <<= OUString(); +} + +void BulletList::setSuffixPeriod() +{ + msNumberingSuffix <<= OUString( "." ); + msNumberingPrefix <<= OUString(); +} + +void BulletList::setSuffixNone() +{ + msNumberingSuffix <<= OUString(); + msNumberingPrefix <<= OUString(); +} + +void BulletList::setSuffixMinusRight() +{ + msNumberingSuffix <<= OUString( "-" ); + msNumberingPrefix <<= OUString(); +} + +void BulletList::setType( sal_Int32 nType ) +{ + OSL_ASSERT((nType & sal_Int32(0xFFFF0000))==0); + switch( nType ) + { + case XML_alphaLcParenBoth: + mnNumberingType <<= NumberingType::CHARS_LOWER_LETTER; + setSuffixParenBoth(); + break; + case XML_alphaLcParenR: + mnNumberingType <<= NumberingType::CHARS_LOWER_LETTER; + setSuffixParenRight(); + break; + case XML_alphaLcPeriod: + mnNumberingType <<= NumberingType::CHARS_LOWER_LETTER; + setSuffixPeriod(); + break; + case XML_alphaUcParenBoth: + mnNumberingType <<= NumberingType::CHARS_UPPER_LETTER; + setSuffixParenBoth(); + break; + case XML_alphaUcParenR: + mnNumberingType <<= NumberingType::CHARS_UPPER_LETTER; + setSuffixParenRight(); + break; + case XML_alphaUcPeriod: + mnNumberingType <<= NumberingType::CHARS_UPPER_LETTER; + setSuffixPeriod(); + break; + case XML_arabic1Minus: + case XML_arabic2Minus: + case XML_arabicDbPeriod: + case XML_arabicDbPlain: + // TODO + break; + case XML_arabicParenBoth: + mnNumberingType <<= NumberingType::ARABIC; + setSuffixParenBoth(); + break; + case XML_arabicParenR: + mnNumberingType <<= NumberingType::ARABIC; + setSuffixParenRight(); + break; + case XML_arabicPeriod: + mnNumberingType <<= NumberingType::ARABIC; + setSuffixPeriod(); + break; + case XML_arabicPlain: + mnNumberingType <<= NumberingType::ARABIC; + setSuffixNone(); + break; + case XML_circleNumDbPlain: + case XML_circleNumWdBlackPlain: + case XML_circleNumWdWhitePlain: + mnNumberingType <<= NumberingType::CIRCLE_NUMBER; + break; + case XML_ea1ChsPeriod: + mnNumberingType <<= NumberingType::NUMBER_UPPER_ZH; + setSuffixPeriod(); + break; + case XML_ea1ChsPlain: + mnNumberingType <<= NumberingType::NUMBER_UPPER_ZH; + setSuffixNone(); + break; + case XML_ea1ChtPeriod: + mnNumberingType <<= NumberingType::NUMBER_UPPER_ZH_TW; + setSuffixPeriod(); + break; + case XML_ea1ChtPlain: + mnNumberingType <<= NumberingType::NUMBER_UPPER_ZH_TW; + setSuffixNone(); + break; + case XML_ea1JpnChsDbPeriod: + case XML_ea1JpnKorPeriod: + case XML_ea1JpnKorPlain: + break; + case XML_hebrew2Minus: + mnNumberingType <<= NumberingType::CHARS_HEBREW; + setSuffixMinusRight(); + break; + case XML_hindiAlpha1Period: + case XML_hindiAlphaPeriod: + case XML_hindiNumParenR: + case XML_hindiNumPeriod: + // TODO + break; + case XML_romanLcParenBoth: + mnNumberingType <<= NumberingType::ROMAN_LOWER; + setSuffixParenBoth(); + break; + case XML_romanLcParenR: + mnNumberingType <<= NumberingType::ROMAN_LOWER; + setSuffixParenRight(); + break; + case XML_romanLcPeriod: + mnNumberingType <<= NumberingType::ROMAN_LOWER; + setSuffixPeriod(); + break; + case XML_romanUcParenBoth: + mnNumberingType <<= NumberingType::ROMAN_UPPER; + setSuffixParenBoth(); + break; + case XML_romanUcParenR: + mnNumberingType <<= NumberingType::ROMAN_UPPER; + setSuffixParenRight(); + break; + case XML_romanUcPeriod: + mnNumberingType <<= NumberingType::ROMAN_UPPER; + setSuffixPeriod(); + break; + case XML_thaiAlphaParenBoth: + case XML_thaiNumParenBoth: + mnNumberingType <<= NumberingType::CHARS_THAI; + setSuffixParenBoth(); + break; + case XML_thaiAlphaParenR: + case XML_thaiNumParenR: + mnNumberingType <<= NumberingType::CHARS_THAI; + setSuffixParenRight(); + break; + case XML_thaiAlphaPeriod: + case XML_thaiNumPeriod: + mnNumberingType <<= NumberingType::CHARS_THAI; + setSuffixPeriod(); + break; + } +} + +void BulletList::setBulletSize(sal_Int16 nSize) +{ + mnSize <<= nSize; +} + +void BulletList::setBulletAspectRatio(double nAspectRatio) +{ + mnAspectRatio <<= nAspectRatio; +} + +void BulletList::setFontSize(sal_Int16 nSize) +{ + mnFontSize <<= nSize; +} + +void BulletList::apply( const BulletList& rSource ) +{ + if ( rSource.maBulletColorPtr->isUsed() ) + maBulletColorPtr = rSource.maBulletColorPtr; + if ( rSource.mbBulletColorFollowText.hasValue() ) + mbBulletColorFollowText = rSource.mbBulletColorFollowText; + if ( rSource.mbBulletFontFollowText.hasValue() ) + mbBulletFontFollowText = rSource.mbBulletFontFollowText; + if ( rSource.mbBulletSizeFollowText.hasValue() ) + mbBulletSizeFollowText = rSource.mbBulletSizeFollowText; + maBulletFont.assignIfUsed( rSource.maBulletFont ); + if ( rSource.msBulletChar.hasValue() ) + msBulletChar = rSource.msBulletChar; + if ( rSource.mnStartAt.hasValue() ) + mnStartAt = rSource.mnStartAt; + if ( rSource.mnNumberingType.hasValue() ) + mnNumberingType = rSource.mnNumberingType; + if ( rSource.msNumberingPrefix.hasValue() ) + msNumberingPrefix = rSource.msNumberingPrefix; + if ( rSource.msNumberingSuffix.hasValue() ) + msNumberingSuffix = rSource.msNumberingSuffix; + if ( rSource.mnSize.hasValue() ) + mnSize = rSource.mnSize; + if ( rSource.mnAspectRatio.hasValue() ) + mnAspectRatio = rSource.mnAspectRatio; + if ( rSource.mnFontSize.hasValue() ) + mnFontSize = rSource.mnFontSize; + if ( rSource.maStyleName.hasValue() ) + maStyleName = rSource.maStyleName; + if ( rSource.maGraphic.hasValue() ) + maGraphic = rSource.maGraphic; +} + +void BulletList::pushToPropMap( const ::oox::core::XmlFilterBase* pFilterBase, PropertyMap& rPropMap ) const +{ + if( msNumberingPrefix.hasValue() ) + rPropMap.setAnyProperty( PROP_Prefix, msNumberingPrefix); + if( msNumberingSuffix.hasValue() ) + rPropMap.setAnyProperty( PROP_Suffix, msNumberingSuffix); + if( mnStartAt.hasValue() ) + rPropMap.setAnyProperty( PROP_StartWith, mnStartAt); + rPropMap.setProperty( PROP_Adjust, HoriOrientation::LEFT); + + if( mnNumberingType.hasValue() ) + rPropMap.setAnyProperty( PROP_NumberingType, mnNumberingType); + + OUString aBulletFontName; + sal_Int16 nBulletFontPitch = 0; + sal_Int16 nBulletFontFamily = 0; + float nBulletFontWeight = css::awt::FontWeight::NORMAL; + bool bSymbolFont = false; + if( pFilterBase) { + bool bFollowTextFont = false; + mbBulletFontFollowText >>= bFollowTextFont; + if (!bFollowTextFont && maBulletFont.getFontData( aBulletFontName, nBulletFontPitch, nBulletFontFamily, *pFilterBase ) ) + { + FontDescriptor aFontDesc; + sal_Int16 nFontSize = 0; + if( mnFontSize >>= nFontSize ) + aFontDesc.Height = nFontSize; + + // TODO move the to the TextFont struct. + aFontDesc.Name = aBulletFontName; + aFontDesc.Pitch = nBulletFontPitch; + aFontDesc.Family = nBulletFontFamily; + aFontDesc.Weight = nBulletFontWeight; + if ( aBulletFontName.equalsIgnoreAsciiCase("Wingdings") || + aBulletFontName.equalsIgnoreAsciiCase("Wingdings 2") || + aBulletFontName.equalsIgnoreAsciiCase("Wingdings 3") || + aBulletFontName.equalsIgnoreAsciiCase("Monotype Sorts") || + aBulletFontName.equalsIgnoreAsciiCase("Monotype Sorts 2") || + aBulletFontName.equalsIgnoreAsciiCase("Webdings") || + aBulletFontName.equalsIgnoreAsciiCase("StarBats") || + aBulletFontName.equalsIgnoreAsciiCase("StarMath") || + aBulletFontName.equalsIgnoreAsciiCase("ZapfDingbats") ) { + aFontDesc.CharSet = RTL_TEXTENCODING_SYMBOL; + bSymbolFont = true; + } + rPropMap.setProperty( PROP_BulletFont, aFontDesc); + rPropMap.setProperty( PROP_BulletFontName, aBulletFontName); + } + } + if ( msBulletChar.hasValue() ) { + OUString sBuChar; + + msBulletChar >>= sBuChar; + + if( pFilterBase && sBuChar.getLength() == 1 && maBulletFont.getFontData( aBulletFontName, nBulletFontPitch, nBulletFontFamily, *pFilterBase ) && bSymbolFont ) + { + sal_Unicode nBuChar = sBuChar.toChar(); + nBuChar &= 0x00ff; + nBuChar |= 0xf000; + sBuChar = OUString( &nBuChar, 1 ); + } + + rPropMap.setProperty( PROP_BulletChar, sBuChar); + } + if ( maGraphic.hasValue() ) + { + Reference xBitmap(maGraphic, UNO_QUERY); + if (xBitmap.is()) + rPropMap.setProperty(PROP_GraphicBitmap, xBitmap); + } + bool bFollowTextSize = false; + mbBulletSizeFollowText >>= bFollowTextSize; + if( !bFollowTextSize && mnSize.hasValue() ) + rPropMap.setAnyProperty( PROP_BulletRelSize, mnSize); + if ( maStyleName.hasValue() ) + rPropMap.setAnyProperty( PROP_CharStyleName, maStyleName); + if (pFilterBase ) { + bool bFollowTextColor = false; + mbBulletColorFollowText >>= bFollowTextColor; + if ( maBulletColorPtr->isUsed() && !bFollowTextColor ) + rPropMap.setProperty( PROP_BulletColor, maBulletColorPtr->getColor( pFilterBase->getGraphicHelper() )); + } +} + +TextParagraphProperties::TextParagraphProperties() +: mnLevel( 0 ) +{ +} + +void TextParagraphProperties::apply( const TextParagraphProperties& rSourceProps ) +{ + maTextParagraphPropertyMap.assignAll( rSourceProps.maTextParagraphPropertyMap ); + maBulletList.apply( rSourceProps.maBulletList ); + maTextCharacterProperties.assignUsed( rSourceProps.maTextCharacterProperties ); + if ( rSourceProps.maParaTopMargin.bHasValue ) + maParaTopMargin = rSourceProps.maParaTopMargin; + if ( rSourceProps.maParaBottomMargin.bHasValue ) + maParaBottomMargin = rSourceProps.maParaBottomMargin; + if ( rSourceProps.moParaLeftMargin ) + moParaLeftMargin = rSourceProps.moParaLeftMargin; + if ( rSourceProps.moFirstLineIndentation ) + moFirstLineIndentation = rSourceProps.moFirstLineIndentation; + if( rSourceProps.mnLevel ) + mnLevel = rSourceProps.mnLevel; + if( rSourceProps.moParaAdjust ) + moParaAdjust = rSourceProps.moParaAdjust; + if( rSourceProps.maLineSpacing.bHasValue ) + maLineSpacing = rSourceProps.maLineSpacing; +} + +void TextParagraphProperties::pushToPropSet( const ::oox::core::XmlFilterBase* pFilterBase, + const Reference < XPropertySet >& xPropSet, PropertyMap& rioBulletMap, const BulletList* pMasterBuList, bool bApplyBulletMap, float fCharacterSize, + sal_Int32 nAutofitFontScale, bool bPushDefaultValues ) const +{ + PropertySet aPropSet( xPropSet ); + aPropSet.setProperties( maTextParagraphPropertyMap ); + + sal_Int32 nNumberingType = NumberingType::NUMBER_NONE; + if ( maBulletList.mnNumberingType.hasValue() ) + { + maBulletList.mnNumberingType >>= nNumberingType; + aPropSet.setProperty< sal_Int16 >( PROP_NumberingLevel, getLevel() ); + } + else if ( pMasterBuList && pMasterBuList->mnNumberingType.hasValue() ) + pMasterBuList->mnNumberingType >>= nNumberingType; + if ( nNumberingType == NumberingType::NUMBER_NONE ) + aPropSet.setProperty< sal_Int16 >( PROP_NumberingLevel, -1 ); + + maBulletList.pushToPropMap( pFilterBase, rioBulletMap ); + + if ( maParaTopMargin.bHasValue || bPushDefaultValues ) + aPropSet.setProperty( PROP_ParaTopMargin, maParaTopMargin.toMargin( fCharacterSize != 0.0 ? fCharacterSize : getCharHeightPoints ( 12.0 ) ) ); + if ( maParaBottomMargin.bHasValue || bPushDefaultValues ) + aPropSet.setProperty( PROP_ParaBottomMargin, maParaBottomMargin.toMargin( fCharacterSize != 0.0 ? fCharacterSize : getCharHeightPoints ( 12.0 ) ) ); + + std::optional< sal_Int32 > noParaLeftMargin( moParaLeftMargin ); + std::optional< sal_Int32 > noFirstLineIndentation( moFirstLineIndentation ); + + // tdf#149961 Impress scales the indents when text is autofitted while Powerpoint doesn't + // Try to counteract this by multiplying indents by the inverse of the autofit font scale. + if ( nAutofitFontScale ) + { + if ( noParaLeftMargin ) noParaLeftMargin = *noParaLeftMargin * MAX_PERCENT / nAutofitFontScale; + if ( noFirstLineIndentation ) noFirstLineIndentation = *noFirstLineIndentation * MAX_PERCENT / nAutofitFontScale; + } + + if ( nNumberingType != NumberingType::NUMBER_NONE ) + { + if ( noParaLeftMargin ) + { + aPropSet.setProperty( PROP_ParaLeftMargin, 0); + rioBulletMap.setProperty( PROP_LeftMargin, *noParaLeftMargin); + noParaLeftMargin.reset(); + } + if ( noFirstLineIndentation ) + { + // Force Paragraph property as zero - impress seems to use the value from previous + // (non) bullet line if not set to zero explicitly :( + aPropSet.setProperty( PROP_ParaFirstLineIndent, 0); + rioBulletMap.setProperty( PROP_FirstLineOffset, *noFirstLineIndentation); + noFirstLineIndentation.reset(); + } + if ( nNumberingType != NumberingType::BITMAP && !rioBulletMap.hasProperty( PROP_BulletColor ) && pFilterBase ) + rioBulletMap.setProperty( PROP_BulletColor, maTextCharacterProperties.maFillProperties.getBestSolidColor().getColor( pFilterBase->getGraphicHelper())); + } + + if ( bApplyBulletMap ) + { + Reference< XIndexReplace > xNumRule; + aPropSet.getProperty( xNumRule, PROP_NumberingRules ); + OSL_ENSURE( xNumRule.is(), "can't get Numbering rules"); + + try + { + if( xNumRule.is() ) + { + if( !rioBulletMap.empty() ) + { + // fix default bullet size to be 100% + if( !rioBulletMap.hasProperty( PROP_BulletRelSize ) ) + rioBulletMap.setProperty( PROP_BulletRelSize, 100); + Sequence< PropertyValue > aBulletPropSeq = rioBulletMap.makePropertyValueSequence(); + xNumRule->replaceByIndex( getLevel(), Any( aBulletPropSeq ) ); + } + + aPropSet.setProperty( PROP_NumberingRules, xNumRule ); + } + } + catch (const Exception &) + { + // Don't warn for now, expected to fail for Writer. + } + } + if ( noParaLeftMargin ) + aPropSet.setProperty( PROP_ParaLeftMargin, *noParaLeftMargin); + if ( noFirstLineIndentation ) + { + aPropSet.setProperty( PROP_ParaFirstLineIndent, *noFirstLineIndentation ); + if( bPushDefaultValues ) + { + // Reset TabStops - these would be auto calculated by Impress + TabStop aTabStop; + aTabStop.Position = 0; + Sequence< TabStop > aSeq { aTabStop }; + aPropSet.setProperty( PROP_ParaTabStops, aSeq ); + } + } + + if ( moParaAdjust ) + { + aPropSet.setProperty( PROP_ParaAdjust, *moParaAdjust); + } + else + { + aPropSet.setProperty( PROP_ParaAdjust, css::style::ParagraphAdjust_LEFT); + } + + if ( maLineSpacing.bHasValue ) + { + aPropSet.setProperty( PROP_ParaLineSpacing, maLineSpacing.toLineSpacing()); + } + else + { + aPropSet.setProperty( PROP_ParaLineSpacing, css::style::LineSpacing( css::style::LineSpacingMode::PROP, 100 )); + } +} + +float TextParagraphProperties::getCharHeightPoints( float fDefault ) const +{ + return maTextCharacterProperties.getCharHeightPoints( fDefault ); +} + +#ifdef DBG_UTIL +// Note: Please don't remove this function. This is required for +// debugging pptx import problems. +void TextParagraphProperties::dump() const +{ + Reference< css::drawing::XShape > xShape( oox::ppt::PowerPointImport::mpDebugFilterBase->getModelFactory()->createInstance( "com.sun.star.presentation.TitleTextShape" ), UNO_QUERY ); + Reference< css::text::XText > xText( xShape, UNO_QUERY ); + + Reference< css::drawing::XDrawPage > xDebugPage(ppt::SlidePersist::mxDebugPage.get(), UNO_QUERY); + if (xDebugPage.is()) + xDebugPage->add( xShape ); + + PropertyMap emptyMap; + + xText->setString( "debug" ); + Reference< css::text::XTextCursor > xStart = xText->createTextCursor(); + xStart->gotoEnd( true ); + Reference< XPropertySet > xPropSet( xStart, UNO_QUERY ); + pushToPropSet( nullptr, xPropSet, emptyMap, nullptr, false, 0 ); + PropertySet aPropSet( xPropSet ); + aPropSet.dump(); +} +#endif +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/drawingml/textparagraphpropertiescontext.cxx b/oox/source/drawingml/textparagraphpropertiescontext.cxx new file mode 100644 index 000000000..c1b8763a9 --- /dev/null +++ b/oox/source/drawingml/textparagraphpropertiescontext.cxx @@ -0,0 +1,375 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include + +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include +#include +#include +#include +#include "textspacingcontext.hxx" +#include "texttabstoplistcontext.hxx" +#include +#include +#include + +using namespace ::oox::core; +using namespace ::com::sun::star::uno; +using namespace ::com::sun::star::xml::sax; +using namespace ::com::sun::star::style; +using namespace ::com::sun::star::text; +using namespace ::com::sun::star::graphic; + +namespace oox::drawingml { +namespace { + +double lclGetGraphicAspectRatio( const Reference< XGraphic >& rxGraphic ) +{ + double fRatio = 1.0; + Reference< com::sun::star::beans::XPropertySet > xGraphicPropertySet( rxGraphic, UNO_QUERY_THROW ); + css::awt::Size aSizeHmm( 0, 0 ); + xGraphicPropertySet->getPropertyValue( "Size100thMM" ) >>= aSizeHmm; + + if( aSizeHmm.Width > 0 && aSizeHmm.Height > 0) + return double(aSizeHmm.Width)/double(aSizeHmm.Height); + else + { + css::awt::Size aSourceSizePixel( 0, 0 ); + xGraphicPropertySet->getPropertyValue( "SizePixel" ) >>= aSourceSizePixel; + + if( aSourceSizePixel.Width > 0 && aSourceSizePixel.Height > 0 ) + return double(aSourceSizePixel.Width)/double(aSourceSizePixel.Height); + } + return fRatio; +} + +} //namespace + +// CT_TextParagraphProperties +TextParagraphPropertiesContext::TextParagraphPropertiesContext( ContextHandler2Helper const & rParent, + const AttributeList& rAttribs, + TextParagraphProperties& rTextParagraphProperties ) +: ContextHandler2( rParent ) +, mrTextParagraphProperties( rTextParagraphProperties ) +, mrBulletList( rTextParagraphProperties.getBulletList() ) +{ + OUString sValue; + + PropertyMap& rPropertyMap( mrTextParagraphProperties.getTextParagraphPropertyMap() ); + + // ST_TextAlignType + if ( rAttribs.hasAttribute( XML_algn ) ) + { + mrTextParagraphProperties.getParaAdjust() = GetParaAdjust( rAttribs.getToken( XML_algn, XML_l ) ); + } + // TODO see to do the same with RubyAdjust + + // ST_Coordinate32 +// sValue = rAttribs.getString( XML_defTabSz ).get(); SJ: we need to be able to set the default tab size for each text object, +// this is possible at the moment only for the whole document. +// sal_Int32 nDefTabSize = ( sValue.getLength() == 0 ? 0 : GetCoordinate( sValue ) ); + // TODO + +// bool bEaLineBrk = rAttribs.getBool( XML_eaLnBrk, true ); + if ( rAttribs.hasAttribute( XML_latinLnBrk ) ) + { + bool bLatinLineBrk = rAttribs.getBool( XML_latinLnBrk, true ); + rPropertyMap.setProperty( PROP_ParaIsHyphenation, bLatinLineBrk); + } + // TODO see what to do with Asian hyphenation + + // ST_TextFontAlignType + // TODO +// sal_Int32 nFontAlign = rAttribs.getToken( XML_fontAlgn, XML_base ); + + if ( rAttribs.hasAttribute( XML_hangingPunct ) ) + { + bool bHangingPunct = rAttribs.getBool( XML_hangingPunct, false ); + rPropertyMap.setProperty( PROP_ParaIsHangingPunctuation, bHangingPunct); + } + + // ST_Coordinate + if ( rAttribs.hasAttribute( XML_indent ) ) + { + sValue = rAttribs.getString( XML_indent ).get(); + mrTextParagraphProperties.getFirstLineIndentation() = std::optional< sal_Int32 >( sValue.isEmpty() ? 0 : GetCoordinate( sValue ) ); + } + + // ST_TextIndentLevelType + // -1 is an invalid value and denote the lack of level + sal_Int32 nLevel = rAttribs.getInteger( XML_lvl, 0 ); + if( nLevel > 8 || nLevel < 0 ) + { + nLevel = 0; + } + + mrTextParagraphProperties.setLevel( static_cast< sal_Int16 >( nLevel ) ); + + char name[] = "Outline X"; + name[8] = static_cast( '1' + nLevel ); + const OUString sStyleNameValue( OUString::createFromAscii( name ) ); + mrBulletList.setStyleName( sStyleNameValue ); + + // ST_TextMargin + // ParaLeftMargin + if ( rAttribs.hasAttribute( XML_marL ) ) + { + sValue = rAttribs.getString( XML_marL ).get(); + mrTextParagraphProperties.getParaLeftMargin() = std::optional< sal_Int32 >( sValue.isEmpty() ? 0 : GetCoordinate( sValue ) ); + } + + // ParaRightMargin + if ( rAttribs.hasAttribute( XML_marR ) ) + { + sValue = rAttribs.getString( XML_marR ).get(); + sal_Int32 nMarR = sValue.isEmpty() ? 0 : GetCoordinate( sValue ) ; + rPropertyMap.setProperty( PROP_ParaRightMargin, nMarR); + } + + if ( rAttribs.hasAttribute( XML_rtl ) ) + { + bool bRtl = rAttribs.getBool( XML_rtl, false ); + rPropertyMap.setProperty( PROP_WritingMode, ( bRtl ? WritingMode2::RL_TB : WritingMode2::LR_TB )); + } +} + +TextParagraphPropertiesContext::~TextParagraphPropertiesContext() +{ + PropertyMap& rPropertyMap( mrTextParagraphProperties.getTextParagraphPropertyMap() ); + if ( mrTextParagraphProperties.getLineSpacing().bHasValue ) + rPropertyMap.setProperty( PROP_ParaLineSpacing, mrTextParagraphProperties.getLineSpacing().toLineSpacing()); + else + rPropertyMap.setProperty( PROP_ParaLineSpacing, css::style::LineSpacing( css::style::LineSpacingMode::PROP, 100 )); + + ::std::vector< TabStop >::size_type nTabCount = maTabList.size(); + if( nTabCount != 0 ) + { + Sequence< TabStop > aSeq( nTabCount ); + TabStop * aArray = aSeq.getArray(); + OSL_ENSURE( aArray != nullptr, "sequence array is NULL" ); + ::std::copy( maTabList.begin(), maTabList.end(), aArray ); + rPropertyMap.setProperty( PROP_ParaTabStops, aSeq); + } + + if (mxBlipProps && mxBlipProps->mxFillGraphic.is()) + { + mrBulletList.setGraphic( mxBlipProps->mxFillGraphic ); + mrBulletList.setBulletAspectRatio( lclGetGraphicAspectRatio(mxBlipProps->mxFillGraphic) ); + } + + if( mrBulletList.is() ) + rPropertyMap.setProperty( PROP_IsNumbering, true); + sal_Int16 nLevel = mrTextParagraphProperties.getLevel(); + rPropertyMap.setProperty( PROP_NumberingLevel, nLevel); + rPropertyMap.setProperty( PROP_NumberingIsNumber, true); + + if( mrTextParagraphProperties.getParaAdjust() ) + rPropertyMap.setProperty( PROP_ParaAdjust, *mrTextParagraphProperties.getParaAdjust()); +} + +ContextHandlerRef TextParagraphPropertiesContext::onCreateContext( sal_Int32 aElementToken, const AttributeList& rAttribs ) +{ + switch( aElementToken ) + { + case A_TOKEN( lnSpc ): // CT_TextSpacing + return new TextSpacingContext( *this, mrTextParagraphProperties.getLineSpacing() ); + case A_TOKEN( spcBef ): // CT_TextSpacing + return new TextSpacingContext( *this, mrTextParagraphProperties.getParaTopMargin() ); + case A_TOKEN( spcAft ): // CT_TextSpacing + return new TextSpacingContext( *this, mrTextParagraphProperties.getParaBottomMargin() ); + // EG_TextBulletColor + case A_TOKEN( buClrTx ): // CT_TextBulletColorFollowText ??? + mrBulletList.mbBulletColorFollowText <<= true; + break; + case A_TOKEN( buClr ): // CT_Color + return new ColorContext( *this, *mrBulletList.maBulletColorPtr ); + // EG_TextBulletSize + case A_TOKEN( buSzTx ): // CT_TextBulletSizeFollowText + mrBulletList.mbBulletSizeFollowText <<= true; + break; + case A_TOKEN( buSzPct ): // CT_TextBulletSizePercent + mrBulletList.setBulletSize( std::lround( GetPercent( rAttribs.getString( XML_val ).get() ) / 1000.f ) ); + break; + case A_TOKEN( buSzPts ): // CT_TextBulletSizePoint + mrBulletList.setBulletSize(0); + mrBulletList.setFontSize( static_cast(GetTextSize( rAttribs.getString( XML_val ).get() ) ) ); + break; + + // EG_TextBulletTypeface + case A_TOKEN( buFontTx ): // CT_TextBulletTypefaceFollowText + mrBulletList.mbBulletFontFollowText <<= true; + break; + case A_TOKEN( buFont ): // CT_TextFont + mrBulletList.maBulletFont.setAttributes( rAttribs ); + break; + + // EG_TextBullet + case A_TOKEN( buNone ): // CT_TextNoBullet + mrBulletList.setNone(); + break; + case A_TOKEN( buAutoNum ): // CT_TextAutonumberBullet + { + try { + sal_Int32 nType = rAttribs.getToken( XML_type, 0 ); + sal_Int32 nStartAt = rAttribs.getInteger( XML_startAt, 1 ); + if( nStartAt > 32767 ) + { + nStartAt = 32767; + } + else if( nStartAt < 1 ) + { + nStartAt = 1; + } + mrBulletList.setStartAt( nStartAt ); + mrBulletList.setType( nType ); + } + catch(SAXException& /* e */ ) + { + TOOLS_WARN_EXCEPTION("oox", "OOX: SAXException in XML_buAutoNum"); + } + break; + } + case A_TOKEN( buChar ): // CT_TextCharBullet + try { + + mrBulletList.setBulletChar( rAttribs.getString( XML_char ).get() ); + mrBulletList.setSuffixNone(); + } + catch(SAXException& /* e */) + { + TOOLS_WARN_EXCEPTION("oox", "OOX: SAXException in XML_buChar"); + } + break; + case A_TOKEN( buBlip ): // CT_TextBlipBullet + { + mxBlipProps = std::make_shared(); + return new BlipFillContext( *this, rAttribs, *mxBlipProps ); + } + case A_TOKEN( tabLst ): // CT_TextTabStopList + return new TextTabStopListContext( *this, maTabList ); + case A_TOKEN( defRPr ): // CT_TextCharacterProperties + return new TextCharacterPropertiesContext( *this, rAttribs, mrTextParagraphProperties.getTextCharacterProperties() ); + case W_TOKEN( jc ): + { + OptValue< OUString > oParaAdjust = rAttribs.getString( W_TOKEN(val) ); + if( oParaAdjust.has() && !oParaAdjust.get().isEmpty() ) + { + const OUString& sParaAdjust = oParaAdjust.get(); + if( sParaAdjust == "left" ) + mrTextParagraphProperties.setParaAdjust(ParagraphAdjust_LEFT); + else if ( sParaAdjust == "right" ) + mrTextParagraphProperties.setParaAdjust(ParagraphAdjust_RIGHT); + else if ( sParaAdjust == "center" ) + mrTextParagraphProperties.setParaAdjust(ParagraphAdjust_CENTER); + else if ( sParaAdjust == "both" ) + mrTextParagraphProperties.setParaAdjust(ParagraphAdjust_BLOCK); + } + } + break; + case W_TOKEN( spacing ): + { + // Spacing before + if( !rAttribs.getBool(W_TOKEN(beforeAutospacing), false) ) + { + OptValue oBefore = rAttribs.getInteger(W_TOKEN(before)); + if (oBefore.has()) + { + TextSpacing& rSpacing = mrTextParagraphProperties.getParaTopMargin(); + rSpacing.nUnit = TextSpacing::Unit::Points; + rSpacing.nValue = convertTwipToMm100(oBefore.get()); + rSpacing.bHasValue = true; + } + else + { + OptValue oBeforeLines = rAttribs.getInteger(W_TOKEN(beforeLines)); + if (oBeforeLines.has()) + { + TextSpacing& rSpacing = mrTextParagraphProperties.getParaTopMargin(); + rSpacing.nUnit = TextSpacing::Unit::Percent; + rSpacing.nValue = oBeforeLines.get() * MAX_PERCENT / 100; + rSpacing.bHasValue = true; + } + } + } + + // Spacing after + if( !rAttribs.getBool(W_TOKEN(afterAutospacing), false) ) + { + OptValue oAfter = rAttribs.getInteger(W_TOKEN(after)); + if (oAfter.has()) + { + TextSpacing& rSpacing = mrTextParagraphProperties.getParaBottomMargin(); + rSpacing.nUnit = TextSpacing::Unit::Points; + rSpacing.nValue = convertTwipToMm100(oAfter.get()); + rSpacing.bHasValue = true; + } + else + { + OptValue oAfterLines = rAttribs.getInteger(W_TOKEN(afterLines)); + if (oAfterLines.has()) + { + TextSpacing& rSpacing = mrTextParagraphProperties.getParaBottomMargin(); + rSpacing.nUnit = TextSpacing::Unit::Percent; + rSpacing.nValue = oAfterLines.get() * MAX_PERCENT / 100; + rSpacing.bHasValue = true; + } + } + } + + // Line spacing + OptValue oLineRule = rAttribs.getString(W_TOKEN(lineRule)); + OptValue oLineSpacing = rAttribs.getInteger(W_TOKEN(line)); + if (oLineSpacing.has()) + { + TextSpacing& rLineSpacing = mrTextParagraphProperties.getLineSpacing(); + if( !oLineRule.has() || oLineRule.get() == "auto" ) + { + rLineSpacing.nUnit = TextSpacing::Unit::Percent; + rLineSpacing.nValue = oLineSpacing.get() * MAX_PERCENT / 240; + } + else + { + rLineSpacing.nUnit = TextSpacing::Unit::Points; + rLineSpacing.nValue = convertTwipToMm100(oLineSpacing.get()); + } + rLineSpacing.bHasValue = true; + } + } + break; + default: + SAL_WARN("oox", "TextParagraphPropertiesContext::onCreateContext: unhandled element: " << getBaseToken(aElementToken)); + } + return this; +} + +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/drawingml/textrun.cxx b/oox/source/drawingml/textrun.cxx new file mode 100644 index 000000000..e3bcecb74 --- /dev/null +++ b/oox/source/drawingml/textrun.cxx @@ -0,0 +1,190 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include + +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include +#include +#include + +using namespace ::com::sun::star::uno; +using namespace ::com::sun::star::text; +using namespace ::com::sun::star::beans; +using namespace ::com::sun::star::lang; + +namespace oox::drawingml { + +TextRun::TextRun() : + mbIsLineBreak( false ) +{ +} + +TextRun::~TextRun() +{ +} + +sal_Int32 TextRun::insertAt( + const ::oox::core::XmlFilterBase& rFilterBase, + const Reference < XText > & xText, + const Reference < XTextCursor > &xAt, + const TextCharacterProperties& rTextCharacterStyle, + float nDefaultCharHeight) const +{ + sal_Int32 nCharHeight = 0; + try { + Reference< XTextRange > xStart = xAt; + PropertySet aPropSet( xStart ); + + Reference xState(xStart, UNO_QUERY); + Any aOldFontName = xState->getPropertyDefault("CharFontName"); + Any aOldFontPitch = xState->getPropertyDefault("CharFontPitch"); + Any aOldFontFamily = xState->getPropertyDefault("CharFontFamily"); + + TextCharacterProperties aTextCharacterProps( rTextCharacterStyle ); + + // If no text color specified lets anyway initialize it as default: + // this will help to recover after hyperlink + if (!aTextCharacterProps.maFillProperties.maFillColor.isUsed()) + aTextCharacterProps.maFillProperties.moFillType = XML_solidFill; + + aTextCharacterProps.assignUsed(maTextCharacterProperties); + if ( aTextCharacterProps.moHeight.has() ) + nCharHeight = aTextCharacterProps.moHeight.get(); + else + // UNO API has the character height as float, DML has it as int, but in hundreds. + aTextCharacterProps.moHeight = static_cast(nDefaultCharHeight * 100); + aTextCharacterProps.pushToPropSet( aPropSet, rFilterBase ); + + if( maTextCharacterProperties.maHyperlinkPropertyMap.empty() ) + { + if( mbIsLineBreak ) + { + SAL_WARN("oox", "OOX: TextRun::insertAt() insert line break" ); + xText->insertControlCharacter( xStart, ControlCharacter::LINE_BREAK, false ); + } + else if (!getText().isEmpty()) + { + sal_Int32 nIndex = 0; + sal_Int32 nMax = getText().getLength(); + while(true) + { + bool bSymbol = (getText()[nIndex] & 0xff00) == 0xf000; + sal_Int32 nCount = 1; + while(nIndex + nCount < nMax + && ((getText()[nIndex + nCount] & 0xff00) == 0xf000) == bSymbol) + ++nCount; + + OUString aFontName; + sal_Int16 nFontFamily = 0, nFontPitch = 0; + bool bReset = false; + + // Direct formatting for symbols. + if (bSymbol && aTextCharacterProps.maSymbolFont.getFontData(aFontName, nFontPitch, nFontFamily, rFilterBase)) + + { + aPropSet.setAnyProperty(PROP_CharFontName, Any(aFontName)); + aPropSet.setAnyProperty(PROP_CharFontPitch, Any(nFontPitch)); + aPropSet.setAnyProperty(PROP_CharFontFamily, Any(nFontFamily)); + bReset = true; + } + + OUString aSubString(getText().copy(nIndex, nCount)); + xText->insertString(xStart, aSubString, false); + + aPropSet = PropertySet(xStart); + // Reset to whatever it was. + if (bReset) + { + aPropSet.setAnyProperty(PROP_CharFontName, aOldFontName); + aPropSet.setAnyProperty(PROP_CharFontPitch, aOldFontPitch); + aPropSet.setAnyProperty(PROP_CharFontFamily, aOldFontFamily); + } + + nIndex += nCount; + + if (nIndex >= nMax) + break; + + aTextCharacterProps.pushToPropSet(aPropSet, rFilterBase); + } + } + } + else + { + SAL_WARN("oox", "OOX: URL field" ); + Reference< XMultiServiceFactory > xFactory( rFilterBase.getModel(), UNO_QUERY ); + Reference< XTextField > xField( xFactory->createInstance( "com.sun.star.text.TextField.URL" ), UNO_QUERY ); + if( xField.is() ) + { + Reference< XTextCursor > xTextFieldCursor = xText->createTextCursor(); + xTextFieldCursor->gotoEnd( false ); + + PropertySet aFieldProps( xField ); + aFieldProps.setProperties( maTextCharacterProperties.maHyperlinkPropertyMap ); + aFieldProps.setProperty( PROP_Representation, getText() ); + xText->insertTextContent( xStart, xField, false ); + + xTextFieldCursor->gotoEnd( true ); + + if (!maTextCharacterProperties.maHyperlinkPropertyMap.hasProperty(PROP_CharColor)) + aTextCharacterProps.maFillProperties.maFillColor.setSchemeClr(XML_hlink); + + aTextCharacterProps.maFillProperties.moFillType.set(XML_solidFill); + if ( !maTextCharacterProperties.moUnderline.has() ) + aTextCharacterProps.moUnderline.set( XML_sng ); + + PropertySet aFieldTextPropSet( xTextFieldCursor ); + aTextCharacterProps.pushToPropSet( aFieldTextPropSet, rFilterBase ); + + oox::core::TextField aTextField; + aTextField.xText = xText; + aTextField.xTextCursor = xTextFieldCursor; + aTextField.xTextField = xField; + rFilterBase.getTextFieldStack().push_back( aTextField ); + } + else + { + SAL_WARN("oox", "OOX: URL field couldn't be created" ); + xText->insertString( xStart, getText(), false ); + } + } + } + catch( const Exception& ) + { + TOOLS_WARN_EXCEPTION("oox", "OOX: TextRun::insertAt()"); + } + + return nCharHeight; +} + +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/drawingml/textspacingcontext.cxx b/oox/source/drawingml/textspacingcontext.cxx new file mode 100644 index 000000000..f96f1a20c --- /dev/null +++ b/oox/source/drawingml/textspacingcontext.cxx @@ -0,0 +1,63 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include +#include +#include +#include +#include +#include "textspacingcontext.hxx" + +using namespace ::oox::core; +using namespace ::com::sun::star::xml::sax; +using namespace ::com::sun::star::uno; + +namespace oox::drawingml { + + TextSpacingContext::TextSpacingContext( ContextHandler2Helper const & rParent, TextSpacing & aSpacing ) + : ContextHandler2( rParent ) + , maSpacing( aSpacing ) + { + maSpacing.bHasValue = true; + } + + ContextHandlerRef TextSpacingContext::onCreateContext( ::sal_Int32 aElement, + const AttributeList& rAttribs ) + { + switch( aElement ) + { + case A_TOKEN( spcPct ): + maSpacing.nUnit = TextSpacing::Unit::Percent; + maSpacing.nValue = GetPercent( rAttribs.getString( XML_val ).get() ); + break; + case A_TOKEN( spcPts ): + maSpacing.nUnit = TextSpacing::Unit::Points; + maSpacing.nValue = GetTextSpacingPoint( rAttribs.getString( XML_val ).get() ); + maSpacing.bExactValue = true; + break; + default: + break; + } + + return this; + } + +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/drawingml/textspacingcontext.hxx b/oox/source/drawingml/textspacingcontext.hxx new file mode 100644 index 000000000..5af2c0544 --- /dev/null +++ b/oox/source/drawingml/textspacingcontext.hxx @@ -0,0 +1,44 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_OOX_SOURCE_DRAWINGML_TEXTSPACINGCONTEXT_HXX +#define INCLUDED_OOX_SOURCE_DRAWINGML_TEXTSPACINGCONTEXT_HXX + +#include + +namespace oox::drawingml +{ +class TextSpacing; + +class TextSpacingContext : public ::oox::core::ContextHandler2 +{ +public: + TextSpacingContext(::oox::core::ContextHandler2Helper const& rParent, TextSpacing& aSpacing); + + virtual ::oox::core::ContextHandlerRef + onCreateContext(::sal_Int32 Element, const ::oox::AttributeList& rAttribs) override; + +private: + TextSpacing& maSpacing; +}; +} + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/drawingml/texttabstoplistcontext.cxx b/oox/source/drawingml/texttabstoplistcontext.cxx new file mode 100644 index 000000000..09809a9d8 --- /dev/null +++ b/oox/source/drawingml/texttabstoplistcontext.cxx @@ -0,0 +1,73 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include + +#include +#include +#include +#include +#include "texttabstoplistcontext.hxx" + +using namespace ::oox::core; +using namespace ::com::sun::star::uno; +using namespace ::com::sun::star::style; +using namespace ::com::sun::star::xml::sax; + +namespace oox::drawingml { + + TextTabStopListContext::TextTabStopListContext( ContextHandler2Helper const & rParent, std::vector< TabStop > & aTabList ) + : ContextHandler2( rParent ) + , maTabList( aTabList ) + { + } + + TextTabStopListContext::~TextTabStopListContext() + { + } + + ContextHandlerRef TextTabStopListContext::onCreateContext( ::sal_Int32 aElement, const AttributeList& rAttribs ) + { + switch( aElement ) + { + case A_TOKEN( tab ): + { + OUString sValue; + TabStop aTabStop; + sValue = rAttribs.getString( XML_pos ).get(); + if( !sValue.isEmpty() ) + { + aTabStop.Position = GetCoordinate( sValue ); + } + sal_Int32 aToken = rAttribs.getToken( XML_algn, 0 ); + if( aToken != 0 ) + { + aTabStop.Alignment = GetTabAlign( aToken ); + } + maTabList.push_back(aTabStop); + break; + } + default: + break; + } + return this; + } +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/drawingml/texttabstoplistcontext.hxx b/oox/source/drawingml/texttabstoplistcontext.hxx new file mode 100644 index 000000000..e1ca2cb11 --- /dev/null +++ b/oox/source/drawingml/texttabstoplistcontext.hxx @@ -0,0 +1,48 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_OOX_SOURCE_DRAWINGML_TEXTTABSTOPLISTCONTEXT_HXX +#define INCLUDED_OOX_SOURCE_DRAWINGML_TEXTTABSTOPLISTCONTEXT_HXX + +#include + +#include + +#include + +namespace oox::drawingml { + +class TextTabStopListContext final : public ::oox::core::ContextHandler2 +{ +public: + TextTabStopListContext( ::oox::core::ContextHandler2Helper const & rParent, + ::std::vector< css::style::TabStop > & aTabList ); + virtual ~TextTabStopListContext() override; + + virtual ::oox::core::ContextHandlerRef onCreateContext( ::sal_Int32 Element, const ::oox::AttributeList& rAttribs ) override; + +private: + ::std::vector< css::style::TabStop > & maTabList; +}; + +} + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/drawingml/theme.cxx b/oox/source/drawingml/theme.cxx new file mode 100644 index 000000000..87bee8895 --- /dev/null +++ b/oox/source/drawingml/theme.cxx @@ -0,0 +1,122 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include +#include +#include +#include +#include +#include +#include + +using namespace com::sun::star; + +namespace oox::drawingml { + +namespace { + +template< typename Type > +const Type* lclGetStyleElement( const RefVector< Type >& rVector, sal_Int32 nIndex ) +{ + return (rVector.empty() || (nIndex < 1)) ? nullptr : + rVector.get( ::std::min( static_cast< sal_Int32 >( nIndex - 1 ), static_cast< sal_Int32 >( rVector.size() - 1 ) ) ).get(); +} + +} // namespace + +const FillProperties* Theme::getFillStyle( sal_Int32 nIndex ) const +{ + return (nIndex >= 1000) ? + lclGetStyleElement( maBgFillStyleList, nIndex - 1000 ) : + lclGetStyleElement( maFillStyleList, nIndex ); +} + +const LineProperties* Theme::getLineStyle( sal_Int32 nIndex ) const +{ + return lclGetStyleElement( maLineStyleList, nIndex ); +} + +const EffectProperties* Theme::getEffectStyle( sal_Int32 nIndex ) const +{ + return lclGetStyleElement( maEffectStyleList, nIndex ); +} + +const TextCharacterProperties* Theme::getFontStyle( sal_Int32 nSchemeType ) const +{ + return maFontScheme.get( nSchemeType ).get(); +} + +const TextFont* Theme::resolveFont( const OUString& rName ) const +{ + const TextCharacterProperties* pCharProps = nullptr; + /* Resolves the following names: + +mj-lt, +mj-ea, +mj-cs -- major Latin, Asian, Complex font + +mn-lt, +mn-ea, +mn-cs -- minor Latin, Asian, Complex font + */ + if( (rName.getLength() == 6) && (rName[ 0 ] == '+') && (rName[ 3 ] == '-') ) + { + if( (rName[ 1 ] == 'm') && (rName[ 2 ] == 'j') ) + pCharProps = maFontScheme.get( XML_major ).get(); + else if( (rName[ 1 ] == 'm') && (rName[ 2 ] == 'n') ) + pCharProps = maFontScheme.get( XML_minor ).get(); + if( pCharProps ) + { + if( (rName[ 4 ] == 'l') && (rName[ 5 ] == 't') ) + return &pCharProps->maLatinFont; + if( (rName[ 4 ] == 'e') && (rName[ 5 ] == 'a') ) + return &pCharProps->maAsianFont; + if( (rName[ 4 ] == 'c') && (rName[ 5 ] == 's') ) + return &pCharProps->maComplexFont; + } + } + + // See writerfilter::dmapper::ThemeTable::getFontNameForTheme(). + if (rName == "majorHAnsi" || rName == "majorAscii" || rName == "majorBidi" || rName == "majorEastAsia") + pCharProps = maFontScheme.get(XML_major).get(); + else if (rName == "minorHAnsi" || rName == "minorAscii" || rName == "minorBidi" || rName == "minorEastAsia") + pCharProps = maFontScheme.get(XML_minor).get(); + if (pCharProps) + { + if (rName == "majorAscii" || rName == "majorHAnsi" || rName == "minorAscii" || rName == "minorHAnsi") + return &pCharProps->maLatinFont; + else if (rName == "minorBidi" || rName == "majorBidi") + return &pCharProps->maComplexFont; + else if (rName == "minorEastAsia" || rName == "majorEastAsia") + return &pCharProps->maAsianFont; + } + return nullptr; +} + +void Theme::addTheme(const css::uno::Reference& xDrawPage) const +{ + beans::PropertyValue aColorScheme; + aColorScheme.Name = "ColorScheme"; + maClrScheme.ToAny(aColorScheme.Value); + beans::PropertyValues aValues = { + comphelper::makePropertyValue("Name", maThemeName), + comphelper::makePropertyValue("ColorSchemeName", maClrScheme.GetName()), + aColorScheme, + }; + uno::Reference xPropertySet(xDrawPage, uno::UNO_QUERY); + xPropertySet->setPropertyValue("Theme", uno::Any(aValues)); +} + +} // namespace oox::drawingml + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/drawingml/themeelementscontext.cxx b/oox/source/drawingml/themeelementscontext.cxx new file mode 100644 index 000000000..0922c4b61 --- /dev/null +++ b/oox/source/drawingml/themeelementscontext.cxx @@ -0,0 +1,243 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "effectproperties.hxx" +#include +#include +#include + +using namespace ::oox::core; +using namespace ::com::sun::star::uno; +using namespace ::com::sun::star::xml::sax; + +namespace oox::drawingml { + +namespace { + +class FillStyleListContext : public ContextHandler2 +{ +public: + FillStyleListContext( ContextHandler2Helper const & rParent, FillStyleList& rFillStyleList ); + virtual ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ) override; + +private: + FillStyleList& mrFillStyleList; +}; + +} + +FillStyleListContext::FillStyleListContext( ContextHandler2Helper const & rParent, FillStyleList& rFillStyleList ) : + ContextHandler2( rParent ), + mrFillStyleList( rFillStyleList ) +{ +} + +ContextHandlerRef FillStyleListContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ) +{ + switch( nElement ) + { + case A_TOKEN( noFill ): + case A_TOKEN( solidFill ): + case A_TOKEN( gradFill ): + case A_TOKEN( blipFill ): + case A_TOKEN( pattFill ): + case A_TOKEN( grpFill ): + mrFillStyleList.push_back( std::make_shared( ) ); + return FillPropertiesContext::createFillContext( *this, nElement, rAttribs, *mrFillStyleList.back() ); + } + return nullptr; +} + +namespace { + +class LineStyleListContext : public ContextHandler2 +{ +public: + LineStyleListContext( ContextHandler2Helper const & rParent, LineStyleList& rLineStyleList ); + virtual ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ) override; + +private: + LineStyleList& mrLineStyleList; +}; + +} + +LineStyleListContext::LineStyleListContext( ContextHandler2Helper const & rParent, LineStyleList& rLineStyleList ) : + ContextHandler2( rParent ), + mrLineStyleList( rLineStyleList ) +{ +} + +ContextHandlerRef LineStyleListContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ) +{ + switch( nElement ) + { + case A_TOKEN( ln ): + mrLineStyleList.push_back( std::make_shared( ) ); + return new LinePropertiesContext( *this, rAttribs, *mrLineStyleList.back() ); + } + return nullptr; +} + +namespace { + +class EffectStyleListContext : public ContextHandler2 +{ +public: + EffectStyleListContext( ContextHandler2Helper const & rParent, EffectStyleList& rEffectStyleList ); + virtual ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ) override; + +private: + EffectStyleList& mrEffectStyleList; +}; + +} + +EffectStyleListContext::EffectStyleListContext( ContextHandler2Helper const & rParent, EffectStyleList& rEffectStyleList ) : + ContextHandler2( rParent ), + mrEffectStyleList( rEffectStyleList ) +{ +} + +ContextHandlerRef EffectStyleListContext::onCreateContext( sal_Int32 nElement, const AttributeList& /*rAttribs*/ ) +{ + switch( nElement ) + { + case A_TOKEN( effectStyle ): + mrEffectStyleList.push_back( std::make_shared( ) ); + return this; + + case A_TOKEN( effectLst ): // CT_EffectList + if( mrEffectStyleList.back() ) + return new EffectPropertiesContext( *this, *mrEffectStyleList.back() ); + break; + } + return nullptr; +} + +namespace { + +class FontSchemeContext : public ContextHandler2 +{ +public: + FontSchemeContext( ContextHandler2Helper const & rParent, FontScheme& rFontScheme ); + virtual ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ) override; + virtual void onEndElement() override; + +private: + FontScheme& mrFontScheme; + TextCharacterPropertiesPtr mxCharProps; +}; + +} + +FontSchemeContext::FontSchemeContext( ContextHandler2Helper const & rParent, FontScheme& rFontScheme ) : + ContextHandler2( rParent ), + mrFontScheme( rFontScheme ) +{ +} + +ContextHandlerRef FontSchemeContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ) +{ + switch( nElement ) + { + case A_TOKEN( majorFont ): + mxCharProps = std::make_shared(); + mrFontScheme[ XML_major ] = mxCharProps; + return this; + case A_TOKEN( minorFont ): + mxCharProps = std::make_shared(); + mrFontScheme[ XML_minor ] = mxCharProps; + return this; + + case A_TOKEN( latin ): + if( mxCharProps ) + mxCharProps->maLatinFont.setAttributes( rAttribs ); + break; + case A_TOKEN( ea ): + if( mxCharProps ) + mxCharProps->maAsianFont.setAttributes( rAttribs ); + break; + case A_TOKEN( cs ): + if( mxCharProps ) + mxCharProps->maComplexFont.setAttributes( rAttribs ); + break; + } + return nullptr; +} + +void FontSchemeContext::onEndElement() +{ + switch( getCurrentElement() ) + { + case A_TOKEN( majorFont ): + case A_TOKEN( minorFont ): + mxCharProps.reset(); + break; + } +} + +ThemeElementsContext::ThemeElementsContext( ContextHandler2Helper const & rParent, Theme& rTheme ) : + ContextHandler2( rParent ), + mrTheme( rTheme ) +{ +} + +ContextHandlerRef ThemeElementsContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ) +{ + // CT_BaseStyles + switch( nElement ) + { + case A_TOKEN( clrScheme ): // CT_ColorScheme + if (rAttribs.hasAttribute(XML_name)) + { + mrTheme.getClrScheme().SetName(rAttribs.getString(XML_name).get()); + } + return new clrSchemeContext( *this, mrTheme.getClrScheme() ); + case A_TOKEN( fontScheme ): // CT_FontScheme + return new FontSchemeContext( *this, mrTheme.getFontScheme() ); + + case A_TOKEN( fmtScheme ): // CT_StyleMatrix + mrTheme.setStyleName( rAttribs.getString( XML_name ).get() ); + return this; + + case A_TOKEN( fillStyleLst ): // CT_FillStyleList + return new FillStyleListContext( *this, mrTheme.getFillStyleList() ); + case A_TOKEN( lnStyleLst ): // CT_LineStyleList + return new LineStyleListContext( *this, mrTheme.getLineStyleList() ); + case A_TOKEN( effectStyleLst ): // CT_EffectStyleList + return new EffectStyleListContext( *this, mrTheme.getEffectStyleList() ); + case A_TOKEN( bgFillStyleLst ): // CT_BackgroundFillStyleList + return new FillStyleListContext( *this, mrTheme.getBgFillStyleList() ); + } + return nullptr; +} + +} // namespace oox::drawingml + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/drawingml/themefragmenthandler.cxx b/oox/source/drawingml/themefragmenthandler.cxx new file mode 100644 index 000000000..5ab0ee1e6 --- /dev/null +++ b/oox/source/drawingml/themefragmenthandler.cxx @@ -0,0 +1,78 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include +#include +#include +#include +#include +#include + +using namespace ::oox::core; + +namespace oox::drawingml { + +ThemeFragmentHandler::ThemeFragmentHandler( XmlFilterBase& rFilter, const OUString& rFragmentPath, Theme& rTheme ) : + FragmentHandler2( rFilter, rFragmentPath ), + mrTheme( rTheme ) +{ +} + +ThemeFragmentHandler::~ThemeFragmentHandler() +{ +} + +ContextHandlerRef ThemeFragmentHandler::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs) +{ + // CT_OfficeStyleSheet + switch( getCurrentElement() ) + { + case XML_ROOT_CONTEXT: + switch( nElement ) + { + case A_TOKEN( theme ): + { + mrTheme.setThemeName(rAttribs.getString(XML_name).get()); + return this; + } + } + break; + + case A_TOKEN( theme ): + switch( nElement ) + { + case A_TOKEN( themeElements ): // CT_BaseStyles + return new ThemeElementsContext( *this, mrTheme ); + case A_TOKEN( objectDefaults ): // CT_ObjectStyleDefaults + return new objectDefaultContext( *this, mrTheme ); + case A_TOKEN( extraClrSchemeLst ): // CT_ColorSchemeList + return nullptr; + case A_TOKEN( custClrLst ): // CustomColorList + return nullptr; + case A_TOKEN( ext ): // CT_OfficeArtExtension + return nullptr; + } + break; + } + return nullptr; +} + +} // namespace oox::drawingml + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/drawingml/transform2dcontext.cxx b/oox/source/drawingml/transform2dcontext.cxx new file mode 100644 index 000000000..08ec71f5a --- /dev/null +++ b/oox/source/drawingml/transform2dcontext.cxx @@ -0,0 +1,129 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include +#include +#include +#include +#include +#include + +using namespace ::com::sun::star; +using ::oox::core::ContextHandlerRef; + +namespace oox::drawingml { + +/** context to import a CT_Transform2D */ +Transform2DContext::Transform2DContext( ContextHandler2Helper const & rParent, const AttributeList& rAttribs, Shape& rShape, bool btxXfrm ) noexcept +: ContextHandler2( rParent ) +, mrShape( rShape ) +, mbtxXfrm ( btxXfrm ) +{ + if( !btxXfrm ) + { + mrShape.setRotation( rAttribs.getInteger( XML_rot, 0 ) ); // 60000ths of a degree Positive angles are clockwise; negative angles are counter-clockwise + mrShape.setFlip( rAttribs.getBool( XML_flipH, false ), rAttribs.getBool( XML_flipV, false ) ); + } + else + { + if (rAttribs.hasAttribute(XML_rot) && mrShape.getTextBody()) + mrShape.getTextBody()->getTextProperties().moRotation = rAttribs.getInteger( XML_rot ).get(); + } +} + +ContextHandlerRef Transform2DContext::onCreateContext( sal_Int32 aElementToken, const AttributeList& rAttribs ) +{ + if( mbtxXfrm ) + { + // Workaround: only for rectangles + const sal_Int32 nType = mrShape.getCustomShapeProperties()->getShapePresetType(); + if( mrShape.getTextBody() && ( nType == XML_rect || nType == XML_roundRect || nType == XML_ellipse ) ) + { + switch( aElementToken ) + { + case A_TOKEN( off ): + { + const OUString sXValue = rAttribs.getString( XML_x ).get(); + const OUString sYValue = rAttribs.getString( XML_y ).get(); + + if( !sXValue.isEmpty() && nType != XML_ellipse ) + mrShape.getTextBody()->getTextProperties().moTextOffLeft = GetCoordinate( sXValue.toInt32() - mrShape.getPosition().X ); + if( !sYValue.isEmpty() ) + mrShape.getTextBody()->getTextProperties().moTextOffUpper = GetCoordinate( sYValue.toInt32() - mrShape.getPosition().Y ); + } + break; + case A_TOKEN( ext ): + { + const OUString sXValue = rAttribs.getString( XML_cx ).get(); + const OUString sYValue = rAttribs.getString( XML_cy ).get(); + + if( !sXValue.isEmpty() && nType == XML_rect ) + { + mrShape.getTextBody()->getTextProperties().moTextOffRight = GetCoordinate(mrShape.getSize().Width - sXValue.toInt32()); + if( mrShape.getTextBody()->getTextProperties().moTextOffLeft ) + *mrShape.getTextBody()->getTextProperties().moTextOffRight -= *mrShape.getTextBody()->getTextProperties().moTextOffLeft; + } + if( !sYValue.isEmpty() ) + { + mrShape.getTextBody()->getTextProperties().moTextOffLower = GetCoordinate(mrShape.getSize().Height - sYValue.toInt32()); + if( mrShape.getTextBody()->getTextProperties().moTextOffUpper ) + *mrShape.getTextBody()->getTextProperties().moTextOffLower -= *mrShape.getTextBody()->getTextProperties().moTextOffUpper; + + } + } + break; + } + } + return nullptr; + } + + switch( aElementToken ) + { + case A_TOKEN( off ): // horz/vert translation + mrShape.setPosition( awt::Point( rAttribs.getString( XML_x ).get().toInt32(), rAttribs.getString( XML_y ).get().toInt32() ) ); + break; + case A_TOKEN( ext ): // horz/vert size + mrShape.setSize( awt::Size( rAttribs.getString( XML_cx ).get().toInt32(), rAttribs.getString( XML_cy ).get().toInt32() ) ); + break; + case A_TOKEN( chOff ): // horz/vert translation of children + mrShape.setChildPosition( awt::Point( rAttribs.getString( XML_x ).get().toInt32(), rAttribs.getString( XML_y ).get().toInt32() ) ); + break; + case A_TOKEN( chExt ): // horz/vert size of children + { + sal_Int32 nChExtCx = rAttribs.getString(XML_cx).get().toInt32(); + + if(nChExtCx == 0) + nChExtCx = mrShape.getSize().Width; + + sal_Int32 nChExtCy = rAttribs.getString(XML_cy).get().toInt32(); + + if(nChExtCy == 0) + nChExtCy = mrShape.getSize().Height; + + mrShape.setChildSize(awt::Size(nChExtCx, nChExtCy)); + } + break; + } + + return nullptr; +} + +} // namespace oox::drawingml + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/dump/biffdumper.ini b/oox/source/dump/biffdumper.ini new file mode 100644 index 000000000..a5ae4c12a --- /dev/null +++ b/oox/source/dump/biffdumper.ini @@ -0,0 +1,2397 @@ +# +# This file is part of the LibreOffice project. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# +# This file incorporates work covered by the following license notice: +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed +# with this work for additional information regarding copyright +# ownership. The ASF licenses this file to you under the Apache +# License, Version 2.0 (the "License"); you may not use this file +# except in compliance with the License. You may obtain a copy of +# the License at http://www.apache.org/licenses/LICENSE-2.0 . +# + +# dumper settings ============================================================ + +# Path to additional configuration data, relative to this file. +include-config-file=dumperbase.ini +include-config-file=dffdumper.ini +include-config-file=oledumper.ini + +# Enable entire dumper. This option does not affect the option 'enable-import'. +# 0=off, 1=on, missing = use setting from dumperbase.ini +# enable-dumper=1 + +# Enable import after dumping. Disabling this option allows to dump a file +# without loading it. This option is independent from the 'enable-dumper' +# option. +# 0=off, 1=on, missing = use setting from dumperbase.ini +# enable-import=1 + +# BIFF record settings ------------------------------------------------------- + +# Merge CONTINUE records with leading record (default=on). +# 0=off - show CONTINUE records separately (hex dump) +# 1=on - show contents of leading record together with following CONTINUE +merge-continue-record=1 + +# name lists ================================================================= + +# common --------------------------------------------------------------------- + +unitconverter=CONV-PERCENT-NEG,-1,% +unitconverter=CONV-COLWIDTH,/256,chars +unitconverter=CONV-TINT,/327.67,% + +shortlist=BIFF,0,biff2,biff3,biff4,biff5,biff8 + +constlist=ERRORCODES + 0x00=#NULL! + 0x07=#DIV/0! + 0x0F=#VALUE! + 0x17=#REF! + 0x1D=#NAME? + 0x24=#NUM! + 0x2A=#N/A +end + +shortlist=WINDOWS-PALETTE-0,0,black,white,red,green,blue,yellow,magenta,cyan +shortlist=WINDOWS-PALETTE-8,8,black,white,red,green,blue,yellow,magenta,cyan +shortlist=WINDOWS-PALETTE-16,16,dark-red,dark-green,dark-blue,dark-yellow,dark-magenta,dark-cyan,light-grey,dark-grey + +multilist=WINDOWS-SYSCOLORS-BIFF2 + 24=sys-window-text,sys-window-bg + 0x7FFF=sys-window-text +end + +multilist=WINDOWS-SYSCOLORS-BIFF5 + 64=sys-window-text,sys-window-bg,,sys-button-face + 77=sys-window-text-chart,sys-window-bg-chart,auto-border-chart,sys-tooltip-bg,sys-tooltip-text + 0x7FFF=sys-window-text +end + +constlist=COLORS-BIFF2 + include=WINDOWS-PALETTE-0 + include=WINDOWS-SYSCOLORS-BIFF2 +end + +constlist=COLORS-BIFF3 + include=WINDOWS-PALETTE-0 + include=WINDOWS-PALETTE-8 + include=WINDOWS-PALETTE-16 + include=WINDOWS-SYSCOLORS-BIFF2 +end + +multilist=COLORS-BIFF5 + include=WINDOWS-PALETTE-0 + include=WINDOWS-PALETTE-8 + include=WINDOWS-PALETTE-16 + 24=0x8080FF,0x802060,0xFFFFC0,0xA0E0E0,0x600080,0xFF8080,0x0080C0,0xC0C0FF + 32=0x000080,0xFF00FF,0xFFFF00,0x00FFFF,0x800080,0x800000,0x008080,0x0000FF + 40=0x00CFFF,0x69FFFF,0xE0FFE0,0xFFFF80,0xA6CAF0,0xDD9CB3,0xB38FEE,0xE3E3E3 + 48=0x2A6FF9,0x3FB8CD,0x488436,0x958C41,0x8E5E42,0xA0627A,0x624FAC,0x969696 + 56=0x1D2FBE,0x286676,0x004500,0x453E01,0x6A2813,0x85396A,0x4A3285,0x424242 + include=WINDOWS-SYSCOLORS-BIFF5 +end + +multilist=COLORS-BIFF8 + include=WINDOWS-PALETTE-0 + include=WINDOWS-PALETTE-8 + include=WINDOWS-PALETTE-16 + 24=0x9999FF,0x993366,0xFFFFCC,0xCCFFFF,0x660066,0xFF8080,0x0066CC,0xCCCCFF + 32=0x000080,0xFF00FF,0xFFFF00,0x00FFFF,0x800080,0x800000,0x008080,0x0000FF + 40=0x00CCFF,0xCCFFFF,0xCCFFCC,0xFFFF99,0x99CCFF,0xFF99CC,0xCC99FF,0xFFCC99 + 48=0x3366FF,0x33CCCC,0x99CC00,0xFFCC00,0xFF9900,0xFF6600,0x666699,0x969696 + 56=0x003366,0x339966,0x003300,0x333300,0x993300,0x993366,0x333399,0x333333 + include=WINDOWS-SYSCOLORS-BIFF5 +end + +shortlist=BORDERSTYLES-BIFF3,0,none,thin,medium,dash,dot,thick,double,hair + +multilist=BORDERSTYLES-BIFF8 + include=BORDERSTYLES-BIFF3 + 8=medium-dash,thin-dash-dot,medium-dash-dot,thin-dash-dot-dot,medium-dash-dot-dot,slant-dash-dot +end + +multilist=FILLPATTERNS-BIFF3 + 0=no-fill,solid-fill,50%-grey,75%-grey,25%-grey + 5=hor-stripe,ver-stripe,rev-diag-stripe,diag-stripe,diag-crosshatch + 10=thick-diag-crosshatch,thin-hor-stripe,thin-ver-stripe,thin-rev-diag-stripe,thin-diag-stripe + 15=thin-hor-crosshatch,thin-diag-crosshatch,12.5%-grey,6.25%-grey +end + +shortlist=TEXTORIENTATION,0,horizontal,stacked,90°-ccw,90°-cw + +constlist=TEXTROTATION-BIFF8 + default= + 255=stacked +end + +multilist=BUILTIN-FORMATS + quote-names=1 + 0=General,0,0.00,'#,##0','#,##0.00' + 5='"$"#,##0_);\("$"#,##0\)','"$"#,##0_);[Red]\("$"#,##0\)','"$"#,##0.00_);\("$"#,##0.00\)','"$"#,##0.00_);[Red]\("$"#,##0.00\)',0% + 10=0.00%,0.00E+00,# ?/?,# ??/??,M/D/YYYY + 15=D-MMM-YY,D-MMM,MMM-YY,h:mm AM/PM,h:mm:ss AM/PM + 20=h:mm,h:mm:ss,M/D/YYYY h:mm,General,General + 25=General,General,M/D/YYYY,M/D/YYYY,M/D/YYYY + 30=M/D/YYYY,M/D/YYYY,h:mm:ss,h:mm:ss,h:mm:ss + 35=h:mm:ss,M/D/YYYY,'#,##0_);(#,##0)','#,##0_);[Red](#,##0)','#,##0.00_);(#,##0.00)' + 40='#,##0.00_);[Red](#,##0.00)' + 41='_(* #,##0_);_(* \(#,##0\);_(* "-"_);_(@_)' + 42='_("$"* #,##0_);_("$"* \(#,##0\);_("$"* "-"_);_(@_)' + 43='_(* #,##0.00_);_(* \(#,##0.00\);_(* "-"??_);_(@_)' + 44='_("$"* #,##0.00_);_("$"* \(#,##0.00\);_("$"* "-"??_);_(@_)' + 45=mm:ss,[h]:mm:ss,mm:ss.0,##0.0E+0,@ + 50=M/D/YYYY,M/D/YYYY,M/D/YYYY,M/D/YYYY,M/D/YYYY + 55=M/D/YYYY,M/D/YYYY,M/D/YYYY,M/D/YYYY,0 + 60=0.00,'#,##0','#,##0.00','$#,##0_);($#,##0)','$#,##0_);[Red]($#,##0)' + 65='$#,##0.00_);($#,##0.00)','$#,##0.00_);[Red]($#,##0.00)',0%,0.00%,# ?/? + 70=# ??/??,M/D/YYYY,M/D/YYYY,D-MMM-YY,D-MMM + 75=MMM-YY,h:mm,h:mm:ss,M/D/YYYY h:mm,mm:ss + 80=[h]:mm:ss,mm:ss.0 +end + +constlist=CONSTVALUE-TYPE + 0=empty + 1=number + 2=string + 4=boolean + 16=error +end + +constlist=PIVOT-NAMELEN + default= + 0xFFFF=name-in-cache +end + +flagslist=FR-FLAGS + 0x0001=has-ref + 0x0002=alert-unsupported +end + +shortlist=EXTCOLOR-TYPE,0,auto,indexed,rgb,theme,n/a + +combilist=EXTCOLOR-FLAGS + 0x01=rgb-valid + 0xFE=uint8,dec,type,EXTCOLOR-TYPE +end + +shortlist=EXTGRADIENT-TYPE,0,linear,path + +shortlist=EXTFONT-SCHEME,-1,n/a,none,major,minor + +# DFF ------------------------------------------------------------------------ + +flagslist=DFF-CLIENTANCHOR-FLAGS + 0x0001=pos-locked + 0x0002=size-locked +end + +# formulas ------------------------------------------------------------------- + +multilist=BASETOKENS-BIFF2 + 0x00=,tExp,tTbl,tAdd,tSub,tMul,tDiv,tPower + 0x08=tConcat,tLT,tLE,tEQ,tGE,tGT,tNE,tIsect + 0x10=tList,tRange,tUplus,tUminus,tPercent,tParen,tMissArg,tStr + 0x18=,tAttr,tSheet,tEndSheet,tErr,tBool,tInt,tNum +end + +constlist=BASETOKENS-BIFF5 + include=BASETOKENS-BIFF2 + exclude=0x1A,0x1B +end + +constlist=BASETOKENS-BIFF8 + include=BASETOKENS-BIFF5 + 0x18=tNlr +end + +constlist=TOKENCLASSES + 0x20=R + 0x40=V + 0x60=A +end + +multilist=CLASSTOKENS-BIFF2 + 0x00=tArray,tFunc,tFuncVar,tName,tRef,tArea,tMemArea,tMemErr + 0x08=tMemNoMem,tMemFunc,tRefErr,tAreaErr,tRefN,tAreaN,tMemAreaN,tMemNoMemN + 0x18=tFuncCE +end + +constlist=CLASSTOKENS-BIFF4 + include=CLASSTOKENS-BIFF2 + exclude=0x18 +end + +multilist=CLASSTOKENS-BIFF5 + include=CLASSTOKENS-BIFF4 + 0x19=tNameX,tRef3d,tArea3d,tRefErr3d,tAreaErr3d +end + +combilist=FUNCID + 0x7FFF=uint16,dec,func-id + 0x8000=command +end + +combilist=PARAMCOUNT-CMD + 0x7F=uint8,dec,count + 0x80=prompt +end + +combilist=REFRELFLAGS + 0x3FFF=uint16,dec,value + 0x4000=col-rel + 0x8000=row-rel +end + +multilist=NLRTYPES + 0x00=,tNlrErr,tNlrRowR,tNlrColR,,,tNlrRowV,tNlrColV + 0x08=,,tNlrRange,tNlrSRange,tNlrSRowR,tNlrSColR,tNlrSRowV,tNlrSColV + 0x10=tNlrRangeErr,,,,,,, + 0x18=,,,,,tNlrSxName,, +end + +combilist=NLRADDFLAGS + 0x3FFFFFFF=uint32,dec,count + 0x80000000=rel +end + +flagslist=ATTRTYPES + 0x00=skip + 0x01=volatile + 0x02=if + 0x04=choose + 0x08=skip + 0x10=sum + 0x20=assign + 0x40=space +end + +shortlist=ATTRSPACETYPES,0,space-before-token,cr-before-token,space-before-open,cr-before-open,space-before-close,cr-before-close,leading-space + +# record names --------------------------------------------------------------- + +multilist=RECORD-NAMES-BIFF2 + # worksheet records + 0x0000=DIMENSION,BLANK,INTEGER,NUMBER,LABEL,BOOLERR,FORMULA,STRING + 0x0008=ROW,BOF,EOF,INDEX,CALCCOUNT,CALCMODE,PRECISION,REFMODE + 0x0010=DELTA,ITERATION,PROTECT,PASSWORD,HEADER,FOOTER,EXTERNCOUNT,EXTERNSHEET + 0x0018=DEFINEDNAME,WINDOWPROTECT,VERTICALPAGEBREAKS,HORIZONTALPAGEBREAKS,NOTE,SELECTION,FORMAT,BUILTINFMTCOUNT + 0x0020=COLUMNDEFAULT,ARRAY,DATEMODE,EXTERNALNAME,COLWIDTH,DEFAULTROWHEIGHT,LEFTMARGIN,RIGHTMARGIN + 0x0028=TOPMARGIN,BOTTOMMARGIN,PRINTHEADERS,PRINTGRIDLINES,,,,FILEPASS + 0x0030=,FONT,FONT2,PRINTSIZE,,INFOOPTS,DATATABLE,DATATABLE2 + 0x0038=WNDESK,,BEGINPREF,ENDPREF,CONTINUE,WINDOW1,WINDOW2, + 0x0040=BACKUP,PANE,CODEPAGE,XF,IXFE,EFONT,SHOWSCROLL,SHOWFORMULA + 0x0048=STATUSBAR,SHORTMENUS,DDEENABLED,AUTODEC,MENUKEY,PLS|ZOOM,MENUUND,MOVESEL + 0x0050=DCON,DCONREF,DCONNAME,,,DEFCOLWIDTH,, + # worksheet records new in BIFF3, but supported in BIFF2 streams + 0x0200=DIMENSION,BLANK,,NUMBER,LABEL,BOOLERR,, + 0x0208=,,,INDEX,,,, + 0x027E=RK + # BIFF5 style BOF + 0x0809=BOF + # chart records + 0x1000=,CHUNITS,CHCHART,CHSERIES,CHSOURCELINK,,CHDATAFORMAT,CHLINEFORMAT + 0x1008=,CHMARKERFORMAT,CHAREAFORMAT,CHPIEFORMAT,CHATTACHEDLABEL,CHSTRING,, + 0x1010=,,,,CHTYPEGROUP,CHLEGEND,CHSERIESLIST,CHBAR + 0x1018=CHLINE,CHPIE,CHAREA,CHSCATTER,CHCHARTLINE,CHAXIS,CHTICK,CHVALUERANGE + 0x1020=CHLABELRANGE,CHAXISLINE,CHFORMATLINK,,CHDEFAULTTEXT,CHTEXT,CHFONT,CHOBJECTLINK + 0x1028=,,,,,CHARROW,,CHARROWHEAD + 0x1030=,,CHFRAME,CHBEGIN,CHEND,CHPLOTFRAME,CHCHARTSIZE,CHRELPOSITION + 0x1038=CHARROWRELPOS,,CHCHART3D,,,,, +end + +multilist=RECORD-NAMES-BIFF3 + include=RECORD-NAMES-BIFF2 + # worksheet records + exclude=0x0006,0x0008,0x0009,0x000B,0x0018,0x0020,0x0023,0x0024,0x0025,0x0031,0x0036,0x0037,0x003E,0x0043,0x0044,0x0045 + 0x0050=,,,,,,BUILTINFMTCOUNT, + 0x0058=TOOLBAR,XCT,CRN,FILESHARING,WRITEACCESS,OBJ,UNCALCED,SAFERECALC + 0x0060=TEMPLATE,INTL,,OBJECTPROTECT,,,, + 0x0068=,,,,,,, + 0x0070=,,,,,,, + 0x0078=,,,,,COLINFO,,IMGDATA + 0x0080=GUTS,SHEETPR,GRIDSET,HCENTER,VCENTER,,WRITEPROT,ADDIN + 0x0088=EDG,PUB,NOTEOFF,LH,COUNTRY,HIDEOBJ,, + 0x0090=SORT,SUB,PALETTE,,LHRECORD,LHNGRAPH,, + 0x0200=,,,,,,FORMULA,STRING + 0x0208=ROW,BOF,,,,,, + 0x0218=DEFINEDNAME + 0x0221=ARRAY + 0x0223=EXTERNALNAME + 0x0225=DEFAULTROWHEIGHT + 0x0231=FONT + 0x0236=DATATABLE + 0x023E=WINDOW2 + 0x0243=XF + 0x0293=STYLE + # chart records + 0x103C=CHPICFORMAT +end + +multilist=RECORD-NAMES-BIFF4 + include=RECORD-NAMES-BIFF3 + # worksheet/workbook records + exclude=0x0206,0x0209,0x001E,0x0243 + 0x0085=SHEET + 0x0088=,,,,,,SHEETSOFFSET,SHEETHEADER + 0x0090=,,,,,,NOTESOUND,SYNC + 0x0098=LPR,STANDARDWIDTH,FNGROUPNAME,,FNGROUPCOUNT,,, + 0x00A0=SCL,PAGESETUP,FNPROTO,PROJEXTSHEET,,,, + 0x00A8=DRAGDROP,COORDLIST,,GCW,,,, + 0x0406=FORMULA + 0x0409=BOF + 0x041E=FORMAT + 0x0443=XF + # chart records + 0x1038=,,,CHMULTILINK,,CHDROPBAR,CHRADARLINE,CHSURFACE +end + +multilist=RECORD-NAMES-BIFF5 + include=RECORD-NAMES-BIFF4 + # worksheet/workbook records + exclude=0x0409,0x0218,0x0223,0x0231,0x0443 + 0x0006=FORMULA + 0x0018=DEFINEDNAME + 0x0023=EXTERNALNAME + 0x0031=FONT + 0x0098=,,,FILTERMODE,,AUTOFILTER,FILTERCOLUMN, + 0x00A8=,,,,,,SCENARIOS,SCENARIO + 0x00B0=PTDEFINITION,PTFIELD,PTFITEM,,PTROWCOLFIELDS,PTROWCOLITEMS,PTPAGEFIELDS, + 0x00B8=DOCROUTE,RECIPNAME,,,,MULTRK,MULTBLANK,TOOLBARHDR + 0x00C0=TOOLBAREND,MMS,ADDMENU,DELMENU,,PTDATAFIELD,PCDEFINITION,PCDFIELD + 0x00C8=PCITEM_INDEXLIST,PCITEM_DOUBLE,PCITEM_BOOL,PCITEM_ERROR,PCITEM_INTEGER,PCITEM_STRING,PCITEM_DATE,PCITEM_MISSING + 0x00D0=SXTBL,SXTBRGITEM,SXTBPG,VBAPROJECT,,PIVOTCACHE,RSTRING,DBCELL + 0x00D8=PCDFRANGEPR,PCDFDISCRETEPR,BOOKBOOL,REVERT,DBORPARAMQUERY,SCENPROTECT,OLESIZE,UDDESC + 0x00E0=XF,INTERFACEHDR,INTERFACEEND,PCDSOURCE,,,, + 0x0206=FORMULA + 0x04BC=SHAREDFMLA + # chart records + exclude=0x1004,0x102D,0x102F,0x1036,0x1037,0x1038,0x103B + 0x1040=CHRADARAREA,CHAXESSET,,CHLEGENDENTRY,CHPROPERTIES,CHSERGROUP,CHUSEDAXESSETS, + 0x1048=CHPIVOTRANGE,,CHSERPARENT,CHSERTRENDLINE,,,CHFORMAT,CHFRAMEPOS + 0x1050=CHFORMATRUNS,CHSOURCELINK,,,,,, + 0x1058=,,,CHSERERRORBAR,,CHSERIESFORMAT,, +end + +multilist=RECORD-NAMES-BIFF8 + include=RECORD-NAMES-BIFF5 + # worksheet/workbook records + 0x00E0=,,,,,CELLMERGING,, + 0x00E8=,IMGDATA,,MSODRAWINGGROUP,MSODRAWING,MSODRAWINGSELECTION,,PHONETICPR + 0x00F0=,PTDEFINITION2,,,,,, + 0x00F8=,PCDFORMULAFIELD,,,SST,LABELSST,,EXTSST + 0x0100=PTFIELD2,,,PCDFIELDINDEX,,,, + 0x0120=,,PCDEFINITION2,,,,, + 0x0130=,,,,,,,CHTRINSERT + 0x0138=CHTRINFO,,,CHTRCELLCONTENT,,TABID,, + 0x0140=CHTRMOVERANGE,,,,,,, + 0x0148=,,,,,CHTRINSERTTAB,, + 0x0158=,,,,,,,LABELRANGES + 0x0160=USESELFS,DSF,XL5MODIFY,,,,, + 0x0190=,,,,,,CHTRHEADER, + 0x01A8=,USERBVIEW,USERSVIEWBEGIN,USERSVIEWEND,,QUERYTABLE,EXTERNALBOOK,PROT4REV + 0x01B0=CFHEADER,CFRULE,DATAVALIDATIONS,,,DCONBINAME,TXO,REFRESHALL + 0x01B8=HYPERLINK,NLRDELNAME,CODENAME,PCDFSQLTYPE,PROT4REVPASS,VBAPROJECTEMPTY,DATAVALIDATION, + 0x01C0=XL9FILE,RECALCID,INTCACHEDDATA,,,,, + # future records + 0x0800=SCREENTIP,,QUERYTABLEREFRESH,QUERYTABLESETTINGS,QUERYTABLESTRING,,, + 0x0850=CHFRINFO,CHFRWRAPPER,CHFRBLOCKBEGIN,CHFRBLOCKEND,,,CHFRCATEGORYPROPS,CHFRUNITPROPS + 0x0858=CHPIVOTREF,CHPIVOTFLAGS,,,,,, + 0x0860=,,SHEETEXT,BOOKEXT,,,,SHAREDFEATHEAD + 0x0868=,,,CHFRLABELPROPS,,,, + 0x0870=,,,,,,CONNECTION, + 0x0878=,,CFRULE12,CFRULEEXT,XFCRC,XFEXT,FILTERCOLUMN12,CONTINUE12 + 0x0888=,,,PAGELAYOUTVIEW,CHECKCOMPAT,DXF,TABLESTYLES, + 0x0890=,,STYLEEXT,,,,THEME, + 0x0898=,,MTHREADSETTINGS,COMPRESSPICS,HEADERFOOTER,CHFRLAYOUT,CHFREXTPROPS,CHFREXTPROPSCONT + 0x08A0=,,,FORCEFULLCALC,CHFRSHAPEPROPS,CHFRTEXTPROPS,,CHFRPLOTAREALAYOUT + # chart records + 0x1058=,,,,,,,CH3DDATAFORMAT + 0x1060=CHFONTBASE,CHPIEEXT,CHDATERANGE,CHDATATABLE,CHPLOTGROWTH,CHSERINDEX,CHESCHERFORMAT,CHPIEEXTSETT +end + +# simple records ------------------------------------------------------------- + +constlist=SIMPLE-RECORDS-BIFF2 + 0x000C=uint16,dec,max-iterations + 0x000D=int16,dec,calc-mode,CALCMODE + 0x000E=uint16,bool,calc-precise + 0x000F=uint16,dec,ref-mode,REFMODE + 0x0010=double,dec,epsilon + 0x0011=uint16,bool,iterate-recursive + 0x0012=uint16,bool,contents-protected + 0x0013=uint16,hex,password-hash + 0x0016=uint16,dec,externsheets + 0x0019=uint16,bool,window-protected + 0x001F=uint16,dec,builtin-fmt-count + 0x0022=uint16,dec,null-date,DATEMODE + 0x0025=uint16,hex,rowheight-flags,DEFROWHEIGHT-FLAGS + 0x0026=double,dec,left-margin,CONV-INCH-TO-CM + 0x0027=double,dec,right-margin,CONV-INCH-TO-CM + 0x0028=double,dec,top-margin,CONV-INCH-TO-CM + 0x0029=double,dec,bottom-margin,CONV-INCH-TO-CM + 0x002A=uint16,bool,print-sheet-headers + 0x002B=uint16,bool,print-gridlines + 0x0040=uint16,bool,backup-on-save + 0x0044=uint16,dec,xf-idx + 0x0045=uint16,dec,font-color-idx,COLORS + 0x0055=uint16,dec,base-col-width + 0x100B=uint16,dec,extrusion,CONV-PERCENT + 0x100C=uint16,hex,flags,CHATTACHEDLABEL-FLAGS + 0x1018=uint16,hex,flags,CHLINE-FLAGS + 0x101A=uint16,hex,flags,CHAREA-FLAGS + 0x101C=uint16,dec,line-type,CHCHARTLINE-TYPE + 0x1021=uint16,dec,axisline-id,CHAXISLINE-ID + 0x1024=uint16,dec,text-idx + 0x1026=uint16,dec,font-idx,FONTNAMES + 0x1045=uint16,dec,group-idx + 0x1046=uint16,dec,used-axessets + 0x104A=uint16,dec,series-idx + 0x104E=uint16,dec,fmt-idx,FORMATS +end + +constlist=SIMPLE-RECORDS-BIFF3 + include=SIMPLE-RECORDS-BIFF2 + 0x0056=uint16,dec,builtin-fmt-count + 0x005E=uint16,unused + 0x005F=uint16,bool,recalc-on-save + 0x0063=uint16,bool,objects-protected + 0x0081=uint16,hex,flags,SHEETPR-FLAGS + 0x0082=uint16,bool,print-gridlines-changed + 0x0083=uint16,bool,horizontal-centered + 0x0084=uint16,bool,vertical-centered + 0x008D=uint16,dec,object-mode,HIDEOBJ +end + +constlist=SIMPLE-RECORDS-BIFF4 + include=SIMPLE-RECORDS-BIFF3 + 0x008E=uint32,hex,stream-pos,CONV-DEC + 0x0099=uint16,dec,default-col-width,CONV-COLWIDTH + 0x009C=uint16,dec,func-group-count + 0x103D=uint16,dec,bar-dist + 0x103E=uint16,hex,flags,CHRADAR-FLAGS + 0x103F=uint16,hex,flags,CHSURFACE-FLAGS +end + +constlist=SIMPLE-RECORDS-BIFF5 + include=SIMPLE-RECORDS-BIFF4 + 0x009D=uint16,dec,column-count + 0x00C9=double,dec,value + 0x00CA=uint16,bool,value + 0x00CB=uint16,hex,error-code,ERRORCODES + 0x00CC=int16,dec,value + 0x00D5=uint16,hex,cache-id + 0x00D8=uint16,hex,flags,PCDFRANGEPR-FLAGS + 0x00DA=uint16,bool,strip-cached-values + 0x00DD=uint16,bool,scenarios-protected + 0x00E3=uint16,dec,source-type,PCDSOURCE-TYPE + 0x1040=uint16,hex,flags,CHRADAR-FLAGS + 0x105D=uint16,hex,flags,CHSERIESFORMAT-FLAGS +end + +constlist=SIMPLE-RECORDS-BIFF8 + include=SIMPLE-RECORDS-BIFF5 + 0x00E1=uint16,dec,codepage,CODEPAGES + 0x0160=uint16,bool,use-nat-lang-refs + 0x0161=uint16,bool,double-stream + 0x01AF=uint16,bool,revlog-protected + 0x01B7=uint16,bool,refresh-all + 0x01BB=uint16,dec,sql-data-type,PCDFSQLTYPE-DATATYPE + 0x01BC=uint16,hex,password-hash + 0x1065=uint16,dec,series-idx +end + +# ARRAY ---------------------------------------------------------------------- + +flagslist=ARRAY-FLAGS-BIFF2 + 0x0001=recalc-always +end + +flagslist=ARRAY-FLAGS-BIFF3 + include=ARRAY-FLAGS-BIFF2 + 0x0002=recalc-onload +end + +# BOF ------------------------------------------------------------------------ + +constlist=BOF-BIFFTYPE + 0x0000=from-id + 0x0007=biff2 + 0x0200=biff2 + 0x0300=biff3 + 0x0400=biff4 + 0x0500=biff5 + 0x0600=biff8 +end + +constlist=BOF-SHEETTYPE + 0x0005=globals + 0x0006=vb-module + 0x0010=sheet + 0x0020=chart + 0x0040=macro + 0x0100=workspace +end + +shortlist=BOF-EXCELVERSION,0,excel-97,excel-2000,excel-2002,excel-2003,excel-2007,,excel-2010 +shortlist=BOF-LOWESTVERSION-BIFF,6,biff8 + +combilist=BOF-HISTORY-FLAGS + ignore=0x000000C0 + 0x00000001=windows + 0x00000002=risc + 0x00000004=beta + 0x00000008=win-any + 0x00000010=mac-any + 0x00000020=beta-any + 0x00000100=risc-any + 0x00000200=out-of-mem + 0x00000400=out-of-mem-renderer + 0x00002000=font-limit-255 + 0x0003C000=uint8,dec,max-version-saved,BOF-EXCELVERSION +end + +combilist=BOF-LOWESTVERSION-FLAGS + 0x000000FF=uint8,dec,biff-version,BOF-LOWESTVERSION-BIFF + 0x00000F00=uint8,dec,version-saved,BOF-EXCELVERSION +end + +# BOOKEXT -------------------------------------------------------------------- + +combilist=BOOKEXT-FLAGS1 + 0x00000001=no-auto-recover + 0x00000002=hide-pivot-list + 0x00000004=filter-privacy + 0x00000008=embed-smarttags + 0x00000030=uint8,dec,display-smarttags,BOOKEXT-DISPLAY-SMARTTAGS + 0x00000040=saved-on-recovery + 0x00000080=minimal-save + 0x00000100=opened-on-recovery + 0x00000200=opened-in-save-mode +end + +shortlist=BOOKEXT-DISPLAY-SMARTTAGS,0,button-and-indicator,button,nothing + +flagslist=BOOKEXT-FLAGS2 + 0x01=warn-smart-doc-manifest + 0x02=show-inc-annotations +end + +flagslist=BOOKEXT-FLAGS3 + 0x02=!all-published!selected-items-published + 0x04=show-pivot-chart-filter +end + +# CALCMODE ------------------------------------------------------------------- + +shortlist=CALCMODE,-1,automatic-no-table,manual,automatic + +# CFHEADER ------------------------------------------------------------------- + +combilist=CFHEADER-FLAGS + 0x0001=complex + 0xFFFE=uint16,dec,id +end + +# CFRULE --------------------------------------------------------------------- + +shortlist=CFRULE-TYPE,1,value,formula +shortlist=CFRULE-OPERATOR,0,none,between,not-between,equal,not-equal,greater-than,less-than,greater-equal,less-equal + +flagslist=CFRULE-FLAGS1 + ignore=0x00200000 + 0x00000001=!hor-align-used + 0x00000002=!vert-align-used + 0x00000004=!text-wrap-used + 0x00000008=!rotation-used + 0x00000010=!justify-lastline-used + 0x00000020=!indent-used + 0x00000040=!shrinktofit-used + 0x00000080=!cell-merged-used + 0x00000100=!cell-locked-used + 0x00000200=!cell-hidden-used + 0x00000400=!left-border-used + 0x00000800=!right-border-used + 0x00001000=!top-border-used + 0x00002000=!bottom-border-used + 0x00004000=!tl-to-br-used + 0x00008000=!bl-to-tr-used + 0x00010000=!fill-pattern-used + 0x00020000=!fg-color-idx-used + 0x00040000=!bg-color-idx-used + 0x00080000=!fmt-idx-used + 0x00100000=!def-font-used + 0x02000000=numfmt-block + 0x04000000=font-block + 0x08000000=alignment-block + 0x10000000=border-block + 0x20000000=pattern-block + 0x40000000=protection-block + 0x80000000=!text-dir-used +end + +flagslist=CFRULE-FLAGS2 + ignore=0x0002 + 0x0001=!numfmt-id!numfmt-string + 0x0004=outline-border + 0x8000=use-text-dir +end + +combilist=CFRULE-ALIGNMENT + 0x07=uint8,dec,hor-align,XF-HORALIGN + 0x08=text-wrap + 0x70=uint8,dec,ver-align,XF-VERALIGN + 0x80=justify-lastline +end + +combilist=CFRULE-INDENT + 0x000F=uint8,dec,indent + 0x0010=shrink-to-fit + 0x0020=cell-merged + 0x00C0=uint8,dec,text-dir,XF-TEXTDIRECTION +end + +flagslist=CFRULE-FONTFLAGS + 0x00000002=italic + 0x00000008=outline + 0x00000010=shadow + 0x00000020=condense + 0x00000040=extend + 0x00000080=strikeout +end + +constlist=CFRULE-FONTWEIGHT + include=FONT-WEIGHT + -1=unused +end + +constlist=CFRULE-FONTESCAPEMENT + include=FONT-ESCAPEMENT + -1=unused +end + +constlist=CFRULE-FONTUNDERLINE + include=FONT-UNDERLINE + -1=unused +end + +constlist=CFRULE-FONTCOLOR + include=COLORS-BIFF8 + -1=unused +end + +flagslist=CFRULE-FONTUSEDFLAGS + ignore=0xFFFFFF00 + 0x00000002=!italic-used + 0x00000008=!outline-used + 0x00000010=!shadow-used + 0x00000020=!condense-used + 0x00000040=!extend-used + 0x00000080=!strikeout-used +end + +constlist=CFRULE-FONTUSED + 0=used + 1=not-used +end + +combilist=CFRULE-BORDERCOLOR2 + 0x0000007F=uint8,dec,top-color,COLORS + 0x00003F80=uint8,dec,bottom-color,COLORS + 0x001FC000=uint8,dec,diag-color,COLORS + 0x01E00000=uint8,dec,diag-style,BORDERSTYLES +end + +combilist=CFRULE-FILLBLOCK + 0x0000FC00=uint8,dec,fill-pattern,FILLPATTERNS + 0x007F0000=uint8,dec,fg-color-idx,COLORS + 0x3F800000=uint8,dec,bg-color-idx,COLORS +end + +flagslist=CFRULE-PROTECTION-FLAGS + 0x0001=locked + 0x0002=formula-hidden +end + +# CFRULE12 ------------------------------------------------------------------- + +shortlist=CFRULE12-TYPE,1,cell-is,expression,color-scale,data-bar,top-ten,icon-set + +flagslist=CFRULE12-FLAGS + 0x0002=stop-if-true +end + +multilist=CFRULE12-SUBTYPE + 0=cell-is,expression,color-scale,data-bar,icon-set,top-ten,,unique-values,contains-text,contains-blanks + 10=not-contains-blanks,contains-errors,not-contains-errors,,,today,tomorrow,yesterday,last-7-days,last-month + 20=next-month,this-week,next-week,last-week,this-month,above-average,below-average,duplicate-values,,equal-above-average + 30=equal-below-average +end + +flagslist=CFRULE12-TOP10-FLAGS + 0x01=!bottom!top + 0x02=percent +end + +shortlist=CFRULE12-TEXT-OPERATOR,0,contains,not-contains,begins-with,ends-with +shortlist=CFRULE12-DATE-OPERATOR,0,today,yesterday,last-7-days,this-week,last-week,last-month,tomorrow,next-week,next-month,this-month + +# CFRULEEXT ------------------------------------------------------------------ + +flagslist=CFRULEEXT-FLAGS + 0x0001=active + 0x0002=stop-if-true +end + +# CH3DDATAFORMAT ------------------------------------------------------------- + +shortlist=CH3DDATAFORMAT-BASE,0,rectangular,circular +shortlist=CH3DDATAFORMAT-TOP,0,straight,sharp,trunc + +# CHAREA --------------------------------------------------------------------- + +flagslist=CHAREA-FLAGS + 0x0001=stacked + 0x0002=percent + 0x0004=shadow +end + +# CHAREAFORMAT --------------------------------------------------------------- + +flagslist=CHAREAFORMAT-FLAGS + 0x0001=auto + 0x0002=swap-negative +end + +# CHATTACHEDLABEL ------------------------------------------------------------ + +flagslist=CHATTACHEDLABEL-FLAGS + 0x0001=show-value + 0x0002=show-percent + 0x0004=show-categ-percent + 0x0008=smoothed + 0x0010=show-categ + 0x0020=show-bubble +end + +# CHAXESSET ------------------------------------------------------------------ + +shortlist=CHAXESSET-ID,0,primary,secondary + +# CHAXIS --------------------------------------------------------------------- + +shortlist=CHAXIS-TYPE,0,x-axis,y-axis,z-axis + +# CHAXISLINE ----------------------------------------------------------------- + +shortlist=CHAXISLINE-ID,0,axisline,major-grid,minor-grid,wall + +# CHBAR ---------------------------------------------------------------------- + +flagslist=CHBAR-FLAGS + 0x0001=horizontal + 0x0002=stacked + 0x0004=percent + 0x0008=shadow +end + +# CHCHART3D ------------------------------------------------------------------ + +flagslist=CHCHART3D-FLAGS + ignore=0x0010 + 0x0001=real3d + 0x0002=clustered + 0x0004=auto-height + 0x0020=2d-plotarea +end + +# CHTYPEGROUP ---------------------------------------------------------------- + +flagslist=CHTYPEGROUP-FLAGS + 0x0001=varied-colors +end + +# CHCHARTLINE ---------------------------------------------------------------- + +shortlist=CHCHARTLINE-TYPE,0,drop-line,hi-lo-line,series-connector + +# CHDATAFORMAT --------------------------------------------------------------- + +constlist=CHDATAFORMAT-POINTIDX + default= + -1=all-points +end + +constlist=CHDATAFORMAT-FORMATIDX + default= + -3=axesset-global +end + +flagslist=CHDATAFORMAT-FLAGS + 0x0001=excel4-colors +end + +# CHDATERANGE ---------------------------------------------------------------- + +shortlist=CHDATERANGE-UNIT,0,days,months,years + +flagslist=CHDATERANGE-FLAGS + 0x0001=auto-minimum + 0x0002=auto-maximum + 0x0004=auto-major + 0x0008=auto-minor + 0x0010=date-axis + 0x0020=auto-base + 0x0040=auto-axis-cross + 0x0080=auto-date +end + +# CHFRAME -------------------------------------------------------------------- + +shortlist=CHFRAME-FORMAT,0,standard,,,,shadow + +flagslist=CHFRAME-FLAGS + 0x0001=auto-size + 0x0002=auto-pos +end + +# CHFRAMEPOS ----------------------------------------------------------------- + +shortlist=CHFRAMEPOS-POSMODE,0,rel-points,abssize-points,parent-dependent,offset-plotarea-size,,chartsize + +# CHFRBLOCKBEGIN, CHFRBLOCKEND ----------------------------------------------- + +shortlist=CHFRBLOCK-TYPE,0,axes-set,,text,,axis,type-group,data-table,frame,,legend,legend-exception,,series,chart,data-format,drop-bar + +# CHFRCATEGORYPROPS ---------------------------------------------------------- + +shortlist=CHFRCATEGORYPROPS-ALIGN,1,top-left,center,bottom-right + +flagslist=CHFRCATEGORYPROPS-FLAGS + ignore=0xFFFE + 0x0001=auto-label-frequency +end + +# CHFREXTPROPS --------------------------------------------------------------- + +constlist=CHFREXTPROPS-PARENT + 0x0001=log-scaling + 0x0002=style + 0x0004=category-scaling + 0x0005=chart-props + 0x000F=legend + 0x0013=marker + 0x0016=plot-area + 0x0019=chart-title + 0x0037=3d-props +end + +constlist=CHFREXTPROPS-TYPE + 0=start + 1=end + 2=bool + 3=double + 4=int32 + 5=string + 6=uint16 + 7=blob +end + +constlist=CHFREXTPROPS-TAG + 0x0000=log-base + 0x0003=style + 0x001E=chart-formatting + 0x0020=text-formatting + 0x0022=symbol-type + 0x002E=no-multi-level + 0x002F=overlay + 0x0033=theme-override + 0x0034=color-mapping-override + 0x0035=backwall-thickness + 0x0036=floor-thickness + 0x004D=perspective + 0x004E=rotation-x + 0x004F=rotation-y + 0x0050=right-angled-axes-off + 0x0052=tick-mark-skip + 0x0051=tick-label-skip + 0x0053=major-unit + 0x0054=minor-unit + 0x0055=max + 0x0056=min + 0x0059=side-wall + 0x005B=show-data-labels-over-max + 0x005C=tick-label-pos + 0x005E=pie-combination + 0x005F=basetime-unit + 0x0064=format-code + 0x0065=height-percent + 0x0066=display-blanks-as + 0x006A=major-unit-type + 0x006B=minor-unit-type + 0x0076=edit-language +end + +constlist=CHFREXTPROPS-TAG-NAMELIST + default= + 0x0022=CHFREXTPROPS-SYMBOLTYPE + 0x0035=CONV-PERCENT + 0x0036=CONV-PERCENT + 0x004E=CONV-DEG + 0x004F=CONV-DEG + 0x005C=CHFREXTPROPS-TICKLABELPOS + 0x005F=CHFREXTPROPS-TIMEUNIT + 0x0065=CONV-PERCENT + 0x0066=CHFREXTPROPS-DISPBLANKSAS + 0x006A=CHFREXTPROPS-TIMEUNIT + 0x006B=CHFREXTPROPS-TIMEUNIT +end + +shortlist=CHFREXTPROPS-DISPBLANKSAS,0x0067,gap,,spanned +shortlist=CHFREXTPROPS-SYMBOLTYPE,0x0023,none,diamond,square,triangle,x,star,dot,dash,circle,plus +shortlist=CHFREXTPROPS-TICKLABELPOS,0x005D,center +shortlist=CHFREXTPROPS-TIMEUNIT,0x0060,days,months,years + +# CHFRINFO ------------------------------------------------------------------- + +shortlist=CHFRINFO-APPVERSION,9,excel-2000,excel-xp-2003,,excel-2007 + +# CHFRLABELPROPS ------------------------------------------------------------- + +flagslist=CHFRLABELPROPS-FLAGS + 0x0001=show-series + 0x0002=show-categ + 0x0004=show-value + 0x0008=show-percent + 0x0010=show-bubble +end + +# CHFRLAYOUT ----------------------------------------------------------------- + +combilist=CHFRLAYOUT-FLAGS + 0x001E=uint8,dec,legend-pos,CHFRLAYOUT-LEGENDPOS +end + +shortlist=CHFRLAYOUT-LEGENDPOS,0,bottom,top-right,top,right,left + +shortlist=CHFRLAYOUT-MODE,0,auto,factor,edge + +# CHFRPLOTAREALAYOUT --------------------------------------------------------- + +flagslist=CHFRPLOTAREALAYOUT-FLAGS + 0x0001=!outer!inner +end + +shortlist=CHFRLAYOUT-LEGENDPOS,0,bottom,top-right,top,right,left + +shortlist=CHFRLAYOUT-MODE,0,auto,factor,edge + +# CHFRUNITPROPS -------------------------------------------------------------- + +shortlist=CHFRUNITPROPS-PRESET,-1,manual,none,hundred,thousand,10000,100000,million,10-million,100-million,billion,trillion + +flagslist=CHFRUNITPROPS-FLAGS + 0x0002=show-unit +end + +# CHLABELRANGE --------------------------------------------------------------- + +flagslist=CHLABELRANGE-FLAGS + 0x0001=cross-between-categ + 0x0002=maximum-axis-cross + 0x0004=reverse-order +end + +# CHLEGEND ------------------------------------------------------------------- + +shortlist=CHLEGEND-DOCKPOS,0,bottom,top-right,top,right,left,,,manual +shortlist=CHLEGEND-SPACING,0,close,medium,open + +flagslist=CHLEGEND-FLAGS + 0x0001=docked + 0x0002=auto-series + 0x0004=auto-pos-x + 0x0008=auto-pos-y + 0x0010=stacked + 0x0020=data-table +end + +# CHLINE --------------------------------------------------------------------- + +flagslist=CHLINE-FLAGS + 0x0001=stacked + 0x0002=percent + 0x0004=shadow +end + +# CHLINEFORMAT --------------------------------------------------------------- + +shortlist=CHLINEFORMAT-LINETYPE,0,solid,dash,dot,dash-dot,dash-dot-dot,none,25%-pattern,50%-pattern,75%-pattern +shortlist=CHLINEFORMAT-LINEWEIGHT,-1,hair,thin,medium,thick + +flagslist=CHLINEFORMAT-FLAGS + 0x0001=auto + 0x0004=axis-enabled + 0x0008=system-color +end + +# CHMARKERFORMAT ------------------------------------------------------------- + +shortlist=CHMARKERFORMAT-TYPE,0,none,square,diamond,triangle,cross,star,dow-jones,std-dev,circle,plus + +flagslist=CHMARKERFORMAT-FLAGS + 0x0001=auto + 0x0010=no-fill + 0x0020=no-border +end + +# CHOBJECTLINK --------------------------------------------------------------- + +shortlist=CHOBJECTLINK-TARGET,0,none,title,y-axis,x-axis,datapoint,legend,none,z-axis,,,,,axis-unit + +constlist=CHOBJECTLINK-POINT + default= + -2=unknown + -1=all-points +end + +# CHPICFORMAT ---------------------------------------------------------------- + +shortlist=CHPICFORMAT-BITMAP-MODE,1,stretched,stacked,stacked-scaled + +combilist=CHPICFORMAT-FLAGS + 0x0200=top-bottom + 0x0400=front-back + 0x0800=left-right +end + +# CHPIE ---------------------------------------------------------------------- + +flagslist=CHPIE-FLAGS + 0x0001=shadow + 0x0002=connectors +end + +# CHPIVOTFLAGS --------------------------------------------------------------- + +flagslist=CHPIVOTFLAGS-FLAGS + 0x0001=hide-field-captions +end + +# CHRADAR, CHRADARAREA ------------------------------------------------------- + +flagslist=CHRADAR-FLAGS + 0x0001=axis-labels + 0x0002=shadow +end + +# CHPROPERTIES --------------------------------------------------------------- + +shortlist=CHPROPERTIES-EMPTYCELLS,0,do-not-plot,as-zero,interpolated + +flagslist=CHPROPERTIES-FLAGS + 0x0001=manual-series + 0x0002=plot-visible-only + 0x0004=fixed-size + 0x0008=manual-plotarea + 0x0010=apply-plotarea-pos +end + +# CHSCATTER ------------------------------------------------------------------ + +shortlist=CHSCATTER-SIZETYPE,0,none,area,width + +flagslist=CHSCATTER-FLAGS + 0x0001=bubbles + 0x0002=show-negative + 0x0004=shadow +end + +# CHSERERRORBAR -------------------------------------------------------------- + +shortlist=CHSERERRORBAR-TYPE,1,x-plus,x-minus,y-plus,y-minus +shortlist=CHSERERRORBAR-SOURCE,1,percent,fixed,std-deviation,custom,std-error + +# CHSERIES ------------------------------------------------------------------- + +shortlist=CHSERIES-TYPE,0,date,numeric,sequence,text + +# CHSERIESFORMAT ------------------------------------------------------------- + +flagslist=CHSERIESFORMAT-FLAGS + 0x0001=spline + 0x0002=bubbles-3d + 0x0004=shadow +end + +# CHSERTRENDLINE ------------------------------------------------------------- + +shortlist=CHSERTRENDLINE-TYPE,0,polynomial,exponential,logarithmic,power,moving-average + +# CHSOURCELINK --------------------------------------------------------------- + +shortlist=CHSOURCELINK-TARGET,0,title,values,category,bubbles +shortlist=CHSOURCELINK-TYPE,0,default,constant,sheet-link + +flagslist=CHSOURCELINK-FLAGS + 0x0001=custom-numfmt +end + +# CHSTRING ------------------------------------------------------------------- + +shortlist=CHSTRING-TYPE,0,text,category-default,value-default,x-prefix,x-postfix,y-prefix,y-postfix,comment + +# CHSURFACE ------------------------------------------------------------------ + +flagslist=CHSURFACE-FLAGS + 0x0001=filled + 0x0002=shadow +end + +# CHTEXT --------------------------------------------------------------------- + +shortlist=CHTEXT-HORALIGN,1,left,center,right,block,distribute +shortlist=CHTEXT-VERALIGN,1,top,center,bottom,block,distribute +shortlist=CHTEXT-FILLMODE,1,transparent,opaque + +flagslist=CHTEXT-FLAGS1-BIFF2 + 0x0001=auto-color + 0x0002=show-symbol + 0x0004=show-value + 0x0008=vertical + 0x0010=auto-text + 0x0020=default-format + 0x0040=deleted + 0x0080=auto-fill +end + +combilist=CHTEXT-FLAGS1-BIFF3 + include=CHTEXT-FLAGS1-BIFF2 + 0x0700=uint8,dec,orientation,TEXTORIENTATION +end + +combilist=CHTEXT-FLAGS1-BIFF5 + include=CHTEXT-FLAGS1-BIFF3 + 0x0800=show-categ-percent + 0x1000=show-percent +end + +combilist=CHTEXT-FLAGS1-BIFF8 + include=CHTEXT-FLAGS1-BIFF5 + 0x2000=show-bubble-size + 0x4000=show-categ +end + +combilist=CHTEXT-FLAGS2 + ignore=0x3FF0 + 0x000F=uint8,dec,placement,CHTEXT-PLACEMENT + 0xC000=uint8,dec,text-dir,XF-TEXTDIRECTION +end + +shortlist=CHTEXT-PLACEMENT,0,context,outside,inside,center,axis,above,below,left,right,auto,manual + +# CHTICK --------------------------------------------------------------------- + +shortlist=CHTICK-TYPE,0,none,inside,outside,both +# TODO: really different label positions in BIFF2-BIFF4? +shortlist=CHTICK-LABELPOS-BIFF2,0,none,near,below,above +shortlist=CHTICK-LABELPOS-BIFF5,0,none,below,above,near + +flagslist=CHTICK-FLAGS-BIFF2 + 0x0001=auto-color + 0x0002=auto-fill +end + +combilist=CHTICK-FLAGS-BIFF3 + include=CHTICK-FLAGS-BIFF2 + 0x001C=uint8,dec,orientation,TEXTORIENTATION + 0x0020=auto-rotation +end + +# CHVALUERANGE --------------------------------------------------------------- + +flagslist=CHVALUERANGE-FLAGS + ignore=0x0100 + 0x0001=auto-minimum + 0x0002=auto-maximum + 0x0004=auto-major + 0x0008=auto-minor + 0x0010=auto-axis-cross + 0x0020=logarithmic + 0x0040=reverse-order + 0x0080=maximum-axis-cross +end + +# COLINFO -------------------------------------------------------------------- + +combilist=COLINFO-FLAGS + 0x0001=hidden + 0x0002=custom-width + 0x0004=best-fit + 0x0008=show-phonetic + 0x0700=uint8,dec,outline-level + 0x1000=outline-collapsed +end + +# CONNECTION ----------------------------------------------------------------- + +shortlist=CONNECTION-SOURCETYPE,1,odbc,dao,file,html,ole-db,text,ado,dsp + +flagslist=CONNECTION-FLAGS + 0x0001=save-password + 0x0002=html-tables + 0x0004=table-names + 0x0008=deleted + 0x0010=stand-alone + 0x0020=only-use-conn-file + 0x0040=background + 0x0080=refresh-on-load + 0x0100=save-data +end + +shortlist=CONNECTION-RECONNECTTYPE,0,as-required,always,never +shortlist=CONNECTION-CREDENTIALS,0,integrated,none,stored-sso,prompt +shortlist=CONNECTION-LINKEDOBJECTTYPE,0,none,query-table,pivot-cache + +# DATATABLE ------------------------------------------------------------------ + +flagslist=DATATABLE-FLAGS-BIFF3 + 0x0001=recalc-always + 0x0002=recalc-on-load + 0x0004=row-table + 0x0008=table-2d +end + +flagslist=DATATABLE-FLAGS-BIFF8 + include=DATATABLE-FLAGS-BIFF3 + 0x0010=ref1-deleted + 0x0020=ref2-deleted +end + +# DATAVALIDATION ------------------------------------------------------------- + +combilist=DATAVALIDATION-FLAGS + 0x0000000F=uint8,dec,type,DATAVALIDATION-TYPE + 0x00000070=uint8,dec,error-style,DATAVALIDATION-ERRORSTYLE + 0x00000080=string-list + 0x00000100=ignore-empty + 0x00000200=no-dropdown + 0x00040000=show-input-box + 0x00080000=show-error-box + 0x00F00000=uint8,dec,operator,DATAVALIDATION-OPERATOR +end + +shortlist=DATAVALIDATION-TYPE,0,any,whole,decimal,list,date,time,text-length,custom +shortlist=DATAVALIDATION-OPERATOR,0,between,not-between,equal,not-equal,greater-than,less-than,greater-equal,less-equal +shortlist=DATAVALIDATION-ERRORSTYLE,0,error,warning,info + +# DATAVALIDATIONS ------------------------------------------------------------ + +flagslist=DATAVALIDATIONS-FLAGS + 0x0001=input-box-visible + 0x0002=input-box-at-cell + 0x0004=cached +end + +# DATEMODE ------------------------------------------------------------------- + +shortlist=DATEMODE,0,1899-12-31,1904-01-01 + +# DBQUERY -------------------------------------------------------------------- + +combilist=DBQUERY-FLAGS + 0x0007=uint8,dec,source-type,CONNECTION-SOURCETYPE + 0x0008=odbc-connection + 0x0010=sql-query + 0x0020=server-sql + 0x0040=html-query + 0x0080=save-password + 0x0100=html-tables +end + +# DEFINEDNAME ---------------------------------------------------------------- + +flagslist=DEFINEDNAME-FLAGS-BIFF2 + 0x02=macro + 0x04=complex +end + +shortlist=DEFINEDNAME-MACROTYPE-BIFF2,0,none,function,procedure + +flagslist=DEFINEDNAME-FLAGS-BIFF3 + 0x0001=hidden + 0x0002=function + 0x0004=command + 0x0008=macro + 0x0010=complex + 0x0020=builtin +end + +shortlist=DEFINEDNAME-BUILTINID,0,consolidate-area,auto-open,auto-close,extract,database,criteria,print-area,print-titles,recorder,data-form,auto-activate,auto-deactivate,sheet-title,filterdatabase + +combilist=DEFINEDNAME-FLAGS-BIFF4 + include=DEFINEDNAME-FLAGS-BIFF3 + 0x0FC0=uint16,dec,func-group,DEFINEDNAME-FUNCGROUP +end + +combilist=DEFINEDNAME-FLAGS-BIFF5 + include=DEFINEDNAME-FLAGS-BIFF4 + 0x0004=vba + 0x1000=binary +end + +shortlist=DEFINEDNAME-FUNCGROUP,0,none,financial,date-time,math-trig,statistical,lookup-ref,database,text,logical,information,commands,customizing,macro-control,dde-external,user-definded + +constlist=DEFINEDNAME-SHEETIDX + default= + 0=global +end + +# DEFROWHEIGHT --------------------------------------------------------------- + +combilist=DEFROWHEIGHT-FLAGS-BIFF2 + 0x7FFF=uint16,dec,row-height,CONV-TWIP-TO-PT + 0x8000=unchanged +end + +flagslist=DEFROWHEIGHT-FLAGS-BIFF3 + 0x0001=custom-height + 0x0002=hidden + 0x0004=thick-top + 0x0008=thick-bottom +end + +# DXF ------------------------------------------------------------------------ + +flagslist=DXF-FLAGS + 0x0001=!swap-fg-bg-color + 0x0002=use-internal-borders +end + +multilist=DXF-SUBREC + 0=FILL-PATTERN,FILL-FGCOLOR,FILL-BGCOLOR,FILL-GRADIENT,FILL-STOP + 5=FONT-COLOR,BORDER-TOP,BORDER-BOTTOM,BORDER-LEFT,BORDER-RIGHT + 10=BORDER-DIAGONAL,BORDER-VERTICAL,BORDER-HORIZONTAL,BORDER-DIAGUP,BORDER-DIAGDOWN + 15=ALIGN-HORIZONTAL,ALIGN-VERTICAL,ALIGN-ROTATION,ALIGN-INDENT,ALIGN-READINGORDER + 20=ALIGN-WRAPTEXT,ALIGN-JUSTLASTLINE,ALIGN-SHRINKTOFIT,ALIGN-MERGED,FONT-NAME + 25=FONT-WEIGHT,FONT-UNDERLINE,FONT-ESCAPEMENT,FONT-ITALIC,FONT-STRIKE + 30=FONT-OUTLINE,FONT-SHADOW,FONT-CONDENSE,FONT-EXTEND,FONT-CHARSET + 35=FONT-PITCHFAMILY,FONT-HEIGHT,FONT-SCHEME,NUMFMT-CODE, + 40=,NUMFMT-ID,ALIGN-RELINDENT,PROT-LOCKED,PROT-HIDDEN +end + +# EXTERNALBOOK --------------------------------------------------------------- + +constlist=EXTERNALBOOK-KEY + 0x0401=self-reference + 0x3A01=analysis-addin +end + +# EXTERNALNAME --------------------------------------------------------------- + +flagslist=EXTERNALNAME-FLAGS-BIFF3 + 0x0001=builtin + 0x0002=automatic + 0x0004=pic-link + 0x0008=dde-stddocumentname +end + +combilist=EXTERNALNAME-FLAGS-BIFF5 + include=EXTERNALNAME-FLAGS-BIFF3 + 0x0010=ole-link + 0x7FE0=uint16,dec,clipboard-format + 0x8000=iconified +end + +# EXTERNSHEET ---------------------------------------------------------------- + +constlist=EXTERNSHEET-IDX-BIFF8 + default= + -1=deleted + -2=special +end + +# FILEPASS ------------------------------------------------------------------- + +shortlist=FILEPASS-TYPE,0,xor,rc4 +shortlist=FILEPASS-MAJOR,1,rc4,crypto-api-2003,crypto-api-2007 + +# FILTERCOLUMN --------------------------------------------------------------- + +combilist=FILTERCOLUMN-FLAGS + 0x0001=!and!or + 0x0004=op-1-simple + 0x0008=op-2-simple + 0x0010=top-10 + 0x0020=!bottom!top + 0x0040=percent + 0xFF80=uint16,dec,top-10-count +end + +constlist=FILTERCOLUMN-DATATYPE + 0=none + 2=rk + 4=double + 6=string + 8=boolean + 12=blank + 14=not-blank +end + +shortlist=FILTERCOLUMN-OPERATOR,0,none,less,equal,less-equal,greater,not-equal,greater-equal + +# FONT ----------------------------------------------------------------------- + +flagslist=FONT-FLAGS + 0x0001=bold + 0x0002=italic + 0x0004=underline + 0x0008=strikeout + 0x0010=outline + 0x0020=shadow + 0x0040=condense + 0x0080=extend +end + +multilist=FONT-UNDERLINE + 0x00=none,single,double + 0x21=single-acc,double-acc +end + +shortlist=FONT-ESCAPEMENT,0,none,superscript,subscript + +# FORMULA -------------------------------------------------------------------- + +flagslist=FORMULA-FLAGS-BIFF2 + 0x0001=recalc-always +end + +flagslist=FORMULA-FLAGS-BIFF3 + include=FORMULA-FLAGS-BIFF2 + 0x0002=recalc-onload +end + +flagslist=FORMULA-FLAGS-BIFF5 + include=FORMULA-FLAGS-BIFF3 + 0x0008=shared-fmla +end + +shortlist=FORMULA-RESULTTYPE,0,string,boolean,error,empty + +# GUTS ----------------------------------------------------------------------- + +shortlist=GUTS-LEVELS,0,none,,1-level,2-levels,3-levels,4-levels,5-levels,6-levels,7-levels + +# HEADERFOOTER --------------------------------------------------------------- + +flagslist=HEADERFOOTER-FLAGS + ignore=0xFFF0 + 0x0001=has-even-hf + 0x0002=has-first-hf + 0x0004=scale-with-sheet + 0x0008=align-with-margins +end + +# HIDEOBJ -------------------------------------------------------------------- + +shortlist=HIDEOBJ,0,show,placeholder,hide + +# IMGDATA -------------------------------------------------------------------- + +constlist=IMGDATA-FORMAT + -1=none + 2=wmf-pict + 9=dib + 14=native +end + +shortlist=IMGDATA-ENV,1,windows,apple + +# NOTE ----------------------------------------------------------------------- + +flagslist=NOTE-FLAGS-BIFF8 + 0x0002=visible + 0x0080=row-hidden + 0x0100=col-hidden +end + +# NOTESOUND ------------------------------------------------------------------ + +constlist=NOTESOUND-FORMAT + 1=pcm + 3=ieee-float + 6=a-law + 7=mu-law + 0xFFFE=extensible +end + +# OBJ ------------------------------------------------------------------------ + +# object types --- + +multilist=OBJ-TYPE-BIFF3 + 0=group,line,rectangle,oval,arc,chart,textbox,button,picture +end + +multilist=OBJ-TYPE-BIFF4 + include=OBJ-TYPE-BIFF3 + 9=polygon +end + +multilist=OBJ-TYPE-BIFF5 + include=OBJ-TYPE-BIFF4 + 10=,checkbox,optionbutton,edit,label,dialog,spin,scrollbar,listbox,groupbox + 20=dropdown +end + +multilist=OBJ-TYPE-BIFF8 + include=OBJ-TYPE-BIFF5 + 25=note + 30=drawing +end + +# flags and constants --- + +flagslist=OBJ-FLAGS-BIFF3 + 0x0001=selected + 0x0002=auto-size + 0x0004=auto-move + 0x0010=protected + 0x0080=grouped + 0x0100=hidden + 0x0200=visible +end + +flagslist=OBJ-FLAGS-BIFF4 + include=OBJ-FLAGS-BIFF3 + 0x0400=printable +end + +flagslist=OBJ-AUTO-FLAGS + 0x01=auto +end + +multilist=OBJ-LINETYPE + 0=solid,dash,dot,dash-dot,dash-dot-dot,25%-pattern,50%-pattern,75%-pattern + 255=none +end + +shortlist=OBJ-LINEWEIGHT,0,hair,thin,medium,thick + +shortlist=OBJ-ARROWHEAD-TYPE,0,none,open,filled,double-end-open,double-end-filled +shortlist=OBJ-ARROWHEAD-WIDTH,0,narrow,medium,wide +shortlist=OBJ-ARROWHEAD-LENGTH,0,short,medium,long + +combilist=OBJ-LINEENDS + 0x000F=uint8,dec,arrowhead-type,OBJ-ARROWHEAD-TYPE + 0x00F0=uint8,dec,arrowhead-width,OBJ-ARROWHEAD-WIDTH + 0x0F00=uint8,dec,arrowhead-length,OBJ-ARROWHEAD-LENGTH +end + +shortlist=OBJ-LINEDIR,0,topleft-to-bottomright,topright-to-bottomleft,bottomright-to-topleft,bottomleft-to-topright + +shortlist=OBJ-ARC-QUADRANT,0,upper-right,upper-left,lower-left,lower-right + +combilist=OBJ-FRAMESTYLE-FLAGS + 0x0001=rounded + 0x0002=shadow + 0x03FC=uint16,dec,rounded-diameter +end + +shortlist=OBJ-HORALIGN,0,none,left,center,right,justify +shortlist=OBJ-VERALIGN,0,none,top,center,bottom,justify + +combilist=OBJ-TEXT-FLAGS + 0x000E=uint16,dec,hor-align,OBJ-HORALIGN + 0x0070=uint16,dec,ver-align,OBJ-VERALIGN + 0x0080=auto-size + 0x0200=text-locked + 0x0400=selected +end + +flagslist=OBJ-PICTURE-FLAGS + 0x0001=auto-size + 0x0002=linked + 0x0008=symbol +end + +flagslist=OBJ-POLYGON-FLAGS + 0x0100=closed +end + +flagslist=OBJ-CHART-FLAGS-BIFF5 + 0x0001=linked-to-sheet +end + +flagslist=OBJ-BUTTON-FLAGS-BIFF5 + 0x0001=default-btn + 0x0002=help-btn + 0x0004=cancel-btn + 0x0008=close-btn +end + +shortlist=OBJ-CHECKBOX-STATE-BIFF5,0,unchecked,checked,tristate + +flagslist=OBJ-CHECKBOX-FLAGS-BIFF5 + 0x0001=flat + 0x0002=box-only +end + +shortlist=OBJ-EDIT-TYPE-BIFF5,0,text,integer,double,reference,formula + +flagslist=OBJ-SCROLLBAR-FLAGS-BIFF5 + 0x0001=visible + 0x0002=slider-only + 0x0004=tracking + 0x0008=flat +end + +combilist=OBJ-LISTBOX-FLAGS-BIFF5 + 0x0004=linked-edit + 0x0008=flat + 0x0030=uint8,dec,selection-type,OBJ-LISTBOX-SELTYPE-BIFF5 +end + +shortlist=OBJ-LISTBOX-SELTYPE-BIFF5,0,single,multi,range + +flagslist=OBJ-GROUPBOX-FLAGS-BIFF5 + 0x0001=flat +end + +combilist=OBJ-DROPDOWN-FLAGS-BIFF5 + 0x0003=uint8,dec,type,OBJ-DROPDOWN-TYPE-BIFF5 + 0x0008=filtered +end + +shortlist=OBJ-DROPDOWN-TYPE-BIFF5,0,listbox,combobox,simple,max + +multilist=OBJ-RECNAMES-BIFF8 + 0x0000=OBJEND,,,,OBJMACRO,,OBJGMO,OBJCF + 0x0008=OBJFLAGS,OBJPICTFMLA,OBJCBLS,OBJRBO,OBJSBS,OBJNTS,OBJSBSFMLA,OBJGBODATA + 0x0010=OBJEDODATA,OBJRBODATA,OBJCBLSDATA,OBJLBSDATA,OBJCBLSFMLA,OBJCMO,, +end + +flagslist=OBJFLAGS-FLAGS + 0x0001=manual-size + 0x0002=linked + 0x0004=update-on-print + 0x0008=symbol + 0x0010=control + 0x0020=ctls-stream + 0x0080=camera-pic + 0x0100=default-size + 0x0200=auto-load +end + +flagslist=OBJCMO-FLAGS + 0x0001=locked + 0x0004=default-size + 0x0008=published + 0x0010=printable + 0x0080=disabled + 0x0100=auxiliary + 0x0200=recalc-on-load + 0x1000=recalc-always + 0x2000=auto-line + 0x4000=auto-area +end + +# PAGELAYOUTVIEW ------------------------------------------------------------- + +flagslist=PAGELAYOUTVIEW-FLAGS + ignore=0xFFF8 + 0x0001=page-layout-view + 0x0002=show-ruler + 0x0004=hide-margins +end + +# PAGESETUP ------------------------------------------------------------------ + +multilist=PAGESETUP-PAPERSIZE + 0=undefined,letter,letter-small,tabloid,ledger,legal,statement,executive,a3,a4 + 10=a4-small,a5,b4,b5,folio,quarto,10x14,11x17,note,envelope-9 + 20=envelope-10,envelope-11,envelope-12,envelope-14,c,d,e,envelope-dl,envelope-c5,envelope-c3 + 30=envelope-c4,envelope-c6,envelope-c65,envelope-b4,envelope-b5,envelope-b6,envelope-italy,envelope-monarch,envelope-6-3/4,us-standard-fanfold + 40=german-standard-fanfold,german-legal-fanfold,b4,japanese-dbl-postcaed,9x11,10x11,15x11,, + 50=envelope-invite,letter-extra,legal-extra,tabloid-extra,a4-extra,letter-transverse,a4-transverse,letter-extra-transverse,super-a-a4,super-b-a3,letter-plus + 60=a4-plus,a5-transverse,jis-b5-transverse,a3-extra,a5-extra,b5-extra,a2,a3-transverse,a3-extra-transverse +end + +constlist=PAGESETUP-SCALETOPAGES + default= + 0=automatic +end + +flagslist=PAGESETUP-FLAGS-BIFF4 + 0x0001=print-in-rows + 0x0002=portrait + 0x0004=uninitialized + 0x0008=black-and-white +end + +flagslist=PAGESETUP-FLAGS-BIFF5 + include=PAGESETUP-FLAGS-BIFF4 + 0x0010=draft-quality + 0x0020=print-notes + 0x0040=default-orientation + 0x0080=use-first-page +end + +combilist=PAGESETUP-FLAGS-BIFF8 + include=PAGESETUP-FLAGS-BIFF5 + 0x0200=print-notes-at-end + 0x0C00=uint8,dec,print-errors,PAGESETUP-PRINTERRORS +end + +shortlist=PAGESETUP-PRINTERRORS,0,displayed,none,as-dashes,as-na + +unitconverter=PAGESETUP-DPI,1,dpi + +# PANE ----------------------------------------------------------------------- + +shortlist=PANE-ID,0,bottom-right,top-right,bottom-left,top-left + +# PCDEFINITION --------------------------------------------------------------- + +flagslist=PCDEFINITION-FLAGS + 0x0001=save-data + 0x0002=invalid + 0x0004=refresh-on-load + 0x0008=optimize-memory + 0x0010=background-query + 0x0020=enable-refresh +end + +# PCDFIELD ------------------------------------------------------------------- + +flagslist=PCDFIELD-FLAGS + 0x0001=has-items + 0x0002=has-unshared-items + 0x0004=calculated + 0x0008=has-parent + 0x0010=range-group + 0x0020=is-numeric + 0x0040=is-integer + 0x0080=has-semi-mixed-types + 0x0100=has-min-max + 0x0200=16bit-indexes + 0x0400=has-non-date + 0x0800=has-date +end + +# PCDFRANGEPR ---------------------------------------------------------------- + +combilist=PCDFRANGEPR-FLAGS + ignore=0xFFE0 + 0x0001=auto-start + 0x0002=auto-end + 0x001C=uint8,dec,group-by,PCDFRANGEPR-GROUPBY +end + +shortlist=PCDFRANGEPR-GROUPBY,0,numeric,seconds,minutes,hours,days,months,quarters,years + +# PCDFSQLTYPE ---------------------------------------------------------------- + +shortlist=PCDFSQLTYPE-DATATYPE,0,unknown,char,numeric,decimal,int32,int16,float,real,double,,,datetime,var-char + +# PCDSOURCE ------------------------------------------------------------------ + +flagslist=PCDSOURCE-TYPE + 0x0001=spreadsheet + 0x0002=extern + 0x0004=consolidation-area + 0x0010=scenario +end + +# PHONETICPR ----------------------------------------------------------------- + +shortlist=PHONETICPR-TYPE,0,halfwidth-katakana,fullwidth-katakana,hiragana,no-conversion +shortlist=PHONETICPR-ALIGNMENT,0,no-control,left,center,distributed + +combilist=PHONETICPR-FLAGS + ignore=0xFFF0 + 0x0003=uint8,dec,type,PHONETICPR-TYPE + 0x000C=uint8,dec,alignment,PHONETICPR-ALIGNMENT +end + +# PROJEXTSHEET --------------------------------------------------------------- + +shortlist=PROJEXTSHEET-TYPE,0,sheet,macro,chart + +# PTDATAFIELD ---------------------------------------------------------------- + +shortlist=PTDATAFIELD-SUBTOTAL,0,sum,count-all,average,max,min,product,count-num,std-dev,std-dev-p,variance,variance-p +shortlist=PTDATAFIELD-SHOWDATAAS,0,normal,diff-from,percent-of,percent-diff-from,running-total-in,percent-of-row,percent-of-column,percent-of-total,index + +multilist=PTDATAFIELD-BASEITEM + default= + 0x7FFB=previous-item,next-item +end + +# PTDEFINITION --------------------------------------------------------------- + +flagslist=PTDEFINITION-FLAGS + 0x0001=row-grandtotals + 0x0002=column-grandtotals + 0x0008=auto-format + 0x0010=size-auto-format + 0x0020=font-auto-format + 0x0040=align-auto-format + 0x0080=border-auto-format + 0x0100=pattern-auto-format + 0x0200=number-auto-format +end + +constlist=PTDEFINITION-DATAFIELD-POS + default= + -1=append +end + +# PTDEFINITION2 -------------------------------------------------------------- + +combilist=PTDEFINITION2-FLAGS + 0x00000001=page-over-then-down + 0x000001FE=dec,uint8,page-wrap + 0x00010000=enable-wizard + 0x00020000=enable-drill + 0x00040000=enable-field-props + 0x00080000=preserve-formatting + 0x00100000=merge-labels + 0x00200000=show-error + 0x00400000=show-missing + 0x00800000=multiple-page-items +end + +# PTFIELD -------------------------------------------------------------------- + +flagslist=PTFIELD-AXISTYPE + 0x0001=row + 0x0002=column + 0x0004=page + 0x0008=data +end + +flagslist=PTFIELD-SUBTOTALS + 0x0001=default + 0x0002=sum + 0x0004=count-all + 0x0008=average + 0x0010=max + 0x0020=min + 0x0040=product + 0x0080=count-num + 0x0100=std-dev + 0x0200=std-dev-p + 0x0400=variance + 0x0800=variance-p +end + +# PTFIELD2 ------------------------------------------------------------------- + +combilist=PTFIELD2-FLAGS + 0x00000001=show-all-items + 0x00000002=drag-to-row + 0x00000004=drag-to-column + 0x00000008=drag-to-page + 0x00000010=drag-to-hide + 0x00000080=server-based + 0x00000200=autosort + 0x00000400=ascend-sort + 0x00000800=autoshow + 0x00001000=autoshow-top + 0x00002000=calculated + 0x00200000=outline + 0x00400000=insert-blank-row + 0x00800000=subtotal-top + 0xFF000000=uint8,dec,autoshow-item-count +end + +# PTFITEM -------------------------------------------------------------------- + +multilist=PTFITEM-ITEMTYPE + 0=data,default,sum,count-all,average,max,min,product,count-num,std-dev,std-dev-p,variance,variance-p,grandtotal + 254=page,none +end + +flagslist=PTFITEM-FLAGS + 0x0001=hidden + 0x0002=hide-detail + 0x0008=calculated + 0x0010=missing +end + +constlist=PTFITEM-CACHEIDX + default= + -1=no-cache-item +end + +# PTPAGEFIELDS --------------------------------------------------------------- + +constlist=PTPAGEFIELDS-ITEM + default= + 0x7FFD=all +end + +# PTROWCOLITEMS -------------------------------------------------------------- + +shortlist=PTROWCOLITEMS-ITEMTYPE,0,data,default,sum,count-all,average,max,min,product,count-num,std-dev,std-dev-p,variance,variance-p,grandtotal,blank-line + +combilist=PTROWCOLITEMS-FLAGS + ignore=0xC000 + 0x0001=field-name + 0x01FE=uint16,dec,data-field-idx + 0x0200=subtotal + 0x0400=blocktotal + 0x0800=grandtotal + 0x1000=multi-data +end + +# QUERYTABLE ----------------------------------------------------------------- + +combilist=QUERYTABLE-FLAGS + 0x0001=headers + 0x0002=row-numbers + 0x0004=disable-refresh + 0x0008=background + 0x0010=first-background + 0x0020=refresh-on-load + 0x0040=delete-unused + 0x0080=fill-formulas + 0x0100=adjust-column-width + 0x0200=save-data + 0x0400=disable-edit + 0x2000=overwrite-existing +end + +combilist=QUERYTABLE-AUTOFORMAT-FLAGS + 0x0001=apply-num-fmt + 0x0002=apply-font + 0x0004=apply-alignment + 0x0008=apply-border + 0x0010=apply-fill + 0x0020=apply-protection +end + +# QUERYTABLEREFRESH ---------------------------------------------------------- + +flagslist=QUERYTABLEREFRESH-FLAGS + 0x0001=enable-refresh + 0x0002=pivot-cache-invalid + 0x0004=olap-pivot-table +end + +flagslist=QUERYTABLEREFRESH-PTFLAGS + 0x00000001=disable-draw-drop + 0x00000002=hide-totals-annotation + 0x00000008=include-empty-rows + 0x00000010=include-empty-columns +end + +flagslist=QUERYTABLEREFRESH-QTFLAGS + 0x00000001=preserve-formatting + 0x00000002=adjust-column-width + 0x00000010=ext-data-list + 0x00000040=create-table-list + 0x00000080=create-dummy-list +end + +# QUERYTABLESETTINGS --------------------------------------------------------- + +flagslist=QUERYTABLESETTINGS-FLAGS + 0x0001=keep-alive + 0x0002=new + 0x0004=source-data + 0x0008=web-based-prov + 0x0010=reinit-list + 0x0080=xml +end + +flagslist=QUERYTABLESETTINGS-HTML-FLAGS + 0x0001=parse-pre + 0x0002=consecutive-delimiters + 0x0004=first-row + 0x0008=xl97-created + 0x0010=text-dates + 0x0020=xl2000-refreshed +end + +combilist=QUERYTABLESETTINGS-OLEDB-FLAGS + 0x0007=uint8,dec,command-type,QUERYTABLESETTINGS-OLEDB-COMMANDTYPE + 0x0008=alt-connection-string + 0x0010=no-refresh-cube + 0x0020=olap-has-locale + 0x0040=server-num-fmt + 0x0080=server-fill-color + 0x0100=server-font-color + 0x0200=server-font-format + 0x0400=olap-member-l10n +end + +shortlist=QUERYTABLESETTINGS-OLEDB-COMMANDTYPE,0,none,cube,sql,table,default,list + +flagslist=QUERYTABLESETTINGS-ADO-FLAGS + 0x0100=ado-refreshable +end + +flagslist=QUERYTABLESETTINGS-EXT-FLAGS + 0x0001=text-query + 0x0002=table-names +end + +unitconverter=QUERYTABLESETTINGS-INTERVAL,60,sec +shortlist=QUERYTABLESETTINGS-HTMLFORMAT,1,none,rtf,all + +# REFMODE -------------------------------------------------------------------- + +shortlist=REFMODE,0,R1C1,A1 + +# ROW ------------------------------------------------------------------------ + +combilist=ROW-HEIGHT + 0x7FFF=uint16,dec,height,CONV-TWIP-TO-PT + 0x8000=default-height +end + +combilist=ROW-FLAGS + ignore=0x00000100 + 0x00000007=uint8,dec,outline-level + 0x00000010=outline-collapsed + 0x00000020=hidden + 0x00000040=custom-height + 0x00000080=custom-format + 0x0FFF0000=uint16,dec,custom-xf-idx + 0x10000000=thick-top + 0x20000000=thick-bottom + 0x40000000=show-phonetic +end + +# SHAREDFEATHEAD ------------------------------------------------------------- + +shortlist=SHAREDFEATHEAD-TYPE,2,protection,ignored-formula-errors,smarttag,table + +flagslist=SHAREDFEATHEAD-PROT-FLAGS + 0x00000001=edit-object + 0x00000002=edit-scenario + 0x00000004=format-cell + 0x00000008=format-column + 0x00000010=format-row + 0x00000020=insert-column + 0x00000040=insert-row + 0x00000080=insert-hyperlink + 0x00000100=delete-column + 0x00000200=delete-row + 0x00000400=select-locked + 0x00000800=sort + 0x00001000=use-autofilter + 0x00002000=pivottable-report + 0x00004000=select-unlocked +end + +# SHEET ---------------------------------------------------------------------- + +shortlist=SHEET-STATE,0,visible,hidden,very-hidden +shortlist=SHEET-TYPE,0,worksheet,macrosheet,chartsheet,,,,vb-module + +# SHEETEXT ------------------------------------------------------------------- + +combilist=SHEETEXT-FLAGS1 + 0x0000007F=uint8,dec,color-idx,SHEETEXT-COLOR +end + +constlist=SHEETEXT-COLOR + include=COLORS + 0x7F=undefined +end + +combilist=SHEETEXT-FLAGS2 + include=SHEETEXT-FLAGS1 + 0x00000080=eval-cond-formats + 0x00000100=!published!unpublished +end + +# SHEETPR -------------------------------------------------------------------- + +shortlist=SHEETPR-WINDOWPOS,0,tiled,horizontal,vertical,cascaded + +flagslist=SHEETPR-FLAGS-BIFF3 + 0x0001=show-autopagebreaks + 0x0020=outline-auto-style + 0x0040=outline-symbols-below + 0x0080=outline-symbols-right + 0x0100=fit-to-pages + 0x0200=skip-linked-values + 0x0400=show-row-outline + 0x0800=show-column-outline +end + +flagslist=SHEETPR-FLAGS-BIFF4 + include=SHEETPR-FLAGS-BIFF3 + 0x3000=uint8,dec,window-pos,SHEETPR-WINDOWPOS + 0x4000=lotus-expr-eval + 0x8000=lotus-formula-edit +end + +flagslist=SHEETPR-FLAGS-BIFF5 + include=SHEETPR-FLAGS-BIFF4 + exclude=0x0200,0x3000 + 0x0010=dialog-sheet +end + +# STYLE ---------------------------------------------------------------------- + +combilist=STYLE-FLAGS + 0x0FFF=uint16,dec,xf-idx + 0x8000=builtin +end + +shortlist=STYLE-BUILTIN,-1,user-defined,normal,rowlevel,collevel,comma,currency,percent,comma-0,currency-0,hyperlink,followed-hyperlink + +# STYLEEXT ------------------------------------------------------------------- + +flagslist=STYLEEXT-FLAGS + 0x01=builtin + 0x02=hidden + 0x04=custom +end + +shortlist=STYLEEXT-CATEGORY,0,custom,good-bad-neutral,data-model,title-heading,themed,number-format + +multilist=STYLEEXT-BUILTIN + include=STYLE-BUILTIN + 10=note,warning-text,,,,title,heading-1,heading-2,heading-3,heading-4 + 20=input,output,calculation,check-cell,linked-cell,total,good,bad,neutral,accent1 + 30=20%-accent1,40%-accent1,60%-accent1,accent2,20%-accent2,40%-accent2,60%-accent2,accent3,20%-accent3,40%-accent3 + 40=60%-accent3,accent4,20%-accent4,40%-accent4,60%-accent4,accent5,20%-accent5,40%-accent5,60%-accent5,accent6 + 50=20%-accent6,40%-accent6,60%-accent6,explanatory-text +end + +# THEME ---------------------------------------------------------------------- + +constlist=THEME-VERSION + 0=custom + 123820=default + 124226=default +end + +# TXO ------------------------------------------------------------------------ + +combilist=TXO-FLAGS + 0x000E=uint16,dec,hor-align,OBJ-HORALIGN + 0x0070=uint16,dec,ver-align,OBJ-VERALIGN + 0x0200=text-locked +end + +# WINDOW1 -------------------------------------------------------------------- + +flagslist=WINDOW1-FLAGS + 0x0001=hidden + 0x0002=minimized + 0x0008=show-horizontal-scroll + 0x0010=show-vertical-scroll + 0x0020=show-tabbar +end + +unitconverter=WINDOW1-TABBARRATIO,/10,% + +# WINDOW2 -------------------------------------------------------------------- + +flagslist=WINDOW2-FLAGS-BIFF3 + 0x0001=show-formulas + 0x0002=show-gridlines + 0x0004=show-headings + 0x0008=frozen-panes + 0x0010=show-zeros + 0x0020=default-gridcolor + 0x0040=right-to-left + 0x0080=show-outline-symbols + 0x0100=remove-split-with-freeze +end + +flagslist=WINDOW2-FLAGS-BIFF5 + include=WINDOW2-FLAGS-BIFF3 + 0x0200=sheet-selected + 0x0400=sheet-active +end + +flagslist=WINDOW2-FLAGS-BIFF8 + include=WINDOW2-FLAGS-BIFF5 + 0x0800=pagebreak-mode +end + +# XF ------------------------------------------------------------------------- + +shortlist=XF-HORALIGN,0,general,left,center,right,fill,block,center-across-sel,distribute +shortlist=XF-VERALIGN,0,top,center,bottom,justify,distribute +shortlist=XF-TEXTDIRECTION,0,context,left-to-right,right-to-left + +flagslist=XF-PROTECTION-FLAGS + 0x01=locked + 0x02=formula-hidden + 0x04=style-xf + 0x08=apostroph-quote +end + +flagslist=XF-USEDATTRIBS-FLAGS + 0x04=format + 0x08=font + 0x10=alignment + 0x20=border + 0x40=area + 0x80=protection +end + +combilist=XF-STYLEFLAGS-BIFF2 + 0x07=uint8,dec,hor-align,XF-HORALIGN + 0x08=left-border + 0x10=right-border + 0x20=top-border + 0x40=bottom-border + 0x80=fill +end + +combilist=XF-TYPEFLAGS-BIFF2 + 0x3F=uint8,dec,fmt-idx,FORMATS + 0x40=locked + 0x80=formula-hidden +end + +flagslist=XF-TYPEFLAGS-BIFF3 + include=XF-PROTECTION-FLAGS +end + +combilist=XF-TYPEFLAGS-BIFF4 + include=XF-TYPEFLAGS-BIFF3 + 0xFFF0=uint16,dec,parent-xf-idx +end + +combilist=XF-ALIGNMENT-BIFF3 + 0x0007=uint8,dec,hor-align,XF-HORALIGN + 0x0008=text-wrap + 0xFFF0=uint16,dec,parent-xf-idx +end + +combilist=XF-ALIGNMENT-BIFF4 + 0x07=uint8,dec,hor-align,XF-HORALIGN + 0x08=text-wrap + 0x30=uint8,dec,ver-align,XF-VERALIGN + 0xC0=uint8,dec,orientation,TEXTORIENTATION +end + +combilist=XF-ALIGNMENT-BIFF5 + 0x07=uint8,dec,hor-align,XF-HORALIGN + 0x08=text-wrap + 0x70=uint8,dec,ver-align,XF-VERALIGN + 0x80=justify-lastline +end + +combilist=XF-ORIENTATTRIBS-BIFF5 + include=XF-USEDATTRIBS-FLAGS + 0x03=uint8,dec,orientation,TEXTORIENTATION +end + +combilist=XF-TEXTFLAGS-BIFF8 + 0x0F=uint8,dec,indent + 0x10=shrink-to-fit + 0xC0=uint8,dec,text-dir,XF-TEXTDIRECTION +end + +combilist=XF-FILL-BIFF3 + 0x003F=uint8,dec,fill-pattern,FILLPATTERNS + 0x07C0=uint8,dec,fg-color-idx,COLORS + 0xF800=uint8,dec,bg-color-idx,COLORS +end + +combilist=XF-BORDER-BIFF3 + 0x00000007=uint8,dec,top-style,BORDERSTYLES + 0x000000F8=uint8,dec,top-color,COLORS + 0x00000700=uint8,dec,left-style,BORDERSTYLES + 0x0000F800=uint8,dec,left-color,COLORS + 0x00070000=uint8,dec,bottom-style,BORDERSTYLES + 0x00F80000=uint8,dec,bottom-color,COLORS + 0x07000000=uint8,dec,right-style,BORDERSTYLES + 0xF8000000=uint8,dec,right-color,COLORS +end + +combilist=XF-FILL-BIFF5 + 0x0000007F=uint8,dec,fg-color-idx,COLORS + 0x00003F80=uint8,dec,bg-color-idx,COLORS + 0x003F0000=uint8,dec,fill-pattern,FILLPATTERNS + 0x01C00000=uint8,dec,bottom-style,BORDERSTYLES + 0xFE000000=uint8,dec,bottom-color,COLORS +end + +combilist=XF-BORDER-BIFF5 + 0x00000007=uint8,dec,top-style,BORDERSTYLES + 0x00000038=uint8,dec,left-style,BORDERSTYLES + 0x000001C0=uint8,dec,right-style,BORDERSTYLES + 0x0000FE00=uint8,dec,top-color,COLORS + 0x007F0000=uint8,dec,left-color,COLORS + 0x3F800000=uint8,dec,right-color,COLORS +end + +combilist=XF-BORDERSTYLE-BIFF8 + 0x000F=uint8,dec,left-style,BORDERSTYLES + 0x00F0=uint8,dec,right-style,BORDERSTYLES + 0x0F00=uint8,dec,top-style,BORDERSTYLES + 0xF000=uint8,dec,bottom-style,BORDERSTYLES +end + +combilist=XF-BORDERCOLOR1-BIFF8 + 0x007F=uint8,dec,left-color,COLORS + 0x3F80=uint8,dec,right-color,COLORS + 0x4000=diag-tl-to-br + 0x8000=diag-bl-to-tr +end + +combilist=XF-BORDERCOLOR2-BIFF8 + 0x0000007F=uint8,dec,top-color,COLORS + 0x00003F80=uint8,dec,bottom-color,COLORS + 0x001FC000=uint8,dec,diag-color,COLORS + 0x01E00000=uint8,dec,diag-style,BORDERSTYLES + 0xFC000000=uint8,dec,fill-pattern,FILLPATTERNS +end + +combilist=XF-FILLCOLOR-BIFF8 + 0x007F=uint8,dec,fg-color-idx,COLORS + 0x3F80=uint8,dec,bg-color-idx,COLORS +end + +# BIFF2 cell records ---------------------------------------------------------- + +constlist=XFINDEX-BIFF2 + default= + 63=from-ixfe +end + +combilist=CELL-XFINDEX-BIFF2 + 0x3F=uint8,dec,xf-idx,XFINDEX-BIFF2 + 0x40=locked + 0x80=formula-hidden +end + +combilist=CELL-XFFORMAT-BIFF2 + 0x3F=uint8,dec,fmt-idx,FORMATS + 0xC0=uint8,dec,font-idx,FONTNAMES +end + +combilist=CELL-XFSTYLE-BIFF2 + include=XF-STYLEFLAGS-BIFF2 +end + +# XFEXT ---------------------------------------------------------------------- + +multilist=XFEXT-SUBREC + 0=,,,,FILL-FGCOLOR + 5=FILL-BGCOLOR,FILL-GRADIENT,BORDER-TOP-COLOR,BORDER-BOTTOM-COLOR,BORDER-LEFT-COLOR + 10=BORDER-RIGHT-COLOR,BORDER-DIAG-COLOR,,TEXT-COLOR,FONT-SCHEME + 15=INDENT +end + +# ============================================================================ diff --git a/oox/source/dump/dffdumper.cxx b/oox/source/dump/dffdumper.cxx new file mode 100644 index 000000000..9c8acd828 --- /dev/null +++ b/oox/source/dump/dffdumper.cxx @@ -0,0 +1,227 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include + +#ifdef DBG_UTIL + +namespace oox::dump { + +namespace { + +const sal_uInt16 DFF_ID_BSE = 0xF007; /// BLIP store entry. +const sal_uInt16 DFF_ID_BSTORECONTAINER = 0xF001; /// BLIP store container. +const sal_uInt16 DFF_ID_CHILDANCHOR = 0xF00F; /// Child anchor (in groups). +const sal_uInt16 DFF_ID_CLIENTANCHOR = 0xF010; /// Client anchor. +const sal_uInt16 DFF_ID_DG = 0xF008; /// Drawing. +const sal_uInt16 DFF_ID_DGG = 0xF006; /// Drawing group. +const sal_uInt16 DFF_ID_OPT = 0xF00B; /// Property set. +const sal_uInt16 DFF_ID_OPT2 = 0xF121; /// Secondary property set. +const sal_uInt16 DFF_ID_OPT3 = 0xF122; /// Ternary property set. +const sal_uInt16 DFF_ID_SP = 0xF00A; /// Shape. +const sal_uInt16 DFF_ID_SPGR = 0xF009; /// Shape group. +const sal_uInt16 DFF_ID_SPLITMENUCOLORS = 0xF11E; /// Current toolbar colors. + +const sal_uInt16 DFF_OPT_IDMASK = 0x3FFF; +const sal_uInt16 DFF_OPT_COMPLEX = 0x8000; + +} // namespace + +bool DffStreamObject::implReadRecordHeader( BinaryInputStream& rBaseStrm, sal_Int64& ornRecId, sal_Int64& ornRecSize ) +{ + mnInstVer = rBaseStrm.readuInt16(); + ornRecId = rBaseStrm.readuInt16(); + mnRealSize = rBaseStrm.readInt32(); + ornRecSize = isContainer() ? 0 : mnRealSize; + return !rBaseStrm.isEof(); +} + +void DffStreamObject::implWriteExtHeader() +{ + const char* pcListName = "DFF-RECORD-INST"; + switch( getRecId() ) + { + case DFF_ID_BSE: pcListName = "DFFBSE-RECORD-INST"; break; // BLIP type + case DFF_ID_BSTORECONTAINER: pcListName = "DFFBSTORECONT-RECORD-INST"; break; // BLIP count + case DFF_ID_DG: pcListName = "DFFDG-RECORD-INST"; break; // drawing ID + case DFF_ID_OPT: pcListName = "DFFOPT-RECORD-INST"; break; // property count + case DFF_ID_SP: pcListName = "DFFSP-RECORD-INST"; break; // shape type + case DFF_ID_SPLITMENUCOLORS: pcListName = "DFFSPLITMENUC-RECORD-INST"; break; // number of colors + } + MultiItemsGuard aMultiGuard( mxOut ); + writeHexItem( "instance", mnInstVer, pcListName ); + if( isContainer() ) writeDecItem( "container-size", mnRealSize ); +} + +void DffStreamObject::implDumpRecordBody() +{ + switch( getRecId() ) + { + case DFF_ID_BSE: + dumpDec< sal_uInt8 >( "win-type", "DFFBSE-TYPE" ); + dumpDec< sal_uInt8 >( "mac-type", "DFFBSE-TYPE" ); + dumpGuid( "guid" ); + dumpDec< sal_uInt16 >( "tag" ); + dumpDec< sal_uInt32 >( "blip-size" ); + dumpDec< sal_uInt32 >( "blip-refcount" ); + dumpDec< sal_uInt32 >( "blip-streampos" ); + dumpDec< sal_uInt8 >( "blip-usage", "DFFBSE-USAGE" ); + dumpDec< sal_uInt8 >( "blip-name-len" ); + dumpUnused( 2 ); + break; + + case DFF_ID_CHILDANCHOR: + dumpDec< sal_uInt32 >( "left" ); + dumpDec< sal_uInt32 >( "top" ); + dumpDec< sal_uInt32 >( "right" ); + dumpDec< sal_uInt32 >( "bottom" ); + break; + + case DFF_ID_CLIENTANCHOR: + break; + + case DFF_ID_DG: + dumpDec< sal_uInt32 >( "shape-count" ); + dumpHex< sal_uInt32 >( "max-shape-id", "CONV-DEC" ); + break; + + case DFF_ID_DGG: + { + dumpHex< sal_uInt32 >( "max-shape-id", "CONV-DEC" ); + sal_uInt32 nClusters = dumpDec< sal_uInt32 >( "id-cluster-count" ); + dumpDec< sal_uInt32 >( "shape-count" ); + dumpDec< sal_uInt32 >( "drawing-count" ); + mxOut->resetItemIndex( 1 ); + TableGuard aTabGuard( mxOut, 15, 16 ); + for( sal_uInt32 nCluster = 1; !mxStrm->isEof() && (nCluster < nClusters); ++nCluster ) + { + MultiItemsGuard aMultiGuard( mxOut ); + writeEmptyItem( "#cluster" ); + dumpDec< sal_uInt32 >( "drawing-id" ); + dumpHex< sal_uInt32 >( "next-free-id", "CONV-DEC" ); + } + } + break; + + case DFF_ID_OPT: + case DFF_ID_OPT2: + case DFF_ID_OPT3: + dumpDffOpt(); + break; + + case DFF_ID_SP: + dumpHex< sal_uInt32 >( "shape-id", "CONV-DEC" ); + dumpHex< sal_uInt32 >( "shape-flags", "DFFSP-FLAGS" ); + break; + + case DFF_ID_SPGR: + dumpDec< sal_uInt32 >( "left" ); + dumpDec< sal_uInt32 >( "top" ); + dumpDec< sal_uInt32 >( "right" ); + dumpDec< sal_uInt32 >( "bottom" ); + break; + + case DFF_ID_SPLITMENUCOLORS: + dumpDffSimpleColor( "fill-color" ); + dumpDffSimpleColor( "line-color" ); + dumpDffSimpleColor( "shadow-color" ); + dumpDffSimpleColor( "3d-color" ); + break; + } +} + +sal_uInt32 DffStreamObject::dumpDffSimpleColor( const String& rName ) +{ + return dumpHex< sal_uInt32 >( rName, "DFF-SIMPLE-COLOR" ); +} + +namespace { + +enum class PropType { Binary }; + +struct PropInfo +{ + OUString maName; + PropType meType; + sal_uInt16 mnId; + sal_uInt32 mnSize; + explicit PropInfo( const OUString& rName, PropType eType, sal_uInt16 nId, sal_uInt32 nSize ) : + maName( rName ), meType( eType ), mnId( nId ), mnSize( nSize ) {} +}; + +typedef ::std::vector< PropInfo > PropInfoVector; + +} // namespace + +void DffStreamObject::dumpDffOpt() +{ + sal_uInt16 nPropCount = getInst(); + PropInfoVector aPropInfos; + mxOut->resetItemIndex(); + for( sal_uInt16 nPropIdx = 0; !mxStrm->isEof() && (nPropIdx < nPropCount); ++nPropIdx ) + { + sal_uInt16 nPropId = dumpDffOptPropHeader(); + sal_uInt16 nBaseId = nPropId & DFF_OPT_IDMASK; + sal_uInt32 nValue = mxStrm->readuInt32(); + + IndentGuard aIndent( mxOut ); + if( getFlag( nPropId, DFF_OPT_COMPLEX ) ) + { + writeHexItem( "complex-size", nValue, "CONV-DEC" ); + aPropInfos.emplace_back( String( "property-data" ), PropType::Binary, nBaseId, nValue ); + } + else + { + writeHexItem( "value", nValue ); + } + } + + mxOut->resetItemIndex(); + for (auto const& propInfo : aPropInfos) + { + if (mxStrm->isEof()) + break; + mxOut->startMultiItems(); + writeEmptyItem( "#complex-data" ); + writeHexItem( "id", propInfo.mnId, "DFFOPT-PROPERTY-NAMES" ); + mxOut->endMultiItems(); + IndentGuard aIndent( mxOut ); + switch(propInfo.meType) + { + case PropType::Binary: + dumpBinary( propInfo.maName, propInfo.mnSize ); + break; + default: assert(false && "missing implementation?"); + } + } +} + +sal_uInt16 DffStreamObject::dumpDffOptPropHeader() +{ + MultiItemsGuard aMultiGuard( mxOut ); + TableGuard aTabGuard( mxOut, 11 ); + writeEmptyItem( "#prop" ); + return dumpHex< sal_uInt16 >( "id", "DFFOPT-PROPERTY-ID" ); +} + +} // namespace oox::dump + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/dump/dffdumper.ini b/oox/source/dump/dffdumper.ini new file mode 100644 index 000000000..45b5aecc7 --- /dev/null +++ b/oox/source/dump/dffdumper.ini @@ -0,0 +1,676 @@ +# +# This file is part of the LibreOffice project. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# +# This file incorporates work covered by the following license notice: +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed +# with this work for additional information regarding copyright +# ownership. The ASF licenses this file to you under the Apache +# License, Version 2.0 (the "License"); you may not use this file +# except in compliance with the License. You may obtain a copy of +# the License at http://www.apache.org/licenses/LICENSE-2.0 . +# + +# dumper settings ============================================================ + +# Path to additional configuration data, relative to this file. +include-config-file=dumperbase.ini + +# name lists ================================================================= + +multilist=DFF-RECORD-NAMES + 0xF000=DFFDGGCONTAINER,DFFBSTORECONTAINER,DFFDGCONTAINER,DFFSPGRCONTAINER,DFFSPCONTAINER,DFFSOLVERCONTAINER,DFFDGG,DFFBSE + 0xF008=DFFDG,DFFSPGR,DFFSP,DFFOPT,DFFTEXTBOX,DFFCLIENTTEXTBOX,DFFANCHOR,DFFCHILDANCHOR + 0xF010=DFFCLIENTANCHOR,DFFCLIENTDATA,DFFCONNECTORRULE,DFFALIGNRULE,DFFARCRULE,DFFCLIENTRULE,DFFCLASSID,DFFCALLOUTRULE + # 0xF018-0xF117 reserved for pictures + 0xF118=DFFREGROUPITEM,DFFSELECTION,DFFCOLORMRU,,,DFFDELETEDPSPL,DFFSPLITMENUCOLORS,DFFOLEOBJECT + 0xF120=DFFCOLORSCHEME,DFFOPT2,DFFOPT3 +end + +combilist=DFF-RECORD-INST + 0x000F=uint8,hex,version,DFF-RECORD-VERSION + 0xFFF0=uint16,dec,instance +end + +constlist=DFF-RECORD-VERSION + default= + 15=container +end + +combilist=DFF-SIMPLE-COLOR + 0x000000FF=uint8,dec,red,,filter=0x10000000~0x00000000 + 0x0000FF00=uint8,dec,green,,filter=0x10000000~0x00000000 + 0x00FF0000=uint8,dec,blue,,filter=0x10000000~0x00000000 + 0x000000FF=uint8,dec,scheme-idx,,filter=0x10000000~0x10000000 + 0x10000000=!rgb!scheme + ignore=0x08000000 +end + +combilist=DFF-COLOR + 0x0000FFFF=uint16,dec,palette-idx,,filter=0xFF000000~0x01000000 + 0x000000FF=uint8,dec,red,,filter=0xF9000000~0x00000000 + 0x0000FF00=uint8,dec,green,,filter=0xF9000000~0x00000000 + 0x00FF0000=uint8,dec,blue,,filter=0xF9000000~0x00000000 + 0x000000FF=uint8,dec,scheme-idx,,filter=0xFF000000~0x08000000 + 0x0000FFFF=uint16,dec,system-idx,DFF-SYSTEMCOLOR,filter=0xFF000000~0x10000000 + 0x00FF0000=uint16,dec,mod-by,,filter=0xFF000000~0x10000000 + 0x01000000=palette-idx + 0x02000000=palette-rgb + 0x04000000=system-rgb + 0x08000000=scheme-idx + 0x10000000=system-idx +end + +combilist=DFF-SYSTEMCOLOR + 0x00FF=uint8,dec,color-id,DFF-SYSTEMCOLOR-ID + 0x0F00=uint8,dec,mod,DFF-SYSTEMCOLOR-MOD + 0x2000=invert-after + 0x4000=half-invert-after + 0x8000=grey-before +end + +constlist=DFF-SYSTEMCOLOR-ID + include=SYSTEMCOLOR + 0xF0=shape-fill + 0xF1=shape-line-or-fill + 0xF2=shape-line + 0xF3=shape-shadow + 0xF4=current-or-last-used + 0xF5=shape-fill-back + 0xF6=shape-line-back + 0xF7=shape-fill-or-line +end + +shortlist=DFF-SYSTEMCOLOR-MOD,0,none,darken-by,lighten-by,add-grey-by,sub-grey-by,reverse-sub-grey-by,monochrome-by + +combilist=DFF-COLORMOD + 0x00000300=uint8,dec,type,DFF-COLORMOD-TYPE + 0x00FF0000=uint8,dec,level + ignore=0x200000FF +end + +shortlist=DFF-COLORMOD-TYPE,0,none,shade,tint + +unitconverter=DFF-OPACITY,/655.36,% +unitconverter=DFF-DEGREES,/65536,° + +# DFFBSE --------------------------------------------------------------------- + +combilist=DFFBSE-RECORD-INST + include=DFF-RECORD-INST + 0xFFF0=uint16,dec,blip-type,DFFBSE-TYPE +end + +multilist=DFFBSE-TYPE + 0=error,unknown,emf,wmf,pict,jpeg,png,dib + 17=tiff,cmyk-jpeg +end + +shortlist=DFFBSE-USAGE,0,default,texture + +# DFFBSTORECONTAINER --------------------------------------------------------- + +combilist=DFFBSTORECONT-RECORD-INST + include=DFF-RECORD-INST + 0xFFF0=uint16,dec,blip-count +end + +# DFFDG ---------------------------------------------------------------------- + +combilist=DFFDG-RECORD-INST + include=DFF-RECORD-INST + 0xFFF0=uint16,dec,drawing-id +end + +# DFFOPT --------------------------------------------------------------------- + +combilist=DFFOPT-RECORD-INST + include=DFF-RECORD-INST + 0xFFF0=uint16,dec,property-count +end + +combilist=DFFOPT-PROPERTY-ID + 0x3FFF=uint16,dec,id,DFFOPT-PROPERTY-NAMES + 0x4000=picture + 0x8000=complex +end + +multilist=DFFOPT-PROPERTY-NAMES + # 0x0000-0x003F: transformation + 0x0000=transf-left,transf-top,transf-right,transf-bottom,transf-rotation,transf-page + 0x003F=transf-flags + # 0x0040-0x007F: protection + 0x007F=prot-flags + # 0x0080-0x00BF: text + 0x0080=text-id,text-left,text-top,text-right,text-bottom,text-wrap-mode,text-scale,text-anchor-mode + 0x0088=text-flow,text-font-orient,text-next-shape,text-bidi + 0x00BF=text-flags + # 0x00C0-0x00FF: text geometry + 0x00C0=textgeo-unicode-string,textgeo-rtf-string,textgeo-curve-align,textgeo-def-size,textgeo-spacing,textgeo-font,textgeo-css-font + 0x00FF=textgeo-flags + # 0x0100-0x013F: picture (BLIP) + 0x0100=blip-crop-top,blip-crop-bottom,blip-crop-left,blip-crop-right,blip-id,blip-name,blip-opt,blip-transparency-color + 0x0108=blip-contrast,blip-brightness,blip-gamma,blip-ole-id,blip-double-cr-mod,blip-fill-cr-mod,blip-line-cr-mod,blip-print-id + 0x0110=blip-print-name,blip-print-opt,blip-movie,,,blip-transparency-color-ext,reserved,blip-transparency-color-ext-mod + 0x0118=reserved,reserved,blip-recolor,blip-recolor-ext,reserved,blip-recolor-ext-mod,reserved,reserved + 0x013F=blip-flags + # 0x0140-0x017F: shape geometry + 0x0140=geo-left,geo-top,geo-right,geo-bottom,geo-shape-path,geo-vertices,geo-segment-info,geo-adjust-1 + 0x0148=geo-adjust-2,geo-adjust-3,geo-adjust-4,geo-adjust-5,geo-adjust-6,geo-adjust-7,geo-adjust-8, + 0x0150=,geo-connect-sites,geo-connect-sites-dir,geo-stretch-x,geo-stretch-y,geo-handles,geo-guides,geo-inscribe + 0x0158=geo-connect-points + 0x017F=geo-flags + # 0x0180-0x01BF: fill style + 0x0180=fill-type,fill-color,fill-opacity,fill-back-color,fill-back-opacity,fill-cr-mod,fill-blip,fill-blip-name + 0x0188=fill-blip-opt,fill-width,fill-height,fill-angle,fill-focus,fill-to-left,fill-to-top,fill-to-right + 0x0190=fill-to-bottom,fill-rect-left,fill-rect-top,fill-rect-right,fill-rect-bottom,fill-dz-type,fill-shade-preset,fill-shade-colors + 0x0198=fill-origin-x,fill-origin-y,fill-shape-origin-x,fill-shape-origin-y,fill-shade-type,,fill-color-ext,reserved + 0x01A0=fill-color-ext-mod,reserved,fill-back-color-ext,reserved,fill-back-color-ext-mod,reserved,reserved,reserved + 0x01BF=fill-flags + # 0x01C0-0x01FF: line style + 0x01C0=line-color,line-opacity,line-back-color,line-cr-mod,line-type,line-fill-blip,line-fill-blip-name,line-fill-blip-opt + 0x01C8=line-fill-width,line-fill-height,line-fill-dz-type,line-width,line-miter-limit,line-style,line-dash,line-dash-style + 0x01D0=line-start-arrow-head,line-end-arrow-head,line-start-arrow-width,line-start-arrow-length,line-end-arrow-width,line-end-arrow-length,line-join-style,line-end-cap-style + 0x01D8=,line-color-ext,reserved,line-color-ext-mod,reserved,line-back-color-ext,reserved,line-back-color-ext-mod + 0x01E0=reserved,reserved,reserved + 0x01FF=line-flags + # 0x0200-0x023F: shadow style + 0x0200=shadow-type,shadow-color,shadow-highlight,shadow-cr-mod,shadow-opacity,shadow-offset-x,shadow-offset-y,shadow-2nd-offset-x + 0x0208=shadow-2nd-offset-y,,,,,,, + 0x0210=shadow-origin-x,shadow-origin-y,shadow-color-ext,reserved,shadow-color-ext-mod,reserved,shadow-highlight-ext,reserved + 0x0218=shadow-highlight-ext-mod,reserved,reserved,reserved + 0x023F=shadow-flags + # 0x0240-0x027F: perspective + 0x0240=persp-type,persp-offset-x,persp-offsety,persp-scale-x-to-x,persp-scale-y-to-x,persp-scale-x-to-y,persp-scale-y-to-y,persp-persp-x + 0x0248=persp-persp-y,persp-weight,persp-origin-x,persp-origin-y + 0x027F=persp-flags + # 0x0280-0x02BF: 3d object + 0x0280=3dobj-specular-amt,3dobj-diffuse-amt,3dobj-shininess,3dobj-edge-thickness,3dobj-extrude-forward,3dobj-extrude-backward,3dobj-extrude-plane,3dobj-extrusion-color + 0x0288=3dobj-cr-mod,3dobj-extrusion-color-ext,reserved,3dobj-extrusion-color-ext-mod,reserved,reserved + 0x02BF=3dobj-flags + # 0x02C0-0x02FF: 3d style + 0x02C0=3dstyle-y-rotation,3dstyle-x-rotation,3dstyle-rotation-axis-x,3dstyle-rotation-axis-y,3dstyle-rotation-axis-z,3dstyle-rotation,3dstyle-rotation-center-x,3dstyle-rotation-center-y + 0x02C8=3dstyle-rotation-center-z,3dstyle-render-mode,3dstyle-tolerance,3dstyle-view-point-x,3dstyle-view-point-y,3dstyle-view-point-z,3dstyle-origin-x,3dstyle-origin-y + 0x02D0=3dstyle-skew-angle,3dstyle-skew-amount,3dstyle-ambient-intensity,3dstyle-key-light-x,3dstyle-key-light-y,3dstyle-key-light-z,3dstyle-key-light-intensity,3dstyle-fill-light-x + 0x02D8=3dstyle-fill-light-y,3dstyle-fill-light-z,3dstyle-fill-light-intensity + 0x02FF=3dstyle-flags + # 0x0300-0x033F: shape + 0x0300=,shape-master,,shape-connect-style,shape-bw-mod,shape-bw-mode-pure-bw,shape-bw-mode-bw,shape-discuss-anchor-id + 0x0308=,shape-dia-layout,shape-dia-node-kind,shape-dia-layout-mru,shape-equation-xml + 0x033F=shape-flags + # 0x0340-0x037F: callout + 0x0340=callout-type,callout-box-distance,callout-angle,callout-drop-type,callout-drop-pos,callout-length + 0x037F=callout-flags + # 0x0380-0x03BF: group or shape + 0x0380=group-name,group-description,group-hyperlink,group-wrap-polygon-vertices,group-wrap-left,group-wrap-top,group-wrap-right,group-wrap-bottom + 0x0388=group-regroup-id,,,,,group-tooltip,group-script,group-pos-h + 0x0390=group-pos-rel-h,group-pos-v,group-pos-rel-v,group-rel-width-hr,group-align-hr,group-height-hr,group-width-hr,group-script-ext-attr + 0x0398=group-script-lang,,group-script-lang-attr,group-border-top-color,group-border-left-color,group-border-bottom-color,group-border-right-color,group-table-props + 0x03A0=group-table-row-props,,,,,group-web-bot,, + 0x03A8=,group-metro-blob,group-rel-z-order, + 0x03BF=group-flags + # 0x03C0-0x03FF: relative transformation + 0x03C0=reltransf-left,reltransf-top,reltransf-right,reltransf-bottom,reltransf-rotation,reltransf-page + 0x03FF=reltransf-flags + # 0x0400-0x043F: unknown HTML + 0x0400=,,uhtml-line-id,uhtml-fill-id,uhtml-pic-id,uhtml-path-id,uhtml-shadow-id,uhtml-persp-id + 0x0408=uhtml-text-path-id,uhtml-formulae-id,uhtml-handles-id,uhtml-callout-id,uhtml-lock-id,uhtml-text-id,uhtml-3d-id + 0x043F=uhtml-flags + # 0x0500-0x053F: diagram + 0x0500=dia-type,dia-style,,,dia-rel-table,dia-scale-x,dia-scale-y,dia-def-fontsize + 0x0508=dia-constrain-bounds,dia-base-text-scale + 0x053F=dia-flags + # 0x0540-0x057F: left line style + 0x0540=lline-color,lline-opacity,lline-back-color,lline-cr-mod,lline-type,lline-fill-blip,lline-fill-blip-name,lline-fill-blip-opt + 0x0548=lline-fill-width,lline-fill-height,lline-fill-dz-type,lline-width,lline-miter-limit,lline-style,lline-dash,lline-dash-style + 0x0550=lline-start-arrow-head,lline-end-arrow-head,lline-start-arrow-width,lline-start-arrow-length,lline-end-arrow-width,lline-end-arrow-length,lline-join-style,lline-end-cap-style + 0x0558=,lline-color-ext,reserved,lline-color-ext-mod,reserved,lline-back-color-ext,reserved,lline-back-color-ext-mod + 0x0560=reserved,reserved,reserved + 0x057F=lline-flags + # 0x0580-0x05BF: top line style + 0x0580=tline-color,tline-opacity,tline-back-color,tline-cr-mod,tline-type,tline-fill-blip,tline-fill-blip-name,tline-fill-blip-opt + 0x0588=tline-fill-width,tline-fill-height,tline-fill-dz-type,tline-width,tline-miter-limit,tline-style,tline-dash,tline-dash-style + 0x0590=tline-start-arrow-head,tline-end-arrow-head,tline-start-arrow-width,tline-start-arrow-length,tline-end-arrow-width,tline-end-arrow-length,tline-join-style,tline-end-cap-style + 0x0598=,tline-color-ext,reserved,tline-color-ext-mod,reserved,tline-back-color-ext,reserved,tline-back-color-ext-mod + 0x05A0=reserved,reserved,reserved + 0x05BF=tline-flags + # 0x05C0-0x05FF: right line style + 0x05C0=rline-color,rline-opacity,rline-back-color,rline-cr-mod,rline-type,rline-fill-blip,rline-fill-blip-name,rline-fill-blip-opt + 0x05C8=rline-fill-width,rline-fill-height,rline-fill-dz-type,rline-width,rline-miter-limit,rline-style,rline-dash,rline-dash-style + 0x05D0=rline-start-arrow-head,rline-end-arrow-head,rline-start-arrow-width,rline-start-arrow-length,rline-end-arrow-width,rline-end-arrow-length,rline-join-style,rline-end-cap-style + 0x05D8=,rline-color-ext,reserved,rline-color-ext-mod,reserved,rline-back-color-ext,reserved,rline-back-color-ext-mod + 0x05E0=reserved,reserved,reserved + 0x05FF=rline-flags + # 0x0600-0x063F: bottom line style + 0x0600=bline-color,bline-opacity,bline-back-color,bline-cr-mod,bline-type,bline-fill-blip,bline-fill-blip-name,bline-fill-blip-opt + 0x0608=bline-fill-width,bline-fill-height,bline-fill-dz-type,bline-width,bline-miter-limit,bline-style,bline-dash,bline-dash-style + 0x0610=bline-start-arrow-head,bline-end-arrow-head,bline-start-arrow-width,bline-start-arrow-length,bline-end-arrow-width,bline-end-arrow-length,bline-join-style,bline-end-cap-style + 0x0618=,bline-color-ext,reserved,bline-color-ext-mod,reserved,bline-back-color-ext,reserved,bline-back-color-ext-mod + 0x0620=reserved,reserved,reserved + 0x063F=bline-flags + # 0x0680-0x06BF: web component + 0x0680=webcomp-html,webcomp-name,webcomp-url + 0x06BF=webcomp-flags + # 0x0700-0x073F: ink data + 0x0700=ink-data + 0x073F=ink-flags + # 0x0780-0x07BF: signature line + 0x0780=,sigline-guid,sigline-provider-guid,sigline-suggested-signer,sigline-suggested-signer-info,sigline-suggested-signer-email,sigline-sign-instruction,sigline-add-xml + 0x0788=sigline-provider-url + 0x07BF=sigline-flags + # 0x07C0-0x07FF: group or shape #2 + 0x07C0=group2-rel-width,group2-rel-height,group2-rel-pos-x,group2-rel-pos-y,group2-size-rel-h,group2-size-rel-v +end + +constlist=DFFOPT-SIMPLE-PROPERTIES + # transformation + 0x003F=uint32,hex,flags,DFFOPT-TRANSFORM-FLAGS + # protection + 0x007F=uint32,hex,flags,DFFOPT-PROTECTION-FLAGS + # text + 0x00BF=uint32,hex,flags,DFFOPT-TEXT-FLAGS + # text geometry + 0x00FF=uint32,hex,flags,DFFOPT-TEXTGEO-FLAGS + # picture (BLIP) + 0x013F=uint32,hex,flags,DFFOPT-BLIP-FLAGS + # shape geometry + 0x017F=uint32,hex,flags,DFFOPT-GEO-FLAGS + # fill style + 0x0180=uint32,dec,type,DFFOPT-FILL-TYPE + 0x0181=uint32,hex,color,DFF-COLOR + 0x0182=int32,fix,opacity,DFF-OPACITY + 0x0183=uint32,hex,color,DFF-COLOR + 0x0184=int32,fix,opacity,DFF-OPACITY + 0x0185=uint32,hex,color,DFF-COLOR + 0x0186=uint32,dec,blip-id + 0x0188=uint32,dec,blip-opt,DFFOPT-BLIPOPT + 0x0189=int32,dec,width + 0x018A=int32,dec,height + 0x018B=int32,fix,angle,DFF-DEGREES + 0x018C=int32,dec,focus,CONV-PERCENT + 0x018D=int32,fix,size,DFF-OPACITY + 0x018E=int32,fix,size,DFF-OPACITY + 0x018F=int32,fix,size,DFF-OPACITY + 0x0190=int32,fix,size,DFF-OPACITY + 0x0191=int32,fix,size,CONV-EMU-TO-CM + 0x0192=int32,fix,size,CONV-EMU-TO-CM + 0x0193=int32,fix,size,CONV-EMU-TO-CM + 0x0194=int32,fix,size,CONV-EMU-TO-CM + 0x0195=uint32,dec,type,DFFOPT-FILL-DZTYPE + 0x0196=int32,dec,preset + 0x0198=int32,fix,pos,DFF-OPACITY + 0x0199=int32,fix,pos,DFF-OPACITY + 0x019A=int32,fix,pos,DFF-OPACITY + 0x019B=int32,fix,pos,DFF-OPACITY + 0x019C=uint32,hex,type,DFFOPT-FILL-SHADETYPE + 0x019E=uint32,hex,color,DFF-COLOR + 0x01A0=uint32,hex,color-mod,DFF-COLORMOD + 0x01A2=uint32,hex,color,DFF-COLOR + 0x01A4=uint32,hex,color-mod,DFF-COLORMOD + 0x01BF=uint32,hex,flags,DFFOPT-FILL-FLAGS + # line style + 0x01C0=uint32,hex,color,DFF-COLOR + 0x01C2=uint32,hex,color,DFF-COLOR + 0x01FF=uint32,hex,flags,DFFOPT-LINE-FLAGS + # shadow style + 0x0201=uint32,hex,color,DFF-COLOR + 0x023F=uint32,hex,flags,DFFOPT-SHADOW-FLAGS + # perspective + 0x027F=uint32,hex,flags,DFFOPT-PERSP-FLAGS + # 3d object + 0x02BF=uint32,hex,flags,DFFOPT-3DOBJ-FLAGS + # 3d style + 0x02FF=uint32,hex,flags,DFFOPT-3DSTYLE-FLAGS + # shape + 0x033F=uint32,hex,flags,DFFOPT-SHAPE-FLAGS + # callout + 0x037F=uint32,hex,flags,DFFOPT-CALLOUT-FLAGS + # group or shape + 0x03BF=uint32,hex,flags,DFFOPT-GROUP-FLAGS + # relative transformation + 0x03FF=uint32,hex,flags,DFFOPT-TRANSFORM-FLAGS + # unknown HTML + 0x043F=uint32,hex,flags,DFFOPT-UHTML-FLAGS + # diagram + 0x053F=uint32,hex,flags,DFFOPT-DIAGRAM-FLAGS + # left line style + 0x0540=uint32,hex,color,DFF-COLOR + 0x0542=uint32,hex,color,DFF-COLOR + 0x057F=uint32,hex,flags,DFFOPT-LINE-FLAGS + # top line style + 0x0580=uint32,hex,color,DFF-COLOR + 0x0582=uint32,hex,color,DFF-COLOR + 0x05BF=uint32,hex,flags,DFFOPT-LINE-FLAGS + # right line style + 0x05C0=uint32,hex,color,DFF-COLOR + 0x05C2=uint32,hex,color,DFF-COLOR + 0x05FF=uint32,hex,flags,DFFOPT-LINE-FLAGS + # bottom line style + 0x0600=uint32,hex,color,DFF-COLOR + 0x0602=uint32,hex,color,DFF-COLOR + 0x063F=uint32,hex,flags,DFFOPT-LINE-FLAGS + # web component + 0x06BF=uint32,hex,flags,DFFOPT-WEBCOMP-FLAGS + # ink data + 0x073F=uint32,hex,flags,DFFOPT-INK-FLAGS + # signature line + 0x07BF=uint32,hex,flags,DFFOPT-SIGLINE-FLAGS + # group or shape #2 +end + +constlist=DFFOPT-COMPLEX-PROPERTIES + 0x0186=uint32,hex,blip,blip + 0x0187=uint32,hex,blip-name,string + 0x0197=uint32,hex,shade-colors,colorarray + 0x0380=uint32,hex,shape-name,string +end + +# common + +combilist=DFFOPT-BLIPOPT + 0x00000003=uint8,dec,type,DFFOPT-BLIPOPT-TYPE + 0x00000004=do-not-save + 0x00000008=linked +end + +shortlist=DFFOPT-BLIPOPT-TYPE,0,comment,file,url + +# transformation + +flagslist=DFFOPT-TRANSFORM-FLAGS + 0x0001=:flip-h + 0x0002=:flip-v +end + +# protection + +flagslist=DFFOPT-PROTECTION-FLAGS + 0x0001=:lock-against-grouping + 0x0002=:lock-adjust-handles + 0x0004=:lock-text + 0x0008=:lock-vertices + 0x0010=:lock-cropping + 0x0020=:lock-against-select + 0x0040=:lock-position + 0x0080=:lock-aspect-ratio + 0x0100=:lock-rotation + 0x0200=:lock-against-ungrouping +end + +# text + +flagslist=DFFOPT-TEXT-FLAGS + 0x0002=:fit-shape-to-text + 0x0008=:auto-text-margin + 0x0010=:select-text + ignore=0x0005 +end + +# text geometry + +flagslist=DFFOPT-TEXTGEO-FLAGS + 0x0001=:strike-through + 0x0002=:small-caps + 0x0004=:shadow + 0x0008=:underline + 0x0010=:italic + 0x0020=:bold + 0x0040=:no-measure-along-path + 0x0080=:normalize + 0x0100=:best-fit + 0x0200=:shrink-to-fit + 0x0400=:stretch-to-fit + 0x0800=:tightening + 0x1000=:kerning + 0x2000=:vertical + 0x4000=:has-effect + 0x8000=:reverse-rows +end + +# picture (BLIP) + +flagslist=DFFOPT-BLIP-FLAGS + 0x0001=:ole-alive + 0x0002=:bi-level-display + 0x0004=:grayscale + 0x0008=:no-hit-test + 0x0010=:loop-anim + 0x0020=:rewind-anim + 0x0040=:preserve-gray +end + +# shape geometry + +flagslist=DFFOPT-GEO-FLAGS + 0x0001=:fill-support + 0x0002=:fill-shade-shape-support + 0x0004=:fontwork-support + 0x0008=:line-support + 0x0010=:3d-support + 0x0020=:shadow-support +end + +# fill style + +shortlist=DFFOPT-FILL-TYPE,0,solid,pattern,texture,picture,edge-shade,linear-shade,shape-shade,point-shade,title-shade,background + +combilist=DFFOPT-FILL-DZTYPE + 0x00000003=uint8,dec,unit,DFFOPT-FILL-DZTYPE-UNIT + 0x0000000C=uint8,dec,aspect,DFFOPT-FILL-DZTYPE-ASPECT +end + +shortlist=DFFOPT-FILL-DZTYPE-UNIT,0,unused,emu,pixel,shape-size-rel +shortlist=DFFOPT-FILL-DZTYPE-ASPECT,0,none,fixed,prefer-largest + +flagslist=DFFOPT-FILL-SHADETYPE + ignore=0x40000000 + 0x00000001=none + 0x00000002=gamma + 0x00000004=sigma-transfer + 0x00000008=flat-band + 0x00000010=one-color +end + +flagslist=DFFOPT-FILL-FLAGS + 0x0001=:no-fill-hit-test + 0x0002=:fill-to-rect + 0x0004=:fill-rel-to-shape + 0x0008=:hit-test-fill + 0x0010=:has-fill + 0x0020=:shape-anchor + 0x0040=:recolor-as-pic +end + +# line style + +flagslist=DFFOPT-LINE-FLAGS + 0x0001=:draw-dash-for-invisible + 0x0002=:fill-rel-to-shape + 0x0004=:hit-test-line + 0x0008=:has-line + 0x0010=:arrowhead-support + 0x0020=:inset-pen-support + 0x0040=:inset-pen + 0x0200=:opaque-back-line +end + +# shadow style + +flagslist=DFFOPT-SHADOW-FLAGS + 0x0001=:obscured-shadow + 0x0002=:has-shadow +end + +# perspective + +flagslist=DFFOPT-PERSP-FLAGS + 0x0001=:has-perspective +end + +# 3d object + +flagslist=DFFOPT-3DOBJ-FLAGS + 0x0001=:light-face + 0x0002=:extrusion-color + 0x0004=:metallic + 0x0008=:has-3d +end + +# 3d style + +flagslist=DFFOPT-3DSTYLE-FLAGS + 0x0001=:fill-color-harsh + 0x0002=:key-color-harsh + 0x0004=:parallel + 0x0008=:rotation-center-auto + 0x0010=:constrain-rotation +end + +# shape + +flagslist=DFFOPT-SHAPE-FLAGS + 0x0001=:background + 0x0004=:initiator + 0x0008=:lock-shape-type + 0x0010=:prefer-rel-resize + 0x0020=:ole-iconified + 0x0040=:flip-v-override + 0x0080=:flip-h-override + 0x0100=:policy-barcode + 0x0200=:policy-label +end + +# callout + +flagslist=DFFOPT-CALLOUT-FLAGS + 0x0001=:length-specified + 0x0002=:drop-auto + 0x0004=:minus-y + 0x0008=:minus-x + 0x0010=:has-text-border + 0x0020=:has-accent-bar + 0x0040=:is-callout +end + +# group or shape + +flagslist=DFFOPT-GROUP-FLAGS + 0x0001=:print + 0x0002=:hidden + 0x0004=:1d-adjustment + 0x0008=:is-button + 0x0010=:notify-double-click + 0x0020=:behind-doc + 0x0040=:wrap-edited + 0x0080=:script-anchor + 0x0100=:really-hidden + 0x0200=:allow-overlap + 0x0400=:user-drawn + 0x0800=:is-hr + 0x1000=:no-shade-hr + 0x2000=:standard-hr + 0x4000=:is-bullet + 0x8000=:layout-in-cell +end + +# unknown HTML + +flagslist=DFFOPT-UHTML-FLAGS + 0x0002=:fake-master + 0x0004=:ole-from-html +end + +# diagram + +flagslist=DFFOPT-DIAGRAM-FLAGS + 0x0001=:pseudo-inline + 0x0002=:do-layout + 0x0004=:reverse + 0x0008=:do-format +end + +# web component + +flagslist=DFFOPT-WEBCOMP-FLAGS + 0x0001=:is-web-component +end + +# ink data + +flagslist=DFFOPT-INK-FLAGS + 0x0001=:render-ink + 0x0002=:render-shape + 0x0004=:hit-test-ink + 0x0008=:ink-annotation +end + +# signature line + +flagslist=DFFOPT-SIGLINE-FLAGS + 0x0001=:is-signature-line + 0x0002=:show-sign-instruction + 0x0004=:show-sign-comment + 0x0008=:show-sign-date +end + +# group or shape #2 + +# DFFSP ---------------------------------------------------------------------- + +combilist=DFFSP-RECORD-INST + include=DFF-RECORD-INST + 0xFFF0=uint16,dec,shape-type,DFFSP-TYPE +end + +multilist=DFFSP-TYPE + 0=not-primitive,rectangle,round-rectangle,ellipse,diamond,isoceles-triangle,right-triangle,parallelogram,trapezoid,hexagon + 10=octagon,plus,star,arrow,thick-arrow,home-plate,cube,balloon,seal,arc + 20=line,plaque,can,donut,text-simple,text-octagon,text-hexagon,text-curve,text-wave,text-ring + 30=text-on-curve,text-on-ring,straight-connector-1,bent-connector-2,bent-connector-3,bent-connector-4,bent-connector-5,curved-connector-2,curved-connector-3,curved-connector-4 + 40=curved-connector-5,callout-1,callout-2,callout-3,accent-callout-1,accent-callout-2,accent-callout-3,border-callout-1,border-callout-2,border-callout-3 + 50=accent-border-callout-1,accent-border-callout-2,accent-border-callout-3,ribbon,ribbon-2,chevron,pentagon,no-smoking,seal-8,seal-16 + 60=seal-32,wedge-rect-callout,wedge-rrect-callout,wedge-ellipse-callout,wave,folded-corner,left-arrow,down-arrow,up-arrow,left-right-arrow + 70=up-down-arrow,irregular-seal-1,irregular-seal-2,lightning-bolt,heart,picture-frame,quad-arrow,left-arrow-callout,right-arrow-callout,up-arrow-callout + 80=down-arrow-callout,left-right-arrow-callout,up-down-arrow-callout,quad-arrow-callout,bevel,left-bracket,right-bracket,left-brace,right-brace,left-up-arrow + 90=bent-up-arrow,bent-arrow,seal-24,striped-right-arrow,notched-right-arrow,block-arc,smiley-face,vertical-scroll,horizontal-scroll,circular-arrow + 100=notched-circular-arrow,uturn-arrow,curved-right-arrow,curved-left-arrow,curved-up-arrow,curved-down-arrow,cloud-callout,ellipse-ribbon,ellipse-ribbon-2,flow-chart-process + 110=flow-chart-decision,flow-chart-input-output,flow-chart-predefined-process,flow-chart-internal-storage,flow-chart-document,flow-chart-multidocument,flow-chart-terminator,flow-chart-preparation,flow-chart-manual-input,flow-chart-manual-operation + 120=flow-chart-connector,flow-chart-punched-card,flow-chart-punched-tape,flow-chart-summing-junction,flow-chart-or,flow-chart-collate,flow-chart-sort,flow-chart-extract,flow-chart-merge,flow-chart-offline-storage + 130=flow-chart-online-storage,flow-chart-magnetic-tape,flow-chart-magnetic-disk,flow-chart-magnetic-drum,flow-chart-display,flow-chart-delay,text-plain-text,text-stop,text-triangle,text-triangle-inverted + 140=text-chevron,text-chevron-inverted,text-ring-inside,text-ring-outside,text-arch-up-curve,text-arch-down-curve,text-circle-curve,text-button-curve,text-arch-up-pour,text-arch-down-pour + 150=text-circle-pour,text-button-pour,text-curve-up,text-curve-down,text-cascade-up,text-cascade-down,text-wave-1,text-wave-2,text-wave-3,text-wave-4 + 160=text-inflate,text-deflate,text-inflate-bottom,text-deflate-bottom,text-inflate-top,text-deflate-top,text-deflate-inflate,text-deflate-inflate-deflate,text-fade-right,text-fade-left + 170=text-fade-up,text-fade-down,text-slant-up,text-slant-down,text-can-up,text-can-down,flow-chart-alternate-process,flow-chart-offpage-connector,callout-90,accent-callout-90 + 180=border-callout-90,accent-border-callout-90,left-right-up-arrow,sun,moon,bracket-pair,brace-pair,seal-4,double-wave,action-button-blank + 190=action-button-home,action-button-help,action-button-information,action-button-forward-next,action-button-back-previous,action-button-end,action-button-beginning,action-button-return,action-button-document,action-button-sound + 200=action-button-movie,host-control,text-box +end + +flagslist=DFFSP-FLAGS + 0x00000001=group + 0x00000002=child + 0x00000004=patriarch + 0x00000008=deleted + 0x00000010=ole + 0x00000020=has-master + 0x00000040=flip-horizontal + 0x00000080=flip-vertical + 0x00000100=connector + 0x00000200=has-anchor + 0x00000400=background + 0x00000800=has-shape-type +end + +# DFFSPLITMENUCOLORS --------------------------------------------------------- + +combilist=DFFSPLITMENUC-RECORD-INST + include=DFF-RECORD-INST + 0xFFF0=uint16,dec,color-count +end + +# ============================================================================ diff --git a/oox/source/dump/dumperbase.cxx b/oox/source/dump/dumperbase.cxx new file mode 100644 index 000000000..61d603228 --- /dev/null +++ b/oox/source/dump/dumperbase.cxx @@ -0,0 +1,2580 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef DBG_UTIL + +namespace oox::dump { + +using namespace ::com::sun::star; +using namespace ::com::sun::star::beans; +using namespace ::com::sun::star::io; +using namespace ::com::sun::star::lang; +using namespace ::com::sun::star::ucb; +using namespace ::com::sun::star::uno; + +using ::oox::core::FilterBase; + +namespace { + +const sal_Unicode OOX_DUMP_BOM = 0xFEFF; +const sal_Int32 OOX_DUMP_MAXSTRLEN = 80; +const sal_Int32 OOX_DUMP_INDENT = 2; +const sal_Unicode OOX_DUMP_BINDOT = '.'; +const sal_Unicode OOX_DUMP_CFG_LISTSEP = ','; +const sal_Unicode OOX_DUMP_CFG_QUOTE = '\''; +const sal_Unicode OOX_DUMP_LF = '\n'; +const sal_Unicode OOX_DUMP_ITEMSEP = '='; +const sal_Int32 OOX_DUMP_BYTESPERLINE = 16; +const sal_Int64 OOX_DUMP_MAXARRAY = 16; + +} // namespace + +// file names ----------------------------------------------------------------- + +OUString InputOutputHelper::convertFileNameToUrl( const OUString& rFileName ) +{ + OUString aFileUrl; + if( ::osl::FileBase::getFileURLFromSystemPath( rFileName, aFileUrl ) == ::osl::FileBase::E_None ) + return aFileUrl; + return OUString(); +} + +sal_Int32 InputOutputHelper::getFileNamePos( std::u16string_view rFileUrl ) +{ + size_t nSepPos = rFileUrl.find( '/' ); + return (nSepPos == std::u16string_view::npos) ? 0 : (nSepPos + 1); +} + +std::u16string_view InputOutputHelper::getFileNameExtension( std::u16string_view rFileUrl ) +{ + sal_Int32 nNamePos = getFileNamePos( rFileUrl ); + size_t nExtPos = rFileUrl.rfind( '.' ); + if( nExtPos != std::u16string_view::npos && static_cast(nExtPos) >= nNamePos ) + return rFileUrl.substr( nExtPos + 1 ); + return std::u16string_view(); +} + +// input streams -------------------------------------------------------------- + +Reference< XInputStream > InputOutputHelper::openInputStream( + const Reference< XComponentContext >& rxContext, const OUString& rFileName ) +{ + Reference< XInputStream > xInStrm; + if( rxContext.is() ) try + { + Reference xFileAccess(SimpleFileAccess::create(rxContext)); + xInStrm = xFileAccess->openFileRead( rFileName ); + } + catch( Exception& ) + { + } + return xInStrm; +} + +// output streams ------------------------------------------------------------- + +Reference< XOutputStream > InputOutputHelper::openOutputStream( + const Reference< XComponentContext >& rxContext, const OUString& rFileName ) +{ + Reference< XOutputStream > xOutStrm; + if( rxContext.is() ) try + { + Reference xFileAccess(SimpleFileAccess::create(rxContext)); + xOutStrm = xFileAccess->openFileWrite( rFileName ); + } + catch( Exception& ) + { + } + return xOutStrm; +} + +Reference< XTextOutputStream2 > InputOutputHelper::openTextOutputStream( + const Reference< XComponentContext >& rxContext, const Reference< XOutputStream >& rxOutStrm, rtl_TextEncoding eTextEnc ) +{ + Reference< XTextOutputStream2 > xTextOutStrm; + const char* pcCharset = rtl_getMimeCharsetFromTextEncoding( eTextEnc ); + if( rxContext.is() && rxOutStrm.is() && pcCharset ) try + { + xTextOutStrm = TextOutputStream::create(rxContext); + xTextOutStrm->setOutputStream( rxOutStrm ); + xTextOutStrm->setEncoding( OUString::createFromAscii( pcCharset ) ); + } + catch( Exception& ) + { + } + return xTextOutStrm; +} + +Reference< XTextOutputStream2 > InputOutputHelper::openTextOutputStream( + const Reference< XComponentContext >& rxContext, const OUString& rFileName, rtl_TextEncoding eTextEnc ) +{ + return openTextOutputStream( rxContext, openOutputStream( rxContext, rFileName ), eTextEnc ); +} + +ItemFormat::ItemFormat() : + meDataType( DATATYPE_VOID ), + meFmtType( FORMATTYPE_NONE ) +{ +} + +void ItemFormat::set( DataType eDataType, FormatType eFmtType, const OUString& rItemName ) +{ + meDataType = eDataType; + meFmtType = eFmtType; + maItemName = rItemName; + maListName.clear(); +} + +OUStringVector::const_iterator ItemFormat::parse( const OUStringVector& rFormatVec ) +{ + set( DATATYPE_VOID, FORMATTYPE_NONE, OUString() ); + + OUStringVector::const_iterator aIt = rFormatVec.begin(), aEnd = rFormatVec.end(); + OUString aDataType, aFmtType; + if( aIt != aEnd ) aDataType = *aIt++; + if( aIt != aEnd ) aFmtType = *aIt++; + if( aIt != aEnd ) maItemName = *aIt++; + if( aIt != aEnd ) maListName = *aIt++; + + meDataType = StringHelper::convertToDataType( aDataType ); + meFmtType = StringHelper::convertToFormatType( aFmtType ); + + if( meFmtType == FORMATTYPE_NONE ) + { + if ( aFmtType == "unused" ) + set( meDataType, FORMATTYPE_HEX, OOX_DUMP_UNUSED ); + else if ( aFmtType == "unknown" ) + set( meDataType, FORMATTYPE_HEX, OOX_DUMP_UNKNOWN ); + } + + return aIt; +} + +OUStringVector ItemFormat::parse( const OUString& rFormatStr ) +{ + OUStringVector aFormatVec; + StringHelper::convertStringToStringList( aFormatVec, rFormatStr, false ); + OUStringVector::const_iterator aIt = parse( aFormatVec ); + return OUStringVector( aIt, const_cast< const OUStringVector& >( aFormatVec ).end() ); +} + +// append string to string ---------------------------------------------------- + +void StringHelper::appendChar( OUStringBuffer& rStr, sal_Unicode cChar, sal_Int32 nCount ) +{ + for( sal_Int32 nIndex = 0; nIndex < nCount; ++nIndex ) + rStr.append( cChar ); +} + +void StringHelper::appendString( OUStringBuffer& rStr, const OUString& rData, sal_Int32 nWidth, sal_Unicode cFill ) +{ + appendChar( rStr, cFill, nWidth - rData.getLength() ); + rStr.append( rData ); +} + +// append decimal ------------------------------------------------------------- + +void StringHelper::appendDec( OUStringBuffer& rStr, sal_uInt8 nData, sal_Int32 nWidth, sal_Unicode cFill ) +{ + appendString( rStr, OUString::number( nData ), nWidth, cFill ); +} + +void StringHelper::appendDec( OUStringBuffer& rStr, sal_Int8 nData, sal_Int32 nWidth, sal_Unicode cFill ) +{ + appendString( rStr, OUString::number( nData ), nWidth, cFill ); +} + +void StringHelper::appendDec( OUStringBuffer& rStr, sal_uInt16 nData, sal_Int32 nWidth, sal_Unicode cFill ) +{ + appendString( rStr, OUString::number( nData ), nWidth, cFill ); +} + +void StringHelper::appendDec( OUStringBuffer& rStr, sal_Int16 nData, sal_Int32 nWidth, sal_Unicode cFill ) +{ + appendString( rStr, OUString::number( nData ), nWidth, cFill ); +} + +void StringHelper::appendDec( OUStringBuffer& rStr, sal_uInt32 nData, sal_Int32 nWidth, sal_Unicode cFill ) +{ + appendString( rStr, OUString::number( nData ), nWidth, cFill ); +} + +void StringHelper::appendDec( OUStringBuffer& rStr, sal_Int32 nData, sal_Int32 nWidth, sal_Unicode cFill ) +{ + appendString( rStr, OUString::number( nData ), nWidth, cFill ); +} + +void StringHelper::appendDec( OUStringBuffer& rStr, sal_uInt64 nData, sal_Int32 nWidth, sal_Unicode cFill ) +{ + /* Values greater than biggest signed 64bit integer will change to + negative when converting to sal_Int64. Therefore, the trailing digit + will be written separately. */ + OUStringBuffer aBuffer; + if( nData > 9 ) + aBuffer.append( static_cast(nData / 10 ) ); + aBuffer.append( static_cast< sal_Unicode >( '0' + (nData % 10) ) ); + appendString( rStr, aBuffer.makeStringAndClear(), nWidth, cFill ); +} + +void StringHelper::appendDec( OUStringBuffer& rStr, sal_Int64 nData, sal_Int32 nWidth, sal_Unicode cFill ) +{ + appendString( rStr, OUString::number( nData ), nWidth, cFill ); +} + +void StringHelper::appendDec( OUStringBuffer& rStr, double fData, sal_Int32 nWidth, sal_Unicode cFill ) +{ + appendString( rStr, ::rtl::math::doubleToUString( fData, rtl_math_StringFormat_G, 15, '.', true ), nWidth, cFill ); +} + +// append hexadecimal --------------------------------------------------------- + +void StringHelper::appendHex( OUStringBuffer& rStr, sal_uInt8 nData, bool bPrefix ) +{ + static const sal_Unicode spcHexDigits[] = { '0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F' }; + if( bPrefix ) + rStr.append( "0x" ); + rStr.append( spcHexDigits[ (nData >> 4) & 0x0F ] ).append( spcHexDigits[ nData & 0x0F ] ); +} + +void StringHelper::appendHex( OUStringBuffer& rStr, sal_Int8 nData, bool bPrefix ) +{ + appendHex( rStr, static_cast< sal_uInt8 >( nData ), bPrefix ); +} + +void StringHelper::appendHex( OUStringBuffer& rStr, sal_uInt16 nData, bool bPrefix ) +{ + appendHex( rStr, static_cast< sal_uInt8 >( nData >> 8 ), bPrefix ); + appendHex( rStr, static_cast< sal_uInt8 >( nData ), false ); +} + +void StringHelper::appendHex( OUStringBuffer& rStr, sal_Int16 nData, bool bPrefix ) +{ + appendHex( rStr, static_cast< sal_uInt16 >( nData ), bPrefix ); +} + +void StringHelper::appendHex( OUStringBuffer& rStr, sal_uInt32 nData, bool bPrefix ) +{ + appendHex( rStr, static_cast< sal_uInt16 >( nData >> 16 ), bPrefix ); + appendHex( rStr, static_cast< sal_uInt16 >( nData ), false ); +} + +void StringHelper::appendHex( OUStringBuffer& rStr, sal_Int32 nData, bool bPrefix ) +{ + appendHex( rStr, static_cast< sal_uInt32 >( nData ), bPrefix ); +} + +void StringHelper::appendHex( OUStringBuffer& rStr, sal_uInt64 nData, bool bPrefix ) +{ + appendHex( rStr, static_cast< sal_uInt32 >( nData >> 32 ), bPrefix ); + appendHex( rStr, static_cast< sal_uInt32 >( nData ), false ); +} + +void StringHelper::appendHex( OUStringBuffer& rStr, sal_Int64 nData, bool bPrefix ) +{ + appendHex( rStr, static_cast< sal_uInt64 >( nData ), bPrefix ); +} + +static sal_uInt64 +lcl_ConvertDouble(double const f) +{ + sal_uInt64 i = sal_uInt64(); + for (size_t j = 0; j < sizeof(double); ++j) + { // hopefully both endian independent and strict aliasing safe + reinterpret_cast(&i)[j] = reinterpret_cast(&f)[j]; + } + return i; +} + +void StringHelper::appendHex( OUStringBuffer& rStr, double fData, bool bPrefix ) +{ + appendHex( rStr, lcl_ConvertDouble(fData), bPrefix ); +} + +// append shortened hexadecimal ----------------------------------------------- + +void StringHelper::appendShortHex( OUStringBuffer& rStr, sal_uInt8 nData, bool bPrefix ) +{ + appendHex( rStr, nData, bPrefix ); +} + +void StringHelper::appendShortHex( OUStringBuffer& rStr, sal_Int8 nData, bool bPrefix ) +{ + appendHex( rStr, nData, bPrefix ); +} + +void StringHelper::appendShortHex( OUStringBuffer& rStr, sal_uInt16 nData, bool bPrefix ) +{ + if( nData > SAL_MAX_UINT8 ) + appendHex( rStr, nData, bPrefix ); + else + appendHex( rStr, static_cast< sal_uInt8 >( nData ), bPrefix ); +} + +void StringHelper::appendShortHex( OUStringBuffer& rStr, sal_Int16 nData, bool bPrefix ) +{ + appendShortHex( rStr, static_cast< sal_uInt16 >( nData ), bPrefix ); +} + +void StringHelper::appendShortHex( OUStringBuffer& rStr, sal_uInt32 nData, bool bPrefix ) +{ + if( nData > SAL_MAX_UINT16 ) + appendHex( rStr, nData, bPrefix ); + else + appendShortHex( rStr, static_cast< sal_uInt16 >( nData ), bPrefix ); +} + +void StringHelper::appendShortHex( OUStringBuffer& rStr, sal_Int32 nData, bool bPrefix ) +{ + appendShortHex( rStr, static_cast< sal_uInt32 >( nData ), bPrefix ); +} + +void StringHelper::appendShortHex( OUStringBuffer& rStr, sal_uInt64 nData, bool bPrefix ) +{ + if( nData > SAL_MAX_UINT32 ) + appendHex( rStr, nData, bPrefix ); + else + appendShortHex( rStr, static_cast< sal_uInt32 >( nData ), bPrefix ); +} + +void StringHelper::appendShortHex( OUStringBuffer& rStr, sal_Int64 nData, bool bPrefix ) +{ + appendShortHex( rStr, static_cast< sal_uInt64 >( nData ), bPrefix ); +} + +void StringHelper::appendShortHex( OUStringBuffer& rStr, double fData, bool bPrefix ) +{ + appendHex( rStr, fData, bPrefix ); +} + +// append binary -------------------------------------------------------------- + +void StringHelper::appendBin( OUStringBuffer& rStr, sal_uInt8 nData, bool bDots ) +{ + for( sal_uInt8 nMask = 0x80; nMask != 0; (nMask >>= 1) &= 0x7F ) + { + rStr.append( static_cast< sal_Unicode >( (nData & nMask) ? '1' : '0' ) ); + if( bDots && (nMask == 0x10) ) + rStr.append( OOX_DUMP_BINDOT ); + } +} + +void StringHelper::appendBin( OUStringBuffer& rStr, sal_Int8 nData, bool bDots ) +{ + appendBin( rStr, static_cast< sal_uInt8 >( nData ), bDots ); +} + +void StringHelper::appendBin( OUStringBuffer& rStr, sal_uInt16 nData, bool bDots ) +{ + appendBin( rStr, static_cast< sal_uInt8 >( nData >> 8 ), bDots ); + if( bDots ) + rStr.append( OOX_DUMP_BINDOT ); + appendBin( rStr, static_cast< sal_uInt8 >( nData ), bDots ); +} + +void StringHelper::appendBin( OUStringBuffer& rStr, sal_Int16 nData, bool bDots ) +{ + appendBin( rStr, static_cast< sal_uInt16 >( nData ), bDots ); +} + +void StringHelper::appendBin( OUStringBuffer& rStr, sal_uInt32 nData, bool bDots ) +{ + appendBin( rStr, static_cast< sal_uInt16 >( nData >> 16 ), bDots ); + if( bDots ) + rStr.append( OOX_DUMP_BINDOT ); + appendBin( rStr, static_cast< sal_uInt16 >( nData ), bDots ); +} + +void StringHelper::appendBin( OUStringBuffer& rStr, sal_Int32 nData, bool bDots ) +{ + appendBin( rStr, static_cast< sal_uInt32 >( nData ), bDots ); +} + +void StringHelper::appendBin( OUStringBuffer& rStr, sal_uInt64 nData, bool bDots ) +{ + appendBin( rStr, static_cast< sal_uInt32 >( nData >> 32 ), bDots ); + if( bDots ) + rStr.append( OOX_DUMP_BINDOT ); + appendBin( rStr, static_cast< sal_uInt32 >( nData ), bDots ); +} + +void StringHelper::appendBin( OUStringBuffer& rStr, sal_Int64 nData, bool bDots ) +{ + appendBin( rStr, static_cast< sal_uInt64 >( nData ), bDots ); +} + +void StringHelper::appendBin( OUStringBuffer& rStr, double fData, bool bDots ) +{ + appendBin( rStr, lcl_ConvertDouble(fData), bDots ); +} + +// append formatted value ----------------------------------------------------- + +void StringHelper::appendBool( OUStringBuffer& rStr, bool bData ) +{ + rStr.appendAscii( bData ? "true" : "false" ); +} + +// encoded text output -------------------------------------------------------- + +void StringHelper::appendCChar( OUStringBuffer& rStr, sal_Unicode cChar, bool bPrefix ) +{ + if( cChar > 0x00FF ) + { + if( bPrefix ) + rStr.append( "\\u" ); + appendHex( rStr, static_cast< sal_uInt16 >( cChar ), false ); + } + else + { + if( bPrefix ) + rStr.append( "\\x" ); + appendHex( rStr, static_cast< sal_uInt8 >( cChar ), false ); + } +} + +void StringHelper::appendEncChar( OUStringBuffer& rStr, sal_Unicode cChar, sal_Int32 nCount, bool bPrefix ) +{ + if( cChar < 0x0020 ) + { + // C-style hex code + OUStringBuffer aCode; + appendCChar( aCode, cChar, bPrefix ); + OUString aCodeStr = aCode.makeStringAndClear(); + for( sal_Int32 nIdx = 0; nIdx < nCount; ++nIdx ) + rStr.append( aCodeStr ); + } + else + { + appendChar( rStr, cChar, nCount ); + } +} + +void StringHelper::appendEncString( OUStringBuffer& rStr, const OUString& rData, bool bPrefix ) +{ + sal_Int32 nBeg = 0; + sal_Int32 nIdx = 0; + sal_Int32 nEnd = rData.getLength(); + while( nIdx < nEnd ) + { + // find next character that needs encoding + while( (nIdx < nEnd) && (rData[ nIdx ] >= 0x20) ) ++nIdx; + // append portion + if( nBeg < nIdx ) + { + if( (nBeg == 0) && (nIdx == nEnd) ) + rStr.append( rData ); + else + rStr.append( rData.subView(nBeg, nIdx - nBeg) ); + } + // append characters to be encoded + while( (nIdx < nEnd) && (rData[ nIdx ] < 0x20) ) + { + appendCChar( rStr, rData[ nIdx ], bPrefix ); + ++nIdx; + } + // adjust limits + nBeg = nIdx; + } +} + +// token list ----------------------------------------------------------------- + +void StringHelper::appendToken( OUStringBuffer& rStr, std::u16string_view rToken, sal_Unicode cSep ) +{ + if( (rStr.getLength() > 0) && (!rToken.empty()) ) + rStr.append( cSep ); + rStr.append( rToken ); +} + +void StringHelper::appendIndex( OUStringBuffer& rStr, sal_Int64 nIdx ) +{ + OUStringBuffer aToken; + appendDec( aToken, nIdx ); + rStr.append( '[' ).append( aToken.makeStringAndClear() ).append( ']' ); +} + +std::u16string_view StringHelper::getToken( std::u16string_view rData, sal_Int32& rnPos, sal_Unicode cSep ) +{ + return trimSpaces( o3tl::getToken(rData, 0, cSep, rnPos ) ); +} + +void StringHelper::enclose( OUStringBuffer& rStr, sal_Unicode cOpen, sal_Unicode cClose ) +{ + rStr.insert( 0, cOpen ).append( cClose ? cClose : cOpen ); +} + +// string conversion ---------------------------------------------------------- + +namespace { + +sal_Int32 lclIndexOf( const OUString& rStr, sal_Unicode cChar, sal_Int32 nStartPos ) +{ + sal_Int32 nIndex = rStr.indexOf( cChar, nStartPos ); + return (nIndex < 0) ? rStr.getLength() : nIndex; +} + +OUString lclTrimQuotedStringList( const OUString& rStr ) +{ + OUStringBuffer aBuffer; + sal_Int32 nPos = 0; + sal_Int32 nLen = rStr.getLength(); + while( nPos < nLen ) + { + if( rStr[ nPos ] == OOX_DUMP_CFG_QUOTE ) + { + // quoted string, skip leading quote character + ++nPos; + // process quoted text and embedded literal quote characters + OUStringBuffer aToken; + do + { + // seek to next quote character and add text portion to token buffer + sal_Int32 nEnd = lclIndexOf( rStr, OOX_DUMP_CFG_QUOTE, nPos ); + aToken.append( rStr.subView(nPos, nEnd - nPos) ); + // process literal quotes + while( (nEnd + 1 < nLen) && (rStr[ nEnd ] == OOX_DUMP_CFG_QUOTE) && (rStr[ nEnd + 1 ] == OOX_DUMP_CFG_QUOTE) ) + { + aToken.append( OOX_DUMP_CFG_QUOTE ); + nEnd += 2; + } + // nEnd is start of possible next text portion + nPos = nEnd; + } + while( (nPos < nLen) && (rStr[ nPos ] != OOX_DUMP_CFG_QUOTE) ); + // add token, seek to list separator, ignore text following closing quote + aBuffer.append( aToken.makeStringAndClear() ); + nPos = lclIndexOf( rStr, OOX_DUMP_CFG_LISTSEP, nPos ); + if( nPos < nLen ) + aBuffer.append( OOX_DUMP_LF ); + // set current position behind list separator + ++nPos; + } + else + { + // find list separator, add token text to buffer + sal_Int32 nEnd = lclIndexOf( rStr, OOX_DUMP_CFG_LISTSEP, nPos ); + aBuffer.append( rStr.subView(nPos, nEnd - nPos) ); + if( nEnd < nLen ) + aBuffer.append( OOX_DUMP_LF ); + // set current position behind list separator + nPos = nEnd + 1; + } + } + + return aBuffer.makeStringAndClear(); +} + +} // namespace + +std::u16string_view StringHelper::trimSpaces( std::u16string_view rStr ) +{ + size_t nBeg = 0; + while( (nBeg < rStr.size()) && ((rStr[ nBeg ] == ' ') || (rStr[ nBeg ] == '\t')) ) + ++nBeg; + size_t nEnd = rStr.size(); + while( (nEnd > nBeg) && ((rStr[ nEnd - 1 ] == ' ') || (rStr[ nEnd - 1 ] == '\t')) ) + --nEnd; + return rStr.substr( nBeg, nEnd - nBeg ); +} + +OUString StringHelper::trimTrailingNul( const OUString& rStr ) +{ + sal_Int32 nLastPos = rStr.getLength() - 1; + if( (nLastPos >= 0) && (rStr[ nLastPos ] == 0) ) + return rStr.copy( 0, nLastPos ); + return rStr; +} + +OString StringHelper::convertToUtf8( std::u16string_view rStr ) +{ + return OUStringToOString( rStr, RTL_TEXTENCODING_UTF8 ); +} + +DataType StringHelper::convertToDataType( std::u16string_view rStr ) +{ + DataType eType = DATATYPE_VOID; + if ( rStr == u"int8" ) + eType = DATATYPE_INT8; + else if ( rStr == u"uint8" ) + eType = DATATYPE_UINT8; + else if ( rStr == u"int16" ) + eType = DATATYPE_INT16; + else if ( rStr == u"uint16" ) + eType = DATATYPE_UINT16; + else if ( rStr == u"int32" ) + eType = DATATYPE_INT32; + else if ( rStr == u"uint32" ) + eType = DATATYPE_UINT32; + else if ( rStr == u"int64" ) + eType = DATATYPE_INT64; + else if ( rStr == u"uint64" ) + eType = DATATYPE_UINT64; + else if ( rStr == u"float" ) + eType = DATATYPE_FLOAT; + else if ( rStr == u"double" ) + eType = DATATYPE_DOUBLE; + return eType; +} + +FormatType StringHelper::convertToFormatType( std::u16string_view rStr ) +{ + FormatType eType = FORMATTYPE_NONE; + if ( rStr == u"dec" ) + eType = FORMATTYPE_DEC; + else if ( rStr == u"hex" ) + eType = FORMATTYPE_HEX; + else if ( rStr == u"shorthex" ) + eType = FORMATTYPE_SHORTHEX; + else if ( rStr == u"bin" ) + eType = FORMATTYPE_BIN; + else if ( rStr == u"fix" ) + eType = FORMATTYPE_FIX; + else if ( rStr == u"bool" ) + eType = FORMATTYPE_BOOL; + return eType; +} + +bool StringHelper::convertFromDec( sal_Int64& ornData, std::u16string_view rData ) +{ + size_t nPos = 0; + size_t nLen = rData.size(); + bool bNeg = false; + if( (nLen > 0) && (rData[ 0 ] == '-') ) + { + bNeg = true; + ++nPos; + } + ornData = 0; + for( ; nPos < nLen; ++nPos ) + { + sal_Unicode cChar = rData[ nPos ]; + if( (cChar < '0') || (cChar > '9') ) + return false; + ornData = (ornData * 10) + (cChar - '0'); + } + if( bNeg ) + ornData *= -1; + return true; +} + +bool StringHelper::convertFromHex( sal_Int64& ornData, std::u16string_view rData ) +{ + ornData = 0; + for( size_t nPos = 0, nLen = rData.size(); nPos < nLen; ++nPos ) + { + sal_Unicode cChar = rData[ nPos ]; + if( ('0' <= cChar) && (cChar <= '9') ) + cChar -= '0'; + else if( ('A' <= cChar) && (cChar <= 'F') ) + cChar -= ('A' - 10); + else if( ('a' <= cChar) && (cChar <= 'f') ) + cChar -= ('a' - 10); + else + return false; + ornData = (ornData << 4) + cChar; + } + return true; +} + +bool StringHelper::convertStringToInt( sal_Int64& ornData, std::u16string_view rData ) +{ + if( (rData.size() > 2) && (rData[ 0 ] == '0') && ((rData[ 1 ] == 'X') || (rData[ 1 ] == 'x')) ) + return convertFromHex( ornData, rData.substr( 2 ) ); + return convertFromDec( ornData, rData ); +} + +bool StringHelper::convertStringToDouble( double& orfData, std::u16string_view rData ) +{ + rtl_math_ConversionStatus eStatus = rtl_math_ConversionStatus_Ok; + sal_Int32 nSize = 0; + sal_Unicode const * pBegin = rData.data(); + sal_Unicode const * pEnd; + orfData = rtl_math_uStringToDouble(pBegin, + pBegin + rData.size(), + '.', '\0', + &eStatus, &pEnd); + nSize = static_cast(pEnd - pBegin); + return (eStatus == rtl_math_ConversionStatus_Ok) && (nSize == static_cast(rData.size())); +} + +bool StringHelper::convertStringToBool( std::u16string_view rData ) +{ + if ( rData == u"true" ) + return true; + if ( rData == u"false" ) + return false; + sal_Int64 nData; + return convertStringToInt( nData, rData ) && (nData != 0); +} + +OUStringPair StringHelper::convertStringToPair( const OUString& rString, sal_Unicode cSep ) +{ + OUStringPair aPair; + if( !rString.isEmpty() ) + { + sal_Int32 nEqPos = rString.indexOf( cSep ); + if( nEqPos < 0 ) + { + aPair.first = rString; + } + else + { + aPair.first = StringHelper::trimSpaces( rString.subView( 0, nEqPos ) ); + aPair.second = StringHelper::trimSpaces( rString.subView( nEqPos + 1 ) ); + } + } + return aPair; +} + +void StringHelper::convertStringToStringList( OUStringVector& orVec, const OUString& rData, bool bIgnoreEmpty ) +{ + orVec.clear(); + OUString aUnquotedData = lclTrimQuotedStringList( rData ); + sal_Int32 nPos = 0; + sal_Int32 nLen = aUnquotedData.getLength(); + while( (0 <= nPos) && (nPos < nLen) ) + { + std::u16string_view aToken = getToken( aUnquotedData, nPos, OOX_DUMP_LF ); + if( !bIgnoreEmpty || !aToken.empty() ) + orVec.push_back( OUString(aToken) ); + } +} + +void StringHelper::convertStringToIntList( Int64Vector& orVec, const OUString& rData, bool bIgnoreEmpty ) +{ + orVec.clear(); + OUString aUnquotedData = lclTrimQuotedStringList( rData ); + sal_Int32 nPos = 0; + sal_Int32 nLen = aUnquotedData.getLength(); + sal_Int64 nData; + while( (0 <= nPos) && (nPos < nLen) ) + { + bool bOk = convertStringToInt( nData, getToken( aUnquotedData, nPos, OOX_DUMP_LF ) ); + if( !bIgnoreEmpty || bOk ) + orVec.push_back( bOk ? nData : 0 ); + } +} + +Base::~Base() +{ +} + +ConfigItemBase::~ConfigItemBase() +{ +} + +void ConfigItemBase::readConfigBlock( TextInputStream& rStrm ) +{ + readConfigBlockContents( rStrm ); +} + +void ConfigItemBase::implProcessConfigItemStr( + TextInputStream& /*rStrm*/, const OUString& /*rKey*/, const OUString& /*rData*/ ) +{ +} + +void ConfigItemBase::implProcessConfigItemInt( + TextInputStream& /*rStrm*/, sal_Int64 /*nKey*/, const OUString& /*rData*/ ) +{ +} + +void ConfigItemBase::readConfigBlockContents( TextInputStream& rStrm ) +{ + bool bLoop = true; + while( bLoop && !rStrm.isEof() ) + { + OUString aKey, aData; + switch( readConfigLine( rStrm, aKey, aData ) ) + { + case LINETYPE_DATA: + processConfigItem( rStrm, aKey, aData ); + break; + case LINETYPE_END: + bLoop = false; + break; + } + } +} + +ConfigItemBase::LineType ConfigItemBase::readConfigLine( + TextInputStream& rStrm, OUString& orKey, OUString& orData ) +{ + OUString aLine; + while( !rStrm.isEof() && aLine.isEmpty() ) + { + aLine = rStrm.readLine(); + if( !aLine.isEmpty() && (aLine[ 0 ] == OOX_DUMP_BOM) ) + aLine = aLine.copy( 1 ); + aLine = StringHelper::trimSpaces( aLine ); + if( !aLine.isEmpty() ) + { + // ignore comments (starting with hash or semicolon) + sal_Unicode cChar = aLine[ 0 ]; + if( (cChar == '#') || (cChar == ';') ) + aLine.clear(); + } + } + + OUStringPair aPair = StringHelper::convertStringToPair( aLine ); + orKey = aPair.first; + orData = aPair.second; + return ( !orKey.isEmpty() && (!orData.isEmpty() || orKey != "end" )) ? + LINETYPE_DATA : LINETYPE_END; +} + +void ConfigItemBase::processConfigItem( + TextInputStream& rStrm, const OUString& rKey, const OUString& rData ) +{ + sal_Int64 nKey; + if( StringHelper::convertStringToInt( nKey, rKey ) ) + implProcessConfigItemInt( rStrm, nKey, rData ); + else + implProcessConfigItemStr( rStrm, rKey, rData ); +} + +NameListBase::~NameListBase() +{ +} + +void NameListBase::setName( sal_Int64 nKey, const String& rName ) +{ + implSetName( nKey, rName ); +} + +void NameListBase::includeList( const NameListRef& rxList ) +{ + if( rxList ) + { + for (auto const& elem : *rxList) + maMap[ elem.first ] = elem.second; + implIncludeList( *rxList ); + } +} + +bool NameListBase::implIsValid() const +{ + return true; +} + +void NameListBase::implProcessConfigItemStr( + TextInputStream& rStrm, const OUString& rKey, const OUString& rData ) +{ + if ( rKey == "include" ) + include( rData ); + else if ( rKey == "exclude" ) + exclude( rData ); + else + ConfigItemBase::implProcessConfigItemStr( rStrm, rKey, rData ); +} + +void NameListBase::implProcessConfigItemInt( + TextInputStream& /*rStrm*/, sal_Int64 nKey, const OUString& rData ) +{ + implSetName( nKey, rData ); +} + +void NameListBase::insertRawName( sal_Int64 nKey, const OUString& rName ) +{ + maMap[ nKey ] = rName; +} + +const OUString* NameListBase::findRawName( sal_Int64 nKey ) const +{ + const_iterator aIt = maMap.find( nKey ); + return (aIt == end()) ? nullptr : &aIt->second; +} + +void NameListBase::include( const OUString& rListKeys ) +{ + OUStringVector aVec; + StringHelper::convertStringToStringList( aVec, rListKeys, true ); + for (auto const& elem : aVec) + includeList( mrCfgData.getNameList(elem) ); +} + +void NameListBase::exclude( const OUString& rKeys ) +{ + Int64Vector aVec; + StringHelper::convertStringToIntList( aVec, rKeys, true ); + for (auto const& elem : aVec) + maMap.erase(elem); +} + +void ItemFormatMap::insertFormats( const NameListRef& rxNameList ) +{ + if( Base::isValid( rxNameList ) ) + { + for (auto const& elemName : *rxNameList) + maMap[ elemName.first ].parse( elemName.second ); + } +} + +ConstList::ConstList( const SharedConfigData& rCfgData ) : + NameListBase( rCfgData ), + maDefName( OOX_DUMP_ERR_NONAME ), + mbQuoteNames( false ) +{ +} + +void ConstList::implProcessConfigItemStr( + TextInputStream& rStrm, const OUString& rKey, const OUString& rData ) +{ + if ( rKey == "default" ) + maDefName = rData; // Sets a default name for unknown keys. + else if ( rKey == "quote-names" ) + setQuoteNames( StringHelper::convertStringToBool( rData ) ); + else + NameListBase::implProcessConfigItemStr( rStrm, rKey, rData ); +} + +void ConstList::implSetName( sal_Int64 nKey, const OUString& rName ) +{ + insertRawName( nKey, rName ); +} + +OUString ConstList::implGetName( const Config& /*rCfg*/, sal_Int64 nKey ) const +{ + const OUString* pName = findRawName( nKey ); + OUString aName = pName ? *pName : maDefName; + if( mbQuoteNames ) + { + OUStringBuffer aBuffer( aName ); + StringHelper::enclose( aBuffer, OOX_DUMP_STRQUOTE ); + aName = aBuffer.makeStringAndClear(); + } + return aName; +} + +OUString ConstList::implGetNameDbl( const Config& /*rCfg*/, double /*fValue*/ ) const +{ + return OUString(); +} + +void ConstList::implIncludeList( const NameListBase& rList ) +{ + if( const ConstList* pConstList = dynamic_cast< const ConstList* >( &rList ) ) + { + maDefName = pConstList->maDefName; + mbQuoteNames = pConstList->mbQuoteNames; + } +} + +MultiList::MultiList( const SharedConfigData& rCfgData ) : + ConstList( rCfgData ), + mbIgnoreEmpty( true ) +{ +} + +void MultiList::setNamesFromVec( sal_Int64 nStartKey, const OUStringVector& rNames ) +{ + sal_Int64 nKey = nStartKey; + for (auto const& name : rNames) + { + if( !mbIgnoreEmpty || !name.isEmpty() ) + insertRawName( nKey, name); + ++nKey; + } +} + +void MultiList::implProcessConfigItemStr( + TextInputStream& rStrm, const OUString& rKey, const OUString& rData ) +{ + if ( rKey == "ignore-empty" ) + mbIgnoreEmpty = StringHelper::convertStringToBool( rData ); + else + ConstList::implProcessConfigItemStr( rStrm, rKey, rData ); +} + +void MultiList::implSetName( sal_Int64 nKey, const OUString& rName ) +{ + OUStringVector aNames; + StringHelper::convertStringToStringList( aNames, rName, false ); + setNamesFromVec( nKey, aNames ); +} + +FlagsList::FlagsList( const SharedConfigData& rCfgData ) : + NameListBase( rCfgData ), + mnIgnore( 0 ) +{ +} + +void FlagsList::implProcessConfigItemStr( + TextInputStream& rStrm, const OUString& rKey, const OUString& rData ) +{ + if ( rKey == "ignore" ) + { + sal_Int64 nIgnore; + if( StringHelper::convertStringToInt( nIgnore, rData ) ) + setIgnoreFlags( nIgnore ); + } + else + { + NameListBase::implProcessConfigItemStr( rStrm, rKey, rData ); + } +} + +void FlagsList::implSetName( sal_Int64 nKey, const OUString& rName ) +{ + if( (nKey != 0) && ((nKey & (nKey - 1)) == 0) ) // only a single bit set? + insertRawName( nKey, rName ); +} + +OUString FlagsList::implGetName( const Config& /*rCfg*/, sal_Int64 nKey ) const +{ + sal_Int64 nFound = mnIgnore; + OUStringBuffer aName; + // add known flags + for( const_iterator aIt = begin(), aEnd = end(); aIt != aEnd; ++aIt ) + { + sal_Int64 nMask = aIt->first; + setFlag( nFound, nMask ); + if( !getFlag( mnIgnore, nMask ) ) + { + const OUString& rFlagName = aIt->second; + bool bOnOff = rFlagName.startsWith(":"); + bool bFlag = getFlag( nKey, nMask ); + if( bOnOff ) + { + StringHelper::appendToken( aName, rFlagName.subView( 1 ) ); + aName.appendAscii( bFlag ? ":on" : ":off" ); + } + else + { + bool bNegated = rFlagName.startsWith("!"); + sal_Int32 nBothSep = bNegated ? rFlagName.indexOf( '!', 1 ) : -1; + if( bFlag ) + { + if( !bNegated ) + StringHelper::appendToken( aName, rFlagName ); + else if( nBothSep > 0 ) + StringHelper::appendToken( aName, rFlagName.subView( nBothSep + 1 ) ); + } + else if( bNegated ) + { + if( nBothSep > 0 ) + StringHelper::appendToken( aName, rFlagName.subView( 1, nBothSep - 1 ) ); + else + StringHelper::appendToken( aName, rFlagName.subView( 1 ) ); + } + } + } + } + // add unknown flags + setFlag( nKey, nFound, false ); + if( nKey != 0 ) + { + OUStringBuffer aUnknown( OOX_DUMP_UNKNOWN ); + aUnknown.append( OOX_DUMP_ITEMSEP ); + StringHelper::appendShortHex( aUnknown, nKey ); + StringHelper::enclose( aUnknown, '(', ')' ); + StringHelper::appendToken( aName, aUnknown.makeStringAndClear() ); + } + return aName.makeStringAndClear(); +} + +OUString FlagsList::implGetNameDbl( const Config& /*rCfg*/, double /*fValue*/ ) const +{ + return OUString(); +} + +void FlagsList::implIncludeList( const NameListBase& rList ) +{ + if( const FlagsList* pFlagsList = dynamic_cast< const FlagsList* >( &rList ) ) + mnIgnore = pFlagsList->mnIgnore; +} + +bool CombiList::ExtItemFormatKey::operator<( const ExtItemFormatKey& rRight ) const +{ + return (mnKey < rRight.mnKey) || ((mnKey == rRight.mnKey) && (maFilter < rRight.maFilter)); +} + +CombiList::CombiList( const SharedConfigData& rCfgData ) : + FlagsList( rCfgData ) +{ +} + +void CombiList::implSetName( sal_Int64 nKey, const OUString& rName ) +{ + if( (nKey & (nKey - 1)) != 0 ) // more than a single bit set? + { + ::std::set< ExtItemFormatKey > aItemKeys; + ExtItemFormat aItemFmt; + OUStringVector aRemain = aItemFmt.parse( rName ); + for (auto const& elemRemain : aRemain) + { + OUStringPair aPair = StringHelper::convertStringToPair(elemRemain); + if ( aPair.first == "noshift" ) + { + aItemFmt.mbShiftValue = StringHelper::convertStringToBool( aPair.second ); + } + else if ( aPair.first == "filter" ) + { + OUStringPair aFilter = StringHelper::convertStringToPair( aPair.second, '~' ); + ExtItemFormatKey aKey( nKey ); + if( !aFilter.first.isEmpty() && StringHelper::convertStringToInt( aKey.maFilter.first, aFilter.first ) && + !aFilter.second.isEmpty() && StringHelper::convertStringToInt( aKey.maFilter.second, aFilter.second ) ) + { + if( aKey.maFilter.first == 0 ) + aKey.maFilter.second = 0; + aItemKeys.insert( aKey ); + } + } + } + if( aItemKeys.empty() ) + aItemKeys.insert( ExtItemFormatKey( nKey ) ); + for (auto const& itemKey : aItemKeys) + maFmtMap[itemKey] = aItemFmt; + } + else + { + FlagsList::implSetName( nKey, rName ); + } +} + +OUString CombiList::implGetName( const Config& rCfg, sal_Int64 nKey ) const +{ + sal_Int64 nFound = 0; + OUStringBuffer aName; + // add known flag fields + for (auto const& fmt : maFmtMap) + { + const ExtItemFormatKey& rMapKey = fmt.first; + sal_Int64 nMask = rMapKey.mnKey; + if( (nMask != 0) && ((nKey & rMapKey.maFilter.first) == rMapKey.maFilter.second) ) + { + const ExtItemFormat& rItemFmt = fmt.second; + + sal_uInt64 nUFlags = static_cast< sal_uInt64 >( nKey ); + sal_uInt64 nUMask = static_cast< sal_uInt64 >( nMask ); + if( rItemFmt.mbShiftValue ) + while( (nUMask & 1) == 0 ) { nUFlags >>= 1; nUMask >>= 1; } + + sal_uInt64 nUValue = nUFlags & nUMask; + sal_Int64 nSValue = static_cast< sal_Int64 >( nUValue ); + if( getFlag< sal_uInt64 >( nUValue, (nUMask + 1) >> 1 ) ) + setFlag( nSValue, static_cast< sal_Int64 >( ~nUMask ) ); + + OUStringBuffer aItem( rItemFmt.maItemName ); + OUStringBuffer aValue; + switch( rItemFmt.meDataType ) + { + case DATATYPE_INT8: StringHelper::appendValue( aValue, static_cast< sal_Int8 >( nSValue ), rItemFmt.meFmtType ); break; + case DATATYPE_UINT8: StringHelper::appendValue( aValue, static_cast< sal_uInt8 >( nUValue ), rItemFmt.meFmtType ); break; + case DATATYPE_INT16: StringHelper::appendValue( aValue, static_cast< sal_Int16 >( nSValue ), rItemFmt.meFmtType ); break; + case DATATYPE_UINT16: StringHelper::appendValue( aValue, static_cast< sal_uInt16 >( nUValue ), rItemFmt.meFmtType ); break; + case DATATYPE_INT32: StringHelper::appendValue( aValue, static_cast< sal_Int32 >( nSValue ), rItemFmt.meFmtType ); break; + case DATATYPE_UINT32: StringHelper::appendValue( aValue, static_cast< sal_uInt32 >( nUValue ), rItemFmt.meFmtType ); break; + case DATATYPE_INT64: StringHelper::appendValue( aValue, nSValue, rItemFmt.meFmtType ); break; + case DATATYPE_UINT64: StringHelper::appendValue( aValue, nUValue, rItemFmt.meFmtType ); break; + case DATATYPE_FLOAT: StringHelper::appendValue( aValue, static_cast< float >( nSValue ), rItemFmt.meFmtType ); break; + case DATATYPE_DOUBLE: StringHelper::appendValue( aValue, static_cast< double >( nSValue ), rItemFmt.meFmtType ); break; + default:; + } + StringHelper::appendToken( aItem, aValue.makeStringAndClear(), OOX_DUMP_ITEMSEP ); + if( !rItemFmt.maListName.isEmpty() ) + { + OUString aValueName = rCfg.getName( rItemFmt.maListName, static_cast< sal_Int64 >( nUValue ) ); + StringHelper::appendToken( aItem, aValueName, OOX_DUMP_ITEMSEP ); + } + StringHelper::enclose( aItem, '(', ')' ); + StringHelper::appendToken( aName, aItem.makeStringAndClear() ); + setFlag( nFound, nMask ); + } + } + setFlag( nKey, nFound, false ); + StringHelper::appendToken( aName, FlagsList::implGetName( rCfg, nKey ) ); + return aName.makeStringAndClear(); +} + +void CombiList::implIncludeList( const NameListBase& rList ) +{ + if( const CombiList* pCombiList = dynamic_cast< const CombiList* >( &rList ) ) + maFmtMap = pCombiList->maFmtMap; + FlagsList::implIncludeList( rList ); +} + +UnitConverter::UnitConverter( const SharedConfigData& rCfgData ) : + NameListBase( rCfgData ), + mfFactor( 1.0 ) +{ +} + +void UnitConverter::implSetName( sal_Int64 /*nKey*/, const OUString& /*rName*/ ) +{ + // nothing to do +} + +OUString UnitConverter::implGetName( const Config& rCfg, sal_Int64 nKey ) const +{ + return implGetNameDbl( rCfg, static_cast< double >( nKey ) ); +} + +OUString UnitConverter::implGetNameDbl( const Config& /*rCfg*/, double fValue ) const +{ + OUStringBuffer aValue; + StringHelper::appendDec( aValue, mfFactor * fValue ); + aValue.append( maUnitName ); + return aValue.makeStringAndClear(); +} + +void UnitConverter::implIncludeList( const NameListBase& /*rList*/ ) +{ +} + +const NameListRef & NameListWrapper::getNameList( const Config& rCfg ) const +{ + if (!mxList) + mxList = rCfg.getNameList( maName ); + return mxList; +} + +SharedConfigData::SharedConfigData( const OUString& rFileName, + const Reference< XComponentContext >& rxContext, const StorageRef& rxRootStrg, + const OUString& rSysFileName ) : + mxContext( rxContext ), + mxRootStrg( rxRootStrg ), + maSysFileName( rSysFileName ), + mbLoaded( false ) +{ + OUString aFileUrl = InputOutputHelper::convertFileNameToUrl( rFileName ); + if( !aFileUrl.isEmpty() ) + { + sal_Int32 nNamePos = InputOutputHelper::getFileNamePos( aFileUrl ); + maConfigPath = aFileUrl.copy( 0, nNamePos ); + mbLoaded = readConfigFile( aFileUrl ); + } +} + +SharedConfigData::~SharedConfigData() +{ +} + +const OUString* SharedConfigData::getOption( const OUString& rKey ) const +{ + ConfigDataMap::const_iterator aIt = maConfigData.find( rKey ); + return (aIt == maConfigData.end()) ? nullptr : &aIt->second; +} + +void SharedConfigData::setNameList( const OUString& rListName, const NameListRef& rxList ) +{ + if( !rListName.isEmpty() ) + maNameLists[ rListName ] = rxList; +} + +void SharedConfigData::eraseNameList( const OUString& rListName ) +{ + maNameLists.erase( rListName ); +} + +NameListRef SharedConfigData::getNameList( const OUString& rListName ) const +{ + NameListRef xList; + NameListMap::const_iterator aIt = maNameLists.find( rListName ); + if( aIt != maNameLists.end() ) + xList = aIt->second; + return xList; +} + +bool SharedConfigData::implIsValid() const +{ + return mbLoaded && mxContext.is() && mxRootStrg && !maSysFileName.isEmpty(); +} + +void SharedConfigData::implProcessConfigItemStr( + TextInputStream& rStrm, const OUString& rKey, const OUString& rData ) +{ + if ( rKey == "include-config-file" ) + readConfigFile( maConfigPath + rData ); + else if ( rKey == "constlist" ) + readNameList< ConstList >( rStrm, rData ); + else if ( rKey == "multilist" ) + readNameList< MultiList >( rStrm, rData ); + else if ( rKey == "flagslist" ) + readNameList< FlagsList >( rStrm, rData ); + else if ( rKey == "combilist" ) + readNameList< CombiList >( rStrm, rData ); + else if ( rKey == "shortlist" ) + createShortList( rData ); + else if ( rKey == "unitconverter" ) + createUnitConverter( rData ); + else + maConfigData[ rKey ] = rData; +} + +bool SharedConfigData::readConfigFile( const OUString& rFileUrl ) +{ + bool bLoaded = maConfigFiles.count( rFileUrl ) > 0; + if( !bLoaded ) + { + Reference< XInputStream > xInStrm = InputOutputHelper::openInputStream( mxContext, rFileUrl ); + TextInputStream aTxtStrm( mxContext, xInStrm, RTL_TEXTENCODING_UTF8 ); + if( !aTxtStrm.isEof() ) + { + maConfigFiles.insert( rFileUrl ); + readConfigBlockContents( aTxtStrm ); + bLoaded = true; + } + } + return bLoaded; +} + +void SharedConfigData::createShortList( const OUString& rData ) +{ + OUStringVector aDataVec; + StringHelper::convertStringToStringList( aDataVec, rData, false ); + if( aDataVec.size() < 3 ) + return; + + sal_Int64 nStartKey; + if( StringHelper::convertStringToInt( nStartKey, aDataVec[ 1 ] ) ) + { + std::shared_ptr< MultiList > xList = createNameList< MultiList >( aDataVec[ 0 ] ); + if( xList ) + { + aDataVec.erase( aDataVec.begin(), aDataVec.begin() + 2 ); + xList->setNamesFromVec( nStartKey, aDataVec ); + } + } +} + +void SharedConfigData::createUnitConverter( const OUString& rData ) +{ + OUStringVector aDataVec; + StringHelper::convertStringToStringList( aDataVec, rData, false ); + if( aDataVec.size() < 2 ) + return; + + OUString aFactor = aDataVec[ 1 ]; + bool bRecip = aFactor.startsWith("/"); + if( bRecip ) + aFactor = aFactor.copy( 1 ); + double fFactor; + if( StringHelper::convertStringToDouble( fFactor, aFactor ) && (fFactor != 0.0) ) + { + std::shared_ptr< UnitConverter > xList = createNameList< UnitConverter >( aDataVec[ 0 ] ); + if( xList ) + { + xList->setFactor( bRecip ? (1.0 / fFactor) : fFactor ); + if( aDataVec.size() >= 3 ) + xList->setUnitName( aDataVec[ 2 ] ); + } + } +} + +Config::Config( const char* pcEnvVar, const FilterBase& rFilter ) +{ + construct( pcEnvVar, rFilter ); +} + +Config::Config( const char* pcEnvVar, const Reference< XComponentContext >& rxContext, const StorageRef& rxRootStrg, const OUString& rSysFileName ) +{ + construct( pcEnvVar, rxContext, rxRootStrg, rSysFileName ); +} + +Config::~Config() +{ +} + +void Config::construct( const char* pcEnvVar, const FilterBase& rFilter ) +{ + if( !rFilter.getFileUrl().isEmpty() ) + construct( pcEnvVar, rFilter.getComponentContext(), rFilter.getStorage(), rFilter.getFileUrl() ); +} + +void Config::construct( const char* pcEnvVar, const Reference< XComponentContext >& rxContext, const StorageRef& rxRootStrg, const OUString& rSysFileName ) +{ + if( pcEnvVar && rxRootStrg && !rSysFileName.isEmpty() ) + if( const char* pcFileName = ::getenv( pcEnvVar ) ) + mxCfgData = std::make_shared( OUString::createFromAscii( pcFileName ), rxContext, rxRootStrg, rSysFileName ); +} + +const OUString& Config::getStringOption( const String& rKey, const OUString& rDefault ) const +{ + const OUString* pData = implGetOption( rKey ); + return pData ? *pData : rDefault; +} + +bool Config::getBoolOption( const String& rKey, bool bDefault ) const +{ + const OUString* pData = implGetOption( rKey ); + return pData ? StringHelper::convertStringToBool( *pData ) : bDefault; +} + +bool Config::isDumperEnabled() const +{ + return getBoolOption( "enable-dumper", false ); +} + +bool Config::isImportEnabled() const +{ + return getBoolOption( "enable-import", true ); +} + +void Config::eraseNameList( const String& rListName ) +{ + mxCfgData->eraseNameList( rListName ); +} + +NameListRef Config::getNameList( const String& rListName ) const +{ + return mxCfgData->getNameList( rListName ); +} + +bool Config::implIsValid() const +{ + return isValid( mxCfgData ); +} + +const OUString* Config::implGetOption( const OUString& rKey ) const +{ + return mxCfgData->getOption( rKey ); +} + +Output::Output( const Reference< XComponentContext >& rxContext, const OUString& rFileName ) : + mxStrm( InputOutputHelper::openTextOutputStream( rxContext, rFileName, RTL_TEXTENCODING_UTF8 ) ), + mnCol( 0 ), + mnItemLevel( 0 ), + mnMultiLevel( 0 ), + mnItemIdx( 0 ), + mnLastItem( 0 ) +{ + if( mxStrm.is() ) + mxStrm->writeString( OUString( OOX_DUMP_BOM ) ); +} + +void Output::newLine() +{ + if( maLine.getLength() > 0 ) + { + mxStrm->writeString( maIndent ); + maLine.append( '\n' ); + mxStrm->writeString( maLine.makeStringAndClear() ); + mnCol = 0; + mnLastItem = 0; + } +} + +void Output::emptyLine( size_t nCount ) +{ + for( size_t nIdx = 0; nIdx < nCount; ++nIdx ) + mxStrm->writeString( OUString('\n') ); +} + +void Output::incIndent() +{ + OUStringBuffer aBuffer( maIndent ); + StringHelper::appendChar( aBuffer, ' ', OOX_DUMP_INDENT ); + maIndent = aBuffer.makeStringAndClear(); +} + +void Output::decIndent() +{ + if( maIndent.getLength() >= OOX_DUMP_INDENT ) + maIndent = maIndent.copy( OOX_DUMP_INDENT ); +} + +void Output::startTable( sal_Int32 nW1 ) +{ + startTable( 1, &nW1 ); +} + +void Output::startTable( sal_Int32 nW1, sal_Int32 nW2 ) +{ + sal_Int32 pnColWidths[ 2 ]; + pnColWidths[ 0 ] = nW1; + pnColWidths[ 1 ] = nW2; + startTable( 2, pnColWidths ); +} + +void Output::startTable( sal_Int32 nW1, sal_Int32 nW2, sal_Int32 nW3, sal_Int32 nW4 ) +{ + sal_Int32 pnColWidths[ 4 ]; + pnColWidths[ 0 ] = nW1; + pnColWidths[ 1 ] = nW2; + pnColWidths[ 2 ] = nW3; + pnColWidths[ 3 ] = nW4; + startTable( 4, pnColWidths ); +} + +void Output::startTable( size_t nColCount, const sal_Int32* pnColWidths ) +{ + maColPos.clear(); + maColPos.push_back( 0 ); + sal_Int32 nColPos = 0; + for( size_t nCol = 0; nCol < nColCount; ++nCol ) + { + nColPos = nColPos + pnColWidths[ nCol ]; + maColPos.push_back( nColPos ); + } +} + +void Output::tab() +{ + tab( mnCol + 1 ); +} + +void Output::tab( size_t nCol ) +{ + mnCol = nCol; + if( mnCol < maColPos.size() ) + { + sal_Int32 nColPos = maColPos[ mnCol ]; + if( maLine.getLength() >= nColPos ) + maLine.setLength( ::std::max< sal_Int32 >( nColPos - 1, 0 ) ); + StringHelper::appendChar( maLine, ' ', nColPos - maLine.getLength() ); + } + else + { + StringHelper::appendChar( maLine, ' ', 2 ); + } +} + +void Output::endTable() +{ + maColPos.clear(); +} + +void Output::resetItemIndex( sal_Int64 nIdx ) +{ + mnItemIdx = nIdx; +} + +void Output::startItem( const String& rItemName ) +{ + if( mnItemLevel == 0 ) + { + if( (mnMultiLevel > 0) && (maLine.getLength() > 0) ) + tab(); + if( rItemName.has() ) + { + writeItemName( rItemName ); + writeChar( OOX_DUMP_ITEMSEP ); + } + } + ++mnItemLevel; + mnLastItem = maLine.getLength(); +} + +void Output::contItem() +{ + if( mnItemLevel > 0 ) + { + if( (maLine.getLength() == 0) || (maLine[ maLine.getLength() - 1 ] != OOX_DUMP_ITEMSEP) ) + writeChar( OOX_DUMP_ITEMSEP ); + mnLastItem = maLine.getLength(); + } +} + +void Output::endItem() +{ + if( mnItemLevel > 0 ) + { + maLastItem = maLine.copy( mnLastItem ).makeStringAndClear(); + if( maLastItem.isEmpty() && mnLastItem > 0 && maLine[ mnLastItem - 1 ] == OOX_DUMP_ITEMSEP ) + maLine.setLength( mnLastItem - 1 ); + --mnItemLevel; + } + if( mnItemLevel == 0 ) + { + if( mnMultiLevel == 0 ) + newLine(); + } + else + contItem(); +} + +void Output::startMultiItems() +{ + ++mnMultiLevel; +} + +void Output::endMultiItems() +{ + if( mnMultiLevel > 0 ) + --mnMultiLevel; + if( mnMultiLevel == 0 ) + newLine(); +} + +void Output::writeChar( sal_Unicode cChar, sal_Int32 nCount ) +{ + StringHelper::appendEncChar( maLine, cChar, nCount ); +} + +void Output::writeAscii( const char* pcStr ) +{ + if( pcStr ) + maLine.appendAscii( pcStr ); +} + +void Output::writeString( const OUString& rStr ) +{ + StringHelper::appendEncString( maLine, rStr ); +} + +void Output::writeArray( const sal_uInt8* pnData, std::size_t nSize, sal_Unicode cSep ) +{ + const sal_uInt8* pnEnd = pnData ? (pnData + nSize) : nullptr; + for( const sal_uInt8* pnByte = pnData; pnByte < pnEnd; ++pnByte ) + { + if( pnByte > pnData ) + writeChar( cSep ); + writeHex( *pnByte, false ); + } +} + +void Output::writeBool( bool bData ) +{ + StringHelper::appendBool( maLine, bData ); +} + +void Output::writeDateTime( const util::DateTime& rDateTime ) +{ + writeDec( rDateTime.Year, 4, '0' ); + writeChar( '-' ); + writeDec( rDateTime.Month, 2, '0' ); + writeChar( '-' ); + writeDec( rDateTime.Day, 2, '0' ); + writeChar( 'T' ); + writeDec( rDateTime.Hours, 2, '0' ); + writeChar( ':' ); + writeDec( rDateTime.Minutes, 2, '0' ); + writeChar( ':' ); + writeDec( rDateTime.Seconds, 2, '0' ); +} + +bool Output::implIsValid() const +{ + return mxStrm.is(); +} + +void Output::writeItemName( const String& rItemName ) +{ + if( rItemName.has() && (rItemName[ 0 ] == '#') ) + { + writeString( rItemName.copy( 1 ) ); + StringHelper::appendIndex( maLine, mnItemIdx++ ); + } + else + writeString( rItemName ); +} + +StorageIterator::StorageIterator( const StorageRef& rxStrg ) : + mxStrg( rxStrg ) +{ + if( mxStrg ) + mxStrg->getElementNames( maNames ); + maIt = maNames.begin(); +} + +StorageIterator::~StorageIterator() +{ +} + +StorageIterator& StorageIterator::operator++() +{ + if( maIt != maNames.end() ) + ++maIt; + return *this; +} + +OUString StorageIterator::getName() const +{ + OUString aName; + if( maIt != maNames.end() ) + aName = *maIt; + return aName; +} + +bool StorageIterator::isStream() const +{ + return isValid() && mxStrg->openInputStream( *maIt ).is(); +} + +bool StorageIterator::isStorage() const +{ + if( !isValid() ) + return false; + StorageRef xStrg = mxStrg->openSubStorage( *maIt, false ); + return xStrg && xStrg->isStorage(); +} + +bool StorageIterator::implIsValid() const +{ + return mxStrg && mxStrg->isStorage() && (maIt != maNames.end()); +} + +ObjectBase::~ObjectBase() +{ +} + +void ObjectBase::construct( const ConfigRef& rxConfig ) +{ + mxConfig = rxConfig; +} + +void ObjectBase::construct( const ObjectBase& rParent ) +{ + *this = rParent; +} + +void ObjectBase::dump() +{ + if( isValid() ) + implDump(); +} + +bool ObjectBase::implIsValid() const +{ + return isValid( mxConfig ); +} + +void ObjectBase::implDump() +{ +} + +void StorageObjectBase::construct( const ObjectBase& rParent, const StorageRef& rxStrg, const OUString& rSysPath ) +{ + ObjectBase::construct( rParent ); + mxStrg = rxStrg; + maSysPath = rSysPath; +} + +void StorageObjectBase::construct( const ObjectBase& rParent ) +{ + ObjectBase::construct( rParent ); + if( ObjectBase::implIsValid() ) + { + mxStrg = cfg().getRootStorage(); + maSysPath = cfg().getSysFileName(); + } +} + +bool StorageObjectBase::implIsValid() const +{ + return mxStrg && !maSysPath.isEmpty() && ObjectBase::implIsValid(); +} + +void StorageObjectBase::implDump() +{ + bool bIsStrg = mxStrg->isStorage(); + bool bIsRoot = mxStrg->isRootStorage(); + Reference< XInputStream > xBaseStrm; + if( !bIsStrg ) + xBaseStrm = mxStrg->openInputStream( OUString() ); + + OUString aSysOutPath = maSysPath; + if( bIsRoot ) try + { + aSysOutPath += OOX_DUMP_DUMPEXT; + Reference xFileAccess(SimpleFileAccess::create(getContext())); + xFileAccess->kill( aSysOutPath ); + } + catch( Exception& ) + { + } + + if( bIsStrg ) + { + extractStorage( mxStrg, OUString(), aSysOutPath ); + } + else if( xBaseStrm.is() ) + { + BinaryInputStreamRef xInStrm( std::make_shared( xBaseStrm, false ) ); + xInStrm->seekToStart(); + implDumpBaseStream( xInStrm, aSysOutPath ); + } +} + +void StorageObjectBase::implDumpStream( const Reference< XInputStream >&, const OUString&, const OUString&, const OUString& ) +{ +} + +void StorageObjectBase::implDumpStorage( const StorageRef& rxStrg, const OUString& rStrgPath, const OUString& rSysPath ) +{ + extractStorage( rxStrg, rStrgPath, rSysPath ); +} + +void StorageObjectBase::implDumpBaseStream( const BinaryInputStreamRef&, const OUString& ) +{ +} + +void StorageObjectBase::addPreferredStream( const String& rStrmName ) +{ + if( rStrmName.has() ) + maPreferred.emplace_back( rStrmName, false ); +} + +void StorageObjectBase::addPreferredStorage( const String& rStrgPath ) +{ + if( rStrgPath.has() ) + maPreferred.emplace_back( rStrgPath, true ); +} + +OUString StorageObjectBase::getSysFileName( + const OUString& rStrmName, std::u16string_view rSysOutPath ) +{ + // encode all characters < 0x20 + OUStringBuffer aBuffer; + StringHelper::appendEncString( aBuffer, rStrmName, false ); + + // replace all characters reserved in file system + OUString aFileName = aBuffer.makeStringAndClear(); + static const sal_Unicode spcReserved[] = { '/', '\\', ':', '*', '?', '<', '>', '|' }; + for(const sal_Unicode cChar : spcReserved) + aFileName = aFileName.replace(cChar, '_'); + + // build full path + return OUString::Concat(rSysOutPath) + "/" + aFileName; +} + +void StorageObjectBase::extractStream( StorageBase& rStrg, const OUString& rStrgPath, const OUString& rStrmName, const OUString& rSysFileName ) +{ + BinaryXInputStream aInStrm( rStrg.openInputStream( rStrmName ), true ); + if( !aInStrm.isEof() ) + { + BinaryXOutputStream aOutStrm( InputOutputHelper::openOutputStream( getContext(), rSysFileName ), true ); + if( !aOutStrm.isEof() ) + aInStrm.copyToStream( aOutStrm ); + } + Reference< XInputStream > xDumpStrm = InputOutputHelper::openInputStream( getContext(), rSysFileName ); + if( xDumpStrm.is() ) + implDumpStream( xDumpStrm, rStrgPath, rStrmName, rSysFileName ); +} + +void StorageObjectBase::extractStorage( const StorageRef& rxStrg, const OUString& rStrgPath, const OUString& rSysPath ) +{ + // create directory in file system + ::osl::FileBase::RC eRes = ::osl::Directory::create( rSysPath ); + if( (eRes != ::osl::FileBase::E_None) && (eRes != ::osl::FileBase::E_EXIST) ) + return; + + // process preferred storages and streams in root storage first + if( rStrgPath.isEmpty() ) + { + for (auto const& elemPreferred : maPreferred) + extractItem( rxStrg, rStrgPath, elemPreferred.maName, rSysPath, elemPreferred.mbStorage, !elemPreferred.mbStorage ); + } + + // process children of the storage + for( StorageIterator aIt( rxStrg ); aIt.isValid(); ++aIt ) + { + // skip processed preferred items + OUString aItemName = aIt.getName(); + bool bFound = false; + if( rStrgPath.isEmpty() ) + { + for (auto const& elemPreferred : maPreferred) + { + bFound = elemPreferred.maName == aItemName; + if (bFound) + break; + } + } + if( !bFound ) + extractItem( rxStrg, rStrgPath, aItemName, rSysPath, aIt.isStorage(), aIt.isStream() ); + } +} + +void StorageObjectBase::extractItem( const StorageRef& rxStrg, const OUString& rStrgPath, const OUString& rItemName, std::u16string_view rSysPath, bool bIsStrg, bool bIsStrm ) +{ + OUString aSysFileName = getSysFileName( rItemName, rSysPath ); + if( bIsStrg ) + { + OUStringBuffer aStrgPath( rStrgPath ); + StringHelper::appendToken( aStrgPath, rItemName, '/' ); + implDumpStorage( rxStrg->openSubStorage( rItemName, false ), aStrgPath.makeStringAndClear(), aSysFileName ); + } + else if( bIsStrm ) + { + extractStream( *rxStrg, rStrgPath, rItemName, aSysFileName ); + } +} + +OutputObjectBase::~OutputObjectBase() +{ +} + +void OutputObjectBase::construct( const ObjectBase& rParent, const OUString& rSysFileName ) +{ + ObjectBase::construct( rParent ); + if( ObjectBase::implIsValid() ) + { + maSysFileName = rSysFileName; + mxOut = std::make_shared( getContext(), rSysFileName + OOX_DUMP_DUMPEXT ); + } +} + +void OutputObjectBase::construct( const OutputObjectBase& rParent ) +{ + *this = rParent; +} + +bool OutputObjectBase::implIsValid() const +{ + return isValid( mxOut ) && ObjectBase::implIsValid(); +} + +void OutputObjectBase::writeEmptyItem( const String& rName ) +{ + ItemGuard aItem( mxOut, rName ); +} + +void OutputObjectBase::writeInfoItem( const String& rName, const String& rData ) +{ + ItemGuard aItem( mxOut, rName ); + mxOut->writeString( rData ); +} + +void OutputObjectBase::writeCharItem( const String& rName, sal_Unicode cData ) +{ + ItemGuard aItem( mxOut, rName ); + mxOut->writeChar( OOX_DUMP_STRQUOTE ); + mxOut->writeChar( cData ); + mxOut->writeChar( OOX_DUMP_STRQUOTE ); +} + +void OutputObjectBase::writeStringItem( const String& rName, const OUString& rData ) +{ + ItemGuard aItem( mxOut, rName ); + mxOut->writeAscii( "(len=" ); + mxOut->writeDec( rData.getLength() ); + mxOut->writeAscii( ")," ); + OUStringBuffer aValue( rData.subView( 0, ::std::min( rData.getLength(), OOX_DUMP_MAXSTRLEN ) ) ); + StringHelper::enclose( aValue, OOX_DUMP_STRQUOTE ); + mxOut->writeString( aValue.makeStringAndClear() ); + if( rData.getLength() > OOX_DUMP_MAXSTRLEN ) + mxOut->writeAscii( ",cut" ); +} + +void OutputObjectBase::writeArrayItem( const String& rName, const sal_uInt8* pnData, std::size_t nSize, sal_Unicode cSep ) +{ + ItemGuard aItem( mxOut, rName ); + mxOut->writeArray( pnData, nSize, cSep ); +} + +void OutputObjectBase::writeDateTimeItem( const String& rName, const util::DateTime& rDateTime ) +{ + ItemGuard aItem( mxOut, rName ); + mxOut->writeDateTime( rDateTime ); +} + +void OutputObjectBase::writeGuidItem( const String& rName, const OUString& rGuid ) +{ + ItemGuard aItem( mxOut, rName ); + mxOut->writeString( rGuid ); + aItem.cont(); + mxOut->writeString( cfg().getStringOption( rGuid, OUString() ) ); +} + +InputObjectBase::~InputObjectBase() +{ +} + +void InputObjectBase::construct( const ObjectBase& rParent, const BinaryInputStreamRef& rxStrm, const OUString& rSysFileName ) +{ + OutputObjectBase::construct( rParent, rSysFileName ); + mxStrm = rxStrm; +} + +void InputObjectBase::construct( const OutputObjectBase& rParent, const BinaryInputStreamRef& rxStrm ) +{ + OutputObjectBase::construct( rParent ); + mxStrm = rxStrm; +} + +void InputObjectBase::construct( const InputObjectBase& rParent ) +{ + *this = rParent; +} + +bool InputObjectBase::implIsValid() const +{ + return mxStrm && OutputObjectBase::implIsValid(); +} + +void InputObjectBase::skipBlock( sal_Int64 nBytes, bool bShowSize ) +{ + sal_Int64 nEndPos = ::std::min< sal_Int64 >( mxStrm->tell() + nBytes, mxStrm->size() ); + if( mxStrm->tell() < nEndPos ) + { + if( bShowSize ) + writeDecItem( "skipped-data-size", static_cast< sal_uInt64 >( nEndPos - mxStrm->tell() ) ); + mxStrm->seek( nEndPos ); + } +} + +void InputObjectBase::dumpRawBinary( sal_Int64 nBytes, bool bShowOffset, bool bStream ) +{ + TableGuard aTabGuard( mxOut, + bShowOffset ? 12 : 0, + 3 * OOX_DUMP_BYTESPERLINE / 2 + 1, + 3 * OOX_DUMP_BYTESPERLINE / 2 + 1, + OOX_DUMP_BYTESPERLINE / 2 + 1 ); + + sal_Int64 nMaxShowSize = cfg().getIntOption< sal_Int64 >( + bStream ? "max-binary-stream-size" : "max-binary-data-size", SAL_MAX_INT64 ); + + bool bSeekable = mxStrm->size() >= 0; + sal_Int64 nEndPos = bSeekable ? ::std::min< sal_Int64 >( mxStrm->tell() + nBytes, mxStrm->size() ) : 0; + sal_Int64 nDumpEnd = bSeekable ? ::std::min< sal_Int64 >( mxStrm->tell() + nMaxShowSize, nEndPos ) : nMaxShowSize; + sal_Int64 nPos = bSeekable ? mxStrm->tell() : 0; + bool bLoop = true; + + while( bLoop && (nPos < nDumpEnd) ) + { + mxOut->writeHex( static_cast< sal_uInt32 >( nPos ) ); + mxOut->tab(); + + sal_uInt8 pnLineData[ OOX_DUMP_BYTESPERLINE ]; + sal_Int32 nLineSize = bSeekable ? ::std::min( static_cast< sal_Int32 >( nDumpEnd - mxStrm->tell() ), OOX_DUMP_BYTESPERLINE ) : OOX_DUMP_BYTESPERLINE; + sal_Int32 nReadSize = mxStrm->readMemory( pnLineData, nLineSize ); + bLoop = nReadSize == nLineSize; + nPos += nReadSize; + + if( nReadSize > 0 ) + { + const sal_uInt8* pnByte = nullptr; + const sal_uInt8* pnEnd = nullptr; + for( pnByte = pnLineData, pnEnd = pnLineData + nReadSize; pnByte != pnEnd; ++pnByte ) + { + if( (pnByte - pnLineData) == (OOX_DUMP_BYTESPERLINE / 2) ) mxOut->tab(); + mxOut->writeHex( *pnByte, false ); + mxOut->writeChar( ' ' ); + } + + aTabGuard.tab( 3 ); + for( pnByte = pnLineData, pnEnd = pnLineData + nReadSize; pnByte != pnEnd; ++pnByte ) + { + if( (pnByte - pnLineData) == (OOX_DUMP_BYTESPERLINE / 2) ) mxOut->tab(); + mxOut->writeChar( static_cast< sal_Unicode >( (*pnByte < 0x20) ? '.' : *pnByte ) ); + } + mxOut->newLine(); + } + } + + // skip undumped data + if( bSeekable ) + skipBlock( nEndPos - mxStrm->tell() ); +} + +void InputObjectBase::dumpBinary( const String& rName, sal_Int64 nBytes, bool bShowOffset ) +{ + { + MultiItemsGuard aMultiGuard( mxOut ); + writeEmptyItem( rName ); + writeDecItem( "size", nBytes ); + } + IndentGuard aIndGuard( mxOut ); + dumpRawBinary( nBytes, bShowOffset ); +} + +void InputObjectBase::dumpRemaining( sal_Int64 nBytes ) +{ + if( nBytes > 0 ) + { + if( cfg().getBoolOption( "show-trailing-unknown", true ) ) + dumpBinary( "remaining-data", nBytes, false ); + else + skipBlock( nBytes ); + } +} + +void InputObjectBase::dumpRemainingTo( sal_Int64 nPos ) +{ + if( mxStrm->isEof() || (mxStrm->tell() > nPos) ) + writeInfoItem( "stream-state", OOX_DUMP_ERR_STREAM ); + else + dumpRemaining( nPos - mxStrm->tell() ); + mxStrm->seek( nPos ); +} + +void InputObjectBase::dumpRemainingStream() +{ + dumpRemainingTo( mxStrm->size() ); +} + +void InputObjectBase::dumpArray( const String& rName, sal_Int32 nBytes, sal_Unicode cSep ) +{ + sal_Int32 nDumpSize = getLimitedValue< sal_Int32, sal_Int64 >( mxStrm->size() - mxStrm->tell(), 0, nBytes ); + if( nDumpSize > OOX_DUMP_MAXARRAY ) + { + dumpBinary( rName, nBytes, false ); + } + else if( nDumpSize > 1 ) + { + sal_uInt8 pnData[ OOX_DUMP_MAXARRAY ]; + mxStrm->readMemory( pnData, nDumpSize ); + writeArrayItem( rName, pnData, nDumpSize, cSep ); + } + else if( nDumpSize == 1 ) + dumpHex< sal_uInt8 >( rName ); +} + +sal_Unicode InputObjectBase::dumpUnicode( const String& rName ) +{ + sal_uInt16 nChar = mxStrm->readuInt16(); + sal_Unicode cChar = static_cast< sal_Unicode >( nChar ); + writeCharItem( rName( "char" ), cChar ); + return cChar; +} + +OUString InputObjectBase::dumpCharArray( const String& rName, sal_Int32 nLen, rtl_TextEncoding eTextEnc, bool bHideTrailingNul ) +{ + sal_Int32 nDumpSize = getLimitedValue< sal_Int32, sal_Int64 >( mxStrm->size() - mxStrm->tell(), 0, nLen ); + OUString aString; + if( nDumpSize > 0 ) + { + ::std::vector< char > aBuffer( static_cast< std::size_t >( nLen ) + 1 ); + sal_Int32 nCharsRead = mxStrm->readMemory(aBuffer.data(), nLen); + aBuffer[ nCharsRead ] = 0; + aString = OStringToOUString(std::string_view(aBuffer.data()), eTextEnc); + } + if( bHideTrailingNul ) + aString = StringHelper::trimTrailingNul( aString ); + writeStringItem( rName( "text" ), aString ); + return aString; +} + +OUString InputObjectBase::dumpUnicodeArray( const String& rName, sal_Int32 nLen, bool bHideTrailingNul ) +{ + OUStringBuffer aBuffer; + for( sal_Int32 nIndex = 0; !mxStrm->isEof() && (nIndex < nLen); ++nIndex ) + { + aBuffer.append( static_cast< sal_Unicode >( mxStrm->readuInt16() ) ); + } + OUString aString = aBuffer.makeStringAndClear(); + if( bHideTrailingNul ) + aString = StringHelper::trimTrailingNul( aString ); + writeStringItem( rName( "text" ), aString ); + return aString; +} + +util::DateTime InputObjectBase::dumpFileTime( const String& rName ) +{ + util::DateTime aDateTime; + + ItemGuard aItem( mxOut, rName( "file-time" ) ); + sal_Int64 nFileTime = dumpDec< sal_Int64 >( EMPTY_STRING ); + // file time is in 10^-7 seconds (100 nanoseconds), convert to nanoseconds + nFileTime *= 100; + // entire days + sal_Int64 nDays = nFileTime / sal_Int64( ::tools::Time::nanoSecPerDay ); + // number of entire years + sal_Int64 nYears = (nDays - (nDays / (4 * 365)) + (nDays / (100 * 365)) - (nDays / (400 * 365))) / 365; + // remaining days in the year + sal_Int64 nDaysInYear = nDays - (nYears * 365 + nYears / 4 - nYears / 100 + nYears / 400); + // the year (file dates start from 1601-01-01) + aDateTime.Year = static_cast< sal_uInt16 >( 1601 + nYears ); + // leap year? + bool bLeap = ((aDateTime.Year % 4 == 0) && (aDateTime.Year % 100 != 0)) || (aDateTime.Year % 400 == 0); + // static arrays with number of days in month + static const sal_Int64 spnDaysInMonth[] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; + static const sal_Int64 spnDaysInMonthL[] = { 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; + const sal_Int64* pnDaysInMonth = bLeap ? spnDaysInMonthL : spnDaysInMonth; + // the month + aDateTime.Month = 1; + while( nDaysInYear >= *pnDaysInMonth ) + { + nDaysInYear -= *pnDaysInMonth++; + ++aDateTime.Month; + } + // the day + aDateTime.Day = static_cast< sal_uInt16 >( nDaysInYear + 1 ); + // number of nanoseconds in the day + sal_Int64 nTimeInDay = nFileTime % sal_Int64( ::tools::Time::nanoSecPerDay ); + // nanoseconds + aDateTime.NanoSeconds = static_cast< sal_uInt32 >( nTimeInDay % ::tools::Time::nanoSecPerSec ); + nTimeInDay /= ::tools::Time::nanoSecPerSec; + // seconds + aDateTime.Seconds = static_cast< sal_uInt16 >( nTimeInDay % ::tools::Time::secondPerMinute ); + nTimeInDay /= ::tools::Time::secondPerMinute; + // minutes + aDateTime.Minutes = static_cast< sal_uInt16 >( nTimeInDay % ::tools::Time::minutePerHour ); + nTimeInDay /= ::tools::Time::minutePerHour; + // hours + aDateTime.Hours = static_cast< sal_uInt16 >( nTimeInDay ); + + writeDateTimeItem( EMPTY_STRING, aDateTime ); + return aDateTime; +} + +OUString InputObjectBase::dumpGuid( const String& rName ) +{ + OUStringBuffer aBuffer; + sal_uInt32 nData32; + sal_uInt16 nData16; + sal_uInt8 nData8; + + nData32 = mxStrm->readuInt32(); + StringHelper::appendHex( aBuffer, nData32, false ); + aBuffer.append( '-' ); + nData16 = mxStrm->readuInt16(); + StringHelper::appendHex( aBuffer, nData16, false ); + aBuffer.append( '-' ); + nData16 = mxStrm->readuInt16(); + StringHelper::appendHex( aBuffer, nData16, false ); + aBuffer.append( '-' ); + nData8 = mxStrm->readuChar(); + StringHelper::appendHex( aBuffer, nData8, false ); + nData8 = mxStrm->readuChar( ); + StringHelper::appendHex( aBuffer, nData8, false ); + aBuffer.append( '-' ); + for( int nIndex = 0; nIndex < 6; ++nIndex ) + { + nData8 = mxStrm->readuChar( ); + StringHelper::appendHex( aBuffer, nData8, false ); + } + StringHelper::enclose( aBuffer, '{', '}' ); + OUString aGuid = aBuffer.makeStringAndClear(); + writeGuidItem( rName( "guid" ), aGuid ); + return aGuid; +} + +void InputObjectBase::dumpItem( const ItemFormat& rItemFmt ) +{ + switch( rItemFmt.meDataType ) + { + case DATATYPE_VOID: break; + case DATATYPE_INT8: dumpValue< sal_Int8 >( rItemFmt ); break; + case DATATYPE_UINT8: dumpValue< sal_uInt8 >( rItemFmt ); break; + case DATATYPE_INT16: dumpValue< sal_Int16 >( rItemFmt ); break; + case DATATYPE_UINT16: dumpValue< sal_uInt16 >( rItemFmt ); break; + case DATATYPE_INT32: dumpValue< sal_Int32 >( rItemFmt ); break; + case DATATYPE_UINT32: dumpValue< sal_uInt32 >( rItemFmt ); break; + case DATATYPE_INT64: dumpValue< sal_Int64 >( rItemFmt ); break; + case DATATYPE_UINT64: dumpValue< sal_uInt64 >( rItemFmt ); break; + case DATATYPE_FLOAT: dumpValue< float >( rItemFmt ); break; + case DATATYPE_DOUBLE: dumpValue< double >( rItemFmt ); break; + default:; + } +} + +BinaryStreamObject::BinaryStreamObject( const ObjectBase& rParent, const BinaryInputStreamRef& rxStrm, const OUString& rSysFileName ) +{ + InputObjectBase::construct( rParent, rxStrm, rSysFileName ); +} + +void BinaryStreamObject::dumpBinaryStream( bool bShowOffset ) +{ + mxStrm->seekToStart(); + dumpRawBinary( mxStrm->size(), bShowOffset, true ); + mxOut->emptyLine(); +} + +void BinaryStreamObject::implDump() +{ + dumpBinaryStream(); +} + +void TextStreamObjectBase::construct( const ObjectBase& rParent, + const BinaryInputStreamRef& rxStrm, rtl_TextEncoding eTextEnc, const OUString& rSysFileName ) +{ + InputObjectBase::construct( rParent, rxStrm, rSysFileName ); + constructTextStrmObj( eTextEnc ); +} + +void TextStreamObjectBase::construct( const OutputObjectBase& rParent, + const BinaryInputStreamRef& rxStrm, rtl_TextEncoding eTextEnc ) +{ + InputObjectBase::construct( rParent, rxStrm ); + constructTextStrmObj( eTextEnc ); +} + +bool TextStreamObjectBase::implIsValid() const +{ + return InputObjectBase::implIsValid() && mxTextStrm; +} + +void TextStreamObjectBase::implDump() +{ + implDumpText( *mxTextStrm ); +} + +void TextStreamObjectBase::constructTextStrmObj( rtl_TextEncoding eTextEnc ) +{ + if( mxStrm ) + mxTextStrm = std::make_shared( getContext(), *mxStrm, eTextEnc ); +} + +TextLineStreamObject::TextLineStreamObject( const ObjectBase& rParent, + const BinaryInputStreamRef& rxStrm, rtl_TextEncoding eTextEnc, const OUString& rSysFileName ) +{ + TextStreamObjectBase::construct( rParent, rxStrm, eTextEnc, rSysFileName ); +} + +TextLineStreamObject::TextLineStreamObject( const OutputObjectBase& rParent, + const BinaryInputStreamRef& rxStrm, rtl_TextEncoding eTextEnc ) +{ + TextStreamObjectBase::construct( rParent, rxStrm, eTextEnc ); +} + +void TextLineStreamObject::implDumpText( TextInputStream& rTextStrm ) +{ + sal_uInt32 nLine = 0; + while( !rTextStrm.isEof() ) + { + OUString aLine = rTextStrm.readLine(); + if( !rTextStrm.isEof() || !aLine.isEmpty() ) + implDumpLine( aLine, ++nLine ); + } +} + +void TextLineStreamObject::implDumpLine( const OUString& rLine, sal_uInt32 nLine ) +{ + TableGuard aTabGuard( mxOut, 8 ); + mxOut->writeDec( nLine, 6 ); + mxOut->tab(); + mxOut->writeString( rLine ); + mxOut->newLine(); +} + +XmlStreamObject::XmlStreamObject( const ObjectBase& rParent, + const BinaryInputStreamRef& rxStrm, const OUString& rSysFileName ) +{ + TextStreamObjectBase::construct( rParent, rxStrm, RTL_TEXTENCODING_UTF8, rSysFileName ); +} + +void XmlStreamObject::implDumpText( TextInputStream& rTextStrm ) +{ + /* Buffers a start element and the following element text. Needed to dump + matching start/end elements and the element text on the same line. */ + OUStringBuffer aOldStartElem; + // special handling for VML + bool bIsVml = o3tl::equalsIgnoreAsciiCase(InputOutputHelper::getFileNameExtension( maSysFileName ), u"vml"); + + while( !rTextStrm.isEof() ) + { + // get the next element and the following element text from text stream + OUString aElem = rTextStrm.readToChar( '>', true ).trim(); + OUString aText = rTextStrm.readToChar( '<', false ); + + // remove multiple whitespace from element + sal_Int32 nPos = 0; + while( nPos < aElem.getLength() ) + { + while( (nPos < aElem.getLength()) && (aElem[ nPos ] >= 32) ) ++nPos; + if( nPos < aElem.getLength() ) + aElem = aElem.subView( 0, nPos ) + OUStringChar(' ') + o3tl::trim(aElem.subView( nPos )); + ++nPos; + } + + sal_Int32 nElemLen = aElem.getLength(); + if( (nElemLen >= 2) && (aElem[ 0 ] == '<') && (aElem[ nElemLen - 1 ] == '>') ) + { + // determine type of the element + bool bSimpleElem = (aElem[ 1 ] == '!') || (aElem[ 1 ] == '?') || (aElem[ nElemLen - 2 ] == '/') || + (bIsVml && (nElemLen == 4) && (aElem[ 1 ] == 'b') && (aElem[ 2 ] == 'r')); + bool bStartElem = !bSimpleElem && (aElem[ 1 ] != '/'); + bool bEndElem = !bSimpleElem && !bStartElem; + + /* Start element or simple element: flush old start element and + its text from previous iteration, and start a new indentation + level for the new element. Trim whitespace and line breaks from + the text of the old start element. */ + if( (bSimpleElem || bStartElem) && (aOldStartElem.getLength() > 0) ) + { + mxOut->writeString( aOldStartElem.makeStringAndClear().trim() ); + mxOut->newLine(); + mxOut->incIndent(); + } + + /* Start element: remember it and its text, to be able to print the + matching end element on the same line in the next iteration. */ + if( bStartElem ) + { + aOldStartElem.append( aElem + aText ); + } + else + { + /* End element: if a start element has been remembered in the + previous iteration, write it out here untrimmed, to show + all whitespace in the element text, and without trailing + line break. Code below will add the end element right after + it. Otherwise, return to previous indentation level. */ + if( bEndElem ) + { + if( aOldStartElem.getLength() == 0 ) + mxOut->decIndent(); + else + mxOut->writeString( aOldStartElem.makeStringAndClear() ); + } + + /* Write the element. Write following element text in a new + line, but only, if it does not contain of white space + entirely. */ + mxOut->writeString( aElem ); + mxOut->newLine(); + if( !aText.trim().isEmpty() ) + { + mxOut->writeString( aText ); + mxOut->newLine(); + } + } + } + } +} + +void RecordObjectBase::construct( const ObjectBase& rParent, + const BinaryInputStreamRef& rxBaseStrm, const OUString& rSysFileName, + const BinaryInputStreamRef& rxRecStrm, const String& rRecNames, const String& rSimpleRecs ) +{ + InputObjectBase::construct( rParent, rxRecStrm, rSysFileName ); + constructRecObjBase( rxBaseStrm, rRecNames, rSimpleRecs ); +} + +bool RecordObjectBase::implIsValid() const +{ + return mxBaseStrm && InputObjectBase::implIsValid(); +} + +void RecordObjectBase::implDump() +{ + NameListRef xRecNames = maRecNames.getNameList( cfg() ); + ItemFormatMap aSimpleRecs( maSimpleRecs.getNameList( cfg() ) ); + + while( implStartRecord( *mxBaseStrm, mnRecPos, mnRecId, mnRecSize ) ) + { + // record header + mxOut->emptyLine(); + writeHeader(); + implWriteExtHeader(); + IndentGuard aIndGuard( mxOut ); + sal_Int64 nRecPos = mxStrm->tell(); + + // record body + if( !mbBinaryOnly && cfg().hasName( xRecNames, mnRecId ) ) + { + ::std::map< sal_Int64, ItemFormat >::const_iterator aIt = aSimpleRecs.find( mnRecId ); + if( aIt != aSimpleRecs.end() ) + dumpItem( aIt->second ); + else + implDumpRecordBody(); + } + + // remaining undumped data + if( !mxStrm->isEof() && (mxStrm->tell() == nRecPos) ) + dumpRawBinary( mnRecSize, false ); + else + dumpRemainingTo( nRecPos + mnRecSize ); + } +} + +void RecordObjectBase::implWriteExtHeader() +{ +} + +void RecordObjectBase::implDumpRecordBody() +{ +} + +void RecordObjectBase::constructRecObjBase( const BinaryInputStreamRef& rxBaseStrm, const String& rRecNames, const String& rSimpleRecs ) +{ + mxBaseStrm = rxBaseStrm; + maRecNames = rRecNames; + maSimpleRecs = rSimpleRecs; + mnRecPos = mnRecId = mnRecSize = 0; + mbBinaryOnly = false; + if( InputObjectBase::implIsValid() ) + mbShowRecPos = cfg().getBoolOption( "show-record-position", true ); +} + +void RecordObjectBase::writeHeader() +{ + MultiItemsGuard aMultiGuard( mxOut ); + writeEmptyItem( "REC" ); + if( mbShowRecPos && mxBaseStrm->isSeekable() ) + writeShortHexItem( "pos", mnRecPos, "CONV-DEC" ); + writeShortHexItem( "size", mnRecSize, "CONV-DEC" ); + ItemGuard aItem( mxOut, "id" ); + mxOut->writeShortHex( mnRecId ); + addNameToItem( mnRecId, "CONV-DEC" ); + addNameToItem( mnRecId, maRecNames ); +} + +void SequenceRecordObjectBase::construct( const ObjectBase& rParent, + const BinaryInputStreamRef& rxBaseStrm, const OUString& rSysFileName, + const String& rRecNames, const String& rSimpleRecs ) +{ + BinaryInputStreamRef xRecStrm( std::make_shared( *mxRecData ) ); + RecordObjectBase::construct( rParent, rxBaseStrm, rSysFileName, xRecStrm, rRecNames, rSimpleRecs ); +} + +bool SequenceRecordObjectBase::implStartRecord( BinaryInputStream& rBaseStrm, sal_Int64& ornRecPos, sal_Int64& ornRecId, sal_Int64& ornRecSize ) +{ + bool bValid = true; + if( rBaseStrm.isSeekable() ) + { + ornRecPos = rBaseStrm.tell(); + // do not try to overread seekable streams, may cause assertions + bValid = ornRecPos < rBaseStrm.size(); + } + + // read the record header + if( bValid ) + bValid = implReadRecordHeader( rBaseStrm, ornRecId, ornRecSize ) && !rBaseStrm.isEof() && (0 <= ornRecSize) && (ornRecSize <= 0x00100000); + + // read record contents into data sequence + if( bValid ) + { + sal_Int32 nRecSize = static_cast< sal_Int32 >( ornRecSize ); + mxRecData->realloc( nRecSize ); + bValid = (nRecSize == 0) || (rBaseStrm.readData( *mxRecData, nRecSize ) == nRecSize); + mxStrm->seekToStart(); + } + return bValid; +} + +DumperBase::~DumperBase() +{ +} + +bool DumperBase::isImportEnabled() const +{ + return !isValid() || cfg().isImportEnabled(); +} + +void DumperBase::construct( const ConfigRef& rxConfig ) +{ + if( isValid( rxConfig ) && rxConfig->isDumperEnabled() ) + ObjectBase::construct( rxConfig ); +} + +} // namespace oox + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/dump/dumperbase.ini b/oox/source/dump/dumperbase.ini new file mode 100644 index 000000000..efb42651f --- /dev/null +++ b/oox/source/dump/dumperbase.ini @@ -0,0 +1,412 @@ +# +# This file is part of the LibreOffice project. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# +# This file incorporates work covered by the following license notice: +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed +# with this work for additional information regarding copyright +# ownership. The ASF licenses this file to you under the Apache +# License, Version 2.0 (the "License"); you may not use this file +# except in compliance with the License. You may obtain a copy of +# the License at http://www.apache.org/licenses/LICENSE-2.0 . +# + +# dumper settings ============================================================ +# +# Basic concepts +# +# - Character encoding of dumper ini files is UTF-8. +# - Whitespace characters are generally stripped, e.g. at start and end of +# lines, before/after equal signs, commas, etc. +# - Comments start with the hash (#) or semicolon (;) character. Leading +# whitespace characters are ignored. +# +# ---------------------------------------------------------------------------- + +# Enable entire dumper (default=off). This option does not affect the option +# 'enable-import'. +# 0=off, 1=on +enable-dumper=1 + +# Enable import after dumping (default=on). Disabling this option allows +# to dump a file without loading it. This option is independent from the +# 'enable-dumper' option. +# 0=off, 1=on +enable-import=1 + +# Maximum size of binary stream dumps (default=infinite). +max-binary-stream-size=65536 + +# Maximum size of binary data blocks in content dumps (default=infinite). +max-binary-data-size=128 + +# Shows unknown trailing data as binary dump (default=on). +# 0=off, 1=on +show-trailing-unknown=1 + +# Shows the absolute stream position of records in the record header field +# (default=on). +# 0=off, 1=on +show-record-position=0 + +# name lists ================================================================= +# +# Syntax descriptions +# +# - Optional items are enclosed in brackets []. +# - Optional items that may be repeated are marked with an ellipsis (...). +# - Items in a set to choose from are separated by vertical lines (|). +# - denotes the name of a list. List names may consist of any non- +# whitespace characters. +# - , , , etc. denote integer values. +# Decimal and hexadecimal notation is supported, using C/C++ notation. +# - denotes a boolean value. Possible values are 0|1|false|true. +# - denotes a literal name for a constant or bit. +# +# ---------------------------------------------------------------------------- +# +# constlist +# +# Defines names for a list of specific values. +# +# Syntax: +# +# constlist = +# default = +# include = [,...] +# exclude = [,...] +# quote-names = +# = +# end +# +# - default (optional): Declares as a default name for values not +# specified in the name list. may be the empty string. If not +# set, the literal string '?err:no-name' (unquoted) is the default name. +# - include (optional): Includes the specified name list(s) into the own list. +# - exclude (optional): Removes values from the name lists, useful e.g. after +# a name list has been included. +# - quote-names (optional): Specifies whether to return the contained names +# enclosed in single quote (') characters. Default is false. +# +# The order of the declarations is important, later declarations may overwrite +# names generated from earlier declarations. +# +# Example: +# +# constlist = EXAMPLE-CONSTLIST +# 1 = my-value +# include = OTHER-LIST +# exclude = 2,3 +# 0x0004 = other-value +# end +# +# - Defines the name 'my-value' for the constant 1. +# - Includes 'OTHER-LIST' which may overwrite the name of the constant 1. +# - Excludes the names of constants 2 and 3, which may have been included from +# the name list 'OTHER-LIST'. +# - Defines the name 'other-value' for the constant 4, which may overwrite the +# name of this constant included from the name list 'OTHER-LIST'. +# +# ---------------------------------------------------------------------------- +# +# multilist +# +# Defines names for contiguous ranges of values. +# +# Syntax: +# +# multilist = +# default = +# include = [,...] +# exclude = [,...] +# ignore-empty = +# = [,...] +# end +# +# - default (optional): See constlist above. +# - include (optional): See constlist above. +# - exclude (optional): See constlist above. +# - ignore-empty (optional): Specifies whether to skip empty names in a list. +# - True = skips an empty entry, the default name will be generated. +# - False = creates an empty string for the entry. +# Default is true (skip empty entries). +# +# Examples: +# +# multilist = EXAMPLE-MULTILIST +# 0 = value0,value1,,value3 +# 8 = value8 +# end +# +# - Defines the names 'value0' for the constant 0, 'value1' for the constant +# 1, 'value3' for the constant 3, and 'value8' for the constant 8. +# +# multilist = EXAMPLE-MULTILIST-2 +# include = EXAMPLE-MULTILIST +# ignore-empty = false +# default = other +# end +# +# - Same as example above (includes EXAMPLE-MULTILIST), but defines the empty +# string for the constant 2. Other constants (less than 0 or greater than 3 +# and not equal to 8) get the default name 'other'. +# +# ---------------------------------------------------------------------------- +# +# shortlist +# +# Defines names for a contiguous range of values. The entire list definition +# is given in a single text line. +# +# Syntax: +# +# shortlist = ,,[,...] +# +# Uses default settings of the multi-list (i.e. skips empty entries). +# +# ---------------------------------------------------------------------------- +# +# flagslist +# +# Defines names for single bits in a bit field. +# +# Syntax: +# +# flagslist = +# include = [,...] +# exclude = [,...] +# ignore = +# = | ! | : | !! +# end +# +# - include (optional): See constlist above. +# - exclude (optional): See constlist above. +# - ignore (optional): Specifies bits to be ignored. Bits without an explicit +# name and not set in this declaration will be shown as unknown. Default is +# to not ignore a bit. +# - : The bit to be named. Must be a value with a single bit set. +# - - Sets a name for the bit that will be shown if the bit is set. +# Does not show anything if the bit is cleared. +# - ! - Sets a name for the bit that will be shown if the bit is +# cleared. Does not show anything if the bit is set. +# - : - Sets a name for the bit that will always be shown together +# with the actual state of the bit, appended as ':on' or ':off'. +# - !! - Sets a name for both the cleared bit (cname0), and +# for the set bit (cname1). +# +# ---------------------------------------------------------------------------- +# +# combilist +# +# Defines names for single bits and for embedded values in a bit field. This +# is an extension of the flagslist described above. +# +# Syntax: +# +# combilist = +# include = [,...] +# exclude = [,...] +# ignore = +# = | ! | : | !! +# = ,,[,[,options...]] +# end +# +# - include (optional): See constlist above. +# - exclude (optional): See constlist above. +# - ignore (optional): See flagslist above. +# - : See flagslist above. +# - : The mask of the embedded bitfield. Must be a value with +# exactly one sequence of at least 2 consecutive bits. +# - : [u]int8 | [u]int16 | [u]int32 | [u]int64 | float | double +# - : dec | hex | shorthex | bin | fix | bool +# - : The name of the embedded bitfield. +# - : Optional name list with names for the values of the embedded +# bitfield. +# - options: Additional options for this bitfield: +# - filter = ~: If set, the entire bitfield +# will only be written, if the complete data item currently dumped +# contains exactly the value specified in in the bitfield +# specified in . Otherwise, nothing is written. It is +# possible to specify multiple filter rules for this bitfield. In that +# case, the bitfield will be written, if at least one filter rule +# applies for the current data item. +# - noshift = : If set to 'true', the extracted value will be +# shifted to the right (normalized). If set to 'false', the value will +# be written unshifted. Default is 'true'. +# +# ---------------------------------------------------------------------------- +# +# unitconverter +# +# Converts values and appends a unit name. +# +# Syntax: +# +# unitconverter = ,[/][,] +# +# ---------------------------------------------------------------------------- + +unitconverter=CONV-DEC,1 +unitconverter=CONV-PERCENT,1,% +unitconverter=CONV-FLOAT-TO-PERC,100,% +unitconverter=CONV-DEG,1,° +unitconverter=CONV-HMM-TO-CM,/1000,cm +unitconverter=CONV-INCH-TO-CM,2.54,cm +unitconverter=CONV-PT-TO-CM,/28.346457,cm +unitconverter=CONV-PT1616-TO-CM,/1857713.4,cm +unitconverter=CONV-TWIP-TO-CM,/566.92913,cm +unitconverter=CONV-TWIP-TO-PT,/20,pt +unitconverter=CONV-EMU-TO-CM,/36000,cm + +constlist=BOOLEAN + 0=FALSE + default=TRUE +end + +combilist=RK-FLAGS + 0x00000001=div-100 + 0x00000002=integer + 0xFFFFFFFC=int32,hex,value +end + +constlist=CHARSET + 0=win-1252-latin-1 + 1=system-default + 2=symbol + 77=apple-roman + 128=win-932-japanese-shift-jis + 129=win-949-korean-hangul + 130=win-1361-korean-johab + 134=win-936-chinese-simplified-gbk + 136=win-950-chinese-traditional-big5 + 161=win-1253-greek + 162=win-1254-turkish + 163=win-1258-vietnamese + 177=win-1255-hebrew + 178=win-1256-arabic + 186=win-1257-baltic + 204=win-1251-cyrillic + 222=win-874-thai + 238=win-1250-latin-2-central-european + 255=ibm-850-latin-1 +end + +combilist=FONT-PITCHFAMILY + 0x0F=uint8,dec,pitch,FONT-PITCH + 0xF0=uint8,dec,family,FONT-FAMILY +end + +constlist=FONT-WEIGHT + 400=normal + 700=bold +end + +shortlist=FONT-PITCH,0,unknown,fixed,variable +shortlist=FONT-FAMILY,0,unknown,roman,swiss,modern,script,decorative + +constlist=CODEPAGES + 367=ascii + 437=ibm-437-us + 708=iso-8859-6 + 720=ibm-720-arabic + 737=ibm-737-greek + 775=ibm-775-baltic + 850=ibm-850-latin-1 + 852=ibm-852-latin-2-central-european + 855=ibm-855-cyrillic + 857=ibm-857-turkish + 858=ibm-858-multilingual-latin-1-with-euro + 860=ibm-860-portuguese + 861=ibm-861-icelandic + 862=ibm-862-hebrew + 863=ibm-863-canadian-french + 864=ibm-864-arabic + 865=ibm-865-nordic + 866=ibm-866-cyrillic-russian + 869=ibm-869-greek-modern + 874=win-874-thai + 932=win-932-japanese-shift-jis + 936=win-936-chinese-simplified-gbk + 949=win-949-korean-wansung + 950=win-950-chinese-traditional-big5 + 1200=utf-16 + 1250=win-1250-latin-2-central-european + 1251=win-1251-cyrillic + 1252=win-1252-latin-1 + 1253=win-1253-greek + 1254=win-1254-turkish + 1255=win-1255-hebrew + 1256=win-1256-arabic + 1257=win-1257-baltic + 1258=win-1258-vietnamese + 1361=win-1361-korean-johab + 10000=apple-roman + 10001=apple-japanese + 10002=apple-chinese-traditional + 10003=apple-korean + 10004=apple-arabic + 10005=apple-hebrew + 10006=apple-greek + 10007=apple-cyrillic + 10008=apple-chinese-simplified + 10010=apple-romanian + 10017=apple-ukrainian + 10029=apple-central-european-with-euro + 10079=apple-icelandic + 10081=apple-turkish + 10082=apple-croatian + 20127=ascii + 20866=koi8-r + 21866=koi8-u + 28591=iso-8859-1 + 28592=iso-8859-2 + 28593=iso-8859-3 + 28594=iso-8859-4 + 28595=iso-8859-5 + 28596=iso-8859-6 + 28597=iso-8859-7 + 28598=iso-8859-8 + 28599=iso-8859-9 + 28605=iso-8859-15 + 32768=apple-romanian + 32769=win-1252-latin-1 + 50220=iso-2022-jp + 50225=iso-2022-kr + 51932=euc-jp + 51936=euc-cn + 51949=euc-kr + 65000=utf-7 + 65001=utf-8 +end + +multilist=COUNTRY + 1=usa,canada,latin-america,,,,russia + 20=egypt + 30=greece,netherlands,belgium,france,spain,,hungary,,,italy + 40=,switzerland,,austria,uk,denmark,sweden,norway,poland,germany + 50=,,mexico,,,brazil + 60=,australia,,,new-zealand,,thailand + 80=,japan,korea,,vietnam,,china + 90=turkey + 210=,,,algeria,,,morocco,,libya + 350=,portugal,,,iceland,,,,finland + 420=czech + 880=,,,,,,taiwan + 960=,lebanon,jordan,syria,iraq,kuwait,saudi-arabia + 970=,uae,israel,,qatar + 980=,iran +end + +multilist=SYSTEMCOLOR + 0x00=scrollbar,desktop,active-title,inactive-title,menu,window-back,window-frame,menu-text + 0x08=window-text,active-title-text,active-border,inactive-border,app-workspace,highlight,highlight-text,button-face + 0x10=button-shadow,disabled-text,button-text,inactive-title-text,button-highlight,button-dark-shadow,button-light-shadow,tooltip-text + 0x18=tooltip-back,,hot-light,active-title-2,inactive-title-2,menu-highlight,menubar +end + +# ============================================================================ diff --git a/oox/source/dump/oledumper.cxx b/oox/source/dump/oledumper.cxx new file mode 100644 index 000000000..92e67c045 --- /dev/null +++ b/oox/source/dump/oledumper.cxx @@ -0,0 +1,2085 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include + +#include + +#include + +#include +#include +#include + +#ifdef DBG_UTIL + +namespace oox::dump { + +using namespace ::com::sun::star::io; +using namespace ::com::sun::star::uno; + +OUString OleInputObjectBase::dumpAnsiString32( const String& rName ) +{ + return dumpCharArray( rName, mxStrm->readInt32(), RTL_TEXTENCODING_MS_1252 ); +} + +OUString OleInputObjectBase::dumpUniString32( const String& rName ) +{ + return dumpUnicodeArray( rName, mxStrm->readInt32() ); +} + +sal_Int32 OleInputObjectBase::dumpStdClipboardFormat( const String& rName ) +{ + return dumpDec< sal_Int32 >( rName( "clipboard-format" ), "OLE-STD-CLIPBOARD-FORMAT" ); +} + +OUString OleInputObjectBase::dumpAnsiString32OrStdClip( const String& rName ) +{ + sal_Int32 nLen = mxStrm->readInt32(); + return (nLen < 0) ? OUString::number( dumpStdClipboardFormat( rName ) ) : dumpCharArray( rName, nLen, RTL_TEXTENCODING_MS_1252 ); +} + +OUString OleInputObjectBase::dumpUniString32OrStdClip( const String& rName ) +{ + sal_Int32 nLen = mxStrm->readInt32(); + return (nLen < 0) ? OUString::number( dumpStdClipboardFormat( rName ) ) : dumpUnicodeArray( rName, nLen ); +} + +void OleInputObjectBase::writeOleColorItem( const String& rName, sal_uInt32 nColor ) +{ + MultiItemsGuard aMultiGuard( mxOut ); + writeHexItem( rName, nColor, "OLE-COLOR" ); +} + +sal_uInt32 OleInputObjectBase::dumpOleColor( const String& rName ) +{ + sal_uInt32 nOleColor = mxStrm->readuInt32(); + writeOleColorItem( rName, nOleColor ); + return nOleColor; +} + +StdFontObject::StdFontObject( const InputObjectBase& rParent ) +{ + construct( rParent ); +} + +void StdFontObject::implDump() +{ + dumpDec< sal_uInt8 >( "version" ); + dumpDec< sal_uInt16 >( "charset", "CHARSET" ); + dumpHex< sal_uInt8 >( "flags", "STDFONT-FLAGS" ); + dumpDec< sal_uInt16 >( "weight", "FONT-WEIGHT" ); + dumpDec< sal_uInt32 >( "height", "STDFONT-HEIGHT" ); + dumpCharArray( "name", mxStrm->readuInt8(), RTL_TEXTENCODING_ASCII_US ); +} + +StdPicObject::StdPicObject( const InputObjectBase& rParent ) +{ + construct( rParent ); +} + +void StdPicObject::implDump() +{ + dumpHex< sal_uInt32 >( "identifier", "STDPIC-ID" ); + sal_uInt32 nSize = dumpHex< sal_uInt32 >( "image-size", "CONV-DEC" ); + dumpBinary( "image-data", nSize ); +} + +OleStreamObject::OleStreamObject( const ObjectBase& rParent, const BinaryInputStreamRef& rxStrm, const OUString& rSysFileName ) +{ + construct( rParent, rxStrm, rSysFileName ); +} + +OleCompObjObject::OleCompObjObject( const ObjectBase& rParent, const BinaryInputStreamRef& rxStrm, const OUString& rSysFileName ) : + OleStreamObject( rParent, rxStrm, rSysFileName ) +{ +} + +void OleCompObjObject::implDump() +{ + dumpUnused( 4 ); + dumpDec< sal_uInt32 >( "version" ); + dumpUnused( 20 ); + dumpAnsiString32( "ansi-display-name" ); + dumpAnsiString32OrStdClip( "ansi-clipboard-format" ); + if( mxStrm->getRemaining() >= 4 ) + { + sal_Int32 nLen = mxStrm->readInt32(); + if( (0 <= nLen) && (nLen <= 40) ) + { + dumpCharArray( "ansi-unused", nLen, RTL_TEXTENCODING_MS_1252 ); + if( (mxStrm->getRemaining() >= 4) && (dumpHex< sal_Int32 >( "unicode-marker" ) == 0x71B239F4) ) + { + dumpUniString32( "unicode-display-name" ); + dumpUniString32OrStdClip( "unicode-clipboard-format" ); + dumpUniString32( "unicode-unused" ); + } + } + else + writeDecItem( "length", nLen ); + } + dumpRemainingStream(); +} + +namespace { + +const sal_Int32 OLEPROP_ID_DICTIONARY = 0; +const sal_Int32 OLEPROP_ID_CODEPAGE = 1; + +const sal_uInt16 OLEPROP_TYPE_INT16 = 2; +const sal_uInt16 OLEPROP_TYPE_INT32 = 3; +const sal_uInt16 OLEPROP_TYPE_FLOAT = 4; +const sal_uInt16 OLEPROP_TYPE_DOUBLE = 5; +const sal_uInt16 OLEPROP_TYPE_DATE = 7; +const sal_uInt16 OLEPROP_TYPE_STRING = 8; +const sal_uInt16 OLEPROP_TYPE_STATUS = 10; +const sal_uInt16 OLEPROP_TYPE_BOOL = 11; +const sal_uInt16 OLEPROP_TYPE_VARIANT = 12; +const sal_uInt16 OLEPROP_TYPE_INT8 = 16; +const sal_uInt16 OLEPROP_TYPE_UINT8 = 17; +const sal_uInt16 OLEPROP_TYPE_UINT16 = 18; +const sal_uInt16 OLEPROP_TYPE_UINT32 = 19; +const sal_uInt16 OLEPROP_TYPE_INT64 = 20; +const sal_uInt16 OLEPROP_TYPE_UINT64 = 21; +const sal_uInt16 OLEPROP_TYPE_STRING8 = 30; +const sal_uInt16 OLEPROP_TYPE_STRING16 = 31; +const sal_uInt16 OLEPROP_TYPE_FILETIME = 64; +const sal_uInt16 OLEPROP_TYPE_BLOB = 65; +const sal_uInt16 OLEPROP_TYPE_STREAM = 66; +const sal_uInt16 OLEPROP_TYPE_STORAGE = 67; +const sal_uInt16 OLEPROP_TYPE_CLIPFMT = 71; + +const sal_uInt16 OLEPROP_TYPE_SIMPLE = 0x0000; +const sal_uInt16 OLEPROP_TYPE_VECTOR = 0x1000; +const sal_uInt16 OLEPROP_TYPE_ARRAY = 0x2000; + +const sal_uInt16 CODEPAGE_UNICODE = 1200; + +const sal_uInt32 AX_STRING_COMPRESSED = 0x80000000; + +} // namespace + +OlePropertyStreamObject::OlePropertyStreamObject( const ObjectBase& rParent, const BinaryInputStreamRef& rxStrm, const OUString& rSysFileName ) +{ + construct( rParent, rxStrm, rSysFileName ); +} + +void OlePropertyStreamObject::implDump() +{ + OUStringVector aGuidVec; + ::std::vector< sal_uInt32 > aStartPosVec; + + // dump header + writeEmptyItem( "HEADER" ); + { + IndentGuard aIndGuard( mxOut ); + dumpHex< sal_uInt16 >( "byte-order", "OLEPROP-BYTE-ORDER" ); + dumpDec< sal_uInt16 >( "version" ); + dumpDec< sal_uInt16 >( "os-minor" ); + dumpDec< sal_uInt16 >( "os-type", "OLEPROP-OSTYPE" ); + dumpGuid( "guid" ); + sal_Int32 nSectCount = dumpDec< sal_Int32 >( "section-count" ); + + // dump table of section positions + { + TableGuard aTabGuard( mxOut, 15, 60 ); + mxOut->resetItemIndex(); + for( sal_Int32 nSectIdx = 0; !mxStrm->isEof() && (nSectIdx < nSectCount); ++nSectIdx ) + { + MultiItemsGuard aMultiGuard( mxOut ); + writeEmptyItem( "#section" ); + aGuidVec.push_back( dumpGuid( "guid" ) ); + aStartPosVec.push_back( dumpHex< sal_uInt32 >( "start-pos", "CONV-DEC" ) ); + } + } + } + mxOut->emptyLine(); + + // dump sections + for( size_t nSectIdx = 0; !mxStrm->isEof() && (nSectIdx < aStartPosVec.size()); ++nSectIdx ) + dumpSection( aGuidVec[ nSectIdx ], aStartPosVec[ nSectIdx ] ); +} + +void OlePropertyStreamObject::dumpSection( const OUString& rGuid, sal_uInt32 nStartPos ) +{ + // property ID names + mxPropIds = cfg().createNameList< ConstList >( "OLEPROP-IDS" ); + OUString aGuidName = cfg().getStringOption( rGuid, OUString() ); + if ( aGuidName == "GlobalDocProp" ) + mxPropIds->includeList( cfg().getNameList( "OLEPROP-GLOBALIDS" ) ); + else if ( aGuidName == "BuiltinDocProp" ) + mxPropIds->includeList( cfg().getNameList( "OLEPROP-BUILTINIDS" ) ); + else + mxPropIds->includeList( cfg().getNameList( "OLEPROP-BASEIDS" ) ); + + // property ID/position map + typedef ::std::map< sal_Int32, sal_uInt32 > PropertyPosMap; + PropertyPosMap aPropMap; + + // dump section header line + writeSectionHeader( rGuid, nStartPos ); + + // seek to section + IndentGuard aIndGuard( mxOut ); + if( startElement( nStartPos ) ) + { + // dump section header + dumpDec< sal_Int32 >( "size" ); + sal_Int32 nPropCount = dumpDec< sal_Int32 >( "property-count" ); + + // dump table of property positions + { + TableGuard aTabGuard( mxOut, 15, 25 ); + mxOut->resetItemIndex(); + for( sal_Int32 nPropIdx = 0; !mxStrm->isEof() && (nPropIdx < nPropCount); ++nPropIdx ) + { + MultiItemsGuard aMultiGuard( mxOut ); + writeEmptyItem( "#property" ); + sal_Int32 nPropId = dumpDec< sal_Int32 >( "id", mxPropIds ); + sal_uInt32 nPropPos = nStartPos + dumpHex< sal_uInt32 >( "start-pos", "CONV-DEC" ); + aPropMap[ nPropId ] = nPropPos; + } + } + } + mxOut->emptyLine(); + + // code page property + meTextEnc = RTL_TEXTENCODING_MS_1252; + mbIsUnicode = false; + PropertyPosMap::iterator aCodePageIt = aPropMap.find( OLEPROP_ID_CODEPAGE ); + if( aCodePageIt != aPropMap.end() ) + { + dumpCodePageProperty( aCodePageIt->second ); + aPropMap.erase( aCodePageIt ); + } + + // dictionary property + PropertyPosMap::iterator aDictIt = aPropMap.find( OLEPROP_ID_DICTIONARY ); + if( aDictIt != aPropMap.end() ) + { + dumpDictionaryProperty( aDictIt->second ); + aPropMap.erase( aDictIt ); + } + + // other properties + for (auto const& elem : aPropMap) + dumpProperty( elem.first, elem.second ); + + // remove the user defined list of property ID names + cfg().eraseNameList( "OLEPROP-IDS" ); +} + +void OlePropertyStreamObject::dumpProperty( sal_Int32 nPropId, sal_uInt32 nStartPos ) +{ + writePropertyHeader( nPropId, nStartPos ); + IndentGuard aIndGuard( mxOut ); + if( startElement( nStartPos ) ) + dumpPropertyContents( nPropId ); + mxOut->emptyLine(); +} + +void OlePropertyStreamObject::dumpCodePageProperty( sal_uInt32 nStartPos ) +{ + writePropertyHeader( OLEPROP_ID_CODEPAGE, nStartPos ); + IndentGuard aIndGuard( mxOut ); + if( startElement( nStartPos ) ) + { + sal_uInt16 nType = dumpPropertyType(); + if( nType == OLEPROP_TYPE_INT16 ) + { + sal_uInt16 nCodePage = dumpDec< sal_uInt16 >( "codepage", "CODEPAGES" ); + rtl_TextEncoding eNewTextEnc = rtl_getTextEncodingFromWindowsCodePage( nCodePage ); + if( eNewTextEnc != RTL_TEXTENCODING_DONTKNOW ) + meTextEnc = eNewTextEnc; + mbIsUnicode = nCodePage == CODEPAGE_UNICODE; + } + else + dumpPropertyContents( OLEPROP_ID_CODEPAGE ); + } + mxOut->emptyLine(); +} + +void OlePropertyStreamObject::dumpDictionaryProperty( sal_uInt32 nStartPos ) +{ + writePropertyHeader( OLEPROP_ID_DICTIONARY, nStartPos ); + IndentGuard aIndGuard( mxOut ); + if( startElement( nStartPos ) ) + { + sal_Int32 nCount = dumpDec< sal_Int32 >( "count" ); + for( sal_Int32 nIdx = 0; !mxStrm->isEof() && (nIdx < nCount); ++nIdx ) + { + MultiItemsGuard aMultiGuard( mxOut ); + TableGuard aTabGuard( mxOut, 10, 20 ); + sal_Int32 nId = dumpDec< sal_Int32 >( "id" ); + OUString aName = dumpString8( "name" ); + if( mxPropIds ) + mxPropIds->setName( nId, aName ); + } + } + mxOut->emptyLine(); +} + +sal_uInt16 OlePropertyStreamObject::dumpPropertyContents( sal_Int32 nPropId ) +{ + sal_uInt16 nType = dumpPropertyType(); + sal_uInt16 nBaseType = static_cast< sal_uInt16 >( nType & 0x0FFF ); + sal_uInt16 nArrayType = static_cast< sal_uInt16 >( nType & 0xF000 ); + switch( nArrayType ) + { + case OLEPROP_TYPE_SIMPLE: dumpPropertyValue( nPropId, nBaseType ); break; + case OLEPROP_TYPE_VECTOR: dumpPropertyVector( nPropId, nBaseType ); break; + case OLEPROP_TYPE_ARRAY: /*TODO*/; break; + } + return nType; +} + +void OlePropertyStreamObject::dumpPropertyValue( sal_Int32 nPropId, sal_uInt16 nBaseType ) +{ + switch( nBaseType ) + { + case OLEPROP_TYPE_INT16: dumpDec< sal_Int16 >( "value" ); break; + case OLEPROP_TYPE_INT32: dumpDec< sal_Int32 >( "value" ); break; + case OLEPROP_TYPE_FLOAT: dumpDec< float >( "value" ); break; + case OLEPROP_TYPE_DOUBLE: dumpDec< double >( "value" ); break; + case OLEPROP_TYPE_DATE: dumpDec< double >( "date" ); break; + case OLEPROP_TYPE_STRING: dumpString8( "value" ); break; + case OLEPROP_TYPE_STATUS: dumpHex< sal_Int32 >( "status" ); break; + case OLEPROP_TYPE_BOOL: dumpBool< sal_Int16 >( "value" ); break; + case OLEPROP_TYPE_VARIANT: dumpPropertyContents( nPropId ); break; + case OLEPROP_TYPE_INT8: dumpDec< sal_Int8 >( "value" ); break; + case OLEPROP_TYPE_UINT8: dumpDec< sal_uInt8 >( "value" ); break; + case OLEPROP_TYPE_UINT16: dumpDec< sal_uInt16 >( "value" ); break; + case OLEPROP_TYPE_UINT32: dumpDec< sal_uInt32 >( "value" ); break; + case OLEPROP_TYPE_INT64: dumpDec< sal_Int64 >( "value" ); break; + case OLEPROP_TYPE_UINT64: dumpDec< sal_uInt64 >( "value" ); break; + case OLEPROP_TYPE_STRING8: dumpString8( "value" ); break; + case OLEPROP_TYPE_STRING16: dumpString16( "value" ); break; + case OLEPROP_TYPE_FILETIME: dumpFileTime( "file-time" ); break; + case OLEPROP_TYPE_BLOB: dumpBlob( nPropId, "data" ); break; + case OLEPROP_TYPE_STREAM: dumpString8( "stream-name" ); break; + case OLEPROP_TYPE_STORAGE: dumpString8( "storage-name" ); break; + case OLEPROP_TYPE_CLIPFMT: dumpBlob( nPropId, "clip-data" ); break; + } +} + +void OlePropertyStreamObject::dumpPropertyVector( sal_Int32 nPropId, sal_uInt16 nBaseType ) +{ + sal_Int32 nElemCount = dumpDec< sal_Int32 >( "element-count" ); + for( sal_Int32 nElemIdx = 0; !mxStrm->isEof() && (nElemIdx < nElemCount); ++nElemIdx ) + { + mxOut->resetItemIndex( nElemIdx ); + writeEmptyItem( "#element" ); + IndentGuard aIndGuard( mxOut ); + dumpPropertyValue( nPropId, nBaseType ); + } +} + +sal_uInt16 OlePropertyStreamObject::dumpPropertyType() +{ + return static_cast< sal_uInt16 >( dumpHex< sal_Int32 >( "type", "OLEPROP-TYPE" ) & 0xFFFF ); +} + +void OlePropertyStreamObject::dumpBlob( sal_Int32 nPropId, const String& rName ) +{ + sal_Int32 nSize = dumpDec< sal_Int32 >( "data-size" ); + if( nSize > 0 ) + { + OUString aPropName = mxPropIds->getName( cfg(), nPropId ); + if( aPropName == "'_PID_HLINKS'" ) + dumpHlinks( nSize ); + else + dumpBinary( rName, nSize ); + } +} + +OUString OlePropertyStreamObject::dumpString8( const String& rName ) +{ + sal_Int32 nLen = dumpDec< sal_Int32 >( "string-len" ); + return mbIsUnicode ? dumpCharArray16( rName, nLen ) : dumpCharArray8( rName, nLen ); +} + +OUString OlePropertyStreamObject::dumpCharArray8( const String& rName, sal_Int32 nLen ) +{ + sal_Int32 nNewLen = getLimitedValue< sal_Int32, sal_Int32 >( nLen, 0, 1024 ); + OUString aData = mxStrm->readCharArrayUC( nNewLen, meTextEnc ); + writeStringItem( rName, aData ); + return aData; +} + +OUString OlePropertyStreamObject::dumpString16( const String& rName ) +{ + sal_Int32 nLen = dumpDec< sal_Int32 >( "string-len" ); + return dumpCharArray16( rName, nLen ); +} + +OUString OlePropertyStreamObject::dumpCharArray16( const String& rName, sal_Int32 nLen ) +{ + sal_Int32 nNewLen = getLimitedValue< sal_Int32, sal_Int32 >( nLen, 0, 1024 ); + OUString aData = mxStrm->readUnicodeArray( nNewLen ); + writeStringItem( rName, aData ); + if( nNewLen & 1 ) dumpUnused( 2 ); // always padding to 32bit + return aData; +} + +bool OlePropertyStreamObject::dumpTypedProperty( const String& rName, sal_uInt16 nExpectedType ) +{ + writeEmptyItem( rName ); + IndentGuard aIndGuard( mxOut ); + return (dumpPropertyContents( -1 ) == nExpectedType) && !mxStrm->isEof(); +} + +void OlePropertyStreamObject::dumpHlinks( sal_Int32 nSize ) +{ + sal_Int64 nEndPos = mxStrm->tell() + nSize; + sal_Int32 nCount = dumpDec< sal_Int32 >( "property-count" ); + bool bValid = true; + for( sal_Int32 nHlinkIndex = 0, nHlinkCount = nCount / 6; bValid && !mxStrm->isEof() && (nHlinkIndex < nHlinkCount); ++nHlinkIndex ) + { + writeEmptyItem( "HYPERLINK" ); + IndentGuard aIndGuard( mxOut ); + bValid = + dumpTypedProperty( "hash", OLEPROP_TYPE_INT32 ) && + dumpTypedProperty( "app", OLEPROP_TYPE_INT32 ) && + dumpTypedProperty( "shape-id", OLEPROP_TYPE_INT32 ) && + dumpTypedProperty( "info", OLEPROP_TYPE_INT32 ) && + dumpTypedProperty( "target", OLEPROP_TYPE_STRING16 ) && + dumpTypedProperty( "location", OLEPROP_TYPE_STRING16 ); + } + dumpRemainingTo( nEndPos ); +} + +bool OlePropertyStreamObject::startElement( sal_uInt32 nStartPos ) +{ + mxStrm->seek( nStartPos ); + if( mxStrm->isEof() ) + writeInfoItem( "stream-state", OOX_DUMP_ERR_STREAM ); + return !mxStrm->isEof(); +} + +void OlePropertyStreamObject::writeSectionHeader( const OUString& rGuid, sal_uInt32 nStartPos ) +{ + MultiItemsGuard aMultiGuard( mxOut ); + writeEmptyItem( "SECTION" ); + writeHexItem( "pos", nStartPos, "CONV-DEC" ); + writeGuidItem( "guid", rGuid ); +} + +void OlePropertyStreamObject::writePropertyHeader( sal_Int32 nPropId, sal_uInt32 nStartPos ) +{ + MultiItemsGuard aMultiGuard( mxOut ); + writeEmptyItem( "PROPERTY" ); + writeHexItem( "pos", nStartPos, "CONV-DEC" ); + writeDecItem( "id", nPropId, mxPropIds ); +} + +OleStorageObject::OleStorageObject( const ObjectBase& rParent, const StorageRef& rxStrg, const OUString& rSysPath ) +{ + construct( rParent, rxStrg, rSysPath ); +} + +void OleStorageObject::implDumpStream( const Reference< XInputStream >& rxStrm, const OUString& /*rStrgPath*/, const OUString& rStrmName, const OUString& rSysFileName ) +{ + if ( rStrmName == "\001CompObj" ) + OleCompObjObject( *this, rxStrm, rSysFileName ).dump(); + else if( rStrmName == "\005SummaryInformation" || rStrmName == "\005DocumentSummaryInformation" ) + OlePropertyStreamObject( *this, rxStrm, rSysFileName ).dump(); + else + BinaryStreamObject( *this, rxStrm, rSysFileName ).dump(); +} + +ComCtlObjectBase::ComCtlObjectBase( const InputObjectBase& rParent, + sal_uInt32 nDataId5, sal_uInt32 nDataId6, sal_uInt16 nVersion, bool bCommonPart, bool bComplexPart ) : + mnDataId5( nDataId5 ), + mnDataId6( nDataId6 ), + mnVersion( nVersion ), + mbCommonPart( bCommonPart ), + mbComplexPart( bComplexPart ) +{ + construct( rParent ); +} + +void ComCtlObjectBase::implDump() +{ + sal_uInt32 nCommonSize = 0; + dumpComCtlSize() && dumpComCtlData( nCommonSize ) && (!mbCommonPart || dumpComCtlCommon( nCommonSize )) && (!mbComplexPart || dumpComCtlComplex()); +} + +void ComCtlObjectBase::implDumpCommonExtra( sal_Int64 /*nEndPos*/ ) +{ +} + +void ComCtlObjectBase::implDumpCommonTrailing() +{ +} + +bool ComCtlObjectBase::dumpComCtlHeader( sal_uInt32 nExpId, sal_uInt16 nExpMajor, sal_uInt16 nExpMinor ) +{ + // no idea if all this is correct... + sal_uInt32 nId = dumpHex< sal_uInt32 >( "header-id", "COMCTL-HEADER-IDS" ); + ItemGuard aItem( mxOut, "version" ); + sal_uInt16 nMinor = mxStrm->readuInt16(); + sal_uInt16 nMajor = mxStrm->readuInt16(); + mxOut->writeDec( nMajor ); + mxOut->writeChar( '.' ); + mxOut->writeDec( nMinor ); + return !mxStrm->isEof() && (nId == nExpId) && ((nExpMajor == SAL_MAX_UINT16) || (nExpMajor == nMajor)) && ((nExpMinor == SAL_MAX_UINT16) || (nExpMinor == nMinor)); +} + +bool ComCtlObjectBase::dumpComCtlSize() +{ + if( dumpComCtlHeader( 0x12344321, 0, 8 ) ) + { + IndentGuard aIndGuard( mxOut ); + dumpDec< sal_Int32 >( "width", "CONV-HMM-TO-CM" ); + dumpDec< sal_Int32 >( "height", "CONV-HMM-TO-CM" ); + return !mxStrm->isEof(); + } + return false; +} + +bool ComCtlObjectBase::dumpComCtlData( sal_uInt32& ornCommonPartSize ) +{ + if( dumpComCtlHeader( (mnVersion == 5) ? mnDataId5 : mnDataId6, mnVersion ) ) + { + IndentGuard aIndGuard( mxOut ); + if( mbCommonPart ) + ornCommonPartSize = dumpDec< sal_uInt32 >( "common-part-size" ); + implDumpProperties(); + return !mxStrm->isEof(); + } + return false; +} + +bool ComCtlObjectBase::dumpComCtlCommon( sal_uInt32 nPartSize ) +{ + sal_Int64 nEndPos = mxStrm->tell() + nPartSize; + if( (nPartSize >= 16) && dumpComCtlHeader( 0xABCDEF01, 5, 0 ) ) + { + IndentGuard aIndGuard( mxOut ); + dumpUnknown( 4 ); + dumpHex< sal_uInt32 >( "common-flags", "COMCTL-COMMON-FLAGS" ); + implDumpCommonExtra( nEndPos ); + dumpRemainingTo( nEndPos ); + implDumpCommonTrailing(); + return !mxStrm->isEof(); + } + return false; +} + +bool ComCtlObjectBase::dumpComCtlComplex() +{ + if( dumpComCtlHeader( 0xBDECDE1F, 5, 1 ) ) + { + IndentGuard aIndGuard( mxOut ); + sal_uInt32 nFlags = dumpHex< sal_uInt32 >( "comctl-complex-flags", "COMCTL-COMPLEX-FLAGS" ); + if( !mxStrm->isEof() && (nFlags & 0x01) ) + { + writeEmptyItem( "font" ); + IndentGuard aIndGuard2( mxOut ); + OUString aClassName = cfg().getStringOption( dumpGuid(), OUString() ); + if ( aClassName == "StdFont" ) + StdFontObject( *this ).dump(); + } + if( !mxStrm->isEof() && (nFlags & 0x02) ) + { + writeEmptyItem( "mouse-icon" ); + IndentGuard aIndGuard2( mxOut ); + OUString aClassName = cfg().getStringOption( dumpGuid(), OUString() ); + if ( aClassName == "StdPic" ) + StdPicObject( *this ).dump(); + } + return !mxStrm->isEof(); + } + return false; +} + +ComCtlScrollBarObject::ComCtlScrollBarObject( const InputObjectBase& rParent, sal_uInt16 nVersion ) : + ComCtlObjectBase( rParent, SAL_MAX_UINT32, 0x99470A83, nVersion, true, true ) +{ +} + +void ComCtlScrollBarObject::implDumpProperties() +{ + dumpHex< sal_uInt32 >( "flags", "COMCTL-SCROLLBAR-FLAGS" ); + dumpDec< sal_Int32 >( "large-change" ); + dumpDec< sal_Int32 >( "small-change" ); + dumpDec< sal_Int32 >( "min" ); + dumpDec< sal_Int32 >( "max" ); + dumpDec< sal_Int32 >( "value" ); +} + +ComCtlProgressBarObject::ComCtlProgressBarObject( const InputObjectBase& rParent, sal_uInt16 nVersion ) : + ComCtlObjectBase( rParent, 0xE6E17E84, 0x97AB8A01, nVersion, true, true ) +{ +} + +void ComCtlProgressBarObject::implDumpProperties() +{ + dumpDec< float >( "min" ); + dumpDec< float >( "max" ); + if( mnVersion == 6 ) + { + dumpBool< sal_uInt16 >( "vertical" ); + dumpBool< sal_uInt16 >( "smooth-scroll" ); + } +} + +ComCtlSliderObject::ComCtlSliderObject( const InputObjectBase& rParent, sal_uInt16 nVersion ) : + ComCtlObjectBase( rParent, 0xE6E17E86, 0x0A2BAE11, nVersion, true, true ) +{ +} + +void ComCtlSliderObject::implDumpProperties() +{ + dumpBool< sal_Int32 >( "vertical" ); + dumpDec< sal_Int32 >( "large-change" ); + dumpDec< sal_Int32 >( "small-change" ); + dumpDec< sal_Int32 >( "min" ); + dumpDec< sal_Int32 >( "max" ); + dumpDec< sal_Int16 >( "select-range", "COMCTL-SLIDER-SELECTRANGE" ); + dumpUnused( 2 ); + dumpDec< sal_Int32 >( "select-start" ); + dumpDec< sal_Int32 >( "select-length" ); + dumpDec< sal_Int32 >( "tick-style", "COMCTL-SLIDER-TICKSTYLE" ); + dumpDec< sal_Int32 >( "tick-frequency" ); + dumpDec< sal_Int32 >( "value" ); + if( mnVersion == 6 ) + dumpBool< sal_Int32 >( "tooltip-below" ); +} + +ComCtlUpDownObject::ComCtlUpDownObject( const InputObjectBase& rParent, sal_uInt16 nVersion ) : + ComCtlObjectBase( rParent, 0xFF3626A0, 0xFF3626A0, nVersion, false, false ) +{ +} + +void ComCtlUpDownObject::implDumpProperties() +{ + dumpUnknown( 16 ); // buddy-property, somehow + dumpDec< sal_Int32 >( "buddy-control" ); + dumpUnknown( 8 ); + dumpDec< sal_Int32 >( "value" ); + dumpUnknown( 4 ); + dumpDec< sal_Int32 >( "increment" ); + dumpDec< sal_Int32 >( "max" ); + dumpDec< sal_Int32 >( "min" ); + dumpHex< sal_uInt32 >( "flags-1", "COMCTL-UPDOWN-FLAGS1" ); + dumpHex< sal_uInt32 >( "flags-2", "COMCTL-UPDOWN-FLAGS2" ); + dumpUnknown( 4 ); +} + +ComCtlImageListObject::ComCtlImageListObject( const InputObjectBase& rParent, sal_uInt16 nVersion ) : + ComCtlObjectBase( rParent, 0xE6E17E80, 0xE6E17E80, nVersion, true, false ) +{ +} + +void ComCtlImageListObject::implDumpProperties() +{ + dumpDec< sal_uInt16 >( "image-width" ); + dumpDec< sal_uInt16 >( "image-height" ); + dumpOleColor( "mask-color" ); + dumpBool< sal_Int16 >( "use-mask-color" ); + dumpUnknown( 2 ); +} + +void ComCtlImageListObject::implDumpCommonExtra( sal_Int64 /*nEndPos*/ ) +{ + dumpUnknown( 4 ); + dumpOleColor( "back-color" ); + dumpUnknown( 4 ); + sal_Int32 nImageCount = dumpDec< sal_Int32 >( "image-count" ); + mxOut->resetItemIndex(); + for( sal_Int32 nImageIndex = 0; (nImageIndex < nImageCount) && !mxStrm->isEof(); ++nImageIndex ) + { + writeEmptyItem( "#image" ); + IndentGuard aIndGuard( mxOut ); + sal_uInt8 nFlags = dumpHex< sal_uInt8 >( "text-flags", "COMCTL-IMAGELIST-TEXTFLAGS" ); + if( nFlags & 0x01 ) dumpUniString32( "caption" ); + if( nFlags & 0x02 ) dumpUniString32( "key" ); + } +} + +void ComCtlImageListObject::implDumpCommonTrailing() +{ + sal_Int32 nImageCount = dumpDec< sal_Int32 >( "image-count" ); + mxOut->resetItemIndex(); + for( sal_Int32 nImageIndex = 0; (nImageIndex < nImageCount) && !mxStrm->isEof(); ++nImageIndex ) + { + writeEmptyItem( "#image" ); + IndentGuard aIndGuard( mxOut ); + dumpDec< sal_Int32 >( "index" ); + StdPicObject( *this ).dump(); + } +} + +ComCtlTabStripObject::ComCtlTabStripObject( const InputObjectBase& rParent, sal_uInt16 nVersion ) : + ComCtlObjectBase( rParent, 0xE6E17E8A, 0xD12A7AC1, nVersion, true, true ) +{ +} + +void ComCtlTabStripObject::implDumpProperties() +{ + dumpHex< sal_uInt32 >( "flags-1", "COMCTL-TABSTRIP-FLAGS1" ); + dumpDec< sal_uInt16 >( "tab-fixed-width", "CONV-HMM-TO-CM" ); + dumpDec< sal_uInt16 >( "tab-fixed-height", "CONV-HMM-TO-CM" ); + if( mnVersion == 6 ) + { + dumpHex< sal_uInt32 >( "flags-2", "COMCTL-TABSTRIP-FLAGS2" ); + dumpDec< sal_uInt16 >( "tab-min-width", "CONV-HMM-TO-CM" ); + dumpUnknown( 2 ); + dumpHex< sal_uInt32 >( "flags-3", "COMCTL-TABSTRIP-FLAGS3" ); + } +} + +void ComCtlTabStripObject::implDumpCommonExtra( sal_Int64 /*nEndPos*/ ) +{ + dumpUnknown( 12 ); + dumpUniString32( "image-list" ); + sal_Int32 nTabCount = dumpDec< sal_Int32 >( "tab-count" ); + mxOut->resetItemIndex(); + for( sal_Int32 nTabIndex = 0; (nTabIndex < nTabCount) && !mxStrm->isEof(); ++nTabIndex ) + { + writeEmptyItem( "#tab" ); + IndentGuard aIndGuard( mxOut ); + dumpUnknown( 4 ); + sal_uInt32 nTabFlags = dumpHex< sal_uInt32 >( "tab-flags", "COMCTL-TABSTRIP-TABFLAGS" ); + if( nTabFlags & 0x01 ) dumpUniString32( "caption" ); + if( nTabFlags & 0x02 ) dumpUniString32( "key" ); + if( nTabFlags & 0x04 ) dumpUniString32( "tag" ); + if( nTabFlags & 0x08 ) dumpUniString32( "tooltip" ); + dumpDec< sal_uInt16 >( "image-id" ); + } +} + +ComCtlTreeViewObject::ComCtlTreeViewObject( const InputObjectBase& rParent, sal_uInt16 nVersion ) : + ComCtlObjectBase( rParent, 0xE6E17E8E, 0x6AC13CB1, nVersion, true, true ), + mnStringFlags( 0 ) +{ +} + +void ComCtlTreeViewObject::implDumpProperties() +{ + dumpHex< sal_uInt32 >( "flags", "COMCTL-TREEVIEW-FLAGS" ); + dumpDec< sal_Int32 >( "indentation", "CONV-HMM-TO-CM" ); + if( mnVersion == 6 ) + dumpHex< sal_uInt32 >( "flags-2", "COMCTL-TREEVIEW-FLAGS2" ); + mnStringFlags = dumpHex< sal_uInt32 >( "string-flags", "COMCTL-TREEVIEW-STRINGFLAGS" ); +} + +void ComCtlTreeViewObject::implDumpCommonExtra( sal_Int64 /*nEndPos*/ ) +{ + dumpOleColor( "text-color" ); + dumpOleColor( "back-color" ); + dumpUnknown( 4 ); + if( mnStringFlags & 0x02 ) + dumpUniString32( "image-list" ); + dumpUniString32( "path-separator" ); +} + +ComCtlStatusBarObject::ComCtlStatusBarObject( const InputObjectBase& rParent, sal_uInt16 nVersion ) : + ComCtlObjectBase( rParent, 0xE6E17E88, SAL_MAX_UINT32, nVersion, true, true ) +{ +} + +void ComCtlStatusBarObject::implDumpProperties() +{ + dumpBool< sal_Int32 >( "style-simple-text" ); + dumpBool< sal_Int16 >( "show-tips" ); + dumpUnknown( 2 ); +} + +void ComCtlStatusBarObject::implDumpCommonExtra( sal_Int64 /*nEndPos*/ ) +{ + dumpUnknown( 12 ); + dumpUniString32( "simple-text" ); + sal_Int32 nPanelCount = dumpDec< sal_Int32 >( "panel-count" ); + mxOut->resetItemIndex(); + for( sal_Int32 nPanelIndex = 0; (nPanelIndex < nPanelCount) && !mxStrm->isEof(); ++nPanelIndex ) + { + writeEmptyItem( "#panel" ); + IndentGuard aIndGuard( mxOut ); + dumpHex< sal_uInt32 >( "panel-flags", "COMCTL-STATUSBAR-PANELFLAGS" ); + dumpDec< sal_Int32 >( "current-width", "CONV-HMM-TO-CM" ); + dumpDec< sal_Int32 >( "minimal-width", "CONV-HMM-TO-CM" ); + sal_uInt32 nTextFlags = dumpHex< sal_uInt32 >( "text-flags", "COMCTL-STATUSBAR-TEXTFLAGS" ); + if( nTextFlags & 0x01 ) dumpUniString32( "text" ); + if( nTextFlags & 0x02 ) dumpUniString32( "vis-text" ); + if( nTextFlags & 0x04 ) dumpUniString32( "key" ); + if( nTextFlags & 0x08 ) dumpUniString32( "tag" ); + if( nTextFlags & 0x10 ) dumpUniString32( "tooltip" ); + } +} + +void ComCtlStatusBarObject::implDumpCommonTrailing() +{ + sal_Int32 nImageCount = dumpDec< sal_Int32 >( "image-count" ); + mxOut->resetItemIndex(); + for( sal_Int32 nImageIndex = 0; (nImageIndex < nImageCount) && !mxStrm->isEof(); ++nImageIndex ) + { + writeEmptyItem( "#image" ); + IndentGuard aIndGuard( mxOut ); + dumpDec< sal_Int32 >( "panel-index" ); + StdPicObject( *this ).dump(); + } +} + +void AxPropertyObjectBase::construct( const ObjectBase& rParent, + const BinaryInputStreamRef& rxStrm, const OUString& rSysFileName, const String& rPropNameList, bool b64BitPropFlags ) +{ + OleInputObjectBase::construct( rParent, rxStrm, rSysFileName ); + constructAxPropObj( rPropNameList, b64BitPropFlags ); +} + +void AxPropertyObjectBase::construct( const InputObjectBase& rParent, + const String& rPropNameList, bool b64BitPropFlags ) +{ + OleInputObjectBase::construct( rParent ); + constructAxPropObj( rPropNameList, b64BitPropFlags ); +} + +bool AxPropertyObjectBase::implIsValid() const +{ + return OleInputObjectBase::implIsValid() && mxStrm->isSeekable(); +} + +void AxPropertyObjectBase::implDump() +{ + mbValid = true; + // header + setAlignAnchor(); + dumpVersion(); + sal_uInt16 nSize = dumpDec< sal_uInt16 >( "size" ); + mnPropertiesEnd = mxStrm->tell() + nSize; + // property flags + maLargeProps.clear(); + maStreamProps.clear(); + mnPropFlags = dumpHex< sal_Int64, sal_uInt32 >( mb64BitPropFlags, "properties", mxPropNames ); + mnCurrProp = 0; + // properties + dumpShortProperties(); + dumpLargeProperties(); + setAlignAnchor(); + if( ensureValid() ) + implDumpExtended(); +} + +void AxPropertyObjectBase::implDumpShortProperties() +{ +} + +void AxPropertyObjectBase::implDumpExtended() +{ +} + +bool AxPropertyObjectBase::ensureValid( bool bCondition ) +{ + if( mbValid && (!bCondition || mxStrm->isEof()) ) + { + if( !bCondition ) + writeInfoItem( "state", OOX_DUMP_ERRASCII( "format-error" ) ); + mbValid = false; + } + return mbValid; +} + +void AxPropertyObjectBase::setAlignAnchor() +{ + mnPropertiesStart = mxStrm->tell(); +} + +bool AxPropertyObjectBase::startNextProperty() +{ + if( mnCurrProp == 0 ) mnCurrProp = 1; else mnCurrProp <<= 1; + bool bHasProp = getFlag( mnPropFlags, mnCurrProp ); + setFlag( mnPropFlags, mnCurrProp, false ); + return ensureValid() && bHasProp; +} + +OUString AxPropertyObjectBase::getPropertyName() const +{ + return cfg().getName( mxPropNames, mnCurrProp ); +} + +sal_uInt32 AxPropertyObjectBase::dumpFlagsProperty( sal_uInt32 nDefault, const char* pcNameList ) +{ + if( startNextProperty() ) + { + alignInput< sal_uInt32 >(); + return dumpHex< sal_uInt32 >( getPropertyName(), pcNameList ); + } + return nDefault; +} + +sal_uInt32 AxPropertyObjectBase::dumpColorProperty( sal_uInt32 nDefault ) +{ + if( startNextProperty() ) + { + alignInput< sal_uInt32 >(); + return dumpOleColor( getPropertyName() ); + } + return nDefault; +} + +sal_Unicode AxPropertyObjectBase::dumpUnicodeProperty() +{ + if( startNextProperty() ) + { + alignInput< sal_uInt16 >(); + return dumpUnicode( getPropertyName() ); + } + return '\0'; +} + +void AxPropertyObjectBase::dumpUnknownProperty() +{ + if( startNextProperty() ) + ensureValid( false ); +} + +void AxPropertyObjectBase::dumpPosProperty() +{ + if( startNextProperty() ) + maLargeProps.emplace_back( LargeProperty::PROPTYPE_POS, getPropertyName(), 8 ); +} + +void AxPropertyObjectBase::dumpSizeProperty() +{ + if( startNextProperty() ) + maLargeProps.emplace_back( LargeProperty::PROPTYPE_SIZE, getPropertyName(), 8 ); +} + +void AxPropertyObjectBase::dumpGuidProperty( OUString* pValue ) +{ + if( startNextProperty() ) + maLargeProps.emplace_back( LargeProperty::PROPTYPE_GUID, getPropertyName(), 16, pValue ); +} + +void AxPropertyObjectBase::dumpStringProperty( OUString* pValue ) +{ + if( startNextProperty() ) + { + alignInput< sal_uInt32 >(); + sal_uInt32 nLen = dumpHex< sal_uInt32 >( getPropertyName(), "AX-STRINGLEN" ); + maLargeProps.emplace_back( LargeProperty::PROPTYPE_STRING, getPropertyName(), nLen, pValue ); + } +} + +void AxPropertyObjectBase::dumpStringArrayProperty() +{ + if( startNextProperty() ) + { + alignInput< sal_uInt32 >(); + sal_uInt32 nLen = dumpHex< sal_uInt32 >( getPropertyName(), "CONV-DEC" ); + maLargeProps.emplace_back( LargeProperty::PROPTYPE_STRINGARRAY, getPropertyName(), nLen ); + } +} + +void AxPropertyObjectBase::dumpStreamProperty() +{ + if( startNextProperty() ) + { + alignInput< sal_uInt16 >(); + sal_uInt16 nData = dumpHex< sal_uInt16 >( getPropertyName() ); + maStreamProps.emplace_back( getPropertyName(), nData ); + } +} + +void AxPropertyObjectBase::dumpEmbeddedFont() +{ + if( ensureValid() ) + { + writeEmptyItem( "embedded-fontdata" ); + IndentGuard aIndGuard( mxOut ); + AxCFontNewObject( *this ).dump(); + } +} + +void AxPropertyObjectBase::dumpToPosition( sal_Int64 nPos ) +{ + dumpRemainingTo( nPos ); + mbValid = true; + ensureValid(); +} + +void AxPropertyObjectBase::constructAxPropObj( const String& rPropNameList, bool b64BitPropFlags ) +{ + if( OleInputObjectBase::implIsValid() ) + { + mxPropNames = cfg().getNameList( rPropNameList ); + mb64BitPropFlags = b64BitPropFlags; + mbValid = true; + } +} + +void AxPropertyObjectBase::dumpVersion() +{ + ItemGuard aItem( mxOut, "version" ); + sal_uInt8 nMinor = mxStrm->readuChar(); + sal_uInt8 nMajor = mxStrm->readuChar(); + mxOut->writeDec( nMajor ); + mxOut->writeChar( '.' ); + mxOut->writeDec( nMinor ); +} + +OUString AxPropertyObjectBase::dumpString( const String& rName, sal_uInt32 nSize, bool bArray ) +{ + bool bCompressed = getFlag( nSize, AX_STRING_COMPRESSED ); + sal_uInt32 nBufSize = extractValue< sal_uInt32 >( nSize, 0, 31 ); + OUString aString = bCompressed ? + dumpCharArray( rName, nBufSize, RTL_TEXTENCODING_ISO_8859_1 ) : + dumpUnicodeArray( rName, bArray ? nBufSize : (nBufSize / 2) ); + alignInput< sal_Int32 >(); + return aString; +} + +void AxPropertyObjectBase::dumpShortProperties() +{ + if( ensureValid() ) + { + writeEmptyItem( "short-properties" ); + IndentGuard aIndGuard( mxOut ); + implDumpShortProperties(); + alignInput< sal_uInt32 >(); + } +} + +void AxPropertyObjectBase::dumpLargeProperties() +{ + if( ensureValid( mnPropFlags == 0 ) && !maLargeProps.empty() ) + { + writeEmptyItem( "large-properties" ); + IndentGuard aIndGuard( mxOut ); + for (auto const& largeProp : maLargeProps) + { + if (!ensureValid()) + break; + switch( largeProp.mePropType ) + { + case LargeProperty::PROPTYPE_POS: + { + MultiItemsGuard aMultiGuard( mxOut ); + writeEmptyItem( largeProp.maItemName ); + dumpDec< sal_Int32 >( "top", "CONV-HMM-TO-CM" ); + dumpDec< sal_Int32 >( "left", "CONV-HMM-TO-CM" ); + } + break; + case LargeProperty::PROPTYPE_SIZE: + { + MultiItemsGuard aMultiGuard( mxOut ); + writeEmptyItem( largeProp.maItemName ); + dumpDec< sal_Int32 >( "width", "CONV-HMM-TO-CM" ); + dumpDec< sal_Int32 >( "height", "CONV-HMM-TO-CM" ); + } + break; + case LargeProperty::PROPTYPE_GUID: + { + OUString aGuid = dumpGuid( largeProp.maItemName ); + if( largeProp.mpItemValue ) + *largeProp.mpItemValue = cfg().getStringOption( aGuid, OUString() ); + } + break; + case LargeProperty::PROPTYPE_STRING: + { + OUString aString = dumpString( largeProp.maItemName, largeProp.mnDataSize, false ); + if( largeProp.mpItemValue ) + *largeProp.mpItemValue = aString; + } + break; + case LargeProperty::PROPTYPE_STRINGARRAY: + { + writeEmptyItem( largeProp.maItemName ); + IndentGuard aIndGuard2( mxOut ); + mxOut->resetItemIndex(); + sal_Int64 nEndPos = mxStrm->tell() + largeProp.mnDataSize; + while( mxStrm->tell() < nEndPos ) + { + MultiItemsGuard aMultiGuard( mxOut ); + sal_uInt32 nDataSize = dumpHex< sal_uInt32 >( "#flags", "AX-ARRAYSTRINGLEN" ); + dumpString( "string", nDataSize, true ); + } + dumpToPosition( nEndPos ); + } + break; + } + } + } + dumpToPosition( mnPropertiesEnd ); + + if( !ensureValid() || maStreamProps.empty() ) + return; + + writeEmptyItem( "stream-properties" ); + IndentGuard aIndGuard( mxOut ); + for (auto const& streamProp : maStreamProps) + { + if (!ensureValid()) + break; + writeEmptyItem( streamProp.maItemName ); + if( ensureValid( streamProp.mnData == 0xFFFF ) ) + { + IndentGuard aIndGuard2( mxOut ); + OUString aClassName = cfg().getStringOption( dumpGuid(), OUString() ); + if ( aClassName == "StdFont" ) + StdFontObject( *this ).dump(); + else if ( aClassName == "StdPic" ) + StdPicObject( *this ).dump(); + else if ( aClassName == "CFontNew" ) + AxCFontNewObject( *this ).dump(); + else + ensureValid( false ); + } + } +} + +AxCFontNewObject::AxCFontNewObject( const InputObjectBase& rParent ) +{ + AxPropertyObjectBase::construct( rParent, "AX-CFONTNEW-PROPERTIES" ); +} + +void AxCFontNewObject::implDumpShortProperties() +{ + dumpStringProperty(); + dumpFlagsProperty( 0, "AX-CFONTNEW-FLAGS" ); + dumpDecProperty< sal_Int32 >( 160 ); + dumpDecProperty< sal_Int32 >( 0 ); + dumpDecProperty< sal_uInt8 >( WINDOWS_CHARSET_DEFAULT, "CHARSET" ); + dumpDecProperty< sal_uInt8 >( 0, "FONT-PITCHFAMILY" ); + dumpDecProperty< sal_uInt8 >( 1, "AX-CFONTNEW-ALIGNMENT" ); + dumpDecProperty< sal_uInt16 >( 400, "FONT-WEIGHT" ); +} + +AxColumnInfoObject::AxColumnInfoObject( const InputObjectBase& rParent ) +{ + AxPropertyObjectBase::construct( rParent, "AX-COLUMNINFO-PROPERTIES" ); +} + +void AxColumnInfoObject::implDumpShortProperties() +{ + dumpDecProperty< sal_Int32 >( -1, "CONV-HMM-TO-CM" ); +} + +AxCommandButtonObject::AxCommandButtonObject( const InputObjectBase& rParent ) +{ + AxPropertyObjectBase::construct( rParent, "AX-COMMANDBUTTON-PROPERTIES" ); +} + +void AxCommandButtonObject::implDumpShortProperties() +{ + dumpColorProperty( 0x80000012 ); + dumpColorProperty( 0x80000008 ); + dumpFlagsProperty( 0x0000001B ); + dumpStringProperty(); + dumpImagePosProperty(); + dumpSizeProperty(); + dumpMousePtrProperty(); + dumpStreamProperty(); + dumpUnicodeProperty(); + dumpBoolProperty(); + dumpStreamProperty(); +} + +void AxCommandButtonObject::implDumpExtended() +{ + dumpEmbeddedFont(); +} + +AxMorphControlObject::AxMorphControlObject( const InputObjectBase& rParent ) +{ + AxPropertyObjectBase::construct( rParent, "AX-MORPH-PROPERTIES", true ); +} + +void AxMorphControlObject::implDumpShortProperties() +{ + dumpFlagsProperty( 0x2C80081B ); + dumpColorProperty( 0x80000005 ); + dumpColorProperty( 0x80000008 ); + dumpDecProperty< sal_uInt32 >( 0 ); + dumpBorderStyleProperty< sal_uInt8 >( 0 ); + dumpDecProperty< sal_uInt8 >( 0, "AX-MORPH-SCROLLBARS" ); + mnCtrlType = dumpDecProperty< sal_uInt8 >( 1, "AX-MORPH-CONTROLTYPE" ); + dumpMousePtrProperty(); + dumpSizeProperty(); + dumpUnicodeProperty(); + dumpDecProperty< sal_uInt32 >( 0, "CONV-HMM-TO-CM" ); + dumpDecProperty< sal_uInt16 >( 1, "AX-MORPH-BOUNDCOLUMN" ); + dumpDecProperty< sal_Int16 >( -1, "AX-MORPH-TEXTCOLUMN" ); + dumpDecProperty< sal_Int16 >( 1, "AX-MORPH-COLUMNCOUNT" ); + dumpDecProperty< sal_uInt16 >( 8 ); + mnColInfoCount = dumpDecProperty< sal_uInt16 >( 1 ); + dumpDecProperty< sal_uInt8 >( 2, "AX-MORPH-MATCHENTRYTYPE" ); + dumpDecProperty< sal_uInt8 >( 0, "AX-MORPH-LISTSTYLE" ); + dumpDecProperty< sal_uInt8 >( 0, "AX-MORPH-SHOWDROPDOWNMODE" ); + dumpUnknownProperty(); + dumpDecProperty< sal_uInt8 >( 1, "AX-MORPH-DROPDOWNSTYLE" ); + dumpDecProperty< sal_uInt8 >( 0, "AX-MORPH-SELECTIONTYPE" ); + dumpStringProperty(); + dumpStringProperty(); + dumpImagePosProperty(); + dumpColorProperty( 0x80000006 ); + dumpSpecialEffectProperty< sal_uInt32 >( 2 ); + dumpStreamProperty(); + dumpStreamProperty(); + dumpUnicodeProperty(); + dumpUnknownProperty(); + dumpBoolProperty(); + dumpStringProperty(); +} + +void AxMorphControlObject::implDumpExtended() +{ + dumpEmbeddedFont(); + dumpColumnInfos(); +} + +void AxMorphControlObject::dumpColumnInfos() +{ + if( ensureValid() && (mnColInfoCount > 0) && ((mnCtrlType == 2) || (mnCtrlType == 3)) ) + { + mxOut->resetItemIndex(); + for( sal_uInt16 nIdx = 0; ensureValid() && (nIdx < mnColInfoCount); ++nIdx ) + { + writeEmptyItem( "#column-info" ); + IndentGuard aIndGuard( mxOut ); + AxColumnInfoObject( *this ).dump(); + } + } +} + +AxLabelObject::AxLabelObject( const InputObjectBase& rParent ) +{ + AxPropertyObjectBase::construct( rParent, "AX-LABEL-PROPERTIES" ); +} + +void AxLabelObject::implDumpShortProperties() +{ + dumpColorProperty( 0x80000012 ); + dumpColorProperty( 0x8000000F ); + dumpFlagsProperty( 0x0080001B ); + dumpStringProperty(); + dumpImagePosProperty(); + dumpSizeProperty(); + dumpMousePtrProperty(); + dumpColorProperty( 0x80000006 ); + dumpBorderStyleProperty< sal_uInt16 >( 0 ); + dumpSpecialEffectProperty< sal_uInt16 >( 0 ); + dumpStreamProperty(); + dumpUnicodeProperty(); + dumpStreamProperty(); +} + +void AxLabelObject::implDumpExtended() +{ + dumpEmbeddedFont(); +} + +AxImageObject::AxImageObject( const InputObjectBase& rParent ) +{ + AxPropertyObjectBase::construct( rParent, "AX-IMAGE-PROPERTIES" ); +} + +void AxImageObject::implDumpShortProperties() +{ + dumpUnknownProperty(); + dumpUnknownProperty(); + dumpBoolProperty(); + dumpColorProperty( 0x80000006 ); + dumpColorProperty( 0x8000000F ); + dumpBorderStyleProperty< sal_uInt8 >( 1 ); + dumpMousePtrProperty(); + dumpImageSizeModeProperty(); + dumpSpecialEffectProperty< sal_uInt8 >( 0 ); + dumpSizeProperty(); + dumpStreamProperty(); + dumpImageAlignProperty(); + dumpBoolProperty(); + dumpFlagsProperty( 0x0000001B ); + dumpStreamProperty(); +} + +AxScrollBarObject::AxScrollBarObject( const InputObjectBase& rParent ) +{ + AxPropertyObjectBase::construct( rParent, "AX-SCROLLBAR-PROPERTIES" ); +} + +void AxScrollBarObject::implDumpShortProperties() +{ + dumpColorProperty( 0x80000012 ); + dumpColorProperty( 0x8000000F ); + dumpFlagsProperty( 0x0000001B ); + dumpSizeProperty(); + dumpMousePtrProperty(); + dumpDecProperty< sal_Int32 >( 0 ); + dumpDecProperty< sal_Int32 >( 32767 ); + dumpDecProperty< sal_Int32 >( 0 ); + dumpHexProperty< sal_uInt32 >( 0 ); + dumpEnabledProperty(); + dumpEnabledProperty(); + dumpDecProperty< sal_Int32 >( 1 ); + dumpDecProperty< sal_Int32 >( 1 ); + dumpOrientationProperty(); + dumpDecProperty< sal_Int16 >( -1, "AX-SCROLLBAR-PROPTHUMB" ); + dumpDelayProperty(); + dumpStreamProperty(); +} + +AxSpinButtonObject::AxSpinButtonObject( const InputObjectBase& rParent ) +{ + AxPropertyObjectBase::construct( rParent, "AX-SPINBUTTON-PROPERTIES" ); +} + +void AxSpinButtonObject::implDumpShortProperties() +{ + dumpColorProperty( 0x80000012 ); + dumpColorProperty( 0x8000000F ); + dumpFlagsProperty( 0x0000001B ); + dumpSizeProperty(); + dumpHexProperty< sal_uInt32 >( 0 ); + dumpDecProperty< sal_Int32 >( 0 ); + dumpDecProperty< sal_Int32 >( 100 ); + dumpDecProperty< sal_Int32 >( 0 ); + dumpEnabledProperty(); + dumpEnabledProperty(); + dumpDecProperty< sal_Int32 >( 1 ); + dumpOrientationProperty(); + dumpDelayProperty(); + dumpStreamProperty(); + dumpMousePtrProperty(); +} + +AxTabStripObject::AxTabStripObject( const InputObjectBase& rParent ) +{ + AxPropertyObjectBase::construct( rParent, "AX-TABSTRIP-PROPERTIES" ); +} + +void AxTabStripObject::implDumpShortProperties() +{ + dumpDecProperty< sal_Int32 >( -1 ); + dumpColorProperty( 0x8000000F ); + dumpColorProperty( 0x80000012 ); + dumpUnknownProperty(); + dumpSizeProperty(); + dumpStringArrayProperty(); + dumpMousePtrProperty(); + dumpUnknownProperty(); + dumpDecProperty< sal_uInt32 >( 0, "AX-TABSTRIP-ORIENTATION" ); + dumpDecProperty< sal_uInt32 >( 0, "AX-TABSTRIP-TABSTYLE" ); + dumpBoolProperty(); + dumpHmmProperty(); + dumpHmmProperty(); + dumpBoolProperty(); + dumpUnknownProperty(); + dumpStringArrayProperty(); + dumpUnknownProperty(); + dumpStringArrayProperty(); + dumpFlagsProperty( 0x0000001B ); + dumpBoolProperty(); + dumpDecProperty< sal_uInt32 >( 0 ); + dumpStringArrayProperty(); + mnTabFlagCount = dumpDecProperty< sal_Int32 >( 0 ); + dumpStringArrayProperty(); + dumpStreamProperty(); +} + +void AxTabStripObject::implDumpExtended() +{ + dumpEmbeddedFont(); + if( mnTabFlagCount > 0 ) + { + writeEmptyItem( "tab-flags" ); + IndentGuard aIndGuard( mxOut ); + mxOut->resetItemIndex(); + for( sal_Int32 nIdx = 0; ensureValid() && (nIdx < mnTabFlagCount); ++nIdx ) + dumpHex< sal_uInt32 >( "#flags", "AX-TABSTRIP-FLAGS" ); + } +} + +FormControlStreamObject::FormControlStreamObject( const ObjectBase& rParent, const BinaryInputStreamRef& rxStrm, const OUString& rSysFileName, const OUString* pProgId ) +{ + construct( rParent, rxStrm, rSysFileName ); + constructFormCtrlStrmObj( pProgId ); +} + +FormControlStreamObject::FormControlStreamObject( const OutputObjectBase& rParent, const BinaryInputStreamRef& rxStrm, const OUString* pProgId ) +{ + construct( rParent, rxStrm ); + constructFormCtrlStrmObj( pProgId ); +} + +void FormControlStreamObject::implDump() +{ + if( mbReadGuid ) + maProgId = cfg().getStringOption( dumpGuid(), OUString() ); + + if( !maProgId.isEmpty() && !mxStrm->isEof() ) + { + if ( maProgId == "Forms.CommandButton.1" ) + AxCommandButtonObject( *this ).dump(); + else if( maProgId == "Forms.TextBox.1" || + maProgId == "Forms.ListBox.1" || + maProgId == "Forms.ComboBox.1" || + maProgId == "Forms.CheckBox.1" || + maProgId == "Forms.OptionButton.1" || + maProgId == "Forms.ToggleButton.1" || + maProgId == "RefEdit.Ctrl" ) + AxMorphControlObject( *this ).dump(); + else if ( maProgId == "Forms.Label.1" ) + AxLabelObject( *this ).dump(); + else if ( maProgId == "Forms.Image.1" ) + AxImageObject( *this ).dump(); + else if ( maProgId == "Forms.ScrollBar.1" ) + AxScrollBarObject( *this ).dump(); + else if ( maProgId == "Forms.SpinButton.1" ) + AxSpinButtonObject( *this ).dump(); + else if ( maProgId == "Forms.TabStrip.1" ) + AxTabStripObject( *this ).dump(); + else if ( maProgId == "MSComCtl2.FlatScrollBar.2" ) + ComCtlScrollBarObject( *this, 6 ).dump(); + else if ( maProgId == "COMCTL.ProgCtrl.1" ) + ComCtlProgressBarObject( *this, 5 ).dump(); + else if ( maProgId == "MSComctlLib.ProgCtrl.2" ) + ComCtlProgressBarObject( *this, 6 ).dump(); + else if ( maProgId == "COMCTL.Slider.1" ) + ComCtlSliderObject( *this, 5 ).dump(); + else if ( maProgId == "MSComctlLib.Slider.2" ) + ComCtlSliderObject( *this, 6 ).dump(); + else if ( maProgId == "ComCtl2.UpDown.1" ) + ComCtlUpDownObject( *this, 5 ).dump(); + else if ( maProgId == "MSComCtl2.UpDown.2" ) + ComCtlUpDownObject( *this, 6 ).dump(); + else if ( maProgId == "COMCTL.ImageListCtrl.1" ) + ComCtlImageListObject( *this, 5 ).dump(); + else if ( maProgId == "MSComctlLib.ImageListCtrl.2" ) + ComCtlImageListObject( *this, 6 ).dump(); + else if ( maProgId == "COMCTL.TabStrip.1" ) + ComCtlTabStripObject( *this, 5 ).dump(); + else if ( maProgId == "MSComctlLib.TabStrip.2" ) + ComCtlTabStripObject( *this, 6 ).dump(); + else if ( maProgId == "COMCTL.TreeCtrl.1" ) + ComCtlTreeViewObject( *this, 5 ).dump(); + else if ( maProgId == "MSComctlLib.TreeCtrl.2" ) + ComCtlTreeViewObject( *this, 6 ).dump(); + else if ( maProgId == "COMCTL.SBarCtrl.1" ) + ComCtlStatusBarObject( *this, 5 ).dump(); + else if ( maProgId == "StdPic" ) + StdPicObject( *this ).dump(); + } + dumpRemainingStream(); +} + +void FormControlStreamObject::constructFormCtrlStrmObj( const OUString* pProgId ) +{ + mbReadGuid = pProgId == nullptr; + if( pProgId ) + maProgId = *pProgId; +} + +VbaFormClassInfoObject::VbaFormClassInfoObject( const InputObjectBase& rParent, VbaFormSharedData& rFormData ) : + mrFormData( rFormData ) +{ + AxPropertyObjectBase::construct( rParent, "VBA-CLASSINFO-PROPERTIES" ); +} + +void VbaFormClassInfoObject::implDumpShortProperties() +{ + mrFormData.maClassInfoProgIds.emplace_back( ); + dumpGuidProperty( &mrFormData.maClassInfoProgIds.back() ); + dumpGuidProperty(); + dumpUnknownProperty(); + dumpGuidProperty(); + dumpFlagsProperty( 0, "VBA-CLASSINFO-FLAGS" ); + dumpDecProperty< sal_uInt32 >( 0 ); + dumpDecProperty< sal_Int32 >( -1 ); + dumpDecProperty< sal_uInt16 >( 0 ); + dumpDecProperty< sal_uInt16 >( 0 ); + dumpDecProperty< sal_uInt16 >( 0, "OLEPROP-TYPE" ); + dumpDecProperty< sal_uInt16 >( 0 ); + dumpDecProperty< sal_uInt16 >( 0 ); + dumpDecProperty< sal_uInt16 >( 0, "OLEPROP-TYPE" ); + dumpDecProperty< sal_Int32 >( -1 ); + dumpDecProperty< sal_uInt16 >( 0 ); +} + +namespace { + +const sal_uInt32 VBA_FORMSITE_OBJSTREAM = 0x0010; + +const sal_uInt16 VBA_FORMSITE_CLASSTABLEINDEX = 0x8000; +const sal_uInt16 VBA_FORMSITE_CLASSTABLEMASK = 0x7FFF; + +} // namespace + +VbaFormSiteObject::VbaFormSiteObject( const InputObjectBase& rParent, VbaFormSharedData& rFormData ) : + mrFormData( rFormData ) +{ + AxPropertyObjectBase::construct( rParent, "VBA-FORMSITE-PROPERTIES" ); +} + +void VbaFormSiteObject::implDumpShortProperties() +{ + VbaFormSiteInfo aSiteInfo; + dumpStringProperty(); + dumpStringProperty(); + sal_Int32 nId = dumpDecProperty< sal_Int32 >( 0 ); + dumpDecProperty< sal_Int32 >( 0 ); + sal_uInt32 nFlags = dumpFlagsProperty( 0x00000033, "VBA-FORMSITE-FLAGS" ); + sal_uInt32 nLength = dumpDecProperty< sal_uInt32 >( 0 ); + dumpDecProperty< sal_Int16 >( -1 ); + sal_uInt16 nClassId = dumpHexProperty< sal_uInt16 >( 0x7FFF, "VBA-FORMSITE-CLASSIDCACHE" ); + dumpPosProperty(); + dumpDecProperty< sal_uInt16 >( 0 ); + dumpUnknownProperty(); + dumpStringProperty(); + dumpStringProperty(); + dumpStringProperty(); + dumpStringProperty(); + + sal_uInt16 nIndex = nClassId & VBA_FORMSITE_CLASSTABLEMASK; + if( getFlag( nClassId, VBA_FORMSITE_CLASSTABLEINDEX ) ) + { + if( nIndex < mrFormData.maClassInfoProgIds.size() ) + aSiteInfo.maProgId = mrFormData.maClassInfoProgIds[ nIndex ]; + } + else + { + if( cfg().hasName( "VBA-FORMSITE-CLASSNAMES", nIndex ) ) + aSiteInfo.maProgId = cfg().getName( "VBA-FORMSITE-CLASSNAMES", nIndex ); + } + aSiteInfo.mnId = nId; + aSiteInfo.mnLength = nLength; + aSiteInfo.mbInStream = getFlag( nFlags, VBA_FORMSITE_OBJSTREAM ); + + mrFormData.maSiteInfos.push_back( aSiteInfo ); +} + +VbaFormDesignExtObject::VbaFormDesignExtObject( const InputObjectBase& rParent ) +{ + AxPropertyObjectBase::construct( rParent, "VBA-FORMDESIGNEXT-PROPERTIES" ); +} + +void VbaFormDesignExtObject::implDumpShortProperties() +{ + dumpFlagsProperty( 0x00015F55, "VBA-FORMDESIGNEXT-FLAGS" ); + dumpHmmProperty(); + dumpHmmProperty(); + dumpDecProperty< sal_Int8 >( 0, "VBA-FORMDESIGNEXT-CLICKCTRLMODE" ); + dumpDecProperty< sal_Int8 >( 0, "VBA-FORMDESIGNEXT-DBLCLICKCTRLMODE" ); +} + +namespace { + +const sal_uInt32 AX_FORM_HASDESIGNEXTENDER = 0x00004000; +const sal_uInt32 AX_FORM_SKIPCLASSTABLE = 0x00008000; + +const sal_uInt8 AX_FORM_SITECOUNTTYPE_COUNT = 0x80; +const sal_uInt8 AX_FORM_SITECOUNTTYPE_MASK = 0x7F; + +} // namespace + +VbaFStreamObject::VbaFStreamObject( const ObjectBase& rParent, const BinaryInputStreamRef& rxStrm, const OUString& rSysFileName, VbaFormSharedData& rFormData ) : + mrFormData( rFormData ) +{ + AxPropertyObjectBase::construct( rParent, rxStrm, rSysFileName, "VBA-FORM-PROPERTIES" ); +} + +void VbaFStreamObject::implDumpShortProperties() +{ + dumpUnknownProperty(); + dumpColorProperty( 0x8000000F ); + dumpColorProperty( 0x80000012 ); + dumpDecProperty< sal_uInt32 >( 0 ); + dumpUnknownProperty(); + dumpUnknownProperty(); + mnFlags = dumpFlagsProperty( 0x00000004, "VBA-FORM-FLAGS" ); + dumpBorderStyleProperty< sal_uInt8 >( 0 ); + dumpMousePtrProperty(); + dumpHexProperty< sal_uInt8 >( 0x0C, "VBA-FORM-SCROLLBARS" ); + dumpSizeProperty(); + dumpSizeProperty(); + dumpPosProperty(); + dumpDecProperty< sal_uInt32 >( 0 ); + dumpUnknownProperty(); + dumpStreamProperty(); + dumpDecProperty< sal_uInt8 >( 0, "VBA-FORM-CYCLE" ); + dumpSpecialEffectProperty< sal_uInt8 >( 0 ); + dumpColorProperty( 0x80000012 ); + dumpStringProperty(); + dumpStreamProperty(); + dumpStreamProperty(); + dumpDecProperty< sal_Int32 >( 100, "CONV-PERCENT" ); + dumpImageAlignProperty(); + dumpBoolProperty(); + dumpImageSizeModeProperty(); + dumpDecProperty< sal_uInt32 >( 0 ); + dumpDecProperty< sal_uInt32 >( 0 ); +} + +void VbaFStreamObject::implDumpExtended() +{ + dumpClassInfos(); + dumpSiteData(); + dumpDesignExtender(); + dumpRemainingStream(); +} + +void VbaFStreamObject::dumpClassInfos() +{ + if( ensureValid() && !getFlag( mnFlags, AX_FORM_SKIPCLASSTABLE ) ) + { + mxOut->emptyLine(); + sal_uInt16 nCount = dumpDec< sal_uInt16 >( "class-info-count" ); + mxOut->resetItemIndex(); + for( sal_uInt16 nIdx = 0; ensureValid() && (nIdx < nCount); ++nIdx ) + { + writeEmptyItem( "#class-info" ); + IndentGuard aIndGuard( mxOut ); + VbaFormClassInfoObject( *this, mrFormData ).dump(); + } + } +} + +void VbaFStreamObject::dumpFormSites( sal_uInt32 nCount ) +{ + mxOut->resetItemIndex(); + for( sal_uInt32 nIdx = 0; ensureValid() && (nIdx < nCount); ++nIdx ) + { + mxOut->emptyLine(); + writeEmptyItem( "#form-site" ); + IndentGuard aIndGuard( mxOut ); + VbaFormSiteObject( *this, mrFormData ).dump(); + } +} + +void VbaFStreamObject::dumpSiteData() +{ + if( !ensureValid() ) + return; + + mxOut->emptyLine(); + setAlignAnchor(); + sal_uInt32 nSiteCount = dumpDec< sal_uInt32 >( "site-count" ); + sal_uInt32 nSiteLength = dumpDec< sal_uInt32 >( "site-data-size" ); + sal_Int64 nEndPos = mxStrm->tell() + nSiteLength; + if( !ensureValid( nEndPos <= mxStrm->size() ) ) + return; + + mxOut->resetItemIndex(); + sal_uInt32 nSiteIdx = 0; + while( ensureValid() && (nSiteIdx < nSiteCount) ) + { + mxOut->emptyLine(); + writeEmptyItem( "#site-info" ); + IndentGuard aIndGuard( mxOut ); + dumpDec< sal_uInt8 >( "depth" ); + sal_uInt8 nTypeCount = dumpHex< sal_uInt8 >( "type-count", "VBA-FORM-SITE-TYPECOUNT" ); + if( getFlag( nTypeCount, AX_FORM_SITECOUNTTYPE_COUNT ) ) + { + dumpDec< sal_uInt8 >( "repeated-type" ); + nSiteIdx += (nTypeCount & AX_FORM_SITECOUNTTYPE_MASK); + } + else + { + ++nSiteIdx; + } + } + alignInput< sal_uInt32 >(); + dumpFormSites( nSiteCount ); + dumpToPosition( nEndPos ); +} + +void VbaFStreamObject::dumpDesignExtender() +{ + if( ensureValid() && getFlag( mnFlags, AX_FORM_HASDESIGNEXTENDER ) ) + { + mxOut->emptyLine(); + writeEmptyItem( "design-extender" ); + IndentGuard aIndGuard( mxOut ); + VbaFormDesignExtObject( *this ).dump(); + } +} + +VbaOStreamObject::VbaOStreamObject( const ObjectBase& rParent, + const BinaryInputStreamRef& rxStrm, const OUString& rSysFileName, VbaFormSharedData& rFormData ) : + mrFormData( rFormData ) +{ + OleInputObjectBase::construct( rParent, rxStrm, rSysFileName ); +} + +void VbaOStreamObject::implDump() +{ + for (auto const& siteInfo : mrFormData.maSiteInfos) + { + if (mxStrm->isEof()) + break; + if( (siteInfo.mbInStream) && (siteInfo.mnLength > 0) ) + { + mxOut->emptyLine(); + writeDecItem( "control-id", siteInfo.mnId ); + writeInfoItem( "prog-id", siteInfo.maProgId ); + IndentGuard aIndGuard( mxOut ); + BinaryInputStreamRef xRelStrm( std::make_shared( *mxStrm, siteInfo.mnLength ) ); + FormControlStreamObject( *this, xRelStrm, &siteInfo.maProgId ).dump(); + } + } + dumpRemainingStream(); +} + +VbaPageObject::VbaPageObject( const InputObjectBase& rParent ) +{ + AxPropertyObjectBase::construct( rParent, "VBA-PAGE-PROPERTIES" ); +} + +void VbaPageObject::implDumpShortProperties() +{ + dumpUnknownProperty(); + dumpDecProperty< sal_uInt32 >( 0, "VBA-PAGE-TRANSITIONEFFECT" ); + dumpDecProperty< sal_uInt32 >( 0, "AX-CONV-MS" ); +} + +VbaMultiPageObject::VbaMultiPageObject( const InputObjectBase& rParent ) +{ + AxPropertyObjectBase::construct( rParent, "VBA-MULTIPAGE-PROPERTIES" ); +} + +void VbaMultiPageObject::implDumpShortProperties() +{ + dumpUnknownProperty(); + mnPageCount = dumpDecProperty< sal_Int32 >( 0 ); + dumpDecProperty< sal_Int32 >( 0 ); + dumpBoolProperty(); +} + +void VbaMultiPageObject::implDumpExtended() +{ + if( ensureValid() && (mnPageCount > 0) ) + { + writeEmptyItem( "page-ids" ); + IndentGuard aIndGuard( mxOut ); + mxOut->resetItemIndex(); + for( sal_Int32 nIdx = 0; ensureValid() && (nIdx < mnPageCount); ++nIdx ) + dumpDec< sal_Int32 >( "#id" ); + } +} + +VbaXStreamObject::VbaXStreamObject( const ObjectBase& rParent, + const BinaryInputStreamRef& rxStrm, const OUString& rSysFileName, VbaFormSharedData& rFormData ) : + mrFormData( rFormData ) +{ + InputObjectBase::construct( rParent, rxStrm, rSysFileName ); +} + +void VbaXStreamObject::implDump() +{ + for( size_t nIdx = 0, nCount = mrFormData.maSiteInfos.size(); !mxStrm->isEof() && (nIdx < nCount); ++nIdx ) + { + mxOut->emptyLine(); + writeEmptyItem( "page" ); + IndentGuard aIndGuard( mxOut ); + VbaPageObject( *this ).dump(); + } + if( !mxStrm->isEof() ) + { + mxOut->emptyLine(); + writeEmptyItem( "multi-page" ); + IndentGuard aIndGuard( mxOut ); + VbaMultiPageObject( *this ).dump(); + } + dumpRemainingStream(); +} + +VbaContainerStorageObject::VbaContainerStorageObject( const ObjectBase& rParent, const StorageRef& rxStrg, const OUString& rSysPath ) : + OleStorageObject( rParent, rxStrg, rSysPath ) +{ + addPreferredStream( "f" ); +} + +void VbaContainerStorageObject::implDumpStream( const Reference< XInputStream >& rxStrm, const OUString& rStrgPath, const OUString& rStrmName, const OUString& rSysFileName ) +{ + if ( rStrmName == "f" ) + VbaFStreamObject( *this, rxStrm, rSysFileName, maFormData ).dump(); + else if ( rStrmName == "o" ) + VbaOStreamObject( *this, rxStrm, rSysFileName, maFormData ).dump(); + else if ( rStrmName == "x" ) + VbaXStreamObject( *this, rxStrm, rSysFileName, maFormData ).dump(); + else + OleStorageObject::implDumpStream( rxStrm, rStrgPath, rStrmName, rSysFileName ); +} + +void VbaContainerStorageObject::implDumpStorage( const StorageRef& rxStrg, const OUString& rStrgPath, const OUString& rSysPath ) +{ + if( isFormStorage( rStrgPath ) ) + VbaContainerStorageObject( *this, rxStrg, rSysPath ).dump(); + else + OleStorageObject( *this, rxStrg, rSysPath ).dump(); +} + +bool VbaContainerStorageObject::isFormStorage( const OUString& rStrgPath ) const +{ + if( (rStrgPath.getLength() >= 3) && (rStrgPath[ 0 ] == 'i') ) + { + std::u16string_view aId = rStrgPath.subView( 1 ); + if( (aId.size() == 2) && (aId[ 0 ] == '0') ) + aId = aId.substr( 1 ); + sal_Int32 nId = o3tl::toInt32(aId); + if( (nId > 0) && (std::u16string_view(OUString::number( nId )) == aId) ) + for (auto const& siteInfo : maFormData.maSiteInfos) + if( siteInfo.mnId == nId ) + return true; + } + return false; +} + +VbaSharedData::VbaSharedData() : + meTextEnc( RTL_TEXTENCODING_MS_1252 ) +{ +} + +bool VbaSharedData::isModuleStream( const OUString& rStrmName ) const +{ + return maStrmOffsets.count( rStrmName ) > 0; +} + +sal_Int32 VbaSharedData::getStreamOffset( const OUString& rStrmName ) const +{ + StreamOffsetMap::const_iterator aIt = maStrmOffsets.find( rStrmName ); + return (aIt == maStrmOffsets.end()) ? 0 : aIt->second; +} + +VbaDirStreamObject::VbaDirStreamObject( const ObjectBase& rParent, + const BinaryInputStreamRef& rxStrm, const OUString& rSysFileName, VbaSharedData& rVbaData ) : + mrVbaData( rVbaData ) +{ + mxInStrm = rxStrm; + if( mxInStrm ) + { + BinaryInputStreamRef xVbaStrm( std::make_shared<::oox::ole::VbaInputStream>( *mxInStrm ) ); + SequenceRecordObjectBase::construct( rParent, xVbaStrm, rSysFileName, "VBA-DIR-RECORD-NAMES", "VBA-DIR-SIMPLE-RECORDS" ); + } +} + +bool VbaDirStreamObject::implIsValid() const +{ + return mxInStrm && SequenceRecordObjectBase::implIsValid(); +} + +bool VbaDirStreamObject::implReadRecordHeader( BinaryInputStream& rBaseStrm, sal_Int64& ornRecId, sal_Int64& ornRecSize ) +{ + ornRecId = rBaseStrm.readuInt16(); + ornRecSize = rBaseStrm.readInt32(); + + // for no obvious reason, PROJECTVERSION record contains size field of 4, but is 6 bytes long + if( ornRecId == 9 ) + ornRecSize = 6; + + return !rBaseStrm.isEof(); +} + +void VbaDirStreamObject::implDumpRecordBody() +{ + switch( getRecId() ) + { + case 0x0003: + mrVbaData.meTextEnc = rtl_getTextEncodingFromWindowsCodePage( dumpDec< sal_uInt16 >( "codepage", "CODEPAGES" ) ); + break; + case 0x0004: + dumpByteString( "name" ); + break; + case 0x0005: + dumpByteString( "description" ); + break; + case 0x0006: + dumpByteString( "helpfile-path" ); + break; + case 0x0009: + dumpDec< sal_uInt32 >( "major" ); + dumpDec< sal_uInt16 >( "minor" ); + break; + case 0x000C: + dumpByteString( "constants" ); + break; + case 0x000D: + dumpByteStringWithLength( "lib-id" ); + dumpUnused( 6 ); + break; + case 0x000E: + dumpByteStringWithLength( "lib-id-absolute" ); + dumpByteStringWithLength( "lib-id-relative" ); + dumpDec< sal_uInt32 >( "major" ); + dumpDec< sal_uInt16 >( "minor" ); + break; + case 0x0016: + dumpByteString( "name" ); + break; + case 0x0019: + dumpByteString( "name" ); + maCurrStream.clear(); + mnCurrOffset = 0; + break; + case 0x001A: + maCurrStream = dumpByteString( "stream-name" ); + break; + case 0x001C: + dumpByteString( "description" ); + break; + case 0x002B: + if( !maCurrStream.isEmpty() ) + mrVbaData.maStrmOffsets[ maCurrStream ] = mnCurrOffset; + maCurrStream.clear(); + mnCurrOffset = 0; + break; + case 0x002F: + dumpByteStringWithLength( "lib-id-twiddled" ); + dumpUnused( 6 ); + break; + case 0x0030: + dumpByteStringWithLength( "lib-id-extended" ); + dumpUnused( 6 ); + dumpGuid( "original-typelib" ); + dumpDec< sal_uInt32 >( "cookie" ); + break; + case 0x0031: + mnCurrOffset = dumpHex< sal_Int32 >( "stream-offset", "CONV-DEC" ); + break; + case 0x0032: + dumpUniString( "stream-name" ); + break; + case 0x0033: + dumpByteString( "lib-id-original" ); + break; + case 0x003C: + dumpUniString( "constants" ); + break; + case 0x003D: + dumpByteString( "helpfile-path" ); + break; + case 0x003E: + dumpUniString( "name" ); + break; + case 0x0040: + dumpUniString( "description" ); + break; + case 0x0047: + dumpUniString( "name" ); + break; + case 0x0048: + dumpUniString( "description" ); + break; + } +} + +OUString VbaDirStreamObject::dumpByteString( const String& rName ) +{ + return dumpCharArray( rName, static_cast< sal_Int32 >( getRecSize() ), mrVbaData.meTextEnc ); +} + +OUString VbaDirStreamObject::dumpUniString( const String& rName ) +{ + return dumpUnicodeArray( rName, static_cast< sal_Int32 >( getRecSize() / 2 ) ); +} + +OUString VbaDirStreamObject::dumpByteStringWithLength( const String& rName ) +{ + return dumpCharArray( rName, mxStrm->readInt32(), mrVbaData.meTextEnc ); +} + +VbaModuleStreamObject::VbaModuleStreamObject( + const ObjectBase& rParent, const BinaryInputStreamRef& rxStrm, + const OUString& rSysFileName, VbaSharedData& rVbaData, sal_Int32 nStrmOffset ) : + mrVbaData( rVbaData ), + mnStrmOffset( nStrmOffset ) +{ + InputObjectBase::construct( rParent, rxStrm, rSysFileName ); +} + +void VbaModuleStreamObject::implDump() +{ + dumpBinary( "perf-cache", mnStrmOffset ); + mxOut->emptyLine(); + writeEmptyItem( "source-code" ); + IndentGuard aIndGuard( mxOut ); + BinaryInputStreamRef xVbaStrm( std::make_shared<::oox::ole::VbaInputStream>( *mxStrm ) ); + TextLineStreamObject( *this, xVbaStrm, mrVbaData.meTextEnc ).dump(); +} + +VbaStorageObject::VbaStorageObject( const ObjectBase& rParent, const StorageRef& rxStrg, const OUString& rSysPath, VbaSharedData& rVbaData ) : + OleStorageObject( rParent, rxStrg, rSysPath ), + mrVbaData( rVbaData ) +{ + addPreferredStream( "dir" ); +} + +void VbaStorageObject::implDumpStream( const Reference< XInputStream >& rxStrm, const OUString& rStrgPath, const OUString& rStrmName, const OUString& rSysFileName ) +{ + if( rStrgPath.isEmpty() && rStrmName == "dir" ) + VbaDirStreamObject( *this, rxStrm, rSysFileName, mrVbaData ).dump(); + else if( mrVbaData.isModuleStream( rStrmName ) ) + VbaModuleStreamObject( *this, rxStrm, rSysFileName, mrVbaData, mrVbaData.getStreamOffset( rStrmName ) ).dump(); + else + OleStorageObject::implDumpStream( rxStrm, rStrgPath, rStrmName, rSysFileName ); +} + +VbaFormStorageObject::VbaFormStorageObject( const ObjectBase& rParent, const StorageRef& rxStrg, const OUString& rSysPath, VbaSharedData& rVbaData ) : + VbaContainerStorageObject( rParent, rxStrg, rSysPath ), + mrVbaData( rVbaData ) +{ +} + +void VbaFormStorageObject::implDumpStream( const Reference< XInputStream >& rxStrm, const OUString& rStrgPath, const OUString& rStrmName, const OUString& rSysFileName ) +{ + if ( rStrmName == "\003VBFrame" ) + TextLineStreamObject( *this, rxStrm, mrVbaData.meTextEnc, rSysFileName ).dump(); + else + VbaContainerStorageObject::implDumpStream( rxStrm, rStrgPath, rStrmName, rSysFileName ); +} + +VbaProjectStorageObject::VbaProjectStorageObject( const ObjectBase& rParent, const StorageRef& rxStrg, const OUString& rSysPath ) : + OleStorageObject( rParent, rxStrg, rSysPath ) +{ + addPreferredStorage( "VBA" ); +} + +void VbaProjectStorageObject::implDumpStream( const Reference< XInputStream >& rxStrm, const OUString& rStrgPath, const OUString& rStrmName, const OUString& rSysFileName ) +{ + if( rStrgPath.isEmpty() && rStrmName == "PROJECT" ) + TextLineStreamObject( *this, rxStrm, maVbaData.meTextEnc, rSysFileName ).dump(); + else + OleStorageObject::implDumpStream( rxStrm, rStrgPath, rStrmName, rSysFileName ); +} + +void VbaProjectStorageObject::implDumpStorage( const StorageRef& rxStrg, const OUString& rStrgPath, const OUString& rSysPath ) +{ + if ( rStrgPath == "VBA" ) + VbaStorageObject( *this, rxStrg, rSysPath, maVbaData ).dump(); + else + VbaFormStorageObject( *this, rxStrg, rSysPath, maVbaData ).dump(); +} + +ActiveXStorageObject::ActiveXStorageObject( const ObjectBase& rParent, const StorageRef& rxStrg, const OUString& rSysPath ) : + VbaContainerStorageObject( rParent, rxStrg, rSysPath ) +{ +} + +void ActiveXStorageObject::implDumpBaseStream( const BinaryInputStreamRef& rxStrm, const OUString& rSysFileName ) +{ + FormControlStreamObject( *this, rxStrm, rSysFileName ).dump(); +} + +} // namespace oox + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/dump/oledumper.ini b/oox/source/dump/oledumper.ini new file mode 100644 index 000000000..2d33c6c4f --- /dev/null +++ b/oox/source/dump/oledumper.ini @@ -0,0 +1,904 @@ +# +# This file is part of the LibreOffice project. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# +# This file incorporates work covered by the following license notice: +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed +# with this work for additional information regarding copyright +# ownership. The ASF licenses this file to you under the Apache +# License, Version 2.0 (the "License"); you may not use this file +# except in compliance with the License. You may obtain a copy of +# the License at http://www.apache.org/licenses/LICENSE-2.0 . +# + +# dumper settings ============================================================ + +# Path to additional configuration data, relative to this file. +include-config-file=dumperbase.ini + +# OLE name lists ============================================================= + +constlist=OLE-STD-CLIPBOARD-FORMAT + 2=bmp + 3=wmf + 8=dib + 14=emf +end + +combilist=OLE-COLOR + 0x0000FFFF=uint32,dec,palette-index,,filter=0xFF000000~0x01000000 + 0x000000FF=uint32,dec,red,,filter=0xFF000000~0x00000000,filter=0xFF000000~0x02000000 + 0x0000FF00=uint32,dec,green,,filter=0xFF000000~0x00000000,filter=0xFF000000~0x02000000 + 0x00FF0000=uint32,dec,blue,,filter=0xFF000000~0x00000000,filter=0xFF000000~0x02000000 + 0x0000FFFF=uint32,dec,system-color,SYSTEMCOLOR,filter=0xFF000000~0x80000000 + 0xFF000000=uint8,dec,type,OLE-COLORTYPE +end + +constlist=OLE-COLORTYPE + 0x00=default + 0x01=palette + 0x02=rgb + 0x80=system-color +end + +multilist=OLE-MOUSEPTR + 0=default,arrow,cross,i-beam + 6=size-diag-down,size-vert,size-diag-up,size-hor + 10=up-arrow,hour-glass,no-drop,app-starting,help,size-all + 99=custom +end + +# StdFont -------------------------------------------------------------------- + +{0BE35203-8F91-11CE-9DE3-00AA004BB851}=StdFont + +flagslist=STDFONT-FLAGS + 0x01=bold + 0x02=italic + 0x04=underline + 0x08=strikeout +end + +unitconverter=STDFONT-HEIGHT,/10000,pt + +# StdPic --------------------------------------------------------------------- + +{0BE35204-8F91-11CE-9DE3-00AA004BB851}=StdPic + +shortlist=STDPIC-ID,0x0000746C,StdPic + +# StdHlink ------------------------------------------------------------------- + +{79EAC9D0-BAF9-11CE-8C82-00AA004BA90B}=StdHlink +{79EAC9E0-BAF9-11CE-8C82-00AA004BA90B}=URLMoniker +{00000303-0000-0000-C000-000000000046}=FileMoniker +{00000304-0000-0000-C000-000000000046}=ItemMoniker +{00000305-0000-0000-C000-000000000046}=AntiMoniker +{00000309-0000-0000-C000-000000000046}=CompositeMoniker + +flagslist=STDHLINK-FLAGS + 0x00000001=has-target + 0x00000002=!relative!absolute + 0x00000004=display-specified + 0x00000008=has-location + 0x00000010=has-display + 0x00000020=has-guid + 0x00000040=has-creation-time + 0x00000080=has-frame + 0x00000100=!as-guid!as-string + 0x00000200=has-abs-from-rel +end + +flagslist=STDHLINK-URL-FLAGS + 0x00000001=allow-relative + 0x00000002=wildcard-scheme + 0x00000004=implicit-file-scheme + 0x00000008=no-fragment + 0x00000010=no-canonicalize + 0x00000020=canonicalize + 0x00000040=dos-path + 0x00000080=decode-extra-info + 0x00000100=no-decode-extra-info + 0x00000200=crack-unknown-schemes + 0x00000400=no-crack-unknown-schemes + 0x00000800=preprocess-html + 0x00001000=no-preprocess-html + 0x00002000=registry-settings + 0x00004000=no-registry-settings + 0x00008000=no-encode-forbidden-chars +end + +# OLE property stream -------------------------------------------------------- + +{F29F85E0-4FF9-1068-AB91-08002B27B3D9}=GlobalDocProp +{D5CDD502-2E9C-101B-9397-08002B2CF9AE}=BuiltinDocProp +{D5CDD505-2E9C-101B-9397-08002B2CF9AE}=CustomDocProp + +constlist=OLEPROP-BYTE-ORDER + 0xFEFF=big-endian + 0xFFFE=little-endian +end + +shortlist=OLEPROP-OSTYPE,0,dos,mac,win32,unix + +multilist=OLEPROP-BASEIDS + quote-names=1 + default= + 0=dictionary,codepage +end + +multilist=OLEPROP-GLOBALIDS + include=OLEPROP-BASEIDS + 2=title,subject,author,keywords,comments,template,last-author,rev-number + 10=edit-time,last-printed,create-time,last-saved,page-count,word-count,char-count,thumbnail,appname,security +end + +multilist=OLEPROP-BUILTINIDS + include=OLEPROP-BASEIDS + 2=category,pres-target,byte-count,line-count,para-count,slide-count,note-count,hidden-slide-count + 10=clips,scale-crop,heading-pairs,part-titles,manager,company,links-uptodate +end + +multilist=OLEPROP-TYPE-SIMPLE + 0=empty,null,int16,int32,float,double,currency,date,string8,dispatch + 10=error,bool,variant,unknown,decimal,int8,uint8,uint16,uint32 + 20=int64,uint64,int,uint,void,hresult,ptr,savearray,c-array,userdef + 30=string8,string16,,,,,record,intptr,uintptr + 64=time-stamp,blob,stream,storage,stream-obj,storage-obj + 70=blob-obj,clip-fmt,guid,vers-stream + 0x0FFF=str8-blob +end + +combilist=OLEPROP-TYPE + 0x0FFF=int32,dec,base-type,OLEPROP-TYPE-SIMPLE + 0x1000=vector + 0x2000=array + 0x4000=byref +end + +# ComCtl controls ============================================================ + +constlist=COMCTL-HEADER-IDS + 0x0A2BAE11=COMCTL_SLIDER_60 + 0x12344321=COMCTL_SIZE + 0x6AC13CB1=COMCTL_TREEVIEW_60 + 0x97AB8A01=COMCTL_PROGRESSBAR_60 + 0x99470A83=COMCTL_SCROLLBAR_60 + 0xABCDEF01=COMCTL_COMMONDATA + 0xBDECDE1F=COMCTL_COMPLEXDATA + 0xD12A7AC1=COMCTL_TABSTRIP_60 + 0xE6E17E80=COMCTL_IMAGELIST_50_60 + 0xE6E17E84=COMCTL_PROGRESSBAR_50 + 0xE6E17E86=COMCTL_SLIDER_50 + 0xE6E17E88=COMCTL_STATUSBAR_50 + 0xE6E17E8A=COMCTL_TABSTRIP_50 + 0xE6E17E8E=COMCTL_TREEVIEW_50 + 0xFF3626A0=COMCTL_UPDOWN_50_60 +end + +combilist=COMCTL-COMMON-FLAGS + ignore=0xFFFF8000 + 0x00000001=flat-border + 0x00000002=enabled + 0x00000004=3d-border + 0x000007F8=uint8,dec,mouse-ptr,OLE-MOUSEPTR + 0x00000800=ole-drag-auto + 0x00002000=ole-drop-manual +end + +flagslist=COMCTL-COMPLEX-FLAGS + ignore=0xFFFFFFFC + 0x00000001=font + 0x00000002=mouse-icon +end + +# flat scrollbar ------------------------------------------------------------- + +{FE38753A-44A3-11D1-B5B7-0000C09000C4}=MSComCtl2.FlatScrollBar.2 + +combilist=COMCTL-SCROLLBAR-FLAGS + 0x00000003=uint8,dec,appearance,COMCTL-SCROLLBAR-APPEARANCE + 0x0000000C=uint8,dec,arrows,COMCTL-SCROLLBAR-ARROWS + 0x00000010=!vertical!horizontal +end + +shortlist=COMCTL-SCROLLBAR-APPEARANCE,0,3d,flat,track-3d +shortlist=COMCTL-SCROLLBAR-ARROWS,0,both,left-up,right-down + +# progress bar --------------------------------------------------------------- + +{0713E8D2-850A-101B-AFC0-4210102A8DA7}=COMCTL.ProgCtrl.1 +{35053A22-8589-11D1-B16A-00C0F0283628}=MSComctlLib.ProgCtrl.2 + +# slider --------------------------------------------------------------------- + +{373FF7F0-EB8B-11CD-8820-08002B2F4F5A}=COMCTL.Slider.1 +{F08DF954-8592-11D1-B16A-00C0F0283628}=MSComctlLib.Slider.2 + +constlist=COMCTL-SLIDER-SELECTRANGE + 0x00000000=off + 0x0000FFFF=on +end + +shortlist=COMCTL-SLIDER-TICKSTYLE,0,bottom-right,top-left,both,no-ticks + +# updown --------------------------------------------------------------------- + +{026371C0-1B7C-11CF-9D53-00AA003C9CB6}=ComCtl2.UpDown.1 +{603C7E80-87C2-11D1-8BE3-0000F8754DA1}=MSComCtl2.UpDown.2 + +flagslist=COMCTL-UPDOWN-FLAGS1 + 0x00000001=!align-left!align-right + 0x00000004=!vertical!horizontal +end + +flagslist=COMCTL-UPDOWN-FLAGS2 + 0x00000004=wrap + 0x00000020=ole-drop-manual + 0x00000080=enabled +end + +# image list ----------------------------------------------------------------- + +{58DA8D8F-9D6A-101B-AFC0-4210102A8DA7}=COMCTL.ImageListCtrl.1 +{2C247F23-8591-11D1-B16A-00C0F0283628}=MSComctlLib.ImageListCtrl.2 + +flagslist=COMCTL-IMAGELIST-TEXTFLAGS + 0x01=key + 0x02=tag +end + +# tab strip ------------------------------------------------------------------ + +{9ED94440-E5E8-101B-B9B5-444553540000}=COMCTL.TabStrip.1 +{1EFB6596-857C-11D1-B16A-00C0F0283628}=MSComctlLib.TabStrip.2 + +combilist=COMCTL-TABSTRIP-FLAGS1 + ignore=0xFFFFFFE0 + 0x00000001=multi-row + 0x00000002=show-tooltips + 0x00000018=uint8,dec,tab-width-style,COMCTL-TABSTRIP-TABWIDTHSTYLE +end + +combilist=COMCTL-TABSTRIP-FLAGS2 + ignore=0xFFFF0000 + 0x00000003=uint8,dec,style,COMCTL-TABSTRIP-STYLE + 0x00000004=hot-tracking + 0x00000008=multi-select + 0x00000030=uint8,dec,placement,COMCTL-TABSTRIP-PLACEMENT + 0x00000040=separators +end + +flagslist=COMCTL-TABSTRIP-FLAGS3 + ignore=0xFFFF0000 + 0x00000001=tabstyle-opposite +end + +shortlist=COMCTL-TABSTRIP-TABWIDTHSTYLE,0,justified,non-justified,fixed +shortlist=COMCTL-TABSTRIP-STYLE,0,tabs,tab-buttons,flat-buttons +shortlist=COMCTL-TABSTRIP-PLACEMENT,0,top,bottom,left,right + +flagslist=COMCTL-TABSTRIP-TABFLAGS + 0x00000001=caption + 0x00000002=key + 0x00000004=tag + 0x00000008=tooltip +end + +# tree view ------------------------------------------------------------------ + +{0713E8A2-850A-101B-AFC0-4210102A8DA7}=COMCTL.TreeCtrl.1 +{C74190B6-8589-11D1-B16A-00C0F0283628}=MSComctlLib.TreeCtrl.2 + +combilist=COMCTL-TREEVIEW-FLAGS + ignore=0xFFFF0000 + 0x00000001=!tree-lines!root-lines + 0x0000001C=uint8,dec,style,COMCTL-TREEVIEW-STYLE + 0x00000020=label-edit + 0x00000080=hide-selection + 0x00000100=sorted +end + +flagslist=COMCTL-TREEVIEW-STRINGFLAGS + ignore=0xFFFFFFF8 + 0x00000001=separator + 0x00000002=image-list +end + +shortlist=COMCTL-TREEVIEW-STYLE,0,text,pic-text,plusminus-text,plusminus-pic-text,treelines-text,treelines-pic-text,treelines-plusminus-text,treelines-plusminus-pic-text + +flagslist=COMCTL-TREEVIEW-FLAGS2 + 0x00000001=checkboxes + 0x00000002=full-row-select + 0x00000004=hot-tracking + 0x00000008=scroll + 0x00000010=single-select +end + +# status bar ----------------------------------------------------------------- + +{6B7E638F-850A-101B-AFC0-4210102A8DA7}=COMCTL.SBarCtrl.1 + +combilist=COMCTL-STATUSBAR-PANELFLAGS + ignore=0xFFFFF000 + 0x00000007=uint8,dec,style,COMCTL-STATUSBAR-STYLE + 0x00000018=uint8,dec,alignment,COMCTL-STATUSBAR-ALIGN + 0x00000060=uint8,dec,bevel,COMCTL-STATUSBAR-BEVEL + 0x00000080=enabled + 0x00000300=uint8,dec,autosize,COMCTL-STATUSBAR-AUTOSIZE + 0x00000400=visible +end + +shortlist=COMCTL-STATUSBAR-STYLE,0,text,caps,num,ins,scrl,time,date,kana +shortlist=COMCTL-STATUSBAR-ALIGN,0,left,center,right +shortlist=COMCTL-STATUSBAR-BEVEL,0,no-bevel,inset,raised +shortlist=COMCTL-STATUSBAR-AUTOSIZE,0,no-auto,spring,content + +flagslist=COMCTL-STATUSBAR-TEXTFLAGS + 0x00000001=text + 0x00000002=vis-text + 0x00000004=key + 0x00000008=tag + 0x00000010=tooltip +end + +# other controls ============================================================= + +# Microsoft Web Browser +{8856F961-340A-11D0-A96B-00C04FD705A2}=Shell.Explorer.2 + +# ActiveX name lists ========================================================= + +combilist=AX-STRINGLEN + 0x80000000=!unicode!compressed + 0x7FFFFFFF=int32,dec,buffer-size +end + +combilist=AX-ARRAYSTRINGLEN + 0x80000000=!unicode!compressed + 0x7FFFFFFF=int32,dec,len +end + +combilist=AX-FLAGS + 0x00000001=reserved-1 + 0x00000002=enabled + 0x00000004=locked + 0x00000008=opaque + 0x00000010=reserved-2 + 0x00000400=column-heads + 0x00000800=entire-rows + 0x00001000=existing-entries-only + 0x00002000=caption-left + 0x00004000=editable + 0x00078000=uint8,dec,ime-mode,AX-IMEMODE + 0x00080000=drag-enabled + 0x00100000=enter-as-newline + 0x00200000=keep-selection + 0x00400000=tab-as-character + 0x00800000=word-wrap + 0x02000000=borders-suppressed + 0x04000000=select-line + 0x08000000=single-char-select + 0x10000000=auto-size + 0x20000000=hide-selection + 0x40000000=maxlength-autotab + 0x80000000=multi-line +end + +multilist=AX-IMEMODE + 0=no-control,on,off,disabled + 4=hiragana,fillwidth-katakana,halfwidth-katakana + 7=fullwidth-alpha,halfwidth-alpha + 9=fullwidth-hangul,halfwidth-hangul + 11=fullwidth-hanzi,halfwidth-hanzi +end + +combilist=AX-IMAGEPOS + 0x0000FFFF=uint16,dec,image,AX-POS + 0xFFFF0000=uint16,dec,label,AX-POS +end + +unitconverter=AX-CONV-MS,1,ms + +shortlist=AX-ENABLED,0,disabled,enabled +shortlist=AX-BORDERSTYLE,0,none,single +shortlist=AX-SPECIALEFFECT,0,flat,raised,sunken,etched,,,bump +shortlist=AX-ORIENTATION,-1,auto,vertical,horizontal +shortlist=AX-POS,0,top-left,top,top-right,left,center,right,bottom-left,bottom,bottom-right +shortlist=AX-IMAGEALIGN,0,top-left,top-right,center,bottom-left,bottom-right +shortlist=AX-IMAGESIZEMODE,0,clip,stretch,,stretch-ratio + +# CFontNew ------------------------------------------------------------------- + +{AFC20920-DA4E-11CE-B94300AA006887B4}=CFontNew + +flagslist=AX-CFONTNEW-PROPERTIES + 0x0001=font-name + 0x0002=flags + 0x0004=font-size + 0x0008=font-offset + 0x0010=charset + 0x0020=pitch-family + 0x0040=alignment + 0x0080=font-weight +end + +flagslist=AX-CFONTNEW-FLAGS + 0x00000001=bold + 0x00000002=italic + 0x00000004=underline + 0x00000008=strikeout + 0x00002000=sunken + 0x00002000=sunken + 0x40000000=auto-color +end + +shortlist=AX-CFONTNEW-ALIGNMENT,1,left,right,center + +# column info ---------------------------------------------------------------- + +flagslist=AX-COLUMNINFO-PROPERTIES + 0x00000001=column-width +end + +# command button ------------------------------------------------------------- + +{D7053240-CE69-11CD-A777-00DD01143C57}=Forms.CommandButton.1 + +flagslist=AX-COMMANDBUTTON-PROPERTIES + 0x00000001=text-color + 0x00000002=fill-color + 0x00000004=flags + 0x00000008=caption + 0x00000010=image-pos + 0x00000020=size + 0x00000040=mouse-ptr + 0x00000080=image + 0x00000100=accelerator + 0x00000200=no-take-focus + 0x00000400=mouse-icon +end + +# toggle button, check box, option button, text box, list box, combo box ----- + +{8BD21D10-EC42-11CE-9E0D-00AA006002F3}=Forms.TextBox.1 +{8BD21D20-EC42-11CE-9E0D-00AA006002F3}=Forms.ListBox.1 +{8BD21D30-EC42-11CE-9E0D-00AA006002F3}=Forms.ComboBox.1 +{8BD21D40-EC42-11CE-9E0D-00AA006002F3}=Forms.CheckBox.1 +{8BD21D50-EC42-11CE-9E0D-00AA006002F3}=Forms.OptionButton.1 +{8BD21D60-EC42-11CE-9E0D-00AA006002F3}=Forms.ToggleButton.1 +{00024512-0000-0000-C000-000000000046}=RefEdit.Ctrl + +flagslist=AX-MORPH-PROPERTIES + 0x0000000000000001=flags + 0x0000000000000002=fill-color + 0x0000000000000004=text-color + 0x0000000000000008=max-length + 0x0000000000000010=border-style + 0x0000000000000020=scrollbars + 0x0000000000000040=control-type + 0x0000000000000080=mouse-ptr + 0x0000000000000100=size + 0x0000000000000200=password-char + 0x0000000000000400=list-width + 0x0000000000000800=bound-column + 0x0000000000001000=text-column + 0x0000000000002000=column-count + 0x0000000000004000=list-rowcount + 0x0000000000008000=column-info-count + 0x0000000000010000=match-entry-mode + 0x0000000000020000=list-style + 0x0000000000040000=show-dropdown-mode + 0x0000000000100000=dropdown-style + 0x0000000000200000=selection-type + 0x0000000000400000=value + 0x0000000000800000=caption + 0x0000000001000000=image-pos + 0x0000000002000000=border-color + 0x0000000004000000=special-effect + 0x0000000008000000=mouse-icon + 0x0000000010000000=image + 0x0000000020000000=accelerator + 0x0000000080000000=reserved + 0x0000000100000000=groupname +end + +shortlist=AX-MORPH-SCROLLBARS,0,none,horizontal,vertical,both +shortlist=AX-MORPH-CONTROLTYPE,1,edit,listbox,combobox,checkbox,optionbutton,togglebutton,dropdown-listbox +shortlist=AX-MORPH-MATCHENTRYTYPE,0,first-letter,complete,none +shortlist=AX-MORPH-LISTSTYLE,0,plain,with-buttons +shortlist=AX-MORPH-SHOWDROPDOWNMODE,0,never,on-focus,always +shortlist=AX-MORPH-DROPDOWNSTYLE,0,no-symbol,arrow,ellipsis,underline +shortlist=AX-MORPH-SELECTIONTYPE,0,single,multi,range + +constlist=AX-MORPH-BOUNDCOLUMN + default= + 0=value-is-row-index +end + +constlist=AX-MORPH-TEXTCOLUMN + default= + -1=first-column-with-width + 0=row-numbers +end + +constlist=AX-MORPH-COLUMNCOUNT + default= + -1=all-columns +end + +# label ---------------------------------------------------------------------- + +{978C9E23-D4B0-11CE-BF2D-00AA003F40D0}=Forms.Label.1 + +flagslist=AX-LABEL-PROPERTIES + 0x00000001=text-color + 0x00000002=fill-color + 0x00000004=flags + 0x00000008=caption + 0x00000010=image-pos + 0x00000020=size + 0x00000040=mouse-ptr + 0x00000080=border-color + 0x00000100=border-style + 0x00000200=special-effect + 0x00000400=image + 0x00000800=accelerator + 0x00001000=mouse-icon +end + +# image ---------------------------------------------------------------------- + +{4C599241-6926-101B-9992-00000B65C6F9}=Forms.Image.1 + +flagslist=AX-IMAGE-PROPERTIES + 0x00000004=auto-size + 0x00000008=border-color + 0x00000010=fill-color + 0x00000020=border-style + 0x00000040=mouse-ptr + 0x00000080=image-size-mode + 0x00000100=special-effect + 0x00000200=size + 0x00000400=image + 0x00000800=image-align + 0x00001000=image-tiling + 0x00002000=flags + 0x00004000=mouse-icon +end + +# scroll bar ----------------------------------------------------------------- + +{DFD181E0-5E2F-11CE-A449-00AA004A803D}=Forms.ScrollBar.1 + +flagslist=AX-SCROLLBAR-PROPERTIES + 0x00000001=arrow-color + 0x00000002=fill-color + 0x00000004=flags + 0x00000008=size + 0x00000010=mouse-ptr + 0x00000020=min + 0x00000040=max + 0x00000080=value + 0x00000100=unused + 0x00000200=prev-enabled + 0x00000400=next-enabled + 0x00000800=step + 0x00001000=page-step + 0x00002000=orientation + 0x00004000=prop-thumb + 0x00008000=delay + 0x00010000=mouse-icon +end + +shortlist=AX-SCROLLBAR-PROPTHUMB,-1,proportional,fixed + +# spin button ---------------------------------------------------------------- + +{79176FB0-B7F2-11CE-97EF-00AA006D2776}=Forms.SpinButton.1 + +flagslist=AX-SPINBUTTON-PROPERTIES + 0x00000001=arrow-color + 0x00000002=fill-color + 0x00000004=flags + 0x00000008=size + 0x00000010=unused + 0x00000020=min + 0x00000040=max + 0x00000080=value + 0x00000100=prev-enabled + 0x00000200=next-enabled + 0x00000400=step + 0x00000800=orientation + 0x00001000=delay + 0x00002000=mouse-icon + 0x00004000=mouse-ptr +end + +# tab strip ------------------------------------------------------------------ + +{EAE50EB0-4A62-11CE-BED6-00AA00611080}=Forms.TabStrip.1 + +flagslist=AX-TABSTRIP-PROPERTIES + 0x00000001=selected-tab + 0x00000002=fill-color + 0x00000004=text-color + 0x00000010=size + 0x00000020=tab-captions + 0x00000040=mouse-ptr + 0x00000100=tab-orientation + 0x00000200=tab-style + 0x00000400=multi-row + 0x00000800=tab-fixed-width + 0x00001000=tab-fixed-height + 0x00002000=tooltips + 0x00008000=tooltip-strings + 0x00020000=tab-names + 0x00040000=flags + 0x00080000=new-version + 0x00100000=tabs-allocated + 0x00200000=tags + 0x00400000=tab-flag-count + 0x00800000=accelerators + 0x01000000=mouse-icon +end + +shortlist=AX-TABSTRIP-ORIENTATION,0,top,bottom,left,right +shortlist=AX-TABSTRIP-TABSTYLE,0,tabs,buttons,none + +flagslist=AX-TABSTRIP-FLAGS + 0x00000001=visible + 0x00000002=enabled +end + +# VBA forms ================================================================== + +# form class info ------------------------------------------------------------ + +flagslist=VBA-CLASSINFO-PROPERTIES + 0x00000001=class-id + 0x00000002=disp-event + 0x00000008=default-prog + 0x00000010=class-flags + 0x00000020=method-count + 0x00000040=dispatch-id-bind + 0x00000080=get-bind-index + 0x00000100=put-bind-index + 0x00000200=bind-type + 0x00000400=get-value-index + 0x00000800=put-value-index + 0x00001000=value-type + 0x00002000=dispatch-id-rowset + 0x00004000=set-rowset +end + +combilist=VBA-CLASSINFO-FLAGS + 0x0000FFFF=uint16,hex,classtable-flags,VBA-CLASSTABLE-CLASSFLAGS + 0xFFFF0000=uint16,hex,var-flags,VBA-CLASSTABLE-VARFLAGS +end + +flagslist=VBA-CLASSTABLE-CLASSFLAGS + 0x0001=exclusive-value + 0x0002=dual-interface + 0x0004=no-aggregation +end + +flagslist=VBA-CLASSTABLE-VARFLAGS + 0x0001=read-only + 0x0002=source + 0x0004=bindable + 0x0008=request-edit + 0x0010=display-bind + 0x0020=default-bind + 0x0040=hidden + 0x0080=restricted + 0x0100=default-coll-elem + 0x0200=ui-default + 0x0400=non-browsable + 0x0800=replaceable + 0x1000=immediate-bind +end + +# form site ------------------------------------------------------------------ + +flagslist=VBA-FORMSITE-PROPERTIES + 0x00000001=name + 0x00000002=tag + 0x00000004=id + 0x00000008=help-context-id + 0x00000010=flags + 0x00000020=stream-size + 0x00000040=tab-index + 0x00000080=class-id-cache-index + 0x00000100=pos + 0x00000200=group-id + 0x00000800=tool-tip + 0x00001000=licence-key + 0x00002000=control-source + 0x00004000=row-source +end + +flagslist=VBA-FORMSITE-FLAGS + 0x00000001=tabstop + 0x00000002=visible + 0x00000004=default + 0x00000008=cancel + 0x00000010=!storage!obj-stream + 0x00000020=auto-size + 0x00000100=preserve-height + 0x00000200=fit-to-parent + 0x00002000=select-child + 0x00040000=container +end + +combilist=VBA-FORMSITE-CLASSIDCACHE + 0x7FFF=uint16,dec,cache-idx,VBA-FORMSITE-CLASSIDCACHEINDEX,filter=0x8000~0x0000 + 0x7FFF=uint16,dec,class-table-idx,,filter=0x8000~0x8000 + 0x8000=!predefined-class-id!class-table-index +end + +constlist=VBA-FORMSITE-CLASSNAMES + 7=Forms.Form.1 + 12=Forms.Image.1 + 14=Forms.Frame.1 + 15=Internal.MorphData + 16=Forms.SpinButton.1 + 17=Forms.CommandButton.1 + 18=Forms.TabStrip.1 + 21=Forms.Label.1 + 23=Forms.TextBox.1 + 24=Forms.ListBox.1 + 25=Forms.ComboBox.1 + 26=Forms.CheckBox.1 + 27=Forms.OptionButton.1 + 28=Forms.ToggleButton.1 + 47=Forms.ScrollBar.1 + 57=Forms.MultiPage.1 +end + +constlist=VBA-FORMSITE-CLASSIDCACHEINDEX + include=VBA-FORMSITE-CLASSNAMES + 0x7FFF=invalid +end + +# form design extender ------------------------------------------------------ + +flagslist=VBA-FORMDESIGNEXT-PROPERTIES + 0x00000001=flags + 0x00000002=grid-x + 0x00000004=grid-y + 0x00000008=click-control-mode + 0x00000010=dblclick-control-mode +end + +flagslist=VBA-FORMDESIGNEXT-FLAGS + 0x00000001=inherit-design-mode + 0x00000002=design-mode + 0x00000004=inherit-show-toolbox + 0x00000008=show-toolbox + 0x00000010=inherit-show-grid + 0x00000020=show-grid + 0x00000040=inherit-snap-to-grid + 0x00000080=snap-to-grid + 0x00000100=inherit-grid-x + 0x00000200=inherit-grid-y + 0x00000400=inherit-click-control-mode + 0x00000800=inherit-dblclick-control-mode + 0x00001000=inherit-show-invisible + 0x00002000=show-invisible + 0x00004000=inherit-show-tooltips + 0x00008000=show-tooltips + 0x00010000=inherit-immediate-layout + 0x00020000=immediate-layout +end + +shortlist=VBA-FORMDESIGNEXT-CLICKCTRLMODE,-2,inherit,default,insertion-point,select-then-insert +shortlist=VBA-FORMDESIGNEXT-DBLCLICKCTRLMODE,-2,inherit,,select-text,edit-code,edit-properties + +# form ----------------------------------------------------------------------- + +{C62A69F0-16DC-11CE-9E98-00AA00574A4F}=Forms.Form.1 +{6E182020-F460-11CE-9BCD-00AA00608E01}=Forms.Frame.1 + +flagslist=VBA-FORM-PROPERTIES + 0x00000002=fill-color + 0x00000004=text-color + 0x00000008=next-available-id + 0x00000040=flags + 0x00000080=border-style + 0x00000100=mouse-ptr + 0x00000200=scrollbars + 0x00000400=display-size + 0x00000800=logical-size + 0x00001000=scroll-pos + 0x00002000=group-count + 0x00008000=mouse-icon + 0x00010000=cycle + 0x00020000=special-effect + 0x00040000=border-color + 0x00080000=caption + 0x00100000=font + 0x00200000=image + 0x00400000=zoom + 0x00800000=image-align + 0x01000000=image-tiling + 0x02000000=image-sizemode + 0x04000000=shape-cookie + 0x08000000=draw-buffer +end + +flagslist=VBA-FORM-FLAGS + 0x00000004=enabled + 0x00004000=has-design-extender + 0x00008000=!has-class-table!skip-class-table +end + +flagslist=VBA-FORM-SCROLLBARS + 0x01=horizontal + 0x02=vertical + 0x04=keep-horizontal + 0x08=keep-vertical + 0x10=vertical-left +end + +shortlist=VBA-FORM-CYCLE,0,all-forms,,current-form + +combilist=VBA-FORM-SITE-TYPECOUNT + 0x7F=uint8,dec,type-count + 0x80=!type!count +end + +# page ----------------------------------------------------------------------- + +flagslist=VBA-PAGE-PROPERTIES + 0x00000002=transition-effect + 0x00000004=transition-period +end + +shortlist=VBA-PAGE-TRANSITIONEFFECT,0,none,cover-up,cover-right-up,cover-right,cover-right-down,cover-down,cover-left-down,cover-left,cover-left-up,push-up,push-right,push-down,push-left + +# multi page ----------------------------------------------------------------- + +{46E31370-3F7A-11CE-BED6-00AA00611080}=Forms.MultiPage.1 + +flagslist=VBA-MULTIPAGE-PROPERTIES + 0x00000002=page-count + 0x00000004=id + 0x00000008=enabled +end + +# VBA project name lists ===================================================== + +multilist=VBA-DIR-RECORD-NAMES + 0x0000=,PROJECTSYSKIND,PROJECTLCID,PROJECTCODEPAGE,PROJECTNAME,PROJECTDOCSTRING,PROJECTHELPFILEPATH1,PROJECTHELPCONTEXT + 0x0008=PROJECTLIBFLAGS,PROJECTVERSION,,,PROJECTCONSTANTS,REFERENCEREGISTERED,REFERENCEPROJECT,PROJECTMODULES + 0x0010=PROJECTEND,,,PROJECTCOOKIE,PROJECTLCIDINVOKE,,REFERENCENAME, + 0x0018=,MODULENAME,MODULESTREAMNAME,,MODULEDOCSTRING,,MODULEHELPCONTEXT, + 0x0020=,MODULETYPEPROCEDURAL,MODULETYPEDOCUMENT,,,MODULEREADONLY,, + 0x0028=MODULEPRIVATE,,,MODULEEND,MODULECOOKIE,,,REFERENCECONTROL + 0x0030=REFERENCEEXTENDED,MODULEOFFSET,MODULESTREAMNAMEUNICODE,REFERENCEORIGINAL,,,, + 0x0038=,,,,PROJECTCONSTANTSUNICODE,PROJECTHELPFILEPATH2,REFERENCENAMEUNICODE, + 0x0040=PROJECTDOCSTRINGUNICODE,,,,,,,MODULENAMEUNICODE + 0x0048=MODULEDOCSTRINGUNICODE,,,,,,, +end + +constlist=VBA-DIR-SIMPLE-RECORDS + 0x0001=uint32,dec,platform,VBA-DIR-PROJECTSYSKIND-PLATFORM + 0x0002=uint32,hex,lang-id + 0x0007=uint32,dec,help-context-id + 0x0008=uint32,hex,libflags + 0x000F=uint16,dec,module-count + 0x0013=int16,dec,cookie + 0x0014=uint32,hex,lang-id + 0x001E=uint32,dec,help-context-id + 0x002C=int16,dec,cookie +end + +shortlist=VBA-DIR-PROJECTSYSKIND-PLATFORM,0,16-bit-windows,32-bit-windows,macintosh + +# ============================================================================ diff --git a/oox/source/dump/pptxdumper.cxx b/oox/source/dump/pptxdumper.cxx new file mode 100644 index 000000000..c65b79206 --- /dev/null +++ b/oox/source/dump/pptxdumper.cxx @@ -0,0 +1,131 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include + +#include +#include +#include +#include +#include +#include + +#ifdef DBG_UTIL + +namespace oox::dump::pptx { + +using namespace ::com::sun::star::io; +//using namespace ::com::sun::star::lang; +using namespace ::com::sun::star::uno; + +using ::oox::core::FilterBase; + +RootStorageObject::RootStorageObject( const DumperBase& rParent ) +{ + StorageObjectBase::construct( rParent ); +} + +void RootStorageObject::implDumpStream( const Reference< XInputStream >& rxStrm, const OUString& rStrgPath, const OUString& rStrmName, const OUString& rSysFileName ) +{ + std::u16string_view aExt( InputOutputHelper::getFileNameExtension( rStrmName ) ); + if( o3tl::equalsIgnoreAsciiCase(aExt, u"pptx") || + o3tl::equalsIgnoreAsciiCase(aExt, u"potx") ) + { + Dumper( getContext(), rxStrm, rSysFileName ).dump(); + } +#ifdef FIXME + else if( + o3tl::equalsIgnoreAsciiCase(aExt, u"xlsb") || + o3tl::equalsIgnoreAsciiCase(aExt, u"xlsm") || + o3tl::equalsIgnoreAsciiCase(aExt, u"xlsx") || + o3tl::equalsIgnoreAsciiCase(aExt, u"xltm") || + o3tl::equalsIgnoreAsciiCase(aExt, u"xltx") ) + { + ::oox::dump::xlsb::Dumper( getContext(), rxStrm, rSysFileName ).dump(); + } + else if( + o3tl::equalsIgnoreAsciiCase(aExt, u"xla") || + o3tl::equalsIgnoreAsciiCase(aExt, u"xlc") || + o3tl::equalsIgnoreAsciiCase(aExt, u"xlm") || + o3tl::equalsIgnoreAsciiCase(aExt, u"xls") || + o3tl::equalsIgnoreAsciiCase(aExt, u"xlt") || + o3tl::equalsIgnoreAsciiCase(aExt, u"xlw") ) + { + ::oox::dump::biff::Dumper( getContext(), rxStrm, rSysFileName ).dump(); + } +#endif + else if( + o3tl::equalsIgnoreAsciiCase(aExt, u"xml") || + o3tl::equalsIgnoreAsciiCase(aExt, u"vml") || + o3tl::equalsIgnoreAsciiCase(aExt, u"rels") ) + { + XmlStreamObject( *this, rxStrm, rSysFileName ).dump(); + } + else if( o3tl::equalsIgnoreAsciiCase(aExt, u"bin") ) + { + if( rStrgPath == "ppt" && rStrmName == "vbaProject.bin" ) + { + StorageRef xStrg = std::make_shared<::oox::ole::OleStorage>( getContext(), rxStrm, false ); + VbaProjectStorageObject( *this, xStrg, rSysFileName ).dump(); + } + else if ( rStrgPath == "ppt/embeddings" ) + { + StorageRef xStrg = std::make_shared<::oox::ole::OleStorage>( getContext(), rxStrm, false ); + OleStorageObject( *this, xStrg, rSysFileName ).dump(); + } + else if ( rStrgPath == "ppt/activeX" ) + { + StorageRef xStrg = std::make_shared<::oox::ole::OleStorage>( getContext(), rxStrm, true ); + ActiveXStorageObject( *this, xStrg, rSysFileName ).dump(); + } + else + { + BinaryStreamObject( *this, rxStrm, rSysFileName ).dump(); + } + } +} + +#define DUMP_PPTX_CONFIG_ENVVAR "OOO_PPTXDUMPER" + +Dumper::Dumper( const FilterBase& rFilter ) +{ + ConfigRef xCfg = std::make_shared( DUMP_PPTX_CONFIG_ENVVAR, rFilter ); + DumperBase::construct( xCfg ); +} + +Dumper::Dumper( const Reference< XComponentContext >& rxContext, const Reference< XInputStream >& rxInStrm, const OUString& rSysFileName ) +{ + if( rxContext.is() && rxInStrm.is() ) + { + StorageRef xStrg = std::make_shared( rxContext, rxInStrm ); + ConfigRef xCfg = std::make_shared( DUMP_PPTX_CONFIG_ENVVAR, rxContext, xStrg, rSysFileName ); + DumperBase::construct( xCfg ); + } +} + +void Dumper::implDump() +{ + RootStorageObject( *this ).dump(); +} + +} // namespace oox::dump::pptx + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/dump/pptxdumper.ini b/oox/source/dump/pptxdumper.ini new file mode 100644 index 000000000..5bfd267e7 --- /dev/null +++ b/oox/source/dump/pptxdumper.ini @@ -0,0 +1,35 @@ +# +# This file is part of the LibreOffice project. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# +# This file incorporates work covered by the following license notice: +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed +# with this work for additional information regarding copyright +# ownership. The ASF licenses this file to you under the Apache +# License, Version 2.0 (the "License"); you may not use this file +# except in compliance with the License. You may obtain a copy of +# the License at http://www.apache.org/licenses/LICENSE-2.0 . +# + +# dumper settings ============================================================ + +# Path to additional configuration data, relative to this file. +include-config-file=dumperbase.ini + +# Enable entire dumper (default=off). This option does not affect the option +# 'enable-import'. +# 0=off, 1=on, missing: setting from dumperbase.ini +# enable-dumper=1 + +# Enable import after dumping (default=on). Disabling this option allows +# to dump a file without loading it. This option is independent from the +# 'enable-dumper' option. +# 0=off, 1=on, missing: setting from dumperbase.ini +# enable-import=1 + +# ============================================================================ diff --git a/oox/source/dump/xlsbdumper.ini b/oox/source/dump/xlsbdumper.ini new file mode 100644 index 000000000..9a28f8268 --- /dev/null +++ b/oox/source/dump/xlsbdumper.ini @@ -0,0 +1,1204 @@ +# +# This file is part of the LibreOffice project. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# +# This file incorporates work covered by the following license notice: +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed +# with this work for additional information regarding copyright +# ownership. The ASF licenses this file to you under the Apache +# License, Version 2.0 (the "License"); you may not use this file +# except in compliance with the License. You may obtain a copy of +# the License at http://www.apache.org/licenses/LICENSE-2.0 . +# + +# dumper settings ============================================================ + +# Path to additional configuration data, relative to this file. +include-config-file=dumperbase.ini +include-config-file=oledumper.ini + +# Enable entire dumper. This option does not affect the option 'enable-import'. +# 0=off, 1=on, missing = use setting from dumperbase.ini +# enable-dumper=1 + +# Enable import after dumping. Disabling this option allows to dump a file +# without loading it. This option is independent from the 'enable-dumper' +# option. +# 0=off, 1=on, missing = use setting from dumperbase.ini +# enable-import=1 + +# name lists ================================================================= + +# common --------------------------------------------------------------------- + +unitconverter=CONV-TINT,/327.67,% +unitconverter=CONV-COLWIDTH,/256,chars + +constlist=ERRORCODES + 0x00=#NULL! + 0x07=#DIV/0! + 0x0F=#VALUE! + 0x17=#REF! + 0x1D=#NAME? + 0x24=#NUM! + 0x2A=#N/A +end + +flagslist=STRING-FLAGS + 0x01=rich-string + 0x02=phonetic-text +end + +combilist=CELL-XFID + 0x00FFFFFF=int32,dec,xf-id + 0x01000000=show-phonetic +end + +combilist=PHONETIC-FLAGS + ignore=0x0030 + 0x0003=uint8,dec,type,PHONETICPR-TYPE + 0x000C=uint8,dec,alignment,PHONETICPR-ALIGNMENT +end + +shortlist=COLOR-TYPE,0,auto,indexed,rgb,theme + +combilist=COLOR-FLAGS + 0x01=rgb-valid + 0xFE=uint8,dec,type,COLOR-TYPE +end + +multilist=PALETTE-COLORS + default= + 0=ega-black,ega-white,ega-red,ega-green,ega-blue,ega-yellow,ega-magenta,ega-cyan + 64=sys-window-text + 65=sys-window-bg + 67=sys-button-face + 77=sys-window-text-chart + 78=sys-window-bg-chart + 79=auto-border-chart + 80=sys-tooltip-bg + 81=sys-tooltip-text +end + +constlist=TEXTROTATION + default= + 255=stacked +end + +multilist=BORDERSTYLES + 0=none,thin,medium,dash,dot + 5=thick,double,hair,medium-dash,thin-dash-dot + 10=medium-dash-dot,thin-dash-dot-dot,medium-dash-dot-dot,slant-dash-dot +end + +multilist=FILLPATTERNS + 0=no-fill,solid-fill,50%-grey,75%-grey,25%-grey + 5=hor-stripe,ver-stripe,rev-diag-stripe,diag-stripe,diag-crosshatch + 10=thick-diag-crosshatch,thin-hor-stripe,thin-ver-stripe,thin-rev-diag-stripe,thin-diag-stripe + 15=thin-hor-crosshatch,thin-diag-crosshatch,12.5%-grey,6.25%-grey + 40=gradient +end + +# formulas ------------------------------------------------------------------- + +flagslist=FORMULA-FLAGS + 0x0002=recalc-always +end + +multilist=BASETOKENS + 0x00=,tExp,tTbl,tAdd,tSub,tMul,tDiv,tPower + 0x08=tConcat,tLT,tLE,tEQ,tGE,tGT,tNE,tIsect + 0x10=tList,tRange,tUplus,tUminus,tPercent,tParen,tMissArg,tStr + 0x18=tTable,tAttr,,,tErr,tBool,tInt,tNum +end + +constlist=TOKENCLASSES + 0x20=R + 0x40=V + 0x60=A +end + +multilist=CLASSTOKENS + 0x00=tArray,tFunc,tFuncVar,tName,tRef,tArea,tMemArea,tMemErr + 0x08=tMemNoMem,tMemFunc,tRefErr,tAreaErr,tRefN,tAreaN,tMemAreaN,tMemNoMemN + 0x18=,tNameX,tRef3d,tArea3d,tRefErr3d,tAreaErr3d +end + +combilist=FUNCID + 0x7FFF=uint16,dec,func-id + 0x8000=command +end + +combilist=PARAMCOUNT-CMD + 0x7F=uint8,dec,count + 0x80=prompt +end + +combilist=REFRELFLAGS + 0x3FFF=uint16,dec,value + 0x4000=col-rel + 0x8000=row-rel +end + +flagslist=TABLEFLAGS + 0x0001=single-column + 0x0002=column-range + 0x0004=#all + 0x0008=#headers + 0x0010=#data + 0x0020=#totals + 0x0040=#this-row + 0x0080=bracket-spaces + 0x0100=sep-spaces + 0x0200=single-row + 0x0400=single-cell +end + +flagslist=ATTRTYPES + 0x01=volatile + 0x02=if + 0x04=choose + 0x08=skip + 0x10=sum + 0x20=assign + 0x40=space + 0x80=iferror +end + +shortlist=ATTRSPACETYPES,0,space-before-token,cr-before-token,space-before-open,cr-before-open,space-before-close,cr-before-close,leading-space + +shortlist=ARRAYVALUE-TYPE,0,number,string,boolean,,error + +# record names --------------------------------------------------------------- + +multilist=RECORD-NAMES + 0x0000=ROW,CELL_BLANK,CELL_RK,CELL_ERROR,CELL_BOOL,CELL_DOUBLE,CELL_STRING,CELL_SI + 0x0008=FORMULA_STRING,FORMULA_DOUBLE,FORMULA_BOOL,FORMULA_ERROR,MULTCELL_BLANK,MULTCELL_RK,MULTCELL_ERROR,MULTCELL_BOOL + 0x0010=MULTCELL_DOUBLE,MULTCELL_STRING,MULTCELL_SI,SI,PCITEM_MISSING,PCITEM_DOUBLE,PCITEM_BOOL,PCITEM_ERROR + 0x0018=PCITEM_STRING,PCITEM_DATE,PCITEM_INDEX,PCITEMA_MISSING,PCITEMA_DOUBLE,PCITEMA_BOOL,PCITEMA_ERROR,PCITEMA_STRING + 0x0020=PCITEMA_DATE,PCRECORD,PCRECORDDT,FRT,FRT_END,,,DEFINEDNAME + 0x0028=BINARYINDEXROWS,,BINARYINDEXBLOCK,FONT,NUMFMT,FILL,BORDER,XF + 0x0030=CELLSTYLE,,,,,,, + 0x0038=,,,,COL,MULTCELL_RSTRING,CELL_RSTRING,CALCCHAINCELL + 0x0040=DATAVALIDATION,,,,,,, + + 0x0080=FILEVERSION,WORKSHEET,WORKSHEET_END,WORKBOOK,WORKBOOK_END,SHEETVIEWS,SHEETVIEWS_END,BOOKVIEWS + 0x0088=BOOKVIEWS_END,SHEETVIEW,SHEETVIEW_END,CHARTSHEETVIEWS,CHARTSHEETVIEWS_END,CHARTSHEETVIEW,CHARTSHEETVIEW_END,SHEETS + 0x0090=SHEETS_END,SHEETDATA,SHEETDATA_END,SHEETPR,DIMENSION,,,PANE + 0x0098=SELECTION,WORKBOOKPR,SMARTTAGPR,FILERECOVERYPR,SHEET,CALCPR,WORKBOOKVIEW,SST + 0x00A0=SST_END,AUTOFILTER,AUTOFILTER_END,FILTERCOLUMN,FILTERCOLUMN_END,DISCRETEFILTERS,DISCRETEFILTERS_END,DISCRETEFILTER + 0x00A8=COLORFILTER,ICONFILTER,TOP10FILTER,DYNAMICFILTER,CUSTOMFILTERS,CUSTOMFILTERS_END,CUSTOMFILTER,AFDATEGROUPITEM + 0x00B0=MERGECELL,MERGECELLS,MERGECELLS_END,PCDEFINITION,PCDEFINITION_END,PCDFIELDS,PCDFIELDS_END,PCDFIELD + 0x00B8=PCDFIELD_END,PCDSOURCE,PCDSOURCE_END,PCDSHEETSOURCE,PCDSHEETSOURCE_END,PCDFSHAREDITEMS,PCDFSHAREDITEMS_END,PCITEM_ARRAY + 0x00C0=PCITEM_ARRAY_END,PCRECORDS,PCRECORDS_END,,,,, + 0x00C8=,CONNECTION,CONNECTION_END,,,,, + + 0x00D8=,,,PCDFIELDGROUP,PCDFIELDGROUP_END,PCDFGROUPITEMS,PCDFGROUPITEMS_END,PCDFRANGEPR + 0x00E0=PCDFRANGEPR_END,PCDFDISCRETEPR,PCDFDISCRETEPR_END,,,,, + + 0x00F0=,,,,,,,PIVOTAREA + 0x00F8=PIVOTAREA_END,PTREFERENCES,PTREFERENCES_END,PTREFERENCE,PTREFERENCE_END,,, + 0x0100=,,,,,WEBPR,WEBPR_END,WEBPRTABLES + 0x0108=WEBPRTABLES_END,,,,,,, + 0x0110=,,,,,BINARYINDEX_END,STYLESHEET,STYLESHEET_END + 0x0118=PTDEFINITION,PTFITEM_END,PTFITEM,PTFITEMS,PTFITEMS_END,PTFIELD,PTFIELD_END,PTFIELDS + 0x0120=PTFIELDS_END,PTPAGEFIELD,PTPAGEFIELD_END,PTPAGEFIELDS,PTPAGEFIELDS_END,PTDATAFIELD,PTDATAFIELD_END,PTDATAFIELDS + 0x0128=PTDATAFIELDS_END,,,,,,, + 0x0130=,,,,,PTROWFIELDS,PTROWFIELDS_END,PTCOLFIELDS + 0x0138=PTCOLFIELDS_END,PTLOCATION_END,PTLOCATION,PTDEFINITION_END,,,, + + 0x0150=,,,,,,,TABLE + 0x0158=TABLE_END,TABLECOLUMNS,TABLECOLUMNS_END,TABLECOLUMN,TABLECOLUMN_END,,,CALCEDCOLUMNFMLA + 0x0160=,EXTERNALREFS,EXTERNALREFS_END,EXTERNALREF,,EXTERNALSELF,EXTERNALSAME,EXTSHEETNAMES + 0x0168=EXTERNALBOOK,,EXTERNALSHEETS,EXTSHEETDATA,EXTSHEETDATA_END,,EXTROW,EXTCELL_BLANK + 0x0170=EXTCELL_DOUBLE,EXTCELL_BOOL,EXTCELL_ERROR,EXTCELL_STRING,,,, + 0x0178=,,,,,,PTREFERENCEITEM,PTREFERENCEITEM_END + 0x0180=PIVOTCACHES,PIVOTCACHES_END,PIVOTCACHE,PIVOTCACHE_END,,,COLS,COLS_END + 0x0188=ROWBREAKS,ROWBREAKS_END,COLBREAKS,COLBREAKS_END,BRK,CUSTOMWORKBOOKVIEW,, + + 0x01A0=,,,,,,CUSTOMSHEETVIEWS,CUSTOMSHEETVIEW + 0x01A8=CUSTOMSHEETVIEW_END,CUSTOMSHEETVIEWS_END,ARRAY,SHAREDFMLA,DATATABLE,CONNECTIONS,CONNECTIONS_END, + + 0x01B8=,,,,,,,QUERYTABLE + 0x01C0=QUERYTABLE_END,QUERYTABLEREFRESH,QUERYTABLEREFRESH_END,,,,, + 0x01C8=,,,AUTOSORTSCOPE,AUTOSORTSCOPE_END,CONDFORMATTING,CONDFORMATTING_END,CFRULE + 0x01D0=CFRULE_END,ICONSET,ICONSET_END,DATABAR,DATABAR_END,COLORSCALE,COLORSCALE_END,CFVO + 0x01D8=,COLORS,COLORS_END,RGBCOLOR,PAGEMARGINS,PRINTOPTIONS,PAGESETUP,HEADERFOOTER + 0x01E0=HEADERFOOTER_END,PTCHARTFORMAT,PTCHARTFORMAT_END,PTCHARTFORMATS,PTCHARTFORMATS_END,SHEETFORMATPR,, + 0x01E8=,,,,,,HYPERLINK, + 0x01F0=,,,,SCENARIOS,SCENARIOS_END,SCENARIO,SCENARIO_END + 0x01F8=INPUTCELLS,DXFS,DXFS_END,DXF,TABLESTYLES,TABLESTYLES_END,, + 0x0200=,TABLESTYLEINFO,VOLTYPES,VOLTYPES_END,VOLTYPE,VOLTYPE_END,VOLTYPEMAIN,VOLTYPEMAIN_END + 0x0208=VOLTYPETP,VOLTYPETP_END,VOLTYPESTP,VOLTYPETR,,VOLTYPE_ERROR,, + 0x0210=CALCCHAIN,CALCCHAIN_END,,,,,,SHEETPROTECTION + 0x0218=,PHONETICPR,,,,,, + 0x0220=,,,,,OLESIZE,DRAWING,LEGACYDRAWING + + 0x0230=,,PICTURE,,CFCOLOR,INDEXEDCOLORS,INDEXEDCOLORS_END, + 0x0238=,MRUCOLORS,MRUCOLORS_END,,COLOR,DATAVALIDATIONS,DATAVALIDATIONS_END, + 0x0240=,EXTERNALNAME,DDEITEMVALUES,DDEITEMVALUES_END,DDEITEM_DOUBLE,DDEITEM_ERROR,DDEITEM_STRING,DDEITEM_EMPTY + 0x0248=DDEITEM_BOOL,EXTERNALNAMEREF,EXTERNALNAMEFLAGS,EXTERNALNAME_END,EXTERNALBOOK_END,,, + 0x0250=,,,,,,,PTFILTERS + 0x0258=PTFILTERS_END,PTFILTER,PTFILTER_END,FILLS,FILLS_END,,, + 0x0260=,,,FONTS,FONTS_END,BORDERS,BORDERS_END,NUMFMTS + 0x0268=NUMFMTS_END,CELLXFS,CELLXFS_END,CELLSTYLES,CELLSTYLES_END,,, + 0x0270=,,CELLSTYLEXFS,CELLSTYLEXFS_END,COMMENTS,COMMENTS_END,COMMENTAUTHORS,COMMENTAUTHORS_END + 0x0278=COMMENTAUTHOR,COMMENTLIST,COMMENTLIST_END,COMMENT,COMMENT_END,COMMENTTEXT,OLEOBJECTS,OLEOBJECT + 0x0280=OLEOBJECTS_END,,,CONTROLS,CONTROL,CONTROLS_END,, + 0x0288=,,,CHARTSHEETPR,CHARTPAGESETUP,CUSTOMCHARTVIEWS,CUSTOMCHARTVIEWS_END,CUSTOMCHARTVIEW + 0x0290=CUSTOMCHARTVIEW_END,,,,TABLEPARTS,TABLEPART,TABLEPARTS_END,SHEETCALCPR + 0x0298=FUNCTIONGROUPS,FUNCTIONGROUP,FUNCTIONGROUPS_END,EXTERNALADDIN,,CHARTPROTECTION,, +end + +# simple records ------------------------------------------------------------- + +constlist=SIMPLE-RECORDS + 0x001A=int32,dec,item-index + 0x00AC=int32,dec,relation,CUSTOMFILTERS-RELATION + 0x00B5=int32,dec,count + 0x00C1=int32,dec,count + 0x00DD=int32,dec,count + 0x00E1=int32,dec,count + 0x00F9=int32,dec,count + 0x0107=int32,dec,count + 0x011B=int32,dec,count + 0x011F=int32,dec,count + 0x0123=int32,dec,count + 0x0159=int32,dec,count + 0x017E=int32,dec,item-index + 0x01DD=uint16,hex,flags,PRINTOPTIONS-FLAGS + 0x01E3=int32,dec,count + 0x01F9=int32,dec,count + 0x0204=int32,dec,type,VOLTYPE-TYPE + 0x020D=uint8,dec,error-code,ERRORCODES + 0x0244=double,dec,value + 0x0245=uint8,dec,error-code,ERRORCODES + 0x0248=uint8,dec,value,BOOLEAN + 0x0257=int32,dec,count + 0x025B=int32,dec,count + 0x0263=int32,dec,count + 0x0265=int32,dec,count + 0x0267=int32,dec,count + 0x0269=int32,dec,count + 0x026B=int32,dec,count + 0x0272=int32,dec,count + 0x0294=int32,dec,count + 0x0297=uint8,hex,flags,SHEETCALCPR-FLAGS + 0x0298=uint8,dec,builtin-count +end + +# ARRAY ---------------------------------------------------------------------- + +flagslist=ARRAY-FLAGS + ignore=0xFE + 0x01=recalc-always +end + +# BORDER --------------------------------------------------------------------- + +flagslist=BORDER-FLAGS + 0x01=diag-tl-to-br + 0x02=diag-bl-to-tr +end + +# CALCPR --------------------------------------------------------------------- + +shortlist=CALCPR-CALCMODE,0,manual,auto,auto-no-tables + +flagslist=CALCPR-FLAGS + 0x0001=calc-on-load + 0x0002=a1 + 0x0004=iterate + 0x0008=full-precision + 0x0010=calc-complete + 0x0020=calc-on-save + 0x0040=concurrent + 0x0080=manual-processors + 0x0100=force-full-calc +end + +# CELLSTYLE ------------------------------------------------------------------ + +flagslist=CELLSTYLE-FLAGS + 0x0001=builtin + 0x0002=hidden + 0x0004=custom +end + +multilist=CELLSTYLE-BUILTIN + 0=normal,rowlevel,collevel,comma,currency,percent,comma-0,currency-0,hyperlink,followed-hyperlink + 10=note,warning-text,,,,title,heading-1,heading-2,heading-3,heading-4 + 20=input,output,calculation,check-cell,linked-cell,total,good,bad,neutral,accent1 + 30=20%-accent1,40%-accent1,60%-accent1,accent2,20%-accent2,40%-accent2,60%-accent2,accent3,20%-accent3,40%-accent3 + 40=60%-accent3,accent4,20%-accent4,40%-accent4,60%-accent4,accent5,20%-accent5,40%-accent5,60%-accent5,accent6 + 50=20%-accent6,40%-accent6,60%-accent6,explanatory-text +end + +# CFRULE --------------------------------------------------------------------- + +shortlist=CFRULE-TYPE,1,cell-is,expression,color-scale,data-bar,top-ten,icon-set + +multilist=CFRULE-SUBTYPE + 0=cell-is,expression,color-scale,data-bar,icon-set,top-ten,,unique-values,contains-text,contains-blanks + 10=not-contains-blanks,contains-errors,not-contains-errors,,,today,tomorrow,yesterday,last-7-days,last-month + 20=next-month,this-week,next-week,last-week,this-month,above-average,below-average,duplicate-values,,equal-above-average + 30=equal-below-average +end + +shortlist=CFRULE-CELL-OPERATOR,1,between,not-between,equal,not-equal,greater-than,less-than,greater-equal,less-equal +shortlist=CFRULE-TEXT-OPERATOR,0,contains,not-contains,begins-with,ends-with +shortlist=CFRULE-DATE-OPERATOR,0,today,yesterday,last-7-days,this-week,last-week,last-month,tomorrow,next-week,next-month,this-month +shortlist=CFRULE-OTHER-OPERATOR,0,none + +flagslist=CFRULE-FLAGS + 0x0001=table-row + 0x0002=stop-if-true + 0x0004=above-average + 0x0008=bottom + 0x0010=percent +end + +# CHARTPAGESETUP ------------------------------------------------------------------ + +combilist=CHARTPAGESETUP-FLAGS + 0x0001=landscape + 0x0002=uninitialized + 0x0004=black-and-white + 0x0008=default-orientation + 0x0010=use-first-page + 0x0020=draft-quality +end + +# CHARTSHEETPR --------------------------------------------------------------- + +flagslist=CHARTSHEETPR-FLAGS + 0x0001=published +end + +# CHARTSHEETVIEW ------------------------------------------------------------- + +flagslist=CHARTSHEETVIEW-FLAGS + 0x0001=selected + 0x0002=zoom-to-fit +end + +# COL ------------------------------------------------------------------------ + +combilist=COL-FLAGS + 0x0001=hidden + 0x0002=custom-width + 0x0004=best-fit + 0x0008=show-phonetic + 0x0700=uint8,dec,outline-level + 0x1000=outline-collapsed +end + +# CONNECTION ----------------------------------------------------------------- + +shortlist=CONNECTION-SAVEPASSWORD,1,on,off +unitconverter=CONNECTION-INTERVAL,60,sec +shortlist=CONNECTION-SOURCETYPE,1,odbc,dao,file,html,ole-db,text,ado,dsp +shortlist=CONNECTION-RECONNECTTYPE,1,as-required,always,never +shortlist=CONNECTION-CREDENTIALS,0,integrated,none,stored-sso,prompt + +flagslist=CONNECTION-FLAGS + 0x0001=keep-alive + 0x0002=new + 0x0004=deleted + 0x0008=only-use-conn-file + 0x0010=background + 0x0020=refresh-on-load + 0x0040=save-data +end + +flagslist=CONNECTION-STRINGFLAGS + 0x0001=has-source-file + 0x0002=has-source-conn-file + 0x0004=has-description + 0x0008=has-name + 0x0010=has-sso-id +end + +# CUSTOMFILTER --------------------------------------------------------------- + +constlist=CUSTOMFILTER-DATATYPE + 4=double + 6=string + 8=boolean + 12=blank + 14=not-blank +end + +shortlist=CUSTOMFILTER-OPERATOR,1,less,equal,less-equal,greater,not-equal,greater-equal + +# CUSTOMFILTERS -------------------------------------------------------------- + +shortlist=CUSTOMFILTERS-RELATION,0,and,or + +# DATATABLE ------------------------------------------------------------------ + +flagslist=DATATABLE-FLAGS + 0x01=row-table + 0x02=table-2d + 0x04=ref1-deleted + 0x08=ref2-deleted + 0x10=recalc-always +end + +# DATAVALIDATION ------------------------------------------------------------- + +combilist=DATAVALIDATION-FLAGS + 0x0000000F=uint8,dec,type,DATAVALIDATION-TYPE + 0x00000070=uint8,dec,error-style,DATAVALIDATION-ERRORSTYLE + 0x00000080=string-list + 0x00000100=ignore-empty + 0x00000200=no-dropdown + 0x00040000=show-input-box + 0x00080000=show-error-box + 0x00F00000=uint8,dec,operator,DATAVALIDATION-OPERATOR +end + +shortlist=DATAVALIDATION-TYPE,0,any,whole,decimal,list,date,time,text-length,custom +shortlist=DATAVALIDATION-OPERATOR,0,between,not-between,equal,not-equal,greater-than,less-than,greater-equal,less-equal +shortlist=DATAVALIDATION-ERRORSTYLE,0,error,warning,info + +# DATAVALIDATIONS ------------------------------------------------------------ + +combilist=DATAVALIDATIONS-FLAGS + 0x0001=disable-prompts +end + +# DEFINEDNAME ---------------------------------------------------------------- + +combilist=DEFINEDNAME-FLAGS + 0x00000001=hidden + 0x00000002=function + 0x00000004=vba + 0x00000008=macro + 0x00000010=complex + 0x00000020=built-in + 0x00007FC0=int32,dec,func-group,DEFINEDNAME-FUNCGROUP + 0x00008000=published + 0x00010000=workbook-param +end + +shortlist=DEFINEDNAME-FUNCGROUP,0,none,financial,date-time,math-trig,statistical,lookup-ref,database,text,logical,information,commands,customizing,macro-control,dde-external,user-definded + +constlist=DEFINEDNAME-SHEETID + default= + -1=global +end + +# DISCRETEFILTERS -------------------------------------------------------------------- + +shortlist=DISCRETEFILTERS-CALTYPE,0,none,gregorian,gregorian-us,japan,taiwan,korea,hijri,thai,hebrew,gregorian-mideast-fr,gregorian-ar,gregorian-xlit-en,gregorian-xlit-fr + +# DXF ------------------------------------------------------------------------ + +flagslist=DXF-FLAGS + 0x00008000=border-outline +end + +multilist=DXF-SUBREC + 0=FILL-PATTERN,FILL-FGCOLOR,FILL-BGCOLOR,FILL-GRADIENT,FILL-STOP + 5=FONT-COLOR,BORDER-TOP,BORDER-BOTTOM,BORDER-LEFT,BORDER-RIGHT + 10=BORDER-DIAGONAL,BORDER-VERTICAL,BORDER-HORIZONTAL,BORDER-DIAGUP,BORDER-DIAGDOWN + 15=ALIGN-HORIZONTAL,ALIGN-VERTICAL,ALIGN-ROTATION,ALIGN-INDENT,ALIGN-READINGORDER + 20=ALIGN-WRAPTEXT,ALIGN-JUSTLASTLINE,ALIGN-SHRINKTOFIT,,FONT-NAME + 25=FONT-WEIGHT,FONT-UNDERLINE,FONT-ESCAPEMENT,FONT-ITALIC,FONT-STRIKE + 30=FONT-OUTLINE,FONT-SHADOW,FONT-CONDENSE,FONT-EXTEND,FONT-CHARSET + 35=FONT-PITCHFAMILY,FONT-HEIGHT,FONT-SCHEME,NUMFMT-CODE, + 40=,NUMFMT-ID,ALIGN-RELINDENT,PROT-LOCKED,PROT-HIDDEN +end + +# EXTERNALBOOK --------------------------------------------------------------- + +shortlist=EXTERNALBOOK-TYPE,0,book,dde-link,ole-link + +# EXTERNALNAMEFLAGS ---------------------------------------------------------- + +flagslist=EXTERNALNAMEFLAGS-FLAGS + 0x0002=automatic + 0x0004=pic-link + 0x0008=dde-stddocumentname + 0x0010=ole-link + 0x0020=iconified +end + +# EXTERNALSHEETS ------------------------------------------------------------- + +constlist=EXTERNALSHEETS-ID + default= + -1=deleted + -2=special +end + +# EXTSHEETDATA --------------------------------------------------------------- + +flagslist=EXTSHEETDATA-FLAGS + 0x01=refresh-error +end + +# FILL ----------------------------------------------------------------------- + +shortlist=FILL-GRADIENTTYPE,0,linear,path + +# FILTERCOLUMN --------------------------------------------------------------- + +flagslist=FILTERCOLUMN-FLAGS + 0x0001=hidden-button + 0x0002=show-button +end + +# FONT ----------------------------------------------------------------------- + +flagslist=FONT-FLAGS + 0x0001=bold + 0x0002=italic + 0x0004=underline + 0x0008=strikeout + 0x0010=outline + 0x0020=shadow + 0x0040=condense + 0x0080=extend +end + +multilist=FONT-UNDERLINE + 0x00=none,single,double + 0x21=single-acc,double-acc +end + +shortlist=FONT-SCHEME,0,none,major,minor +shortlist=FONT-ESCAPEMENT,0,none,superscript,subscript + +# HEADERFOOTER --------------------------------------------------------------- + +flagslist=HEADERFOOTER-FLAGS + 0x0001=diff-odd-even + 0x0002=diff-dirst + 0x0004=scale-with-doc + 0x0008=align-with-margins +end + +# OLEOBJECT ------------------------------------------------------------------ + +shortlist=OLEOBJECT-ASPECT,1,content,,,icon +shortlist=OLEOBJECT-UPDATE,0,na,automatic,,manual + +flagslist=OLEOBJECT-FLAGS + 0x0001=linked + 0x0002=auto-load +end + +# PAGESETUP ------------------------------------------------------------------ + +multilist=PAGESETUP-PAPERSIZE + 0=undefined,letter,letter-small,tabloid,ledger,legal,statement,executive,a3,a4 + 10=a4-small,a5,b4,b5,folio,quarto,10x14,11x17,note,envelope-9 + 20=envelope-10,envelope-11,envelope-12,envelope-14,c,d,e,envelope-dl,envelope-c5,envelope-c3 + 30=envelope-c4,envelope-c6,envelope-c65,envelope-b4,envelope-b5,envelope-b6,envelope-italy,envelope-monarch,envelope-6-3/4,us-standard-fanfold + 40=german-standard-fanfold,german-legal-fanfold,b4,japanese-dbl-postcaed,9x11,10x11,15x11,, + 50=envelope-invite,letter-extra,legal-extra,tabloid-extra,a4-extra,letter-transverse,a4-transverse,letter-extra-transverse,super-a-a4,super-b-a3,letter-plus + 60=a4-plus,a5-transverse,jis-b5-transverse,a3-extra,a5-extra,b5-extra,a2,a3-transverse,a3-extra-transverse +end + +constlist=PAGESETUP-SCALETOPAGES + default= + 0=automatic +end + +combilist=PAGESETUP-FLAGS + 0x0001=print-in-rows + 0x0002=landscape + 0x0004=uninitialized + 0x0008=black-and-white + 0x0010=draft-quality + 0x0020=print-notes + 0x0040=default-orientation + 0x0080=use-first-page + 0x0100=print-notes-at-end + 0x0600=uint8,dec,print-errors,PAGESETUP-PRINTERRORS +end + +shortlist=PAGESETUP-PRINTERRORS,0,displayed,none,as-dashes,as-na + +unitconverter=PAGESETUP-DPI,1,dpi + +# PANE ----------------------------------------------------------------------- + +shortlist=PANE-ID,0,bottom-right,top-right,bottom-left,top-left + +flagslist=PANE-FLAGS + 0x01=frozen + 0x02=remove-split-with-freeze +end + +# PCDEFINITION --------------------------------------------------------------- + +flagslist=PCDEFINITION-FLAGS1 + 0x01=save-data + 0x02=invalid + 0x04=refresh-on-load + 0x08=optimize-memory + 0x10=enable-refresh + 0x20=background-query + 0x40=upgrade-on-refresh + 0x80=tuple-cache +end + +constlist=PCDEFINITION-MISSINGITEMS + default= + -1=clear-automatic + 0=clear-always +end + +flagslist=PCDEFINITION-FLAGS2 + 0x01=has-username + 0x02=has-rel-id + 0x04=support-subquery + 0x08=support-drilldown +end + +# PCDFIELD ------------------------------------------------------------------- + +flagslist=PCDFIELD-FLAGS + 0x0001=server-field + 0x0002=no-unique-items + 0x0004=database-field + 0x0008=has-caption + 0x0010=member-property-field + 0x0100=has-formula + 0x0200=has-property-name +end + +# PCDFRANGEPR ---------------------------------------------------------------- + +shortlist=PCDFRANGEPR-GROUPBY,0,numeric,seconds,minutes,hours,days,months,quarters,years + +flagslist=PCDFRANGEPR-FLAGS + 0x01=auto-start + 0x02=auto-end + 0x04=date-group +end + +# PCDFSHAREDITEMS ------------------------------------------------------------ + +flagslist=PCDFSHAREDITEMS-FLAGS + 0x0001=has-semi-mixed-types + 0x0002=has-non-date + 0x0004=has-date + 0x0008=has-string-bool-err + 0x0010=has-blank + 0x0020=has-mixed-types + 0x0040=is-numeric + 0x0080=is-integer + 0x0100=has-min-max + 0x0200=long-text +end + +# PCDSOURCE ------------------------------------------------------------------ + +shortlist=PCDSOURCE-TYPE,0,worksheet,external,consolidation,scenario + +# PCDWORKSHEETSOURCE --------------------------------------------------------- + +flagslist=PCDWORKSHEETSOURCE-FLAGS + 0x01=has-rel-id + 0x02=has-sheet +end + +# PCITEM_ARRAY --------------------------------------------------------------- + +constlist=PCITEM_ARRAY-TYPE + 0x0001=double + 0x0002=string + 0x0010=error + 0x0020=date +end + +# PHONETICPR ----------------------------------------------------------------- + +shortlist=PHONETICPR-TYPE,0,halfwidth-katakana,fullwidth-katakana,hiragana,no-conversion +shortlist=PHONETICPR-ALIGNMENT,0,no-control,left,center,distributed + +# PIVOTAREA ------------------------------------------------------------------ + +shortlist=PIVOTAREA-TYPE,0,none,normal,data,all,origin,button,top-right + +flagslist=PIVOTAREA-FLAGS1 + 0x01=data-only + 0x02=label-only + 0x04=grand-row + 0x08=grand-col + 0x10=cache-based + 0x20=line-mode + 0x40=part + 0x80=fuzzy +end + +combilist=PIVOTAREA-FLAGS2 + 0x0001=row + 0x0002=col + 0x0004=page + 0x0008=data + 0x0FF0=uint8,dec,pos-on-axis +end + +# PRINTOPTIONS --------------------------------------------------------------- + +flagslist=PRINTOPTIONS-FLAGS + 0x0001=horizontal-centered + 0x0002=vertical-centered + 0x0004=print-headings + 0x0008=print-gridlines + 0x0010=gridlines-set +end + +# Pivot table globals -------------------------------------------------------- + +constlist=PT-FIELDINDEX + default= + -2=data-field +end + +# PTDATAFIELD ---------------------------------------------------------------- + +shortlist=PTDATAFIELD-SUBTOTAL,0,sum,count-all,average,max,min,product,count-num,std-dev,std-dev-p,var,var-p +shortlist=PTDATAFIELD-SHOWDATAAS,0,normal,difference,percent,percent-diff,run-total,percent-of-row,percent-of-col,percent-of-total,index + +constlist=PTDATAFIELD-BASEITEM + default= + 0x001000FC=previous-item + 0x001000FD=next-item +end + +# PTDEFINITION --------------------------------------------------------------- + +flagslist=PTDEFINITION-FLAGS1 + 0x01=show-items + 0x02=edit-data + 0x04=disable-field-list + 0x08=refresh-on-load + 0x10=hide-calc-members + 0x20=with-hidden-totals + 0x40=show-multiple-label +end + +combilist=PTDEFINITION-FLAGS2 + 0x0001=hide-data-drop-down + 0x0010=hide-drill + 0x0020=print-drill + 0x0040=show-member-prop-tips + 0x0080=hide-data-tips + 0x7F00=uint8,dec,indent + 0x8000=hide-headers +end + +flagslist=PTDEFINITION-FLAGS3 + ignore=0x00010000 + 0x00000001=hide-drop-zones + 0x00000002=no-asterisk-totals + 0x00000004=show-empty-row + 0x00000008=show-empty-col + 0x00000010=enable-wizard + 0x00000020=enable-drill + 0x00000040=enable-field-props + 0x00000080=preserve-formatting + 0x00000100=use-auto-formatting + 0x00000200=show-error + 0x00000400=show-missing + 0x00000800=page-over-then-down + 0x00001000=multiple-page-items + 0x00002000=row-grand-totals + 0x00004000=col-grand-totals + 0x00008000=field-print-titles + 0x00020000=item-print-titles + 0x00040000=merge-item + 0x00080000=has-data-caption + 0x00100000=has-grand-total-caption + 0x00200000=has-page-field-style + 0x00400000=has-pivot-table-style + 0x00800000=has-vacated-style + 0x01000000=apply-num-fmt + 0x02000000=apply-font + 0x04000000=apply-alignment + 0x08000000=apply-border + 0x10000000=apply-fill + 0x20000000=apply-protection + 0x40000000=has-tag +end + +flagslist=PTDEFINITION-FLAGS4 + 0x00000001=compact + 0x00000002=outline + 0x00000004=outline-data + 0x00000008=compact-data + 0x00000010=no-grid-drop-zones + 0x00000020=published + 0x00000040=!has-error-caption + 0x00000080=!has-missing-caption + 0x00000100=immersive-off + 0x00000200=single-field-filters + 0x00000400=has-row-header-caption + 0x00000800=has-col-header-caption + 0x00001000=field-list-sort-asc + 0x00004000=no-custom-list-sort +end + +shortlist=PTDEFINITION-DATAFIELD-AXIS,1,row-axis,col-axis + +constlist=PTDEFINITION-DATAFIELD-POS + default= + -1=append +end + +# PTFIELD -------------------------------------------------------------------- + +flagslist=PTFIELD-FLAGS1 + 0x00000001=row + 0x00000002=col + 0x00000004=page + 0x00000008=data + 0x00000100=default + 0x00000200=sum + 0x00000400=count-all + 0x00000800=average + 0x00001000=max + 0x00002000=min + 0x00004000=product + 0x00008000=count-num + 0x00010000=std-dev + 0x00020000=std-dev-p + 0x00040000=variance + 0x00080000=variance-p + 0x01000000=drilled-level + 0x02000000=hide-dropdown + 0x04000000=hidden-level + 0x08000000=has-member-prop-caption + 0x10000000=compact + 0x20000000=has-display-name + 0x40000000=has-subtotal-caption + 0x80000000=source-ordered +end + +flagslist=PTFIELD-FLAGS2 + 0x00000001=drag-to-row + 0x00000002=drag-to-col + 0x00000004=drag-to-page + 0x00000008=drag-to-hide + 0x00000010=drag-to-data + 0x00000020=show-all-items + 0x00000040=outline + 0x00000080=insert-blank-row + 0x00000100=subtotal-top + 0x00000200=server-based + 0x00000800=insert-page-break + 0x00001000=autosort + 0x00002000=ascend-sort + 0x00004000=autoshow + 0x00008000=autoshow-top + 0x00010000=hide-new-items + 0x00020000=has-value-filter + 0x00040000=exclude-new-items + 0x00080000=multiple-page-items + 0x00100000=simple-data-sort + 0x00200000=show-member-prop-report + 0x00400000=show-member-prop-tooltip + 0x00800000=show-member-prop-caption + 0x01000000=items-drilled +end + +# PTFILTER ------------------------------------------------------------------- + +multilist=PTFILTER-TYPE + 0=unknown,count,percent,sum,caption-equal,caption-not-equal,caption-begins-width,caption-not-begins-with,caption-ends-width,caption-not-ends-with + 10=caption-contains,caption-not-contains,caption-greater-than,caption-greater-equal,caption-less-than,caption-less-equal,caption-between,caption-not-between,value-equal,value-not-equal + 20=value-greater-than,value-greater-equal,value-less-than,value-less-equal,value-between,value-not-between,date-equal,date-older-than,date-newer-than,date-between + 30=date-tomorrow,date-today,date-yesterday,date-next-week,date-this-week,date-last-week,date-next-month,date-this-month,date-last-month,date-next-quarter + 40=date-this-quarter,date-last-quarter,date-next-year,date-this-year,date-last-year,year-to-date,date-q1,date-q2,date-q3,date-q4 + 50=date-jan,date-feb,date-mar,date-apr,date-may,date-jun,date-jul,date-aug,date-sep,date-oct + 60=date-nov,date-dec,date-not-equal,date-older-equal,date-newer-equal,date-not-between +end + +flagslist=PTFILTER-FLAGS + 0x0001=has-name + 0x0002=has-description + 0x0004=has-str-value1 + 0x0008=has-str-value2 +end + +# PTFITEM -------------------------------------------------------------------- + +shortlist=PTFITEM-TYPE,0,data,default,sum,count-all,average,max,min,product,count-numbers,std-dev,std-dev-p,var,var-p,grand-total,blank + +flagslist=PTFITEM-FLAGS + 0x0001=hidden + 0x0002=hide-detail + 0x0004=calculated + 0x0008=missing + 0x0010=has-name + 0x0020=drilled-member + 0x0040=can-have-children + 0x0080=collapsed-member + 0x0100=olap-filter-selected +end + +# PTPAGEFIELD ---------------------------------------------------------------- + +constlist=PTPAGEFIELD-ITEM + default= + 0x001000FE=multiple-items +end + +flagslist=PTPAGEFIELD-FLAGS + 0x01=has-unique-name + 0x02=has-member-caption +end + +# PTREFERENCE ---------------------------------------------------------------- + +flagslist=PTREFERENCE-FLAGS1 + 0x0001=data + 0x0002=default + 0x0004=sum + 0x0008=count-all + 0x0010=average + 0x0020=max + 0x0040=min + 0x0080=product + 0x0100=count-num + 0x0200=std-dev + 0x0400=std-dev-p + 0x0800=variance + 0x1000=variance-p +end + +flagslist=PTREFERENCE-FLAGS2 + 0x01=selected +end + +# QUERYTABLE ----------------------------------------------------------------- + +combilist=QUERYTABLE-FLAGS + 0x00000001=headers + 0x00000002=row-numbers + 0x00000004=disable-refresh + 0x00000008=background + 0x00000010=first-background + 0x00000020=refresh-on-load + 0x000000C0=uint8,dec,grow-shrink,QUERYTABLE-GROWSHRINK + 0x00000100=fill-formulas + 0x00000200=save-data + 0x00000400=disable-edit + 0x00000800=preserve-formatting + 0x00001000=adjust-column-width + 0x00002000=intermediate + 0x00004000=apply-num-fmt + 0x00008000=apply-font + 0x00010000=apply-alignment + 0x00020000=apply-border + 0x00040000=apply-fill + 0x00080000=apply-protection +end + +shortlist=QUERYTABLE-GROWSHRINK,0,insert-clear,insert-delete,overwrite-clear + +# ROW ------------------------------------------------------------------------ + +combilist=ROW-FLAGS1 + 0x0001=thick-top + 0x0002=thick-bottom + 0x0700=uint8,dec,outline-level + 0x0800=outline-collapsed + 0x1000=hidden + 0x2000=custom-height + 0x4000=custom-format +end + +flagslist=ROW-FLAGS2 + 0x01=show-phonetic +end + +# SHEET ---------------------------------------------------------------------- + +shortlist=SHEET-STATE,0,visible,hidden,very-hidden + +# SHEETCALCPR ---------------------------------------------------------------- + +flagslist=SHEETCALCPR-FLAGS + 0x01=calc-on-load +end + +# SHEETFORMATPR -------------------------------------------------------------- + +flagslist=SHEETFORMATPR-FLAGS + 0x0001=custom-row-height + 0x0002=rows-hidden +end + +# SHEETPR -------------------------------------------------------------------- + +flagslist=SHEETPR-FLAGS1 + 0x0001=show-autopagebreaks + 0x0008=published + 0x0010=dialog-sheet + 0x0020=outline-auto-style + 0x0040=row-symbols-below + 0x0080=column-symbols-right + 0x0100=fit-to-pages + 0x0400=show-outline-symbols + 0x1000=is-row-synched + 0x2000=is-col-synched + 0x4000=lotus-formula-eval + 0x8000=lotus-formula-entry +end + +flagslist=SHEETPR-FLAGS2 + 0x01=is-filtered + 0x02=eval-cond-formats +end + +# SHEETVIEW ------------------------------------------------------------------ + +flagslist=SHEETVIEW-FLAGS + 0x0001=window-protected + 0x0002=show-formulas + 0x0004=show-gridlines + 0x0008=show-headings + 0x0010=show-zeros + 0x0020=right-to-left + 0x0040=selected + 0x0080=show-ruler + 0x0100=show-outline-symbols + 0x0200=default-gridcolor + 0x0400=show-whitespace +end + +shortlist=SHEETVIEW-TYPE,0,normal,pagebreak-preview,page-layout + +# TABLE ---------------------------------------------------------------------- + +shortlist=TABLE-TYPE,0,worksheet,,,query-table + +flagslist=TABLE-FLAGS + 0x00000001=totals-row-shown + 0x00000002=published + 0x00000004=insert-row + 0x00000008=insert-row-shift +end + +# TABLESTYLEINFO ------------------------------------------------------------- + +flagslist=TABLESTYLEINFO-FLAGS + 0x0001=show-first-column + 0x0002=show-last-column + 0x0004=show-row-stripes + 0x0008=show-column-stripes + 0x0010=show-row-headers + 0x0020=show-column-headers +end + +# TOP10FILTER ---------------------------------------------------------------- + +flagslist=TOP10FILTER-FLAGS + 0x01=!bottom!top + 0x02=percent + 0x04=applied +end + +# VOLTYPE -------------------------------------------------------------------- + +shortlist=VOLTYPE-TYPE,0,realtime-data,olap-functions + +# WEBPR ---------------------------------------------------------------------- + +combilist=WEBPR-FLAGS + 0x000000FF=uint8,dec,html-format,WEBPR-HTMLFORMAT + 0x00000100=xml + 0x00000200=source-data + 0x00000400=parse-pre + 0x00000800=consecutive-delimiters + 0x00001000=first-row + 0x00002000=xl97-created + 0x00004000=text-dates + 0x00008000=xl2000-refreshed + 0x00010000=html-tables +end + +shortlist=WEBPR-HTMLFORMAT,0,none,rtf,all + +flagslist=WEBPR-STRINGFLAGS + 0x01=has-post-method + 0x02=has-edit-page + 0x04=has-url +end + +# WORKBBOKPR ----------------------------------------------------------------- + +combilist=WORKBBOKPR-FLAGS + 0x00000001=date-1904 + 0x00000004=hide-border-unsel-tables + 0x00000008=filter-privacy + 0x00000010=prompted-solutions + 0x00000020=show-ink-annotation + 0x00000040=backup-file + 0x00000080=strip-extlink-values + 0x00000300=uint8,dec,update-links,WORKBBOKPR-UPDATELINKS + 0x00000400=hide-pivot-fieldlist + 0x00000800=publish-items + 0x00001000=check-compatibility + 0x00006000=uint8,dec,show-objects,WORKBBOKPR-SHOWOBJECTS + 0x00008000=show-pivotchart-filter + 0x00010000=autocompress-pic + 0x00020000=refresh-all-links +end + +shortlist=WORKBBOKPR-UPDATELINKS,0,ask-user,never,always +shortlist=WORKBBOKPR-SHOWOBJECTS,0,show,placeholder,hide + +# WORKBOOKVIEW --------------------------------------------------------------- + +flagslist=WORKBOOKVIEW-FLAGS + 0x01=hidden + 0x02=minimized + 0x08=show-horizontal-scroll + 0x10=show-vertical-scroll + 0x20=show-tabbar + 0x40=autofilter-date-grouping +end + +# XF ------------------------------------------------------------------------- + +shortlist=XF-HORALIGN,0,general,left,center,right,fill,block,center-across-sel,distribute +shortlist=XF-VERALIGN,0,top,center,bottom,justify,distribute +shortlist=XF-TEXTDIRECTION,0,context,left-to-right,right-to-left + +combilist=XF-ALIGNMENT + 0x000000FF=uint8,dec,rotation,TEXTROTATION + 0x0000FF00=uint8,dec,indent + 0x00070000=uint8,dec,hor-align,XF-HORALIGN + 0x00380000=uint8,dec,ver-align,XF-VERALIGN + 0x00400000=text-wrap + 0x00800000=justify-lastline + 0x01000000=shrink-to-fit + 0x0C000000=uint8,dec,text-dir,XF-TEXTDIRECTION + 0x10000000=locked + 0x20000000=formula-hidden + 0x80000000=quote-prefix +end + +flagslist=XF-USEDFLAGS + 0x0001=format + 0x0002=font + 0x0004=alignment + 0x0008=border + 0x0010=fill + 0x0020=protection +end + +# ============================================================================ diff --git a/oox/source/export/ColorPropertySet.cxx b/oox/source/export/ColorPropertySet.cxx new file mode 100644 index 000000000..a0998f195 --- /dev/null +++ b/oox/source/export/ColorPropertySet.cxx @@ -0,0 +1,178 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +// FIXME? This file is nearly identical to xmloff/source/chart/ColorPropertySet.cxx + +#include "ColorPropertySet.hxx" + +#include +#include +#include + +using namespace ::com::sun::star; +using namespace ::com::sun::star::beans; + +using ::com::sun::star::uno::Reference; +using ::com::sun::star::uno::Sequence; + +namespace +{ +class lcl_ColorPropertySetInfo : public ::cppu::WeakImplHelper< + XPropertySetInfo > +{ +public: + explicit lcl_ColorPropertySetInfo( bool bFillColor ); + +protected: + // ____ XPropertySetInfo ____ + virtual Sequence< Property > SAL_CALL getProperties() override; + virtual Property SAL_CALL getPropertyByName( const OUString& aName ) override; + virtual sal_Bool SAL_CALL hasPropertyByName( const OUString& Name ) override; + +private: + OUString m_aColorPropName; + Property m_aColorProp; +}; + +lcl_ColorPropertySetInfo::lcl_ColorPropertySetInfo( bool bFillColor ) : + // note: length of FillColor and LineColor is 9 + m_aColorPropName( (bFillColor ? "FillColor" : "LineColor"), 9, RTL_TEXTENCODING_ASCII_US ), + m_aColorProp( m_aColorPropName, -1, + cppu::UnoType::get(), 0) +{} + +Sequence< Property > SAL_CALL lcl_ColorPropertySetInfo::getProperties() +{ + + return Sequence< Property >( & m_aColorProp, 1 ); +} + +Property SAL_CALL lcl_ColorPropertySetInfo::getPropertyByName( const OUString& aName ) +{ + if( aName == m_aColorPropName ) + return m_aColorProp; + throw UnknownPropertyException( m_aColorPropName, static_cast< uno::XWeak * >( this )); +} + +sal_Bool SAL_CALL lcl_ColorPropertySetInfo::hasPropertyByName( const OUString& Name ) +{ + return Name == m_aColorPropName; +} + +} // anonymous namespace + +namespace oox::drawingml +{ + +ColorPropertySet::ColorPropertySet( ::Color nColor, bool bFillColor /* = true */ ) : + // note: length of FillColor and LineColor is 9 + m_aColorPropName( (bFillColor ? "FillColor" : "LineColor"), 9, RTL_TEXTENCODING_ASCII_US ), + m_nColor( nColor ), + m_bIsFillColor( bFillColor ), + m_nDefaultColor( 0x0099ccff ) // blue 8 +{} + +ColorPropertySet::~ColorPropertySet() +{} + +// ____ XPropertySet ____ + +Reference< XPropertySetInfo > SAL_CALL ColorPropertySet::getPropertySetInfo() +{ + if( ! m_xInfo.is()) + m_xInfo.set( new lcl_ColorPropertySetInfo( m_bIsFillColor )); + + return m_xInfo; +} + +void SAL_CALL ColorPropertySet::setPropertyValue( const OUString& rPropertyName, const uno::Any& aValue ) +{ + if (rPropertyName != m_aColorPropName) + { + // trying to catch these cases in the next crash testing + assert(false); + return; + } + + aValue >>= m_nColor; +} + +uno::Any SAL_CALL ColorPropertySet::getPropertyValue( const OUString& aPropertyName ) +{ + if( aPropertyName == "FillStyle" && m_bIsFillColor ) + { + return uno::Any(css::drawing::FillStyle_SOLID); + } + else if (aPropertyName == m_aColorPropName) + return uno::Any( m_nColor ); + + throw UnknownPropertyException(aPropertyName); +} + +void SAL_CALL ColorPropertySet::addPropertyChangeListener( const OUString& /* aPropertyName */, const Reference< XPropertyChangeListener >& /* xListener */ ) +{ + OSL_FAIL( "Not Implemented" ); +} + +void SAL_CALL ColorPropertySet::removePropertyChangeListener( const OUString& /* aPropertyName */, const Reference< XPropertyChangeListener >& /* aListener */ ) +{ + OSL_FAIL( "Not Implemented" ); +} + +void SAL_CALL ColorPropertySet::addVetoableChangeListener( const OUString& /* PropertyName */, const Reference< XVetoableChangeListener >& /* aListener */ ) +{ + OSL_FAIL( "Not Implemented" ); +} + +void SAL_CALL ColorPropertySet::removeVetoableChangeListener( const OUString& /* PropertyName */, const Reference< XVetoableChangeListener >& /* aListener */ ) +{ + OSL_FAIL( "Not Implemented" ); +} + +// ____ XPropertyState ____ + +PropertyState SAL_CALL ColorPropertySet::getPropertyState( const OUString& /* PropertyName */ ) +{ + return PropertyState_DIRECT_VALUE; +} + +Sequence< PropertyState > SAL_CALL ColorPropertySet::getPropertyStates( const Sequence< OUString >& /* aPropertyName */ ) +{ + PropertyState aState = PropertyState_DIRECT_VALUE; + // coverity[overrun-buffer-arg : FALSE] - coverity has difficulty with css::uno::Sequence + return Sequence(&aState, 1); +} + +void SAL_CALL ColorPropertySet::setPropertyToDefault( const OUString& PropertyName ) +{ + if( PropertyName == m_aColorPropName ) + m_nColor = m_nDefaultColor; +} + +uno::Any SAL_CALL ColorPropertySet::getPropertyDefault( const OUString& aPropertyName ) +{ + if( aPropertyName == m_aColorPropName ) + return uno::Any( m_nDefaultColor ); + + return uno::Any(); +} + +} // namespace oox::drawingml + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/export/ColorPropertySet.hxx b/oox/source/export/ColorPropertySet.hxx new file mode 100644 index 000000000..70213a731 --- /dev/null +++ b/oox/source/export/ColorPropertySet.hxx @@ -0,0 +1,87 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef XMLOFF_COLORPROPERTYSET_HXX +#define XMLOFF_COLORPROPERTYSET_HXX + +// FIXME? this file is identical to xmloff/source/chart/ColorPropertySet.hxx + +#include +#include + +#include +#include + +namespace oox::drawingml +{ + +class ColorPropertySet : public ::cppu::WeakImplHelper< + css::beans::XPropertySet, + css::beans::XPropertyState > +{ +public: + // if bFillColor == false, the color is a LineColor + explicit ColorPropertySet( ::Color nColor, bool bFillColor = true ); + virtual ~ColorPropertySet() override; + +protected: + // ____ XPropertySet ____ + virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override; + virtual void SAL_CALL setPropertyValue( + const OUString& aPropertyName, + const css::uno::Any& aValue ) override; + virtual css::uno::Any SAL_CALL getPropertyValue( + const OUString& PropertyName ) override; + virtual void SAL_CALL addPropertyChangeListener( + const OUString& aPropertyName, + const css::uno::Reference< css::beans::XPropertyChangeListener >& xListener ) override; + virtual void SAL_CALL removePropertyChangeListener( + const OUString& aPropertyName, + const css::uno::Reference< css::beans::XPropertyChangeListener >& aListener ) override; + virtual void SAL_CALL addVetoableChangeListener( + const OUString& PropertyName, + const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override; + virtual void SAL_CALL removeVetoableChangeListener( + const OUString& PropertyName, + const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override; + + // ____ XPropertyState ____ + virtual css::beans::PropertyState SAL_CALL getPropertyState( + const OUString& PropertyName ) override; + virtual css::uno::Sequence< css::beans::PropertyState > SAL_CALL getPropertyStates( + const css::uno::Sequence< OUString >& aPropertyName ) override; + virtual void SAL_CALL setPropertyToDefault( + const OUString& PropertyName ) override; + virtual css::uno::Any SAL_CALL getPropertyDefault( + const OUString& aPropertyName ) override; + +private: + css::uno::Reference< css::beans::XPropertySetInfo > m_xInfo; + OUString m_aColorPropName; + ::Color m_nColor; + bool m_bIsFillColor; + ::Color m_nDefaultColor; +}; + +} // namespace xmloff::chart + +// XMLOFF_COLORPROPERTYSET_HXX +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/export/DMLPresetShapeExport.cxx b/oox/source/export/DMLPresetShapeExport.cxx new file mode 100644 index 000000000..a2d08ec3e --- /dev/null +++ b/oox/source/export/DMLPresetShapeExport.cxx @@ -0,0 +1,1658 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* +* This file is part of the LibreOffice project. +* +* This Source Code Form is subject to the terms of the Mozilla Public +* License, v. 2.0. If a copy of the MPL was not distributed with this +* file, You can obtain one at http://mozilla.org/MPL/2.0/. +*/ + +#include +#include + +#include +#include +#include +#include +#include + +#include +#include + +#include + +using namespace ::css; +using namespace ::css::drawing; + +namespace oox::drawingml +{ +// DMLPresetShapeExporter class + +// ctor +DMLPresetShapeExporter::DMLPresetShapeExporter(DrawingML* pDMLExporter, + css::uno::Reference xShape) + : m_pDMLexporter(pDMLExporter) +{ + // This class only work with custom shapes! + OSL_ASSERT(xShape->getShapeType() == "com.sun.star.drawing.CustomShape"); + + m_xShape = xShape; + m_bHasHandleValues = false; + uno::Reference xShapeProps(m_xShape, uno::UNO_QUERY); + css::uno::Sequence aCustomShapeGeometry + = xShapeProps->getPropertyValue("CustomShapeGeometry") + .get>(); + + for (sal_uInt32 i = 0; i < aCustomShapeGeometry.size(); i++) + { + if (aCustomShapeGeometry[i].Name == "Type") + { + m_sPresetShapeType = aCustomShapeGeometry[i].Value.get(); + } + if (aCustomShapeGeometry[i].Name == "Handles") + { + m_bHasHandleValues = true; + m_HandleValues + = aCustomShapeGeometry[i] + .Value + .get>>(); + } + if (aCustomShapeGeometry[i].Name == "AdjustmentValues") + { + m_AdjustmentValues + = aCustomShapeGeometry[i] + .Value + .get>(); + } + if (aCustomShapeGeometry[i].Name == "MirroredX") + { + m_bIsFlipped.first = aCustomShapeGeometry[i].Value.get(); + } + if (aCustomShapeGeometry[i].Name == "MirroredY") + { + m_bIsFlipped.second = aCustomShapeGeometry[i].Value.get(); + } + //if (aCustomShapeGeometry[i].Name == "Equations") + //{ + // m_Equations = aCustomShapeGeometry[i].Value.get>(); + //} + //if (aCustomShapeGeometry[i].Name == "Path") + //{ + // m_Path = aCustomShapeGeometry[i] + // .Value.get>(); + //} + //if (aCustomShapeGeometry[i].Name == "ViewBox") + //{ + // m_ViewBox = aCustomShapeGeometry[i].Value.get(); + //} + } +}; + +// dtor +DMLPresetShapeExporter::~DMLPresetShapeExporter(){ + // Do nothing +}; + +bool DMLPresetShapeExporter::HasHandleValue() const { return m_bHasHandleValues; } + +const OUString& DMLPresetShapeExporter::GetShapeType() const { return m_sPresetShapeType; } + +const css::uno::Sequence>& +DMLPresetShapeExporter::GetHandleValues() const +{ + return m_HandleValues; +}; + +const css::uno::Sequence& +DMLPresetShapeExporter::GetAdjustmentValues() const +{ + return m_AdjustmentValues; +}; + +css::uno::Any DMLPresetShapeExporter::GetHandleValueOfModificationPoint(sal_Int32 nPoint, + std::u16string_view sType) +{ + uno::Any aRet; + if (GetHandleValues().getLength() > nPoint) + { + for (sal_Int32 i = 0; i < GetHandleValues()[nPoint].getLength(); i++) + { + if (GetHandleValues()[nPoint][i].Name == sType) + { + aRet = GetHandleValues()[nPoint][i].Value; + break; + } + } + } + return aRet; +}; + +DMLPresetShapeExporter::RadiusAdjustmentValue +DMLPresetShapeExporter::GetAdjustmentPointRadiusValue(sal_Int32 nPoint) +{ + RadiusAdjustmentValue aRet; + try + { + auto aValPos = GetHandleValueOfModificationPoint(nPoint, u"Position") + .get(); + aRet.nMinVal = GetHandleValueOfModificationPoint(nPoint, u"RadiusRangeMinimum") + .get() + .Value.get(); + aRet.nMaxVal = GetHandleValueOfModificationPoint(nPoint, u"RadiusRangeMaximum") + .get() + .Value.get(); + aRet.nCurrVal = GetAdjustmentValues()[aValPos.First.Value.get()].Value.get(); + } + catch (...) + { + // Do nothing. + } + return aRet; +}; + +DMLPresetShapeExporter::AngleAdjustmentValue +DMLPresetShapeExporter::GetAdjustmentPointAngleValue(sal_Int32 nPoint) +{ + AngleAdjustmentValue aRet; + try + { + auto aValPos = GetHandleValueOfModificationPoint(nPoint, u"Position") + .get(); + aRet.nMinVal = 0; + aRet.nMaxVal = 360; + aRet.nCurrVal = GetAdjustmentValues()[aValPos.Second.Value.get()].Value.get(); + } + catch (...) + { + // Do nothing. + } + return aRet; +}; + +DMLPresetShapeExporter::XAdjustmentValue +DMLPresetShapeExporter::GetAdjustmentPointXValue(sal_Int32 nPoint) +{ + XAdjustmentValue aRet; + try + { + auto aValPos = GetHandleValueOfModificationPoint(nPoint, u"Position") + .get(); + aRet.nMinVal = GetHandleValueOfModificationPoint(nPoint, u"RangeXMinimum") + .get() + .Value.get(); + aRet.nMaxVal = GetHandleValueOfModificationPoint(nPoint, u"RangeXMaximum") + .get() + .Value.get(); + aRet.nCurrVal = GetAdjustmentValues()[aValPos.First.Value.get()].Value.get(); + } + catch (...) + { + // Do nothing. + } + return aRet; +}; + +DMLPresetShapeExporter::YAdjustmentValue +DMLPresetShapeExporter::GetAdjustmentPointYValue(sal_Int32 nPoint) +{ + YAdjustmentValue aRet; + try + { + auto aValPos = GetHandleValueOfModificationPoint(nPoint, u"Position") + .get(); + aRet.nMinVal = GetHandleValueOfModificationPoint(nPoint, u"RangeYMinimum") + .get() + .Value.get(); + aRet.nMaxVal = GetHandleValueOfModificationPoint(nPoint, u"RangeYMaximum") + .get() + .Value.get(); + aRet.nCurrVal = GetAdjustmentValues()[aValPos.Second.Value.get()].Value.get(); + } + catch (...) + { + // Do nothing. + } + return aRet; +}; + +bool DMLPresetShapeExporter::WriteShape() +{ + if (m_pDMLexporter && m_xShape) + { + // Case 1: We do not have adjustment points of the shape: just export it as preset + if (!m_bHasHandleValues) + { + OUString sShapeType = GetShapeType(); + const OString& sPresetShape = msfilter::util::GetOOXMLPresetGeometry(sShapeType); + m_pDMLexporter->WriteShapeTransformation(m_xShape, XML_a, IsXFlipped(), IsYFlipped(), + false, false); + m_pDMLexporter->WritePresetShape(sPresetShape); + return true; + } + else // Case2: There are adjustment points what have to be converted and exported. + { + return WriteShapeWithAVlist(); + } + } + return false; +}; + +bool DMLPresetShapeExporter::WriteAV(const OUString& sValName, const OUString& sVal) +{ + try + { + m_pDMLexporter->GetFS()->singleElementNS(XML_a, XML_gd, XML_name, sValName, XML_fmla, sVal); + return true; + } + catch (...) + { + return false; + } +}; + +bool DMLPresetShapeExporter::StartAVListWriting() +{ + try + { + const OString& pShape = msfilter::util::GetOOXMLPresetGeometry(GetShapeType()); + m_pDMLexporter->GetFS()->startElementNS(XML_a, XML_prstGeom, XML_prst, pShape); + m_pDMLexporter->GetFS()->startElementNS(XML_a, XML_avLst); + return true; + } + catch (...) + { + return false; + } +}; +bool DMLPresetShapeExporter::EndAVListWriting() +{ + try + { + m_pDMLexporter->GetFS()->endElementNS(XML_a, XML_avLst); + m_pDMLexporter->GetFS()->endElementNS(XML_a, XML_prstGeom); + return true; + } + catch (...) + { + return false; + } +}; + +bool DMLPresetShapeExporter::WriteShapeWithAVlist() +{ + // Remark: This method is under development. If a shape type is implemented, the corresponding, + // return must be set to true. False means nothing done true, export done. There are many + // types which do not have pairs in LO, they are do not have to be mapped, because import + // filter it does with GrabBag, this method only maps the SDR ones to OOXML shapes. + + OString sShapeType(msfilter::util::GetOOXMLPresetGeometry(GetShapeType())); + + // OOXML uses 60th of degree, so 360 degree is 21 600 000 60thdeg + const tools::Long nConstOfMaxDegreeOf60th = 21600000; + try + { + if (sShapeType == "accentBorderCallout1") + { + // LO does not have this type, so it does not necessary to be mapped. + return false; + } + if (sShapeType == "accentBorderCallout2") + { + // LO does not have this type, so it does not necessary to be mapped. + return false; + } + if (sShapeType == "accentBorderCallout3") + { + // LO does not have this type, so it does not necessary to be mapped. + return false; + } + if (sShapeType == "accentCallout1") + { + // LO does not have this type, so it does not necessary to be mapped. + return false; + } + if (sShapeType == "accentCallout2") + { + // LO does not have this type, so it does not necessary to be mapped. + return false; + } + if (sShapeType == "accentCallout3") + { + // LO does not have this type, so it does not necessary to be mapped. + return false; + } + if (sShapeType == "actionButtonBackPrevious") + { + // LO does not have this type, so it does not necessary to be mapped. + return false; + } + if (sShapeType == "actionButtonBeginning") + { + // LO does not have this type, so it does not necessary to be mapped. + return false; + } + if (sShapeType == "actionButtonBlank") + { + // LO does not have this type, so it does not necessary to be mapped. + return false; + } + if (sShapeType == "actionButtonDocument") + { + // LO does not have this type, so it does not necessary to be mapped. + return false; + } + if (sShapeType == "actionButtonEnd") + { + // LO does not have this type, so it does not necessary to be mapped. + return false; + } + if (sShapeType == "actionButtonForwardNext") + { + // LO does not have this type, so it does not necessary to be mapped. + return false; + } + if (sShapeType == "actionButtonHelp") + { + // LO does not have this type, so it does not necessary to be mapped. + return false; + } + if (sShapeType == "actionButtonHome") + { + // LO does not have this type, so it does not necessary to be mapped. + return false; + } + if (sShapeType == "actionButtonInformation") + { + // LO does not have this type, so it does not necessary to be mapped. + return false; + } + if (sShapeType == "actionButtonMovie") + { + // LO does not have this type, so it does not necessary to be mapped. + return false; + } + if (sShapeType == "actionButtonReturn") + { + // LO does not have this type, so it does not necessary to be mapped. + return false; + } + if (sShapeType == "actionButtonSound") + { + // LO does not have this type, so it does not necessary to be mapped. + return false; + } + if (sShapeType == "arc") + { + // LO does not have handle points for this, so CustGeom is enough. + return false; + } + if (sShapeType == "bentArrow") + { + // LO has only one type, which have to be rotated, without handling points + // So CustGeom enough. + return false; + } + if (sShapeType == "bentConnector2") + { + // CustGeom Enough + return false; + } + if (sShapeType == "bentConnector3") + { + // CustGeom Enough + return false; + } + if (sShapeType == "bentConnector4") + { + // CustGeom Enough + return false; + } + if (sShapeType == "bentConnector5") + { + // CustGeom Enough + return false; + } + if (sShapeType == "bentUpArrow") + { + // CustGeom Enough, no handle points + return false; + } + if (sShapeType == "bevel") + { + auto aPoint1 = GetAdjustmentPointXValue(0); + if (!aPoint1.nCurrVal.has_value() || !aPoint1.nMaxVal.has_value() + || !aPoint1.nMinVal.has_value()) + return false; + m_pDMLexporter->WriteShapeTransformation(m_xShape, XML_a, IsXFlipped(), IsYFlipped(), + false, false); + + tools::Long nVal1 + = std::lround(*aPoint1.nCurrVal / (*aPoint1.nMaxVal - *aPoint1.nMinVal) * 50000); + return StartAVListWriting() + && WriteAV(u"adj", OUString(u"val " + OUString::number(nVal1))) + && EndAVListWriting(); + } + if (sShapeType == "blockArc") + { + auto aPointR = GetAdjustmentPointRadiusValue(0); + auto aPointA = GetAdjustmentPointAngleValue(0); + if (!aPointA.nCurrVal.has_value() || !aPointA.nMaxVal.has_value() + || !aPointA.nMinVal.has_value() || !aPointR.nCurrVal.has_value() + || !aPointR.nMaxVal.has_value() || !aPointR.nMinVal.has_value()) + return false; + m_pDMLexporter->WriteShapeTransformation(m_xShape, XML_a, IsXFlipped(), IsYFlipped(), + false, false); + tools::Long nVal1 + = std::lround((*aPointA.nCurrVal < 0 ? 360 + *aPointA.nCurrVal : *aPointA.nCurrVal) + / (*aPointA.nMaxVal - *aPointA.nMinVal) * nConstOfMaxDegreeOf60th); + tools::Long nVal2 = std::lround( + (*aPointA.nCurrVal > 180 ? 360 - *aPointA.nCurrVal : 180 - *aPointA.nCurrVal) + / (*aPointA.nMaxVal - *aPointA.nMinVal) * nConstOfMaxDegreeOf60th); + tools::Long nVal3 = std::lround( + 50000 - (*aPointR.nCurrVal / (*aPointR.nMaxVal - *aPointR.nMinVal) * 50000)); + return StartAVListWriting() + && WriteAV(u"adj1", OUString(u"val " + OUString::number(nVal1))) + && WriteAV(u"adj2", OUString(u"val " + OUString::number(nVal2))) + && WriteAV(u"adj3", OUString(u"val " + OUString::number(nVal3))) + && EndAVListWriting(); + } + if (sShapeType == "borderCallout1") + { + // LO does not have this type, so it does not necessary to be mapped. + return false; + } + if (sShapeType == "borderCallout2") + { + // LO does not have this type, so it does not necessary to be mapped. + return false; + } + if (sShapeType == "borderCallout3") + { + // LO does not have this type, so it does not necessary to be mapped. + return false; + } + if (sShapeType == "bracePair") + { + auto aPoint1 = GetAdjustmentPointYValue(0); + if (!aPoint1.nCurrVal.has_value() || !aPoint1.nMaxVal.has_value() + || !aPoint1.nMinVal.has_value()) + return false; + + m_pDMLexporter->WriteShapeTransformation(m_xShape, XML_a, IsXFlipped(), IsYFlipped(), + false, false); + tools::Long nVal1 + = std::lround(*aPoint1.nCurrVal / (*aPoint1.nMaxVal - *aPoint1.nMinVal) * 25000); + return StartAVListWriting() + && WriteAV(u"adj", OUString(u"val " + OUString::number(nVal1))) + && EndAVListWriting(); + } + if (sShapeType == "bracketPair") + { + auto aPoint1 = GetAdjustmentPointYValue(0); + if (!aPoint1.nCurrVal.has_value() || !aPoint1.nMaxVal.has_value() + || !aPoint1.nMinVal.has_value()) + return false; + + m_pDMLexporter->WriteShapeTransformation(m_xShape, XML_a, IsXFlipped(), IsYFlipped(), + false, false); + tools::Long nVal1 + = std::lround(*aPoint1.nCurrVal / (*aPoint1.nMaxVal - *aPoint1.nMinVal) * 50000); + return StartAVListWriting() + && WriteAV(u"adj", OUString(u"val " + OUString::number(nVal1))) + && EndAVListWriting(); + } + if (sShapeType == "callout1") + { + // LO does not have this type, so it does not necessary to be mapped. + return false; + } + if (sShapeType == "callout2") + { + // LO does not have this type, so it does not necessary to be mapped. + return false; + } + if (sShapeType == "callout3") + { + // LO does not have this type, so it does not necessary to be mapped. + return false; + } + if (sShapeType == "can") + { + return false; + // Do the export as before. + } + if (sShapeType == "chartPlus") + { + // LO does not have this type, so it does not necessary to be mapped. + return false; + } + if (sShapeType == "chartStar") + { + // LO does not have this type, so it does not necessary to be mapped. + return false; + } + if (sShapeType == "chartX") + { + // LO does not have this type, so it does not necessary to be mapped. + return false; + } + if (sShapeType == "chord") + { + // CustGeom, because LO does not have handle points + return false; + } + if (sShapeType == "circularArrow") + { + // LO does not have this type, so it does not necessary to be mapped. + return false; + } + if (sShapeType == "cloud") + { + // CustGeom enough + return false; + } + if (sShapeType == "cloudCallout") + { + return false; + // Works fine without this, so export it like before. + } + if (sShapeType == "cornerTabs") + { + // LO does not have this type, so it does not necessary to be mapped. + return false; + } + if (sShapeType == "cube") + { + // Works fine without this, so export it like before. + return false; + } + if (sShapeType == "curvedConnector2") + { + // Not necessary to be mapped + return false; + } + if (sShapeType == "curvedConnector3") + { + // Not necessary to be mapped + return false; + } + if (sShapeType == "curvedConnector4") + { + // Not necessary to be mapped + return false; + } + if (sShapeType == "curvedConnector5") + { + // Not necessary to be mapped + return false; + } + if (sShapeType == "curvedDownArrow") + { + // LO does not have this type, so it does not necessary to be mapped. + return false; + } + if (sShapeType == "curvedLeftArrow") + { + // LO does not have this type, so it does not necessary to be mapped. + return false; + } + if (sShapeType == "curvedRightArrow") + { + // LO does not have this type, so it does not necessary to be mapped. + return false; + } + if (sShapeType == "curvedUpArrow") + { + // LO does not have this type, so it does not necessary to be mapped. + return false; + } + if (sShapeType == "decagon") + { + // LO does not have this type, so it does not necessary to be mapped. + return false; + } + if (sShapeType == "diagStripe") + { + // LO does not have this type, so it does not necessary to be mapped. + return false; + } + if (sShapeType == "diamond") + { + // It does not have handle points so it do not have to be mapped. + return false; + } + if (sShapeType == "dodecagon") + { + // LO does not have this type, so it does not necessary to be mapped. + return false; + } + if (sShapeType == "donut") + { + // TODO + return false; + } + if (sShapeType == "doubleWave") + { + // LO does not have this type, so it does not necessary to be mapped. + return false; + } + if (sShapeType == "downArrow") + { + auto aPointX = GetAdjustmentPointXValue(0); + auto aPointY = GetAdjustmentPointYValue(0); + if (!aPointX.nCurrVal.has_value() || !aPointX.nMaxVal.has_value() + || !aPointX.nMinVal.has_value() || !aPointY.nCurrVal.has_value() + || !aPointY.nMaxVal.has_value() || !aPointY.nMinVal.has_value()) + return false; + + m_pDMLexporter->WriteShapeTransformation(m_xShape, XML_a, IsXFlipped(), IsYFlipped(), + false, false); + tools::Long nMaxVal1 = 100000; + tools::Long nMaxVal2 + = 100000 * m_xShape->getSize().Height + / std::min(m_xShape->getSize().Width, m_xShape->getSize().Height); + tools::Long nVal1 = std::lround((*aPointX.nMaxVal - *aPointX.nCurrVal) + / (*aPointX.nMaxVal - *aPointX.nMinVal) * nMaxVal1); + tools::Long nVal2 = std::lround((*aPointY.nMaxVal - *aPointY.nCurrVal) + / (*aPointY.nMaxVal - *aPointY.nMinVal) * nMaxVal2); + return StartAVListWriting() + && WriteAV(u"adj1", OUString(u"val " + OUString::number(nVal1))) + && WriteAV(u"adj2", OUString(u"val " + OUString::number(nVal2))) + && EndAVListWriting(); + } + if (sShapeType == "downArrowCallout") + { + auto aNeckFromBox = GetAdjustmentPointXValue(1); + auto aHeadFromNeck = GetAdjustmentPointXValue(2); + auto aHeadHeight = GetAdjustmentPointYValue(1); + auto aBoxHeight = GetAdjustmentPointYValue(0); + if (!aNeckFromBox.nCurrVal.has_value() || !aNeckFromBox.nMaxVal.has_value() + || !aNeckFromBox.nMinVal.has_value() || !aHeadFromNeck.nCurrVal.has_value() + || !aHeadFromNeck.nMaxVal.has_value() || !aHeadFromNeck.nMinVal.has_value() + || !aHeadHeight.nCurrVal.has_value() || !aHeadHeight.nMaxVal.has_value() + || !aHeadHeight.nMinVal.has_value() || !aBoxHeight.nCurrVal.has_value() + || !aBoxHeight.nMaxVal.has_value() || !aBoxHeight.nMinVal.has_value()) + return false; + + m_pDMLexporter->WriteShapeTransformation(m_xShape, XML_a, IsXFlipped(), IsYFlipped(), + false, false); + tools::Long nMaxVal1 + = 100000 * m_xShape->getSize().Width + / std::min(m_xShape->getSize().Width, m_xShape->getSize().Height); + tools::Long nMaxVal2 + = 50000 * m_xShape->getSize().Width + / std::min(m_xShape->getSize().Width, m_xShape->getSize().Height); + tools::Long nMaxVal3 + = 100000 * m_xShape->getSize().Height + / std::min(m_xShape->getSize().Width, m_xShape->getSize().Height); + tools::Long nVal1 + = std::lround((*aNeckFromBox.nMaxVal - *aNeckFromBox.nCurrVal) + / (*aNeckFromBox.nMaxVal - *aNeckFromBox.nMinVal) * nMaxVal1); + tools::Long nVal2 = std::lround((10800 - *aHeadFromNeck.nCurrVal) + / (10800 - *aHeadFromNeck.nMinVal) * nMaxVal2); + tools::Long nVal3 + = std::lround((*aHeadHeight.nMaxVal - *aHeadHeight.nCurrVal) + / (*aHeadHeight.nMaxVal - *aHeadHeight.nMinVal) * nMaxVal3); + tools::Long nVal4 = std::lround((*aBoxHeight.nCurrVal - *aBoxHeight.nMinVal) + / (21600 - *aBoxHeight.nMinVal) * 100000); + return StartAVListWriting() + && WriteAV(u"adj1", OUString(u"val " + OUString::number(nVal1))) + && WriteAV(u"adj2", OUString(u"val " + OUString::number(nVal2))) + && WriteAV(u"adj3", OUString(u"val " + OUString::number(nVal3))) + && WriteAV(u"adj4", OUString(u"val " + OUString::number(nVal4))) + && EndAVListWriting(); + } + if (sShapeType == "ellipse") + { + // Does not have handle points, so preset enough. + return false; + } + if (sShapeType == "ellipseRibbon") + { + // LO does not have this type, so it does not necessary to be mapped. + return false; + } + if (sShapeType == "ellipseRibbon2") + { + // LO does not have this type, so it does not necessary to be mapped. + return false; + } + if (sShapeType == "flowChartAlternateProcess") + { + // Does not have handle points, so preset enough. + return false; + } + if (sShapeType == "flowChartCollate") + { + // Does not have handle points, so preset enough. + return false; + } + if (sShapeType == "flowChartConnector") + { + // Does not have handle points, so preset enough. + return false; + } + if (sShapeType == "flowChartDecision") + { + // Does not have handle points, so preset enough. + return false; + } + if (sShapeType == "flowChartDecision") + { + // Does not have handle points, so preset enough. + return false; + } + if (sShapeType == "flowChartDelay") + { + // Does not have handle points, so preset enough. + return false; + } + if (sShapeType == "flowChartDisplay") + { + // Does not have handle points, so preset enough. + return false; + } + if (sShapeType == "flowChartDocument") + { + // Does not have handle points, so preset enough. + return false; + } + if (sShapeType == "flowChartExtract") + { + // Does not have handle points, so preset enough. + return false; + } + if (sShapeType == "flowChartInputOutput") + { + // Does not have handle points, so preset enough. + return false; + } + if (sShapeType == "flowChartInternalStorage") + { + // Does not have handle points, so preset enough. + return false; + } + if (sShapeType == "flowChartMagneticDisk") + { + // Does not have handle points, so preset enough. + return false; + } + if (sShapeType == "flowChartMagneticDrum") + { + // Does not have handle points, so preset enough. + return false; + } + if (sShapeType == "flowChartMagneticTape") + { + // Does not have handle points, so preset enough. + return false; + } + if (sShapeType == "flowChartManualInput") + { + // Does not have handle points, so preset enough. + return false; + } + if (sShapeType == "flowChartManualOperation") + { + // Does not have handle points, so preset enough. + return false; + } + if (sShapeType == "flowChartMerge") + { + // Does not have handle points, so preset enough. + return false; + } + if (sShapeType == "flowChartMultidocument") + { + // Does not have handle points, so preset enough. + return false; + } + if (sShapeType == "flowChartOfflineStorage") + { + // Does not have handle points, so preset enough. + return false; + } + if (sShapeType == "flowChartOffpageConnector") + { + // Does not have handle points, so preset enough. + return false; + } + if (sShapeType == "flowChartOnlineStorage") + { + // Does not have handle points, so preset enough. + return false; + } + if (sShapeType == "flowChartOr") + { + // Does not have handle points, so preset enough. + return false; + } + if (sShapeType == "flowChartDecision") + { + // Does not have handle points, so preset enough. + return false; + } + if (sShapeType == "flowChartPredefinedProcess") + { + // Does not have handle points, so preset enough. + return false; + } + if (sShapeType == "flowChartPreparation") + { + // Does not have handle points, so preset enough. + return false; + } + if (sShapeType == "flowChartPunchedCard") + { + // Does not have handle points, so preset enough. + return false; + } + if (sShapeType == "flowChartPunchedTape") + { + // Does not have handle points, so preset enough. + return false; + } + if (sShapeType == "flowChartSort") + { + // Does not have handle points, so preset enough. + return false; + } + if (sShapeType == "flowChartSummingJunction") + { + // Does not have handle points, so preset enough. + return false; + } + if (sShapeType == "flowChartTerminator") + { + // Does not have handle points, so preset enough. + return false; + } + if (sShapeType == "foldedCorner") + { + // TODO + return false; + } + if (sShapeType == "frame") + { + // TODO + return false; + } + if (sShapeType == "funnel") + { + // Not found in word + return false; + } + if (sShapeType == "gear6") + { + // Not found in word + return false; + } + if (sShapeType == "gear9") + { + // Not found in word + return false; + } + if (sShapeType == "halfFrame") + { + // LO does not have this type, not necessary to map + return false; + } + if (sShapeType == "heart") + { + // TODO + return false; + } + if (sShapeType == "heptagon") + { + // LO does not have this type, not necessary to map + return false; + } + if (sShapeType == "hexagon") + { + auto aPoint1 = GetAdjustmentPointXValue(0); + if (!aPoint1.nCurrVal.has_value() || !aPoint1.nMaxVal.has_value() + || !aPoint1.nMinVal.has_value()) + return false; + + m_pDMLexporter->WriteShapeTransformation(m_xShape, XML_a, IsXFlipped(), IsYFlipped(), + false, false); + tools::Long nMaxVal = 50000 * m_xShape->getSize().Width + / std::min(m_xShape->getSize().Width, m_xShape->getSize().Height); + tools::Long nVal1 + = std::lround(*aPoint1.nCurrVal / (*aPoint1.nMaxVal - *aPoint1.nMinVal) * nMaxVal); + return StartAVListWriting() + && WriteAV(u"adj", OUString(u"val " + OUString::number(nVal1))) + && WriteAV(u"vf", OUString(u"val " + OUString::number(115470))) + && EndAVListWriting(); + } + if (sShapeType == "homePlate") + { + // Not found in word + return false; + } + if (sShapeType == "horizontalScroll") + { + // TODO + return false; + } + if (sShapeType == "irregularSeal1") + { + // Not found in word + return false; + } + if (sShapeType == "irregularSeal2") + { + // Not found in word + return false; + } + if (sShapeType == "leftArrow") + { + auto aPointX = GetAdjustmentPointXValue(0); + auto aPointY = GetAdjustmentPointYValue(0); + if (!aPointX.nCurrVal.has_value() || !aPointX.nMaxVal.has_value() + || !aPointX.nMinVal.has_value() || !aPointY.nCurrVal.has_value() + || !aPointY.nMaxVal.has_value() || !aPointY.nMinVal.has_value()) + return false; + + m_pDMLexporter->WriteShapeTransformation(m_xShape, XML_a, IsXFlipped(), IsYFlipped(), + false, false); + tools::Long nMaxVal1 = 100000; + tools::Long nMaxVal2 + = 100000 + * (double(m_xShape->getSize().Width) + / std::min(m_xShape->getSize().Width, m_xShape->getSize().Height)); + tools::Long nVal1 = std::lround((*aPointY.nMaxVal - *aPointY.nCurrVal) + / (*aPointY.nMaxVal - *aPointY.nMinVal) * nMaxVal1); + tools::Long nVal2 = std::lround((*aPointX.nCurrVal - *aPointX.nMinVal) + / (*aPointX.nMaxVal - *aPointX.nMinVal) * nMaxVal2); + return StartAVListWriting() + && WriteAV(u"adj1", OUString(u"val " + OUString::number(nVal1))) + && WriteAV(u"adj2", OUString(u"val " + OUString::number(nVal2))) + && EndAVListWriting(); + } + if (sShapeType == "leftArrowCallout") + { + auto aBoxWidth = GetAdjustmentPointXValue(0); + auto aNeckLength = GetAdjustmentPointXValue(1); + auto aNeckFromBox = GetAdjustmentPointYValue(1); + auto aHeadFromNeck = GetAdjustmentPointYValue(2); + if (!aBoxWidth.nCurrVal.has_value() || !aBoxWidth.nMaxVal.has_value() + || !aBoxWidth.nMinVal.has_value() || !aNeckLength.nCurrVal.has_value() + || !aNeckLength.nMaxVal.has_value() || !aNeckLength.nMinVal.has_value() + || !aNeckFromBox.nCurrVal.has_value() || !aNeckFromBox.nMaxVal.has_value() + || !aNeckFromBox.nMinVal.has_value() || !aHeadFromNeck.nCurrVal.has_value() + || !aHeadFromNeck.nMaxVal.has_value() || !aHeadFromNeck.nMinVal.has_value()) + return false; + + m_pDMLexporter->WriteShapeTransformation(m_xShape, XML_a, IsXFlipped(), IsYFlipped(), + false, false); + tools::Long nMaxVal1 + = 100000 * m_xShape->getSize().Height + / std::min(m_xShape->getSize().Width, m_xShape->getSize().Height); + tools::Long nMaxVal2 + = 50000 * m_xShape->getSize().Height + / std::min(m_xShape->getSize().Width, m_xShape->getSize().Height); + tools::Long nMaxVal3 + = 100000 * m_xShape->getSize().Width + / std::min(m_xShape->getSize().Width, m_xShape->getSize().Height); + tools::Long nVal1 + = std::lround((*aNeckFromBox.nMaxVal - *aNeckFromBox.nCurrVal) + / (*aNeckFromBox.nMaxVal - *aNeckFromBox.nMinVal) * nMaxVal1); + tools::Long nVal2 = std::lround((10800 - *aHeadFromNeck.nCurrVal) + / (10800 - *aHeadFromNeck.nMinVal) * nMaxVal2); + tools::Long nVal3 = std::lround((*aNeckLength.nCurrVal - *aNeckLength.nMinVal) + / (21600 - *aNeckLength.nMinVal) * nMaxVal3); + tools::Long nVal4 = std::lround((*aBoxWidth.nMaxVal - *aBoxWidth.nCurrVal) + / (*aBoxWidth.nMaxVal - *aBoxWidth.nMinVal) * 100000); + return StartAVListWriting() + && WriteAV(u"adj1", OUString(u"val " + OUString::number(nVal1))) + && WriteAV(u"adj2", OUString(u"val " + OUString::number(nVal2))) + && WriteAV(u"adj3", OUString(u"val " + OUString::number(nVal3))) + && WriteAV(u"adj4", OUString(u"val " + OUString::number(nVal4))) + && EndAVListWriting(); + } + if (sShapeType == "leftBrace") + { + // TODO + return false; + } + if (sShapeType == "leftBracket") + { + // TODO + return false; + } + if (sShapeType == "leftCircularArrow") + { + // LO does not have this type, not necessary to map + return false; + } + if (sShapeType == "leftRightArrow") + { + auto aPointX = GetAdjustmentPointXValue(0); + auto aPointY = GetAdjustmentPointYValue(0); + if (!aPointX.nCurrVal.has_value() || !aPointX.nMaxVal.has_value() + || !aPointX.nMinVal.has_value() || !aPointY.nCurrVal.has_value() + || !aPointY.nMaxVal.has_value() || !aPointY.nMinVal.has_value()) + return false; + + m_pDMLexporter->WriteShapeTransformation(m_xShape, XML_a, IsXFlipped(), IsYFlipped(), + false, false); + tools::Long nMaxVal1 = 100000; + tools::Long nMaxVal2 + = 50000 + * (double(m_xShape->getSize().Width) + / std::min(m_xShape->getSize().Width, m_xShape->getSize().Height)); + tools::Long nVal1 = std::lround((*aPointY.nMaxVal - *aPointY.nCurrVal) + / (*aPointY.nMaxVal - *aPointY.nMinVal) * nMaxVal1); + tools::Long nVal2 = std::lround((*aPointX.nCurrVal - *aPointX.nMinVal) + / (*aPointX.nMaxVal - *aPointX.nMinVal) * nMaxVal2); + return StartAVListWriting() + && WriteAV(u"adj1", OUString(u"val " + OUString::number(nVal1))) + && WriteAV(u"adj2", OUString(u"val " + OUString::number(nVal2))) + && EndAVListWriting(); + } + if (sShapeType == "leftRightArrowCallout") + { + auto aNeckFromBox = GetAdjustmentPointXValue(1); + auto aHeadFromNeck = GetAdjustmentPointXValue(2); + auto aHeadHeight = GetAdjustmentPointYValue(1); + auto aBoxHeight = GetAdjustmentPointYValue(0); + if (!aNeckFromBox.nCurrVal.has_value() || !aNeckFromBox.nMaxVal.has_value() + || !aNeckFromBox.nMinVal.has_value() || !aHeadFromNeck.nCurrVal.has_value() + || !aHeadFromNeck.nMaxVal.has_value() || !aHeadFromNeck.nMinVal.has_value() + || !aHeadHeight.nCurrVal.has_value() || !aHeadHeight.nMaxVal.has_value() + || !aHeadHeight.nMinVal.has_value() || !aBoxHeight.nCurrVal.has_value() + || !aBoxHeight.nMaxVal.has_value() || !aBoxHeight.nMinVal.has_value()) + return false; + + m_pDMLexporter->WriteShapeTransformation(m_xShape, XML_a, IsXFlipped(), IsYFlipped(), + false, false); + tools::Long nMaxVal1 + = 100000 * m_xShape->getSize().Width + / std::min(m_xShape->getSize().Width, m_xShape->getSize().Height); + tools::Long nMaxVal2 + = 50000 * m_xShape->getSize().Width + / std::min(m_xShape->getSize().Width, m_xShape->getSize().Height); + tools::Long nMaxVal3 + = 100000 * m_xShape->getSize().Height + / std::min(m_xShape->getSize().Width, m_xShape->getSize().Height); + tools::Long nVal1 + = std::lround((*aNeckFromBox.nMaxVal - *aNeckFromBox.nCurrVal) + / (*aNeckFromBox.nMaxVal - *aNeckFromBox.nMinVal) * nMaxVal1); + tools::Long nVal2 = std::lround((10800 - *aHeadFromNeck.nCurrVal) + / (10800 - *aHeadFromNeck.nMinVal) * nMaxVal2); + tools::Long nVal3 = std::lround((*aHeadHeight.nCurrVal - *aHeadHeight.nMinVal) + / (21600 - *aHeadHeight.nMinVal) * nMaxVal3); + tools::Long nVal4 = std::lround((*aBoxHeight.nCurrVal - *aBoxHeight.nMinVal) + / (10800 - *aBoxHeight.nMinVal) * 100000); + return StartAVListWriting() + && WriteAV(u"adj1", OUString(u"val " + OUString::number(nVal1))) + && WriteAV(u"adj2", OUString(u"val " + OUString::number(nVal2))) + && WriteAV(u"adj3", OUString(u"val " + OUString::number(nVal3))) + && WriteAV(u"adj4", OUString(u"val " + OUString::number(nVal4))) + && EndAVListWriting(); + } + if (sShapeType == "leftRightCircularArrow") + { + // Not found in word + return false; + } + if (sShapeType == "leftRightRibbon") + { + // LO does not have this type so mapping not necessary + return false; + } + if (sShapeType == "leftRightUpArrow") + { + // TODO? + // MS Word stretches the arrow to fit the bounding box; LO doesn't + return false; + } + if (sShapeType == "leftUpArrow") + { + // MS Word's and LO's interpretations of what a leftUpArrow should look like + // are too different to find a compromise :( + } + if (sShapeType == "lightningBolt") + { + // Difference between the SDR and OOXML variants, custgeom? + return false; + } + if (sShapeType == "line") + { + // Not necessary + return false; + } + if (sShapeType == "lineInv") + { + // Not necessary + return false; + } + if (sShapeType == "mathDivide") + { + // LO does not have this type so mapping not necessary + return false; + } + if (sShapeType == "mathEqual") + { + // LO does not have this type so mapping not necessary + return false; + } + if (sShapeType == "mathMinus") + { + // LO does not have this type so mapping not necessary + return false; + } + if (sShapeType == "mathMultiply") + { + // LO does not have this type so mapping not necessary + return false; + } + if (sShapeType == "mathNotEqual") + { + // LO does not have this type so mapping not necessary + return false; + } + if (sShapeType == "mathPlus") + { + // LO does not have this type so mapping not necessary + return false; + } + if (sShapeType == "nonIsoscelesTrapezoid") + { + // TODO + return false; + } + if (sShapeType == "noSmoking") + { + // TODO + return false; + } + if (sShapeType == "notchedRightArrow") + { + // TODO + return false; + } + if (sShapeType == "octagon") + { + auto aPoint1 = GetAdjustmentPointXValue(0); + if (!aPoint1.nCurrVal.has_value() || !aPoint1.nMaxVal.has_value() + || !aPoint1.nMinVal.has_value()) + return false; + + m_pDMLexporter->WriteShapeTransformation(m_xShape, XML_a, IsXFlipped(), IsYFlipped(), + false, false); + tools::Long nVal1 + = std::lround(*aPoint1.nCurrVal / (*aPoint1.nMaxVal - *aPoint1.nMinVal) * 50000); + return StartAVListWriting() + && WriteAV(u"adj", OUString(u"val " + OUString::number(nVal1))) + && EndAVListWriting(); + } + if (sShapeType == "parallelogram") + { + auto aPoint1 = GetAdjustmentPointXValue(0); + if (!aPoint1.nCurrVal.has_value() || !aPoint1.nMaxVal.has_value() + || !aPoint1.nMinVal.has_value()) + return false; + + m_pDMLexporter->WriteShapeTransformation(m_xShape, XML_a, IsXFlipped(), IsYFlipped(), + false, false); + tools::Long nMaxVal = 100000 * m_xShape->getSize().Width + / std::min(m_xShape->getSize().Width, m_xShape->getSize().Height); + tools::Long nVal1 + = std::lround(*aPoint1.nCurrVal / (*aPoint1.nMaxVal - *aPoint1.nMinVal) * nMaxVal); + return StartAVListWriting() + && WriteAV(u"adj", OUString(u"val " + OUString::number(nVal1))) + && EndAVListWriting(); + } + if (sShapeType == "pentagon") + { + // TODO + return false; + } + if (sShapeType == "pie") + { + // TODO + return false; + } + if (sShapeType == "pieWedge") + { + // Not found in word. + return false; + } + if (sShapeType == "plaque") + { + // TODO + return false; + } + if (sShapeType == "plaqueTabs") + { + // LO does not have this, so not necessary to map. + return false; + } + if (sShapeType == "plus") + { + auto aPoint1 = GetAdjustmentPointXValue(0); + if (!aPoint1.nCurrVal.has_value() || !aPoint1.nMaxVal.has_value() + || !aPoint1.nMinVal.has_value()) + return false; + + m_pDMLexporter->WriteShapeTransformation(m_xShape, XML_a, IsXFlipped(), IsYFlipped(), + false, false); + tools::Long nVal1 + = std::lround(*aPoint1.nCurrVal / (*aPoint1.nMaxVal - *aPoint1.nMinVal) * 50000); + return StartAVListWriting() + && WriteAV(u"adj", OUString(u"val " + OUString::number(nVal1))) + && EndAVListWriting(); + } + if (sShapeType == "quadArrow") + { + // TODO + return false; + } + if (sShapeType == "quadArrowCallout") + { + // TODO + return false; + } + if (sShapeType == "rect") + { + // preset enough without AV points. + return false; + } + if (sShapeType == "ribbon") + { + // LO does not have this, so not necessary to map. + return false; + } + if (sShapeType == "ribbon2") + { + // LO does not have this, so not necessary to map. + return false; + } + if (sShapeType == "rightArrow") + { + auto aPointX = GetAdjustmentPointXValue(0); + auto aPointY = GetAdjustmentPointYValue(0); + if (!aPointX.nCurrVal.has_value() || !aPointX.nMaxVal.has_value() + || !aPointX.nMinVal.has_value() || !aPointY.nCurrVal.has_value() + || !aPointY.nMaxVal.has_value() || !aPointY.nMinVal.has_value()) + return false; + + m_pDMLexporter->WriteShapeTransformation(m_xShape, XML_a, IsXFlipped(), IsYFlipped(), + false, false); + tools::Long nMaxVal1 = 100000; + tools::Long nMaxVal2 + = 100000 + * (double(m_xShape->getSize().Width) + / std::min(m_xShape->getSize().Width, m_xShape->getSize().Height)); + tools::Long nVal1 = std::lround((*aPointY.nMaxVal - *aPointY.nCurrVal) + / (*aPointY.nMaxVal - *aPointY.nMinVal) * nMaxVal1); + tools::Long nVal2 = std::lround((*aPointX.nMaxVal - *aPointX.nCurrVal) + / (*aPointX.nMaxVal - *aPointX.nMinVal) * nMaxVal2); + return StartAVListWriting() + && WriteAV(u"adj1", OUString(u"val " + OUString::number(nVal1))) + && WriteAV(u"adj2", OUString(u"val " + OUString::number(nVal2))) + && EndAVListWriting(); + } + if (sShapeType == "rightArrowCallout") + { + auto aBoxWidth = GetAdjustmentPointXValue(0); + auto aNeckLength = GetAdjustmentPointXValue(1); + auto aNeckFromBox = GetAdjustmentPointYValue(1); + auto aHeadFromNeck = GetAdjustmentPointYValue(2); + if (!aBoxWidth.nCurrVal.has_value() || !aBoxWidth.nMaxVal.has_value() + || !aBoxWidth.nMinVal.has_value() || !aNeckLength.nCurrVal.has_value() + || !aNeckLength.nMaxVal.has_value() || !aNeckLength.nMinVal.has_value() + || !aNeckFromBox.nCurrVal.has_value() || !aNeckFromBox.nMaxVal.has_value() + || !aNeckFromBox.nMinVal.has_value() || !aHeadFromNeck.nCurrVal.has_value() + || !aHeadFromNeck.nMaxVal.has_value() || !aHeadFromNeck.nMinVal.has_value()) + return false; + + m_pDMLexporter->WriteShapeTransformation(m_xShape, XML_a, IsXFlipped(), IsYFlipped(), + false, false); + tools::Long nMaxVal1 + = 100000 * m_xShape->getSize().Height + / std::min(m_xShape->getSize().Width, m_xShape->getSize().Height); + tools::Long nMaxVal2 + = 50000 * m_xShape->getSize().Height + / std::min(m_xShape->getSize().Width, m_xShape->getSize().Height); + tools::Long nMaxVal3 + = 100000 * m_xShape->getSize().Width + / std::min(m_xShape->getSize().Width, m_xShape->getSize().Height); + tools::Long nVal1 + = std::lround((*aNeckFromBox.nMaxVal - *aNeckFromBox.nCurrVal) + / (*aNeckFromBox.nMaxVal - *aNeckFromBox.nMinVal) * nMaxVal1); + tools::Long nVal2 = std::lround((10800 - *aHeadFromNeck.nCurrVal) + / (10800 - *aHeadFromNeck.nMinVal) * nMaxVal2); + tools::Long nVal3 + = std::lround((*aNeckLength.nMaxVal - *aNeckLength.nCurrVal) + / (*aNeckLength.nMaxVal - *aNeckLength.nMinVal) * nMaxVal3); + tools::Long nVal4 = std::lround((*aBoxWidth.nCurrVal - *aBoxWidth.nMinVal) + / (21600 - *aBoxWidth.nMinVal) * 100000); + return StartAVListWriting() + && WriteAV(u"adj1", OUString(u"val " + OUString::number(nVal1))) + && WriteAV(u"adj2", OUString(u"val " + OUString::number(nVal2))) + && WriteAV(u"adj3", OUString(u"val " + OUString::number(nVal3))) + && WriteAV(u"adj4", OUString(u"val " + OUString::number(nVal4))) + && EndAVListWriting(); + } + if (sShapeType == "rightBrace") + { + // TODO + return false; + } + if (sShapeType == "rightBracket") + { + // TODO + return false; + } + if (sShapeType == "round1Rect") + { + // LO does not have this, so not necessary to map. + return false; + } + if (sShapeType == "round2DiagRect") + { + // LO does not have this, so not necessary to map. + return false; + } + if (sShapeType == "round2SameRect") + { + // LO does not have this, so not necessary to map. + return false; + } + if (sShapeType == "roundRect") + { + tools::Long nVal1 = 0; + if (m_xShape->getSize().Width >= m_xShape->getSize().Height) + { + auto aPointX = GetAdjustmentPointXValue(0); + if (!aPointX.nCurrVal.has_value() || !aPointX.nMaxVal.has_value() + || !aPointX.nMinVal.has_value()) + return false; + nVal1 = std::lround(*aPointX.nCurrVal / (*aPointX.nMaxVal - *aPointX.nMinVal) + * 50000); + } + else + { + auto aPointY = GetAdjustmentPointYValue(0); + if (!aPointY.nCurrVal.has_value() || !aPointY.nMaxVal.has_value() + || !aPointY.nMinVal.has_value()) + return false; + nVal1 = std::lround(*aPointY.nCurrVal / (*aPointY.nMaxVal - *aPointY.nMinVal) + * 50000); + } + + m_pDMLexporter->WriteShapeTransformation(m_xShape, XML_a, IsXFlipped(), IsYFlipped(), + false, false); + return StartAVListWriting() + && WriteAV(u"adj", OUString(u"val " + OUString::number(nVal1))) + && EndAVListWriting(); + } + if (sShapeType == "rtTriangle") + { + // Does not have AV points not necessary to map + return false; + } + if (sShapeType == "smileyFace") + { + // TODO + return false; + } + if (sShapeType == "snip1Rect") + { + // LO does not have this, so not necessary to map. + return false; + } + if (sShapeType == "snip2DiagRect") + { + // LO does not have this, so not necessary to map. + return false; + } + if (sShapeType == "snip2SameRect") + { + // LO does not have this, so not necessary to map. + return false; + } + if (sShapeType == "snipRoundRect") + { + // LO does not have this, so not necessary to map. + return false; + } + if (sShapeType == "squareTabs") + { + // LO does not have this, so not necessary to map. + return false; + } + if (sShapeType == "star10") + { + // LO does not have this, so not necessary to map. + return false; + } + if (sShapeType == "star12") + { + // TODO + return false; + } + if (sShapeType == "star16") + { + // LO does not have this, so not necessary to map. + return false; + } + if (sShapeType == "star24") + { + // TODO + return false; + } + if (sShapeType == "star32") + { + // LO does not have this, so not necessary to map. + return false; + } + if (sShapeType == "star4") + { + // TODO + return false; + } + if (sShapeType == "star5") + { + // TODO + return false; + } + if (sShapeType == "star6") + { + // TODO + return false; + } + if (sShapeType == "star7") + { + // LO does not have this, so not necessary to map. + return false; + } + if (sShapeType == "star8") + { + // TODO + return false; + } + if (sShapeType == "straightConnector1") + { + // Not necessary to map. + return false; + } + if (sShapeType == "stripedRightArrow") + { + // TODO + return false; + } + if (sShapeType == "sun") + { + // TODO + return false; + } + if (sShapeType == "swooshArrow") + { + // Not found in word. + return false; + } + if (sShapeType == "teardrop") + { + // TODO + return false; + } + if (sShapeType == "trapezoid") + { + // Preset enough. + return false; + } + if (sShapeType == "triangle") + { + auto aPoint1 = GetAdjustmentPointXValue(0); + if (!aPoint1.nCurrVal.has_value() || !aPoint1.nMaxVal.has_value() + || !aPoint1.nMinVal.has_value()) + return false; + + m_pDMLexporter->WriteShapeTransformation(m_xShape, XML_a, IsXFlipped(), IsYFlipped(), + false, false); + tools::Long nMaxVal = 100000; + tools::Long nVal1 + = std::lround(*aPoint1.nCurrVal / (*aPoint1.nMaxVal - *aPoint1.nMinVal) * nMaxVal); + return StartAVListWriting() + && WriteAV(u"adj", OUString(u"val " + OUString::number(nVal1))) + && EndAVListWriting(); + } + if (sShapeType == "upArrowCallout") + { + auto aNeckFromBox = GetAdjustmentPointXValue(1); + auto aHeadFromNeck = GetAdjustmentPointXValue(2); + auto aHeadHeight = GetAdjustmentPointYValue(1); + auto aBoxHeight = GetAdjustmentPointYValue(0); + if (!aNeckFromBox.nCurrVal.has_value() || !aNeckFromBox.nMaxVal.has_value() + || !aNeckFromBox.nMinVal.has_value() || !aHeadFromNeck.nCurrVal.has_value() + || !aHeadFromNeck.nMaxVal.has_value() || !aHeadFromNeck.nMinVal.has_value() + || !aHeadHeight.nCurrVal.has_value() || !aHeadHeight.nMaxVal.has_value() + || !aHeadHeight.nMinVal.has_value() || !aBoxHeight.nCurrVal.has_value() + || !aBoxHeight.nMaxVal.has_value() || !aBoxHeight.nMinVal.has_value()) + return false; + + m_pDMLexporter->WriteShapeTransformation(m_xShape, XML_a, IsXFlipped(), IsYFlipped(), + false, false); + tools::Long nMaxVal1 + = 100000 * m_xShape->getSize().Width + / std::min(m_xShape->getSize().Width, m_xShape->getSize().Height); + tools::Long nMaxVal2 + = 50000 * m_xShape->getSize().Width + / std::min(m_xShape->getSize().Width, m_xShape->getSize().Height); + tools::Long nMaxVal3 + = 100000 * m_xShape->getSize().Height + / std::min(m_xShape->getSize().Width, m_xShape->getSize().Height); + tools::Long nVal1 + = std::lround((*aNeckFromBox.nMaxVal - *aNeckFromBox.nCurrVal) + / (*aNeckFromBox.nMaxVal - *aNeckFromBox.nMinVal) * nMaxVal1); + tools::Long nVal2 = std::lround((10800 - *aHeadFromNeck.nCurrVal) + / (10800 - *aHeadFromNeck.nMinVal) * nMaxVal2); + tools::Long nVal3 = std::lround((*aHeadHeight.nCurrVal - *aHeadHeight.nMinVal) + / (21600 - *aHeadHeight.nMinVal) * nMaxVal3); + tools::Long nVal4 = std::lround((*aBoxHeight.nCurrVal - *aBoxHeight.nMinVal) + / (10800 - *aBoxHeight.nMinVal) * 100000); + return StartAVListWriting() + && WriteAV(u"adj1", OUString(u"val " + OUString::number(nVal1))) + && WriteAV(u"adj2", OUString(u"val " + OUString::number(nVal2))) + && WriteAV(u"adj3", OUString(u"val " + OUString::number(nVal3))) + && WriteAV(u"adj4", OUString(u"val " + OUString::number(nVal4))) + && EndAVListWriting(); + } + if (sShapeType == "upDownArrow") + { + auto aPointX = GetAdjustmentPointXValue(0); + auto aPointY = GetAdjustmentPointYValue(0); + if (!aPointX.nCurrVal.has_value() || !aPointX.nMaxVal.has_value() + || !aPointX.nMinVal.has_value() || !aPointY.nCurrVal.has_value() + || !aPointY.nMaxVal.has_value() || !aPointY.nMinVal.has_value()) + return false; + + m_pDMLexporter->WriteShapeTransformation(m_xShape, XML_a, IsXFlipped(), IsYFlipped(), + false, false); + tools::Long nMaxVal1 = 100000; + tools::Long nMaxVal2 + = 50000 * m_xShape->getSize().Height + / std::min(m_xShape->getSize().Width, m_xShape->getSize().Height); + tools::Long nVal1 = std::lround((*aPointX.nMaxVal - *aPointX.nCurrVal) + / (*aPointX.nMaxVal - *aPointX.nMinVal) * nMaxVal1); + tools::Long nVal2 = std::lround((*aPointY.nCurrVal - *aPointY.nMinVal) + / (*aPointY.nMaxVal - *aPointY.nMinVal) * nMaxVal2); + return StartAVListWriting() + && WriteAV(u"adj1", OUString(u"val " + OUString::number(nVal1))) + && WriteAV(u"adj2", OUString(u"val " + OUString::number(nVal2))) + && EndAVListWriting(); + } + if (sShapeType == "upArrow") + { + auto aPointX = GetAdjustmentPointXValue(0); + auto aPointY = GetAdjustmentPointYValue(0); + if (!aPointX.nCurrVal.has_value() || !aPointX.nMaxVal.has_value() + || !aPointX.nMinVal.has_value() || !aPointY.nCurrVal.has_value() + || !aPointY.nMaxVal.has_value() || !aPointY.nMinVal.has_value()) + return false; + + m_pDMLexporter->WriteShapeTransformation(m_xShape, XML_a, IsXFlipped(), IsYFlipped(), + false, false); + tools::Long nMaxVal1 = 100000; + tools::Long nMaxVal2 + = 100000 * m_xShape->getSize().Height + / std::min(m_xShape->getSize().Width, m_xShape->getSize().Height); + tools::Long nVal1 = std::lround((*aPointX.nMaxVal - *aPointX.nCurrVal) + / (*aPointX.nMaxVal - *aPointX.nMinVal) * nMaxVal1); + tools::Long nVal2 = std::lround((*aPointY.nCurrVal - *aPointY.nMinVal) + / (*aPointY.nMaxVal - *aPointY.nMinVal) * nMaxVal2); + return StartAVListWriting() + && WriteAV(u"adj1", OUString(u"val " + OUString::number(nVal1))) + && WriteAV(u"adj2", OUString(u"val " + OUString::number(nVal2))) + && EndAVListWriting(); + } + if (sShapeType == "upDownArrowCallout") + { + // TODO + return false; + } + if (sShapeType == "uturnArrow") + { + // LO does not have like this. + return false; + } + if (sShapeType == "verticalScroll") + { + // TODO + return false; + } + if (sShapeType == "wave") + { + // LO does not have. + return false; + } + if (sShapeType == "wedgeEllipseCallout") + { + // TODO + return false; + } + if (sShapeType == "wedgeRectCallout") + { + // TODO + return false; + } + if (sShapeType == "wedgeRoundRectCallout") + { + // TODO + return false; + } + } + catch (...) + { + // Problem detected with the writing, aborting and trying to find another way. + return false; + } + + // Default, nothing happened return. + return false; +}; +} diff --git a/oox/source/export/README b/oox/source/export/README new file mode 100644 index 000000000..56195b977 --- /dev/null +++ b/oox/source/export/README @@ -0,0 +1,2 @@ +presetTextWarpDefinitions.xml and presetShapeDefinitions.xml come from the +OOXML documentation (TC45). diff --git a/oox/source/export/chartexport.cxx b/oox/source/export/chartexport.cxx new file mode 100644 index 000000000..8a6d5fa7d --- /dev/null +++ b/oox/source/export/chartexport.cxx @@ -0,0 +1,4685 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include +#include + +#include +#include +#include +#include +#include "ColorPropertySet.hxx" + +#include +#include +#include +#include + +#include +#include + +#include +#include + +using namespace css; +using namespace css::uno; +using namespace css::drawing; +using namespace ::oox::core; +using css::beans::PropertyValue; +using css::beans::XPropertySet; +using css::container::XNamed; +using css::table::CellAddress; +using css::sheet::XFormulaParser; +using ::oox::core::XmlFilterBase; +using ::sax_fastparser::FSHelperPtr; + +namespace cssc = css::chart; + +namespace oox::drawingml { + +namespace { + +bool isPrimaryAxes(sal_Int32 nIndex) +{ + assert(nIndex == 0 || nIndex == 1); + return nIndex != 1; +} + +class lcl_MatchesRole +{ +public: + explicit lcl_MatchesRole( const OUString & aRole ) : + m_aRole( aRole ) + {} + + bool operator () ( const Reference< chart2::data::XLabeledDataSequence > & xSeq ) const + { + if( !xSeq.is() ) + return false; + Reference< beans::XPropertySet > xProp( xSeq->getValues(), uno::UNO_QUERY ); + OUString aRole; + + return ( xProp.is() && + (xProp->getPropertyValue( "Role" ) >>= aRole ) && + m_aRole == aRole ); + } + +private: + OUString m_aRole; +}; + +} + +static Reference< chart2::data::XLabeledDataSequence > lcl_getCategories( const Reference< chart2::XDiagram > & xDiagram, bool& bHasDateCategories ) +{ + bHasDateCategories = false; + Reference< chart2::data::XLabeledDataSequence > xResult; + try + { + Reference< chart2::XCoordinateSystemContainer > xCooSysCnt( + xDiagram, uno::UNO_QUERY_THROW ); + const Sequence< Reference< chart2::XCoordinateSystem > > aCooSysSeq( + xCooSysCnt->getCoordinateSystems()); + for( const auto& xCooSys : aCooSysSeq ) + { + OSL_ASSERT( xCooSys.is()); + for( sal_Int32 nN = xCooSys->getDimension(); nN--; ) + { + const sal_Int32 nMaxAxisIndex = xCooSys->getMaximumAxisIndexByDimension(nN); + for(sal_Int32 nI=0; nI<=nMaxAxisIndex; ++nI) + { + Reference< chart2::XAxis > xAxis = xCooSys->getAxisByDimension( nN, nI ); + OSL_ASSERT( xAxis.is()); + if( xAxis.is()) + { + chart2::ScaleData aScaleData = xAxis->getScaleData(); + if( aScaleData.Categories.is()) + { + bHasDateCategories = aScaleData.AxisType == chart2::AxisType::DATE; + xResult.set( aScaleData.Categories ); + break; + } + } + } + } + } + } + catch( const uno::Exception & ) + { + DBG_UNHANDLED_EXCEPTION("oox"); + } + + return xResult; +} + +static Reference< chart2::data::XLabeledDataSequence > + lcl_getDataSequenceByRole( + const Sequence< Reference< chart2::data::XLabeledDataSequence > > & aLabeledSeq, + const OUString & rRole ) +{ + Reference< chart2::data::XLabeledDataSequence > aNoResult; + + const Reference< chart2::data::XLabeledDataSequence > * pBegin = aLabeledSeq.getConstArray(); + const Reference< chart2::data::XLabeledDataSequence > * pEnd = pBegin + aLabeledSeq.getLength(); + const Reference< chart2::data::XLabeledDataSequence > * pMatch = + ::std::find_if( pBegin, pEnd, lcl_MatchesRole( rRole )); + + if( pMatch != pEnd ) + return *pMatch; + + return aNoResult; +} + +static bool lcl_hasCategoryLabels( const Reference< chart2::XChartDocument >& xChartDoc ) +{ + //categories are always the first sequence + Reference< chart2::XDiagram > xDiagram( xChartDoc->getFirstDiagram()); + bool bDateCategories; + Reference< chart2::data::XLabeledDataSequence > xCategories( lcl_getCategories( xDiagram, bDateCategories ) ); + return xCategories.is(); +} + +static bool lcl_isCategoryAxisShifted( const Reference< chart2::XDiagram >& xDiagram ) +{ + bool bCategoryPositionShifted = false; + try + { + Reference< chart2::XCoordinateSystemContainer > xCooSysCnt( + xDiagram, uno::UNO_QUERY_THROW); + const Sequence< Reference< chart2::XCoordinateSystem > > aCooSysSeq( + xCooSysCnt->getCoordinateSystems()); + for (const auto& xCooSys : aCooSysSeq) + { + OSL_ASSERT(xCooSys.is()); + if( 0 < xCooSys->getDimension() && 0 <= xCooSys->getMaximumAxisIndexByDimension(0) ) + { + Reference< chart2::XAxis > xAxis = xCooSys->getAxisByDimension(0, 0); + OSL_ASSERT(xAxis.is()); + if (xAxis.is()) + { + chart2::ScaleData aScaleData = xAxis->getScaleData(); + bCategoryPositionShifted = aScaleData.ShiftedCategoryPosition; + break; + } + } + } + } + catch (const uno::Exception&) + { + DBG_UNHANDLED_EXCEPTION("oox"); + } + + return bCategoryPositionShifted; +} + +static sal_Int32 lcl_getCategoryAxisType( const Reference< chart2::XDiagram >& xDiagram, sal_Int32 nDimensionIndex, sal_Int32 nAxisIndex ) +{ + sal_Int32 nAxisType = -1; + try + { + Reference< chart2::XCoordinateSystemContainer > xCooSysCnt( + xDiagram, uno::UNO_QUERY_THROW); + const Sequence< Reference< chart2::XCoordinateSystem > > aCooSysSeq( + xCooSysCnt->getCoordinateSystems()); + for( const auto& xCooSys : aCooSysSeq ) + { + OSL_ASSERT(xCooSys.is()); + if( nDimensionIndex < xCooSys->getDimension() && nAxisIndex <= xCooSys->getMaximumAxisIndexByDimension(nDimensionIndex) ) + { + Reference< chart2::XAxis > xAxis = xCooSys->getAxisByDimension(nDimensionIndex, nAxisIndex); + OSL_ASSERT(xAxis.is()); + if( xAxis.is() ) + { + chart2::ScaleData aScaleData = xAxis->getScaleData(); + nAxisType = aScaleData.AxisType; + break; + } + } + } + } + catch (const uno::Exception&) + { + DBG_UNHANDLED_EXCEPTION("oox"); + } + + return nAxisType; +} + +static OUString lclGetTimeUnitToken( sal_Int32 nTimeUnit ) +{ + switch( nTimeUnit ) + { + case cssc::TimeUnit::DAY: return "days"; + case cssc::TimeUnit::MONTH: return "months"; + case cssc::TimeUnit::YEAR: return "years"; + default: OSL_ENSURE(false, "lclGetTimeUnitToken - unexpected time unit"); + } + return "days"; +} + +static cssc::TimeIncrement lcl_getDateTimeIncrement( const Reference< chart2::XDiagram >& xDiagram, sal_Int32 nAxisIndex ) +{ + cssc::TimeIncrement aTimeIncrement; + try + { + Reference< chart2::XCoordinateSystemContainer > xCooSysCnt( + xDiagram, uno::UNO_QUERY_THROW); + const Sequence< Reference< chart2::XCoordinateSystem > > aCooSysSeq( + xCooSysCnt->getCoordinateSystems()); + for( const auto& xCooSys : aCooSysSeq ) + { + OSL_ASSERT(xCooSys.is()); + if( 0 < xCooSys->getDimension() && nAxisIndex <= xCooSys->getMaximumAxisIndexByDimension(0) ) + { + Reference< chart2::XAxis > xAxis = xCooSys->getAxisByDimension(0, nAxisIndex); + OSL_ASSERT(xAxis.is()); + if( xAxis.is() ) + { + chart2::ScaleData aScaleData = xAxis->getScaleData(); + aTimeIncrement = aScaleData.TimeIncrement; + break; + } + } + } + } + catch (const uno::Exception&) + { + DBG_UNHANDLED_EXCEPTION("oox"); + } + + return aTimeIncrement; +} + +static bool lcl_isSeriesAttachedToFirstAxis( + const Reference< chart2::XDataSeries > & xDataSeries ) +{ + bool bResult=true; + + try + { + sal_Int32 nAxisIndex = 0; + Reference< beans::XPropertySet > xProp( xDataSeries, uno::UNO_QUERY_THROW ); + xProp->getPropertyValue("AttachedAxisIndex") >>= nAxisIndex; + bResult = (0==nAxisIndex); + } + catch( const uno::Exception & ) + { + DBG_UNHANDLED_EXCEPTION("oox"); + } + + return bResult; +} + +static OUString lcl_flattenStringSequence( const Sequence< OUString > & rSequence ) +{ + OUStringBuffer aResult; + bool bPrecedeWithSpace = false; + for( const auto& rString : rSequence ) + { + if( !rString.isEmpty()) + { + if( bPrecedeWithSpace ) + aResult.append( ' ' ); + aResult.append( rString ); + bPrecedeWithSpace = true; + } + } + return aResult.makeStringAndClear(); +} + +static Sequence< OUString > lcl_getLabelSequence( const Reference< chart2::data::XDataSequence > & xLabelSeq ) +{ + Sequence< OUString > aLabels; + + uno::Reference< chart2::data::XTextualDataSequence > xTextualDataSequence( xLabelSeq, uno::UNO_QUERY ); + if( xTextualDataSequence.is()) + { + aLabels = xTextualDataSequence->getTextualData(); + } + else if( xLabelSeq.is()) + { + const Sequence< uno::Any > aAnies( xLabelSeq->getData()); + aLabels.realloc( aAnies.getLength()); + auto pLabels = aLabels.getArray(); + for( sal_Int32 i=0; i>= pLabels[i]; + } + + return aLabels; +} + +static void lcl_fillCategoriesIntoStringVector( + const Reference< chart2::data::XDataSequence > & xCategories, + ::std::vector< OUString > & rOutCategories ) +{ + OSL_ASSERT( xCategories.is()); + if( !xCategories.is()) + return; + Reference< chart2::data::XTextualDataSequence > xTextualDataSequence( xCategories, uno::UNO_QUERY ); + if( xTextualDataSequence.is()) + { + rOutCategories.clear(); + const Sequence< OUString > aTextData( xTextualDataSequence->getTextualData()); + rOutCategories.insert( rOutCategories.end(), aTextData.begin(), aTextData.end() ); + } + else + { + Sequence< uno::Any > aAnies( xCategories->getData()); + rOutCategories.resize( aAnies.getLength()); + for( sal_Int32 i=0; i>= rOutCategories[i]; + } +} + +static ::std::vector< double > lcl_getAllValuesFromSequence( const Reference< chart2::data::XDataSequence > & xSeq ) +{ + ::std::vector< double > aResult; + + Reference< chart2::data::XNumericalDataSequence > xNumSeq( xSeq, uno::UNO_QUERY ); + if( xNumSeq.is()) + { + const Sequence< double > aValues( xNumSeq->getNumericalData()); + aResult.insert( aResult.end(), aValues.begin(), aValues.end() ); + } + else if( xSeq.is()) + { + Sequence< uno::Any > aAnies( xSeq->getData()); + aResult.resize( aAnies.getLength(), std::numeric_limits::quiet_NaN() ); + for( sal_Int32 i=0; i>= aResult[i]; + } + return aResult; +} + +static sal_Int32 lcl_getChartType( std::u16string_view sChartType ) +{ + chart::TypeId eChartTypeId = chart::TYPEID_UNKNOWN; + if( sChartType == u"com.sun.star.chart.BarDiagram" + || sChartType == u"com.sun.star.chart2.ColumnChartType" ) + eChartTypeId = chart::TYPEID_BAR; + else if( sChartType == u"com.sun.star.chart.AreaDiagram" + || sChartType == u"com.sun.star.chart2.AreaChartType" ) + eChartTypeId = chart::TYPEID_AREA; + else if( sChartType == u"com.sun.star.chart.LineDiagram" + || sChartType == u"com.sun.star.chart2.LineChartType" ) + eChartTypeId = chart::TYPEID_LINE; + else if( sChartType == u"com.sun.star.chart.PieDiagram" + || sChartType == u"com.sun.star.chart2.PieChartType" ) + eChartTypeId = chart::TYPEID_PIE; + else if( sChartType == u"com.sun.star.chart.DonutDiagram" + || sChartType == u"com.sun.star.chart2.DonutChartType" ) + eChartTypeId = chart::TYPEID_DOUGHNUT; + else if( sChartType == u"com.sun.star.chart.XYDiagram" + || sChartType == u"com.sun.star.chart2.ScatterChartType" ) + eChartTypeId = chart::TYPEID_SCATTER; + else if( sChartType == u"com.sun.star.chart.NetDiagram" + || sChartType == u"com.sun.star.chart2.NetChartType" ) + eChartTypeId = chart::TYPEID_RADARLINE; + else if( sChartType == u"com.sun.star.chart.FilledNetDiagram" + || sChartType == u"com.sun.star.chart2.FilledNetChartType" ) + eChartTypeId = chart::TYPEID_RADARAREA; + else if( sChartType == u"com.sun.star.chart.StockDiagram" + || sChartType == u"com.sun.star.chart2.CandleStickChartType" ) + eChartTypeId = chart::TYPEID_STOCK; + else if( sChartType == u"com.sun.star.chart.BubbleDiagram" + || sChartType == u"com.sun.star.chart2.BubbleChartType" ) + eChartTypeId = chart::TYPEID_BUBBLE; + + return eChartTypeId; +} + +static sal_Int32 lcl_generateRandomValue() +{ + return comphelper::rng::uniform_int_distribution(0, 100000000-1); +} + +static sal_Int32 lcl_getAlphaFromTransparenceGradient(const awt::Gradient& rGradient, bool bStart) +{ + // Our alpha is a gray color value. + sal_uInt8 nRed = ::Color(ColorTransparency, bStart ? rGradient.StartColor : rGradient.EndColor).GetRed(); + // drawingML alpha is a percentage on a 0..100000 scale. + return (255 - nRed) * oox::drawingml::MAX_PERCENT / 255; +} + +bool DataLabelsRange::empty() const +{ + return maLabels.empty(); +} + +size_t DataLabelsRange::count() const +{ + return maLabels.size(); +} + +bool DataLabelsRange::hasLabel(sal_Int32 nIndex) const +{ + return maLabels.find(nIndex) != maLabels.end(); +} + +const OUString & DataLabelsRange::getRange() const +{ + return maRange; +} + +void DataLabelsRange::setRange(const OUString& rRange) +{ + maRange = rRange; +} + +void DataLabelsRange::setLabel(sal_Int32 nIndex, const OUString& rText) +{ + maLabels.emplace(nIndex, rText); +} + +DataLabelsRange::LabelsRangeMap::const_iterator DataLabelsRange::begin() const +{ + return maLabels.begin(); +} + +DataLabelsRange::LabelsRangeMap::const_iterator DataLabelsRange::end() const +{ + return maLabels.end(); +} + +ChartExport::ChartExport( sal_Int32 nXmlNamespace, FSHelperPtr pFS, Reference< frame::XModel > const & xModel, XmlFilterBase* pFB, DocumentType eDocumentType ) + : DrawingML( std::move(pFS), pFB, eDocumentType ) + , mnXmlNamespace( nXmlNamespace ) + , mnSeriesCount(0) + , mxChartModel( xModel ) + , mpURLTransformer(std::make_shared()) + , mbHasCategoryLabels( false ) + , mbHasZAxis( false ) + , mbIs3DChart( false ) + , mbStacked(false) + , mbPercent(false) + , mbHasDateCategories(false) +{ +} + +void ChartExport::SetURLTranslator(const std::shared_ptr& pTransformer) +{ + mpURLTransformer = pTransformer; +} + +sal_Int32 ChartExport::getChartType( ) +{ + OUString sChartType = mxDiagram->getDiagramType(); + return lcl_getChartType( sChartType ); +} + +namespace { + +uno::Sequence< beans::PropertyValue > createArguments( + const OUString & rRangeRepresentation, bool bUseColumns) +{ + css::chart::ChartDataRowSource eRowSource = css::chart::ChartDataRowSource_ROWS; + if (bUseColumns) + eRowSource = css::chart::ChartDataRowSource_COLUMNS; + + uno::Sequence aArguments{ + { "DataRowSource", -1, uno::Any(eRowSource), beans::PropertyState_DIRECT_VALUE }, + { "FirstCellAsLabel", -1, uno::Any(false), beans::PropertyState_DIRECT_VALUE }, + { "HasCategories", -1, uno::Any(false), beans::PropertyState_DIRECT_VALUE }, + { "CellRangeRepresentation", -1, uno::Any(rRangeRepresentation), + beans::PropertyState_DIRECT_VALUE } + }; + + return aArguments; +} + +Reference getPrimaryDataSeries(const Reference& xChartType) +{ + Reference< chart2::XDataSeriesContainer > xDSCnt(xChartType, uno::UNO_QUERY_THROW); + + // export dataseries for current chart-type + const Sequence< Reference< chart2::XDataSeries > > aSeriesSeq(xDSCnt->getDataSeries()); + for (const auto& rSeries : aSeriesSeq) + { + Reference xSource(rSeries, uno::UNO_QUERY); + if (xSource.is()) + return xSource; + } + + return Reference(); +} + +} + +Sequence< Sequence< OUString > > ChartExport::getSplitCategoriesList( const OUString& rRange ) +{ + Reference< chart2::XChartDocument > xChartDoc(getModel(), uno::UNO_QUERY); + OSL_ASSERT(xChartDoc.is()); + if (xChartDoc.is()) + { + Reference< chart2::data::XDataProvider > xDataProvider(xChartDoc->getDataProvider()); + OSL_ENSURE(xDataProvider.is(), "No DataProvider"); + if (xDataProvider.is()) + { + //detect whether the first series is a row or a column + bool bSeriesUsesColumns = true; + Reference< chart2::XDiagram > xDiagram(xChartDoc->getFirstDiagram()); + try + { + Reference< chart2::XCoordinateSystemContainer > xCooSysCnt(xDiagram, uno::UNO_QUERY_THROW); + const Sequence< Reference< chart2::XCoordinateSystem > > aCooSysSeq(xCooSysCnt->getCoordinateSystems()); + for (const auto& rCooSys : aCooSysSeq) + { + const Reference< chart2::XChartTypeContainer > xCTCnt(rCooSys, uno::UNO_QUERY_THROW); + const Sequence< Reference< chart2::XChartType > > aChartTypeSeq(xCTCnt->getChartTypes()); + for (const auto& rChartType : aChartTypeSeq) + { + Reference< chart2::XDataSeries > xDataSeries = getPrimaryDataSeries(rChartType); + if (xDataSeries.is()) + { + uno::Reference< chart2::data::XDataSource > xSeriesSource(xDataSeries, uno::UNO_QUERY); + const uno::Sequence< beans::PropertyValue > rArguments = xDataProvider->detectArguments(xSeriesSource); + for (const beans::PropertyValue& rProperty : rArguments) + { + if (rProperty.Name == "DataRowSource") + { + css::chart::ChartDataRowSource eRowSource; + if (rProperty.Value >>= eRowSource) + { + bSeriesUsesColumns = (eRowSource == css::chart::ChartDataRowSource_COLUMNS); + break; + } + } + } + } + } + } + } + catch (const uno::Exception &) + { + DBG_UNHANDLED_EXCEPTION("chart2"); + } + // detect we have an inner data table or not + if (xChartDoc->hasInternalDataProvider() && rRange == "categories") + { + try + { + css::uno::Reference< css::chart2::XAnyDescriptionAccess > xDataAccess(xChartDoc->getDataProvider(), uno::UNO_QUERY); + const Sequence< Sequence< uno::Any > >aAnyCategories(bSeriesUsesColumns ? xDataAccess->getAnyRowDescriptions() : xDataAccess->getAnyColumnDescriptions()); + auto pMax = std::max_element(aAnyCategories.begin(), aAnyCategories.end(), + [](const Sequence& a, const Sequence& b) { + return a.getLength() < b.getLength(); }); + + //minimum is 1! + if (pMax != aAnyCategories.end() && pMax->getLength() > 1) + { + sal_Int32 nLevelCount = pMax->getLength(); + //we have complex categories + //sort the categories name + Sequence>aFinalSplitSource(nLevelCount); + auto pFinalSplitSource = aFinalSplitSource.getArray(); + for (sal_Int32 i = 0; i < nLevelCount; i++) + { + sal_Int32 nElemLabel = 0; + pFinalSplitSource[nLevelCount - i - 1].realloc(aAnyCategories.getLength()); + auto pSeq = pFinalSplitSource[nLevelCount - i - 1].getArray(); + for (auto const& elemLabel : aAnyCategories) + { + // make sure elemLabel[i] exists! + if (elemLabel.getLength() > i) + { + pSeq[nElemLabel] = elemLabel[i].get(); + nElemLabel++; + } + } + } + return aFinalSplitSource; + } + } + catch (const uno::Exception &) + { + DBG_UNHANDLED_EXCEPTION("oox"); + } + } + else + { + try + { + uno::Reference< chart2::data::XDataSource > xCategoriesSource(xDataProvider->createDataSource( + createArguments(rRange, bSeriesUsesColumns))); + + if (xCategoriesSource.is()) + { + const Sequence< Reference< chart2::data::XLabeledDataSequence >> aCategories = xCategoriesSource->getDataSequences(); + if (aCategories.getLength() > 1) + { + //we have complex categories + //sort the categories name + Sequence> aFinalSplitSource(aCategories.getLength()); + std::transform(aCategories.begin(), aCategories.end(), + std::reverse_iterator(asNonConstRange(aFinalSplitSource).end()), + [](const Reference& xCat) { + return lcl_getLabelSequence(xCat->getValues()); }); + return aFinalSplitSource; + } + } + } + catch (const uno::Exception &) + { + DBG_UNHANDLED_EXCEPTION("oox"); + } + } + } + } + + return Sequence< Sequence< OUString>>(0); +} + +OUString ChartExport::parseFormula( const OUString& rRange ) +{ + OUString aResult; + Reference< XFormulaParser > xParser; + uno::Reference< lang::XMultiServiceFactory > xSF = GetFB()->getModelFactory(); + if( xSF.is() ) + { + try + { + xParser.set( xSF->createInstance("com.sun.star.sheet.FormulaParser"), UNO_QUERY ); + } + catch( Exception& ) + { + } + } + + SAL_WARN_IF(!xParser.is(), "oox", "creating formula parser failed"); + + if( xParser.is() ) + { + Reference< XPropertySet > xParserProps( xParser, uno::UNO_QUERY ); + // rRange is the result of a + // css::chart2::data::XDataSequence::getSourceRangeRepresentation() + // call that returns the range in the document's current UI notation. + // Creating a FormulaParser defaults to the same notation, for + // parseFormula() do not attempt to override the FormulaConvention + // property with css::sheet::AddressConvention::OOO or some such. + /* TODO: it would be much better to introduce a + * getSourceRangeRepresentation(css::sheet::AddressConvention) to + * return the ranges in a specific convention than converting them with + * the overhead of creating an XFormulaParser for each... */ + uno::Sequence aTokens = xParser->parseFormula( rRange, CellAddress( 0, 0, 0 ) ); + if( xParserProps.is() ) + { + xParserProps->setPropertyValue("FormulaConvention", uno::Any(css::sheet::AddressConvention::XL_OOX) ); + // For referencing named ranges correctly with special excel chart syntax. + xParserProps->setPropertyValue("RefConventionChartOOXML", uno::Any(true) ); + } + aResult = xParser->printFormula( aTokens, CellAddress( 0, 0, 0 ) ); + } + else + { + //FIXME: currently just using simple converter, e.g $Sheet1.$A$1:$C$1 -> Sheet1!$A$1:$C$1 + OUString aRange( rRange ); + if( aRange.startsWith("$") ) + aRange = aRange.copy(1); + aRange = aRange.replaceAll(".$", "!$" ); + aResult = aRange; + } + + return aResult; +} + +void ChartExport::WriteChartObj( const Reference< XShape >& xShape, sal_Int32 nID, sal_Int32 nChartCount ) +{ + FSHelperPtr pFS = GetFS(); + + Reference< XPropertySet > xShapeProps( xShape, UNO_QUERY ); + + pFS->startElementNS(mnXmlNamespace, XML_graphicFrame); + + pFS->startElementNS(mnXmlNamespace, XML_nvGraphicFramePr); + + // TODO: get the correct chart name chart id + OUString sName = "Object 1"; + Reference< XNamed > xNamed( xShape, UNO_QUERY ); + if (xNamed.is()) + sName = xNamed->getName(); + + pFS->startElementNS( mnXmlNamespace, XML_cNvPr, + XML_id, OString::number(nID), + XML_name, sName); + + OUString sURL; + if ( GetProperty( xShapeProps, "URL" ) ) + mAny >>= sURL; + if( !sURL.isEmpty() ) + { + OUString sRelId = mpFB->addRelation( mpFS->getOutputStream(), + oox::getRelationship(Relationship::HYPERLINK), + mpURLTransformer->getTransformedString(sURL), + mpURLTransformer->isExternalURL(sURL)); + + mpFS->singleElementNS(XML_a, XML_hlinkClick, FSNS(XML_r, XML_id), sRelId); + } + pFS->endElementNS(mnXmlNamespace, XML_cNvPr); + + pFS->singleElementNS(mnXmlNamespace, XML_cNvGraphicFramePr); + + if( GetDocumentType() == DOCUMENT_PPTX ) + pFS->singleElementNS(mnXmlNamespace, XML_nvPr); + pFS->endElementNS( mnXmlNamespace, XML_nvGraphicFramePr ); + + // visual chart properties + WriteShapeTransformation( xShape, mnXmlNamespace ); + + // writer chart object + pFS->startElement(FSNS(XML_a, XML_graphic)); + pFS->startElement( FSNS( XML_a, XML_graphicData ), + XML_uri, "http://schemas.openxmlformats.org/drawingml/2006/chart" ); + OUString sId; + const char* sFullPath = nullptr; + const char* sRelativePath = nullptr; + switch( GetDocumentType() ) + { + case DOCUMENT_DOCX: + { + sFullPath = "word/charts/chart"; + sRelativePath = "charts/chart"; + break; + } + case DOCUMENT_PPTX: + { + sFullPath = "ppt/charts/chart"; + sRelativePath = "../charts/chart"; + break; + } + case DOCUMENT_XLSX: + { + sFullPath = "xl/charts/chart"; + sRelativePath = "../charts/chart"; + break; + } + default: + { + sFullPath = "charts/chart"; + sRelativePath = "charts/chart"; + break; + } + } + OUString sFullStream = OUStringBuffer() + .appendAscii(sFullPath) + .append(OUString::number(nChartCount) + ".xml") + .makeStringAndClear(); + OUString sRelativeStream = OUStringBuffer() + .appendAscii(sRelativePath) + .append(OUString::number(nChartCount) + ".xml" ) + .makeStringAndClear(); + FSHelperPtr pChart = CreateOutputStream( + sFullStream, + sRelativeStream, + pFS->getOutputStream(), + "application/vnd.openxmlformats-officedocument.drawingml.chart+xml", + OUStringToOString(oox::getRelationship(Relationship::CHART), RTL_TEXTENCODING_UTF8).getStr(), + &sId ); + + XmlFilterBase* pFB = GetFB(); + pFS->singleElement( FSNS( XML_c, XML_chart ), + FSNS(XML_xmlns, XML_c), pFB->getNamespaceURL(OOX_NS(dmlChart)), + FSNS(XML_xmlns, XML_r), pFB->getNamespaceURL(OOX_NS(officeRel)), + FSNS(XML_r, XML_id), sId ); + + pFS->endElement( FSNS( XML_a, XML_graphicData ) ); + pFS->endElement( FSNS( XML_a, XML_graphic ) ); + pFS->endElementNS( mnXmlNamespace, XML_graphicFrame ); + + SetFS( pChart ); + ExportContent(); +} + +void ChartExport::InitRangeSegmentationProperties( const Reference< chart2::XChartDocument > & xChartDoc ) +{ + if( !xChartDoc.is()) + return; + + try + { + Reference< chart2::data::XDataProvider > xDataProvider( xChartDoc->getDataProvider() ); + OSL_ENSURE( xDataProvider.is(), "No DataProvider" ); + if( xDataProvider.is()) + { + mbHasCategoryLabels = lcl_hasCategoryLabels( xChartDoc ); + } + } + catch( const uno::Exception & ) + { + DBG_UNHANDLED_EXCEPTION("oox"); + } +} + +void ChartExport::ExportContent() +{ + Reference< chart2::XChartDocument > xChartDoc( getModel(), uno::UNO_QUERY ); + OSL_ASSERT( xChartDoc.is() ); + if( !xChartDoc.is() ) + return; + InitRangeSegmentationProperties( xChartDoc ); + // TODO: export chart + ExportContent_( ); +} + +void ChartExport::ExportContent_() +{ + Reference< css::chart::XChartDocument > xChartDoc( getModel(), uno::UNO_QUERY ); + if( xChartDoc.is()) + { + // determine if data comes from the outside + bool bIncludeTable = true; + + Reference< chart2::XChartDocument > xNewDoc( xChartDoc, uno::UNO_QUERY ); + if( xNewDoc.is()) + { + // check if we have own data. If so we must not export the complete + // range string, as this is our only indicator for having own or + // external data. @todo: fix this in the file format! + Reference< lang::XServiceInfo > xDPServiceInfo( xNewDoc->getDataProvider(), uno::UNO_QUERY ); + if( ! (xDPServiceInfo.is() && xDPServiceInfo->getImplementationName() == "com.sun.star.comp.chart.InternalDataProvider" )) + { + bIncludeTable = false; + } + } + exportChartSpace( xChartDoc, bIncludeTable ); + } + else + { + OSL_FAIL( "Couldn't export chart due to wrong XModel" ); + } +} + +void ChartExport::exportChartSpace( const Reference< css::chart::XChartDocument >& xChartDoc, + bool bIncludeTable ) +{ + FSHelperPtr pFS = GetFS(); + XmlFilterBase* pFB = GetFB(); + pFS->startElement( FSNS( XML_c, XML_chartSpace ), + FSNS( XML_xmlns, XML_c ), pFB->getNamespaceURL(OOX_NS(dmlChart)), + FSNS( XML_xmlns, XML_a ), pFB->getNamespaceURL(OOX_NS(dml)), + FSNS( XML_xmlns, XML_r ), pFB->getNamespaceURL(OOX_NS(officeRel))); + // TODO: get the correct editing language + pFS->singleElement(FSNS(XML_c, XML_lang), XML_val, "en-US"); + + pFS->singleElement(FSNS(XML_c, XML_roundedCorners), XML_val, "0"); + + if( !bIncludeTable ) + { + // TODO:external data + } + //XML_chart + exportChart(xChartDoc); + + // TODO: printSettings + // TODO: style + // TODO: text properties + // TODO: shape properties + Reference< XPropertySet > xPropSet = xChartDoc->getArea(); + if( xPropSet.is() ) + exportShapeProps( xPropSet ); + + //XML_externalData + exportExternalData(xChartDoc); + + // export additional shapes in chart + exportAdditionalShapes(xChartDoc); + + pFS->endElement( FSNS( XML_c, XML_chartSpace ) ); +} + +void ChartExport::exportExternalData( const Reference< css::chart::XChartDocument >& xChartDoc ) +{ + // Embedded external data is grab bagged for docx file hence adding export part of + // external data for docx files only. + if(GetDocumentType() != DOCUMENT_DOCX) + return; + + OUString externalDataPath; + Reference< beans::XPropertySet > xDocPropSet( xChartDoc->getDiagram(), uno::UNO_QUERY ); + if( xDocPropSet.is()) + { + try + { + Any aAny( xDocPropSet->getPropertyValue( "ExternalData" )); + aAny >>= externalDataPath; + } + catch( beans::UnknownPropertyException & ) + { + SAL_WARN("oox", "Required property not found in ChartDocument"); + } + } + if(externalDataPath.isEmpty()) + return; + + // Here adding external data entry to relationship. + OUString relationPath = externalDataPath; + // Converting absolute path to relative path. + if( externalDataPath[ 0 ] != '.' && externalDataPath[ 1 ] != '.') + { + sal_Int32 nSepPos = externalDataPath.indexOf( '/', 0 ); + if( nSepPos > 0) + { + relationPath = relationPath.copy( nSepPos, ::std::max< sal_Int32 >( externalDataPath.getLength(), 0 ) - nSepPos ); + relationPath = ".." + relationPath; + } + } + FSHelperPtr pFS = GetFS(); + OUString type = oox::getRelationship(Relationship::PACKAGE); + if (relationPath.endsWith(".bin")) + type = oox::getRelationship(Relationship::OLEOBJECT); + + OUString sRelId = GetFB()->addRelation(pFS->getOutputStream(), + type, + relationPath); + pFS->singleElementNS(XML_c, XML_externalData, FSNS(XML_r, XML_id), sRelId); +} + +void ChartExport::exportAdditionalShapes( const Reference< css::chart::XChartDocument >& xChartDoc ) +{ + Reference< beans::XPropertySet > xDocPropSet(xChartDoc, uno::UNO_QUERY); + if (!xDocPropSet.is()) + return; + + css::uno::Reference< css::drawing::XShapes > mxAdditionalShapes; + // get a sequence of non-chart shapes + try + { + Any aShapesAny = xDocPropSet->getPropertyValue("AdditionalShapes"); + if( (aShapesAny >>= mxAdditionalShapes) && mxAdditionalShapes.is() ) + { + OUString sId; + const char* sFullPath = nullptr; + const char* sRelativePath = nullptr; + sal_Int32 nDrawing = getNewDrawingUniqueId(); + + switch (GetDocumentType()) + { + case DOCUMENT_DOCX: + { + sFullPath = "word/drawings/drawing"; + sRelativePath = "../drawings/drawing"; + break; + } + case DOCUMENT_PPTX: + { + sFullPath = "ppt/drawings/drawing"; + sRelativePath = "../drawings/drawing"; + break; + } + case DOCUMENT_XLSX: + { + sFullPath = "xl/drawings/drawing"; + sRelativePath = "../drawings/drawing"; + break; + } + default: + { + sFullPath = "drawings/drawing"; + sRelativePath = "drawings/drawing"; + break; + } + } + OUString sFullStream = OUStringBuffer() + .appendAscii(sFullPath) + .append(OUString::number(nDrawing) + ".xml") + .makeStringAndClear(); + OUString sRelativeStream = OUStringBuffer() + .appendAscii(sRelativePath) + .append(OUString::number(nDrawing) + ".xml") + .makeStringAndClear(); + + sax_fastparser::FSHelperPtr pDrawing = CreateOutputStream( + sFullStream, + sRelativeStream, + GetFS()->getOutputStream(), + "application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml", + OUStringToOString(oox::getRelationship(Relationship::CHARTUSERSHAPES), RTL_TEXTENCODING_UTF8).getStr(), + &sId); + + GetFS()->singleElementNS(XML_c, XML_userShapes, FSNS(XML_r, XML_id), sId); + + XmlFilterBase* pFB = GetFB(); + pDrawing->startElement(FSNS(XML_c, XML_userShapes), + FSNS(XML_xmlns, XML_cdr), pFB->getNamespaceURL(OOX_NS(dmlChartDr)), + FSNS(XML_xmlns, XML_a), pFB->getNamespaceURL(OOX_NS(dml)), + FSNS(XML_xmlns, XML_c), pFB->getNamespaceURL(OOX_NS(dmlChart)), + FSNS(XML_xmlns, XML_r), pFB->getNamespaceURL(OOX_NS(officeRel))); + + const sal_Int32 nShapeCount(mxAdditionalShapes->getCount()); + for (sal_Int32 nShapeId = 0; nShapeId < nShapeCount; nShapeId++) + { + Reference< drawing::XShape > xShape; + mxAdditionalShapes->getByIndex(nShapeId) >>= xShape; + SAL_WARN_IF(!xShape.is(), "xmloff.chart", "Shape without an XShape?"); + if (!xShape.is()) + continue; + + // TODO: absSizeAnchor: we import both (absSizeAnchor and relSizeAnchor), but there is no essential difference between them. + pDrawing->startElement(FSNS(XML_cdr, XML_relSizeAnchor)); + uno::Reference< beans::XPropertySet > xShapeProperties(xShape, uno::UNO_QUERY); + if( xShapeProperties.is() ) + { + Reference xVisObject(mxChartModel, uno::UNO_QUERY); + awt::Size aPageSize = xVisObject->getVisualAreaSize(embed::Aspects::MSOLE_CONTENT); + WriteFromTo( xShape, aPageSize, pDrawing ); + + ShapeExport aExport(XML_cdr, pDrawing, nullptr, GetFB(), GetDocumentType(), nullptr, true); + aExport.WriteShape(xShape); + } + pDrawing->endElement(FSNS(XML_cdr, XML_relSizeAnchor)); + } + pDrawing->endElement(FSNS(XML_c, XML_userShapes)); + } + } + catch (const uno::Exception&) + { + TOOLS_INFO_EXCEPTION("xmloff.chart", "AdditionalShapes not found"); + } +} + +void ChartExport::exportChart( const Reference< css::chart::XChartDocument >& xChartDoc ) +{ + Reference< chart2::XChartDocument > xNewDoc( xChartDoc, uno::UNO_QUERY ); + mxDiagram.set( xChartDoc->getDiagram() ); + if( xNewDoc.is()) + mxNewDiagram.set( xNewDoc->getFirstDiagram()); + + // get Properties of ChartDocument + bool bHasMainTitle = false; + OUString aSubTitle; + bool bHasLegend = false; + Reference< beans::XPropertySet > xDocPropSet( xChartDoc, uno::UNO_QUERY ); + if( xDocPropSet.is()) + { + try + { + Any aAny( xDocPropSet->getPropertyValue("HasMainTitle")); + aAny >>= bHasMainTitle; + aAny = xDocPropSet->getPropertyValue("HasLegend"); + aAny >>= bHasLegend; + } + catch( beans::UnknownPropertyException & ) + { + SAL_WARN("oox", "Required property not found in ChartDocument"); + } + } // if( xDocPropSet.is()) + + Reference< beans::XPropertySet > xPropSubTitle( xChartDoc->getSubTitle(), UNO_QUERY ); + if( xPropSubTitle.is()) + { + try + { + xPropSubTitle->getPropertyValue("String") >>= aSubTitle; + } + catch( beans::UnknownPropertyException & ) + { + } + } + + // chart element + FSHelperPtr pFS = GetFS(); + pFS->startElement(FSNS(XML_c, XML_chart)); + + // titles + if( bHasMainTitle ) + { + exportTitle( xChartDoc->getTitle(), !aSubTitle.isEmpty() ? &aSubTitle : nullptr ); + pFS->singleElement(FSNS(XML_c, XML_autoTitleDeleted), XML_val, "0"); + } + else if( !aSubTitle.isEmpty() ) + { + exportTitle( xChartDoc->getSubTitle(), nullptr ); + pFS->singleElement(FSNS(XML_c, XML_autoTitleDeleted), XML_val, "0"); + } + else + { + pFS->singleElement(FSNS(XML_c, XML_autoTitleDeleted), XML_val, "1"); + } + + InitPlotArea( ); + if( mbIs3DChart ) + { + exportView3D(); + + // floor + Reference< beans::XPropertySet > xFloor = mxNewDiagram->getFloor(); + if( xFloor.is() ) + { + pFS->startElement(FSNS(XML_c, XML_floor)); + exportShapeProps( xFloor ); + pFS->endElement( FSNS( XML_c, XML_floor ) ); + } + + // LibreOffice doesn't distinguish between sideWall and backWall (both are using the same color). + // It is controlled by the same Wall property. + Reference< beans::XPropertySet > xWall = mxNewDiagram->getWall(); + if( xWall.is() ) + { + // sideWall + pFS->startElement(FSNS(XML_c, XML_sideWall)); + exportShapeProps( xWall ); + pFS->endElement( FSNS( XML_c, XML_sideWall ) ); + + // backWall + pFS->startElement(FSNS(XML_c, XML_backWall)); + exportShapeProps( xWall ); + pFS->endElement( FSNS( XML_c, XML_backWall ) ); + } + + } + // plot area + exportPlotArea( xChartDoc ); + // legend + if( bHasLegend ) + exportLegend( xChartDoc ); + + uno::Reference xDiagramPropSet(xChartDoc->getDiagram(), uno::UNO_QUERY); + uno::Any aPlotVisOnly = xDiagramPropSet->getPropertyValue("IncludeHiddenCells"); + bool bIncludeHiddenCells = false; + aPlotVisOnly >>= bIncludeHiddenCells; + pFS->singleElement(FSNS(XML_c, XML_plotVisOnly), XML_val, ToPsz10(!bIncludeHiddenCells)); + + exportMissingValueTreatment(Reference(mxDiagram, uno::UNO_QUERY)); + + pFS->endElement( FSNS( XML_c, XML_chart ) ); +} + +void ChartExport::exportMissingValueTreatment(const uno::Reference& xPropSet) +{ + if (!xPropSet.is()) + return; + + sal_Int32 nVal = 0; + uno::Any aAny = xPropSet->getPropertyValue("MissingValueTreatment"); + if (!(aAny >>= nVal)) + return; + + const char* pVal = nullptr; + switch (nVal) + { + case cssc::MissingValueTreatment::LEAVE_GAP: + pVal = "gap"; + break; + case cssc::MissingValueTreatment::USE_ZERO: + pVal = "zero"; + break; + case cssc::MissingValueTreatment::CONTINUE: + pVal = "span"; + break; + default: + SAL_WARN("oox", "unknown MissingValueTreatment value"); + break; + } + + FSHelperPtr pFS = GetFS(); + pFS->singleElement(FSNS(XML_c, XML_dispBlanksAs), XML_val, pVal); +} + +void ChartExport::exportLegend( const Reference< css::chart::XChartDocument >& xChartDoc ) +{ + FSHelperPtr pFS = GetFS(); + pFS->startElement(FSNS(XML_c, XML_legend)); + + Reference< beans::XPropertySet > xProp( xChartDoc->getLegend(), uno::UNO_QUERY ); + if( xProp.is() ) + { + // position + css::chart::ChartLegendPosition aLegendPos = css::chart::ChartLegendPosition_NONE; + try + { + Any aAny( xProp->getPropertyValue( "Alignment" )); + aAny >>= aLegendPos; + } + catch( beans::UnknownPropertyException & ) + { + SAL_WARN("oox", "Property Align not found in ChartLegend"); + } + + const char* strPos = nullptr; + switch( aLegendPos ) + { + case css::chart::ChartLegendPosition_LEFT: + strPos = "l"; + break; + case css::chart::ChartLegendPosition_RIGHT: + strPos = "r"; + break; + case css::chart::ChartLegendPosition_TOP: + strPos = "t"; + break; + case css::chart::ChartLegendPosition_BOTTOM: + strPos = "b"; + break; + case css::chart::ChartLegendPosition_NONE: + case css::chart::ChartLegendPosition::ChartLegendPosition_MAKE_FIXED_SIZE: + // nothing + break; + } + + if( strPos != nullptr ) + { + pFS->singleElement(FSNS(XML_c, XML_legendPos), XML_val, strPos); + } + + // legendEntry + Reference xCooSysContainer(mxNewDiagram, UNO_QUERY_THROW); + const Sequence> xCooSysSequence(xCooSysContainer->getCoordinateSystems()); + + sal_Int32 nIndex = 0; + bool bShowLegendEntry; + for (const auto& rCooSys : xCooSysSequence) + { + PropertySet aCooSysProp(rCooSys); + bool bSwapXAndY = aCooSysProp.getBoolProperty(PROP_SwapXAndYAxis); + + Reference xChartTypeContainer(rCooSys, UNO_QUERY_THROW); + const Sequence> xChartTypeSequence(xChartTypeContainer->getChartTypes()); + if (!xChartTypeSequence.hasElements()) + continue; + + for (const auto& rCT : xChartTypeSequence) + { + Reference xDSCont(rCT, UNO_QUERY); + if (!xDSCont.is()) + continue; + + OUString aChartType(rCT->getChartType()); + bool bIsPie = lcl_getChartType(aChartType) == chart::TYPEID_PIE; + if (bIsPie) + { + PropertySet xChartTypeProp(rCT); + bIsPie = !xChartTypeProp.getBoolProperty(PROP_UseRings); + } + const Sequence> aDataSeriesSeq = xDSCont->getDataSeries(); + if (bSwapXAndY) + nIndex += aDataSeriesSeq.getLength() - 1; + for (const auto& rDataSeries : aDataSeriesSeq) + { + PropertySet aSeriesProp(rDataSeries); + bool bVaryColorsByPoint = aSeriesProp.getBoolProperty(PROP_VaryColorsByPoint); + if (bVaryColorsByPoint || bIsPie) + { + Sequence deletedLegendEntriesSeq; + aSeriesProp.getProperty(deletedLegendEntriesSeq, PROP_DeletedLegendEntries); + for (const auto& deletedLegendEntry : std::as_const(deletedLegendEntriesSeq)) + { + pFS->startElement(FSNS(XML_c, XML_legendEntry)); + pFS->singleElement(FSNS(XML_c, XML_idx), XML_val, + OString::number(nIndex + deletedLegendEntry)); + pFS->singleElement(FSNS(XML_c, XML_delete), XML_val, "1"); + pFS->endElement(FSNS(XML_c, XML_legendEntry)); + } + Reference xDSrc(rDataSeries, UNO_QUERY); + if (!xDSrc.is()) + continue; + + const Sequence> aDataSeqs = xDSrc->getDataSequences(); + for (const auto& rDataSeq : aDataSeqs) + { + Reference xValues = rDataSeq->getValues(); + if (!xValues.is()) + continue; + + sal_Int32 nDataSeqSize = xValues->getData().getLength(); + nIndex += nDataSeqSize; + } + } + else + { + bShowLegendEntry = aSeriesProp.getBoolProperty(PROP_ShowLegendEntry); + if (!bShowLegendEntry) + { + pFS->startElement(FSNS(XML_c, XML_legendEntry)); + pFS->singleElement(FSNS(XML_c, XML_idx), XML_val, + OString::number(nIndex)); + pFS->singleElement(FSNS(XML_c, XML_delete), XML_val, "1"); + pFS->endElement(FSNS(XML_c, XML_legendEntry)); + } + bSwapXAndY ? nIndex-- : nIndex++; + } + } + if (bSwapXAndY) + nIndex += aDataSeriesSeq.getLength() + 1; + } + } + + uno::Any aRelativePos = xProp->getPropertyValue("RelativePosition"); + if (aRelativePos.hasValue()) + { + pFS->startElement(FSNS(XML_c, XML_layout)); + pFS->startElement(FSNS(XML_c, XML_manualLayout)); + + pFS->singleElement(FSNS(XML_c, XML_xMode), XML_val, "edge"); + pFS->singleElement(FSNS(XML_c, XML_yMode), XML_val, "edge"); + chart2::RelativePosition aPos = aRelativePos.get(); + + const double x = aPos.Primary; + const double y = aPos.Secondary; + + pFS->singleElement(FSNS(XML_c, XML_x), XML_val, OString::number(x)); + pFS->singleElement(FSNS(XML_c, XML_y), XML_val, OString::number(y)); + + uno::Any aRelativeSize = xProp->getPropertyValue("RelativeSize"); + if (aRelativeSize.hasValue()) + { + chart2::RelativeSize aSize = aRelativeSize.get(); + + const double w = aSize.Primary; + const double h = aSize.Secondary; + + pFS->singleElement(FSNS(XML_c, XML_w), XML_val, OString::number(w)); + + pFS->singleElement(FSNS(XML_c, XML_h), XML_val, OString::number(h)); + } + + SAL_WARN_IF(aPos.Anchor != css::drawing::Alignment_TOP_LEFT, "oox", "unsupported anchor position"); + + pFS->endElement(FSNS(XML_c, XML_manualLayout)); + pFS->endElement(FSNS(XML_c, XML_layout)); + } + + if (strPos != nullptr) + { + uno::Any aOverlay = xProp->getPropertyValue("Overlay"); + if(aOverlay.get()) + pFS->singleElement(FSNS(XML_c, XML_overlay), XML_val, "1"); + else + pFS->singleElement(FSNS(XML_c, XML_overlay), XML_val, "0"); + } + + // shape properties + exportShapeProps( xProp ); + + // draw-chart:txPr text properties + exportTextProps( xProp ); + } + + pFS->endElement( FSNS( XML_c, XML_legend ) ); +} + +void ChartExport::exportTitle( const Reference< XShape >& xShape, const OUString* pSubText) +{ + OUString sText; + Reference< beans::XPropertySet > xPropSet( xShape, uno::UNO_QUERY ); + if( xPropSet.is()) + { + xPropSet->getPropertyValue("String") >>= sText; + } + + // tdf#101322: add subtitle to title + if( pSubText ) + sText = sText.isEmpty() ? *pSubText : sText + "\n" + *pSubText; + + if( sText.isEmpty() ) + return; + + FSHelperPtr pFS = GetFS(); + pFS->startElement(FSNS(XML_c, XML_title)); + + pFS->startElement(FSNS(XML_c, XML_tx)); + pFS->startElement(FSNS(XML_c, XML_rich)); + + // TODO: bodyPr + const char* sWritingMode = nullptr; + bool bVertical = false; + xPropSet->getPropertyValue("StackedText") >>= bVertical; + if( bVertical ) + sWritingMode = "wordArtVert"; + + sal_Int32 nRotation = 0; + xPropSet->getPropertyValue("TextRotation") >>= nRotation; + + pFS->singleElement( FSNS( XML_a, XML_bodyPr ), + XML_vert, sWritingMode, + XML_rot, oox::drawingml::calcRotationValue(nRotation) ); + // TODO: lstStyle + pFS->singleElement(FSNS(XML_a, XML_lstStyle)); + // FIXME: handle multiple paragraphs to parse aText + pFS->startElement(FSNS(XML_a, XML_p)); + + pFS->startElement(FSNS(XML_a, XML_pPr)); + + bool bDummy = false; + sal_Int32 nDummy; + WriteRunProperties(xPropSet, false, XML_defRPr, true, bDummy, nDummy ); + + pFS->endElement( FSNS( XML_a, XML_pPr ) ); + + pFS->startElement(FSNS(XML_a, XML_r)); + bDummy = false; + WriteRunProperties( xPropSet, false, XML_rPr, true, bDummy, nDummy ); + pFS->startElement(FSNS(XML_a, XML_t)); + pFS->writeEscaped( sText ); + pFS->endElement( FSNS( XML_a, XML_t ) ); + pFS->endElement( FSNS( XML_a, XML_r ) ); + + pFS->endElement( FSNS( XML_a, XML_p ) ); + + pFS->endElement( FSNS( XML_c, XML_rich ) ); + pFS->endElement( FSNS( XML_c, XML_tx ) ); + + uno::Any aManualLayout = xPropSet->getPropertyValue("RelativePosition"); + if (aManualLayout.hasValue()) + { + pFS->startElement(FSNS(XML_c, XML_layout)); + pFS->startElement(FSNS(XML_c, XML_manualLayout)); + pFS->singleElement(FSNS(XML_c, XML_xMode), XML_val, "edge"); + pFS->singleElement(FSNS(XML_c, XML_yMode), XML_val, "edge"); + + Reference xVisObject(mxChartModel, uno::UNO_QUERY); + awt::Size aPageSize = xVisObject->getVisualAreaSize(embed::Aspects::MSOLE_CONTENT); + + awt::Size aSize = xShape->getSize(); + awt::Point aPos2 = xShape->getPosition(); + // rotated shapes need special handling... + double fSin = fabs(sin(basegfx::deg2rad<100>(nRotation))); + // remove part of height from X direction, if title is rotated down + if( nRotation*0.01 > 180.0 ) + aPos2.X -= static_cast(fSin * aSize.Height + 0.5); + // remove part of width from Y direction, if title is rotated up + else if( nRotation*0.01 > 0.0 ) + aPos2.Y -= static_cast(fSin * aSize.Width + 0.5); + + double x = static_cast(aPos2.X) / static_cast(aPageSize.Width); + double y = static_cast(aPos2.Y) / static_cast(aPageSize.Height); + /* + pFS->singleElement(FSNS(XML_c, XML_wMode), XML_val, "edge"); + pFS->singleElement(FSNS(XML_c, XML_hMode), XML_val, "edge"); + */ + pFS->singleElement(FSNS(XML_c, XML_x), XML_val, OString::number(x)); + pFS->singleElement(FSNS(XML_c, XML_y), XML_val, OString::number(y)); + /* + pFS->singleElement(FSNS(XML_c, XML_w), XML_val, ""); + pFS->singleElement(FSNS(XML_c, XML_h), XML_val, ""); + */ + pFS->endElement(FSNS(XML_c, XML_manualLayout)); + pFS->endElement(FSNS(XML_c, XML_layout)); + } + + pFS->singleElement(FSNS(XML_c, XML_overlay), XML_val, "0"); + + // shape properties + if( xPropSet.is() ) + { + exportShapeProps( xPropSet ); + } + + pFS->endElement( FSNS( XML_c, XML_title ) ); +} + +namespace { + + std::vector > > splitDataSeriesByAxis(const Reference< chart2::XChartType >& xChartType) + { + std::vector > > aSplitSeries; + std::map aMapAxisToIndex; + + Reference< chart2::XDataSeriesContainer > xDSCnt(xChartType, uno::UNO_QUERY); + if (xDSCnt.is()) + { + sal_Int32 nAxisIndexOfFirstSeries = -1; + const Sequence< Reference< chart2::XDataSeries > > aSeriesSeq(xDSCnt->getDataSeries()); + for (const uno::Reference& xSeries : aSeriesSeq) + { + Reference xPropSet(xSeries, uno::UNO_QUERY); + if (!xPropSet.is()) + continue; + + sal_Int32 nAxisIndex = -1; + uno::Any aAny = xPropSet->getPropertyValue("AttachedAxisIndex"); + aAny >>= nAxisIndex; + size_t nVectorPos = 0; + if (nAxisIndexOfFirstSeries == -1) + { + nAxisIndexOfFirstSeries = nAxisIndex; + } + + auto it = aMapAxisToIndex.find(nAxisIndex); + if (it == aMapAxisToIndex.end()) + { + aSplitSeries.emplace_back(); + nVectorPos = aSplitSeries.size() - 1; + aMapAxisToIndex.insert(std::pair(nAxisIndex, nVectorPos)); + } + else + { + nVectorPos = it->second; + } + + uno::Sequence >& rAxisSeriesSeq = aSplitSeries[nVectorPos]; + sal_Int32 nLength = rAxisSeriesSeq.getLength(); + rAxisSeriesSeq.realloc(nLength + 1); + rAxisSeriesSeq.getArray()[nLength] = xSeries; + } + // if the first series attached to secondary axis, then export those series first, which are attached to primary axis + // also the MS Office export every time in this order + if (aSplitSeries.size() > 1 && nAxisIndexOfFirstSeries == 1) + { + std::swap(aSplitSeries[0], aSplitSeries[1]); + } + } + + return aSplitSeries; + } + +} + +void ChartExport::exportPlotArea(const Reference< css::chart::XChartDocument >& xChartDoc) +{ + Reference< chart2::XCoordinateSystemContainer > xBCooSysCnt( mxNewDiagram, uno::UNO_QUERY ); + if( ! xBCooSysCnt.is()) + return; + + // plot-area element + + FSHelperPtr pFS = GetFS(); + pFS->startElement(FSNS(XML_c, XML_plotArea)); + + Reference xWall(mxNewDiagram, uno::UNO_QUERY); + if( xWall.is() ) + { + uno::Any aAny = xWall->getPropertyValue("RelativePosition"); + if (aAny.hasValue()) + { + chart2::RelativePosition aPos = aAny.get(); + aAny = xWall->getPropertyValue("RelativeSize"); + chart2::RelativeSize aSize = aAny.get(); + uno::Reference< css::chart::XDiagramPositioning > xDiagramPositioning( xChartDoc->getDiagram(), uno::UNO_QUERY ); + exportManualLayout(aPos, aSize, xDiagramPositioning->isExcludingDiagramPositioning() ); + } + } + + // chart type + const Sequence< Reference< chart2::XCoordinateSystem > > + aCooSysSeq( xBCooSysCnt->getCoordinateSystems()); + + // tdf#123647 Save empty chart as empty bar chart. + if (!aCooSysSeq.hasElements()) + { + pFS->startElement(FSNS(XML_c, XML_barChart)); + pFS->singleElement(FSNS(XML_c, XML_barDir), XML_val, "col"); + pFS->singleElement(FSNS(XML_c, XML_grouping), XML_val, "clustered"); + pFS->singleElement(FSNS(XML_c, XML_varyColors), XML_val, "0"); + exportAxesId(true); + pFS->endElement(FSNS(XML_c, XML_barChart)); + } + + for( const auto& rCS : aCooSysSeq ) + { + Reference< chart2::XChartTypeContainer > xCTCnt( rCS, uno::UNO_QUERY ); + if( ! xCTCnt.is()) + continue; + mnSeriesCount=0; + const Sequence< Reference< chart2::XChartType > > aCTSeq( xCTCnt->getChartTypes()); + for( const auto& rCT : aCTSeq ) + { + Reference< chart2::XDataSeriesContainer > xDSCnt( rCT, uno::UNO_QUERY ); + if( ! xDSCnt.is()) + return; + Reference< chart2::XChartType > xChartType( rCT, uno::UNO_QUERY ); + if( ! xChartType.is()) + continue; + // note: if xDSCnt.is() then also aCTSeq[nCTIdx] + OUString aChartType( xChartType->getChartType()); + sal_Int32 eChartType = lcl_getChartType( aChartType ); + switch( eChartType ) + { + case chart::TYPEID_BAR: + { + exportBarChart( xChartType ); + break; + } + case chart::TYPEID_AREA: + { + exportAreaChart( xChartType ); + break; + } + case chart::TYPEID_LINE: + { + exportLineChart( xChartType ); + break; + } + case chart::TYPEID_BUBBLE: + { + exportBubbleChart( xChartType ); + break; + } + case chart::TYPEID_OFPIE: + { + break; + } + case chart::TYPEID_DOUGHNUT: + case chart::TYPEID_PIE: + { + exportPieChart( xChartType ); + break; + } + case chart::TYPEID_RADARLINE: + case chart::TYPEID_RADARAREA: + { + exportRadarChart( xChartType ); + break; + } + case chart::TYPEID_SCATTER: + { + exportScatterChart( xChartType ); + break; + } + case chart::TYPEID_STOCK: + { + exportStockChart( xChartType ); + break; + } + case chart::TYPEID_SURFACE: + { + exportSurfaceChart( xChartType ); + break; + } + default: + { + SAL_WARN("oox", "ChartExport::exportPlotArea -- not support chart type"); + break; + } + } + + } + } + //Axis Data + exportAxes( ); + // Data Table + exportDataTable(); + + // shape properties + /* + * Export the Plot area Shape Properties + * eg: Fill and Outline + */ + Reference< css::chart::X3DDisplay > xWallFloorSupplier( mxDiagram, uno::UNO_QUERY ); + // tdf#114139 For 2D charts Plot Area equivalent is Chart Wall. + // Unfortunately LibreOffice doesn't have Plot Area equivalent for 3D charts. + // It means that Plot Area couldn't be displayed and changed for 3D chars in LibreOffice. + // We cannot write Wall attributes into Plot Area for 3D charts, because Wall us used as background wall. + if( !mbIs3DChart && xWallFloorSupplier.is() ) + { + Reference< beans::XPropertySet > xWallPropSet = xWallFloorSupplier->getWall(); + if( xWallPropSet.is() ) + { + uno::Any aAny = xWallPropSet->getPropertyValue("LineStyle"); + sal_Int32 eChartType = getChartType( ); + // Export LineStyle_NONE instead of default linestyle of PlotArea border, because LibreOffice + // make invisible the Wall shape properties, in case of these charts. Or in the future set + // the default LineStyle of these charts to LineStyle_NONE. + bool noSupportWallProp = ( (eChartType == chart::TYPEID_PIE) || (eChartType == chart::TYPEID_RADARLINE) || (eChartType == chart::TYPEID_RADARAREA) ); + if ( noSupportWallProp && (aAny != drawing::LineStyle_NONE) ) + { + xWallPropSet->setPropertyValue( "LineStyle", uno::Any(drawing::LineStyle_NONE) ); + } + exportShapeProps( xWallPropSet ); + } + } + + pFS->endElement( FSNS( XML_c, XML_plotArea ) ); + +} + +void ChartExport::exportManualLayout(const css::chart2::RelativePosition& rPos, + const css::chart2::RelativeSize& rSize, + const bool bIsExcludingDiagramPositioning) +{ + FSHelperPtr pFS = GetFS(); + pFS->startElement(FSNS(XML_c, XML_layout)); + pFS->startElement(FSNS(XML_c, XML_manualLayout)); + + // By default layoutTarget is set to "outer" and we shouldn't save it in that case + if ( bIsExcludingDiagramPositioning ) + { + pFS->singleElement(FSNS(XML_c, XML_layoutTarget), XML_val, "inner"); + } + pFS->singleElement(FSNS(XML_c, XML_xMode), XML_val, "edge"); + pFS->singleElement(FSNS(XML_c, XML_yMode), XML_val, "edge"); + + double x = rPos.Primary; + double y = rPos.Secondary; + const double w = rSize.Primary; + const double h = rSize.Secondary; + switch (rPos.Anchor) + { + case drawing::Alignment_LEFT: + y -= (h/2); + break; + case drawing::Alignment_TOP_LEFT: + break; + case drawing::Alignment_BOTTOM_LEFT: + y -= h; + break; + case drawing::Alignment_TOP: + x -= (w/2); + break; + case drawing::Alignment_CENTER: + x -= (w/2); + y -= (h/2); + break; + case drawing::Alignment_BOTTOM: + x -= (w/2); + y -= h; + break; + case drawing::Alignment_TOP_RIGHT: + x -= w; + break; + case drawing::Alignment_BOTTOM_RIGHT: + x -= w; + y -= h; + break; + case drawing::Alignment_RIGHT: + y -= (h/2); + x -= w; + break; + default: + SAL_WARN("oox", "unhandled alignment case for manual layout export " << static_cast(rPos.Anchor)); + } + + pFS->singleElement(FSNS(XML_c, XML_x), XML_val, OString::number(x)); + + pFS->singleElement(FSNS(XML_c, XML_y), XML_val, OString::number(y)); + + pFS->singleElement(FSNS(XML_c, XML_w), XML_val, OString::number(w)); + + pFS->singleElement(FSNS(XML_c, XML_h), XML_val, OString::number(h)); + + pFS->endElement(FSNS(XML_c, XML_manualLayout)); + pFS->endElement(FSNS(XML_c, XML_layout)); +} + +void ChartExport::exportFill( const Reference< XPropertySet >& xPropSet ) +{ + // Similar to DrawingML::WriteFill, but gradient access via name + if (!GetProperty( xPropSet, "FillStyle" )) + return; + FillStyle aFillStyle(FillStyle_NONE); + mAny >>= aFillStyle; + + // map full transparent background to no fill + if (aFillStyle == FillStyle_SOLID && GetProperty( xPropSet, "FillTransparence" )) + { + sal_Int16 nVal = 0; + mAny >>= nVal; + if ( nVal == 100 ) + aFillStyle = FillStyle_NONE; + } + OUString sFillTransparenceGradientName; + if (aFillStyle == FillStyle_SOLID + && GetProperty(xPropSet, "FillTransparenceGradientName") && (mAny >>= sFillTransparenceGradientName) + && !sFillTransparenceGradientName.isEmpty()) + { + awt::Gradient aTransparenceGradient; + uno::Reference< lang::XMultiServiceFactory > xFact( getModel(), uno::UNO_QUERY ); + uno::Reference< container::XNameAccess > xTransparenceGradient(xFact->createInstance("com.sun.star.drawing.TransparencyGradientTable"), uno::UNO_QUERY); + uno::Any rTransparenceValue = xTransparenceGradient->getByName(sFillTransparenceGradientName); + rTransparenceValue >>= aTransparenceGradient; + if (aTransparenceGradient.StartColor == 0xffffff && aTransparenceGradient.EndColor == 0xffffff) + aFillStyle = FillStyle_NONE; + } + switch( aFillStyle ) + { + case FillStyle_SOLID: + exportSolidFill(xPropSet); + break; + case FillStyle_GRADIENT : + exportGradientFill( xPropSet ); + break; + case FillStyle_BITMAP : + exportBitmapFill( xPropSet ); + break; + case FillStyle_HATCH: + exportHatch(xPropSet); + break; + case FillStyle_NONE: + mpFS->singleElementNS(XML_a, XML_noFill); + break; + default: + ; + } +} + +void ChartExport::exportSolidFill(const Reference< XPropertySet >& xPropSet) +{ + // Similar to DrawingML::WriteSolidFill, but gradient access via name + // and currently no InteropGrabBag + // get fill color + if (!GetProperty( xPropSet, "FillColor" )) + return; + sal_uInt32 nFillColor = mAny.get(); + + sal_Int32 nAlpha = MAX_PERCENT; + if (GetProperty( xPropSet, "FillTransparence" )) + { + sal_Int32 nTransparency = 0; + mAny >>= nTransparency; + // Calculate alpha value (see oox/source/drawingml/color.cxx : getTransparency()) + nAlpha = (MAX_PERCENT - ( PER_PERCENT * nTransparency ) ); + } + // OOXML has no separate transparence gradient but uses transparency in the gradient stops. + // So we merge transparency and color and use gradient fill in such case. + awt::Gradient aTransparenceGradient; + bool bNeedGradientFill(false); + OUString sFillTransparenceGradientName; + if (GetProperty(xPropSet, "FillTransparenceGradientName") + && (mAny >>= sFillTransparenceGradientName) + && !sFillTransparenceGradientName.isEmpty()) + { + uno::Reference< lang::XMultiServiceFactory > xFact( getModel(), uno::UNO_QUERY ); + uno::Reference< container::XNameAccess > xTransparenceGradient(xFact->createInstance("com.sun.star.drawing.TransparencyGradientTable"), uno::UNO_QUERY); + uno::Any rTransparenceValue = xTransparenceGradient->getByName(sFillTransparenceGradientName); + rTransparenceValue >>= aTransparenceGradient; + if (aTransparenceGradient.StartColor != aTransparenceGradient.EndColor) + bNeedGradientFill = true; + else if (aTransparenceGradient.StartColor != 0) + nAlpha = lcl_getAlphaFromTransparenceGradient(aTransparenceGradient, true); + } + // write XML + if (bNeedGradientFill) + { + awt::Gradient aPseudoColorGradient; + aPseudoColorGradient.XOffset = aTransparenceGradient.XOffset; + aPseudoColorGradient.YOffset = aTransparenceGradient.YOffset; + aPseudoColorGradient.StartIntensity = 100; + aPseudoColorGradient.EndIntensity = 100; + aPseudoColorGradient.Angle = aTransparenceGradient.Angle; + aPseudoColorGradient.Border = aTransparenceGradient.Border; + aPseudoColorGradient.Style = aTransparenceGradient.Style; + aPseudoColorGradient.StartColor = nFillColor; + aPseudoColorGradient.EndColor = nFillColor; + aPseudoColorGradient.StepCount = aTransparenceGradient.StepCount; + mpFS->startElementNS(XML_a, XML_gradFill, XML_rotWithShape, "0"); + WriteGradientFill(aPseudoColorGradient, aTransparenceGradient); + mpFS->endElementNS(XML_a, XML_gradFill); + } + else + WriteSolidFill(::Color(ColorTransparency, nFillColor & 0xffffff), nAlpha); +} + +void ChartExport::exportHatch( const Reference< XPropertySet >& xPropSet ) +{ + if (!xPropSet.is()) + return; + + if (GetProperty(xPropSet, "FillHatchName")) + { + OUString aHatchName; + mAny >>= aHatchName; + uno::Reference< lang::XMultiServiceFactory > xFact( getModel(), uno::UNO_QUERY ); + uno::Reference< container::XNameAccess > xHatchTable( xFact->createInstance("com.sun.star.drawing.HatchTable"), uno::UNO_QUERY ); + uno::Any rValue = xHatchTable->getByName(aHatchName); + css::drawing::Hatch aHatch; + rValue >>= aHatch; + WritePattFill(xPropSet, aHatch); + } + +} + +void ChartExport::exportBitmapFill( const Reference< XPropertySet >& xPropSet ) +{ + if( !xPropSet.is() ) + return; + + OUString sFillBitmapName; + xPropSet->getPropertyValue("FillBitmapName") >>= sFillBitmapName; + + uno::Reference< lang::XMultiServiceFactory > xFact( getModel(), uno::UNO_QUERY ); + try + { + uno::Reference< container::XNameAccess > xBitmapTable( xFact->createInstance("com.sun.star.drawing.BitmapTable"), uno::UNO_QUERY ); + uno::Any rValue = xBitmapTable->getByName( sFillBitmapName ); + if (rValue.has>()) + { + uno::Reference xBitmap = rValue.get>(); + uno::Reference xGraphic(xBitmap, uno::UNO_QUERY); + if (xGraphic.is()) + { + WriteXGraphicBlipFill(xPropSet, xGraphic, XML_a, true, true); + } + } + } + catch (const uno::Exception &) + { + TOOLS_WARN_EXCEPTION("oox", "ChartExport::exportBitmapFill"); + } +} + +void ChartExport::exportGradientFill( const Reference< XPropertySet >& xPropSet ) +{ + if( !xPropSet.is() ) + return; + + OUString sFillGradientName; + xPropSet->getPropertyValue("FillGradientName") >>= sFillGradientName; + + uno::Reference< lang::XMultiServiceFactory > xFact( getModel(), uno::UNO_QUERY ); + try + { + uno::Reference< container::XNameAccess > xGradient( xFact->createInstance("com.sun.star.drawing.GradientTable"), uno::UNO_QUERY ); + uno::Any rGradientValue = xGradient->getByName( sFillGradientName ); + awt::Gradient aGradient; + if( rGradientValue >>= aGradient ) + { + awt::Gradient aTransparenceGradient; + mpFS->startElementNS(XML_a, XML_gradFill); + OUString sFillTransparenceGradientName; + if( (xPropSet->getPropertyValue("FillTransparenceGradientName") >>= sFillTransparenceGradientName) && !sFillTransparenceGradientName.isEmpty()) + { + uno::Reference< container::XNameAccess > xTransparenceGradient(xFact->createInstance("com.sun.star.drawing.TransparencyGradientTable"), uno::UNO_QUERY); + uno::Any rTransparenceValue = xTransparenceGradient->getByName(sFillTransparenceGradientName); + rTransparenceValue >>= aTransparenceGradient; + WriteGradientFill(aGradient, aTransparenceGradient); + } + else + { + WriteGradientFill(aGradient, aTransparenceGradient, xPropSet); + } + mpFS->endElementNS(XML_a, XML_gradFill); + } + } + catch (const uno::Exception &) + { + TOOLS_INFO_EXCEPTION("oox", "ChartExport::exportGradientFill"); + } +} + +void ChartExport::exportDataTable( ) +{ + FSHelperPtr pFS = GetFS(); + Reference< beans::XPropertySet > aPropSet( mxDiagram, uno::UNO_QUERY ); + + bool bShowVBorder = false; + bool bShowHBorder = false; + bool bShowOutline = false; + + if (GetProperty( aPropSet, "DataTableHBorder")) + mAny >>= bShowHBorder; + if (GetProperty( aPropSet, "DataTableVBorder")) + mAny >>= bShowVBorder; + if (GetProperty( aPropSet, "DataTableOutline")) + mAny >>= bShowOutline; + + if (!(bShowVBorder || bShowHBorder || bShowOutline)) + return; + + pFS->startElement(FSNS(XML_c, XML_dTable)); + if (bShowHBorder) + pFS->singleElement( FSNS( XML_c, XML_showHorzBorder ), + XML_val, "1" ); + if (bShowVBorder) + pFS->singleElement(FSNS(XML_c, XML_showVertBorder), XML_val, "1"); + if (bShowOutline) + pFS->singleElement(FSNS(XML_c, XML_showOutline), XML_val, "1"); + + pFS->endElement( FSNS( XML_c, XML_dTable)); + +} +void ChartExport::exportAreaChart( const Reference< chart2::XChartType >& xChartType ) +{ + FSHelperPtr pFS = GetFS(); + const std::vector > > aSplitDataSeries = splitDataSeriesByAxis(xChartType); + for (const auto& splitDataSeries : aSplitDataSeries) + { + if (!splitDataSeries.hasElements()) + continue; + + sal_Int32 nTypeId = XML_areaChart; + if (mbIs3DChart) + nTypeId = XML_area3DChart; + pFS->startElement(FSNS(XML_c, nTypeId)); + + exportGrouping(); + bool bPrimaryAxes = true; + exportSeries(xChartType, splitDataSeries, bPrimaryAxes); + exportAxesId(bPrimaryAxes); + + pFS->endElement(FSNS(XML_c, nTypeId)); + } +} + +void ChartExport::exportBarChart(const Reference< chart2::XChartType >& xChartType) +{ + sal_Int32 nTypeId = XML_barChart; + if (mbIs3DChart) + nTypeId = XML_bar3DChart; + FSHelperPtr pFS = GetFS(); + + const std::vector > > aSplitDataSeries = splitDataSeriesByAxis(xChartType); + for (const auto& splitDataSeries : aSplitDataSeries) + { + if (!splitDataSeries.hasElements()) + continue; + + pFS->startElement(FSNS(XML_c, nTypeId)); + // bar direction + bool bVertical = false; + Reference< XPropertySet > xPropSet(mxDiagram, uno::UNO_QUERY); + if (GetProperty(xPropSet, "Vertical")) + mAny >>= bVertical; + + const char* bardir = bVertical ? "bar" : "col"; + pFS->singleElement(FSNS(XML_c, XML_barDir), XML_val, bardir); + + exportGrouping(true); + + exportVaryColors(xChartType); + + bool bPrimaryAxes = true; + exportSeries(xChartType, splitDataSeries, bPrimaryAxes); + + Reference< XPropertySet > xTypeProp(xChartType, uno::UNO_QUERY); + + if (xTypeProp.is() && GetProperty(xTypeProp, "GapwidthSequence")) + { + uno::Sequence< sal_Int32 > aBarPositionSequence; + mAny >>= aBarPositionSequence; + if (aBarPositionSequence.hasElements()) + { + sal_Int32 nGapWidth = aBarPositionSequence[0]; + pFS->singleElement(FSNS(XML_c, XML_gapWidth), XML_val, OString::number(nGapWidth)); + } + } + + if (mbIs3DChart) + { + // Shape + namespace cssc = css::chart; + sal_Int32 nGeom3d = cssc::ChartSolidType::RECTANGULAR_SOLID; + if (xPropSet.is() && GetProperty(xPropSet, "SolidType")) + mAny >>= nGeom3d; + const char* sShapeType = nullptr; + switch (nGeom3d) + { + case cssc::ChartSolidType::RECTANGULAR_SOLID: + sShapeType = "box"; + break; + case cssc::ChartSolidType::CONE: + sShapeType = "cone"; + break; + case cssc::ChartSolidType::CYLINDER: + sShapeType = "cylinder"; + break; + case cssc::ChartSolidType::PYRAMID: + sShapeType = "pyramid"; + break; + } + pFS->singleElement(FSNS(XML_c, XML_shape), XML_val, sShapeType); + } + + //overlap + if (!mbIs3DChart && xTypeProp.is() && GetProperty(xTypeProp, "OverlapSequence")) + { + uno::Sequence< sal_Int32 > aBarPositionSequence; + mAny >>= aBarPositionSequence; + if (aBarPositionSequence.hasElements()) + { + sal_Int32 nOverlap = aBarPositionSequence[0]; + // Stacked/Percent Bar/Column chart Overlap-workaround + // Export the Overlap value with 100% for stacked charts, + // because the default overlap value of the Bar/Column chart is 0% and + // LibreOffice do nothing with the overlap value in Stacked charts case, + // unlike the MS Office, which is interpreted differently. + if ((mbStacked || mbPercent) && nOverlap != 100) + { + nOverlap = 100; + pFS->singleElement(FSNS(XML_c, XML_overlap), XML_val, OString::number(nOverlap)); + } + else // Normal bar chart + { + pFS->singleElement(FSNS(XML_c, XML_overlap), XML_val, OString::number(nOverlap)); + } + } + } + + exportAxesId(bPrimaryAxes); + + pFS->endElement(FSNS(XML_c, nTypeId)); + } +} + +void ChartExport::exportBubbleChart( const Reference< chart2::XChartType >& xChartType ) +{ + FSHelperPtr pFS = GetFS(); + const std::vector > > aSplitDataSeries = splitDataSeriesByAxis(xChartType); + for (const auto& splitDataSeries : aSplitDataSeries) + { + if (!splitDataSeries.hasElements()) + continue; + + pFS->startElement(FSNS(XML_c, XML_bubbleChart)); + + exportVaryColors(xChartType); + + bool bPrimaryAxes = true; + exportSeries(xChartType, splitDataSeries, bPrimaryAxes); + + exportAxesId(bPrimaryAxes); + + pFS->endElement(FSNS(XML_c, XML_bubbleChart)); + } +} + +void ChartExport::exportDoughnutChart( const Reference< chart2::XChartType >& xChartType ) +{ + FSHelperPtr pFS = GetFS(); + pFS->startElement(FSNS(XML_c, XML_doughnutChart)); + + exportVaryColors(xChartType); + + bool bPrimaryAxes = true; + exportAllSeries(xChartType, bPrimaryAxes); + // firstSliceAng + exportFirstSliceAng( ); + //FIXME: holeSize + pFS->singleElement(FSNS(XML_c, XML_holeSize), XML_val, OString::number(50)); + + pFS->endElement( FSNS( XML_c, XML_doughnutChart ) ); +} + +namespace { + +void writeDataLabelsRange(const FSHelperPtr& pFS, const XmlFilterBase* pFB, DataLabelsRange& rDLblsRange) +{ + if (rDLblsRange.empty()) + return; + + pFS->startElement(FSNS(XML_c, XML_extLst)); + pFS->startElement(FSNS(XML_c, XML_ext), XML_uri, "{02D57815-91ED-43cb-92C2-25804820EDAC}", FSNS(XML_xmlns, XML_c15), pFB->getNamespaceURL(OOX_NS(c15))); + pFS->startElement(FSNS(XML_c15, XML_datalabelsRange)); + + // Write cell range. + pFS->startElement(FSNS(XML_c15, XML_f)); + pFS->writeEscaped(rDLblsRange.getRange()); + pFS->endElement(FSNS(XML_c15, XML_f)); + + // Write all labels. + pFS->startElement(FSNS(XML_c15, XML_dlblRangeCache)); + pFS->singleElement(FSNS(XML_c, XML_ptCount), XML_val, OString::number(rDLblsRange.count())); + for (const auto& rLabelKV: rDLblsRange) + { + pFS->startElement(FSNS(XML_c, XML_pt), XML_idx, OString::number(rLabelKV.first)); + pFS->startElement(FSNS(XML_c, XML_v)); + pFS->writeEscaped(rLabelKV.second); + pFS->endElement(FSNS( XML_c, XML_v )); + pFS->endElement(FSNS(XML_c, XML_pt)); + } + + pFS->endElement(FSNS(XML_c15, XML_dlblRangeCache)); + + pFS->endElement(FSNS(XML_c15, XML_datalabelsRange)); + pFS->endElement(FSNS(XML_c, XML_ext)); + pFS->endElement(FSNS(XML_c, XML_extLst)); +} + +} + +void ChartExport::exportLineChart( const Reference< chart2::XChartType >& xChartType ) +{ + FSHelperPtr pFS = GetFS(); + const std::vector > > aSplitDataSeries = splitDataSeriesByAxis(xChartType); + for (const auto& splitDataSeries : aSplitDataSeries) + { + if (!splitDataSeries.hasElements()) + continue; + + sal_Int32 nTypeId = XML_lineChart; + if( mbIs3DChart ) + nTypeId = XML_line3DChart; + pFS->startElement(FSNS(XML_c, nTypeId)); + + exportGrouping( ); + + exportVaryColors(xChartType); + // TODO: show marker symbol in series? + bool bPrimaryAxes = true; + exportSeries(xChartType, splitDataSeries, bPrimaryAxes); + + // show marker? + sal_Int32 nSymbolType = css::chart::ChartSymbolType::NONE; + Reference< XPropertySet > xPropSet( mxDiagram , uno::UNO_QUERY); + if( GetProperty( xPropSet, "SymbolType" ) ) + mAny >>= nSymbolType; + + if( !mbIs3DChart ) + { + exportHiLowLines(); + exportUpDownBars(xChartType); + const char* marker = nSymbolType == css::chart::ChartSymbolType::NONE? "0":"1"; + pFS->singleElement(FSNS(XML_c, XML_marker), XML_val, marker); + } + + exportAxesId(bPrimaryAxes, true); + + pFS->endElement( FSNS( XML_c, nTypeId ) ); + } +} + +void ChartExport::exportPieChart( const Reference< chart2::XChartType >& xChartType ) +{ + sal_Int32 eChartType = getChartType( ); + if(eChartType == chart::TYPEID_DOUGHNUT) + { + exportDoughnutChart( xChartType ); + return; + } + FSHelperPtr pFS = GetFS(); + sal_Int32 nTypeId = XML_pieChart; + if( mbIs3DChart ) + nTypeId = XML_pie3DChart; + pFS->startElement(FSNS(XML_c, nTypeId)); + + exportVaryColors(xChartType); + + bool bPrimaryAxes = true; + exportAllSeries(xChartType, bPrimaryAxes); + + if( !mbIs3DChart ) + { + // firstSliceAng + exportFirstSliceAng( ); + } + + pFS->endElement( FSNS( XML_c, nTypeId ) ); +} + +void ChartExport::exportRadarChart( const Reference< chart2::XChartType >& xChartType) +{ + FSHelperPtr pFS = GetFS(); + pFS->startElement(FSNS(XML_c, XML_radarChart)); + + // radarStyle + sal_Int32 eChartType = getChartType( ); + const char* radarStyle = nullptr; + if( eChartType == chart::TYPEID_RADARAREA ) + radarStyle = "filled"; + else + radarStyle = "marker"; + pFS->singleElement(FSNS(XML_c, XML_radarStyle), XML_val, radarStyle); + + exportVaryColors(xChartType); + bool bPrimaryAxes = true; + exportAllSeries(xChartType, bPrimaryAxes); + exportAxesId(bPrimaryAxes); + + pFS->endElement( FSNS( XML_c, XML_radarChart ) ); +} + +void ChartExport::exportScatterChartSeries( const Reference< chart2::XChartType >& xChartType, + const css::uno::Sequence>* pSeries) +{ + FSHelperPtr pFS = GetFS(); + pFS->startElement(FSNS(XML_c, XML_scatterChart)); + // TODO:scatterStyle + + sal_Int32 nSymbolType = css::chart::ChartSymbolType::NONE; + Reference< XPropertySet > xPropSet( mxDiagram , uno::UNO_QUERY); + if( GetProperty( xPropSet, "SymbolType" ) ) + mAny >>= nSymbolType; + + const char* scatterStyle = "lineMarker"; + if (nSymbolType == css::chart::ChartSymbolType::NONE) + { + scatterStyle = "line"; + } + + pFS->singleElement(FSNS(XML_c, XML_scatterStyle), XML_val, scatterStyle); + + exportVaryColors(xChartType); + // FIXME: should export xVal and yVal + bool bPrimaryAxes = true; + if (pSeries) + exportSeries(xChartType, *pSeries, bPrimaryAxes); + exportAxesId(bPrimaryAxes); + + pFS->endElement( FSNS( XML_c, XML_scatterChart ) ); +} + +void ChartExport::exportScatterChart( const Reference< chart2::XChartType >& xChartType ) +{ + const std::vector > > aSplitDataSeries = splitDataSeriesByAxis(xChartType); + bool bExported = false; + for (const auto& splitDataSeries : aSplitDataSeries) + { + if (!splitDataSeries.hasElements()) + continue; + + bExported = true; + exportScatterChartSeries(xChartType, &splitDataSeries); + } + if (!bExported) + exportScatterChartSeries(xChartType, nullptr); +} + +void ChartExport::exportStockChart( const Reference< chart2::XChartType >& xChartType ) +{ + FSHelperPtr pFS = GetFS(); + const std::vector > > aSplitDataSeries = splitDataSeriesByAxis(xChartType); + for (const auto& splitDataSeries : aSplitDataSeries) + { + if (!splitDataSeries.hasElements()) + continue; + + pFS->startElement(FSNS(XML_c, XML_stockChart)); + + bool bPrimaryAxes = true; + exportCandleStickSeries(splitDataSeries, bPrimaryAxes); + + // export stock properties + Reference< css::chart::XStatisticDisplay > xStockPropProvider(mxDiagram, uno::UNO_QUERY); + if (xStockPropProvider.is()) + { + exportHiLowLines(); + exportUpDownBars(xChartType); + } + + exportAxesId(bPrimaryAxes); + + pFS->endElement(FSNS(XML_c, XML_stockChart)); + } +} + +void ChartExport::exportHiLowLines() +{ + FSHelperPtr pFS = GetFS(); + // export the chart property + Reference< css::chart::XStatisticDisplay > xChartPropProvider( mxDiagram, uno::UNO_QUERY ); + + if (!xChartPropProvider.is()) + return; + + Reference< beans::XPropertySet > xStockPropSet = xChartPropProvider->getMinMaxLine(); + if( !xStockPropSet.is() ) + return; + + pFS->startElement(FSNS(XML_c, XML_hiLowLines)); + exportShapeProps( xStockPropSet ); + pFS->endElement( FSNS( XML_c, XML_hiLowLines ) ); +} + +void ChartExport::exportUpDownBars( const Reference< chart2::XChartType >& xChartType) +{ + if(xChartType->getChartType() != "com.sun.star.chart2.CandleStickChartType") + return; + + FSHelperPtr pFS = GetFS(); + // export the chart property + Reference< css::chart::XStatisticDisplay > xChartPropProvider( mxDiagram, uno::UNO_QUERY ); + if(!xChartPropProvider.is()) + return; + + // updownbar + pFS->startElement(FSNS(XML_c, XML_upDownBars)); + // TODO: gapWidth + pFS->singleElement(FSNS(XML_c, XML_gapWidth), XML_val, OString::number(150)); + + Reference< beans::XPropertySet > xChartPropSet = xChartPropProvider->getUpBar(); + if( xChartPropSet.is() ) + { + pFS->startElement(FSNS(XML_c, XML_upBars)); + // For Linechart with UpDownBars, spPr is not getting imported + // so no need to call the exportShapeProps() for LineChart + if(xChartType->getChartType() == "com.sun.star.chart2.CandleStickChartType") + { + exportShapeProps(xChartPropSet); + } + pFS->endElement( FSNS( XML_c, XML_upBars ) ); + } + xChartPropSet = xChartPropProvider->getDownBar(); + if( xChartPropSet.is() ) + { + pFS->startElement(FSNS(XML_c, XML_downBars)); + if(xChartType->getChartType() == "com.sun.star.chart2.CandleStickChartType") + { + exportShapeProps(xChartPropSet); + } + pFS->endElement( FSNS( XML_c, XML_downBars ) ); + } + pFS->endElement( FSNS( XML_c, XML_upDownBars ) ); +} + +void ChartExport::exportSurfaceChart( const Reference< chart2::XChartType >& xChartType ) +{ + FSHelperPtr pFS = GetFS(); + sal_Int32 nTypeId = XML_surfaceChart; + if( mbIs3DChart ) + nTypeId = XML_surface3DChart; + pFS->startElement(FSNS(XML_c, nTypeId)); + exportVaryColors(xChartType); + bool bPrimaryAxes = true; + exportAllSeries(xChartType, bPrimaryAxes); + exportAxesId(bPrimaryAxes); + + pFS->endElement( FSNS( XML_c, nTypeId ) ); +} + +void ChartExport::exportAllSeries(const Reference& xChartType, bool& rPrimaryAxes) +{ + Reference< chart2::XDataSeriesContainer > xDSCnt( xChartType, uno::UNO_QUERY ); + if( ! xDSCnt.is()) + return; + + // export dataseries for current chart-type + Sequence< Reference< chart2::XDataSeries > > aSeriesSeq( xDSCnt->getDataSeries()); + exportSeries(xChartType, aSeriesSeq, rPrimaryAxes); +} + +void ChartExport::exportVaryColors(const Reference& xChartType) +{ + FSHelperPtr pFS = GetFS(); + try + { + Reference xDataSeries = getPrimaryDataSeries(xChartType); + Reference xDataSeriesProps(xDataSeries, uno::UNO_QUERY_THROW); + Any aAnyVaryColors = xDataSeriesProps->getPropertyValue("VaryColorsByPoint"); + bool bVaryColors = false; + aAnyVaryColors >>= bVaryColors; + pFS->singleElement(FSNS(XML_c, XML_varyColors), XML_val, ToPsz10(bVaryColors)); + } + catch (...) + { + pFS->singleElement(FSNS(XML_c, XML_varyColors), XML_val, "0"); + } +} + +void ChartExport::exportSeries( const Reference& xChartType, + const Sequence >& rSeriesSeq, bool& rPrimaryAxes ) +{ + OUString aLabelRole = xChartType->getRoleOfSequenceForSeriesLabel(); + OUString aChartType( xChartType->getChartType()); + sal_Int32 eChartType = lcl_getChartType( aChartType ); + + for( const auto& rSeries : rSeriesSeq ) + { + // export series + Reference< chart2::data::XDataSource > xSource( rSeries, uno::UNO_QUERY ); + if( xSource.is()) + { + Reference< chart2::XDataSeries > xDataSeries( xSource, uno::UNO_QUERY ); + Sequence< Reference< chart2::data::XLabeledDataSequence > > aSeqCnt( + xSource->getDataSequences()); + // search for main sequence and create a series element + { + sal_Int32 nMainSequenceIndex = -1; + sal_Int32 nSeriesLength = 0; + Reference< chart2::data::XDataSequence > xValuesSeq; + Reference< chart2::data::XDataSequence > xLabelSeq; + sal_Int32 nSeqIdx=0; + for( ; nSeqIdx xTempValueSeq( aSeqCnt[nSeqIdx]->getValues() ); + if( nMainSequenceIndex==-1 ) + { + Reference< beans::XPropertySet > xSeqProp( xTempValueSeq, uno::UNO_QUERY ); + OUString aRole; + if( xSeqProp.is()) + xSeqProp->getPropertyValue("Role") >>= aRole; + // "main" sequence + if( aRole == aLabelRole ) + { + xValuesSeq.set( xTempValueSeq ); + xLabelSeq.set( aSeqCnt[nSeqIdx]->getLabel()); + nMainSequenceIndex = nSeqIdx; + } + } + sal_Int32 nSequenceLength = (xTempValueSeq.is()? xTempValueSeq->getData().getLength() : sal_Int32(0)); + if( nSeriesLength < nSequenceLength ) + nSeriesLength = nSequenceLength; + } + + // have found the main sequence, then xValuesSeq and + // xLabelSeq contain those. Otherwise both are empty + { + FSHelperPtr pFS = GetFS(); + + pFS->startElement(FSNS(XML_c, XML_ser)); + + // TODO: idx and order + pFS->singleElement( FSNS( XML_c, XML_idx ), + XML_val, OString::number(mnSeriesCount) ); + pFS->singleElement( FSNS( XML_c, XML_order ), + XML_val, OString::number(mnSeriesCount++) ); + + // export label + if( xLabelSeq.is() ) + exportSeriesText( xLabelSeq ); + + Reference xPropSet(xDataSeries, UNO_QUERY_THROW); + if( GetProperty( xPropSet, "AttachedAxisIndex") ) + { + sal_Int32 nLocalAttachedAxis = 0; + mAny >>= nLocalAttachedAxis; + rPrimaryAxes = isPrimaryAxes(nLocalAttachedAxis); + } + + // export shape properties + Reference< XPropertySet > xOldPropSet = SchXMLSeriesHelper::createOldAPISeriesPropertySet( + rSeries, getModel() ); + if( xOldPropSet.is() ) + { + exportShapeProps( xOldPropSet ); + } + + switch( eChartType ) + { + case chart::TYPEID_BUBBLE: + case chart::TYPEID_HORBAR: + case chart::TYPEID_BAR: + { + pFS->singleElement(FSNS(XML_c, XML_invertIfNegative), XML_val, "0"); + } + break; + case chart::TYPEID_LINE: + { + exportMarker(xOldPropSet); + break; + } + case chart::TYPEID_PIE: + case chart::TYPEID_DOUGHNUT: + { + if( xOldPropSet.is() && GetProperty( xOldPropSet, "SegmentOffset") ) + { + sal_Int32 nOffset = 0; + mAny >>= nOffset; + pFS->singleElement( FSNS( XML_c, XML_explosion ), + XML_val, OString::number( nOffset ) ); + } + break; + } + case chart::TYPEID_SCATTER: + { + exportMarker(xOldPropSet); + break; + } + case chart::TYPEID_RADARLINE: + { + exportMarker(xOldPropSet); + break; + } + } + + // export data points + exportDataPoints( uno::Reference< beans::XPropertySet >( rSeries, uno::UNO_QUERY ), nSeriesLength, eChartType ); + + DataLabelsRange aDLblsRange; + // export data labels + exportDataLabels(rSeries, nSeriesLength, eChartType, aDLblsRange); + + exportTrendlines( rSeries ); + + if( eChartType != chart::TYPEID_PIE && + eChartType != chart::TYPEID_RADARLINE ) + { + //export error bars here + Reference< XPropertySet > xSeriesPropSet( xSource, uno::UNO_QUERY ); + Reference< XPropertySet > xErrorBarYProps; + xSeriesPropSet->getPropertyValue("ErrorBarY") >>= xErrorBarYProps; + if(xErrorBarYProps.is()) + exportErrorBar(xErrorBarYProps, true); + if (eChartType != chart::TYPEID_BAR && + eChartType != chart::TYPEID_HORBAR) + { + Reference< XPropertySet > xErrorBarXProps; + xSeriesPropSet->getPropertyValue("ErrorBarX") >>= xErrorBarXProps; + if(xErrorBarXProps.is()) + exportErrorBar(xErrorBarXProps, false); + } + } + + // export categories + if( eChartType != chart::TYPEID_SCATTER && eChartType != chart::TYPEID_BUBBLE && mxCategoriesValues.is() ) + exportSeriesCategory( mxCategoriesValues ); + + if( (eChartType == chart::TYPEID_SCATTER) + || (eChartType == chart::TYPEID_BUBBLE) ) + { + // export xVal + Reference< chart2::data::XLabeledDataSequence > xSequence( lcl_getDataSequenceByRole( aSeqCnt, "values-x" ) ); + if( xSequence.is() ) + { + Reference< chart2::data::XDataSequence > xValues( xSequence->getValues() ); + if( xValues.is() ) + exportSeriesValues( xValues, XML_xVal ); + } + else if( mxCategoriesValues.is() ) + exportSeriesCategory( mxCategoriesValues, XML_xVal ); + } + + if( eChartType == chart::TYPEID_BUBBLE ) + { + // export yVal + Reference< chart2::data::XLabeledDataSequence > xSequence( lcl_getDataSequenceByRole( aSeqCnt, "values-y" ) ); + if( xSequence.is() ) + { + Reference< chart2::data::XDataSequence > xValues( xSequence->getValues() ); + if( xValues.is() ) + exportSeriesValues( xValues, XML_yVal ); + } + } + + // export values + if( xValuesSeq.is() ) + { + sal_Int32 nYValueType = XML_val; + if( eChartType == chart::TYPEID_SCATTER ) + nYValueType = XML_yVal; + else if( eChartType == chart::TYPEID_BUBBLE ) + nYValueType = XML_bubbleSize; + exportSeriesValues( xValuesSeq, nYValueType ); + } + + if( eChartType == chart::TYPEID_SCATTER + || eChartType == chart::TYPEID_LINE ) + exportSmooth(); + + // tdf103988: "corrupted" files with Bubble chart opening in MSO + if( eChartType == chart::TYPEID_BUBBLE ) + pFS->singleElement(FSNS(XML_c, XML_bubble3D), XML_val, "0"); + + if (!aDLblsRange.empty()) + writeDataLabelsRange(pFS, GetFB(), aDLblsRange); + + pFS->endElement( FSNS( XML_c, XML_ser ) ); + } + } + } + } +} + +void ChartExport::exportCandleStickSeries( + const Sequence< Reference< chart2::XDataSeries > > & aSeriesSeq, + bool& rPrimaryAxes) +{ + for( const Reference< chart2::XDataSeries >& xSeries : aSeriesSeq ) + { + rPrimaryAxes = lcl_isSeriesAttachedToFirstAxis(xSeries); + + Reference< chart2::data::XDataSource > xSource( xSeries, uno::UNO_QUERY ); + if( xSource.is()) + { + // export series in correct order (as we don't store roles) + // with japanese candlesticks: open, low, high, close + // otherwise: low, high, close + Sequence< Reference< chart2::data::XLabeledDataSequence > > aSeqCnt( + xSource->getDataSequences()); + + const char* sSeries[] = {"values-first","values-max","values-min","values-last",nullptr}; + + for( sal_Int32 idx = 0; sSeries[idx] != nullptr ; idx++ ) + { + Reference< chart2::data::XLabeledDataSequence > xLabeledSeq( lcl_getDataSequenceByRole( aSeqCnt, OUString::createFromAscii(sSeries[idx]) ) ); + if( xLabeledSeq.is()) + { + Reference< chart2::data::XDataSequence > xLabelSeq( xLabeledSeq->getLabel()); + Reference< chart2::data::XDataSequence > xValueSeq( xLabeledSeq->getValues()); + { + FSHelperPtr pFS = GetFS(); + pFS->startElement(FSNS(XML_c, XML_ser)); + + // TODO: idx and order + // idx attribute should start from 1 and not from 0. + pFS->singleElement( FSNS( XML_c, XML_idx ), + XML_val, OString::number(idx+1) ); + pFS->singleElement( FSNS( XML_c, XML_order ), + XML_val, OString::number(idx+1) ); + + // export label + if( xLabelSeq.is() ) + exportSeriesText( xLabelSeq ); + + // TODO:export shape properties + + // export categories + if( mxCategoriesValues.is() ) + exportSeriesCategory( mxCategoriesValues ); + + // export values + if( xValueSeq.is() ) + exportSeriesValues( xValueSeq ); + + pFS->endElement( FSNS( XML_c, XML_ser ) ); + } + } + } + } + } +} + +void ChartExport::exportSeriesText( const Reference< chart2::data::XDataSequence > & xValueSeq ) +{ + FSHelperPtr pFS = GetFS(); + pFS->startElement(FSNS(XML_c, XML_tx)); + + OUString aCellRange = xValueSeq->getSourceRangeRepresentation(); + aCellRange = parseFormula( aCellRange ); + pFS->startElement(FSNS(XML_c, XML_strRef)); + + pFS->startElement(FSNS(XML_c, XML_f)); + pFS->writeEscaped( aCellRange ); + pFS->endElement( FSNS( XML_c, XML_f ) ); + + OUString aLabelString = lcl_flattenStringSequence(lcl_getLabelSequence(xValueSeq)); + pFS->startElement(FSNS(XML_c, XML_strCache)); + pFS->singleElement(FSNS(XML_c, XML_ptCount), XML_val, "1"); + pFS->startElement(FSNS(XML_c, XML_pt), XML_idx, "0"); + pFS->startElement(FSNS(XML_c, XML_v)); + pFS->writeEscaped( aLabelString ); + pFS->endElement( FSNS( XML_c, XML_v ) ); + pFS->endElement( FSNS( XML_c, XML_pt ) ); + pFS->endElement( FSNS( XML_c, XML_strCache ) ); + pFS->endElement( FSNS( XML_c, XML_strRef ) ); + pFS->endElement( FSNS( XML_c, XML_tx ) ); +} + +void ChartExport::exportSeriesCategory( const Reference< chart2::data::XDataSequence > & xValueSeq, sal_Int32 nValueType ) +{ + FSHelperPtr pFS = GetFS(); + pFS->startElement(FSNS(XML_c, nValueType)); + + OUString aCellRange = xValueSeq.is() ? xValueSeq->getSourceRangeRepresentation() : OUString(); + const Sequence< Sequence< OUString >> aFinalSplitSource = (nValueType == XML_cat) ? getSplitCategoriesList(aCellRange) : Sequence< Sequence< OUString>>(0); + aCellRange = parseFormula( aCellRange ); + + if(aFinalSplitSource.getLength() > 1) + { + // export multi level category axis labels + pFS->startElement(FSNS(XML_c, XML_multiLvlStrRef)); + + pFS->startElement(FSNS(XML_c, XML_f)); + pFS->writeEscaped(aCellRange); + pFS->endElement(FSNS(XML_c, XML_f)); + + pFS->startElement(FSNS(XML_c, XML_multiLvlStrCache)); + pFS->singleElement(FSNS(XML_c, XML_ptCount), XML_val, OString::number(aFinalSplitSource[0].getLength())); + for(const auto& rSeq : aFinalSplitSource) + { + pFS->startElement(FSNS(XML_c, XML_lvl)); + for(sal_Int32 j = 0; j < rSeq.getLength(); j++) + { + if(!rSeq[j].isEmpty()) + { + pFS->startElement(FSNS(XML_c, XML_pt), XML_idx, OString::number(j)); + pFS->startElement(FSNS(XML_c, XML_v)); + pFS->writeEscaped(rSeq[j]); + pFS->endElement(FSNS(XML_c, XML_v)); + pFS->endElement(FSNS(XML_c, XML_pt)); + } + } + pFS->endElement(FSNS(XML_c, XML_lvl)); + } + + pFS->endElement(FSNS(XML_c, XML_multiLvlStrCache)); + pFS->endElement(FSNS(XML_c, XML_multiLvlStrRef)); + } + else + { + // export single category axis labels + bool bWriteDateCategories = mbHasDateCategories && (nValueType == XML_cat); + OUString aNumberFormatString; + if (bWriteDateCategories) + { + Reference< css::chart::XAxisXSupplier > xAxisXSupp( mxDiagram, uno::UNO_QUERY ); + if( xAxisXSupp.is()) + { + Reference< XPropertySet > xAxisProp = xAxisXSupp->getXAxis(); + if (GetProperty(xAxisProp, "NumberFormat")) + { + sal_Int32 nKey = 0; + mAny >>= nKey; + aNumberFormatString = getNumberFormatCode(nKey); + } + } + if (aNumberFormatString.isEmpty()) + bWriteDateCategories = false; + } + + pFS->startElement(FSNS(XML_c, bWriteDateCategories ? XML_numRef : XML_strRef)); + + pFS->startElement(FSNS(XML_c, XML_f)); + pFS->writeEscaped(aCellRange); + pFS->endElement(FSNS(XML_c, XML_f)); + + ::std::vector< OUString > aCategories; + lcl_fillCategoriesIntoStringVector(xValueSeq, aCategories); + sal_Int32 ptCount = aCategories.size(); + pFS->startElement(FSNS(XML_c, bWriteDateCategories ? XML_numCache : XML_strCache)); + if (bWriteDateCategories) + { + pFS->startElement(FSNS(XML_c, XML_formatCode)); + pFS->writeEscaped(aNumberFormatString); + pFS->endElement(FSNS(XML_c, XML_formatCode)); + } + + pFS->singleElement(FSNS(XML_c, XML_ptCount), XML_val, OString::number(ptCount)); + for (sal_Int32 i = 0; i < ptCount; i++) + { + pFS->startElement(FSNS(XML_c, XML_pt), XML_idx, OString::number(i)); + pFS->startElement(FSNS(XML_c, XML_v)); + pFS->writeEscaped(aCategories[i]); + pFS->endElement(FSNS(XML_c, XML_v)); + pFS->endElement(FSNS(XML_c, XML_pt)); + } + + pFS->endElement(FSNS(XML_c, bWriteDateCategories ? XML_numCache : XML_strCache)); + pFS->endElement(FSNS(XML_c, bWriteDateCategories ? XML_numRef : XML_strRef)); + } + + pFS->endElement( FSNS( XML_c, nValueType ) ); +} + +void ChartExport::exportSeriesValues( const Reference< chart2::data::XDataSequence > & xValueSeq, sal_Int32 nValueType ) +{ + FSHelperPtr pFS = GetFS(); + pFS->startElement(FSNS(XML_c, nValueType)); + + OUString aCellRange = xValueSeq.is() ? xValueSeq->getSourceRangeRepresentation() : OUString(); + aCellRange = parseFormula( aCellRange ); + // TODO: need to handle XML_multiLvlStrRef according to aCellRange + pFS->startElement(FSNS(XML_c, XML_numRef)); + + pFS->startElement(FSNS(XML_c, XML_f)); + pFS->writeEscaped( aCellRange ); + pFS->endElement( FSNS( XML_c, XML_f ) ); + + ::std::vector< double > aValues = lcl_getAllValuesFromSequence( xValueSeq ); + sal_Int32 ptCount = aValues.size(); + pFS->startElement(FSNS(XML_c, XML_numCache)); + pFS->startElement(FSNS(XML_c, XML_formatCode)); + // TODO: what format code? + pFS->writeEscaped( "General" ); + pFS->endElement( FSNS( XML_c, XML_formatCode ) ); + pFS->singleElement(FSNS(XML_c, XML_ptCount), XML_val, OString::number(ptCount)); + + for( sal_Int32 i = 0; i < ptCount; i++ ) + { + if (!std::isnan(aValues[i])) + { + pFS->startElement(FSNS(XML_c, XML_pt), XML_idx, OString::number(i)); + pFS->startElement(FSNS(XML_c, XML_v)); + pFS->write(aValues[i]); + pFS->endElement(FSNS(XML_c, XML_v)); + pFS->endElement(FSNS(XML_c, XML_pt)); + } + } + + pFS->endElement( FSNS( XML_c, XML_numCache ) ); + pFS->endElement( FSNS( XML_c, XML_numRef ) ); + pFS->endElement( FSNS( XML_c, nValueType ) ); +} + +void ChartExport::exportShapeProps( const Reference< XPropertySet >& xPropSet ) +{ + FSHelperPtr pFS = GetFS(); + pFS->startElement(FSNS(XML_c, XML_spPr)); + + exportFill( xPropSet ); + WriteOutline( xPropSet, getModel() ); + + pFS->endElement( FSNS( XML_c, XML_spPr ) ); +} + +void ChartExport::exportTextProps(const Reference& xPropSet) +{ + FSHelperPtr pFS = GetFS(); + pFS->startElement(FSNS(XML_c, XML_txPr)); + + sal_Int32 nRotation = 0; + const char* textWordWrap = nullptr; + + if (auto xServiceInfo = uno::Reference(xPropSet, uno::UNO_QUERY)) + { + double fMultiplier = 0.0; + // We have at least two possible units of returned value: degrees (e.g., for data labels), + // and 100ths of degree (e.g., for axes labels). The latter is returned as an Any wrapping + // a sal_Int32 value (see WrappedTextRotationProperty::convertInnerToOuterValue), while + // the former is double. So we could test the contained type to decide which multiplier to + // use. But testing the service info should be more robust. + if (xServiceInfo->supportsService("com.sun.star.chart.ChartAxis")) + fMultiplier = -600.0; + else if (xServiceInfo->supportsService("com.sun.star.chart2.DataSeries") || xServiceInfo->supportsService("com.sun.star.chart2.DataPointProperties")) + { + fMultiplier = -60000.0; + bool bTextWordWrap = false; + if ((xPropSet->getPropertyValue("TextWordWrap") >>= bTextWordWrap) && bTextWordWrap) + textWordWrap = "square"; + else + textWordWrap = "none"; + } + + if (fMultiplier) + { + double fTextRotation = 0.0; + uno::Any aAny = xPropSet->getPropertyValue("TextRotation"); + if (aAny.hasValue() && (aAny >>= fTextRotation)) + { + fTextRotation *= fMultiplier; + // The MS Office UI allows values only in range of [-90,90]. + if (fTextRotation < -5400000.0 && fTextRotation > -16200000.0) + { + // Reflect the angle if the value is between 90° and 270° + fTextRotation += 10800000.0; + } + else if (fTextRotation <= -16200000.0) + { + fTextRotation += 21600000.0; + } + nRotation = std::round(fTextRotation); + } + } + } + + if (nRotation) + pFS->singleElement(FSNS(XML_a, XML_bodyPr), XML_rot, OString::number(nRotation), XML_wrap, textWordWrap); + else + pFS->singleElement(FSNS(XML_a, XML_bodyPr), XML_wrap, textWordWrap); + + pFS->singleElement(FSNS(XML_a, XML_lstStyle)); + + pFS->startElement(FSNS(XML_a, XML_p)); + pFS->startElement(FSNS(XML_a, XML_pPr)); + + WriteRunProperties(xPropSet, false, XML_defRPr, true, o3tl::temporary(false), + o3tl::temporary(sal_Int32())); + + pFS->endElement(FSNS(XML_a, XML_pPr)); + pFS->endElement(FSNS(XML_a, XML_p)); + pFS->endElement(FSNS(XML_c, XML_txPr)); +} + +void ChartExport::InitPlotArea( ) +{ + Reference< XPropertySet > xDiagramProperties (mxDiagram, uno::UNO_QUERY); + + // Check for supported services and then the properties provided by this service. + Reference xServiceInfo (mxDiagram, uno::UNO_QUERY); + if (xServiceInfo.is()) + { + if (xServiceInfo->supportsService("com.sun.star.chart.ChartAxisZSupplier")) + { + xDiagramProperties->getPropertyValue("HasZAxis") >>= mbHasZAxis; + } + } + + xDiagramProperties->getPropertyValue("Dim3D") >>= mbIs3DChart; + + if( mbHasCategoryLabels && mxNewDiagram.is()) + { + Reference< chart2::data::XLabeledDataSequence > xCategories( lcl_getCategories( mxNewDiagram, mbHasDateCategories ) ); + if( xCategories.is() ) + { + mxCategoriesValues.set( xCategories->getValues() ); + } + } +} + +void ChartExport::exportAxes( ) +{ + sal_Int32 nSize = maAxes.size(); + // let's export the axis types in the right order + for ( sal_Int32 nSortIdx = AXIS_PRIMARY_X; nSortIdx <= AXIS_SECONDARY_Y; nSortIdx++ ) + { + for ( sal_Int32 nIdx = 0; nIdx < nSize; nIdx++ ) + { + if (nSortIdx == maAxes[nIdx].nAxisType) + exportAxis( maAxes[nIdx] ); + } + } +} + +namespace { + +sal_Int32 getXAxisTypeByChartType(sal_Int32 eChartType) +{ + if( (eChartType == chart::TYPEID_SCATTER) + || (eChartType == chart::TYPEID_BUBBLE) ) + return XML_valAx; + else if( eChartType == chart::TYPEID_STOCK ) + return XML_dateAx; + + return XML_catAx; +} + +sal_Int32 getRealXAxisType(sal_Int32 nAxisType) +{ + if( nAxisType == chart2::AxisType::CATEGORY ) + return XML_catAx; + else if( nAxisType == chart2::AxisType::DATE ) + return XML_dateAx; + else if( nAxisType == chart2::AxisType::SERIES ) + return XML_serAx; + + return XML_valAx; +} + +} + +void ChartExport::exportAxis(const AxisIdPair& rAxisIdPair) +{ + // get some properties from document first + bool bHasXAxisTitle = false, + bHasYAxisTitle = false, + bHasZAxisTitle = false, + bHasSecondaryXAxisTitle = false, + bHasSecondaryYAxisTitle = false; + bool bHasXAxisMajorGrid = false, + bHasXAxisMinorGrid = false, + bHasYAxisMajorGrid = false, + bHasYAxisMinorGrid = false, + bHasZAxisMajorGrid = false, + bHasZAxisMinorGrid = false; + + Reference< XPropertySet > xDiagramProperties (mxDiagram, uno::UNO_QUERY); + + xDiagramProperties->getPropertyValue("HasXAxisTitle") >>= bHasXAxisTitle; + xDiagramProperties->getPropertyValue("HasYAxisTitle") >>= bHasYAxisTitle; + xDiagramProperties->getPropertyValue("HasZAxisTitle") >>= bHasZAxisTitle; + xDiagramProperties->getPropertyValue("HasSecondaryXAxisTitle") >>= bHasSecondaryXAxisTitle; + xDiagramProperties->getPropertyValue("HasSecondaryYAxisTitle") >>= bHasSecondaryYAxisTitle; + + xDiagramProperties->getPropertyValue("HasXAxisGrid") >>= bHasXAxisMajorGrid; + xDiagramProperties->getPropertyValue("HasYAxisGrid") >>= bHasYAxisMajorGrid; + xDiagramProperties->getPropertyValue("HasZAxisGrid") >>= bHasZAxisMajorGrid; + + xDiagramProperties->getPropertyValue("HasXAxisHelpGrid") >>= bHasXAxisMinorGrid; + xDiagramProperties->getPropertyValue("HasYAxisHelpGrid") >>= bHasYAxisMinorGrid; + xDiagramProperties->getPropertyValue("HasZAxisHelpGrid") >>= bHasZAxisMinorGrid; + + Reference< XPropertySet > xAxisProp; + Reference< drawing::XShape > xAxisTitle; + Reference< beans::XPropertySet > xMajorGrid; + Reference< beans::XPropertySet > xMinorGrid; + sal_Int32 nAxisType = XML_catAx; + const char* sAxPos = nullptr; + + switch( rAxisIdPair.nAxisType ) + { + case AXIS_PRIMARY_X: + { + Reference< css::chart::XAxisXSupplier > xAxisXSupp( mxDiagram, uno::UNO_QUERY ); + if( xAxisXSupp.is()) + xAxisProp = xAxisXSupp->getXAxis(); + if( bHasXAxisTitle ) + xAxisTitle = xAxisXSupp->getXAxisTitle(); + if( bHasXAxisMajorGrid ) + xMajorGrid = xAxisXSupp->getXMainGrid(); + if( bHasXAxisMinorGrid ) + xMinorGrid = xAxisXSupp->getXHelpGrid(); + + nAxisType = lcl_getCategoryAxisType(mxNewDiagram, 0, 0); + if( nAxisType != -1 ) + nAxisType = getRealXAxisType(nAxisType); + else + nAxisType = getXAxisTypeByChartType( getChartType() ); + // FIXME: axPos, need to check axis direction + sAxPos = "b"; + break; + } + case AXIS_PRIMARY_Y: + { + Reference< css::chart::XAxisYSupplier > xAxisYSupp( mxDiagram, uno::UNO_QUERY ); + if( xAxisYSupp.is()) + xAxisProp = xAxisYSupp->getYAxis(); + if( bHasYAxisTitle ) + xAxisTitle = xAxisYSupp->getYAxisTitle(); + if( bHasYAxisMajorGrid ) + xMajorGrid = xAxisYSupp->getYMainGrid(); + if( bHasYAxisMinorGrid ) + xMinorGrid = xAxisYSupp->getYHelpGrid(); + + nAxisType = XML_valAx; + // FIXME: axPos, need to check axis direction + sAxPos = "l"; + break; + } + case AXIS_PRIMARY_Z: + { + Reference< css::chart::XAxisZSupplier > xAxisZSupp( mxDiagram, uno::UNO_QUERY ); + if( xAxisZSupp.is()) + xAxisProp = xAxisZSupp->getZAxis(); + if( bHasZAxisTitle ) + xAxisTitle = xAxisZSupp->getZAxisTitle(); + if( bHasZAxisMajorGrid ) + xMajorGrid = xAxisZSupp->getZMainGrid(); + if( bHasZAxisMinorGrid ) + xMinorGrid = xAxisZSupp->getZHelpGrid(); + + sal_Int32 eChartType = getChartType( ); + if( (eChartType == chart::TYPEID_SCATTER) + || (eChartType == chart::TYPEID_BUBBLE) ) + nAxisType = XML_valAx; + else if( eChartType == chart::TYPEID_STOCK ) + nAxisType = XML_dateAx; + else if( eChartType == chart::TYPEID_BAR || eChartType == chart::TYPEID_AREA ) + nAxisType = XML_serAx; + // FIXME: axPos, need to check axis direction + sAxPos = "b"; + break; + } + case AXIS_SECONDARY_X: + { + Reference< css::chart::XTwoAxisXSupplier > xAxisTwoXSupp( mxDiagram, uno::UNO_QUERY ); + if( xAxisTwoXSupp.is()) + xAxisProp = xAxisTwoXSupp->getSecondaryXAxis(); + if( bHasSecondaryXAxisTitle ) + { + Reference< css::chart::XSecondAxisTitleSupplier > xAxisSupp( mxDiagram, uno::UNO_QUERY ); + xAxisTitle = xAxisSupp->getSecondXAxisTitle(); + } + + nAxisType = lcl_getCategoryAxisType(mxNewDiagram, 0, 1); + if( nAxisType != -1 ) + nAxisType = getRealXAxisType(nAxisType); + else + nAxisType = getXAxisTypeByChartType( getChartType() ); + // FIXME: axPos, need to check axis direction + sAxPos = "t"; + break; + } + case AXIS_SECONDARY_Y: + { + Reference< css::chart::XTwoAxisYSupplier > xAxisTwoYSupp( mxDiagram, uno::UNO_QUERY ); + if( xAxisTwoYSupp.is()) + xAxisProp = xAxisTwoYSupp->getSecondaryYAxis(); + if( bHasSecondaryYAxisTitle ) + { + Reference< css::chart::XSecondAxisTitleSupplier > xAxisSupp( mxDiagram, uno::UNO_QUERY ); + xAxisTitle = xAxisSupp->getSecondYAxisTitle(); + } + + nAxisType = XML_valAx; + // FIXME: axPos, need to check axis direction + sAxPos = "r"; + break; + } + } + + _exportAxis(xAxisProp, xAxisTitle, xMajorGrid, xMinorGrid, nAxisType, sAxPos, rAxisIdPair); +} + +void ChartExport::_exportAxis( + const Reference< XPropertySet >& xAxisProp, + const Reference< drawing::XShape >& xAxisTitle, + const Reference< XPropertySet >& xMajorGrid, + const Reference< XPropertySet >& xMinorGrid, + sal_Int32 nAxisType, + const char* sAxisPos, + const AxisIdPair& rAxisIdPair ) +{ + FSHelperPtr pFS = GetFS(); + pFS->startElement(FSNS(XML_c, nAxisType)); + pFS->singleElement(FSNS(XML_c, XML_axId), XML_val, OString::number(rAxisIdPair.nAxisId)); + + pFS->startElement(FSNS(XML_c, XML_scaling)); + + // logBase, min, max + if(GetProperty( xAxisProp, "Logarithmic" ) ) + { + bool bLogarithmic = false; + mAny >>= bLogarithmic; + if( bLogarithmic ) + { + // default value is 10? + pFS->singleElement(FSNS(XML_c, XML_logBase), XML_val, OString::number(10)); + } + } + + // orientation: minMax, maxMin + bool bReverseDirection = false; + if(GetProperty( xAxisProp, "ReverseDirection" ) ) + mAny >>= bReverseDirection; + + const char* orientation = bReverseDirection ? "maxMin":"minMax"; + pFS->singleElement(FSNS(XML_c, XML_orientation), XML_val, orientation); + + bool bAutoMax = false; + if(GetProperty( xAxisProp, "AutoMax" ) ) + mAny >>= bAutoMax; + + if( !bAutoMax && (GetProperty( xAxisProp, "Max" ) ) ) + { + double dMax = 0; + mAny >>= dMax; + pFS->singleElement(FSNS(XML_c, XML_max), XML_val, OString::number(dMax)); + } + + bool bAutoMin = false; + if(GetProperty( xAxisProp, "AutoMin" ) ) + mAny >>= bAutoMin; + + if( !bAutoMin && (GetProperty( xAxisProp, "Min" ) ) ) + { + double dMin = 0; + mAny >>= dMin; + pFS->singleElement(FSNS(XML_c, XML_min), XML_val, OString::number(dMin)); + } + + pFS->endElement( FSNS( XML_c, XML_scaling ) ); + + bool bVisible = true; + if( xAxisProp.is() ) + { + xAxisProp->getPropertyValue("Visible") >>= bVisible; + } + + // only export each axis only once non-deleted + bool bDeleted = maExportedAxis.find(rAxisIdPair.nAxisType) != maExportedAxis.end(); + + if (!bDeleted) + maExportedAxis.insert(rAxisIdPair.nAxisType); + + pFS->singleElement(FSNS(XML_c, XML_delete), XML_val, !bDeleted && bVisible ? "0" : "1"); + + // FIXME: axPos, need to check the property "ReverseDirection" + pFS->singleElement(FSNS(XML_c, XML_axPos), XML_val, sAxisPos); + // major grid line + if( xMajorGrid.is()) + { + pFS->startElement(FSNS(XML_c, XML_majorGridlines)); + exportShapeProps( xMajorGrid ); + pFS->endElement( FSNS( XML_c, XML_majorGridlines ) ); + } + + // minor grid line + if( xMinorGrid.is()) + { + pFS->startElement(FSNS(XML_c, XML_minorGridlines)); + exportShapeProps( xMinorGrid ); + pFS->endElement( FSNS( XML_c, XML_minorGridlines ) ); + } + + // title + if( xAxisTitle.is() ) + exportTitle( xAxisTitle ); + + bool bLinkedNumFmt = true; + if (GetProperty(xAxisProp, "LinkNumberFormatToSource")) + mAny >>= bLinkedNumFmt; + + OUString aNumberFormatString("General"); + if (GetProperty(xAxisProp, "NumberFormat")) + { + sal_Int32 nKey = 0; + mAny >>= nKey; + aNumberFormatString = getNumberFormatCode(nKey); + } + + pFS->singleElement(FSNS(XML_c, XML_numFmt), + XML_formatCode, aNumberFormatString, + XML_sourceLinked, bLinkedNumFmt ? "1" : "0"); + + // majorTickMark + sal_Int32 nValue = 0; + if(GetProperty( xAxisProp, "Marks" ) ) + { + mAny >>= nValue; + bool bInner = nValue & css::chart::ChartAxisMarks::INNER; + bool bOuter = nValue & css::chart::ChartAxisMarks::OUTER; + const char* majorTickMark = nullptr; + if( bInner && bOuter ) + majorTickMark = "cross"; + else if( bInner ) + majorTickMark = "in"; + else if( bOuter ) + majorTickMark = "out"; + else + majorTickMark = "none"; + pFS->singleElement(FSNS(XML_c, XML_majorTickMark), XML_val, majorTickMark); + } + // minorTickMark + if(GetProperty( xAxisProp, "HelpMarks" ) ) + { + mAny >>= nValue; + bool bInner = nValue & css::chart::ChartAxisMarks::INNER; + bool bOuter = nValue & css::chart::ChartAxisMarks::OUTER; + const char* minorTickMark = nullptr; + if( bInner && bOuter ) + minorTickMark = "cross"; + else if( bInner ) + minorTickMark = "in"; + else if( bOuter ) + minorTickMark = "out"; + else + minorTickMark = "none"; + pFS->singleElement(FSNS(XML_c, XML_minorTickMark), XML_val, minorTickMark); + } + // tickLblPos + const char* sTickLblPos = nullptr; + bool bDisplayLabel = true; + if(GetProperty( xAxisProp, "DisplayLabels" ) ) + mAny >>= bDisplayLabel; + if( bDisplayLabel && (GetProperty( xAxisProp, "LabelPosition" ) ) ) + { + css::chart::ChartAxisLabelPosition eLabelPosition = css::chart::ChartAxisLabelPosition_NEAR_AXIS; + mAny >>= eLabelPosition; + switch( eLabelPosition ) + { + case css::chart::ChartAxisLabelPosition_NEAR_AXIS: + case css::chart::ChartAxisLabelPosition_NEAR_AXIS_OTHER_SIDE: + sTickLblPos = "nextTo"; + break; + case css::chart::ChartAxisLabelPosition_OUTSIDE_START: + sTickLblPos = "low"; + break; + case css::chart::ChartAxisLabelPosition_OUTSIDE_END: + sTickLblPos = "high"; + break; + default: + sTickLblPos = "nextTo"; + break; + } + } + else + { + sTickLblPos = "none"; + } + pFS->singleElement(FSNS(XML_c, XML_tickLblPos), XML_val, sTickLblPos); + + // shape properties + exportShapeProps( xAxisProp ); + + exportTextProps(xAxisProp); + + pFS->singleElement(FSNS(XML_c, XML_crossAx), XML_val, OString::number(rAxisIdPair.nCrossAx)); + + // crosses & crossesAt + bool bCrossesValue = false; + const char* sCrosses = nullptr; + // do not export the CrossoverPosition/CrossoverValue, if the axis is deleted and not visible + if( GetProperty( xAxisProp, "CrossoverPosition" ) && !bDeleted && bVisible ) + { + css::chart::ChartAxisPosition ePosition( css::chart::ChartAxisPosition_ZERO ); + mAny >>= ePosition; + switch( ePosition ) + { + case css::chart::ChartAxisPosition_START: + sCrosses = "min"; + break; + case css::chart::ChartAxisPosition_END: + sCrosses = "max"; + break; + case css::chart::ChartAxisPosition_ZERO: + sCrosses = "autoZero"; + break; + default: + bCrossesValue = true; + break; + } + } + + if( bCrossesValue && GetProperty( xAxisProp, "CrossoverValue" ) ) + { + double dValue = 0; + mAny >>= dValue; + pFS->singleElement(FSNS(XML_c, XML_crossesAt), XML_val, OString::number(dValue)); + } + else + { + if(sCrosses) + { + pFS->singleElement(FSNS(XML_c, XML_crosses), XML_val, sCrosses); + } + } + + if( ( nAxisType == XML_catAx ) + || ( nAxisType == XML_dateAx ) ) + { + // FIXME: seems not support? use default value, + const char* const isAuto = "1"; + pFS->singleElement(FSNS(XML_c, XML_auto), XML_val, isAuto); + + if( nAxisType == XML_catAx ) + { + // FIXME: seems not support? lblAlgn + const char* const sLblAlgn = "ctr"; + pFS->singleElement(FSNS(XML_c, XML_lblAlgn), XML_val, sLblAlgn); + } + + // FIXME: seems not support? lblOffset + pFS->singleElement(FSNS(XML_c, XML_lblOffset), XML_val, OString::number(100)); + + // export baseTimeUnit, majorTimeUnit, minorTimeUnit of Date axis + if( nAxisType == XML_dateAx ) + { + sal_Int32 nAxisIndex = -1; + if( rAxisIdPair.nAxisType == AXIS_PRIMARY_X ) + nAxisIndex = 0; + else if( rAxisIdPair.nAxisType == AXIS_SECONDARY_X ) + nAxisIndex = 1; + + cssc::TimeIncrement aTimeIncrement = lcl_getDateTimeIncrement( mxNewDiagram, nAxisIndex ); + sal_Int32 nTimeResolution = css::chart::TimeUnit::DAY; + if( aTimeIncrement.TimeResolution >>= nTimeResolution ) + pFS->singleElement(FSNS(XML_c, XML_baseTimeUnit), XML_val, lclGetTimeUnitToken(nTimeResolution)); + + cssc::TimeInterval aInterval; + if( aTimeIncrement.MajorTimeInterval >>= aInterval ) + { + pFS->singleElement(FSNS(XML_c, XML_majorUnit), XML_val, OString::number(aInterval.Number)); + pFS->singleElement(FSNS(XML_c, XML_majorTimeUnit), XML_val, lclGetTimeUnitToken(aInterval.TimeUnit)); + } + if( aTimeIncrement.MinorTimeInterval >>= aInterval ) + { + pFS->singleElement(FSNS(XML_c, XML_minorUnit), XML_val, OString::number(aInterval.Number)); + pFS->singleElement(FSNS(XML_c, XML_minorTimeUnit), XML_val, lclGetTimeUnitToken(aInterval.TimeUnit)); + } + } + + // FIXME: seems not support? noMultiLvlLbl + pFS->singleElement(FSNS(XML_c, XML_noMultiLvlLbl), XML_val, OString::number(0)); + } + + // crossBetween + if( nAxisType == XML_valAx ) + { + if( lcl_isCategoryAxisShifted( mxNewDiagram )) + pFS->singleElement(FSNS(XML_c, XML_crossBetween), XML_val, "between"); + else + pFS->singleElement(FSNS(XML_c, XML_crossBetween), XML_val, "midCat"); + } + + // majorUnit + bool bAutoStepMain = false; + if(GetProperty( xAxisProp, "AutoStepMain" ) ) + mAny >>= bAutoStepMain; + + if( !bAutoStepMain && (GetProperty( xAxisProp, "StepMain" ) ) ) + { + double dMajorUnit = 0; + mAny >>= dMajorUnit; + pFS->singleElement(FSNS(XML_c, XML_majorUnit), XML_val, OString::number(dMajorUnit)); + } + // minorUnit + bool bAutoStepHelp = false; + if(GetProperty( xAxisProp, "AutoStepHelp" ) ) + mAny >>= bAutoStepHelp; + + if( !bAutoStepHelp && (GetProperty( xAxisProp, "StepHelp" ) ) ) + { + double dMinorUnit = 0; + mAny >>= dMinorUnit; + if( GetProperty( xAxisProp, "StepHelpCount" ) ) + { + sal_Int32 dMinorUnitCount = 0; + mAny >>= dMinorUnitCount; + // tdf#114168 Don't save minor unit if number of step help count is 5 (which is default for MS Excel), + // to allow proper .xlsx import. If minorUnit is set and majorUnit not, then it is impossible + // to calculate StepHelpCount. + if( dMinorUnitCount != 5 ) + { + pFS->singleElement( FSNS( XML_c, XML_minorUnit ), + XML_val, OString::number( dMinorUnit ) ); + } + } + } + + if( nAxisType == XML_valAx && GetProperty( xAxisProp, "DisplayUnits" ) ) + { + bool bDisplayUnits = false; + mAny >>= bDisplayUnits; + if(bDisplayUnits) + { + if(GetProperty( xAxisProp, "BuiltInUnit" )) + { + OUString aVal; + mAny >>= aVal; + if(!aVal.isEmpty()) + { + pFS->startElement(FSNS(XML_c, XML_dispUnits)); + + pFS->singleElement(FSNS(XML_c, XML_builtInUnit), XML_val, aVal); + + pFS->singleElement(FSNS( XML_c, XML_dispUnitsLbl )); + pFS->endElement( FSNS( XML_c, XML_dispUnits ) ); + } + } + } + } + + pFS->endElement( FSNS( XML_c, nAxisType ) ); +} + +namespace { + +struct LabelPlacementParam +{ + bool mbExport; + sal_Int32 meDefault; + + std::unordered_set maAllowedValues; + + LabelPlacementParam(bool bExport, sal_Int32 nDefault) : + mbExport(bExport), + meDefault(nDefault), + maAllowedValues( + { + css::chart::DataLabelPlacement::OUTSIDE, + css::chart::DataLabelPlacement::INSIDE, + css::chart::DataLabelPlacement::CENTER, + css::chart::DataLabelPlacement::NEAR_ORIGIN, + css::chart::DataLabelPlacement::TOP, + css::chart::DataLabelPlacement::BOTTOM, + css::chart::DataLabelPlacement::LEFT, + css::chart::DataLabelPlacement::RIGHT, + css::chart::DataLabelPlacement::AVOID_OVERLAP + } + ) + {} +}; + +const char* toOOXMLPlacement( sal_Int32 nPlacement ) +{ + switch (nPlacement) + { + case css::chart::DataLabelPlacement::OUTSIDE: return "outEnd"; + case css::chart::DataLabelPlacement::INSIDE: return "inEnd"; + case css::chart::DataLabelPlacement::CENTER: return "ctr"; + case css::chart::DataLabelPlacement::NEAR_ORIGIN: return "inBase"; + case css::chart::DataLabelPlacement::TOP: return "t"; + case css::chart::DataLabelPlacement::BOTTOM: return "b"; + case css::chart::DataLabelPlacement::LEFT: return "l"; + case css::chart::DataLabelPlacement::RIGHT: return "r"; + case css::chart::DataLabelPlacement::CUSTOM: + case css::chart::DataLabelPlacement::AVOID_OVERLAP: return "bestFit"; + default: + ; + } + + return "outEnd"; +} + +OUString getFieldTypeString( const chart2::DataPointCustomLabelFieldType aType ) +{ + switch (aType) + { + case chart2::DataPointCustomLabelFieldType_CATEGORYNAME: + return "CATEGORYNAME"; + + case chart2::DataPointCustomLabelFieldType_SERIESNAME: + return "SERIESNAME"; + + case chart2::DataPointCustomLabelFieldType_VALUE: + return "VALUE"; + + case chart2::DataPointCustomLabelFieldType_CELLREF: + return "CELLREF"; + + case chart2::DataPointCustomLabelFieldType_CELLRANGE: + return "CELLRANGE"; + + default: + break; + } + return OUString(); +} + +void writeRunProperties( ChartExport* pChartExport, Reference const & xPropertySet ) +{ + bool bDummy = false; + sal_Int32 nDummy; + pChartExport->WriteRunProperties(xPropertySet, false, XML_rPr, true, bDummy, nDummy); +} + +void writeCustomLabel( const FSHelperPtr& pFS, ChartExport* pChartExport, + const Sequence>& rCustomLabelFields, + sal_Int32 nLabelIndex, DataLabelsRange& rDLblsRange ) +{ + pFS->startElement(FSNS(XML_c, XML_tx)); + pFS->startElement(FSNS(XML_c, XML_rich)); + + // TODO: body properties? + pFS->singleElement(FSNS(XML_a, XML_bodyPr)); + + OUString sFieldType; + OUString sContent; + pFS->startElement(FSNS(XML_a, XML_p)); + + for (auto& rField : rCustomLabelFields) + { + Reference xPropertySet(rField, UNO_QUERY); + chart2::DataPointCustomLabelFieldType aType = rField->getFieldType(); + sFieldType.clear(); + sContent.clear(); + bool bNewParagraph = false; + + if (aType == chart2::DataPointCustomLabelFieldType_CELLRANGE && + rField->getDataLabelsRange()) + { + if (rDLblsRange.getRange().isEmpty()) + rDLblsRange.setRange(rField->getCellRange()); + + if (!rDLblsRange.hasLabel(nLabelIndex)) + rDLblsRange.setLabel(nLabelIndex, rField->getString()); + + sContent = "[CELLRANGE]"; + } + else + { + sContent = rField->getString(); + } + + if (aType == chart2::DataPointCustomLabelFieldType_NEWLINE) + bNewParagraph = true; + else if (aType != chart2::DataPointCustomLabelFieldType_TEXT) + sFieldType = getFieldTypeString(aType); + + if (bNewParagraph) + { + pFS->endElement(FSNS(XML_a, XML_p)); + pFS->startElement(FSNS(XML_a, XML_p)); + continue; + } + + if (sFieldType.isEmpty()) + { + // Normal text run + pFS->startElement(FSNS(XML_a, XML_r)); + writeRunProperties(pChartExport, xPropertySet); + + pFS->startElement(FSNS(XML_a, XML_t)); + pFS->writeEscaped(sContent); + pFS->endElement(FSNS(XML_a, XML_t)); + + pFS->endElement(FSNS(XML_a, XML_r)); + } + else + { + // Field + pFS->startElement(FSNS(XML_a, XML_fld), XML_id, rField->getGuid(), XML_type, + sFieldType); + writeRunProperties(pChartExport, xPropertySet); + + pFS->startElement(FSNS(XML_a, XML_t)); + pFS->writeEscaped(sContent); + pFS->endElement(FSNS(XML_a, XML_t)); + + pFS->endElement(FSNS(XML_a, XML_fld)); + } + } + + pFS->endElement(FSNS(XML_a, XML_p)); + pFS->endElement(FSNS(XML_c, XML_rich)); + pFS->endElement(FSNS(XML_c, XML_tx)); +} + +void writeLabelProperties( const FSHelperPtr& pFS, ChartExport* pChartExport, + const uno::Reference& xPropSet, const LabelPlacementParam& rLabelParam, + sal_Int32 nLabelIndex, DataLabelsRange& rDLblsRange ) +{ + if (!xPropSet.is()) + return; + + chart2::DataPointLabel aLabel; + Sequence> aCustomLabelFields; + sal_Int32 nLabelBorderWidth = 0; + sal_Int32 nLabelBorderColor = 0x00FFFFFF; + sal_Int32 nLabelFillColor = -1; + + xPropSet->getPropertyValue("Label") >>= aLabel; + xPropSet->getPropertyValue("CustomLabelFields") >>= aCustomLabelFields; + xPropSet->getPropertyValue("LabelBorderWidth") >>= nLabelBorderWidth; + xPropSet->getPropertyValue("LabelBorderColor") >>= nLabelBorderColor; + xPropSet->getPropertyValue("LabelFillColor") >>= nLabelFillColor; + + if (nLabelBorderWidth > 0 || nLabelFillColor != -1) + { + pFS->startElement(FSNS(XML_c, XML_spPr)); + + if (nLabelFillColor != -1) + { + pFS->startElement(FSNS(XML_a, XML_solidFill)); + + OString aStr = OString::number(nLabelFillColor, 16).toAsciiUpperCase(); + pFS->singleElement(FSNS(XML_a, XML_srgbClr), XML_val, aStr); + + pFS->endElement(FSNS(XML_a, XML_solidFill)); + } + + if (nLabelBorderWidth > 0) + { + pFS->startElement(FSNS(XML_a, XML_ln), XML_w, + OString::number(convertHmmToEmu(nLabelBorderWidth))); + + if (nLabelBorderColor != -1) + { + pFS->startElement(FSNS(XML_a, XML_solidFill)); + + OString aStr = OString::number(nLabelBorderColor, 16).toAsciiUpperCase(); + pFS->singleElement(FSNS(XML_a, XML_srgbClr), XML_val, aStr); + + pFS->endElement(FSNS(XML_a, XML_solidFill)); + } + + pFS->endElement(FSNS(XML_a, XML_ln)); + } + + pFS->endElement(FSNS(XML_c, XML_spPr)); + } + + pChartExport->exportTextProps(xPropSet); + + if (aCustomLabelFields.hasElements()) + writeCustomLabel(pFS, pChartExport, aCustomLabelFields, nLabelIndex, rDLblsRange); + + if (rLabelParam.mbExport) + { + sal_Int32 nLabelPlacement = rLabelParam.meDefault; + if (xPropSet->getPropertyValue("LabelPlacement") >>= nLabelPlacement) + { + if (!rLabelParam.maAllowedValues.count(nLabelPlacement)) + nLabelPlacement = rLabelParam.meDefault; + pFS->singleElement(FSNS(XML_c, XML_dLblPos), XML_val, toOOXMLPlacement(nLabelPlacement)); + } + } + + pFS->singleElement(FSNS(XML_c, XML_showLegendKey), XML_val, ToPsz10(aLabel.ShowLegendSymbol)); + pFS->singleElement(FSNS(XML_c, XML_showVal), XML_val, ToPsz10(aLabel.ShowNumber)); + pFS->singleElement(FSNS(XML_c, XML_showCatName), XML_val, ToPsz10(aLabel.ShowCategoryName)); + pFS->singleElement(FSNS(XML_c, XML_showSerName), XML_val, ToPsz10(aLabel.ShowSeriesName)); + pFS->singleElement(FSNS(XML_c, XML_showPercent), XML_val, ToPsz10(aLabel.ShowNumberInPercent)); + + // Export the text "separator" if exists + uno::Any aAny = xPropSet->getPropertyValue("LabelSeparator"); + if( aAny.hasValue() ) + { + OUString nLabelSeparator; + aAny >>= nLabelSeparator; + pFS->startElement(FSNS(XML_c, XML_separator)); + pFS->writeEscaped( nLabelSeparator ); + pFS->endElement( FSNS( XML_c, XML_separator ) ); + } + + if (rDLblsRange.hasLabel(nLabelIndex)) + { + pFS->startElement(FSNS(XML_c, XML_extLst)); + pFS->startElement(FSNS(XML_c, XML_ext), XML_uri, + "{CE6537A1-D6FC-4f65-9D91-7224C49458BB}", FSNS(XML_xmlns, XML_c15), + pChartExport->GetFB()->getNamespaceURL(OOX_NS(c15))); + + pFS->singleElement(FSNS(XML_c15, XML_showDataLabelsRange), XML_val, "1"); + + pFS->endElement(FSNS(XML_c, XML_ext)); + pFS->endElement(FSNS(XML_c, XML_extLst)); + } +} + +} + +void ChartExport::exportDataLabels( + const uno::Reference & xSeries, sal_Int32 nSeriesLength, sal_Int32 eChartType, + DataLabelsRange& rDLblsRange) +{ + if (!xSeries.is() || nSeriesLength <= 0) + return; + + uno::Reference xPropSet(xSeries, uno::UNO_QUERY); + if (!xPropSet.is()) + return; + + FSHelperPtr pFS = GetFS(); + pFS->startElement(FSNS(XML_c, XML_dLbls)); + + bool bLinkedNumFmt = true; + if (GetProperty(xPropSet, "LinkNumberFormatToSource")) + mAny >>= bLinkedNumFmt; + + chart2::DataPointLabel aLabel; + bool bLabelIsNumberFormat = true; + if( xPropSet->getPropertyValue("Label") >>= aLabel ) + bLabelIsNumberFormat = aLabel.ShowNumber; + + if (GetProperty(xPropSet, bLabelIsNumberFormat ? OUString("NumberFormat") : OUString("PercentageNumberFormat"))) + { + sal_Int32 nKey = 0; + mAny >>= nKey; + + OUString aNumberFormatString = getNumberFormatCode(nKey); + + pFS->singleElement(FSNS(XML_c, XML_numFmt), + XML_formatCode, aNumberFormatString, + XML_sourceLinked, ToPsz10(bLinkedNumFmt)); + } + + uno::Sequence aAttrLabelIndices; + xPropSet->getPropertyValue("AttributedDataPoints") >>= aAttrLabelIndices; + + // We must not export label placement property when the chart type doesn't + // support this option in MS Office, else MS Office would think the file + // is corrupt & refuse to open it. + + const chart::TypeGroupInfo& rInfo = chart::GetTypeGroupInfo(static_cast(eChartType)); + LabelPlacementParam aParam(!mbIs3DChart, rInfo.mnDefLabelPos); + switch (eChartType) // diagram chart type + { + case chart::TYPEID_PIE: + if(getChartType() == chart::TYPEID_DOUGHNUT) + aParam.mbExport = false; + else + // All pie charts support label placement. + aParam.mbExport = true; + break; + case chart::TYPEID_AREA: + case chart::TYPEID_RADARLINE: + case chart::TYPEID_RADARAREA: + // These chart types don't support label placement. + aParam.mbExport = false; + break; + case chart::TYPEID_BAR: + if (mbStacked || mbPercent) + { + aParam.maAllowedValues.clear(); + aParam.maAllowedValues.insert(css::chart::DataLabelPlacement::CENTER); + aParam.maAllowedValues.insert(css::chart::DataLabelPlacement::INSIDE); + aParam.maAllowedValues.insert(css::chart::DataLabelPlacement::NEAR_ORIGIN); + aParam.meDefault = css::chart::DataLabelPlacement::CENTER; + } + else // Clustered bar chart + { + aParam.maAllowedValues.clear(); + aParam.maAllowedValues.insert(css::chart::DataLabelPlacement::CENTER); + aParam.maAllowedValues.insert(css::chart::DataLabelPlacement::INSIDE); + aParam.maAllowedValues.insert(css::chart::DataLabelPlacement::OUTSIDE); + aParam.maAllowedValues.insert(css::chart::DataLabelPlacement::NEAR_ORIGIN); + aParam.meDefault = css::chart::DataLabelPlacement::OUTSIDE; + } + break; + default: + ; + } + + for (const sal_Int32 nIdx : std::as_const(aAttrLabelIndices)) + { + uno::Reference xLabelPropSet = xSeries->getDataPointByIndex(nIdx); + + if (!xLabelPropSet.is()) + continue; + + pFS->startElement(FSNS(XML_c, XML_dLbl)); + pFS->singleElement(FSNS(XML_c, XML_idx), XML_val, OString::number(nIdx)); + + // export custom position of data label + if( eChartType != chart::TYPEID_PIE ) + { + chart2::RelativePosition aCustomLabelPosition; + if( xLabelPropSet->getPropertyValue("CustomLabelPosition") >>= aCustomLabelPosition ) + { + pFS->startElement(FSNS(XML_c, XML_layout)); + pFS->startElement(FSNS(XML_c, XML_manualLayout)); + + pFS->singleElement(FSNS(XML_c, XML_x), XML_val, OString::number(aCustomLabelPosition.Primary)); + pFS->singleElement(FSNS(XML_c, XML_y), XML_val, OString::number(aCustomLabelPosition.Secondary)); + + SAL_WARN_IF(aCustomLabelPosition.Anchor != css::drawing::Alignment_TOP_LEFT, "oox", "unsupported anchor position"); + + pFS->endElement(FSNS(XML_c, XML_manualLayout)); + pFS->endElement(FSNS(XML_c, XML_layout)); + } + } + + if( GetProperty(xLabelPropSet, "LinkNumberFormatToSource") ) + mAny >>= bLinkedNumFmt; + + if( xLabelPropSet->getPropertyValue("Label") >>= aLabel ) + bLabelIsNumberFormat = aLabel.ShowNumber; + else + bLabelIsNumberFormat = true; + + if (GetProperty(xLabelPropSet, bLabelIsNumberFormat ? OUString("NumberFormat") : OUString("PercentageNumberFormat"))) + { + sal_Int32 nKey = 0; + mAny >>= nKey; + + OUString aNumberFormatString = getNumberFormatCode(nKey); + + pFS->singleElement(FSNS(XML_c, XML_numFmt), XML_formatCode, aNumberFormatString, + XML_sourceLinked, ToPsz10(bLinkedNumFmt)); + } + + // Individual label property that overwrites the baseline. + writeLabelProperties(pFS, this, xLabelPropSet, aParam, nIdx, rDLblsRange); + pFS->endElement(FSNS(XML_c, XML_dLbl)); + } + + // Baseline label properties for all labels. + writeLabelProperties(pFS, this, xPropSet, aParam, -1, rDLblsRange); + + bool bShowLeaderLines = false; + xPropSet->getPropertyValue("ShowCustomLeaderLines") >>= bShowLeaderLines; + pFS->singleElement(FSNS(XML_c, XML_showLeaderLines), XML_val, ToPsz10(bShowLeaderLines)); + + // Export leader line + if( eChartType != chart::TYPEID_PIE ) + { + pFS->startElement(FSNS(XML_c, XML_extLst)); + pFS->startElement(FSNS(XML_c, XML_ext), XML_uri, "{CE6537A1-D6FC-4f65-9D91-7224C49458BB}", FSNS(XML_xmlns, XML_c15), GetFB()->getNamespaceURL(OOX_NS(c15))); + pFS->singleElement(FSNS(XML_c15, XML_showLeaderLines), XML_val, ToPsz10(bShowLeaderLines)); + pFS->endElement(FSNS(XML_c, XML_ext)); + pFS->endElement(FSNS(XML_c, XML_extLst)); + } + pFS->endElement(FSNS(XML_c, XML_dLbls)); +} + +void ChartExport::exportDataPoints( + const uno::Reference< beans::XPropertySet > & xSeriesProperties, + sal_Int32 nSeriesLength, sal_Int32 eChartType ) +{ + uno::Reference< chart2::XDataSeries > xSeries( xSeriesProperties, uno::UNO_QUERY ); + bool bVaryColorsByPoint = false; + Sequence< sal_Int32 > aDataPointSeq; + if( xSeriesProperties.is()) + { + Any aAny = xSeriesProperties->getPropertyValue( "AttributedDataPoints" ); + aAny >>= aDataPointSeq; + xSeriesProperties->getPropertyValue( "VaryColorsByPoint" ) >>= bVaryColorsByPoint; + } + + const sal_Int32 * pPoints = aDataPointSeq.getConstArray(); + sal_Int32 nElement; + Reference< chart2::XColorScheme > xColorScheme; + if( mxNewDiagram.is()) + xColorScheme.set( mxNewDiagram->getDefaultColorScheme()); + + if( bVaryColorsByPoint && xColorScheme.is() ) + { + o3tl::sorted_vector< sal_Int32 > aAttrPointSet; + aAttrPointSet.reserve(aDataPointSeq.getLength()); + for (auto p = pPoints; p < pPoints + aDataPointSeq.getLength(); ++p) + aAttrPointSet.insert(*p); + const auto aEndIt = aAttrPointSet.end(); + for( nElement = 0; nElement < nSeriesLength; ++nElement ) + { + uno::Reference< beans::XPropertySet > xPropSet; + if( aAttrPointSet.find( nElement ) != aEndIt ) + { + try + { + xPropSet = SchXMLSeriesHelper::createOldAPIDataPointPropertySet( + xSeries, nElement, getModel() ); + } + catch( const uno::Exception & ) + { + DBG_UNHANDLED_EXCEPTION( "oox", "Exception caught during Export of data point" ); + } + } + else + { + // property set only containing the color + xPropSet.set( new ColorPropertySet( ColorTransparency, xColorScheme->getColorByIndex( nElement ))); + } + + if( xPropSet.is() ) + { + FSHelperPtr pFS = GetFS(); + pFS->startElement(FSNS(XML_c, XML_dPt)); + pFS->singleElement(FSNS(XML_c, XML_idx), XML_val, OString::number(nElement)); + + switch (eChartType) + { + case chart::TYPEID_PIE: + case chart::TYPEID_DOUGHNUT: + { + if( xPropSet.is() && GetProperty( xPropSet, "SegmentOffset") ) + { + sal_Int32 nOffset = 0; + mAny >>= nOffset; + if (nOffset) + pFS->singleElement( FSNS( XML_c, XML_explosion ), + XML_val, OString::number( nOffset ) ); + } + break; + } + default: + break; + } + exportShapeProps( xPropSet ); + + pFS->endElement( FSNS( XML_c, XML_dPt ) ); + } + } + } + + // Export Data Point Property in Charts even if the VaryColors is false + if( bVaryColorsByPoint ) + return; + + o3tl::sorted_vector< sal_Int32 > aAttrPointSet; + aAttrPointSet.reserve(aDataPointSeq.getLength()); + for (auto p = pPoints; p < pPoints + aDataPointSeq.getLength(); ++p) + aAttrPointSet.insert(*p); + const auto aEndIt = aAttrPointSet.end(); + for( nElement = 0; nElement < nSeriesLength; ++nElement ) + { + uno::Reference< beans::XPropertySet > xPropSet; + if( aAttrPointSet.find( nElement ) != aEndIt ) + { + try + { + xPropSet = SchXMLSeriesHelper::createOldAPIDataPointPropertySet( + xSeries, nElement, getModel() ); + } + catch( const uno::Exception & ) + { + DBG_UNHANDLED_EXCEPTION( "oox", "Exception caught during Export of data point" ); + } + } + + if( xPropSet.is() ) + { + FSHelperPtr pFS = GetFS(); + pFS->startElement(FSNS(XML_c, XML_dPt)); + pFS->singleElement(FSNS(XML_c, XML_idx), XML_val, OString::number(nElement)); + + switch( eChartType ) + { + case chart::TYPEID_BUBBLE: + case chart::TYPEID_HORBAR: + case chart::TYPEID_BAR: + pFS->singleElement(FSNS(XML_c, XML_invertIfNegative), XML_val, "0"); + exportShapeProps(xPropSet); + break; + + case chart::TYPEID_LINE: + case chart::TYPEID_SCATTER: + case chart::TYPEID_RADARLINE: + exportMarker(xPropSet); + break; + + default: + exportShapeProps(xPropSet); + break; + } + + pFS->endElement( FSNS( XML_c, XML_dPt ) ); + } + } +} + +void ChartExport::exportAxesId(bool bPrimaryAxes, bool bCheckCombinedAxes) +{ + sal_Int32 nAxisIdx, nAxisIdy; + bool bPrimaryAxisExists = false; + bool bSecondaryAxisExists = false; + // let's check which axis already exists and which axis is attached to the actual dataseries + if (maAxes.size() >= 2) + { + bPrimaryAxisExists = bPrimaryAxes && maAxes[1].nAxisType == AXIS_PRIMARY_Y; + bSecondaryAxisExists = !bPrimaryAxes && maAxes[1].nAxisType == AXIS_SECONDARY_Y; + } + // tdf#114181 keep axes of combined charts + if ( bCheckCombinedAxes && ( bPrimaryAxisExists || bSecondaryAxisExists ) ) + { + nAxisIdx = maAxes[0].nAxisId; + nAxisIdy = maAxes[1].nAxisId; + } + else + { + nAxisIdx = lcl_generateRandomValue(); + nAxisIdy = lcl_generateRandomValue(); + AxesType eXAxis = bPrimaryAxes ? AXIS_PRIMARY_X : AXIS_SECONDARY_X; + AxesType eYAxis = bPrimaryAxes ? AXIS_PRIMARY_Y : AXIS_SECONDARY_Y; + maAxes.emplace_back( eXAxis, nAxisIdx, nAxisIdy ); + maAxes.emplace_back( eYAxis, nAxisIdy, nAxisIdx ); + } + FSHelperPtr pFS = GetFS(); + pFS->singleElement(FSNS(XML_c, XML_axId), XML_val, OString::number(nAxisIdx)); + pFS->singleElement(FSNS(XML_c, XML_axId), XML_val, OString::number(nAxisIdy)); + if (mbHasZAxis) + { + sal_Int32 nAxisIdz = 0; + if( isDeep3dChart() ) + { + nAxisIdz = lcl_generateRandomValue(); + maAxes.emplace_back( AXIS_PRIMARY_Z, nAxisIdz, nAxisIdy ); + } + pFS->singleElement(FSNS(XML_c, XML_axId), XML_val, OString::number(nAxisIdz)); + } +} + +void ChartExport::exportGrouping( bool isBar ) +{ + FSHelperPtr pFS = GetFS(); + Reference< XPropertySet > xPropSet( mxDiagram , uno::UNO_QUERY); + // grouping + if( GetProperty( xPropSet, "Stacked" ) ) + mAny >>= mbStacked; + if( GetProperty( xPropSet, "Percent" ) ) + mAny >>= mbPercent; + + const char* grouping = nullptr; + if (mbStacked) + grouping = "stacked"; + else if (mbPercent) + grouping = "percentStacked"; + else + { + if( isBar && !isDeep3dChart() ) + { + grouping = "clustered"; + } + else + grouping = "standard"; + } + pFS->singleElement(FSNS(XML_c, XML_grouping), XML_val, grouping); +} + +void ChartExport::exportTrendlines( const Reference< chart2::XDataSeries >& xSeries ) +{ + FSHelperPtr pFS = GetFS(); + Reference< chart2::XRegressionCurveContainer > xRegressionCurveContainer( xSeries, UNO_QUERY ); + if( !xRegressionCurveContainer.is() ) + return; + + const Sequence< Reference< chart2::XRegressionCurve > > aRegCurveSeq = xRegressionCurveContainer->getRegressionCurves(); + for( const Reference< chart2::XRegressionCurve >& xRegCurve : aRegCurveSeq ) + { + if (!xRegCurve.is()) + continue; + + Reference< XPropertySet > xProperties( xRegCurve , uno::UNO_QUERY ); + + OUString aService; + Reference< lang::XServiceName > xServiceName( xProperties, UNO_QUERY ); + if( !xServiceName.is() ) + continue; + + aService = xServiceName->getServiceName(); + + if(aService != "com.sun.star.chart2.LinearRegressionCurve" && + aService != "com.sun.star.chart2.ExponentialRegressionCurve" && + aService != "com.sun.star.chart2.LogarithmicRegressionCurve" && + aService != "com.sun.star.chart2.PotentialRegressionCurve" && + aService != "com.sun.star.chart2.PolynomialRegressionCurve" && + aService != "com.sun.star.chart2.MovingAverageRegressionCurve") + continue; + + pFS->startElement(FSNS(XML_c, XML_trendline)); + + OUString aName; + xProperties->getPropertyValue("CurveName") >>= aName; + if(!aName.isEmpty()) + { + pFS->startElement(FSNS(XML_c, XML_name)); + pFS->writeEscaped(aName); + pFS->endElement( FSNS( XML_c, XML_name) ); + } + + exportShapeProps( xProperties ); + + if( aService == "com.sun.star.chart2.LinearRegressionCurve" ) + { + pFS->singleElement(FSNS(XML_c, XML_trendlineType), XML_val, "linear"); + } + else if( aService == "com.sun.star.chart2.ExponentialRegressionCurve" ) + { + pFS->singleElement(FSNS(XML_c, XML_trendlineType), XML_val, "exp"); + } + else if( aService == "com.sun.star.chart2.LogarithmicRegressionCurve" ) + { + pFS->singleElement(FSNS(XML_c, XML_trendlineType), XML_val, "log"); + } + else if( aService == "com.sun.star.chart2.PotentialRegressionCurve" ) + { + pFS->singleElement(FSNS(XML_c, XML_trendlineType), XML_val, "power"); + } + else if( aService == "com.sun.star.chart2.PolynomialRegressionCurve" ) + { + pFS->singleElement(FSNS(XML_c, XML_trendlineType), XML_val, "poly"); + + sal_Int32 aDegree = 2; + xProperties->getPropertyValue( "PolynomialDegree") >>= aDegree; + pFS->singleElement(FSNS(XML_c, XML_order), XML_val, OString::number(aDegree)); + } + else if( aService == "com.sun.star.chart2.MovingAverageRegressionCurve" ) + { + pFS->singleElement(FSNS(XML_c, XML_trendlineType), XML_val, "movingAvg"); + + sal_Int32 aPeriod = 2; + xProperties->getPropertyValue( "MovingAveragePeriod") >>= aPeriod; + + pFS->singleElement(FSNS(XML_c, XML_period), XML_val, OString::number(aPeriod)); + } + else + { + // should never happen + // This would produce invalid OOXML files so we check earlier for the type + assert(false); + } + + double fExtrapolateForward = 0.0; + double fExtrapolateBackward = 0.0; + + xProperties->getPropertyValue("ExtrapolateForward") >>= fExtrapolateForward; + xProperties->getPropertyValue("ExtrapolateBackward") >>= fExtrapolateBackward; + + pFS->singleElement( FSNS( XML_c, XML_forward ), + XML_val, OString::number(fExtrapolateForward) ); + + pFS->singleElement( FSNS( XML_c, XML_backward ), + XML_val, OString::number(fExtrapolateBackward) ); + + bool bForceIntercept = false; + xProperties->getPropertyValue("ForceIntercept") >>= bForceIntercept; + + if (bForceIntercept) + { + double fInterceptValue = 0.0; + xProperties->getPropertyValue("InterceptValue") >>= fInterceptValue; + + pFS->singleElement( FSNS( XML_c, XML_intercept ), + XML_val, OString::number(fInterceptValue) ); + } + + // Equation properties + Reference< XPropertySet > xEquationProperties( xRegCurve->getEquationProperties() ); + + // Show Equation + bool bShowEquation = false; + xEquationProperties->getPropertyValue("ShowEquation") >>= bShowEquation; + + // Show R^2 + bool bShowCorrelationCoefficient = false; + xEquationProperties->getPropertyValue("ShowCorrelationCoefficient") >>= bShowCorrelationCoefficient; + + pFS->singleElement( FSNS( XML_c, XML_dispRSqr ), + XML_val, ToPsz10(bShowCorrelationCoefficient) ); + + pFS->singleElement(FSNS(XML_c, XML_dispEq), XML_val, ToPsz10(bShowEquation)); + + pFS->endElement( FSNS( XML_c, XML_trendline ) ); + } +} + +void ChartExport::exportMarker(const Reference< XPropertySet >& xPropSet) +{ + chart2::Symbol aSymbol; + if( GetProperty( xPropSet, "Symbol" ) ) + mAny >>= aSymbol; + + if(aSymbol.Style != chart2::SymbolStyle_STANDARD && aSymbol.Style != chart2::SymbolStyle_NONE) + return; + + FSHelperPtr pFS = GetFS(); + pFS->startElement(FSNS(XML_c, XML_marker)); + + sal_Int32 nSymbol = aSymbol.StandardSymbol; + // TODO: more properties support for marker + const char* pSymbolType; // no initialization here, to let compiler warn if we have a code path + // where it stays uninitialized + switch( nSymbol ) + { + case 0: + pSymbolType = "square"; + break; + case 1: + pSymbolType = "diamond"; + break; + case 2: + case 3: + case 4: + case 5: + pSymbolType = "triangle"; + break; + case 8: + pSymbolType = "circle"; + break; + case 9: + pSymbolType = "star"; + break; + case 10: + pSymbolType = "x"; // in MS office 2010 built in symbol marker 'X' is represented as 'x' + break; + case 11: + pSymbolType = "plus"; + break; + case 13: + pSymbolType = "dash"; + break; + default: + pSymbolType = "square"; + break; + } + + bool bSkipFormatting = false; + if (aSymbol.Style == chart2::SymbolStyle_NONE) + { + bSkipFormatting = true; + pSymbolType = "none"; + } + + pFS->singleElement(FSNS(XML_c, XML_symbol), XML_val, pSymbolType); + + if (!bSkipFormatting) + { + awt::Size aSymbolSize = aSymbol.Size; + sal_Int32 nSize = std::max( aSymbolSize.Width, aSymbolSize.Height ); + + nSize = nSize/250.0*7.0 + 1; // just guessed based on some test cases, + //the value is always 1 less than the actual value. + nSize = std::clamp( int(nSize), 2, 72 ); + pFS->singleElement(FSNS(XML_c, XML_size), XML_val, OString::number(nSize)); + + pFS->startElement(FSNS(XML_c, XML_spPr)); + + util::Color aColor = aSymbol.FillColor; + if (GetProperty(xPropSet, "Color")) + mAny >>= aColor; + + if (aColor == -1) + { + pFS->singleElement(FSNS(XML_a, XML_noFill)); + } + else + WriteSolidFill(::Color(ColorTransparency, aColor)); + + pFS->endElement( FSNS( XML_c, XML_spPr ) ); + } + + pFS->endElement( FSNS( XML_c, XML_marker ) ); +} + +void ChartExport::exportSmooth() +{ + FSHelperPtr pFS = GetFS(); + Reference< XPropertySet > xPropSet( mxDiagram , uno::UNO_QUERY ); + sal_Int32 nSplineType = 0; + if( GetProperty( xPropSet, "SplineType" ) ) + mAny >>= nSplineType; + const char* pVal = nSplineType != 0 ? "1" : "0"; + pFS->singleElement(FSNS(XML_c, XML_smooth), XML_val, pVal); +} + +void ChartExport::exportFirstSliceAng( ) +{ + FSHelperPtr pFS = GetFS(); + sal_Int32 nStartingAngle = 0; + Reference< XPropertySet > xPropSet( mxDiagram , uno::UNO_QUERY); + if( GetProperty( xPropSet, "StartingAngle" ) ) + mAny >>= nStartingAngle; + + // convert to ooxml angle + nStartingAngle = (450 - nStartingAngle ) % 360; + pFS->singleElement(FSNS(XML_c, XML_firstSliceAng), XML_val, OString::number(nStartingAngle)); +} + +namespace { + +const char* getErrorBarStyle(sal_Int32 nErrorBarStyle) +{ + switch(nErrorBarStyle) + { + case cssc::ErrorBarStyle::NONE: + return nullptr; + case cssc::ErrorBarStyle::VARIANCE: + break; + case cssc::ErrorBarStyle::STANDARD_DEVIATION: + return "stdDev"; + case cssc::ErrorBarStyle::ABSOLUTE: + return "fixedVal"; + case cssc::ErrorBarStyle::RELATIVE: + return "percentage"; + case cssc::ErrorBarStyle::ERROR_MARGIN: + break; + case cssc::ErrorBarStyle::STANDARD_ERROR: + return "stdErr"; + case cssc::ErrorBarStyle::FROM_DATA: + return "cust"; + default: + assert(false && "can't happen"); + } + return nullptr; +} + +Reference< chart2::data::XDataSequence> getLabeledSequence( + const uno::Sequence< uno::Reference< chart2::data::XLabeledDataSequence > >& aSequences, + bool bPositive ) +{ + OUString aDirection; + if(bPositive) + aDirection = "positive"; + else + aDirection = "negative"; + + for( const auto& rSequence : aSequences ) + { + if( rSequence.is()) + { + uno::Reference< chart2::data::XDataSequence > xSequence( rSequence->getValues()); + uno::Reference< beans::XPropertySet > xSeqProp( xSequence, uno::UNO_QUERY_THROW ); + OUString aRole; + if( ( xSeqProp->getPropertyValue( "Role" ) >>= aRole ) && + aRole.match( "error-bars" ) && aRole.indexOf(aDirection) >= 0 ) + { + return xSequence; + } + } + } + + return Reference< chart2::data::XDataSequence > (); +} + +} + +void ChartExport::exportErrorBar(const Reference< XPropertySet>& xErrorBarProps, bool bYError) +{ + sal_Int32 nErrorBarStyle = cssc::ErrorBarStyle::NONE; + xErrorBarProps->getPropertyValue("ErrorBarStyle") >>= nErrorBarStyle; + const char* pErrorBarStyle = getErrorBarStyle(nErrorBarStyle); + if(!pErrorBarStyle) + return; + + FSHelperPtr pFS = GetFS(); + pFS->startElement(FSNS(XML_c, XML_errBars)); + pFS->singleElement(FSNS(XML_c, XML_errDir), XML_val, bYError ? "y" : "x"); + bool bPositive = false, bNegative = false; + xErrorBarProps->getPropertyValue("ShowPositiveError") >>= bPositive; + xErrorBarProps->getPropertyValue("ShowNegativeError") >>= bNegative; + const char* pErrBarType; + if(bPositive && bNegative) + pErrBarType = "both"; + else if(bPositive) + pErrBarType = "plus"; + else if(bNegative) + pErrBarType = "minus"; + else + { + // what the hell should we do now? + // at least this makes the file valid + pErrBarType = "both"; + } + pFS->singleElement(FSNS(XML_c, XML_errBarType), XML_val, pErrBarType); + pFS->singleElement(FSNS(XML_c, XML_errValType), XML_val, pErrorBarStyle); + pFS->singleElement(FSNS(XML_c, XML_noEndCap), XML_val, "0"); + if(nErrorBarStyle == cssc::ErrorBarStyle::FROM_DATA) + { + uno::Reference< chart2::data::XDataSource > xDataSource(xErrorBarProps, uno::UNO_QUERY); + Sequence< Reference < chart2::data::XLabeledDataSequence > > aSequences = + xDataSource->getDataSequences(); + + if(bPositive) + { + exportSeriesValues(getLabeledSequence(aSequences, true), XML_plus); + } + + if(bNegative) + { + exportSeriesValues(getLabeledSequence(aSequences, false), XML_minus); + } + } + else + { + double nVal = 0.0; + if(nErrorBarStyle == cssc::ErrorBarStyle::STANDARD_DEVIATION) + { + xErrorBarProps->getPropertyValue("Weight") >>= nVal; + } + else + { + if(bPositive) + xErrorBarProps->getPropertyValue("PositiveError") >>= nVal; + else + xErrorBarProps->getPropertyValue("NegativeError") >>= nVal; + } + + pFS->singleElement(FSNS(XML_c, XML_val), XML_val, OString::number(nVal)); + } + + exportShapeProps( xErrorBarProps ); + + pFS->endElement( FSNS( XML_c, XML_errBars) ); +} + +void ChartExport::exportView3D() +{ + Reference< XPropertySet > xPropSet( mxDiagram , uno::UNO_QUERY); + if( !xPropSet.is() ) + return; + FSHelperPtr pFS = GetFS(); + pFS->startElement(FSNS(XML_c, XML_view3D)); + sal_Int32 eChartType = getChartType( ); + // rotX + if( GetProperty( xPropSet, "RotationHorizontal" ) ) + { + sal_Int32 nRotationX = 0; + mAny >>= nRotationX; + if( nRotationX < 0 ) + { + if(eChartType == chart::TYPEID_PIE) + { + /* In OOXML we get value in 0..90 range for pie chart X rotation , whereas we expect it to be in -90..90 range, + so we convert that during import. It is modified in View3DConverter::convertFromModel() + here we convert it back to 0..90 as we received in import */ + nRotationX += 90; // X rotation (map Chart2 [-179,180] to OOXML [0..90]) + } + else + nRotationX += 360; // X rotation (map Chart2 [-179,180] to OOXML [-90..90]) + } + pFS->singleElement(FSNS(XML_c, XML_rotX), XML_val, OString::number(nRotationX)); + } + // rotY + if( GetProperty( xPropSet, "RotationVertical" ) ) + { + // Y rotation (map Chart2 [-179,180] to OOXML [0..359]) + if( eChartType == chart::TYPEID_PIE && GetProperty( xPropSet, "StartingAngle" ) ) + { + // Y rotation used as 'first pie slice angle' in 3D pie charts + sal_Int32 nStartingAngle=0; + mAny >>= nStartingAngle; + // convert to ooxml angle + nStartingAngle = (450 - nStartingAngle ) % 360; + pFS->singleElement(FSNS(XML_c, XML_rotY), XML_val, OString::number(nStartingAngle)); + } + else + { + sal_Int32 nRotationY = 0; + mAny >>= nRotationY; + // Y rotation (map Chart2 [-179,180] to OOXML [0..359]) + if( nRotationY < 0 ) + nRotationY += 360; + pFS->singleElement(FSNS(XML_c, XML_rotY), XML_val, OString::number(nRotationY)); + } + } + // rAngAx + if( GetProperty( xPropSet, "RightAngledAxes" ) ) + { + bool bRightAngled = false; + mAny >>= bRightAngled; + const char* sRightAngled = bRightAngled ? "1":"0"; + pFS->singleElement(FSNS(XML_c, XML_rAngAx), XML_val, sRightAngled); + } + // perspective + if( GetProperty( xPropSet, "Perspective" ) ) + { + sal_Int32 nPerspective = 0; + mAny >>= nPerspective; + // map Chart2 [0,100] to OOXML [0..200] + nPerspective *= 2; + pFS->singleElement(FSNS(XML_c, XML_perspective), XML_val, OString::number(nPerspective)); + } + pFS->endElement( FSNS( XML_c, XML_view3D ) ); +} + +bool ChartExport::isDeep3dChart() +{ + bool isDeep = false; + if( mbIs3DChart ) + { + Reference< XPropertySet > xPropSet( mxDiagram , uno::UNO_QUERY); + if( GetProperty( xPropSet, "Deep" ) ) + mAny >>= isDeep; + } + return isDeep; +} + +OUString ChartExport::getNumberFormatCode(sal_Int32 nKey) const +{ + /* XXX if this was called more than one or two times per export the two + * SvNumberFormatter instances and NfKeywordTable should be member + * variables and initialized only once. */ + + OUString aCode("General"); // init with fallback + uno::Reference xNumberFormatsSupplier(mxChartModel, uno::UNO_QUERY_THROW); + SvNumberFormatsSupplierObj* pSupplierObj = comphelper::getFromUnoTunnel( xNumberFormatsSupplier); + if (!pSupplierObj) + return aCode; + + SvNumberFormatter* pNumberFormatter = pSupplierObj->GetNumberFormatter(); + if (!pNumberFormatter) + return aCode; + + SvNumberFormatter aTempFormatter( comphelper::getProcessComponentContext(), LANGUAGE_ENGLISH_US); + NfKeywordTable aKeywords; + aTempFormatter.FillKeywordTableForExcel( aKeywords); + aCode = pNumberFormatter->GetFormatStringForExcel( nKey, aKeywords, aTempFormatter); + + return aCode; +} + +}// oox + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx new file mode 100644 index 000000000..85207b7c7 --- /dev/null +++ b/oox/source/export/drawingml.cxx @@ -0,0 +1,6125 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +using namespace ::css; +using namespace ::css::beans; +using namespace ::css::drawing; +using namespace ::css::i18n; +using namespace ::css::style; +using namespace ::css::text; +using namespace ::css::uno; +using namespace ::css::container; +using namespace ::com::sun::star::drawing::EnhancedCustomShapeSegmentCommand; + +using ::css::io::XOutputStream; +using ::sax_fastparser::FSHelperPtr; +using ::sax_fastparser::FastSerializerHelper; + +namespace +{ +/// Extracts start or end alpha information from a transparency gradient. +sal_Int32 GetAlphaFromTransparenceGradient(const awt::Gradient& rGradient, bool bStart) +{ + // Our alpha is a gray color value. + sal_uInt8 nRed = ::Color(ColorTransparency, bStart ? rGradient.StartColor : rGradient.EndColor).GetRed(); + // drawingML alpha is a percentage on a 0..100000 scale. + return (255 - nRed) * oox::drawingml::MAX_PERCENT / 255; +} + +const char* g_aPredefinedClrNames[] = { + "dk1", + "lt1", + "dk2", + "lt2", + "accent1", + "accent2", + "accent3", + "accent4", + "accent5", + "accent6", + "hlink", + "folHlink", +}; +} + +namespace oox::drawingml { + +URLTransformer::~URLTransformer() +{ +} + +OUString URLTransformer::getTransformedString(const OUString& rString) const +{ + return rString; +} + +bool URLTransformer::isExternalURL(const OUString& rURL) const +{ + bool bExternal = true; + if (rURL.startsWith("#")) + bExternal = false; + return bExternal; +} + +static css::uno::Any getLineDash( const css::uno::Reference& xModel, const OUString& rDashName ) + { + css::uno::Reference xFact(xModel, css::uno::UNO_QUERY); + css::uno::Reference xNameAccess( + xFact->createInstance("com.sun.star.drawing.DashTable"), + css::uno::UNO_QUERY ); + if(xNameAccess.is()) + { + if (!xNameAccess->hasByName(rDashName)) + return css::uno::Any(); + + return xNameAccess->getByName(rDashName); + } + + return css::uno::Any(); + } + +namespace +{ +void WriteGradientPath(const awt::Gradient& rGradient, const FSHelperPtr& pFS, const bool bCircle) +{ + pFS->startElementNS(XML_a, XML_path, XML_path, bCircle ? "circle" : "rect"); + + // Write the focus rectangle. Work with the focus point, and assume + // that it extends 50% in all directions. The below + // left/top/right/bottom values are percentages, where 0 means the + // edge of the tile rectangle and 100% means the center of it. + rtl::Reference pAttributeList( + sax_fastparser::FastSerializerHelper::createAttrList()); + sal_Int32 nLeftPercent = rGradient.XOffset; + pAttributeList->add(XML_l, OString::number(nLeftPercent * PER_PERCENT)); + sal_Int32 nTopPercent = rGradient.YOffset; + pAttributeList->add(XML_t, OString::number(nTopPercent * PER_PERCENT)); + sal_Int32 nRightPercent = 100 - rGradient.XOffset; + pAttributeList->add(XML_r, OString::number(nRightPercent * PER_PERCENT)); + sal_Int32 nBottomPercent = 100 - rGradient.YOffset; + pAttributeList->add(XML_b, OString::number(nBottomPercent * PER_PERCENT)); + pFS->singleElementNS(XML_a, XML_fillToRect, pAttributeList); + + pFS->endElementNS(XML_a, XML_path); +} +} + +// not thread safe +std::stack DrawingML::mnImageCounter; +std::stack DrawingML::mnWdpImageCounter; +std::stack> DrawingML::maWdpCache; +sal_Int32 DrawingML::mnDrawingMLCount = 0; +sal_Int32 DrawingML::mnVmlCount = 0; +std::stack> DrawingML::maExportGraphics; + +sal_Int16 DrawingML::GetScriptType(const OUString& rStr) +{ + if (rStr.getLength() > 0) + { + static Reference xBreakIterator = + css::i18n::BreakIterator::create(comphelper::getProcessComponentContext()); + + sal_Int16 nScriptType = xBreakIterator->getScriptType(rStr, 0); + + if (nScriptType == css::i18n::ScriptType::WEAK) + { + sal_Int32 nPos = xBreakIterator->nextScript(rStr, 0, nScriptType); + if (nPos < rStr.getLength()) + nScriptType = xBreakIterator->getScriptType(rStr, nPos); + + } + + if (nScriptType != css::i18n::ScriptType::WEAK) + return nScriptType; + } + + return css::i18n::ScriptType::LATIN; +} + +void DrawingML::ResetMlCounters() +{ + mnDrawingMLCount = 0; + mnVmlCount = 0; +} + +void DrawingML::PushExportGraphics() +{ + mnImageCounter.push(1); + maExportGraphics.emplace(); + + mnWdpImageCounter.push(1); + maWdpCache.emplace(); +} + +void DrawingML::PopExportGraphics() +{ + mnImageCounter.pop(); + maExportGraphics.pop(); + + mnWdpImageCounter.pop(); + maWdpCache.pop(); +} + +bool DrawingML::GetProperty( const Reference< XPropertySet >& rXPropertySet, const OUString& aName ) +{ + try + { + mAny = rXPropertySet->getPropertyValue(aName); + if (mAny.hasValue()) + return true; + } + catch( const Exception& ) + { + /* printf ("exception when trying to get value of property: %s\n", aName.toUtf8()); */ + } + return false; +} + +bool DrawingML::GetPropertyAndState( const Reference< XPropertySet >& rXPropertySet, const Reference< XPropertyState >& rXPropertyState, const OUString& aName, PropertyState& eState ) +{ + try + { + mAny = rXPropertySet->getPropertyValue(aName); + if (mAny.hasValue()) + { + eState = rXPropertyState->getPropertyState(aName); + return true; + } + } + catch( const Exception& ) + { + /* printf ("exception when trying to get value of property: %s\n", aName.toUtf8()); */ + } + return false; +} + +namespace +{ +/// Gets hexa value of color on string format. +OString getColorStr(const ::Color nColor) +{ + // Transparency is a separate element. + OString sColor = OString::number(sal_uInt32(nColor) & 0x00FFFFFF, 16); + if (sColor.getLength() < 6) + { + OStringBuffer sBuf("0"); + int remains = 5 - sColor.getLength(); + + while (remains > 0) + { + sBuf.append("0"); + remains--; + } + + sBuf.append(sColor); + + sColor = sBuf.getStr(); + } + return sColor; +} +} + +void DrawingML::WriteColor( ::Color nColor, sal_Int32 nAlpha ) +{ + const auto sColor = getColorStr(nColor); + if( nAlpha < MAX_PERCENT ) + { + mpFS->startElementNS(XML_a, XML_srgbClr, XML_val, sColor); + mpFS->singleElementNS(XML_a, XML_alpha, XML_val, OString::number(nAlpha)); + mpFS->endElementNS( XML_a, XML_srgbClr ); + + } + else + { + mpFS->singleElementNS(XML_a, XML_srgbClr, XML_val, sColor); + } +} + +void DrawingML::WriteColor( const OUString& sColorSchemeName, const Sequence< PropertyValue >& aTransformations, sal_Int32 nAlpha ) +{ + // prevent writing a tag with empty val attribute + if( sColorSchemeName.isEmpty() ) + return; + + if( aTransformations.hasElements() ) + { + mpFS->startElementNS(XML_a, XML_schemeClr, XML_val, sColorSchemeName); + WriteColorTransformations( aTransformations, nAlpha ); + mpFS->endElementNS( XML_a, XML_schemeClr ); + } + else if(nAlpha < MAX_PERCENT) + { + mpFS->startElementNS(XML_a, XML_schemeClr, XML_val, sColorSchemeName); + mpFS->singleElementNS(XML_a, XML_alpha, XML_val, OString::number(nAlpha)); + mpFS->endElementNS( XML_a, XML_schemeClr ); + } + else + { + mpFS->singleElementNS(XML_a, XML_schemeClr, XML_val, sColorSchemeName); + } +} + +void DrawingML::WriteColor( const ::Color nColor, const Sequence< PropertyValue >& aTransformations, sal_Int32 nAlpha ) +{ + const auto sColor = getColorStr(nColor); + if( aTransformations.hasElements() ) + { + mpFS->startElementNS(XML_a, XML_srgbClr, XML_val, sColor); + WriteColorTransformations(aTransformations, nAlpha); + mpFS->endElementNS(XML_a, XML_srgbClr); + } + else if(nAlpha < MAX_PERCENT) + { + mpFS->startElementNS(XML_a, XML_srgbClr, XML_val, sColor); + mpFS->singleElementNS(XML_a, XML_alpha, XML_val, OString::number(nAlpha)); + mpFS->endElementNS(XML_a, XML_srgbClr); + } + else + { + mpFS->singleElementNS(XML_a, XML_srgbClr, XML_val, sColor); + } +} + +void DrawingML::WriteColorTransformations( const Sequence< PropertyValue >& aTransformations, sal_Int32 nAlpha ) +{ + for( const auto& rTransformation : aTransformations ) + { + sal_Int32 nToken = Color::getColorTransformationToken( rTransformation.Name ); + if( nToken != XML_TOKEN_INVALID && rTransformation.Value.hasValue() ) + { + if(nToken == XML_alpha && nAlpha < MAX_PERCENT) + { + mpFS->singleElementNS(XML_a, nToken, XML_val, OString::number(nAlpha)); + } + else + { + sal_Int32 nValue = rTransformation.Value.get(); + mpFS->singleElementNS(XML_a, nToken, XML_val, OString::number(nValue)); + } + } + } +} + +bool DrawingML::WriteCharColor(const css::uno::Reference& xPropertySet) +{ + if (!xPropertySet->getPropertySetInfo()->hasPropertyByName("CharColorTheme")) + { + return false; + } + + sal_Int32 nCharColorTheme = -1; + xPropertySet->getPropertyValue("CharColorTheme") >>= nCharColorTheme; + if (nCharColorTheme < 0 || nCharColorTheme > 11) + { + return false; + } + + const char* pColorName = g_aPredefinedClrNames[nCharColorTheme]; + + sal_Int32 nCharColorTintOrShade{}; + xPropertySet->getPropertyValue("CharColorTintOrShade") >>= nCharColorTintOrShade; + if (nCharColorTintOrShade != 0) + { + return false; + } + + mpFS->startElementNS(XML_a, XML_solidFill); + mpFS->startElementNS(XML_a, XML_schemeClr, XML_val, pColorName); + + sal_Int32 nCharColorLumMod{}; + xPropertySet->getPropertyValue("CharColorLumMod") >>= nCharColorLumMod; + if (nCharColorLumMod != 10000) + { + mpFS->singleElementNS(XML_a, XML_lumMod, XML_val, OString::number(nCharColorLumMod * 10)); + } + + sal_Int32 nCharColorLumOff{}; + xPropertySet->getPropertyValue("CharColorLumOff") >>= nCharColorLumOff; + if (nCharColorLumOff != 0) + { + mpFS->singleElementNS(XML_a, XML_lumOff, XML_val, OString::number(nCharColorLumOff * 10)); + } + + mpFS->endElementNS(XML_a, XML_schemeClr); + mpFS->endElementNS(XML_a, XML_solidFill); + + return true; +} + +void DrawingML::WriteSolidFill( ::Color nColor, sal_Int32 nAlpha ) +{ + mpFS->startElementNS(XML_a, XML_solidFill); + WriteColor( nColor, nAlpha ); + mpFS->endElementNS( XML_a, XML_solidFill ); +} + +void DrawingML::WriteSolidFill( const OUString& sSchemeName, const Sequence< PropertyValue >& aTransformations, sal_Int32 nAlpha ) +{ + mpFS->startElementNS(XML_a, XML_solidFill); + WriteColor( sSchemeName, aTransformations, nAlpha ); + mpFS->endElementNS( XML_a, XML_solidFill ); +} + +void DrawingML::WriteSolidFill( const ::Color nColor, const Sequence< PropertyValue >& aTransformations, sal_Int32 nAlpha ) +{ + mpFS->startElementNS(XML_a, XML_solidFill); + WriteColor(nColor, aTransformations, nAlpha); + mpFS->endElementNS(XML_a, XML_solidFill); +} + +void DrawingML::WriteSolidFill( const Reference< XPropertySet >& rXPropSet ) +{ + // get fill color + if ( !GetProperty( rXPropSet, "FillColor" ) ) + return; + sal_uInt32 nFillColor = mAny.get(); + + // get InteropGrabBag and search the relevant attributes + OUString sColorFillScheme; + sal_uInt32 nOriginalColor = 0; + Sequence< PropertyValue > aStyleProperties, aTransformations; + if ( GetProperty( rXPropSet, "InteropGrabBag" ) ) + { + Sequence< PropertyValue > aGrabBag; + mAny >>= aGrabBag; + for( const auto& rProp : std::as_const(aGrabBag) ) + { + if( rProp.Name == "SpPrSolidFillSchemeClr" ) + rProp.Value >>= sColorFillScheme; + else if( rProp.Name == "OriginalSolidFillClr" ) + rProp.Value >>= nOriginalColor; + else if( rProp.Name == "StyleFillRef" ) + rProp.Value >>= aStyleProperties; + else if( rProp.Name == "SpPrSolidFillSchemeClrTransformations" ) + rProp.Value >>= aTransformations; + } + } + + sal_Int32 nAlpha = MAX_PERCENT; + if( GetProperty( rXPropSet, "FillTransparence" ) ) + { + sal_Int32 nTransparency = 0; + mAny >>= nTransparency; + // Calculate alpha value (see oox/source/drawingml/color.cxx : getTransparency()) + nAlpha = (MAX_PERCENT - ( PER_PERCENT * nTransparency ) ); + } + + // OOXML has no separate transparence gradient but uses transparency in the gradient stops. + // So we merge transparency and color and use gradient fill in such case. + awt::Gradient aTransparenceGradient; + bool bNeedGradientFill(false); + if (GetProperty(rXPropSet, "FillTransparenceGradient")) + { + mAny >>= aTransparenceGradient; + if (aTransparenceGradient.StartColor != aTransparenceGradient.EndColor) + bNeedGradientFill = true; + else if (aTransparenceGradient.StartColor != 0) + nAlpha = GetAlphaFromTransparenceGradient(aTransparenceGradient, true); + } + + // write XML + if (bNeedGradientFill) + { + awt::Gradient aPseudoColorGradient; + aPseudoColorGradient.XOffset = aTransparenceGradient.XOffset; + aPseudoColorGradient.YOffset = aTransparenceGradient.YOffset; + aPseudoColorGradient.StartIntensity = 100; + aPseudoColorGradient.EndIntensity = 100; + aPseudoColorGradient.Angle = aTransparenceGradient.Angle; + aPseudoColorGradient.Border = aTransparenceGradient.Border; + aPseudoColorGradient.Style = aTransparenceGradient.Style; + aPseudoColorGradient.StartColor = nFillColor; + aPseudoColorGradient.EndColor = nFillColor; + aPseudoColorGradient.StepCount = aTransparenceGradient.StepCount; + mpFS->startElementNS(XML_a, XML_gradFill, XML_rotWithShape, "0"); + WriteGradientFill(aPseudoColorGradient, aTransparenceGradient); + mpFS->endElementNS( XML_a, XML_gradFill ); + } + else if ( nFillColor != nOriginalColor ) + { + // the user has set a different color for the shape + if (!WriteFillColor(rXPropSet)) + { + WriteSolidFill(::Color(ColorTransparency, nFillColor & 0xffffff), nAlpha); + } + } + else if ( !sColorFillScheme.isEmpty() ) + { + // the shape had a scheme color and the user didn't change it + WriteSolidFill( sColorFillScheme, aTransformations, nAlpha ); + } + else + { + // the shape had a custom color and the user didn't change it + // tdf#124013 + WriteSolidFill( ::Color(ColorTransparency, nFillColor & 0xffffff), nAlpha ); + } +} + +bool DrawingML::WriteFillColor(const uno::Reference& xPropertySet) +{ + if (!xPropertySet->getPropertySetInfo()->hasPropertyByName("FillColorTheme")) + { + return false; + } + + sal_Int32 nFillColorTheme = -1; + xPropertySet->getPropertyValue("FillColorTheme") >>= nFillColorTheme; + if (nFillColorTheme < 0 || nFillColorTheme > 11) + { + return false; + } + + const char* pColorName = g_aPredefinedClrNames[nFillColorTheme]; + + mpFS->startElementNS(XML_a, XML_solidFill); + mpFS->startElementNS(XML_a, XML_schemeClr, XML_val, pColorName); + + sal_Int32 nFillColorLumMod{}; + xPropertySet->getPropertyValue("FillColorLumMod") >>= nFillColorLumMod; + if (nFillColorLumMod != 10000) + { + mpFS->singleElementNS(XML_a, XML_lumMod, XML_val, OString::number(nFillColorLumMod * 10)); + } + + sal_Int32 nFillColorLumOff{}; + xPropertySet->getPropertyValue("FillColorLumOff") >>= nFillColorLumOff; + if (nFillColorLumOff != 0) + { + mpFS->singleElementNS(XML_a, XML_lumOff, XML_val, OString::number(nFillColorLumOff * 10)); + } + + mpFS->endElementNS(XML_a, XML_schemeClr); + mpFS->endElementNS(XML_a, XML_solidFill); + + return true; +} + +void DrawingML::WriteGradientStop(sal_uInt16 nStop, ::Color nColor, sal_Int32 nAlpha) +{ + mpFS->startElementNS(XML_a, XML_gs, XML_pos, OString::number(nStop * 1000)); + WriteColor(nColor, nAlpha); + mpFS->endElementNS( XML_a, XML_gs ); +} + +::Color DrawingML::ColorWithIntensity( sal_uInt32 nColor, sal_uInt32 nIntensity ) +{ + return ::Color(ColorTransparency, ( ( ( nColor & 0xff ) * nIntensity ) / 100 ) + | ( ( ( ( ( nColor & 0xff00 ) >> 8 ) * nIntensity ) / 100 ) << 8 ) + | ( ( ( ( ( nColor & 0xff0000 ) >> 8 ) * nIntensity ) / 100 ) << 8 )); +} + +bool DrawingML::EqualGradients( awt::Gradient aGradient1, awt::Gradient aGradient2 ) +{ + return aGradient1.Style == aGradient2.Style && + aGradient1.StartColor == aGradient2.StartColor && + aGradient1.EndColor == aGradient2.EndColor && + aGradient1.Angle == aGradient2.Angle && + aGradient1.Border == aGradient2.Border && + aGradient1.XOffset == aGradient2.XOffset && + aGradient1.YOffset == aGradient2.YOffset && + aGradient1.StartIntensity == aGradient2.StartIntensity && + aGradient1.EndIntensity == aGradient2.EndIntensity && + aGradient1.StepCount == aGradient2.StepCount; +} + +void DrawingML::WriteGradientFill( const Reference< XPropertySet >& rXPropSet ) +{ + awt::Gradient aGradient; + if (!GetProperty(rXPropSet, "FillGradient")) + return; + + aGradient = *o3tl::doAccess(mAny); + + // get InteropGrabBag and search the relevant attributes + awt::Gradient aOriginalGradient; + Sequence< PropertyValue > aGradientStops; + if ( GetProperty( rXPropSet, "InteropGrabBag" ) ) + { + Sequence< PropertyValue > aGrabBag; + mAny >>= aGrabBag; + for( const auto& rProp : std::as_const(aGrabBag) ) + if( rProp.Name == "GradFillDefinition" ) + rProp.Value >>= aGradientStops; + else if( rProp.Name == "OriginalGradFill" ) + rProp.Value >>= aOriginalGradient; + } + + // check if an ooxml gradient had been imported and if the user has modified it + // Gradient grab-bag depends on theme grab-bag, which is implemented + // only for DOCX. + if( EqualGradients( aOriginalGradient, aGradient ) && GetDocumentType() == DOCUMENT_DOCX) + { + // If we have no gradient stops that means original gradient were defined by a theme. + if( aGradientStops.hasElements() ) + { + mpFS->startElementNS(XML_a, XML_gradFill, XML_rotWithShape, "0"); + WriteGrabBagGradientFill(aGradientStops, aGradient); + mpFS->endElementNS( XML_a, XML_gradFill ); + } + } + else + { + awt::Gradient aTransparenceGradient; + mpFS->startElementNS(XML_a, XML_gradFill, XML_rotWithShape, "0"); + OUString sFillTransparenceGradientName; + if (GetProperty(rXPropSet, "FillTransparenceGradientName") + && (mAny >>= sFillTransparenceGradientName) + && !sFillTransparenceGradientName.isEmpty()) + { + if (GetProperty(rXPropSet, "FillTransparenceGradient")) + aTransparenceGradient = *o3tl::doAccess(mAny); + } + else if (GetProperty(rXPropSet, "FillTransparence")) + { + // currently only StartColor and EndColor are evaluated in WriteGradientFill() + sal_Int32 nTransparency = 0; + mAny >>= nTransparency; + // convert percent to gray color + nTransparency = nTransparency * 255/100; + const sal_Int32 aGrayColor = static_cast( nTransparency | nTransparency << 8 | nTransparency << 16 ); + aTransparenceGradient.StartColor = aGrayColor; + aTransparenceGradient.EndColor = aGrayColor; + } + WriteGradientFill(aGradient, aTransparenceGradient); + mpFS->endElementNS(XML_a, XML_gradFill); + } +} + +void DrawingML::WriteGrabBagGradientFill( const Sequence< PropertyValue >& aGradientStops, awt::Gradient rGradient ) +{ + // write back the original gradient + mpFS->startElementNS(XML_a, XML_gsLst); + + // get original stops and write them + for( const auto& rGradientStop : aGradientStops ) + { + Sequence< PropertyValue > aGradientStop; + rGradientStop.Value >>= aGradientStop; + + // get values + OUString sSchemeClr; + double nPos = 0; + sal_Int16 nTransparency = 0; + ::Color nRgbClr; + Sequence< PropertyValue > aTransformations; + for( const auto& rProp : std::as_const(aGradientStop) ) + { + if( rProp.Name == "SchemeClr" ) + rProp.Value >>= sSchemeClr; + else if( rProp.Name == "RgbClr" ) + rProp.Value >>= nRgbClr; + else if( rProp.Name == "Pos" ) + rProp.Value >>= nPos; + else if( rProp.Name == "Transparency" ) + rProp.Value >>= nTransparency; + else if( rProp.Name == "Transformations" ) + rProp.Value >>= aTransformations; + } + // write stop + mpFS->startElementNS(XML_a, XML_gs, XML_pos, OString::number(nPos * 100000.0).getStr()); + if( sSchemeClr.isEmpty() ) + { + // Calculate alpha value (see oox/source/drawingml/color.cxx : getTransparency()) + sal_Int32 nAlpha = MAX_PERCENT - ( PER_PERCENT * nTransparency ); + WriteColor( nRgbClr, nAlpha ); + } + else + { + WriteColor( sSchemeClr, aTransformations ); + } + mpFS->endElementNS( XML_a, XML_gs ); + } + mpFS->endElementNS( XML_a, XML_gsLst ); + + switch (rGradient.Style) + { + default: + mpFS->singleElementNS( + XML_a, XML_lin, XML_ang, + OString::number(((3600 - rGradient.Angle + 900) * 6000) % 21600000)); + break; + case awt::GradientStyle_RADIAL: + WriteGradientPath(rGradient, mpFS, true); + break; + } +} + +void DrawingML::WriteGradientFill(awt::Gradient rGradient, awt::Gradient rTransparenceGradient, + const uno::Reference& rXPropSet) +{ + sal_Int32 nStartAlpha; + sal_Int32 nEndAlpha; + if( rXPropSet.is() && GetProperty(rXPropSet, "FillTransparence") ) + { + sal_Int32 nTransparency = 0; + mAny >>= nTransparency; + nStartAlpha = nEndAlpha = (MAX_PERCENT - (PER_PERCENT * nTransparency)); + } + else + { + nStartAlpha = GetAlphaFromTransparenceGradient(rTransparenceGradient, true); + nEndAlpha = GetAlphaFromTransparenceGradient(rTransparenceGradient, false); + } + switch( rGradient.Style ) + { + default: + case awt::GradientStyle_LINEAR: + { + mpFS->startElementNS(XML_a, XML_gsLst); + WriteGradientStop(rGradient.Border, ColorWithIntensity(rGradient.StartColor, rGradient.StartIntensity), + nStartAlpha); + WriteGradientStop(100, ColorWithIntensity(rGradient.EndColor, rGradient.EndIntensity), + nEndAlpha); + mpFS->endElementNS( XML_a, XML_gsLst ); + mpFS->singleElementNS( + XML_a, XML_lin, XML_ang, + OString::number(((3600 - rGradient.Angle + 900) * 6000) % 21600000)); + break; + } + + case awt::GradientStyle_AXIAL: + { + mpFS->startElementNS(XML_a, XML_gsLst); + WriteGradientStop(0, ColorWithIntensity(rGradient.EndColor, rGradient.EndIntensity), + nEndAlpha); + if (rGradient.Border > 0 && rGradient.Border < 100) + { + WriteGradientStop(rGradient.Border/2, + ColorWithIntensity(rGradient.EndColor, rGradient.EndIntensity), + nEndAlpha); + } + WriteGradientStop(50, ColorWithIntensity(rGradient.StartColor, rGradient.StartIntensity), + nStartAlpha); + if (rGradient.Border > 0 && rGradient.Border < 100) + { + WriteGradientStop(100 - rGradient.Border/2, + ColorWithIntensity(rGradient.EndColor, rGradient.EndIntensity), + nEndAlpha); + } + WriteGradientStop(100, ColorWithIntensity(rGradient.EndColor, rGradient.EndIntensity), + nEndAlpha); + mpFS->endElementNS(XML_a, XML_gsLst); + mpFS->singleElementNS( + XML_a, XML_lin, XML_ang, + OString::number(((3600 - rGradient.Angle + 900) * 6000) % 21600000)); + break; + } + + case awt::GradientStyle_RADIAL: + case awt::GradientStyle_ELLIPTICAL: + case awt::GradientStyle_RECT: + case awt::GradientStyle_SQUARE: + { + mpFS->startElementNS(XML_a, XML_gsLst); + WriteGradientStop(0, ColorWithIntensity(rGradient.EndColor, rGradient.EndIntensity), + nEndAlpha); + if (rGradient.Border > 0 && rGradient.Border < 100) + { + // Map border to an additional gradient stop, which has the + // same color as the final stop. + WriteGradientStop(100 - rGradient.Border, + ColorWithIntensity(rGradient.StartColor, rGradient.StartIntensity), + nStartAlpha); + } + WriteGradientStop(100, + ColorWithIntensity(rGradient.StartColor, rGradient.StartIntensity), + nStartAlpha); + mpFS->endElementNS(XML_a, XML_gsLst); + + WriteGradientPath(rGradient, mpFS, rGradient.Style == awt::GradientStyle_RADIAL || rGradient.Style == awt::GradientStyle_ELLIPTICAL); + break; + } + } +} + +void DrawingML::WriteLineArrow( const Reference< XPropertySet >& rXPropSet, bool bLineStart ) +{ + ESCHER_LineEnd eLineEnd; + sal_Int32 nArrowLength; + sal_Int32 nArrowWidth; + + if ( !EscherPropertyContainer::GetLineArrow( bLineStart, rXPropSet, eLineEnd, nArrowLength, nArrowWidth ) ) + return; + + const char* len; + const char* type; + const char* width; + + switch( nArrowLength ) + { + case ESCHER_LineShortArrow: + len = "sm"; + break; + default: + case ESCHER_LineMediumLenArrow: + len = "med"; + break; + case ESCHER_LineLongArrow: + len = "lg"; + break; + } + + switch( eLineEnd ) + { + default: + case ESCHER_LineNoEnd: + type = "none"; + break; + case ESCHER_LineArrowEnd: + type = "triangle"; + break; + case ESCHER_LineArrowStealthEnd: + type = "stealth"; + break; + case ESCHER_LineArrowDiamondEnd: + type = "diamond"; + break; + case ESCHER_LineArrowOvalEnd: + type = "oval"; + break; + case ESCHER_LineArrowOpenEnd: + type = "arrow"; + break; + } + + switch( nArrowWidth ) + { + case ESCHER_LineNarrowArrow: + width = "sm"; + break; + default: + case ESCHER_LineMediumWidthArrow: + width = "med"; + break; + case ESCHER_LineWideArrow: + width = "lg"; + break; + } + + mpFS->singleElementNS( XML_a, bLineStart ? XML_headEnd : XML_tailEnd, + XML_len, len, + XML_type, type, + XML_w, width ); +} + +void DrawingML::WriteOutline( const Reference& rXPropSet, Reference< frame::XModel > const & xModel ) +{ + drawing::LineStyle aLineStyle( drawing::LineStyle_NONE ); + if (GetProperty(rXPropSet, "LineStyle")) + mAny >>= aLineStyle; + + const LineCap aLineCap = GetProperty(rXPropSet, "LineCap") ? mAny.get() : LineCap_BUTT; + + sal_uInt32 nLineWidth = 0; + sal_uInt32 nEmuLineWidth = 0; + ::Color nColor; + sal_Int32 nColorAlpha = MAX_PERCENT; + bool bColorSet = false; + const char* cap = nullptr; + drawing::LineDash aLineDash; + bool bDashSet = false; + bool bNoFill = false; + + + // get InteropGrabBag and search the relevant attributes + OUString sColorFillScheme; + ::Color aResolvedColorFillScheme; + + ::Color nOriginalColor; + ::Color nStyleColor; + sal_uInt32 nStyleLineWidth = 0; + + Sequence aStyleProperties; + Sequence aTransformations; + + drawing::LineStyle aStyleLineStyle(drawing::LineStyle_NONE); + drawing::LineJoint aStyleLineJoint(drawing::LineJoint_NONE); + + if (GetProperty(rXPropSet, "InteropGrabBag")) + { + Sequence aGrabBag; + mAny >>= aGrabBag; + + for (const auto& rProp : std::as_const(aGrabBag)) + { + if( rProp.Name == "SpPrLnSolidFillSchemeClr" ) + rProp.Value >>= sColorFillScheme; + if( rProp.Name == "SpPrLnSolidFillResolvedSchemeClr" ) + rProp.Value >>= aResolvedColorFillScheme; + else if( rProp.Name == "OriginalLnSolidFillClr" ) + rProp.Value >>= nOriginalColor; + else if( rProp.Name == "StyleLnRef" ) + rProp.Value >>= aStyleProperties; + else if( rProp.Name == "SpPrLnSolidFillSchemeClrTransformations" ) + rProp.Value >>= aTransformations; + else if( rProp.Name == "EmuLineWidth" ) + rProp.Value >>= nEmuLineWidth; + } + for (const auto& rStyleProp : std::as_const(aStyleProperties)) + { + if( rStyleProp.Name == "Color" ) + rStyleProp.Value >>= nStyleColor; + else if( rStyleProp.Name == "LineStyle" ) + rStyleProp.Value >>= aStyleLineStyle; + else if( rStyleProp.Name == "LineJoint" ) + rStyleProp.Value >>= aStyleLineJoint; + else if( rStyleProp.Name == "LineWidth" ) + rStyleProp.Value >>= nStyleLineWidth; + } + } + + if (GetProperty(rXPropSet, "LineWidth")) + mAny >>= nLineWidth; + + switch (aLineStyle) + { + case drawing::LineStyle_NONE: + bNoFill = true; + break; + case drawing::LineStyle_DASH: + if (GetProperty(rXPropSet, "LineDash")) + { + aLineDash = mAny.get(); + //this query is good for shapes, but in the case of charts it returns 0 values + if (aLineDash.Dots == 0 && aLineDash.DotLen == 0 && aLineDash.Dashes == 0 && aLineDash.DashLen == 0 && aLineDash.Distance == 0) { + OUString aLineDashName; + if (GetProperty(rXPropSet, "LineDashName")) + mAny >>= aLineDashName; + if (!aLineDashName.isEmpty() && xModel) { + css::uno::Any aAny = getLineDash(xModel, aLineDashName); + aAny >>= aLineDash; + } + } + } + else + { + //export the linestyle of chart wall (plot area) and chart page + OUString aLineDashName; + if (GetProperty(rXPropSet, "LineDashName")) + mAny >>= aLineDashName; + if (!aLineDashName.isEmpty() && xModel) { + css::uno::Any aAny = getLineDash(xModel, aLineDashName); + aAny >>= aLineDash; + } + } + bDashSet = true; + if (aLineDash.Style == DashStyle_ROUND || aLineDash.Style == DashStyle_ROUNDRELATIVE) + { + cap = "rnd"; + } + + SAL_INFO("oox.shape", "dash dots: " << aLineDash.Dots << " dashes: " << aLineDash.Dashes + << " dotlen: " << aLineDash.DotLen << " dashlen: " << aLineDash.DashLen << " distance: " << aLineDash.Distance); + + [[fallthrough]]; + case drawing::LineStyle_SOLID: + default: + if (GetProperty(rXPropSet, "LineColor")) + { + nColor = ::Color(ColorTransparency, mAny.get() & 0xffffff); + bColorSet = true; + } + if (GetProperty(rXPropSet, "LineTransparence")) + { + nColorAlpha = MAX_PERCENT - (mAny.get() * PER_PERCENT); + } + if (aLineCap == LineCap_ROUND) + cap = "rnd"; + else if (aLineCap == LineCap_SQUARE) + cap = "sq"; + break; + } + + // if the line-width was not modified after importing then the original EMU value will be exported to avoid unexpected conversion (rounding) error + if (nEmuLineWidth == 0 || static_cast(oox::drawingml::convertEmuToHmm(nEmuLineWidth)) != nLineWidth) + nEmuLineWidth = oox::drawingml::convertHmmToEmu(nLineWidth); + mpFS->startElementNS( XML_a, XML_ln, + XML_cap, cap, + XML_w, sax_fastparser::UseIf(OString::number(nEmuLineWidth), + nLineWidth == 0 || (nLineWidth > 1 && nStyleLineWidth != nLineWidth)) ); + + if( bColorSet ) + { + if( nColor != nOriginalColor ) + { + // the user has set a different color for the line + WriteSolidFill( nColor, nColorAlpha ); + } + else if( !sColorFillScheme.isEmpty() ) + { + // the line had a scheme color and the user didn't change it + WriteSolidFill( aResolvedColorFillScheme, aTransformations ); + } + else + { + WriteSolidFill( nColor, nColorAlpha ); + } + } + + if( bDashSet && aStyleLineStyle != drawing::LineStyle_DASH ) + { + // Try to detect if it might come from ms preset line style import. + // MS Office styles are always relative, both binary and OOXML. + // "dot" is always the first dash and "dash" the second one. All OOXML presets linestyles + // start with the longer one. Definitions are in OOXML part 1, 20.1.10.49 + // The tests are strict, for to not catch styles from standard.sod (as of Aug 2019). + bool bIsConverted = false; + + bool bIsRelative(aLineDash.Style == DashStyle_RECTRELATIVE || aLineDash.Style == DashStyle_ROUNDRELATIVE); + if ( bIsRelative && aLineDash.Dots == 1) + { // The length were tweaked on import in case of prstDash. Revert it here. + sal_uInt32 nDotLen = aLineDash.DotLen; + sal_uInt32 nDashLen = aLineDash.DashLen; + sal_uInt32 nDistance = aLineDash.Distance; + if (aLineCap != LineCap_BUTT && nDistance >= 99) + { + nDistance -= 99; + nDotLen += 99; + if (nDashLen > 0) + nDashLen += 99; + } + // LO uses length 0 for 100%, if the attribute is missing in ODF. + // Other applications might write 100%. Make is unique for the conditions. + if (nDotLen == 0) + nDotLen = 100; + if (nDashLen == 0 && aLineDash.Dashes > 0) + nDashLen = 100; + bIsConverted = true; + if (nDotLen == 100 && aLineDash.Dashes == 0 && nDashLen == 0 && nDistance == 300) + { + mpFS->singleElementNS(XML_a, XML_prstDash, XML_val, "dot"); + } + else if (nDotLen == 400 && aLineDash.Dashes == 0 && nDashLen == 0 && nDistance == 300) + { + mpFS->singleElementNS(XML_a, XML_prstDash, XML_val, "dash"); + } + else if (nDotLen == 400 && aLineDash.Dashes == 1 && nDashLen == 100 && nDistance == 300) + { + mpFS->singleElementNS(XML_a, XML_prstDash, XML_val, "dashDot"); + } + else if (nDotLen == 800 && aLineDash.Dashes == 0 && nDashLen == 0 && nDistance == 300) + { + mpFS->singleElementNS(XML_a, XML_prstDash, XML_val, "lgDash"); + } + else if (nDotLen == 800 && aLineDash.Dashes == 1 && nDashLen == 100 && nDistance == 300) + { + mpFS->singleElementNS(XML_a, XML_prstDash, XML_val, "lgDashDot"); + } + else if (nDotLen == 800 && aLineDash.Dashes == 2 && nDashLen == 100 && nDistance == 300) + { + mpFS->singleElementNS(XML_a, XML_prstDash, XML_val, "lgDashDotDot"); + } + else if (nDotLen == 100 && aLineDash.Dashes == 0 && nDashLen == 0 && nDistance == 100) + { + mpFS->singleElementNS(XML_a, XML_prstDash, XML_val, "sysDot"); + } + else if (nDotLen == 300 && aLineDash.Dashes == 0 && nDashLen == 0 && nDistance == 100) + { + mpFS->singleElementNS(XML_a, XML_prstDash, XML_val, "sysDash"); + } + else if (nDotLen == 300 && aLineDash.Dashes == 1 && nDashLen == 100 && nDistance == 100) + { + mpFS->singleElementNS(XML_a, XML_prstDash, XML_val, "sysDashDot"); + } + else if (nDotLen == 300 && aLineDash.Dashes == 2 && nDashLen == 100 && nDistance == 100) + { + mpFS->singleElementNS(XML_a, XML_prstDash, XML_val, "sysDashDotDot"); + } + else + bIsConverted = false; + } + // Do not map our own line styles to OOXML prstDash values, because custDash gives better results. + if (!bIsConverted) + { + mpFS->startElementNS(XML_a, XML_custDash); + // In case of hairline we would need the current pixel size. Instead use a reasonable + // ersatz for it. The value is the same as SMALLEST_DASH_WIDTH in xattr.cxx. + // (And it makes sure fLineWidth is not zero in below division.) + double fLineWidth = nLineWidth > 0 ? nLineWidth : 26.95; + int i; + double fSp = bIsRelative ? aLineDash.Distance : aLineDash.Distance * 100.0 / fLineWidth; + // LO uses line width, in case Distance is zero. MS Office would use a space of zero length. + // So set 100% explicitly. + if (aLineDash.Distance <= 0) + fSp = 100.0; + // In case of custDash, round caps are included in dash length in MS Office. Square caps are added + // to dash length, same as in ODF. Change the length values accordingly. + if (aLineCap == LineCap_ROUND && fSp > 99.0) + fSp -= 99.0; + + if (aLineDash.Dots > 0) + { + double fD = bIsRelative ? aLineDash.DotLen : aLineDash.DotLen * 100.0 / fLineWidth; + // LO sets length to 0, if attribute is missing in ODF. Then a relative length of 100% is intended. + if (aLineDash.DotLen == 0) + fD = 100.0; + // Tweak dash length, see above. + if (aLineCap == LineCap_ROUND && fSp > 99.0) + fD += 99.0; + + for( i = 0; i < aLineDash.Dots; i ++ ) + { + mpFS->singleElementNS( XML_a, XML_ds, + XML_d , write1000thOfAPercent(fD), + XML_sp, write1000thOfAPercent(fSp) ); + } + } + if ( aLineDash.Dashes > 0 ) + { + double fD = bIsRelative ? aLineDash.DashLen : aLineDash.DashLen * 100.0 / fLineWidth; + // LO sets length to 0, if attribute is missing in ODF. Then a relative length of 100% is intended. + if (aLineDash.DashLen == 0) + fD = 100.0; + // Tweak dash length, see above. + if (aLineCap == LineCap_ROUND && fSp > 99.0) + fD += 99.0; + + for( i = 0; i < aLineDash.Dashes; i ++ ) + { + mpFS->singleElementNS( XML_a , XML_ds, + XML_d , write1000thOfAPercent(fD), + XML_sp, write1000thOfAPercent(fSp) ); + } + } + + SAL_WARN_IF(nLineWidth <= 0, + "oox.shape", "while writing outline - custom dash - line width was < 0 : " << nLineWidth); + SAL_WARN_IF(aLineDash.Dashes < 0, + "oox.shape", "while writing outline - custom dash - number of dashes was < 0 : " << aLineDash.Dashes); + SAL_WARN_IF(aLineDash.Dashes > 0 && aLineDash.DashLen <= 0, + "oox.shape", "while writing outline - custom dash - dash length was < 0 : " << aLineDash.DashLen); + SAL_WARN_IF(aLineDash.Dots < 0, + "oox.shape", "while writing outline - custom dash - number of dots was < 0 : " << aLineDash.Dots); + SAL_WARN_IF(aLineDash.Dots > 0 && aLineDash.DotLen <= 0, + "oox.shape", "while writing outline - custom dash - dot length was < 0 : " << aLineDash.DotLen); + SAL_WARN_IF(aLineDash.Distance <= 0, + "oox.shape", "while writing outline - custom dash - distance was < 0 : " << aLineDash.Distance); + + mpFS->endElementNS( XML_a, XML_custDash ); + } + } + + if (!bNoFill && nLineWidth > 1 && GetProperty(rXPropSet, "LineJoint")) + { + LineJoint eLineJoint = mAny.get(); + + if( aStyleLineJoint == LineJoint_NONE || aStyleLineJoint != eLineJoint ) + { + // style-defined line joint does not exist, or is different from the shape's joint + switch( eLineJoint ) + { + case LineJoint_NONE: + case LineJoint_BEVEL: + mpFS->singleElementNS(XML_a, XML_bevel); + break; + default: + case LineJoint_MIDDLE: + case LineJoint_MITER: + mpFS->singleElementNS(XML_a, XML_miter); + break; + case LineJoint_ROUND: + mpFS->singleElementNS(XML_a, XML_round); + break; + } + } + } + + if( !bNoFill ) + { + WriteLineArrow( rXPropSet, true ); + WriteLineArrow( rXPropSet, false ); + } + else + { + mpFS->singleElementNS(XML_a, XML_noFill); + } + + mpFS->endElementNS( XML_a, XML_ln ); +} + +const char* DrawingML::GetComponentDir() const +{ + switch ( meDocumentType ) + { + case DOCUMENT_DOCX: return "word"; + case DOCUMENT_PPTX: return "ppt"; + case DOCUMENT_XLSX: return "xl"; + } + + return "unknown"; +} + +const char* DrawingML::GetRelationCompPrefix() const +{ + switch ( meDocumentType ) + { + case DOCUMENT_DOCX: return ""; + case DOCUMENT_PPTX: + case DOCUMENT_XLSX: return "../"; + } + + return "unknown"; +} + +OUString DrawingML::WriteImage( const Graphic& rGraphic , bool bRelPathToMedia ) +{ + GfxLink aLink = rGraphic.GetGfxLink (); + BitmapChecksum aChecksum = rGraphic.GetChecksum(); + OUString sMediaType; + const char* pExtension = ""; + OUString sRelId; + OUString sPath; + + // tdf#74670 tdf#91286 Save image only once + if (!maExportGraphics.empty()) + { + auto aIterator = maExportGraphics.top().find(aChecksum); + if (aIterator != maExportGraphics.top().end()) + sPath = aIterator->second; + } + + if (sPath.isEmpty()) + { + SvMemoryStream aStream; + const void* aData = aLink.GetData(); + std::size_t nDataSize = aLink.GetDataSize(); + + switch (aLink.GetType()) + { + case GfxLinkType::NativeGif: + sMediaType = "image/gif"; + pExtension = ".gif"; + break; + + // #i15508# added BMP type for better exports + // export not yet active, so adding for reference (not checked) + case GfxLinkType::NativeBmp: + sMediaType = "image/bmp"; + pExtension = ".bmp"; + break; + + case GfxLinkType::NativeJpg: + sMediaType = "image/jpeg"; + pExtension = ".jpeg"; + break; + case GfxLinkType::NativePng: + sMediaType = "image/png"; + pExtension = ".png"; + break; + case GfxLinkType::NativeTif: + sMediaType = "image/tiff"; + pExtension = ".tif"; + break; + case GfxLinkType::NativeWmf: + sMediaType = "image/x-wmf"; + pExtension = ".wmf"; + break; + case GfxLinkType::NativeMet: + sMediaType = "image/x-met"; + pExtension = ".met"; + break; + case GfxLinkType::NativePct: + sMediaType = "image/x-pict"; + pExtension = ".pct"; + break; + case GfxLinkType::NativeMov: + sMediaType = "application/movie"; + pExtension = ".MOV"; + break; + default: + { + GraphicType aType = rGraphic.GetType(); + if (aType == GraphicType::Bitmap || aType == GraphicType::GdiMetafile) + { + if (aType == GraphicType::Bitmap) + { + (void)GraphicConverter::Export(aStream, rGraphic, ConvertDataFormat::PNG); + sMediaType = "image/png"; + pExtension = ".png"; + } + else + { + (void)GraphicConverter::Export(aStream, rGraphic, ConvertDataFormat::EMF); + sMediaType = "image/x-emf"; + pExtension = ".emf"; + } + } + else + { + SAL_WARN("oox.shape", "unhandled graphic type " << static_cast(aType)); + /*Earlier, even in case of unhandled graphic types we were + proceeding to write the image, which would eventually + write an empty image with a zero size, and return a valid + relationID, which is incorrect. + */ + return sRelId; + } + + aData = aStream.GetData(); + nDataSize = aStream.GetEndOfData(); + break; + } + } + + Reference xOutStream = mpFB->openFragmentStream( + OUStringBuffer() + .appendAscii(GetComponentDir()) + .append("/media/image" + OUString::number(mnImageCounter.top())) + .appendAscii(pExtension) + .makeStringAndClear(), + sMediaType); + xOutStream->writeBytes(Sequence(static_cast(aData), nDataSize)); + xOutStream->closeOutput(); + + const OString sRelPathToMedia = "media/image"; + OString sRelationCompPrefix; + if (bRelPathToMedia) + sRelationCompPrefix = "../"; + else + sRelationCompPrefix = GetRelationCompPrefix(); + sPath = OUStringBuffer() + .appendAscii(sRelationCompPrefix.getStr()) + .appendAscii(sRelPathToMedia.getStr()) + .append(static_cast(mnImageCounter.top()++)) + .appendAscii(pExtension) + .makeStringAndClear(); + + if (!maExportGraphics.empty()) + maExportGraphics.top()[aChecksum] = sPath; + } + + sRelId = mpFB->addRelation( mpFS->getOutputStream(), + oox::getRelationship(Relationship::IMAGE), + sPath ); + + return sRelId; +} + +void DrawingML::WriteMediaNonVisualProperties(const css::uno::Reference& xShape) +{ + SdrMediaObj* pMediaObj = dynamic_cast(SdrObject::getSdrObjectFromXShape(xShape)); + if (!pMediaObj) + return; + + // extension + OUString aExtension; + const OUString& rURL(pMediaObj->getURL()); + int nLastDot = rURL.lastIndexOf('.'); + if (nLastDot >= 0) + aExtension = rURL.copy(nLastDot); + + bool bEmbed = rURL.startsWith("vnd.sun.star.Package:"); + Relationship eMediaType = Relationship::VIDEO; + + // mime type +#if HAVE_FEATURE_AVMEDIA + OUString aMimeType(pMediaObj->getMediaProperties().getMimeType()); +#else + OUString aMimeType("none"); +#endif + if (aMimeType == "application/vnd.sun.star.media") + { + // try to set something better + // TODO fix the importer to actually set the mimetype on import + if (aExtension.equalsIgnoreAsciiCase(".avi")) + aMimeType = "video/x-msvideo"; + else if (aExtension.equalsIgnoreAsciiCase(".flv")) + aMimeType = "video/x-flv"; + else if (aExtension.equalsIgnoreAsciiCase(".mp4")) + aMimeType = "video/mp4"; + else if (aExtension.equalsIgnoreAsciiCase(".mov")) + aMimeType = "video/quicktime"; + else if (aExtension.equalsIgnoreAsciiCase(".ogv")) + aMimeType = "video/ogg"; + else if (aExtension.equalsIgnoreAsciiCase(".wmv")) + aMimeType = "video/x-ms-wmv"; + else if (aExtension.equalsIgnoreAsciiCase(".wav")) + { + aMimeType = "audio/x-wav"; + eMediaType = Relationship::AUDIO; + } + else if (aExtension.equalsIgnoreAsciiCase(".m4a")) + { + aMimeType = "audio/mp4"; + eMediaType = Relationship::AUDIO; + } + else if (aExtension.equalsIgnoreAsciiCase(".mp3")) + { + aMimeType = "audio/mp3"; + eMediaType = Relationship::AUDIO; + } + } + + OUString aVideoFileRelId; + OUString aMediaRelId; + + if (bEmbed) + { + // copy the video stream + Reference xOutStream = mpFB->openFragmentStream(OUStringBuffer() + .appendAscii(GetComponentDir()) + .append("/media/media" + + OUString::number(mnImageCounter.top()) + + aExtension) + .makeStringAndClear(), + aMimeType); + + uno::Reference xInputStream(pMediaObj->GetInputStream()); + comphelper::OStorageHelper::CopyInputToOutput(xInputStream, xOutStream); + + xOutStream->closeOutput(); + + // create the relation + OUString aPath = OUStringBuffer().appendAscii(GetRelationCompPrefix()) + .append("media/media" + OUString::number(mnImageCounter.top()++) + aExtension) + .makeStringAndClear(); + aVideoFileRelId = mpFB->addRelation(mpFS->getOutputStream(), oox::getRelationship(eMediaType), aPath); + aMediaRelId = mpFB->addRelation(mpFS->getOutputStream(), oox::getRelationship(Relationship::MEDIA), aPath); + } + else + { + aVideoFileRelId = mpFB->addRelation(mpFS->getOutputStream(), oox::getRelationship(eMediaType), rURL, true); + aMediaRelId = mpFB->addRelation(mpFS->getOutputStream(), oox::getRelationship(Relationship::MEDIA), rURL, true); + } + + GetFS()->startElementNS(XML_p, XML_nvPr); + + GetFS()->singleElementNS(XML_a, eMediaType == Relationship::VIDEO ? XML_videoFile : XML_audioFile, + FSNS(XML_r, XML_link), aVideoFileRelId); + + GetFS()->startElementNS(XML_p, XML_extLst); + // media extensions; google this ID for details + GetFS()->startElementNS(XML_p, XML_ext, XML_uri, "{DAA4B4D4-6D71-4841-9C94-3DE7FCFB9230}"); + + GetFS()->singleElementNS(XML_p14, XML_media, + bEmbed? FSNS(XML_r, XML_embed): FSNS(XML_r, XML_link), aMediaRelId); + + GetFS()->endElementNS(XML_p, XML_ext); + GetFS()->endElementNS(XML_p, XML_extLst); + + GetFS()->endElementNS(XML_p, XML_nvPr); +} + +void DrawingML::WriteImageBrightnessContrastTransparence(uno::Reference const & rXPropSet) +{ + sal_Int16 nBright = 0; + sal_Int32 nContrast = 0; + sal_Int32 nTransparence = 0; + + if (GetProperty(rXPropSet, "AdjustLuminance")) + nBright = mAny.get(); + if (GetProperty(rXPropSet, "AdjustContrast")) + nContrast = mAny.get(); + // Used for shapes with picture fill + if (GetProperty(rXPropSet, "FillTransparence")) + nTransparence = mAny.get(); + // Used for pictures + if (nTransparence == 0 && GetProperty(rXPropSet, "Transparency")) + nTransparence = static_cast(mAny.get()); + + if (GetProperty(rXPropSet, "GraphicColorMode")) + { + drawing::ColorMode aColorMode; + mAny >>= aColorMode; + if (aColorMode == drawing::ColorMode_GREYS) + mpFS->singleElementNS(XML_a, XML_grayscl); + else if (aColorMode == drawing::ColorMode_MONO) + //black/white has a 0,5 threshold in LibreOffice + mpFS->singleElementNS(XML_a, XML_biLevel, XML_thresh, OString::number(50000)); + else if (aColorMode == drawing::ColorMode_WATERMARK) + { + //map watermark with mso washout + nBright = 70; + nContrast = -70; + } + } + + + if (nBright || nContrast) + { + mpFS->singleElementNS(XML_a, XML_lum, + XML_bright, sax_fastparser::UseIf(OString::number(nBright * 1000), nBright != 0), + XML_contrast, sax_fastparser::UseIf(OString::number(nContrast * 1000), nContrast != 0)); + } + + if (nTransparence) + { + sal_Int32 nAlphaMod = (100 - nTransparence ) * PER_PERCENT; + mpFS->singleElementNS(XML_a, XML_alphaModFix, XML_amt, OString::number(nAlphaMod)); + } +} + +OUString DrawingML::WriteXGraphicBlip(uno::Reference const & rXPropSet, + uno::Reference const & rxGraphic, + bool bRelPathToMedia) +{ + OUString sRelId; + + if (!rxGraphic.is()) + return sRelId; + + Graphic aGraphic(rxGraphic); + sRelId = WriteImage(aGraphic, bRelPathToMedia); + + mpFS->startElementNS(XML_a, XML_blip, FSNS(XML_r, XML_embed), sRelId); + + WriteImageBrightnessContrastTransparence(rXPropSet); + + WriteArtisticEffect(rXPropSet); + + mpFS->endElementNS(XML_a, XML_blip); + + return sRelId; +} + +void DrawingML::WriteXGraphicBlipMode(uno::Reference const & rXPropSet, + uno::Reference const & rxGraphic) +{ + BitmapMode eBitmapMode(BitmapMode_NO_REPEAT); + if (GetProperty(rXPropSet, "FillBitmapMode")) + mAny >>= eBitmapMode; + + SAL_INFO("oox.shape", "fill bitmap mode: " << int(eBitmapMode)); + + switch (eBitmapMode) + { + case BitmapMode_REPEAT: + WriteXGraphicTile(rXPropSet, rxGraphic); + break; + case BitmapMode_STRETCH: + WriteXGraphicStretch(rXPropSet, rxGraphic); + break; + default: + break; + } +} + +void DrawingML::WriteBlipOrNormalFill( const Reference< XPropertySet >& xPropSet, const OUString& rURLPropName ) +{ + // check for blip and otherwise fall back to normal fill + // we always store normal fill properties but OOXML + // uses a choice between our fill props and BlipFill + if (GetProperty ( xPropSet, rURLPropName )) + WriteBlipFill( xPropSet, rURLPropName ); + else + WriteFill(xPropSet); +} + +void DrawingML::WriteBlipFill( const Reference< XPropertySet >& rXPropSet, const OUString& sURLPropName ) +{ + WriteBlipFill( rXPropSet, sURLPropName, XML_a ); +} + +void DrawingML::WriteBlipFill( const Reference< XPropertySet >& rXPropSet, const OUString& sURLPropName, sal_Int32 nXmlNamespace ) +{ + if ( !GetProperty( rXPropSet, sURLPropName ) ) + return; + + uno::Reference xGraphic; + if (mAny.has>()) + { + uno::Reference xBitmap = mAny.get>(); + if (xBitmap.is()) + xGraphic.set(xBitmap, uno::UNO_QUERY); + } + else if (mAny.has>()) + { + xGraphic = mAny.get>(); + } + + if (xGraphic.is()) + { + bool bWriteMode = false; + if (sURLPropName == "FillBitmap" || sURLPropName == "BackGraphic") + bWriteMode = true; + WriteXGraphicBlipFill(rXPropSet, xGraphic, nXmlNamespace, bWriteMode); + } +} + +void DrawingML::WriteXGraphicBlipFill(uno::Reference const & rXPropSet, + uno::Reference const & rxGraphic, + sal_Int32 nXmlNamespace, bool bWriteMode, bool bRelPathToMedia) +{ + if (!rxGraphic.is() ) + return; + + mpFS->startElementNS(nXmlNamespace , XML_blipFill, XML_rotWithShape, "0"); + + WriteXGraphicBlip(rXPropSet, rxGraphic, bRelPathToMedia); + + if (GetDocumentType() != DOCUMENT_DOCX) + { + // Write the crop rectangle of Impress as a source rectangle. + WriteSrcRectXGraphic(rXPropSet, rxGraphic); + } + + if (bWriteMode) + { + WriteXGraphicBlipMode(rXPropSet, rxGraphic); + } + else if(GetProperty(rXPropSet, "FillBitmapStretch")) + { + bool bStretch = mAny.get(); + + if (bStretch) + { + WriteXGraphicStretch(rXPropSet, rxGraphic); + } + } + mpFS->endElementNS(nXmlNamespace, XML_blipFill); +} + +void DrawingML::WritePattFill( const Reference< XPropertySet >& rXPropSet ) +{ + if ( GetProperty( rXPropSet, "FillHatch" ) ) + { + drawing::Hatch aHatch; + mAny >>= aHatch; + WritePattFill(rXPropSet, aHatch); + } +} + +void DrawingML::WritePattFill(const Reference& rXPropSet, const css::drawing::Hatch& rHatch) +{ + mpFS->startElementNS(XML_a, XML_pattFill, XML_prst, GetHatchPattern(rHatch)); + + sal_Int32 nAlpha = MAX_PERCENT; + if (GetProperty(rXPropSet, "FillTransparence")) + { + sal_Int32 nTransparency = 0; + mAny >>= nTransparency; + nAlpha = (MAX_PERCENT - (PER_PERCENT * nTransparency)); + } + + mpFS->startElementNS(XML_a, XML_fgClr); + WriteColor(::Color(ColorTransparency, rHatch.Color), nAlpha); + mpFS->endElementNS( XML_a , XML_fgClr ); + + ::Color nColor = COL_WHITE; + + if ( GetProperty( rXPropSet, "FillBackground" ) ) + { + bool isBackgroundFilled = false; + mAny >>= isBackgroundFilled; + if( isBackgroundFilled ) + { + if( GetProperty( rXPropSet, "FillColor" ) ) + { + mAny >>= nColor; + } + } + else + nAlpha = 0; + } + + mpFS->startElementNS(XML_a, XML_bgClr); + WriteColor(nColor, nAlpha); + mpFS->endElementNS( XML_a , XML_bgClr ); + + mpFS->endElementNS( XML_a , XML_pattFill ); +} + +void DrawingML::WriteGraphicCropProperties(uno::Reference const & rXPropSet, + Size const & rOriginalSize, + MapMode const & rMapMode) +{ + if (!GetProperty(rXPropSet, "GraphicCrop")) + return; + + css::text::GraphicCrop aGraphicCropStruct; + mAny >>= aGraphicCropStruct; + + if(GetProperty(rXPropSet, "CustomShapeGeometry")) + { + // tdf#134210 GraphicCrop property is handled in import filter because of LibreOffice has not core + // feature. We cropped the bitmap physically and MSO shouldn't crop bitmap one more time. When we + // have core feature for graphic cropping in custom shapes, we should uncomment the code anymore. + + mpFS->singleElementNS( XML_a, XML_srcRect); + } + else + { + Size aOriginalSize(rOriginalSize); + + // GraphicCrop is in mm100, so in case the original size is in pixels, convert it over. + if (rMapMode.GetMapUnit() == MapUnit::MapPixel) + aOriginalSize = Application::GetDefaultDevice()->PixelToLogic(aOriginalSize, MapMode(MapUnit::Map100thMM)); + + if ( (0 != aGraphicCropStruct.Left) || (0 != aGraphicCropStruct.Top) || (0 != aGraphicCropStruct.Right) || (0 != aGraphicCropStruct.Bottom) ) + { + mpFS->singleElementNS( XML_a, XML_srcRect, + XML_l, OString::number(rtl::math::round(aGraphicCropStruct.Left * 100000.0 / aOriginalSize.Width())), + XML_t, OString::number(rtl::math::round(aGraphicCropStruct.Top * 100000.0 / aOriginalSize.Height())), + XML_r, OString::number(rtl::math::round(aGraphicCropStruct.Right * 100000.0 / aOriginalSize.Width())), + XML_b, OString::number(rtl::math::round(aGraphicCropStruct.Bottom * 100000.0 / aOriginalSize.Height())) ); + } + } +} + +void DrawingML::WriteSrcRectXGraphic(uno::Reference const & rxPropertySet, + uno::Reference const & rxGraphic) +{ + Graphic aGraphic(rxGraphic); + Size aOriginalSize = aGraphic.GetPrefSize(); + const MapMode& rMapMode = aGraphic.GetPrefMapMode(); + WriteGraphicCropProperties(rxPropertySet, aOriginalSize, rMapMode); +} + +void DrawingML::WriteXGraphicStretch(uno::Reference const & rXPropSet, + uno::Reference const & rxGraphic) +{ + if (GetDocumentType() != DOCUMENT_DOCX) + { + // Limiting the area used for stretching is not supported in Impress. + mpFS->singleElementNS(XML_a, XML_stretch); + return; + } + + mpFS->startElementNS(XML_a, XML_stretch); + + bool bCrop = false; + if (GetProperty(rXPropSet, "GraphicCrop")) + { + css::text::GraphicCrop aGraphicCropStruct; + mAny >>= aGraphicCropStruct; + + if ((0 != aGraphicCropStruct.Left) + || (0 != aGraphicCropStruct.Top) + || (0 != aGraphicCropStruct.Right) + || (0 != aGraphicCropStruct.Bottom)) + { + Graphic aGraphic(rxGraphic); + Size aOriginalSize(aGraphic.GetPrefSize()); + mpFS->singleElementNS(XML_a, XML_fillRect, + XML_l, OString::number(((aGraphicCropStruct.Left) * 100000) / aOriginalSize.Width()), + XML_t, OString::number(((aGraphicCropStruct.Top) * 100000) / aOriginalSize.Height()), + XML_r, OString::number(((aGraphicCropStruct.Right) * 100000) / aOriginalSize.Width()), + XML_b, OString::number(((aGraphicCropStruct.Bottom) * 100000) / aOriginalSize.Height())); + bCrop = true; + } + } + + if (!bCrop) + { + mpFS->singleElementNS(XML_a, XML_fillRect); + } + + mpFS->endElementNS(XML_a, XML_stretch); +} + +static OUString lclConvertRectanglePointToToken(RectanglePoint eRectanglePoint) +{ + OUString sAlignment; + switch (eRectanglePoint) + { + case RectanglePoint_LEFT_TOP: + sAlignment = "tl"; + break; + case RectanglePoint_MIDDLE_TOP: + sAlignment = "t"; + break; + case RectanglePoint_RIGHT_TOP: + sAlignment = "tr"; + break; + case RectanglePoint_LEFT_MIDDLE: + sAlignment = "l"; + break; + case RectanglePoint_MIDDLE_MIDDLE: + sAlignment = "ctr"; + break; + case RectanglePoint_RIGHT_MIDDLE: + sAlignment = "r"; + break; + case RectanglePoint_LEFT_BOTTOM: + sAlignment = "bl"; + break; + case RectanglePoint_MIDDLE_BOTTOM: + sAlignment = "b"; + break; + case RectanglePoint_RIGHT_BOTTOM: + sAlignment = "br"; + break; + default: + break; + } + return sAlignment; +} + +void DrawingML::WriteXGraphicTile(uno::Reference const& rXPropSet, + uno::Reference const& rxGraphic) +{ + Graphic aGraphic(rxGraphic); + Size aOriginalSize(aGraphic.GetPrefSize()); + const MapMode& rMapMode = aGraphic.GetPrefMapMode(); + // if the original size is in pixel, convert it to mm100 + if (rMapMode.GetMapUnit() == MapUnit::MapPixel) + aOriginalSize = Application::GetDefaultDevice()->PixelToLogic(aOriginalSize, + MapMode(MapUnit::Map100thMM)); + sal_Int32 nOffsetX = 0; + if (GetProperty(rXPropSet, "FillBitmapPositionOffsetX")) + nOffsetX = (*o3tl::doAccess(mAny)) * aOriginalSize.Width() * 3.6; + + sal_Int32 nOffsetY = 0; + if (GetProperty(rXPropSet, "FillBitmapPositionOffsetY")) + nOffsetY = (*o3tl::doAccess(mAny)) * aOriginalSize.Height() * 3.6; + + // convert the X size of bitmap to a percentage + sal_Int32 nSizeX = 0; + if (GetProperty(rXPropSet, "FillBitmapSizeX")) + { + mAny >>= nSizeX; + if (nSizeX > 0) + nSizeX = double(nSizeX) / aOriginalSize.Width() * 100000; + else if (nSizeX < 0) + nSizeX *= 1000; + else + nSizeX = 100000; + } + + // convert the Y size of bitmap to a percentage + sal_Int32 nSizeY = 0; + if (GetProperty(rXPropSet, "FillBitmapSizeY")) + { + mAny >>= nSizeY; + if (nSizeY > 0) + nSizeY = double(nSizeY) / aOriginalSize.Height() * 100000; + else if (nSizeY < 0) + nSizeY *= 1000; + else + nSizeY = 100000; + } + + // if the "Scale" setting is checked in the images settings dialog. + if (nSizeX < 0 && nSizeY < 0) + { + Reference xDPS(GetFB()->getModel(), UNO_QUERY_THROW); + Reference xDrawPages(xDPS->getDrawPages(), UNO_SET_THROW); + // in this case, the size of the first slide is enough, because all slides are the same size + Reference xDrawPage(xDrawPages->getByIndex(0), UNO_QUERY); + css::uno::Reference xPagePropSet(xDrawPage, UNO_QUERY); + if (xPagePropSet) + { + double nPageWidth, nPageHeight; + xPagePropSet->getPropertyValue("Width") >>= nPageWidth; + xPagePropSet->getPropertyValue("Height") >>= nPageHeight; + nSizeX = nPageWidth / aOriginalSize.Width() * std::abs(nSizeX); + nSizeY = nPageHeight / aOriginalSize.Height() * std::abs(nSizeY); + } + } + + OUString sRectanglePoint; + if (GetProperty(rXPropSet, "FillBitmapRectanglePoint")) + sRectanglePoint = lclConvertRectanglePointToToken(*o3tl::doAccess(mAny)); + + mpFS->singleElementNS(XML_a, XML_tile, XML_tx, OUString::number(nOffsetX), XML_ty, + OUString::number(nOffsetY), XML_sx, OUString::number(nSizeX), XML_sy, + OUString::number(nSizeY), XML_algn, sRectanglePoint); +} + +namespace +{ +bool IsTopGroupObj(const uno::Reference& xShape) +{ + SdrObject* pObject = SdrObject::getSdrObjectFromXShape(xShape); + if (!pObject) + return false; + + if (pObject->getParentSdrObjectFromSdrObject()) + return false; + + return pObject->IsGroupObject(); +} +} + +void DrawingML::WriteTransformation(const Reference< XShape >& xShape, const tools::Rectangle& rRect, + sal_Int32 nXmlNamespace, bool bFlipH, bool bFlipV, sal_Int32 nRotation, bool bIsGroupShape) +{ + + mpFS->startElementNS( nXmlNamespace, XML_xfrm, + XML_flipH, sax_fastparser::UseIf("1", bFlipH), + XML_flipV, sax_fastparser::UseIf("1", bFlipV), + XML_rot, sax_fastparser::UseIf(OString::number(nRotation), nRotation % 21600000 != 0)); + + sal_Int32 nLeft = rRect.Left(); + sal_Int32 nTop = rRect.Top(); + if (GetDocumentType() == DOCUMENT_DOCX && !m_xParent.is()) + { + nLeft = 0; + nTop = 0; + } + sal_Int32 nChildLeft = nLeft; + sal_Int32 nChildTop = nTop; + + mpFS->singleElementNS(XML_a, XML_off, + XML_x, OString::number(oox::drawingml::convertHmmToEmu(nLeft)), + XML_y, OString::number(oox::drawingml::convertHmmToEmu(nTop))); + mpFS->singleElementNS(XML_a, XML_ext, + XML_cx, OString::number(oox::drawingml::convertHmmToEmu(rRect.GetWidth())), + XML_cy, OString::number(oox::drawingml::convertHmmToEmu(rRect.GetHeight()))); + + if (bIsGroupShape && (GetDocumentType() != DOCUMENT_DOCX || IsTopGroupObj(xShape))) + { + mpFS->singleElementNS(XML_a, XML_chOff, + XML_x, OString::number(oox::drawingml::convertHmmToEmu(nChildLeft)), + XML_y, OString::number(oox::drawingml::convertHmmToEmu(nChildTop))); + mpFS->singleElementNS(XML_a, XML_chExt, + XML_cx, OString::number(oox::drawingml::convertHmmToEmu(rRect.GetWidth())), + XML_cy, OString::number(oox::drawingml::convertHmmToEmu(rRect.GetHeight()))); + } + + mpFS->endElementNS( nXmlNamespace, XML_xfrm ); +} + +void DrawingML::WriteShapeTransformation( const Reference< XShape >& rXShape, sal_Int32 nXmlNamespace, bool bFlipH, bool bFlipV, bool bSuppressRotation, bool bSuppressFlipping, bool bFlippedBeforeRotation ) +{ + SAL_INFO("oox.shape", "write shape transformation"); + + Degree100 nRotation; + Degree100 nCameraRotation; + awt::Point aPos = rXShape->getPosition(); + awt::Size aSize = rXShape->getSize(); + + bool bFlipHWrite = bFlipH && !bSuppressFlipping; + bool bFlipVWrite = bFlipV && !bSuppressFlipping; + bFlipH = bFlipH && !bFlippedBeforeRotation; + bFlipV = bFlipV && !bFlippedBeforeRotation; + + if (GetDocumentType() == DOCUMENT_DOCX && m_xParent.is()) + { + awt::Point aParentPos = m_xParent->getPosition(); + aPos.X -= aParentPos.X; + aPos.Y -= aParentPos.Y; + } + + if ( aSize.Width < 0 ) + aSize.Width = 1000; + if ( aSize.Height < 0 ) + aSize.Height = 1000; + if (!bSuppressRotation) + { + SdrObject* pShape = SdrObject::getSdrObjectFromXShape(rXShape); + nRotation = pShape ? pShape->GetRotateAngle() : 0_deg100; + if ( GetDocumentType() != DOCUMENT_DOCX ) + { + int faccos=bFlipV ? -1 : 1; + int facsin=bFlipH ? -1 : 1; + aPos.X-=(1-faccos*cos(toRadians(nRotation)))*aSize.Width/2-facsin*sin(toRadians(nRotation))*aSize.Height/2; + aPos.Y-=(1-faccos*cos(toRadians(nRotation)))*aSize.Height/2+facsin*sin(toRadians(nRotation))*aSize.Width/2; + } + else if (m_xParent.is() && nRotation != 0_deg100) + { + // Position for rotated shapes inside group is not set by DocxSdrExport. + basegfx::B2DRange aRect(-aSize.Width / 2.0, -aSize.Height / 2.0, aSize.Width / 2.0, + aSize.Height / 2.0); + basegfx::B2DHomMatrix aRotateMatrix = + basegfx::utils::createRotateB2DHomMatrix(toRadians(nRotation)); + aRect.transform(aRotateMatrix); + aPos.X += -aSize.Width / 2.0 - aRect.getMinX(); + aPos.Y += -aSize.Height / 2.0 - aRect.getMinY(); + } + + // The RotateAngle property's value is independent from any flipping, and that's exactly what we need here. + uno::Reference xPropertySet(rXShape, uno::UNO_QUERY); + uno::Reference xPropertySetInfo = xPropertySet->getPropertySetInfo(); + if (xPropertySetInfo->hasPropertyByName("RotateAngle")) + { + sal_Int32 nTmp; + if (xPropertySet->getPropertyValue("RotateAngle") >>= nTmp) + nRotation = Degree100(nTmp); + } + // tdf#133037: restore original rotate angle before output + if (nRotation && xPropertySetInfo->hasPropertyByName(UNO_NAME_MISC_OBJ_INTEROPGRABBAG)) + { + uno::Sequence aGrabBagProps; + xPropertySet->getPropertyValue(UNO_NAME_MISC_OBJ_INTEROPGRABBAG) >>= aGrabBagProps; + auto p3DEffectProps = std::find_if(std::cbegin(aGrabBagProps), std::cend(aGrabBagProps), + [](const PropertyValue& rProp) { return rProp.Name == "3DEffectProperties"; }); + if (p3DEffectProps != std::cend(aGrabBagProps)) + { + uno::Sequence a3DEffectProps; + p3DEffectProps->Value >>= a3DEffectProps; + auto pCameraProps = std::find_if(std::cbegin(a3DEffectProps), std::cend(a3DEffectProps), + [](const PropertyValue& rProp) { return rProp.Name == "Camera"; }); + if (pCameraProps != std::cend(a3DEffectProps)) + { + uno::Sequence aCameraProps; + pCameraProps->Value >>= aCameraProps; + auto pZRotationProp = std::find_if(std::cbegin(aCameraProps), std::cend(aCameraProps), + [](const PropertyValue& rProp) { return rProp.Name == "rotRev"; }); + if (pZRotationProp != std::cend(aCameraProps)) + { + sal_Int32 nTmp = 0; + pZRotationProp->Value >>= nTmp; + nCameraRotation = NormAngle36000(Degree100(nTmp / -600)); + } + } + } + } + } + + // OOXML flips shapes before rotating them. + if(bFlipH != bFlipV) + nRotation = 36000_deg100 - nRotation; + + WriteTransformation(rXShape, tools::Rectangle(Point(aPos.X, aPos.Y), Size(aSize.Width, aSize.Height)), nXmlNamespace, + bFlipHWrite, bFlipVWrite, ExportRotateClockwisify(nRotation + nCameraRotation), IsGroupShape( rXShape )); +} + +static OUString lcl_GetTarget(const css::uno::Reference& xModel, OUString& rURL) +{ + Reference xDPS(xModel, uno::UNO_QUERY_THROW); + Reference xDrawPages(xDPS->getDrawPages(), uno::UNO_SET_THROW); + sal_uInt32 nPageCount = xDrawPages->getCount(); + OUString sTarget; + + for (sal_uInt32 i = 0; i < nPageCount; ++i) + { + Reference xDrawPage; + xDrawPages->getByIndex(i) >>= xDrawPage; + Reference xNamed(xDrawPage, UNO_QUERY); + if (!xNamed) + continue; + OUString sSlideName = "#" + xNamed->getName(); + if (rURL == sSlideName) + { + sTarget = "slide" + OUString::number(i + 1) + ".xml"; + break; + } + } + if (sTarget.isEmpty()) + { + sal_Int32 nSplit = rURL.lastIndexOf(' '); + if (nSplit > -1) + sTarget = OUString::Concat("slide") + rURL.subView(nSplit + 1) + ".xml"; + } + + return sTarget; +} + +void DrawingML::WriteRunProperties( const Reference< XPropertySet >& rRun, bool bIsField, sal_Int32 nElement, + bool bCheckDirect,bool& rbOverridingCharHeight, sal_Int32& rnCharHeight, + sal_Int16 nScriptType, const Reference< XPropertySet >& rXShapePropSet) +{ + Reference< XPropertySet > rXPropSet = rRun; + Reference< XPropertyState > rXPropState( rRun, UNO_QUERY ); + OUString usLanguage; + PropertyState eState; + bool bComplex = ( nScriptType == css::i18n::ScriptType::COMPLEX ); + const char* bold = "0"; + const char* italic = nullptr; + const char* underline = nullptr; + const char* strikeout = nullptr; + const char* cap = nullptr; + sal_Int32 nSize = 1800; + sal_Int32 nCharEscapement = 0; + sal_Int32 nCharKerning = 0; + sal_Int32 nCharEscapementHeight = 0; + + if ( nElement == XML_endParaRPr && rbOverridingCharHeight ) + { + nSize = rnCharHeight; + } + else if (GetProperty(rXPropSet, "CharHeight")) + { + nSize = static_cast(100*(*o3tl::doAccess(mAny))); + if ( nElement == XML_rPr || nElement == XML_defRPr ) + { + rbOverridingCharHeight = true; + rnCharHeight = nSize; + } + } + + if (GetProperty(rXPropSet, "CharKerning")) + nCharKerning = static_cast(*o3tl::doAccess(mAny)); + /** While setting values in propertymap, + * CharKerning converted using GetTextSpacingPoint + * i.e set @ https://opengrok.libreoffice.org/xref/core/oox/source/drawingml/textcharacterproperties.cxx#129 + * therefore to get original value CharKerning need to be convert. + * https://opengrok.libreoffice.org/xref/core/oox/source/drawingml/drawingmltypes.cxx#95 + **/ + nCharKerning = ((nCharKerning * 720)-360) / 254; + + if ((bComplex && GetProperty(rXPropSet, "CharWeightComplex")) + || GetProperty(rXPropSet, "CharWeight")) + { + if ( *o3tl::doAccess(mAny) >= awt::FontWeight::SEMIBOLD ) + bold = "1"; + } + + if ((bComplex && GetProperty(rXPropSet, "CharPostureComplex")) + || GetProperty(rXPropSet, "CharPosture")) + switch ( *o3tl::doAccess(mAny) ) + { + case awt::FontSlant_OBLIQUE : + case awt::FontSlant_ITALIC : + italic = "1"; + break; + default: + break; + } + + if ((bCheckDirect && GetPropertyAndState(rXPropSet, rXPropState, "CharUnderline", eState) + && eState == beans::PropertyState_DIRECT_VALUE) + || GetProperty(rXPropSet, "CharUnderline")) + { + switch ( *o3tl::doAccess(mAny) ) + { + case awt::FontUnderline::SINGLE : + underline = "sng"; + break; + case awt::FontUnderline::DOUBLE : + underline = "dbl"; + break; + case awt::FontUnderline::DOTTED : + underline = "dotted"; + break; + case awt::FontUnderline::DASH : + underline = "dash"; + break; + case awt::FontUnderline::LONGDASH : + underline = "dashLong"; + break; + case awt::FontUnderline::DASHDOT : + underline = "dotDash"; + break; + case awt::FontUnderline::DASHDOTDOT : + underline = "dotDotDash"; + break; + case awt::FontUnderline::WAVE : + underline = "wavy"; + break; + case awt::FontUnderline::DOUBLEWAVE : + underline = "wavyDbl"; + break; + case awt::FontUnderline::BOLD : + underline = "heavy"; + break; + case awt::FontUnderline::BOLDDOTTED : + underline = "dottedHeavy"; + break; + case awt::FontUnderline::BOLDDASH : + underline = "dashHeavy"; + break; + case awt::FontUnderline::BOLDLONGDASH : + underline = "dashLongHeavy"; + break; + case awt::FontUnderline::BOLDDASHDOT : + underline = "dotDashHeavy"; + break; + case awt::FontUnderline::BOLDDASHDOTDOT : + underline = "dotDotDashHeavy"; + break; + case awt::FontUnderline::BOLDWAVE : + underline = "wavyHeavy"; + break; + } + } + + if ((bCheckDirect && GetPropertyAndState(rXPropSet, rXPropState, "CharStrikeout", eState) + && eState == beans::PropertyState_DIRECT_VALUE) + || GetProperty(rXPropSet, "CharStrikeout")) + { + switch ( *o3tl::doAccess(mAny) ) + { + case awt::FontStrikeout::NONE : + strikeout = "noStrike"; + break; + case awt::FontStrikeout::SINGLE : + // LibO supports further values of character + // strikeout, OOXML standard (20.1.10.78, + // ST_TextStrikeType) however specifies only + // 3 - single, double and none. Approximate + // the remaining ones by single strike (better + // some strike than none at all). + // TODO: figure out how to do this better + case awt::FontStrikeout::BOLD : + case awt::FontStrikeout::SLASH : + case awt::FontStrikeout::X : + strikeout = "sngStrike"; + break; + case awt::FontStrikeout::DOUBLE : + strikeout = "dblStrike"; + break; + } + } + + bool bLang = false; + switch(nScriptType) + { + case css::i18n::ScriptType::ASIAN: + bLang = GetProperty(rXPropSet, "CharLocaleAsian"); break; + case css::i18n::ScriptType::COMPLEX: + bLang = GetProperty(rXPropSet, "CharLocaleComplex"); break; + default: + bLang = GetProperty(rXPropSet, "CharLocale"); break; + } + + if (bLang) + { + css::lang::Locale aLocale; + mAny >>= aLocale; + LanguageTag aLanguageTag( aLocale); + if (!aLanguageTag.isSystemLocale()) + usLanguage = aLanguageTag.getBcp47MS(); + } + + if (GetPropertyAndState(rXPropSet, rXPropState, "CharEscapement", eState) + && eState == beans::PropertyState_DIRECT_VALUE) + mAny >>= nCharEscapement; + + if (GetPropertyAndState(rXPropSet, rXPropState, "CharEscapementHeight", eState) + && eState == beans::PropertyState_DIRECT_VALUE) + mAny >>= nCharEscapementHeight; + + if (DFLT_ESC_AUTO_SUPER == nCharEscapement) + { + // Raised by the differences between the ascenders (ascent = baseline to top of highest letter). + // The ascent is generally about 80% of the total font height. + // That is why DFLT_ESC_PROP (58) leads to 33% (DFLT_ESC_SUPER) + nCharEscapement = .8 * (100 - nCharEscapementHeight); + } + else if (DFLT_ESC_AUTO_SUB == nCharEscapement) + { + // Lowered by the differences between the descenders (descent = baseline to bottom of lowest letter). + // The descent is generally about 20% of the total font height. + // That is why DFLT_ESC_PROP (58) leads to 8% (DFLT_ESC_SUB) + nCharEscapement = .2 * -(100 - nCharEscapementHeight); + } + + if (nCharEscapement && nCharEscapementHeight) + { + nSize = (nSize * nCharEscapementHeight) / 100; + // MSO uses default ~58% size + nSize = (nSize / 0.58); + } + + if (GetProperty(rXPropSet, "CharCaseMap")) + { + switch ( *o3tl::doAccess(mAny) ) + { + case CaseMap::UPPERCASE : + cap = "all"; + break; + case CaseMap::SMALLCAPS : + cap = "small"; + break; + } + } + + mpFS->startElementNS( XML_a, nElement, + XML_b, bold, + XML_i, italic, + XML_lang, sax_fastparser::UseIf(usLanguage, !usLanguage.isEmpty()), + XML_sz, OString::number(nSize), + // For Condensed character spacing spc value is negative. + XML_spc, sax_fastparser::UseIf(OString::number(nCharKerning), nCharKerning != 0), + XML_strike, strikeout, + XML_u, underline, + XML_baseline, sax_fastparser::UseIf(OString::number(nCharEscapement*1000), nCharEscapement != 0), + XML_cap, cap ); + + // Fontwork-shapes in LO have text outline and fill from shape stroke and shape fill + // PowerPoint has this as run properties + if (IsFontworkShape(rXShapePropSet)) + { + WriteOutline(rXShapePropSet); + WriteBlipOrNormalFill(rXShapePropSet, "Graphic"); + WriteShapeEffects(rXShapePropSet); + } + else + { + // mso doesn't like text color to be placed after typeface + if ((bCheckDirect && GetPropertyAndState(rXPropSet, rXPropState, "CharColor", eState) + && eState == beans::PropertyState_DIRECT_VALUE) + || GetProperty(rXPropSet, "CharColor")) + { + ::Color color( ColorTransparency, *o3tl::doAccess(mAny) ); + SAL_INFO("oox.shape", "run color: " << sal_uInt32(color) << " auto: " << sal_uInt32(COL_AUTO)); + + // WriteSolidFill() handles MAX_PERCENT as "no transparency". + sal_Int32 nTransparency = MAX_PERCENT; + if (rXPropSet->getPropertySetInfo()->hasPropertyByName("CharTransparence")) + { + rXPropSet->getPropertyValue("CharTransparence") >>= nTransparency; + // UNO scale is 0..100, OOXML scale is 0..100000; also UNO tracks transparency, OOXML + // tracks opacity. + nTransparency = MAX_PERCENT - (nTransparency * PER_PERCENT); + } + + bool bContoured = false; + if (GetProperty(rXPropSet, "CharContoured")) + bContoured = *o3tl::doAccess(mAny); + + // tdf#127696 If the CharContoured is true, then the text color is white and the outline color is the CharColor. + if (bContoured) + { + mpFS->startElementNS(XML_a, XML_ln); + if (color == COL_AUTO) + { + mbIsBackgroundDark ? WriteSolidFill(COL_WHITE) : WriteSolidFill(COL_BLACK); + } + else + { + color.SetAlpha(255); + if (!WriteCharColor(rXPropSet)) + WriteSolidFill(color, nTransparency); + } + mpFS->endElementNS(XML_a, XML_ln); + + WriteSolidFill(COL_WHITE); + } + // tdf#104219 In LibreOffice and MS Office, there are two types of colors: + // Automatic and Fixed. OOXML is setting automatic color, by not providing color. + else if( color != COL_AUTO ) + { + color.SetAlpha(255); + // TODO: special handle embossed/engraved + if (!WriteCharColor(rXPropSet)) + { + WriteSolidFill(color, nTransparency); + } + } + else if (GetDocumentType() == DOCUMENT_PPTX) + { + // Resolve COL_AUTO for PPTX since MS Powerpoint doesn't have automatic colors. + bool bIsTextBackgroundDark = mbIsBackgroundDark; + if (rXShapePropSet.is() && GetProperty(rXShapePropSet, "FillStyle") + && mAny.get() != FillStyle_NONE + && GetProperty(rXShapePropSet, "FillColor")) + { + ::Color aShapeFillColor(ColorTransparency, mAny.get()); + bIsTextBackgroundDark = aShapeFillColor.IsDark(); + } + + if (bIsTextBackgroundDark) + WriteSolidFill(COL_WHITE); + else + WriteSolidFill(COL_BLACK); + } + } + } + + // tdf#128096, exporting XML_highlight to docx already works fine, + // so make sure this code is only run when exporting to pptx, just in case + if (GetDocumentType() == DOCUMENT_PPTX) + { + if (GetProperty(rXPropSet, "CharBackColor")) + { + ::Color color(ColorTransparency, *o3tl::doAccess(mAny)); + if( color != COL_AUTO ) + { + mpFS->startElementNS(XML_a, XML_highlight); + WriteColor( color ); + mpFS->endElementNS( XML_a, XML_highlight ); + } + } + } + + if (underline + && ((bCheckDirect + && GetPropertyAndState(rXPropSet, rXPropState, "CharUnderlineColor", eState) + && eState == beans::PropertyState_DIRECT_VALUE) + || GetProperty(rXPropSet, "CharUnderlineColor"))) + { + ::Color color(ColorTransparency, *o3tl::doAccess(mAny)); + // if color is automatic, then we shouldn't write information about color but to take color from character + if( color != COL_AUTO ) + { + mpFS->startElementNS(XML_a, XML_uFill); + WriteSolidFill( color ); + mpFS->endElementNS( XML_a, XML_uFill ); + } + else + { + mpFS->singleElementNS(XML_a, XML_uFillTx); + } + } + + if (GetProperty(rXPropSet, "CharFontName")) + { + const char* const pitch = nullptr; + const char* const charset = nullptr; + OUString usTypeface; + + mAny >>= usTypeface; + OUString aSubstName( GetSubsFontName( usTypeface, SubsFontFlags::ONLYONE | SubsFontFlags::MS ) ); + if (!aSubstName.isEmpty()) + usTypeface = aSubstName; + + mpFS->singleElementNS( XML_a, XML_latin, + XML_typeface, usTypeface, + XML_pitchFamily, pitch, + XML_charset, charset ); + } + + if ((bComplex + && (GetPropertyAndState(rXPropSet, rXPropState, "CharFontNameComplex", eState) + && eState == beans::PropertyState_DIRECT_VALUE)) + || (!bComplex + && (GetPropertyAndState(rXPropSet, rXPropState, "CharFontNameAsian", eState) + && eState == beans::PropertyState_DIRECT_VALUE))) + { + const char* const pitch = nullptr; + const char* const charset = nullptr; + OUString usTypeface; + + mAny >>= usTypeface; + OUString aSubstName( GetSubsFontName( usTypeface, SubsFontFlags::ONLYONE | SubsFontFlags::MS ) ); + if (!aSubstName.isEmpty()) + usTypeface = aSubstName; + + mpFS->singleElementNS( XML_a, bComplex ? XML_cs : XML_ea, + XML_typeface, usTypeface, + XML_pitchFamily, pitch, + XML_charset, charset ); + } + + if( bIsField ) + { + Reference< XTextField > rXTextField; + if (GetProperty(rXPropSet, "TextField")) + mAny >>= rXTextField; + if( rXTextField.is() ) + rXPropSet.set( rXTextField, UNO_QUERY ); + } + + // field properties starts here + if (GetProperty(rXPropSet, "URL")) + { + OUString sURL; + + mAny >>= sURL; + if (!sURL.isEmpty()) + { + if (!sURL.match("#action?jump=")) + { + bool bExtURL = URLTransformer().isExternalURL(sURL); + sURL = bExtURL ? sURL : lcl_GetTarget(GetFB()->getModel(), sURL); + + OUString sRelId + = mpFB->addRelation(mpFS->getOutputStream(), + bExtURL ? oox::getRelationship(Relationship::HYPERLINK) + : oox::getRelationship(Relationship::SLIDE), + sURL, bExtURL); + + if (bExtURL) + mpFS->singleElementNS(XML_a, XML_hlinkClick, FSNS(XML_r, XML_id), sRelId); + else + mpFS->singleElementNS(XML_a, XML_hlinkClick, FSNS(XML_r, XML_id), sRelId, + XML_action, "ppaction://hlinksldjump"); + } + else + { + sal_Int32 nIndex = sURL.indexOf('='); + std::u16string_view aDestination(sURL.subView(nIndex + 1)); + mpFS->singleElementNS(XML_a, XML_hlinkClick, FSNS(XML_r, XML_id), "", XML_action, + OUString::Concat("ppaction://hlinkshowjump?jump=") + aDestination); + } + } + } + mpFS->endElementNS( XML_a, nElement ); +} + +OUString DrawingML::GetFieldValue( const css::uno::Reference< css::text::XTextRange >& rRun, bool& bIsURLField ) +{ + Reference< XPropertySet > rXPropSet( rRun, UNO_QUERY ); + OUString aFieldType, aFieldValue; + + if (GetProperty(rXPropSet, "TextPortionType")) + { + aFieldType = *o3tl::doAccess(mAny); + SAL_INFO("oox.shape", "field type: " << aFieldType); + } + + if( aFieldType == "TextField" ) + { + Reference< XTextField > rXTextField; + if (GetProperty(rXPropSet, "TextField")) + mAny >>= rXTextField; + if( rXTextField.is() ) + { + rXPropSet.set( rXTextField, UNO_QUERY ); + if( rXPropSet.is() ) + { + OUString aFieldKind( rXTextField->getPresentation( true ) ); + SAL_INFO("oox.shape", "field kind: " << aFieldKind); + if( aFieldKind == "Page" ) + { + aFieldValue = "slidenum"; + } + else if( aFieldKind == "Pages" ) + { + aFieldValue = "slidecount"; + } + else if( aFieldKind == "PageName" ) + { + aFieldValue = "slidename"; + } + else if( aFieldKind == "URL" ) + { + bIsURLField = true; + if (GetProperty(rXPropSet, "Representation")) + mAny >>= aFieldValue; + + } + else if(aFieldKind == "Date") + { + sal_Int32 nNumFmt = -1; + rXPropSet->getPropertyValue(UNO_TC_PROP_NUMFORMAT) >>= nNumFmt; + aFieldValue = GetDatetimeTypeFromDate(static_cast(nNumFmt)); + } + else if(aFieldKind == "ExtTime") + { + sal_Int32 nNumFmt = -1; + rXPropSet->getPropertyValue(UNO_TC_PROP_NUMFORMAT) >>= nNumFmt; + aFieldValue = GetDatetimeTypeFromTime(static_cast(nNumFmt)); + } + else if(aFieldKind == "ExtFile") + { + sal_Int32 nNumFmt = -1; + rXPropSet->getPropertyValue(UNO_TC_PROP_FILE_FORMAT) >>= nNumFmt; + switch(nNumFmt) + { + case 0: aFieldValue = "file"; // Path/File name + break; + case 1: aFieldValue = "file1"; // Path + break; + case 2: aFieldValue = "file2"; // File name without extension + break; + case 3: aFieldValue = "file3"; // File name with extension + } + } + else if(aFieldKind == "Author") + { + aFieldValue = "author"; + } + } + } + } + return aFieldValue; +} + +OUString DrawingML::GetDatetimeTypeFromDate(SvxDateFormat eDate) +{ + return GetDatetimeTypeFromDateTime(eDate, SvxTimeFormat::AppDefault); +} + +OUString DrawingML::GetDatetimeTypeFromTime(SvxTimeFormat eTime) +{ + return GetDatetimeTypeFromDateTime(SvxDateFormat::AppDefault, eTime); +} + +OUString DrawingML::GetDatetimeTypeFromDateTime(SvxDateFormat eDate, SvxTimeFormat eTime) +{ + OUString aDateField; + switch (eDate) + { + case SvxDateFormat::StdSmall: + case SvxDateFormat::A: + aDateField = "datetime"; + break; + case SvxDateFormat::B: + aDateField = "datetime1"; // 13/02/1996 + break; + case SvxDateFormat::C: + aDateField = "datetime5"; + break; + case SvxDateFormat::D: + aDateField = "datetime3"; // 13 February 1996 + break; + case SvxDateFormat::StdBig: + case SvxDateFormat::E: + case SvxDateFormat::F: + aDateField = "datetime2"; + break; + default: + break; + } + + OUString aTimeField; + switch (eTime) + { + case SvxTimeFormat::Standard: + case SvxTimeFormat::HH24_MM_SS: + case SvxTimeFormat::HH24_MM_SS_00: + aTimeField = "datetime11"; // 13:49:38 + break; + case SvxTimeFormat::HH24_MM: + aTimeField = "datetime10"; // 13:49 + break; + case SvxTimeFormat::HH12_MM: + case SvxTimeFormat::HH12_MM_AMPM: + aTimeField = "datetime12"; // 01:49 PM + break; + case SvxTimeFormat::HH12_MM_SS: + case SvxTimeFormat::HH12_MM_SS_AMPM: + case SvxTimeFormat::HH12_MM_SS_00: + case SvxTimeFormat::HH12_MM_SS_00_AMPM: + aTimeField = "datetime13"; // 01:49:38 PM + break; + default: + break; + } + + if (!aDateField.isEmpty() && aTimeField.isEmpty()) + return aDateField; + else if (!aTimeField.isEmpty() && aDateField.isEmpty()) + return aTimeField; + else if (!aDateField.isEmpty() && !aTimeField.isEmpty()) + { + if (aTimeField == "datetime11" || aTimeField == "datetime13") + // only datetime format that has Date and HH:MM:SS + return "datetime9"; // dd/mm/yyyy H:MM:SS + else + // only datetime format that has Date and HH:MM + return "datetime8"; // dd/mm/yyyy H:MM + } + else + return ""; +} + +void DrawingML::WriteRun( const Reference< XTextRange >& rRun, + bool& rbOverridingCharHeight, sal_Int32& rnCharHeight, + const css::uno::Reference< css::beans::XPropertySet >& rXShapePropSet) +{ + Reference< XPropertySet > rXPropSet( rRun, UNO_QUERY ); + sal_Int16 nLevel = -1; + if (GetProperty(rXPropSet, "NumberingLevel")) + mAny >>= nLevel; + + bool bNumberingIsNumber = true; + if (GetProperty(rXPropSet, "NumberingIsNumber")) + mAny >>= bNumberingIsNumber; + + float nFontSize = -1; + if (GetProperty(rXPropSet, "CharHeight")) + mAny >>= nFontSize; + + bool bIsURLField = false; + OUString sFieldValue = GetFieldValue( rRun, bIsURLField ); + bool bWriteField = !( sFieldValue.isEmpty() || bIsURLField ); + + OUString sText = rRun->getString(); + + //if there is no text following the bullet, add a space after the bullet + if (nLevel !=-1 && bNumberingIsNumber && sText.isEmpty() ) + sText=" "; + + if ( bIsURLField ) + sText = sFieldValue; + + if( sText.isEmpty()) + { + Reference< XPropertySet > xPropSet( rRun, UNO_QUERY ); + + try + { + if( !xPropSet.is() || !( xPropSet->getPropertyValue( "PlaceholderText" ) >>= sText ) ) + return; + if( sText.isEmpty() ) + return; + } + catch (const Exception &) + { + return; + } + } + + if (sText == "\n") + { + // Empty run? Do not forget to write the font size in case of pptx: + if ((GetDocumentType() == DOCUMENT_PPTX) && (nFontSize != -1)) + { + mpFS->startElementNS(XML_a, XML_br); + mpFS->singleElementNS(XML_a, XML_rPr, XML_sz, + OString::number(nFontSize * 100).getStr()); + mpFS->endElementNS(XML_a, XML_br); + } + else + mpFS->singleElementNS(XML_a, XML_br); + } + else + { + if( bWriteField ) + { + OString sUUID(comphelper::xml::generateGUIDString()); + mpFS->startElementNS( XML_a, XML_fld, + XML_id, sUUID.getStr(), + XML_type, sFieldValue ); + } + else + { + mpFS->startElementNS(XML_a, XML_r); + } + + Reference< XPropertySet > xPropSet( rRun, uno::UNO_QUERY ); + + WriteRunProperties( xPropSet, bIsURLField, XML_rPr, true, rbOverridingCharHeight, rnCharHeight, GetScriptType(sText), rXShapePropSet); + mpFS->startElementNS(XML_a, XML_t); + mpFS->writeEscaped( sText ); + mpFS->endElementNS( XML_a, XML_t ); + + if( bWriteField ) + mpFS->endElementNS( XML_a, XML_fld ); + else + mpFS->endElementNS( XML_a, XML_r ); + } +} + +static OUString GetAutoNumType(SvxNumType nNumberingType, bool bSDot, bool bPBehind, bool bPBoth) +{ + OUString sPrefixSuffix; + + if (bPBoth) + sPrefixSuffix = "ParenBoth"; + else if (bPBehind) + sPrefixSuffix = "ParenR"; + else if (bSDot) + sPrefixSuffix = "Period"; + + switch( nNumberingType ) + { + case SVX_NUM_CHARS_UPPER_LETTER_N : + case SVX_NUM_CHARS_UPPER_LETTER : + return "alphaUc" + sPrefixSuffix; + + case SVX_NUM_CHARS_LOWER_LETTER_N : + case SVX_NUM_CHARS_LOWER_LETTER : + return "alphaLc" + sPrefixSuffix; + + case SVX_NUM_ROMAN_UPPER : + return "romanUc" + sPrefixSuffix; + + case SVX_NUM_ROMAN_LOWER : + return "romanLc" + sPrefixSuffix; + + case SVX_NUM_ARABIC : + { + if (sPrefixSuffix.isEmpty()) + return "arabicPlain"; + else + return "arabic" + sPrefixSuffix; + } + default: + break; + } + + return OUString(); +} + +void DrawingML::WriteParagraphNumbering(const Reference< XPropertySet >& rXPropSet, float fFirstCharHeight, sal_Int16 nLevel ) +{ + if (nLevel < 0 || !GetProperty(rXPropSet, "NumberingRules")) + return; + + Reference< XIndexAccess > rXIndexAccess; + + if (!(mAny >>= rXIndexAccess) || nLevel >= rXIndexAccess->getCount()) + return; + + SAL_INFO("oox.shape", "numbering rules"); + + Sequence aPropertySequence; + rXIndexAccess->getByIndex(nLevel) >>= aPropertySequence; + + if (!aPropertySequence.hasElements()) + return; + + SvxNumType nNumberingType = SVX_NUM_NUMBER_NONE; + bool bSDot = false; + bool bPBehind = false; + bool bPBoth = false; + sal_Unicode aBulletChar = 0x2022; // a bullet + awt::FontDescriptor aFontDesc; + bool bHasFontDesc = false; + uno::Reference xGraphic; + sal_Int16 nBulletRelSize = 0; + sal_Int16 nStartWith = 1; + ::Color nBulletColor; + bool bHasBulletColor = false; + awt::Size aGraphicSize; + + for ( const PropertyValue& rPropValue : std::as_const(aPropertySequence) ) + { + OUString aPropName( rPropValue.Name ); + SAL_INFO("oox.shape", "pro name: " << aPropName); + if ( aPropName == "NumberingType" ) + { + nNumberingType = static_cast(*o3tl::doAccess(rPropValue.Value)); + } + else if ( aPropName == "Prefix" ) + { + if( *o3tl::doAccess(rPropValue.Value) == ")") + bPBoth = true; + } + else if ( aPropName == "Suffix" ) + { + auto s = o3tl::doAccess(rPropValue.Value); + if( *s == ".") + bSDot = true; + else if( *s == ")") + bPBehind = true; + } + else if(aPropName == "BulletColor") + { + nBulletColor = ::Color(ColorTransparency, *o3tl::doAccess(rPropValue.Value)); + bHasBulletColor = true; + } + else if ( aPropName == "BulletChar" ) + { + aBulletChar = (*o3tl::doAccess(rPropValue.Value))[ 0 ]; + } + else if ( aPropName == "BulletFont" ) + { + aFontDesc = *o3tl::doAccess(rPropValue.Value); + bHasFontDesc = true; + + // Our numbullet dialog has set the wrong textencoding for our "StarSymbol" font, + // instead of a Unicode encoding the encoding RTL_TEXTENCODING_SYMBOL was used. + // Because there might exist a lot of damaged documents I added this two lines + // which fixes the bullet problem for the export. + if ( aFontDesc.Name.equalsIgnoreAsciiCase("StarSymbol") ) + aFontDesc.CharSet = RTL_TEXTENCODING_MS_1252; + + } + else if ( aPropName == "BulletRelSize" ) + { + nBulletRelSize = *o3tl::doAccess(rPropValue.Value); + } + else if ( aPropName == "StartWith" ) + { + nStartWith = *o3tl::doAccess(rPropValue.Value); + } + else if (aPropName == "GraphicBitmap") + { + auto xBitmap = rPropValue.Value.get>(); + xGraphic.set(xBitmap, uno::UNO_QUERY); + } + else if ( aPropName == "GraphicSize" ) + { + aGraphicSize = *o3tl::doAccess(rPropValue.Value); + SAL_INFO("oox.shape", "graphic size: " << aGraphicSize.Width << "x" << aGraphicSize.Height); + } + } + + if (nNumberingType == SVX_NUM_NUMBER_NONE) + return; + + Graphic aGraphic(xGraphic); + if (xGraphic.is() && aGraphic.GetType() != GraphicType::NONE) + { + tools::Long nFirstCharHeightMm = TransformMetric(fFirstCharHeight * 100.f, FieldUnit::POINT, FieldUnit::MM); + float fBulletSizeRel = aGraphicSize.Height / static_cast(nFirstCharHeightMm) / OOX_BULLET_LIST_SCALE_FACTOR; + + OUString sRelationId; + + if (fBulletSizeRel < 1.0f) + { + // Add padding to get the bullet point centered in PPT + Size aDestSize(64, 64); + float fBulletSizeRelX = fBulletSizeRel / aGraphicSize.Height * aGraphicSize.Width; + tools::Long nPaddingX = std::max(0, std::lround((aDestSize.Width() - fBulletSizeRelX * aDestSize.Width()) / 2.f)); + tools::Long nPaddingY = std::lround((aDestSize.Height() - fBulletSizeRel * aDestSize.Height()) / 2.f); + tools::Rectangle aDestRect(nPaddingX, nPaddingY, aDestSize.Width() - nPaddingX, aDestSize.Height() - nPaddingY); + + AlphaMask aMask(aDestSize); + aMask.Erase(255); + BitmapEx aSourceBitmap(aGraphic.GetBitmapEx()); + aSourceBitmap.Scale(aDestRect.GetSize()); + tools::Rectangle aSourceRect(Point(0, 0), aDestRect.GetSize()); + BitmapEx aDestBitmap(Bitmap(aDestSize, vcl::PixelFormat::N24_BPP), aMask); + aDestBitmap.CopyPixel(aDestRect, aSourceRect, &aSourceBitmap); + Graphic aDestGraphic(aDestBitmap); + sRelationId = WriteImage(aDestGraphic); + fBulletSizeRel = 1.0f; + } + else + { + sRelationId = WriteImage(aGraphic); + } + + mpFS->singleElementNS( XML_a, XML_buSzPct, + XML_val, OString::number(std::min(std::lround(100000.f * fBulletSizeRel), 400000))); + mpFS->startElementNS(XML_a, XML_buBlip); + mpFS->singleElementNS(XML_a, XML_blip, FSNS(XML_r, XML_embed), sRelationId); + mpFS->endElementNS( XML_a, XML_buBlip ); + } + else + { + if(bHasBulletColor) + { + if (nBulletColor == COL_AUTO ) + { + nBulletColor = ::Color(ColorTransparency, mbIsBackgroundDark ? 0xffffff : 0x000000); + } + mpFS->startElementNS(XML_a, XML_buClr); + WriteColor( nBulletColor ); + mpFS->endElementNS( XML_a, XML_buClr ); + } + + if( nBulletRelSize && nBulletRelSize != 100 ) + mpFS->singleElementNS( XML_a, XML_buSzPct, + XML_val, OString::number(std::clamp(1000*nBulletRelSize, 25000, 400000))); + if( bHasFontDesc ) + { + if ( SVX_NUM_CHAR_SPECIAL == nNumberingType ) + aBulletChar = SubstituteBullet( aBulletChar, aFontDesc ); + mpFS->singleElementNS( XML_a, XML_buFont, + XML_typeface, aFontDesc.Name, + XML_charset, sax_fastparser::UseIf("2", aFontDesc.CharSet == awt::CharSet::SYMBOL)); + } + + OUString aAutoNumType = GetAutoNumType( nNumberingType, bSDot, bPBehind, bPBoth ); + + if (!aAutoNumType.isEmpty()) + { + mpFS->singleElementNS(XML_a, XML_buAutoNum, + XML_type, aAutoNumType, + XML_startAt, sax_fastparser::UseIf(OString::number(nStartWith), nStartWith > 1)); + } + else + { + mpFS->singleElementNS(XML_a, XML_buChar, XML_char, OUString(aBulletChar)); + } + } +} + +void DrawingML::WriteParagraphTabStops(const Reference& rXPropSet) +{ + css::uno::Sequence aTabStops; + if (GetProperty(rXPropSet, "ParaTabStops")) + aTabStops = *o3tl::doAccess>(mAny); + + if (aTabStops.getLength() > 0) + mpFS->startElementNS(XML_a, XML_tabLst); + + for (const css::style::TabStop& rTabStop : std::as_const(aTabStops)) + { + OString sPosition = OString::number(GetPointFromCoordinate(rTabStop.Position)); + OString sAlignment; + switch (rTabStop.Alignment) + { + case css::style::TabAlign_DECIMAL: + sAlignment = "dec"; + break; + case css::style::TabAlign_RIGHT: + sAlignment = "r"; + break; + case css::style::TabAlign_CENTER: + sAlignment = "ctr"; + break; + case css::style::TabAlign_LEFT: + default: + sAlignment = "l"; + } + mpFS->singleElementNS(XML_a, XML_tab, XML_algn, sAlignment, XML_pos, sPosition); + } + if (aTabStops.getLength() > 0) + mpFS->endElementNS(XML_a, XML_tabLst); +} + +bool DrawingML::IsGroupShape( const Reference< XShape >& rXShape ) +{ + bool bRet = false; + if ( rXShape.is() ) + { + uno::Reference xServiceInfo(rXShape, uno::UNO_QUERY_THROW); + bRet = xServiceInfo->supportsService("com.sun.star.drawing.GroupShape"); + } + return bRet; +} + +sal_Int32 DrawingML::getBulletMarginIndentation (const Reference< XPropertySet >& rXPropSet,sal_Int16 nLevel, std::u16string_view propName) +{ + if (nLevel < 0 || !GetProperty(rXPropSet, "NumberingRules")) + return 0; + + Reference< XIndexAccess > rXIndexAccess; + + if (!(mAny >>= rXIndexAccess) || nLevel >= rXIndexAccess->getCount()) + return 0; + + SAL_INFO("oox.shape", "numbering rules"); + + Sequence aPropertySequence; + rXIndexAccess->getByIndex(nLevel) >>= aPropertySequence; + + if (!aPropertySequence.hasElements()) + return 0; + + for ( const PropertyValue& rPropValue : std::as_const(aPropertySequence) ) + { + OUString aPropName( rPropValue.Name ); + SAL_INFO("oox.shape", "pro name: " << aPropName); + if ( aPropName == propName ) + return *o3tl::doAccess(rPropValue.Value); + } + + return 0; +} + +const char* DrawingML::GetAlignment( style::ParagraphAdjust nAlignment ) +{ + const char* sAlignment = nullptr; + + switch( nAlignment ) + { + case style::ParagraphAdjust_CENTER: + sAlignment = "ctr"; + break; + case style::ParagraphAdjust_RIGHT: + sAlignment = "r"; + break; + case style::ParagraphAdjust_BLOCK: + sAlignment = "just"; + break; + default: + ; + } + + return sAlignment; +} + +void DrawingML::WriteLinespacing(const LineSpacing& rSpacing, float fFirstCharHeight) +{ + if( rSpacing.Mode == LineSpacingMode::PROP ) + { + mpFS->singleElementNS( XML_a, XML_spcPct, + XML_val, OString::number(static_cast(rSpacing.Height)*1000)); + } + else if (rSpacing.Mode == LineSpacingMode::MINIMUM + && fFirstCharHeight > static_cast(rSpacing.Height) * 0.001 * 72.0 / 2.54) + { + // 100% proportional line spacing = single line spacing + mpFS->singleElementNS(XML_a, XML_spcPct, XML_val, + OString::number(static_cast(100000))); + } + else + { + mpFS->singleElementNS( XML_a, XML_spcPts, + XML_val, OString::number(std::lround(rSpacing.Height / 25.4 * 72))); + } +} + +bool DrawingML::WriteParagraphProperties(const Reference& rParagraph, const Reference& rXShapePropSet, float fFirstCharHeight, sal_Int32 nElement) +{ + Reference< XPropertySet > rXPropSet( rParagraph, UNO_QUERY ); + Reference< XPropertyState > rXPropState( rParagraph, UNO_QUERY ); + PropertyState eState; + + if( !rXPropSet.is() || !rXPropState.is() ) + return false; + + sal_Int16 nLevel = -1; + if (GetProperty(rXPropSet, "NumberingLevel")) + mAny >>= nLevel; + + bool bWriteNumbering = true; + bool bForceZeroIndent = false; + if (mbPlaceholder) + { + Reference< text::XTextRange > xParaText(rParagraph, UNO_QUERY); + if (xParaText) + { + bool bNumberingOnThisLevel = false; + if (nLevel > -1) + { + Reference< XIndexAccess > xNumberingRules(rXPropSet->getPropertyValue("NumberingRules"), UNO_QUERY); + const PropertyValues& rNumRuleOfLevel = xNumberingRules->getByIndex(nLevel).get(); + for (const PropertyValue& rRule : rNumRuleOfLevel) + if (rRule.Name == "NumberingType" && rRule.Value.hasValue()) + bNumberingOnThisLevel = rRule.Value.get() != style::NumberingType::NUMBER_NONE; + } + + const bool bIsNumberingVisible = rXPropSet->getPropertyValue("NumberingIsNumber").get(); + const bool bIsLineEmpty = !xParaText->getString().getLength(); + + bWriteNumbering = !bIsLineEmpty && bIsNumberingVisible && (nLevel != -1); + bForceZeroIndent = (!bIsNumberingVisible || bIsLineEmpty || !bNumberingOnThisLevel); + } + + } + + sal_Int16 nTmp = sal_Int16(style::ParagraphAdjust_LEFT); + if (GetProperty(rXPropSet, "ParaAdjust")) + mAny >>= nTmp; + style::ParagraphAdjust nAlignment = static_cast(nTmp); + + bool bHasLinespacing = false; + LineSpacing aLineSpacing; + if (GetPropertyAndState(rXPropSet, rXPropState, "ParaLineSpacing", eState) + && (mAny >>= aLineSpacing) + && (eState == beans::PropertyState_DIRECT_VALUE || + // only export if it differs from the default 100% line spacing + aLineSpacing.Mode != LineSpacingMode::PROP || aLineSpacing.Height != 100)) + bHasLinespacing = true; + + bool bRtl = false; + if (GetProperty(rXPropSet, "WritingMode")) + { + sal_Int16 nWritingMode; + if( ( mAny >>= nWritingMode ) && nWritingMode == text::WritingMode2::RL_TB ) + { + bRtl = true; + } + } + + sal_Int32 nParaLeftMargin = 0; + sal_Int32 nParaFirstLineIndent = 0; + + if (GetProperty(rXPropSet, "ParaLeftMargin")) + mAny >>= nParaLeftMargin; + if (GetProperty(rXPropSet, "ParaFirstLineIndent")) + mAny >>= nParaFirstLineIndent; + + sal_Int32 nParaTopMargin = 0; + sal_Int32 nParaBottomMargin = 0; + + if (GetProperty(rXPropSet, "ParaTopMargin")) + mAny >>= nParaTopMargin; + if (GetProperty(rXPropSet, "ParaBottomMargin")) + mAny >>= nParaBottomMargin; + + sal_Int32 nLeftMargin = getBulletMarginIndentation ( rXPropSet, nLevel,u"LeftMargin"); + sal_Int32 nLineIndentation = getBulletMarginIndentation ( rXPropSet, nLevel,u"FirstLineOffset"); + + if (bWriteNumbering && !bForceZeroIndent) + { + if (!(nLevel != -1 + || nAlignment != style::ParagraphAdjust_LEFT + || bHasLinespacing)) + return false; + } + + // for autofitted textboxes, scale the indents + if (GetProperty(rXShapePropSet, "TextFitToSize") && mAny.get() == TextFitToSizeType_AUTOFIT) + { + SvxShapeText* pTextShape = dynamic_cast(rXShapePropSet.get()); + if (pTextShape) + { + SdrTextObj* pTextObject = dynamic_cast(pTextShape->GetSdrObject()); + if (pTextObject) + { + const auto nFontScaleY = pTextObject->GetFontScaleY(); + nLeftMargin = nLeftMargin * nFontScaleY / 100; + nLineIndentation = nLineIndentation * nFontScaleY / 100; + nParaLeftMargin = nParaLeftMargin * nFontScaleY / 100; + nParaFirstLineIndent = nParaFirstLineIndent * nFontScaleY / 100; + } + } + } + + if (nParaLeftMargin) // For Paragraph + mpFS->startElementNS( XML_a, nElement, + XML_lvl, sax_fastparser::UseIf(OString::number(nLevel), nLevel > 0), + XML_marL, sax_fastparser::UseIf(OString::number(oox::drawingml::convertHmmToEmu(nParaLeftMargin)), nParaLeftMargin > 0), + XML_indent, sax_fastparser::UseIf(OString::number(!bForceZeroIndent ? oox::drawingml::convertHmmToEmu(nParaFirstLineIndent) : 0), (bForceZeroIndent || (nParaFirstLineIndent != 0))), + XML_algn, GetAlignment( nAlignment ), + XML_rtl, sax_fastparser::UseIf(ToPsz10(bRtl), bRtl)); + else + mpFS->startElementNS( XML_a, nElement, + XML_lvl, sax_fastparser::UseIf(OString::number(nLevel), nLevel > 0), + XML_marL, sax_fastparser::UseIf(OString::number(oox::drawingml::convertHmmToEmu(nLeftMargin)), nLeftMargin > 0), + XML_indent, sax_fastparser::UseIf(OString::number(!bForceZeroIndent ? oox::drawingml::convertHmmToEmu(nLineIndentation) : 0), (bForceZeroIndent || ( nLineIndentation != 0))), + XML_algn, GetAlignment( nAlignment ), + XML_rtl, sax_fastparser::UseIf(ToPsz10(bRtl), bRtl)); + + + if( bHasLinespacing ) + { + mpFS->startElementNS(XML_a, XML_lnSpc); + WriteLinespacing(aLineSpacing, fFirstCharHeight); + mpFS->endElementNS( XML_a, XML_lnSpc ); + } + + if( nParaTopMargin != 0 ) + { + mpFS->startElementNS(XML_a, XML_spcBef); + { + mpFS->singleElementNS( XML_a, XML_spcPts, + XML_val, OString::number(std::lround(nParaTopMargin / 25.4 * 72))); + } + mpFS->endElementNS( XML_a, XML_spcBef ); + } + + if( nParaBottomMargin != 0 ) + { + mpFS->startElementNS(XML_a, XML_spcAft); + { + mpFS->singleElementNS( XML_a, XML_spcPts, + XML_val, OString::number(std::lround(nParaBottomMargin / 25.4 * 72))); + } + mpFS->endElementNS( XML_a, XML_spcAft ); + } + + if (!bWriteNumbering) + mpFS->singleElementNS(XML_a, XML_buNone); + else + WriteParagraphNumbering( rXPropSet, fFirstCharHeight, nLevel ); + + WriteParagraphTabStops( rXPropSet ); + + // do not end element for lstStyles since, defRPr should be stacked inside it + if( nElement != XML_lvl1pPr ) + mpFS->endElementNS( XML_a, nElement ); + + return true; +} + +void DrawingML::WriteLstStyles(const css::uno::Reference& rParagraph, + bool& rbOverridingCharHeight, sal_Int32& rnCharHeight, + const css::uno::Reference& rXShapePropSet) +{ + Reference xAccess(rParagraph, UNO_QUERY); + if (!xAccess.is()) + return; + + Reference xEnumeration(xAccess->createEnumeration()); + if (!xEnumeration.is()) + return; + + + Reference rRun; + + if (!xEnumeration->hasMoreElements()) + return; + + Any aAny(xEnumeration->nextElement()); + if (aAny >>= rRun) + { + float fFirstCharHeight = rnCharHeight / 1000.; + Reference xFirstRunPropSet(rRun, UNO_QUERY); + Reference xFirstRunPropSetInfo + = xFirstRunPropSet->getPropertySetInfo(); + + if (xFirstRunPropSetInfo->hasPropertyByName("CharHeight")) + fFirstCharHeight = xFirstRunPropSet->getPropertyValue("CharHeight").get(); + + mpFS->startElementNS(XML_a, XML_lstStyle); + if( !WriteParagraphProperties(rParagraph, rXShapePropSet, fFirstCharHeight, XML_lvl1pPr) ) + mpFS->startElementNS(XML_a, XML_lvl1pPr); + WriteRunProperties(xFirstRunPropSet, false, XML_defRPr, true, rbOverridingCharHeight, + rnCharHeight, GetScriptType(rRun->getString()), rXShapePropSet); + mpFS->endElementNS(XML_a, XML_lvl1pPr); + mpFS->endElementNS(XML_a, XML_lstStyle); + } +} + +void DrawingML::WriteParagraph( const Reference< XTextContent >& rParagraph, + bool& rbOverridingCharHeight, sal_Int32& rnCharHeight, + const css::uno::Reference< css::beans::XPropertySet >& rXShapePropSet) +{ + Reference< XEnumerationAccess > access( rParagraph, UNO_QUERY ); + if( !access.is() ) + return; + + Reference< XEnumeration > enumeration( access->createEnumeration() ); + if( !enumeration.is() ) + return; + + mpFS->startElementNS(XML_a, XML_p); + + bool bPropertiesWritten = false; + while( enumeration->hasMoreElements() ) + { + Reference< XTextRange > run; + Any any ( enumeration->nextElement() ); + + if (any >>= run) + { + if( !bPropertiesWritten ) + { + float fFirstCharHeight = rnCharHeight / 1000.; + Reference< XPropertySet > xFirstRunPropSet (run, UNO_QUERY); + Reference< XPropertySetInfo > xFirstRunPropSetInfo = xFirstRunPropSet->getPropertySetInfo(); + if( xFirstRunPropSetInfo->hasPropertyByName("CharHeight") ) + { + fFirstCharHeight = xFirstRunPropSet->getPropertyValue("CharHeight").get(); + rnCharHeight = 100 * fFirstCharHeight; + rbOverridingCharHeight = true; + } + WriteParagraphProperties(rParagraph, rXShapePropSet, fFirstCharHeight, XML_pPr); + bPropertiesWritten = true; + } + WriteRun( run, rbOverridingCharHeight, rnCharHeight, rXShapePropSet); + } + } + Reference< XPropertySet > rXPropSet( rParagraph, UNO_QUERY ); + sal_Int16 nDummy = -1; + WriteRunProperties(rXPropSet, false, XML_endParaRPr, false, rbOverridingCharHeight, + rnCharHeight, nDummy, rXShapePropSet); + + mpFS->endElementNS( XML_a, XML_p ); +} + +bool DrawingML::IsFontworkShape(const css::uno::Reference& rXShapePropSet) +{ + bool bResult(false); + if (rXShapePropSet.is()) + { + Sequence aCustomShapeGeometryProps; + if (GetProperty(rXShapePropSet, "CustomShapeGeometry")) + { + mAny >>= aCustomShapeGeometryProps; + uno::Sequence aTextPathSeq; + for (const auto& rProp : std::as_const(aCustomShapeGeometryProps)) + { + if (rProp.Name == "TextPath") + { + rProp.Value >>= aTextPathSeq; + for (const auto& rTextPathItem : std::as_const(aTextPathSeq)) + { + if (rTextPathItem.Name == "TextPath") + { + rTextPathItem.Value >>= bResult; + break; + } + } + break; + } + } + } + } + return bResult; +} + +void DrawingML::WriteText(const Reference& rXIface, bool bBodyPr, bool bText, + sal_Int32 nXmlNamespace, bool bWritePropertiesAsLstStyles) +{ + // ToDo: Fontwork in DOCX + uno::Reference xXText(rXIface, UNO_QUERY); + if( !xXText.is() ) + return; + + uno::Reference xShape(rXIface, UNO_QUERY); + uno::Reference rXPropSet(rXIface, UNO_QUERY); + + sal_Int32 nTextPreRotateAngle = 0; + double nTextRotateAngle = 0; + + constexpr const sal_Int32 constDefaultLeftRightInset = 254; + constexpr const sal_Int32 constDefaultTopBottomInset = 127; + sal_Int32 nLeft = constDefaultLeftRightInset; + sal_Int32 nRight = constDefaultLeftRightInset; + sal_Int32 nTop = constDefaultTopBottomInset; + sal_Int32 nBottom = constDefaultTopBottomInset; + + // top inset looks a bit different compared to ppt export + // check if something related doesn't work as expected + if (GetProperty(rXPropSet, "TextLeftDistance")) + mAny >>= nLeft; + if (GetProperty(rXPropSet, "TextRightDistance")) + mAny >>= nRight; + if (GetProperty(rXPropSet, "TextUpperDistance")) + mAny >>= nTop; + if (GetProperty(rXPropSet, "TextLowerDistance")) + mAny >>= nBottom; + + // Transform the text distance values so they are compatible with OOXML insets + if (xShape.is()) + { + sal_Int32 nTextHeight = xShape->getSize().Height; // Hmm, default + + // CustomShape can have text area different from shape rectangle + auto* pCustomShape + = dynamic_cast(SdrObject::getSdrObjectFromXShape(xShape)); + if (pCustomShape) + { + const EnhancedCustomShape2d aCustomShape2d(*pCustomShape); + nTextHeight = aCustomShape2d.GetTextRect().getHeight(); + if (DOCUMENT_DOCX == meDocumentType) + nTextHeight = convertTwipToMm100(nTextHeight); + } + + if (nTop + nBottom >= nTextHeight) + { + // Effective bottom would be above effective top of text area. LO normalizes the + // effective text area in such case implicitely for rendering. MS needs indents so that + // the result is the normalized effective text area. + std::swap(nTop, nBottom); + nTop = nTextHeight - nTop; + nBottom = nTextHeight - nBottom; + } + } + + TextVerticalAdjust eVerticalAlignment( TextVerticalAdjust_TOP ); + const char* sVerticalAlignment = nullptr; + if (GetProperty(rXPropSet, "TextVerticalAdjust")) + mAny >>= eVerticalAlignment; + sVerticalAlignment = GetTextVerticalAdjust(eVerticalAlignment); + + const char* sWritingMode = nullptr; + bool bVertical = false; + if (GetProperty(rXPropSet, "TextWritingMode")) + { + WritingMode eMode; + + if( ( mAny >>= eMode ) && eMode == WritingMode_TB_RL ) + { + sWritingMode = "eaVert"; + bVertical = true; + } + } + + bool bIsFontworkShape(IsFontworkShape(rXPropSet)); + Sequence aAdjustmentSeq; + uno::Sequence aTextPathSeq; + bool bScaleX(false); + OUString sShapeType("non-primitive"); + // ToDo move to InteropGrabBag + OUString sMSWordPresetTextWarp; + + if (GetProperty(rXPropSet, "CustomShapeGeometry")) + { + Sequence< PropertyValue > aProps; + if ( mAny >>= aProps ) + { + for ( const auto& rProp : std::as_const(aProps) ) + { + if ( rProp.Name == "TextPreRotateAngle" && ( rProp.Value >>= nTextPreRotateAngle ) ) + { + if ( nTextPreRotateAngle == -90 ) + { + sWritingMode = "vert"; + bVertical = true; + } + else if ( nTextPreRotateAngle == -270 ) + { + sWritingMode = "vert270"; + bVertical = true; + } + } + else if (rProp.Name == "AdjustmentValues") + rProp.Value >>= aAdjustmentSeq; + else if( rProp.Name == "TextRotateAngle" ) + rProp.Value >>= nTextRotateAngle; + else if (rProp.Name == "Type") + rProp.Value >>= sShapeType; + else if (rProp.Name == "TextPath") + { + rProp.Value >>= aTextPathSeq; + for (const auto& rTextPathItem : std::as_const(aTextPathSeq)) + { + if (rTextPathItem.Name == "ScaleX") + rTextPathItem.Value >>= bScaleX; + } + } + else if (rProp.Name == "PresetTextWarp") + rProp.Value >>= sMSWordPresetTextWarp; + } + } + } + else + { + if (mpTextExport) + { + if (xShape) + { + auto xTextFrame = mpTextExport->GetUnoTextFrame(xShape); + if (xTextFrame) + { + uno::Reference xPropSet(xTextFrame, uno::UNO_QUERY); + auto aAny = xPropSet->getPropertyValue("WritingMode"); + sal_Int16 nWritingMode; + if (aAny >>= nWritingMode) + { + switch (nWritingMode) + { + case WritingMode2::TB_RL: + sWritingMode = "vert"; + bVertical = true; + break; + case WritingMode2::BT_LR: + sWritingMode = "vert270"; + bVertical = true; + break; + default: + break; + } + } + } + } + } + } + OUString sPresetWarp(PresetGeometryTypeNames::GetMsoName(sShapeType)); + // ODF may have user defined TextPath, use "textPlain" as ersatz. + if (sPresetWarp.isEmpty()) + sPresetWarp = bIsFontworkShape ? std::u16string_view(u"textPlain") : std::u16string_view(u"textNoShape"); + + bool bFromWordArt = !bScaleX + && ( sPresetWarp == "textArchDown" || sPresetWarp == "textArchUp" + || sPresetWarp == "textButton" || sPresetWarp == "textCircle"); + + TextHorizontalAdjust eHorizontalAlignment( TextHorizontalAdjust_CENTER ); + bool bHorizontalCenter = false; + if (GetProperty(rXPropSet, "TextHorizontalAdjust")) + mAny >>= eHorizontalAlignment; + if( eHorizontalAlignment == TextHorizontalAdjust_CENTER ) + bHorizontalCenter = true; + else if( bVertical && eHorizontalAlignment == TextHorizontalAdjust_LEFT ) + sVerticalAlignment = "b"; + + bool bHasWrap = false; + bool bWrap = false; + // Only custom shapes obey the TextWordWrap option, normal text always wraps. + if (dynamic_cast(rXIface.get()) && GetProperty(rXPropSet, "TextWordWrap")) + { + mAny >>= bWrap; + bHasWrap = true; + } + + if (bBodyPr) + { + const char* pWrap = (bHasWrap && !bWrap) || bIsFontworkShape ? "none" : nullptr; + if (GetDocumentType() == DOCUMENT_DOCX) + { + // In case of DOCX, if we want to have the same effect as + // TextShape's automatic word wrapping, then we need to set + // wrapping to square. + uno::Reference xServiceInfo(rXIface, uno::UNO_QUERY); + if (xServiceInfo.is() && xServiceInfo->supportsService("com.sun.star.drawing.TextShape")) + pWrap = "square"; + } + + std::optional sHorzOverflow; + std::optional sVertOverflow; + sal_Int32 nShapeRotateAngle = rXPropSet->getPropertyValue("RotateAngle").get() / 300; + sal_Int16 nCols = 0; + sal_Int32 nColSpacing = -1; + if (GetProperty(rXPropSet, "TextColumns")) + { + if (css::uno::Reference xCols{ mAny, css::uno::UNO_QUERY }) + { + nCols = xCols->getColumnCount(); + if (css::uno::Reference xProps{ mAny, + css::uno::UNO_QUERY }) + { + if (GetProperty(xProps, "AutomaticDistance")) + mAny >>= nColSpacing; + } + } + } + + std::optional isUpright; + if (GetProperty(rXPropSet, "InteropGrabBag")) + { + if (rXPropSet->getPropertySetInfo()->hasPropertyByName("InteropGrabBag")) + { + bool bUpright = false; + sal_Int32 nOldShapeRotation = 0; + sal_Int32 nOldTextRotation = 0; + uno::Sequence aGrabBag; + rXPropSet->getPropertyValue("InteropGrabBag") >>= aGrabBag; + for (const auto& aProp : std::as_const(aGrabBag)) + { + if (aProp.Name == "Upright") + { + aProp.Value >>= bUpright; + isUpright = OString(bUpright ? "1" : "0"); + } + else if (aProp.Name == "horzOverflow") + { + OUString sValue; + aProp.Value >>= sValue; + sHorzOverflow = sValue; + } + else if (aProp.Name == "vertOverflow") + { + OUString sValue; + aProp.Value >>= sValue; + sVertOverflow = sValue; + } + } + if (bUpright) + { + for (const auto& aProp : std::as_const(aGrabBag)) + { + if (aProp.Name == "nShapeRotationAtImport") + aProp.Value >>= nOldShapeRotation; + else if (aProp.Name == "nTextRotationAtImport") + aProp.Value >>= nOldTextRotation; + } + // So our shape with the textbox in it was not rotated. + // Keep upright and make the preRotateAngle 0, it is an attribute + // of textBodyPr and must be 0 when upright is true, otherwise + // bad rotation happens in MSO. + if (nShapeRotateAngle == nOldShapeRotation && nShapeRotateAngle == nOldTextRotation) + nTextPreRotateAngle = 0; + // So we rotated the shape, in this case lose upright and do + // as LO normally does. + else + isUpright.reset(); + } + } + } + + mpFS->startElementNS( (nXmlNamespace ? nXmlNamespace : XML_a), XML_bodyPr, + XML_numCol, sax_fastparser::UseIf(OString::number(nCols), nCols > 0), + XML_spcCol, sax_fastparser::UseIf(OString::number(oox::drawingml::convertHmmToEmu(nColSpacing)), nCols > 0 && nColSpacing >= 0), + XML_wrap, pWrap, + XML_horzOverflow, sHorzOverflow, + XML_vertOverflow, sVertOverflow, + XML_fromWordArt, sax_fastparser::UseIf("1", bFromWordArt), + XML_lIns, sax_fastparser::UseIf(OString::number(oox::drawingml::convertHmmToEmu(nLeft)), nLeft != constDefaultLeftRightInset), + XML_rIns, sax_fastparser::UseIf(OString::number(oox::drawingml::convertHmmToEmu(nRight)), nRight != constDefaultLeftRightInset), + XML_tIns, sax_fastparser::UseIf(OString::number(oox::drawingml::convertHmmToEmu(nTop)), nTop != constDefaultTopBottomInset), + XML_bIns, sax_fastparser::UseIf(OString::number(oox::drawingml::convertHmmToEmu(nBottom)), nBottom != constDefaultTopBottomInset), + XML_anchor, sVerticalAlignment, + XML_anchorCtr, sax_fastparser::UseIf("1", bHorizontalCenter), + XML_vert, sWritingMode, + XML_upright, isUpright, + XML_rot, sax_fastparser::UseIf(oox::drawingml::calcRotationValue((nTextPreRotateAngle + nTextRotateAngle) * 100), (nTextPreRotateAngle + nTextRotateAngle) != 0)); + if (bIsFontworkShape) + { + if (aAdjustmentSeq.hasElements()) + { + mpFS->startElementNS(XML_a, XML_prstTxWarp, XML_prst, sPresetWarp); + mpFS->startElementNS(XML_a, XML_avLst); + bool bHasTwoHandles( + sPresetWarp == "textArchDownPour" || sPresetWarp == "textArchUpPour" + || sPresetWarp == "textButtonPour" || sPresetWarp == "textCirclePour" + || sPresetWarp == "textDoubleWave1" || sPresetWarp == "textWave1" + || sPresetWarp == "textWave2" || sPresetWarp == "textWave4"); + for (sal_Int32 i = 0, nElems = aAdjustmentSeq.getLength(); i < nElems; ++i ) + { + OString sName = "adj" + (bHasTwoHandles ? OString::number(i + 1) : OString()); + double fValue(0.0); + if (aAdjustmentSeq[i].Value.getValueTypeClass() == TypeClass_DOUBLE) + aAdjustmentSeq[i].Value >>= fValue; + else + { + sal_Int32 nNumber(0); + aAdjustmentSeq[i].Value >>= nNumber; + fValue = static_cast(nNumber); + } + // Convert from binary coordinate system with viewBox "0 0 21600 21600" and simple degree + // to DrawingML with coordinate range 0..100000 and angle in 1/60000 degree. + // Reverse to conversion in lcl_createPresetShape in drawingml/shape.cxx on import. + if (sPresetWarp == "textArchDown" || sPresetWarp == "textArchUp" + || sPresetWarp == "textButton" || sPresetWarp == "textCircle" + || ((i == 0) + && (sPresetWarp == "textArchDownPour" || sPresetWarp == "textArchUpPour" + || sPresetWarp == "textButtonPour" || sPresetWarp == "textCirclePour"))) + { + fValue *= 60000.0; + if (fValue < 0) + fValue += 21600000; + } + else if ((i == 1) + && (sPresetWarp == "textDoubleWave1" || sPresetWarp == "textWave1" + || sPresetWarp == "textWave2" || sPresetWarp == "textWave4")) + { + fValue = fValue / 0.216 - 50000.0; + } + else if ((i == 1) + && (sPresetWarp == "textArchDownPour" + || sPresetWarp == "textArchUpPour" + || sPresetWarp == "textButtonPour" + || sPresetWarp == "textCirclePour")) + { + fValue /= 0.108; + } + else + { + fValue /= 0.216; + } + OString sFmla = "val " + OString::number(std::lround(fValue)); + mpFS->singleElementNS(XML_a, XML_gd, XML_name, sName, XML_fmla, sFmla); + // There exists faulty Favorite shapes with one handle but two adjustment values. + if (!bHasTwoHandles) + break; + } + mpFS->endElementNS(XML_a, XML_avLst); + mpFS->endElementNS(XML_a, XML_prstTxWarp); + } + else + { + mpFS->singleElementNS(XML_a, XML_prstTxWarp, XML_prst, sPresetWarp); + } + } + else if (GetDocumentType() == DOCUMENT_DOCX) + { + // interim solution for fdo#80897, roundtrip DOCX > LO > DOCX + if (!sMSWordPresetTextWarp.isEmpty()) + mpFS->singleElementNS(XML_a, XML_prstTxWarp, XML_prst, sMSWordPresetTextWarp); + } + + if (GetDocumentType() == DOCUMENT_DOCX || GetDocumentType() == DOCUMENT_XLSX) + { + // tdf#112312: only custom shapes obey the TextAutoGrowHeight option + bool bTextAutoGrowHeight = false; + auto pSdrObjCustomShape = xShape.is() ? dynamic_cast(SdrObject::getSdrObjectFromXShape(xShape)) : nullptr; + if (pSdrObjCustomShape && GetProperty(rXPropSet, "TextAutoGrowHeight")) + { + mAny >>= bTextAutoGrowHeight; + } + mpFS->singleElementNS(XML_a, (bTextAutoGrowHeight ? XML_spAutoFit : XML_noAutofit)); + } + if (GetDocumentType() == DOCUMENT_PPTX) + { + TextFitToSizeType eFit = TextFitToSizeType_NONE; + if (GetProperty(rXPropSet, "TextFitToSize")) + mAny >>= eFit; + + if (eFit == TextFitToSizeType_AUTOFIT) + { + const sal_Int32 MAX_SCALE_VAL = 100000; + sal_Int32 nFontScale = MAX_SCALE_VAL; + SvxShapeText* pTextShape = dynamic_cast(rXIface.get()); + if (pTextShape) + { + SdrTextObj* pTextObject = dynamic_cast(pTextShape->GetSdrObject()); + if (pTextObject) + nFontScale = pTextObject->GetFontScaleY() * 1000; + } + + mpFS->singleElementNS(XML_a, XML_normAutofit, XML_fontScale, + sax_fastparser::UseIf(OString::number(nFontScale), nFontScale < MAX_SCALE_VAL && nFontScale > 0)); + } + else + { + // tdf#127030: Only custom shapes obey the TextAutoGrowHeight option. + bool bTextAutoGrowHeight = false; + if (dynamic_cast(rXIface.get()) && GetProperty(rXPropSet, "TextAutoGrowHeight")) + mAny >>= bTextAutoGrowHeight; + mpFS->singleElementNS(XML_a, (bTextAutoGrowHeight ? XML_spAutoFit : XML_noAutofit)); + } + } + + Write3DEffects( rXPropSet, /*bIsText=*/true ); + + mpFS->endElementNS((nXmlNamespace ? nXmlNamespace : XML_a), XML_bodyPr); + } + + Reference< XEnumerationAccess > access( xXText, UNO_QUERY ); + if( !access.is() || !bText ) + return; + + Reference< XEnumeration > enumeration( access->createEnumeration() ); + if( !enumeration.is() ) + return; + + SdrObject* pSdrObject = xShape.is() ? SdrObject::getSdrObjectFromXShape(xShape) : nullptr; + const SdrTextObj* pTxtObj = dynamic_cast( pSdrObject ); + if (pTxtObj && mpTextExport) + { + std::optional pParaObj; + + /* + #i13885# + When the object is actively being edited, that text is not set into + the objects normal text object, but lives in a separate object. + */ + if (pTxtObj->IsTextEditActive()) + { + pParaObj = pTxtObj->CreateEditOutlinerParaObject(); + } + else if (pTxtObj->GetOutlinerParaObject()) + pParaObj = *pTxtObj->GetOutlinerParaObject(); + + if (pParaObj) + { + // this is reached only in case some text is attached to the shape + mpTextExport->WriteOutliner(*pParaObj); + } + return; + } + + bool bOverridingCharHeight = false; + sal_Int32 nCharHeight = -1; + bool bFirstParagraph = true; + + // tdf#144092 For shapes without text: Export run properties (into + // endParaRPr) from the shape's propset instead of the paragraph's. + if(xXText->getString().isEmpty() && enumeration->hasMoreElements()) + { + Any aAny (enumeration->nextElement()); + Reference xParagraph; + if( aAny >>= xParagraph ) + { + mpFS->startElementNS(XML_a, XML_p); + WriteParagraphProperties(xParagraph, rXPropSet, nCharHeight, XML_pPr); + sal_Int16 nDummy = -1; + WriteRunProperties(rXPropSet, false, XML_endParaRPr, false, + bOverridingCharHeight, nCharHeight, nDummy, rXPropSet); + mpFS->endElementNS(XML_a, XML_p); + } + return; + } + + while( enumeration->hasMoreElements() ) + { + Reference< XTextContent > paragraph; + Any any ( enumeration->nextElement() ); + + if( any >>= paragraph) + { + if (bFirstParagraph && bWritePropertiesAsLstStyles) + WriteLstStyles(paragraph, bOverridingCharHeight, nCharHeight, rXPropSet); + + WriteParagraph(paragraph, bOverridingCharHeight, nCharHeight, rXPropSet); + bFirstParagraph = false; + } + } +} + +void DrawingML::WritePresetShape( const OString& pShape , std::vector< std::pair> & rAvList ) +{ + mpFS->startElementNS(XML_a, XML_prstGeom, XML_prst, pShape); + if ( !rAvList.empty() ) + { + + mpFS->startElementNS(XML_a, XML_avLst); + for (auto const& elem : rAvList) + { + OString sName = "adj" + ( ( elem.first > 0 ) ? OString::number(elem.first) : OString() ); + OString sFmla = "val " + OString::number( elem.second ); + + mpFS->singleElementNS(XML_a, XML_gd, XML_name, sName, XML_fmla, sFmla); + } + mpFS->endElementNS( XML_a, XML_avLst ); + } + else + mpFS->singleElementNS(XML_a, XML_avLst); + + mpFS->endElementNS( XML_a, XML_prstGeom ); +} + +void DrawingML::WritePresetShape( const OString& pShape ) +{ + mpFS->startElementNS(XML_a, XML_prstGeom, XML_prst, pShape); + mpFS->singleElementNS(XML_a, XML_avLst); + mpFS->endElementNS( XML_a, XML_prstGeom ); +} + +static std::map< OString, std::vector > lcl_getAdjNames() +{ + std::map< OString, std::vector > aRet; + + OUString aPath("$BRAND_BASE_DIR/" LIBO_SHARE_FOLDER "/filter/oox-drawingml-adj-names"); + rtl::Bootstrap::expandMacros(aPath); + SvFileStream aStream(aPath, StreamMode::READ); + if (aStream.GetError() != ERRCODE_NONE) + SAL_WARN("oox.shape", "failed to open oox-drawingml-adj-names"); + OStringBuffer aLine; + bool bNotDone = aStream.ReadLine(aLine); + while (bNotDone) + { + sal_Int32 nIndex = 0; + // Each line is in a "key\tvalue" format: read the key, the rest is the value. + OString aKey( o3tl::getToken(aLine, 0, '\t', nIndex) ); + OString aValue( std::string_view(aLine).substr(nIndex) ); + aRet[aKey].push_back(aValue); + bNotDone = aStream.ReadLine(aLine); + } + return aRet; +} + +void DrawingML::WritePresetShape( const OString& pShape, MSO_SPT eShapeType, bool bPredefinedHandlesUsed, const PropertyValue& rProp ) +{ + static std::map< OString, std::vector > aAdjMap = lcl_getAdjNames(); + // If there are predefined adj names for this shape type, look them up now. + std::vector aAdjustments; + if (aAdjMap.find(pShape) != aAdjMap.end()) + aAdjustments = aAdjMap[pShape]; + + mpFS->startElementNS(XML_a, XML_prstGeom, XML_prst, pShape); + mpFS->startElementNS(XML_a, XML_avLst); + + Sequence< drawing::EnhancedCustomShapeAdjustmentValue > aAdjustmentSeq; + if ( ( rProp.Value >>= aAdjustmentSeq ) + && eShapeType != mso_sptActionButtonForwardNext // we have adjustments values for these type of shape, but MSO doesn't like them + && eShapeType != mso_sptActionButtonBackPrevious // so they are now disabled + && pShape != "rect" //some shape types are commented out in pCustomShapeTypeTranslationTable[] & are being defaulted to rect & rect does not have adjustment values/name. + ) + { + SAL_INFO("oox.shape", "adj seq len: " << aAdjustmentSeq.getLength()); + sal_Int32 nAdjustmentsWhichNeedsToBeConverted = 0; + if ( bPredefinedHandlesUsed ) + EscherPropertyContainer::LookForPolarHandles( eShapeType, nAdjustmentsWhichNeedsToBeConverted ); + + sal_Int32 nValue, nLength = aAdjustmentSeq.getLength(); + // aAdjustments will give info about the number of adj values for a particular geometry. For example for hexagon aAdjustments.size() will be 2 and for circular arrow it will be 5 as per lcl_getAdjNames. + // Sometimes there are more values than needed, so we ignore the excessive ones. + if (aAdjustments.size() <= o3tl::make_unsigned(nLength)) + { + for (sal_Int32 i = 0; i < static_cast(aAdjustments.size()); i++) + { + if( EscherPropertyContainer::GetAdjustmentValue( aAdjustmentSeq[ i ], i, nAdjustmentsWhichNeedsToBeConverted, nValue ) ) + { + // If the document model doesn't have an adjustment name (e.g. shape was created from VML), then take it from the predefined list. + OString aAdjName = aAdjustmentSeq[i].Name.isEmpty() + ? aAdjustments[i] + : aAdjustmentSeq[i].Name.toUtf8(); + + mpFS->singleElementNS( XML_a, XML_gd, + XML_name, aAdjName, + XML_fmla, "val " + OString::number(nValue)); + } + } + } + } + + mpFS->endElementNS( XML_a, XML_avLst ); + mpFS->endElementNS( XML_a, XML_prstGeom ); +} + +namespace // helpers for DrawingML::WriteCustomGeometry +{ +sal_Int32 +FindNextCommandEndSubpath(const sal_Int32 nStart, + const uno::Sequence& rSegments) +{ + sal_Int32 i = nStart < 0 ? 0 : nStart; + while (i < rSegments.getLength() && rSegments[i].Command != ENDSUBPATH) + i++; + return i; +} + +bool HasCommandInSubPath(const sal_Int16 nCommand, const sal_Int32 nFirst, const sal_Int32 nLast, + const uno::Sequence& rSegments) +{ + for (sal_Int32 i = nFirst < 0 ? 0 : nFirst; i <= nLast && i < rSegments.getLength(); i++) + { + if (rSegments[i].Command == nCommand) + return true; + } + return false; +} + +// Ellipse is given by radii fwR and fhR and center (fCx|fCy). The ray from center through point RayP +// intersects the ellipse in point S and this point S has angle fAngleDeg in degrees. +void getEllipsePointAndAngleFromRayPoint(double& rfAngleDeg, double& rfSx, double& rfSy, + const double fWR, const double fHR, const double fCx, + const double fCy, const double fRayPx, const double fRayPy) +{ + if (basegfx::fTools::equalZero(fWR) || basegfx::fTools::equalZero(fHR)) + { + rfSx = fCx; // needed for getting new 'current point' + rfSy = fCy; + } + else + { + // center ellipse at origin, stretch in y-direction to circle, flip to Math orientation + // and get angle + double fCircleMathAngle = atan2(-fWR / fHR * (fRayPy - fCy), fRayPx - fCx); + // use angle for intersection point on circle and stretch back to ellipse + double fPointMathEllipse_x = fWR * cos(fCircleMathAngle); + double fPointMathEllipse_y = fHR * sin(fCircleMathAngle); + // get angle of intersection point on ellipse + double fEllipseMathAngle = atan2(fPointMathEllipse_y, fPointMathEllipse_x); + // convert from Math to View orientation and shift ellipse back from origin + rfAngleDeg = -basegfx::rad2deg(fEllipseMathAngle); + rfSx = fPointMathEllipse_x + fCx; + rfSy = -fPointMathEllipse_y + fCy; + } +} + +void getEllipsePointFromViewAngle(double& rfSx, double& rfSy, const double fWR, const double fHR, + const double fCx, const double fCy, const double fViewAngleDeg) +{ + if (basegfx::fTools::equalZero(fWR) || basegfx::fTools::equalZero(fHR)) + { + rfSx = fCx; // needed for getting new 'current point' + rfSy = fCy; + } + else + { + double fX = cos(basegfx::deg2rad(fViewAngleDeg)) / fWR; + double fY = sin(basegfx::deg2rad(fViewAngleDeg)) / fHR; + double fRadius = 1.0 / std::hypot(fX, fY); + rfSx = fCx + fRadius * cos(basegfx::deg2rad(fViewAngleDeg)); + rfSy = fCy + fRadius * sin(basegfx::deg2rad(fViewAngleDeg)); + } +} + +sal_Int32 GetCustomGeometryPointValue(const css::drawing::EnhancedCustomShapeParameter& rParam, + const EnhancedCustomShape2d& rCustomShape2d, + const bool bReplaceGeoWidth, const bool bReplaceGeoHeight) +{ + double fValue = 0.0; + rCustomShape2d.GetParameter(fValue, rParam, bReplaceGeoWidth, bReplaceGeoHeight); + sal_Int32 nValue(std::lround(fValue)); + + return nValue; +} + +struct TextAreaRect +{ + OString left; + OString top; + OString right; + OString bottom; +}; + +struct Guide +{ + OString sName; + OString sFormula; +}; + +void prepareTextArea(const EnhancedCustomShape2d& rEnhancedCustomShape2d, + std::vector& rGuideList, TextAreaRect& rTextAreaRect) +{ + tools::Rectangle aTextAreaLO(rEnhancedCustomShape2d.GetTextRect()); + tools::Rectangle aLogicRectLO(rEnhancedCustomShape2d.GetLogicRect()); + if (aTextAreaLO == aLogicRectLO) + { + rTextAreaRect.left = "l"; + rTextAreaRect.top = "t"; + rTextAreaRect.right = "r"; + rTextAreaRect.bottom = "b"; + return; + } + // Flip aTextAreaLO if shape is flipped + if (rEnhancedCustomShape2d.IsFlipHorz()) + aTextAreaLO.Move((aLogicRectLO.Center().X() - aTextAreaLO.Center().X()) * 2, 0); + if (rEnhancedCustomShape2d.IsFlipVert()) + aTextAreaLO.Move(0, (aLogicRectLO.Center().Y() - aTextAreaLO.Center().Y()) * 2); + + Guide aGuide; + // horizontal + const sal_Int32 nWidth = aLogicRectLO.Right() - aLogicRectLO.Left(); + const OString sWidth = OString::number(oox::drawingml::convertHmmToEmu(nWidth)); + + // left + aGuide.sName = "textAreaLeft"; + sal_Int32 nHelp = aTextAreaLO.Left() - aLogicRectLO.Left(); + const OString sLeft = OString::number(oox::drawingml::convertHmmToEmu(nHelp)); + aGuide.sFormula = "*/ " + sLeft + " w " + sWidth; + rTextAreaRect.left = aGuide.sName; + rGuideList.push_back(aGuide); + + // right + aGuide.sName = "textAreaRight"; + nHelp = aTextAreaLO.Right() - aLogicRectLO.Left(); + const OString sRight = OString::number(oox::drawingml::convertHmmToEmu(nHelp)); + aGuide.sFormula = "*/ " + sRight + " w " + sWidth; + rTextAreaRect.right = aGuide.sName; + rGuideList.push_back(aGuide); + + // vertical + const sal_Int32 nHeight = aLogicRectLO.Bottom() - aLogicRectLO.Top(); + const OString sHeight = OString::number(oox::drawingml::convertHmmToEmu(nHeight)); + + // top + aGuide.sName = "textAreaTop"; + nHelp = aTextAreaLO.Top() - aLogicRectLO.Top(); + const OString sTop = OString::number(oox::drawingml::convertHmmToEmu(nHelp)); + aGuide.sFormula = "*/ " + sTop + " h " + sHeight; + rTextAreaRect.top = aGuide.sName; + rGuideList.push_back(aGuide); + + // bottom + aGuide.sName = "textAreaBottom"; + nHelp = aTextAreaLO.Bottom() - aLogicRectLO.Top(); + const OString sBottom = OString::number(oox::drawingml::convertHmmToEmu(nHelp)); + aGuide.sFormula = "*/ " + sBottom + " h " + sHeight; + rTextAreaRect.bottom = aGuide.sName; + rGuideList.push_back(aGuide); + + return; +} +} + +bool DrawingML::WriteCustomGeometry( + const Reference< XShape >& rXShape, + const SdrObjCustomShape& rSdrObjCustomShape) +{ + uno::Reference< beans::XPropertySet > aXPropSet; + uno::Any aAny( rXShape->queryInterface(cppu::UnoType::get())); + + if ( ! (aAny >>= aXPropSet) ) + return false; + + try + { + aAny = aXPropSet->getPropertyValue( "CustomShapeGeometry" ); + if ( !aAny.hasValue() ) + return false; + } + catch( const ::uno::Exception& ) + { + return false; + } + + auto pGeometrySeq = o3tl::tryAccess>(aAny); + if (!pGeometrySeq) + return false; + + auto pPathProp = std::find_if(std::cbegin(*pGeometrySeq), std::cend(*pGeometrySeq), + [](const PropertyValue& rProp) { return rProp.Name == "Path"; }); + if (pPathProp == std::cend(*pGeometrySeq)) + return false; + + uno::Sequence aPathProp; + pPathProp->Value >>= aPathProp; + + uno::Sequence aPairs; + uno::Sequence aSegments; + uno::Sequence aPathSize; + bool bReplaceGeoWidth = false; + bool bReplaceGeoHeight = false; + for (const beans::PropertyValue& rPathProp : std::as_const(aPathProp)) + { + if (rPathProp.Name == "Coordinates") + rPathProp.Value >>= aPairs; + else if (rPathProp.Name == "Segments") + rPathProp.Value >>= aSegments; + else if (rPathProp.Name == "SubViewSize") + rPathProp.Value >>= aPathSize; + else if (rPathProp.Name == "StretchX") + bReplaceGeoWidth = true; + else if (rPathProp.Name == "StretchY") + bReplaceGeoHeight = true; + } + + if ( !aPairs.hasElements() ) + return false; + + if ( !aSegments.hasElements() ) + { + aSegments = uno::Sequence + { + { MOVETO, 1 }, + { LINETO, + static_cast(std::min( aPairs.getLength() - 1, sal_Int32(32767) )) }, + { CLOSESUBPATH, 0 }, + { ENDSUBPATH, 0 } + }; + }; + + int nExpectedPairCount = std::accumulate(std::cbegin(aSegments), std::cend(aSegments), 0, + [](const int nSum, const drawing::EnhancedCustomShapeSegment& rSegment) { return nSum + rSegment.Count; }); + + if ( nExpectedPairCount > aPairs.getLength() ) + { + SAL_WARN("oox.shape", "Segments need " << nExpectedPairCount << " coordinates, but Coordinates have only " << aPairs.getLength() << " pairs."); + return false; + } + + // A EnhancedCustomShape2d caches the equation results. Therefore we use only one of it for the + // entire method. + const EnhancedCustomShape2d aCustomShape2d(const_cast(rSdrObjCustomShape)); + + TextAreaRect aTextAreaRect; + std::vector aGuideList; // for now only for + prepareTextArea(aCustomShape2d, aGuideList, aTextAreaRect); + mpFS->startElementNS(XML_a, XML_custGeom); + mpFS->singleElementNS(XML_a, XML_avLst); + if (aGuideList.empty()) + { + mpFS->singleElementNS(XML_a, XML_gdLst); + } + else + { + mpFS->startElementNS(XML_a, XML_gdLst); + for (auto const& elem : aGuideList) + { + mpFS->singleElementNS(XML_a, XML_gd, XML_name, elem.sName, XML_fmla, elem.sFormula); + } + mpFS->endElementNS(XML_a, XML_gdLst); + } + mpFS->singleElementNS(XML_a, XML_ahLst); + mpFS->singleElementNS(XML_a, XML_rect, XML_l, aTextAreaRect.left, XML_t, aTextAreaRect.top, + XML_r, aTextAreaRect.right, XML_b, aTextAreaRect.bottom); + mpFS->startElementNS(XML_a, XML_pathLst); + + // Prepare width and height for + bool bUseGlobalViewBox(false); + + // nViewBoxWidth must be integer otherwise ReplaceGeoWidth in aCustomShape2d.GetParameter() is not + // triggered; same for height. + sal_Int32 nViewBoxWidth(0); + sal_Int32 nViewBoxHeight(0); + if (!aPathSize.hasElements()) + { + bUseGlobalViewBox = true; + // If draw:viewBox is missing in draw:enhancedGeometry, then import sets + // viewBox="0 0 21600 21600". Missing ViewBox can only occur, if user has manipulated + // current file via macro. Author of macro has to fix it. + auto pProp = std::find_if( + std::cbegin(*pGeometrySeq), std::cend(*pGeometrySeq), + [](const beans::PropertyValue& rGeomProp) { return rGeomProp.Name == "ViewBox"; }); + if (pProp != std::cend(*pGeometrySeq)) + { + css::awt::Rectangle aViewBox; + if (pProp->Value >>= aViewBox) + { + nViewBoxWidth = aViewBox.Width; + nViewBoxHeight = aViewBox.Height; + css::drawing::EnhancedCustomShapeParameter aECSP; + aECSP.Type = css::drawing::EnhancedCustomShapeParameterType::NORMAL; + aECSP.Value <<= nViewBoxWidth; + double fRetValue; + aCustomShape2d.GetParameter(fRetValue, aECSP, true, false); + nViewBoxWidth = basegfx::fround(fRetValue); + aECSP.Value <<= nViewBoxHeight; + aCustomShape2d.GetParameter(fRetValue, aECSP, false, true); + nViewBoxHeight = basegfx::fround(fRetValue); + } + } + // Import from oox or documents, which are imported from oox and saved to strict ODF, might + // have no subViewSize but viewBox="0 0 0 0". We need to generate width and height in those + // cases. Even if that is fixed, we need the substitute for old documents. + if ((nViewBoxWidth == 0 && nViewBoxHeight == 0) || pProp == std::cend(*pGeometrySeq)) + { + // Generate a substitute based on point coordinates + sal_Int32 nXMin(0); + aPairs[0].First.Value >>= nXMin; + sal_Int32 nXMax = nXMin; + sal_Int32 nYMin(0); + aPairs[0].Second.Value >>= nYMin; + sal_Int32 nYMax = nYMin; + + for (const auto& rPair : std::as_const(aPairs)) + { + sal_Int32 nX = GetCustomGeometryPointValue(rPair.First, aCustomShape2d, + bReplaceGeoWidth, false); + sal_Int32 nY = GetCustomGeometryPointValue(rPair.Second, aCustomShape2d, false, + bReplaceGeoHeight); + if (nX < nXMin) + nXMin = nX; + if (nY < nYMin) + nYMin = nY; + if (nX > nXMax) + nXMax = nX; + if (nY > nYMax) + nYMax = nY; + } + nViewBoxWidth = std::max(nXMax, nXMax - nXMin); + nViewBoxHeight = std::max(nYMax, nYMax - nYMin); + } + // ToDo: Other values of left,top than 0,0 are not considered yet. Such would require a + // shift of the resulting path coordinates. + } + + // Iterate over subpaths + sal_Int32 nPairIndex = 0; // index over "Coordinates" + sal_Int32 nPathSizeIndex = 0; // index over "SubViewSize" + sal_Int32 nSubpathStartIndex(0); // index over "Segments" + sal_Int32 nSubPathIndex(0); // serial number of current subpath + do + { + bool bOK(true); // catch faulty paths were commands do not correspond to points + // get index of next command ENDSUBPATH; if such doesn't exist use index behind last segment + sal_Int32 nNextNcommandIndex = FindNextCommandEndSubpath(nSubpathStartIndex, aSegments); + + // Prepare attributes for a:path start element + // NOFILL or one of the LIGHTEN commands + std::optional sFill; + if (HasCommandInSubPath(NOFILL, nSubpathStartIndex, nNextNcommandIndex - 1, aSegments)) + sFill = "none"; + else if (HasCommandInSubPath(DARKEN, nSubpathStartIndex, nNextNcommandIndex - 1, aSegments)) + sFill = "darken"; + else if (HasCommandInSubPath(DARKENLESS, nSubpathStartIndex, nNextNcommandIndex - 1, + aSegments)) + sFill = "darkenLess"; + else if (HasCommandInSubPath(LIGHTEN, nSubpathStartIndex, nNextNcommandIndex - 1, + aSegments)) + sFill = "lighten"; + else if (HasCommandInSubPath(LIGHTENLESS, nSubpathStartIndex, nNextNcommandIndex - 1, + aSegments)) + sFill = "lightenLess"; + else + { + // shading info might be in object type, e.g. "Octagon Bevel". + sal_Int32 nLuminanceChange(aCustomShape2d.GetLuminanceChange(nSubPathIndex)); + if (nLuminanceChange <= -40) + sFill = "darken"; + else if (nLuminanceChange <= -10) + sFill = "darkenLess"; + else if (nLuminanceChange >= 40) + sFill = "lighten"; + else if (nLuminanceChange >= 10) + sFill = "lightenLess"; + } + // NOSTROKE + std::optional sStroke; + if (HasCommandInSubPath(NOSTROKE, nSubpathStartIndex, nNextNcommandIndex - 1, aSegments)) + sStroke = "0"; + + // Write a:path start element + mpFS->startElementNS( + XML_a, XML_path, XML_fill, sFill, XML_stroke, sStroke, XML_w, + OString::number(bUseGlobalViewBox ? nViewBoxWidth : aPathSize[nPathSizeIndex].Width), + XML_h, + OString::number(bUseGlobalViewBox ? nViewBoxHeight : aPathSize[nPathSizeIndex].Height)); + + // Arcs drawn by commands ELLIPTICALQUADRANTX and ELLIPTICALQUADRANTY depend on the position + // of the target point in regard to the current point. Therefore we need to track the + // current point. A current point is not defined in the beginning. + double fCurrentX(0.0); + double fCurrentY(0.0); + bool bCurrentValid(false); + // Actually write the subpath + for (sal_Int32 nSegmentIndex = nSubpathStartIndex; nSegmentIndex < nNextNcommandIndex; + ++nSegmentIndex) + { + const auto& rSegment(aSegments[nSegmentIndex]); + if (rSegment.Command == CLOSESUBPATH) + { + mpFS->singleElementNS(XML_a, XML_close); // command Z has no parameter + // ODF 1.4 specifies, that the start of the subpath becomes the current point. + // But that is not implemented yet. Currently LO keeps the last current point. + } + for (sal_Int32 k = 0; k < rSegment.Count && bOK; ++k) + { + bOK = WriteCustomGeometrySegment(rSegment.Command, k, aPairs, nPairIndex, fCurrentX, + fCurrentY, bCurrentValid, aCustomShape2d, + bReplaceGeoWidth, bReplaceGeoHeight); + } + } // end loop over all commands of subpath + // finish this subpath in any case + mpFS->endElementNS(XML_a, XML_path); + + if (!bOK) + break; // exit loop if not enough values in aPairs + + // step forward to next subpath + nSubpathStartIndex = nNextNcommandIndex + 1; + nPathSizeIndex++; + nSubPathIndex++; + } while (nSubpathStartIndex < aSegments.getLength()); + + mpFS->endElementNS(XML_a, XML_pathLst); + mpFS->endElementNS(XML_a, XML_custGeom); + return true; // We have written custGeom even if path is poorly structured. +} + +bool DrawingML::WriteCustomGeometrySegment( + const sal_Int16 eCommand, const sal_Int32 nCount, + const uno::Sequence& rPairs, + sal_Int32& rnPairIndex, double& rfCurrentX, double& rfCurrentY, bool& rbCurrentValid, + const EnhancedCustomShape2d& rCustomShape2d, const bool bReplaceGeoWidth, + const bool bReplaceGeoHeight) +{ + switch (eCommand) + { + case MOVETO: + { + if (rnPairIndex >= rPairs.getLength()) + return false; + + mpFS->startElementNS(XML_a, XML_moveTo); + WriteCustomGeometryPoint(rPairs[rnPairIndex], rCustomShape2d, bReplaceGeoWidth, + bReplaceGeoHeight); + mpFS->endElementNS(XML_a, XML_moveTo); + rCustomShape2d.GetParameter(rfCurrentX, rPairs[rnPairIndex].First, bReplaceGeoWidth, + false); + rCustomShape2d.GetParameter(rfCurrentY, rPairs[rnPairIndex].Second, false, + bReplaceGeoHeight); + rbCurrentValid = true; + rnPairIndex++; + break; + } + case LINETO: + { + if (rnPairIndex >= rPairs.getLength()) + return false; + // LINETO without valid current point is a faulty path. LO is tolerant and makes a + // moveTo instead. Do the same on export. MS OFFICE requires a current point for lnTo, + // otherwise it shows nothing of the shape. + if (rbCurrentValid) + { + mpFS->startElementNS(XML_a, XML_lnTo); + WriteCustomGeometryPoint(rPairs[rnPairIndex], rCustomShape2d, bReplaceGeoWidth, + bReplaceGeoHeight); + mpFS->endElementNS(XML_a, XML_lnTo); + } + else + { + mpFS->startElementNS(XML_a, XML_moveTo); + WriteCustomGeometryPoint(rPairs[rnPairIndex], rCustomShape2d, bReplaceGeoWidth, + bReplaceGeoHeight); + mpFS->endElementNS(XML_a, XML_moveTo); + } + rCustomShape2d.GetParameter(rfCurrentX, rPairs[rnPairIndex].First, bReplaceGeoWidth, + false); + rCustomShape2d.GetParameter(rfCurrentY, rPairs[rnPairIndex].Second, false, + bReplaceGeoHeight); + rbCurrentValid = true; + rnPairIndex++; + break; + } + case CURVETO: + { + if (rnPairIndex + 2 >= rPairs.getLength()) + return false; + + mpFS->startElementNS(XML_a, XML_cubicBezTo); + for (sal_uInt8 i = 0; i <= 2; ++i) + { + WriteCustomGeometryPoint(rPairs[rnPairIndex + i], rCustomShape2d, bReplaceGeoWidth, + bReplaceGeoHeight); + } + mpFS->endElementNS(XML_a, XML_cubicBezTo); + rCustomShape2d.GetParameter(rfCurrentX, rPairs[rnPairIndex + 2].First, bReplaceGeoWidth, + false); + rCustomShape2d.GetParameter(rfCurrentY, rPairs[rnPairIndex + 2].Second, false, + bReplaceGeoHeight); + rbCurrentValid = true; + rnPairIndex += 3; + break; + } + case ANGLEELLIPSETO: + case ANGLEELLIPSE: + { + if (rnPairIndex + 2 >= rPairs.getLength()) + return false; + + // Read parameters + double fCx = 0.0; + rCustomShape2d.GetParameter(fCx, rPairs[rnPairIndex].First, bReplaceGeoWidth, false); + double fCy = 0.0; + rCustomShape2d.GetParameter(fCy, rPairs[rnPairIndex].Second, false, bReplaceGeoHeight); + double fWR = 0.0; + rCustomShape2d.GetParameter(fWR, rPairs[rnPairIndex + 1].First, false, false); + double fHR = 0.0; + rCustomShape2d.GetParameter(fHR, rPairs[rnPairIndex + 1].Second, false, false); + double fStartAngle = 0.0; + rCustomShape2d.GetParameter(fStartAngle, rPairs[rnPairIndex + 2].First, false, false); + double fEndAngle = 0.0; + rCustomShape2d.GetParameter(fEndAngle, rPairs[rnPairIndex + 2].Second, false, false); + + // Prepare start and swing angle + sal_Int32 nStartAng(std::lround(fStartAngle * 60000)); + sal_Int32 nSwingAng = 0; + if (basegfx::fTools::equalZero(fStartAngle) + && basegfx::fTools::equalZero(fEndAngle - 360.0)) + nSwingAng = 360 * 60000; // special case full circle + else + { + nSwingAng = std::lround((fEndAngle - fStartAngle) * 60000); + if (nSwingAng < 0) + nSwingAng += 360 * 60000; + } + + // calculate start point on ellipse + double fSx = 0.0; + double fSy = 0.0; + getEllipsePointFromViewAngle(fSx, fSy, fWR, fHR, fCx, fCy, fStartAngle); + + // write markup for going to start point + // lnTo requires a valid current point + if (eCommand == ANGLEELLIPSETO && rbCurrentValid) + { + mpFS->startElementNS(XML_a, XML_lnTo); + mpFS->singleElementNS(XML_a, XML_pt, XML_x, OString::number(std::lround(fSx)), + XML_y, OString::number(std::lround(fSy))); + mpFS->endElementNS(XML_a, XML_lnTo); + } + else + { + mpFS->startElementNS(XML_a, XML_moveTo); + mpFS->singleElementNS(XML_a, XML_pt, XML_x, OString::number(std::lround(fSx)), + XML_y, OString::number(std::lround(fSy))); + mpFS->endElementNS(XML_a, XML_moveTo); + } + // write markup for arcTo + if (!basegfx::fTools::equalZero(fWR) && !basegfx::fTools::equalZero(fHR)) + mpFS->singleElement( + FSNS(XML_a, XML_arcTo), XML_wR, OString::number(std::lround(fWR)), XML_hR, + OString::number(std::lround(fHR)), XML_stAng, OString::number(nStartAng), + XML_swAng, OString::number(nSwingAng)); + + getEllipsePointFromViewAngle(rfCurrentX, rfCurrentY, fWR, fHR, fCx, fCy, fEndAngle); + rbCurrentValid = true; + rnPairIndex += 3; + break; + } + case ARCTO: + case ARC: + case CLOCKWISEARCTO: + case CLOCKWISEARC: + { + if (rnPairIndex + 3 >= rPairs.getLength()) + return false; + + // read parameters + double fX1 = 0.0; + rCustomShape2d.GetParameter(fX1, rPairs[rnPairIndex].First, bReplaceGeoWidth, false); + double fY1 = 0.0; + rCustomShape2d.GetParameter(fY1, rPairs[rnPairIndex].Second, false, bReplaceGeoHeight); + double fX2 = 0.0; + rCustomShape2d.GetParameter(fX2, rPairs[rnPairIndex + 1].First, bReplaceGeoWidth, + false); + double fY2 = 0.0; + rCustomShape2d.GetParameter(fY2, rPairs[rnPairIndex + 1].Second, false, + bReplaceGeoHeight); + double fX3 = 0.0; + rCustomShape2d.GetParameter(fX3, rPairs[rnPairIndex + 2].First, bReplaceGeoWidth, + false); + double fY3 = 0.0; + rCustomShape2d.GetParameter(fY3, rPairs[rnPairIndex + 2].Second, false, + bReplaceGeoHeight); + double fX4 = 0.0; + rCustomShape2d.GetParameter(fX4, rPairs[rnPairIndex + 3].First, bReplaceGeoWidth, + false); + double fY4 = 0.0; + rCustomShape2d.GetParameter(fY4, rPairs[rnPairIndex + 3].Second, false, + bReplaceGeoHeight); + // calculate ellipse parameter + const double fWR = (fX2 - fX1) / 2.0; + const double fHR = (fY2 - fY1) / 2.0; + const double fCx = (fX1 + fX2) / 2.0; + const double fCy = (fY1 + fY2) / 2.0; + // calculate start angle + double fStartAngle = 0.0; + double fPx = 0.0; + double fPy = 0.0; + getEllipsePointAndAngleFromRayPoint(fStartAngle, fPx, fPy, fWR, fHR, fCx, fCy, fX3, + fY3); + // markup for going to start point + // lnTo requires a valid current point. + if ((eCommand == ARCTO || eCommand == CLOCKWISEARCTO) && rbCurrentValid) + { + mpFS->startElementNS(XML_a, XML_lnTo); + mpFS->singleElementNS(XML_a, XML_pt, XML_x, OString::number(std::lround(fPx)), + XML_y, OString::number(std::lround(fPy))); + mpFS->endElementNS(XML_a, XML_lnTo); + } + else + { + mpFS->startElementNS(XML_a, XML_moveTo); + mpFS->singleElementNS(XML_a, XML_pt, XML_x, OString::number(std::lround(fPx)), + XML_y, OString::number(std::lround(fPy))); + mpFS->endElementNS(XML_a, XML_moveTo); + } + // calculate swing angle + double fEndAngle = 0.0; + getEllipsePointAndAngleFromRayPoint(fEndAngle, fPx, fPy, fWR, fHR, fCx, fCy, fX4, fY4); + double fSwingAngle(fEndAngle - fStartAngle); + const bool bIsClockwise(eCommand == CLOCKWISEARCTO || eCommand == CLOCKWISEARC); + if (bIsClockwise && fSwingAngle < 0) + fSwingAngle += 360.0; + else if (!bIsClockwise && fSwingAngle > 0) + fSwingAngle -= 360.0; + // markup for arcTo + // ToDo: write markup for case zero width or height of ellipse + const sal_Int32 nStartAng(std::lround(fStartAngle * 60000)); + const sal_Int32 nSwingAng(std::lround(fSwingAngle * 60000)); + mpFS->singleElement(FSNS(XML_a, XML_arcTo), XML_wR, OString::number(std::lround(fWR)), + XML_hR, OString::number(std::lround(fHR)), XML_stAng, + OString::number(nStartAng), XML_swAng, OString::number(nSwingAng)); + rfCurrentX = fPx; + rfCurrentY = fPy; + rbCurrentValid = true; + rnPairIndex += 4; + break; + } + case ELLIPTICALQUADRANTX: + case ELLIPTICALQUADRANTY: + { + if (rnPairIndex >= rPairs.getLength()) + return false; + + // read parameters + double fX = 0.0; + rCustomShape2d.GetParameter(fX, rPairs[rnPairIndex].First, bReplaceGeoWidth, false); + double fY = 0.0; + rCustomShape2d.GetParameter(fY, rPairs[rnPairIndex].Second, false, bReplaceGeoHeight); + + // Prepare parameters for arcTo + if (rbCurrentValid) + { + double fWR = std::abs(rfCurrentX - fX); + double fHR = std::abs(rfCurrentY - fY); + double fStartAngle(0.0); + double fSwingAngle(0.0); + // The starting direction of the arc toggles between X and Y + if ((eCommand == ELLIPTICALQUADRANTX && !(nCount % 2)) + || (eCommand == ELLIPTICALQUADRANTY && (nCount % 2))) + { + // arc starts horizontal + fStartAngle = fY < rfCurrentY ? 90.0 : 270.0; + const bool bClockwise = (fX < rfCurrentX && fY < rfCurrentY) + || (fX > rfCurrentX && fY > rfCurrentY); + fSwingAngle = bClockwise ? 90.0 : -90.0; + } + else + { + // arc starts vertical + fStartAngle = fX < rfCurrentX ? 0.0 : 180.0; + const bool bClockwise = (fX < rfCurrentX && fY > rfCurrentY) + || (fX > rfCurrentX && fY < rfCurrentY); + fSwingAngle = bClockwise ? 90.0 : -90.0; + } + sal_Int32 nStartAng(std::lround(fStartAngle * 60000)); + sal_Int32 nSwingAng(std::lround(fSwingAngle * 60000)); + mpFS->singleElement( + FSNS(XML_a, XML_arcTo), XML_wR, OString::number(std::lround(fWR)), XML_hR, + OString::number(std::lround(fHR)), XML_stAng, OString::number(nStartAng), + XML_swAng, OString::number(nSwingAng)); + } + else + { + // faulty path, but we continue with the target point + mpFS->startElementNS(XML_a, XML_moveTo); + WriteCustomGeometryPoint(rPairs[rnPairIndex], rCustomShape2d, bReplaceGeoWidth, + bReplaceGeoHeight); + mpFS->endElementNS(XML_a, XML_moveTo); + } + rfCurrentX = fX; + rfCurrentY = fY; + rbCurrentValid = true; + rnPairIndex++; + break; + } + case QUADRATICCURVETO: + { + if (rnPairIndex + 1 >= rPairs.getLength()) + return false; + + mpFS->startElementNS(XML_a, XML_quadBezTo); + for (sal_uInt8 i = 0; i < 2; ++i) + { + WriteCustomGeometryPoint(rPairs[rnPairIndex + i], rCustomShape2d, bReplaceGeoWidth, + bReplaceGeoHeight); + } + mpFS->endElementNS(XML_a, XML_quadBezTo); + rCustomShape2d.GetParameter(rfCurrentX, rPairs[rnPairIndex + 1].First, bReplaceGeoWidth, + false); + rCustomShape2d.GetParameter(rfCurrentY, rPairs[rnPairIndex + 1].Second, false, + bReplaceGeoHeight); + rbCurrentValid = true; + rnPairIndex += 2; + break; + } + case ARCANGLETO: + { + if (rnPairIndex + 1 >= rPairs.getLength()) + return false; + + double fWR = 0.0; + rCustomShape2d.GetParameter(fWR, rPairs[rnPairIndex].First, false, false); + double fHR = 0.0; + rCustomShape2d.GetParameter(fHR, rPairs[rnPairIndex].Second, false, false); + double fStartAngle = 0.0; + rCustomShape2d.GetParameter(fStartAngle, rPairs[rnPairIndex + 1].First, false, false); + sal_Int32 nStartAng(std::lround(fStartAngle * 60000)); + double fSwingAng = 0.0; + rCustomShape2d.GetParameter(fSwingAng, rPairs[rnPairIndex + 1].Second, false, false); + sal_Int32 nSwingAng(std::lround(fSwingAng * 60000)); + mpFS->singleElement(FSNS(XML_a, XML_arcTo), XML_wR, OString::number(fWR), XML_hR, + OString::number(fHR), XML_stAng, OString::number(nStartAng), + XML_swAng, OString::number(nSwingAng)); + double fPx = 0.0; + double fPy = 0.0; + getEllipsePointFromViewAngle(fPx, fPy, fWR, fHR, 0.0, 0.0, fStartAngle); + double fCx = rfCurrentX - fPx; + double fCy = rfCurrentY - fPy; + getEllipsePointFromViewAngle(rfCurrentX, rfCurrentY, fWR, fHR, fCx, fCy, + fStartAngle + fSwingAng); + rbCurrentValid = true; + rnPairIndex += 2; + break; + } + default: + // do nothing + break; + } + return true; +} + +void DrawingML::WriteCustomGeometryPoint( + const drawing::EnhancedCustomShapeParameterPair& rParamPair, + const EnhancedCustomShape2d& rCustomShape2d, const bool bReplaceGeoWidth, + const bool bReplaceGeoHeight) +{ + sal_Int32 nX + = GetCustomGeometryPointValue(rParamPair.First, rCustomShape2d, bReplaceGeoWidth, false); + sal_Int32 nY + = GetCustomGeometryPointValue(rParamPair.Second, rCustomShape2d, false, bReplaceGeoHeight); + + mpFS->singleElementNS(XML_a, XML_pt, XML_x, OString::number(nX), XML_y, OString::number(nY)); +} + +void DrawingML::WriteEmptyCustomGeometry() +{ + // This method is used for export to docx in case WriteCustomGeometry fails. + mpFS->startElementNS(XML_a, XML_custGeom); + mpFS->singleElementNS(XML_a, XML_avLst); + mpFS->singleElementNS(XML_a, XML_gdLst); + mpFS->singleElementNS(XML_a, XML_ahLst); + mpFS->singleElementNS(XML_a, XML_rect, XML_l, "0", XML_t, "0", XML_r, "r", XML_b, "b"); + mpFS->singleElementNS(XML_a, XML_pathLst); + mpFS->endElementNS(XML_a, XML_custGeom); +} + +// version for SdrPathObj +void DrawingML::WritePolyPolygon(const css::uno::Reference& rXShape, + const bool bClosed) +{ + tools::PolyPolygon aPolyPolygon = EscherPropertyContainer::GetPolyPolygon(rXShape); + // In case of Writer, the parent element is , and there the + // element is not optional. + if (aPolyPolygon.Count() < 1 && GetDocumentType() != DOCUMENT_DOCX) + return; + + mpFS->startElementNS(XML_a, XML_custGeom); + mpFS->singleElementNS(XML_a, XML_avLst); + mpFS->singleElementNS(XML_a, XML_gdLst); + mpFS->singleElementNS(XML_a, XML_ahLst); + mpFS->singleElementNS(XML_a, XML_rect, XML_l, "0", XML_t, "0", XML_r, "r", XML_b, "b"); + + mpFS->startElementNS(XML_a, XML_pathLst); + + awt::Size aSize = rXShape->getSize(); + awt::Point aPos = rXShape->getPosition(); + Reference xPropertySet(rXShape, UNO_QUERY); + uno::Reference xPropertySetInfo = xPropertySet->getPropertySetInfo(); + if (xPropertySetInfo->hasPropertyByName("AnchorPosition")) + { + awt::Point aAnchorPosition; + xPropertySet->getPropertyValue("AnchorPosition") >>= aAnchorPosition; + aPos.X += aAnchorPosition.X; + aPos.Y += aAnchorPosition.Y; + } + + // Only closed SdrPathObj can be filled + std::optional sFill; + if (!bClosed) + sFill = "none"; // for possible values see ST_PathFillMode in OOXML standard + + // Put all polygons of rPolyPolygon in the same path element + // to subtract the overlapped areas. + mpFS->startElementNS(XML_a, XML_path, XML_fill, sFill, XML_w, OString::number(aSize.Width), + XML_h, OString::number(aSize.Height)); + + for (sal_uInt16 i = 0; i < aPolyPolygon.Count(); i++) + { + const tools::Polygon& aPoly = aPolyPolygon[i]; + + if (aPoly.GetSize() > 0) + { + mpFS->startElementNS(XML_a, XML_moveTo); + + mpFS->singleElementNS(XML_a, XML_pt, XML_x, OString::number(aPoly[0].X() - aPos.X), + XML_y, OString::number(aPoly[0].Y() - aPos.Y)); + + mpFS->endElementNS(XML_a, XML_moveTo); + } + + for (sal_uInt16 j = 1; j < aPoly.GetSize(); j++) + { + PolyFlags flags = aPoly.GetFlags(j); + if (flags == PolyFlags::Control) + { + // a:cubicBezTo can only contain 3 a:pt elements, so we need to make sure of this + if (j + 2 < aPoly.GetSize() && aPoly.GetFlags(j + 1) == PolyFlags::Control + && aPoly.GetFlags(j + 2) != PolyFlags::Control) + { + mpFS->startElementNS(XML_a, XML_cubicBezTo); + for (sal_uInt8 k = 0; k <= 2; ++k) + { + mpFS->singleElementNS(XML_a, XML_pt, XML_x, + OString::number(aPoly[j + k].X() - aPos.X), XML_y, + OString::number(aPoly[j + k].Y() - aPos.Y)); + } + mpFS->endElementNS(XML_a, XML_cubicBezTo); + j += 2; + } + } + else if (flags == PolyFlags::Normal) + { + mpFS->startElementNS(XML_a, XML_lnTo); + mpFS->singleElementNS(XML_a, XML_pt, XML_x, OString::number(aPoly[j].X() - aPos.X), + XML_y, OString::number(aPoly[j].Y() - aPos.Y)); + mpFS->endElementNS(XML_a, XML_lnTo); + } + } + } + if (bClosed) + mpFS->singleElementNS(XML_a, XML_close); + mpFS->endElementNS(XML_a, XML_path); + + mpFS->endElementNS(XML_a, XML_pathLst); + + mpFS->endElementNS(XML_a, XML_custGeom); +} + +void DrawingML::WriteConnectorConnections( sal_uInt32 nStartGlueId, sal_Int32 nEndGlueId, sal_Int32 nStartID, sal_Int32 nEndID ) +{ + if( nStartID != -1 ) + { + mpFS->singleElementNS( XML_a, XML_stCxn, + XML_id, OString::number(nStartID), + XML_idx, OString::number(nStartGlueId) ); + } + if( nEndID != -1 ) + { + mpFS->singleElementNS( XML_a, XML_endCxn, + XML_id, OString::number(nEndID), + XML_idx, OString::number(nEndGlueId) ); + } +} + +sal_Unicode DrawingML::SubstituteBullet( sal_Unicode cBulletId, css::awt::FontDescriptor& rFontDesc ) +{ + if ( IsStarSymbol(rFontDesc.Name) ) + { + rtl_TextEncoding eCharSet = rFontDesc.CharSet; + cBulletId = msfilter::util::bestFitOpenSymbolToMSFont(cBulletId, eCharSet, rFontDesc.Name); + rFontDesc.CharSet = eCharSet; + } + + return cBulletId; +} + +sax_fastparser::FSHelperPtr DrawingML::CreateOutputStream ( + const OUString& sFullStream, + std::u16string_view sRelativeStream, + const Reference< XOutputStream >& xParentRelation, + const char* sContentType, + const char* sRelationshipType, + OUString* pRelationshipId ) +{ + OUString sRelationshipId; + if (xParentRelation.is()) + sRelationshipId = GetFB()->addRelation( xParentRelation, OUString::createFromAscii( sRelationshipType), sRelativeStream ); + else + sRelationshipId = GetFB()->addRelation( OUString::createFromAscii( sRelationshipType ), sRelativeStream ); + + if( pRelationshipId ) + *pRelationshipId = sRelationshipId; + + sax_fastparser::FSHelperPtr p = GetFB()->openFragmentStreamWithSerializer( sFullStream, OUString::createFromAscii( sContentType ) ); + + return p; +} + +void DrawingML::WriteFill( const Reference< XPropertySet >& xPropSet ) +{ + if ( !GetProperty( xPropSet, "FillStyle" ) ) + return; + FillStyle aFillStyle( FillStyle_NONE ); + xPropSet->getPropertyValue( "FillStyle" ) >>= aFillStyle; + + // map full transparent background to no fill + if ( aFillStyle == FillStyle_SOLID && GetProperty( xPropSet, "FillTransparence" ) ) + { + sal_Int16 nVal = 0; + xPropSet->getPropertyValue( "FillTransparence" ) >>= nVal; + if ( nVal == 100 ) + aFillStyle = FillStyle_NONE; + } + if (aFillStyle == FillStyle_SOLID && GetProperty( xPropSet, "FillTransparenceGradient")) + { + awt::Gradient aTransparenceGradient; + mAny >>= aTransparenceGradient; + if (aTransparenceGradient.StartColor == 0xffffff && aTransparenceGradient.EndColor == 0xffffff) + aFillStyle = FillStyle_NONE; + } + + bool bUseBackground(false); + if (GetProperty(xPropSet, "FillUseSlideBackground")) + xPropSet->getPropertyValue("FillUseSlideBackground") >>= bUseBackground; + + switch( aFillStyle ) + { + case FillStyle_SOLID : + WriteSolidFill( xPropSet ); + break; + case FillStyle_GRADIENT : + WriteGradientFill( xPropSet ); + break; + case FillStyle_BITMAP : + WriteBlipFill( xPropSet, "FillBitmap" ); + break; + case FillStyle_HATCH : + WritePattFill( xPropSet ); + break; + case FillStyle_NONE: + if (!bUseBackground) // attribute `useBgFill` will be written at parent p:sp shape + mpFS->singleElementNS(XML_a, XML_noFill); + break; + default: + ; + } +} + +void DrawingML::WriteStyleProperties( sal_Int32 nTokenId, const Sequence< PropertyValue >& aProperties ) +{ + if( aProperties.hasElements() ) + { + OUString sSchemeClr; + sal_uInt32 nIdx = 0; + Sequence< PropertyValue > aTransformations; + for( const auto& rProp : aProperties) + { + if( rProp.Name == "SchemeClr" ) + rProp.Value >>= sSchemeClr; + else if( rProp.Name == "Idx" ) + rProp.Value >>= nIdx; + else if( rProp.Name == "Transformations" ) + rProp.Value >>= aTransformations; + } + mpFS->startElementNS(XML_a, nTokenId, XML_idx, OString::number(nIdx)); + WriteColor(sSchemeClr, aTransformations); + mpFS->endElementNS( XML_a, nTokenId ); + } + else + { + // write mock tag + mpFS->singleElementNS(XML_a, nTokenId, XML_idx, OString::number(0)); + } +} + +void DrawingML::WriteShapeStyle( const Reference< XPropertySet >& xPropSet ) +{ + // check existence of the grab bag + if ( !GetProperty( xPropSet, "InteropGrabBag" ) ) + return; + + // extract the relevant properties from the grab bag + Sequence< PropertyValue > aGrabBag; + Sequence< PropertyValue > aFillRefProperties, aLnRefProperties, aEffectRefProperties; + mAny >>= aGrabBag; + for( const auto& rProp : std::as_const(aGrabBag)) + { + if( rProp.Name == "StyleFillRef" ) + rProp.Value >>= aFillRefProperties; + else if( rProp.Name == "StyleLnRef" ) + rProp.Value >>= aLnRefProperties; + else if( rProp.Name == "StyleEffectRef" ) + rProp.Value >>= aEffectRefProperties; + } + + WriteStyleProperties( XML_lnRef, aLnRefProperties ); + WriteStyleProperties( XML_fillRef, aFillRefProperties ); + WriteStyleProperties( XML_effectRef, aEffectRefProperties ); + + // write mock + mpFS->singleElementNS(XML_a, XML_fontRef, XML_idx, "minor"); +} + +void DrawingML::WriteShapeEffect( std::u16string_view sName, const Sequence< PropertyValue >& aEffectProps ) +{ + if( !aEffectProps.hasElements() ) + return; + + // assign the proper tag and enable bContainsColor if necessary + sal_Int32 nEffectToken = 0; + bool bContainsColor = false; + if( sName == u"outerShdw" ) + { + nEffectToken = FSNS( XML_a, XML_outerShdw ); + bContainsColor = true; + } + else if( sName == u"innerShdw" ) + { + nEffectToken = FSNS( XML_a, XML_innerShdw ); + bContainsColor = true; + } + else if( sName == u"glow" ) + { + nEffectToken = FSNS( XML_a, XML_glow ); + bContainsColor = true; + } + else if( sName == u"softEdge" ) + nEffectToken = FSNS( XML_a, XML_softEdge ); + else if( sName == u"reflection" ) + nEffectToken = FSNS( XML_a, XML_reflection ); + else if( sName == u"blur" ) + nEffectToken = FSNS( XML_a, XML_blur ); + + OUString sSchemeClr; + ::Color nRgbClr; + sal_Int32 nAlpha = MAX_PERCENT; + Sequence< PropertyValue > aTransformations; + rtl::Reference aOuterShdwAttrList = FastSerializerHelper::createAttrList(); + for( const auto& rEffectProp : aEffectProps ) + { + if( rEffectProp.Name == "Attribs" ) + { + // read tag attributes + uno::Sequence< beans::PropertyValue > aOuterShdwProps; + rEffectProp.Value >>= aOuterShdwProps; + for( const auto& rOuterShdwProp : std::as_const(aOuterShdwProps) ) + { + if( rOuterShdwProp.Name == "algn" ) + { + OUString sVal; + rOuterShdwProp.Value >>= sVal; + aOuterShdwAttrList->add( XML_algn, sVal ); + } + else if( rOuterShdwProp.Name == "blurRad" ) + { + sal_Int64 nVal = 0; + rOuterShdwProp.Value >>= nVal; + aOuterShdwAttrList->add( XML_blurRad, OString::number( nVal ).getStr() ); + } + else if( rOuterShdwProp.Name == "dir" ) + { + sal_Int32 nVal = 0; + rOuterShdwProp.Value >>= nVal; + aOuterShdwAttrList->add( XML_dir, OString::number( nVal ).getStr() ); + } + else if( rOuterShdwProp.Name == "dist" ) + { + sal_Int32 nVal = 0; + rOuterShdwProp.Value >>= nVal; + aOuterShdwAttrList->add( XML_dist, OString::number( nVal ).getStr() ); + } + else if( rOuterShdwProp.Name == "kx" ) + { + sal_Int32 nVal = 0; + rOuterShdwProp.Value >>= nVal; + aOuterShdwAttrList->add( XML_kx, OString::number( nVal ).getStr() ); + } + else if( rOuterShdwProp.Name == "ky" ) + { + sal_Int32 nVal = 0; + rOuterShdwProp.Value >>= nVal; + aOuterShdwAttrList->add( XML_ky, OString::number( nVal ).getStr() ); + } + else if( rOuterShdwProp.Name == "rotWithShape" ) + { + sal_Int32 nVal = 0; + rOuterShdwProp.Value >>= nVal; + aOuterShdwAttrList->add( XML_rotWithShape, OString::number( nVal ).getStr() ); + } + else if( rOuterShdwProp.Name == "sx" ) + { + sal_Int32 nVal = 0; + rOuterShdwProp.Value >>= nVal; + aOuterShdwAttrList->add( XML_sx, OString::number( nVal ).getStr() ); + } + else if( rOuterShdwProp.Name == "sy" ) + { + sal_Int32 nVal = 0; + rOuterShdwProp.Value >>= nVal; + aOuterShdwAttrList->add( XML_sy, OString::number( nVal ).getStr() ); + } + else if( rOuterShdwProp.Name == "rad" ) + { + sal_Int64 nVal = 0; + rOuterShdwProp.Value >>= nVal; + aOuterShdwAttrList->add( XML_rad, OString::number( nVal ).getStr() ); + } + else if( rOuterShdwProp.Name == "endA" ) + { + sal_Int32 nVal = 0; + rOuterShdwProp.Value >>= nVal; + aOuterShdwAttrList->add( XML_endA, OString::number( nVal ).getStr() ); + } + else if( rOuterShdwProp.Name == "endPos" ) + { + sal_Int32 nVal = 0; + rOuterShdwProp.Value >>= nVal; + aOuterShdwAttrList->add( XML_endPos, OString::number( nVal ).getStr() ); + } + else if( rOuterShdwProp.Name == "fadeDir" ) + { + sal_Int32 nVal = 0; + rOuterShdwProp.Value >>= nVal; + aOuterShdwAttrList->add( XML_fadeDir, OString::number( nVal ).getStr() ); + } + else if( rOuterShdwProp.Name == "stA" ) + { + sal_Int32 nVal = 0; + rOuterShdwProp.Value >>= nVal; + aOuterShdwAttrList->add( XML_stA, OString::number( nVal ).getStr() ); + } + else if( rOuterShdwProp.Name == "stPos" ) + { + sal_Int32 nVal = 0; + rOuterShdwProp.Value >>= nVal; + aOuterShdwAttrList->add( XML_stPos, OString::number( nVal ).getStr() ); + } + else if( rOuterShdwProp.Name == "grow" ) + { + sal_Int32 nVal = 0; + rOuterShdwProp.Value >>= nVal; + aOuterShdwAttrList->add( XML_grow, OString::number( nVal ).getStr() ); + } + } + } + else if(rEffectProp.Name == "RgbClr") + { + rEffectProp.Value >>= nRgbClr; + } + else if(rEffectProp.Name == "RgbClrTransparency") + { + sal_Int32 nTransparency; + if (rEffectProp.Value >>= nTransparency) + // Calculate alpha value (see oox/source/drawingml/color.cxx : getTransparency()) + nAlpha = MAX_PERCENT - ( PER_PERCENT * nTransparency ); + } + else if(rEffectProp.Name == "SchemeClr") + { + rEffectProp.Value >>= sSchemeClr; + } + else if(rEffectProp.Name == "SchemeClrTransformations") + { + rEffectProp.Value >>= aTransformations; + } + } + + if( nEffectToken <= 0 ) + return; + + mpFS->startElement( nEffectToken, aOuterShdwAttrList ); + + if( bContainsColor ) + { + if( sSchemeClr.isEmpty() ) + WriteColor( nRgbClr, nAlpha ); + else + WriteColor( sSchemeClr, aTransformations ); + } + + mpFS->endElement( nEffectToken ); +} + +static sal_Int32 lcl_CalculateDist(const double dX, const double dY) +{ + return static_cast< sal_Int32 >(sqrt(dX*dX + dY*dY) * 360); +} + +static sal_Int32 lcl_CalculateDir(const double dX, const double dY) +{ + return (static_cast< sal_Int32 >(basegfx::rad2deg<60000>(atan2(dY,dX))) + 21600000) % 21600000; +} + +void DrawingML::WriteShapeEffects( const Reference< XPropertySet >& rXPropSet ) +{ + Sequence< PropertyValue > aGrabBag, aEffects, aOuterShdwProps; + bool bHasInteropGrabBag = rXPropSet->getPropertySetInfo()->hasPropertyByName("InteropGrabBag"); + if (bHasInteropGrabBag && GetProperty(rXPropSet, "InteropGrabBag")) + { + mAny >>= aGrabBag; + auto pProp = std::find_if(std::cbegin(aGrabBag), std::cend(aGrabBag), + [](const PropertyValue& rProp) { return rProp.Name == "EffectProperties"; }); + if (pProp != std::cend(aGrabBag)) + { + pProp->Value >>= aEffects; + auto pEffect = std::find_if(std::cbegin(aEffects), std::cend(aEffects), + [](const PropertyValue& rEffect) { return rEffect.Name == "outerShdw"; }); + if (pEffect != std::cend(aEffects)) + pEffect->Value >>= aOuterShdwProps; + } + } + + // tdf#132201: the order of effects is important. Effects order (CT_EffectList in ECMA-376): + // blur -> fillOverlay -> glow -> innerShdw -> outerShdw -> prstShdw -> reflection -> softEdge + + if( !aEffects.hasElements() ) + { + bool bHasShadow = false; + if( GetProperty( rXPropSet, "Shadow" ) ) + mAny >>= bHasShadow; + bool bHasEffects = bHasShadow; + if (!bHasEffects && GetProperty(rXPropSet, "GlowEffectRadius")) + { + sal_Int32 rad = 0; + mAny >>= rad; + bHasEffects = rad > 0; + } + if (!bHasEffects && GetProperty(rXPropSet, "SoftEdgeRadius")) + { + sal_Int32 rad = 0; + mAny >>= rad; + bHasEffects = rad > 0; + } + + if (bHasEffects) + { + mpFS->startElementNS(XML_a, XML_effectLst); + WriteGlowEffect(rXPropSet); + if( bHasShadow ) + { + double dX = +0.0, dY = +0.0; + sal_Int32 nBlur =0; + rXPropSet->getPropertyValue( "ShadowXDistance" ) >>= dX; + rXPropSet->getPropertyValue( "ShadowYDistance" ) >>= dY; + rXPropSet->getPropertyValue( "ShadowBlur" ) >>= nBlur; + + Sequence< PropertyValue > aShadowAttribsGrabBag{ + comphelper::makePropertyValue("dist", lcl_CalculateDist(dX, dY)), + comphelper::makePropertyValue("dir", lcl_CalculateDir(dX, dY)), + comphelper::makePropertyValue("blurRad", oox::drawingml::convertHmmToEmu(nBlur)), + comphelper::makePropertyValue("rotWithShape", false) //ooxml default is 'true', so must write it + }; + + Sequence< PropertyValue > aShadowGrabBag{ + comphelper::makePropertyValue("Attribs", aShadowAttribsGrabBag), + comphelper::makePropertyValue("RgbClr", rXPropSet->getPropertyValue( "ShadowColor" )), + comphelper::makePropertyValue("RgbClrTransparency", rXPropSet->getPropertyValue( "ShadowTransparence" )) + }; + + WriteShapeEffect( u"outerShdw", aShadowGrabBag ); + } + WriteSoftEdgeEffect(rXPropSet); + mpFS->endElementNS(XML_a, XML_effectLst); + } + } + else + { + for( auto& rOuterShdwProp : asNonConstRange(aOuterShdwProps) ) + { + if( rOuterShdwProp.Name == "Attribs" ) + { + Sequence< PropertyValue > aAttribsProps; + rOuterShdwProp.Value >>= aAttribsProps; + + double dX = +0.0, dY = +0.0; + sal_Int32 nBlur =0; + rXPropSet->getPropertyValue( "ShadowXDistance" ) >>= dX; + rXPropSet->getPropertyValue( "ShadowYDistance" ) >>= dY; + rXPropSet->getPropertyValue( "ShadowBlur" ) >>= nBlur; + + + for( auto& rAttribsProp : asNonConstRange(aAttribsProps) ) + { + if( rAttribsProp.Name == "dist" ) + { + rAttribsProp.Value <<= lcl_CalculateDist(dX, dY); + } + else if( rAttribsProp.Name == "dir" ) + { + rAttribsProp.Value <<= lcl_CalculateDir(dX, dY); + } + else if( rAttribsProp.Name == "blurRad" ) + { + rAttribsProp.Value <<= oox::drawingml::convertHmmToEmu(nBlur); + } + } + + rOuterShdwProp.Value <<= aAttribsProps; + } + else if( rOuterShdwProp.Name == "RgbClr" ) + { + rOuterShdwProp.Value = rXPropSet->getPropertyValue( "ShadowColor" ); + } + else if( rOuterShdwProp.Name == "RgbClrTransparency" ) + { + rOuterShdwProp.Value = rXPropSet->getPropertyValue( "ShadowTransparence" ); + } + } + + mpFS->startElementNS(XML_a, XML_effectLst); + bool bGlowWritten = false; + for( const auto& rEffect : std::as_const(aEffects) ) + { + if (!bGlowWritten + && (rEffect.Name == "innerShdw" || rEffect.Name == "outerShdw" + || rEffect.Name == "prstShdw" || rEffect.Name == "reflection" + || rEffect.Name == "softEdge")) + { + WriteGlowEffect(rXPropSet); + bGlowWritten = true; + } + + if( rEffect.Name == "outerShdw" ) + { + WriteShapeEffect( rEffect.Name, aOuterShdwProps ); + } + else + { + Sequence< PropertyValue > aEffectProps; + rEffect.Value >>= aEffectProps; + WriteShapeEffect( rEffect.Name, aEffectProps ); + } + } + if (!bGlowWritten) + WriteGlowEffect(rXPropSet); + WriteSoftEdgeEffect(rXPropSet); // the last + + mpFS->endElementNS(XML_a, XML_effectLst); + } +} + +void DrawingML::WriteGlowEffect(const Reference< XPropertySet >& rXPropSet) +{ + if (!rXPropSet->getPropertySetInfo()->hasPropertyByName("GlowEffectRadius")) + { + return; + } + + sal_Int32 nRad = 0; + rXPropSet->getPropertyValue("GlowEffectRadius") >>= nRad; + if (!nRad) + return; + + Sequence< PropertyValue > aGlowAttribs{ comphelper::makePropertyValue( + "rad", oox::drawingml::convertHmmToEmu(nRad)) }; + Sequence< PropertyValue > aGlowProps{ + comphelper::makePropertyValue("Attribs", aGlowAttribs), + comphelper::makePropertyValue("RgbClr", rXPropSet->getPropertyValue("GlowEffectColor")), + comphelper::makePropertyValue("RgbClrTransparency", rXPropSet->getPropertyValue("GlowEffectTransparency")) + }; + // TODO other stuff like saturation or luminance + + WriteShapeEffect(u"glow", aGlowProps); +} + +void DrawingML::WriteSoftEdgeEffect(const css::uno::Reference& rXPropSet) +{ + if (!rXPropSet->getPropertySetInfo()->hasPropertyByName("SoftEdgeRadius")) + { + return; + } + + sal_Int32 nRad = 0; + rXPropSet->getPropertyValue("SoftEdgeRadius") >>= nRad; + if (!nRad) + return; + + css::uno::Sequence aAttribs{ comphelper::makePropertyValue( + "rad", oox::drawingml::convertHmmToEmu(nRad)) }; + css::uno::Sequence aProps{ comphelper::makePropertyValue("Attribs", + aAttribs) }; + + WriteShapeEffect(u"softEdge", aProps); +} + +void DrawingML::Write3DEffects( const Reference< XPropertySet >& xPropSet, bool bIsText ) +{ + // check existence of the grab bag + if( !GetProperty( xPropSet, "InteropGrabBag" ) ) + return; + + // extract the relevant properties from the grab bag + Sequence< PropertyValue > aGrabBag, aEffectProps, aLightRigProps, aShape3DProps; + mAny >>= aGrabBag; + + auto pShapeProp = std::find_if( std::cbegin(aGrabBag), std::cend(aGrabBag), + [bIsText](const PropertyValue& rProp) + { return rProp.Name == (bIsText ? u"Text3DEffectProperties" : u"3DEffectProperties"); }); + if (pShapeProp != std::cend(aGrabBag)) + { + Sequence< PropertyValue > a3DEffectProps; + pShapeProp->Value >>= a3DEffectProps; + for( const auto& r3DEffectProp : std::as_const(a3DEffectProps) ) + { + if( r3DEffectProp.Name == "Camera" ) + r3DEffectProp.Value >>= aEffectProps; + else if( r3DEffectProp.Name == "LightRig" ) + r3DEffectProp.Value >>= aLightRigProps; + else if( r3DEffectProp.Name == "Shape3D" ) + r3DEffectProp.Value >>= aShape3DProps; + } + } + + if( !aEffectProps.hasElements() && !aLightRigProps.hasElements() && !aShape3DProps.hasElements() ) + return; + + bool bCameraRotationPresent = false; + rtl::Reference aCameraAttrList = FastSerializerHelper::createAttrList(); + rtl::Reference aCameraRotationAttrList = FastSerializerHelper::createAttrList(); + for( const auto& rEffectProp : std::as_const(aEffectProps) ) + { + if( rEffectProp.Name == "prst" ) + { + OUString sVal; + rEffectProp.Value >>= sVal; + aCameraAttrList->add(XML_prst, sVal); + } + else if( rEffectProp.Name == "fov" ) + { + float fVal = 0; + rEffectProp.Value >>= fVal; + aCameraAttrList->add( XML_fov, OString::number( fVal * 60000 ).getStr() ); + } + else if( rEffectProp.Name == "zoom" ) + { + float fVal = 1; + rEffectProp.Value >>= fVal; + aCameraAttrList->add( XML_zoom, OString::number( fVal * 100000 ).getStr() ); + } + else if( rEffectProp.Name == "rotLat" || + rEffectProp.Name == "rotLon" || + rEffectProp.Name == "rotRev" ) + { + sal_Int32 nVal = 0, nToken = XML_none; + rEffectProp.Value >>= nVal; + if( rEffectProp.Name == "rotLat" ) + nToken = XML_lat; + else if( rEffectProp.Name == "rotLon" ) + nToken = XML_lon; + else if( rEffectProp.Name == "rotRev" ) + nToken = XML_rev; + aCameraRotationAttrList->add( nToken, OString::number( nVal ).getStr() ); + bCameraRotationPresent = true; + } + } + + bool bLightRigRotationPresent = false; + rtl::Reference aLightRigAttrList = FastSerializerHelper::createAttrList(); + rtl::Reference aLightRigRotationAttrList = FastSerializerHelper::createAttrList(); + for( const auto& rLightRigProp : std::as_const(aLightRigProps) ) + { + if( rLightRigProp.Name == "rig" || rLightRigProp.Name == "dir" ) + { + OUString sVal; + sal_Int32 nToken = XML_none; + rLightRigProp.Value >>= sVal; + if( rLightRigProp.Name == "rig" ) + nToken = XML_rig; + else if( rLightRigProp.Name == "dir" ) + nToken = XML_dir; + aLightRigAttrList->add(nToken, sVal); + } + else if( rLightRigProp.Name == "rotLat" || + rLightRigProp.Name == "rotLon" || + rLightRigProp.Name == "rotRev" ) + { + sal_Int32 nVal = 0, nToken = XML_none; + rLightRigProp.Value >>= nVal; + if( rLightRigProp.Name == "rotLat" ) + nToken = XML_lat; + else if( rLightRigProp.Name == "rotLon" ) + nToken = XML_lon; + else if( rLightRigProp.Name == "rotRev" ) + nToken = XML_rev; + aLightRigRotationAttrList->add( nToken, OString::number( nVal ).getStr() ); + bLightRigRotationPresent = true; + } + } + + mpFS->startElementNS(XML_a, XML_scene3d); + + if( aEffectProps.hasElements() ) + { + mpFS->startElementNS( XML_a, XML_camera, aCameraAttrList ); + if( bCameraRotationPresent ) + { + mpFS->singleElementNS( XML_a, XML_rot, aCameraRotationAttrList ); + } + mpFS->endElementNS( XML_a, XML_camera ); + } + else + { + // a:camera with Word default values - Word won't open the document if this is not present + mpFS->singleElementNS(XML_a, XML_camera, XML_prst, "orthographicFront"); + } + + if( aEffectProps.hasElements() ) + { + mpFS->startElementNS( XML_a, XML_lightRig, aLightRigAttrList ); + if( bLightRigRotationPresent ) + { + mpFS->singleElementNS( XML_a, XML_rot, aLightRigRotationAttrList ); + } + mpFS->endElementNS( XML_a, XML_lightRig ); + } + else + { + // a:lightRig with Word default values - Word won't open the document if this is not present + mpFS->singleElementNS(XML_a, XML_lightRig, XML_rig, "threePt", XML_dir, "t"); + } + + mpFS->endElementNS( XML_a, XML_scene3d ); + + if( !aShape3DProps.hasElements() ) + return; + + bool bBevelTPresent = false, bBevelBPresent = false; + Sequence< PropertyValue > aExtrusionColorProps, aContourColorProps; + rtl::Reference aBevelTAttrList = FastSerializerHelper::createAttrList(); + rtl::Reference aBevelBAttrList = FastSerializerHelper::createAttrList(); + rtl::Reference aShape3DAttrList = FastSerializerHelper::createAttrList(); + for( const auto& rShape3DProp : std::as_const(aShape3DProps) ) + { + if( rShape3DProp.Name == "extrusionH" || rShape3DProp.Name == "contourW" || rShape3DProp.Name == "z" ) + { + sal_Int32 nVal = 0, nToken = XML_none; + rShape3DProp.Value >>= nVal; + if( rShape3DProp.Name == "extrusionH" ) + nToken = XML_extrusionH; + else if( rShape3DProp.Name == "contourW" ) + nToken = XML_contourW; + else if( rShape3DProp.Name == "z" ) + nToken = XML_z; + aShape3DAttrList->add( nToken, OString::number( nVal ).getStr() ); + } + else if( rShape3DProp.Name == "prstMaterial" ) + { + OUString sVal; + rShape3DProp.Value >>= sVal; + aShape3DAttrList->add(XML_prstMaterial, sVal); + } + else if( rShape3DProp.Name == "extrusionClr" ) + { + rShape3DProp.Value >>= aExtrusionColorProps; + } + else if( rShape3DProp.Name == "contourClr" ) + { + rShape3DProp.Value >>= aContourColorProps; + } + else if( rShape3DProp.Name == "bevelT" || rShape3DProp.Name == "bevelB" ) + { + Sequence< PropertyValue > aBevelProps; + rShape3DProp.Value >>= aBevelProps; + if ( !aBevelProps.hasElements() ) + continue; + + rtl::Reference aBevelAttrList; + if( rShape3DProp.Name == "bevelT" ) + { + bBevelTPresent = true; + aBevelAttrList = aBevelTAttrList; + } + else + { + bBevelBPresent = true; + aBevelAttrList = aBevelBAttrList; + } + for( const auto& rBevelProp : std::as_const(aBevelProps) ) + { + if( rBevelProp.Name == "w" || rBevelProp.Name == "h" ) + { + sal_Int32 nVal = 0, nToken = XML_none; + rBevelProp.Value >>= nVal; + if( rBevelProp.Name == "w" ) + nToken = XML_w; + else if( rBevelProp.Name == "h" ) + nToken = XML_h; + aBevelAttrList->add( nToken, OString::number( nVal ).getStr() ); + } + else if( rBevelProp.Name == "prst" ) + { + OUString sVal; + rBevelProp.Value >>= sVal; + aBevelAttrList->add(XML_prst, sVal); + } + } + + } + } + + mpFS->startElementNS( XML_a, XML_sp3d, aShape3DAttrList ); + if( bBevelTPresent ) + { + mpFS->singleElementNS( XML_a, XML_bevelT, aBevelTAttrList ); + } + if( bBevelBPresent ) + { + mpFS->singleElementNS( XML_a, XML_bevelB, aBevelBAttrList ); + } + if( aExtrusionColorProps.hasElements() ) + { + OUString sSchemeClr; + ::Color nColor; + sal_Int32 nTransparency(0); + Sequence< PropertyValue > aColorTransformations; + for( const auto& rExtrusionColorProp : std::as_const(aExtrusionColorProps) ) + { + if( rExtrusionColorProp.Name == "schemeClr" ) + rExtrusionColorProp.Value >>= sSchemeClr; + else if( rExtrusionColorProp.Name == "schemeClrTransformations" ) + rExtrusionColorProp.Value >>= aColorTransformations; + else if( rExtrusionColorProp.Name == "rgbClr" ) + rExtrusionColorProp.Value >>= nColor; + else if( rExtrusionColorProp.Name == "rgbClrTransparency" ) + rExtrusionColorProp.Value >>= nTransparency; + } + mpFS->startElementNS(XML_a, XML_extrusionClr); + + if( sSchemeClr.isEmpty() ) + WriteColor( nColor, MAX_PERCENT - ( PER_PERCENT * nTransparency ) ); + else + WriteColor( sSchemeClr, aColorTransformations ); + + mpFS->endElementNS( XML_a, XML_extrusionClr ); + } + if( aContourColorProps.hasElements() ) + { + OUString sSchemeClr; + ::Color nColor; + sal_Int32 nTransparency(0); + Sequence< PropertyValue > aColorTransformations; + for( const auto& rContourColorProp : std::as_const(aContourColorProps) ) + { + if( rContourColorProp.Name == "schemeClr" ) + rContourColorProp.Value >>= sSchemeClr; + else if( rContourColorProp.Name == "schemeClrTransformations" ) + rContourColorProp.Value >>= aColorTransformations; + else if( rContourColorProp.Name == "rgbClr" ) + rContourColorProp.Value >>= nColor; + else if( rContourColorProp.Name == "rgbClrTransparency" ) + rContourColorProp.Value >>= nTransparency; + } + mpFS->startElementNS(XML_a, XML_contourClr); + + if( sSchemeClr.isEmpty() ) + WriteColor( nColor, MAX_PERCENT - ( PER_PERCENT * nTransparency ) ); + else + WriteColor( sSchemeClr, aContourColorProps ); + + mpFS->endElementNS( XML_a, XML_contourClr ); + } + mpFS->endElementNS( XML_a, XML_sp3d ); +} + +void DrawingML::WriteArtisticEffect( const Reference< XPropertySet >& rXPropSet ) +{ + if( !GetProperty( rXPropSet, "InteropGrabBag" ) ) + return; + + PropertyValue aEffect; + Sequence< PropertyValue > aGrabBag; + mAny >>= aGrabBag; + auto pProp = std::find_if(std::cbegin(aGrabBag), std::cend(aGrabBag), + [](const PropertyValue& rProp) { return rProp.Name == "ArtisticEffectProperties"; }); + if (pProp != std::cend(aGrabBag)) + pProp->Value >>= aEffect; + sal_Int32 nEffectToken = ArtisticEffectProperties::getEffectToken( aEffect.Name ); + if( nEffectToken == XML_none ) + return; + + Sequence< PropertyValue > aAttrs; + aEffect.Value >>= aAttrs; + rtl::Reference aAttrList = FastSerializerHelper::createAttrList(); + OString sRelId; + for( const auto& rAttr : std::as_const(aAttrs) ) + { + sal_Int32 nToken = ArtisticEffectProperties::getEffectToken( rAttr.Name ); + if( nToken != XML_none ) + { + sal_Int32 nVal = 0; + rAttr.Value >>= nVal; + aAttrList->add( nToken, OString::number( nVal ).getStr() ); + } + else if( rAttr.Name == "OriginalGraphic" ) + { + Sequence< PropertyValue > aGraphic; + rAttr.Value >>= aGraphic; + Sequence< sal_Int8 > aGraphicData; + OUString sGraphicId; + for( const auto& rProp : std::as_const(aGraphic) ) + { + if( rProp.Name == "Id" ) + rProp.Value >>= sGraphicId; + else if( rProp.Name == "Data" ) + rProp.Value >>= aGraphicData; + } + sRelId = WriteWdpPicture( sGraphicId, aGraphicData ); + } + } + + mpFS->startElementNS(XML_a, XML_extLst); + mpFS->startElementNS(XML_a, XML_ext, XML_uri, "{BEBA8EAE-BF5A-486C-A8C5-ECC9F3942E4B}"); + mpFS->startElementNS( XML_a14, XML_imgProps, + FSNS(XML_xmlns, XML_a14), mpFB->getNamespaceURL(OOX_NS(a14)) ); + mpFS->startElementNS(XML_a14, XML_imgLayer, FSNS(XML_r, XML_embed), sRelId); + mpFS->startElementNS(XML_a14, XML_imgEffect); + + mpFS->singleElementNS( XML_a14, nEffectToken, aAttrList ); + + mpFS->endElementNS( XML_a14, XML_imgEffect ); + mpFS->endElementNS( XML_a14, XML_imgLayer ); + mpFS->endElementNS( XML_a14, XML_imgProps ); + mpFS->endElementNS( XML_a, XML_ext ); + mpFS->endElementNS( XML_a, XML_extLst ); +} + +OString DrawingML::WriteWdpPicture( const OUString& rFileId, const Sequence< sal_Int8 >& rPictureData ) +{ + if (!maWdpCache.empty()) + { + std::map::iterator aCachedItem = maWdpCache.top().find(rFileId); + if (aCachedItem != maWdpCache.top().end()) + return OUStringToOString(aCachedItem->second, RTL_TEXTENCODING_UTF8); + } + + OUString sFileName = "media/hdphoto" + OUString::number( mnWdpImageCounter.top()++ ) + ".wdp"; + Reference< XOutputStream > xOutStream = mpFB->openFragmentStream( OUStringBuffer() + .appendAscii( GetComponentDir() ) + .append( "/" + sFileName ) + .makeStringAndClear(), + "image/vnd.ms-photo" ); + OUString sId; + xOutStream->writeBytes( rPictureData ); + xOutStream->closeOutput(); + + sId = mpFB->addRelation( mpFS->getOutputStream(), + oox::getRelationship(Relationship::HDPHOTO), + OUStringBuffer() + .appendAscii( GetRelationCompPrefix() ) + .append( sFileName ) + .makeStringAndClear() ); + + if (!maWdpCache.empty()) + maWdpCache.top()[rFileId] = sId; + + return OUStringToOString( sId, RTL_TEXTENCODING_UTF8 ); +} + +void DrawingML::WriteDiagram(const css::uno::Reference& rXShape, int nDiagramId) +{ + uno::Reference xPropSet(rXShape, uno::UNO_QUERY); + + uno::Reference dataDom; + uno::Reference layoutDom; + uno::Reference styleDom; + uno::Reference colorDom; + uno::Reference drawingDom; + uno::Sequence> xDataRelSeq; + uno::Sequence diagramDrawing; + + // retrieve the doms from the GrabBag + uno::Sequence propList; + xPropSet->getPropertyValue(UNO_NAME_MISC_OBJ_INTEROPGRABBAG) >>= propList; + for (const auto& rProp : std::as_const(propList)) + { + OUString propName = rProp.Name; + if (propName == "OOXData") + rProp.Value >>= dataDom; + else if (propName == "OOXLayout") + rProp.Value >>= layoutDom; + else if (propName == "OOXStyle") + rProp.Value >>= styleDom; + else if (propName == "OOXColor") + rProp.Value >>= colorDom; + else if (propName == "OOXDrawing") + { + rProp.Value >>= diagramDrawing; + diagramDrawing[0] + >>= drawingDom; // if there is OOXDrawing property then set drawingDom here only. + } + else if (propName == "OOXDiagramDataRels") + rProp.Value >>= xDataRelSeq; + } + + // check that we have the 4 mandatory XDocuments + // if not, there was an error importing and we won't output anything + if (!dataDom.is() || !layoutDom.is() || !styleDom.is() || !colorDom.is()) + return; + + // generate a unique id + rtl::Reference pDocPrAttrList + = sax_fastparser::FastSerializerHelper::createAttrList(); + pDocPrAttrList->add(XML_id, OString::number(nDiagramId).getStr()); + OString sName = "Diagram" + OString::number(nDiagramId); + pDocPrAttrList->add(XML_name, sName); + + if (GetDocumentType() == DOCUMENT_DOCX) + { + mpFS->singleElementNS(XML_wp, XML_docPr, pDocPrAttrList); + mpFS->singleElementNS(XML_wp, XML_cNvGraphicFramePr); + + mpFS->startElementNS(XML_a, XML_graphic, FSNS(XML_xmlns, XML_a), + mpFB->getNamespaceURL(OOX_NS(dml))); + } + else + { + mpFS->startElementNS(XML_p, XML_nvGraphicFramePr); + + mpFS->singleElementNS(XML_p, XML_cNvPr, pDocPrAttrList); + mpFS->singleElementNS(XML_p, XML_cNvGraphicFramePr); + + mpFS->startElementNS(XML_p, XML_nvPr); + mpFS->startElementNS(XML_p, XML_extLst); + // change tracking extension - required in PPTX + mpFS->startElementNS(XML_p, XML_ext, XML_uri, "{D42A27DB-BD31-4B8C-83A1-F6EECF244321}"); + mpFS->singleElementNS(XML_p14, XML_modId, + FSNS(XML_xmlns, XML_p14), mpFB->getNamespaceURL(OOX_NS(p14)), + XML_val, + OString::number(comphelper::rng::uniform_uint_distribution(1, SAL_MAX_UINT32))); + mpFS->endElementNS(XML_p, XML_ext); + mpFS->endElementNS(XML_p, XML_extLst); + mpFS->endElementNS(XML_p, XML_nvPr); + + mpFS->endElementNS(XML_p, XML_nvGraphicFramePr); + + // store size and position of background shape instead of group shape + // as some shapes may be outside + css::uno::Reference xShapes(rXShape, uno::UNO_QUERY); + if (xShapes.is() && xShapes->hasElements()) + { + css::uno::Reference xShapeBg(xShapes->getByIndex(0), + uno::UNO_QUERY); + awt::Point aPos = xShapeBg->getPosition(); + awt::Size aSize = xShapeBg->getSize(); + WriteTransformation( + xShapeBg, tools::Rectangle(Point(aPos.X, aPos.Y), Size(aSize.Width, aSize.Height)), + XML_p, false, false, 0, false); + } + + mpFS->startElementNS(XML_a, XML_graphic); + } + + mpFS->startElementNS(XML_a, XML_graphicData, XML_uri, + "http://schemas.openxmlformats.org/drawingml/2006/diagram"); + + OUString sRelationCompPrefix = OUString::createFromAscii(GetRelationCompPrefix()); + + // add data relation + OUString dataFileName = "diagrams/data" + OUString::number(nDiagramId) + ".xml"; + OUString dataRelId = + mpFB->addRelation(mpFS->getOutputStream(), oox::getRelationship(Relationship::DIAGRAMDATA), + OUStringConcatenation(sRelationCompPrefix + dataFileName)); + + // add layout relation + OUString layoutFileName = "diagrams/layout" + OUString::number(nDiagramId) + ".xml"; + OUString layoutRelId = mpFB->addRelation(mpFS->getOutputStream(), + oox::getRelationship(Relationship::DIAGRAMLAYOUT), + OUStringConcatenation(sRelationCompPrefix + layoutFileName)); + + // add style relation + OUString styleFileName = "diagrams/quickStyle" + OUString::number(nDiagramId) + ".xml"; + OUString styleRelId = mpFB->addRelation(mpFS->getOutputStream(), + oox::getRelationship(Relationship::DIAGRAMQUICKSTYLE), + OUStringConcatenation(sRelationCompPrefix + styleFileName)); + + // add color relation + OUString colorFileName = "diagrams/colors" + OUString::number(nDiagramId) + ".xml"; + OUString colorRelId = mpFB->addRelation(mpFS->getOutputStream(), + oox::getRelationship(Relationship::DIAGRAMCOLORS), + OUStringConcatenation(sRelationCompPrefix + colorFileName)); + + OUString drawingFileName; + if (drawingDom.is()) + { + // add drawing relation + drawingFileName = "diagrams/drawing" + OUString::number(nDiagramId) + ".xml"; + OUString drawingRelId = mpFB->addRelation( + mpFS->getOutputStream(), oox::getRelationship(Relationship::DIAGRAMDRAWING), + OUStringConcatenation(sRelationCompPrefix + drawingFileName)); + + // the data dom contains a reference to the drawing relation. We need to update it with the new generated + // relation value before writing the dom to a file + + // Get the dsp:damaModelExt node from the dom + uno::Reference nodeList = dataDom->getElementsByTagNameNS( + "http://schemas.microsoft.com/office/drawing/2008/diagram", "dataModelExt"); + + // There must be one element only so get it + uno::Reference node = nodeList->item(0); + + // Get the list of attributes of the node + uno::Reference nodeMap = node->getAttributes(); + + // Get the node with the relId attribute and set its new value + uno::Reference relIdNode = nodeMap->getNamedItem("relId"); + relIdNode->setNodeValue(drawingRelId); + } + + mpFS->singleElementNS(XML_dgm, XML_relIds, + FSNS(XML_xmlns, XML_dgm), mpFB->getNamespaceURL(OOX_NS(dmlDiagram)), + FSNS(XML_xmlns, XML_r), mpFB->getNamespaceURL(OOX_NS(officeRel)), + FSNS(XML_r, XML_dm), dataRelId, FSNS(XML_r, XML_lo), layoutRelId, + FSNS(XML_r, XML_qs), styleRelId, FSNS(XML_r, XML_cs), colorRelId); + + mpFS->endElementNS(XML_a, XML_graphicData); + mpFS->endElementNS(XML_a, XML_graphic); + + uno::Reference serializer; + uno::Reference writer + = xml::sax::Writer::create(comphelper::getProcessComponentContext()); + + OUString sDir = OUString::createFromAscii(GetComponentDir()); + + // write data file + serializer.set(dataDom, uno::UNO_QUERY); + uno::Reference xDataOutputStream = mpFB->openFragmentStream( + sDir + "/" + dataFileName, + "application/vnd.openxmlformats-officedocument.drawingml.diagramData+xml"); + writer->setOutputStream(xDataOutputStream); + serializer->serialize(uno::Reference(writer, uno::UNO_QUERY_THROW), + uno::Sequence()); + + // write the associated Images and rels for data file + writeDiagramRels(xDataRelSeq, xDataOutputStream, u"OOXDiagramDataRels", nDiagramId); + + // write layout file + serializer.set(layoutDom, uno::UNO_QUERY); + writer->setOutputStream(mpFB->openFragmentStream( + sDir + "/" + layoutFileName, + "application/vnd.openxmlformats-officedocument.drawingml.diagramLayout+xml")); + serializer->serialize(uno::Reference(writer, uno::UNO_QUERY_THROW), + uno::Sequence()); + + // write style file + serializer.set(styleDom, uno::UNO_QUERY); + writer->setOutputStream(mpFB->openFragmentStream( + sDir + "/" + styleFileName, + "application/vnd.openxmlformats-officedocument.drawingml.diagramStyle+xml")); + serializer->serialize(uno::Reference(writer, uno::UNO_QUERY_THROW), + uno::Sequence()); + + // write color file + serializer.set(colorDom, uno::UNO_QUERY); + writer->setOutputStream(mpFB->openFragmentStream( + sDir + "/" + colorFileName, + "application/vnd.openxmlformats-officedocument.drawingml.diagramColors+xml")); + serializer->serialize(uno::Reference(writer, uno::UNO_QUERY_THROW), + uno::Sequence()); + + // write drawing file + if (!drawingDom.is()) + return; + + serializer.set(drawingDom, uno::UNO_QUERY); + uno::Reference xDrawingOutputStream = mpFB->openFragmentStream( + sDir + "/" + drawingFileName, "application/vnd.ms-office.drawingml.diagramDrawing+xml"); + writer->setOutputStream(xDrawingOutputStream); + serializer->serialize( + uno::Reference(writer, uno::UNO_QUERY_THROW), + uno::Sequence()); + + // write the associated Images and rels for drawing file + uno::Sequence> xDrawingRelSeq; + diagramDrawing[1] >>= xDrawingRelSeq; + writeDiagramRels(xDrawingRelSeq, xDrawingOutputStream, u"OOXDiagramDrawingRels", nDiagramId); +} + +void DrawingML::writeDiagramRels(const uno::Sequence>& xRelSeq, + const uno::Reference& xOutStream, + std::u16string_view sGrabBagProperyName, int nDiagramId) +{ + // add image relationships of OOXData, OOXDiagram + OUString sType(oox::getRelationship(Relationship::IMAGE)); + uno::Reference xWriter + = xml::sax::Writer::create(comphelper::getProcessComponentContext()); + xWriter->setOutputStream(xOutStream); + + // retrieve the relationships from Sequence + for (sal_Int32 j = 0; j < xRelSeq.getLength(); j++) + { + // diagramDataRelTuple[0] => RID, + // diagramDataRelTuple[1] => xInputStream + // diagramDataRelTuple[2] => extension + uno::Sequence diagramDataRelTuple = xRelSeq[j]; + + OUString sRelId; + OUString sExtension; + diagramDataRelTuple[0] >>= sRelId; + diagramDataRelTuple[2] >>= sExtension; + OUString sContentType; + if (sExtension.equalsIgnoreAsciiCase(".WMF")) + sContentType = "image/x-wmf"; + else + sContentType = OUString::Concat("image/") + sExtension.subView(1); + sRelId = sRelId.copy(3); + + StreamDataSequence dataSeq; + diagramDataRelTuple[1] >>= dataSeq; + uno::Reference dataImagebin( + new ::comphelper::SequenceInputStream(dataSeq)); + + //nDiagramId is used to make the name unique irrespective of the number of smart arts. + OUString sFragment = OUString::Concat("media/") + sGrabBagProperyName + + OUString::number(nDiagramId) + "_" + + OUString::number(j) + sExtension; + + PropertySet aProps(xOutStream); + aProps.setAnyProperty(PROP_RelId, uno::Any(sRelId.toInt32())); + + mpFB->addRelation(xOutStream, sType, OUStringConcatenation("../" + sFragment)); + + OUString sDir = OUString::createFromAscii(GetComponentDir()); + uno::Reference xBinOutStream + = mpFB->openFragmentStream(sDir + "/" + sFragment, sContentType); + + try + { + comphelper::OStorageHelper::CopyInputToOutput(dataImagebin, xBinOutStream); + } + catch (const uno::Exception&) + { + TOOLS_WARN_EXCEPTION("oox.drawingml", "DrawingML::writeDiagramRels Failed to copy grabbaged Image"); + } + dataImagebin->closeInput(); + } +} + +void DrawingML::WriteFromTo(const uno::Reference& rXShape, const awt::Size& aPageSize, + const FSHelperPtr& pDrawing) +{ + awt::Point aTopLeft = rXShape->getPosition(); + awt::Size aSize = rXShape->getSize(); + + SdrObject* pObj = SdrObject::getSdrObjectFromXShape(rXShape); + if (pObj) + { + Degree100 nRotation = pObj->GetRotateAngle(); + if (nRotation) + { + sal_Int16 nHalfWidth = aSize.Width / 2; + sal_Int16 nHalfHeight = aSize.Height / 2; + // aTopLeft needs correction for rotated customshapes + if (pObj->GetObjIdentifier() == SdrObjKind::CustomShape) + { + // Center of bounding box of the rotated shape + const auto aSnapRectCenter(pObj->GetSnapRect().Center()); + aTopLeft.X = aSnapRectCenter.X() - nHalfWidth; + aTopLeft.Y = aSnapRectCenter.Y() - nHalfHeight; + } + + // MSO changes the anchor positions at these angles and that does an extra 90 degrees + // rotation on our shapes, so we output it in such position that MSO + // can draw this shape correctly. + if ((nRotation >= 4500_deg100 && nRotation < 13500_deg100) || (nRotation >= 22500_deg100 && nRotation < 31500_deg100)) + { + aTopLeft.X = aTopLeft.X - nHalfHeight + nHalfWidth; + aTopLeft.Y = aTopLeft.Y - nHalfWidth + nHalfHeight; + + std::swap(aSize.Width, aSize.Height); + } + } + } + + tools::Rectangle aLocation(aTopLeft.X, aTopLeft.Y, aTopLeft.X + aSize.Width, aTopLeft.Y + aSize.Height); + double nXpos = static_cast(aLocation.TopLeft().getX()) / static_cast(aPageSize.Width); + double nYpos = static_cast(aLocation.TopLeft().getY()) / static_cast(aPageSize.Height); + + pDrawing->startElement(FSNS(XML_cdr, XML_from)); + pDrawing->startElement(FSNS(XML_cdr, XML_x)); + pDrawing->write(nXpos); + pDrawing->endElement(FSNS(XML_cdr, XML_x)); + pDrawing->startElement(FSNS(XML_cdr, XML_y)); + pDrawing->write(nYpos); + pDrawing->endElement(FSNS(XML_cdr, XML_y)); + pDrawing->endElement(FSNS(XML_cdr, XML_from)); + + nXpos = static_cast(aLocation.BottomRight().getX()) / static_cast(aPageSize.Width); + nYpos = static_cast(aLocation.BottomRight().getY()) / static_cast(aPageSize.Height); + + pDrawing->startElement(FSNS(XML_cdr, XML_to)); + pDrawing->startElement(FSNS(XML_cdr, XML_x)); + pDrawing->write(nXpos); + pDrawing->endElement(FSNS(XML_cdr, XML_x)); + pDrawing->startElement(FSNS(XML_cdr, XML_y)); + pDrawing->write(nYpos); + pDrawing->endElement(FSNS(XML_cdr, XML_y)); + pDrawing->endElement(FSNS(XML_cdr, XML_to)); +} + +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/export/ooxml-export-notes.txt b/oox/source/export/ooxml-export-notes.txt new file mode 100644 index 000000000..36c42fc53 --- /dev/null +++ b/oox/source/export/ooxml-export-notes.txt @@ -0,0 +1,235 @@ +# +# This file is part of the LibreOffice project. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# +# This file incorporates work covered by the following license notice: +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed +# with this work for additional information regarding copyright +# ownership. The ASF licenses this file to you under the Apache +# License, Version 2.0 (the "License"); you may not use this file +# except in compliance with the License. You may obtain a copy of +# the License at http://www.apache.org/licenses/LICENSE-2.0 . +# + +OOXML generally +--------------- + +- http://www.ecma-international.org/publications/standards/Ecma-376.htm +- http://www.asahi-net.or.jp/~eb2m-mrt/ooxml/dependencies.html + +Related modules +--------------- + +- oox + - .xlsx and .pptx import + +- writerfilter + - import of .docx, uses also oox for the graphics etc. + +- filter + - the configuration stuff (so that the filters appear in the filepicker) + +Old binary filters (export) +--------------------------- + +- doc export + - sw/source/filter/ww8/wrtww8* + - wrtww8.cxx:2191 [SwWW8Writer::StoreDoc()] is the entry point + + - eg. + #0 SwWW8Writer::WriteText (this=0x2aaab3dfb7c0) at /local/ooxml/ooxml/sw/source/filter/ww8/wrtww8.cxx:1846 + #1 0x00002aaaae75a545 in SwWW8Writer::WriteMainText (this=0x2aaab3d6a870) + at /local/ooxml/ooxml/sw/source/filter/ww8/wrtww8.cxx:1925 + #2 0x00002aaaae75e357 in SwWW8Writer::StoreDoc1 (this=0x2aaab3d6a870) + at /local/ooxml/ooxml/sw/source/filter/ww8/wrtww8.cxx:2076 + #3 0x00002aaaae7605ec in SwWW8Writer::StoreDoc (this=0x2aaab3d6a870) + at /local/ooxml/ooxml/sw/source/filter/ww8/wrtww8.cxx:2383 + #4 0x00002aaaae760fd5 in SwWW8Writer::WriteStorage (this=0x2aaab3d6a870) + at /local/ooxml/ooxml/sw/source/filter/ww8/wrtww8.cxx:2547 + #5 0x00002aaaae70b793 in StgWriter::Write (this=0x2aaab3d6a870, rPaM=@0x2b3802a2b640, rStg=@0x2aaab3d621c0, + pFName=0x7fffb1b285c0) at /local/ooxml/ooxml/sw/source/filter/writer/writer.cxx:653 + #6 0x00002aaaae70b84d in Writer::Write (this=0x2aaab3d6a870, rPaM=@0x2b3802a2b640, rStrm=@0x2aaaad979d20, + pFName=0x7fffb1b285c0) at /local/ooxml/ooxml/sw/source/filter/writer/writer.cxx:358 + #7 0x00002aaaae70b993 in Writer::Write (this=0x2aaab3d6a870, rPam=@0x2b3802a2b640, rMed=@0x2aaaad999f30, + pFileName=0x7fffb1b285c0) at /local/ooxml/ooxml/sw/source/filter/writer/writer.cxx:385 + #8 0x00002aaaae6375d7 in SwWriter::Write (this=0x7fffb1b28410, rxWriter=@0x7fffb1b285d0, + pRealFileName=0x7fffb1b285c0) at /local/ooxml/ooxml/sw/source/filter/basflt/shellio.cxx:963 + #9 0x00002aaaae87cc1e in SwDocShell::ConvertTo (this=0xcc27f0, rMedium=@0x2aaaad999f30) + at /local/ooxml/ooxml/sw/source/ui/app/docsh.cxx:924 + #10 0x00002b37faae6b58 in SfxObjectShell::DoLoad () + from /local/ooxml/inst/openoffice.org3.0/program/../basis-link/program//libsfxlx.so + +- xls export + - sc/source/filter/excel/xe* + + - eg. + #0 XclExpRecord::Save (this=0x11ae4c0, rStrm=@0x7fff5e6335d0) + at /local/ooxml/ooxml/sc/source/filter/excel/xerecord.cxx:88 + #1 0x00002aaaae562c4a in ExcRecord::Save (this=0x11ae4c0, rStrm=@0x7fff5e6335d0) + at /local/ooxml/ooxml/sc/source/filter/excel/excrecds.cxx:168 + #2 0x00002aaaae54b0fa in XclExpRecordList::Save (this=0x11c5d18, rStrm=@0x7fff5e6335d0) + at ../inc/xerecord.hxx:281 + #3 0x00002aaaae547541 in ExcTable::Write (this=0x11c5cf8, rStr=@0x7fff5e6335d0) + at /local/ooxml/ooxml/sc/source/filter/excel/excdoc.cxx:455 + #4 0x00002aaaae5475fb in ExcDocument::Write (this=0x11c5ce0, rSvStrm=@0x2aaab3dcd070) + at /local/ooxml/ooxml/sc/source/filter/excel/excdoc.cxx:525 + #5 0x00002aaaae568add in ExportBiff5::Write (this=0x7fff5e6339c0) + at /local/ooxml/ooxml/sc/source/filter/excel/expop2.cxx:119 + #6 0x00002aaaae54f4af in ScExportExcel5 (rMedium=@0x2aaab3d87410, pDocument=0xce6a00, bBiff8=1 '\001', eNach=1) + at /local/ooxml/ooxml/sc/source/filter/excel/excel.cxx:252 + #7 0x00002aaaadf1b70a in ScDocShell::ConvertTo (this=0xce6990, rMed=@0x2aaab3d87410) + at /local/ooxml/ooxml/sc/source/ui/docshell/docsh.cxx:2080 + #8 0x00002b354dfd8b58 in SfxObjectShell::DoLoad () + from /local/ooxml/inst/openoffice.org3.0/program/../basis-link/program//libsfxlx.so + + - Current approach is to add a XclExpRecordBase::SaveXml() method, which + would be used to write the XML content (while Save() would continue + writing the BIFF format). + - Q: How do we get to the Save()/SaveXml() methods (e.g. the SST export code) + #0 XclExpSstImpl::Save (this=0x1b170b0, rStrm=@0x7fffd4d5c4a0) + at /home/jon/Development/OpenOffice.org/ooxml/sc/source/filter/excel/xecontent.cxx:224 + #1 0x00007f68b7e46ff7 in XclExpSst::Save (this=0x1abc300, + rStrm=@0x7fffd4d5c4a0) + at /home/jon/Development/OpenOffice.org/ooxml/sc/source/filter/excel/xecontent.cxx:351 + #2 0x00007f68b7de5090 in XclExpRecordList::Save ( + this=0x1b2d168, rStrm=@0x7fffd4d5c4a0) at ../inc/xerecord.hxx:282 + // as above, starting at frame 2 + + - Thus, to get to the SaveXml() method, we need to add a slew of WriteXml() + methods that will (eventually) invoke the SaveXml() methods. + + - ZipStorage for XML handling and StorageRef (XStorage interface) + - To construct ZipStorage, need XMultiServiceFactory (!), and + XInputStream. + - Have an SvStream; need to wrap SvStream with XInputStream + - OInputStreamWrapper in + - Where do I get XMultiServiceFactory? + - Lots of places -- just grep + - perhaps XmlFilterBase _does_ make sense here. + - Do it anyway. + - Looking into having XclExpXmlStream inherit from ZipFilterBase + - problem: exception during construction, because ZipStorage hates me: + #0 OStorageFactory::createInstanceWithArguments (this=0x10612a0, + aArguments=@0x7fffe2ef76d0) + at /home/jon/Development/OpenOffice.org/ooxml/package/source/xstor/xfactory.cxx:275 + #1 0x00007f12d93f0d5c in comphelper::OStorageHelper::GetStorageOfFormatFromStream (aFormat=@0x7fffe2ef7780, xStream=@0x1a502d8, nStorageMode=15, + xFactory=@0x1a502c0) + at /home/jon/Development/OpenOffice.org/ooxml/comphelper/source/misc/storagehelper.cxx:342 + #2 0x00007f12c33d1a6d in ZipStorage (this=0x1a92550, rxFactory=@0x1a502c0, + rxStream=@0x1a502d8) + at /home/jon/Development/OpenOffice.org/ooxml/oox/source/helper/zipstorage.cxx:87 + #3 0x00007f12c33f089e in oox::core::XmlFilterBase::implCreateStorage ( + this=0x7fffe2ef7930, rxInStream=@0x1a502d0, rxStream=@0x1a502d8) + at /home/jon/Development/OpenOffice.org/ooxml/oox/source/core/xmlfilterbase.cxx:298 + #4 0x00007f12c33dd204 in oox::core::FilterBase::filter (this=0x7fffe2ef7930, + rDescriptor=@0x7fffe2ef78d0) + at /home/jon/Development/OpenOffice.org/ooxml/oox/source/core/filterbase.cxx:284 + #5 0x00007f12c68097a2 in XclExpXmlStream (this=0x7fffe2ef7930, + rSMgr=@0x7fffe2ef79a0, rStrm=@0x18d6f90) + at /home/jon/Development/OpenOffice.org/ooxml/sc/source/filter/excel/xestream.cxx:659 + #6 0x00007f12c674c8c1 in ExcDocument::WriteXml (this=0x15911f0, + rStrm=@0x18d6f90) + at /home/jon/Development/OpenOffice.org/ooxml/sc/source/filter/excel/excdoc.cxx:575 + ... + - Actual problem: xfactory.cxx:274, the CheckPackageSignature_Impl() call. + - fails because the empty file has content (!), thus fails the "package + signature check" (which tries to ensure the file format is correct). + - Underlying file is an SvFileStream, created in + SfxMedium::GetOutStream(). + - So why's CheckPackageSignature_Impl() fail? Because + lcl_ExportExcel2007Xml() had the code: + + tools::SvRef xRootStrg = new SotStorage( pMedStrm, FALSE ); + + That is, it was creating an OLE Structured Storage document over the + SvStream, and then (later) used the *same* SvStream and passed it to + ZipStorage. This caused ZipStorage to complain because OLESS data was + already present in the file, with a different file signature than what + ZipPackage was expecting (go figure). + +- ppt export + - sd/source/filter/eppt/* + - svx/source/msfilter + - for eg. Escher export + - Escher: http://chicago.sourceforge.net/devel/docs/escher/index.html + + - eg. + #0 PPTWriter (this=0x15807d0, rSvStorage=@0x7fff894f5340, rXModel=@0x142a2e8, rXStatInd=@0x142a2f0, pVBA=0x0, + nCnvrtFlags=15) at /local/ooxml/ooxml/sd/source/filter/eppt/eppt.cxx:268 + #1 0x00002aaab3895719 in ExportPPT (rSvStorage=@0x7fff894f5340, rXModel=@0x142a2e8, rXStatInd=@0x142a2f0, + pVBA=0x0, nCnvrtFlags=15) at /local/ooxml/ooxml/sd/source/filter/eppt/eppt.cxx:2503 + #2 0x00002aaaadef85b7 in SdPage::onParagraphRemoving () + from /local/ooxml/inst/openoffice.org3.0/program/../basis-link/program/libsdlx.so + #3 0x00002aaaade202e3 in sd::DrawDocShell::ConvertTo () + from /local/ooxml/inst/openoffice.org3.0/program/../basis-link/program/libsdlx.so + #4 0x00002aec23119b58 in SfxObjectShell::DoLoad () + from /local/ooxml/inst/openoffice.org3.0/program/../basis-link/program//libsfxlx.so + +- pptx export + - sd/source/filter/eppt/pptx-epptooxml.cxx, + oox::core::PowerPointExport::exportDocument() + +- odp export + #0 ZipPackage (this=0x1805e80, xNewFactory=@0x7fffe284e990) at /home/rodo/git/ooxml/package/source/zippackage/ZipPackage.cxx:279 + #1 0x00002aaaadd3dc94 in ZipPackage_createInstance (xMgr=@0x7fffe284e990) at /home/rodo/git/ooxml/package/source/zippackage/ZipPackage.cxx:1546 + #2 0x00002b0fca7ab6b3 in ?? () from /opt/libreoffice/program/../basis-link/program/../ure-link/lib/libuno_cppuhelpergcc3.so.3 + #3 0x00002b0fca7a7fda in ?? () from /opt/libreoffice/program/../basis-link/program/../ure-link/lib/libuno_cppuhelpergcc3.so.3 + #4 0x00002b0fca7a811e in ?? () from /opt/libreoffice/program/../basis-link/program/../ure-link/lib/libuno_cppuhelpergcc3.so.3 + #5 0x00002b0fca7aa7cc in ?? () from /opt/libreoffice/program/../basis-link/program/../ure-link/lib/libuno_cppuhelpergcc3.so.3 + #6 0x00002b0fca7aacbe in ?? () from /opt/libreoffice/program/../basis-link/program/../ure-link/lib/libuno_cppuhelpergcc3.so.3 + #7 0x00002b0fca7aa035 in ?? () from /opt/libreoffice/program/../basis-link/program/../ure-link/lib/libuno_cppuhelpergcc3.so.3 + #8 0x00002aaaaadae1b3 in ?? () from /opt/libreoffice/ure/lib/bootstrap.uno.so + #9 0x00002aaaaadaa84c in ?? () from /opt/libreoffice/ure/lib/bootstrap.uno.so + #10 0x00002aaab5c7a7e5 in OStorage_Impl::OpenOwnPackage (this=0x185cac0) at /home/rodo/git/ooxml/package/source/xstor/xstorage.cxx:549 + #11 0x00002aaab5c7ab3e in OStorage_Impl::ReadContents (this=0x185cac0) at /home/rodo/git/ooxml/package/source/xstor/xstorage.cxx:649 + #12 0x00002aaab5c7d32f in OStorage_Impl::FindElement (this=0x185cac0, rName=@0x7fffe284f280) at /home/rodo/git/ooxml/package/source/xstor/xstorage.cxx:1387 + #13 0x00002aaab5c7dc45 in OStorage::hasByName (this=0x1808880, aName=@0x7fffe284f280) at /home/rodo/git/ooxml/package/source/xstor/xstorage.cxx:4045 + #14 0x00002aaab1fde8c5 in XMLVersionListPersistence::load () from /opt/libreoffice/program/../basis-link/program/libxolx.so + #15 0x00002b0fcb058bb2 in SfxMedium::GetVersionList (this=0x1750050, _bNoReload=false) at /home/rodo/git/ooxml/sfx2/source/doc/docfile.cxx:3247 + #16 0x00002b0fcb0571b5 in SfxMedium::GetStorage (this=0x1750050) at /home/rodo/git/ooxml/sfx2/source/doc/docfile.cxx:1328 + #17 0x00002b0fcb05d0d7 in SfxMedium::GetOutputStorage (this=0x1750050) at /home/rodo/git/ooxml/sfx2/source/doc/docfile.cxx:1068 + #18 0x00002b0fcb091227 in SfxObjectShell::SaveTo_Impl (this=0xf44d60, rMedium=@0x1750050, pSet=0x0) at /home/rodo/git/ooxml/sfx2/source/doc/objstor.cxx:1557 + #19 0x00002b0fcb09443c in SfxObjectShell::PreDoSaveAs_Impl (this=0xf44d60, rFileName=@0x7fffe2850700, aFilterName=@0x7fffe28507f0, pParams=0xf10c10) + at /home/rodo/git/ooxml/sfx2/source/doc/objstor.cxx:2984 + #20 0x00002b0fcb094ea5 in SfxObjectShell::CommonSaveAs_Impl (this=0xf44d60, aURL=@0x7fffe2850870, aFilterName=@0x7fffe28507f0, aParams=0x1740310) + at /home/rodo/git/ooxml/sfx2/source/doc/objstor.cxx:2855 + #21 0x00002b0fcb0a1da2 in SfxObjectShell::APISaveAs_Impl (this=0xf44d60, aFileName=@0x7fffe2850b70, aParams=0x1740310) + at /home/rodo/git/ooxml/sfx2/source/doc/objserv.cxx:432 + #22 0x00002b0fcb0e74c8 in SfxBaseModel::impl_store (this=0xf96a00, sURL=@0x7fffe28516b0, seqArguments=@0x7fffe2851ae0, bSaveTo=0 '\0') + at /home/rodo/git/ooxml/sfx2/source/doc/sfxbasemodel.cxx:2591 + #23 0x00002b0fcb0f124b in SfxBaseModel::storeAsURL (this=0xf96a00, rURL=@0x7fffe28516b0, rArgs=@0x7fffe2851ae0) + at /home/rodo/git/ooxml/sfx2/source/doc/sfxbasemodel.cxx:1568 + #24 0x00002b0fcb101d3d in SfxStoringHelper::GUIStoreModel (this=0x7fffe28519f0, xModel=@0xf18798, aSlotName=@0x7fffe2852200, aArgsSequence=@0x7fffe2851ae0, + bPreselectPassword=0 '\0') at /home/rodo/git/ooxml/sfx2/source/doc/guisaveas.cxx:1529 + #25 0x00002b0fcb0a4051 in SfxObjectShell::ExecFile_Impl (this=0xf44d60, rReq=@0x1484f20) at /home/rodo/git/ooxml/sfx2/source/doc/objserv.cxx:744 + #26 0x00002b0fcb0a5c73 in SfxStubSfxObjectShellExecFile_Impl (pShell=0xf44d60, rReq=@0x1484f20) at ../../unxlngx6.pro/inc/sfxslots.hxx:161 + #27 0x00002b0fcb17f398 in SfxShell::CallExec (this=0xf44d60, pFunc=0x2b0fcb0a5c56 , rReq=@0x1484f20) + at ../../inc/sfx2/shell.hxx:226 + #28 0x00002b0fcb17cec3 in SfxDispatcher::Call_Impl (this=0x110fde0, rShell=@0xf44d60, rSlot=@0x2b0fcb576368, rReq=@0x1484f20, bRecord=1 '\001') + at /home/rodo/git/ooxml/sfx2/source/control/dispatch.cxx:338 + #29 0x00002b0fcb17d3f2 in SfxDispatcher::PostMsgHandler (this=0x110fde0, pReq=0x1484f20) at /home/rodo/git/ooxml/sfx2/source/control/dispatch.cxx:1643 + #30 0x00002b0fcb17d51d in SfxDispatcher::LinkStubPostMsgHandler (pThis=0x110fde0, pCaller=0x1484f20) at /home/rodo/git/ooxml/sfx2/source/control/dispatch.cxx:1610 + #31 0x00002b0fcafb3e70 in Link::Call (this=0x11488f8, pCaller=0x1484f20) at /home/rodo/git/ooxml/solver/300/unxlngx6.pro/inc/tools/link.hxx:158 + #32 0x00002b0fcb1a9952 in GenLink::Call (this=0x11488f8, pCaller=0x1484f20) at ../../inc/sfx2/genlink.hxx:63 + #33 0x00002b0fcb1a9773 in SfxHintPoster::Event (this=0x11488e0, pPostedHint=0x1484f20) at /home/rodo/git/ooxml/sfx2/source/notify/hintpost.cxx:98 + #34 0x00002b0fcb1a9984 in SfxHintPoster::DoEvent_Impl (this=0x11488e0, pPostedHint=0x1484f20) at /home/rodo/git/ooxml/sfx2/source/notify/hintpost.cxx:88 + #35 0x00002b0fcb1a974f in SfxHintPoster::LinkStubDoEvent_Impl (pThis=0x11488e0, pCaller=0x1484f20) at /home/rodo/git/ooxml/sfx2/source/notify/hintpost.cxx:92 + #36 0x00002b0fccef69f8 in ImplWindowFrameProc () from /opt/libreoffice/program/../basis-link/program/libvcllx.so + #37 0x00002b0fd3f91f8f in SalDisplay::DispatchInternalEvent () from /opt/libreoffice/basis3.0/program/libvclplug_genlx.so + #38 0x00002b0fd0fa4a84 in GtkXLib::userEventFn () from /opt/libreoffice/basis3.0/program/libvclplug_gtklx.so + #39 0x00002b0fd3cb0204 in g_main_context_dispatch () from /usr/lib64/libglib-2.0.so.0 + #40 0x00002b0fd3cb34fd in ?? () from /usr/lib64/libglib-2.0.so.0 + #41 0x00002b0fd3cb39ce in g_main_context_iteration () from /usr/lib64/libglib-2.0.so.0 + #42 0x00002b0fd0fa4fd9 in GtkXLib::Yield () from /opt/libreoffice/basis3.0/program/libvclplug_gtklx.so + #43 0x00002b0fccd1859e in Application::Yield () from /opt/libreoffice/program/../basis-link/program/libvcllx.so + #44 0x00002b0fccd18677 in Application::Execute () from /opt/libreoffice/program/../basis-link/program/libvcllx.so + #45 0x00002b0fc86fd803 in ?? () from /opt/libreoffice/program/../basis-link/program/libsoffice.so + #46 0x00002b0fccd1da24 in ImplSVMain () from /opt/libreoffice/program/../basis-link/program/libvcllx.so + #47 0x00002b0fccd1db15 in SVMain () from /opt/libreoffice/program/../basis-link/program/libvcllx.so + #48 0x00002b0fc872fe6c in soffice_main () from /opt/libreoffice/program/../basis-link/program/libsoffice.so + #49 0x000000000040114b in main () diff --git a/oox/source/export/preset-definitions-to-shape-types.pl b/oox/source/export/preset-definitions-to-shape-types.pl new file mode 100644 index 000000000..5760a8609 --- /dev/null +++ b/oox/source/export/preset-definitions-to-shape-types.pl @@ -0,0 +1,1237 @@ +#!/usr/bin/env perl -w +# +# This file is part of the LibreOffice project. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# +# This file incorporates work covered by the following license notice: +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed +# with this work for additional information regarding copyright +# ownership. The ASF licenses this file to you under the Apache +# License, Version 2.0 (the "License"); you may not use this file +# except in compliance with the License. You may obtain a copy of +# the License at http://www.apache.org/licenses/LICENSE-2.0 . +# + +use strict; +use warnings; + +sub usage() { + print STDERR < + +Converts presetShapeDefinitions.xml and presetTextWarpDefinitions.xml to a +.cxx that contains VML with the definitions of the shapes. The result is +written to stdout. + + presetShapeDefinitions.xml (including the path to it) + presetTextWarpDefinitions.xml (including the path to it) +EOF + exit 1; +} + +sub show_call_stack +{ + my ( $path, $line, $subr ); + my $max_depth = 30; + my $i = 1; + print STDERR "--- Begin stack trace ---\n"; + while ( (my @call_details = (caller($i++))) && ($i<$max_depth) ) { + print STDERR "$call_details[1] line $call_details[2] in function $call_details[3]\n"; + } + print STDERR "--- End stack trace ---\n"; +} + +my $drawingml_adj_names_data = 0; +my $vml_shape_types_data = 0; +my $src_shapes = shift; +if ($src_shapes eq "--drawingml-adj-names-data") { + $drawingml_adj_names_data = 1; + $src_shapes = shift; +} elsif ($src_shapes eq "--vml-shape-types-data") { + $vml_shape_types_data = 1; + $src_shapes = shift; +} +my $src_text = shift; + +usage() if ( !defined( $src_shapes ) || !defined( $src_text ) || + $src_shapes eq "-h" || $src_shapes eq "--help" || + !-f $src_shapes || !-f $src_text ); + +# Global variables +my @levels = (); +my $shape_name = ""; +my $state = ""; +my $path = ""; +my $adjust = ""; +my %adj_names; +my $max_adj_no = 0; +my @formulas = (); +my %variables = (); +my $ignore_this_shape = 0; +my $handles = ""; +my $textboxrect = ""; +my $last_pos_x = ""; +my $last_pos_y = ""; +my $no_stroke = 0; +my $no_fill = 0; +my $path_w = 1; +my $path_h = 1; +my @quadratic_bezier = (); + +my %result_shapes = (); + +my %shapes_ids = ( + 0 => 'notPrimitive', + 1 => 'rectangle', + 2 => 'roundRectangle', + 3 => 'ellipse', + 4 => 'diamond', + 5 => 'triangle', + 6 => 'rtTriangle', + 7 => 'parallelogram', + 8 => 'trapezoid', + 9 => 'hexagon', + 10 => 'octagon', + 11 => 'plus', + 12 => 'star5', + 13 => 'rightArrow', + 14 => 'thickArrow', # should not be used + 15 => 'homePlate', + 16 => 'cube', + 17 => 'wedgeRoundRectCallout', # balloon + 18 => 'star16', # seal + 19 => 'arc', + 20 => 'line', + 21 => 'plaque', + 22 => 'can', + 23 => 'donut', + 24 => 'textPlain', # textSimple - FIXME MS Office 2007 converts these to textboxes with unstyled text, so is it actually correct to map it to a real style? + 25 => 'textStop', # textOctagon FIXME see 24 + 26 => 'textTriangle', # textHexagon FIXMME see 24 + 27 => 'textCanDown', # textCurve FIXMME see 24 + 28 => 'textWave1', # textWave FIXMME see 24 + 29 => 'textArchUpPour', # textRing FIXMME see 24 + 30 => 'textCanDown', # textOnCurve FIXMME see 24 + 31 => 'textArchUp', # textOnRing FIXMME see 24 + 32 => 'straightConnector1', + 33 => 'bentConnector2', + 34 => 'bentConnector3', + 35 => 'bentConnector4', + 36 => 'bentConnector5', + 37 => 'curvedConnector2', + 38 => 'curvedConnector3', + 39 => 'curvedConnector4', + 40 => 'curvedConnector5', + 41 => 'callout1', + 42 => 'callout2', + 43 => 'callout3', + 44 => 'accentCallout1', + 45 => 'accentCallout2', + 46 => 'accentCallout3', + 47 => 'borderCallout1', + 48 => 'borderCallout2', + 49 => 'borderCallout3', + 50 => 'accentBorderCallout1', + 51 => 'accentBorderCallout2', + 52 => 'accentBorderCallout3', + 53 => 'ribbon', + 54 => 'ribbon2', + 55 => 'chevron', + 56 => 'pentagon', + 57 => 'noSmoking', + 58 => 'star8', # seal8 + 59 => 'star16', # seal16 + 60 => 'star32', # seal32 + 61 => 'wedgeRectCallout', + 62 => 'wedgeRoundRectCallout', # wedgeRRectCallout + 63 => 'wedgeEllipseCallout', + 64 => 'wave', + 65 => 'foldedCorner', + 66 => 'leftArrow', + 67 => 'downArrow', + 68 => 'upArrow', + 69 => 'leftRightArrow', + 70 => 'upDownArrow', + 71 => 'irregularSeal1', + 72 => 'irregularSeal2', + 73 => 'lightningBolt', + 74 => 'heart', + 75 => 'pictureFrame', + 76 => 'quadArrow', + 77 => 'leftArrowCallout', + 78 => 'rightArrowCallout', + 79 => 'upArrowCallout', + 80 => 'downArrowCallout', + 81 => 'leftRightArrowCallout', + 82 => 'upDownArrowCallout', + 83 => 'quadArrowCallout', + 84 => 'bevel', + 85 => 'leftBracket', + 86 => 'rightBracket', + 87 => 'leftBrace', + 88 => 'rightBrace', + 89 => 'leftUpArrow', + 90 => 'bentUpArrow', + 91 => 'bentArrow', + 92 => 'star24', # seal24 + 93 => 'stripedRightArrow', + 94 => 'notchedRightArrow', + 95 => 'blockArc', + 96 => 'smileyFace', + 97 => 'verticalScroll', + 98 => 'horizontalScroll', + 99 => 'circularArrow', + 100 => 'notchedCircularArrow', # should not be used + 101 => 'uturnArrow', + 102 => 'curvedRightArrow', + 103 => 'curvedLeftArrow', + 104 => 'curvedUpArrow', + 105 => 'curvedDownArrow', + 106 => 'cloudCallout', + 107 => 'ellipseRibbon', + 108 => 'ellipseRibbon2', + 109 => 'flowChartProcess', + 110 => 'flowChartDecision', + 111 => 'flowChartInputOutput', + 112 => 'flowChartPredefinedProcess', + 113 => 'flowChartInternalStorage', + 114 => 'flowChartDocument', + 115 => 'flowChartMultidocument', + 116 => 'flowChartTerminator', + 117 => 'flowChartPreparation', + 118 => 'flowChartManualInput', + 119 => 'flowChartManualOperation', + 120 => 'flowChartConnector', + 121 => 'flowChartPunchedCard', + 122 => 'flowChartPunchedTape', + 123 => 'flowChartSummingJunction', + 124 => 'flowChartOr', + 125 => 'flowChartCollate', + 126 => 'flowChartSort', + 127 => 'flowChartExtract', + 128 => 'flowChartMerge', + 129 => 'flowChartOfflineStorage', + 130 => 'flowChartOnlineStorage', + 131 => 'flowChartMagneticTape', + 132 => 'flowChartMagneticDisk', + 133 => 'flowChartMagneticDrum', + 134 => 'flowChartDisplay', + 135 => 'flowChartDelay', + 136 => 'textPlain', # textPlainText + 137 => 'textStop', + 138 => 'textTriangle', + 139 => 'textTriangleInverted', + 140 => 'textChevron', + 141 => 'textChevronInverted', + 142 => 'textRingInside', + 143 => 'textRingOutside', + 144 => 'textArchUp', # textArchUpCurve + 145 => 'textArchDown', # textArchDownCurve + 146 => 'textCircle', # textCircleCurve + 147 => 'textButton', # textButtonCurve + 148 => 'textArchUpPour', + 149 => 'textArchDownPour', + 150 => 'textCirclePour', + 151 => 'textButtonPour', + 152 => 'textCurveUp', + 153 => 'textCurveDown', + 154 => 'textCascadeUp', + 155 => 'textCascadeDown', + 156 => 'textWave1', + 157 => 'textWave2', + 158 => 'textWave3', + 159 => 'textWave4', + 160 => 'textInflate', + 161 => 'textDeflate', + 162 => 'textInflateBottom', + 163 => 'textDeflateBottom', + 164 => 'textInflateTop', + 165 => 'textDeflateTop', + 166 => 'textDeflateInflate', + 167 => 'textDeflateInflateDeflate', + 168 => 'textFadeRight', + 169 => 'textFadeLeft', + 170 => 'textFadeUp', + 171 => 'textFadeDown', + 172 => 'textSlantUp', + 173 => 'textSlantDown', + 174 => 'textCanUp', + 175 => 'textCanDown', + 176 => 'flowChartAlternateProcess', + 177 => 'flowChartOffpageConnector', + 178 => 'callout1', # callout90 + 179 => 'accentCallout1', # accentCallout90 + 180 => 'borderCallout1', # borderCallout90 + 181 => 'accentBorderCallout1', # accentBorderCallout90 + 182 => 'leftRightUpArrow', + 183 => 'sun', + 184 => 'moon', + 185 => 'bracketPair', + 186 => 'bracePair', + 187 => 'star4', # seal4 + 188 => 'doubleWave', + 189 => 'actionButtonBlank', + 190 => 'actionButtonHome', + 191 => 'actionButtonHelp', + 192 => 'actionButtonInformation', + 193 => 'actionButtonForwardNext', + 194 => 'actionButtonBackPrevious', + 195 => 'actionButtonEnd', + 196 => 'actionButtonBeginning', + 197 => 'actionButtonReturn', + 198 => 'actionButtonDocument', + 199 => 'actionButtonSound', + 200 => 'actionButtonMovie', + 201 => 'hostControl', + 202 => 'textBox' +); +# An error occurred, we have to ignore this shape +sub error( $ ) +{ + my ( $msg ) = @_; + + $ignore_this_shape = 1; + print STDERR "ERROR (in $shape_name ): $msg\n"; +} + +# Setup the %variables map with predefined values +sub setup_variables() +{ + %variables = ( + 'l' => 0, + 't' => 0, + 'r' => 21600, + 'b' => 21600, + + 'w' => 21600, + 'h' => 21600, + 'ss' => 21600, + 'ls' => 21600, + + 'ssd2' => 10800, # 1/2 + 'ssd4' => 5400, # 1/4 + 'ssd6' => 3600, # 1/6 + 'ssd8' => 2700, # 1/8 + 'ssd16' => 1350, # 1/16 + 'ssd32' => 675, # 1/32 + + 'hc' => 10800, # horizontal center + 'vc' => 10800, # vertical center + + 'wd2' => 10800, # 1/2 + 'wd3' => 7200, # 1/3 + 'wd4' => 5400, # 1/4 + 'wd5' => 4320, # 1/5 + 'wd6' => 3600, # 1/6 + 'wd8' => 2700, # 1/8 + 'wd10' => 2160, # 1/10 + 'wd12' => 1800, # 1/12 + 'wd32' => 675, # 1/32 + + 'hd2' => 10800, # 1/2 + 'hd3' => 7200, # 1/3 + 'hd4' => 5400, # 1/4 + 'hd5' => 4320, # 1/5 + 'hd6' => 3600, # 1/6 + 'hd8' => 2700, # 1/8 + 'hd10' => 2160, # 1/10 + 'hd12' => 1800, # 1/12 + 'hd32' => 675, # 1/32 + + '25000' => 5400, + '12500' => 2700, + + 'cd4' => 90, # 1/4 of a circle + 'cd2' => 180, # 1/2 of a circle + '3cd4' => 270, # 3/4 of a circle + + 'cd8' => 45, # 1/8 of a circle + '3cd8' => 135, # 3/8 of a circle + '5cd8' => 225, # 5/8 of a circle + '7cd8' => 315, # 7/8 of a circle + + '-5400000' => -90, + '-10800000'=> -180, + '-16200000'=> -270, + '-21600000'=> -360, + '-21599999'=> -360, + + '5400000' => 90, + '10800000' => 180, + '16200000' => 270, + '21600000' => 360, + '21599999' => 360 +# +# '21600000' => 360, # angle conversions +# '27000000' => 450, +# '32400000' => 540, +# '37800000' => 630 + ); +} + +# Convert the (predefined) value to a number +sub value( $ ) +{ + my ( $val ) = @_; + + my $result = $variables{$val}; + return $result if ( defined( $result ) ); + + return $val if ( $val =~ /^[0-9-]+$/ ); + + error( "Unknown variable '$val'." ); + + show_call_stack(); + return $val; +} + +# Convert the DrawingML formula to a VML one +my %command_variables = ( + 'w' => 'width', + 'h' => 'height', + 'r' => 'width', + 'b' => 'height' +); + +# The same as value(), but some of the hardcoded values can have a name +sub command_value( $ ) +{ + my ( $value ) = @_; + + return "" if ( $value eq "" ); + + return $value if ( $value =~ /^@/ ); + + my $command_val = $command_variables{$value}; + if ( defined( $command_val ) ) { + return $command_val; + } + + return value( $value ); +} + +# Insert the new formula to the list of formulas +# Creates the name if it's empty... +sub insert_formula( $$ ) +{ + my ( $name, $fmla ) = @_; + + my $i = 0; + foreach my $f ( @formulas ) { + if ( $f eq $fmla ) { + if ( $name ne "" ) { + $variables{$name} = "@" . $i; + } + return "@" . $i; + } + ++$i; + } + + if ( $name eq "" ) { + $name = "@" . ( $#formulas + 1 ); + } + + $variables{$name} = "@" . ( $#formulas + 1 ); + push @formulas, $fmla; + + if ( $#formulas > 127 ) { + error( "Reached the maximum amount of formulas, have to ignore the shape '$shape_name'" ); + } + + return $variables{$name}; +} + +# The same as insert_formula(), but converts the params +sub insert_formula_params( $$$$$ ) +{ + my ( $name, $command, $p1, $p2, $p3 ) = @_; + + my $result = $command; + if ( $p1 ne "" ) { + $result .= " " . command_value( $p1 ); + if ( $p2 ne "" ) { + $result .= " " . command_value( $p2 ); + if ( $p3 ne "" ) { + $result .= " " . command_value( $p3 ); + } + } + } + + return insert_formula( $name, $result ); +} + +# Convert the formula from DrawingML to VML +sub convert_formula( $$ ) +{ + my ( $name, $fmla ) = @_; + + if ( $fmla =~ /^([^ ]+)/ ) { + my $command = $1; + + # parse the parameters + ( my $values = $fmla ) =~ s/^([^ ]+) *//; + my $p1 = ""; + my $p2 = ""; + my $p3 = ""; + if ( $values =~ /^([^ ]+)/ ) { + $p1 = $1; + $values =~ s/^([^ ]+) *//; + if ( $values =~ /^([^ ]+)/ ) { + $p2 = $1; + $values =~ s/^([^ ]+) *//; + if ( $values =~ /^([^ ]+)/ ) { + $p3 = $1; + } + } + } + + # now convert the formula + if ( $command eq "+-" ) { + if ( $p1 eq "100000" ) { + $p1 = value( 'w' ); + } + insert_formula_params( $name, "sum", $p1, $p2, $p3 ); + return; + } + elsif ( $command eq "*/" ) { + if ( ( $p2 =~ /^(w|h|ss|hd2|wd2|vc)$/ ) && defined( $variables{$p1} ) ) { + # switch it ;-) - presetTextWarpDefinitions.xml has it in other order + my $tmp = $p1; + $p1 = $p2; + $p2 = $tmp; + } + + if ( ( $p1 =~ /^(w|h|ss|hd2|wd2|vc)$/ ) && defined( $variables{$p2} ) ) { + my $val3 = $p3; + if ( $val3 =~ /^[0-9-]+$/ ) { + $val3 *= ( value( 'w' ) / value( $p1 ) ); + + # Oh yes, I'm too lazy to implement the full GCD here ;-) + if ( ( $val3 % 100000 ) == 0 ) { + $p1 = 1; + $p3 = sprintf( "%.0f", ( $val3 / 100000 ) ); + } + elsif ( $val3 < 100000 ) { + $p3 = 1; + while ( ( ( $p3 * 100000 ) % $val3 ) != 0 ) { + ++$p3 + } + $p1 = ( $p3 * 100000 ) / $val3; + } + else { + error( "Need to count the greatest common divisor." ); + } + } + } + elsif ( $p3 eq "100000" && $p2 =~ /^[0-9-]+$/ ) { + # prevent overflows in some shapes + $p2 = sprintf( "%.0f", ( $p2 / 10 ) ); + $p3 /= 10; + } + elsif ( $p3 eq "32768" && $p2 =~ /^[0-9-]+$/ ) { + # prevent overflows in some shapes + $p2 = sprintf( "%.0f", ( $p2 / 8 ) ); + $p3 /= 8; + } + elsif ( $p3 eq "50000" ) { + $p3 = 10800; + } + elsif ( $name =~ /^maxAdj/ ) { + my $val = value( $p1 ); + if ( $val =~ /^[0-9-]+$/ ) { + $p1 = sprintf( "%.0f", ( value( 'w' ) * $val / 100000 ) ); + } + } + + if ( ( value( $p1 ) eq value( $p3 ) ) || ( value( $p2 ) eq value( $p3 ) ) ) { + my $val = value( ( value( $p1 ) eq value( $p3 ) )? $p2: $p1 ); + if ( $val =~ /^@([0-9]+)$/ ) { + insert_formula( $name, $formulas[$1] ); + } + else { + insert_formula( $name, "val $val" ); + } + } + else { + insert_formula_params( $name, "prod", $p1, $p2, $p3 ); + } + return; + } + elsif ( $command eq "+/" ) { + # we have to split this into 2 formulas - 'sum' and 'prod' + my $constructed = insert_formula_params( "", "sum", $p1, $p2, "0" ); + insert_formula_params( $name, "prod", 1, $constructed, $p3); # references the 'sum' formula + return; + } + elsif ( $command eq "?:" ) { + insert_formula_params( $name, "if", $p1, $p2, $p3 ); + return; + } + elsif ( $command eq "sin" || $command eq "cos" ) { + if ( $p2 =~ /^[0-9-]+$/ && ( ( $p2 % 60000 ) == 0 ) ) { + $p2 /= 60000; + } + else { + $p2 = insert_formula_params( "", "prod", "1", $p2, "60000" ); + } + # we have to use 'sumangle' even for the case when $p2 is const + # and theoretically could be written as such; but Word does not + # accept it :-( + my $conv = insert_formula_params( "", "sumangle", "0", $p2, "0" ); + + $p2 = $conv; + + insert_formula_params( $name, $command, $p1, $p2, "" ); + return; + } + elsif ( $command eq "abs" ) { + insert_formula_params( $name, $command, $p1, "", "" ); + return; + } + elsif ( $command eq "max" || $command eq "min" ) { + insert_formula_params( $name, $command, $p1, $p2, "" ); + return; + } + elsif ( $command eq "at2" ) { + insert_formula_params( $name, "atan2", $p1, $p2, "" ); + return; + } + elsif ( $command eq "cat2" ) { + insert_formula_params( $name, "cosatan2", $p1, $p2, $p3 ); + return; + } + elsif ( $command eq "sat2" ) { + insert_formula_params( $name, "sinatan2", $p1, $p2, $p3 ); + return; + } + elsif ( $command eq "sqrt" ) { + insert_formula_params( $name, "sqrt", $p1, "", "" ); + return; + } + elsif ( $command eq "mod" ) { + insert_formula_params( $name, "mod", $p1, $p2, $p3 ); + return; + } + elsif ( $command eq "val" ) { + insert_formula_params( $name, "val", value( $p1 ), "", "" ); + return; + } + else { + error( "Unknown formula '$name', '$fmla'." ); + } + } + else { + error( "Cannot convert formula's command '$name', '$fmla'." ); + } +} + +# There's no exact equivalent of 'arcTo' in VML, we have to do some special casing... +my %convert_arcTo = ( + '0' => { + '90' => { + 'path' => 'qy', + 'op' => [ 'sum 0 __last_x__ __wR__', 'sum __hR__ __last_y__ 0' ], + }, + '-90' => { + 'path' => 'qy', + 'op' => [ 'sum 0 __last_x__ __wR__', 'sum 0 __last_y__ __hR__' ], + }, + }, + '90' => { + '90' => { + 'path' => 'qx', + 'op' => [ 'sum 0 __last_x__ __wR__', 'sum 0 __last_y__ __hR__' ], + }, + '-90' => { + 'path' => 'qx', + 'op' => [ 'sum __wR__ __last_x__ 0', 'sum 0 __last_y__ __hR__' ], + }, + }, + '180' => { + '90' => { + 'path' => 'qy', + 'op' => [ 'sum __wR__ __last_x__ 0', 'sum 0 __last_y__ __hR__' ], + }, + '-90' => { + 'path' => 'qy', + 'op' => [ 'sum __wR__ __last_x__ 0', 'sum __hR__ __last_y__ 0' ], + }, + }, + '270' => { + '90' => { + 'path' => 'qx', + 'op' => [ 'sum __wR__ __last_x__ 0', 'sum __hR__ __last_y__ 0' ], + }, + '-90' => { + 'path' => 'qx', + 'op' => [ 'sum 0 __last_x__ __wR__', 'sum __hR__ __last_y__ 0' ], + }, + }, +); + +# Elliptic quadrant +# FIXME optimize so that we compute the const values when possible +sub elliptic_quadrant( $$$$ ) +{ + my ( $wR, $hR, $stAng, $swAng ) = @_; + + if ( defined( $convert_arcTo{$stAng} ) && defined( $convert_arcTo{$stAng}{$swAng} ) ) { + my $conv_path = $convert_arcTo{$stAng}{$swAng}{'path'}; + my $conv_op_ref = $convert_arcTo{$stAng}{$swAng}{'op'}; + + $path .= "$conv_path"; + + my $pos_x = $last_pos_x; + my $pos_y = $last_pos_y; + for ( my $i = 0; $i <= $#{$conv_op_ref}; ++$i ) { + my $op = $conv_op_ref->[$i]; + + $op =~ s/__last_x__/$last_pos_x/g; + $op =~ s/__last_y__/$last_pos_y/g; + $op =~ s/__wR__/$wR/g; + $op =~ s/__hR__/$hR/g; + + my $fmla = insert_formula( "", $op ); + + $path .= $fmla; + + # so far it's sufficient just to rotate the positions + # FIXME if not ;-) + $pos_x = $pos_y; + $pos_y = $fmla; + } + $last_pos_x = $pos_x; + $last_pos_y = $pos_y; + } + else { + error( "Unhandled elliptic_quadrant(), input is ($wR, $hR, $stAng, $swAng)." ); + } +} + +# Convert the quadratic bezier to cubic (exact) +# No idea why, but the 'qb' did not work for me :-( +sub quadratic_to_cubic_bezier( $ ) +{ + my ( $axis ) = @_; + + my $a0 = $quadratic_bezier[0]->{$axis}; + my $a1 = $quadratic_bezier[1]->{$axis}; + my $a2 = $quadratic_bezier[2]->{$axis}; + + my $b0 = $a0; + + # $b1 = $a0 + 2/3 * ( $a1 - $a0 ), but in VML + # FIXME optimize for constants - compute directly + my $b1_1 = insert_formula_params( "", "sum", "0", $a1, $a0 ); + my $b1_2 = insert_formula_params( "", "prod", "2", $b1_1, "3" ); + my $b1 = insert_formula_params( "", "sum", $a0, $b1_2, "0" ); + + # $b2 = $b1 + 1/3 * ( $a2 - $a0 ); + # FIXME optimize for constants - compute directly + my $b2_1 = insert_formula_params( "", "sum", "0", $a2, $a0 ); + my $b2_2 = insert_formula_params( "", "prod", "1", $b2_1, "3" ); + my $b2 = insert_formula_params( "", "sum", $b1, $b2_2, "0" ); + + my $b3 = $a2; + + return ( $b0, $b1, $b2, $b3 ); +} + +# Extend $path by one more point +sub add_point_to_path( $$ ) +{ + my ( $x, $y ) = @_; + + if ( $path =~ /[0-9]$/ && $x =~ /^[0-9-]/ ) { + $path .= ","; + } + $path .= $x; + + if ( $path =~ /[0-9]$/ && $y =~ /^[0-9-]/ ) { + $path .= ","; + } + $path .= $y; +} + +# Start of an element +sub start_element( $% ) +{ + my ( $element, %attr ) = @_; + + push @levels, $element; + + #print "element: $element\n"; + + if ( @levels > 1 && ( $levels[-2] eq "presetShapeDefinitons" || + $levels[-2] eq "presetTextWarpDefinitions" ) ) { + $shape_name = $element; + + $state = ""; + $ignore_this_shape = 0; + $path = ""; + $adjust = ""; + $max_adj_no = 0; + @formulas = (); + $handles = ""; + $textboxrect = ""; + $last_pos_x = ""; + $last_pos_y = ""; + $no_stroke = 0; + $no_fill = 0; + @quadratic_bezier = (); + + setup_variables(); + + if ( $shape_name eq "sun" ) { + # hack for this shape + $variables{'100000'} = "21600"; + $variables{'50000'} = "10800"; + $variables{'25000'} = "5400"; + $variables{'12500'} = "2700"; + $variables{'3662'} = "791"; + } + + my $found = 0; + foreach my $name ( values( %shapes_ids ) ) { + if ( $name eq $shape_name ) { + $found = 1; + last; + } + } + if ( !$found ) { + error( "Unknown shape '$shape_name'." ); + } + } + elsif ( $element eq "pathLst" ) { + $state = "path"; + } + elsif ( $element eq "avLst" ) { + $state = "adjust"; + } + elsif ( $element eq "gdLst" ) { + $state = "formulas"; + } + elsif ( $element eq "ahLst" ) { + $state = "handles"; + } + elsif ( $element eq "rect" ) { + $textboxrect = value( $attr{'l'} ) . "," . value( $attr{'t'} ) . "," . + value( $attr{'r'} ) . "," . value( $attr{'b'} ); + } + elsif ( $state eq "path" ) { + if ( $element eq "path" ) { + $no_stroke = ( defined( $attr{'stroke'} ) && $attr{'stroke'} eq 'false' ); + $no_fill = ( defined( $attr{'fill'} ) && $attr{'fill'} eq 'none' ); + $path_w = $attr{'w'}; + $path_h = $attr{'h'}; + } + elsif ( $element eq "moveTo" ) { + $path .= "m"; + } + elsif ( $element eq "lnTo" ) { + $path .= "l"; + } + elsif ( $element eq "cubicBezTo" ) { + $path .= "c"; + } + elsif ( $element eq "quadBezTo" ) { + my %points = ( 'x' => $last_pos_x, 'y' => $last_pos_y ); + @quadratic_bezier = ( \%points ); + } + elsif ( $element eq "close" ) { + $path .= "x"; + } + elsif ( $element eq "pt" ) { + # remember the last position for the arcTo + $last_pos_x = value( $attr{'x'} ); + $last_pos_y = value( $attr{'y'} ); + + $last_pos_x *= ( value( 'w' ) / $path_w ) if ( defined( $path_w ) ); + $last_pos_y *= ( value( 'h' ) / $path_h ) if ( defined( $path_h ) ); + + if ( $#quadratic_bezier >= 0 ) { + my %points = ( 'x' => $last_pos_x, 'y' => $last_pos_y ); + push( @quadratic_bezier, \%points ); + } + else { + add_point_to_path( $last_pos_x, $last_pos_y ); + } + } + elsif ( ( $element eq "arcTo" ) && ( $last_pos_x ne "" ) && ( $last_pos_y ne "" ) ) { + # there's no exact equivalent of arcTo in VML, so we have to + # compute here a bit... + my $stAng = value( $attr{'stAng'} ); + my $swAng = value( $attr{'swAng'} ); + my $wR = value( $attr{'wR'} ); + my $hR = value( $attr{'hR'} ); + + $wR *= ( value( 'w' ) / $path_w ) if ( defined( $path_w ) ); + $hR *= ( value( 'h' ) / $path_h ) if ( defined( $path_h ) ); + + if ( ( $stAng =~ /^[0-9-]+$/ ) && ( $swAng =~ /^[0-9-]+$/ ) ) { + if ( ( ( $stAng % 90 ) == 0 ) && ( ( $swAng % 90 ) == 0 ) && ( $swAng != 0 ) ) { + my $end = $stAng + $swAng; + my $step = ( $swAng > 0 )? 90: -90; + + for ( my $cur = $stAng; $cur != $end; $cur += $step ) { + elliptic_quadrant( $wR, $hR, ( $cur % 360 ), $step ); + } + } + else { + error( "Unsupported numeric 'arcTo' ($attr{'wR'}, $attr{'hR'}, $stAng, $swAng)." ); + } + } + else { + error( "Unsupported 'arcTo' conversion ($attr{'wR'}, $attr{'hR'}, $stAng, $swAng)." ); + } + } + else { + error( "Unhandled path element '$element'." ); + } + } + elsif ( $state eq "adjust" ) { + if ( $element eq "gd" ) { + my $adj_no = $attr{'name'}; + + # Save this adj number for this type for later use. + push(@{$adj_names{$shape_name}}, $adj_no); + + my $is_const = 0; + + $adj_no =~ s/^adj//; + if ( $adj_no eq "" ) { + $max_adj_no = 0; + } + elsif ( !( $adj_no =~ /^[0-9]*$/ ) ) { + ++$max_adj_no; + $is_const = 1; + } + elsif ( $adj_no != $max_adj_no + 1 ) { + error( "Wrong order of adj values." ); + ++$max_adj_no; + } + else { + $max_adj_no = $adj_no; + } + + if ( $attr{'fmla'} =~ /^val ([0-9-]*)$/ ) { + my $val = sprintf( "%.0f", ( 21600 * $1 ) / 100000 ); + if ( $is_const ) { + $variables{$adj_no} = $val; + } + elsif ( $adjust eq "" ) { + $adjust = $val; + } + else { + $adjust = "$val,$adjust"; + } + } + else { + error( "Wrong fmla '$attr{'fmla'}'." ); + } + } + else { + error( "Unhandled adjust element '$element'." ); + } + } + elsif ( $state eq "formulas" ) { + if ( $element eq "gd" ) { + if ( $attr{'fmla'} =~ /^\*\/ (h|w|ss) adj([0-9]+) 100000$/ ) { + insert_formula( $attr{'name'}, "val #" . ( $max_adj_no - $2 ) ); + } + elsif ( $attr{'fmla'} =~ /^pin [^ ]+ ([^ ]+) / ) { + print STDERR "TODO Map 'pin' to VML as xrange for handles.\n"; + my $pin_val = $1; + if ( $pin_val eq "adj" ) { + insert_formula( $attr{'name'}, "val #0" ); + } + elsif ( $pin_val =~ /^adj([0-9]+)/ ) { + insert_formula( $attr{'name'}, "val #" . ( $max_adj_no - $1 ) ); + } + else { + insert_formula( $attr{'name'}, "val " . value( $pin_val ) ); + } + } + elsif ( $attr{'fmla'} =~ /adj/ ) { + error( "Non-standard usage of adj in '$attr{'fmla'}'." ); + } + else { + convert_formula( $attr{'name'}, $attr{'fmla'} ); + } + } + } + elsif ( $state eq "handles" ) { + if ( $element eq "pos" ) { + $handles .= "\n"; + } + } +} + +# End of an element +sub end_element( $ ) +{ + my ( $element ) = @_; + + pop @levels; + + if ( $element eq $shape_name ) { + if ( !$ignore_this_shape ) { + # we have all the info, generate the shape now + $state = ""; + + # shape path + my $out = "\n"; + + # stroke + $out .= "\n"; + + # formulas + if ( $#formulas >= 0 ) + { + $out .= "\n"; + foreach my $fmla ( @formulas ) { + $out .= "\n" + } + $out .= "\n"; + } + + # path + if ( $textboxrect ne "" ) { # TODO connectlocs, connectangles + $out .= "\n"; + } + + # handles + if ( $handles ne "" ) { + $out .= "\n$handles\n"; + } + + $out .=""; + + # hooray! :-) + $result_shapes{$shape_name} = $out; + } + else { + print STDERR "Shape '$shape_name' ignored; see the above error(s) for the reason.\n"; + } + $shape_name = ""; + } + elsif ( $state eq "path" ) { + if ( $element eq "path" ) { + $path .= "ns" if ( $no_stroke ); + $path .= "nf" if ( $no_fill ); + $path .= "e"; + } + elsif ( $element eq "quadBezTo" ) { + # we have to convert the quadratic bezier to cubic + if ( $#quadratic_bezier == 2 ) { + my @points_x = quadratic_to_cubic_bezier( 'x' ); + my @points_y = quadratic_to_cubic_bezier( 'y' ); + + $path .= "c"; + # ignore the starting point + for ( my $i = 1; $i < 4; ++$i ) { + add_point_to_path( $points_x[$i], $points_y[$i] ); + } + } + else { + error( "Wrong number of points of the quadratic bezier." ); + } + @quadratic_bezier = (); + } + } + elsif ( $element eq "avLst" ) { + $state = ""; + } + elsif ( $element eq "gdLst" ) { + $state = ""; + } + elsif ( $element eq "ahLst" ) { + $state = ""; + } +} + +# Text inside an element +sub characters( $ ) +{ + #my ( $text ) = @_; +} + +#################### A trivial XML parser #################### + +# Parse the attributes +sub parse_start_element( $ ) +{ + # split the string containing both the elements and attributes + my ( $element_tmp ) = @_; + + $element_tmp =~ s/\s*$//; + $element_tmp =~ s/^\s*//; + + ( my $element = $element_tmp ) =~ s/\s.*$//; + if ( $element_tmp =~ /\s/ ) { + $element_tmp =~ s/^[^\s]*\s//; + } + else { + $element_tmp = ""; + } + + # we have the element, now the attributes + my %attr; + my $is_key = 1; + my $key = ""; + foreach my $tmp ( split( /"/, $element_tmp ) ) { + if ( $is_key ) { + $key = $tmp; + $key =~ s/^\s*//; + $key =~ s/\s*=\s*$//; + } + else { + $attr{$key} = $tmp; + } + $is_key = !$is_key; + } + + if ( $element ne "" ) { + start_element( $element, %attr ); + } +} + +# Parse the file +sub parse( $ ) +{ + my ( $file ) = @_; + + my $in_comment = 0; + my $line = ""; + while (<$file>) { + # ignore comments + s/<\?[^>]*\?>//g; + s///g; + if ( // && $in_comment ) { + $in_comment = 0; + s/.*-->//; + } + elsif ( $in_comment ) { + next; + } + # ignore empty lines + chomp; + s/^\s*//; + s/\s*$//; + next if ( $_ eq "" ); + + # take care of lines where element continues + if ( $line ne "" ) { + $line .= " " . $_; + } + else { + $line = $_; + } + next if ( !/>$/ ); + + # the actual parsing + my @starts = split( //, $start ); + my $element = $ends[0]; + my $data = $ends[1]; + + # start or end element + if ( $element =~ /^\/(.*)/ ) { + end_element( $1 ); + } + elsif ( $element =~ /^(.*)\/$/ ) { + parse_start_element( $1 ); + ( my $end = $1 ) =~ s/\s.*$//; + end_element( $end ); + } + else { + parse_start_element( $element ); + } + + # the data + characters( $data ) if ( defined( $data ) && $data ne "" ); + } + } +} + +# Do the real work +my $file; +open( $file, "<$src_shapes" ) || die "Cannot open $src_shapes: $!"; +parse( $file ); +close( $file ); + +open( $file, "<$src_text" ) || die "Cannot open $src_text: $!"; +parse( $file ); +close( $file ); + +if ( !defined( $result_shapes{'textBox'} ) ) { + # tdf#114842 shapetype id of the textbox, must be the same as defined + $result_shapes{'textBox'} = + "\n" . + "\n" . + "\n" . + ""; +} + +# Generate the data +if ($drawingml_adj_names_data eq 1) { + foreach my $adj_name (sort(keys %adj_names)) + { + foreach my $adj (@{$adj_names{$adj_name}}) + { + print "$adj_name\t$adj\n"; + } + } + exit 0; +} elsif ($vml_shape_types_data eq 1) { + for ( my $i = 0; $i < 203; ++$i ) { + if ( $i < 4 ) { + print "/* $i - $shapes_ids{$i} - handled separately */\nNULL\n"; + } + else { + print "/* $i - $shapes_ids{$i} */\n"; + my $out = $result_shapes{$shapes_ids{$i}}; + if ( defined( $out ) ) { + # set the id + $out =~ s/__ID__/$i/g; + + # output as string + $out =~ s/\n//g; + + print "$out\n"; + } + else { + print "NULL\n"; + } + } + } + exit 0; +} + +# should not happen +exit 1; + +# vim:set ft=perl shiftwidth=4 softtabstop=4 expandtab: # diff --git a/oox/source/export/presetTextWarpDefinitions.xml b/oox/source/export/presetTextWarpDefinitions.xml new file mode 100644 index 000000000..c701c8f82 --- /dev/null +++ b/oox/source/export/presetTextWarpDefinitions.xml @@ -0,0 +1,1885 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/oox/source/export/shapes.cxx b/oox/source/export/shapes.cxx new file mode 100644 index 000000000..df7394995 --- /dev/null +++ b/oox/source/export/shapes.cxx @@ -0,0 +1,2728 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +using namespace ::css; +using namespace ::css::beans; +using namespace ::css::uno; +using namespace ::css::drawing; +using namespace ::css::i18n; +using namespace ::css::table; +using namespace ::css::container; +using namespace ::css::document; +using namespace ::css::text; + +using ::css::io::XOutputStream; +using ::css::chart2::XChartDocument; +using ::css::frame::XModel; + +using ::oox::core::XmlFilterBase; +using ::sax_fastparser::FSHelperPtr; + + +namespace oox { + +static void lcl_ConvertProgID(std::u16string_view rProgID, + OUString & o_rMediaType, OUString & o_rRelationType, OUString & o_rFileExtension) +{ + if (rProgID == u"Excel.Sheet.12") + { + o_rMediaType = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"; + o_rRelationType = oox::getRelationship(Relationship::PACKAGE); + o_rFileExtension = "xlsx"; + } + else if (o3tl::starts_with(rProgID, u"Excel.SheetBinaryMacroEnabled.12") ) + { + o_rMediaType = "application/vnd.ms-excel.sheet.binary.macroEnabled.12"; + o_rRelationType = oox::getRelationship(Relationship::PACKAGE); + o_rFileExtension = "xlsb"; + } + else if (o3tl::starts_with(rProgID, u"Excel.SheetMacroEnabled.12")) + { + o_rMediaType = "application/vnd.ms-excel.sheet.macroEnabled.12"; + o_rRelationType = oox::getRelationship(Relationship::PACKAGE); + o_rFileExtension = "xlsm"; + } + else if (o3tl::starts_with(rProgID, u"Excel.Sheet")) + { + o_rMediaType = "application/vnd.ms-excel"; + o_rRelationType = oox::getRelationship(Relationship::OLEOBJECT); + o_rFileExtension = "xls"; + } + else if (rProgID == u"PowerPoint.Show.12") + { + o_rMediaType = "application/vnd.openxmlformats-officedocument.presentationml.presentation"; + o_rRelationType = oox::getRelationship(Relationship::PACKAGE); + o_rFileExtension = "pptx"; + } + else if (rProgID == u"PowerPoint.ShowMacroEnabled.12") + { + o_rMediaType = "application/vnd.ms-powerpoint.presentation.macroEnabled.12"; + o_rRelationType = oox::getRelationship(Relationship::PACKAGE); + o_rFileExtension = "pptm"; + } + else if (o3tl::starts_with(rProgID, u"PowerPoint.Show")) + { + o_rMediaType = "application/vnd.ms-powerpoint"; + o_rRelationType = oox::getRelationship(Relationship::OLEOBJECT); + o_rFileExtension = "ppt"; + } + else if (o3tl::starts_with(rProgID, u"PowerPoint.Slide.12")) + { + o_rMediaType = "application/vnd.openxmlformats-officedocument.presentationml.slide"; + o_rRelationType = oox::getRelationship(Relationship::PACKAGE); + o_rFileExtension = "sldx"; + } + else if (rProgID == u"PowerPoint.SlideMacroEnabled.12") + { + o_rMediaType = "application/vnd.ms-powerpoint.slide.macroEnabled.12"; + o_rRelationType = oox::getRelationship(Relationship::PACKAGE); + o_rFileExtension = "sldm"; + } + else if (rProgID == u"Word.DocumentMacroEnabled.12") + { + o_rMediaType = "application/vnd.ms-word.document.macroEnabled.12"; + o_rRelationType = oox::getRelationship(Relationship::PACKAGE); + o_rFileExtension = "docm"; + } + else if (rProgID == u"Word.Document.12") + { + o_rMediaType = "application/vnd.openxmlformats-officedocument.wordprocessingml.document"; + o_rRelationType = oox::getRelationship(Relationship::PACKAGE); + o_rFileExtension = "docx"; + } + else if (rProgID == u"Word.Document.8") + { + o_rMediaType = "application/msword"; + o_rRelationType = oox::getRelationship(Relationship::OLEOBJECT); + o_rFileExtension = "doc"; + } + else if (rProgID == u"Excel.Chart.8") + { + o_rMediaType = "application/vnd.ms-excel"; + o_rRelationType = oox::getRelationship(Relationship::OLEOBJECT); + o_rFileExtension = "xls"; + } + else if (rProgID == u"AcroExch.Document.11") + { + o_rMediaType = "application/pdf"; + o_rRelationType = oox::getRelationship(Relationship::OLEOBJECT); + o_rFileExtension = "pdf"; + } + else + { + o_rMediaType = "application/vnd.openxmlformats-officedocument.oleObject"; + o_rRelationType = oox::getRelationship(Relationship::OLEOBJECT); + o_rFileExtension = "bin"; + } +} + +static uno::Reference lcl_StoreOwnAsOOXML( + uno::Reference const& xContext, + uno::Reference const& xObj, + char const*& o_rpProgID, + OUString & o_rMediaType, OUString & o_rRelationType, OUString & o_rSuffix) +{ + static struct { + struct { + sal_uInt32 n1; + sal_uInt16 n2, n3; + sal_uInt8 b8, b9, b10, b11, b12, b13, b14, b15; + } ClassId; + char const* pFilterName; + char const* pMediaType; + char const* pProgID; + char const* pSuffix; + } const s_Mapping[] = { + { {SO3_SW_CLASSID_60}, "MS Word 2007 XML", "application/vnd.openxmlformats-officedocument.wordprocessingml.document", "Word.Document.12", "docx" }, + { {SO3_SC_CLASSID_60}, "Calc MS Excel 2007 XML", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "Excel.Sheet.12", "xlsx" }, + { {SO3_SIMPRESS_CLASSID_60}, "Impress MS PowerPoint 2007 XML", "application/vnd.openxmlformats-officedocument.presentationml.presentation", "PowerPoint.Show.12", "pptx" }, + // FIXME: Draw does not appear to have a MSO format export filter? +// { {SO3_SDRAW_CLASSID}, "", "", "", "" }, + { {SO3_SCH_CLASSID_60}, "unused", "", "", "" }, + { {SO3_SM_CLASSID_60}, "unused", "", "", "" }, + }; + + const char * pFilterName(nullptr); + SvGlobalName const classId(xObj->getClassID()); + for (auto & i : s_Mapping) + { + auto const& rId(i.ClassId); + SvGlobalName const temp(rId.n1, rId.n2, rId.n3, rId.b8, rId.b9, rId.b10, rId.b11, rId.b12, rId.b13, rId.b14, rId.b15); + if (temp == classId) + { + assert(SvGlobalName(SO3_SCH_CLASSID_60) != classId); // chart should be written elsewhere! + assert(SvGlobalName(SO3_SM_CLASSID_60) != classId); // formula should be written elsewhere! + pFilterName = i.pFilterName; + o_rMediaType = OUString::createFromAscii(i.pMediaType); + o_rpProgID = i.pProgID; + o_rSuffix = OUString::createFromAscii(i.pSuffix); + o_rRelationType = oox::getRelationship(Relationship::PACKAGE); + break; + } + } + + if (!pFilterName) + { + SAL_WARN("oox.shape", "oox::GetOLEObjectStream: unknown ClassId " << classId.GetHexName()); + return nullptr; + } + + if (embed::EmbedStates::LOADED == xObj->getCurrentState()) + { + xObj->changeState(embed::EmbedStates::RUNNING); + } + // use a temp stream - while it would work to store directly to a + // fragment stream, an error during export means we'd have to delete it + uno::Reference const xTempStream( + xContext->getServiceManager()->createInstanceWithContext( + "com.sun.star.comp.MemoryStream", xContext), + uno::UNO_QUERY_THROW); + uno::Sequence args( comphelper::InitPropertySequence({ + { "OutputStream", Any(xTempStream->getOutputStream()) }, + { "FilterName", Any(OUString::createFromAscii(pFilterName)) } + })); + uno::Reference xStorable(xObj->getComponent(), uno::UNO_QUERY); + try + { + xStorable->storeToURL("private:stream", args); + } + catch (uno::Exception const&) + { + TOOLS_WARN_EXCEPTION("oox.shape", "oox::GetOLEObjectStream"); + return nullptr; + } + xTempStream->getOutputStream()->closeOutput(); + return xTempStream->getInputStream(); +} + +uno::Reference GetOLEObjectStream( + uno::Reference const& xContext, + uno::Reference const& xObj, + std::u16string_view i_rProgID, + OUString & o_rMediaType, + OUString & o_rRelationType, + OUString & o_rSuffix, + const char *& o_rpProgID) +{ + uno::Reference xInStream; + try + { + uno::Reference const xParent( + uno::Reference(xObj, uno::UNO_QUERY_THROW)->getParent(), + uno::UNO_QUERY_THROW); + uno::Reference const xParentStorage(xParent->getDocumentStorage()); + OUString const entryName( + uno::Reference(xObj, uno::UNO_QUERY_THROW)->getEntryName()); + + if (xParentStorage->isStreamElement(entryName)) + { + lcl_ConvertProgID(i_rProgID, o_rMediaType, o_rRelationType, o_rSuffix); + xInStream = xParentStorage->cloneStreamElement(entryName)->getInputStream(); + // TODO: make it possible to take the sMediaType from the stream + } + else // the object is ODF - either the whole document is + { // ODF, or the OLE was edited so it was converted to ODF + xInStream = lcl_StoreOwnAsOOXML(xContext, xObj, + o_rpProgID, o_rMediaType, o_rRelationType, o_rSuffix); + } + } + catch (uno::Exception const&) + { + TOOLS_WARN_EXCEPTION("oox.shape", "oox::GetOLEObjectStream"); + } + return xInStream; +} + +} // namespace oox + +namespace oox::drawingml { + +#define GETA(propName) \ + GetProperty( rXPropSet, #propName) + +#define GETAD(propName) \ + ( GetPropertyAndState( rXPropSet, rXPropState, #propName, eState ) && eState == beans::PropertyState_DIRECT_VALUE ) + +#define GET(variable, propName) \ + if ( GETA(propName) ) \ + mAny >>= variable; + +ShapeExport::ShapeExport( sal_Int32 nXmlNamespace, FSHelperPtr pFS, ShapeHashMap* pShapeMap, XmlFilterBase* pFB, DocumentType eDocumentType, DMLTextExport* pTextExport, bool bUserShapes ) + : DrawingML( std::move(pFS), pFB, eDocumentType, pTextExport ) + , m_nEmbeddedObjects(0) + , mnShapeIdMax( 1 ) + , mbUserShapes( bUserShapes ) + , mnXmlNamespace( nXmlNamespace ) + , maMapModeSrc( MapUnit::Map100thMM ) + , maMapModeDest( MapUnit::MapInch, Point(), Fraction( 1, 576 ), Fraction( 1, 576 ) ) + , mpShapeMap( pShapeMap ? pShapeMap : &maShapeMap ) +{ + mpURLTransformer = std::make_shared(); +} + +void ShapeExport::SetURLTranslator(const std::shared_ptr& pTransformer) +{ + mpURLTransformer = pTransformer; +} + +awt::Size ShapeExport::MapSize( const awt::Size& rSize ) const +{ + Size aRetSize( OutputDevice::LogicToLogic( Size( rSize.Width, rSize.Height ), maMapModeSrc, maMapModeDest ) ); + + if ( !aRetSize.Width() ) + aRetSize.AdjustWidth( 1 ); + if ( !aRetSize.Height() ) + aRetSize.AdjustHeight( 1 ); + return awt::Size( aRetSize.Width(), aRetSize.Height() ); +} + +static bool IsNonEmptySimpleText(const Reference& xIface) +{ + if (Reference xText{ xIface, UNO_QUERY }) + return xText->getString().getLength(); + + return false; +} + +bool ShapeExport::NonEmptyText( const Reference< XInterface >& xIface ) +{ + Reference< XPropertySet > xPropSet( xIface, UNO_QUERY ); + + if( xPropSet.is() ) + { + Reference< XPropertySetInfo > xPropSetInfo = xPropSet->getPropertySetInfo(); + if ( xPropSetInfo.is() ) + { + if ( xPropSetInfo->hasPropertyByName( "IsEmptyPresentationObject" ) ) + { + bool bIsEmptyPresObj = false; + if ( xPropSet->getPropertyValue( "IsEmptyPresentationObject" ) >>= bIsEmptyPresObj ) + { + SAL_INFO("oox.shape", "empty presentation object " << bIsEmptyPresObj << " , props:"); + if( bIsEmptyPresObj ) + return true; + } + } + + if ( xPropSetInfo->hasPropertyByName( "IsPresentationObject" ) ) + { + bool bIsPresObj = false; + if ( xPropSet->getPropertyValue( "IsPresentationObject" ) >>= bIsPresObj ) + { + SAL_INFO("oox.shape", "presentation object " << bIsPresObj << ", props:"); + if( bIsPresObj ) + return true; + } + } + } + } + + return IsNonEmptySimpleText(xIface); +} + +ShapeExport& ShapeExport::WritePolyPolygonShape( const Reference< XShape >& xShape, const bool bClosed ) +{ + SAL_INFO("oox.shape", "write polypolygon shape"); + + FSHelperPtr pFS = GetFS(); + pFS->startElementNS(mnXmlNamespace, (GetDocumentType() != DOCUMENT_DOCX || mbUserShapes ? XML_sp : XML_wsp)); + + awt::Point aPos = xShape->getPosition(); + // Position is relative to group for child elements in Word, but absolute in API. + if (GetDocumentType() == DOCUMENT_DOCX && !mbUserShapes && m_xParent.is()) + { + awt::Point aParentPos = m_xParent->getPosition(); + aPos.X -= aParentPos.X; + aPos.Y -= aParentPos.Y; + } + awt::Size aSize = xShape->getSize(); + tools::Rectangle aRect(Point(aPos.X, aPos.Y), Size(aSize.Width, aSize.Height)); + +#if OSL_DEBUG_LEVEL > 0 + tools::PolyPolygon aPolyPolygon = EscherPropertyContainer::GetPolyPolygon(xShape); + awt::Size size = MapSize( awt::Size( aRect.GetWidth(), aRect.GetHeight() ) ); + SAL_INFO("oox.shape", "poly count " << aPolyPolygon.Count()); + SAL_INFO("oox.shape", "size: " << size.Width << " x " << size.Height); +#endif + + // non visual shape properties + if (GetDocumentType() != DOCUMENT_DOCX || mbUserShapes) + { + pFS->startElementNS(mnXmlNamespace, XML_nvSpPr); + pFS->singleElementNS( mnXmlNamespace, XML_cNvPr, + XML_id, OString::number(GetNewShapeID(xShape)), + XML_name, GetShapeName(xShape)); + } + pFS->singleElementNS(mnXmlNamespace, XML_cNvSpPr); + if (GetDocumentType() != DOCUMENT_DOCX || mbUserShapes) + { + WriteNonVisualProperties( xShape ); + pFS->endElementNS( mnXmlNamespace, XML_nvSpPr ); + } + + // visual shape properties + pFS->startElementNS(mnXmlNamespace, XML_spPr); + WriteTransformation( xShape, aRect, XML_a ); + WritePolyPolygon(xShape, bClosed); + Reference< XPropertySet > xProps( xShape, UNO_QUERY ); + if( xProps.is() ) { + if( bClosed ) + WriteFill( xProps ); + WriteOutline( xProps ); + } + + pFS->endElementNS( mnXmlNamespace, XML_spPr ); + + // write text + WriteTextBox( xShape, mnXmlNamespace ); + + pFS->endElementNS( mnXmlNamespace, (GetDocumentType() != DOCUMENT_DOCX || mbUserShapes ? XML_sp : XML_wsp) ); + + return *this; +} + +ShapeExport& ShapeExport::WriteClosedPolyPolygonShape( const Reference< XShape >& xShape ) +{ + return WritePolyPolygonShape( xShape, true ); +} + +ShapeExport& ShapeExport::WriteOpenPolyPolygonShape( const Reference< XShape >& xShape ) +{ + return WritePolyPolygonShape( xShape, false ); +} + +ShapeExport& ShapeExport::WriteGroupShape(const uno::Reference& xShape) +{ + FSHelperPtr pFS = GetFS(); + + sal_Int32 nGroupShapeToken = XML_grpSp; + if (GetDocumentType() == DOCUMENT_DOCX && !mbUserShapes) + { + if (!m_xParent.is()) + nGroupShapeToken = XML_wgp; // toplevel + else + mnXmlNamespace = XML_wpg; + } + + pFS->startElementNS(mnXmlNamespace, nGroupShapeToken); + + // non visual properties + if (GetDocumentType() != DOCUMENT_DOCX || mbUserShapes) + { + pFS->startElementNS(mnXmlNamespace, XML_nvGrpSpPr); + pFS->singleElementNS(mnXmlNamespace, XML_cNvPr, + XML_id, OString::number(GetNewShapeID(xShape)), + XML_name, GetShapeName(xShape)); + pFS->singleElementNS(mnXmlNamespace, XML_cNvGrpSpPr); + WriteNonVisualProperties(xShape ); + pFS->endElementNS(mnXmlNamespace, XML_nvGrpSpPr); + } + else + pFS->singleElementNS(mnXmlNamespace, XML_cNvGrpSpPr); + + // visual properties + pFS->startElementNS(mnXmlNamespace, XML_grpSpPr); + WriteShapeTransformation(xShape, XML_a, false, false, true); + pFS->endElementNS(mnXmlNamespace, XML_grpSpPr); + + uno::Reference xGroupShape(xShape, uno::UNO_QUERY_THROW); + uno::Reference xParent = m_xParent; + m_xParent = xShape; + for (sal_Int32 i = 0; i < xGroupShape->getCount(); ++i) + { + uno::Reference xChild(xGroupShape->getByIndex(i), uno::UNO_QUERY_THROW); + sal_Int32 nSavedNamespace = mnXmlNamespace; + + uno::Reference xServiceInfo(xChild, uno::UNO_QUERY_THROW); + if (GetDocumentType() == DOCUMENT_DOCX && !mbUserShapes) + { + // tdf#128820: WriteGraphicObjectShapePart calls WriteTextShape for non-empty simple + // text objects, which needs writing into wps::wsp element, so make sure to use wps + // namespace for those objects + if (xServiceInfo->supportsService("com.sun.star.drawing.GraphicObjectShape") + && !IsNonEmptySimpleText(xChild)) + mnXmlNamespace = XML_pic; + else + mnXmlNamespace = XML_wps; + } + WriteShape(xChild); + + mnXmlNamespace = nSavedNamespace; + } + m_xParent = xParent; + + pFS->endElementNS(mnXmlNamespace, nGroupShapeToken); + return *this; +} + +static bool lcl_IsOnDenylist(OUString const & rShapeType) +{ + static const std::initializer_list vDenylist = { + u"block-arc", + u"rectangle", + u"ellipse", + u"ring", + u"can", + u"cube", + u"paper", + u"frame", + u"forbidden", + u"smiley", + u"sun", + u"flower", + u"bracket-pair", + u"brace-pair", + u"quad-bevel", + u"round-rectangular-callout", + u"rectangular-callout", + u"round-callout", + u"cloud-callout", + u"line-callout-1", + u"line-callout-2", + u"line-callout-3", + u"paper", + u"vertical-scroll", + u"horizontal-scroll", + u"mso-spt34", + u"mso-spt75", + u"mso-spt164", + u"mso-spt180", + u"flowchart-process", + u"flowchart-alternate-process", + u"flowchart-decision", + u"flowchart-data", + u"flowchart-predefined-process", + u"flowchart-internal-storage", + u"flowchart-document", + u"flowchart-multidocument", + u"flowchart-terminator", + u"flowchart-preparation", + u"flowchart-manual-input", + u"flowchart-manual-operation", + u"flowchart-connector", + u"flowchart-off-page-connector", + u"flowchart-card", + u"flowchart-punched-tape", + u"flowchart-summing-junction", + u"flowchart-or", + u"flowchart-collate", + u"flowchart-sort", + u"flowchart-extract", + u"flowchart-merge", + u"flowchart-stored-data", + u"flowchart-delay", + u"flowchart-sequential-access", + u"flowchart-magnetic-disk", + u"flowchart-direct-access-storage", + u"flowchart-display" + }; + + return std::find(vDenylist.begin(), vDenylist.end(), rShapeType) != vDenylist.end(); +} + +static bool lcl_IsOnAllowlist(OUString const & rShapeType) +{ + static const std::initializer_list vAllowlist = { + u"heart", + u"puzzle", + u"col-60da8460", + u"col-502ad400" + }; + + return std::find(vAllowlist.begin(), vAllowlist.end(), rShapeType) != vAllowlist.end(); +} + +static bool lcl_GetHandlePosition( sal_Int32 &nValue, const EnhancedCustomShapeParameter &rParam, const Sequence< EnhancedCustomShapeAdjustmentValue > &rSeq) +{ + bool bAdj = false; + if ( rParam.Value.getValueTypeClass() == TypeClass_DOUBLE ) + { + double fValue(0.0); + if ( rParam.Value >>= fValue ) + nValue = static_cast(fValue); + } + else + rParam.Value >>= nValue; + + if ( rParam.Type == EnhancedCustomShapeParameterType::ADJUSTMENT) + { + bAdj = true; + sal_Int32 nIdx = nValue; + if ( nIdx < rSeq.getLength() ) + { + if ( rSeq[ nIdx ] .Value.getValueTypeClass() == TypeClass_DOUBLE ) + { + double fValue(0.0); + rSeq[ nIdx ].Value >>= fValue; + nValue = fValue; + + } + else + { + rSeq[ nIdx ].Value >>= nValue; + } + } + } + return bAdj; +} + +static void lcl_AnalyzeHandles( const uno::Sequence & rHandles, + std::vector< std::pair< sal_Int32, sal_Int32> > &rHandlePositionList, + const Sequence< EnhancedCustomShapeAdjustmentValue > &rSeq) +{ + for ( const Sequence< PropertyValue >& rPropSeq : rHandles ) + { + static const OUStringLiteral sPosition( u"Position" ); + bool bPosition = false; + EnhancedCustomShapeParameterPair aPosition; + for ( const PropertyValue& rPropVal: rPropSeq ) + { + if ( rPropVal.Name == sPosition ) + { + if ( rPropVal.Value >>= aPosition ) + bPosition = true; + } + } + if ( bPosition ) + { + sal_Int32 nXPosition = 0; + sal_Int32 nYPosition = 0; + // For polar handles, nXPosition is radius and nYPosition is angle + lcl_GetHandlePosition( nXPosition, aPosition.First , rSeq ); + lcl_GetHandlePosition( nYPosition, aPosition.Second, rSeq ); + rHandlePositionList.emplace_back( nXPosition, nYPosition ); + } + } +} + +static void lcl_AppendAdjustmentValue( std::vector< std::pair< sal_Int32, sal_Int32> > &rAvList, sal_Int32 nAdjIdx, sal_Int32 nValue ) +{ + rAvList.emplace_back( nAdjIdx , nValue ); +} + +static sal_Int32 lcl_NormalizeAngle( sal_Int32 nAngle ) +{ + nAngle = nAngle % 360; + return nAngle < 0 ? ( nAngle + 360 ) : nAngle ; +} + +static sal_Int32 lcl_CircleAngle2CustomShapeEllipseAngleOOX(const sal_Int32 nInternAngle, const sal_Int32 nWidth, const sal_Int32 nHeight) +{ + if (nWidth != 0 || nHeight != 0) + { + double fAngle = basegfx::deg2rad<100>(nInternAngle); // intern 1/100 deg to rad + fAngle = atan2(nHeight * sin(fAngle), nWidth * cos(fAngle)); // circle to ellipse + fAngle = basegfx::rad2deg<60000>(fAngle); // rad to OOXML angle unit + sal_Int32 nAngle = basegfx::fround(fAngle); // normalize + nAngle = nAngle % 21600000; + return nAngle < 0 ? (nAngle + 21600000) : nAngle; + } + else // should be handled by caller, dummy value + return 0; +} + +static OUString lcl_GetTarget(const css::uno::Reference& xModel, + std::u16string_view rURL) +{ + Reference xDPS(xModel, uno::UNO_QUERY_THROW); + Reference xDrawPages(xDPS->getDrawPages(), uno::UNO_SET_THROW); + sal_uInt32 nPageCount = xDrawPages->getCount(); + OUString sTarget; + + for (sal_uInt32 i = 0; i < nPageCount; ++i) + { + Reference xDrawPage; + xDrawPages->getByIndex(i) >>= xDrawPage; + Reference xNamed(xDrawPage, UNO_QUERY); + if (!xNamed) + continue; + OUString sSlideName = "#" + xNamed->getName(); + if (rURL == sSlideName) + { + sTarget = "slide" + OUString::number(i + 1) + ".xml"; + break; + } + } + + return sTarget; +} + +ShapeExport& ShapeExport::WriteCustomShape( const Reference< XShape >& xShape ) +{ + SAL_INFO("oox.shape", "write custom shape"); + Reference< XPropertySet > rXPropSet( xShape, UNO_QUERY ); + // First check, if this is a Fontwork-shape. For DrawingML, such a shape is a + // TextBox shape with body property prstTxWarp. + if (IsFontworkShape(rXPropSet)) + { + ShapeExport::WriteTextShape(xShape); // qualifier to prevent PowerPointShapeExport + return *this; + } + + bool bHasGeometrySeq(false); + Sequence< PropertyValue > aGeometrySeq; + OUString sShapeType("non-primitive"); // default in ODF + if (GETA(CustomShapeGeometry)) + { + SAL_INFO("oox.shape", "got custom shape geometry"); + if (mAny >>= aGeometrySeq) + { + bHasGeometrySeq = true; + SAL_INFO("oox.shape", "got custom shape geometry sequence"); + for (const PropertyValue& rProp : std::as_const(aGeometrySeq)) + { + SAL_INFO("oox.shape", "geometry property: " << rProp.Name); + if (rProp.Name == "Type") + rProp.Value >>= sShapeType; + } + } + } + + bool bPredefinedHandlesUsed = true; + bool bHasHandles = false; + + ShapeFlag nMirrorFlags = ShapeFlag::NONE; + MSO_SPT eShapeType = EscherPropertyContainer::GetCustomShapeType( xShape, nMirrorFlags, sShapeType ); + assert(dynamic_cast< SdrObjCustomShape* >(SdrObject::getSdrObjectFromXShape(xShape)) && "Not a SdrObjCustomShape (!)"); + SdrObjCustomShape& rSdrObjCustomShape(static_cast< SdrObjCustomShape& >(*SdrObject::getSdrObjectFromXShape(xShape))); + const bool bIsDefaultObject( + EscherPropertyContainer::IsDefaultObject( + rSdrObjCustomShape, + eShapeType)); + OString sPresetShape = msfilter::util::GetOOXMLPresetGeometry(sShapeType); + SAL_INFO("oox.shape", "custom shape type: " << sShapeType << " ==> " << sPresetShape); + + sal_Int32 nAdjustmentValuesIndex = -1; + awt::Rectangle aViewBox; + uno::Sequence aHandles; + + bool bFlipH = false; + bool bFlipV = false; + + if (bHasGeometrySeq) + { + for (int i = 0; i < aGeometrySeq.getLength(); i++) + { + const PropertyValue& rProp = aGeometrySeq[ i ]; + SAL_INFO("oox.shape", "geometry property: " << rProp.Name); + + if ( rProp.Name == "MirroredX" ) + rProp.Value >>= bFlipH; + + if ( rProp.Name == "MirroredY" ) + rProp.Value >>= bFlipV; + if ( rProp.Name == "AdjustmentValues" ) + nAdjustmentValuesIndex = i; + else if ( rProp.Name == "Handles" ) + { + rProp.Value >>= aHandles; + if ( aHandles.hasElements() ) + bHasHandles = true; + if( !bIsDefaultObject ) + bPredefinedHandlesUsed = false; + // TODO: update nAdjustmentsWhichNeedsToBeConverted here + } + else if ( rProp.Name == "ViewBox" ) + rProp.Value >>= aViewBox; + } + } + + FSHelperPtr pFS = GetFS(); + // non visual shape properties + if (GetDocumentType() != DOCUMENT_DOCX || mbUserShapes) + { + bool bUseBackground = false; + if (GETA(FillUseSlideBackground)) + mAny >>= bUseBackground; + if (bUseBackground) + mpFS->startElementNS(mnXmlNamespace, XML_sp, XML_useBgFill, "1"); + else + mpFS->startElementNS(mnXmlNamespace, XML_sp); + + bool isVisible = true ; + if( GETA (Visible)) + { + mAny >>= isVisible; + } + pFS->startElementNS( mnXmlNamespace, XML_nvSpPr ); + pFS->startElementNS( + mnXmlNamespace, XML_cNvPr, XML_id, + OString::number(GetShapeID(xShape) == -1 ? GetNewShapeID(xShape) : GetShapeID(xShape)), + XML_name, GetShapeName(xShape), XML_hidden, sax_fastparser::UseIf("1", !isVisible)); + + if( GETA( URL ) ) + { + OUString sURL; + mAny >>= sURL; + if( !sURL.isEmpty() ) + { + OUString sRelId = mpFB->addRelation( mpFS->getOutputStream(), + oox::getRelationship(Relationship::HYPERLINK), + mpURLTransformer->getTransformedString(sURL), + mpURLTransformer->isExternalURL(sURL)); + + mpFS->singleElementNS(XML_a, XML_hlinkClick, FSNS(XML_r, XML_id), sRelId); + } + } + + OUString sBookmark; + if (GETA(Bookmark)) + mAny >>= sBookmark; + + if (GETA(OnClick)) + { + OUString sPPAction; + presentation::ClickAction eClickAction = presentation::ClickAction_NONE; + mAny >>= eClickAction; + if (eClickAction != presentation::ClickAction_NONE) + { + switch (eClickAction) + { + case presentation::ClickAction_STOPPRESENTATION: + sPPAction = "ppaction://hlinkshowjump?jump=endshow"; + break; + case presentation::ClickAction_NEXTPAGE: + sPPAction = "ppaction://hlinkshowjump?jump=nextslide"; + break; + case presentation::ClickAction_LASTPAGE: + sPPAction = "ppaction://hlinkshowjump?jump=lastslide"; + break; + case presentation::ClickAction_PREVPAGE: + sPPAction = "ppaction://hlinkshowjump?jump=previousslide"; + break; + case presentation::ClickAction_FIRSTPAGE: + sPPAction = "ppaction://hlinkshowjump?jump=firstslide"; + break; + case presentation::ClickAction_BOOKMARK: + sBookmark = "#" + sBookmark; + break; + default: + break; + } + } + if (!sPPAction.isEmpty()) + pFS->singleElementNS(XML_a, XML_hlinkClick, FSNS(XML_r, XML_id), "", XML_action, + sPPAction); + } + if (!sBookmark.isEmpty()) + { + bool bExtURL = URLTransformer().isExternalURL(sBookmark); + sBookmark = bExtURL ? sBookmark : lcl_GetTarget(GetFB()->getModel(), sBookmark); + + OUString sRelId + = mpFB->addRelation(mpFS->getOutputStream(), + bExtURL ? oox::getRelationship(Relationship::HYPERLINK) + : oox::getRelationship(Relationship::SLIDE), + sBookmark, bExtURL); + if (bExtURL) + mpFS->singleElementNS(XML_a, XML_hlinkClick, FSNS(XML_r, XML_id), sRelId); + else + mpFS->singleElementNS(XML_a, XML_hlinkClick, FSNS(XML_r, XML_id), sRelId, + XML_action, "ppaction://hlinksldjump"); + } + pFS->endElementNS(mnXmlNamespace, XML_cNvPr); + pFS->singleElementNS(mnXmlNamespace, XML_cNvSpPr); + WriteNonVisualProperties( xShape ); + pFS->endElementNS( mnXmlNamespace, XML_nvSpPr ); + } + else + { + pFS->startElementNS(mnXmlNamespace, XML_wsp); + pFS->singleElementNS(mnXmlNamespace, XML_cNvSpPr); + } + + // visual shape properties + pFS->startElementNS(mnXmlNamespace, XML_spPr); + + // we export non-primitive shapes to custom geometry + // we also export non-ooxml shapes which have handles/equations to custom geometry, because + // we cannot convert ODF equations to DrawingML equations. TODO: see what binary DOC export filter does. + // but our WritePolyPolygon()/WriteCustomGeometry() functions are incomplete, therefore we use a denylist + // we use a allowlist for shapes where mapping to MSO preset shape is not optimal + bool bCustGeom = true; + bool bOnDenylist = false; + if( sShapeType == "ooxml-non-primitive" ) + bCustGeom = true; + else if( sShapeType.startsWith("ooxml") ) + bCustGeom = false; + else if( lcl_IsOnAllowlist(sShapeType) ) + bCustGeom = true; + else if( lcl_IsOnDenylist(sShapeType) ) + { + bCustGeom = false; + bOnDenylist = true; + } + + bool bPresetWriteSuccessful = false; + // Let the custom shapes what has name and preset information in OOXML, to be written + // as preset ones with parameters. Try that with this converter class. + if (!sShapeType.startsWith("ooxml") && sShapeType != "non-primitive" && !mbUserShapes + && xShape->getShapeType() == "com.sun.star.drawing.CustomShape" + && !lcl_IsOnAllowlist(sShapeType)) + { + DMLPresetShapeExporter aCustomShapeConverter(this, xShape); + bPresetWriteSuccessful = aCustomShapeConverter.WriteShape(); + } + // If preset writing has problems try to write the shape as it done before + if (bPresetWriteSuccessful) + ;// Already written do nothing. + else if (bCustGeom) + { + WriteShapeTransformation( xShape, XML_a, bFlipH, bFlipV ); + bool bSuccess = WriteCustomGeometry(xShape, rSdrObjCustomShape); + // In case of Writer, the parent element is , and there the element + // is not optional. + if (!bSuccess && GetDocumentType() == DOCUMENT_DOCX) + { + WriteEmptyCustomGeometry(); + } + } + else if (bOnDenylist && bHasHandles && nAdjustmentValuesIndex !=-1 && !sShapeType.startsWith("mso-spt")) + { + WriteShapeTransformation( xShape, XML_a, bFlipH, bFlipV ); + Sequence< EnhancedCustomShapeAdjustmentValue > aAdjustmentSeq; + std::vector< std::pair< sal_Int32, sal_Int32> > aHandlePositionList; + std::vector< std::pair< sal_Int32, sal_Int32> > aAvList; + aGeometrySeq[ nAdjustmentValuesIndex ].Value >>= aAdjustmentSeq ; + + lcl_AnalyzeHandles( aHandles, aHandlePositionList, aAdjustmentSeq ); + + sal_Int32 nXPosition = 0; + sal_Int32 nYPosition = 0; + if ( !aHandlePositionList.empty() ) + { + nXPosition = aHandlePositionList[0].first ; + nYPosition = aHandlePositionList[0].second ; + } + switch( eShapeType ) + { + case mso_sptBorderCallout1: + { + sal_Int32 adj3 = double(nYPosition)/aViewBox.Height *100000; + sal_Int32 adj4 = double(nXPosition)/aViewBox.Width *100000; + lcl_AppendAdjustmentValue( aAvList, 1, 18750 ); + lcl_AppendAdjustmentValue( aAvList, 2, -8333 ); + lcl_AppendAdjustmentValue( aAvList, 3, adj3 ); + lcl_AppendAdjustmentValue( aAvList, 4, adj4 ); + break; + } + case mso_sptBorderCallout2: + { + sal_Int32 adj5 = double(nYPosition)/aViewBox.Height *100000; + sal_Int32 adj6 = double(nXPosition)/aViewBox.Width *100000; + sal_Int32 adj3 = 18750; + sal_Int32 adj4 = -16667; + lcl_AppendAdjustmentValue( aAvList, 1, 18750 ); + lcl_AppendAdjustmentValue( aAvList, 2, -8333 ); + if ( aHandlePositionList.size() > 1 ) + { + nXPosition = aHandlePositionList[1].first ; + nYPosition = aHandlePositionList[1].second ; + adj3 = double(nYPosition)/aViewBox.Height *100000; + adj4 = double(nXPosition)/aViewBox.Width *100000; + } + lcl_AppendAdjustmentValue( aAvList, 3, adj3 ); + lcl_AppendAdjustmentValue( aAvList, 4, adj4 ); + lcl_AppendAdjustmentValue( aAvList, 5, adj5 ); + lcl_AppendAdjustmentValue( aAvList, 6, adj6 ); + break; + } + case mso_sptWedgeRectCallout: + case mso_sptWedgeRRectCallout: + case mso_sptWedgeEllipseCallout: + case mso_sptCloudCallout: + { + sal_Int32 adj1 = (double(nXPosition)/aViewBox.Width -0.5) *100000; + sal_Int32 adj2 = (double(nYPosition)/aViewBox.Height -0.5) *100000; + lcl_AppendAdjustmentValue( aAvList, 1, adj1 ); + lcl_AppendAdjustmentValue( aAvList, 2, adj2 ); + if ( eShapeType == mso_sptWedgeRRectCallout) + { + lcl_AppendAdjustmentValue( aAvList, 3, 16667); + } + + break; + } + case mso_sptFoldedCorner: + { + sal_Int32 adj = double( aViewBox.Width - nXPosition) / std::min( aViewBox.Width,aViewBox.Height ) * 100000; + lcl_AppendAdjustmentValue( aAvList, 0, adj ); + break; + } + case mso_sptDonut: + case mso_sptSun: + case mso_sptMoon: + case mso_sptNoSmoking: + case mso_sptHorizontalScroll: + case mso_sptBevel: + case mso_sptBracketPair: + { + sal_Int32 adj = double( nXPosition )/aViewBox.Width*100000 ; + lcl_AppendAdjustmentValue( aAvList, 0, adj ); + break; + } + case mso_sptCan: + case mso_sptCube: + case mso_sptBracePair: + case mso_sptVerticalScroll: + { + sal_Int32 adj = double( nYPosition )/aViewBox.Height *100000 ; + lcl_AppendAdjustmentValue( aAvList, 0, adj ); + break; + } + case mso_sptSmileyFace: + { + sal_Int32 adj = double( nYPosition )/aViewBox.Height *100000 - 76458.0; + lcl_AppendAdjustmentValue( aAvList, 0, adj ); + break; + } + case mso_sptBlockArc: + { + sal_Int32 nRadius = 50000 * ( 1 - double(nXPosition) / 10800); + sal_Int32 nAngleStart = lcl_NormalizeAngle( nYPosition ); + sal_Int32 nAngleEnd = lcl_NormalizeAngle( 180 - nAngleStart ); + lcl_AppendAdjustmentValue( aAvList, 1, 21600000 / 360 * nAngleStart ); + lcl_AppendAdjustmentValue( aAvList, 2, 21600000 / 360 * nAngleEnd ); + lcl_AppendAdjustmentValue( aAvList, 3, nRadius ); + break; + } + // case mso_sptNil: + // case mso_sptBentConnector3: + // case mso_sptBorderCallout3: + default: + { + if ( sPresetShape == "frame" ) + { + sal_Int32 adj1 = double( nYPosition )/aViewBox.Height *100000 ; + lcl_AppendAdjustmentValue( aAvList, 1, adj1 ); + } + break; + } + } + WritePresetShape( sPresetShape , aAvList ); + } + else // preset geometry + { + WriteShapeTransformation( xShape, XML_a, bFlipH, bFlipV ); + if( nAdjustmentValuesIndex != -1 ) + { + WritePresetShape( sPresetShape, eShapeType, bPredefinedHandlesUsed, + aGeometrySeq[ nAdjustmentValuesIndex ] ); + } + else + WritePresetShape( sPresetShape ); + } + if( rXPropSet.is() ) + { + WriteFill( rXPropSet ); + WriteOutline( rXPropSet ); + WriteShapeEffects( rXPropSet ); + + bool bHas3DEffectinShape = false; + uno::Sequence grabBag; + rXPropSet->getPropertyValue("InteropGrabBag") >>= grabBag; + + for (auto const& it : std::as_const(grabBag)) + if (it.Name == "3DEffectProperties") + bHas3DEffectinShape = true; + + if( bHas3DEffectinShape) + Write3DEffects( rXPropSet, /*bIsText=*/false ); + } + + pFS->endElementNS( mnXmlNamespace, XML_spPr ); + + pFS->startElementNS(mnXmlNamespace, XML_style); + WriteShapeStyle( rXPropSet ); + pFS->endElementNS( mnXmlNamespace, XML_style ); + + // write text + WriteTextBox( xShape, mnXmlNamespace ); + + pFS->endElementNS( mnXmlNamespace, (GetDocumentType() != DOCUMENT_DOCX || mbUserShapes ? XML_sp : XML_wsp) ); + + return *this; +} + +ShapeExport& ShapeExport::WriteEllipseShape( const Reference< XShape >& xShape ) +{ + SAL_INFO("oox.shape", "write ellipse shape"); + + FSHelperPtr pFS = GetFS(); + + pFS->startElementNS(mnXmlNamespace, (GetDocumentType() != DOCUMENT_DOCX || mbUserShapes ? XML_sp : XML_wsp)); + + // TODO: connector ? + + // non visual shape properties + if (GetDocumentType() != DOCUMENT_DOCX || mbUserShapes) + { + pFS->startElementNS(mnXmlNamespace, XML_nvSpPr); + pFS->singleElementNS( mnXmlNamespace, XML_cNvPr, + XML_id, OString::number(GetNewShapeID(xShape)), + XML_name, GetShapeName(xShape)); + pFS->singleElementNS( mnXmlNamespace, XML_cNvSpPr ); + WriteNonVisualProperties( xShape ); + pFS->endElementNS( mnXmlNamespace, XML_nvSpPr ); + } + else + pFS->singleElementNS(mnXmlNamespace, XML_cNvSpPr); + + Reference< XPropertySet > xProps( xShape, UNO_QUERY ); + CircleKind eCircleKind(CircleKind_FULL); + if (xProps.is()) + xProps->getPropertyValue("CircleKind" ) >>= eCircleKind; + + // visual shape properties + pFS->startElementNS( mnXmlNamespace, XML_spPr ); + WriteShapeTransformation( xShape, XML_a ); + + if (CircleKind_FULL == eCircleKind) + WritePresetShape("ellipse"); + else + { + sal_Int32 nStartAngleIntern(9000); + sal_Int32 nEndAngleIntern(0); + if (xProps.is()) + { + xProps->getPropertyValue("CircleStartAngle" ) >>= nStartAngleIntern; + xProps->getPropertyValue("CircleEndAngle") >>= nEndAngleIntern; + } + std::vector< std::pair> aAvList; + awt::Size aSize = xShape->getSize(); + if (aSize.Width != 0 || aSize.Height != 0) + { + // Our arc has 90° up, OOXML has 90° down, so mirror it. + // API angles are 1/100 degree. + sal_Int32 nStartAngleOOXML(lcl_CircleAngle2CustomShapeEllipseAngleOOX(36000 - nEndAngleIntern, aSize.Width, aSize.Height)); + sal_Int32 nEndAngleOOXML(lcl_CircleAngle2CustomShapeEllipseAngleOOX(36000 - nStartAngleIntern, aSize.Width, aSize.Height)); + lcl_AppendAdjustmentValue( aAvList, 1, nStartAngleOOXML); + lcl_AppendAdjustmentValue( aAvList, 2, nEndAngleOOXML); + } + switch (eCircleKind) + { + case CircleKind_ARC : + WritePresetShape("arc", aAvList); + break; + case CircleKind_SECTION : + WritePresetShape("pie", aAvList); + break; + case CircleKind_CUT : + WritePresetShape("chord", aAvList); + break; + default : + WritePresetShape("ellipse"); + } + } + if( xProps.is() ) + { + if (CircleKind_ARC == eCircleKind) + { + // An arc in ODF is never filled, even if a fill style other than + // "none" is set. OOXML arc can be filled, so set fill explicit to + // NONE, otherwise some hidden or inherited filling is shown. + FillStyle eFillStyle(FillStyle_NONE); + uno::Any aNewValue; + aNewValue <<= eFillStyle; + xProps->setPropertyValue("FillStyle", aNewValue); + } + WriteFill( xProps ); + WriteOutline( xProps ); + } + pFS->endElementNS( mnXmlNamespace, XML_spPr ); + + // write text + WriteTextBox( xShape, mnXmlNamespace ); + + pFS->endElementNS( mnXmlNamespace, (GetDocumentType() != DOCUMENT_DOCX || mbUserShapes ? XML_sp : XML_wsp) ); + + return *this; +} + +ShapeExport& ShapeExport::WriteGraphicObjectShape( const Reference< XShape >& xShape ) +{ + WriteGraphicObjectShapePart( xShape ); + + return *this; +} + +void ShapeExport::WriteGraphicObjectShapePart( const Reference< XShape >& xShape, const Graphic* pGraphic ) +{ + SAL_INFO("oox.shape", "write graphic object shape"); + + if (IsNonEmptySimpleText(xShape)) + { + SAL_INFO("oox.shape", "graphicObject: wrote only text"); + + WriteTextShape(xShape); + + return; + } + + SAL_INFO("oox.shape", "graphicObject without text"); + + uno::Reference xGraphic; + OUString sMediaURL; + + Reference< XPropertySet > xShapeProps( xShape, UNO_QUERY ); + + if (pGraphic) + { + xGraphic.set(pGraphic->GetXGraphic()); + } + else if (xShapeProps.is() && xShapeProps->getPropertySetInfo()->hasPropertyByName("Graphic")) + { + xShapeProps->getPropertyValue("Graphic") >>= xGraphic; + } + + bool bHasMediaURL = xShapeProps.is() && xShapeProps->getPropertySetInfo()->hasPropertyByName("MediaURL") && (xShapeProps->getPropertyValue("MediaURL") >>= sMediaURL); + + if (!xGraphic.is() && !bHasMediaURL) + { + SAL_INFO("oox.shape", "no graphic or media URL found"); + return; + } + + FSHelperPtr pFS = GetFS(); + XmlFilterBase* pFB = GetFB(); + + if (GetDocumentType() != DOCUMENT_DOCX || mbUserShapes) + pFS->startElementNS(mnXmlNamespace, XML_pic); + else + pFS->startElementNS(mnXmlNamespace, XML_pic, + FSNS(XML_xmlns, XML_pic), pFB->getNamespaceURL(OOX_NS(dmlPicture))); + + pFS->startElementNS(mnXmlNamespace, XML_nvPicPr); + + presentation::ClickAction eClickAction = presentation::ClickAction_NONE; + OUString sDescr, sURL, sBookmark, sPPAction; + bool bHaveDesc; + + if ( ( bHaveDesc = GetProperty( xShapeProps, "Description" ) ) ) + mAny >>= sDescr; + if ( GetProperty( xShapeProps, "URL" ) ) + mAny >>= sURL; + if (GetProperty(xShapeProps, "Bookmark")) + mAny >>= sBookmark; + if (GetProperty(xShapeProps, "OnClick")) + mAny >>= eClickAction; + + pFS->startElementNS( mnXmlNamespace, XML_cNvPr, + XML_id, OString::number(GetNewShapeID(xShape)), + XML_name, GetShapeName(xShape), + XML_descr, sax_fastparser::UseIf(sDescr, bHaveDesc)); + + if (eClickAction != presentation::ClickAction_NONE) + { + switch (eClickAction) + { + case presentation::ClickAction_STOPPRESENTATION: + sPPAction = "ppaction://hlinkshowjump?jump=endshow"; + break; + case presentation::ClickAction_NEXTPAGE: + sPPAction = "ppaction://hlinkshowjump?jump=nextslide"; + break; + case presentation::ClickAction_LASTPAGE: + sPPAction = "ppaction://hlinkshowjump?jump=lastslide"; + break; + case presentation::ClickAction_PREVPAGE: + sPPAction = "ppaction://hlinkshowjump?jump=previousslide"; + break; + case presentation::ClickAction_FIRSTPAGE: + sPPAction = "ppaction://hlinkshowjump?jump=firstslide"; + break; + case presentation::ClickAction_BOOKMARK: + sBookmark = "#" + sBookmark; + break; + default: + break; + } + } + + // OOXTODO: //cNvPr children: XML_extLst, XML_hlinkHover + if (bHasMediaURL || !sPPAction.isEmpty()) + pFS->singleElementNS(XML_a, XML_hlinkClick, FSNS(XML_r, XML_id), "", XML_action, + bHasMediaURL ? "ppaction://media" : sPPAction); + if( !sURL.isEmpty() ) + { + OUString sRelId = mpFB->addRelation( mpFS->getOutputStream(), + oox::getRelationship(Relationship::HYPERLINK), + mpURLTransformer->getTransformedString(sURL), + mpURLTransformer->isExternalURL(sURL)); + + mpFS->singleElementNS(XML_a, XML_hlinkClick, FSNS(XML_r, XML_id), sRelId); + } + + if (!sBookmark.isEmpty()) + { + bool bExtURL = URLTransformer().isExternalURL(sBookmark); + sBookmark = bExtURL ? sBookmark : lcl_GetTarget(GetFB()->getModel(), sBookmark); + + OUString sRelId = mpFB->addRelation(mpFS->getOutputStream(), + bExtURL ? oox::getRelationship(Relationship::HYPERLINK) + : oox::getRelationship(Relationship::SLIDE), + sBookmark, bExtURL); + + if (bExtURL) + mpFS->singleElementNS(XML_a, XML_hlinkClick, FSNS(XML_r, XML_id), sRelId); + else + mpFS->singleElementNS(XML_a, XML_hlinkClick, FSNS(XML_r, XML_id), sRelId, XML_action, + "ppaction://hlinksldjump"); + } + pFS->endElementNS(mnXmlNamespace, XML_cNvPr); + + pFS->singleElementNS(mnXmlNamespace, XML_cNvPicPr + // OOXTODO: XML_preferRelativeSize + ); + if (bHasMediaURL) + WriteMediaNonVisualProperties(xShape); + else + WriteNonVisualProperties(xShape); + + pFS->endElementNS( mnXmlNamespace, XML_nvPicPr ); + + pFS->startElementNS(mnXmlNamespace, XML_blipFill); + + if (xGraphic.is()) + { + WriteXGraphicBlip(xShapeProps, xGraphic, mbUserShapes); + } + else if (bHasMediaURL) + { + Reference xFallbackGraphic; + if (xShapeProps->getPropertySetInfo()->hasPropertyByName("FallbackGraphic")) + xShapeProps->getPropertyValue("FallbackGraphic") >>= xFallbackGraphic; + + WriteXGraphicBlip(xShapeProps, xFallbackGraphic, mbUserShapes); + } + + if (xGraphic.is()) + { + WriteSrcRectXGraphic(xShapeProps, xGraphic); + } + + // now we stretch always when we get pGraphic (when changing that + // behavior, test n#780830 for regression, where the OLE sheet might get tiled + bool bStretch = false; + if( !pGraphic && GetProperty( xShapeProps, "FillBitmapStretch" ) ) + mAny >>= bStretch; + + if ( pGraphic || bStretch ) + pFS->singleElementNS(XML_a, XML_stretch); + + if (bHasMediaURL) + { + // Graphic of media shapes is always stretched. + pFS->startElementNS(XML_a, XML_stretch); + pFS->singleElementNS(XML_a, XML_fillRect); + pFS->endElementNS(XML_a, XML_stretch); + } + + pFS->endElementNS( mnXmlNamespace, XML_blipFill ); + + // visual shape properties + pFS->startElementNS(mnXmlNamespace, XML_spPr); + bool bFlipH = false; + if( xShapeProps->getPropertySetInfo()->hasPropertyByName("IsMirrored") ) + { + xShapeProps->getPropertyValue("IsMirrored") >>= bFlipH; + } + WriteShapeTransformation( xShape, XML_a, bFlipH, false, false, false, true ); + WritePresetShape( "rect" ); + // graphic object can come with the frame (bnc#654525) + WriteOutline( xShapeProps ); + + WriteShapeEffects( xShapeProps ); + Write3DEffects( xShapeProps, /*bIsText=*/false ); + + pFS->endElementNS( mnXmlNamespace, XML_spPr ); + + pFS->endElementNS( mnXmlNamespace, XML_pic ); +} + +static void lcl_Rotate(sal_Int32 nAngle, Point center, awt::Point& pt) +{ + sal_Int16 nCos, nSin; + switch (nAngle) + { + case 90: + nCos = 0; + nSin = 1; + break; + case 180: + nCos = -1; + nSin = 0; + break; + case 270: + nCos = 0; + nSin = -1; + break; + default: + return; + } + sal_Int32 x = pt.X - center.X(); + sal_Int32 y = pt.Y - center.Y(); + pt.X = center.X() + x * nCos - y * nSin; + pt.Y = center.Y() + y * nCos + x * nSin; +} + +static void lcl_FlipHFlipV(tools::Polygon aPoly, sal_Int32 nAngle, bool& rFlipH, bool& rFlipV) +{ + Point aStart = aPoly[0]; + Point aEnd = aPoly[aPoly.GetSize() - 1]; + + if (aStart.X() > aEnd.X() && aStart.Y() > aEnd.Y()) + { + if (nAngle) + { + if (nAngle == 90) + rFlipH = true; + if (nAngle == 270) + rFlipV = true; + } + else // 0° + { + rFlipH = true; + rFlipV = true; + } + } + + if (aStart.X() < aEnd.X() && aStart.Y() < aEnd.Y()) + { + if (nAngle) + { + if (nAngle != 270) + { + rFlipH = true; + rFlipV = true; + } + else + rFlipH = true; + } + } + + if (aStart.Y() < aEnd.Y() && aStart.X() > aEnd.X()) + { + if (nAngle) + { + if (nAngle == 180) + rFlipV = true; + if (nAngle == 270) + { + rFlipV = true; + rFlipH = true; + } + } + else // 0° + { + rFlipH = true; + } + } + + if (aStart.Y() > aEnd.Y() && aStart.X() < aEnd.X()) + { + if (nAngle) + { + if (nAngle == 90) + { + rFlipH = true; + rFlipV = true; + } + if (nAngle == 180) + rFlipH = true; + } + else // 0° + rFlipV = true; + } +} + +static sal_Int32 lcl_GetAngle(tools::Polygon aPoly) +{ + sal_Int32 nAngle; + Point aStartPoint = aPoly[0]; + Point aEndPoint = aPoly[aPoly.GetSize() - 1]; + if (aStartPoint.X() == aPoly[1].X()) + { + if ((aStartPoint.X() < aEndPoint.X() && aStartPoint.Y() > aEndPoint.Y()) + || (aStartPoint.X() > aEndPoint.X() && aStartPoint.Y() < aEndPoint.Y())) + { + nAngle = 90; + } + else + nAngle = 270; + } + else + { + if (aStartPoint.X() > aPoly[1].X()) + nAngle = 180; + else + nAngle = 0; + } + + return nAngle; +} + +// Adjust value decide the position, where the connector should turn. +static void lcl_GetConnectorAdjustValue(const Reference& xShape, tools::Polygon aPoly, + ConnectorType eConnectorType, + std::vector>& rAvList) +{ + sal_Int32 nAdjCount = 0; + if (eConnectorType == ConnectorType_CURVE) + { + if (aPoly.GetSize() == 4) + { + if ((aPoly[0].X() == aPoly[1].X() && aPoly[2].X() == aPoly[3].X()) + || (aPoly[0].Y() == aPoly[1].Y() && aPoly[2].Y() == aPoly[3].Y())) + { + nAdjCount = 1; // curvedConnector3 + } + else + nAdjCount = 0; // curvedConnector2 + } + else if (aPoly.GetSize() > 4) + { + if ((aPoly[2].X() == aPoly[3].X() && aPoly[3].X() == aPoly[4].X()) + || (aPoly[2].Y() == aPoly[3].Y() && aPoly[3].Y() == aPoly[4].Y())) + { + nAdjCount = 3; // curvedConnector5 + } + else + nAdjCount = 2; // curvedConnector4 + } + } + else + { + switch (aPoly.GetSize()) + { + case 3: + nAdjCount = 0; // bentConnector2 + break; + case 4: + nAdjCount = 1; // bentConnector3 + break; + case 5: + nAdjCount = 2; // bentConnector4 + break; + case 6: + nAdjCount = 3; // bentConnector5 + break; + } + } + + if (nAdjCount) + { + sal_Int32 nAdjustValue; + Point aStart = aPoly[0]; + Point aEnd = aPoly[aPoly.GetSize() - 1]; + + for (sal_Int32 i = 1; i <= nAdjCount; ++i) + { + Point aPt = aPoly[i]; + + if (aEnd.Y() == aStart.Y()) + aEnd.setY(aStart.Y() + 1); + if (aEnd.X() == aStart.X()) + aEnd.setX(aStart.X() + 1); + + bool bVertical = aPoly[1].X() - aStart.X() != 0 ? true : false; + // vertical and horizon alternate + if (i % 2 == 1) + bVertical = !bVertical; + + if (eConnectorType == ConnectorType_CURVE) + { + awt::Size aSize = xShape->getSize(); + awt::Point aShapePosition = xShape->getPosition(); + tools::Rectangle aBoundRect = aPoly.GetBoundRect(); + + if (bVertical) + { + if ((aBoundRect.GetSize().Height() - aSize.Height) == 1) + aPt.setY(aPoly[i + 1].Y()); + else if (aStart.Y() > aPt.Y()) + aPt.setY(aShapePosition.Y); + else + aPt.setY(aShapePosition.Y + aSize.Height); + } + else + { + if ((aBoundRect.GetSize().Width() - aSize.Width) == 1) + aPt.setX(aPoly[i + 1].X()); + else if (aStart.X() > aPt.X()) + aPt.setX(aShapePosition.X); + else + aPt.setX(aShapePosition.X + aSize.Width); + } + } + + if (bVertical) + nAdjustValue = ((aPt.Y() - aStart.Y()) * 100000) / (aEnd.Y() - aStart.Y()); + else + nAdjustValue = ((aPt.X() - aStart.X()) * 100000) / (aEnd.X() - aStart.X()); + + rAvList.emplace_back(i, nAdjustValue); + } + } +} + +static sal_Int32 lcl_GetGluePointId(sal_Int32 nGluePointId) +{ + if (nGluePointId > 3) + return nGluePointId - 4; + else + { + // change id of the bounding box (1 <-> 3) + if (nGluePointId == 1) + return 3; // Right + else if (nGluePointId == 3) + return 1; // Left + } + + return nGluePointId; +} + +ShapeExport& ShapeExport::WriteConnectorShape( const Reference< XShape >& xShape ) +{ + bool bFlipH = false; + bool bFlipV = false; + sal_Int32 nAngle = 0; + sal_Int32 nStartGlueId = 0; + sal_Int32 nEndGlueId = 0; + + SAL_INFO("oox.shape", "write connector shape"); + + FSHelperPtr pFS = GetFS(); + + OUString sGeometry; + std::vector> aAdjustValueList; + Reference< XPropertySet > rXPropSet( xShape, UNO_QUERY ); + Reference< XPropertyState > rXPropState( xShape, UNO_QUERY ); + awt::Point aStartPoint, aEndPoint; + Reference< XShape > rXShapeA; + Reference< XShape > rXShapeB; + PropertyState eState; + ConnectorType eConnectorType = ConnectorType_STANDARD; + GET(eConnectorType, EdgeKind); + + switch( eConnectorType ) { + case ConnectorType_CURVE: + sGeometry = "curvedConnector"; + break; + case ConnectorType_LINES: + case ConnectorType_STANDARD: + sGeometry = "bentConnector"; + break; + default: + case ConnectorType_LINE: + sGeometry = "straightConnector1"; + break; + } + + if( GETAD( EdgeStartPoint ) ) { + mAny >>= aStartPoint; + if( GETAD( EdgeEndPoint ) ) { + mAny >>= aEndPoint; + } + } + GET( rXShapeA, EdgeStartConnection ); + GET( rXShapeB, EdgeEndConnection ); + + GET(nStartGlueId, StartGluePointIndex); + if (nStartGlueId != -1) + nStartGlueId = lcl_GetGluePointId(nStartGlueId); + GET(nEndGlueId, EndGluePointIndex); + if (nEndGlueId != -1) + nEndGlueId = lcl_GetGluePointId(nEndGlueId); + + // Position is relative to group in Word, but relative to anchor of group in API. + if (GetDocumentType() == DOCUMENT_DOCX && !mbUserShapes && m_xParent.is()) + { + awt::Point aParentPos = m_xParent->getPosition(); + aStartPoint.X -= aParentPos.X; + aStartPoint.Y -= aParentPos.Y; + aEndPoint.X -= aParentPos.X; + aEndPoint.Y -= aParentPos.Y; + } + EscherConnectorListEntry aConnectorEntry( xShape, aStartPoint, rXShapeA, aEndPoint, rXShapeB ); + + if (eConnectorType != ConnectorType_LINE) + { + tools::PolyPolygon aPolyPolygon = EscherPropertyContainer::GetPolyPolygon(xShape); + if (aPolyPolygon.Count() > 0) + { + tools::Polygon aPoly = aPolyPolygon.GetObject(0); + lcl_GetConnectorAdjustValue(xShape, aPoly, eConnectorType, aAdjustValueList); + nAngle = lcl_GetAngle(aPoly); + lcl_FlipHFlipV(aPoly, nAngle, bFlipH, bFlipV); + if (nAngle) + { + Point center((aEndPoint.X + aStartPoint.X) / 2, (aEndPoint.Y + aStartPoint.Y) / 2); + lcl_Rotate(nAngle, center, aStartPoint); + lcl_Rotate(nAngle, center, aEndPoint); + nAngle *= 60000; + } + sGeometry = sGeometry + OUString::number(aAdjustValueList.size() + 2); + } + } + + tools::Rectangle aRect( Point( aStartPoint.X, aStartPoint.Y ), Point( aEndPoint.X, aEndPoint.Y ) ); + if( aRect.getWidth() < 0 ) { + aRect.SetLeft(aEndPoint.X); + aRect.setWidth( aStartPoint.X - aEndPoint.X ); + if (eConnectorType == ConnectorType_LINE) + bFlipH = true; + } + + if( aRect.getHeight() < 0 ) { + aRect.SetTop(aEndPoint.Y); + aRect.setHeight( aStartPoint.Y - aEndPoint.Y ); + if (eConnectorType == ConnectorType_LINE) + bFlipV = true; + } + + // tdf#99810 connector shape (cxnSp) is not valid with namespace 'wps' + const auto nShapeNode = (mnXmlNamespace == XML_wps ? XML_wsp : XML_cxnSp); + pFS->startElementNS(mnXmlNamespace, nShapeNode); + + if (mnXmlNamespace == XML_wps) + { + // non visual connector shape drawing properties + pFS->singleElementNS(mnXmlNamespace, XML_cNvCnPr); + } + else + { + // non visual shape properties + pFS->startElementNS(mnXmlNamespace, XML_nvCxnSpPr); + pFS->singleElementNS(mnXmlNamespace, XML_cNvPr, + XML_id, OString::number(GetNewShapeID(xShape)), + XML_name, GetShapeName(xShape)); + // non visual connector shape drawing properties + pFS->startElementNS(mnXmlNamespace, XML_cNvCxnSpPr); + + if (GetShapeID(rXShapeA) == -1) + GetNewShapeID(rXShapeA); + if (GetShapeID(rXShapeB) == -1) + GetNewShapeID(rXShapeB); + WriteConnectorConnections(nStartGlueId, nEndGlueId, GetShapeID(rXShapeA), GetShapeID(rXShapeB)); + pFS->endElementNS(mnXmlNamespace, XML_cNvCxnSpPr); + if (GetDocumentType() == DOCUMENT_PPTX) + pFS->singleElementNS(mnXmlNamespace, XML_nvPr); + pFS->endElementNS(mnXmlNamespace, XML_nvCxnSpPr); + } + + // visual shape properties + pFS->startElementNS(mnXmlNamespace, XML_spPr); + WriteTransformation( xShape, aRect, XML_a, bFlipH, bFlipV, nAngle ); + // TODO: write adjustments (ppt export doesn't work well there either) + WritePresetShape( sGeometry.toUtf8(), aAdjustValueList); + Reference< XPropertySet > xShapeProps( xShape, UNO_QUERY ); + if( xShapeProps.is() ) + WriteOutline( xShapeProps ); + pFS->endElementNS( mnXmlNamespace, XML_spPr ); + + // connector shape (cxnSp) cannot contain text (txBody) (according to schema) + if( nShapeNode != XML_cxnSp ) + { + // write text + WriteTextBox( xShape, mnXmlNamespace ); + } + + pFS->endElementNS(mnXmlNamespace, nShapeNode); + + return *this; +} + +ShapeExport& ShapeExport::WriteLineShape( const Reference< XShape >& xShape ) +{ + bool bFlipH = false; + bool bFlipV = false; + + SAL_INFO("oox.shape", "write line shape"); + + FSHelperPtr pFS = GetFS(); + + pFS->startElementNS(mnXmlNamespace, (GetDocumentType() != DOCUMENT_DOCX || mbUserShapes ? XML_sp : XML_wsp)); + + tools::PolyPolygon aPolyPolygon = EscherPropertyContainer::GetPolyPolygon( xShape ); + if( aPolyPolygon.Count() == 1 && aPolyPolygon[ 0 ].GetSize() == 2) + { + const tools::Polygon& rPoly = aPolyPolygon[ 0 ]; + + bFlipH = ( rPoly[ 0 ].X() > rPoly[ 1 ].X() ); + bFlipV = ( rPoly[ 0 ].Y() > rPoly[ 1 ].Y() ); + } + + // non visual shape properties + if (GetDocumentType() != DOCUMENT_DOCX || mbUserShapes) + { + pFS->startElementNS(mnXmlNamespace, XML_nvSpPr); + pFS->singleElementNS( mnXmlNamespace, XML_cNvPr, + XML_id, OString::number(GetNewShapeID(xShape)), + XML_name, GetShapeName(xShape)); + } + pFS->singleElementNS( mnXmlNamespace, XML_cNvSpPr ); + if (GetDocumentType() != DOCUMENT_DOCX || mbUserShapes) + { + WriteNonVisualProperties( xShape ); + pFS->endElementNS( mnXmlNamespace, XML_nvSpPr ); + } + + // visual shape properties + pFS->startElementNS(mnXmlNamespace, XML_spPr); + WriteShapeTransformation( xShape, XML_a, bFlipH, bFlipV, true); + WritePresetShape( "line" ); + Reference< XPropertySet > xShapeProps( xShape, UNO_QUERY ); + if( xShapeProps.is() ) + WriteOutline( xShapeProps ); + pFS->endElementNS( mnXmlNamespace, XML_spPr ); + + //write style + pFS->startElementNS(mnXmlNamespace, XML_style); + WriteShapeStyle( xShapeProps ); + pFS->endElementNS( mnXmlNamespace, XML_style ); + + // write text + WriteTextBox( xShape, mnXmlNamespace ); + + pFS->endElementNS( mnXmlNamespace, (GetDocumentType() != DOCUMENT_DOCX || mbUserShapes ? XML_sp : XML_wsp) ); + + return *this; +} + +ShapeExport& ShapeExport::WriteNonVisualDrawingProperties( const Reference< XShape >& xShape, const char* pName ) +{ + GetFS()->singleElementNS( mnXmlNamespace, XML_cNvPr, + XML_id, OString::number(GetNewShapeID(xShape)), + XML_name, pName ); + + return *this; +} + +ShapeExport& ShapeExport::WriteNonVisualProperties( const Reference< XShape >& ) +{ + // Override to generate //nvPr elements. + return *this; +} + +ShapeExport& ShapeExport::WriteRectangleShape( const Reference< XShape >& xShape ) +{ + SAL_INFO("oox.shape", "write rectangle shape"); + + FSHelperPtr pFS = GetFS(); + + pFS->startElementNS(mnXmlNamespace, (GetDocumentType() != DOCUMENT_DOCX || mbUserShapes ? XML_sp : XML_wsp)); + + sal_Int32 nRadius = 0; + + Reference< XPropertySet > xShapeProps( xShape, UNO_QUERY ); + if( xShapeProps.is() ) + { + xShapeProps->getPropertyValue( "CornerRadius" ) >>= nRadius; + } + + if( nRadius ) + { + nRadius = MapSize( awt::Size( nRadius, 0 ) ).Width; + } + //TODO: use nRadius value more precisely than just deciding whether to use + // "rect" or "roundRect" preset shape below + + // non visual shape properties + if (GetDocumentType() == DOCUMENT_DOCX && !mbUserShapes) + pFS->singleElementNS(mnXmlNamespace, XML_cNvSpPr); + pFS->startElementNS(mnXmlNamespace, XML_nvSpPr); + pFS->singleElementNS( mnXmlNamespace, XML_cNvPr, + XML_id, OString::number(GetNewShapeID(xShape)), + XML_name, GetShapeName(xShape)); + pFS->singleElementNS(mnXmlNamespace, XML_cNvSpPr); + WriteNonVisualProperties( xShape ); + pFS->endElementNS( mnXmlNamespace, XML_nvSpPr ); + + // visual shape properties + pFS->startElementNS(mnXmlNamespace, XML_spPr); + WriteShapeTransformation( xShape, XML_a ); + WritePresetShape( nRadius == 0 ? "rect" : "roundRect" ); + Reference< XPropertySet > xProps( xShape, UNO_QUERY ); + if( xProps.is() ) + { + WriteFill( xProps ); + WriteOutline( xProps ); + } + pFS->endElementNS( mnXmlNamespace, XML_spPr ); + + // write text + WriteTextBox( xShape, mnXmlNamespace ); + + pFS->endElementNS( mnXmlNamespace, (GetDocumentType() != DOCUMENT_DOCX || mbUserShapes ? XML_sp : XML_wsp) ); + + return *this; +} + +typedef ShapeExport& (ShapeExport::*ShapeConverter)( const Reference< XShape >& ); +typedef std::unordered_map< const char*, ShapeConverter, rtl::CStringHash, rtl::CStringEqual> NameToConvertMapType; + +static const NameToConvertMapType& lcl_GetConverters() +{ + static NameToConvertMapType const shape_converters + { + // tdf#98736 export CaptionShape as TextShape, because it is non-ooxml shape and + // we can't export this shape as CustomShape + // TODO: WriteCaptionShape + { "com.sun.star.drawing.CaptionShape" , &ShapeExport::WriteTextShape }, + + { "com.sun.star.drawing.ClosedBezierShape" , &ShapeExport::WriteClosedPolyPolygonShape }, + { "com.sun.star.drawing.ConnectorShape" , &ShapeExport::WriteConnectorShape }, + { "com.sun.star.drawing.CustomShape" , &ShapeExport::WriteCustomShape }, + { "com.sun.star.drawing.EllipseShape" , &ShapeExport::WriteEllipseShape }, + { "com.sun.star.drawing.GraphicObjectShape" , &ShapeExport::WriteGraphicObjectShape }, + { "com.sun.star.drawing.LineShape" , &ShapeExport::WriteLineShape }, + { "com.sun.star.drawing.MediaShape" , &ShapeExport::WriteGraphicObjectShape }, + { "com.sun.star.drawing.OpenBezierShape" , &ShapeExport::WriteOpenPolyPolygonShape }, + { "com.sun.star.drawing.PolyPolygonShape" , &ShapeExport::WriteClosedPolyPolygonShape }, + { "com.sun.star.drawing.PolyLineShape" , &ShapeExport::WriteOpenPolyPolygonShape }, + { "com.sun.star.drawing.RectangleShape" , &ShapeExport::WriteRectangleShape }, + { "com.sun.star.drawing.OLE2Shape" , &ShapeExport::WriteOLE2Shape }, + { "com.sun.star.drawing.TableShape" , &ShapeExport::WriteTableShape }, + { "com.sun.star.drawing.TextShape" , &ShapeExport::WriteTextShape }, + { "com.sun.star.drawing.GroupShape" , &ShapeExport::WriteGroupShape }, + + { "com.sun.star.presentation.GraphicObjectShape" , &ShapeExport::WriteGraphicObjectShape }, + { "com.sun.star.presentation.MediaShape" , &ShapeExport::WriteGraphicObjectShape }, + { "com.sun.star.presentation.ChartShape" , &ShapeExport::WriteOLE2Shape }, + { "com.sun.star.presentation.OLE2Shape" , &ShapeExport::WriteOLE2Shape }, + { "com.sun.star.presentation.TableShape" , &ShapeExport::WriteTableShape }, + { "com.sun.star.presentation.TextShape" , &ShapeExport::WriteTextShape }, + + { "com.sun.star.presentation.DateTimeShape" , &ShapeExport::WriteTextShape }, + { "com.sun.star.presentation.FooterShape" , &ShapeExport::WriteTextShape }, + { "com.sun.star.presentation.HeaderShape" , &ShapeExport::WriteTextShape }, + { "com.sun.star.presentation.NotesShape" , &ShapeExport::WriteTextShape }, + { "com.sun.star.presentation.OutlinerShape" , &ShapeExport::WriteTextShape }, + { "com.sun.star.presentation.SlideNumberShape" , &ShapeExport::WriteTextShape }, + { "com.sun.star.presentation.TitleTextShape" , &ShapeExport::WriteTextShape }, + }; + return shape_converters; +} + +ShapeExport& ShapeExport::WriteShape( const Reference< XShape >& xShape ) +{ + if (!xShape) + throw lang::IllegalArgumentException(); + + OUString sShapeType = xShape->getShapeType(); + SAL_INFO("oox.shape", "write shape: " << sShapeType); + NameToConvertMapType::const_iterator aConverter + = lcl_GetConverters().find(sShapeType.toUtf8().getStr()); + if (aConverter == lcl_GetConverters().end()) + { + SAL_INFO("oox.shape", "unknown shape"); + return WriteUnknownShape( xShape ); + } + + if (GetDocumentType() == DOCUMENT_PPTX) + { + Reference< XPropertySet > xShapeProperties(xShape, UNO_QUERY); + if (xShapeProperties && xShapeProperties->getPropertySetInfo() + && xShapeProperties->getPropertySetInfo()->hasPropertyByName("IsPresentationObject") + && xShapeProperties->getPropertyValue("IsPresentationObject").hasValue()) + mbPlaceholder = xShapeProperties->getPropertyValue("IsPresentationObject").get(); + } + + (this->*(aConverter->second))( xShape ); + + return *this; +} + +static bool lcl_isTextBox(const Reference& xIface) +{ + uno::Reference xPropertySet(xIface, uno::UNO_QUERY); + if (!xPropertySet.is()) + return false; + uno::Reference xPropertySetInfo = xPropertySet->getPropertySetInfo(); + if (!xPropertySetInfo->hasPropertyByName("TextBox")) + return false; + css::uno::Any aTextBox(xPropertySet->getPropertyValue("TextBox")); + if (!aTextBox.hasValue()) + return false; + return aTextBox.get(); +} + +ShapeExport& ShapeExport::WriteTextBox( const Reference< XInterface >& xIface, sal_Int32 nXmlNamespace, bool bWritePropertiesAsLstStyles ) +{ + // In case this shape has an associated textbox, then export that, and we're done. + if (GetDocumentType() == DOCUMENT_DOCX && !mbUserShapes && GetTextExport()) + { + if (lcl_isTextBox(xIface)) + { + GetTextExport()->WriteTextBox(uno::Reference(xIface, uno::UNO_QUERY_THROW)); + WriteText( xIface, /*bBodyPr=*/true, /*bText=*/false, /*nXmlNamespace=*/nXmlNamespace ); + return *this; + } + } + + Reference< XText > xXText( xIface, UNO_QUERY ); + if( (NonEmptyText( xIface ) || GetDocumentType() == DOCUMENT_PPTX) + && xXText.is() ) + { + FSHelperPtr pFS = GetFS(); + + pFS->startElementNS(nXmlNamespace, + (GetDocumentType() != DOCUMENT_DOCX || mbUserShapes ? XML_txBody : XML_txbx)); + WriteText(xIface, /*bBodyPr=*/(GetDocumentType() != DOCUMENT_DOCX || mbUserShapes), /*bText=*/true, + /*nXmlNamespace=*/0, /*bWritePropertiesAsLstStyles=*/bWritePropertiesAsLstStyles); + pFS->endElementNS( nXmlNamespace, (GetDocumentType() != DOCUMENT_DOCX || mbUserShapes ? XML_txBody : XML_txbx) ); + if (GetDocumentType() == DOCUMENT_DOCX && !mbUserShapes) + WriteText( xIface, /*bBodyPr=*/true, /*bText=*/false, /*nXmlNamespace=*/nXmlNamespace ); + } + else if (GetDocumentType() == DOCUMENT_DOCX && !mbUserShapes) + mpFS->singleElementNS(nXmlNamespace, XML_bodyPr); + + return *this; +} + +void ShapeExport::WriteTable( const Reference< XShape >& rXShape ) +{ + Reference< XTable > xTable; + Reference< XPropertySet > xPropSet( rXShape, UNO_QUERY ); + + mpFS->startElementNS(XML_a, XML_graphic); + mpFS->startElementNS(XML_a, XML_graphicData, + XML_uri, "http://schemas.openxmlformats.org/drawingml/2006/table"); + + if ( xPropSet.is() && ( xPropSet->getPropertyValue( "Model" ) >>= xTable ) ) + { + mpFS->startElementNS(XML_a, XML_tbl); + mpFS->startElementNS(XML_a, XML_tblPr); + WriteShapeEffects(xPropSet); + mpFS->endElementNS(XML_a, XML_tblPr); + + Reference< container::XIndexAccess > xColumns( xTable->getColumns(), UNO_QUERY_THROW ); + Reference< container::XIndexAccess > xRows( xTable->getRows(), UNO_QUERY_THROW ); + sal_uInt16 nRowCount = static_cast< sal_uInt16 >( xRows->getCount() ); + sal_uInt16 nColumnCount = static_cast< sal_uInt16 >( xColumns->getCount() ); + + mpFS->startElementNS(XML_a, XML_tblGrid); + + for ( sal_Int32 x = 0; x < nColumnCount; x++ ) + { + Reference< XPropertySet > xColPropSet( xColumns->getByIndex( x ), UNO_QUERY_THROW ); + sal_Int32 nWidth(0); + xColPropSet->getPropertyValue( "Width" ) >>= nWidth; + + mpFS->singleElementNS(XML_a, XML_gridCol, + XML_w, OString::number(oox::drawingml::convertHmmToEmu(nWidth))); + } + + mpFS->endElementNS( XML_a, XML_tblGrid ); + + // map for holding the transpose index of the merged cells and pair + typedef std::unordered_map > > transposeTableMap; + transposeTableMap mergedCellMap; + + for( sal_Int32 nRow = 0; nRow < nRowCount; nRow++ ) + { + Reference< XPropertySet > xRowPropSet( xRows->getByIndex( nRow ), UNO_QUERY_THROW ); + sal_Int32 nRowHeight(0); + + xRowPropSet->getPropertyValue( "Height" ) >>= nRowHeight; + + mpFS->startElementNS(XML_a, XML_tr, + XML_h, OString::number(oox::drawingml::convertHmmToEmu(nRowHeight))); + for( sal_Int32 nColumn = 0; nColumn < nColumnCount; nColumn++ ) + { + Reference< XMergeableCell > xCell( xTable->getCellByPosition( nColumn, nRow ), + UNO_QUERY_THROW ); + sal_Int32 transposedIndexofCell = (nRow * nColumnCount) + nColumn; + + //assume we will open a cell, set to false below if we won't + bool bCellOpened = true; + + if(xCell->getColumnSpan() > 1 && xCell->getRowSpan() > 1) + { + // having both : horizontal and vertical merge + mpFS->startElementNS(XML_a, XML_tc, + XML_gridSpan, OString::number(xCell->getColumnSpan()), + XML_rowSpan, OString::number(xCell->getRowSpan())); + // since, XMergeableCell doesn't have the information about + // cell having hMerge or vMerge. + // So, Populating the merged cell map in-order to use it to + // decide the attribute for the individual cell. + for(sal_Int32 columnIndex = nColumn; columnIndex < nColumn+xCell->getColumnSpan(); ++columnIndex) + { + for(sal_Int32 rowIndex = nRow; rowIndex < nRow+xCell->getRowSpan(); ++rowIndex) + { + sal_Int32 transposeIndexForMergeCell = + (rowIndex * nColumnCount) + columnIndex; + mergedCellMap[transposeIndexForMergeCell] = + std::make_pair(transposedIndexofCell, xCell); + } + } + + } + else if(xCell->getColumnSpan() > 1) + { + // having : horizontal merge + mpFS->startElementNS(XML_a, XML_tc, + XML_gridSpan, OString::number(xCell->getColumnSpan())); + for(sal_Int32 columnIndex = nColumn; columnIndex < nColumn + xCell->getColumnSpan(); ++columnIndex) { + sal_Int32 transposeIndexForMergeCell = (nRow*nColumnCount) + columnIndex; + mergedCellMap[transposeIndexForMergeCell] = + std::make_pair(transposedIndexofCell, xCell); + } + } + else if(xCell->getRowSpan() > 1) + { + // having : vertical merge + mpFS->startElementNS(XML_a, XML_tc, + XML_rowSpan, OString::number(xCell->getRowSpan())); + + for(sal_Int32 rowIndex = nRow; rowIndex < nRow + xCell->getRowSpan(); ++rowIndex) { + sal_Int32 transposeIndexForMergeCell = (rowIndex*nColumnCount) + nColumn; + mergedCellMap[transposeIndexForMergeCell] = + std::make_pair(transposedIndexofCell, xCell); + } + } + else + { + // now, the cell can be an independent cell or + // it can be a cell which is been merged to some parent cell + if(!xCell->isMerged()) + { + // independent cell + mpFS->startElementNS(XML_a, XML_tc); + } + else + { + // it a merged cell to some parent cell + // find the parent cell for the current cell at hand + transposeTableMap::iterator it = mergedCellMap.find(transposedIndexofCell); + if(it != mergedCellMap.end()) + { + sal_Int32 transposeIndexOfParent = it->second.first; + Reference< XMergeableCell > parentCell = it->second.second; + // finding the row and column index for the parent cell from transposed index + sal_Int32 parentColumnIndex = transposeIndexOfParent % nColumnCount; + sal_Int32 parentRowIndex = transposeIndexOfParent / nColumnCount; + if(nColumn == parentColumnIndex) + { + // the cell is vertical merge and it might have gridspan + if(parentCell->getColumnSpan() > 1) + { + // vMerge and has gridSpan + mpFS->startElementNS(XML_a, XML_tc, + XML_vMerge, OString::number(1), + XML_gridSpan, OString::number(xCell->getColumnSpan())); + } + else + { + // only vMerge + mpFS->startElementNS(XML_a, XML_tc, + XML_vMerge, OString::number(1)); + } + } + else if(nRow == parentRowIndex) + { + // the cell is horizontal merge and it might have rowspan + if(parentCell->getRowSpan() > 1) + { + // hMerge and has rowspan + mpFS->startElementNS(XML_a, XML_tc, + XML_hMerge, OString::number(1), + XML_rowSpan, OString::number(xCell->getRowSpan())); + } + else + { + // only hMerge + mpFS->startElementNS(XML_a, XML_tc, + XML_hMerge, OString::number(1)); + } + } + else + { + // has hMerge and vMerge + mpFS->startElementNS(XML_a, XML_tc, + XML_vMerge, OString::number(1), + XML_hMerge, OString::number(1)); + } + } + else + bCellOpened = false; + } + } + + if (bCellOpened) + { + WriteTextBox( xCell, XML_a ); + + Reference< XPropertySet > xCellPropSet(xCell, UNO_QUERY_THROW); + WriteTableCellProperties(xCellPropSet); + + mpFS->endElementNS( XML_a, XML_tc ); + } + } + + mpFS->endElementNS( XML_a, XML_tr ); + } + + mpFS->endElementNS( XML_a, XML_tbl ); + } + + mpFS->endElementNS( XML_a, XML_graphicData ); + mpFS->endElementNS( XML_a, XML_graphic ); +} + +void ShapeExport::WriteTableCellProperties(const Reference< XPropertySet>& xCellPropSet) +{ + sal_Int32 nLeftMargin(0), nRightMargin(0); + TextVerticalAdjust eVerticalAlignment; + const char* sVerticalAlignment; + + Any aLeftMargin = xCellPropSet->getPropertyValue("TextLeftDistance"); + aLeftMargin >>= nLeftMargin; + + Any aRightMargin = xCellPropSet->getPropertyValue("TextRightDistance"); + aRightMargin >>= nRightMargin; + + Any aVerticalAlignment = xCellPropSet->getPropertyValue("TextVerticalAdjust"); + aVerticalAlignment >>= eVerticalAlignment; + sVerticalAlignment = GetTextVerticalAdjust(eVerticalAlignment); + + mpFS->startElementNS(XML_a, XML_tcPr, XML_anchor, sVerticalAlignment, + XML_marL, sax_fastparser::UseIf(OString::number(oox::drawingml::convertHmmToEmu(nLeftMargin)), nLeftMargin > 0), + XML_marR, sax_fastparser::UseIf(OString::number(oox::drawingml::convertHmmToEmu(nRightMargin)), nRightMargin > 0)); + + // Write background fill for table cell. + // TODO + // tcW : Table cell width + WriteTableCellBorders(xCellPropSet); + DrawingML::WriteFill(xCellPropSet); + mpFS->endElementNS( XML_a, XML_tcPr ); +} + +void ShapeExport::WriteBorderLine(const sal_Int32 XML_line, const BorderLine2& rBorderLine) +{ +// While importing the table cell border line width, it converts EMU->Hmm then divided result by 2. +// To get original value of LineWidth need to multiple by 2. + sal_Int32 nBorderWidth = rBorderLine.LineWidth; + nBorderWidth *= 2; + nBorderWidth = oox::drawingml::convertHmmToEmu( nBorderWidth ); + + if ( nBorderWidth > 0 ) + { + mpFS->startElementNS(XML_a, XML_line, XML_w, OString::number(nBorderWidth)); + if ( rBorderLine.Color == sal_Int32( COL_AUTO ) ) + mpFS->singleElementNS(XML_a, XML_noFill); + else + DrawingML::WriteSolidFill( ::Color(ColorTransparency, rBorderLine.Color) ); + mpFS->endElementNS( XML_a, XML_line ); + } + else if( nBorderWidth == 0) + { + mpFS->startElementNS(XML_a, XML_line); + mpFS->singleElementNS(XML_a, XML_noFill); + mpFS->endElementNS( XML_a, XML_line ); + } +} + +void ShapeExport::WriteTableCellBorders(const Reference< XPropertySet>& xCellPropSet) +{ + BorderLine2 aBorderLine; + +// lnL - Left Border Line Properties of table cell + xCellPropSet->getPropertyValue("LeftBorder") >>= aBorderLine; + WriteBorderLine( XML_lnL, aBorderLine ); + +// lnR - Right Border Line Properties of table cell + xCellPropSet->getPropertyValue("RightBorder") >>= aBorderLine; + WriteBorderLine( XML_lnR, aBorderLine ); + +// lnT - Top Border Line Properties of table cell + xCellPropSet->getPropertyValue("TopBorder") >>= aBorderLine; + WriteBorderLine( XML_lnT, aBorderLine ); + +// lnB - Bottom Border Line Properties of table cell + xCellPropSet->getPropertyValue("BottomBorder") >>= aBorderLine; + WriteBorderLine( XML_lnB, aBorderLine ); +} + +ShapeExport& ShapeExport::WriteTableShape( const Reference< XShape >& xShape ) +{ + FSHelperPtr pFS = GetFS(); + + pFS->startElementNS(mnXmlNamespace, XML_graphicFrame); + + pFS->startElementNS(mnXmlNamespace, XML_nvGraphicFramePr); + + pFS->singleElementNS( mnXmlNamespace, XML_cNvPr, + XML_id, OString::number(GetNewShapeID(xShape)), + XML_name, GetShapeName(xShape)); + + pFS->singleElementNS(mnXmlNamespace, XML_cNvGraphicFramePr); + + if( GetDocumentType() == DOCUMENT_PPTX ) + pFS->singleElementNS(mnXmlNamespace, XML_nvPr); + pFS->endElementNS( mnXmlNamespace, XML_nvGraphicFramePr ); + + WriteShapeTransformation( xShape, mnXmlNamespace ); + WriteTable( xShape ); + + pFS->endElementNS( mnXmlNamespace, XML_graphicFrame ); + + return *this; +} + +ShapeExport& ShapeExport::WriteTextShape( const Reference< XShape >& xShape ) +{ + FSHelperPtr pFS = GetFS(); + Reference xShapeProps(xShape, UNO_QUERY); + + pFS->startElementNS(mnXmlNamespace, (GetDocumentType() != DOCUMENT_DOCX || mbUserShapes ? XML_sp : XML_wsp)); + + // non visual shape properties + if (GetDocumentType() != DOCUMENT_DOCX || mbUserShapes) + { + pFS->startElementNS(mnXmlNamespace, XML_nvSpPr); + pFS->startElementNS(mnXmlNamespace, XML_cNvPr, + XML_id, OString::number(GetNewShapeID(xShape)), + XML_name, GetShapeName(xShape)); + OUString sURL; + if (GetProperty(xShapeProps, "URL")) + mAny >>= sURL; + + if (!sURL.isEmpty()) + { + OUString sRelId = mpFB->addRelation(mpFS->getOutputStream(), + oox::getRelationship(Relationship::HYPERLINK), + mpURLTransformer->getTransformedString(sURL), + mpURLTransformer->isExternalURL(sURL)); + + mpFS->singleElementNS(XML_a, XML_hlinkClick, FSNS(XML_r, XML_id), sRelId); + } + pFS->endElementNS(mnXmlNamespace, XML_cNvPr); + } + pFS->singleElementNS(mnXmlNamespace, XML_cNvSpPr, XML_txBox, "1"); + if (GetDocumentType() != DOCUMENT_DOCX || mbUserShapes) + { + WriteNonVisualProperties( xShape ); + pFS->endElementNS( mnXmlNamespace, XML_nvSpPr ); + } + + // visual shape properties + pFS->startElementNS(mnXmlNamespace, XML_spPr); + WriteShapeTransformation( xShape, XML_a ); + WritePresetShape( "rect" ); + uno::Reference xPropertySet(xShape, UNO_QUERY); + if (!IsFontworkShape(xShapeProps)) // Fontwork needs fill and outline in run properties instead. + { + WriteBlipOrNormalFill(xPropertySet, "Graphic"); + WriteOutline(xPropertySet); + WriteShapeEffects(xPropertySet); + } + pFS->endElementNS( mnXmlNamespace, XML_spPr ); + + WriteTextBox( xShape, mnXmlNamespace ); + + pFS->endElementNS( mnXmlNamespace, (GetDocumentType() != DOCUMENT_DOCX || mbUserShapes ? XML_sp : XML_wsp) ); + + return *this; +} + +void ShapeExport::WriteMathShape(Reference const& xShape) +{ + Reference const xPropSet(xShape, UNO_QUERY); + assert(xPropSet.is()); + Reference xMathModel; + xPropSet->getPropertyValue("Model") >>= xMathModel; + assert(xMathModel.is()); + assert(GetDocumentType() != DOCUMENT_DOCX); // should be written in DocxAttributeOutput + SAL_WARN_IF(GetDocumentType() == DOCUMENT_XLSX, "oox.shape", "Math export to XLSX isn't tested, should it happen here?"); + + // ECMA standard does not actually allow oMath outside of + // WordProcessingML so write a MCE like PPT 2010 does + mpFS->startElementNS(XML_mc, XML_AlternateContent); + mpFS->startElementNS(XML_mc, XML_Choice, + FSNS(XML_xmlns, XML_a14), mpFB->getNamespaceURL(OOX_NS(a14)), + XML_Requires, "a14"); + mpFS->startElementNS(mnXmlNamespace, XML_sp); + mpFS->startElementNS(mnXmlNamespace, XML_nvSpPr); + mpFS->singleElementNS(mnXmlNamespace, XML_cNvPr, + XML_id, OString::number(GetNewShapeID(xShape)), + XML_name, GetShapeName(xShape)); + mpFS->singleElementNS(mnXmlNamespace, XML_cNvSpPr, XML_txBox, "1"); + mpFS->singleElementNS(mnXmlNamespace, XML_nvPr); + mpFS->endElementNS(mnXmlNamespace, XML_nvSpPr); + mpFS->startElementNS(mnXmlNamespace, XML_spPr); + WriteShapeTransformation(xShape, XML_a); + WritePresetShape("rect"); + mpFS->endElementNS(mnXmlNamespace, XML_spPr); + mpFS->startElementNS(mnXmlNamespace, XML_txBody); + mpFS->startElementNS(XML_a, XML_bodyPr); + mpFS->endElementNS(XML_a, XML_bodyPr); + mpFS->startElementNS(XML_a, XML_p); + mpFS->startElementNS(XML_a14, XML_m); + + oox::FormulaExportBase *const pMagic(dynamic_cast(xMathModel.get())); + assert(pMagic); + pMagic->writeFormulaOoxml(GetFS(), GetFB()->getVersion(), GetDocumentType(), + FormulaExportBase::eFormulaAlign::INLINE); + + mpFS->endElementNS(XML_a14, XML_m); + mpFS->endElementNS(XML_a, XML_p); + mpFS->endElementNS(mnXmlNamespace, XML_txBody); + mpFS->endElementNS(mnXmlNamespace, XML_sp); + mpFS->endElementNS(XML_mc, XML_Choice); + mpFS->startElementNS(XML_mc, XML_Fallback); + // TODO: export bitmap shape as fallback + mpFS->endElementNS(XML_mc, XML_Fallback); + mpFS->endElementNS(XML_mc, XML_AlternateContent); +} + +ShapeExport& ShapeExport::WriteOLE2Shape( const Reference< XShape >& xShape ) +{ + Reference< XPropertySet > xPropSet( xShape, UNO_QUERY ); + if (!xPropSet.is()) + return *this; + + enum { CHART, MATH, OTHER } eType(OTHER); + OUString clsid; + xPropSet->getPropertyValue("CLSID") >>= clsid; + if (!clsid.isEmpty()) + { + SvGlobalName aClassID; + bool const isValid = aClassID.MakeId(clsid); + assert(isValid); (void)isValid; + if (SotExchange::IsChart(aClassID)) + eType = CHART; + else if (SotExchange::IsMath(aClassID)) + eType = MATH; + } + + if (CHART == eType) + { + Reference< XChartDocument > xChartDoc; + xPropSet->getPropertyValue("Model") >>= xChartDoc; + assert(xChartDoc.is()); + //export the chart +#if !ENABLE_WASM_STRIP_CHART + // WASM_CHART change + // TODO: With Chart extracted this cannot really happen since + // no Chart could've been added at all + ChartExport aChartExport( mnXmlNamespace, GetFS(), xChartDoc, GetFB(), GetDocumentType() ); + static sal_Int32 nChartCount = 0; + aChartExport.WriteChartObj( xShape, GetNewShapeID( xShape ), ++nChartCount ); +#endif + return *this; + } + + if (MATH == eType) + { + WriteMathShape(xShape); + return *this; + } + + uno::Reference const xObj( + xPropSet->getPropertyValue("EmbeddedObject"), uno::UNO_QUERY); + + if (!xObj.is()) + { + SAL_WARN("oox.shape", "ShapeExport::WriteOLE2Shape: no object"); + + // tdf#152436 Export the preview graphic of the object if the object is missing. + SdrObject* pSdrOLE2(SdrObject::getSdrObjectFromXShape(xShape)); + if (auto pOle2Obj = dynamic_cast(pSdrOLE2)) + { + const Graphic* pGraphic = pOle2Obj->GetGraphic(); + if (pGraphic) + WriteGraphicObjectShapePart(xShape, pGraphic); + } + + return *this; + } + + uno::Sequence grabBag; + OUString entryName; + try + { + uno::Reference const xParent( + uno::Reference(xObj, uno::UNO_QUERY_THROW)->getParent(), + uno::UNO_QUERY_THROW); + + xParent->getPropertyValue("InteropGrabBag") >>= grabBag; + + entryName = uno::Reference(xObj, uno::UNO_QUERY_THROW)->getEntryName(); + } + catch (uno::Exception const&) + { + TOOLS_WARN_EXCEPTION("oox.shape", "ShapeExport::WriteOLE2Shape"); + return *this; + } + + OUString progID; + + for (auto const& it : std::as_const(grabBag)) + { + if (it.Name == "EmbeddedObjects") + { + uno::Sequence objects; + it.Value >>= objects; + for (auto const& object : std::as_const(objects)) + { + if (object.Name == entryName) + { + uno::Sequence props; + object.Value >>= props; + for (auto const& prop : std::as_const(props)) + { + if (prop.Name == "ProgID") + { + prop.Value >>= progID; + break; + } + } + break; + } + } + break; + } + } + + OUString sMediaType; + OUString sRelationType; + OUString sSuffix; + const char * pProgID(nullptr); + + uno::Reference const xInStream = + oox::GetOLEObjectStream( + mpFB->getComponentContext(), xObj, progID, + sMediaType, sRelationType, sSuffix, pProgID); + + if (!xInStream.is()) + { + return *this; + } + + OString anotherProgID; + if (!pProgID && !progID.isEmpty()) + { + anotherProgID = OUStringToOString(progID, RTL_TEXTENCODING_UTF8); + pProgID = anotherProgID.getStr(); + } + + assert(!sMediaType.isEmpty()); + assert(!sRelationType.isEmpty()); + assert(!sSuffix.isEmpty()); + + OUString sFileName = "embeddings/oleObject" + OUString::number(++m_nEmbeddedObjects) + "." + sSuffix; + uno::Reference const xOutStream( + mpFB->openFragmentStream( + OUString::createFromAscii(GetComponentDir()) + "/" + sFileName, + sMediaType)); + assert(xOutStream.is()); // no reason why that could fail + + try { + ::comphelper::OStorageHelper::CopyInputToOutput(xInStream, xOutStream); + } catch (uno::Exception const&) { + TOOLS_WARN_EXCEPTION("oox.shape", "ShapeExport::WriteOLEObject"); + } + + OUString const sRelId = mpFB->addRelation( + mpFS->getOutputStream(), sRelationType, + OUStringConcatenation(OUString::createFromAscii(GetRelationCompPrefix()) + sFileName)); + + mpFS->startElementNS(mnXmlNamespace, XML_graphicFrame); + + mpFS->startElementNS(mnXmlNamespace, XML_nvGraphicFramePr); + + mpFS->singleElementNS( mnXmlNamespace, XML_cNvPr, + XML_id, OString::number(GetNewShapeID(xShape)), + XML_name, GetShapeName(xShape)); + + mpFS->singleElementNS(mnXmlNamespace, XML_cNvGraphicFramePr); + + if (GetDocumentType() == DOCUMENT_PPTX) + mpFS->singleElementNS(mnXmlNamespace, XML_nvPr); + mpFS->endElementNS( mnXmlNamespace, XML_nvGraphicFramePr ); + + WriteShapeTransformation( xShape, mnXmlNamespace ); + + mpFS->startElementNS(XML_a, XML_graphic); + mpFS->startElementNS(XML_a, XML_graphicData, + XML_uri, "http://schemas.openxmlformats.org/presentationml/2006/ole"); + if (pProgID) + { + mpFS->startElementNS( mnXmlNamespace, XML_oleObj, + XML_progId, pProgID, + FSNS(XML_r, XML_id), sRelId, + XML_spid, "" ); + } + else + { + mpFS->startElementNS( mnXmlNamespace, XML_oleObj, +//? XML_name, "Document", + FSNS(XML_r, XML_id), sRelId, + // The spec says that this is a required attribute, but PowerPoint can only handle an empty value. + XML_spid, "" ); + } + + mpFS->singleElementNS( mnXmlNamespace, XML_embed ); + + // pic element + SdrObject* pSdrOLE2(SdrObject::getSdrObjectFromXShape(xShape)); + // The spec doesn't allow here, but PowerPoint requires it. + bool bEcma = mpFB->getVersion() == oox::core::ECMA_DIALECT; + if (bEcma) + if (auto pOle2Obj = dynamic_cast(pSdrOLE2)) + { + const Graphic* pGraphic = pOle2Obj->GetGraphic(); + if (pGraphic) + WriteGraphicObjectShapePart( xShape, pGraphic ); + } + + mpFS->endElementNS( mnXmlNamespace, XML_oleObj ); + + mpFS->endElementNS( XML_a, XML_graphicData ); + mpFS->endElementNS( XML_a, XML_graphic ); + + mpFS->endElementNS( mnXmlNamespace, XML_graphicFrame ); + + return *this; +} + +ShapeExport& ShapeExport::WriteUnknownShape( const Reference< XShape >& ) +{ + // Override this method to do something useful. + return *this; +} + +sal_Int32 ShapeExport::GetNewShapeID( const Reference< XShape >& rXShape ) +{ + return GetNewShapeID( rXShape, GetFB() ); +} + +sal_Int32 ShapeExport::GetNewShapeID( const Reference< XShape >& rXShape, XmlFilterBase* pFB ) +{ + if( !rXShape.is() ) + return -1; + + sal_Int32 nID = pFB->GetUniqueId(); + + (*mpShapeMap)[ rXShape ] = nID; + + return nID; +} + +sal_Int32 ShapeExport::GetShapeID( const Reference< XShape >& rXShape ) +{ + return GetShapeID( rXShape, mpShapeMap ); +} + +sal_Int32 ShapeExport::GetShapeID( const Reference< XShape >& rXShape, ShapeHashMap* pShapeMap ) +{ + if( !rXShape.is() ) + return -1; + + ShapeHashMap::const_iterator aIter = pShapeMap->find( rXShape ); + + if( aIter == pShapeMap->end() ) + return -1; + + return aIter->second; +} + +OUString ShapeExport::GetShapeName(const Reference& xShape) +{ + Reference rXPropSet(xShape, UNO_QUERY); + + // Empty name keeps the object unnamed. + OUString sName; + + if (GetProperty(rXPropSet, "Name")) + mAny >>= sName; + return sName; +} + +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/export/vmlexport.cxx b/oox/source/export/vmlexport.cxx new file mode 100644 index 000000000..4f2654fae --- /dev/null +++ b/oox/source/export/vmlexport.cxx @@ -0,0 +1,1529 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +using namespace sax_fastparser; +using namespace oox::vml; +using namespace com::sun::star; + +const sal_Int32 Tag_Container = 44444; +const sal_Int32 Tag_Commit = 44445; + +VMLExport::VMLExport( ::sax_fastparser::FSHelperPtr const & pSerializer, VMLTextExport* pTextExport ) + : EscherEx( std::make_shared(), nullptr, /*bOOXML=*/true ) + , m_pSerializer( pSerializer ) + , m_pTextExport( pTextExport ) + , m_eHOri( 0 ) + , m_eVOri( 0 ) + , m_eHRel( 0 ) + , m_eVRel( 0 ) + , m_bInline( false ) + , m_pSdrObject( nullptr ) + , m_nShapeType( ESCHER_ShpInst_Nil ) + , m_nShapeFlags(ShapeFlag::NONE) + , m_ShapeStyle( 200 ) + , m_aShapeTypeWritten( ESCHER_ShpInst_COUNT ) + , m_bSkipwzName( false ) + , m_bUseHashMarkForType( false ) + , m_bOverrideShapeIdGeneration( false ) + , m_nShapeIDCounter( 0 ) +{ + mnGroupLevel = 1; +} + +void VMLExport::SetFS( const ::sax_fastparser::FSHelperPtr& pSerializer ) +{ + m_pSerializer = pSerializer; +} + +VMLExport::~VMLExport() +{ + delete mpOutStrm; + mpOutStrm = nullptr; +} + +void VMLExport::OpenContainer( sal_uInt16 nEscherContainer, int nRecInstance ) +{ + EscherEx::OpenContainer( nEscherContainer, nRecInstance ); + + if ( nEscherContainer != ESCHER_SpContainer ) + return; + + // opening a shape container + SAL_WARN_IF(m_nShapeType != ESCHER_ShpInst_Nil, "oox.vml", "opening shape inside of a shape!"); + m_nShapeType = ESCHER_ShpInst_Nil; + m_pShapeAttrList = FastSerializerHelper::createAttrList(); + + m_ShapeStyle.setLength(0); + m_ShapeStyle.ensureCapacity(200); + + // postpone the output so that we are able to write even the elements + // that we learn inside Commit() + m_pSerializer->mark(Tag_Container); +} + +void VMLExport::CloseContainer() +{ + if ( mRecTypes.back() == ESCHER_SpContainer ) + { + // write the shape now when we have all the info + sal_Int32 nShapeElement = StartShape(); + + m_pSerializer->mergeTopMarks(Tag_Container); + + EndShape( nShapeElement ); + + // cleanup + m_nShapeType = ESCHER_ShpInst_Nil; + m_pShapeAttrList = nullptr; + } + + EscherEx::CloseContainer(); +} + +sal_uInt32 VMLExport::EnterGroup( const OUString& rShapeName, const tools::Rectangle* pRect ) +{ + sal_uInt32 nShapeId = GenerateShapeId(); + + OStringBuffer aStyle( 200 ); + rtl::Reference pAttrList = FastSerializerHelper::createAttrList(); + + pAttrList->add( XML_id, ShapeIdString( nShapeId ) ); + + if ( rShapeName.getLength() ) + pAttrList->add( XML_alt, rShapeName ); + + bool rbAbsolutePos = true; + //editAs + OUString rEditAs = EscherEx::GetEditAs(); + if (!rEditAs.isEmpty()) + { + pAttrList->add(XML_editas, rEditAs); + rbAbsolutePos = false; + } + + // style + if ( pRect ) + AddRectangleDimensions( aStyle, *pRect, rbAbsolutePos ); + + if ( !aStyle.isEmpty() ) + pAttrList->add( XML_style, aStyle.makeStringAndClear() ); + + // coordorigin/coordsize + if ( pRect && ( mnGroupLevel == 1 ) ) + { + pAttrList->add( XML_coordorigin, + OString::number( pRect->Left() ) + "," + OString::number( pRect->Top() ) ); + + pAttrList->add( XML_coordsize, + OString::number( pRect->Right() - pRect->Left() ) + "," + + OString::number( pRect->Bottom() - pRect->Top() ) ); + } + + m_pSerializer->startElementNS( XML_v, XML_group, pAttrList ); + + mnGroupLevel++; + return nShapeId; +} + +void VMLExport::LeaveGroup() +{ + --mnGroupLevel; + m_pSerializer->endElementNS( XML_v, XML_group ); +} + +void VMLExport::AddShape( sal_uInt32 nShapeType, ShapeFlag nShapeFlags, sal_uInt32 nShapeId ) +{ + m_nShapeType = nShapeType; + m_nShapeFlags = nShapeFlags; + + m_sShapeId = ShapeIdString( nShapeId ); + // If shape is a watermark object - should keep the original shape's name + // because Microsoft detects if it is a watermark by the actual name + if (!IsWaterMarkShape(m_pSdrObject->GetName())) + { + // Not a watermark object + m_pShapeAttrList->add( XML_id, m_sShapeId ); + } + else + { + // A watermark object - store the optional shape ID + m_pShapeAttrList->add( XML_id, m_pSdrObject->GetName() ); + // also ('o:spid') + m_pShapeAttrList->addNS( XML_o, XML_spid, m_sShapeId ); + } +} + +bool VMLExport::IsWaterMarkShape(std::u16string_view rStr) +{ + if (rStr.empty() ) return false; + + return o3tl::starts_with(rStr, u"PowerPlusWaterMarkObject") || o3tl::starts_with(rStr, u"WordPictureWatermark"); +} + +void VMLExport::OverrideShapeIDGen(bool bOverrideShapeIdGen, const OString& sShapeIDPrefix) +{ + m_bOverrideShapeIdGeneration = bOverrideShapeIdGen; + if(bOverrideShapeIdGen) + { + assert(!sShapeIDPrefix.isEmpty()); + m_sShapeIDPrefix = sShapeIDPrefix; + } + else + m_sShapeIDPrefix.clear(); +} + +static void impl_AddArrowHead( sax_fastparser::FastAttributeList *pAttrList, sal_Int32 nElement, sal_uInt32 nValue ) +{ + if ( !pAttrList ) + return; + + const char *pArrowHead = nullptr; + switch ( nValue ) + { + case ESCHER_LineNoEnd: pArrowHead = "none"; break; + case ESCHER_LineArrowEnd: pArrowHead = "block"; break; + case ESCHER_LineArrowStealthEnd: pArrowHead = "classic"; break; + case ESCHER_LineArrowDiamondEnd: pArrowHead = "diamond"; break; + case ESCHER_LineArrowOvalEnd: pArrowHead = "oval"; break; + case ESCHER_LineArrowOpenEnd: pArrowHead = "open"; break; + } + + if ( pArrowHead ) + pAttrList->add( nElement, pArrowHead ); +} + +static void impl_AddArrowLength( sax_fastparser::FastAttributeList *pAttrList, sal_Int32 nElement, sal_uInt32 nValue ) +{ + if ( !pAttrList ) + return; + + const char *pArrowLength = nullptr; + switch ( nValue ) + { + case ESCHER_LineShortArrow: pArrowLength = "short"; break; + case ESCHER_LineMediumLenArrow: pArrowLength = "medium"; break; + case ESCHER_LineLongArrow: pArrowLength = "long"; break; + } + + if ( pArrowLength ) + pAttrList->add( nElement, pArrowLength ); +} + +static void impl_AddArrowWidth( sax_fastparser::FastAttributeList *pAttrList, sal_Int32 nElement, sal_uInt32 nValue ) +{ + if ( !pAttrList ) + return; + + const char *pArrowWidth = nullptr; + switch ( nValue ) + { + case ESCHER_LineNarrowArrow: pArrowWidth = "narrow"; break; + case ESCHER_LineMediumWidthArrow: pArrowWidth = "medium"; break; + case ESCHER_LineWideArrow: pArrowWidth = "wide"; break; + } + + if ( pArrowWidth ) + pAttrList->add( nElement, pArrowWidth ); +} + +static void impl_AddBool( sax_fastparser::FastAttributeList *pAttrList, sal_Int32 nElement, bool bValue ) +{ + if ( !pAttrList ) + return; + + pAttrList->add( nElement, bValue? "t": "f" ); +} + +static void impl_AddColor( sax_fastparser::FastAttributeList *pAttrList, sal_Int32 nElement, sal_uInt32 nColor ) +{ + SAL_WARN_IF( nColor & 0xFF000000 , "oox.vml" , "TODO: this is not a RGB value!"); + + if ( !pAttrList || ( nColor & 0xFF000000 ) ) + return; + + nColor = ( ( nColor & 0xFF ) << 16 ) + ( nColor & 0xFF00 ) + ( ( nColor & 0xFF0000 ) >> 16 ); + + const char *pColor = nullptr; + char pRgbColor[10]; + switch ( nColor ) + { + case 0x000000: pColor = "black"; break; + case 0xC0C0C0: pColor = "silver"; break; + case 0x808080: pColor = "gray"; break; + case 0xFFFFFF: pColor = "white"; break; + case 0x800000: pColor = "maroon"; break; + case 0xFF0000: pColor = "red"; break; + case 0x800080: pColor = "purple"; break; + case 0xFF00FF: pColor = "fuchsia"; break; + case 0x008000: pColor = "green"; break; + case 0x00FF00: pColor = "lime"; break; + case 0x808000: pColor = "olive"; break; + case 0xFFFF00: pColor = "yellow"; break; + case 0x000080: pColor = "navy"; break; + case 0x0000FF: pColor = "blue"; break; + case 0x008080: pColor = "teal"; break; + case 0x00FFFF: pColor = "aqua"; break; + default: + { + snprintf( pRgbColor, sizeof( pRgbColor ), "#%06x", static_cast< unsigned int >( nColor ) ); // not too handy to use OString::valueOf() here :-( + pColor = pRgbColor; + } + break; + } + + pAttrList->add( nElement, pColor ); +} + +static void impl_AddInt( sax_fastparser::FastAttributeList *pAttrList, sal_Int32 nElement, sal_uInt32 nValue ) +{ + if ( !pAttrList ) + return; + + pAttrList->add( nElement, OString::number( nValue ).getStr() ); +} + +static sal_uInt16 impl_GetUInt16( const sal_uInt8* &pVal ) +{ + sal_uInt16 nRet = *pVal++; + nRet += ( *pVal++ ) << 8; + return nRet; +} + +static sal_Int32 impl_GetPointComponent( const sal_uInt8* &pVal, sal_uInt16 nPointSize ) +{ + sal_Int32 nRet = 0; + if ( ( nPointSize == 0xfff0 ) || ( nPointSize == 4 ) ) + { + sal_uInt16 nUnsigned = *pVal++; + nUnsigned += ( *pVal++ ) << 8; + + nRet = sal_Int16( nUnsigned ); + } + else if ( nPointSize == 8 ) + { + sal_uInt32 nUnsigned = *pVal++; + nUnsigned += ( *pVal++ ) << 8; + nUnsigned += ( *pVal++ ) << 16; + nUnsigned += ( *pVal++ ) << 24; + + nRet = nUnsigned; + } + + return nRet; +} + +void VMLExport::AddSdrObjectVMLObject( const SdrObject& rObj) +{ + m_pSdrObject = &rObj; +} +void VMLExport::Commit( EscherPropertyContainer& rProps, const tools::Rectangle& rRect ) +{ + if ( m_nShapeType == ESCHER_ShpInst_Nil ) + return; + + // postpone the output of the embedded elements so that they are written + // inside the shapes + m_pSerializer->mark(Tag_Commit); + + // dimensions + if ( m_nShapeType == ESCHER_ShpInst_Line ) + AddLineDimensions( rRect ); + else + { + if ( IsWaterMarkShape( m_pSdrObject->GetName() ) ) + { + // Watermark need some padding to be compatible with MSO + tools::Long nPaddingY = 0; + const SfxItemSet& rSet = m_pSdrObject->GetMergedItemSet(); + if ( const SdrMetricItem* pItem = rSet.GetItem( SDRATTR_TEXT_UPPERDIST ) ) + nPaddingY += pItem->GetValue(); + + tools::Rectangle aRect( rRect ); + aRect.setHeight( aRect.getHeight() + nPaddingY ); + AddRectangleDimensions( m_ShapeStyle, aRect ); + } + else + AddRectangleDimensions( m_ShapeStyle, rRect ); + } + + // properties + bool bAlreadyWritten[ 0xFFF ] = {}; + const EscherProperties &rOpts = rProps.GetOpts(); + for (auto const& opt : rOpts) + { + sal_uInt16 nId = ( opt.nPropId & 0x0FFF ); + + if ( bAlreadyWritten[ nId ] ) + continue; + + switch ( nId ) + { + case ESCHER_Prop_WrapText: // 133 + { + const char *pWrapType = nullptr; + switch ( opt.nPropValue ) + { + case ESCHER_WrapSquare: + case ESCHER_WrapByPoints: pWrapType = "square"; break; // these two are equivalent according to the docu + case ESCHER_WrapNone: pWrapType = "none"; break; + case ESCHER_WrapTopBottom: + case ESCHER_WrapThrough: + break; // last two are *undefined* in MS-ODRAW, don't exist in VML + } + if ( pWrapType ) + { + m_ShapeStyle.append(";mso-wrap-style:"); + m_ShapeStyle.append(pWrapType); + } + } + bAlreadyWritten[ ESCHER_Prop_WrapText ] = true; + break; + + case ESCHER_Prop_AnchorText: // 135 + { + char const* pValue(nullptr); + switch (opt.nPropValue) + { + case ESCHER_AnchorTop: + pValue = "top"; + break; + case ESCHER_AnchorMiddle: + pValue = "middle"; + break; + case ESCHER_AnchorBottom: + pValue = "bottom"; + break; + case ESCHER_AnchorTopCentered: + pValue = "top-center"; + break; + case ESCHER_AnchorMiddleCentered: + pValue = "middle-center"; + break; + case ESCHER_AnchorBottomCentered: + pValue = "bottom-center"; + break; + case ESCHER_AnchorTopBaseline: + pValue = "top-baseline"; + break; + case ESCHER_AnchorBottomBaseline: + pValue = "bottom-baseline"; + break; + case ESCHER_AnchorTopCenteredBaseline: + pValue = "top-center-baseline"; + break; + case ESCHER_AnchorBottomCenteredBaseline: + pValue = "bottom-center-baseline"; + break; + } + m_ShapeStyle.append(";v-text-anchor:"); + m_ShapeStyle.append(pValue); + } + break; + + case ESCHER_Prop_txflTextFlow: // 136 + { + // at least "bottom-to-top" only has an effect when it's on the v:textbox element, not on v:shape + assert(m_TextboxStyle.isEmpty()); + switch (opt.nPropValue) + { + case ESCHER_txflHorzN: + m_TextboxStyle.append("layout-flow:horizontal"); + break; + case ESCHER_txflTtoBA: + m_TextboxStyle.append("layout-flow:vertical"); + break; + case ESCHER_txflBtoT: + m_TextboxStyle.append("mso-layout-flow-alt:bottom-to-top"); + break; + default: + assert(false); // unimplemented in escher export + break; + } + } + break; + + // coordorigin + case ESCHER_Prop_geoLeft: // 320 + case ESCHER_Prop_geoTop: // 321 + { + sal_uInt32 nLeft = 0, nTop = 0; + + if ( nId == ESCHER_Prop_geoLeft ) + { + nLeft = opt.nPropValue; + rProps.GetOpt( ESCHER_Prop_geoTop, nTop ); + } + else + { + nTop = opt.nPropValue; + rProps.GetOpt( ESCHER_Prop_geoLeft, nLeft ); + } + if(nTop!=0 && nLeft!=0) + m_pShapeAttrList->add( XML_coordorigin, + OString::number( nLeft ) + "," + OString::number( nTop ) ); + } + bAlreadyWritten[ ESCHER_Prop_geoLeft ] = true; + bAlreadyWritten[ ESCHER_Prop_geoTop ] = true; + break; + + // coordsize + case ESCHER_Prop_geoRight: // 322 + case ESCHER_Prop_geoBottom: // 323 + { + sal_uInt32 nLeft = 0, nRight = 0, nTop = 0, nBottom = 0; + rProps.GetOpt( ESCHER_Prop_geoLeft, nLeft ); + rProps.GetOpt( ESCHER_Prop_geoTop, nTop ); + + if ( nId == ESCHER_Prop_geoRight ) + { + nRight = opt.nPropValue; + rProps.GetOpt( ESCHER_Prop_geoBottom, nBottom ); + } + else + { + nBottom = opt.nPropValue; + rProps.GetOpt( ESCHER_Prop_geoRight, nRight ); + } + + if(nBottom!=0 && nRight!=0 ) + m_pShapeAttrList->add( XML_coordsize, + OString::number( nRight - nLeft ) + "," + OString::number( nBottom - nTop ) ); + } + bAlreadyWritten[ ESCHER_Prop_geoRight ] = true; + bAlreadyWritten[ ESCHER_Prop_geoBottom ] = true; + break; + + case ESCHER_Prop_pVertices: // 325 + case ESCHER_Prop_pSegmentInfo: // 326 + { + EscherPropSortStruct aVertices; + EscherPropSortStruct aSegments; + + if ( rProps.GetOpt( ESCHER_Prop_pVertices, aVertices ) && + rProps.GetOpt( ESCHER_Prop_pSegmentInfo, aSegments ) ) + { + const sal_uInt8 *pVerticesIt = aVertices.nProp.data() + 6; + const sal_uInt8 *pSegmentIt = aSegments.nProp.data(); + OStringBuffer aPath( 512 ); + + sal_uInt16 nPointSize = aVertices.nProp[4] + ( aVertices.nProp[5] << 8 ); + + // number of segments + sal_uInt16 nSegments = impl_GetUInt16( pSegmentIt ); + pSegmentIt += 4; + + for ( ; nSegments; --nSegments ) + { + sal_uInt16 nSeg = impl_GetUInt16( pSegmentIt ); + + // The segment type is stored in the upper 3 bits + // and segment count is stored in the lower 13 + // bits. + unsigned char nSegmentType = (nSeg & 0xE000) >> 13; + unsigned short nSegmentCount = nSeg & 0x03FF; + + switch (nSegmentType) + { + case msopathMoveTo: + { + sal_Int32 nX = impl_GetPointComponent( pVerticesIt, nPointSize ); + sal_Int32 nY = impl_GetPointComponent( pVerticesIt, nPointSize ); + if (nX >= 0 && nY >= 0 ) + aPath.append( "m" + OString::number( nX ) + "," + OString::number( nY ) ); + break; + } + case msopathClientEscape: + break; + case msopathEscape: + { + // If the segment type is msopathEscape, the lower 13 bits are + // divided in a 5 bit escape code and 8 bit + // vertex count (not segment count!) + unsigned char nEscapeCode = (nSegmentCount & 0x1F00) >> 8; + unsigned char nVertexCount = nSegmentCount & 0x00FF; + pVerticesIt += nVertexCount; + + switch (nEscapeCode) + { + case 0xa: // nofill + aPath.append( "nf" ); + break; + case 0xb: // nostroke + aPath.append( "ns" ); + break; + } + + break; + } + case msopathLineTo: + for (unsigned short i = 0; i < nSegmentCount; ++i) + { + sal_Int32 nX = impl_GetPointComponent( pVerticesIt, nPointSize ); + sal_Int32 nY = impl_GetPointComponent( pVerticesIt, nPointSize ); + aPath.append( "l" + OString::number( nX ) + "," + OString::number( nY ) ); + } + break; + case msopathCurveTo: + for (unsigned short i = 0; i < nSegmentCount; ++i) + { + sal_Int32 nX1 = impl_GetPointComponent( pVerticesIt, nPointSize ); + sal_Int32 nY1 = impl_GetPointComponent( pVerticesIt, nPointSize ); + sal_Int32 nX2 = impl_GetPointComponent( pVerticesIt, nPointSize ); + sal_Int32 nY2 = impl_GetPointComponent( pVerticesIt, nPointSize ); + sal_Int32 nX3 = impl_GetPointComponent( pVerticesIt, nPointSize ); + sal_Int32 nY3 = impl_GetPointComponent( pVerticesIt, nPointSize ); + aPath.append( "c" + OString::number( nX1 ) + "," + OString::number( nY1 ) + "," + + OString::number( nX2 ) + "," + OString::number( nY2 ) + "," + + OString::number( nX3 ) + "," + OString::number( nY3 ) ); + } + break; + case msopathClose: + aPath.append( "x" ); + break; + case msopathEnd: + aPath.append( "e" ); + break; + default: + SAL_WARN("oox", "Totally b0rked"); + break; + case msopathInvalid: + SAL_WARN("oox", "Invalid - should never be found"); + break; + } + } + OString pathString = aPath.makeStringAndClear(); + if ( !pathString.isEmpty() && pathString != "xe" ) + m_pShapeAttrList->add( XML_path, pathString ); + } + else + SAL_WARN("oox.vml", "unhandled shape path, missing either pVertices or pSegmentInfo."); + } + bAlreadyWritten[ ESCHER_Prop_pVertices ] = true; + bAlreadyWritten[ ESCHER_Prop_pSegmentInfo ] = true; + break; + + case ESCHER_Prop_fillType: // 384 + case ESCHER_Prop_fillColor: // 385 + case ESCHER_Prop_fillBackColor: // 387 + case ESCHER_Prop_fillBlip: // 390 + case ESCHER_Prop_fNoFillHitTest: // 447 + case ESCHER_Prop_fillOpacity: // 386 + { + sal_uInt32 nValue; + rtl::Reference pAttrList + = FastSerializerHelper::createAttrList(); + + bool imageData = false; + EscherPropSortStruct aStruct; + const SdrGrafObj* pSdrGrafObj = dynamic_cast(m_pSdrObject); + + if (pSdrGrafObj && pSdrGrafObj->isSignatureLine() && m_pTextExport) + { + rtl::Reference pAttrListSignatureLine + = FastSerializerHelper::createAttrList(); + pAttrListSignatureLine->add(XML_issignatureline, "t"); + if (!pSdrGrafObj->getSignatureLineId().isEmpty()) + { + pAttrListSignatureLine->add( + XML_id, pSdrGrafObj->getSignatureLineId()); + } + if (!pSdrGrafObj->getSignatureLineSuggestedSignerName().isEmpty()) + { + pAttrListSignatureLine->add( + FSNS(XML_o, XML_suggestedsigner), + pSdrGrafObj->getSignatureLineSuggestedSignerName()); + } + if (!pSdrGrafObj->getSignatureLineSuggestedSignerTitle().isEmpty()) + { + pAttrListSignatureLine->add( + FSNS(XML_o, XML_suggestedsigner2), + pSdrGrafObj->getSignatureLineSuggestedSignerTitle()); + } + if (!pSdrGrafObj->getSignatureLineSuggestedSignerEmail().isEmpty()) + { + pAttrListSignatureLine->add( + FSNS(XML_o, XML_suggestedsigneremail), + pSdrGrafObj->getSignatureLineSuggestedSignerEmail()); + } + if (!pSdrGrafObj->getSignatureLineSigningInstructions().isEmpty()) + { + pAttrListSignatureLine->add(XML_signinginstructionsset, "t"); + pAttrListSignatureLine->add( + FSNS(XML_o, XML_signinginstructions), + pSdrGrafObj->getSignatureLineSigningInstructions()); + } + pAttrListSignatureLine->add( + XML_showsigndate, + pSdrGrafObj->isSignatureLineShowSignDate() ? "t" : "f"); + pAttrListSignatureLine->add( + XML_allowcomments, + pSdrGrafObj->isSignatureLineCanAddComment() ? "t" : "f"); + + m_pSerializer->singleElementNS( + XML_o, XML_signatureline, + pAttrListSignatureLine); + + // Get signature line graphic + const uno::Reference& xGraphic + = pSdrGrafObj->getSignatureLineUnsignedGraphic(); + Graphic aGraphic(xGraphic); + OUString aImageId = m_pTextExport->GetDrawingML().WriteImage(aGraphic, false); + pAttrList->add(FSNS(XML_r, XML_id), aImageId); + imageData = true; + } + else if (rProps.GetOpt(ESCHER_Prop_fillBlip, aStruct) && m_pTextExport) + { + SvMemoryStream aStream; + // The first bytes are WW8-specific, we're only interested in the PNG + int nHeaderSize = 25; + aStream.WriteBytes(aStruct.nProp.data() + nHeaderSize, + aStruct.nProp.size() - nHeaderSize); + aStream.Seek(0); + Graphic aGraphic; + GraphicConverter::Import(aStream, aGraphic); + OUString aImageId = m_pTextExport->GetDrawingML().WriteImage(aGraphic, false); + pAttrList->add(FSNS(XML_r, XML_id), aImageId); + imageData = true; + } + + if (rProps.GetOpt(ESCHER_Prop_fNoFillHitTest, nValue)) + impl_AddBool(pAttrList.get(), FSNS(XML_o, XML_detectmouseclick), nValue != 0); + + if (imageData) + m_pSerializer->singleElementNS( XML_v, XML_imagedata, pAttrList ); + else + { + if ( rProps.GetOpt( ESCHER_Prop_fillType, nValue ) ) + { + const char *pFillType = nullptr; + switch ( nValue ) + { + case ESCHER_FillSolid: pFillType = "solid"; break; + // TODO case ESCHER_FillPattern: pFillType = ""; break; + case ESCHER_FillTexture: pFillType = "tile"; break; + // TODO case ESCHER_FillPicture: pFillType = ""; break; + // TODO case ESCHER_FillShade: pFillType = ""; break; + // TODO case ESCHER_FillShadeCenter: pFillType = ""; break; + // TODO case ESCHER_FillShadeShape: pFillType = ""; break; + // TODO case ESCHER_FillShadeScale: pFillType = ""; break; + // TODO case ESCHER_FillShadeTitle: pFillType = ""; break; + // TODO case ESCHER_FillBackground: pFillType = ""; break; + default: + SAL_INFO("oox.vml", "Unhandled fill type: " << nValue); + break; + } + if ( pFillType ) + pAttrList->add( XML_type, pFillType ); + } + else if (!rProps.GetOpt(ESCHER_Prop_fillColor, nValue)) + pAttrList->add( XML_on, "false" ); + + if ( rProps.GetOpt( ESCHER_Prop_fillColor, nValue ) ) + impl_AddColor( m_pShapeAttrList.get(), XML_fillcolor, nValue ); + + if ( rProps.GetOpt( ESCHER_Prop_fillBackColor, nValue ) ) + impl_AddColor( pAttrList.get(), XML_color2, nValue ); + + + if (rProps.GetOpt(ESCHER_Prop_fillOpacity, nValue)) + // Partly undo the transformation at the end of EscherPropertyContainer::CreateFillProperties(): VML opacity is 0..1. + pAttrList->add(XML_opacity, OString::number(double((nValue * 100) >> 16) / 100)); + m_pSerializer->singleElementNS( XML_v, XML_fill, pAttrList ); + + } + } + bAlreadyWritten[ ESCHER_Prop_fillType ] = true; + bAlreadyWritten[ ESCHER_Prop_fillColor ] = true; + bAlreadyWritten[ ESCHER_Prop_fillBackColor ] = true; + bAlreadyWritten[ ESCHER_Prop_fillBlip ] = true; + bAlreadyWritten[ ESCHER_Prop_fNoFillHitTest ] = true; + bAlreadyWritten[ ESCHER_Prop_fillOpacity ] = true; + break; + + case ESCHER_Prop_lineColor: // 448 + case ESCHER_Prop_lineWidth: // 459 + case ESCHER_Prop_lineDashing: // 462 + case ESCHER_Prop_lineStartArrowhead: // 464 + case ESCHER_Prop_lineEndArrowhead: // 465 + case ESCHER_Prop_lineStartArrowWidth: // 466 + case ESCHER_Prop_lineStartArrowLength: // 467 + case ESCHER_Prop_lineEndArrowWidth: // 468 + case ESCHER_Prop_lineEndArrowLength: // 469 + case ESCHER_Prop_lineJoinStyle: // 470 + case ESCHER_Prop_lineEndCapStyle: // 471 + { + sal_uInt32 nValue; + rtl::Reference pAttrList = FastSerializerHelper::createAttrList(); + + if ( rProps.GetOpt( ESCHER_Prop_lineColor, nValue ) ) + impl_AddColor( pAttrList.get(), XML_color, nValue ); + + if ( rProps.GetOpt( ESCHER_Prop_lineWidth, nValue ) ) + impl_AddInt( pAttrList.get(), XML_weight, nValue ); + + if ( rProps.GetOpt( ESCHER_Prop_lineDashing, nValue ) ) + { + const char *pDashStyle = nullptr; + switch ( nValue ) + { + case ESCHER_LineSolid: pDashStyle = "solid"; break; + case ESCHER_LineDashSys: pDashStyle = "shortdash"; break; + case ESCHER_LineDotSys: pDashStyle = "shortdot"; break; + case ESCHER_LineDashDotSys: pDashStyle = "shortdashdot"; break; + case ESCHER_LineDashDotDotSys: pDashStyle = "shortdashdotdot"; break; + case ESCHER_LineDotGEL: pDashStyle = "dot"; break; + case ESCHER_LineDashGEL: pDashStyle = "dash"; break; + case ESCHER_LineLongDashGEL: pDashStyle = "longdash"; break; + case ESCHER_LineDashDotGEL: pDashStyle = "dashdot"; break; + case ESCHER_LineLongDashDotGEL: pDashStyle = "longdashdot"; break; + case ESCHER_LineLongDashDotDotGEL: pDashStyle = "longdashdotdot"; break; + } + if ( pDashStyle ) + pAttrList->add( XML_dashstyle, pDashStyle ); + } + + if ( rProps.GetOpt( ESCHER_Prop_lineStartArrowhead, nValue ) ) + impl_AddArrowHead( pAttrList.get(), XML_startarrow, nValue ); + + if ( rProps.GetOpt( ESCHER_Prop_lineEndArrowhead, nValue ) ) + impl_AddArrowHead( pAttrList.get(), XML_endarrow, nValue ); + + if ( rProps.GetOpt( ESCHER_Prop_lineStartArrowWidth, nValue ) ) + impl_AddArrowWidth( pAttrList.get(), XML_startarrowwidth, nValue ); + + if ( rProps.GetOpt( ESCHER_Prop_lineStartArrowLength, nValue ) ) + impl_AddArrowLength( pAttrList.get(), XML_startarrowlength, nValue ); + + if ( rProps.GetOpt( ESCHER_Prop_lineEndArrowWidth, nValue ) ) + impl_AddArrowWidth( pAttrList.get(), XML_endarrowwidth, nValue ); + + if ( rProps.GetOpt( ESCHER_Prop_lineEndArrowLength, nValue ) ) + impl_AddArrowLength( pAttrList.get(), XML_endarrowlength, nValue ); + + if ( rProps.GetOpt( ESCHER_Prop_lineJoinStyle, nValue ) ) + { + const char *pJoinStyle = nullptr; + switch ( nValue ) + { + case ESCHER_LineJoinBevel: pJoinStyle = "bevel"; break; + case ESCHER_LineJoinMiter: pJoinStyle = "miter"; break; + case ESCHER_LineJoinRound: pJoinStyle = "round"; break; + } + if ( pJoinStyle ) + pAttrList->add( XML_joinstyle, pJoinStyle ); + } + + if ( rProps.GetOpt( ESCHER_Prop_lineEndCapStyle, nValue ) ) + { + const char *pEndCap = nullptr; + switch ( nValue ) + { + case ESCHER_LineEndCapRound: pEndCap = "round"; break; + case ESCHER_LineEndCapSquare: pEndCap = "square"; break; + case ESCHER_LineEndCapFlat: pEndCap = "flat"; break; + } + if ( pEndCap ) + pAttrList->add( XML_endcap, pEndCap ); + } + + m_pSerializer->singleElementNS( XML_v, XML_stroke, pAttrList ); + } + bAlreadyWritten[ ESCHER_Prop_lineColor ] = true; + bAlreadyWritten[ ESCHER_Prop_lineWidth ] = true; + bAlreadyWritten[ ESCHER_Prop_lineDashing ] = true; + bAlreadyWritten[ ESCHER_Prop_lineStartArrowhead ] = true; + bAlreadyWritten[ ESCHER_Prop_lineEndArrowhead ] = true; + bAlreadyWritten[ ESCHER_Prop_lineStartArrowWidth ] = true; + bAlreadyWritten[ ESCHER_Prop_lineStartArrowLength ] = true; + bAlreadyWritten[ ESCHER_Prop_lineEndArrowWidth ] = true; + bAlreadyWritten[ ESCHER_Prop_lineEndArrowLength ] = true; + bAlreadyWritten[ ESCHER_Prop_lineJoinStyle ] = true; + bAlreadyWritten[ ESCHER_Prop_lineEndCapStyle ] = true; + break; + + case ESCHER_Prop_fHidden: + if ( !opt.nPropValue ) + m_ShapeStyle.append( ";visibility:hidden" ); + break; + case ESCHER_Prop_shadowColor: + case ESCHER_Prop_fshadowObscured: + { + sal_uInt32 nValue = 0; + bool bShadow = false; + bool bObscured = false; + if ( rProps.GetOpt( ESCHER_Prop_fshadowObscured, nValue ) ) + { + bShadow = (( nValue & 0x20002 ) == 0x20002 ); + bObscured = (( nValue & 0x10001 ) == 0x10001 ); + } + if ( bShadow ) + { + rtl::Reference pAttrList = FastSerializerHelper::createAttrList(); + impl_AddBool( pAttrList.get(), XML_on, bShadow ); + impl_AddBool( pAttrList.get(), XML_obscured, bObscured ); + + if ( rProps.GetOpt( ESCHER_Prop_shadowColor, nValue ) ) + impl_AddColor( pAttrList.get(), XML_color, nValue ); + + m_pSerializer->singleElementNS( XML_v, XML_shadow, pAttrList ); + bAlreadyWritten[ ESCHER_Prop_fshadowObscured ] = true; + bAlreadyWritten[ ESCHER_Prop_shadowColor ] = true; + } + } + break; + case ESCHER_Prop_gtextUNICODE: + case ESCHER_Prop_gtextFont: + { + EscherPropSortStruct aUnicode; + if (rProps.GetOpt(ESCHER_Prop_gtextUNICODE, aUnicode)) + { + SvMemoryStream aStream; + + if(!opt.nProp.empty()) + { + aStream.WriteBytes(opt.nProp.data(), opt.nProp.size()); + } + + aStream.Seek(0); + OUString aTextPathString = SvxMSDffManager::MSDFFReadZString(aStream, opt.nProp.size(), true); + aStream.Seek(0); + + m_pSerializer->singleElementNS(XML_v, XML_path, XML_textpathok, "t"); + + rtl::Reference pAttrList = FastSerializerHelper::createAttrList(); + pAttrList->add(XML_on, "t"); + pAttrList->add(XML_fitshape, "t"); + pAttrList->add(XML_string, aTextPathString); + EscherPropSortStruct aFont; + OUString aStyle; + if (rProps.GetOpt(ESCHER_Prop_gtextFont, aFont)) + { + aStream.WriteBytes(aFont.nProp.data(), aFont.nProp.size()); + aStream.Seek(0); + OUString aTextPathFont = SvxMSDffManager::MSDFFReadZString(aStream, aFont.nProp.size(), true); + aStyle += "font-family:\"" + aTextPathFont + "\""; + } + sal_uInt32 nSize; + if (rProps.GetOpt(ESCHER_Prop_gtextSize, nSize)) + { + float nSizeF = static_cast(nSize) / 65536.0; + OUString aSize = OUString::number(nSizeF); + aStyle += ";font-size:" + aSize + "pt"; + } + if (IsWaterMarkShape(m_pSdrObject->GetName())) + pAttrList->add(XML_trim, "t"); + + if (!aStyle.isEmpty()) + pAttrList->add(XML_style, aStyle); + m_pSerializer->singleElementNS(XML_v, XML_textpath, pAttrList); + } + + bAlreadyWritten[ESCHER_Prop_gtextUNICODE] = true; + bAlreadyWritten[ESCHER_Prop_gtextFont] = true; + } + break; + case ESCHER_Prop_Rotation: + { + // The higher half of the variable contains the angle. + m_ShapeStyle.append(";rotation:" + OString::number(double(opt.nPropValue >> 16))); + bAlreadyWritten[ESCHER_Prop_Rotation] = true; + } + break; + case ESCHER_Prop_fNoLineDrawDash: + { + // See DffPropertyReader::ApplyLineAttributes(). + impl_AddBool( m_pShapeAttrList.get(), XML_stroked, (opt.nPropValue & 8) != 0 ); + bAlreadyWritten[ESCHER_Prop_fNoLineDrawDash] = true; + } + break; + case ESCHER_Prop_wzName: + { + SvMemoryStream aStream; + + if(!opt.nProp.empty()) + { + aStream.WriteBytes(opt.nProp.data(), opt.nProp.size()); + } + + aStream.Seek(0); + OUString idStr = SvxMSDffManager::MSDFFReadZString(aStream, opt.nProp.size(), true); + aStream.Seek(0); + if (!IsWaterMarkShape(m_pSdrObject->GetName()) && !m_bSkipwzName) + m_pShapeAttrList->add(XML_ID, idStr); + + bAlreadyWritten[ESCHER_Prop_wzName] = true; + } + break; + default: +#if OSL_DEBUG_LEVEL > 0 + const size_t opt_nProp_size(opt.nProp.size()); + const sal_uInt8 opt_nProp_empty(0); + fprintf( stderr, "TODO VMLExport::Commit(), unimplemented id: %d, value: %" SAL_PRIuUINT32 ", data: [%zu, %p]\n", + nId, + opt.nPropValue, + opt_nProp_size, + 0 == opt_nProp_size ? &opt_nProp_empty : opt.nProp.data()); + if ( opt.nProp.size() ) + { + const sal_uInt8 *pIt = opt.nProp.data(); + fprintf( stderr, " ( " ); + for ( int nCount = opt.nProp.size(); nCount; --nCount ) + { + fprintf( stderr, "%02x ", *pIt ); + ++pIt; + } + fprintf( stderr, ")\n" ); + } +#endif + break; + } + } + + m_pSerializer->mergeTopMarks(Tag_Commit, sax_fastparser::MergeMarks::POSTPONE ); +} + +OString VMLExport::ShapeIdString( sal_uInt32 nId ) +{ + if(m_bOverrideShapeIdGeneration) + return m_sShapeIDPrefix + OString::number( nId ); + else + return "shape_" + OString::number( nId ); +} + +void VMLExport::AddFlipXY( ) +{ + if (m_nShapeFlags & (ShapeFlag::FlipH | ShapeFlag::FlipV)) + { + m_ShapeStyle.append( ";flip:" ); + + if (m_nShapeFlags & ShapeFlag::FlipH) + m_ShapeStyle.append( "x" ); + + if (m_nShapeFlags & ShapeFlag::FlipV) + m_ShapeStyle.append( "y" ); + } +} + +void VMLExport::AddLineDimensions( const tools::Rectangle& rRectangle ) +{ + // style + if (!m_ShapeStyle.isEmpty()) + m_ShapeStyle.append( ";" ); + + m_ShapeStyle.append( "position:absolute" ); + + AddFlipXY(); + + // the actual dimensions + OString aLeft, aTop, aRight, aBottom; + + if ( mnGroupLevel == 1 ) + { + const OString aPt( "pt" ); + aLeft = OString::number( double( rRectangle.Left() ) / 20 ) + aPt; + aTop = OString::number( double( rRectangle.Top() ) / 20 ) + aPt; + aRight = OString::number( double( rRectangle.Right() ) / 20 ) + aPt; + aBottom = OString::number( double( rRectangle.Bottom() ) / 20 ) + aPt; + } + else + { + aLeft = OString::number( rRectangle.Left() ); + aTop = OString::number( rRectangle.Top() ); + aRight = OString::number( rRectangle.Right() ); + aBottom = OString::number( rRectangle.Bottom() ); + } + + m_pShapeAttrList->add( XML_from, aLeft + "," + aTop ); + + m_pShapeAttrList->add( XML_to, aRight + "," + aBottom ); +} + +void VMLExport::AddRectangleDimensions( OStringBuffer& rBuffer, const tools::Rectangle& rRectangle, bool rbAbsolutePos) +{ + if ( !rBuffer.isEmpty() ) + rBuffer.append( ";" ); + + if (rbAbsolutePos && !m_bInline) + { + rBuffer.append( "position:absolute;" ); + } + + if(m_bInline) + { + rBuffer.append( "width:" + OString::number( double( rRectangle.Right() - rRectangle.Left() ) / 20 ) + + "pt;height:" + OString::number( double( rRectangle.Bottom() - rRectangle.Top() ) / 20 ) + + "pt" ); + } + else if ( mnGroupLevel == 1 ) + { + rBuffer.append( "margin-left:" + OString::number( double( rRectangle.Left() ) / 20 ) + + "pt;margin-top:" + OString::number( double( rRectangle.Top() ) / 20 ) + + "pt;width:" + OString::number( double( rRectangle.Right() - rRectangle.Left() ) / 20 ) + + "pt;height:" + OString::number( double( rRectangle.Bottom() - rRectangle.Top() ) / 20 ) + + "pt" ); + } + else + { + rBuffer.append( "left:" + OString::number( rRectangle.Left() ) + + ";top:" + OString::number( rRectangle.Top() ) + + ";width:" + OString::number( rRectangle.Right() - rRectangle.Left() ) + + ";height:" + OString::number( rRectangle.Bottom() - rRectangle.Top() ) ); + } + + AddFlipXY(); +} + +void VMLExport::AddShapeAttribute( sal_Int32 nAttribute, const OString& rValue ) +{ + m_pShapeAttrList->add( nAttribute, rValue ); +} + +static std::vector lcl_getShapeTypes() +{ + std::vector aRet; + + OUString aPath("$BRAND_BASE_DIR/" LIBO_SHARE_FOLDER "/filter/vml-shape-types"); + rtl::Bootstrap::expandMacros(aPath); + SvFileStream aStream(aPath, StreamMode::READ); + if (aStream.GetError() != ERRCODE_NONE) + SAL_WARN("oox", "failed to open vml-shape-types"); + OStringBuffer aLine; + bool bNotDone = aStream.ReadLine(aLine); + while (bNotDone) + { + // Filter out comments. + if (!o3tl::starts_with(aLine, "/")) + aRet.push_back(OString(aLine)); + bNotDone = aStream.ReadLine(aLine); + } + return aRet; +} + +static bool lcl_isTextBox(const SdrObject* pSdrObject) +{ + uno::Reference xPropertySet(const_cast(pSdrObject)->getUnoShape(), uno::UNO_QUERY); + if (!xPropertySet.is()) + return false; + uno::Reference xPropertySetInfo = xPropertySet->getPropertySetInfo(); + if (!xPropertySetInfo->hasPropertyByName("TextBox")) + return false; + css::uno::Any aTextBox(xPropertySet->getPropertyValue("TextBox")); + if (!aTextBox.hasValue()) + return false; + return aTextBox.get(); +} + +static OUString lcl_getAnchorIdFromGrabBag(const SdrObject* pSdrObject) +{ + OUString aResult; + + uno::Reference xShape(const_cast(pSdrObject)->getUnoShape(), uno::UNO_QUERY); + if (xShape->getPropertySetInfo()->hasPropertyByName("InteropGrabBag")) + { + comphelper::SequenceAsHashMap aInteropGrabBag(xShape->getPropertyValue("InteropGrabBag")); + if (aInteropGrabBag.find("AnchorId") != aInteropGrabBag.end()) + aInteropGrabBag["AnchorId"] >>= aResult; + } + + return aResult; +} + +sal_uInt32 VMLExport::GenerateShapeId() +{ + if(!m_bOverrideShapeIdGeneration) + return EscherEx::GenerateShapeId(); + else + return m_nShapeIDCounter++; +} + +OString VMLExport::GetVMLShapeTypeDefinition( + std::string_view sShapeID, const bool bIsPictureFrame ) +{ + OString sShapeType; + if ( !bIsPictureFrame ) + // We don't have a shape definition for host control in presetShapeDefinitions.xml + // So use a definition copied from DOCX file created with MSO + sShapeType = OString::Concat("\n" + "\n" + "\n" + "\n" + ""; + else + // We don't have a shape definition for picture frame in presetShapeDefinitions.xml + // So use a definition copied from DOCX file created with MSO + sShapeType = OString::Concat("\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + ""; + return sShapeType; +} + +sal_Int32 VMLExport::StartShape() +{ + if ( m_nShapeType == ESCHER_ShpInst_Nil ) + return -1; + + // some of the shapes have their own name ;-) + sal_Int32 nShapeElement = -1; + bool bReferToShapeType = false; + switch ( m_nShapeType ) + { + case ESCHER_ShpInst_NotPrimitive: nShapeElement = XML_shape; break; + case ESCHER_ShpInst_Rectangle: nShapeElement = XML_rect; break; + case ESCHER_ShpInst_RoundRectangle: nShapeElement = XML_roundrect; break; + case ESCHER_ShpInst_Ellipse: nShapeElement = XML_oval; break; + case ESCHER_ShpInst_Arc: nShapeElement = XML_arc; break; + case ESCHER_ShpInst_Line: nShapeElement = XML_line; break; + case ESCHER_ShpInst_HostControl: + { + bReferToShapeType = true; + nShapeElement = XML_shape; + if ( !m_aShapeTypeWritten[ m_nShapeType ] ) + { + m_pSerializer->write(GetVMLShapeTypeDefinition(OString::number(m_nShapeType), false)); + m_aShapeTypeWritten[ m_nShapeType ] = true; + } + break; + } + case ESCHER_ShpInst_PictureFrame: + { + bReferToShapeType = true; + nShapeElement = XML_shape; + if ( !m_aShapeTypeWritten[ m_nShapeType ] ) + { + m_pSerializer->write(GetVMLShapeTypeDefinition(OString::number(m_nShapeType), true)); + m_aShapeTypeWritten[ m_nShapeType ] = true; + } + break; + } + default: + if ( m_nShapeType < ESCHER_ShpInst_COUNT ) + { + nShapeElement = XML_shape; + + // a predefined shape? + static std::vector aShapeTypes = lcl_getShapeTypes(); + SAL_WARN_IF(m_nShapeType >= aShapeTypes.size(), "oox.vml", "Unknown shape type!"); + if (m_nShapeType < aShapeTypes.size() && aShapeTypes[m_nShapeType] != "NULL") + { + bReferToShapeType = true; + if ( !m_aShapeTypeWritten[ m_nShapeType ] ) + { + m_pSerializer->write(aShapeTypes[m_nShapeType]); + m_aShapeTypeWritten[ m_nShapeType ] = true; + } + } + else + { + // rectangle is probably the best fallback... + nShapeElement = XML_rect; + } + } + break; + } + + // anchoring + switch (m_eHOri) + { + case text::HoriOrientation::LEFT: + m_ShapeStyle.append(";mso-position-horizontal:left"); + break; + case text::HoriOrientation::CENTER: + m_ShapeStyle.append(";mso-position-horizontal:center"); + break; + case text::HoriOrientation::RIGHT: + m_ShapeStyle.append(";mso-position-horizontal:right"); + break; + case text::HoriOrientation::INSIDE: + m_ShapeStyle.append(";mso-position-horizontal:inside"); + break; + case text::HoriOrientation::OUTSIDE: + m_ShapeStyle.append(";mso-position-horizontal:outside"); + break; + default: + case text::HoriOrientation::NONE: + break; + } + switch (m_eHRel) + { + case text::RelOrientation::PAGE_PRINT_AREA: + m_ShapeStyle.append(";mso-position-horizontal-relative:margin"); + break; + case text::RelOrientation::PAGE_FRAME: + case text::RelOrientation::PAGE_LEFT: + case text::RelOrientation::PAGE_RIGHT: + m_ShapeStyle.append(";mso-position-horizontal-relative:page"); + break; + case text::RelOrientation::CHAR: + m_ShapeStyle.append(";mso-position-horizontal-relative:char"); + break; + default: + break; + } + + switch (m_eVOri) + { + case text::VertOrientation::TOP: + case text::VertOrientation::LINE_TOP: + case text::VertOrientation::CHAR_TOP: + m_ShapeStyle.append(";mso-position-vertical:top"); + break; + case text::VertOrientation::CENTER: + case text::VertOrientation::LINE_CENTER: + m_ShapeStyle.append(";mso-position-vertical:center"); + break; + case text::VertOrientation::BOTTOM: + case text::VertOrientation::LINE_BOTTOM: + case text::VertOrientation::CHAR_BOTTOM: + m_ShapeStyle.append(";mso-position-vertical:bottom"); + break; + default: + case text::VertOrientation::NONE: + break; + } + switch (m_eVRel) + { + case text::RelOrientation::PAGE_PRINT_AREA: + m_ShapeStyle.append(";mso-position-vertical-relative:margin"); + break; + case text::RelOrientation::PAGE_FRAME: + m_ShapeStyle.append(";mso-position-vertical-relative:page"); + break; + default: + break; + } + + if (!m_pSdrObject->getHyperlink().isEmpty()) + m_pShapeAttrList->add( + XML_href, m_pSdrObject->getHyperlink()); + + m_pShapeAttrList->addNS(XML_o, XML_allowincell, m_IsFollowingTextFlow ? "t" : "f"); + + // add style + m_pShapeAttrList->add( XML_style, m_ShapeStyle.makeStringAndClear() ); + + OUString sAnchorId = lcl_getAnchorIdFromGrabBag(m_pSdrObject); + if (!sAnchorId.isEmpty()) + m_pShapeAttrList->addNS(XML_wp14, XML_anchorId, sAnchorId); + + if ( nShapeElement >= 0 && !m_pShapeAttrList->hasAttribute( XML_type ) && bReferToShapeType ) + { + OString sType; + if (m_bUseHashMarkForType) + sType = "#"; + m_pShapeAttrList->add( XML_type, sType + + "_x0000_t" + OString::number( m_nShapeType ) ); + } + + // start of the shape + m_pSerializer->startElementNS( XML_v, nShapeElement, m_pShapeAttrList ); + + OString const textboxStyle(m_TextboxStyle.makeStringAndClear()); + + // now check if we have some editeng text (not associated textbox) and we have a text exporter registered + const SdrTextObj* pTxtObj = dynamic_cast( m_pSdrObject ); + if (pTxtObj && m_pTextExport && msfilter::util::HasTextBoxContent(m_nShapeType) && !IsWaterMarkShape(m_pSdrObject->GetName()) && !lcl_isTextBox(m_pSdrObject)) + { + std::optional pParaObj; + + /* + #i13885# + When the object is actively being edited, that text is not set into + the objects normal text object, but lives in a separate object. + */ + if (pTxtObj->IsTextEditActive()) + { + pParaObj = pTxtObj->CreateEditOutlinerParaObject(); + } + else if (pTxtObj->GetOutlinerParaObject()) + { + pParaObj = *pTxtObj->GetOutlinerParaObject(); + } + + if( pParaObj ) + { + rtl::Reference pTextboxAttrList = FastSerializerHelper::createAttrList(); + if (!textboxStyle.isEmpty()) + { + pTextboxAttrList->add(XML_style, textboxStyle); + } + + // this is reached only in case some text is attached to the shape + m_pSerializer->startElementNS(XML_v, XML_textbox, pTextboxAttrList); + m_pTextExport->WriteOutliner(*pParaObj); + m_pSerializer->endElementNS(XML_v, XML_textbox); + } + } + + return nShapeElement; +} + +void VMLExport::EndShape( sal_Int32 nShapeElement ) +{ + if ( nShapeElement < 0 ) + return; + + if (m_pTextExport && lcl_isTextBox(m_pSdrObject)) + { + uno::Reference xShape {const_cast(m_pSdrObject)->getUnoShape(), uno::UNO_QUERY}; + uno::Reference xPropertySet(xShape, uno::UNO_QUERY); + uno::Reference xPropertySetInfo = xPropertySet->getPropertySetInfo(); + bool bBottomToTop = false; + if (xPropertySetInfo->hasPropertyByName("CustomShapeGeometry")) + { + // In this case a DrawingML DOCX was imported. + comphelper::SequenceAsHashMap aCustomShapeProperties( + xPropertySet->getPropertyValue("CustomShapeGeometry")); + if (aCustomShapeProperties.find("TextPreRotateAngle") != aCustomShapeProperties.end()) + { + sal_Int32 nTextRotateAngle = aCustomShapeProperties["TextPreRotateAngle"].get(); + if (nTextRotateAngle == -270) + bBottomToTop = true; + } + } + else + { + // In this case a pure VML DOCX was imported, so there is no CustomShapeGeometry. + auto pTextExport = m_pTextExport->GetDrawingML().GetTextExport(); + // FIXME: somewhy pTextExport is always nullptr, we should find its reason + if (pTextExport) + { + auto xTextFrame = pTextExport->GetUnoTextFrame(xShape); + uno::Reference xPropSet(xTextFrame, uno::UNO_QUERY); + auto aAny = xPropSet->getPropertyValue("WritingMode"); + sal_Int16 nWritingMode; + if (aAny >>= nWritingMode) + { + switch (nWritingMode) + { + case text::WritingMode2::BT_LR: + bBottomToTop = true; + break; + default: + break; + } + } + } + } + rtl::Reference pTextboxAttrList = FastSerializerHelper::createAttrList(); + if (bBottomToTop) + pTextboxAttrList->add(XML_style, "mso-layout-flow-alt:bottom-to-top"); + m_pSerializer->startElementNS(XML_v, XML_textbox, pTextboxAttrList); + + m_pTextExport->WriteVMLTextBox(uno::Reference(xPropertySet, uno::UNO_QUERY_THROW)); + + m_pSerializer->endElementNS(XML_v, XML_textbox); + } + + if (m_pWrapAttrList) + { + m_pSerializer->singleElementNS(XML_w10, XML_wrap, m_pWrapAttrList); + } + + // end of the shape + m_pSerializer->endElementNS( XML_v, nShapeElement ); +} + +OString const & VMLExport::AddSdrObject( const SdrObject& rObj, + bool const bIsFollowingTextFlow, + sal_Int16 eHOri, sal_Int16 eVOri, sal_Int16 eHRel, sal_Int16 eVRel, + FastAttributeList* pWrapAttrList, + const bool bOOxmlExport ) +{ + m_pSdrObject = &rObj; + m_eHOri = eHOri; + m_eVOri = eVOri; + m_eHRel = eHRel; + m_eVRel = eVRel; + m_pWrapAttrList = pWrapAttrList; + m_bInline = false; + m_IsFollowingTextFlow = bIsFollowingTextFlow; + EscherEx::AddSdrObject(rObj, bOOxmlExport); + return m_sShapeId; +} + +OString const & VMLExport::AddInlineSdrObject( const SdrObject& rObj, const bool bOOxmlExport ) +{ + m_pSdrObject = &rObj; + m_eHOri = -1; + m_eVOri = -1; + m_eHRel = -1; + m_eVRel = -1; + m_pWrapAttrList.clear(); + m_bInline = true; + m_IsFollowingTextFlow = true; + EscherEx::AddSdrObject(rObj, bOOxmlExport); + return m_sShapeId; +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/helper/attributelist.cxx b/oox/source/helper/attributelist.cxx new file mode 100644 index 000000000..c247fdb43 --- /dev/null +++ b/oox/source/helper/attributelist.cxx @@ -0,0 +1,361 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include + +#include +#include +#include +#include +#include + +namespace oox { + +using namespace ::com::sun::star; +using namespace ::com::sun::star::uno; +using namespace ::com::sun::star::xml::sax; + +namespace { + +const sal_Int32 XSTRING_ENCCHAR_LEN = 7; + +bool lclAddHexDigit( sal_Unicode& orcChar, sal_Unicode cDigit, int nBitShift ) +{ + if( ('0' <= cDigit) && (cDigit <= '9') ) { orcChar |= ((cDigit - '0') << nBitShift); return true; } + if( ('a' <= cDigit) && (cDigit <= 'f') ) { orcChar |= ((cDigit - 'a' + 10) << nBitShift); return true; } + if( ('A' <= cDigit) && (cDigit <= 'F') ) { orcChar |= ((cDigit - 'A' + 10) << nBitShift); return true; } + return false; +} + +sal_Unicode lclGetXChar( const sal_Unicode*& rpcStr, const sal_Unicode* pcEnd ) +{ + sal_Unicode cChar = 0; + if( (pcEnd - rpcStr >= XSTRING_ENCCHAR_LEN) && + (rpcStr[ 0 ] == '_') && + (rpcStr[ 1 ] == 'x') && + (rpcStr[ 6 ] == '_') && + lclAddHexDigit( cChar, rpcStr[ 2 ], 12 ) && + lclAddHexDigit( cChar, rpcStr[ 3 ], 8 ) && + lclAddHexDigit( cChar, rpcStr[ 4 ], 4 ) && + lclAddHexDigit( cChar, rpcStr[ 5 ], 0 ) ) + { + rpcStr += XSTRING_ENCCHAR_LEN; + return cChar; + } + return *rpcStr++; +} + +} // namespace + +#define STRING_TO_TOKEN(color) if (sColorName == u"" #color) return XML_##color +sal_Int32 getHighlightColorTokenFromString(std::u16string_view sColorName) +{ + STRING_TO_TOKEN(black); + STRING_TO_TOKEN(blue); + STRING_TO_TOKEN(cyan); + STRING_TO_TOKEN(darkBlue); + STRING_TO_TOKEN(darkCyan); + STRING_TO_TOKEN(darkGreen); + STRING_TO_TOKEN(darkMagenta); + STRING_TO_TOKEN(darkRed); + STRING_TO_TOKEN(darkYellow); + STRING_TO_TOKEN(darkGray); + STRING_TO_TOKEN(green); + STRING_TO_TOKEN(lightGray); + STRING_TO_TOKEN(magenta); + STRING_TO_TOKEN(red); + STRING_TO_TOKEN(white); + STRING_TO_TOKEN(yellow); + STRING_TO_TOKEN(none); + + return XML_TOKEN_INVALID; +} + +sal_Int32 AttributeConversion::decodeToken( std::u16string_view rValue ) +{ + return TokenMap::getTokenFromUnicode( rValue ); +} + +OUString AttributeConversion::decodeXString( const OUString& rValue ) +{ + // string shorter than one encoded character - no need to decode + if( rValue.getLength() < XSTRING_ENCCHAR_LEN ) + return rValue; + OUStringBuffer aBuffer; + const sal_Unicode* pcStr = rValue.getStr(); + const sal_Unicode* pcEnd = pcStr + rValue.getLength(); + while( pcStr < pcEnd ) + aBuffer.append( lclGetXChar( pcStr, pcEnd ) ); + return aBuffer.makeStringAndClear(); +} + +sal_Int32 AttributeConversion::decodeInteger( std::u16string_view rValue ) +{ + return o3tl::toInt32(rValue); +} + +sal_uInt32 AttributeConversion::decodeUnsigned( std::u16string_view rValue ) +{ + return getLimitedValue< sal_uInt32, sal_Int64 >( o3tl::toInt64(rValue), 0, SAL_MAX_UINT32 ); +} + +sal_Int64 AttributeConversion::decodeHyper( std::u16string_view rValue ) +{ + return o3tl::toInt64(rValue); +} + +sal_Int32 AttributeConversion::decodeIntegerHex( std::u16string_view rValue ) +{ + // It looks like all Office Open XML attributes containing hexadecimal + // values are based on xsd:hexBinary and so use an unsigned representation: + return static_cast< sal_Int32 >(o3tl::toUInt32(rValue, 16)); + //TODO: Change this function to return sal_uInt32 and get rid of the + // cast, but that will have a ripple effect +} + +AttributeList::AttributeList( const Reference< XFastAttributeList >& rxAttribs ) : + mxAttribs( rxAttribs ), + mpAttribList( nullptr ) +{ + OSL_ENSURE( mxAttribs.is(), "AttributeList::AttributeList - missing attribute list interface" ); +} + +sax_fastparser::FastAttributeList *AttributeList::getAttribList() const +{ + if( mpAttribList == nullptr ) + { + mpAttribList = &sax_fastparser::castToFastAttributeList( mxAttribs ); + } + return mpAttribList; +} + +bool AttributeList::hasAttribute( sal_Int32 nAttrToken ) const +{ + return mxAttribs->hasAttribute( nAttrToken ); +} + +oox::drawingml::Color AttributeList::getHighlightColor(sal_Int32 nAttrToken) const +{ + OUString sColorVal = mxAttribs->getValue(nAttrToken); + oox::drawingml::Color aColor; + aColor.setHighlight(getHighlightColorTokenFromString(sColorVal)); + return aColor; +} + +// optional return values ----------------------------------------------------- + +OptValue< sal_Int32 > AttributeList::getToken( sal_Int32 nAttrToken ) const +{ + sal_Int32 nToken = mxAttribs->getOptionalValueToken( nAttrToken, XML_TOKEN_INVALID ); + return OptValue< sal_Int32 >( nToken != XML_TOKEN_INVALID, nToken ); +} + +OptValue< OUString > AttributeList::getString( sal_Int32 nAttrToken ) const +{ + // check if the attribute exists (empty string may be different to missing attribute) + if( mxAttribs->hasAttribute( nAttrToken ) ) + return OptValue< OUString >( mxAttribs->getOptionalValue( nAttrToken ) ); + return OptValue< OUString >(); +} + +OptValue< OUString > AttributeList::getXString( sal_Int32 nAttrToken ) const +{ + // check if the attribute exists (empty string may be different to missing attribute) + if( mxAttribs->hasAttribute( nAttrToken ) ) + return OptValue< OUString >( AttributeConversion::decodeXString( mxAttribs->getOptionalValue( nAttrToken ) ) ); + return OptValue< OUString >(); +} + +OptValue< double > AttributeList::getDouble( sal_Int32 nAttrToken ) const +{ + double nValue; + bool bValid = getAttribList()->getAsDouble( nAttrToken, nValue ); + return OptValue< double >( bValid, nValue ); +} + +OptValue< sal_Int32 > AttributeList::getInteger( sal_Int32 nAttrToken ) const +{ + sal_Int32 nValue; + bool bValid = getAttribList()->getAsInteger( nAttrToken, nValue ); + return OptValue< sal_Int32 >( bValid, nValue ); +} + +OptValue< sal_uInt32 > AttributeList::getUnsigned( sal_Int32 nAttrToken ) const +{ + OUString aValue = mxAttribs->getOptionalValue( nAttrToken ); + bool bValid = !aValue.isEmpty(); + return OptValue< sal_uInt32 >( bValid, AttributeConversion::decodeUnsigned( aValue ) ); +} + +OptValue< sal_Int64 > AttributeList::getHyper( sal_Int32 nAttrToken ) const +{ + OUString aValue = mxAttribs->getOptionalValue( nAttrToken ); + bool bValid = !aValue.isEmpty(); + return OptValue< sal_Int64 >( bValid, bValid ? AttributeConversion::decodeHyper( aValue ) : 0 ); +} + +OptValue< sal_Int32 > AttributeList::getIntegerHex( sal_Int32 nAttrToken ) const +{ + OUString aValue = mxAttribs->getOptionalValue( nAttrToken ); + bool bValid = !aValue.isEmpty(); + return OptValue< sal_Int32 >( bValid, bValid ? AttributeConversion::decodeIntegerHex( aValue ) : 0 ); +} + +OptValue< bool > AttributeList::getBool( sal_Int32 nAttrToken ) const +{ + const char *pAttr; + + // catch the common cases as quickly as possible first + bool bHasAttr = getAttribList()->getAsChar( nAttrToken, pAttr ); + if( !bHasAttr ) + return OptValue< bool >(); + if( !strcmp( pAttr, "false" ) ) + return OptValue< bool >( false ); + if( !strcmp( pAttr, "true" ) ) + return OptValue< bool >( true ); + + // now for all the crazy stuff + + // boolean attributes may be "t", "f", "true", "false", "on", "off", "1", or "0" + switch( getToken( nAttrToken, XML_TOKEN_INVALID ) ) + { + case XML_t: return OptValue< bool >( true ); // used in VML + case XML_true: return OptValue< bool >( true ); + case XML_on: return OptValue< bool >( true ); + case XML_f: return OptValue< bool >( false ); // used in VML + case XML_false: return OptValue< bool >( false ); + case XML_off: return OptValue< bool >( false ); + } + OptValue< sal_Int32 > onValue = getInteger( nAttrToken ); + return OptValue< bool >( onValue.has(), onValue.get() != 0 ); +} + +OptValue< util::DateTime > AttributeList::getDateTime( sal_Int32 nAttrToken ) const +{ + OUString aValue = mxAttribs->getOptionalValue( nAttrToken ); + util::DateTime aDateTime; + bool bValid = (aValue.getLength() == 19 || (aValue.getLength() == 20 && aValue[19] == 'Z')) && + (aValue[ 4 ] == '-') && (aValue[ 7 ] == '-') && (aValue[ 10 ] == 'T') && + (aValue[ 13 ] == ':') && (aValue[ 16 ] == ':'); + if( bValid ) + { + aDateTime.Year = static_cast< sal_uInt16 >( o3tl::toInt32(aValue.subView( 0, 4 )) ); + aDateTime.Month = static_cast< sal_uInt16 >( o3tl::toInt32(aValue.subView( 5, 2 )) ); + aDateTime.Day = static_cast< sal_uInt16 >( o3tl::toInt32(aValue.subView( 8, 2 )) ); + aDateTime.Hours = static_cast< sal_uInt16 >( o3tl::toInt32(aValue.subView( 11, 2 )) ); + aDateTime.Minutes = static_cast< sal_uInt16 >( o3tl::toInt32(aValue.subView( 14, 2 )) ); + aDateTime.Seconds = static_cast< sal_uInt16 >( o3tl::toInt32(aValue.subView( 17, 2 )) ); + } + return OptValue< util::DateTime >( bValid, aDateTime ); +} + +// defaulted return values ---------------------------------------------------- + +sal_Int32 AttributeList::getToken( sal_Int32 nAttrToken, sal_Int32 nDefault ) const +{ + return mxAttribs->getOptionalValueToken( nAttrToken, nDefault ); +} + +OUString AttributeList::getString( sal_Int32 nAttrToken, const OUString& rDefault ) const +{ + // try to avoid slow exception throw/catch if we can + if (rDefault.isEmpty()) + return mxAttribs->getOptionalValue( nAttrToken ); + + try + { + return mxAttribs->getValue( nAttrToken ); + } + catch( Exception& ) + { + } + return rDefault; +} + +OUString AttributeList::getXString( sal_Int32 nAttrToken, const OUString& rDefault ) const +{ + return getXString( nAttrToken ).get( rDefault ); +} + +const char* AttributeList::getChar( sal_Int32 nAttrToken ) const +{ + const char* p = nullptr; + bool bValid = getAttribList()->getAsChar(nAttrToken, p); + if (!bValid) + p = nullptr; + + return p; +} + +double AttributeList::getDouble( sal_Int32 nAttrToken, double fDefault ) const +{ + return getDouble( nAttrToken ).get( fDefault ); +} + +sal_Int32 AttributeList::getInteger( sal_Int32 nAttrToken, sal_Int32 nDefault ) const +{ + return getInteger( nAttrToken ).get( nDefault ); +} + +sal_uInt32 AttributeList::getUnsigned( sal_Int32 nAttrToken, sal_uInt32 nDefault ) const +{ + return getUnsigned( nAttrToken ).get( nDefault ); +} + +sal_Int64 AttributeList::getHyper( sal_Int32 nAttrToken, sal_Int64 nDefault ) const +{ + return getHyper( nAttrToken ).get( nDefault ); +} + +sal_Int32 AttributeList::getIntegerHex( sal_Int32 nAttrToken, sal_Int32 nDefault ) const +{ + return getIntegerHex( nAttrToken ).get( nDefault ); +} + +sal_uInt32 AttributeList::getUnsignedHex( sal_Int32 nAttrToken, sal_uInt32 nDefault ) const +{ + return getIntegerHex( nAttrToken ).get( nDefault ); +} + +bool AttributeList::getBool( sal_Int32 nAttrToken, bool bDefault ) const +{ + return getBool( nAttrToken ).get( bDefault ); +} + +util::DateTime AttributeList::getDateTime( sal_Int32 nAttrToken, const util::DateTime& rDefault ) const +{ + return getDateTime( nAttrToken ).get( rDefault ); +} + +std::vector AttributeList::getTokenList(sal_Int32 nAttrToken) const +{ + std::vector aValues; + OUString sValue = getString(nAttrToken, ""); + sal_Int32 nIndex = 0; + do + { + aValues.push_back(AttributeConversion::decodeToken(o3tl::getToken(sValue, 0, ' ', nIndex))); + } while (nIndex >= 0); + + return aValues; +} + +} // namespace oox + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/helper/binaryinputstream.cxx b/oox/source/helper/binaryinputstream.cxx new file mode 100644 index 000000000..27cbc6ad6 --- /dev/null +++ b/oox/source/helper/binaryinputstream.cxx @@ -0,0 +1,322 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace oox { + +using namespace ::com::sun::star::io; +using namespace ::com::sun::star::uno; + +namespace { + +const sal_Int32 INPUTSTREAM_BUFFERSIZE = 0x8000; + +} // namespace + +OUString BinaryInputStream::readNulUnicodeArray() +{ + OUStringBuffer aBuffer; + for (;;) + { + sal_uInt16 nChar = readuInt16(); + if ( mbEof || (nChar == 0) ) break; + aBuffer.append( static_cast< sal_Unicode >( nChar ) ); + } + return aBuffer.makeStringAndClear(); +} + +OString BinaryInputStream::readCharArray( sal_Int32 nChars ) +{ + if( nChars <= 0 ) + return OString(); + + ::std::vector< sal_uInt8 > aBuffer; + sal_Int32 nCharsRead = readArray( aBuffer, nChars ); + if( nCharsRead <= 0 ) + return OString(); + + aBuffer.resize( static_cast< size_t >( nCharsRead ) ); + // NUL characters are replaced by question marks. + ::std::replace( aBuffer.begin(), aBuffer.end(), '\0', '?' ); + + return OString(reinterpret_cast(aBuffer.data()), nCharsRead); +} + +OUString BinaryInputStream::readCharArrayUC( sal_Int32 nChars, rtl_TextEncoding eTextEnc ) +{ + return OStringToOUString( readCharArray( nChars ), eTextEnc ); +} + +OUString BinaryInputStream::readUnicodeArray( sal_Int32 nChars ) +{ + if( nChars <= 0 ) + return OUString(); + + ::std::vector< sal_uInt16 > aBuffer; + sal_Int32 nCharsRead = readArray( aBuffer, nChars ); + if( nCharsRead <= 0 ) + return OUString(); + + aBuffer.resize( static_cast< size_t >( nCharsRead ) ); + // don't allow nul chars + ::std::replace( aBuffer.begin(), aBuffer.begin() + nCharsRead, '\0', '?' ); + + OUStringBuffer aStringBuffer; + aStringBuffer.ensureCapacity( nCharsRead ); + for (auto const& elem : aBuffer) + aStringBuffer.append( static_cast< sal_Unicode >(elem) ); + return aStringBuffer.makeStringAndClear(); +} + +OUString BinaryInputStream::readCompressedUnicodeArray( sal_Int32 nChars, bool bCompressed ) +{ + return bCompressed ? + // ISO-8859-1 maps all byte values 0xHH to the same Unicode code point U+00HH + readCharArrayUC( nChars, RTL_TEXTENCODING_ISO_8859_1 ) : + readUnicodeArray( nChars ); +} + +void BinaryInputStream::copyToStream( BinaryOutputStream& rOutStrm ) +{ + sal_Int64 nBytes = SAL_MAX_INT64; + sal_Int32 nBufferSize = INPUTSTREAM_BUFFERSIZE; + StreamDataSequence aBuffer( nBufferSize ); + while( nBytes > 0 ) + { + sal_Int32 nReadSize = getLimitedValue< sal_Int32, sal_Int64 >( nBytes, 0, nBufferSize ); + sal_Int32 nBytesRead = readData( aBuffer, nReadSize ); + rOutStrm.writeData( aBuffer ); + if( nReadSize == nBytesRead ) + nBytes -= nReadSize; + else + nBytes = 0; + } +} + +BinaryXInputStream::BinaryXInputStream( const Reference< XInputStream >& rxInStrm, bool bAutoClose ) : + BinaryStreamBase( Reference< XSeekable >( rxInStrm, UNO_QUERY ).is() ), + BinaryXSeekableStream( Reference< XSeekable >( rxInStrm, UNO_QUERY ) ), + maBuffer( INPUTSTREAM_BUFFERSIZE ), + mxInStrm( rxInStrm ), + mbAutoClose( bAutoClose && rxInStrm.is() ) +{ + mbEof = !mxInStrm.is(); +} + +BinaryXInputStream::~BinaryXInputStream() +{ + close(); +} + +void BinaryXInputStream::close() +{ + OSL_ENSURE( !mbAutoClose || mxInStrm.is(), "BinaryXInputStream::close - invalid call" ); + if( mxInStrm.is() ) try + { + mxInStrm->closeInput(); + } + catch( Exception& ) + { + OSL_FAIL( "BinaryXInputStream::close - closing input stream failed" ); + } + mxInStrm.clear(); + mbAutoClose = false; + BinaryXSeekableStream::close(); +} + +sal_Int32 BinaryXInputStream::readData( StreamDataSequence& orData, sal_Int32 nBytes, size_t /*nAtomSize*/ ) +{ + sal_Int32 nRet = 0; + if( !mbEof && (nBytes > 0) ) try + { + nRet = mxInStrm->readBytes( orData, nBytes ); + mbEof = nRet != nBytes; + } + catch( Exception& ) + { + mbEof = true; + } + return nRet; +} + +sal_Int32 BinaryXInputStream::readMemory( void* opMem, sal_Int32 nBytes, size_t nAtomSize ) +{ + sal_Int32 nRet = 0; + if( !mbEof && (nBytes > 0) ) + { + sal_Int32 nBufferSize = getLimitedValue< sal_Int32, sal_Int32 >( nBytes, 0, INPUTSTREAM_BUFFERSIZE ); + sal_uInt8* opnMem = static_cast< sal_uInt8* >( opMem ); + while( !mbEof && (nBytes > 0) ) + { + sal_Int32 nReadSize = getLimitedValue< sal_Int32, sal_Int32 >( nBytes, 0, nBufferSize ); + sal_Int32 nBytesRead = readData( maBuffer, nReadSize, nAtomSize ); + if( nBytesRead > 0 ) + memcpy( opnMem, maBuffer.getConstArray(), static_cast< size_t >( nBytesRead ) ); + opnMem += nBytesRead; + nBytes -= nBytesRead; + nRet += nBytesRead; + } + } + return nRet; +} + +void BinaryXInputStream::skip( sal_Int32 nBytes, size_t /*nAtomSize*/ ) +{ + if( !mbEof ) try + { + mxInStrm->skipBytes( nBytes ); + } + catch( Exception& ) + { + mbEof = true; + } +} + +SequenceInputStream::SequenceInputStream( const StreamDataSequence& rData ) : + BinaryStreamBase( true ), + SequenceSeekableStream( rData ) +{ +} + +sal_Int32 SequenceInputStream::readData( StreamDataSequence& orData, sal_Int32 nBytes, size_t /*nAtomSize*/ ) +{ + sal_Int32 nReadBytes = 0; + if( !mbEof ) + { + nReadBytes = getMaxBytes( nBytes ); + orData.realloc( nReadBytes ); + if( nReadBytes > 0 ) + memcpy( orData.getArray(), mpData->getConstArray() + mnPos, static_cast< size_t >( nReadBytes ) ); + mnPos += nReadBytes; + mbEof = nReadBytes < nBytes; + } + return nReadBytes; +} + +sal_Int32 SequenceInputStream::readMemory( void* opMem, sal_Int32 nBytes, size_t /*nAtomSize*/ ) +{ + sal_Int32 nReadBytes = 0; + if( !mbEof ) + { + nReadBytes = getMaxBytes( nBytes ); + if( nReadBytes > 0 ) + memcpy( opMem, mpData->getConstArray() + mnPos, static_cast< size_t >( nReadBytes ) ); + mnPos += nReadBytes; + mbEof = nReadBytes < nBytes; + } + return nReadBytes; +} + +void SequenceInputStream::skip( sal_Int32 nBytes, size_t /*nAtomSize*/ ) +{ + if( !mbEof ) + { + sal_Int32 nSkipBytes = getMaxBytes( nBytes ); + mnPos += nSkipBytes; + mbEof = nSkipBytes < nBytes; + } +} + +RelativeInputStream::RelativeInputStream( BinaryInputStream& rInStrm, sal_Int64 nSize ) : + BinaryStreamBase( rInStrm.isSeekable() ), + mpInStrm( &rInStrm ), + mnStartPos( rInStrm.tell() ), + mnRelPos( 0 ) +{ + sal_Int64 nRemaining = rInStrm.getRemaining(); + mnSize = (nRemaining >= 0) ? ::std::min( nSize, nRemaining ) : nSize; + mbEof = mbEof || rInStrm.isEof() || (mnSize < 0); +} + +sal_Int64 RelativeInputStream::size() const +{ + return mpInStrm ? mnSize : -1; +} + +sal_Int64 RelativeInputStream::tell() const +{ + return mpInStrm ? mnRelPos : -1; +} + +void RelativeInputStream::seek( sal_Int64 nPos ) +{ + if( mpInStrm && isSeekable() && (mnStartPos >= 0) ) + { + mnRelPos = getLimitedValue< sal_Int64, sal_Int64 >( nPos, 0, mnSize ); + mpInStrm->seek( mnStartPos + mnRelPos ); + mbEof = (mnRelPos != nPos) || mpInStrm->isEof(); + } +} + +void RelativeInputStream::close() +{ + mpInStrm = nullptr; + mbEof = true; +} + +sal_Int32 RelativeInputStream::readData( StreamDataSequence& orData, sal_Int32 nBytes, size_t nAtomSize ) +{ + sal_Int32 nReadBytes = 0; + if( !mbEof ) + { + sal_Int32 nMaxBytes = getMaxBytes( nBytes ); + nReadBytes = mpInStrm->readData( orData, nMaxBytes, nAtomSize ); + mnRelPos += nReadBytes; + mbEof = (nMaxBytes < nBytes) || mpInStrm->isEof(); + } + return nReadBytes; +} + +sal_Int32 RelativeInputStream::readMemory( void* opMem, sal_Int32 nBytes, size_t nAtomSize ) +{ + sal_Int32 nReadBytes = 0; + if( !mbEof ) + { + sal_Int32 nMaxBytes = getMaxBytes( nBytes ); + nReadBytes = mpInStrm->readMemory( opMem, nMaxBytes, nAtomSize ); + mnRelPos += nReadBytes; + mbEof = (nMaxBytes < nBytes) || mpInStrm->isEof(); + } + return nReadBytes; +} + +void RelativeInputStream::skip( sal_Int32 nBytes, size_t nAtomSize ) +{ + if( !mbEof ) + { + sal_Int32 nSkipBytes = getMaxBytes( nBytes ); + mpInStrm->skip( nSkipBytes, nAtomSize ); + mnRelPos += nSkipBytes; + mbEof = nSkipBytes < nBytes; + } +} + +} // namespace oox + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/helper/binaryoutputstream.cxx b/oox/source/helper/binaryoutputstream.cxx new file mode 100644 index 000000000..50ce7f11c --- /dev/null +++ b/oox/source/helper/binaryoutputstream.cxx @@ -0,0 +1,184 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include + +#include +#include +#include +#include + +namespace oox { + +using namespace ::com::sun::star::io; +using namespace ::com::sun::star::uno; + +namespace { + +const sal_Int32 OUTPUTSTREAM_BUFFERSIZE = 0x8000; + +} // namespace + +BinaryXOutputStream::BinaryXOutputStream( const Reference< XOutputStream >& rxOutStrm, bool bAutoClose ) : + BinaryStreamBase( Reference< XSeekable >( rxOutStrm, UNO_QUERY ).is() ), + BinaryXSeekableStream( Reference< XSeekable >( rxOutStrm, UNO_QUERY ) ), + maBuffer( OUTPUTSTREAM_BUFFERSIZE ), + mxOutStrm( rxOutStrm ), + mbAutoClose( bAutoClose && rxOutStrm.is() ) +{ + mbEof = !mxOutStrm.is(); +} + +BinaryXOutputStream::~BinaryXOutputStream() +{ + close(); +} + +void BinaryXOutputStream::close() +{ + OSL_ENSURE( !mbAutoClose || mxOutStrm.is(), "BinaryXOutputStream::close - invalid call" ); + if( mxOutStrm.is() ) try + { + mxOutStrm->flush(); + if ( mbAutoClose ) + mxOutStrm->closeOutput(); + } + catch( Exception& ) + { + OSL_FAIL( "BinaryXOutputStream::close - closing output stream failed" ); + } + mxOutStrm.clear(); + mbAutoClose = false; + BinaryXSeekableStream::close(); +} + +void BinaryXOutputStream::writeData( const StreamDataSequence& rData, size_t /*nAtomSize*/ ) +{ + if( mxOutStrm.is() ) try + { + mxOutStrm->writeBytes( rData ); + } + catch( Exception& ) + { + OSL_FAIL( "BinaryXOutputStream::writeData - stream read error" ); + } +} + +void BinaryXOutputStream::writeMemory( const void* pMem, sal_Int32 nBytes, size_t nAtomSize ) +{ + if( !(mxOutStrm.is() && (nBytes > 0)) ) + return; + + sal_Int32 nBufferSize = getLimitedValue< sal_Int32, sal_Int32 >( nBytes, 0, (OUTPUTSTREAM_BUFFERSIZE / nAtomSize) * nAtomSize ); + const sal_uInt8* pnMem = static_cast< const sal_uInt8* >( pMem ); + while( nBytes > 0 ) + { + sal_Int32 nWriteSize = getLimitedValue< sal_Int32, sal_Int32 >( nBytes, 0, nBufferSize ); + maBuffer.realloc( nWriteSize ); + memcpy( maBuffer.getArray(), pnMem, static_cast< size_t >( nWriteSize ) ); + writeData( maBuffer, nAtomSize ); + pnMem += nWriteSize; + nBytes -= nWriteSize; + } +} + +void +BinaryOutputStream::writeCharArrayUC( std::u16string_view rString, rtl_TextEncoding eTextEnc ) +{ + OString sBuf( OUStringToOString( rString, eTextEnc ) ); + sBuf = sBuf.replace( '\0', '?' ); + writeMemory( static_cast< const void* >( sBuf.getStr() ), sBuf.getLength() ); +} + +void +BinaryOutputStream::writeUnicodeArray( const OUString& rString ) +{ + OUString sBuf = rString.replace( '\0', '?' ); +#ifdef OSL_BIGENDIAN + // need a non-const buffer for swapping byte order + sal_Unicode notConst[sBuf.getLength()]; + memcpy( notConst, sBuf.getStr(), sizeof(sal_Unicode)*sBuf.getLength() ); + writeArray( notConst, sBuf.getLength() ); +#else + writeArray( sBuf.getStr(), sBuf.getLength() ); +#endif +} + +void BinaryOutputStream::writeCompressedUnicodeArray( const OUString& rString, bool bCompressed ) +{ + if ( bCompressed ) + // ISO-8859-1 maps all byte values 0xHH to the same Unicode code point U+00HH + writeCharArrayUC( rString, RTL_TEXTENCODING_ISO_8859_1 ); + else + writeUnicodeArray( rString ); +} + +SequenceOutputStream::SequenceOutputStream( StreamDataSequence & rData ) : + BinaryStreamBase( true ), + mpData( &rData ), + mnPos( 0 ) +{ +} + +void SequenceOutputStream::writeData( const StreamDataSequence& rData, size_t nAtomSize ) +{ + if( mpData && rData.hasElements() ) + writeMemory( rData.getConstArray(), rData.getLength(), nAtomSize ); +} + +void SequenceOutputStream::writeMemory( const void* pMem, sal_Int32 nBytes, size_t /*nAtomSize*/ ) +{ + if( mpData && (nBytes > 0) ) + { + if( mpData->getLength() - mnPos < nBytes ) + mpData->realloc( mnPos + nBytes ); + memcpy( mpData->getArray() + mnPos, pMem, static_cast< size_t >( nBytes ) ); + mnPos += nBytes; + } +} + +sal_Int64 SequenceOutputStream::size() const +{ + return mpData ? mpData->getLength() : -1; +} + +sal_Int64 SequenceOutputStream::tell() const +{ + return mpData ? mnPos : -1; +} + +void SequenceOutputStream::seek( sal_Int64 nPos ) +{ + if( mpData ) + { + mnPos = getLimitedValue< sal_Int32, sal_Int64 >( nPos, 0, mpData->getLength() ); + mbEof = mnPos != nPos; + } +} + +void SequenceOutputStream::close() +{ + mpData = nullptr; + mbEof = true; +} + + +} // namespace oox + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/helper/binarystreambase.cxx b/oox/source/helper/binarystreambase.cxx new file mode 100644 index 000000000..1e3ef11ae --- /dev/null +++ b/oox/source/helper/binarystreambase.cxx @@ -0,0 +1,146 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include +#include + +#include +#include + +namespace oox { + +using namespace ::com::sun::star::io; +using namespace ::com::sun::star::uno; + +BinaryStreamBase::~BinaryStreamBase() +{ +} + +sal_Int64 BinaryStreamBase::getRemaining() const +{ + // do not use isSeekable(), implementations may provide stream position and size even if not seekable + sal_Int64 nPos = tell(); + sal_Int64 nLen = size(); + return ((nPos >= 0) && (nLen >= 0)) ? ::std::max< sal_Int64 >( nLen - nPos, 0 ) : -1; +} + +void BinaryStreamBase::alignToBlock( sal_Int32 nBlockSize, sal_Int64 nAnchorPos ) +{ + sal_Int64 nStrmPos = tell(); + // nothing to do, if stream is at anchor position + if( mbSeekable && (0 <= nAnchorPos) && (nAnchorPos != nStrmPos) && (nBlockSize > 1) ) + { + // prevent modulo with negative arguments... + sal_Int64 nSkipSize = (nAnchorPos < nStrmPos) ? + (nBlockSize - ((nStrmPos - nAnchorPos - 1) % nBlockSize) - 1) : + ((nAnchorPos - nStrmPos) % nBlockSize); + seek( nStrmPos + nSkipSize ); + } +} + +BinaryXSeekableStream::BinaryXSeekableStream( const Reference< XSeekable >& rxSeekable ) : + BinaryStreamBase( rxSeekable.is() ), + mxSeekable( rxSeekable ) +{ +} + +BinaryXSeekableStream::~BinaryXSeekableStream() +{ +} + +sal_Int64 BinaryXSeekableStream::size() const +{ + if( mxSeekable.is() ) try + { + return mxSeekable->getLength(); + } + catch( Exception& ) + { + TOOLS_WARN_EXCEPTION( "oox", "BinaryXSeekableStream::size" ); + } + return -1; +} + +sal_Int64 BinaryXSeekableStream::tell() const +{ + if( mxSeekable.is() ) try + { + return mxSeekable->getPosition(); + } + catch( Exception& ) + { + TOOLS_WARN_EXCEPTION( "oox", "BinaryXSeekableStream::tell" ); + } + return -1; +} + +void BinaryXSeekableStream::seek( sal_Int64 nPos ) +{ + if( mxSeekable.is() ) try + { + mbEof = false; + mxSeekable->seek( nPos ); + } + catch( Exception& ) + { + mbEof = true; + } +} + +void BinaryXSeekableStream::close() +{ + mxSeekable.clear(); + mbEof = true; +} + +SequenceSeekableStream::SequenceSeekableStream( const StreamDataSequence& rData ) : + BinaryStreamBase( true ), + mpData( &rData ), + mnPos( 0 ) +{ +} + +sal_Int64 SequenceSeekableStream::size() const +{ + return mpData ? mpData->getLength() : -1; +} + +sal_Int64 SequenceSeekableStream::tell() const +{ + return mpData ? mnPos : -1; +} + +void SequenceSeekableStream::seek( sal_Int64 nPos ) +{ + if( mpData ) + { + mnPos = getLimitedValue< sal_Int32, sal_Int64 >( nPos, 0, mpData->getLength() ); + mbEof = mnPos != nPos; + } +} + +void SequenceSeekableStream::close() +{ + mpData = nullptr; + mbEof = true; +} + +} // namespace oox + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/helper/containerhelper.cxx b/oox/source/helper/containerhelper.cxx new file mode 100644 index 000000000..60e225e17 --- /dev/null +++ b/oox/source/helper/containerhelper.cxx @@ -0,0 +1,126 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include + +#include + +#include +#include + +namespace oox { + +using namespace ::com::sun::star::container; +using namespace ::com::sun::star::lang; +using namespace ::com::sun::star::uno; + +namespace { + +struct ValueRangeComp +{ + bool operator()( const ValueRange& rLHS, const ValueRange& rRHS ) const + { + return rLHS.mnLast < rRHS.mnFirst; + } +}; + +} // namespace + +void ValueRangeSet::insert( const ValueRange& rRange ) +{ + // find the first range that contains or follows the starting point of the passed range + ValueRangeVector::iterator aBeg = maRanges.begin(); + ValueRangeVector::iterator aEnd = maRanges.end(); + ValueRangeVector::iterator aIt = ::std::lower_bound( aBeg, aEnd, rRange, ValueRangeComp() ); + // nothing to do if found range contains passed range + if( (aIt != aEnd) && aIt->contains( rRange ) ) return; + // check if previous range can be used to merge with the passed range + if( (aIt != aBeg) && ((aIt - 1)->mnLast + 1 == rRange.mnFirst) ) --aIt; + // check if current range (aIt) can be used to merge with passed range + if( (aIt != aEnd) && aIt->intersects( rRange ) ) + { + // set new start value to existing range + aIt->mnFirst = ::std::min( aIt->mnFirst, rRange.mnFirst ); + // search first range that cannot be merged anymore (aNext) + ValueRangeVector::iterator aNext = aIt + 1; + while( (aNext != aEnd) && aNext->intersects( rRange ) ) ++aNext; + // set new end value to existing range + aIt->mnLast = ::std::max( (aNext - 1)->mnLast, rRange.mnLast ); + // remove ranges covered by new existing range (aIt) + maRanges.erase( aIt + 1, aNext ); + } + else + { + // merging not possible: insert new range + maRanges.insert( aIt, rRange ); + } +} + +OUString ContainerHelper::getUnusedName( + const Reference< XNameAccess >& rxNameAccess, const OUString& rSuggestedName, + sal_Unicode cSeparator ) +{ + OSL_ENSURE( rxNameAccess.is(), "ContainerHelper::getUnusedName - missing XNameAccess interface" ); + + OUString aNewName = rSuggestedName; + sal_Int32 nIndex = -1; + while( rxNameAccess->hasByName( aNewName ) ) + aNewName = rSuggestedName + OUStringChar(cSeparator) + OUString::number( nIndex++ ); + return aNewName; +} + +bool ContainerHelper::insertByName( + const Reference< XNameContainer >& rxNameContainer, + const OUString& rName, const Any& rObject ) +{ + OSL_ENSURE( rxNameContainer.is(), "ContainerHelper::insertByName - missing XNameContainer interface" ); + bool bRet = false; + try + { + if( rxNameContainer->hasByName( rName ) ) + rxNameContainer->replaceByName( rName, rObject ); + else + rxNameContainer->insertByName( rName, rObject ); + bRet = true; + } + catch( Exception& ) + { + } + OSL_ENSURE( bRet, "ContainerHelper::insertByName - cannot insert object" ); + return bRet; +} + +OUString ContainerHelper::insertByUnusedName( + const Reference< XNameContainer >& rxNameContainer, + const OUString& rSuggestedName, sal_Unicode cSeparator, + const Any& rObject ) +{ + OSL_ENSURE( rxNameContainer.is(), "ContainerHelper::insertByUnusedName - missing XNameContainer interface" ); + + // find an unused name + OUString aNewName = getUnusedName( rxNameContainer, rSuggestedName, cSeparator ); + + // insert the new object and return its resulting name + insertByName( rxNameContainer, aNewName, rObject ); + return aNewName; +} + +} // namespace oox + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/helper/grabbagstack.cxx b/oox/source/helper/grabbagstack.cxx new file mode 100644 index 000000000..761fc9644 --- /dev/null +++ b/oox/source/helper/grabbagstack.cxx @@ -0,0 +1,82 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + */ + +#include +#include +#include + +namespace oox +{ + +using namespace css::beans; +using namespace css::uno; + +GrabBagStack::GrabBagStack(const OUString& aElementName) +{ + mCurrentElement.maElementName = aElementName; +} + +GrabBagStack::~GrabBagStack() +{} + +bool GrabBagStack::isStackEmpty() const +{ + return mStack.empty(); +} + +PropertyValue GrabBagStack::getRootProperty() +{ + while(!mStack.empty()) + pop(); + + PropertyValue aProperty; + aProperty.Name = mCurrentElement.maElementName; + aProperty.Value <<= comphelper::containerToSequence(mCurrentElement.maPropertyList); + + return aProperty; +} + +void GrabBagStack::appendElement(const OUString& aName, const Any& aAny) +{ + PropertyValue aValue; + aValue.Name = aName; + aValue.Value = aAny; + mCurrentElement.maPropertyList.push_back(aValue); +} + +void GrabBagStack::push(const OUString& aKey) +{ + mStack.push(mCurrentElement); + mCurrentElement.maElementName = aKey; + mCurrentElement.maPropertyList.clear(); +} + +void GrabBagStack::pop() +{ + OUString aName = mCurrentElement.maElementName; + Sequence aSequence(comphelper::containerToSequence(mCurrentElement.maPropertyList)); + mCurrentElement = mStack.top(); + mStack.pop(); + appendElement(aName, Any(aSequence)); +} + +void GrabBagStack::addInt32(const OUString& aElementName, sal_Int32 aIntValue) +{ + appendElement(aElementName, Any(aIntValue)); +} + +void GrabBagStack::addString(const OUString& aElementName, const OUString& aStringValue) +{ + appendElement(aElementName, Any(aStringValue)); +} + +} // namespace oox + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/helper/graphichelper.cxx b/oox/source/helper/graphichelper.cxx new file mode 100644 index 000000000..f327d7eba --- /dev/null +++ b/oox/source/helper/graphichelper.cxx @@ -0,0 +1,323 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace oox { + +using namespace ::com::sun::star; +using namespace ::com::sun::star::beans; +using namespace ::com::sun::star::frame; +using namespace ::com::sun::star::graphic; +using namespace ::com::sun::star::io; +using namespace ::com::sun::star::lang; +using namespace ::com::sun::star::uno; + +namespace { + +sal_Int32 lclConvertScreenPixelToHmm( double fPixel, double fPixelPerHmm ) +{ + return static_cast< sal_Int32 >( (fPixelPerHmm > 0.0) ? (fPixel / fPixelPerHmm + 0.5) : 0.0 ); +} + +} // namespace + +GraphicHelper::GraphicHelper( const Reference< XComponentContext >& rxContext, const Reference< XFrame >& /*rxTargetFrame*/, const StorageRef& rxStorage ) : + mxContext( rxContext ), + mxStorage( rxStorage ) +{ + OSL_ENSURE( mxContext.is(), "GraphicHelper::GraphicHelper - missing component context" ); + if( mxContext.is() ) + mxGraphicProvider.set( graphic::GraphicProvider::create( mxContext ), uno::UNO_QUERY ); + + //! TODO: get colors from system + maSystemPalette[ XML_3dDkShadow ] = Color(0x716F64); + maSystemPalette[ XML_3dLight ] = Color(0xF1EFE2); + maSystemPalette[ XML_activeBorder ] = Color(0xD4D0C8); + maSystemPalette[ XML_activeCaption ] = Color(0x0054E3); + maSystemPalette[ XML_appWorkspace ] = Color(0x808080); + maSystemPalette[ XML_background ] = Color(0x004E98); + maSystemPalette[ XML_btnFace ] = Color(0xECE9D8); + maSystemPalette[ XML_btnHighlight ] = Color(0xFFFFFF); + maSystemPalette[ XML_btnShadow ] = Color(0xACA899); + maSystemPalette[ XML_btnText ] = Color(0x000000); + maSystemPalette[ XML_captionText ] = Color(0xFFFFFF); + maSystemPalette[ XML_gradientActiveCaption ] = Color(0x3D95FF); + maSystemPalette[ XML_gradientInactiveCaption ] = Color(0xD8E4F8); + maSystemPalette[ XML_grayText ] = Color(0xACA899); + maSystemPalette[ XML_highlight ] = Color(0x316AC5); + maSystemPalette[ XML_highlightText ] = Color(0xFFFFFF); + maSystemPalette[ XML_hotLight ] = Color(0x000080); + maSystemPalette[ XML_inactiveBorder ] = Color(0xD4D0C8); + maSystemPalette[ XML_inactiveCaption ] = Color(0x7A96DF); + maSystemPalette[ XML_inactiveCaptionText ] = Color(0xD8E4F8); + maSystemPalette[ XML_infoBk ] = Color(0xFFFFE1); + maSystemPalette[ XML_infoText ] = Color(0x000000); + maSystemPalette[ XML_menu ] = Color(0xFFFFFF); + maSystemPalette[ XML_menuBar ] = Color(0xECE9D8); + maSystemPalette[ XML_menuHighlight ] = Color(0x316AC5); + maSystemPalette[ XML_menuText ] = Color(0x000000); + maSystemPalette[ XML_scrollBar ] = Color(0xD4D0C8); + maSystemPalette[ XML_window ] = Color(0xFFFFFF); + maSystemPalette[ XML_windowFrame ] = Color(0x000000); + maSystemPalette[ XML_windowText ] = Color(0x000000); + + // Note that we cannot try to get DeviceInfo from the current frame here, + // because there might not be a current frame yet + mxDefaultOutputDevice = Application::GetDefaultDevice(); + maDeviceInfo = mxDefaultOutputDevice->GetDeviceInfo(); + // 100 000 is 1 meter in MM100. + // various unit tests rely on these values being exactly this and not the "true" values + Size aDefault = mxDefaultOutputDevice->LogicToPixel(Size(100000, 100000), MapMode(MapUnit::Map100thMM)); + maDeviceInfo.PixelPerMeterX = aDefault.Width(); + maDeviceInfo.PixelPerMeterY = aDefault.Height(); + mfPixelPerHmmX = maDeviceInfo.PixelPerMeterX / 100000.0; + mfPixelPerHmmY = maDeviceInfo.PixelPerMeterY / 100000.0; +} + +GraphicHelper::~GraphicHelper() +{ +} + +// System colors and predefined colors ---------------------------------------- + +::Color GraphicHelper::getSystemColor( sal_Int32 nToken, ::Color nDefaultRgb ) const +{ + return ContainerHelper::getMapElement( maSystemPalette, nToken, nDefaultRgb ); +} + +::Color GraphicHelper::getSchemeColor( sal_Int32 /*nToken*/ ) const +{ + OSL_FAIL( "GraphicHelper::getSchemeColor - scheme colors not implemented" ); + return API_RGB_TRANSPARENT; +} + +::Color GraphicHelper::getPaletteColor( sal_Int32 /*nPaletteIdx*/ ) const +{ + OSL_FAIL( "GraphicHelper::getPaletteColor - palette colors not implemented" ); + return API_RGB_TRANSPARENT; +} + +sal_Int32 GraphicHelper::getDefaultChartAreaFillStyle() const +{ + return XML_solidFill; +} + +sal_Int32 GraphicHelper::getDefaultChartAreaLineStyle() +{ + return XML_solidFill; +} + +sal_Int16 GraphicHelper::getDefaultChartAreaLineWidth() +{ + // this value is what MSO 2016 writes fixing incomplete MSO 2010 documents (0.75 pt in emu) + return 9525; +} + +// Device info and device dependent unit conversion --------------------------- + +sal_Int32 GraphicHelper::convertScreenPixelXToHmm( double fPixelX ) const +{ + return lclConvertScreenPixelToHmm( fPixelX, mfPixelPerHmmX ); +} + +sal_Int32 GraphicHelper::convertScreenPixelYToHmm( double fPixelY ) const +{ + return lclConvertScreenPixelToHmm( fPixelY, mfPixelPerHmmY ); +} + +awt::Size GraphicHelper::convertScreenPixelToHmm( const awt::Size& rPixel ) const +{ + return awt::Size( convertScreenPixelXToHmm( rPixel.Width ), convertScreenPixelYToHmm( rPixel.Height ) ); +} + +double GraphicHelper::convertHmmToScreenPixelX( sal_Int32 nHmmX ) const +{ + return nHmmX * mfPixelPerHmmX; +} + +double GraphicHelper::convertHmmToScreenPixelY( sal_Int32 nHmmY ) const +{ + return nHmmY * mfPixelPerHmmY; +} + +awt::Point GraphicHelper::convertHmmToScreenPixel( const awt::Point& rHmm ) const +{ + return awt::Point( + static_cast< sal_Int32 >( convertHmmToScreenPixelX( rHmm.X ) + 0.5 ), + static_cast< sal_Int32 >( convertHmmToScreenPixelY( rHmm.Y ) + 0.5 ) ); +} + +awt::Size GraphicHelper::convertHmmToScreenPixel( const awt::Size& rHmm ) const +{ + return awt::Size( + static_cast< sal_Int32 >( convertHmmToScreenPixelX( rHmm.Width ) + 0.5 ), + static_cast< sal_Int32 >( convertHmmToScreenPixelY( rHmm.Height ) + 0.5 ) ); +} + +awt::Point GraphicHelper::convertHmmToAppFont( const awt::Point& rHmm ) const +{ + try + { + awt::Point aPixel = convertHmmToScreenPixel( rHmm ); + MapMode aMode(MapUnit::MapAppFont); + ::Point aVCLPoint(aPixel.X, aPixel.Y); + ::Point aDevPoint = mxDefaultOutputDevice->PixelToLogic(aVCLPoint, aMode ); + return awt::Point(aDevPoint.X(), aDevPoint.Y()); + } + catch( Exception& ) + { + DBG_UNHANDLED_EXCEPTION("oox"); + } + return awt::Point( 0, 0 ); +} + +awt::Size GraphicHelper::convertHmmToAppFont( const awt::Size& rHmm ) const +{ + try + { + awt::Size aPixel = convertHmmToScreenPixel( rHmm ); + MapMode aMode(MapUnit::MapAppFont); + ::Size aVCLSize(aPixel.Width, aPixel.Height); + ::Size aDevSz = mxDefaultOutputDevice->PixelToLogic(aVCLSize, aMode ); + return awt::Size(aDevSz.Width(), aDevSz.Height()); + } + catch( Exception& ) + { + DBG_UNHANDLED_EXCEPTION("oox"); + } + return awt::Size( 0, 0 ); +} + + +// Graphics and graphic objects ---------------------------------------------- + +Reference< XGraphic > GraphicHelper::importGraphic( const Reference< XInputStream >& rxInStrm, + const WmfExternal* pExtHeader ) const +{ + Reference< XGraphic > xGraphic; + if( rxInStrm.is() && mxGraphicProvider.is() ) try + { + Sequence< PropertyValue > aArgs{ comphelper::makePropertyValue("InputStream", rxInStrm), + comphelper::makePropertyValue("LazyRead", true) }; + + if ( pExtHeader && pExtHeader->mapMode > 0 ) + { + aArgs.realloc( aArgs.getLength() + 1 ); + auto pArgs = aArgs.getArray(); + Sequence< PropertyValue > aFilterData{ + comphelper::makePropertyValue("ExternalWidth", pExtHeader->xExt), + comphelper::makePropertyValue("ExternalHeight", pExtHeader->yExt), + comphelper::makePropertyValue("ExternalMapMode", pExtHeader->mapMode) + }; + pArgs[ 2 ].Name = "FilterData"; + pArgs[ 2 ].Value <<= aFilterData; + } + + xGraphic = mxGraphicProvider->queryGraphic( aArgs ); + } + catch( Exception& ) + { + } + return xGraphic; +} + +Reference< XGraphic > GraphicHelper::importGraphic( const StreamDataSequence& rGraphicData ) const +{ + Reference< XGraphic > xGraphic; + if( rGraphicData.hasElements() ) + { + Reference< XInputStream > xInStrm( new ::comphelper::SequenceInputStream( rGraphicData ) ); + xGraphic = importGraphic( xInStrm ); + } + return xGraphic; +} + +Reference< XGraphic > GraphicHelper::importEmbeddedGraphic( const OUString& rStreamName, const WmfExternal* pExtHeader ) const +{ + Reference< XGraphic > xGraphic; + OSL_ENSURE( !rStreamName.isEmpty(), "GraphicHelper::importEmbeddedGraphic - empty stream name" ); + + if( !rStreamName.isEmpty() ) + { + initializeGraphicMapperIfNeeded(); + + SAL_WARN_IF(!mxGraphicMapper.is(), "oox", "GraphicHelper::importEmbeddedGraphic - graphic mapper not available"); + + xGraphic = mxGraphicMapper->findGraphic(rStreamName); + if (!xGraphic.is()) + { + auto xStream = mxStorage->openInputStream(rStreamName); + xGraphic = importGraphic(xStream, pExtHeader); + if (xGraphic.is()) + mxGraphicMapper->putGraphic(rStreamName, xGraphic); + } + } + return xGraphic; +} + +awt::Size GraphicHelper::getOriginalSize( const Reference< XGraphic >& xGraphic ) const +{ + awt::Size aSizeHmm; + PropertySet aPropSet( xGraphic ); + if( aPropSet.getProperty( aSizeHmm, PROP_Size100thMM ) && (aSizeHmm.Width == 0) && (aSizeHmm.Height == 0) ) // MAPMODE_PIXEL used? + { + awt::Size aSizePixel( 0, 0 ); + if( aPropSet.getProperty( aSizePixel, PROP_SizePixel ) ) + aSizeHmm = convertScreenPixelToHmm( aSizePixel ); + } + return aSizeHmm; +} + +void GraphicHelper::setGraphicMapper(css::uno::Reference const & rGraphicMapper) +{ + mxGraphicMapper = rGraphicMapper; +} + +void GraphicHelper::initializeGraphicMapperIfNeeded() const +{ + if (!mxGraphicMapper.is()) + { + auto* pNonConstThis = const_cast(this); + pNonConstThis->mxGraphicMapper = graphic::GraphicMapper::create(mxContext); + } +} + +} // namespace oox + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/helper/modelobjecthelper.cxx b/oox/source/helper/modelobjecthelper.cxx new file mode 100644 index 000000000..c5115bba3 --- /dev/null +++ b/oox/source/helper/modelobjecthelper.cxx @@ -0,0 +1,159 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace oox { + +using namespace ::com::sun::star; +using namespace ::com::sun::star::drawing; +using namespace ::com::sun::star::lang; +using namespace ::com::sun::star::uno; + +ObjectContainer::ObjectContainer( const Reference< XMultiServiceFactory >& rxModelFactory, const OUString& rServiceName ) : + mxModelFactory( rxModelFactory ), + maServiceName( rServiceName ), + mnIndex( 0 ) +{ + OSL_ENSURE( mxModelFactory.is(), "ObjectContainer::ObjectContainer - missing service factory" ); +} + +ObjectContainer::~ObjectContainer() +{ +} + +bool ObjectContainer::hasObject( const OUString& rObjName ) const +{ + createContainer(); + return mxContainer.is() && mxContainer->hasByName( rObjName ); +} + +Any ObjectContainer::getObject( const OUString& rObjName ) const +{ + if( hasObject( rObjName ) ) + return mxContainer->getByName( rObjName ); + return Any(); +} + +OUString ObjectContainer::insertObject( const OUString& rObjName, const Any& rObj, bool bInsertByUnusedName ) +{ + createContainer(); + if( mxContainer.is() ) + { + if( bInsertByUnusedName ) + return ContainerHelper::insertByUnusedName( mxContainer, rObjName + OUString::number( ++mnIndex ), ' ', rObj ); + if( ContainerHelper::insertByName( mxContainer, rObjName, rObj ) ) + return rObjName; + } + return OUString(); +} + +void ObjectContainer::createContainer() const +{ + if( !mxContainer.is() && mxModelFactory.is() ) try + { + mxContainer.set( mxModelFactory->createInstance( maServiceName ), UNO_QUERY_THROW ); + mxModelFactory.clear(); + } + catch( Exception& ) + { + } + OSL_ENSURE( mxContainer.is(), "ObjectContainer::createContainer - container not found" ); +} + +constexpr OUStringLiteral gaDashNameBase( u"msLineDash " ); ///< Base name for all named line dashes. +constexpr OUStringLiteral gaGradientNameBase( u"msFillGradient " ); ///< Base name for all named fill gradients. +constexpr OUStringLiteral gaTransGradNameBase( u"msTransGradient " ); ///< Base name for all named fill gradients. +constexpr OUStringLiteral gaBitmapUrlNameBase( u"msFillBitmap " ); ///< Base name for all named fill bitmap URLs. +constexpr OUStringLiteral gaHatchNameBase( u"msFillHatch " ); ///< Base name for all named fill hatches. + +ModelObjectHelper::ModelObjectHelper( const Reference< XMultiServiceFactory >& rxModelFactory ) : + maMarkerContainer( rxModelFactory, "com.sun.star.drawing.MarkerTable" ), + maDashContainer( rxModelFactory, "com.sun.star.drawing.DashTable" ), + maGradientContainer( rxModelFactory, "com.sun.star.drawing.GradientTable" ), + maTransGradContainer( rxModelFactory, "com.sun.star.drawing.TransparencyGradientTable" ), + maBitmapUrlContainer( rxModelFactory, "com.sun.star.drawing.BitmapTable" ), + maHatchContainer( rxModelFactory, "com.sun.star.drawing.HatchTable" ) +{ +} + +bool ModelObjectHelper::hasLineMarker( const OUString& rMarkerName ) const +{ + return maMarkerContainer.hasObject( rMarkerName ); +} + +bool ModelObjectHelper::insertLineMarker( const OUString& rMarkerName, const PolyPolygonBezierCoords& rMarker ) +{ + OSL_ENSURE( rMarker.Coordinates.hasElements(), "ModelObjectHelper::insertLineMarker - line marker without coordinates" ); + if( rMarker.Coordinates.hasElements() ) + return !maMarkerContainer.insertObject( rMarkerName, Any( rMarker ), false ).isEmpty(); + return false; +} + +OUString ModelObjectHelper::insertLineDash( const LineDash& rDash ) +{ + return maDashContainer.insertObject( gaDashNameBase, Any( rDash ), true ); +} + +OUString ModelObjectHelper::insertFillGradient( const awt::Gradient& rGradient ) +{ + return maGradientContainer.insertObject( gaGradientNameBase, Any( rGradient ), true ); +} + +OUString ModelObjectHelper::insertTransGrandient( const awt::Gradient& rGradient ) +{ + return maTransGradContainer.insertObject( gaTransGradNameBase, Any( rGradient ), true ); +} + +OUString ModelObjectHelper::insertFillBitmapXGraphic(uno::Reference const & rxGraphic) +{ + uno::Reference xBitmap(rxGraphic, uno::UNO_QUERY); + if (xBitmap.is()) + return maBitmapUrlContainer.insertObject(gaBitmapUrlNameBase, Any(xBitmap), true); + return OUString(); +} + +OUString ModelObjectHelper::insertFillHatch(const drawing::Hatch& rHatch) +{ + return maHatchContainer.insertObject( gaHatchNameBase, Any( rHatch ), true ); +} + +uno::Reference ModelObjectHelper::getFillBitmap(OUString const & rGraphicName) +{ + uno::Reference xBitmap; + uno::Any aAny = maBitmapUrlContainer.getObject(rGraphicName); + if (aAny.has>()) + xBitmap = aAny.get>(); + return xBitmap; +} + +} // namespace oox + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/helper/ooxresid.cxx b/oox/source/helper/ooxresid.cxx new file mode 100644 index 000000000..6ad02a70b --- /dev/null +++ b/oox/source/helper/ooxresid.cxx @@ -0,0 +1,17 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#include +#include +#include + +OUString OoxResId(TranslateId aId) { return Translate::get(aId, Translate::Create("oox")); } +OUString URLResId(TranslateId aId) { return Translate::get(aId, Translate::Create("sd")); } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/oox/source/helper/progressbar.cxx b/oox/source/helper/progressbar.cxx new file mode 100644 index 000000000..86170b47e --- /dev/null +++ b/oox/source/helper/progressbar.cxx @@ -0,0 +1,167 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include + +#include +#include + +#include + +namespace oox { + +using namespace ::com::sun::star::task; +using namespace ::com::sun::star::uno; + +namespace { + +const sal_Int32 PROGRESS_RANGE = 1000000; + +} // namespace + +IProgressBar::~IProgressBar() +{ +} + +ISegmentProgressBar::~ISegmentProgressBar() +{ +} + +ProgressBar::ProgressBar( const Reference< XStatusIndicator >& rxIndicator, const OUString& rText ) : + mxIndicator( rxIndicator ), + mfPosition( 0 ) +{ + if( mxIndicator.is() ) + mxIndicator->start( rText, PROGRESS_RANGE ); +} + +ProgressBar::~ProgressBar() +{ + if( mxIndicator.is() ) + mxIndicator->end(); +} + +double ProgressBar::getPosition() const +{ + return mfPosition; +} + +void ProgressBar::setPosition( double fPosition ) +{ + SAL_WARN_IF( (mfPosition > fPosition) || (fPosition > 1.0), "oox", "ProgressBar::setPosition - invalid position" ); + mfPosition = getLimitedValue< double >( fPosition, mfPosition, 1.0 ); + if( mxIndicator.is() ) + mxIndicator->setValue( static_cast< sal_Int32 >( mfPosition * PROGRESS_RANGE ) ); +} + +namespace prv { + +namespace { + +class SubSegment : public ISegmentProgressBar +{ +public: + explicit SubSegment( IProgressBar& rParentProgress, double fStartPos, double fLength ); + + virtual double getPosition() const override; + virtual void setPosition( double fPosition ) override; + + virtual double getFreeLength() const override; + virtual ISegmentProgressBarRef createSegment( double fLength ) override; + +private: + IProgressBar& mrParentProgress; + double mfStartPos; + double mfLength; + double mfPosition; + double mfFreeStart; +}; + +} + +SubSegment::SubSegment( IProgressBar& rParentProgress, double fStartPos, double fLength ) : + mrParentProgress( rParentProgress ), + mfStartPos( fStartPos ), + mfLength( fLength ), + mfPosition( 0.0 ), + mfFreeStart( 0.0 ) +{ +} + +double SubSegment::getPosition() const +{ + return mfPosition; +} + +void SubSegment::setPosition( double fPosition ) +{ + SAL_WARN_IF( (mfPosition > fPosition) || (fPosition > 1.0), "oox", "SubSegment::setPosition - invalid position" ); + mfPosition = getLimitedValue< double >( fPosition, mfPosition, 1.0 ); + mrParentProgress.setPosition( mfStartPos + mfPosition * mfLength ); +} + +double SubSegment::getFreeLength() const +{ + return 1.0 - mfFreeStart; +} + +ISegmentProgressBarRef SubSegment::createSegment( double fLength ) +{ + SAL_WARN_IF( (0.0 >= fLength) || (fLength > getFreeLength()), "oox", "SubSegment::createSegment - invalid length" ); + fLength = getLimitedValue< double >( fLength, 0.0, getFreeLength() ); + ISegmentProgressBarRef xSegment = std::make_shared( *this, mfFreeStart, fLength ); + mfFreeStart += fLength; + return xSegment; +} + +} // namespace oox::prv + +SegmentProgressBar::SegmentProgressBar( const Reference< XStatusIndicator >& rxIndicator, const OUString& rText ) : + maProgress( rxIndicator, rText ), + mfFreeStart( 0.0 ) +{ +} + +double SegmentProgressBar::getPosition() const +{ + return maProgress.getPosition(); +} + +void SegmentProgressBar::setPosition( double fPosition ) +{ + maProgress.setPosition( fPosition ); +} + +double SegmentProgressBar::getFreeLength() const +{ + return 1.0 - mfFreeStart; +} + +ISegmentProgressBarRef SegmentProgressBar::createSegment( double fLength ) +{ + SAL_WARN_IF( (0.0 >= fLength) || (fLength > getFreeLength()), "oox", "SegmentProgressBar::createSegment - invalid length" ); + fLength = getLimitedValue< double >( fLength, 0.0, getFreeLength() ); + ISegmentProgressBarRef xSegment = std::make_shared( maProgress, mfFreeStart, fLength ); + mfFreeStart += fLength; + return xSegment; +} + +} // namespace oox + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/helper/propertymap.cxx b/oox/source/helper/propertymap.cxx new file mode 100644 index 000000000..f45291ea8 --- /dev/null +++ b/oox/source/helper/propertymap.cxx @@ -0,0 +1,956 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include + +#if OSL_DEBUG_LEVEL > 0 +# include +# include +# include +using ::com::sun::star::style::LineSpacing; +using ::com::sun::star::text::WritingMode; +#include +#include +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +using ::com::sun::star::uno::Any; +using ::com::sun::star::uno::Reference; +using ::com::sun::star::uno::Sequence; +using ::com::sun::star::beans::Property; +using ::com::sun::star::beans::PropertyValue; +using ::com::sun::star::beans::UnknownPropertyException; +using ::com::sun::star::beans::XPropertyChangeListener; +using ::com::sun::star::beans::XPropertySet; +using ::com::sun::star::beans::XPropertySetInfo; +using ::com::sun::star::beans::XVetoableChangeListener; +using ::com::sun::star::container::XIndexReplace; + +#if OSL_DEBUG_LEVEL > 0 +#define USS(x) OUStringToOString( x, RTL_TEXTENCODING_UTF8 ).getStr() +using namespace ::com::sun::star; +using namespace ::com::sun::star::drawing; +using namespace ::com::sun::star::uno; +using ::com::sun::star::style::LineSpacing; +using ::com::sun::star::text::WritingMode; +using ::com::sun::star::drawing::TextHorizontalAdjust; +using ::com::sun::star::drawing::TextVerticalAdjust; +#endif + +namespace oox { +using ::com::sun::star::container::XIndexReplace; + +using namespace ::com::sun::star::beans; +using namespace ::com::sun::star::lang; +using namespace ::com::sun::star::drawing; +using namespace ::com::sun::star::uno; +using ::com::sun::star::drawing::TextHorizontalAdjust; +using ::com::sun::star::drawing::TextVerticalAdjust; + +namespace { + +/** This class implements a generic XPropertySet. + + Properties of all names and types can be set and later retrieved. + TODO: move this to comphelper or better find an existing implementation + */ +class GenericPropertySet : public ::cppu::WeakImplHelper< XPropertySet, XPropertySetInfo > +{ +public: + explicit GenericPropertySet( const PropertyMap& rPropMap ); + + // XPropertySet + virtual Reference< XPropertySetInfo > SAL_CALL getPropertySetInfo() override; + virtual void SAL_CALL setPropertyValue( const OUString& aPropertyName, const Any& aValue ) override; + virtual Any SAL_CALL getPropertyValue( const OUString& PropertyName ) override; + virtual void SAL_CALL addPropertyChangeListener( const OUString& aPropertyName, const Reference< XPropertyChangeListener >& xListener ) override; + virtual void SAL_CALL removePropertyChangeListener( const OUString& aPropertyName, const Reference< XPropertyChangeListener >& aListener ) override; + virtual void SAL_CALL addVetoableChangeListener( const OUString& PropertyName, const Reference< XVetoableChangeListener >& aListener ) override; + virtual void SAL_CALL removeVetoableChangeListener( const OUString& PropertyName, const Reference< XVetoableChangeListener >& aListener ) override; + + // XPropertySetInfo + virtual Sequence< Property > SAL_CALL getProperties() override; + virtual Property SAL_CALL getPropertyByName( const OUString& aName ) override; + virtual sal_Bool SAL_CALL hasPropertyByName( const OUString& Name ) override; + +private: + std::mutex mMutex; + PropertyNameMap maPropMap; +}; + +GenericPropertySet::GenericPropertySet( const PropertyMap& rPropMap ) +{ + rPropMap.fillPropertyNameMap(maPropMap); +} + +Reference< XPropertySetInfo > SAL_CALL GenericPropertySet::getPropertySetInfo() +{ + return this; +} + +void SAL_CALL GenericPropertySet::setPropertyValue( const OUString& rPropertyName, const Any& rValue ) +{ + std::scoped_lock aGuard( mMutex ); + maPropMap[ rPropertyName ] = rValue; +} + +Any SAL_CALL GenericPropertySet::getPropertyValue( const OUString& rPropertyName ) +{ + PropertyNameMap::iterator aIt = maPropMap.find( rPropertyName ); + if( aIt == maPropMap.end() ) + throw UnknownPropertyException(rPropertyName); + return aIt->second; +} + +// listeners are not supported by this implementation +void SAL_CALL GenericPropertySet::addPropertyChangeListener( const OUString& , const Reference< XPropertyChangeListener >& ) {} +void SAL_CALL GenericPropertySet::removePropertyChangeListener( const OUString& , const Reference< XPropertyChangeListener >& ) {} +void SAL_CALL GenericPropertySet::addVetoableChangeListener( const OUString& , const Reference< XVetoableChangeListener >& ) {} +void SAL_CALL GenericPropertySet::removeVetoableChangeListener( const OUString& , const Reference< XVetoableChangeListener >& ) {} + +// XPropertySetInfo +Sequence< Property > SAL_CALL GenericPropertySet::getProperties() +{ + Sequence< Property > aSeq( static_cast< sal_Int32 >( maPropMap.size() ) ); + Property* pProperty = aSeq.getArray(); + for (auto const& prop : maPropMap) + { + pProperty->Name = prop.first; + pProperty->Handle = 0; + pProperty->Type = prop.second.getValueType(); + pProperty->Attributes = 0; + ++pProperty; + } + return aSeq; +} + +Property SAL_CALL GenericPropertySet::getPropertyByName( const OUString& rPropertyName ) +{ + PropertyNameMap::iterator aIt = maPropMap.find( rPropertyName ); + if( aIt == maPropMap.end() ) + throw UnknownPropertyException(rPropertyName); + Property aProperty; + aProperty.Name = aIt->first; + aProperty.Handle = 0; + aProperty.Type = aIt->second.getValueType(); + aProperty.Attributes = 0; + return aProperty; +} + +sal_Bool SAL_CALL GenericPropertySet::hasPropertyByName( const OUString& rPropertyName ) +{ + return maPropMap.find( rPropertyName ) != maPropMap.end(); +} + +} // namespace + +PropertyMap::PropertyMap() : + mpPropNames( &GetPropertyNameVector() ) // pointer instead reference to get compiler generated copy c'tor and operator= +{ +} + +bool PropertyMap::hasProperty( sal_Int32 nPropId ) const +{ + return maProperties.find( nPropId ) != maProperties.end(); +} + +bool PropertyMap::setAnyProperty( sal_Int32 nPropId, const Any& rValue ) +{ + if( nPropId < 0 ) + return false; + + maProperties[ nPropId ] = rValue; + return true; +} + +Any PropertyMap::getProperty( sal_Int32 nPropId ) +{ + return maProperties[ nPropId ]; +} + +void PropertyMap::erase( sal_Int32 nPropId ) +{ + maProperties.erase(nPropId); +} + +bool PropertyMap::empty() const +{ + return maProperties.empty(); +} + +void PropertyMap::assignUsed( const PropertyMap& rPropMap ) +{ + maProperties.insert(rPropMap.maProperties.begin(), rPropMap.maProperties.end()); +} + +const OUString& PropertyMap::getPropertyName( sal_Int32 nPropId ) +{ + OSL_ENSURE( (0 <= nPropId) && (nPropId < PROP_COUNT), "PropertyMap::getPropertyName - invalid property identifier" ); + return GetPropertyNameVector()[ nPropId ]; +} + +sal_Int32 PropertyMap::getPropertyId( std::u16string_view sPropName ) +{ + // This may use a std::map to get faster from String to ID in the + // future, inside the [0..PROP_COUNT[ entries. Since it is currently + // only used for Diagram re-creation I opted for less memory usage here + if(sPropName.empty()) + return -1; + + const std::vector& rVec(GetPropertyNameVector()); + for(size_t a(0); a < rVec.size(); a++) + if(rVec[a] == sPropName) + return a; + + return -1; +} + +void PropertyMap::assignAll( const PropertyMap& rPropMap ) +{ + for (auto const& prop : rPropMap.maProperties) + maProperties[prop.first] = prop.second; +} + +Sequence< PropertyValue > PropertyMap::makePropertyValueSequence() const +{ + Sequence< PropertyValue > aSeq( static_cast< sal_Int32 >( maProperties.size() ) ); + PropertyValue* pValues = aSeq.getArray(); + for (auto const& prop : maProperties) + { + OSL_ENSURE( (0 <= prop.first) && (prop.first < PROP_COUNT), "PropertyMap::makePropertyValueSequence - invalid property identifier" ); + pValues->Name = (*mpPropNames)[ prop.first ]; + pValues->Value = prop.second; + pValues->State = PropertyState_DIRECT_VALUE; + ++pValues; + } + return aSeq; +} + +void PropertyMap::fillSequences( Sequence< OUString >& rNames, Sequence< Any >& rValues ) const +{ + rNames.realloc( static_cast< sal_Int32 >( maProperties.size() ) ); + rValues.realloc( static_cast< sal_Int32 >( maProperties.size() ) ); + if( maProperties.empty() ) + return; + + OUString* pNames = rNames.getArray(); + Any* pValues = rValues.getArray(); + for (auto const& prop : maProperties) + { + OSL_ENSURE( (0 <= prop.first) && (prop.first < PROP_COUNT), "PropertyMap::fillSequences - invalid property identifier" ); + *pNames = (*mpPropNames)[ prop.first ]; + *pValues = prop.second; + ++pNames; + ++pValues; + } +} + +void PropertyMap::fillPropertyNameMap(PropertyNameMap& rMap) const +{ + for (auto const& prop : maProperties) + { + rMap.insert(std::pair((*mpPropNames)[prop.first], prop.second)); + } +} + +Reference< XPropertySet > PropertyMap::makePropertySet() const +{ + return new GenericPropertySet( *this ); +} + +#if OSL_DEBUG_LEVEL > 0 +static void lclDumpAnyValue( const Any& value) +{ + OUString strValue; + Sequence< OUString > strArray; + Sequence< Any > anyArray; + Sequence< PropertyValue > propArray; + Sequence< Sequence< PropertyValue > > propArrayArray; + Sequence< EnhancedCustomShapeAdjustmentValue > adjArray; + Sequence< EnhancedCustomShapeSegment > segArray; + Sequence< EnhancedCustomShapeParameterPair > ppArray; + EnhancedCustomShapeSegment segment; + EnhancedCustomShapeParameterPair pp; + EnhancedCustomShapeParameter par; + HomogenMatrix3 aMatrix; + sal_Int32 intValue = 0; + sal_uInt32 uintValue = 0; + sal_Int16 int16Value = 0; + sal_uInt16 uint16Value = 0; + float floatValue = 0; + bool boolValue = false; + LineSpacing spacing; +// RectanglePoint pointValue; + WritingMode aWritingMode; + TextVerticalAdjust aTextVertAdj; + TextHorizontalAdjust aTextHorizAdj; + Reference< XIndexReplace > xNumRule; + + if( value >>= strValue ) + fprintf (stderr,"\"%s\"\n", USS( strValue ) ); + else if( value >>= strArray ) { + fprintf (stderr,"%s\n", USS(value.getValueTypeName())); + for( int i=0; i>= propArray ) { + fprintf (stderr,"%s\n", USS(value.getValueTypeName())); + for( int i=0; i>= propArrayArray ) { + fprintf (stderr,"%s\n", USS(value.getValueTypeName())); + for( int i=0; i>= anyArray ) { + fprintf (stderr,"%s\n", USS(value.getValueTypeName())); + for( int i=0; i>= adjArray ) { + fprintf (stderr,"%s\n", USS(value.getValueTypeName())); + for( int i=0; i>= segArray ) { + fprintf (stderr,"%s\n", USS(value.getValueTypeName())); + for( int i=0; i>= ppArray ) { + fprintf (stderr,"%s\n", USS(value.getValueTypeName())); + for( int i=0; i>= segment ) { + fprintf (stderr,"Command: %d Count: %d\n", segment.Command, segment.Count); + } else if( value >>= pp ) { + fprintf (stderr,"First: "); + lclDumpAnyValue( Any (pp.First) ); + fprintf (stderr,"\t\t\t Second: "); + lclDumpAnyValue( Any (pp.Second) ); + } else if( value >>= par ) { + fprintf (stderr,"Parameter (%s): ", USS(par.Value.getValueTypeName())); + lclDumpAnyValue( par.Value ); + } else if( value >>= aMatrix ) { + fprintf (stderr,"Matrix\n%f %f %f\n%f %f %f\n%f %f %f\n", aMatrix.Line1.Column1, aMatrix.Line1.Column2, aMatrix.Line1.Column3, aMatrix.Line2.Column1, aMatrix.Line2.Column2, aMatrix.Line2.Column3, aMatrix.Line3.Column1, aMatrix.Line3.Column2, aMatrix.Line3.Column3); + } else if( value >>= intValue ) + fprintf (stderr,"%-10" SAL_PRIdINT32 " (hex: %" SAL_PRIxUINT32 ")\n", intValue, intValue); + else if( value >>= uintValue ) + fprintf (stderr,"%-10" SAL_PRIuUINT32 " (hex: %" SAL_PRIxUINT32 ")\n", uintValue, uintValue); + else if( value >>= int16Value ) + fprintf (stderr,"%-10d (hex: %x)\n", int16Value, int16Value); + else if( value >>= uint16Value ) + fprintf (stderr,"%-10d (hex: %x)\n", uint16Value, uint16Value); + else if( value >>= floatValue ) + fprintf (stderr,"%f\n", floatValue); + else if( value >>= boolValue ) + fprintf (stderr,"%-10d (bool)\n", boolValue); + else if( value >>= xNumRule ) { + fprintf (stderr, "XIndexReplace\n"); + if (xNumRule.is()) { + for (int k=0; kgetCount(); k++) { + Sequence< PropertyValue > aBulletPropSeq; + fprintf (stderr, "level %d\n", k); + if (xNumRule->getByIndex (k) >>= aBulletPropSeq) { + for (const PropertyValue& rProp : std::as_const(aBulletPropSeq)) { + fprintf(stderr, "%46s = ", USS (rProp.Name)); + lclDumpAnyValue (rProp.Value); + } + } + } + } else { + fprintf (stderr, "empty reference\n"); + } + } else if( value >>= aWritingMode ) + fprintf(stderr, "%d writing mode\n", static_cast(aWritingMode)); + else if( value >>= aTextVertAdj ) { + const char* s = "unknown"; + switch( aTextVertAdj ) { + case TextVerticalAdjust_TOP: + s = "top"; + break; + case TextVerticalAdjust_CENTER: + s = "center"; + break; + case TextVerticalAdjust_BOTTOM: + s = "bottom"; + break; + case TextVerticalAdjust_BLOCK: + s = "block"; + break; + case TextVerticalAdjust::TextVerticalAdjust_MAKE_FIXED_SIZE: + s = "make_fixed_size"; + break; + } + fprintf (stderr, "%s\n", s); + } else if( value >>= aTextHorizAdj ) { + const char* s = "unknown"; + switch( aTextHorizAdj ) { + case TextHorizontalAdjust_LEFT: + s = "left"; + break; + case TextHorizontalAdjust_CENTER: + s = "center"; + break; + case TextHorizontalAdjust_RIGHT: + s = "right"; + break; + case TextHorizontalAdjust_BLOCK: + s = "block"; + break; + case TextHorizontalAdjust::TextHorizontalAdjust_MAKE_FIXED_SIZE: + s = "make_fixed_size"; + break; + } + fprintf (stderr, "%s\n", s); + } else if( value >>= spacing ) { + fprintf (stderr, "mode: %d value: %d\n", spacing.Mode, spacing.Height); + } else if( value.isExtractableTo(::cppu::UnoType::get())) { + fprintf (stderr,"is extractable to int32\n"); + } +// else if( value >>= pointValue ) +// fprintf (stderr,"%d (RectanglePoint)\n", pointValue); + else + fprintf (stderr,"??? \n", USS(value.getValueTypeName())); +} + +#ifdef DBG_UTIL +void PropertyMap::dump( const Reference< XPropertySet >& rXPropSet ) +{ + Reference< XPropertySetInfo > info = rXPropSet->getPropertySetInfo (); + const Sequence< Property > props = info->getProperties (); + + SAL_INFO("oox", "dump props, len: " << props.getLength ()); + + for (Property const & prop : props) { + OString name = OUStringToOString( prop.Name, RTL_TEXTENCODING_UTF8); + fprintf (stderr,"%30s = ", name.getStr() ); + + try { + lclDumpAnyValue (rXPropSet->getPropertyValue( prop.Name )); + } catch (const Exception&) { + fprintf (stderr,"unable to get '%s' value\n", USS(prop.Name)); + } + } +} +#endif + +static void printLevel (int level) +{ + for (int i=0; i>= nFirstValue)) + assert (false); + if (!(pp.Second.Value >>= nSecondValue)) + assert (false); + + printLevel (level); + fprintf (stderr, "{\n"); + printLevel (level + 1); + fprintf (stderr, "%s,\n", lclGetEnhancedParameterType(pp.First.Type)); + printLevel (level + 1); + fprintf (stderr, "%s,\n", lclGetEnhancedParameterType(pp.Second.Type)); + printLevel (level + 1); + fprintf (stderr, "%d, %d\n", static_cast(nFirstValue), static_cast(nSecondValue)); + printLevel (level); + fprintf (stderr, "}"); +} + +static const char* lclDumpAnyValueCode( const Any& value, int level) +{ + OUString strValue; + Sequence< OUString > strArray; + Sequence< Any > anyArray; + Sequence< awt::Size > sizeArray; + Sequence< PropertyValue > propArray; + Sequence< Sequence< PropertyValue > > propArrayArray; + Sequence< EnhancedCustomShapeAdjustmentValue > adjArray; + Sequence< EnhancedCustomShapeTextFrame > segTextFrame; + Sequence< EnhancedCustomShapeSegment > segArray; + Sequence< EnhancedCustomShapeParameterPair > ppArray; + EnhancedCustomShapeSegment segment; + EnhancedCustomShapeTextFrame textFrame; + EnhancedCustomShapeParameterPair pp; + EnhancedCustomShapeParameter par; + awt::Rectangle rect; + awt::Size size; + sal_Int32 intValue; + sal_uInt32 uintValue; + sal_Int16 int16Value; + sal_uInt16 uint16Value; + sal_Int64 int64Value; + float floatValue = 0; + bool boolValue; + LineSpacing spacing; +// RectanglePoint pointValue; + WritingMode aWritingMode; + TextVerticalAdjust aTextVertAdj; + TextHorizontalAdjust aTextHorizAdj; + Reference< XIndexReplace > xNumRule; + + if( value >>= strValue ) + { + printLevel (level); + fprintf (stderr,"OUString str = \"%s\";\n", USS( strValue ) ); + return "Any (str)"; + } + else if( value >>= strArray ) + { + if (strArray.getLength() == 0) + return "Sequence< OUString >(0)"; + + printLevel (level); + fprintf (stderr,"static const char *aStrings[] = {\n"); + for( int i=0; i>= propArray ) + { + printLevel (level); + fprintf (stderr,"Sequence< PropertyValue > aPropSequence (%" SAL_PRIdINT32 ");\n", propArray.getLength()); + for( int i=0; i>= sizeArray ) + { + printLevel (level); + fprintf (stderr, "Sequence< awt::Size > aSizeSequence (%" SAL_PRIdINT32 ");\n", sizeArray.getLength()); + for( int i=0; i>= propArrayArray ) + { + printLevel (level); + fprintf (stderr,"Sequence< Sequence < PropertyValue > > aPropSequenceSequence (%" SAL_PRIdINT32 ");\n", propArrayArray.getLength()); + for( int i=0; i>= anyArray ) + { + fprintf (stderr,"%s\n", USS(value.getValueTypeName())); + for( int i=0; i>= adjArray ) + { + printLevel (level); + fprintf (stderr,"Sequence< EnhancedCustomShapeAdjustmentValue > aAdjSequence (%" SAL_PRIdINT32 ");\n", adjArray.getLength()); + for( int i=0; i 0) { + printLevel (level + 1); + fprintf (stderr, "aAdjSequence [%d].Name = \"%s\";\n", i, USS (adjArray[i].Name)); + } + printLevel (level); + fprintf (stderr, "}\n"); + } + return "aAdjSequence"; + } + else if( value >>= segArray ) + { + if (segArray.getLength() == 0) + return "Sequence< EnhancedCustomShapeSegment >(0)"; + + printLevel (level); + fprintf (stderr,"static const sal_uInt16 nValues[] = {\n"); + printLevel (level); + fprintf (stderr,"// Command, Count\n"); + for( int i = 0; i < segArray.getLength(); i++ ) { + printLevel (level + 1); + fprintf (stderr,"%d,%d%s\n", segArray[i].Command, + segArray[i].Count, i < segArray.getLength() - 1 ? "," : ""); + } + printLevel (level); + fprintf (stderr,"};\n"); + return "createSegmentSequence( SAL_N_ELEMENTS( nValues ), nValues )"; + } + else if( value >>= segTextFrame ) + { + printLevel (level); + fprintf (stderr, "Sequence< EnhancedCustomShapeTextFrame > aTextFrameSeq (%" SAL_PRIdINT32 ");\n", segTextFrame.getLength()); + for( int i=0; i>= ppArray ) + { + printLevel (level); + if (ppArray.getLength() == 0) + return "Sequence< EnhancedCustomShapeParameterPair >(0)"; + + fprintf (stderr, "static const CustomShapeProvider::ParameterPairData aData[] = {\n"); + for( int i = 0; i < ppArray.getLength(); i++ ) { + printParameterPairData(level + 1, ppArray[i]); + fprintf (stderr,"%s\n", i < ppArray.getLength() - 1 ? "," : ""); + } + printLevel (level); + fprintf (stderr,"};\n"); + + return "createParameterPairSequence(SAL_N_ELEMENTS(aData), aData)"; + } + else if( value >>= segment ) + { + printLevel (level); + fprintf (stderr, "EnhancedCustomShapeSegment aSegment;\n"); + printLevel (level); + // TODO: use EnhancedCustomShapeSegmentCommand constants + fprintf (stderr, "aSegment.Command = %d;\n", segment.Command); + printLevel (level); + fprintf (stderr, "aSegment.Count = %d;\n", segment.Count); + return "aSegment"; + } + else if( value >>= textFrame ) + { + printLevel (level); + fprintf (stderr, "EnhancedCustomShapeTextFrame aTextFrame;\n"); + printLevel (level); + fprintf (stderr, "{\n"); + { + const char* var = lclDumpAnyValueCode( Any (textFrame.TopLeft), level + 1 ); + printLevel (level + 1); + fprintf (stderr, "aTextFrame.TopLeft = %s;\n", var); + } + printLevel (level); + fprintf (stderr, "}\n"); + + printLevel (level); + fprintf (stderr, "{\n"); + { + const char* var = lclDumpAnyValueCode( Any (textFrame.BottomRight), level + 1 ); + printLevel (level + 1); + fprintf (stderr, "aTextFrame.BottomRight = %s;\n", var); + } + printLevel (level); + fprintf (stderr, "}\n"); + + return "aTextFrame"; + } + else if( value >>= pp ) + { + printLevel (level); + fprintf (stderr, "static const CustomShapeProvider::ParameterPairData aData =\n"); + printParameterPairData(level, pp); + fprintf (stderr, ";\n"); + + return "createParameterPair(&aData)"; + } + else if( value >>= par ) + { + printLevel (level); + fprintf (stderr,"EnhancedCustomShapeParameter aParameter;\n"); + const char* var = lclDumpAnyValueCode( par.Value, level ); + printLevel (level); + fprintf (stderr,"aParameter.Value = %s;\n", var); + printLevel (level); + fprintf (stderr,"aParameter.Type = %s;\n", + lclGetEnhancedParameterType(par.Type)); + return "aParameter"; + } + else if( value >>= int64Value ) + { + printLevel (level); + fprintf (stderr,"Any aAny ((sal_Int64) %" SAL_PRIdINT64 ");\n", int64Value); + return "aAny"; + } + else if( value >>= intValue ) + fprintf (stderr,"%" SAL_PRIdINT32 " (hex: %" SAL_PRIxUINT32 ")\n", intValue, intValue); + else if( value >>= uintValue ) + fprintf (stderr,"%" SAL_PRIdINT32 " (hex: %" SAL_PRIxUINT32 ")\n", uintValue, uintValue); + else if( value >>= int16Value ) + fprintf (stderr,"%d (hex: %x)\n", int16Value, int16Value); + else if( value >>= uint16Value ) + fprintf (stderr,"%d (hex: %x)\n", uint16Value, uint16Value); + else if( value >>= floatValue ) + fprintf (stderr,"%f\n", floatValue); + else if( value >>= boolValue ) { + if (boolValue) + return "(sal_Bool) sal_True"; + else + return "(sal_Bool) sal_False"; + } + else if( value >>= xNumRule ) { + fprintf (stderr, "XIndexReplace\n"); + for (int k=0; kgetCount(); k++) { + Sequence< PropertyValue > aBulletPropSeq; + fprintf (stderr, "level %d\n", k); + if (xNumRule->getByIndex (k) >>= aBulletPropSeq) { + for (const PropertyValue& rProp : std::as_const(aBulletPropSeq)) { + fprintf(stderr, "%46s = ", USS (rProp.Name)); + lclDumpAnyValue (rProp.Value); + } + } + } + } + else if( value >>= aWritingMode ) + fprintf (stderr, "%d writing mode\n", static_cast(aWritingMode)); + else if( value >>= aTextVertAdj ) { + const char* s = "unknown"; + switch( aTextVertAdj ) { + case TextVerticalAdjust_TOP: + s = "top"; + break; + case TextVerticalAdjust_CENTER: + s = "center"; + break; + case TextVerticalAdjust_BOTTOM: + s = "bottom"; + break; + case TextVerticalAdjust_BLOCK: + s = "block"; + break; + case TextVerticalAdjust::TextVerticalAdjust_MAKE_FIXED_SIZE: + s = "make_fixed_size"; + break; + } + fprintf (stderr, "%s\n", s); + } + else if( value >>= aTextHorizAdj ) { + const char* s = "unknown"; + switch( aTextHorizAdj ) { + case TextHorizontalAdjust_LEFT: + s = "left"; + break; + case TextHorizontalAdjust_CENTER: + s = "center"; + break; + case TextHorizontalAdjust_RIGHT: + s = "right"; + break; + case TextHorizontalAdjust_BLOCK: + s = "block"; + break; + case TextHorizontalAdjust::TextHorizontalAdjust_MAKE_FIXED_SIZE: + s = "make_fixed_size"; + break; + } + fprintf (stderr, "%s\n", s); + } + else if( value >>= spacing ) { + fprintf (stderr, "mode: %d value: %d\n", spacing.Mode, spacing.Height); + } + else if( value >>= rect ) { + printLevel (level); + fprintf (stderr, "awt::Rectangle aRectangle;\n"); + printLevel (level); + fprintf (stderr, "aRectangle.X = %" SAL_PRIdINT32 ";\n", rect.X); + printLevel (level); + fprintf (stderr, "aRectangle.Y = %" SAL_PRIdINT32 ";\n", rect.Y); + printLevel (level); + fprintf (stderr, "aRectangle.Width = %" SAL_PRIdINT32 ";\n", rect.Width); + printLevel (level); + fprintf (stderr, "aRectangle.Height = %" SAL_PRIdINT32 ";\n", rect.Height); + return "aRectangle"; + } + else if( value >>= size ) { + printLevel (level); + fprintf (stderr, "awt::Size aSize;\n"); + printLevel (level); + fprintf (stderr, "aSize.Width = %" SAL_PRIdINT32 ";\n", size.Width); + printLevel (level); + fprintf (stderr, "aSize.Height = %" SAL_PRIdINT32 ";\n", size.Height); + return "aSize"; + } + else if( value.isExtractableTo(::cppu::UnoType::get())) { + fprintf (stderr,"is extractable to int32\n"); + } + else + fprintf (stderr,"??? \n", USS(value.getValueTypeName())); + + return ""; +} + +void PropertyMap::dumpCode( const Reference< XPropertySet >& rXPropSet ) +{ + Reference< XPropertySetInfo > info = rXPropSet->getPropertySetInfo (); + const Sequence< Property > props = info->getProperties (); + static const OUStringLiteral sType = u"Type"; + + for (const Property& rProp : props) { + + // ignore Type, it is set elsewhere + if (rProp.Name == sType) + continue; + + OString name = OUStringToOString( rProp.Name, RTL_TEXTENCODING_UTF8); + + try { + int level = 1; + printLevel (level); + fprintf (stderr, "{\n"); + const char* var = lclDumpAnyValueCode (rXPropSet->getPropertyValue (rProp.Name), level + 1); + printLevel (level + 1); + fprintf (stderr,"aPropertyMap.setProperty(PROP_%s, %s);\n", name.getStr(), var); + printLevel (level); + fprintf (stderr, "}\n"); + } catch (const Exception&) { + fprintf (stderr,"unable to get '%s' value\n", USS(rProp.Name)); + } + } +} + +void PropertyMap::dumpData(const Reference& xPropertySet) +{ + Reference xPropertySetInfo = xPropertySet->getPropertySetInfo(); + const Sequence aProperties = xPropertySetInfo->getProperties(); + + for (const Property& rProp : aProperties) + { + std::cerr << rProp.Name << std::endl; + std::cerr << comphelper::anyToString(xPropertySet->getPropertyValue(rProp.Name)) << std::endl; + } +} + +#endif + +} // namespace oox + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/helper/propertyset.cxx b/oox/source/helper/propertyset.cxx new file mode 100644 index 000000000..98151d5fb --- /dev/null +++ b/oox/source/helper/propertyset.cxx @@ -0,0 +1,150 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include + +#include +#include +#include +#include +#include +#include + +namespace oox { + +using namespace ::com::sun::star::beans; +using namespace ::com::sun::star::uno; + +void PropertySet::set( const Reference< XPropertySet >& rxPropSet ) +{ + mxPropSet = rxPropSet; + mxMultiPropSet.set( mxPropSet, UNO_QUERY ); + if( mxPropSet.is() ) try + { + mxPropSetInfo = mxPropSet->getPropertySetInfo(); + } + catch( Exception& ) + { + } +} + +bool PropertySet::hasProperty( sal_Int32 nPropId ) const +{ + if( mxPropSetInfo.is() ) try + { + const OUString& rPropName = PropertyMap::getPropertyName( nPropId ); + return mxPropSetInfo->hasPropertyByName( rPropName ); + } + catch( Exception& ) + { + } + return false; +} + +// Get properties ------------------------------------------------------------- + +Any PropertySet::getAnyProperty( sal_Int32 nPropId ) const +{ + Any aValue; + return implGetPropertyValue( aValue, PropertyMap::getPropertyName( nPropId ) ) ? aValue : Any(); +} + +// Set properties ------------------------------------------------------------- + +bool PropertySet::setAnyProperty( sal_Int32 nPropId, const Any& rValue ) +{ + return implSetPropertyValue( PropertyMap::getPropertyName( nPropId ), rValue ); +} + +void PropertySet::setProperties( const Sequence< OUString >& rPropNames, const Sequence< Any >& rValues ) +{ + OSL_ENSURE( rPropNames.getLength() == rValues.getLength(), + "PropertySet::setProperties - length of sequences different" ); + + if( mxMultiPropSet.is() ) try + { + mxMultiPropSet->setPropertyValues( rPropNames, rValues ); + return; + } + catch( Exception& ) + { + SAL_WARN( "oox", "PropertySet::setProperties - cannot set all property values, fallback to single mode" ); + } + + if( mxPropSet.is() ) + { + const Any* pValue = rValues.getConstArray(); + for( const OUString& rPropName : rPropNames ) + implSetPropertyValue( rPropName, *pValue++ ); + } +} + +void PropertySet::setProperties( const PropertyMap& rPropertyMap ) +{ + if( !rPropertyMap.empty() ) + { + Sequence< OUString > aPropNames; + Sequence< Any > aValues; + rPropertyMap.fillSequences( aPropNames, aValues ); + setProperties( aPropNames, aValues ); + } +} + +// private -------------------------------------------------------------------- + +bool PropertySet::implGetPropertyValue( Any& orValue, const OUString& rPropName ) const +{ + if( mxPropSet.is() ) try + { + orValue = mxPropSet->getPropertyValue( rPropName ); + return true; + } + catch( const Exception&) + { + TOOLS_WARN_EXCEPTION( "oox", "PropertySet::implGetPropertyValue - cannot get property \"" << + rPropName << "\""); + } + return false; +} + +bool PropertySet::implSetPropertyValue( const OUString& rPropName, const Any& rValue ) +{ + if( mxPropSet.is() ) try + { + mxPropSet->setPropertyValue( rPropName, rValue ); + return true; + } + catch( const Exception&) + { + TOOLS_WARN_EXCEPTION( "oox", "PropertySet::implSetPropertyValue - cannot set property \"" << + rPropName << "\""); + } + return false; +} + +#ifdef DBG_UTIL +void PropertySet::dump() +{ + PropertyMap::dump( mxPropSet ); +} +#endif + +} // namespace oox + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/helper/storagebase.cxx b/oox/source/helper/storagebase.cxx new file mode 100644 index 000000000..50e7562dc --- /dev/null +++ b/oox/source/helper/storagebase.cxx @@ -0,0 +1,255 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include + +#include +#include +#include +#include +#include + +namespace oox { + +using namespace ::com::sun::star::embed; +using namespace ::com::sun::star::io; +using namespace ::com::sun::star::uno; + +namespace { + +void lclSplitFirstElement( OUString& orElement, OUString& orRemainder, const OUString& _aFullName ) +{ + OUString aFullName = _aFullName; + sal_Int32 nSlashPos = aFullName.indexOf( '/' ); + + // strip leading slashes + while( nSlashPos == 0 ) + { + aFullName = aFullName.copy(1); + nSlashPos = aFullName.indexOf( '/' ); + } + + if( (0 <= nSlashPos) && (nSlashPos < aFullName.getLength()) ) + { + orElement = aFullName.copy( 0, nSlashPos ); + orRemainder = aFullName.copy( nSlashPos + 1 ); + } + else + { + orElement = aFullName; + } +} + +} // namespace + +StorageBase::StorageBase( const Reference< XInputStream >& rxInStream, bool bBaseStreamAccess ) : + mxInStream( rxInStream ), + mbBaseStreamAccess( bBaseStreamAccess ), + mbReadOnly( true ) +{ + OSL_ENSURE( mxInStream.is(), "StorageBase::StorageBase - missing base input stream" ); +} + +StorageBase::StorageBase( const Reference< XStream >& rxOutStream, bool bBaseStreamAccess ) : + mxOutStream( rxOutStream ), + mbBaseStreamAccess( bBaseStreamAccess ), + mbReadOnly( false ) +{ + OSL_ENSURE( mxOutStream.is(), "StorageBase::StorageBase - missing base output stream" ); +} + +StorageBase::StorageBase( const StorageBase& rParentStorage, const OUString& rStorageName, bool bReadOnly ) : + maParentPath( rParentStorage.getPath() ), + maStorageName( rStorageName ), + mbBaseStreamAccess( false ), + mbReadOnly( bReadOnly ) +{ +} + +StorageBase::~StorageBase() +{ +} + +bool StorageBase::isStorage() const +{ + return implIsStorage(); +} + +bool StorageBase::isRootStorage() const +{ + return implIsStorage() && maStorageName.isEmpty(); +} + +Reference< XStorage > StorageBase::getXStorage() const +{ + return implGetXStorage(); +} + +OUString StorageBase::getPath() const +{ + OUStringBuffer aBuffer( maParentPath ); + if( !aBuffer.isEmpty() ) + aBuffer.append( '/' ); + aBuffer.append( maStorageName ); + return aBuffer.makeStringAndClear(); +} + +void StorageBase::getElementNames( ::std::vector< OUString >& orElementNames ) const +{ + orElementNames.clear(); + implGetElementNames( orElementNames ); +} + +StorageRef StorageBase::openSubStorage( const OUString& rStorageName, bool bCreateMissing ) +{ + StorageRef xSubStorage; + OSL_ENSURE( !bCreateMissing || !mbReadOnly, "StorageBase::openSubStorage - cannot create substorage in read-only mode" ); + if( !bCreateMissing || !mbReadOnly ) + { + OUString aElement, aRemainder; + lclSplitFirstElement( aElement, aRemainder, rStorageName ); + if( !aElement.isEmpty() ) + xSubStorage = getSubStorage( aElement, bCreateMissing ); + if( xSubStorage && !aRemainder.isEmpty() ) + xSubStorage = xSubStorage->openSubStorage( aRemainder, bCreateMissing ); + } + return xSubStorage; +} + +Reference< XInputStream > StorageBase::openInputStream( const OUString& rStreamName ) +{ + Reference< XInputStream > xInStream; + OUString aElement, aRemainder; + lclSplitFirstElement( aElement, aRemainder, rStreamName ); + if( !aElement.isEmpty() ) + { + if( !aRemainder.isEmpty() ) + { + StorageRef xSubStorage = getSubStorage( aElement, false ); + if( xSubStorage ) + xInStream = xSubStorage->openInputStream( aRemainder ); + } + else + { + xInStream = implOpenInputStream( aElement ); + } + } + else if( mbBaseStreamAccess ) + { + xInStream = mxInStream; + } + return xInStream; +} + +Reference< XOutputStream > StorageBase::openOutputStream( const OUString& rStreamName ) +{ + Reference< XOutputStream > xOutStream; + OSL_ENSURE( !mbReadOnly, "StorageBase::openOutputStream - cannot create output stream in read-only mode" ); + if( !mbReadOnly ) + { + OUString aElement, aRemainder; + lclSplitFirstElement( aElement, aRemainder, rStreamName ); + if( !aElement.isEmpty() ) + { + if( !aRemainder.isEmpty() ) + { + StorageRef xSubStorage = getSubStorage( aElement, true ); + if( xSubStorage ) + xOutStream = xSubStorage->openOutputStream( aRemainder ); + } + else + { + xOutStream = implOpenOutputStream( aElement ); + } + } + else if( mbBaseStreamAccess ) + { + xOutStream = mxOutStream->getOutputStream(); + } + } + return xOutStream; +} + +void StorageBase::copyToStorage( StorageBase& rDestStrg, const OUString& rElementName ) +{ + OSL_ENSURE( rDestStrg.isStorage() && !rDestStrg.isReadOnly(), "StorageBase::copyToStorage - invalid destination" ); + OSL_ENSURE( !rElementName.isEmpty(), "StorageBase::copyToStorage - invalid element name" ); + if( !rDestStrg.isStorage() || rDestStrg.isReadOnly() || rElementName.isEmpty() ) + return; + + StorageRef xSubStrg = openSubStorage( rElementName, false ); + if( xSubStrg ) + { + StorageRef xDestSubStrg = rDestStrg.openSubStorage( rElementName, true ); + if( xDestSubStrg ) + xSubStrg->copyStorageToStorage( *xDestSubStrg ); + } + else + { + Reference< XInputStream > xInStrm = openInputStream( rElementName ); + if( xInStrm.is() ) + { + Reference< XOutputStream > xOutStrm = rDestStrg.openOutputStream( rElementName ); + if( xOutStrm.is() ) + { + BinaryXInputStream aInStrm( xInStrm, true ); + BinaryXOutputStream aOutStrm( xOutStrm, true ); + aInStrm.copyToStream( aOutStrm ); + } + } + } +} + +void StorageBase::copyStorageToStorage( StorageBase& rDestStrg ) +{ + OSL_ENSURE( rDestStrg.isStorage() && !rDestStrg.isReadOnly(), "StorageBase::copyToStorage - invalid destination" ); + if( rDestStrg.isStorage() && !rDestStrg.isReadOnly() ) + { + ::std::vector< OUString > aElements; + getElementNames( aElements ); + for (auto const& elem : aElements) + copyToStorage(rDestStrg, elem); + } +} + +void StorageBase::commit() +{ + OSL_ENSURE( !mbReadOnly, "StorageBase::commit - cannot commit in read-only mode" ); + if( !mbReadOnly ) + { + // commit all open substorages + maSubStorages.forEachMem( &StorageBase::commit ); + // commit this storage + implCommit(); + } +} + +// private -------------------------------------------------------------------- + +StorageRef StorageBase::getSubStorage( const OUString& rElementName, bool bCreateMissing ) +{ + StorageRef& rxSubStrg = maSubStorages[ rElementName ]; + if( !rxSubStrg ) + rxSubStrg = implOpenSubStorage( rElementName, bCreateMissing ); + return rxSubStrg; +} + +} // namespace oox + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/helper/textinputstream.cxx b/oox/source/helper/textinputstream.cxx new file mode 100644 index 000000000..a48860c35 --- /dev/null +++ b/oox/source/helper/textinputstream.cxx @@ -0,0 +1,208 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include + +#include +#include +#include +#include +#include +#include + +namespace oox { + +using namespace ::com::sun::star::io; +using namespace ::com::sun::star::lang; +using namespace ::com::sun::star::uno; + +namespace { + +/** Implementation of a UNO input stream wrapping a binary input stream. + */ +class UnoBinaryInputStream : public ::cppu::WeakImplHelper< XInputStream > +{ +public: + explicit UnoBinaryInputStream( BinaryInputStream& rInStrm ); + + virtual sal_Int32 SAL_CALL readBytes( Sequence< sal_Int8 >& rData, sal_Int32 nBytesToRead ) override; + virtual sal_Int32 SAL_CALL readSomeBytes( Sequence< sal_Int8 >& rData, sal_Int32 nMaxBytesToRead ) override; + virtual void SAL_CALL skipBytes( sal_Int32 nBytesToSkip ) override; + virtual sal_Int32 SAL_CALL available() override; + virtual void SAL_CALL closeInput() override; + +private: + /// @throws NotConnectedException + void ensureConnected() const; + +private: + BinaryInputStream* mpInStrm; +}; + +UnoBinaryInputStream::UnoBinaryInputStream( BinaryInputStream& rInStrm ) : + mpInStrm( &rInStrm ) +{ +} + +sal_Int32 SAL_CALL UnoBinaryInputStream::readBytes( Sequence< sal_Int8 >& rData, sal_Int32 nBytesToRead ) +{ + ensureConnected(); + return mpInStrm->readData( rData, nBytesToRead ); +} + +sal_Int32 SAL_CALL UnoBinaryInputStream::readSomeBytes( Sequence< sal_Int8 >& rData, sal_Int32 nMaxBytesToRead ) +{ + ensureConnected(); + return mpInStrm->readData( rData, nMaxBytesToRead ); +} + +void SAL_CALL UnoBinaryInputStream::skipBytes( sal_Int32 nBytesToSkip ) +{ + ensureConnected(); + mpInStrm->skip( nBytesToSkip ); +} + +sal_Int32 SAL_CALL UnoBinaryInputStream::available() +{ + ensureConnected(); + throw RuntimeException( "Functionality not supported", Reference< XInputStream >() ); +} + +void SAL_CALL UnoBinaryInputStream::closeInput() +{ + ensureConnected(); + mpInStrm->close(); + mpInStrm = nullptr; +} + +void UnoBinaryInputStream::ensureConnected() const +{ + if( !mpInStrm ) + throw NotConnectedException( "Stream closed" ); +} + +} // namespace + +TextInputStream::TextInputStream( const Reference< XComponentContext >& rxContext, const Reference< XInputStream >& rxInStrm, rtl_TextEncoding eTextEnc ) +{ + init( rxContext, rxInStrm, eTextEnc ); +} + +TextInputStream::TextInputStream( const Reference< XComponentContext >& rxContext, BinaryInputStream& rInStrm, rtl_TextEncoding eTextEnc ) +{ + init( rxContext, new UnoBinaryInputStream( rInStrm ), eTextEnc ); +} + +TextInputStream::~TextInputStream() +{ +} + +bool TextInputStream::isEof() const +{ + if( mxTextStrm.is() ) try + { + return mxTextStrm->isEOF(); + } + catch (const Exception&) + { + } + return true; +} + +OUString TextInputStream::readLine() +{ + if( mxTextStrm.is() ) try + { + /* The function createFinalString() adds a character that may have + been buffered in the previous call of readToChar() (see below). */ + return createFinalString( mxTextStrm->readLine() ); + } + catch (const Exception&) + { + mxTextStrm.clear(); + } + return OUString(); +} + +OUString TextInputStream::readToChar( sal_Unicode cChar, bool bIncludeChar ) +{ + if( mxTextStrm.is() ) try + { + Sequence< sal_Unicode > aDelimiters{ cChar }; + /* Always get the delimiter character from the UNO text input stream. + In difference to this implementation, it will not return it in the + next call but silently skip it. If caller specifies to exclude the + character in this call, it will be returned in the next call of one + of the own member functions. The function createFinalString() adds + a character that has been buffered in the previous call. */ + OUString aString = createFinalString( mxTextStrm->readString( aDelimiters, false ) ); + // remove last character from string and remember it for next call + if( !bIncludeChar && !aString.isEmpty() && (aString[ aString.getLength() - 1 ] == cChar) ) + { + mcPendingChar = cChar; + aString = aString.copy( 0, aString.getLength() - 1 ); + } + return aString; + } + catch (const Exception&) + { + mxTextStrm.clear(); + } + return OUString(); +} + +Reference< XTextInputStream2 > TextInputStream::createXTextInputStream( + const Reference< XComponentContext >& rxContext, const Reference< XInputStream >& rxInStrm, rtl_TextEncoding eTextEnc ) +{ + Reference< XTextInputStream2 > xTextStrm; + const char* pcCharset = rtl_getBestMimeCharsetFromTextEncoding( eTextEnc ); + OSL_ENSURE( pcCharset, "TextInputStream::createXTextInputStream - unsupported text encoding" ); + if( rxContext.is() && rxInStrm.is() && pcCharset ) try + { + xTextStrm = css::io::TextInputStream::create( rxContext ); + xTextStrm->setInputStream( rxInStrm ); + xTextStrm->setEncoding( OUString::createFromAscii( pcCharset ) ); + } + catch (const Exception&) + { + } + return xTextStrm; +} + +// private -------------------------------------------------------------------- + +OUString TextInputStream::createFinalString( const OUString& rString ) +{ + if( mcPendingChar == 0 ) + return rString; + + OUString aString = OUStringChar( mcPendingChar ) + rString; + mcPendingChar = 0; + return aString; +} + +void TextInputStream::init( const Reference< XComponentContext >& rxContext, const Reference< XInputStream >& rxInStrm, rtl_TextEncoding eTextEnc ) +{ + mcPendingChar = 0; + mxTextStrm = createXTextInputStream( rxContext, rxInStrm, eTextEnc ); +} + +} // namespace oox + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/helper/zipstorage.cxx b/oox/source/helper/zipstorage.cxx new file mode 100644 index 000000000..d11d145bb --- /dev/null +++ b/oox/source/helper/zipstorage.cxx @@ -0,0 +1,203 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace oox { + +using namespace ::com::sun::star::container; +using namespace ::com::sun::star::embed; +using namespace ::com::sun::star::io; +using namespace ::com::sun::star::lang; +using namespace ::com::sun::star::uno; + +ZipStorage::ZipStorage( const Reference< XComponentContext >& rxContext, const Reference< XInputStream >& rxInStream ) : + StorageBase( rxInStream, false ) +{ + OSL_ENSURE( rxContext.is(), "ZipStorage::ZipStorage - missing component context" ); + // create base storage object + if( !rxContext.is() ) + return; + + try + { + /* #i105325# ::comphelper::OStorageHelper::GetStorageFromInputStream() + cannot be used here as it will open a storage with format type + 'PackageFormat' that will not work with OOXML packages. + + #161971# The MS-document storages should always be opened in repair + mode to ignore the format errors and get so much info as possible. + I hate this solution, but it seems to be the only consistent way to + handle the MS documents. + + TODO: #i105410# switch to 'OFOPXMLFormat' and use its + implementation of relations handling. + */ + mxStorage = ::comphelper::OStorageHelper::GetStorageOfFormatFromInputStream( + ZIP_STORAGE_FORMAT_STRING, rxInStream, rxContext, false); + } + catch (Exception const&) + { + TOOLS_WARN_EXCEPTION("oox.storage", "ZipStorage::ZipStorage exception opening input storage"); + } +} + +ZipStorage::ZipStorage( const Reference< XComponentContext >& rxContext, const Reference< XStream >& rxStream ) : + StorageBase( rxStream, false ) +{ + OSL_ENSURE( rxContext.is(), "ZipStorage::ZipStorage - missing component context" ); + // create base storage object + if( rxContext.is() ) try + { + const sal_Int32 nOpenMode = ElementModes::READWRITE | ElementModes::TRUNCATE; + mxStorage = ::comphelper::OStorageHelper::GetStorageOfFormatFromStream( + OFOPXML_STORAGE_FORMAT_STRING, rxStream, nOpenMode, rxContext, true); + } + catch (Exception const&) + { + TOOLS_WARN_EXCEPTION("oox.storage", "ZipStorage::ZipStorage exception opening output storage"); + } +} + +ZipStorage::ZipStorage( const ZipStorage& rParentStorage, const Reference< XStorage >& rxStorage, const OUString& rElementName ) : + StorageBase( rParentStorage, rElementName, rParentStorage.isReadOnly() ), + mxStorage( rxStorage ) +{ + SAL_WARN_IF(!mxStorage.is(), "oox.storage", "ZipStorage::ZipStorage " + " - missing storage" ); +} + +ZipStorage::~ZipStorage() +{ +} + +bool ZipStorage::implIsStorage() const +{ + return mxStorage.is(); +} + +Reference< XStorage > ZipStorage::implGetXStorage() const +{ + return mxStorage; +} + +void ZipStorage::implGetElementNames( ::std::vector< OUString >& orElementNames ) const +{ + if( mxStorage.is() ) try + { + const Sequence aNames = mxStorage->getElementNames(); + if( aNames.hasElements() ) + orElementNames.insert( orElementNames.end(), aNames.begin(), aNames.end() ); + } + catch (Exception const&) + { + TOOLS_INFO_EXCEPTION("oox.storage", "getElementNames"); + } +} + +StorageRef ZipStorage::implOpenSubStorage( const OUString& rElementName, bool bCreateMissing ) +{ + Reference< XStorage > xSubXStorage; + bool bMissing = false; + if( mxStorage.is() ) try + { + // XStorage::isStorageElement may throw various exceptions... + if( mxStorage->isStorageElement( rElementName ) ) + xSubXStorage = mxStorage->openStorageElement( + rElementName, css::embed::ElementModes::READ ); + } + catch( NoSuchElementException& ) + { + bMissing = true; + } + catch (Exception const&) + { + TOOLS_INFO_EXCEPTION("oox.storage", "openStorageElement"); + } + + if( bMissing && bCreateMissing ) try + { + xSubXStorage = mxStorage->openStorageElement( + rElementName, css::embed::ElementModes::READWRITE ); + } + catch (Exception const&) + { + TOOLS_INFO_EXCEPTION("oox.storage", "openStorageElement"); + } + + StorageRef xSubStorage; + if( xSubXStorage.is() ) + xSubStorage.reset( new ZipStorage( *this, xSubXStorage, rElementName ) ); + return xSubStorage; +} + +Reference< XInputStream > ZipStorage::implOpenInputStream( const OUString& rElementName ) +{ + Reference< XInputStream > xInStream; + if( mxStorage.is() ) try + { + xInStream.set( mxStorage->openStreamElement( rElementName, css::embed::ElementModes::READ ), UNO_QUERY ); + } + catch (Exception const&) + { + TOOLS_INFO_EXCEPTION("oox.storage", "openStreamElement"); + } + return xInStream; +} + +Reference< XOutputStream > ZipStorage::implOpenOutputStream( const OUString& rElementName ) +{ + Reference< XOutputStream > xOutStream; + if( mxStorage.is() ) try + { + xOutStream.set( mxStorage->openStreamElement( rElementName, css::embed::ElementModes::READWRITE ), UNO_QUERY ); + } + catch (Exception const&) + { + TOOLS_INFO_EXCEPTION("oox.storage", "openStreamElement"); + } + return xOutStream; +} + +void ZipStorage::implCommit() const +{ + try + { + Reference< XTransactedObject >( mxStorage, UNO_QUERY_THROW )->commit(); + } + catch (Exception const&) + { + TOOLS_WARN_EXCEPTION("oox.storage", "commit"); + } +} + +} // namespace oox + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/mathml/export.cxx b/oox/source/mathml/export.cxx new file mode 100644 index 000000000..ceb40d0df --- /dev/null +++ b/oox/source/mathml/export.cxx @@ -0,0 +1,18 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#include + +namespace oox +{ +FormulaExportBase::FormulaExportBase() {} + +} // namespace + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/mathml/import.cxx b/oox/source/mathml/import.cxx new file mode 100644 index 000000000..bff603d2b --- /dev/null +++ b/oox/source/mathml/import.cxx @@ -0,0 +1,114 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#include + +#include +#include +#include + +#include + + +using namespace ::com::sun::star; + +namespace oox +{ + +FormulaImportBase::FormulaImportBase() +{ +} + +namespace formulaimport { + +namespace { + +class LazyMathBufferingContext : public core::ContextHandler +{ +private: + XmlStreamBuilder & m_rBuilder; + std::vector m_OpenElements; + +public: + LazyMathBufferingContext(core::ContextHandler const& rParent, + drawingml::TextParagraph & rPara); + + // com.sun.star.xml.sax.XFastContextHandler interface --------------------- + + virtual void SAL_CALL startFastElement(::sal_Int32 Element, const uno::Reference& xAttribs) override; + virtual void SAL_CALL endFastElement(::sal_Int32 Element) override; + virtual uno::Reference< xml::sax::XFastContextHandler> SAL_CALL createFastChildContext(::sal_Int32 Element, const uno::Reference& xAttribs) override; + virtual void SAL_CALL characters(const OUString& rChars) override; + +}; + +} + +LazyMathBufferingContext::LazyMathBufferingContext( + core::ContextHandler const& rParent, drawingml::TextParagraph & rPara) + : core::ContextHandler(rParent) + , m_rBuilder(rPara.GetMathXml()) +{ +} + +void SAL_CALL LazyMathBufferingContext::startFastElement( + sal_Int32 const nElement, + uno::Reference const& xAttrs) +{ + if (0 < m_OpenElements.size()) // ignore a14:m + { // ignore outer oMathPara + if (1 != m_OpenElements.size() || OOX_TOKEN(officeMath, oMathPara) != nElement) + { + m_rBuilder.appendOpeningTag(nElement, xAttrs); + } + } + m_OpenElements.push_back(nElement); +} + +void SAL_CALL LazyMathBufferingContext::endFastElement(sal_Int32 const nElement) +{ + m_OpenElements.pop_back(); + if (0 < m_OpenElements.size()) // ignore a14:m + { // ignore outer oMathPara + if (1 != m_OpenElements.size() || OOX_TOKEN(officeMath, oMathPara) != nElement) + { + m_rBuilder.appendClosingTag(nElement); + } + } +} + +uno::Reference SAL_CALL +LazyMathBufferingContext::createFastChildContext(sal_Int32 const, + uno::Reference const&) +{ + return this; +} + +void SAL_CALL LazyMathBufferingContext::characters(OUString const& rChars) +{ + if (0 < m_OpenElements.size()) // ignore a14:m + { + if (m_OpenElements.back() == OOX_TOKEN(officeMath, t)) + { + m_rBuilder.appendCharacters(rChars); + } + } +} + +} // namespace oox::formulaimport + +rtl::Reference CreateLazyMathBufferingContext( + core::ContextHandler const& rParent, drawingml::TextParagraph & rPara) +{ + return new formulaimport::LazyMathBufferingContext(rParent, rPara); +} + +} // namespace oox + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/mathml/importutils.cxx b/oox/source/mathml/importutils.cxx new file mode 100644 index 000000000..16f527389 --- /dev/null +++ b/oox/source/mathml/importutils.cxx @@ -0,0 +1,337 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#include + +#include + +#include +#include +#include +#include +#include +#include +#include + +#define OPENING( token ) XML_STREAM_OPENING( token ) +#define CLOSING( token ) XML_STREAM_CLOSING( token ) + +using namespace com::sun::star; + +namespace oox::formulaimport +{ + +namespace +{ +// a class that inherits from AttributeList, builds the internal data and then will be sliced off +// during conversion to the base class +class AttributeListBuilder + : public XmlStream::AttributeList +{ +public: + explicit AttributeListBuilder( const uno::Reference< xml::sax::XFastAttributeList >& a ); +}; + +AttributeListBuilder::AttributeListBuilder( const uno::Reference< xml::sax::XFastAttributeList >& a ) +{ + if( !a ) + return; + const uno::Sequence< xml::FastAttribute > aFastAttrSeq = a->getFastAttributes(); + for( const xml::FastAttribute& rFastAttr : aFastAttrSeq ) + { + attrs[ rFastAttr.Token ] = rFastAttr.Value; + } +} + +OString tokenToString( int token ) +{ + uno::Sequence< sal_Int8 > const & aTokenNameSeq = StaticTokenMap().getUtf8TokenName( token & TOKEN_MASK ); + OString tokenname( reinterpret_cast< const char* >( aTokenNameSeq.getConstArray() ), aTokenNameSeq.getLength() ); + if( tokenname.isEmpty()) + tokenname = "???"; + int nmsp = ( token & NMSP_MASK & ~( TAG_OPENING | TAG_CLOSING )); +#if 0 // this is awfully long + OString namespacename = StaticNamespaceMap::get().count( nmsp ) != 0 + ? StaticNamespaceMap::get()[ nmsp ] : OString( "???" ); +#else + OString namespacename; + // only few are needed actually + switch( nmsp ) + { + case NMSP_officeMath: + namespacename = "m"; + break; + case NMSP_doc: + namespacename = "w"; + break; + default: + namespacename = "?"; + break; + } +#endif + if( token == OPENING( token )) + return "<" + namespacename + ":" + tokenname + ">"; + if( token == CLOSING( token )) + return ""; + // just the name itself, not specified whether opening or closing + return namespacename + ":" + tokenname; +} + +} // namespace + +OUString& XmlStream::AttributeList::operator[] (int token) +{ + return attrs[token]; +} + +OUString XmlStream::AttributeList::attribute( int token, const OUString& def ) const +{ + std::map< int, OUString >::const_iterator find = attrs.find( token ); + if( find != attrs.end()) + return find->second; + return def; +} + +bool XmlStream::AttributeList::attribute( int token, bool def ) const +{ + std::map< int, OUString >::const_iterator find = attrs.find( token ); + if( find != attrs.end()) + { + const OUString sValue = find->second; + if( sValue.equalsIgnoreAsciiCase("true") || + sValue.equalsIgnoreAsciiCase("on") || + sValue.equalsIgnoreAsciiCase("t") || + sValue.equalsIgnoreAsciiCase("1") ) + return true; + if( sValue.equalsIgnoreAsciiCase("false") || + sValue.equalsIgnoreAsciiCase("off") || + sValue.equalsIgnoreAsciiCase("f") || + sValue.equalsIgnoreAsciiCase("0") ) + return false; + SAL_WARN( "oox.xmlstream", "Cannot convert \'" << sValue << "\' to bool." ); + } + return def; +} + +sal_Unicode XmlStream::AttributeList::attribute( int token, sal_Unicode def ) const +{ + std::map< int, OUString >::const_iterator find = attrs.find( token ); + if( find != attrs.end()) + { + if( !find->second.isEmpty() ) + { + if( find->second.getLength() != 1 ) + SAL_WARN( "oox.xmlstream", "Cannot convert \'" << find->second << "\' to sal_Unicode, stripping." ); + return find->second[ 0 ]; + } + } + return def; +} + +XmlStream::Tag::Tag( int t, const uno::Reference< xml::sax::XFastAttributeList >& a ) +: token( t ) +, attributes( AttributeListBuilder( a )) +{ +} + +XmlStream::Tag::Tag( int t, const AttributeList& a ) +: token( t ) +, attributes( a ) +{ +} + +XmlStream::Tag::operator bool() const +{ + return token != XML_TOKEN_INVALID; +} + +XmlStream::XmlStream() +: pos( 0 ) +{ + // make sure our extra bit does not conflict with values used by oox + assert( TAG_OPENING > ( 1024 << NMSP_SHIFT )); +} + +bool XmlStream::atEnd() const +{ + return pos >= tags.size(); +} + +XmlStream::Tag XmlStream::currentTag() const +{ + if( pos >= tags.size()) + return Tag(); + return tags[ pos ]; +} + +int XmlStream::currentToken() const +{ + if( pos >= tags.size()) + return XML_TOKEN_INVALID; + return tags[ pos ].token; +} + +void XmlStream::moveToNextTag() +{ + if( pos < tags.size()) + ++pos; +} + +XmlStream::Tag XmlStream::ensureOpeningTag( int token ) +{ + return checkTag( OPENING( token ), false ); +} + +XmlStream::Tag XmlStream::checkOpeningTag( int token ) +{ + return checkTag( OPENING( token ), true ); +} + +void XmlStream::ensureClosingTag( int token ) +{ + checkTag( CLOSING( token ), false ); +} + +XmlStream::Tag XmlStream::checkTag( int token, bool optional ) +{ + // either it's the following tag, or find it + int savedPos = pos; + if( optional ) + { // avoid printing debug messages about skipping tags if the optional one + // will not be found and the position will be reset back + if( currentToken() != token && !findTagInternal( token, true )) + { + pos = savedPos; + return Tag(); + } + } + if( currentToken() == token || findTag( token )) + { + Tag ret = currentTag(); + moveToNextTag(); + return ret; // ok + } + if( optional ) + { // not a problem, just rewind + pos = savedPos; + return Tag(); + } + SAL_WARN( "oox.xmlstream", "Expected tag " << tokenToString( token ) << " not found." ); + return Tag(); +} + +bool XmlStream::findTag( int token ) +{ + return findTagInternal( token, false ); +} + +bool XmlStream::findTagInternal( int token, bool silent ) +{ + int depth = 0; + for(; + !atEnd(); + moveToNextTag()) + { + if( depth > 0 ) // we're inside a nested element, skip those + { + if( currentToken() == OPENING( currentToken())) + { + if( !silent ) + SAL_INFO( "oox.xmlstream", "Skipping tag " << tokenToString( currentToken())); + ++depth; + } + else if( currentToken() == CLOSING( currentToken())) + { + if( !silent ) + SAL_INFO( "oox.xmlstream", "Skipping tag " << tokenToString( currentToken())); + --depth; + } + else + { + if( !silent ) + SAL_WARN( "oox.xmlstream", "Malformed token " << currentToken() << " (" + << tokenToString( currentToken()) << ")" ); + abort(); + } + continue; + } + if( currentToken() == token ) + return true; // ok, found + if( currentToken() == CLOSING( currentToken())) + return false; // that would be leaving current element, so not found + if( currentToken() == OPENING( currentToken())) + { + if( !silent ) + SAL_INFO( "oox.xmlstream", "Skipping tag " << tokenToString( currentToken())); + ++depth; + } + else + abort(); + } + if( !silent ) + SAL_WARN( "oox.xmlstream", "Unexpected end of stream reached." ); + return false; +} + +void XmlStream::skipElementInternal( int token, bool silent ) +{ + int closing = ( token & ~TAG_OPENING ) | TAG_CLOSING; // make it a closing tag + assert( currentToken() == OPENING( token )); + if( !silent ) + SAL_INFO( "oox.xmlstream", "Skipping unexpected element " << tokenToString( currentToken())); + moveToNextTag(); + // and just find the matching closing tag + if( findTag( closing )) + { + if( !silent ) + SAL_INFO( "oox.xmlstream", "Skipped unexpected element " << tokenToString( token )); + moveToNextTag(); // and skip it too + return; + } + // this one is an unexpected problem, do not silent it + SAL_WARN( "oox.xmlstream", "Expected end of element " << tokenToString( token ) << " not found." ); +} + +void XmlStream::handleUnexpectedTag() +{ + if( atEnd()) + return; + if( currentToken() == CLOSING( currentToken())) + { + SAL_INFO( "oox.xmlstream", "Skipping unexpected tag " << tokenToString( currentToken())); + moveToNextTag(); // just skip it + return; + } + skipElementInternal( currentToken(), false ); // otherwise skip the entire element +} + +void XmlStreamBuilder::appendOpeningTag( int token, const uno::Reference< xml::sax::XFastAttributeList >& attrs ) +{ + tags.emplace_back( OPENING( token ), attrs ); +} + +void XmlStreamBuilder::appendOpeningTag( int token, const AttributeList& attrs ) +{ + tags.emplace_back( OPENING( token ), attrs ); +} + +void XmlStreamBuilder::appendClosingTag( int token ) +{ + tags.emplace_back( CLOSING( token )); +} + +void XmlStreamBuilder::appendCharacters( std::u16string_view chars ) +{ + assert( !tags.empty()); + tags.back().text += chars; +} + +} // namespace + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/ole/axbinaryreader.cxx b/oox/source/ole/axbinaryreader.cxx new file mode 100644 index 000000000..6467e51bc --- /dev/null +++ b/oox/source/ole/axbinaryreader.cxx @@ -0,0 +1,291 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include + +#include +#include + +#include + +namespace oox::ole { + +namespace { + +const sal_uInt32 AX_STRING_SIZEMASK = 0x7FFFFFFF; +const sal_uInt32 AX_STRING_COMPRESSED = 0x80000000; + +} // namespace + +AxAlignedInputStream::AxAlignedInputStream( BinaryInputStream& rInStrm ) : + BinaryStreamBase( false ), + mpInStrm( &rInStrm ), + mnStrmPos( 0 ), + mnStrmSize( rInStrm.getRemaining() ) +{ + mbEof = mbEof || rInStrm.isEof(); +} + +sal_Int64 AxAlignedInputStream::size() const +{ + return mpInStrm ? mnStrmSize : -1; +} + +sal_Int64 AxAlignedInputStream::tell() const +{ + return mpInStrm ? mnStrmPos : -1; +} + +void AxAlignedInputStream::seek( sal_Int64 nPos ) +{ + mbEof = mbEof || (nPos < mnStrmPos); + if( !mbEof ) + skip( static_cast< sal_Int32 >( nPos - mnStrmPos ) ); +} + +void AxAlignedInputStream::close() +{ + mpInStrm = nullptr; + mbEof = true; +} + +sal_Int32 AxAlignedInputStream::readData( StreamDataSequence& orData, sal_Int32 nBytes, size_t nAtomSize ) +{ + sal_Int32 nReadSize = 0; + if( !mbEof ) + { + nReadSize = mpInStrm->readData( orData, nBytes, nAtomSize ); + mnStrmPos += nReadSize; + mbEof = mpInStrm->isEof(); + } + return nReadSize; +} + +sal_Int32 AxAlignedInputStream::readMemory( void* opMem, sal_Int32 nBytes, size_t nAtomSize ) +{ + sal_Int32 nReadSize = 0; + if( !mbEof ) + { + nReadSize = mpInStrm->readMemory( opMem, nBytes, nAtomSize ); + mnStrmPos += nReadSize; + mbEof = mpInStrm->isEof(); + } + return nReadSize; +} + +void AxAlignedInputStream::skip( sal_Int32 nBytes, size_t nAtomSize ) +{ + if( !mbEof ) + { + mpInStrm->skip( nBytes, nAtomSize ); + mnStrmPos += nBytes; + mbEof = mpInStrm->isEof(); + } +} + +void AxAlignedInputStream::align( size_t nSize ) +{ + skip( static_cast< sal_Int32 >( (nSize - (mnStrmPos % nSize)) % nSize ) ); +} + +namespace { + +bool lclReadString( AxAlignedInputStream& rInStrm, OUString& rValue, sal_uInt32 nSize, bool bArrayString ) +{ + bool bCompressed = getFlag( nSize, AX_STRING_COMPRESSED ); + sal_uInt32 nBufSize = nSize & AX_STRING_SIZEMASK; + // Unicode: simple strings store byte count, array strings store char count + sal_Int32 nChars = static_cast< sal_Int32 >( nBufSize / ((bCompressed || bArrayString) ? 1 : 2) ); + bool bValidChars = nChars <= 65536; + OSL_ENSURE( bValidChars, "lclReadString - string too long" ); + sal_Int64 nEndPos = rInStrm.tell() + nChars * (bCompressed ? 1 : 2); + nChars = ::std::min< sal_Int32 >( nChars, 65536 ); + rValue = rInStrm.readCompressedUnicodeArray( nChars, bCompressed ); + rInStrm.seek( nEndPos ); + return bValidChars; +} + +} // namespace + +AxBinaryPropertyReader::ComplexProperty::~ComplexProperty() +{ +} + +bool AxBinaryPropertyReader::PairProperty::readProperty( AxAlignedInputStream& rInStrm ) +{ + mrPairData.first = rInStrm.readInt32(); + mrPairData.second = rInStrm.readInt32(); + return true; +} + +bool AxBinaryPropertyReader::StringProperty::readProperty( AxAlignedInputStream& rInStrm ) +{ + return lclReadString( rInStrm, mrValue, mnSize, false ); +} + +bool AxBinaryPropertyReader::ArrayStringProperty::readProperty( AxAlignedInputStream& rInStrm ) +{ + sal_Int64 nEndPos = rInStrm.tell() + mnSize; + while( rInStrm.tell() < nEndPos ) + { + OUString aString; + if( !lclReadString( rInStrm, aString, rInStrm.readuInt32(), true ) ) + return false; + mrArray.push_back( aString ); + // every array string is aligned on 4 byte boundaries + rInStrm.align( 4 ); + } + return true; +} + +bool AxBinaryPropertyReader::GuidProperty::readProperty( AxAlignedInputStream& rInStrm ) +{ + mrGuid = OleHelper::importGuid( rInStrm ); + return true; +} + +bool AxBinaryPropertyReader::FontProperty::readProperty( AxAlignedInputStream& rInStrm ) +{ + return mrFontData.importGuidAndFont( rInStrm ); +} + +bool AxBinaryPropertyReader::PictureProperty::readProperty( AxAlignedInputStream& rInStrm ) +{ + return OleHelper::importStdPic( mrPicData, rInStrm ); +} + +AxBinaryPropertyReader::AxBinaryPropertyReader( BinaryInputStream& rInStrm, bool b64BitPropFlags ) : + maInStrm( rInStrm ), + mbValid( true ) +{ + // version and size of property block + maInStrm.skip( 2 ); + sal_uInt16 nBlockSize = maInStrm.readuInt16(); + mnPropsEnd = maInStrm.tell() + nBlockSize; + // flagfield containing existing properties + if( b64BitPropFlags ) + mnPropFlags = maInStrm.readInt64(); + else + mnPropFlags = maInStrm.readuInt32(); + mnNextProp = 1; +} + +void AxBinaryPropertyReader::readBoolProperty( bool& orbValue, bool bReverse ) +{ + // there is no data, the boolean value is equivalent to the property flag itself + orbValue = startNextProperty() != bReverse; +} + +void AxBinaryPropertyReader::readPairProperty( AxPairData& orPairData ) +{ + if( startNextProperty() ) + maLargeProps.push_back( ComplexPropVector::value_type( std::make_shared( orPairData ) ) ); +} + +void AxBinaryPropertyReader::readStringProperty( OUString& orValue ) +{ + if( startNextProperty() ) + { + sal_uInt32 nSize = maInStrm.readAligned< sal_uInt32 >(); + maLargeProps.push_back( ComplexPropVector::value_type( std::make_shared( orValue, nSize ) ) ); + } +} + +void AxBinaryPropertyReader::readArrayStringProperty( std::vector& orValue ) +{ + if( startNextProperty() ) + { + sal_uInt32 nSize = maInStrm.readAligned< sal_uInt32 >(); + maLargeProps.push_back( ComplexPropVector::value_type( std::make_shared( orValue, nSize ) ) ); + } +} + +void AxBinaryPropertyReader::readGuidProperty( OUString& orGuid ) +{ + if( startNextProperty() ) + maLargeProps.push_back( ComplexPropVector::value_type( std::make_shared( orGuid ) ) ); +} + +void AxBinaryPropertyReader::readFontProperty( AxFontData& orFontData ) +{ + if( startNextProperty() ) + { + sal_Int16 nData = maInStrm.readAligned< sal_Int16 >(); + if( ensureValid( nData == -1 ) ) + maStreamProps.push_back( ComplexPropVector::value_type( std::make_shared( orFontData ) ) ); + } +} + +void AxBinaryPropertyReader::readPictureProperty( StreamDataSequence& orPicData ) +{ + if( startNextProperty() ) + { + sal_Int16 nData = maInStrm.readAligned< sal_Int16 >(); + if( ensureValid( nData == -1 ) ) + maStreamProps.push_back( ComplexPropVector::value_type( std::make_shared( orPicData ) ) ); + } +} + +bool AxBinaryPropertyReader::finalizeImport() +{ + // read large properties + maInStrm.align( 4 ); + if( ensureValid( mnPropFlags == 0 ) ) + { + for (auto const& largeProp : maLargeProps) + { + if (!ensureValid()) + break; + ensureValid( largeProp->readProperty( maInStrm ) ); + maInStrm.align( 4 ); + } + } + maInStrm.seek( mnPropsEnd ); + + // read stream properties (no stream alignment between properties!) + if( ensureValid() ) + { + for (auto const& streamProp : maStreamProps) + { + if (!ensureValid()) + break; + ensureValid( streamProp->readProperty( maInStrm ) ); + } + } + + return mbValid; +} + +bool AxBinaryPropertyReader::ensureValid( bool bCondition ) +{ + mbValid = mbValid && bCondition && !maInStrm.isEof(); + return mbValid; +} + +bool AxBinaryPropertyReader::startNextProperty() +{ + bool bHasProp = getFlag( mnPropFlags, mnNextProp ); + setFlag( mnPropFlags, mnNextProp, false ); + mnNextProp <<= 1; + return ensureValid() && bHasProp; +} + +} // namespace oox::ole + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/ole/axbinarywriter.cxx b/oox/source/ole/axbinarywriter.cxx new file mode 100644 index 000000000..b9c4b66be --- /dev/null +++ b/oox/source/ole/axbinarywriter.cxx @@ -0,0 +1,201 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ +#include + +namespace oox::ole { + +namespace { + +const sal_uInt32 AX_STRING_COMPRESSED = 0x80000000; + +} // namespace + +AxAlignedOutputStream::AxAlignedOutputStream( BinaryOutputStream& rOutStrm ) : + BinaryStreamBase( false ), + mpOutStrm( &rOutStrm ), + mnStrmPos( 0 ), + mnStrmSize( rOutStrm.getRemaining() ), + mnWrappedBeginPos( rOutStrm.tell() ) +{ + mbEof = mbEof || rOutStrm.isEof(); +} + +sal_Int64 AxAlignedOutputStream::size() const +{ + return mpOutStrm ? mnStrmSize : -1; +} + +sal_Int64 AxAlignedOutputStream::tell() const +{ + return mpOutStrm ? mnStrmPos : -1; +} + +void AxAlignedOutputStream::seek( sal_Int64 nPos ) +{ + mbEof = (nPos < 0); + if( !mbEof ) + { + mpOutStrm->seek( static_cast< sal_Int32 >( mnWrappedBeginPos + nPos ) ); + mnStrmPos = mpOutStrm->tell() - mnWrappedBeginPos; + } +} + +void AxAlignedOutputStream::close() +{ + mpOutStrm = nullptr; + mbEof = true; +} + +void AxAlignedOutputStream::writeData( const StreamDataSequence& orData, size_t nAtomSize ) +{ + mpOutStrm->writeData( orData, nAtomSize ); + mnStrmPos = mpOutStrm->tell() - mnWrappedBeginPos; +} + +void AxAlignedOutputStream::writeMemory( const void* opMem, sal_Int32 nBytes, size_t nAtomSize ) +{ + mpOutStrm->writeMemory( opMem, nBytes, nAtomSize ); + mnStrmPos = mpOutStrm->tell() - mnWrappedBeginPos; +} + +void AxAlignedOutputStream::pad( sal_Int32 nBytes ) +{ + //PRESUMABLY we need to pad with 0's here as appropriate + css::uno::Sequence< sal_Int8 > aData( nBytes ); + // ok we could be padding with rubbish here, but really that shouldn't matter + // set to 0(s), easier to not get fooled by 0's when looking at + // binary content... + memset( static_cast( aData.getArray() ), 0, nBytes ); + mpOutStrm->writeData( aData ); + mnStrmPos = mpOutStrm->tell() - mnWrappedBeginPos; +} + +void AxAlignedOutputStream::align( size_t nSize ) +{ + pad( static_cast< sal_Int32 >( (nSize - (mnStrmPos % nSize)) % nSize ) ); +} + +namespace { + +void lclWriteString( AxAlignedOutputStream& rOutStrm, OUString const & rValue, sal_uInt32 nSize ) +{ + bool bCompressed = getFlag( nSize, AX_STRING_COMPRESSED ); + rOutStrm.writeCompressedUnicodeArray( rValue, bCompressed ); +} + +} // namespace + +AxBinaryPropertyWriter::ComplexProperty::~ComplexProperty() +{ +} + +bool AxBinaryPropertyWriter::PairProperty::writeProperty( AxAlignedOutputStream& rOutStrm ) +{ + rOutStrm.WriteInt32(mrPairData.first).WriteInt32(mrPairData.second); + return true; +} + +bool AxBinaryPropertyWriter::StringProperty::writeProperty( AxAlignedOutputStream& rOutStrm ) +{ + lclWriteString( rOutStrm, mrValue, mnSize ); + return true; +} + +AxBinaryPropertyWriter::AxBinaryPropertyWriter( BinaryOutputStream& rOutStrm, bool b64BitPropFlags ) : + maOutStrm( rOutStrm ), + mnPropFlags( 0x0 ), + mbValid( true ), + mb64BitPropFlags( b64BitPropFlags ) +{ + sal_uInt16 nId( 0x0200 ); + maOutStrm.WriteUInt16(nId); + mnBlockSize = 0; // will be filled in the finalize method + + maOutStrm.WriteUInt16(nId); + mnPropFlagsStart = maOutStrm.tell(); + + if( mb64BitPropFlags ) + maOutStrm.WriteInt64( mnPropFlags ); + else + maOutStrm.WriteUInt32( mnPropFlags ); + mnNextProp = 1; +} + +void AxBinaryPropertyWriter::writeBoolProperty( bool orbValue ) +{ + // orbValue == bReverse false then we want to set the bit, e.g. don't skip + startNextProperty( !orbValue ); +} + +void AxBinaryPropertyWriter::writePairProperty( AxPairData& orPairData ) +{ + startNextProperty(); + maLargeProps.push_back( ComplexPropVector::value_type( std::make_shared( orPairData ) ) ); +} + +void AxBinaryPropertyWriter::writeStringProperty( OUString& orValue ) +{ + sal_uInt32 nSize = orValue.getLength() * 2; + setFlag( nSize, AX_STRING_COMPRESSED, false ); + maOutStrm.writeAligned< sal_uInt32 >( nSize ); + maLargeProps.push_back( ComplexPropVector::value_type( std::make_shared( orValue, nSize ) ) ); + startNextProperty(); +} + +void AxBinaryPropertyWriter::finalizeExport() +{ + // write large properties + maOutStrm.align( 4 ); + for (auto const& largeProp : maLargeProps) + { + if (!ensureValid()) + break; + largeProp->writeProperty( maOutStrm ); + maOutStrm.align( 4 ); + } + + mnBlockSize = maOutStrm.tell() - mnPropFlagsStart; + + // write stream properties (no stream alignment between properties!) + for (auto const& streamProp : maStreamProps) + { + if (!ensureValid()) + break; + streamProp->writeProperty( maOutStrm ); + } + + sal_Int64 nPos = maOutStrm.tell(); + maOutStrm.seek( mnPropFlagsStart - sizeof( mnBlockSize ) ); + + maOutStrm.WriteInt16( mnBlockSize ); + + if( mb64BitPropFlags ) + maOutStrm.WriteInt64( mnPropFlags ); + else + maOutStrm.WriteUInt32( mnPropFlags ); + + maOutStrm.seek( nPos ); +} + +bool AxBinaryPropertyWriter::ensureValid() +{ + mbValid = mbValid && !maOutStrm.isEof(); + return mbValid; +} + +void AxBinaryPropertyWriter::startNextProperty( bool bSkip ) +{ + // if we are skipping then we clear the flag + setFlag( mnPropFlags, mnNextProp, !bSkip ); + mnNextProp <<= 1; +} + +} // namespace oox::ole + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/ole/axcontrol.cxx b/oox/source/ole/axcontrol.cxx new file mode 100644 index 000000000..a3573b395 --- /dev/null +++ b/oox/source/ole/axcontrol.cxx @@ -0,0 +1,2786 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace oox::ole { + +using namespace ::com::sun::star; +using namespace ::com::sun::star::awt; +using namespace ::com::sun::star::beans; +using namespace ::com::sun::star::container; +using namespace ::com::sun::star::drawing; +using namespace ::com::sun::star::form; +using namespace ::com::sun::star::form::binding; +using namespace ::com::sun::star::frame; +using namespace ::com::sun::star::lang; +using namespace ::com::sun::star::sheet; +using namespace ::com::sun::star::style; +using namespace ::com::sun::star::table; +using namespace ::com::sun::star::uno; + +namespace { + +const sal_uInt32 COMCTL_ID_SIZE = 0x12344321; + +const sal_uInt32 COMCTL_ID_COMMONDATA = 0xABCDEF01; +const sal_uInt32 COMCTL_COMMON_FLATBORDER = 0x00000001; +const sal_uInt32 COMCTL_COMMON_ENABLED = 0x00000002; +const sal_uInt32 COMCTL_COMMON_3DBORDER = 0x00000004; + +const sal_uInt32 COMCTL_ID_COMPLEXDATA = 0xBDECDE1F; +const sal_uInt32 COMCTL_COMPLEX_FONT = 0x00000001; +const sal_uInt32 COMCTL_COMPLEX_MOUSEICON = 0x00000002; + +const sal_uInt32 COMCTL_ID_SCROLLBAR_60 = 0x99470A83; +const sal_uInt32 COMCTL_SCROLLBAR_HOR = 0x00000010; + +const sal_uInt32 COMCTL_ID_PROGRESSBAR_50 = 0xE6E17E84; +const sal_uInt32 COMCTL_ID_PROGRESSBAR_60 = 0x97AB8A01; + +const sal_uInt32 AX_CMDBUTTON_DEFFLAGS = 0x0000001B; +const sal_uInt32 AX_LABEL_DEFFLAGS = 0x0080001B; +const sal_uInt32 AX_IMAGE_DEFFLAGS = 0x0000001B; +const sal_uInt32 AX_MORPHDATA_DEFFLAGS = 0x2C80081B; +const sal_uInt32 AX_SPINBUTTON_DEFFLAGS = 0x0000001B; +const sal_uInt32 AX_SCROLLBAR_DEFFLAGS = 0x0000001B; + +const sal_uInt16 AX_POS_TOPLEFT = 0; +const sal_uInt16 AX_POS_TOP = 1; +const sal_uInt16 AX_POS_TOPRIGHT = 2; +const sal_uInt16 AX_POS_LEFT = 3; +const sal_uInt16 AX_POS_CENTER = 4; +const sal_uInt16 AX_POS_RIGHT = 5; +const sal_uInt16 AX_POS_BOTTOMLEFT = 6; +const sal_uInt16 AX_POS_BOTTOM = 7; +const sal_uInt16 AX_POS_BOTTOMRIGHT = 8; + +#define AX_PICPOS_IMPL( label, image ) ((AX_POS_##label << 16) | AX_POS_##image) +const sal_uInt32 AX_PICPOS_LEFTTOP = AX_PICPOS_IMPL( TOPRIGHT, TOPLEFT ); +const sal_uInt32 AX_PICPOS_LEFTCENTER = AX_PICPOS_IMPL( RIGHT, LEFT ); +const sal_uInt32 AX_PICPOS_LEFTBOTTOM = AX_PICPOS_IMPL( BOTTOMRIGHT, BOTTOMLEFT ); +const sal_uInt32 AX_PICPOS_RIGHTTOP = AX_PICPOS_IMPL( TOPLEFT, TOPRIGHT ); +const sal_uInt32 AX_PICPOS_RIGHTCENTER = AX_PICPOS_IMPL( LEFT, RIGHT ); +const sal_uInt32 AX_PICPOS_RIGHTBOTTOM = AX_PICPOS_IMPL( BOTTOMLEFT, BOTTOMRIGHT ); +const sal_uInt32 AX_PICPOS_ABOVELEFT = AX_PICPOS_IMPL( BOTTOMLEFT, TOPLEFT ); +const sal_uInt32 AX_PICPOS_ABOVECENTER = AX_PICPOS_IMPL( BOTTOM, TOP ); +const sal_uInt32 AX_PICPOS_ABOVERIGHT = AX_PICPOS_IMPL( BOTTOMRIGHT, TOPRIGHT ); +const sal_uInt32 AX_PICPOS_BELOWLEFT = AX_PICPOS_IMPL( TOPLEFT, BOTTOMLEFT ); +const sal_uInt32 AX_PICPOS_BELOWCENTER = AX_PICPOS_IMPL( TOP, BOTTOM ); +const sal_uInt32 AX_PICPOS_BELOWRIGHT = AX_PICPOS_IMPL( TOPRIGHT, BOTTOMRIGHT ); +const sal_uInt32 AX_PICPOS_CENTER = AX_PICPOS_IMPL( CENTER, CENTER ); +#undef AX_PICPOS_IMPL + +const sal_Int32 AX_MATCHENTRY_FIRSTLETTER = 0; +const sal_Int32 AX_MATCHENTRY_COMPLETE = 1; +const sal_Int32 AX_MATCHENTRY_NONE = 2; + +const sal_Int32 AX_ORIENTATION_AUTO = -1; +const sal_Int32 AX_ORIENTATION_VERTICAL = 0; +const sal_Int32 AX_ORIENTATION_HORIZONTAL = 1; + +const sal_Int32 AX_PROPTHUMB_ON = -1; + +const sal_uInt32 AX_TABSTRIP_TABS = 0; +const sal_uInt32 AX_TABSTRIP_NONE = 2; + +const sal_uInt32 AX_CONTAINER_ENABLED = 0x00000004; +const sal_uInt32 AX_CONTAINER_NOCLASSTABLE = 0x00008000; + +const sal_uInt32 AX_CONTAINER_DEFFLAGS = 0x00000004; + +const sal_Int32 AX_CONTAINER_DEFWIDTH = 4000; +const sal_Int32 AX_CONTAINER_DEFHEIGHT = 3000; + +const sal_Int32 AX_CONTAINER_CYCLEALL = 0; + +const sal_Int32 AX_CONTAINER_SCR_NONE = 0x00; + +const sal_Int16 API_BORDER_NONE = 0; +const sal_Int16 API_BORDER_SUNKEN = 1; +const sal_Int16 API_BORDER_FLAT = 2; + +const sal_Int16 API_STATE_UNCHECKED = 0; +const sal_Int16 API_STATE_CHECKED = 1; +const sal_Int16 API_STATE_DONTKNOW = 2; + +/** Tries to extract a range address from a defined name. */ +bool lclExtractRangeFromName( CellRangeAddress& orRangeAddr, const Reference< XModel >& rxDocModel, const OUString& rAddressString ) +{ + try + { + PropertySet aPropSet( rxDocModel ); + Reference< XNameAccess > xRangesNA( aPropSet.getAnyProperty( PROP_NamedRanges ), UNO_QUERY_THROW ); + Reference< XCellRangeReferrer > xReferrer( xRangesNA->getByName( rAddressString ), UNO_QUERY_THROW ); + Reference< XCellRangeAddressable > xAddressable( xReferrer->getReferredCells(), UNO_QUERY_THROW ); + orRangeAddr = xAddressable->getRangeAddress(); + return true; + } + catch (const Exception&) + { + TOOLS_WARN_EXCEPTION("oox", ""); + } + return false; +} + +bool lclExtractAddressFromName( CellAddress& orAddress, const Reference< XModel >& rxDocModel, const OUString& rAddressString ) +{ + CellRangeAddress aRangeAddr; + if( lclExtractRangeFromName( aRangeAddr, rxDocModel, rAddressString ) && + (aRangeAddr.StartColumn == aRangeAddr.EndColumn) && + (aRangeAddr.StartRow == aRangeAddr.EndRow) ) + { + orAddress.Sheet = aRangeAddr.Sheet; + orAddress.Column = aRangeAddr.StartColumn; + orAddress.Row = aRangeAddr.StartRow; + return true; + } + return false; +} + +void lclPrepareConverter( PropertySet& rConverter, const Reference< XModel >& rxDocModel, + const OUString& rAddressString, sal_Int32 nRefSheet, bool bRange ) +{ + if( !rConverter.is() ) try + { + Reference< XMultiServiceFactory > xModelFactory( rxDocModel, UNO_QUERY_THROW ); + OUString aServiceName = bRange ? + OUString( "com.sun.star.table.CellRangeAddressConversion" ) : + OUString( "com.sun.star.table.CellAddressConversion" ); + rConverter.set( xModelFactory->createInstance( aServiceName ) ); + } + catch (const Exception&) + { + TOOLS_WARN_EXCEPTION("oox", ""); + } + rConverter.setProperty( PROP_XLA1Representation, rAddressString ); + rConverter.setProperty( PROP_ReferenceSheet, nRefSheet ); +} + +} // namespace + +ControlConverter::ControlConverter( const Reference< XModel >& rxDocModel, + const GraphicHelper& rGraphicHelper, bool bDefaultColorBgr ) : + mxDocModel( rxDocModel ), + mrGraphicHelper( rGraphicHelper ), + mbDefaultColorBgr( bDefaultColorBgr ) +{ + OSL_ENSURE( mxDocModel.is(), "ControlConverter::ControlConverter - missing document model" ); +} + +ControlConverter::~ControlConverter() +{ +} + +// Generic conversion --------------------------------------------------------- + +void ControlConverter::convertPosition( PropertyMap& rPropMap, const AxPairData& rPos ) const +{ + // position is given in 1/100 mm, UNO needs AppFont units + awt::Point aAppFontPos = mrGraphicHelper.convertHmmToAppFont( awt::Point( rPos.first, rPos.second ) ); + rPropMap.setProperty( PROP_PositionX, aAppFontPos.X ); + rPropMap.setProperty( PROP_PositionY, aAppFontPos.Y ); +} + +void ControlConverter::convertSize( PropertyMap& rPropMap, const AxPairData& rSize ) const +{ + // size is given in 1/100 mm, UNO needs AppFont units + awt::Size aAppFontSize = mrGraphicHelper.convertHmmToAppFont( awt::Size( rSize.first, rSize.second ) ); + rPropMap.setProperty( PROP_Width, aAppFontSize.Width ); + rPropMap.setProperty( PROP_Height, aAppFontSize.Height ); +} + +void ControlConverter::convertColor( PropertyMap& rPropMap, sal_Int32 nPropId, sal_uInt32 nOleColor ) const +{ + rPropMap.setProperty( nPropId, OleHelper::decodeOleColor( mrGraphicHelper, nOleColor, mbDefaultColorBgr ) ); +} + +void ControlConverter::convertToMSColor( PropertySet const & rPropSet, sal_Int32 nPropId, sal_uInt32& nOleColor, sal_uInt32 nDefault ) +{ + sal_uInt32 nRGB = 0; + if (rPropSet.getProperty( nRGB, nPropId )) + nOleColor = OleHelper::encodeOleColor( nRGB ); + else + nOleColor = nDefault; +} +void ControlConverter::convertPicture( PropertyMap& rPropMap, const StreamDataSequence& rPicData ) const +{ + if( rPicData.hasElements() ) + { + uno::Reference xGraphic = mrGraphicHelper.importGraphic(rPicData); + if (xGraphic.is()) + rPropMap.setProperty(PROP_Graphic, xGraphic); + } +} + +void ControlConverter::convertOrientation( PropertyMap& rPropMap, bool bHorizontal ) +{ + sal_Int32 nScrollOrient = bHorizontal ? ScrollBarOrientation::HORIZONTAL : ScrollBarOrientation::VERTICAL; + rPropMap.setProperty( PROP_Orientation, nScrollOrient ); +} + +void ControlConverter::convertToMSOrientation( PropertySet const & rPropSet, bool& bHorizontal ) +{ + sal_Int32 nScrollOrient = ScrollBarOrientation::HORIZONTAL; + if ( rPropSet.getProperty( nScrollOrient, PROP_Orientation ) ) + bHorizontal = ( nScrollOrient == ScrollBarOrientation::HORIZONTAL ); +} + +void ControlConverter::convertVerticalAlign( PropertyMap& rPropMap, sal_Int32 nVerticalAlign ) +{ + VerticalAlignment eAlign = VerticalAlignment_TOP; + switch( nVerticalAlign ) + { + case XML_Top: eAlign = VerticalAlignment_TOP; break; + case XML_Center: eAlign = VerticalAlignment_MIDDLE; break; + case XML_Bottom: eAlign = VerticalAlignment_BOTTOM; break; + } + rPropMap.setProperty( PROP_VerticalAlign, eAlign ); +} + +void ControlConverter::convertScrollabilitySettings( PropertyMap& rPropMap, + const AxPairData& rScrollPos, const AxPairData& rScrollArea, + sal_Int32 nScrollBars ) const +{ + awt::Size tmpSize = mrGraphicHelper.convertHmmToAppFont( awt::Size( rScrollArea.first, rScrollArea.second ) ); + awt::Point tmpPos = mrGraphicHelper.convertHmmToAppFont( awt::Point( rScrollPos.first, rScrollPos.second ) ); + rPropMap.setProperty( PROP_ScrollHeight, tmpSize.Height ); + rPropMap.setProperty( PROP_ScrollWidth, tmpSize.Width ); + rPropMap.setProperty( PROP_ScrollTop, tmpPos.Y ); + rPropMap.setProperty( PROP_ScrollLeft, tmpPos.X ); + rPropMap.setProperty( PROP_HScroll, ( nScrollBars & 0x1 ) == 0x1 ); + rPropMap.setProperty( PROP_VScroll, ( nScrollBars & 0x2 ) == 0x2 ); +} + +void ControlConverter::convertScrollBar( PropertyMap& rPropMap, + sal_Int32 nMin, sal_Int32 nMax, sal_Int32 nPosition, + sal_Int32 nSmallChange, sal_Int32 nLargeChange, bool bAwtModel ) +{ + rPropMap.setProperty( PROP_ScrollValueMin, ::std::min( nMin, nMax ) ); + rPropMap.setProperty( PROP_ScrollValueMax, ::std::max( nMin, nMax ) ); + rPropMap.setProperty( PROP_LineIncrement, nSmallChange ); + rPropMap.setProperty( PROP_BlockIncrement, nLargeChange ); + rPropMap.setProperty( bAwtModel ? PROP_ScrollValue : PROP_DefaultScrollValue, nPosition ); +} + +void ControlConverter::bindToSources( const Reference< XControlModel >& rxCtrlModel, + const OUString& rCtrlSource, const OUString& rRowSource, sal_Int32 nRefSheet ) const +{ + // value binding + if( !rCtrlSource.isEmpty() ) try + { + // first check if the XBindableValue interface is supported + Reference< XBindableValue > xBindable( rxCtrlModel, UNO_QUERY_THROW ); + + // convert address string to cell address struct + CellAddress aAddress; + if( !lclExtractAddressFromName( aAddress, mxDocModel, rCtrlSource ) ) + { + lclPrepareConverter( maAddressConverter, mxDocModel, rCtrlSource, nRefSheet, false ); + if( !maAddressConverter.getProperty( aAddress, PROP_Address ) ) + throw RuntimeException(); + } + + // create argument sequence + Sequence< Any > aArgs{ Any(NamedValue("BoundCell", Any(aAddress))) }; + + // create the CellValueBinding instance and set at the control model + Reference< XMultiServiceFactory > xModelFactory( mxDocModel, UNO_QUERY_THROW ); + Reference< XValueBinding > xBinding( xModelFactory->createInstanceWithArguments( "com.sun.star.table.CellValueBinding", aArgs ), UNO_QUERY_THROW ); + xBindable->setValueBinding( xBinding ); + } + catch (const Exception&) + { + TOOLS_WARN_EXCEPTION("oox", ""); + } + + // list entry source + if( rRowSource.isEmpty() ) + return; + + try + { + // first check if the XListEntrySink interface is supported + Reference< XListEntrySink > xEntrySink( rxCtrlModel, UNO_QUERY_THROW ); + + // convert address string to cell range address struct + CellRangeAddress aRangeAddr; + if( !lclExtractRangeFromName( aRangeAddr, mxDocModel, rRowSource ) ) + { + lclPrepareConverter( maRangeConverter, mxDocModel, rRowSource, nRefSheet, true ); + if( !maRangeConverter.getProperty( aRangeAddr, PROP_Address ) ) + throw RuntimeException(); + } + + // create argument sequence + Sequence< Any > aArgs{ Any(NamedValue("CellRange", Any(aRangeAddr))) }; + + // create the EntrySource instance and set at the control model + Reference< XMultiServiceFactory > xModelFactory( mxDocModel, UNO_QUERY_THROW ); + Reference< XListEntrySource > xEntrySource( xModelFactory->createInstanceWithArguments("com.sun.star.table.CellRangeListSource", aArgs ), UNO_QUERY_THROW ); + xEntrySink->setListEntrySource( xEntrySource ); + } + catch (const Exception&) + { + TOOLS_WARN_EXCEPTION("oox", ""); + } +} + +// ActiveX (Forms 2.0) specific conversion ------------------------------------ + +void ControlConverter::convertAxBackground( PropertyMap& rPropMap, + sal_uInt32 nBackColor, sal_uInt32 nFlags, ApiTransparencyMode eTranspMode ) const +{ + bool bOpaque = getFlag( nFlags, AX_FLAGS_OPAQUE ); + switch( eTranspMode ) + { + case ApiTransparencyMode::NotSupported: + // fake transparency by using system window background if needed + convertColor( rPropMap, PROP_BackgroundColor, bOpaque ? nBackColor : AX_SYSCOLOR_WINDOWBACK ); + break; + case ApiTransparencyMode::Void: + // keep transparency by leaving the (void) default property value + if( bOpaque ) + convertColor( rPropMap, PROP_BackgroundColor, nBackColor ); + break; + } +} + +void ControlConverter::convertAxBorder( PropertyMap& rPropMap, + sal_uInt32 nBorderColor, sal_Int32 nBorderStyle, sal_Int32 nSpecialEffect ) const +{ + sal_Int16 nBorder = (nBorderStyle == AX_BORDERSTYLE_SINGLE) ? API_BORDER_FLAT : + ((nSpecialEffect == AX_SPECIALEFFECT_FLAT) ? API_BORDER_NONE : API_BORDER_SUNKEN); + rPropMap.setProperty( PROP_Border, nBorder ); + convertColor( rPropMap, PROP_BorderColor, nBorderColor ); +} + +void ControlConverter::convertToAxBorder( PropertySet const & rPropSet, + sal_uInt32& nBorderColor, sal_Int32& nBorderStyle, sal_Int32& nSpecialEffect ) +{ + sal_Int16 nBorder = API_BORDER_NONE; + rPropSet.getProperty( nBorder, PROP_Border ); + nBorderStyle = AX_BORDERSTYLE_NONE; + nSpecialEffect = AX_SPECIALEFFECT_FLAT; + switch ( nBorder ) + { + case API_BORDER_FLAT: + nBorderStyle = AX_BORDERSTYLE_SINGLE; + break; + case API_BORDER_SUNKEN: + nSpecialEffect = AX_SPECIALEFFECT_SUNKEN; + break; + case API_BORDER_NONE: + default: + break; + } + convertToMSColor( rPropSet, PROP_BorderColor, nBorderColor ); +} + +void ControlConverter::convertAxVisualEffect( PropertyMap& rPropMap, sal_Int32 nSpecialEffect ) +{ + sal_Int16 nVisualEffect = (nSpecialEffect == AX_SPECIALEFFECT_FLAT) ? VisualEffect::FLAT : VisualEffect::LOOK3D; + rPropMap.setProperty( PROP_VisualEffect, nVisualEffect ); +} + +void ControlConverter::convertToAxVisualEffect( PropertySet const & rPropSet, sal_Int32& nSpecialEffect ) +{ + sal_Int16 nVisualEffect = AX_SPECIALEFFECT_FLAT; + rPropSet.getProperty( nVisualEffect, PROP_VisualEffect ); + // is this appropriate AX_SPECIALEFFECT_XXXX value ? + if (nVisualEffect == VisualEffect::LOOK3D ) + nSpecialEffect = AX_SPECIALEFFECT_RAISED; +} + +void ControlConverter::convertAxPicture( PropertyMap& rPropMap, const StreamDataSequence& rPicData, sal_uInt32 nPicPos ) const +{ + // the picture + convertPicture( rPropMap, rPicData ); + + // picture position + sal_Int16 nImagePos = ImagePosition::LeftCenter; + switch( nPicPos ) + { + case AX_PICPOS_LEFTTOP: nImagePos = ImagePosition::LeftTop; break; + case AX_PICPOS_LEFTCENTER: nImagePos = ImagePosition::LeftCenter; break; + case AX_PICPOS_LEFTBOTTOM: nImagePos = ImagePosition::LeftBottom; break; + case AX_PICPOS_RIGHTTOP: nImagePos = ImagePosition::RightTop; break; + case AX_PICPOS_RIGHTCENTER: nImagePos = ImagePosition::RightCenter; break; + case AX_PICPOS_RIGHTBOTTOM: nImagePos = ImagePosition::RightBottom; break; + case AX_PICPOS_ABOVELEFT: nImagePos = ImagePosition::AboveLeft; break; + case AX_PICPOS_ABOVECENTER: nImagePos = ImagePosition::AboveCenter; break; + case AX_PICPOS_ABOVERIGHT: nImagePos = ImagePosition::AboveRight; break; + case AX_PICPOS_BELOWLEFT: nImagePos = ImagePosition::BelowLeft; break; + case AX_PICPOS_BELOWCENTER: nImagePos = ImagePosition::BelowCenter; break; + case AX_PICPOS_BELOWRIGHT: nImagePos = ImagePosition::BelowRight; break; + case AX_PICPOS_CENTER: nImagePos = ImagePosition::Centered; break; + default: OSL_FAIL( "ControlConverter::convertAxPicture - unknown picture position" ); + } + rPropMap.setProperty( PROP_ImagePosition, nImagePos ); +} + +void ControlConverter::convertAxPicture( PropertyMap& rPropMap, const StreamDataSequence& rPicData, + sal_Int32 nPicSizeMode ) const +{ + // the picture + convertPicture( rPropMap, rPicData ); + + // picture scale mode + sal_Int16 nScaleMode = ImageScaleMode::NONE; + switch( nPicSizeMode ) + { + case AX_PICSIZE_CLIP: nScaleMode = ImageScaleMode::NONE; break; + case AX_PICSIZE_STRETCH: nScaleMode = ImageScaleMode::ANISOTROPIC; break; + case AX_PICSIZE_ZOOM: nScaleMode = ImageScaleMode::ISOTROPIC; break; + default: OSL_FAIL( "ControlConverter::convertAxPicture - unknown picture size mode" ); + } + rPropMap.setProperty( PROP_ScaleMode, nScaleMode ); +} + +void ControlConverter::convertAxState( PropertyMap& rPropMap, + const OUString& rValue, sal_Int32 nMultiSelect, ApiDefaultStateMode eDefStateMode, bool bAwtModel ) +{ + bool bBooleanState = eDefStateMode == API_DEFAULTSTATE_BOOLEAN; + bool bSupportsTriState = eDefStateMode == API_DEFAULTSTATE_TRISTATE; + + // state + sal_Int16 nState = bSupportsTriState ? API_STATE_DONTKNOW : API_STATE_UNCHECKED; + if( rValue.getLength() == 1 ) switch( rValue[ 0 ] ) + { + case '0': nState = API_STATE_UNCHECKED; break; + case '1': nState = API_STATE_CHECKED; break; + // any other string (also empty) means 'dontknow' + } + sal_Int32 nPropId = bAwtModel ? PROP_State : PROP_DefaultState; + if( bBooleanState ) + rPropMap.setProperty( nPropId, nState != API_STATE_UNCHECKED ); + else + rPropMap.setProperty( nPropId, nState ); + + // tristate + if( bSupportsTriState ) + rPropMap.setProperty( PROP_TriState, nMultiSelect == AX_SELECTION_MULTI ); +} + +void ControlConverter::convertToAxState( PropertySet const & rPropSet, + OUString& rValue, sal_Int32& nMultiSelect, ApiDefaultStateMode eDefStateMode ) +{ + bool bSupportsTriState = eDefStateMode == API_DEFAULTSTATE_TRISTATE; + + sal_Int16 nState = API_STATE_DONTKNOW; + + // need to use State for current state ( I think this is regardless of whether + // control is awt or not ) + rPropSet.getProperty( nState, PROP_State ); + + rValue.clear(); // empty e.g. 'don't know' + if ( nState == API_STATE_UNCHECKED ) + rValue = "0"; + else if ( nState == API_STATE_CHECKED ) + rValue = "1"; + + // tristate + if( bSupportsTriState ) + { + bool bTriStateEnabled = false; + bool bPropertyExists = rPropSet.getProperty( bTriStateEnabled, PROP_TriState ); + if( bPropertyExists && bTriStateEnabled ) + nMultiSelect = AX_SELECTION_MULTI; + } +} + +void ControlConverter::convertAxOrientation( PropertyMap& rPropMap, + const AxPairData& rSize, sal_Int32 nOrientation ) +{ + bool bHorizontal = true; + switch( nOrientation ) + { + case AX_ORIENTATION_AUTO: bHorizontal = rSize.first > rSize.second; break; + case AX_ORIENTATION_VERTICAL: bHorizontal = false; break; + case AX_ORIENTATION_HORIZONTAL: bHorizontal = true; break; + default: OSL_FAIL( "ControlConverter::convertAxOrientation - unknown orientation" ); + } + convertOrientation( rPropMap, bHorizontal ); +} + +void ControlConverter::convertToAxOrientation( PropertySet const & rPropSet, + sal_Int32& nOrientation ) +{ + bool bHorizontal = true; + convertToMSOrientation( rPropSet, bHorizontal ); + + if ( bHorizontal ) + nOrientation = AX_ORIENTATION_HORIZONTAL; + else + nOrientation = AX_ORIENTATION_VERTICAL; +} + +ControlModelBase::ControlModelBase() : + maSize( 0, 0 ), + mbAwtModel( false ) +{ +} + +ControlModelBase::~ControlModelBase() +{ +} + +OUString ControlModelBase::getServiceName() const +{ + ApiControlType eCtrlType = getControlType(); + if( mbAwtModel ) switch( eCtrlType ) + { + case API_CONTROL_BUTTON: return "com.sun.star.awt.UnoControlButtonModel"; + case API_CONTROL_FIXEDTEXT: return "com.sun.star.awt.UnoControlFixedTextModel"; + case API_CONTROL_IMAGE: return "com.sun.star.awt.UnoControlImageControlModel"; + case API_CONTROL_CHECKBOX: return "com.sun.star.awt.UnoControlCheckBoxModel"; + case API_CONTROL_RADIOBUTTON: return "com.sun.star.form.component.RadioButton"; + case API_CONTROL_EDIT: return "com.sun.star.awt.UnoControlEditModel"; + case API_CONTROL_NUMERIC: return "com.sun.star.awt.UnoControlNumericFieldModel"; + case API_CONTROL_LISTBOX: return "com.sun.star.form.component.ListBox"; + case API_CONTROL_COMBOBOX: return "com.sun.star.form.component.ComboBox"; + case API_CONTROL_SPINBUTTON: return "com.sun.star.form.component.SpinButton"; + case API_CONTROL_SCROLLBAR: return "com.sun.star.form.component.ScrollBar"; + case API_CONTROL_PROGRESSBAR: return "com.sun.star.awt.UnoControlProgressBarModel"; + case API_CONTROL_GROUPBOX: return "com.sun.star.form.component.GroupBox"; + case API_CONTROL_FRAME: return "com.sun.star.awt.UnoFrameModel"; + case API_CONTROL_PAGE: return "com.sun.star.awt.UnoPageModel"; + case API_CONTROL_MULTIPAGE: return "com.sun.star.awt.UnoMultiPageModel"; + case API_CONTROL_DIALOG: return "com.sun.star.awt.UnoControlDialogModel"; + default: OSL_FAIL( "ControlModelBase::getServiceName - no AWT model service supported" ); + } + else switch( eCtrlType ) + { + case API_CONTROL_BUTTON: return "com.sun.star.form.component.CommandButton"; + case API_CONTROL_FIXEDTEXT: return "com.sun.star.form.component.FixedText"; + case API_CONTROL_IMAGE: return "com.sun.star.form.component.DatabaseImageControl"; + case API_CONTROL_CHECKBOX: return "com.sun.star.form.component.CheckBox"; + case API_CONTROL_RADIOBUTTON: return "com.sun.star.form.component.RadioButton"; + case API_CONTROL_EDIT: return "com.sun.star.form.component.TextField"; + case API_CONTROL_NUMERIC: return "com.sun.star.form.component.NumericField"; + case API_CONTROL_LISTBOX: return "com.sun.star.form.component.ListBox"; + case API_CONTROL_COMBOBOX: return "com.sun.star.form.component.ComboBox"; + case API_CONTROL_SPINBUTTON: return "com.sun.star.form.component.SpinButton"; + case API_CONTROL_SCROLLBAR: return "com.sun.star.form.component.ScrollBar"; + case API_CONTROL_GROUPBOX: return "com.sun.star.form.component.GroupBox"; + default: OSL_FAIL( "ControlModelBase::getServiceName - no form component service supported" ); + } + return OUString(); +} + +void ControlModelBase::importProperty( sal_Int32 /*nPropId*/, const OUString& /*rValue*/ ) +{ +} + +void ControlModelBase::importPictureData( sal_Int32 /*nPropId*/, BinaryInputStream& /*rInStrm*/ ) +{ +} + +void ControlModelBase::convertProperties( PropertyMap& /*rPropMap*/, const ControlConverter& /*rConv*/ ) const +{ +} + +void ControlModelBase::convertFromProperties( PropertySet& /*rPropMap*/, const ControlConverter& /*rConv*/ ) +{ +} + +void ControlModelBase::convertSize( PropertyMap& rPropMap, const ControlConverter& rConv ) const +{ + rConv.convertSize( rPropMap, maSize ); +} + +ComCtlModelBase::ComCtlModelBase( sal_uInt32 nDataPartId5, sal_uInt32 nDataPartId6, + sal_uInt16 nVersion ) : + maFontData( "Tahoma", 82500 ), + mnFlags( 0 ), + mnVersion( nVersion ), + mnDataPartId5( nDataPartId5 ), + mnDataPartId6( nDataPartId6 ), + mbCommonPart( true ), + mbComplexPart( true ) +{ +} + +bool ComCtlModelBase::importBinaryModel( BinaryInputStream& rInStrm ) +{ + // read initial size part and header of the control data part + if( importSizePart( rInStrm ) && readPartHeader( rInStrm, getDataPartId(), mnVersion ) ) + { + // if flags part exists, the first int32 of the data part contains its size + sal_uInt32 nCommonPartSize = 0; + if (mbCommonPart) + nCommonPartSize = rInStrm.readuInt32(); + // implementations must read the exact amount of data, stream must point to its end afterwards + importControlData( rInStrm ); + // read following parts + if( !rInStrm.isEof() && + (!mbCommonPart || importCommonPart( rInStrm, nCommonPartSize )) && + (!mbComplexPart || importComplexPart( rInStrm )) ) + { + return !rInStrm.isEof(); + } + } + return false; +} + +void ComCtlModelBase::convertProperties( PropertyMap& rPropMap, const ControlConverter& rConv ) const +{ + if( mbCommonPart ) + rPropMap.setProperty( PROP_Enabled, getFlag( mnFlags, COMCTL_COMMON_ENABLED ) ); + ControlModelBase::convertProperties( rPropMap, rConv ); +} + +sal_uInt32 ComCtlModelBase::getDataPartId() const +{ + switch( mnVersion ) + { + case COMCTL_VERSION_50: return mnDataPartId5; + case COMCTL_VERSION_60: return mnDataPartId6; + } + OSL_FAIL( "ComCtlObjectBase::getDataPartId - unexpected version" ); + return SAL_MAX_UINT32; +} + +bool ComCtlModelBase::readPartHeader( BinaryInputStream& rInStrm, sal_uInt32 nExpPartId, sal_uInt16 nExpMajor, sal_uInt16 nExpMinor ) +{ + // no idea if all this is correct... + sal_uInt32 nPartId = rInStrm.readuInt32(); + sal_uInt16 nMinor = rInStrm.readuInt16(); + sal_uInt16 nMajor = rInStrm.readuInt16(); + bool bPartId = nPartId == nExpPartId; + OSL_ENSURE( bPartId, "ComCtlObjectBase::readPartHeader - unexpected part identifier" ); + bool bVersion = ((nExpMajor == SAL_MAX_UINT16) || (nExpMajor == nMajor)) && ((nExpMinor == SAL_MAX_UINT16) || (nExpMinor == nMinor)); + OSL_ENSURE( bVersion, "ComCtlObjectBase::readPartHeader - unexpected part version" ); + return !rInStrm.isEof() && bPartId && bVersion; +} + +bool ComCtlModelBase::importSizePart( BinaryInputStream& rInStrm ) +{ + if( readPartHeader( rInStrm, COMCTL_ID_SIZE, 0, 8 ) ) + { + maSize.first = rInStrm.readInt32(); + maSize.second = rInStrm.readInt32(); + return !rInStrm.isEof(); + } + return false; +} + +bool ComCtlModelBase::importCommonPart( BinaryInputStream& rInStrm, sal_uInt32 nPartSize ) +{ + sal_Int64 nEndPos = rInStrm.tell() + nPartSize; + if( (nPartSize >= 16) && readPartHeader( rInStrm, COMCTL_ID_COMMONDATA, 5, 0 ) ) + { + rInStrm.skip( 4 ); + mnFlags = rInStrm.readuInt32(); + rInStrm.seek( nEndPos ); + return !rInStrm.isEof(); + } + return false; +} + +bool ComCtlModelBase::importComplexPart( BinaryInputStream& rInStrm ) +{ + if( readPartHeader( rInStrm, COMCTL_ID_COMPLEXDATA, 5, 1 ) ) + { + sal_uInt32 nContFlags = rInStrm.readuInt32(); + bool bReadOk = + (!getFlag( nContFlags, COMCTL_COMPLEX_FONT ) || OleHelper::importStdFont( maFontData, rInStrm, true )) && + (!getFlag( nContFlags, COMCTL_COMPLEX_MOUSEICON ) || OleHelper::importStdPic( maMouseIcon, rInStrm )); + return bReadOk && !rInStrm.isEof(); + } + return false; +} + +ComCtlScrollBarModel::ComCtlScrollBarModel( sal_uInt16 nVersion ) : + ComCtlModelBase( SAL_MAX_UINT32, COMCTL_ID_SCROLLBAR_60, nVersion ), + mnScrollBarFlags( 0x00000011 ), + mnLargeChange( 1 ), + mnSmallChange( 1 ), + mnMin( 0 ), + mnMax( 32767 ), + mnPosition( 0 ) +{ +} + +ApiControlType ComCtlScrollBarModel::getControlType() const +{ + return API_CONTROL_SCROLLBAR; +} + +void ComCtlScrollBarModel::convertProperties( PropertyMap& rPropMap, const ControlConverter& rConv ) const +{ + rPropMap.setProperty( PROP_Border, API_BORDER_NONE ); + ControlConverter::convertOrientation( rPropMap, getFlag( mnScrollBarFlags, COMCTL_SCROLLBAR_HOR ) ); + ControlConverter::convertScrollBar( rPropMap, mnMin, mnMax, mnPosition, mnSmallChange, mnLargeChange, mbAwtModel ); + ComCtlModelBase::convertProperties( rPropMap, rConv ); +} + +void ComCtlScrollBarModel::importControlData( BinaryInputStream& rInStrm ) +{ + mnScrollBarFlags = rInStrm.readuInt32(); + mnLargeChange = rInStrm.readInt32(); + mnSmallChange = rInStrm.readInt32(); + mnMin = rInStrm.readInt32(); + mnMax = rInStrm.readInt32(); + mnPosition = rInStrm.readInt32(); +} + +ComCtlProgressBarModel::ComCtlProgressBarModel( sal_uInt16 nVersion ) : + ComCtlModelBase( COMCTL_ID_PROGRESSBAR_50, COMCTL_ID_PROGRESSBAR_60, nVersion ), + mfMin( 0.0 ), + mfMax( 100.0 ), + mnVertical( 0 ), + mnSmooth( 0 ) +{ +} + +ApiControlType ComCtlProgressBarModel::getControlType() const +{ + return API_CONTROL_PROGRESSBAR; +} + +void ComCtlProgressBarModel::convertProperties( PropertyMap& rPropMap, const ControlConverter& rConv ) const +{ + sal_uInt16 nBorder = getFlag( mnFlags, COMCTL_COMMON_3DBORDER ) ? API_BORDER_SUNKEN : + (getFlag( mnFlags, COMCTL_COMMON_FLATBORDER ) ? API_BORDER_FLAT : API_BORDER_NONE); + rPropMap.setProperty( PROP_Border, nBorder ); + rPropMap.setProperty( PROP_ProgressValueMin, getLimitedValue< sal_Int32, double >( ::std::min( mfMin, mfMax ), 0.0, SAL_MAX_INT32 ) ); + rPropMap.setProperty( PROP_ProgressValueMax, getLimitedValue< sal_Int32, double >( ::std::max( mfMin, mfMax ), 0.0, SAL_MAX_INT32 ) ); + // ComCtl model does not provide current value? + ComCtlModelBase::convertProperties( rPropMap, rConv ); +} + +void ComCtlProgressBarModel::importControlData( BinaryInputStream& rInStrm ) +{ + mfMin = rInStrm.readFloat(); + mfMax = rInStrm.readFloat(); + if( mnVersion == COMCTL_VERSION_60 ) + { + mnVertical = rInStrm.readuInt16(); + mnSmooth = rInStrm.readuInt16(); + } +} + +AxControlModelBase::AxControlModelBase() +{ +} + +void AxControlModelBase::importProperty( sal_Int32 nPropId, const OUString& rValue ) +{ + switch( nPropId ) + { + // size of the control shape: format is "width;height" + case XML_Size: + { + sal_Int32 nSepPos = rValue.indexOf( ';' ); + OSL_ENSURE( nSepPos >= 0, "AxControlModelBase::importProperty - missing separator in 'Size' property" ); + if( nSepPos >= 0 ) + { + maSize.first = o3tl::toInt32(rValue.subView( 0, nSepPos )); + maSize.second = o3tl::toInt32(rValue.subView( nSepPos + 1 )); + } + } + break; + } +} + +AxFontDataModel::AxFontDataModel( bool bSupportsAlign ) : + mbSupportsAlign( bSupportsAlign ) +{ +} + +void AxFontDataModel::importProperty( sal_Int32 nPropId, const OUString& rValue ) +{ + switch( nPropId ) + { + case XML_FontName: maFontData.maFontName = rValue; break; + case XML_FontEffects: + maFontData.mnFontEffects = static_cast(AttributeConversion::decodeUnsigned( rValue )); + break; + case XML_FontHeight: maFontData.mnFontHeight = AttributeConversion::decodeInteger( rValue ); break; + case XML_FontCharSet: maFontData.mnFontCharSet = AttributeConversion::decodeInteger( rValue ); break; + case XML_ParagraphAlign: + maFontData.mnHorAlign = static_cast(AttributeConversion::decodeInteger( rValue )); + break; + default: AxControlModelBase::importProperty( nPropId, rValue ); + } +} + +bool AxFontDataModel::importBinaryModel( BinaryInputStream& rInStrm ) +{ + return maFontData.importBinaryModel( rInStrm ); +} + +void AxFontDataModel::exportBinaryModel( BinaryOutputStream& rOutStrm ) +{ + maFontData.exportBinaryModel( rOutStrm ); +} +void AxFontDataModel::convertProperties( PropertyMap& rPropMap, const ControlConverter& rConv ) const +{ + // font name + if( !maFontData.maFontName.isEmpty() ) + rPropMap.setProperty( PROP_FontName, maFontData.maFontName ); + + // font effects + rPropMap.setProperty( PROP_FontWeight, maFontData.mnFontEffects & AxFontFlags::Bold ? awt::FontWeight::BOLD : awt::FontWeight::NORMAL ); + rPropMap.setProperty( PROP_FontSlant, maFontData.mnFontEffects & AxFontFlags::Italic ? FontSlant_ITALIC : FontSlant_NONE ); + if (maFontData.mnFontEffects & AxFontFlags::Underline) + rPropMap.setProperty( PROP_FontUnderline, maFontData.mbDblUnderline ? awt::FontUnderline::DOUBLE : awt::FontUnderline::SINGLE ); + else + rPropMap.setProperty( PROP_FontUnderline, awt::FontUnderline::NONE ); + rPropMap.setProperty( PROP_FontStrikeout, maFontData.mnFontEffects & AxFontFlags::Strikeout ? awt::FontStrikeout::SINGLE : awt::FontStrikeout::NONE ); + rPropMap.setProperty( PROP_FontHeight, maFontData.getHeightPoints() ); + + // font character set + rtl_TextEncoding eFontEnc = RTL_TEXTENCODING_DONTKNOW; + if( (0 <= maFontData.mnFontCharSet) && (maFontData.mnFontCharSet <= SAL_MAX_UINT8) ) + eFontEnc = rtl_getTextEncodingFromWindowsCharset( static_cast< sal_uInt8 >( maFontData.mnFontCharSet ) ); + if( eFontEnc != RTL_TEXTENCODING_DONTKNOW ) + rPropMap.setProperty( PROP_FontCharset, static_cast< sal_Int16 >( eFontEnc ) ); + + // text alignment + if( mbSupportsAlign ) + { + sal_Int32 nAlign = awt::TextAlign::LEFT; + switch( maFontData.mnHorAlign ) + { + case AxHorizontalAlign::Left: nAlign = awt::TextAlign::LEFT; break; + case AxHorizontalAlign::Right: nAlign = awt::TextAlign::RIGHT; break; + case AxHorizontalAlign::Center: nAlign = awt::TextAlign::CENTER; break; + default: OSL_FAIL( "AxFontDataModel::convertProperties - unknown text alignment" ); + } + // form controls expect short value + rPropMap.setProperty( PROP_Align, static_cast< sal_Int16 >( nAlign ) ); + } + + // process base class properties + AxControlModelBase::convertProperties( rPropMap, rConv ); +} + +void AxFontDataModel::convertFromProperties( PropertySet& rPropSet, const ControlConverter& /*rConv */) +{ + rPropSet.getProperty( maFontData.maFontName, PROP_FontName ); + float fontWeight = float(0); + if ( rPropSet.getProperty(fontWeight, PROP_FontWeight ) ) + setFlag( maFontData.mnFontEffects, AxFontFlags::Bold, ( fontWeight == awt::FontWeight::BOLD ) ); + FontSlant nSlant = FontSlant_NONE; + if ( rPropSet.getProperty( nSlant, PROP_FontSlant ) ) + setFlag( maFontData.mnFontEffects, AxFontFlags::Italic, ( nSlant == FontSlant_ITALIC ) ); + + sal_Int16 nUnderLine = awt::FontUnderline::NONE; + if ( rPropSet.getProperty( nUnderLine, PROP_FontUnderline ) ) + setFlag( maFontData.mnFontEffects, AxFontFlags::Underline, nUnderLine != awt::FontUnderline::NONE && nUnderLine != awt::FontUnderline::DONTKNOW); + sal_Int16 nStrikeout = awt::FontStrikeout::NONE ; + if ( rPropSet.getProperty( nStrikeout, PROP_FontStrikeout ) ) + setFlag( maFontData.mnFontEffects, AxFontFlags::Strikeout, nStrikeout != awt::FontStrikeout::NONE && nStrikeout != awt::FontStrikeout::DONTKNOW); + + float fontHeight = 0.0; + if ( rPropSet.getProperty( fontHeight, PROP_FontHeight ) ) + { + if ( fontHeight == 0 ) // tdf#118684 + { + vcl::Font aDefaultVCLFont = Application::GetDefaultDevice()->GetSettings().GetStyleSettings().GetAppFont(); + fontHeight = static_cast< float >( aDefaultVCLFont.GetFontHeight() ); + } + maFontData.setHeightPoints( static_cast< sal_Int16 >( fontHeight ) ); + } + + // TODO - handle textencoding + sal_Int16 nAlign = 0; + if ( rPropSet.getProperty( nAlign, PROP_Align ) ) + { + switch ( nAlign ) + { + case awt::TextAlign::LEFT: maFontData.mnHorAlign = AxHorizontalAlign::Left; break; + case awt::TextAlign::RIGHT: maFontData.mnHorAlign = AxHorizontalAlign::Right; break; + case awt::TextAlign::CENTER: maFontData.mnHorAlign = AxHorizontalAlign::Center; break; + default: OSL_FAIL( "AxFontDataModel::convertFromProperties - unknown text alignment" ); + } + } +} + +AxCommandButtonModel::AxCommandButtonModel() : + mnTextColor( AX_SYSCOLOR_BUTTONTEXT ), + mnBackColor( AX_SYSCOLOR_BUTTONFACE ), + mnFlags( AX_CMDBUTTON_DEFFLAGS ), + mnPicturePos( AX_PICPOS_ABOVECENTER ), + mnVerticalAlign( XML_Center ), + mbFocusOnClick( true ) +{ +} + +void AxCommandButtonModel::importProperty( sal_Int32 nPropId, const OUString& rValue ) +{ + switch( nPropId ) + { + case XML_Caption: maCaption = rValue; break; + case XML_ForeColor: mnTextColor = AttributeConversion::decodeUnsigned( rValue ); break; + case XML_BackColor: mnBackColor = AttributeConversion::decodeUnsigned( rValue ); break; + case XML_VariousPropertyBits: mnFlags = AttributeConversion::decodeUnsigned( rValue ); break; + case XML_PicturePosition: mnPicturePos = AttributeConversion::decodeUnsigned( rValue ); break; + case XML_TakeFocusOnClick: mbFocusOnClick = AttributeConversion::decodeInteger( rValue ) != 0; break; + default: AxFontDataModel::importProperty( nPropId, rValue ); + } +} + +void AxCommandButtonModel::importPictureData( sal_Int32 nPropId, BinaryInputStream& rInStrm ) +{ + switch( nPropId ) + { + case XML_Picture: OleHelper::importStdPic( maPictureData, rInStrm ); break; + default: AxFontDataModel::importPictureData( nPropId, rInStrm ); + } +} + +bool AxCommandButtonModel::importBinaryModel( BinaryInputStream& rInStrm ) +{ + AxBinaryPropertyReader aReader( rInStrm ); + aReader.readIntProperty< sal_uInt32 >( mnTextColor ); + aReader.readIntProperty< sal_uInt32 >( mnBackColor ); + aReader.readIntProperty< sal_uInt32 >( mnFlags ); + aReader.readStringProperty( maCaption ); + aReader.readIntProperty< sal_uInt32 >( mnPicturePos ); + aReader.readPairProperty( maSize ); + aReader.skipIntProperty< sal_uInt8 >(); // mouse pointer + aReader.readPictureProperty( maPictureData ); + aReader.skipIntProperty< sal_uInt16 >(); // accelerator + aReader.readBoolProperty( mbFocusOnClick, true ); // binary flag means "do not take focus" + aReader.skipPictureProperty(); // mouse icon + return aReader.finalizeImport() && AxFontDataModel::importBinaryModel( rInStrm ); +} + +void AxCommandButtonModel::exportBinaryModel( BinaryOutputStream& rOutStrm ) +{ + AxBinaryPropertyWriter aWriter( rOutStrm ); + aWriter.writeIntProperty< sal_uInt32 >( mnTextColor ); + if ( mnBackColor ) + aWriter.writeIntProperty< sal_uInt32 >( mnBackColor ); + else + aWriter.skipProperty(); // default backcolour + aWriter.writeIntProperty< sal_uInt32 >( mnFlags ); + aWriter.writeStringProperty( maCaption ); + aWriter.skipProperty(); // pict pos + aWriter.writePairProperty( maSize ); + aWriter.skipProperty(); // mouse pointer + aWriter.skipProperty(); // picture data + aWriter.skipProperty(); // accelerator + aWriter.writeBoolProperty( mbFocusOnClick ); // binary flag means "do not take focus" + aWriter.skipProperty(); // mouse icon + aWriter.finalizeExport(); + AxFontDataModel::exportBinaryModel( rOutStrm ); +} + +void AxCommandButtonModel::exportCompObj( BinaryOutputStream& rOutStream ) +{ + // should be able to replace this hardcoded foo with + // proper export info from MS-OLEDS spec. + static sal_uInt8 const aCompObj[] = { + 0x01, 0x00, 0xFE, 0xFF, 0x03, 0x0A, 0x00, 0x00, + 0xFF, 0xFF, 0xFF, 0xFF, 0x40, 0x32, 0x05, 0xD7, + 0x69, 0xCE, 0xCD, 0x11, 0xA7, 0x77, 0x00, 0xDD, + 0x01, 0x14, 0x3C, 0x57, 0x22, 0x00, 0x00, 0x00, + 0x4D, 0x69, 0x63, 0x72, 0x6F, 0x73, 0x6F, 0x66, + 0x74, 0x20, 0x46, 0x6F, 0x72, 0x6d, 0x73, 0x20, + 0x32, 0x2e, 0x30, 0x20, 0x43, 0x6F, 0x6D, 0x6D, + 0x61, 0x6E, 0x64, 0x42, 0x75, 0x74, 0x74, 0x6F, + 0x6E, 0x00, 0x10, 0x00, 0x00, 0x00, 0x45, 0x6D, + 0x62, 0x65, 0x64, 0x64, 0x65, 0x64, 0x20, 0x4F, + 0x62, 0x6A, 0x65, 0x63, 0x74, 0x00, 0x16, 0x00, + 0x00, 0x00, 0x46, 0x6F, 0x72, 0x6D, 0x73, 0x2E, + 0x43, 0x6F, 0x6D, 0x6D, 0x61, 0x6E, 0x64, 0x42, + 0x75, 0x74, 0x74, 0x6F, 0x6E, 0x2E, 0x31, 0x00, + 0xF4, 0x39, 0xB2, 0x71, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + }; + rOutStream.writeMemory( aCompObj, sizeof( aCompObj ) ); +} + +ApiControlType AxCommandButtonModel::getControlType() const +{ + return API_CONTROL_BUTTON; +} + +void AxCommandButtonModel::convertProperties( PropertyMap& rPropMap, const ControlConverter& rConv ) const +{ + rPropMap.setProperty( PROP_Label, maCaption ); + rPropMap.setProperty( PROP_Enabled, getFlag( mnFlags, AX_FLAGS_ENABLED ) ); + rPropMap.setProperty( PROP_MultiLine, getFlag( mnFlags, AX_FLAGS_WORDWRAP ) ); + rPropMap.setProperty( PROP_FocusOnClick, mbFocusOnClick ); + rConv.convertColor( rPropMap, PROP_TextColor, mnTextColor ); + ControlConverter::convertVerticalAlign( rPropMap, mnVerticalAlign ); + rConv.convertAxBackground( rPropMap, mnBackColor, mnFlags, ApiTransparencyMode::NotSupported ); + rConv.convertAxPicture( rPropMap, maPictureData, mnPicturePos ); + AxFontDataModel::convertProperties( rPropMap, rConv ); +} + +void AxCommandButtonModel::convertFromProperties( PropertySet& rPropSet, const ControlConverter& rConv ) +{ + (void)rPropSet.getProperty(maCaption, PROP_Label); + bool bRes = false; + if ( rPropSet.getProperty( bRes, PROP_Enabled ) ) + setFlag( mnFlags, AX_FLAGS_ENABLED, bRes ); + if ( rPropSet.getProperty( bRes, PROP_MultiLine ) ) + setFlag( mnFlags, AX_FLAGS_WORDWRAP, bRes ); + (void)rPropSet.getProperty(mbFocusOnClick, PROP_FocusOnClick); + + ControlConverter::convertToMSColor( rPropSet, PROP_TextColor, mnTextColor ); + ControlConverter::convertToMSColor( rPropSet, PROP_BackgroundColor, mnBackColor ); + + AxFontDataModel::convertFromProperties( rPropSet, rConv ); +} + +AxLabelModel::AxLabelModel() : + mnTextColor( AX_SYSCOLOR_BUTTONTEXT ), + mnBackColor( AX_SYSCOLOR_BUTTONFACE ), + mnFlags( AX_LABEL_DEFFLAGS ), + mnBorderColor( AX_SYSCOLOR_WINDOWFRAME ), + mnBorderStyle( AX_BORDERSTYLE_NONE ), + mnSpecialEffect( AX_SPECIALEFFECT_FLAT ), + mnVerticalAlign( XML_Top ) +{ +} + +void AxLabelModel::importProperty( sal_Int32 nPropId, const OUString& rValue ) +{ + switch( nPropId ) + { + case XML_Caption: maCaption = rValue; break; + case XML_ForeColor: mnTextColor = AttributeConversion::decodeUnsigned( rValue ); break; + case XML_BackColor: mnBackColor = AttributeConversion::decodeUnsigned( rValue ); break; + case XML_VariousPropertyBits: mnFlags = AttributeConversion::decodeUnsigned( rValue ); break; + case XML_BorderColor: mnBorderColor = AttributeConversion::decodeUnsigned( rValue ); break; + case XML_BorderStyle: mnBorderStyle = AttributeConversion::decodeInteger( rValue ); break; + case XML_SpecialEffect: mnSpecialEffect = AttributeConversion::decodeInteger( rValue ); break; + default: AxFontDataModel::importProperty( nPropId, rValue ); + } +} + +bool AxLabelModel::importBinaryModel( BinaryInputStream& rInStrm ) +{ + AxBinaryPropertyReader aReader( rInStrm ); + aReader.readIntProperty< sal_uInt32 >( mnTextColor ); + aReader.readIntProperty< sal_uInt32 >( mnBackColor ); + aReader.readIntProperty< sal_uInt32 >( mnFlags ); + aReader.readStringProperty( maCaption ); + aReader.skipIntProperty< sal_uInt32 >(); // picture position + aReader.readPairProperty( maSize ); + aReader.skipIntProperty< sal_uInt8 >(); // mouse pointer + aReader.readIntProperty< sal_uInt32 >( mnBorderColor ); + aReader.readIntProperty< sal_uInt16 >( mnBorderStyle ); + aReader.readIntProperty< sal_uInt16 >( mnSpecialEffect ); + aReader.skipPictureProperty(); // picture + aReader.skipIntProperty< sal_uInt16 >(); // accelerator + aReader.skipPictureProperty(); // mouse icon + return aReader.finalizeImport() && AxFontDataModel::importBinaryModel( rInStrm ); +} + +void AxLabelModel::exportBinaryModel( BinaryOutputStream& rOutStrm ) +{ + AxBinaryPropertyWriter aWriter( rOutStrm ); + aWriter.writeIntProperty< sal_uInt32 >( mnTextColor ); + if ( mnBackColor ) + aWriter.writeIntProperty< sal_uInt32 >( mnBackColor ); + else + // if mnBackColor == 0 then it's the libreoffice default backcolour is + // the MSO Label default which is AX_SYSCOLOR_BUTTONFACE + aWriter.writeIntProperty< sal_uInt32 >( AX_SYSCOLOR_WINDOWBACK ); + aWriter.writeIntProperty< sal_uInt32 >( mnFlags ); + aWriter.writeStringProperty( maCaption ); + aWriter.skipProperty(); // picture position + aWriter.writePairProperty( maSize ); + aWriter.skipProperty(); // mouse pointer + aWriter.writeIntProperty< sal_uInt32 >( mnBorderColor ); + aWriter.writeIntProperty< sal_uInt16 >( mnBorderStyle ); + aWriter.writeIntProperty< sal_uInt16 >( mnSpecialEffect ); + aWriter.skipProperty(); // picture + aWriter.skipProperty(); // accelerator + aWriter.skipProperty(); // mouse icon + aWriter.finalizeExport(); + AxFontDataModel::exportBinaryModel( rOutStrm ); +} + +void AxLabelModel::convertFromProperties( PropertySet& rPropSet, const ControlConverter& rConv ) +{ + rPropSet.getProperty( maCaption, PROP_Label ); + bool bRes = false; + if ( rPropSet.getProperty( bRes, PROP_Enabled ) ) + setFlag( mnFlags, AX_FLAGS_ENABLED, bRes ); + if ( rPropSet.getProperty( bRes, PROP_MultiLine ) ) + setFlag( mnFlags, AX_FLAGS_WORDWRAP, bRes ); + + ControlConverter::convertToMSColor( rPropSet, PROP_TextColor, mnTextColor ); + // VerticalAlign doesn't seem to be read from binary + + // not sure about background color, how do we decide when to set + // AX_FLAGS_OPAQUE ? + ControlConverter::convertToMSColor( rPropSet, PROP_BackgroundColor, mnBackColor ); + ControlConverter::convertToAxBorder( rPropSet, mnBorderColor, mnBorderStyle, mnSpecialEffect ); + + AxFontDataModel::convertFromProperties( rPropSet, rConv ); +} + +void AxLabelModel::exportCompObj( BinaryOutputStream& rOutStream ) +{ + // should be able to replace this hardcoded foo with + // proper export info from MS-OLEDS spec. + static sal_uInt8 const aCompObj[] = { + 0x01, 0x00, 0xFE, 0xFF, 0x03, 0x0A, 0x00, 0x00, + 0xFF, 0xFF, 0xFF, 0xFF, 0x23, 0x9E, 0x8C, 0x97, + 0xB0, 0xD4, 0xCE, 0x11, 0xBF, 0x2D, 0x00, 0xAA, + 0x00, 0x3F, 0x40, 0xD0, 0x1A, 0x00, 0x00, 0x00, + 0x4D, 0x69, 0x63, 0x72, 0x6F, 0x73, 0x6F, 0x66, + 0x74, 0x20, 0x46, 0x6F, 0x72, 0x6D, 0x73, 0x20, + 0x32, 0x2E, 0x30, 0x20, 0x4C, 0x61, 0x62, 0x65, + 0x6C, 0x00, 0x10, 0x00, 0x00, 0x00, 0x45, 0x6D, + 0x62, 0x65, 0x64, 0x64, 0x65, 0x64, 0x20, 0x4F, + 0x62, 0x6A, 0x65, 0x63, 0x74, 0x00, 0x0E, 0x00, + 0x00, 0x00, 0x46, 0x6F, 0x72, 0x6D, 0x73, 0x2E, + 0x4C, 0x61, 0x62, 0x65, 0x6C, 0x2E, 0x31, 0x00, + 0xF4, 0x39, 0xB2, 0x71, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + }; + rOutStream.writeMemory( aCompObj, sizeof( aCompObj ) ); +} + +ApiControlType AxLabelModel::getControlType() const +{ + return API_CONTROL_FIXEDTEXT; +} + +void AxLabelModel::convertProperties( PropertyMap& rPropMap, const ControlConverter& rConv ) const +{ + rPropMap.setProperty( PROP_Label, maCaption ); + rPropMap.setProperty( PROP_Enabled, getFlag( mnFlags, AX_FLAGS_ENABLED ) ); + rPropMap.setProperty( PROP_MultiLine, getFlag( mnFlags, AX_FLAGS_WORDWRAP ) ); + rConv.convertColor( rPropMap, PROP_TextColor, mnTextColor ); + ControlConverter::convertVerticalAlign( rPropMap, mnVerticalAlign ); + rConv.convertAxBackground( rPropMap, mnBackColor, mnFlags, ApiTransparencyMode::Void ); + rConv.convertAxBorder( rPropMap, mnBorderColor, mnBorderStyle, mnSpecialEffect ); + AxFontDataModel::convertProperties( rPropMap, rConv ); +} + +AxImageModel::AxImageModel() : + mnBackColor( AX_SYSCOLOR_BUTTONFACE ), + mnFlags( AX_IMAGE_DEFFLAGS ), + mnBorderColor( AX_SYSCOLOR_WINDOWFRAME ), + mnBorderStyle( AX_BORDERSTYLE_SINGLE ), + mnSpecialEffect( AX_SPECIALEFFECT_FLAT ), + mnPicSizeMode( AX_PICSIZE_CLIP ), + mnPicAlign( AX_PICALIGN_CENTER ), + mbPicTiling( false ) +{ +} + +void AxImageModel::importProperty( sal_Int32 nPropId, const OUString& rValue ) +{ + switch( nPropId ) + { + case XML_BackColor: mnBackColor = AttributeConversion::decodeUnsigned( rValue ); break; + case XML_VariousPropertyBits: mnFlags = AttributeConversion::decodeUnsigned( rValue ); break; + case XML_BorderColor: mnBorderColor = AttributeConversion::decodeUnsigned( rValue ); break; + case XML_BorderStyle: mnBorderStyle = AttributeConversion::decodeInteger( rValue ); break; + case XML_SpecialEffect: mnSpecialEffect = AttributeConversion::decodeInteger( rValue ); break; + case XML_SizeMode: mnPicSizeMode = AttributeConversion::decodeInteger( rValue ); break; + case XML_PictureAlignment: mnPicAlign = AttributeConversion::decodeInteger( rValue ); break; + case XML_PictureTiling: mbPicTiling = AttributeConversion::decodeInteger( rValue ) != 0; break; + default: AxControlModelBase::importProperty( nPropId, rValue ); + } +} + +void AxImageModel::importPictureData( sal_Int32 nPropId, BinaryInputStream& rInStrm ) +{ + switch( nPropId ) + { + case XML_Picture: OleHelper::importStdPic( maPictureData, rInStrm ); break; + default: AxControlModelBase::importPictureData( nPropId, rInStrm ); + } +} + +bool AxImageModel::importBinaryModel( BinaryInputStream& rInStrm ) +{ + AxBinaryPropertyReader aReader( rInStrm ); + aReader.skipUndefinedProperty(); + aReader.skipUndefinedProperty(); + aReader.skipBoolProperty(); // auto-size + aReader.readIntProperty< sal_uInt32 >( mnBorderColor ); + aReader.readIntProperty< sal_uInt32 >( mnBackColor ); + aReader.readIntProperty< sal_uInt8 >( mnBorderStyle ); + aReader.skipIntProperty< sal_uInt8 >(); // mouse pointer + aReader.readIntProperty< sal_uInt8 >( mnPicSizeMode ); + aReader.readIntProperty< sal_uInt8 >( mnSpecialEffect ); + aReader.readPairProperty( maSize ); + aReader.readPictureProperty( maPictureData ); + aReader.readIntProperty< sal_uInt8 >( mnPicAlign ); + aReader.readBoolProperty( mbPicTiling ); + aReader.readIntProperty< sal_uInt32 >( mnFlags ); + aReader.skipPictureProperty(); // mouse icon + return aReader.finalizeImport(); +} + +void AxImageModel::exportBinaryModel( BinaryOutputStream& rOutStrm ) +{ + AxBinaryPropertyWriter aWriter( rOutStrm ); + aWriter.skipProperty(); //undefined + aWriter.skipProperty(); //undefined + aWriter.skipProperty(); //auto-size + aWriter.writeIntProperty< sal_uInt32 >( mnBorderColor ); + if ( mnBackColor ) + aWriter.writeIntProperty< sal_uInt32 >( mnBackColor ); + else + aWriter.skipProperty(); // default backcolour + aWriter.writeIntProperty< sal_uInt8 >( mnBorderStyle ); + aWriter.skipProperty(); // mouse pointer + aWriter.writeIntProperty< sal_uInt8 >( mnPicSizeMode ); + aWriter.writeIntProperty< sal_uInt8 >( mnSpecialEffect ); + aWriter.writePairProperty( maSize ); + aWriter.skipProperty(); //maPictureData ); + aWriter.writeIntProperty< sal_uInt8 >( mnPicAlign ); + aWriter.writeBoolProperty( mbPicTiling ); + aWriter.writeIntProperty< sal_uInt32 >( mnFlags ); + aWriter.skipProperty(); // mouse icon + aWriter.finalizeExport(); +} + +void AxImageModel::exportCompObj( BinaryOutputStream& rOutStream ) +{ + // should be able to replace this hardcoded foo with + // proper export info from MS-OLEDS spec. + static sal_uInt8 const aCompObj[] = { + 0x01, 0x00, 0xFE, 0xFF, 0x03, 0x0A, 0x00, 0x00, + 0xFF, 0xFF, 0xFF, 0xFF, 0x41, 0x92, 0x59, 0x4C, + 0x26, 0x69, 0x1B, 0x10, 0x99, 0x92, 0x00, 0x00, + 0x0B, 0x65, 0xC6, 0xF9, 0x1A, 0x00, 0x00, 0x00, + 0x4D, 0x69, 0x63, 0x72, 0x6F, 0x73, 0x6F, 0x66, + 0x74, 0x20, 0x46, 0x6F, 0x72, 0x6D, 0x73, 0x20, + 0x32, 0x2E, 0x30, 0x20, 0x49, 0x6D, 0x61, 0x67, + 0x65, 0x00, 0x10, 0x00, 0x00, 0x00, 0x45, 0x6D, + 0x62, 0x65, 0x64, 0x64, 0x65, 0x64, 0x20, 0x4F, + 0x62, 0x6A, 0x65, 0x63, 0x74, 0x00, 0x0E, 0x00, + 0x00, 0x00, 0x46, 0x6F, 0x72, 0x6D, 0x73, 0x2E, + 0x49, 0x6D, 0x61, 0x67, 0x65, 0x2E, 0x31, 0x00, + 0xF4, 0x39, 0xB2, 0x71, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + }; + rOutStream.writeMemory( aCompObj, sizeof( aCompObj ) ); +} + +ApiControlType AxImageModel::getControlType() const +{ + return API_CONTROL_IMAGE; +} + +void AxImageModel::convertProperties( PropertyMap& rPropMap, const ControlConverter& rConv ) const +{ + rPropMap.setProperty( PROP_Enabled, getFlag( mnFlags, AX_FLAGS_ENABLED ) ); + rConv.convertAxBackground( rPropMap, mnBackColor, mnFlags, ApiTransparencyMode::Void ); + rConv.convertAxBorder( rPropMap, mnBorderColor, mnBorderStyle, mnSpecialEffect ); + rConv.convertAxPicture( rPropMap, maPictureData, mnPicSizeMode ); + AxControlModelBase::convertProperties( rPropMap, rConv ); +} + +AxTabStripModel::AxTabStripModel() : + mnListIndex( 0 ), + mnTabStyle( 0 ), + mnTabData( 0 ), + mnVariousPropertyBits( 0 ) +{ +} + +bool AxTabStripModel::importBinaryModel( BinaryInputStream& rInStrm ) +{ + // not worth reading much here, basically we are interested + // in whether we have tabs, the width, the height and the + // captions, everything else we can pretty much discard ( for now ) + AxBinaryPropertyReader aReader( rInStrm ); + aReader.readIntProperty< sal_uInt32 >( mnListIndex ); // ListIndex + aReader.skipIntProperty< sal_uInt32 >(); // Backcolor + aReader.skipIntProperty< sal_uInt32 >(); // ForeColor + aReader.skipUndefinedProperty(); + aReader.readPairProperty( maSize ); + aReader.readArrayStringProperty( maItems ); + aReader.skipIntProperty< sal_uInt8 >(); // MousePointer + aReader.skipUndefinedProperty(); + aReader.skipIntProperty< sal_uInt32 >(); // TabOrientation + aReader.readIntProperty< sal_uInt32 >(mnTabStyle); // TabStyle + aReader.skipBoolProperty(); // MultiRow + aReader.skipIntProperty< sal_uInt32 >(); // TabFixedWidth + aReader.skipIntProperty< sal_uInt32 >(); // TabFixedHeight + aReader.skipBoolProperty(); // ToolTips + aReader.skipUndefinedProperty(); + aReader.skipArrayStringProperty(); // ToolTip strings + aReader.skipUndefinedProperty(); + aReader.readArrayStringProperty( maTabNames ); // Tab names + aReader.readIntProperty< sal_uInt32 >(mnVariousPropertyBits); // VariousPropertyBits + aReader.skipBoolProperty();// NewVersion + aReader.skipIntProperty< sal_uInt32 >(); // TabsAllocated + aReader.skipArrayStringProperty(); // Tags + aReader.readIntProperty(mnTabData); // TabData + aReader.skipArrayStringProperty(); // Accelerators + aReader.skipPictureProperty(); // Mouse Icon + return aReader.finalizeImport() && AxFontDataModel::importBinaryModel( rInStrm ); +} + +ApiControlType AxTabStripModel::getControlType() const +{ + return API_CONTROL_TABSTRIP; +} + +AxMorphDataModelBase::AxMorphDataModelBase() : + mnTextColor( AX_SYSCOLOR_WINDOWTEXT ), + mnBackColor( AX_SYSCOLOR_WINDOWBACK ), + mnFlags( AX_MORPHDATA_DEFFLAGS ), + mnPicturePos( AX_PICPOS_ABOVECENTER ), + mnBorderColor( AX_SYSCOLOR_WINDOWFRAME ), + mnBorderStyle( AX_BORDERSTYLE_NONE ), + mnSpecialEffect( AX_SPECIALEFFECT_SUNKEN ), + mnDisplayStyle( AX_DISPLAYSTYLE_TEXT ), + mnMultiSelect( AX_SELECTION_SINGLE ), + mnScrollBars( AX_SCROLLBAR_NONE ), + mnMatchEntry( AX_MATCHENTRY_NONE ), + mnShowDropButton( AX_SHOWDROPBUTTON_NEVER ), + mnMaxLength( 0 ), + mnPasswordChar( 0 ), + mnListRows( 8 ), + mnVerticalAlign( XML_Center ) +{ +} + +void AxMorphDataModelBase::importProperty( sal_Int32 nPropId, const OUString& rValue ) +{ + switch( nPropId ) + { + case XML_Caption: maCaption = rValue; break; + case XML_Value: maValue = rValue; break; + case XML_GroupName: maGroupName = rValue; break; + case XML_ForeColor: mnTextColor = AttributeConversion::decodeUnsigned( rValue ); break; + case XML_BackColor: mnBackColor = AttributeConversion::decodeUnsigned( rValue ); break; + case XML_VariousPropertyBits: mnFlags = AttributeConversion::decodeUnsigned( rValue ); break; + case XML_PicturePosition: mnPicturePos = AttributeConversion::decodeUnsigned( rValue ); break; + case XML_BorderColor: mnBorderColor = AttributeConversion::decodeUnsigned( rValue ); break; + case XML_BorderStyle: mnBorderStyle = AttributeConversion::decodeInteger( rValue ); break; + case XML_SpecialEffect: mnSpecialEffect = AttributeConversion::decodeInteger( rValue ); break; + case XML_DisplayStyle: mnDisplayStyle = AttributeConversion::decodeInteger( rValue ); break; + case XML_MultiSelect: mnMultiSelect = AttributeConversion::decodeInteger( rValue ); break; + case XML_ScrollBars: mnScrollBars = AttributeConversion::decodeInteger( rValue ); break; + case XML_MatchEntry: mnMatchEntry = AttributeConversion::decodeInteger( rValue ); break; + case XML_ShowDropButtonWhen: mnShowDropButton = AttributeConversion::decodeInteger( rValue );break; + case XML_MaxLength: mnMaxLength = AttributeConversion::decodeInteger( rValue ); break; + case XML_PasswordChar: mnPasswordChar = AttributeConversion::decodeInteger( rValue ); break; + case XML_ListRows: mnListRows = AttributeConversion::decodeInteger( rValue ); break; + default: AxFontDataModel::importProperty( nPropId, rValue ); + } +} + +void AxMorphDataModelBase::importPictureData( sal_Int32 nPropId, BinaryInputStream& rInStrm ) +{ + switch( nPropId ) + { + case XML_Picture: OleHelper::importStdPic( maPictureData, rInStrm ); break; + default: AxFontDataModel::importPictureData( nPropId, rInStrm ); + } +} + +bool AxMorphDataModelBase::importBinaryModel( BinaryInputStream& rInStrm ) +{ + AxBinaryPropertyReader aReader( rInStrm, true ); + aReader.readIntProperty< sal_uInt32 >( mnFlags ); + aReader.readIntProperty< sal_uInt32 >( mnBackColor ); + aReader.readIntProperty< sal_uInt32 >( mnTextColor ); + aReader.readIntProperty< sal_Int32 >( mnMaxLength ); + aReader.readIntProperty< sal_uInt8 >( mnBorderStyle ); + aReader.readIntProperty< sal_uInt8 >( mnScrollBars ); + aReader.readIntProperty< sal_uInt8 >( mnDisplayStyle ); + aReader.skipIntProperty< sal_uInt8 >(); // mouse pointer + aReader.readPairProperty( maSize ); + aReader.readIntProperty< sal_uInt16 >( mnPasswordChar ); + aReader.skipIntProperty< sal_uInt32 >(); // list width + aReader.skipIntProperty< sal_uInt16 >(); // bound column + aReader.skipIntProperty< sal_Int16 >(); // text column + aReader.skipIntProperty< sal_Int16 >(); // column count + aReader.readIntProperty< sal_uInt16 >( mnListRows ); + aReader.skipIntProperty< sal_uInt16 >(); // column info count + aReader.readIntProperty< sal_uInt8 >( mnMatchEntry ); + aReader.skipIntProperty< sal_uInt8 >(); // list style + aReader.readIntProperty< sal_uInt8 >( mnShowDropButton ); + aReader.skipUndefinedProperty(); + aReader.skipIntProperty< sal_uInt8 >(); // drop down style + aReader.readIntProperty< sal_uInt8 >( mnMultiSelect ); + aReader.readStringProperty( maValue ); + aReader.readStringProperty( maCaption ); + aReader.readIntProperty< sal_uInt32 >( mnPicturePos ); + aReader.readIntProperty< sal_uInt32 >( mnBorderColor ); + aReader.readIntProperty< sal_uInt32 >( mnSpecialEffect ); + aReader.skipPictureProperty(); // mouse icon + aReader.readPictureProperty( maPictureData ); + aReader.skipIntProperty< sal_uInt16 >(); // accelerator + aReader.skipUndefinedProperty(); + aReader.skipBoolProperty(); + aReader.readStringProperty( maGroupName ); + return aReader.finalizeImport() && AxFontDataModel::importBinaryModel( rInStrm ); +} + +void AxMorphDataModelBase::exportBinaryModel( BinaryOutputStream& rOutStrm ) +{ + AxBinaryPropertyWriter aWriter( rOutStrm, true ); + if ( mnFlags != AX_MORPHDATA_DEFFLAGS ) + aWriter.writeIntProperty< sal_uInt32 >( mnFlags ); + else + aWriter.skipProperty(); //mnFlags + if ( mnBackColor ) + aWriter.writeIntProperty< sal_uInt32 >( mnBackColor ); + else + aWriter.skipProperty(); // default backcolour + aWriter.writeIntProperty< sal_uInt32 >( mnTextColor ); + + // only write if different from default + if ( ( ( mnDisplayStyle == AX_DISPLAYSTYLE_TEXT ) || ( mnDisplayStyle == AX_DISPLAYSTYLE_COMBOBOX ) ) && mnMaxLength != 0 ) + aWriter.writeIntProperty< sal_Int32 >( mnMaxLength ); + else + aWriter.skipProperty(); //mnMaxLength + if ( ( ( mnDisplayStyle == AX_DISPLAYSTYLE_COMBOBOX ) || ( mnDisplayStyle == AX_DISPLAYSTYLE_LISTBOX ) || ( mnDisplayStyle == AX_DISPLAYSTYLE_TEXT ) ) && mnBorderStyle != AX_BORDERSTYLE_NONE ) + aWriter.writeIntProperty< sal_uInt8 >( mnBorderStyle ); + else + aWriter.skipProperty(); //mnBorderStyle + + if ( ( mnDisplayStyle == AX_DISPLAYSTYLE_LISTBOX || mnDisplayStyle == AX_DISPLAYSTYLE_TEXT ) && mnScrollBars != AX_SCROLLBAR_NONE ) + aWriter.writeIntProperty< sal_uInt8 >( mnScrollBars ); + else + aWriter.skipProperty(); //mnScrollBars + aWriter.writeIntProperty< sal_uInt8 >( mnDisplayStyle ); + aWriter.skipProperty(); // mouse pointer + aWriter.writePairProperty( maSize ); + if ( mnDisplayStyle == AX_DISPLAYSTYLE_TEXT ) + aWriter.writeIntProperty< sal_uInt16 >( mnPasswordChar ); + else + aWriter.skipProperty(); // mnPasswordChar + aWriter.skipProperty(); // list width + aWriter.skipProperty(); // bound column + aWriter.skipProperty(); // text column + aWriter.skipProperty(); // column count + aWriter.skipProperty(); // mnListRows + aWriter.skipProperty(); // column info count + aWriter.skipProperty(); // mnMatchEntry + aWriter.skipProperty(); // list style + aWriter.skipProperty(); // mnShowDropButton ); + aWriter.skipProperty(); + aWriter.skipProperty(); // drop down style + if ( (mnDisplayStyle == AX_DISPLAYSTYLE_LISTBOX || mnDisplayStyle == AX_DISPLAYSTYLE_CHECKBOX) && mnMultiSelect != AX_SELECTION_SINGLE ) + aWriter.writeIntProperty< sal_uInt8 >( mnMultiSelect ); + // although CheckBox, ListBox, OptionButton, ToggleButton are also supported + // they can only have the fileformat default + else + aWriter.skipProperty(); //mnMultiSelect + aWriter.writeStringProperty( maValue ); + + if ( ( mnDisplayStyle == AX_DISPLAYSTYLE_CHECKBOX ) || ( mnDisplayStyle == AX_DISPLAYSTYLE_OPTBUTTON ) || ( mnDisplayStyle == AX_DISPLAYSTYLE_TOGGLE ) ) + aWriter.writeStringProperty( maCaption ); + else + aWriter.skipProperty(); // mnCaption + aWriter.skipProperty(); // mnPicturePos ); + if ( ( mnDisplayStyle == AX_DISPLAYSTYLE_COMBOBOX || mnDisplayStyle == AX_DISPLAYSTYLE_LISTBOX || mnDisplayStyle == AX_DISPLAYSTYLE_TEXT ) && mnBorderColor != AX_SYSCOLOR_WINDOWFRAME ) + aWriter.writeIntProperty< sal_uInt32 >( mnBorderColor ); + else + aWriter.skipProperty(); // mnBorderColor + if ( mnSpecialEffect != AX_SPECIALEFFECT_SUNKEN ) + aWriter.writeIntProperty< sal_uInt32 >( mnSpecialEffect ); + else + aWriter.skipProperty(); //mnSpecialEffect + aWriter.skipProperty(); // mouse icon + aWriter.skipProperty(); // maPictureData + aWriter.skipProperty(); // accelerator + aWriter.skipProperty(); // undefined + aWriter.writeBoolProperty(true); // must be 1 for morph + if ( mnDisplayStyle == AX_DISPLAYSTYLE_OPTBUTTON ) + aWriter.writeStringProperty( maGroupName ); + else + aWriter.skipProperty(); //maGroupName + aWriter.finalizeExport(); + AxFontDataModel::exportBinaryModel( rOutStrm ); +} + +void AxMorphDataModelBase::convertProperties( PropertyMap& rPropMap, const ControlConverter& rConv ) const +{ + rPropMap.setProperty( PROP_Enabled, getFlag( mnFlags, AX_FLAGS_ENABLED ) ); + rConv.convertColor( rPropMap, PROP_TextColor, mnTextColor ); + if ( mnDisplayStyle == AX_DISPLAYSTYLE_OPTBUTTON ) + { + // If unspecified, radio buttons autoGroup in the same document/sheet + // NOTE: form controls should not autoGroup with ActiveX controls - see drawingfragment.cxx + OUString sGroupName = !maGroupName.isEmpty() ? maGroupName : "autoGroup_"; + rPropMap.setProperty( PROP_GroupName, sGroupName ); + } + AxFontDataModel::convertProperties( rPropMap, rConv ); +} + +void AxMorphDataModelBase::convertFromProperties( PropertySet& rPropSet, const ControlConverter& rConv ) +{ + if ( mnDisplayStyle == AX_DISPLAYSTYLE_OPTBUTTON ) + rPropSet.getProperty( maGroupName, PROP_GroupName ); + AxFontDataModel::convertFromProperties( rPropSet, rConv ); +} + +AxToggleButtonModel::AxToggleButtonModel() +{ + mnDisplayStyle = AX_DISPLAYSTYLE_TOGGLE; +} + +ApiControlType AxToggleButtonModel::getControlType() const +{ + OSL_ENSURE( mnDisplayStyle == AX_DISPLAYSTYLE_TOGGLE, "AxToggleButtonModel::getControlType - invalid control type" ); + return API_CONTROL_BUTTON; +} + +void AxToggleButtonModel::convertFromProperties( PropertySet& rPropSet, const ControlConverter& rConv ) +{ + rPropSet.getProperty( maCaption, PROP_Label ); + + bool bRes = false; + if ( rPropSet.getProperty( bRes, PROP_MultiLine ) ) + setFlag( mnFlags, AX_FLAGS_WORDWRAP, bRes ); + + ControlConverter::convertToMSColor( rPropSet, PROP_BackgroundColor, mnBackColor ); + ControlConverter::convertToMSColor( rPropSet, PROP_TextColor, mnTextColor ); + // need to process the image if one exists + ControlConverter::convertToAxState( rPropSet, maValue, mnMultiSelect, API_DEFAULTSTATE_BOOLEAN ); + AxMorphDataModelBase::convertFromProperties( rPropSet, rConv ); +} + +void AxToggleButtonModel::convertProperties( PropertyMap& rPropMap, const ControlConverter& rConv ) const +{ + rPropMap.setProperty( PROP_Label, maCaption ); + rPropMap.setProperty( PROP_MultiLine, getFlag( mnFlags, AX_FLAGS_WORDWRAP ) ); + rPropMap.setProperty( PROP_Toggle, true ); + ControlConverter::convertVerticalAlign( rPropMap, mnVerticalAlign ); + rConv.convertAxBackground( rPropMap, mnBackColor, mnFlags, ApiTransparencyMode::NotSupported ); + rConv.convertAxPicture( rPropMap, maPictureData, mnPicturePos ); + ControlConverter::convertAxState( rPropMap, maValue, mnMultiSelect, API_DEFAULTSTATE_BOOLEAN, mbAwtModel ); + AxMorphDataModelBase::convertProperties( rPropMap, rConv ); +} + +void AxToggleButtonModel::exportCompObj( BinaryOutputStream& rOutStream ) +{ + // should be able to replace this hardcoded foo with + // proper export info from MS-OLEDS spec. + static sal_uInt8 const aCompObj[] = { + 0x01, 0x00, 0xFE, 0xFF, 0x03, 0x0A, 0x00, 0x00, + 0xFF, 0xFF, 0xFF, 0xFF, 0x60, 0x1D, 0xD2, 0x8B, + 0x42, 0xEC, 0xCE, 0x11, 0x9E, 0x0D, 0x00, 0xAA, + 0x00, 0x60, 0x02, 0xF3, 0x21, 0x00, 0x00, 0x00, + 0x4D, 0x69, 0x63, 0x72, 0x6F, 0x73, 0x6F, 0x66, + 0x74, 0x20, 0x46, 0x6F, 0x72, 0x6D, 0x73, 0x20, + 0x32, 0x2E, 0x30, 0x20, 0x54, 0x6F, 0x67, 0x67, + 0x6C, 0x65, 0x42, 0x75, 0x74, 0x74, 0x6F, 0x6E, + 0x00, 0x10, 0x00, 0x00, 0x00, 0x45, 0x6D, 0x62, + 0x65, 0x64, 0x64, 0x65, 0x64, 0x20, 0x4F, 0x62, + 0x6A, 0x65, 0x63, 0x74, 0x00, 0x15, 0x00, 0x00, + 0x00, 0x46, 0x6F, 0x72, 0x6D, 0x73, 0x2E, 0x54, + 0x6F, 0x67, 0x67, 0x6C, 0x65, 0x42, 0x75, 0x74, + 0x74, 0x6F, 0x6E, 0x2E, 0x31, 0x00, 0xF4, 0x39, + 0xB2, 0x71, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + }; + rOutStream.writeMemory( aCompObj, sizeof( aCompObj ) ); +} + +AxCheckBoxModel::AxCheckBoxModel() +{ + mnDisplayStyle = AX_DISPLAYSTYLE_CHECKBOX; +} + +ApiControlType AxCheckBoxModel::getControlType() const +{ + OSL_ENSURE( mnDisplayStyle == AX_DISPLAYSTYLE_CHECKBOX, "AxCheckBoxModel::getControlType - invalid control type" ); + return API_CONTROL_CHECKBOX; +} + +void AxCheckBoxModel::convertProperties( PropertyMap& rPropMap, const ControlConverter& rConv ) const +{ + rPropMap.setProperty( PROP_Label, maCaption ); + rPropMap.setProperty( PROP_MultiLine, getFlag( mnFlags, AX_FLAGS_WORDWRAP ) ); + ControlConverter::convertVerticalAlign( rPropMap, mnVerticalAlign ); + rConv.convertAxBackground( rPropMap, mnBackColor, mnFlags, ApiTransparencyMode::Void ); + ControlConverter::convertAxVisualEffect( rPropMap, mnSpecialEffect ); + rConv.convertAxPicture( rPropMap, maPictureData, mnPicturePos ); + ControlConverter::convertAxState( rPropMap, maValue, mnMultiSelect, API_DEFAULTSTATE_TRISTATE, mbAwtModel ); + AxMorphDataModelBase::convertProperties( rPropMap, rConv ); +} + +void AxCheckBoxModel::convertFromProperties( PropertySet& rPropSet, const ControlConverter& rConv ) +{ + rPropSet.getProperty( maCaption, PROP_Label ); + + bool bRes = false; + if ( rPropSet.getProperty( bRes, PROP_MultiLine ) ) + setFlag( mnFlags, AX_FLAGS_WORDWRAP, bRes ); + + ControlConverter::convertToAxVisualEffect( rPropSet, mnSpecialEffect ); + ControlConverter::convertToMSColor( rPropSet, PROP_BackgroundColor, mnBackColor ); + ControlConverter::convertToMSColor( rPropSet, PROP_TextColor, mnTextColor ); + // need to process the image if one exists + ControlConverter::convertToAxState( rPropSet, maValue, mnMultiSelect, API_DEFAULTSTATE_TRISTATE ); + AxMorphDataModelBase::convertFromProperties( rPropSet, rConv ); +} + +void AxCheckBoxModel::exportCompObj( BinaryOutputStream& rOutStream ) +{ + // should be able to replace this hardcoded foo with + // proper export info from MS-OLEDS spec. + static sal_uInt8 const aCompObj[] = { + 0x01, 0x00, 0xFE, 0xFF, 0x03, 0x0A, 0x00, 0x00, + 0xFF, 0xFF, 0xFF, 0xFF, 0x40, 0x1D, 0xD2, 0x8B, + 0x42, 0xEC, 0xCE, 0x11, 0x9E, 0x0D, 0x00, 0xAA, + 0x00, 0x60, 0x02, 0xF3, 0x1D, 0x00, 0x00, 0x00, + 0x4D, 0x69, 0x63, 0x72, 0x6F, 0x73, 0x6F, 0x66, + 0x74, 0x20, 0x46, 0x6F, 0x72, 0x6D, 0x73, 0x20, + 0x32, 0x2E, 0x30, 0x20, 0x43, 0x68, 0x65, 0x63, + 0x6B, 0x42, 0x6F, 0x78, 0x00, 0x10, 0x00, 0x00, + 0x00, 0x45, 0x6D, 0x62, 0x65, 0x64, 0x64, 0x65, + 0x64, 0x20, 0x4F, 0x62, 0x6A, 0x65, 0x63, 0x74, + 0x00, 0x11, 0x00, 0x00, 0x00, 0x46, 0x6F, 0x72, + 0x6D, 0x73, 0x2E, 0x43, 0x68, 0x65, 0x63, 0x6B, + 0x42, 0x6F, 0x78, 0x2E, 0x31, 0x00, 0xF4, 0x39, + 0xB2, 0x71, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + }; + rOutStream.writeMemory( aCompObj, sizeof( aCompObj ) ); +} + +AxOptionButtonModel::AxOptionButtonModel() +{ + mnDisplayStyle = AX_DISPLAYSTYLE_OPTBUTTON; +} + +ApiControlType AxOptionButtonModel::getControlType() const +{ + OSL_ENSURE( mnDisplayStyle == AX_DISPLAYSTYLE_OPTBUTTON, "AxOptionButtonModel::getControlType - invalid control type" ); + return API_CONTROL_RADIOBUTTON; +} + +void AxOptionButtonModel::convertProperties( PropertyMap& rPropMap, const ControlConverter& rConv ) const +{ + rPropMap.setProperty( PROP_Label, maCaption ); + rPropMap.setProperty( PROP_MultiLine, getFlag( mnFlags, AX_FLAGS_WORDWRAP ) ); + ControlConverter::convertVerticalAlign( rPropMap, mnVerticalAlign ); + rConv.convertAxBackground( rPropMap, mnBackColor, mnFlags, ApiTransparencyMode::Void ); + ControlConverter::convertAxVisualEffect( rPropMap, mnSpecialEffect ); + rConv.convertAxPicture( rPropMap, maPictureData, mnPicturePos ); + ControlConverter::convertAxState( rPropMap, maValue, mnMultiSelect, API_DEFAULTSTATE_SHORT, mbAwtModel ); + AxMorphDataModelBase::convertProperties( rPropMap, rConv ); +} + +void AxOptionButtonModel::convertFromProperties( PropertySet& rPropSet, const ControlConverter& rConv ) +{ + rPropSet.getProperty( maCaption, PROP_Label ); + + bool bRes = false; + if ( rPropSet.getProperty( bRes, PROP_MultiLine ) ) + setFlag( mnFlags, AX_FLAGS_WORDWRAP, bRes ); + + ControlConverter::convertToAxVisualEffect( rPropSet, mnSpecialEffect ); + ControlConverter::convertToMSColor( rPropSet, PROP_BackgroundColor, mnBackColor ); + ControlConverter::convertToMSColor( rPropSet, PROP_TextColor, mnTextColor ); + // need to process the image if one exists + ControlConverter::convertToAxState( rPropSet, maValue, mnMultiSelect, API_DEFAULTSTATE_BOOLEAN ); + AxMorphDataModelBase::convertFromProperties( rPropSet, rConv ); +} + +void AxOptionButtonModel::exportCompObj( BinaryOutputStream& rOutStream ) +{ + // should be able to replace this hardcoded foo with + // proper export info from MS-OLEDS spec. + static sal_uInt8 const aCompObj[] = { + 0x01, 0x00, 0xFE, 0xFF, 0x03, 0x0A, 0x00, 0x00, + 0xFF, 0xFF, 0xFF, 0xFF, 0x50, 0x1D, 0xD2, 0x8B, + 0x42, 0xEC, 0xCE, 0x11, 0x9E, 0x0D, 0x00, 0xAA, + 0x00, 0x60, 0x02, 0xF3, 0x21, 0x00, 0x00, 0x00, + 0x4D, 0x69, 0x63, 0x72, 0x6F, 0x73, 0x6F, 0x66, + 0x74, 0x20, 0x46, 0x6F, 0x72, 0x6D, 0x73, 0x20, + 0x32, 0x2E, 0x30, 0x20, 0x4F, 0x70, 0x74, 0x69, + 0x6F, 0x6E, 0x42, 0x75, 0x74, 0x74, 0x6F, 0x6E, + 0x00, 0x10, 0x00, 0x00, 0x00, 0x45, 0x6D, 0x62, + 0x65, 0x64, 0x64, 0x65, 0x64, 0x20, 0x4F, 0x62, + 0x6A, 0x65, 0x63, 0x74, 0x00, 0x15, 0x00, 0x00, + 0x00, 0x46, 0x6F, 0x72, 0x6D, 0x73, 0x2E, 0x4F, + 0x70, 0x74, 0x69, 0x6F, 0x6E, 0x42, 0x75, 0x74, + 0x74, 0x6F, 0x6E, 0x2E, 0x31, 0x00, 0xF4, 0x39, + 0xB2, 0x71, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + }; + rOutStream.writeMemory( aCompObj, sizeof( aCompObj ) ); +} + +AxTextBoxModel::AxTextBoxModel() +{ + mnDisplayStyle = AX_DISPLAYSTYLE_TEXT; +} + +ApiControlType AxTextBoxModel::getControlType() const +{ + OSL_ENSURE( mnDisplayStyle == AX_DISPLAYSTYLE_TEXT, "AxTextBoxModel::getControlType - invalid control type" ); + return API_CONTROL_EDIT; +} + +void AxTextBoxModel::convertProperties( PropertyMap& rPropMap, const ControlConverter& rConv ) const +{ + if (getFlag( mnFlags, AX_FLAGS_MULTILINE ) && getFlag( mnFlags, AX_FLAGS_WORDWRAP )) + rPropMap.setProperty( PROP_MultiLine, true ); + else + rPropMap.setProperty( PROP_MultiLine, false ); + rPropMap.setProperty( PROP_HideInactiveSelection, getFlag( mnFlags, AX_FLAGS_HIDESELECTION ) ); + rPropMap.setProperty( PROP_ReadOnly, getFlag( mnFlags, AX_FLAGS_LOCKED ) ); + rPropMap.setProperty( mbAwtModel ? PROP_Text : PROP_DefaultText, maValue ); + rPropMap.setProperty( PROP_MaxTextLen, getLimitedValue< sal_Int16, sal_Int32 >( mnMaxLength, 0, SAL_MAX_INT16 ) ); + if( (0 < mnPasswordChar) && (mnPasswordChar <= SAL_MAX_INT16) ) + rPropMap.setProperty( PROP_EchoChar, static_cast< sal_Int16 >( mnPasswordChar ) ); + rPropMap.setProperty( PROP_HScroll, getFlag( mnScrollBars, AX_SCROLLBAR_HORIZONTAL ) ); + rPropMap.setProperty( PROP_VScroll, getFlag( mnScrollBars, AX_SCROLLBAR_VERTICAL ) ); + rConv.convertAxBackground( rPropMap, mnBackColor, mnFlags, ApiTransparencyMode::Void ); + rConv.convertAxBorder( rPropMap, mnBorderColor, mnBorderStyle, mnSpecialEffect ); + AxMorphDataModelBase::convertProperties( rPropMap, rConv ); +} + +void AxTextBoxModel::convertFromProperties( PropertySet& rPropSet, const ControlConverter& rConv ) +{ + bool bRes = false; + if ( rPropSet.getProperty( bRes, PROP_MultiLine ) ) { + setFlag( mnFlags, AX_FLAGS_WORDWRAP, bRes ); + setFlag( mnFlags, AX_FLAGS_MULTILINE, bRes ); + } + if ( rPropSet.getProperty( bRes, PROP_HideInactiveSelection ) ) + setFlag( mnFlags, AX_FLAGS_HIDESELECTION, bRes ); + if ( rPropSet.getProperty( bRes, PROP_ReadOnly ) ) + setFlag( mnFlags, AX_FLAGS_LOCKED, bRes ); + rPropSet.getProperty( maValue, ( mbAwtModel ? PROP_Text : PROP_DefaultText ) ); + if (maValue.isEmpty() && !mbAwtModel) + // No default value? Then try exporting the current one. + rPropSet.getProperty( maValue, PROP_Text); + sal_Int16 nTmp(0); + if ( rPropSet.getProperty( nTmp, PROP_MaxTextLen ) ) + mnMaxLength = nTmp; + if ( rPropSet.getProperty( nTmp, PROP_EchoChar ) ) + mnPasswordChar = nTmp; + if ( rPropSet.getProperty( bRes, PROP_HScroll ) ) + setFlag( mnScrollBars, AX_SCROLLBAR_HORIZONTAL, bRes ); + if ( rPropSet.getProperty( bRes, PROP_VScroll ) ) + setFlag( mnScrollBars, AX_SCROLLBAR_VERTICAL, bRes ); + + ControlConverter::convertToMSColor( rPropSet, PROP_BackgroundColor, mnBackColor, 0x80000005L ); + ControlConverter::convertToMSColor( rPropSet, PROP_TextColor, mnTextColor ); + + ControlConverter::convertToAxBorder( rPropSet, mnBorderColor, mnBorderStyle, mnSpecialEffect ); + AxMorphDataModelBase::convertFromProperties( rPropSet, rConv ); +} + +void AxTextBoxModel::exportCompObj( BinaryOutputStream& rOutStream ) +{ + // should be able to replace this hardcoded foo with + // proper export info from MS-OLEDS spec. + static sal_uInt8 const aCompObj[] = { + 0x01, 0x00, 0xFE, 0xFF, 0x03, 0x0A, 0x00, 0x00, + 0xFF, 0xFF, 0xFF, 0xFF, 0x10, 0x1D, 0xD2, 0x8B, + 0x42, 0xEC, 0xCE, 0x11, 0x9E, 0x0D, 0x00, 0xAA, + 0x00, 0x60, 0x02, 0xF3, 0x1C, 0x00, 0x00, 0x00, + 0x4D, 0x69, 0x63, 0x72, 0x6F, 0x73, 0x6F, 0x66, + 0x74, 0x20, 0x46, 0x6F, 0x72, 0x6D, 0x73, 0x20, + 0x32, 0x2E, 0x30, 0x20, 0x54, 0x65, 0x78, 0x74, + 0x42, 0x6F, 0x78, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x45, 0x6D, 0x62, 0x65, 0x64, 0x64, 0x65, 0x64, + 0x20, 0x4F, 0x62, 0x6A, 0x65, 0x63, 0x74, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x46, 0x6F, 0x72, 0x6D, + 0x73, 0x2E, 0x54, 0x65, 0x78, 0x74, 0x42, 0x6F, + 0x78, 0x2E, 0x31, 0x00, 0xF4, 0x39, 0xB2, 0x71, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00 + }; + rOutStream.writeMemory( aCompObj, sizeof( aCompObj ) ); +} + +AxNumericFieldModel::AxNumericFieldModel() +{ + mnDisplayStyle = AX_DISPLAYSTYLE_TEXT; +} + +ApiControlType AxNumericFieldModel::getControlType() const +{ + OSL_ENSURE( mnDisplayStyle == AX_DISPLAYSTYLE_TEXT, "AxNumericFieldModel::getControlType - invalid control type" ); + return API_CONTROL_NUMERIC; +} + +void AxNumericFieldModel::convertProperties( PropertyMap& rPropMap, const ControlConverter& rConv ) const +{ + rPropMap.setProperty( PROP_HideInactiveSelection, getFlag( mnFlags, AX_FLAGS_HIDESELECTION ) ); + // TODO: OUString::toDouble() does not handle local decimal separator + rPropMap.setProperty( mbAwtModel ? PROP_Value : PROP_DefaultValue, maValue.toDouble() ); + rPropMap.setProperty( PROP_Spin, getFlag( mnScrollBars, AX_SCROLLBAR_VERTICAL ) ); + rPropMap.setProperty( PROP_Repeat, true ); + rConv.convertAxBackground( rPropMap, mnBackColor, mnFlags, ApiTransparencyMode::Void ); + rConv.convertAxBorder( rPropMap, mnBorderColor, mnBorderStyle, mnSpecialEffect ); + AxMorphDataModelBase::convertProperties( rPropMap, rConv ); +} + +void AxNumericFieldModel::convertFromProperties( PropertySet& rPropSet, const ControlConverter& rConv ) +{ + bool bRes = false; + if ( rPropSet.getProperty( bRes, PROP_HideInactiveSelection ) ) + setFlag( mnFlags, AX_FLAGS_HIDESELECTION, bRes ); + rPropSet.getProperty( maValue, ( mbAwtModel ? PROP_Text : PROP_DefaultText ) ); + if ( rPropSet.getProperty( bRes, PROP_Spin ) ) + setFlag( mnScrollBars, AX_SCROLLBAR_VERTICAL, bRes ); + + ControlConverter::convertToMSColor( rPropSet, PROP_BackgroundColor, mnBackColor ); + ControlConverter::convertToMSColor( rPropSet, PROP_TextColor, mnTextColor ); + + ControlConverter::convertToAxBorder( rPropSet, mnBorderColor, mnBorderStyle, mnSpecialEffect ); + AxMorphDataModelBase::convertFromProperties( rPropSet, rConv ); +} + +void AxNumericFieldModel::exportCompObj( BinaryOutputStream& rOutStream ) +{ + // should be able to replace this hardcoded foo with + // proper export info from MS-OLEDS spec. + static sal_uInt8 const aCompObj[] = { + 0x01, 0x00, 0xFE, 0xFF, 0x03, 0x0A, 0x00, 0x00, + 0xFF, 0xFF, 0xFF, 0xFF, 0x10, 0x1D, 0xD2, 0x8B, + 0x42, 0xEC, 0xCE, 0x11, 0x9E, 0x0D, 0x00, 0xAA, + 0x00, 0x60, 0x02, 0xF3, 0x1C, 0x00, 0x00, 0x00, + 0x4D, 0x69, 0x63, 0x72, 0x6F, 0x73, 0x6F, 0x66, + 0x74, 0x20, 0x46, 0x6F, 0x72, 0x6D, 0x73, 0x20, + 0x32, 0x2E, 0x30, 0x20, 0x54, 0x65, 0x78, 0x74, + 0x42, 0x6F, 0x78, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x45, 0x6D, 0x62, 0x65, 0x64, 0x64, 0x65, 0x64, + 0x20, 0x4F, 0x62, 0x6A, 0x65, 0x63, 0x74, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x46, 0x6F, 0x72, 0x6D, + 0x73, 0x2E, 0x54, 0x65, 0x78, 0x74, 0x42, 0x6F, + 0x78, 0x2E, 0x31, 0x00, 0xF4, 0x39, 0xB2, 0x71, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00 + }; + rOutStream.writeMemory( aCompObj, sizeof( aCompObj ) ); +} + +AxListBoxModel::AxListBoxModel() +{ + mnDisplayStyle = AX_DISPLAYSTYLE_LISTBOX; +} + +ApiControlType AxListBoxModel::getControlType() const +{ + OSL_ENSURE( mnDisplayStyle == AX_DISPLAYSTYLE_LISTBOX, "AxListBoxModel::getControlType - invalid control type" ); + return API_CONTROL_LISTBOX; +} + +void AxListBoxModel::convertProperties( PropertyMap& rPropMap, const ControlConverter& rConv ) const +{ + bool bMultiSelect = (mnMultiSelect == AX_SELECTION_MULTI) || (mnMultiSelect == AX_SELECTION_EXTENDED); + rPropMap.setProperty( PROP_MultiSelection, bMultiSelect ); + rPropMap.setProperty( PROP_Dropdown, false ); + rConv.convertAxBackground( rPropMap, mnBackColor, mnFlags, ApiTransparencyMode::Void ); + rConv.convertAxBorder( rPropMap, mnBorderColor, mnBorderStyle, mnSpecialEffect ); + AxMorphDataModelBase::convertProperties( rPropMap, rConv ); +} + +void AxListBoxModel::convertFromProperties( PropertySet& rPropSet, const ControlConverter& rConv ) +{ + bool bRes = false; + if ( rPropSet.getProperty( bRes, PROP_MultiSelection ) ) + ControlConverter::convertToMSColor( rPropSet, PROP_BackgroundColor, mnBackColor ); + + ControlConverter::convertToAxBorder( rPropSet, mnBorderColor, mnBorderStyle, mnSpecialEffect ); + ControlConverter::convertToMSColor( rPropSet, PROP_TextColor, mnTextColor ); + AxMorphDataModelBase::convertFromProperties( rPropSet, rConv ); +} + +void AxListBoxModel::exportCompObj( BinaryOutputStream& rOutStream ) +{ + // should be able to replace this hardcoded foo with + // proper export info from MS-OLEDS spec. + static sal_uInt8 const aCompObj[] = { + 0x01, 0x00, 0xFE, 0xFF, 0x03, 0x0A, 0x00, 0x00, + 0xFF, 0xFF, 0xFF, 0xFF, 0x20, 0x1D, 0xD2, 0x8B, + 0x42, 0xEC, 0xCE, 0x11, 0x9E, 0x0D, 0x00, 0xAA, + 0x00, 0x60, 0x02, 0xF3, 0x1C, 0x00, 0x00, 0x00, + 0x4D, 0x69, 0x63, 0x72, 0x6F, 0x73, 0x6F, 0x66, + 0x74, 0x20, 0x46, 0x6F, 0x72, 0x6D, 0x73, 0x20, + 0x32, 0x2E, 0x30, 0x20, 0x4C, 0x69, 0x73, 0x74, + 0x42, 0x6F, 0x78, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x45, 0x6D, 0x62, 0x65, 0x64, 0x64, 0x65, 0x64, + 0x20, 0x4F, 0x62, 0x6A, 0x65, 0x63, 0x74, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x46, 0x6F, 0x72, 0x6D, + 0x73, 0x2E, 0x4C, 0x69, 0x73, 0x74, 0x42, 0x6F, + 0x78, 0x2E, 0x31, 0x00, 0xF4, 0x39, 0xB2, 0x71, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00 + }; + rOutStream.writeMemory( aCompObj, sizeof( aCompObj ) ); +} + +AxComboBoxModel::AxComboBoxModel() +{ + mnDisplayStyle = AX_DISPLAYSTYLE_COMBOBOX; + mnFlags = 0x2c80481b; +} + +ApiControlType AxComboBoxModel::getControlType() const +{ + OSL_ENSURE( (mnDisplayStyle == AX_DISPLAYSTYLE_COMBOBOX) || (mnDisplayStyle == AX_DISPLAYSTYLE_DROPDOWN), "AxComboBoxModel::getControlType - invalid control type" ); + return (mnDisplayStyle == AX_DISPLAYSTYLE_DROPDOWN) ? API_CONTROL_LISTBOX : API_CONTROL_COMBOBOX; +} + +void AxComboBoxModel::convertProperties( PropertyMap& rPropMap, const ControlConverter& rConv ) const +{ + if( mnDisplayStyle != AX_DISPLAYSTYLE_DROPDOWN ) + { + rPropMap.setProperty( PROP_HideInactiveSelection, getFlag( mnFlags, AX_FLAGS_HIDESELECTION ) ); + rPropMap.setProperty( mbAwtModel ? PROP_Text : PROP_DefaultText, maValue ); + rPropMap.setProperty( PROP_MaxTextLen, getLimitedValue< sal_Int16, sal_Int32 >( mnMaxLength, 0, SAL_MAX_INT16 ) ); + bool bAutoComplete = (mnMatchEntry == AX_MATCHENTRY_FIRSTLETTER) || (mnMatchEntry == AX_MATCHENTRY_COMPLETE); + rPropMap.setProperty( PROP_Autocomplete, bAutoComplete ); + } + bool bShowDropdown = (mnShowDropButton == AX_SHOWDROPBUTTON_FOCUS) || (mnShowDropButton == AX_SHOWDROPBUTTON_ALWAYS); + rPropMap.setProperty( PROP_Dropdown, bShowDropdown ); + rPropMap.setProperty( PROP_LineCount, getLimitedValue< sal_Int16, sal_Int32 >( mnListRows, 1, SAL_MAX_INT16 ) ); + rConv.convertAxBackground( rPropMap, mnBackColor, mnFlags, ApiTransparencyMode::Void ); + rConv.convertAxBorder( rPropMap, mnBorderColor, mnBorderStyle, mnSpecialEffect ); + AxMorphDataModelBase::convertProperties( rPropMap, rConv ); +} + +void AxComboBoxModel::convertFromProperties( PropertySet& rPropSet, const ControlConverter& rConv ) +{ + // when would we have mnDisplayStyle = AX_DISPLAYSTYLE_DROPDOWN ? + // #TODO check against msocximex + mnDisplayStyle = AX_DISPLAYSTYLE_COMBOBOX; + bool bRes = false; + + if ( rPropSet.getProperty( bRes, PROP_HideInactiveSelection ) ) + setFlag( mnFlags, AX_FLAGS_HIDESELECTION, bRes ); + rPropSet.getProperty( maValue, ( mbAwtModel ? PROP_Text : PROP_DefaultText ) ); + + sal_Int16 nTmp(0); + if ( rPropSet.getProperty( nTmp, PROP_MaxTextLen ) ) + mnMaxLength = nTmp; + if ( rPropSet.getProperty( bRes, PROP_Autocomplete ) ) + { + // when to choose AX_MATCHENTRY_FIRSTLETTER ? + // #TODO check against msocximex + if ( bRes ) + mnMatchEntry = AX_MATCHENTRY_COMPLETE; + } + if ( rPropSet.getProperty( bRes, PROP_Dropdown ) ) + { + rPropSet.getProperty( mnListRows, PROP_LineCount ); + if ( !mnListRows ) + mnListRows = 1; + } + ControlConverter::convertToMSColor( rPropSet, PROP_BackgroundColor, mnBackColor ); + ControlConverter::convertToMSColor( rPropSet, PROP_TextColor, mnTextColor ); + + ControlConverter::convertToAxBorder( rPropSet, mnBorderColor, mnBorderStyle, mnSpecialEffect ); + AxMorphDataModelBase::convertFromProperties( rPropSet, rConv ); +} + +void AxComboBoxModel::exportCompObj( BinaryOutputStream& rOutStream ) +{ + // should be able to replace this hardcoded foo with + // proper export info from MS-OLEDS spec. + static sal_uInt8 const aCompObj[] = { + 0x01, 0x00, 0xFE, 0xFF, 0x03, 0x0A, 0x00, 0x00, + 0xFF, 0xFF, 0xFF, 0xFF, 0x30, 0x1D, 0xD2, 0x8B, + 0x42, 0xEC, 0xCE, 0x11, 0x9E, 0x0D, 0x00, 0xAA, + 0x00, 0x60, 0x02, 0xF3, 0x1D, 0x00, 0x00, 0x00, + 0x4D, 0x69, 0x63, 0x72, 0x6F, 0x73, 0x6F, 0x66, + 0x74, 0x20, 0x46, 0x6F, 0x72, 0x6D, 0x73, 0x20, + 0x32, 0x2E, 0x30, 0x20, 0x43, 0x6F, 0x6D, 0x62, + 0x6F, 0x42, 0x6F, 0x78, 0x00, 0x10, 0x00, 0x00, + 0x00, 0x45, 0x6D, 0x62, 0x65, 0x64, 0x64, 0x65, + 0x64, 0x20, 0x4F, 0x62, 0x6A, 0x65, 0x63, 0x74, + 0x00, 0x11, 0x00, 0x00, 0x00, 0x46, 0x6F, 0x72, + 0x6D, 0x73, 0x2E, 0x43, 0x6F, 0x6D, 0x62, 0x6F, + 0x42, 0x6F, 0x78, 0x2E, 0x31, 0x00, 0xF4, 0x39, + 0xB2, 0x71, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + }; + rOutStream.writeMemory( aCompObj, sizeof( aCompObj ) ); +} + +AxSpinButtonModel::AxSpinButtonModel() : + mnArrowColor( AX_SYSCOLOR_BUTTONTEXT ), + mnBackColor( AX_SYSCOLOR_BUTTONFACE ), + mnFlags( AX_SPINBUTTON_DEFFLAGS ), + mnOrientation( AX_ORIENTATION_AUTO ), + mnMin( 0 ), + mnMax( 100 ), + mnPosition( 0 ), + mnSmallChange( 1 ), + mnDelay( 50 ) +{ +} + +ApiControlType AxSpinButtonModel::getControlType() const +{ + return API_CONTROL_SPINBUTTON; +} + +void AxSpinButtonModel::importProperty( sal_Int32 nPropId, const OUString& rValue ) +{ + switch( nPropId ) + { + case XML_ForeColor: mnArrowColor = AttributeConversion::decodeUnsigned( rValue ); break; + case XML_BackColor: mnBackColor = AttributeConversion::decodeUnsigned( rValue ); break; + case XML_VariousPropertyBits: mnFlags = AttributeConversion::decodeUnsigned( rValue ); break; + case XML_Orientation: mnOrientation = AttributeConversion::decodeInteger( rValue ); break; + case XML_Min: mnMin = AttributeConversion::decodeInteger( rValue ); break; + case XML_Max: mnMax = AttributeConversion::decodeInteger( rValue ); break; + case XML_Position: mnPosition = AttributeConversion::decodeInteger( rValue ); break; + case XML_SmallChange: mnSmallChange = AttributeConversion::decodeInteger( rValue ); break; + case XML_Delay: mnDelay = AttributeConversion::decodeInteger( rValue ); break; + default: AxControlModelBase::importProperty( nPropId, rValue ); + } +} + +bool AxSpinButtonModel::importBinaryModel( BinaryInputStream& rInStrm ) +{ + AxBinaryPropertyReader aReader( rInStrm ); + aReader.readIntProperty< sal_uInt32 >( mnArrowColor ); + aReader.readIntProperty< sal_uInt32 >( mnBackColor ); + aReader.readIntProperty< sal_uInt32 >( mnFlags ); + aReader.readPairProperty( maSize ); + aReader.skipIntProperty< sal_uInt32 >(); // unused + aReader.readIntProperty< sal_Int32 >( mnMin ); + aReader.readIntProperty< sal_Int32 >( mnMax ); + aReader.readIntProperty< sal_Int32 >( mnPosition ); + aReader.skipIntProperty< sal_uInt32 >(); // prev enabled + aReader.skipIntProperty< sal_uInt32 >(); // next enabled + aReader.readIntProperty< sal_Int32 >( mnSmallChange ); + aReader.readIntProperty< sal_Int32 >( mnOrientation ); + aReader.readIntProperty< sal_Int32 >( mnDelay ); + aReader.skipPictureProperty(); // mouse icon + aReader.skipIntProperty< sal_uInt8 >(); // mouse pointer + return aReader.finalizeImport(); +} + +void AxSpinButtonModel::exportBinaryModel( BinaryOutputStream& rOutStrm ) +{ + AxBinaryPropertyWriter aWriter( rOutStrm ); + aWriter.writeIntProperty< sal_uInt32 >( mnArrowColor ); + if ( mnBackColor ) + aWriter.writeIntProperty< sal_uInt32 >( mnBackColor ); + else + aWriter.skipProperty(); // default backcolour + aWriter.writeIntProperty< sal_uInt32 >( mnFlags ); + aWriter.writePairProperty( maSize ); + aWriter.skipProperty(); // unused + aWriter.writeIntProperty< sal_Int32 >( mnMin ); + aWriter.writeIntProperty< sal_Int32 >( mnMax ); + aWriter.writeIntProperty< sal_Int32 >( mnPosition ); + aWriter.skipProperty(); // prev enabled + aWriter.skipProperty(); // next enabled + aWriter.writeIntProperty< sal_Int32 >( mnSmallChange ); + aWriter.writeIntProperty< sal_Int32 >( mnOrientation ); + aWriter.writeIntProperty< sal_Int32 >( mnDelay ); + aWriter.skipProperty(); // mouse icon + aWriter.skipProperty(); // mouse pointer + + aWriter.finalizeExport(); +} + +void AxSpinButtonModel::convertProperties( PropertyMap& rPropMap, const ControlConverter& rConv ) const +{ + sal_Int32 nMin = ::std::min( mnMin, mnMax ); + sal_Int32 nMax = ::std::max( mnMin, mnMax ); + rPropMap.setProperty( PROP_Enabled, getFlag( mnFlags, AX_FLAGS_ENABLED ) ); + rPropMap.setProperty( PROP_SpinValueMin, nMin ); + rPropMap.setProperty( PROP_SpinValueMax, nMax ); + rPropMap.setProperty( PROP_SpinIncrement, mnSmallChange ); + rPropMap.setProperty( mbAwtModel ? PROP_SpinValue : PROP_DefaultSpinValue, mnPosition ); + rPropMap.setProperty( PROP_Repeat, true ); + rPropMap.setProperty( PROP_RepeatDelay, mnDelay ); + rPropMap.setProperty( PROP_Border, API_BORDER_NONE ); + rConv.convertColor( rPropMap, PROP_SymbolColor, mnArrowColor ); + rConv.convertAxBackground( rPropMap, mnBackColor, mnFlags, ApiTransparencyMode::NotSupported ); + ControlConverter::convertAxOrientation( rPropMap, maSize, mnOrientation ); + AxControlModelBase::convertProperties( rPropMap, rConv ); +} + +void AxSpinButtonModel::convertFromProperties( PropertySet& rPropSet, const ControlConverter& ) +{ + bool bRes = false; + if ( rPropSet.getProperty( bRes, PROP_Enabled ) ) + setFlag( mnFlags, AX_FLAGS_ENABLED, bRes ); + rPropSet.getProperty( mnMin, PROP_SpinValueMin ); + rPropSet.getProperty( mnMax, PROP_SpinValueMax ); + rPropSet.getProperty( mnSmallChange, PROP_SpinIncrement ); + rPropSet.getProperty( mnPosition, ( mbAwtModel ? PROP_SpinValue : PROP_DefaultSpinValue ) ); + rPropSet.getProperty( mnDelay, PROP_RepeatDelay ); + ControlConverter::convertToMSColor( rPropSet, PROP_SymbolColor, mnArrowColor); + ControlConverter::convertToMSColor( rPropSet, PROP_BackgroundColor, mnBackColor ); + + ControlConverter::convertToAxOrientation( rPropSet, mnOrientation ); +} + +void AxSpinButtonModel::exportCompObj( BinaryOutputStream& rOutStream ) +{ + // should be able to replace this hardcoded foo with + // proper export info from MS-OLEDS spec. + static sal_uInt8 const aCompObj[] = + { + 0x01, 0x00, 0xFE, 0xFF, 0x03, 0x0A, 0x00, 0x00, + 0xFF, 0xFF, 0xFF, 0xFF, 0xB0, 0x6F, 0x17, 0x79, + 0xF2, 0xB7, 0xCE, 0x11, 0x97, 0xEF, 0x00, 0xAA, + 0x00, 0x6D, 0x27, 0x76, 0x1F, 0x00, 0x00, 0x00, + 0x4D, 0x69, 0x63, 0x72, 0x6F, 0x73, 0x6F, 0x66, + 0x74, 0x20, 0x46, 0x6F, 0x72, 0x6D, 0x73, 0x20, + 0x32, 0x2E, 0x30, 0x20, 0x53, 0x70, 0x69, 0x6E, + 0x42, 0x75, 0x74, 0x74, 0x6F, 0x6E, 0x00, 0x10, + 0x00, 0x00, 0x00, 0x45, 0x6D, 0x62, 0x65, 0x64, + 0x64, 0x65, 0x64, 0x20, 0x4F, 0x62, 0x6A, 0x65, + 0x63, 0x74, 0x00, 0x13, 0x00, 0x00, 0x00, 0x46, + 0x6F, 0x72, 0x6D, 0x73, 0x2E, 0x53, 0x70, 0x69, + 0x6E, 0x42, 0x75, 0x74, 0x74, 0x6F, 0x6E, 0x2E, + 0x31, 0x00, 0xF4, 0x39, 0xB2, 0x71, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00 + }; + + rOutStream.writeMemory( aCompObj, sizeof( aCompObj ) ); +} + +AxScrollBarModel::AxScrollBarModel() : + mnArrowColor( AX_SYSCOLOR_BUTTONTEXT ), + mnBackColor( AX_SYSCOLOR_BUTTONFACE ), + mnFlags( AX_SCROLLBAR_DEFFLAGS ), + mnOrientation( AX_ORIENTATION_AUTO ), + mnPropThumb( AX_PROPTHUMB_ON ), + mnMin( 0 ), + mnMax( 32767 ), + mnPosition( 0 ), + mnSmallChange( 1 ), + mnLargeChange( 1 ), + mnDelay( 50 ) +{ +} + +ApiControlType AxScrollBarModel::getControlType() const +{ + return API_CONTROL_SCROLLBAR; +} + +void AxScrollBarModel::importProperty( sal_Int32 nPropId, const OUString& rValue ) +{ + switch( nPropId ) + { + case XML_ForeColor: mnArrowColor = AttributeConversion::decodeUnsigned( rValue ); break; + case XML_BackColor: mnBackColor = AttributeConversion::decodeUnsigned( rValue ); break; + case XML_VariousPropertyBits: mnFlags = AttributeConversion::decodeUnsigned( rValue ); break; + case XML_Orientation: mnOrientation = AttributeConversion::decodeInteger( rValue ); break; + case XML_ProportionalThumb: mnPropThumb = AttributeConversion::decodeInteger( rValue ); break; + case XML_Min: mnMin = AttributeConversion::decodeInteger( rValue ); break; + case XML_Max: mnMax = AttributeConversion::decodeInteger( rValue ); break; + case XML_Position: mnPosition = AttributeConversion::decodeInteger( rValue ); break; + case XML_SmallChange: mnSmallChange = AttributeConversion::decodeInteger( rValue ); break; + case XML_LargeChange: mnLargeChange = AttributeConversion::decodeInteger( rValue ); break; + case XML_Delay: mnDelay = AttributeConversion::decodeInteger( rValue ); break; + default: AxControlModelBase::importProperty( nPropId, rValue ); + } +} + +bool AxScrollBarModel::importBinaryModel( BinaryInputStream& rInStrm ) +{ + AxBinaryPropertyReader aReader( rInStrm ); + aReader.readIntProperty< sal_uInt32 >( mnArrowColor ); + aReader.readIntProperty< sal_uInt32 >( mnBackColor ); + aReader.readIntProperty< sal_uInt32 >( mnFlags ); + aReader.readPairProperty( maSize ); + aReader.skipIntProperty< sal_uInt8 >(); // mouse pointer + aReader.readIntProperty< sal_Int32 >( mnMin ); + aReader.readIntProperty< sal_Int32 >( mnMax ); + aReader.readIntProperty< sal_Int32 >( mnPosition ); + aReader.skipIntProperty< sal_uInt32 >(); // unused + aReader.skipIntProperty< sal_uInt32 >(); // prev enabled + aReader.skipIntProperty< sal_uInt32 >(); // next enabled + aReader.readIntProperty< sal_Int32 >( mnSmallChange ); + aReader.readIntProperty< sal_Int32 >( mnLargeChange ); + aReader.readIntProperty< sal_Int32 >( mnOrientation ); + aReader.readIntProperty< sal_Int16 >( mnPropThumb ); + aReader.readIntProperty< sal_Int32 >( mnDelay ); + aReader.skipPictureProperty(); // mouse icon + return aReader.finalizeImport(); +} + +void AxScrollBarModel::exportBinaryModel( BinaryOutputStream& rOutStrm ) +{ + AxBinaryPropertyWriter aWriter( rOutStrm ); + aWriter.writeIntProperty< sal_uInt32 >( mnArrowColor ); + if ( mnBackColor ) + aWriter.writeIntProperty< sal_uInt32 >( mnBackColor ); + else + aWriter.skipProperty(); // default backcolour + aWriter.writeIntProperty< sal_uInt32 >( mnFlags ); + aWriter.writePairProperty( maSize ); + aWriter.skipProperty(); // mouse pointer + aWriter.writeIntProperty< sal_Int32 >( mnMin ); + aWriter.writeIntProperty< sal_Int32 >( mnMax ); + aWriter.writeIntProperty< sal_Int32 >( mnPosition ); + aWriter.skipProperty(); // unused + aWriter.skipProperty(); // prev enabled + aWriter.skipProperty(); // next enabled + aWriter.writeIntProperty< sal_Int32 >( mnSmallChange ); + aWriter.writeIntProperty< sal_Int32 >( mnLargeChange ); + aWriter.writeIntProperty< sal_Int32 >( mnOrientation ); + aWriter.writeIntProperty< sal_Int16 >( mnPropThumb ); + aWriter.writeIntProperty< sal_Int32 >( mnDelay ); + aWriter.skipProperty(); // mouse icon + aWriter.finalizeExport(); +} + +void AxScrollBarModel::exportCompObj( BinaryOutputStream& rOutStream ) +{ + // should be able to replace this hardcoded foo with + // proper export info from MS-OLEDS spec. + static sal_uInt8 const aCompObj[] = + { + 0x01, 0x00, 0xFE, 0xFF, 0x03, 0x0A, 0x00, 0x00, + 0xFF, 0xFF, 0xFF, 0xFF, 0xE0, 0x81, 0xD1, 0xDF, + 0x2F, 0x5E, 0xCE, 0x11, 0xA4, 0x49, 0x00, 0xAA, + 0x00, 0x4A, 0x80, 0x3D, 0x1E, 0x00, 0x00, 0x00, + 0x4D, 0x69, 0x63, 0x72, 0x6F, 0x73, 0x6F, 0x66, + 0x74, 0x20, 0x46, 0x6F, 0x72, 0x6D, 0x73, 0x20, + 0x32, 0x2E, 0x30, 0x20, 0x53, 0x63, 0x72, 0x6F, + 0x6C, 0x6C, 0x42, 0x61, 0x72, 0x00, 0x10, 0x00, + 0x00, 0x00, 0x45, 0x6D, 0x62, 0x65, 0x64, 0x64, + 0x65, 0x64, 0x20, 0x4F, 0x62, 0x6A, 0x65, 0x63, + 0x74, 0x00, 0x12, 0x00, 0x00, 0x00, 0x46, 0x6F, + 0x72, 0x6D, 0x73, 0x2E, 0x53, 0x63, 0x72, 0x6F, + 0x6C, 0x6C, 0x42, 0x61, 0x72, 0x2E, 0x31, 0x00, + 0xF4, 0x39, 0xB2, 0x71, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + }; + rOutStream.writeMemory( aCompObj, sizeof( aCompObj ) ); +} + +void AxScrollBarModel::convertProperties( PropertyMap& rPropMap, const ControlConverter& rConv ) const +{ + rPropMap.setProperty( PROP_Enabled, getFlag( mnFlags, AX_FLAGS_ENABLED ) ); + rPropMap.setProperty( PROP_RepeatDelay, mnDelay ); + rPropMap.setProperty( PROP_Border, API_BORDER_NONE ); + if( (mnPropThumb == AX_PROPTHUMB_ON) && (mnMin != mnMax) && (mnLargeChange > 0) ) + { + // use double to prevent integer overflow in division (fInterval+mnLargeChange may become 0 when performed as int) + double fInterval = fabs( static_cast< double >( mnMax - mnMin ) ); + sal_Int32 nThumbLen = getLimitedValue< sal_Int32, double >( (fInterval * mnLargeChange) / (fInterval + mnLargeChange), 1, SAL_MAX_INT32 ); + rPropMap.setProperty( PROP_VisibleSize, nThumbLen ); + } + rConv.convertColor( rPropMap, PROP_SymbolColor, mnArrowColor ); + rConv.convertAxBackground( rPropMap, mnBackColor, mnFlags, ApiTransparencyMode::NotSupported ); + ControlConverter::convertAxOrientation( rPropMap, maSize, mnOrientation ); + ControlConverter::convertScrollBar( rPropMap, mnMin, mnMax, mnPosition, mnSmallChange, mnLargeChange, mbAwtModel ); + AxControlModelBase::convertProperties( rPropMap, rConv ); +} + +void AxScrollBarModel::convertFromProperties( PropertySet& rPropSet, const ControlConverter& ) +{ + bool bRes = false; + if ( rPropSet.getProperty( bRes, PROP_Enabled ) ) + setFlag( mnFlags, AX_FLAGS_ENABLED, bRes ); + rPropSet.getProperty( mnDelay, PROP_RepeatDelay ); + mnPropThumb = AX_PROPTHUMB_ON; // default + ControlConverter::convertToMSColor( rPropSet, PROP_SymbolColor, mnArrowColor); + ControlConverter::convertToMSColor( rPropSet, PROP_BackgroundColor, mnBackColor ); + ControlConverter::convertToAxOrientation( rPropSet, mnOrientation ); + + rPropSet.getProperty( mnMin, PROP_ScrollValueMin ); + rPropSet.getProperty( mnMax, PROP_ScrollValueMax ); + rPropSet.getProperty( mnSmallChange, PROP_LineIncrement ); + rPropSet.getProperty( mnLargeChange, PROP_BlockIncrement ); + rPropSet.getProperty( mnPosition, ( mbAwtModel ? PROP_ScrollValue : PROP_DefaultScrollValue ) ); + +} + +AxContainerModelBase::AxContainerModelBase( bool bFontSupport ) : + AxFontDataModel( false ), // no support for alignment properties + maLogicalSize( AX_CONTAINER_DEFWIDTH, AX_CONTAINER_DEFHEIGHT ), + maScrollPos( 0, 0 ), + mnBackColor( AX_SYSCOLOR_BUTTONFACE ), + mnTextColor( AX_SYSCOLOR_BUTTONTEXT ), + mnFlags( AX_CONTAINER_DEFFLAGS ), + mnBorderColor( AX_SYSCOLOR_BUTTONTEXT ), + mnBorderStyle( AX_BORDERSTYLE_NONE ), + mnScrollBars( AX_CONTAINER_SCR_NONE ), + mnCycleType( AX_CONTAINER_CYCLEALL ), + mnSpecialEffect( AX_SPECIALEFFECT_FLAT ), + mnPicAlign( AX_PICALIGN_CENTER ), + mnPicSizeMode( AX_PICSIZE_CLIP ), + mbPicTiling( false ), + mbFontSupport( bFontSupport ) +{ + setAwtModelMode(); + // different default size for frame + maSize = AxPairData( AX_CONTAINER_DEFWIDTH, AX_CONTAINER_DEFHEIGHT ); +} + +void AxContainerModelBase::importProperty( sal_Int32 nPropId, const OUString& rValue ) +{ + if( nPropId == XML_Caption ) + maCaption = rValue; +} + +bool AxContainerModelBase::importBinaryModel( BinaryInputStream& rInStrm ) +{ + AxBinaryPropertyReader aReader( rInStrm ); + aReader.skipUndefinedProperty(); + aReader.readIntProperty< sal_uInt32 >( mnBackColor ); + aReader.readIntProperty< sal_uInt32 >( mnTextColor ); + aReader.skipIntProperty< sal_uInt32 >(); // next available control ID + aReader.skipUndefinedProperty(); + aReader.skipUndefinedProperty(); + aReader.readIntProperty< sal_uInt32 >( mnFlags ); + aReader.readIntProperty< sal_uInt8 >( mnBorderStyle ); + aReader.skipIntProperty< sal_uInt8 >(); // mouse pointer + aReader.readIntProperty< sal_uInt8 >( mnScrollBars ); + aReader.readPairProperty( maSize ); + aReader.readPairProperty( maLogicalSize ); + aReader.readPairProperty( maScrollPos ); + aReader.skipIntProperty< sal_uInt32 >(); // number of control groups + aReader.skipUndefinedProperty(); + aReader.skipPictureProperty(); // mouse icon + aReader.readIntProperty< sal_uInt8 >( mnCycleType ); + aReader.readIntProperty< sal_uInt8 >( mnSpecialEffect ); + aReader.readIntProperty< sal_uInt32 >( mnBorderColor ); + aReader.readStringProperty( maCaption ); + aReader.readFontProperty( maFontData ); + aReader.readPictureProperty( maPictureData ); + aReader.skipIntProperty< sal_Int32 >(); // zoom + aReader.readIntProperty< sal_uInt8 >( mnPicAlign ); + aReader.readBoolProperty( mbPicTiling ); + aReader.readIntProperty< sal_uInt8 >( mnPicSizeMode ); + aReader.skipIntProperty< sal_uInt32 >(); // shape cookie + aReader.skipIntProperty< sal_uInt32 >(); // draw buffer size + return aReader.finalizeImport(); +} + +void AxContainerModelBase::convertProperties( PropertyMap& rPropMap, const ControlConverter& rConv ) const +{ + if( mbFontSupport ) + { + rConv.convertColor( rPropMap, PROP_TextColor, mnTextColor ); + AxFontDataModel::convertProperties( rPropMap, rConv ); + } +} + +bool AxContainerModelBase::importClassTable( BinaryInputStream& rInStrm, AxClassTable& orClassTable ) +{ + bool bValid = true; + orClassTable.clear(); + if( !getFlag( mnFlags, AX_CONTAINER_NOCLASSTABLE ) ) + { + sal_uInt16 nCount = rInStrm.readuInt16(); + for( sal_uInt16 nIndex = 0; bValid && (nIndex < nCount); ++nIndex ) + { + orClassTable.emplace_back( ); + AxBinaryPropertyReader aReader( rInStrm ); + aReader.readGuidProperty( orClassTable.back() ); + aReader.skipGuidProperty(); // source interface GUID + aReader.skipUndefinedProperty(); + aReader.skipGuidProperty(); // default interface GUID + aReader.skipIntProperty< sal_uInt32 >(); // class table and var flags + aReader.skipIntProperty< sal_uInt32 >(); // method count + aReader.skipIntProperty< sal_Int32 >(); // IDispatch identifier for linked cell access + aReader.skipIntProperty< sal_uInt16 >(); // get function index for linked cell access + aReader.skipIntProperty< sal_uInt16 >(); // put function index for linked cell access + aReader.skipIntProperty< sal_uInt16 >(); // linked cell access property type + aReader.skipIntProperty< sal_uInt16 >(); // get function index of value + aReader.skipIntProperty< sal_uInt16 >(); // put function index of value + aReader.skipIntProperty< sal_uInt16 >(); // value type + aReader.skipIntProperty< sal_Int32 >(); // IDispatch identifier for source range access + aReader.skipIntProperty< sal_uInt16 >(); // get function index for source range access + bValid = aReader.finalizeImport(); + } + } + return bValid; +} + +AxFrameModel::AxFrameModel() : + AxContainerModelBase( true ) +{ +} + +ApiControlType AxFrameModel::getControlType() const +{ + return mbAwtModel ? API_CONTROL_FRAME : API_CONTROL_GROUPBOX; +} + +void AxFrameModel::convertProperties( PropertyMap& rPropMap, const ControlConverter& rConv ) const +{ + rPropMap.setProperty( PROP_Label, maCaption ); + rPropMap.setProperty( PROP_Enabled, getFlag( mnFlags, AX_CONTAINER_ENABLED ) ); + AxContainerModelBase::convertProperties( rPropMap, rConv ); +} + +AxPageModel::AxPageModel() +{ +} + +ApiControlType AxPageModel::getControlType() const +{ + return API_CONTROL_PAGE; +} + +void AxPageModel::convertProperties( PropertyMap& rPropMap, const ControlConverter& rConv ) const +{ + rPropMap.setProperty( PROP_Title, maCaption ); + rConv.convertColor( rPropMap, PROP_BackgroundColor, mnBackColor ); + rPropMap.setProperty( PROP_Enabled, getFlag( mnFlags, AX_CONTAINER_ENABLED ) ); + AxContainerModelBase::convertProperties( rPropMap, rConv ); +} + +AxMultiPageModel::AxMultiPageModel() : + mnActiveTab( 0 ), + mnTabStyle( AX_TABSTRIP_TABS ) +{ +} + +ApiControlType AxMultiPageModel::getControlType() const +{ + return API_CONTROL_MULTIPAGE; +} + +void AxMultiPageModel::importPageAndMultiPageProperties( BinaryInputStream& rInStrm, sal_Int32 nPages ) +{ + // PageProperties + for ( sal_Int32 nPage = 0; nPage < nPages; ++nPage ) + { + AxBinaryPropertyReader aReader( rInStrm ); + aReader.skipUndefinedProperty(); + aReader.skipIntProperty< sal_uInt32 >(); // TransitionEffect + aReader.skipIntProperty< sal_uInt32 >(); // TransitionPeriod + } + // MultiPageProperties + AxBinaryPropertyReader aReader( rInStrm ); + sal_uInt32 nPageCount = 0; + aReader.skipUndefinedProperty(); + aReader.readIntProperty< sal_uInt32 >(nPageCount); // PageCount + aReader.skipIntProperty< sal_uInt32 >(); //ID + + // IDs + for ( sal_uInt32 count = 0; count < nPageCount; ++count ) + { + mnIDs.push_back( rInStrm.readInt32() ); + } +} + +void AxMultiPageModel::convertProperties( PropertyMap& rPropMap, const ControlConverter& rConv ) const +{ + rPropMap.setProperty( PROP_Title, maCaption ); + rPropMap.setProperty( PROP_MultiPageValue, mnActiveTab + 1); + rConv.convertColor( rPropMap, PROP_BackgroundColor, mnBackColor ); + rPropMap.setProperty( PROP_Enabled, getFlag( mnFlags, AX_CONTAINER_ENABLED ) ); + rPropMap.setProperty( PROP_Decoration, mnTabStyle != AX_TABSTRIP_NONE ); + + AxContainerModelBase::convertProperties( rPropMap, rConv ); +} + +AxUserFormModel::AxUserFormModel() +{ +} + +ApiControlType AxUserFormModel::getControlType() const +{ + return API_CONTROL_DIALOG; +} + +void AxUserFormModel::convertProperties( PropertyMap& rPropMap, const ControlConverter& rConv ) const +{ + rPropMap.setProperty( PROP_Title, maCaption ); + rConv.convertColor( rPropMap, PROP_BackgroundColor, mnBackColor ); + rConv.convertAxPicture( rPropMap, maPictureData, AX_PICPOS_CENTER ); + rConv.convertScrollabilitySettings( rPropMap, maScrollPos, maLogicalSize, mnScrollBars ); + AxContainerModelBase::convertProperties( rPropMap, rConv ); +} + +HtmlSelectModel::HtmlSelectModel() +{ +} + +bool +HtmlSelectModel::importBinaryModel( BinaryInputStream& rInStrm ) +{ + if (rInStrm.size()<=0) + return true; + + OUString sStringContents = rInStrm.readUnicodeArray( rInStrm.size() ); + + // replace crlf with lf + OUString data = sStringContents.replaceAll( "\x0D\x0A" , "\x0A" ); + + std::vector< OUString > listValues; + std::vector< sal_Int16 > selectedIndices; + + // Ultra hacky parser for the info + sal_Int32 nLineIdx {0}; + // first line will tell us if multiselect is enabled + if (o3tl::getToken(data, 0, '\n', nLineIdx ) == u"