[Libreoffice-commits] core.git: sw/CppunitTest_sw_ooxmlimport.mk sw/qa

Tushar Bende tushar.bende at synerzip.com
Tue Oct 1 01:25:15 PDT 2013


 sw/CppunitTest_sw_ooxmlimport.mk              |    2 ++
 sw/qa/extras/ooxmlimport/data/chart-prop.docx |binary
 sw/qa/extras/ooxmlimport/ooxmlimport.cxx      |   14 ++++++++++++++
 3 files changed, 16 insertions(+)

New commits:
commit 7d637b71438921eaf97a66dfc46c6bc88d8aa5d6
Author: Tushar Bende <tushar.bende at synerzip.com>
Date:   Fri Sep 27 18:22:14 2013 +0530

    Unit test case added to verify chart rendering in Writer for docx
    
    Unit Test case to verify Width & Height of Chart rendered
    
    Change-Id: I2899b9bdaf251f82400ebee273b23d09add4b468
    Reviewed-on: https://gerrit.libreoffice.org/6056
    Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>
    Tested-by: Miklos Vajna <vmiklos at collabora.co.uk>

diff --git a/sw/CppunitTest_sw_ooxmlimport.mk b/sw/CppunitTest_sw_ooxmlimport.mk
index b558073..45cac9e 100644
--- a/sw/CppunitTest_sw_ooxmlimport.mk
+++ b/sw/CppunitTest_sw_ooxmlimport.mk
@@ -48,6 +48,8 @@ $(eval $(call gb_CppunitTest_use_ure,sw_ooxmlimport))
 
 $(eval $(call gb_CppunitTest_use_components,sw_ooxmlimport,\
 	basic/util/sb \
+    chart2/source/controller/chartcontroller \
+    chart2/source/chartcore \
     comphelper/util/comphelp \
     configmgr/source/configmgr \
     embeddedobj/util/embobj \
diff --git a/sw/qa/extras/ooxmlimport/data/chart-prop.docx b/sw/qa/extras/ooxmlimport/data/chart-prop.docx
new file mode 100644
index 0000000..f9cddd4
Binary files /dev/null and b/sw/qa/extras/ooxmlimport/data/chart-prop.docx differ
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index df6b0a1..f2ab2c4 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -136,6 +136,7 @@ public:
     void testGroupshapeSdt();
     void testDefaultSectBreakCols();
     void testFdo69636();
+    void testChartProp();
 
     CPPUNIT_TEST_SUITE(Test);
 #if !defined(MACOSX) && !defined(WNT)
@@ -236,6 +237,7 @@ void Test::run()
         {"groupshape-sdt.docx", &Test::testGroupshapeSdt},
         {"default-sect-break-cols.docx", &Test::testDefaultSectBreakCols},
         {"fdo69636.docx", &Test::testFdo69636},
+        {"chart-prop.docx", &Test::testChartProp},
     };
     header();
     for (unsigned int i = 0; i < SAL_N_ELEMENTS(aMethods); ++i)
@@ -1570,6 +1572,18 @@ void Test::testFdo69636()
     CPPUNIT_ASSERT_EQUAL(sal_Int32(900), getProperty<sal_Int32>(getRun(getParagraphOfText(1, xFrame->getText()), 1), "CharRotation"));
 }
 
+void Test::testChartProp()
+{
+    // The problem was that chart was not getting parsed in writer module.
+    uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(mxComponent, uno::UNO_QUERY);
+    uno::Reference<container::XIndexAccess> xDrawPage(xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY);
+    CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xDrawPage->getCount());
+
+    uno::Reference<beans::XPropertySet> xPropertySet(getShape(1), uno::UNO_QUERY);
+    CPPUNIT_ASSERT_EQUAL(sal_Int32(15236), getProperty<sal_Int32>(xPropertySet, "Width"));
+    CPPUNIT_ASSERT_EQUAL(sal_Int32(8886), getProperty<sal_Int32>(xPropertySet, "Height"));
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(Test);
 
 CPPUNIT_PLUGIN_IMPLEMENT();


More information about the Libreoffice-commits mailing list