summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorVasily Melenchuk <Vasily.Melenchuk@cib.de>2017-05-15 13:41:14 +0300
committerThorsten Behrens <Thorsten.Behrens@CIB.de>2017-05-18 14:15:27 +0200
commit5477f7274e4df1210298c0f503a54eabc0f06bfc (patch)
treea6dff61ec7f6d51dbebb3512bdb3e57f19dc148a /svx
parent63843a97262ccfa38d838a9cbbc3faadba8290a6 (diff)
tdf#100072 zero height of shape's path was causing geometry errors
DOCX custom geometry shape's path width and height are now used independently for scaling calculations. Change-Id: I368dd4dc065b8f122c4eb2911261e45047f03c70 Reviewed-on: https://gerrit.libreoffice.org/37639 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
Diffstat (limited to 'svx')
-rw-r--r--svx/source/customshapes/EnhancedCustomShape2d.cxx17
1 files changed, 15 insertions, 2 deletions
diff --git a/svx/source/customshapes/EnhancedCustomShape2d.cxx b/svx/source/customshapes/EnhancedCustomShape2d.cxx
index c3c2d4c33099..c4de12bbcfc3 100644
--- a/svx/source/customshapes/EnhancedCustomShape2d.cxx
+++ b/svx/source/customshapes/EnhancedCustomShape2d.cxx
@@ -651,10 +651,23 @@ void EnhancedCustomShape2d::SetPathSize( sal_Int32 nIndex )
"svx",
"ooxml shape, path width: " << nCoordWidth << " height: "
<< nCoordHeight);
+
+ // Try to set up scale separately, if given only width or height
+ // This is possible case in OOXML when only width or height is non-zero
if ( nCoordWidth == 0 )
- fXScale = 1.0;
+ {
+ if ( nWidth )
+ fXScale = (double)aLogicRect.GetWidth() / (double)nWidth;
+ else
+ fXScale = 1.0;
+ }
if ( nCoordHeight == 0 )
- fYScale = 1.0;
+ {
+ if ( nHeight )
+ fYScale = (double)aLogicRect.GetHeight() / (double)nHeight;
+ else
+ fYScale = 1.0;
+ }
}
if ( (sal_uInt32)nXRef != 0x80000000 && aLogicRect.GetHeight() )
{