From ca80f73c3a330c38493e5e358bfa887adbe21db2 Mon Sep 17 00:00:00 2001 From: Mike Kaganski Date: Sat, 14 Nov 2015 14:04:20 +1000 Subject: tdf#95775: Allow zero shape width/height; fix setting width/height relation Conflicts: sw/qa/extras/ooxmlimport/ooxmlimport.cxx Reviewed on: https://gerrit.libreoffice.org/19962 Change-Id: Ic91ebf4a18a77704dc1ccd1e1180b42d0bc84c74 --- sw/qa/extras/ooxmlimport/data/tdf95775.docx | Bin 0 -> 22523 bytes sw/qa/extras/ooxmlimport/ooxmlimport.cxx | 5 +++++ sw/source/core/doc/textboxhelper.cxx | 6 ++++++ sw/source/core/layout/atrfrm.cxx | 2 +- 4 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 sw/qa/extras/ooxmlimport/data/tdf95775.docx diff --git a/sw/qa/extras/ooxmlimport/data/tdf95775.docx b/sw/qa/extras/ooxmlimport/data/tdf95775.docx new file mode 100644 index 000000000000..a4c1293a56ba Binary files /dev/null and b/sw/qa/extras/ooxmlimport/data/tdf95775.docx differ diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx index 5138377e4079..19dfa31dfc66 100644 --- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx +++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx @@ -2920,6 +2920,11 @@ DECLARE_OOXMLIMPORT_TEST(testTdf85232, "tdf85232.docx") CPPUNIT_ASSERT_EQUAL(static_cast(2267), xShape->getPosition().X); } +DECLARE_OOXMLIMPORT_TEST(testTdf95775, "tdf95775.docx") +{ + // This must not fail in layout +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/core/doc/textboxhelper.cxx b/sw/source/core/doc/textboxhelper.cxx index d640c96dfc83..4c89861a2c41 100644 --- a/sw/source/core/doc/textboxhelper.cxx +++ b/sw/source/core/doc/textboxhelper.cxx @@ -486,6 +486,12 @@ void SwTextBoxHelper::syncProperty(SwFrameFormat* pShape, sal_uInt16 nWID, sal_u case MID_FRMSIZE_IS_AUTO_HEIGHT: aPropertyName = UNO_NAME_FRAME_ISAUTOMATIC_HEIGHT; break; + case MID_FRMSIZE_REL_HEIGHT_RELATION: + aPropertyName = UNO_NAME_RELATIVE_HEIGHT_RELATION; + break; + case MID_FRMSIZE_REL_WIDTH_RELATION: + aPropertyName = UNO_NAME_RELATIVE_WIDTH_RELATION; + break; default: aPropertyName = UNO_NAME_SIZE; bAdjustSize = true; diff --git a/sw/source/core/layout/atrfrm.cxx b/sw/source/core/layout/atrfrm.cxx index 129eca5fd76e..c8d4ca656fc8 100644 --- a/sw/source/core/layout/atrfrm.cxx +++ b/sw/source/core/layout/atrfrm.cxx @@ -282,7 +282,7 @@ bool SwFormatFrmSize::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId ) aTmp.Height() = convertMm100ToTwip(aTmp.Height()); aTmp.Width() = convertMm100ToTwip(aTmp.Width()); } - if(aTmp.Height() && aTmp.Width()) + if(aTmp.Height() || aTmp.Width()) m_aSize = aTmp; else bRet = false; -- cgit v1.2.3