From 92c25a6163dca79987fd8fe7c3efd5527edc29b5 Mon Sep 17 00:00:00 2001 From: Markus Mohrhard Date: Thu, 29 Nov 2018 01:53:12 +0100 Subject: [PATCH] add test for tdf#105236 Change-Id: I5464504ae9ee411221c2cb2ff6f27b7b7e131326 Reviewed-on: https://gerrit.libreoffice.org/64201 Tested-by: Jenkins Reviewed-by: Markus Mohrhard --- chart2/qa/extras/chart2import.cxx | 14 ++++++++++++++ .../data/xls/source_number_format_axis.xls | Bin 0 -> 7168 bytes 2 files changed, 14 insertions(+) create mode 100644 chart2/qa/extras/data/xls/source_number_format_axis.xls diff --git a/chart2/qa/extras/chart2import.cxx b/chart2/qa/extras/chart2import.cxx index d0a5c344a1e6..64e343c6d639 100644 --- a/chart2/qa/extras/chart2import.cxx +++ b/chart2/qa/extras/chart2import.cxx @@ -118,6 +118,7 @@ public: void testDeletedDataLabel(); void testDataPointInheritedColorDOCX(); void testExternalStrRefsXLSX(); + void testSourceNumberFormatComplexCategoriesXLS(); CPPUNIT_TEST_SUITE(Chart2ImportTest); CPPUNIT_TEST(Fdo60083); @@ -190,6 +191,7 @@ public: CPPUNIT_TEST(testDeletedDataLabel); CPPUNIT_TEST(testDataPointInheritedColorDOCX); CPPUNIT_TEST(testExternalStrRefsXLSX); + CPPUNIT_TEST(testSourceNumberFormatComplexCategoriesXLS); CPPUNIT_TEST_SUITE_END(); @@ -1700,6 +1702,18 @@ void Chart2ImportTest::testExternalStrRefsXLSX() CPPUNIT_ASSERT_EQUAL(OUString("test2"), aValues[1].get()); } +void Chart2ImportTest::testSourceNumberFormatComplexCategoriesXLS() +{ + load("/chart2/qa/extras/data/xls/", "source_number_format_axis.xls"); + uno::Reference< chart2::XChartDocument > xChartDoc( getChartCompFromSheet( 0, mxComponent ), UNO_QUERY_THROW ); + CPPUNIT_ASSERT(xChartDoc.is()); + + Reference xAxis = getAxisFromDoc(xChartDoc, 0, 0, 0); + chart2::ScaleData aScaleData = xAxis->getScaleData(); + sal_Int32 nNumberFormat = aScaleData.Categories->getValues()->getNumberFormatKeyByIndex(-1); + CPPUNIT_ASSERT(nNumberFormat != 0); +} + CPPUNIT_TEST_SUITE_REGISTRATION(Chart2ImportTest); CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/chart2/qa/extras/data/xls/source_number_format_axis.xls b/chart2/qa/extras/data/xls/source_number_format_axis.xls new file mode 100644 index 0000000000000000000000000000000000000000..bc54593ac150f2e8cf6d4e0e2e8edf36f31bf65f GIT binary patch literal 7168 zcmeHLU2IfE6h5=NZEvBpx4;7OQx+5`P!L!U5V55N42cE#F(QFTTXq2{6l+Z+qAVa7 z6G?<7m`zBOh=~S+5)yn+LwPYKuJH$X&?mqrq7RE=3<+@kzH{#_+wB&%NHi#?{buH# zduGm=GiT1s-fzDtKX>@}(DRZ-b0jF&onk4>;2X62`p>pV0B!QFJC5VC(Y!}@kq54M zwsH+aSi}N=YhDCcKrzq<;QJDhczHcj|3Ls6>wNe0?moCDz)| zToEdg_h`|SG3Rs(9g#nr2o(C%5h0&8D*tkRd^#?dd{2CinoIt_%Rd62MmRl>d_PZg z{gBS)kMDtB)dPP*5B%bsd_fSXJ_Bj^~^f==2mh5n9{lq8;=B>G}pCzX_F+>vN11wN$DMDPxEZK=fLNjZ4% zpvZ!~5>3W6r$>?3lZv=Rqv#99THVBZkO@>IzTOCL*V%12+ zB_4n{5G@>x77je?Pn?NYC89}`muQT#5_lR|1h=MtE<4pU%8D_1jZ40rW|OW)TwK2iOQ@)O|rG=^aWYj)zz>Cgo2F;UB1 zD(j!yyOsB@s+OLf~iLs02 zWu3N|*ZcAo0SfR&;od*o(hAVE1`CRUWXgm*K4kN_OxZl|Hq+Vnn*N3{dTSAJp8|NI zfcq3wf4WcPmg$Y?bKGG#pRnFP!tyTOgk=~6g4&O|%cxx_$@K`!a+Uc?%eqcUT2!XL zu7a3tP$j3Uf6r9AoB;Z|oS&;-!P*D$7nV&J;a8kfSnYHN#=uIaxw0ClPz*cM@9Ws1 zbR}vd#cBF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