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

Miklos Vajna vmiklos at suse.cz
Sat Jun 22 21:19:52 PDT 2013


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

New commits:
commit 418f712d6e59a2142125ed7815143496bfb5ea81
Author: Miklos Vajna <vmiklos at suse.cz>
Date:   Fri Jun 21 10:31:19 2013 +0200

    fdo#43641 testcase
    
    Change-Id: I3426c7c23eb23fa7f91320ac036b0eb565bbc330
    (cherry picked from commit abfcf7b958afb16a0e68525cefca5813ce7135eb)
    Reviewed-on: https://gerrit.libreoffice.org/4424
    Reviewed-by: Fridrich Strba <fridrich at documentfoundation.org>
    Tested-by: Fridrich Strba <fridrich at documentfoundation.org>

diff --git a/sw/qa/extras/ooxmlimport/data/fdo43641.docx b/sw/qa/extras/ooxmlimport/data/fdo43641.docx
new file mode 100644
index 0000000..90622f8
Binary files /dev/null and b/sw/qa/extras/ooxmlimport/data/fdo43641.docx differ
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index c895db2..a398d91 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -43,6 +43,7 @@
 #include <bordertest.hxx>
 
 #define TWIP_TO_MM100(TWIP) ((TWIP) >= 0 ? (((TWIP)*127L+36L)/72L) : (((TWIP)*127L-36L)/72L))
+#define EMU_TO_MM100(EMU) (EMU / 360)
 
 class Test : public SwModelTestBase
 {
@@ -120,6 +121,7 @@ public:
     void testN820509();
     void testN820788();
     void testN820504();
+    void testFdo43641();
 
     CPPUNIT_TEST_SUITE(Test);
 #if !defined(MACOSX) && !defined(WNT)
@@ -207,6 +209,7 @@ void Test::run()
         {"n820509.docx", &Test::testN820509},
         {"n820788.docx", &Test::testN820788},
         {"n820504.docx", &Test::testN820504},
+        {"fdo43641.docx", &Test::testFdo43641},
     };
     header();
     for (unsigned int i = 0; i < SAL_N_ELEMENTS(aMethods); ++i)
@@ -1469,6 +1472,16 @@ void Test::testN820504()
     CPPUNIT_ASSERT_EQUAL(sal_Int32(4040635), getProperty<sal_Int32>(xStyle, "CharColor"));
 }
 
+void Test::testFdo43641()
+{
+    uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(mxComponent, uno::UNO_QUERY);
+    uno::Reference<container::XIndexAccess> xDraws(xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY);
+    uno::Reference<container::XIndexAccess> xGroupShape(xDraws->getByIndex(0), uno::UNO_QUERY);
+    uno::Reference<drawing::XShape> xLine(xGroupShape->getByIndex(1), uno::UNO_QUERY);
+    // This was 2200, not 2579 in mm100, i.e. the size of the line shape was incorrect.
+    CPPUNIT_ASSERT_EQUAL(sal_Int32(EMU_TO_MM100(928694)), xLine->getSize().Width);
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(Test);
 
 CPPUNIT_PLUGIN_IMPLEMENT();


More information about the Libreoffice-commits mailing list