summaryrefslogtreecommitdiff
path: root/writerfilter
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2017-04-25 09:25:34 +0200
committerAndras Timar <andras.timar@collabora.com>2017-05-04 12:48:22 +0200
commit81a8995e0e5219da6f48baa81fbed5c9e38acf34 (patch)
treeb376a9b843b1e029f76427b0ffce4ec86bff3184 /writerfilter
parentcc7db12b9d3974d1f82655cbda46f14bb9fdfb22 (diff)
tdf#107104 DOCX drawingML import: fix invisible arrow shape
This is the drawingML equivalent of commit 3d9ebded1358395ed81db7a63629b046aec2aeac (Misc improvements for docx VML import, 2010-10-06), which made sure that shapes are never invisible just because they have zero height or width. For this particular bugdoc the Word-produced WW8 equivalent width is 20 twips, but let's be consistent with the VML import and just round up to 1 mm100. Also fix two existing tests that wanted to test something else, but implicitly asserted that some shapes indeed have zero width/height. (cherry picked from commit e6e5a68f52f4e06b73f0ece3a3886f3bfc30f56d) Change-Id: I9600424520d0a3deecc711b44622eccc041a59da Reviewed-on: https://gerrit.libreoffice.org/36953 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com> (cherry picked from commit 7d3baea4a726d6c0cf6cb0d6a8b2c83cef4f580d)
Diffstat (limited to 'writerfilter')
-rw-r--r--writerfilter/source/dmapper/GraphicImport.cxx6
1 files changed, 6 insertions, 0 deletions
diff --git a/writerfilter/source/dmapper/GraphicImport.cxx b/writerfilter/source/dmapper/GraphicImport.cxx
index f9458182505f..991b1461ed8d 100644
--- a/writerfilter/source/dmapper/GraphicImport.cxx
+++ b/writerfilter/source/dmapper/GraphicImport.cxx
@@ -543,6 +543,12 @@ void GraphicImport::lcl_attribute(Id nName, Value& rValue)
case NS_ooxml::LN_CT_PositiveSize2D_cy:
{
sal_Int32 nDim = oox::drawingml::convertEmuToHmm(nIntValue);
+ // drawingML equivalent of oox::vml::ShapeType::getAbsRectangle():
+ // make sure a shape isn't hidden implicitly just because it has
+ // zero height or width.
+ if (nDim == 0)
+ nDim = 1;
+
if( nName == NS_ooxml::LN_CT_PositiveSize2D_cx )
m_pImpl->setXSize(nDim);
else