[Libreoffice-commits] core.git: Branch 'libreoffice-4-1' - oox/source sw/qa

Miklos Vajna vmiklos at suse.cz
Fri Jun 7 03:46:42 PDT 2013


 oox/source/vml/vmltextboxcontext.cxx       |    4 ++++
 sw/qa/extras/ooxmlimport/data/n820788.docx |binary
 sw/qa/extras/ooxmlimport/ooxmlimport.cxx   |   12 ++++++++++++
 3 files changed, 16 insertions(+)

New commits:
commit de320f38621a879c7826b9280e3ff00121fbf80f
Author: Miklos Vajna <vmiklos at suse.cz>
Date:   Fri Jun 7 11:49:10 2013 +0200

    bnc#820788 VML import of v:textbox's mso-fit-shape-to-text style property
    
    Change-Id: I74a0ecd50ca61a4f5bf7ebdbf12743dc1fd9368a
    (cherry picked from commit a22ef599bd3fdcf0bd5c3616aa566a5922624ff3)

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
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 aaf9cc9..ce66980 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -118,6 +118,7 @@ public:
     void testWatermark();
     void testPageBorderShadow();
     void testN820509();
+    void testN820788();
 
     CPPUNIT_TEST_SUITE(Test);
 #if !defined(MACOSX) && !defined(WNT)
@@ -203,6 +204,7 @@ void Test::run()
         {"watermark.docx", &Test::testWatermark},
         {"page-border-shadow.docx", &Test::testPageBorderShadow},
         {"n820509.docx", &Test::testN820509},
+        {"n820788.docx", &Test::testN820788},
     };
     header();
     for (unsigned int i = 0; i < SAL_N_ELEMENTS(aMethods); ++i)
@@ -1445,6 +1447,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();


More information about the Libreoffice-commits mailing list