[Libreoffice-commits] .: 3 commits - oox/source sc/source

Noel Power noelp at kemper.freedesktop.org
Wed Jan 11 10:13:47 PST 2012


 oox/source/export/shapes.cxx        |  198 +++++++++++++++++++++++++++++++++++-
 sc/source/filter/xcl97/xcl97rec.cxx |    4 
 2 files changed, 199 insertions(+), 3 deletions(-)

New commits:
commit 8a3b584528e30f346cbab34141ee088eea16020c
Author: Noel Power <noel.power at novell.com>
Date:   Wed Jan 11 12:45:33 2012 +0000

    export vertical and horizontal flip attribute for customshapes

diff --git a/oox/source/export/shapes.cxx b/oox/source/export/shapes.cxx
index 5a254e0..5b1b810 100644
--- a/oox/source/export/shapes.cxx
+++ b/oox/source/export/shapes.cxx
@@ -712,6 +712,9 @@ ShapeExport& ShapeExport::WriteCustomShape( Reference< XShape > xShape )
     Sequence< PropertyValue > aGeometrySeq;
     sal_Int32 nAdjustmentValuesIndex = -1;
 
+    sal_Bool bFlipH = false;
+    sal_Bool bFlipV = false;
+
     if( GETA( CustomShapeGeometry ) ) {
         DBG(printf("got custom shape geometry\n"));
         if( mAny >>= aGeometrySeq ) {
@@ -721,6 +724,11 @@ ShapeExport& ShapeExport::WriteCustomShape( Reference< XShape > xShape )
                 const PropertyValue& rProp = aGeometrySeq[ i ];
                 DBG(printf("geometry property: %s\n", USS( rProp.Name )));
 
+                if( rProp.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "MirroredX" ) ))
+                    rProp.Value >>= bFlipH;
+
+                if( rProp.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "MirroredY" ) ))
+                    rProp.Value >>= bFlipV;
                 if( rProp.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "AdjustmentValues" ) ))
                     nAdjustmentValuesIndex = i;
                 else if( rProp.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Handles" ) )) {
@@ -747,7 +755,7 @@ ShapeExport& ShapeExport::WriteCustomShape( Reference< XShape > xShape )
 
     // visual shape properties
     pFS->startElementNS( mnXmlNamespace, XML_spPr, FSEND );
-    WriteShapeTransformation( xShape, XML_a );
+    WriteShapeTransformation( xShape, XML_a, bFlipH, bFlipV );
     if( nAdjustmentValuesIndex != -1 )
     {
         sal_Int32 nAdjustmentsWhichNeedsToBeConverted = 0;
commit aaa4e47cbcbd7a990a986ab9f53a6565af93d788
Author: Noel Power <noel.power at novell.com>
Date:   Wed Jan 11 11:42:16 2012 +0000

    add missing ooxml customshape -> mso shape name entries ( for export support )

diff --git a/oox/source/export/shapes.cxx b/oox/source/export/shapes.cxx
index edb8e20..5a254e0 100644
--- a/oox/source/export/shapes.cxx
+++ b/oox/source/export/shapes.cxx
@@ -323,7 +323,193 @@ static const CustomShapeTypeTranslationTable pCustomShapeTypeTranslationTable[]
     { "mso-spt199", "actionButtonSound" },
     { "mso-spt200", "actionButtonMovie" },
     { "mso-spt201", "hostControl" },
-    { "mso-spt202", "rect" }
+    { "mso-spt202", "rect" },
+    { "ooxml-actionButtonSound", "actionButtonSound" },
+    { "ooxml-borderCallout1", "borderCallout1" },
+    { "ooxml-plaqueTabs", "plaqueTabs" },
+    { "ooxml-curvedLeftArrow", "curvedLeftArrow" },
+    { "ooxml-octagon", "octagon" },
+    { "ooxml-leftRightRibbon", "leftRightRibbon" },
+    { "ooxml-actionButtonInformation", "actionButtonInformation" },
+    { "ooxml-bentConnector5", "bentConnector5" },
+    { "ooxml-circularArrow", "circularArrow" },
+    { "ooxml-downArrowCallout", "downArrowCallout" },
+    { "ooxml-mathMinus", "mathMinus" },
+    { "ooxml-gear9", "gear9" },
+    { "ooxml-round1Rect", "round1Rect" },
+    { "ooxml-sun", "sun" },
+    { "ooxml-plaque", "plaque" },
+    { "ooxml-chevron", "chevron" },
+    { "ooxml-flowChartPreparation", "flowChartPreparation" },
+    { "ooxml-diagStripe", "diagStripe" },
+    { "ooxml-pentagon", "pentagon" },
+    { "ooxml-funnel", "funnel" },
+    { "ooxml-chartStar", "chartStar" },
+    { "ooxml-accentBorderCallout1", "accentBorderCallout1" },
+    { "ooxml-notchedRightArrow", "notchedRightArrow" },
+    { "ooxml-rightBracket", "rightBracket" },
+    { "ooxml-flowChartOffpageConnector", "flowChartOffpageConnector" },
+    { "ooxml-leftRightArrow", "leftRightArrow" },
+    { "ooxml-decagon", "decagon" },
+    { "ooxml-actionButtonHelp", "actionButtonHelp" },
+    { "ooxml-star24", "star24" },
+    { "ooxml-mathDivide", "mathDivide" },
+    { "ooxml-curvedConnector4", "curvedConnector4" },
+    { "ooxml-flowChartOr", "flowChartOr" },
+    { "ooxml-borderCallout3", "borderCallout3" },
+    { "ooxml-upDownArrowCallout", "upDownArrowCallout" },
+    { "ooxml-flowChartDecision", "flowChartDecision" },
+    { "ooxml-leftRightArrowCallout", "leftRightArrowCallout" },
+    { "ooxml-flowChartManualOperation", "flowChartManualOperation" },
+    { "ooxml-snipRoundRect", "snipRoundRect" },
+    { "ooxml-mathPlus", "mathPlus" },
+    { "ooxml-actionButtonForwardNext", "actionButtonForwardNext" },
+    { "ooxml-can", "can" },
+    { "ooxml-foldedCorner", "foldedCorner" },
+    { "ooxml-star32", "star32" },
+    { "ooxml-flowChartInternalStorage", "flowChartInternalStorage" },
+    { "ooxml-upDownArrow", "upDownArrow" },
+    { "ooxml-irregularSeal2", "irregularSeal2" },
+    { "ooxml-mathEqual", "mathEqual" },
+    { "ooxml-star12", "star12" },
+    { "ooxml-uturnArrow", "uturnArrow" },
+    { "ooxml-squareTabs", "squareTabs" },
+    { "ooxml-leftRightUpArrow", "leftRightUpArrow" },
+    { "ooxml-homePlate", "homePlate" },
+    { "ooxml-dodecagon", "dodecagon" },
+    { "ooxml-leftArrowCallout", "leftArrowCallout" },
+    { "ooxml-chord", "chord" },
+    { "ooxml-quadArrowCallout", "quadArrowCallout" },
+    { "ooxml-actionButtonBeginning", "actionButtonBeginning" },
+    { "ooxml-ellipse", "ellipse" },
+    { "ooxml-actionButtonEnd", "actionButtonEnd" },
+    { "ooxml-arc", "arc" },
+    { "ooxml-star16", "star16" },
+    { "ooxml-parallelogram", "parallelogram" },
+    { "ooxml-bevel", "bevel" },
+    { "ooxml-roundRect", "roundRect" },
+    { "ooxml-accentCallout1", "accentCallout1" },
+    { "ooxml-flowChartSort", "flowChartSort" },
+    { "ooxml-star8", "star8" },
+    { "ooxml-flowChartAlternateProcess", "flowChartAlternateProcess" },
+    { "ooxml-moon", "moon" },
+    { "ooxml-star6", "star6" },
+    { "ooxml-round2SameRect", "round2SameRect" },
+    { "ooxml-nonIsoscelesTrapezoid", "nonIsoscelesTrapezoid" },
+    { "ooxml-diamond", "diamond" },
+    { "ooxml-ellipseRibbon", "ellipseRibbon" },
+    { "ooxml-callout2", "callout2" },
+    { "ooxml-pie", "pie" },
+    { "ooxml-star4", "star4" },
+    { "ooxml-flowChartPredefinedProcess", "flowChartPredefinedProcess" },
+    { "ooxml-flowChartPunchedTape", "flowChartPunchedTape" },
+    { "ooxml-curvedConnector2", "curvedConnector2" },
+    { "ooxml-bentConnector3", "bentConnector3" },
+    { "ooxml-cornerTabs", "cornerTabs" },
+    { "ooxml-hexagon", "hexagon" },
+    { "ooxml-flowChartConnector", "flowChartConnector" },
+    { "ooxml-flowChartMagneticDisk", "flowChartMagneticDisk" },
+    { "ooxml-heart", "heart" },
+    { "ooxml-ribbon2", "ribbon2" },
+    { "ooxml-bracePair", "bracePair" },
+    { "ooxml-flowChartExtract", "flowChartExtract" },
+    { "ooxml-actionButtonHome", "actionButtonHome" },
+    { "ooxml-accentBorderCallout3", "accentBorderCallout3" },
+    { "ooxml-flowChartOfflineStorage", "flowChartOfflineStorage" },
+    { "ooxml-irregularSeal1", "irregularSeal1" },
+    { "ooxml-quadArrow", "quadArrow" },
+    { "ooxml-leftBrace", "leftBrace" },
+    { "ooxml-leftBracket", "leftBracket" },
+    { "ooxml-blockArc", "blockArc" },
+    { "ooxml-curvedConnector3", "curvedConnector3" },
+    { "ooxml-wedgeRoundRectCallout", "wedgeRoundRectCallout" },
+    { "ooxml-actionButtonMovie", "actionButtonMovie" },
+    { "ooxml-flowChartOnlineStorage", "flowChartOnlineStorage" },
+    { "ooxml-gear6", "gear6" },
+    { "ooxml-halfFrame", "halfFrame" },
+    { "ooxml-snip2SameRect", "snip2SameRect" },
+    { "ooxml-triangle", "triangle" },
+    { "ooxml-teardrop", "teardrop" },
+    { "ooxml-flowChartDocument", "flowChartDocument" },
+    { "ooxml-rightArrowCallout", "rightArrowCallout" },
+    { "ooxml-rightBrace", "rightBrace" },
+    { "ooxml-chartPlus", "chartPlus" },
+    { "ooxml-flowChartManualInput", "flowChartManualInput" },
+    { "ooxml-flowChartMerge", "flowChartMerge" },
+    { "ooxml-line", "line" },
+    { "ooxml-downArrow", "downArrow" },
+    { "ooxml-curvedDownArrow", "curvedDownArrow" },
+    { "ooxml-actionButtonReturn", "actionButtonReturn" },
+    { "ooxml-flowChartInputOutput", "flowChartInputOutput" },
+    { "ooxml-bracketPair", "bracketPair" },
+    { "ooxml-smileyFace", "smileyFace" },
+    { "ooxml-actionButtonBlank", "actionButtonBlank" },
+    { "ooxml-wave", "wave" },
+    { "ooxml-swooshArrow", "swooshArrow" },
+    { "ooxml-flowChartSummingJunction", "flowChartSummingJunction" },
+    { "ooxml-lightningBolt", "lightningBolt" },
+    { "ooxml-flowChartDisplay", "flowChartDisplay" },
+    { "ooxml-actionButtonBackPrevious", "actionButtonBackPrevious" },
+    { "ooxml-frame", "frame" },
+    { "ooxml-rtTriangle", "rtTriangle" },
+    { "ooxml-flowChartMagneticTape", "flowChartMagneticTape" },
+    { "ooxml-curvedRightArrow", "curvedRightArrow" },
+    { "ooxml-leftUpArrow", "leftUpArrow" },
+    { "ooxml-wedgeEllipseCallout", "wedgeEllipseCallout" },
+    { "ooxml-doubleWave", "doubleWave" },
+    { "ooxml-bentArrow", "bentArrow" },
+    { "ooxml-star10", "star10" },
+    { "ooxml-leftArrow", "leftArrow" },
+    { "ooxml-curvedUpArrow", "curvedUpArrow" },
+    { "ooxml-snip1Rect", "snip1Rect" },
+    { "ooxml-ellipseRibbon2", "ellipseRibbon2" },
+    { "ooxml-plus", "plus" },
+    { "ooxml-accentCallout3", "accentCallout3" },
+    { "ooxml-leftCircularArrow", "leftCircularArrow" },
+    { "ooxml-rightArrow", "rightArrow" },
+    { "ooxml-flowChartPunchedCard", "flowChartPunchedCard" },
+    { "ooxml-snip2DiagRect", "snip2DiagRect" },
+    { "ooxml-verticalScroll", "verticalScroll" },
+    { "ooxml-star7", "star7" },
+    { "ooxml-chartX", "chartX" },
+    { "ooxml-cloud", "cloud" },
+    { "ooxml-cube", "cube" },
+    { "ooxml-round2DiagRect", "round2DiagRect" },
+    { "ooxml-flowChartMultidocument", "flowChartMultidocument" },
+    { "ooxml-actionButtonDocument", "actionButtonDocument" },
+    { "ooxml-flowChartTerminator", "flowChartTerminator" },
+    { "ooxml-flowChartDelay", "flowChartDelay" },
+    { "ooxml-curvedConnector5", "curvedConnector5" },
+    { "ooxml-horizontalScroll", "horizontalScroll" },
+    { "ooxml-bentConnector4", "bentConnector4" },
+    { "ooxml-leftRightCircularArrow", "leftRightCircularArrow" },
+    { "ooxml-wedgeRectCallout", "wedgeRectCallout" },
+    { "ooxml-accentCallout2", "accentCallout2" },
+    { "ooxml-flowChartMagneticDrum", "flowChartMagneticDrum" },
+    { "ooxml-corner", "corner" },
+    { "ooxml-borderCallout2", "borderCallout2" },
+    { "ooxml-donut", "donut" },
+    { "ooxml-flowChartCollate", "flowChartCollate" },
+    { "ooxml-mathNotEqual", "mathNotEqual" },
+    { "ooxml-bentConnector2", "bentConnector2" },
+    { "ooxml-mathMultiply", "mathMultiply" },
+    { "ooxml-heptagon", "heptagon" },
+    { "ooxml-rect", "rect" },
+    { "ooxml-accentBorderCallout2", "accentBorderCallout2" },
+    { "ooxml-pieWedge", "pieWedge" },
+    { "ooxml-upArrowCallout", "upArrowCallout" },
+    { "ooxml-flowChartProcess", "flowChartProcess" },
+    { "ooxml-star5", "star5" },
+    { "ooxml-lineInv", "lineInv" },
+    { "ooxml-straightConnector1", "straightConnector1" },
+    { "ooxml-stripedRightArrow", "stripedRightArrow" },
+    { "ooxml-callout3", "callout3" },
+    { "ooxml-bentUpArrow", "bentUpArrow" },
+    { "ooxml-noSmoking", "noSmoking" },
+    { "ooxml-trapezoid", "trapezoid" },
+    { "ooxml-cloudCallout", "cloudCallout" },
+    { "ooxml-callout1", "callout1" },
+    { "ooxml-ribbon", "ribbon" },
 };
 
 struct StringHash
commit c323e60157422ae264e798b9a279a532fe9997af
Author: Noel Power <noel.power at novell.com>
Date:   Wed Jan 11 10:04:59 2012 +0000

    ignore the (unsupported ) group customshape when exporting xlsx
    
    currently the xml export code in oox doesn't handle grouped shapes very well, it produces an extra twoCellAnchor entry for the group ( which is incorrect ). This causes mso2010 to reject the content as corrupt. We need to handle grouping correctly ( e.g. a twoCellAnchor entry for the group and separate drawing shape (xdr:sp) elements for the shapes that are elements of the group ). As a stop gap we can just export the individual shapes of the group ( but not the grouping itself )

diff --git a/sc/source/filter/xcl97/xcl97rec.cxx b/sc/source/filter/xcl97/xcl97rec.cxx
index 56f30fe..911cd40 100644
--- a/sc/source/filter/xcl97/xcl97rec.cxx
+++ b/sc/source/filter/xcl97/xcl97rec.cxx
@@ -1001,7 +1001,9 @@ GetEditAs( XclObjAny& rObj )
 
 void XclObjAny::SaveXml( XclExpXmlStream& rStrm )
 {
-    if( !mxShape.is() )
+    // ignore group shapes at the moment, we don't process them correctly
+    // leading to ms2010 rejecting the content
+    if( !mxShape.is() || mxShape->getShapeType().equals( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.GroupShape") ) ) )
         return;
 
     sax_fastparser::FSHelperPtr pDrawing = rStrm.GetCurrentStream();


More information about the Libreoffice-commits mailing list