diff options
author | Miklos Vajna <vmiklos@suse.cz> | 2013-06-07 11:49:10 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@suse.cz> | 2013-06-07 12:26:09 +0200 |
commit | a22ef599bd3fdcf0bd5c3616aa566a5922624ff3 (patch) | |
tree | ebf5e8e234208effa4888fb17c152246e056eaf4 | |
parent | e57eeb6d5f547a4a49df796641141c733f6c5204 (diff) |
bnc#820788 VML import of v:textbox's mso-fit-shape-to-text style property
Change-Id: I74a0ecd50ca61a4f5bf7ebdbf12743dc1fd9368a
-rw-r--r-- | oox/source/vml/vmltextboxcontext.cxx | 4 | ||||
-rwxr-xr-x | sw/qa/extras/ooxmlimport/data/n820788.docx | bin | 0 -> 10267 bytes | |||
-rw-r--r-- | sw/qa/extras/ooxmlimport/ooxmlimport.cxx | 12 |
3 files changed, 16 insertions, 0 deletions
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 Binary files differnew file mode 100755 index 000000000000..759c4085d6e4 --- /dev/null +++ b/sw/qa/extras/ooxmlimport/data/n820788.docx 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<sal_Int16>(xPropertySet, "DateFormat")); } +void Test::testN820788() +{ + // The problem was that AutoSize was not enabled for the text frame. + uno::Reference<text::XTextFramesSupplier> xTextFramesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xIndexAccess(xTextFramesSupplier->getTextFrames(), uno::UNO_QUERY); + uno::Reference<beans::XPropertySet> xFrame(xIndexAccess->getByIndex(0), uno::UNO_QUERY); + // This was text::SizeType::FIX. + CPPUNIT_ASSERT_EQUAL(text::SizeType::MIN, getProperty<sal_Int16>(xFrame, "SizeType")); +} + CPPUNIT_TEST_SUITE_REGISTRATION(Test); CPPUNIT_PLUGIN_IMPLEMENT(); |