summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2015-11-14 14:04:20 +1000
committerMiklos Vajna <vmiklos@collabora.co.uk>2015-11-14 12:28:46 +0100
commitca80f73c3a330c38493e5e358bfa887adbe21db2 (patch)
treeb58eecda34fa6cd4e1aaa980da51df29cd8d2793
parentf23d092cc08176f470c4d3d9cd3eb1bcf6f2a487 (diff)
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
-rw-r--r--sw/qa/extras/ooxmlimport/data/tdf95775.docxbin0 -> 22523 bytes
-rw-r--r--sw/qa/extras/ooxmlimport/ooxmlimport.cxx5
-rw-r--r--sw/source/core/doc/textboxhelper.cxx6
-rw-r--r--sw/source/core/layout/atrfrm.cxx2
4 files changed, 12 insertions, 1 deletions
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
--- /dev/null
+++ b/sw/qa/extras/ooxmlimport/data/tdf95775.docx
Binary files 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<sal_Int32>(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;