bnc#820788 VML import of v:textbox's mso-fit-shape-to-text style property

Change-Id: I74a0ecd50ca61a4f5bf7ebdbf12743dc1fd9368a
This commit is contained in:
Miklos Vajna 2013-06-07 11:49:10 +02:00
parent e57eeb6d5f
commit a22ef599bd
3 changed files with 16 additions and 0 deletions

View File

@ -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);
}
}
}

Binary file not shown.

View File

@ -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();