summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--chart2/qa/extras/chart2import.cxx34
-rw-r--r--chart2/qa/extras/data/ods/error_bar_range.odsbin0 -> 13490 bytes
-rw-r--r--chart2/qa/extras/data/ods/fdo60083.ods (renamed from chart2/qa/extras/data/ods/error_bar_simple.ods)bin14538 -> 14538 bytes
3 files changed, 33 insertions, 1 deletions
diff --git a/chart2/qa/extras/chart2import.cxx b/chart2/qa/extras/chart2import.cxx
index 251c8a188833..b498c695ff96 100644
--- a/chart2/qa/extras/chart2import.cxx
+++ b/chart2/qa/extras/chart2import.cxx
@@ -41,6 +41,7 @@ class Chart2ImportTest : public test::BootstrapFixture, public unotest::MacrosTe
public:
void Fdo60083();
void testSteppedLines();
+ void testErrorBarRange();
virtual void setUp();
virtual void tearDown();
@@ -48,6 +49,7 @@ public:
CPPUNIT_TEST_SUITE(Chart2ImportTest);
CPPUNIT_TEST(Fdo60083);
CPPUNIT_TEST(testSteppedLines);
+ CPPUNIT_TEST(testErrorBarRange);
CPPUNIT_TEST_SUITE_END();
private:
@@ -66,7 +68,7 @@ private:
// split method up into smaller chunks for more detailed tests
void Chart2ImportTest::Fdo60083()
{
- load("/chart2/qa/extras/data/ods/", "error_bar_simple.ods");
+ load("/chart2/qa/extras/data/ods/", "fdo60083.ods");
uno::Reference< chart2::XChartDocument > xChartDoc = getChartDocFromSheet( 0, mxComponent );
CPPUNIT_ASSERT(xChartDoc.is());
@@ -114,6 +116,36 @@ void Chart2ImportTest::Fdo60083()
CPPUNIT_ASSERT(!xErrorBarXProps.is());
}
+void Chart2ImportTest::testErrorBarRange()
+{
+ load("/chart2/qa/extras/data/ods/", "error_bar_range.ods");
+ 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;
+ CPPUNIT_ASSERT(xErrorBarYProps.is());
+
+ sal_Int32 nErrorBarStyle;
+ CPPUNIT_ASSERT(
+ xErrorBarYProps->getPropertyValue("ErrorBarStyle")
+ >>= nErrorBarStyle);
+ CPPUNIT_ASSERT_EQUAL(
+ static_cast<sal_Int32>(chart::ErrorBarStyle::FROM_DATA),
+ nErrorBarStyle);
+
+ OUString aRangePos;
+ CPPUNIT_ASSERT(xErrorBarYProps->getPropertyValue("ErrorBarRangePositive") >>= aRangePos);
+ CPPUNIT_ASSERT_EQUAL(aRangePos, OUString("$Sheet1.$C$2:$C$4"));
+}
+
// stepped line interpolation
void Chart2ImportTest::testSteppedLines()
diff --git a/chart2/qa/extras/data/ods/error_bar_range.ods b/chart2/qa/extras/data/ods/error_bar_range.ods
new file mode 100644
index 000000000000..27a0103e5789
--- /dev/null
+++ b/chart2/qa/extras/data/ods/error_bar_range.ods
Binary files differ
diff --git a/chart2/qa/extras/data/ods/error_bar_simple.ods b/chart2/qa/extras/data/ods/fdo60083.ods
index 74704f6185ac..74704f6185ac 100644
--- a/chart2/qa/extras/data/ods/error_bar_simple.ods
+++ b/chart2/qa/extras/data/ods/fdo60083.ods
Binary files differ