summaryrefslogtreecommitdiffstats
path: root/sw
diff options
context:
space:
mode:
Diffstat (limited to 'sw')
-rw-r--r--sw/CppunitTest_sw_ooxmlimport.mk2
-rw-r--r--sw/qa/extras/ooxmlimport/data/chart-prop.docxbin0 -> 17749 bytes
-rw-r--r--sw/qa/extras/ooxmlimport/ooxmlimport.cxx14
3 files changed, 16 insertions, 0 deletions
diff --git a/sw/CppunitTest_sw_ooxmlimport.mk b/sw/CppunitTest_sw_ooxmlimport.mk
index b558073b9691..45cac9ec1d0e 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 000000000000..f9cddd4949a6
--- /dev/null
+++ b/sw/qa/extras/ooxmlimport/data/chart-prop.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index df6b0a1acde7..f2ab2c4407dc 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();