summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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.cxx13
3 files changed, 17 insertions, 0 deletions
diff --git a/oox/source/vml/vmltextboxcontext.cxx b/oox/source/vml/vmltextboxcontext.cxx
index b96bb605f9e9..17b087220c0f 100644
--- a/oox/source/vml/vmltextboxcontext.cxx
+++ b/oox/source/vml/vmltextboxcontext.cxx
@@ -188,6 +188,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
--- /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 bd85ca23334e..7eb556cfc76d 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -35,6 +35,7 @@
#include <com/sun/star/text/HoriOrientation.hpp>
#include <com/sun/star/text/RelOrientation.hpp>
#include <com/sun/star/text/SetVariableType.hpp>
+#include <com/sun/star/text/SizeType.hpp>
#include <com/sun/star/text/TableColumnSeparator.hpp>
#include <com/sun/star/text/TextContentAnchorType.hpp>
#include <com/sun/star/text/VertOrientation.hpp>
@@ -124,6 +125,7 @@ public:
void testWatermark();
void testPageBorderShadow();
void testN820509();
+ void testN820788();
CPPUNIT_TEST_SUITE(Test);
#if !defined(MACOSX) && !defined(WNT)
@@ -198,6 +200,7 @@ void Test::run()
{"watermark.docx", &Test::testWatermark},
{"page-border-shadow.docx", &Test::testPageBorderShadow},
{"n820509.docx", &Test::testN820509},
+ {"n820788.docx", &Test::testN820788},
};
for (unsigned int i = 0; i < SAL_N_ELEMENTS(aMethods); ++i)
{
@@ -1246,6 +1249,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();