Kaydet (Commit) 7d637b71 authored tarafından Tushar Bende's avatar Tushar Bende Kaydeden (comit) Miklos Vajna

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/6056Reviewed-by: 's avatarMiklos Vajna <vmiklos@collabora.co.uk>
Tested-by: 's avatarMiklos Vajna <vmiklos@collabora.co.uk>
üst f154d002
......@@ -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 \
......
......@@ -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();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment