diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2016-01-09 18:39:26 +1000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2016-07-13 20:14:47 +0000 |
commit | 88dc41490189a6ccc218c633c6385d4e99af0216 (patch) | |
tree | 5bded5f04fe6a5ae541701813af87bd2b69ccc71 /sw | |
parent | a52bd477f9404c05c18876533e66c9676a84c5ae (diff) |
tdf#92157: allow both dimensions of a graphic to be 0
Commit ca80f73 made it possible for one of dimensions to be zero.
This commit goes further, allowing opening real-life documents
with graphics having both width and height equal to 0.
Thanks to libreoffice@arbruijn.dds.nl for debugging and initial
patch!
Change-Id: I96a13b776adfd9fe46fc2c7691eb7904400c20a1
Reviewed-on: https://gerrit.libreoffice.org/21287
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com>
(cherry picked from commit 654f6ff28d7a148950b48ed8905d8f13a015a5b5)
Reviewed-on: https://gerrit.libreoffice.org/27199
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/qa/extras/ooxmlimport/data/tdf92157.docx | bin | 0 -> 25188 bytes | |||
-rw-r--r-- | sw/qa/extras/ooxmlimport/ooxmlimport.cxx | 5 | ||||
-rw-r--r-- | sw/source/core/layout/atrfrm.cxx | 5 |
3 files changed, 6 insertions, 4 deletions
diff --git a/sw/qa/extras/ooxmlimport/data/tdf92157.docx b/sw/qa/extras/ooxmlimport/data/tdf92157.docx Binary files differnew file mode 100644 index 000000000000..ba5bc2a8f5f5 --- /dev/null +++ b/sw/qa/extras/ooxmlimport/data/tdf92157.docx diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx index 1c026e68b869..8a772ae1ee1d 100644 --- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx +++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx @@ -2971,6 +2971,11 @@ DECLARE_OOXMLIMPORT_TEST(testTdf95775, "tdf95775.docx") // This must not fail in layout } +DECLARE_OOXMLIMPORT_TEST(testTdf92157, "tdf92157.docx") +{ + // A graphic with dimensions 0,0 should not fail on load +} + DECLARE_OOXMLIMPORT_TEST(testTdf60351, "tdf60351.docx") { // Get the first image in the document and check its contour polygon. diff --git a/sw/source/core/layout/atrfrm.cxx b/sw/source/core/layout/atrfrm.cxx index 9e0b50c15fb4..e0f9418d7ab0 100644 --- a/sw/source/core/layout/atrfrm.cxx +++ b/sw/source/core/layout/atrfrm.cxx @@ -282,10 +282,7 @@ bool SwFormatFrameSize::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId ) aTmp.Height() = convertMm100ToTwip(aTmp.Height()); aTmp.Width() = convertMm100ToTwip(aTmp.Width()); } - if(aTmp.Height() || aTmp.Width()) - m_aSize = aTmp; - else - bRet = false; + m_aSize = aTmp; } } break; |