[Libreoffice-commits] .: sw/qa

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Fri Sep 21 02:35:40 PDT 2012


 sw/qa/extras/ooxmlimport/data/n779627.docx |binary
 sw/qa/extras/ooxmlimport/ooxmlimport.cxx   |   18 ++++++++++++++++++
 2 files changed, 18 insertions(+)

New commits:
commit a0b108ac29e9645c1b2b548d69397cdb71b5a79e
Author: Cédric Bosdonnat <cedric.bosdonnat at free.fr>
Date:   Fri Sep 21 11:32:52 2012 +0200

    Added unit test for 53b7f7df0617bcbd7bbef9a34ef53e5097eb16dc
    
    Change-Id: Ifb3216115e6d4ad8e3b40ab798ed438b7e502f47

diff --git a/sw/qa/extras/ooxmlimport/data/n779627.docx b/sw/qa/extras/ooxmlimport/data/n779627.docx
new file mode 100644
index 0000000..0993208
Binary files /dev/null and b/sw/qa/extras/ooxmlimport/data/n779627.docx differ
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index 05d7102..6216502 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -90,6 +90,7 @@ public:
     void testN778828();
     void testInk();
     void testN779834();
+    void testN779627();
 
     CPPUNIT_TEST_SUITE(Test);
 #if !defined(MACOSX) && !defined(WNT)
@@ -126,6 +127,7 @@ public:
     CPPUNIT_TEST(testN778828);
     CPPUNIT_TEST(testInk);
     CPPUNIT_TEST(testN779834);
+    CPPUNIT_TEST(testN779627);
 #endif
     CPPUNIT_TEST_SUITE_END();
 
@@ -867,6 +869,22 @@ void Test::testN779834()
     load("n779834.docx");
 }
 
+void Test::testN779627()
+{
+    /*
+     * The problem was that the table left position was based on the tableCellMar left value
+     * even for nested tables, while it shouldn't.
+     */
+    load("n779627.docx");
+    uno::Reference<text::XTextTablesSupplier> xTablesSupplier(mxComponent, uno::UNO_QUERY);
+    uno::Reference<container::XIndexAccess> xTables(xTablesSupplier->getTextTables( ), uno::UNO_QUERY);
+    uno::Reference<beans::XPropertySet> xTableProperties(xTables->getByIndex(0), uno::UNO_QUERY);
+    uno::Any aValue = xTableProperties->getPropertyValue("LeftMargin");
+    sal_Int32 nLeftMargin;
+    aValue >>= nLeftMargin;
+    CPPUNIT_ASSERT_EQUAL(sal_Int32(0), nLeftMargin);
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(Test);
 
 CPPUNIT_PLUGIN_IMPLEMENT();


More information about the Libreoffice-commits mailing list