summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMuthu Subramanian <sumuthu@collabora.com>2013-12-27 19:59:22 +0530
committerAndras Timar <andras.timar@collabora.com>2014-01-07 09:31:11 +0100
commitbec40dcd4f36bf774f6bc2d805a646ba2232175c (patch)
treedfb84ce98ee2fe0c95b6966c49e80f24218184b8
parentd56dc259875a697aa69fb6a808fe8a86189db062 (diff)
fdo#72998: Custom shapes have improper size.
Change-Id: I4f8b7f80f89ad713e274acf6fc93bb415e660baf
-rw-r--r--oox/source/drawingml/customshapeproperties.cxx6
-rw-r--r--sd/qa/unit/data/xml/n762695_0.xml2
-rw-r--r--sd/qa/unit/data/xml/n762695_1.xml4
3 files changed, 9 insertions, 3 deletions
diff --git a/oox/source/drawingml/customshapeproperties.cxx b/oox/source/drawingml/customshapeproperties.cxx
index 48ace8bec689..247e8cf9880e 100644
--- a/oox/source/drawingml/customshapeproperties.cxx
+++ b/oox/source/drawingml/customshapeproperties.cxx
@@ -213,7 +213,13 @@ void CustomShapeProperties::pushToPropSet( const ::oox::core::FilterBase& /* rFi
aPropertyMap[ PROP_Type ] <<= OUString( "ooxml-non-primitive" );
aPropertyMap[ PROP_MirroredX ] <<= Any( mbMirroredX );
aPropertyMap[ PROP_MirroredY ] <<= Any( mbMirroredY );
+ // 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 );
+ if( maGuideList.size() )
+ aViewBox = awt::Rectangle( 0, 0, 0, 0 );
aPropertyMap[ PROP_ViewBox ] <<= aViewBox;
Sequence< EnhancedCustomShapeAdjustmentValue > aAdjustmentValues( maAdjustmentGuideList.size() );
diff --git a/sd/qa/unit/data/xml/n762695_0.xml b/sd/qa/unit/data/xml/n762695_0.xml
index 5f3080fd8cb9..d55c97976c3f 100644
--- a/sd/qa/unit/data/xml/n762695_0.xml
+++ b/sd/qa/unit/data/xml/n762695_0.xml
@@ -83,7 +83,7 @@
</PropertyValue>
<PropertyValue name="Type" value="ooxml-non-primitive" handle="0" propertyState="DIRECT_VALUE"/>
<PropertyValue name="ViewBox">
- <ViewBox x="0" y="0" width="4820911" height="3908235"/>
+ <ViewBox x="0" y="0" width="0" height="0"/>
</PropertyValue>
</CustomShapeGeometry>
</XShape>
diff --git a/sd/qa/unit/data/xml/n762695_1.xml b/sd/qa/unit/data/xml/n762695_1.xml
index d74678320f22..fb24ba080015 100644
--- a/sd/qa/unit/data/xml/n762695_1.xml
+++ b/sd/qa/unit/data/xml/n762695_1.xml
@@ -83,7 +83,7 @@
</PropertyValue>
<PropertyValue name="Type" value="ooxml-non-primitive" handle="0" propertyState="DIRECT_VALUE"/>
<PropertyValue name="ViewBox">
- <ViewBox x="0" y="0" width="6477000" height="2743200"/>
+ <ViewBox x="0" y="0" width="0" height="0"/>
</PropertyValue>
</CustomShapeGeometry>
</XShape>
@@ -170,7 +170,7 @@
</PropertyValue>
<PropertyValue name="Type" value="ooxml-non-primitive" handle="0" propertyState="DIRECT_VALUE"/>
<PropertyValue name="ViewBox">
- <ViewBox x="0" y="0" width="6365875" height="3430587"/>
+ <ViewBox x="0" y="0" width="0" height="0"/>
</PropertyValue>
</CustomShapeGeometry>
</XShape>