[Libreoffice-commits] core.git: Branch 'private/moggi/abstract-chart-rendering' - 4 commits - chart2/inc chart2/source

Markus Mohrhard markus.mohrhard at googlemail.com
Tue Oct 15 07:51:38 PDT 2013


 chart2/inc/DataSeriesState.hxx                  |    5 +-
 chart2/source/view/inc/AbstractShapeFactory.hxx |    5 +-
 chart2/source/view/inc/DummyXShape.hxx          |   43 ++++++++++++++++++++++--
 chart2/source/view/inc/OpenglShapeFactory.hxx   |    5 +-
 chart2/source/view/inc/ShapeFactory.hxx         |    5 +-
 chart2/source/view/main/DummyXShape.cxx         |   41 ++++++++++++++++++++++
 chart2/source/view/main/OpenglShapeFactory.cxx  |   10 +++--
 chart2/source/view/main/ShapeFactory.cxx        |    5 +-
 8 files changed, 103 insertions(+), 16 deletions(-)

New commits:
commit d51c42d65a74dabda783a577a46e04c85b757304
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Tue Oct 15 16:50:57 2013 +0200

    implement XMultiPropertySet
    
    Change-Id: I91878c0883f0de03341eee65f2925ec3beb71889

diff --git a/chart2/source/view/inc/DummyXShape.hxx b/chart2/source/view/inc/DummyXShape.hxx
index fde04f6..9de599d 100644
--- a/chart2/source/view/inc/DummyXShape.hxx
+++ b/chart2/source/view/inc/DummyXShape.hxx
@@ -10,11 +10,12 @@
 #ifndef CHART2_DUMMY_XSHAPE_HXX
 #define CHART2_DUMMY_XSHAPE_HXX
 
-#include <cppuhelper/implbase5.hxx>
+#include <cppuhelper/implbase6.hxx>
 
 #include <com/sun/star/drawing/XShape.hpp>
 #include <com/sun/star/drawing/XShapes.hpp>
 #include <com/sun/star/beans/XPropertySet.hpp>
+#include <com/sun/star/beans/XMultiPropertySet.hpp>
 #include <com/sun/star/container/XNamed.hpp>
 #include <com/sun/star/container/XChild.hpp>
 #include <com/sun/star/lang/XServiceInfo.hpp>
@@ -36,9 +37,10 @@ class DummyChart;
 
 struct OpenglContext;
 
-class DummyXShape : public cppu::WeakImplHelper5<
+class DummyXShape : public cppu::WeakImplHelper6<
                     ::com::sun::star::drawing::XShape,
                     com::sun::star::beans::XPropertySet,
+                    com::sun::star::beans::XMultiPropertySet,
                     com::sun::star::container::XNamed,
                     com::sun::star::container::XChild,
                     com::sun::star::lang::XServiceInfo >
@@ -67,6 +69,25 @@ public:
     virtual void SAL_CALL addVetoableChangeListener( const OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
     virtual void SAL_CALL removeVetoableChangeListener( const OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
 
+    // XMultiPropertySet
+    virtual void SAL_CALL setPropertyValues( const ::com::sun::star::uno::Sequence< OUString >& aPropertyNames,
+            const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aValues )
+        throw (::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException,
+                ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+
+    virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > SAL_CALL getPropertyValues(
+            const ::com::sun::star::uno::Sequence< OUString >& aPropertyNames )
+        throw (::com::sun::star::uno::RuntimeException);
+
+    virtual void SAL_CALL addPropertiesChangeListener( const ::com::sun::star::uno::Sequence< OUString >& aPropertyNames, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertiesChangeListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
+
+    virtual void SAL_CALL removePropertiesChangeListener( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertiesChangeListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
+
+    virtual void SAL_CALL firePropertiesChangeEvent( const ::com::sun::star::uno::Sequence< OUString >& aPropertyNames,
+            const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertiesChangeListener >& xListener )
+        throw (::com::sun::star::uno::RuntimeException);
+
+
     // XChild
     virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL getParent(  ) throw(::com::sun::star::uno::RuntimeException);
     virtual void SAL_CALL setParent( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& Parent ) throw(::com::sun::star::lang::NoSupportException, ::com::sun::star::uno::RuntimeException);
diff --git a/chart2/source/view/main/DummyXShape.cxx b/chart2/source/view/main/DummyXShape.cxx
index 807216b..26184f8 100644
--- a/chart2/source/view/main/DummyXShape.cxx
+++ b/chart2/source/view/main/DummyXShape.cxx
@@ -100,6 +100,34 @@ void DummyXShape::removeVetoableChangeListener( const OUString&, const uno::Refe
 {
 }
 
+void DummyXShape::setPropertyValues( const uno::Sequence< OUString >& ,
+        const uno::Sequence< uno::Any >& )
+throw (beans::PropertyVetoException, lang::IllegalArgumentException,
+        lang::WrappedTargetException, uno::RuntimeException)
+{
+}
+
+uno::Sequence< uno::Any > DummyXShape::getPropertyValues(
+        const uno::Sequence< OUString >& )
+    throw (uno::RuntimeException)
+{
+    return uno::Sequence< uno::Any >();
+}
+
+    void DummyXShape::addPropertiesChangeListener( const uno::Sequence< OUString >& , const uno::Reference< beans::XPropertiesChangeListener >& ) throw (uno::RuntimeException)
+{
+}
+
+    void DummyXShape::removePropertiesChangeListener( const uno::Reference< beans::XPropertiesChangeListener >& ) throw (uno::RuntimeException)
+{
+}
+
+void DummyXShape::firePropertiesChangeEvent( const uno::Sequence< OUString >& ,
+        const uno::Reference< beans::XPropertiesChangeListener >& )
+    throw (uno::RuntimeException)
+{
+}
+
 OUString DummyXShape::getImplementationName()
     throw(uno::RuntimeException)
 {
commit 9a558a8438d38d034957f83f75f349390c75f357
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Tue Oct 15 16:38:55 2013 +0200

    implement top level shape and method to get it
    
    This class contains the glcontext
    
    Change-Id: If0418cfbfb0486396a75ab274e7b480607f8de6d

diff --git a/chart2/source/view/inc/DummyXShape.hxx b/chart2/source/view/inc/DummyXShape.hxx
index 93b1936f..fde04f6 100644
--- a/chart2/source/view/inc/DummyXShape.hxx
+++ b/chart2/source/view/inc/DummyXShape.hxx
@@ -32,6 +32,10 @@ namespace chart {
 
 namespace dummy {
 
+class DummyChart;
+
+struct OpenglContext;
+
 class DummyXShape : public cppu::WeakImplHelper5<
                     ::com::sun::star::drawing::XShape,
                     com::sun::star::beans::XPropertySet,
@@ -72,6 +76,8 @@ public:
     virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException);
     virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw (::com::sun::star::uno::RuntimeException);
 
+    virtual DummyChart* getRootShape();
+
 private:
     OUString maName;
     com::sun::star::awt::Point maPosition;
@@ -81,6 +87,18 @@ private:
 
 };
 
+class DummyChart : public DummyXShape
+{
+public:
+    virtual DummyChart* getRootShape();
+
+    OpenglContext* getGlContext() { return mpContext; }
+
+private:
+    OpenglContext* mpContext;
+};
+
+
 class DummyXShapes : public DummyXShape, public com::sun::star::drawing::XShapes
 {
 public:
diff --git a/chart2/source/view/main/DummyXShape.cxx b/chart2/source/view/main/DummyXShape.cxx
index 39bac9e..807216b 100644
--- a/chart2/source/view/main/DummyXShape.cxx
+++ b/chart2/source/view/main/DummyXShape.cxx
@@ -155,6 +155,19 @@ void DummyXShape::setParent( const uno::Reference< uno::XInterface >& xParent )
     mxParent = xParent;
 }
 
+DummyChart* DummyXShape::getRootShape()
+{
+    assert(mxParent.is());
+    DummyXShape* pParent = dynamic_cast<DummyXShape*>(mxParent.get());
+    assert(pParent);
+    return pParent->getRootShape();
+}
+
+DummyChart* DummyChart::getRootShape()
+{
+    return this;
+}
+
 uno::Any DummyXShapes::queryInterface( const uno::Type& rType )
     throw(uno::RuntimeException)
 {
commit 83eb035115133b5aadb96710d290d2349549d14d
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Tue Oct 15 16:25:11 2013 +0200

    fix build
    
    Change-Id: I776455675a066dad790bc6beac4aa545186d5192

diff --git a/chart2/inc/DataSeriesState.hxx b/chart2/inc/DataSeriesState.hxx
index 64b27d71..061c467 100644
--- a/chart2/inc/DataSeriesState.hxx
+++ b/chart2/inc/DataSeriesState.hxx
@@ -17,6 +17,7 @@
 #include <map>
 
 #include <com/sun/star/uno/Any.h>
+#include <com/sun/star/chart/MissingValueTreatment.hpp>
 
 namespace chart {
 
@@ -49,7 +50,7 @@ struct DataSeriesProperties
     // hopefully this vector is empty most of the time
     std::vector< PropertyMap > aPointProps;
 
-    com::sun::star::chart::MissingValueTreatment eMissingValueTreatment;
+    sal_Int32 eMissingValueTreatment;
 };
 
 struct Axis
@@ -68,7 +69,7 @@ struct DataSeriesState
     DataSeriesProperties aProperties;
     // also contains bubble chart bubble size
     // apply values to properties with functor
-    std::map<OUString, DataSeries> aMappedProperties;
+    std::map<OUString, DataSequence> aMappedProperties;
     Axis aXAxis;
     Axis aYAxis;
 };
diff --git a/chart2/source/view/main/OpenglShapeFactory.cxx b/chart2/source/view/main/OpenglShapeFactory.cxx
index f4dc5e6..2441289 100644
--- a/chart2/source/view/main/OpenglShapeFactory.cxx
+++ b/chart2/source/view/main/OpenglShapeFactory.cxx
@@ -54,12 +54,13 @@
 
 using namespace ::com::sun::star;
 using ::com::sun::star::uno::Reference;
-using chart::dummy::DummyXShape;
-using chart::dummy::DummyXShapes;
 
 namespace chart
 {
 
+using dummy::DummyXShape;
+using dummy::DummyXShapes;
+
 namespace opengl {
 
 uno::Reference< drawing::XShapes > OpenglShapeFactory::getOrCreateChartRootShape(
commit bb1b31ba01539dec7e26efd7c8df189b10b91760
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Tue Oct 15 16:18:19 2013 +0200

    adapt name of method
    
    Change-Id: I02435256f747bb2bff63414735fa5af3b3413e82

diff --git a/chart2/source/view/inc/AbstractShapeFactory.hxx b/chart2/source/view/inc/AbstractShapeFactory.hxx
index 6a25e9e..8dd8137 100644
--- a/chart2/source/view/inc/AbstractShapeFactory.hxx
+++ b/chart2/source/view/inc/AbstractShapeFactory.hxx
@@ -232,10 +232,11 @@ public:
             com::sun::star::drawing::XShapes> & xTarget,
             const DataSeriesState& rSeriesState ) = 0;
 
-    virtual void pushNextSeriesState( const com::sun::star::uno::Reference<
+    virtual void renderSeries( const com::sun::star::uno::Reference<
             com::sun::star::drawing::XShapes> & xTarget,
             const DataSeriesState& rOldSeriesState,
-            const DataSeriesState& rNewSeriesState ) = 0;
+            const DataSeriesState& rNewSeriesState,
+            double nPercent ) = 0;
 
     static ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >
          getChartRootShape( const ::com::sun::star::uno::Reference<
diff --git a/chart2/source/view/inc/OpenglShapeFactory.hxx b/chart2/source/view/inc/OpenglShapeFactory.hxx
index 93b5e14..1dc444d 100644
--- a/chart2/source/view/inc/OpenglShapeFactory.hxx
+++ b/chart2/source/view/inc/OpenglShapeFactory.hxx
@@ -178,10 +178,11 @@ public:
             com::sun::star::drawing::XShapes> & xTarget,
             const DataSeriesState& rSeriesState );
 
-    virtual void pushNextSeriesState( const com::sun::star::uno::Reference<
+    virtual void renderSeries( const com::sun::star::uno::Reference<
             com::sun::star::drawing::XShapes> & xTarget,
             const DataSeriesState& rOldSeriesState,
-            const DataSeriesState& rNewSeriesState );
+            const DataSeriesState& rNewSeriesState,
+            double nPercent );
 
     virtual ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >
          getOrCreateChartRootShape( const ::com::sun::star::uno::Reference<
diff --git a/chart2/source/view/inc/ShapeFactory.hxx b/chart2/source/view/inc/ShapeFactory.hxx
index 0a46454..04db1d0 100644
--- a/chart2/source/view/inc/ShapeFactory.hxx
+++ b/chart2/source/view/inc/ShapeFactory.hxx
@@ -193,10 +193,11 @@ public:
             com::sun::star::drawing::XShapes> & xTarget,
             const DataSeriesState& rSeriesState );
 
-    virtual void pushNextSeriesState( const com::sun::star::uno::Reference<
+    virtual void renderSeries( const com::sun::star::uno::Reference<
             com::sun::star::drawing::XShapes> & xTarget,
             const DataSeriesState& rOldSeriesState,
-            const DataSeriesState& rNewSeriesState );
+            const DataSeriesState& rNewSeriesState,
+            double nPercent );
 
     virtual ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >
          getOrCreateChartRootShape( const ::com::sun::star::uno::Reference<
diff --git a/chart2/source/view/main/OpenglShapeFactory.cxx b/chart2/source/view/main/OpenglShapeFactory.cxx
index dc62d6f..f4dc5e6 100644
--- a/chart2/source/view/main/OpenglShapeFactory.cxx
+++ b/chart2/source/view/main/OpenglShapeFactory.cxx
@@ -288,10 +288,11 @@ void OpenglShapeFactory::createSeries( const uno::Reference<
 {
 }
 
-void OpenglShapeFactory::pushNextSeriesState( const uno::Reference<
+void OpenglShapeFactory::renderSeries( const uno::Reference<
         drawing::XShapes> & ,
         const DataSeriesState& ,
-        const DataSeriesState& )
+        const DataSeriesState&,
+        double )
 {
 }
 
diff --git a/chart2/source/view/main/ShapeFactory.cxx b/chart2/source/view/main/ShapeFactory.cxx
index 9a7f59e..2bf11e4 100644
--- a/chart2/source/view/main/ShapeFactory.cxx
+++ b/chart2/source/view/main/ShapeFactory.cxx
@@ -2127,10 +2127,11 @@ void ShapeFactory::createSeries( const uno::Reference<
     throw uno::RuntimeException();
 }
 
-void ShapeFactory::pushNextSeriesState( const uno::Reference<
+void ShapeFactory::renderSeries( const uno::Reference<
         drawing::XShapes> & ,
         const DataSeriesState& ,
-        const DataSeriesState& )
+        const DataSeriesState&,
+        double )
 {
     // unsupported for now
     // do we actually want to support this in the normal


More information about the Libreoffice-commits mailing list