diff options
author | Vasily Melenchuk <Vasily.Melenchuk@cib.de> | 2017-05-15 13:41:14 +0300 |
---|---|---|
committer | Thorsten Behrens <Thorsten.Behrens@CIB.de> | 2017-05-31 00:41:11 +0200 |
commit | 9c3100a4b9f258a7dc0aff93bc01fa39f7501d2c (patch) | |
tree | 47f33d6628081894a124be02ccf2e33104725350 /svx | |
parent | 735f1becd2500d2572f47dfcea319c156d9b5484 (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.
Reviewed-on: https://gerrit.libreoffice.org/37639
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
(cherry picked from commit 5477f7274e4df1210298c0f503a54eabc0f06bfc)
plus:
tdf#100072 extra test for DOCX shape import with zero height
Corresponding bug is already fixed in tdf#107104. However created
tests do care only for width, but not for height, like we have in
this testcase.
Reviewed-on: https://gerrit.libreoffice.org/37538
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
(cherry picked from commit cffc5a04661fc0a84dff9fa5da954236d88a8b38)
Change-Id: If5d5499f402379df125b0f31dd071ca51b2553f1
Reviewed-on: https://gerrit.libreoffice.org/38224
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.cxx | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/svx/source/customshapes/EnhancedCustomShape2d.cxx b/svx/source/customshapes/EnhancedCustomShape2d.cxx index 6a5e9e9c87e9..85886b22ec3e 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() ) { |