[Libreoffice-commits] core.git: chart2/qa chart2/source

Balazs Varga (via logerrit) logerrit at kemper.freedesktop.org
Wed Jun 26 09:01:11 UTC 2019


 chart2/qa/extras/chart2import.cxx         |   19 +++++++++++++++++++
 chart2/qa/extras/data/xlsx/tdf126033.xlsx |binary
 chart2/source/view/main/VDataSeries.cxx   |    2 +-
 3 files changed, 20 insertions(+), 1 deletion(-)

New commits:
commit 2783a34899379dae84889c924e49481631280ab1
Author:     Balazs Varga <balazs.varga991 at gmail.com>
AuthorDate: Tue Jun 25 13:26:41 2019 +0200
Commit:     László Németh <nemeth at numbertext.org>
CommitDate: Wed Jun 26 11:00:22 2019 +0200

    tdf#126033 chart: hide removed marker of a single data point
    
    instead of showing a black square.
    
    Note: the patch fixes also the OOXML import (see the unit test).
    
    Change-Id: Ie578db3dd9ba310b0ce972832269acd5ae501778
    Reviewed-on: https://gerrit.libreoffice.org/74690
    Tested-by: Jenkins
    Reviewed-by: László Németh <nemeth at numbertext.org>

diff --git a/chart2/qa/extras/chart2import.cxx b/chart2/qa/extras/chart2import.cxx
index 803e99e773da..569ba8388d26 100644
--- a/chart2/qa/extras/chart2import.cxx
+++ b/chart2/qa/extras/chart2import.cxx
@@ -74,6 +74,7 @@ public:
     void testTdf108021();
     void testTdf100084();
     void testTdf124817();
+    void testTdf126033();
     void testAutoBackgroundXLSX();
     void testAutoChartAreaBorderPropXLSX();
     void testChartAreaStyleBackgroundXLSX();
@@ -167,6 +168,7 @@ public:
     CPPUNIT_TEST(testTdf108021);
     CPPUNIT_TEST(testTdf100084);
     CPPUNIT_TEST(testTdf124817);
+    CPPUNIT_TEST(testTdf126033);
     CPPUNIT_TEST(testAutoBackgroundXLSX);
     CPPUNIT_TEST(testAutoChartAreaBorderPropXLSX);
     CPPUNIT_TEST(testChartAreaStyleBackgroundXLSX);
@@ -933,6 +935,23 @@ void Chart2ImportTest::testTdf124817()
     CPPUNIT_ASSERT((xPropSet_2->getPropertyValue("Symbol") >>= aSymblProp) && (aSymblProp.BorderColor == static_cast<sal_Int32>(0xFF0000)));
 }
 
+void Chart2ImportTest::testTdf126033()
+{
+    load("/chart2/qa/extras/data/xlsx/", "tdf126033.xlsx");
+    Reference<chart2::XChartDocument> xChartDoc = getChartDocFromSheet(0, mxComponent);
+    CPPUNIT_ASSERT_MESSAGE("failed to load chart", xChartDoc.is());
+
+    // Check symbol style and size of data points
+    chart2::Symbol aSymblProp;
+    uno::Reference<chart2::XDataSeries> xDataSeries(getDataSeriesFromDoc(xChartDoc, 0));
+    CPPUNIT_ASSERT(xDataSeries.is());
+    uno::Reference<beans::XPropertySet> xPropertySet(xDataSeries->getDataPointByIndex(0), uno::UNO_SET_THROW);
+    CPPUNIT_ASSERT(xPropertySet->getPropertyValue("Symbol") >>= aSymblProp);
+    CPPUNIT_ASSERT_EQUAL(chart2::SymbolStyle_NONE, aSymblProp.Style);
+    CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(176), aSymblProp.Size.Width);
+    CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(176), aSymblProp.Size.Height);
+}
+
 void Chart2ImportTest::testTransparentBackground(OUString const & filename)
 {
     load("/chart2/qa/extras/data/xlsx/", filename);
diff --git a/chart2/qa/extras/data/xlsx/tdf126033.xlsx b/chart2/qa/extras/data/xlsx/tdf126033.xlsx
new file mode 100644
index 000000000000..ee60103c98e4
Binary files /dev/null and b/chart2/qa/extras/data/xlsx/tdf126033.xlsx differ
diff --git a/chart2/source/view/main/VDataSeries.cxx b/chart2/source/view/main/VDataSeries.cxx
index 6781f2044e7c..a446cd79d538 100644
--- a/chart2/source/view/main/VDataSeries.cxx
+++ b/chart2/source/view/main/VDataSeries.cxx
@@ -803,7 +803,7 @@ Symbol* VDataSeries::getSymbolProperties( sal_Int32 index ) const
                     m_apSymbolProperties_InvisibleSymbolForSelection.reset(new Symbol);
                     m_apSymbolProperties_InvisibleSymbolForSelection->Style = SymbolStyle_STANDARD;
                     m_apSymbolProperties_InvisibleSymbolForSelection->StandardSymbol = 0;//square
-                    m_apSymbolProperties_InvisibleSymbolForSelection->Size = m_apSymbolProperties_Series->Size;
+                    m_apSymbolProperties_InvisibleSymbolForSelection->Size = com::sun::star::awt::Size(0, 0);//tdf#126033
                     m_apSymbolProperties_InvisibleSymbolForSelection->BorderColor = 0xff000000;//invisible
                     m_apSymbolProperties_InvisibleSymbolForSelection->FillColor = 0xff000000;//invisible
                 }


More information about the Libreoffice-commits mailing list