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

Markus Mohrhard markus.mohrhard at collabora.co.uk
Tue Mar 11 14:41:10 PDT 2014


 chart2/qa/extras/chart2export.cxx           |   33 ++++++++++++++++++++++++++++
 chart2/qa/extras/data/ods/ErrorBarRange.ods |binary
 chart2/source/tools/ErrorBar.cxx            |    2 -
 3 files changed, 34 insertions(+), 1 deletion(-)

New commits:
commit 5da51525fab4d424b76b681ee70f76b54d99f73d
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date:   Tue Mar 11 22:36:01 2014 +0100

    add test for fdo#75510
    
    Change-Id: I76cb1008138f7b79223330d4a24d45a026d1118f

diff --git a/chart2/qa/extras/chart2export.cxx b/chart2/qa/extras/chart2export.cxx
index e3554e5..0dd8d63 100644
--- a/chart2/qa/extras/chart2export.cxx
+++ b/chart2/qa/extras/chart2export.cxx
@@ -49,6 +49,7 @@ public:
     void testShapeFollowedByChart();
     void testPieChartDataLabels();
     void testSeriesIdxOrder();
+    void testErrorBarDataRangeODS();
 
     CPPUNIT_TEST_SUITE(Chart2ExportTest);
     CPPUNIT_TEST(test);
@@ -70,6 +71,7 @@ public:
     CPPUNIT_TEST(testShapeFollowedByChart);
     CPPUNIT_TEST(testPieChartDataLabels);
     CPPUNIT_TEST(testSeriesIdxOrder);
+    CPPUNIT_TEST(testErrorBarDataRangeODS);
     CPPUNIT_TEST_SUITE_END();
 
 protected:
@@ -620,6 +622,37 @@ void Chart2ExportTest::testSeriesIdxOrder()
     assertXPath(pXmlDoc, "/c:chartSpace[1]/c:chart[1]/c:plotArea[1]/c:lineChart[1]/c:ser[1]/c:idx[1]", "val", "1");
     assertXPath(pXmlDoc, "/c:chartSpace[1]/c:chart[1]/c:plotArea[1]/c:lineChart[1]/c:ser[1]/c:order[1]", "val", "1");
 }
+
+void Chart2ExportTest::testErrorBarDataRangeODS()
+{
+    load("/chart2/qa/extras/data/ods/", "ErrorBarRange.ods");
+    reload("calc8");
+
+    uno::Reference< chart2::XChartDocument > xChartDoc = getChartDocFromSheet( 0, mxComponent );
+    CPPUNIT_ASSERT(xChartDoc.is());
+
+    Reference< chart2::XDataSeries > xDataSeries = getDataSeriesFromDoc( xChartDoc, 0 );
+    CPPUNIT_ASSERT( xDataSeries.is() );
+
+    Reference< beans::XPropertySet > xPropSet( xDataSeries, UNO_QUERY_THROW );
+    CPPUNIT_ASSERT( xPropSet.is() );
+
+    // test that y error bars are there
+    Reference< beans::XPropertySet > xErrorBarYProps;
+    xPropSet->getPropertyValue("ErrorBarY") >>= xErrorBarYProps;
+    uno::Any aAny = xErrorBarYProps->getPropertyValue("ErrorBarRangePositive");
+    CPPUNIT_ASSERT(aAny.hasValue());
+    OUString aPosRange;
+    aAny >>= aPosRange;
+    CPPUNIT_ASSERT_EQUAL(OUString("$Sheet1.$B$1:$B$3"), aPosRange);
+
+    aAny = xErrorBarYProps->getPropertyValue("ErrorBarRangeNegative");
+    CPPUNIT_ASSERT(aAny.hasValue());
+    OUString aNegRange;
+    aAny >>= aNegRange;
+    CPPUNIT_ASSERT_EQUAL(OUString("$Sheet1.$C$1:$C$3"), aNegRange);
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(Chart2ExportTest);
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/chart2/qa/extras/data/ods/ErrorBarRange.ods b/chart2/qa/extras/data/ods/ErrorBarRange.ods
new file mode 100644
index 0000000..28e6aee
Binary files /dev/null and b/chart2/qa/extras/data/ods/ErrorBarRange.ods differ
commit 7470b3ef17570581fe590a4853de59cac1be6ea5
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date:   Tue Mar 11 22:10:30 2014 +0100

    fix negative error bar range export, fdo#75510
    
    Change-Id: Icca2f9fc26b15b968a940e5c73f7ad3781f75e94

diff --git a/chart2/source/tools/ErrorBar.cxx b/chart2/source/tools/ErrorBar.cxx
index 1469e8e..c500ddd 100644
--- a/chart2/source/tools/ErrorBar.cxx
+++ b/chart2/source/tools/ErrorBar.cxx
@@ -256,7 +256,7 @@ uno::Any ErrorBar::getPropertyValue(const OUString& rPropName)
             uno::Sequence< uno::Reference< chart2::data::XLabeledDataSequence > > aSequences =
                 getDataSequences();
 
-            aRange = getSourceRangeStrFromLabeledSequences( aSequences, true );
+            aRange = getSourceRangeStrFromLabeledSequences( aSequences, false );
         }
 
         aRet <<= aRange;


More information about the Libreoffice-commits mailing list