diff --git a/oox/source/vml/vmltextboxcontext.cxx b/oox/source/vml/vmltextboxcontext.cxx index ca124bcb4d18..0adf9431ff03 100644 --- a/oox/source/vml/vmltextboxcontext.cxx +++ b/oox/source/vml/vmltextboxcontext.cxx @@ -187,6 +187,10 @@ TextBoxContext::TextBoxContext( ContextHandler2Helper& rParent, TextBox& rTextBo if( ConversionHelper::separatePair( aName, aValue, sStyle.getToken( 0, ';', nIndex ), ':' ) ) { if( aName == "layout-flow" ) rTextBox.maLayoutFlow = aValue; + else if (aName == "mso-fit-shape-to-text") + rTextBox.mrTypeModel.mbAutoHeight = true; + else + SAL_WARN("oox", "unhandled style property: " << aName); } } } diff --git a/sw/qa/extras/ooxmlimport/data/n820788.docx b/sw/qa/extras/ooxmlimport/data/n820788.docx new file mode 100755 index 000000000000..759c4085d6e4 Binary files /dev/null and b/sw/qa/extras/ooxmlimport/data/n820788.docx differ diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx index b30ebd6f465e..b1fc3d5c4ba2 100644 --- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx +++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx @@ -118,6 +118,7 @@ public: void testPageBorderShadow(); void testN816593(); void testN820509(); + void testN820788(); CPPUNIT_TEST_SUITE(Test); #if !defined(MACOSX) && !defined(WNT) @@ -203,6 +204,7 @@ void Test::run() {"page-border-shadow.docx", &Test::testPageBorderShadow}, {"n816593.docx", &Test::testN816593}, {"n820509.docx", &Test::testN820509}, + {"n820788.docx", &Test::testN820788}, }; header(); for (unsigned int i = 0; i < SAL_N_ELEMENTS(aMethods); ++i) @@ -1451,6 +1453,16 @@ void Test::testN820509() CPPUNIT_ASSERT_EQUAL(sal_Int16(8), getProperty(xPropertySet, "DateFormat")); } +void Test::testN820788() +{ + // The problem was that AutoSize was not enabled for the text frame. + uno::Reference xTextFramesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference xIndexAccess(xTextFramesSupplier->getTextFrames(), uno::UNO_QUERY); + uno::Reference xFrame(xIndexAccess->getByIndex(0), uno::UNO_QUERY); + // This was text::SizeType::FIX. + CPPUNIT_ASSERT_EQUAL(text::SizeType::MIN, getProperty(xFrame, "SizeType")); +} + CPPUNIT_TEST_SUITE_REGISTRATION(Test); CPPUNIT_PLUGIN_IMPLEMENT();