oox/inc/drawingml/textbodyproperties.hxx | 2 oox/source/drawingml/shape.cxx | 2 oox/source/drawingml/textbodyproperties.cxx | 8 sd/qa/unit/data/n902652.pptx |binary sd/qa/unit/data/xml/n902652_0.xml | 309 ++++++++++++++++++++++++++++ sd/qa/unit/import-tests.cxx | 1 6 files changed, 316 insertions(+), 6 deletions(-)
New commits: commit 6a1cca9b467f1f7205aac5734fdb20b7f7d410f0 Author: Andras Timar <[email protected]> Date: Mon Mar 30 21:37:47 2015 +0200 bnc#902652 OOXML: fix import of insets when shape and/or shape text is rotated 5ac575ee3e109 did not get it right, the vert attribute (i.e. the rotation of text) is relevant, not the rotation of the shape. In that case both text and shape rotation were 270 degrees. I checked that the bugdoc of bnc#773048 looked good after this. Change-Id: I6e0401cd138a82040df82d7da1a47311db7771e4 Reviewed-on: https://gerrit.libreoffice.org/15076 Tested-by: Jenkins <[email protected]> Reviewed-by: Andras Timar <[email protected]> (cherry picked from commit af686aa8694903bde5952656cd69993c8c8393d7) Reviewed-on: https://gerrit.libreoffice.org/15082 Tested-by: Andras Timar <[email protected]> Reviewed-by: Caolán McNamara <[email protected]> Tested-by: Caolán McNamara <[email protected]> diff --git a/oox/inc/drawingml/textbodyproperties.hxx b/oox/inc/drawingml/textbodyproperties.hxx index e6ed0fc..c7a98cb 100644 --- a/oox/inc/drawingml/textbodyproperties.hxx +++ b/oox/inc/drawingml/textbodyproperties.hxx @@ -45,7 +45,7 @@ struct TextBodyProperties explicit TextBodyProperties(); - void pushRotationAdjustments( sal_Int32 nRotation ); + void pushRotationAdjustments(); void pushVertSimulation(); }; diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx index db36b56..81249e5 100644 --- a/oox/source/drawingml/shape.cxx +++ b/oox/source/drawingml/shape.cxx @@ -649,7 +649,7 @@ Reference< XShape > Shape::createAndInsert( // add properties from textbody to shape properties if( mpTextBody.get() ) { - mpTextBody->getTextProperties().pushRotationAdjustments( mnRotation ); + mpTextBody->getTextProperties().pushRotationAdjustments(); 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() ) diff --git a/oox/source/drawingml/textbodyproperties.cxx b/oox/source/drawingml/textbodyproperties.cxx index 9f146c6..f61330a 100644 --- a/oox/source/drawingml/textbodyproperties.cxx +++ b/oox/source/drawingml/textbodyproperties.cxx @@ -58,17 +58,17 @@ void TextBodyProperties::pushVertSimulation() } /* Push adjusted values, taking into consideration Shape Rotation */ -void TextBodyProperties::pushRotationAdjustments( sal_Int32 nRotation ) +void TextBodyProperties::pushRotationAdjustments() { sal_Int32 nOff = 0; sal_Int32 aProps[] = { PROP_TextLeftDistance, PROP_TextUpperDistance, PROP_TextRightDistance, PROP_TextLowerDistance }; sal_Int32 n = ( sal_Int32 )( sizeof( aProps ) / sizeof( sal_Int32 ) ); - switch( nRotation ) // TODO: What happens for part rotations ? + switch( moRotation.get(0) ) { - case (90*1*60000): nOff = 1; break; + case (90*1*60000): nOff = 3; break; case (90*2*60000): nOff = 2; break; - case (90*3*60000): nOff = 3; break; + case (90*3*60000): nOff = 1; break; default: break; } diff --git a/sd/qa/unit/data/n902652.pptx b/sd/qa/unit/data/n902652.pptx new file mode 100644 index 0000000..8726600 Binary files /dev/null and b/sd/qa/unit/data/n902652.pptx differ diff --git a/sd/qa/unit/data/xml/n902652_0.xml b/sd/qa/unit/data/xml/n902652_0.xml new file mode 100644 index 0000000..de8ed91 --- /dev/null +++ b/sd/qa/unit/data/xml/n902652_0.xml @@ -0,0 +1,309 @@ +<?xml version="1.0"?> +<XShapes> + <XShape positionX="899" positionY="9525" sizeX="9000" sizeY="4800" type="com.sun.star.drawing.CustomShape" name="Rounded Rectangle 3" text=" LibreOffice" fontHeight="18.000000" fontColor="ffffffff" textAutoGrowHeight="false" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="BLOCK" textVerticalAdjust="TOP" textLeftDistance="3000" textRightDistance="500" textUpperDistance="300" textLowerDistance="3000" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="SOLID" fillColor="9bbb59" fillTransparence="0" fillTransparenceGradientName=""> + <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/> + <FillGradient style="LINEAR" startColor="3465a4" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/> + <FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/> + <FillBitmap width="32" height="32"/> + <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/> + <LineStart/> + <LineEnd/> + <Transformation> + <Line1 column1="0.000000" column2="4801.000000" column3="899.000000"/> + <Line2 column1="-9001.000000" column2="0.000000" column3="9525.000000"/> + <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/> + </Transformation> + <CustomShapeGeometry> + <PropertyValue name="AdjustmentValues"> + <AdjustmentValues> + <EnhancedCustomShapeAdjustmentValue value="16667" propertyState="DIRECT_VALUE"/> + </AdjustmentValues> + </PropertyValue> + <PropertyValue name="Equations" handle="0" propertyState="DIRECT_VALUE"/> + <PropertyValue name="Handles" handle="0" propertyState="DIRECT_VALUE"/> + <PropertyValue name="IsPostRotateAngle" value="true" handle="0" propertyState="DIRECT_VALUE"/> + <PropertyValue name="MirroredX" value="false" handle="0" propertyState="DIRECT_VALUE"/> + <PropertyValue name="MirroredY" value="false" handle="0" propertyState="DIRECT_VALUE"/> + <PropertyValue name="Path"> + <Path> + <PropertyValue name="Coordinates"> + <Coordinates> + <EnhancedCustomShapeParameterPair> + <First value="0" type="0"/> + <Second value="2" type="1"/> + </EnhancedCustomShapeParameterPair> + <EnhancedCustomShapeParameterPair> + <First value="2" type="1"/> + <Second value="2" type="1"/> + </EnhancedCustomShapeParameterPair> + <EnhancedCustomShapeParameterPair> + <First value="12" type="1"/> + <Second value="13" type="1"/> + </EnhancedCustomShapeParameterPair> + <EnhancedCustomShapeParameterPair> + <First value="3" type="1"/> + <Second value="0" type="0"/> + </EnhancedCustomShapeParameterPair> + <EnhancedCustomShapeParameterPair> + <First value="2" type="1"/> + <Second value="2" type="1"/> + </EnhancedCustomShapeParameterPair> + <EnhancedCustomShapeParameterPair> + <First value="14" type="1"/> + <Second value="15" type="1"/> + </EnhancedCustomShapeParameterPair> + <EnhancedCustomShapeParameterPair> + <First value="11" type="1"/> + <Second value="4" type="1"/> + </EnhancedCustomShapeParameterPair> + <EnhancedCustomShapeParameterPair> + <First value="2" type="1"/> + <Second value="2" type="1"/> + </EnhancedCustomShapeParameterPair> + <EnhancedCustomShapeParameterPair> + <First value="16" type="1"/> + <Second value="17" type="1"/> + </EnhancedCustomShapeParameterPair> + <EnhancedCustomShapeParameterPair> + <First value="2" type="1"/> + <Second value="10" type="1"/> + </EnhancedCustomShapeParameterPair> + <EnhancedCustomShapeParameterPair> + <First value="2" type="1"/> + <Second value="2" type="1"/> + </EnhancedCustomShapeParameterPair> + <EnhancedCustomShapeParameterPair> + <First value="18" type="1"/> + <Second value="19" type="1"/> + </EnhancedCustomShapeParameterPair> + </Coordinates> + </PropertyValue> + <PropertyValue name="Segments"> + <Segments> + <EnhancedCustomShapeSegment command="1" count="1"/> + <EnhancedCustomShapeSegment command="17" count="1"/> + <EnhancedCustomShapeSegment command="2" count="1"/> + <EnhancedCustomShapeSegment command="17" count="1"/> + <EnhancedCustomShapeSegment command="2" count="1"/> + <EnhancedCustomShapeSegment command="17" count="1"/> + <EnhancedCustomShapeSegment command="2" count="1"/> + <EnhancedCustomShapeSegment command="17" count="1"/> + <EnhancedCustomShapeSegment command="4" count="0"/> + <EnhancedCustomShapeSegment command="5" count="0"/> + </Segments> + </PropertyValue> + <PropertyValue name="TextFrames" handle="0" propertyState="DIRECT_VALUE"/> + </Path> + </PropertyValue> + <PropertyValue name="TextPreRotateAngle" value="0" handle="0" propertyState="DIRECT_VALUE"/> + <PropertyValue name="Type" value="ooxml-roundRect" handle="0" propertyState="DIRECT_VALUE"/> + <PropertyValue name="ViewBox"> + <ViewBox x="0" y="0" width="0" height="0"/> + </PropertyValue> + </CustomShapeGeometry> + </XShape> + <XShape positionX="15800" positionY="7848" sizeX="9000" sizeY="4800" type="com.sun.star.drawing.CustomShape" name="Rounded Rectangle 4" text=" LibreOffice" fontHeight="18.000000" fontColor="ffffffff" textAutoGrowHeight="false" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="BLOCK" textVerticalAdjust="TOP" textLeftDistance="1000" textRightDistance="0" textUpperDistance="3000" textLowerDistance="300" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="SOLID" fillColor="9bbb59" fillTransparence="0" fillTransparenceGradientName=""> + <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/> + <FillGradient style="LINEAR" startColor="3465a4" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/> + <FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/> + <FillBitmap width="32" height="32"/> + <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/> + <LineStart/> + <LineEnd/> + <Transformation> + <Line1 column1="-9001.000000" column2="-0.000000" column3="15800.000000"/> + <Line2 column1="0.000000" column2="-4801.000000" column3="7848.000000"/> + <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/> + </Transformation> + <CustomShapeGeometry> + <PropertyValue name="AdjustmentValues"> + <AdjustmentValues> + <EnhancedCustomShapeAdjustmentValue value="16667" propertyState="DIRECT_VALUE"/> + </AdjustmentValues> + </PropertyValue> + <PropertyValue name="Equations" handle="0" propertyState="DIRECT_VALUE"/> + <PropertyValue name="Handles" handle="0" propertyState="DIRECT_VALUE"/> + <PropertyValue name="IsPostRotateAngle" value="true" handle="0" propertyState="DIRECT_VALUE"/> + <PropertyValue name="MirroredX" value="false" handle="0" propertyState="DIRECT_VALUE"/> + <PropertyValue name="MirroredY" value="false" handle="0" propertyState="DIRECT_VALUE"/> + <PropertyValue name="Path"> + <Path> + <PropertyValue name="Coordinates"> + <Coordinates> + <EnhancedCustomShapeParameterPair> + <First value="0" type="0"/> + <Second value="2" type="1"/> + </EnhancedCustomShapeParameterPair> + <EnhancedCustomShapeParameterPair> + <First value="2" type="1"/> + <Second value="2" type="1"/> + </EnhancedCustomShapeParameterPair> + <EnhancedCustomShapeParameterPair> + <First value="12" type="1"/> + <Second value="13" type="1"/> + </EnhancedCustomShapeParameterPair> + <EnhancedCustomShapeParameterPair> + <First value="3" type="1"/> + <Second value="0" type="0"/> + </EnhancedCustomShapeParameterPair> + <EnhancedCustomShapeParameterPair> + <First value="2" type="1"/> + <Second value="2" type="1"/> + </EnhancedCustomShapeParameterPair> + <EnhancedCustomShapeParameterPair> + <First value="14" type="1"/> + <Second value="15" type="1"/> + </EnhancedCustomShapeParameterPair> + <EnhancedCustomShapeParameterPair> + <First value="11" type="1"/> + <Second value="4" type="1"/> + </EnhancedCustomShapeParameterPair> + <EnhancedCustomShapeParameterPair> + <First value="2" type="1"/> + <Second value="2" type="1"/> + </EnhancedCustomShapeParameterPair> + <EnhancedCustomShapeParameterPair> + <First value="16" type="1"/> + <Second value="17" type="1"/> + </EnhancedCustomShapeParameterPair> + <EnhancedCustomShapeParameterPair> + <First value="2" type="1"/> + <Second value="10" type="1"/> + </EnhancedCustomShapeParameterPair> + <EnhancedCustomShapeParameterPair> + <First value="2" type="1"/> + <Second value="2" type="1"/> + </EnhancedCustomShapeParameterPair> + <EnhancedCustomShapeParameterPair> + <First value="18" type="1"/> + <Second value="19" type="1"/> + </EnhancedCustomShapeParameterPair> + </Coordinates> + </PropertyValue> + <PropertyValue name="Segments"> + <Segments> + <EnhancedCustomShapeSegment command="1" count="1"/> + <EnhancedCustomShapeSegment command="17" count="1"/> + <EnhancedCustomShapeSegment command="2" count="1"/> + <EnhancedCustomShapeSegment command="17" count="1"/> + <EnhancedCustomShapeSegment command="2" count="1"/> + <EnhancedCustomShapeSegment command="17" count="1"/> + <EnhancedCustomShapeSegment command="2" count="1"/> + <EnhancedCustomShapeSegment command="17" count="1"/> + <EnhancedCustomShapeSegment command="4" count="0"/> + <EnhancedCustomShapeSegment command="5" count="0"/> + </Segments> + </PropertyValue> + <PropertyValue name="TextFrames" handle="0" propertyState="DIRECT_VALUE"/> + </Path> + </PropertyValue> + <PropertyValue name="TextPreRotateAngle" value="-90" handle="0" propertyState="DIRECT_VALUE"/> + <PropertyValue name="Type" value="ooxml-roundRect" handle="0" propertyState="DIRECT_VALUE"/> + <PropertyValue name="ViewBox"> + <ViewBox x="0" y="0" width="0" height="0"/> + </PropertyValue> + </CustomShapeGeometry> + </XShape> + <XShape positionX="16224" positionY="14365" sizeX="9000" sizeY="4800" type="com.sun.star.drawing.CustomShape" name="Rounded Rectangle 5" text=" LibreOffice" fontHeight="18.000000" fontColor="ffffffff" textAutoGrowHeight="false" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="BLOCK" textVerticalAdjust="TOP" textLeftDistance="0" textRightDistance="1000" textUpperDistance="900" textLowerDistance="3000" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="SOLID" fillColor="9bbb59" fillTransparence="0" fillTransparenceGradientName=""> + <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/> + <FillGradient style="LINEAR" startColor="3465a4" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/> + <FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/> + <FillBitmap width="32" height="32"/> + <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/> + <LineStart/> + <LineEnd/> + <Transformation> + <Line1 column1="-9001.000000" column2="-0.000000" column3="16224.000000"/> + <Line2 column1="0.000000" column2="-4801.000000" column3="14365.000000"/> + <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/> + </Transformation> + <CustomShapeGeometry> + <PropertyValue name="AdjustmentValues"> + <AdjustmentValues> + <EnhancedCustomShapeAdjustmentValue value="16667" propertyState="DIRECT_VALUE"/> + </AdjustmentValues> + </PropertyValue> + <PropertyValue name="Equations" handle="0" propertyState="DIRECT_VALUE"/> + <PropertyValue name="Handles" handle="0" propertyState="DIRECT_VALUE"/> + <PropertyValue name="IsPostRotateAngle" value="true" handle="0" propertyState="DIRECT_VALUE"/> + <PropertyValue name="MirroredX" value="false" handle="0" propertyState="DIRECT_VALUE"/> + <PropertyValue name="MirroredY" value="false" handle="0" propertyState="DIRECT_VALUE"/> + <PropertyValue name="Path"> + <Path> + <PropertyValue name="Coordinates"> + <Coordinates> + <EnhancedCustomShapeParameterPair> + <First value="0" type="0"/> + <Second value="2" type="1"/> + </EnhancedCustomShapeParameterPair> + <EnhancedCustomShapeParameterPair> + <First value="2" type="1"/> + <Second value="2" type="1"/> + </EnhancedCustomShapeParameterPair> + <EnhancedCustomShapeParameterPair> + <First value="12" type="1"/> + <Second value="13" type="1"/> + </EnhancedCustomShapeParameterPair> + <EnhancedCustomShapeParameterPair> + <First value="3" type="1"/> + <Second value="0" type="0"/> + </EnhancedCustomShapeParameterPair> + <EnhancedCustomShapeParameterPair> + <First value="2" type="1"/> + <Second value="2" type="1"/> + </EnhancedCustomShapeParameterPair> + <EnhancedCustomShapeParameterPair> + <First value="14" type="1"/> + <Second value="15" type="1"/> + </EnhancedCustomShapeParameterPair> + <EnhancedCustomShapeParameterPair> + <First value="11" type="1"/> + <Second value="4" type="1"/> + </EnhancedCustomShapeParameterPair> + <EnhancedCustomShapeParameterPair> + <First value="2" type="1"/> + <Second value="2" type="1"/> + </EnhancedCustomShapeParameterPair> + <EnhancedCustomShapeParameterPair> + <First value="16" type="1"/> + <Second value="17" type="1"/> + </EnhancedCustomShapeParameterPair> + <EnhancedCustomShapeParameterPair> + <First value="2" type="1"/> + <Second value="10" type="1"/> + </EnhancedCustomShapeParameterPair> + <EnhancedCustomShapeParameterPair> + <First value="2" type="1"/> + <Second value="2" type="1"/> + </EnhancedCustomShapeParameterPair> + <EnhancedCustomShapeParameterPair> + <First value="18" type="1"/> + <Second value="19" type="1"/> + </EnhancedCustomShapeParameterPair> + </Coordinates> + </PropertyValue> + <PropertyValue name="Segments"> + <Segments> + <EnhancedCustomShapeSegment command="1" count="1"/> + <EnhancedCustomShapeSegment command="17" count="1"/> + <EnhancedCustomShapeSegment command="2" count="1"/> + <EnhancedCustomShapeSegment command="17" count="1"/> + <EnhancedCustomShapeSegment command="2" count="1"/> + <EnhancedCustomShapeSegment command="17" count="1"/> + <EnhancedCustomShapeSegment command="2" count="1"/> + <EnhancedCustomShapeSegment command="17" count="1"/> + <EnhancedCustomShapeSegment command="4" count="0"/> + <EnhancedCustomShapeSegment command="5" count="0"/> + </Segments> + </PropertyValue> + <PropertyValue name="TextFrames" handle="0" propertyState="DIRECT_VALUE"/> + </Path> + </PropertyValue> + <PropertyValue name="TextPreRotateAngle" value="-270" handle="0" propertyState="DIRECT_VALUE"/> + <PropertyValue name="Type" value="ooxml-roundRect" handle="0" propertyState="DIRECT_VALUE"/> + <PropertyValue name="ViewBox"> + <ViewBox x="0" y="0" width="0" height="0"/> + </PropertyValue> + </CustomShapeGeometry> + </XShape> +</XShapes> diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx index d374c73..a9d55c5 100644 --- a/sd/qa/unit/import-tests.cxx +++ b/sd/qa/unit/import-tests.cxx @@ -176,6 +176,7 @@ void SdImportTest::testDocumentLayout() { "n762695.pptx", "xml/n762695_", PPTX, -1 }, { "n593612.pptx", "xml/n593612_", PPTX, -1 }, { "fdo71434.pptx", "xml/fdo71434_", PPTX, -1 }, + { "n902652.pptx", "xml/n902652_", PPTX, -1 }, // { "pptx/n828390.pptx", "pptx/xml/n828390_", PPTX, PPTX }, // Example };
_______________________________________________ Libreoffice-commits mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
