[Libreoffice-commits] core.git: 3 commits - chart2/qa offapi/com

Markus Mohrhard markus.mohrhard at googlemail.com
Sat Mar 23 23:45:08 PDT 2013


 chart2/qa/extras/chart2import.cxx                    |   59 ++++++++++++++++++-
 offapi/com/sun/star/chart/LineDiagram.idl            |    5 +
 offapi/com/sun/star/sheet/XUnnamedDatabaseRanges.idl |    1 
 3 files changed, 62 insertions(+), 3 deletions(-)

New commits:
commit d1bc91ea645f490bd3da205c31fe45711d009f29
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Sun Mar 24 07:39:45 2013 +0100

    add import test for stepped lines
    
    Change-Id: I5a11bc65ca82719c0e8de94628ae4958afe57aa4

diff --git a/chart2/qa/extras/chart2import.cxx b/chart2/qa/extras/chart2import.cxx
index e30e1a0..7933001 100644
--- a/chart2/qa/extras/chart2import.cxx
+++ b/chart2/qa/extras/chart2import.cxx
@@ -27,7 +27,9 @@
 #include <com/sun/star/chart2/XChartTypeContainer.hpp>
 #include <com/sun/star/chart2/XCoordinateSystemContainer.hpp>
 #include <com/sun/star/chart2/XDataSeriesContainer.hpp>
+#include <com/sun/star/chart2/CurveStyle.hpp>
 #include <com/sun/star/chart/ErrorBarStyle.hpp>
+#include <com/sun/star/chart/XChartDocument.hpp>
 
 #include <comphelper/processfactory.hxx>
 
@@ -38,12 +40,14 @@ class Chart2ImportTest : public test::BootstrapFixture, public unotest::MacrosTe
 {
 public:
     void Fdo60083();
+    void testSteppedLines();
 
     virtual void setUp();
     virtual void tearDown();
 
     CPPUNIT_TEST_SUITE(Chart2ImportTest);
     CPPUNIT_TEST(Fdo60083);
+    CPPUNIT_TEST(testSteppedLines);
     CPPUNIT_TEST_SUITE_END();
 
 private:
@@ -52,6 +56,8 @@ private:
     Reference< chart2::XChartDocument > getChartDocFromSheet( sal_Int32 nSheet, uno::Reference< lang::XComponent > xComponent );
     Reference< chart2::XDataSeries > getDataSeriesFromDoc( Reference< chart2::XChartDocument > xChartDoc,
             sal_Int32 nDataSeries, sal_Int32 nChartType = 0, sal_Int32 nCooSys = 0 );
+    Reference< chart2::XChartType > getChartTypeFromDoc( Reference< chart2::XChartDocument > xChartDoc,
+            sal_Int32 nChartType, sal_Int32 nCooSys = 0 );
 
     Reference< lang::XComponent > mxComponent;
 };
@@ -100,6 +106,46 @@ void Chart2ImportTest::Fdo60083()
     CPPUNIT_ASSERT(!xErrorBarXProps.is());
 }
 
+
+// stepped line interpolation
+void Chart2ImportTest::testSteppedLines()
+{
+    const sal_Int32 MAXSHEET = 14;
+    chart2::CurveStyle curveStyle[] = {
+        chart2::CurveStyle_LINES,
+        chart2::CurveStyle_CUBIC_SPLINES,
+        chart2::CurveStyle_B_SPLINES,
+        chart2::CurveStyle_STEP_START,
+        chart2::CurveStyle_STEP_END,
+        chart2::CurveStyle_STEP_CENTER_X,
+        chart2::CurveStyle_STEP_CENTER_Y,
+        chart2::CurveStyle_LINES,
+        chart2::CurveStyle_CUBIC_SPLINES,
+        chart2::CurveStyle_B_SPLINES,
+        chart2::CurveStyle_STEP_START,
+        chart2::CurveStyle_STEP_END,
+        chart2::CurveStyle_STEP_CENTER_X,
+        chart2::CurveStyle_STEP_CENTER_Y
+    };
+
+    load("/chart2/qa/extras/data/ods/", "stepped_lines.ods");
+    for(sal_Int32 nSheet = 0; nSheet < MAXSHEET; ++nSheet)
+    {
+        uno::Reference< chart2::XChartDocument > xChart2Doc = getChartDocFromSheet( nSheet, mxComponent );
+        CPPUNIT_ASSERT(xChart2Doc.is());
+
+        Reference< chart2::XChartType > xChartType = getChartTypeFromDoc( xChart2Doc, 0 );
+        CPPUNIT_ASSERT(xChartType.is());
+
+        Reference< beans::XPropertySet > xPropSet( xChartType, UNO_QUERY );
+        CPPUNIT_ASSERT(xPropSet.is());
+
+        chart2::CurveStyle eCurveStyle;
+        xPropSet->getPropertyValue("CurveStyle") >>= eCurveStyle;
+        CPPUNIT_ASSERT_EQUAL(eCurveStyle, curveStyle[nSheet]);
+    }
+}
+
 Reference< chart2::XChartDocument > Chart2ImportTest::getChartDocFromSheet( sal_Int32 nSheet, uno::Reference< lang::XComponent > xComponent )
 {
     // let us assume that we only have one chart per sheet
@@ -132,8 +178,8 @@ Reference< chart2::XChartDocument > Chart2ImportTest::getChartDocFromSheet( sal_
     return xChartDoc;
 }
 
-Reference< chart2::XDataSeries > Chart2ImportTest::getDataSeriesFromDoc( uno::Reference< chart2::XChartDocument > xChartDoc,
-                                                                sal_Int32 nDataSeries, sal_Int32 nChartType, sal_Int32 nCooSys )
+Reference< chart2::XChartType > Chart2ImportTest::getChartTypeFromDoc( Reference< chart2::XChartDocument > xChartDoc,
+                                                                sal_Int32 nChartType, sal_Int32 nCooSys )
 {
     CPPUNIT_ASSERT( xChartDoc.is() );
 
@@ -152,7 +198,14 @@ Reference< chart2::XDataSeries > Chart2ImportTest::getDataSeriesFromDoc( uno::Re
     Sequence< Reference< chart2::XChartType > > xChartTypeSequence( xChartTypeContainer->getChartTypes() );
     CPPUNIT_ASSERT( xChartTypeSequence.getLength() > nChartType );
 
-    Reference< chart2::XDataSeriesContainer > xDataSequenceContainer( xChartTypeSequence[nChartType], UNO_QUERY_THROW );
+    return xChartTypeSequence[nChartType];
+}
+
+Reference< chart2::XDataSeries > Chart2ImportTest::getDataSeriesFromDoc( uno::Reference< chart2::XChartDocument > xChartDoc,
+                                                                sal_Int32 nDataSeries, sal_Int32 nChartType, sal_Int32 nCooSys )
+{
+    Reference< chart2::XChartType > xChartType = getChartTypeFromDoc( xChartDoc, nChartType, nCooSys );
+    Reference< chart2::XDataSeriesContainer > xDataSequenceContainer( xChartType, UNO_QUERY_THROW );
     CPPUNIT_ASSERT ( xDataSequenceContainer.is() );
 
     Sequence< Reference< chart2::XDataSeries > > xSeriesSequence( xDataSequenceContainer->getDataSeries() );
commit c040fcc93393e941af1cf86a6fa97cd74aac70c2
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Sun Mar 24 07:38:55 2013 +0100

    add since tag to XUnnamedDatabaseRanges.idl
    
    Change-Id: Ic1638d1834be046941a620bc11a467a53bbdfb52

diff --git a/offapi/com/sun/star/sheet/XUnnamedDatabaseRanges.idl b/offapi/com/sun/star/sheet/XUnnamedDatabaseRanges.idl
index 6512661..e5f42eb 100644
--- a/offapi/com/sun/star/sheet/XUnnamedDatabaseRanges.idl
+++ b/offapi/com/sun/star/sheet/XUnnamedDatabaseRanges.idl
@@ -42,6 +42,7 @@ module com {  module sun {  module star {  module sheet {
 
 
 /** provides functions to manage the sheet local databases
+ * @since LibreOffice 3.5
  */
 
 interface XUnnamedDatabaseRanges: com::sun::star::uno::XInterface
commit 0a7b372ec49d95ecb563c6dfd57fbd851180887f
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Wed Mar 20 04:13:41 2013 +0100

    adapt API documentation for stepped lines feature
    
    Change-Id: I6c9c20b7c9fa8fd0f1a47ae0f4c17f9d1951b7b0

diff --git a/offapi/com/sun/star/chart/LineDiagram.idl b/offapi/com/sun/star/chart/LineDiagram.idl
index 9d3c525..7685581 100644
--- a/offapi/com/sun/star/chart/LineDiagram.idl
+++ b/offapi/com/sun/star/chart/LineDiagram.idl
@@ -96,11 +96,16 @@ published service LineDiagram
     /** determines if the chart is a spline-chart type and specifies
         the type of splines.
 
+        @see CurveStyle
         <p>You can set the following values:
         <table border>
         <tr><td>0</td><td>lines are used instead of splines</td></tr>
         <tr><td>1</td><td>use cubic splines</td></tr>
         <tr><td>2</td><td>use B-splines</td></tr>
+        <tr><td>3</td><td>use stepped line with step start</td></tr>
+        <tr><td>4</td><td>use stepped line with step end</td></tr>
+        <tr><td>5</td><td>use stepped line with step center x</td></tr>
+        <tr><td>6</td><td>use stepped line with step center y</td></tr>
         </table>
         </p>
      */


More information about the Libreoffice-commits mailing list