diff options
-rw-r--r-- | chart2/qa/extras/chart2import.cxx | 30 | ||||
-rw-r--r-- | chart2/qa/extras/data/pptx/tdf105517.pptx | bin | 0 -> 37194 bytes | |||
-rw-r--r-- | oox/source/drawingml/clrscheme.cxx | 6 |
3 files changed, 35 insertions, 1 deletions
diff --git a/chart2/qa/extras/chart2import.cxx b/chart2/qa/extras/chart2import.cxx index 9b95105640f8..a49e80e1b867 100644 --- a/chart2/qa/extras/chart2import.cxx +++ b/chart2/qa/extras/chart2import.cxx @@ -62,6 +62,7 @@ public: void testFdo54361(); void testFdo54361_1(); void testTdf86624(); // manually placed legends + void testTdf105517(); void testTdf106217(); void testAutoBackgroundXLSX(); void testChartAreaStyleBackgroundXLSX(); @@ -129,6 +130,7 @@ public: CPPUNIT_TEST(testFdo54361); CPPUNIT_TEST(testFdo54361_1); CPPUNIT_TEST(testTdf86624); + CPPUNIT_TEST(testTdf105517); CPPUNIT_TEST(testTdf106217); CPPUNIT_TEST(testAutoBackgroundXLSX); CPPUNIT_TEST(testChartAreaStyleBackgroundXLSX); @@ -747,6 +749,34 @@ void Chart2ImportTest::testTdf86624() CPPUNIT_ASSERT(aPos.Y > 4000); // real value for ms is above 7000 } +void Chart2ImportTest::testTdf105517() +{ + load("/chart2/qa/extras/data/pptx/", "tdf105517.pptx"); + Reference<chart2::XChartDocument> xChartDoc(getChartDocFromDrawImpress(0, 0), uno::UNO_QUERY); + CPPUNIT_ASSERT(xChartDoc.is()); + + Reference<chart2::XCoordinateSystemContainer> xCoordContainer(xChartDoc->getFirstDiagram(), uno::UNO_QUERY); + CPPUNIT_ASSERT(xCoordContainer.is()); + Reference<chart2::XChartTypeContainer> xChartTypeContainer(xCoordContainer->getCoordinateSystems()[0], uno::UNO_QUERY); + CPPUNIT_ASSERT(xChartTypeContainer.is()); + Reference<chart2::XDataSeriesContainer> xDSContainer(xChartTypeContainer->getChartTypes()[0], uno::UNO_QUERY); + CPPUNIT_ASSERT(xDSContainer.is()); + Reference<beans::XPropertySet> xPropSet1(xDSContainer->getDataSeries()[0], uno::UNO_QUERY); + CPPUNIT_ASSERT(xPropSet1.is()); + + long lineColor; + xPropSet1->getPropertyValue("Color") >>= lineColor; + // incorrect line color was 0x4a7ebb due to not handling themeOverride + CPPUNIT_ASSERT_EQUAL(lineColor, long(0xeaa700)); + + Reference<beans::XPropertySet> xPropSet2(xDSContainer->getDataSeries()[1], uno::UNO_QUERY); + CPPUNIT_ASSERT(xPropSet2.is()); + + xPropSet2->getPropertyValue("Color") >>= lineColor; + // incorrect line color was 0x98b855 + CPPUNIT_ASSERT_EQUAL(lineColor, long(0x1e69a8)); +} + void Chart2ImportTest::testTdf106217() { load("/chart2/qa/extras/data/pptx/", "tdf106217.pptx"); diff --git a/chart2/qa/extras/data/pptx/tdf105517.pptx b/chart2/qa/extras/data/pptx/tdf105517.pptx Binary files differnew file mode 100644 index 000000000000..ff9d747f0349 --- /dev/null +++ b/chart2/qa/extras/data/pptx/tdf105517.pptx diff --git a/oox/source/drawingml/clrscheme.cxx b/oox/source/drawingml/clrscheme.cxx index 7a99f3685a07..0c6517abfbc3 100644 --- a/oox/source/drawingml/clrscheme.cxx +++ b/oox/source/drawingml/clrscheme.cxx @@ -82,7 +82,11 @@ bool ClrScheme::getColor( sal_Int32 nSchemeClrToken, sal_Int32& rColor ) const void ClrScheme::setColor( sal_Int32 nSchemeClrToken, sal_Int32 nColor ) { - maClrScheme.emplace_back(nSchemeClrToken, nColor); + const auto aIter = std::find_if(maClrScheme.begin(), maClrScheme.end(), find_by_token(nSchemeClrToken) ); + if ( aIter != maClrScheme.end() ) + aIter->second = nColor; + else + maClrScheme.emplace_back(nSchemeClrToken, nColor); } bool ClrScheme::getColorByIndex(size_t nIndex, sal_Int32& rColor) const |