summaryrefslogtreecommitdiff
authorMiklos Vajna <vmiklos@suse.cz>2013-06-07 09:49:10 (GMT)
committer Miklos Vajna <vmiklos@suse.cz>2013-06-07 10:26:09 (GMT)
commita22ef599bd3fdcf0bd5c3616aa566a5922624ff3 (patch) (side-by-side diff)
treeebf5e8e234208effa4888fb17c152246e056eaf4
parente57eeb6d5f547a4a49df796641141c733f6c5204 (diff)
downloadcore-a22ef599bd3fdcf0bd5c3616aa566a5922624ff3.zip
core-a22ef599bd3fdcf0bd5c3616aa566a5922624ff3.tar.gz
bnc#820788 VML import of v:textbox's mso-fit-shape-to-text style property
Change-Id: I74a0ecd50ca61a4f5bf7ebdbf12743dc1fd9368a
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--oox/source/vml/vmltextboxcontext.cxx4
-rwxr-xr-xsw/qa/extras/ooxmlimport/data/n820788.docxbin0 -> 10267 bytes
-rw-r--r--sw/qa/extras/ooxmlimport/ooxmlimport.cxx12
3 files changed, 16 insertions, 0 deletions
diff --git a/oox/source/vml/vmltextboxcontext.cxx b/oox/source/vml/vmltextboxcontext.cxx
index ca124bc..0adf943 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 0000000..759c408
--- a/dev/null
+++ b/sw/qa/extras/ooxmlimport/data/n820788.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index b30ebd6..b1fc3d5 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();