summaryrefslogtreecommitdiff
path: root/chart2/qa/extras/chart2import.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'chart2/qa/extras/chart2import.cxx')
-rw-r--r--chart2/qa/extras/chart2import.cxx22
1 files changed, 22 insertions, 0 deletions
diff --git a/chart2/qa/extras/chart2import.cxx b/chart2/qa/extras/chart2import.cxx
index 0b70320d1e9a..4a6f07d5f310 100644
--- a/chart2/qa/extras/chart2import.cxx
+++ b/chart2/qa/extras/chart2import.cxx
@@ -91,6 +91,7 @@ public:
void testTextBreakXLSX();
void testNumberFormatsXLSX();
void testNumberFormatsDOCX();
+ void testPercentageNumberFormatsDOCX();
void testTransparentBackground(OUString const & filename);
@@ -209,6 +210,7 @@ public:
CPPUNIT_TEST(testTextBreakXLSX);
CPPUNIT_TEST(testNumberFormatsXLSX);
CPPUNIT_TEST(testNumberFormatsDOCX);
+ CPPUNIT_TEST(testPercentageNumberFormatsDOCX);
CPPUNIT_TEST(testAutoTitleDelDefaultValue2007XLSX);
CPPUNIT_TEST(testAutoTitleDelDefaultValue2013XLSX);
CPPUNIT_TEST(testDispBlanksAsDefaultValue2007XLSX);
@@ -1314,6 +1316,26 @@ void Chart2ImportTest::testNumberFormatsDOCX()
CPPUNIT_ASSERT_MESSAGE("\"LinkNumberFormatToSource\" should be set to false.", !bLinkNumberFormatToSource);
}
+void Chart2ImportTest::testPercentageNumberFormatsDOCX()
+{
+ load("/chart2/qa/extras/data/docx/", "tdf133632.docx");
+ uno::Reference< chart2::XChartDocument > xChartDoc(getChartDocFromWriter(0), uno::UNO_QUERY);
+ CPPUNIT_ASSERT(xChartDoc.is());
+
+ css::uno::Reference<chart2::XDiagram> xDiagram(xChartDoc->getFirstDiagram(), UNO_SET_THROW);
+ Reference<chart2::XDataSeries> xDataSeries = getDataSeriesFromDoc(xChartDoc, 0);
+ uno::Reference<beans::XPropertySet> xPropertySet(xDataSeries, uno::UNO_QUERY_THROW);
+ CPPUNIT_ASSERT(xPropertySet.is());
+
+ bool bLinkNumberFormatToSource = false;
+ chart2::DataPointLabel aLabel;
+ xPropertySet->getPropertyValue("Label") >>= aLabel;
+ CPPUNIT_ASSERT_EQUAL(sal_False, aLabel.ShowNumber);
+ CPPUNIT_ASSERT_EQUAL(sal_True, aLabel.ShowNumberInPercent);
+ bool bSuccess = xPropertySet->getPropertyValue(CHART_UNONAME_LINK_TO_SRC_NUMFMT) >>= bLinkNumberFormatToSource;
+ CPPUNIT_ASSERT_MESSAGE("\"LinkNumberFormatToSource\" should be set to true.", bSuccess && bLinkNumberFormatToSource);
+}
+
void Chart2ImportTest::testAutoTitleDelDefaultValue2007XLSX()
{
load("/chart2/qa/extras/data/xlsx/", "autotitledel_2007.xlsx");