[Libreoffice-commits] core.git: Branch 'private/moggi/abstract-chart-rendering' - 4 commits - chart2/inc chart2/Library_chartcontroller.mk chart2/Library_chartcore.mk chart2/source
Markus Mohrhard
markus.mohrhard at googlemail.com
Tue Oct 15 02:58:18 PDT 2013
chart2/Library_chartcontroller.mk | 1
chart2/Library_chartcore.mk | 9
chart2/inc/ChartModel.hxx | 589 ++++++++++
chart2/inc/ChartView.hxx | 241 ++++
chart2/inc/DataSeriesState.hxx | 71 +
chart2/source/controller/chartapiwrapper/Chart2ModelContact.cxx | 22
chart2/source/controller/chartapiwrapper/Chart2ModelContact.hxx | 5
chart2/source/controller/chartapiwrapper/ChartDataWrapper.cxx | 4
chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx | 20
chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx | 16
chart2/source/controller/chartapiwrapper/TitleWrapper.cxx | 2
chart2/source/controller/chartapiwrapper/WrappedStockProperties.cxx | 2
chart2/source/controller/dialogs/ChartTypeDialogController.cxx | 2
chart2/source/controller/dialogs/DataBrowserModel.cxx | 17
chart2/source/controller/dialogs/DialogModel.cxx | 8
chart2/source/controller/dialogs/ObjectNameProvider.cxx | 3
chart2/source/controller/dialogs/RangeSelectionHelper.cxx | 2
chart2/source/controller/dialogs/TimerTriggeredControllerLock.cxx | 2
chart2/source/controller/dialogs/dlg_ObjectProperties.cxx | 9
chart2/source/controller/dialogs/res_LegendPosition.cxx | 4
chart2/source/controller/dialogs/tp_3D_SceneIllumination.cxx | 6
chart2/source/controller/dialogs/tp_ChartType.cxx | 2
chart2/source/controller/dialogs/tp_DataSource.cxx | 2
chart2/source/controller/dialogs/tp_Wizard_TitlesAndObjects.cxx | 2
chart2/source/controller/inc/RangeSelectionListener.hxx | 2
chart2/source/controller/inc/TimerTriggeredControllerLock.hxx | 2
chart2/source/controller/itemsetwrapper/SeriesOptionsItemConverter.cxx | 5
chart2/source/controller/main/ChartController.cxx | 2
chart2/source/controller/main/ChartController_Insert.cxx | 22
chart2/source/controller/main/ChartController_Position.cxx | 5
chart2/source/controller/main/ChartController_Properties.cxx | 2
chart2/source/controller/main/ChartController_TextEdit.cxx | 2
chart2/source/controller/main/ChartController_Tools.cxx | 16
chart2/source/controller/main/ChartController_Window.cxx | 7
chart2/source/controller/main/ChartModelClone.cxx | 5
chart2/source/controller/main/PositionAndSizeHelper.cxx | 2
chart2/source/inc/AxisHelper.hxx | 4
chart2/source/inc/ChartModelHelper.hxx | 13
chart2/source/inc/ControllerLockGuard.hxx | 18
chart2/source/inc/DataSourceHelper.hxx | 6
chart2/source/inc/DiagramHelper.hxx | 9
chart2/source/inc/ExplicitCategoriesProvider.hxx | 13
chart2/source/inc/LegendHelper.hxx | 12
chart2/source/inc/ObjectIdentifier.hxx | 21
chart2/source/inc/TitleHelper.hxx | 14
chart2/source/inc/chartview/ExplicitValueProvider.hxx | 8
chart2/source/model/main/ChartModel.cxx | 31
chart2/source/model/main/ChartModel.hxx | 585 ---------
chart2/source/model/main/ChartModel_Persistence.cxx | 2
chart2/source/model/main/_serviceregistration_model.cxx | 8
chart2/source/tools/AxisHelper.cxx | 10
chart2/source/tools/ChartModelHelper.cxx | 44
chart2/source/tools/ControllerLockGuard.cxx | 22
chart2/source/tools/DataSourceHelper.cxx | 28
chart2/source/tools/DiagramHelper.cxx | 46
chart2/source/tools/ExplicitCategoriesProvider.cxx | 123 --
chart2/source/tools/InternalDataProvider.cxx | 4
chart2/source/tools/LegendHelper.cxx | 42
chart2/source/tools/ObjectIdentifier.cxx | 136 ++
chart2/source/tools/TitleHelper.cxx | 80 +
chart2/source/view/charttypes/AreaChart.cxx | 204 +--
chart2/source/view/inc/AbstractShapeFactory.hxx | 12
chart2/source/view/inc/DummyShapeFactory.hxx | 188 ---
chart2/source/view/inc/OpenglShapeFactory.hxx | 197 +++
chart2/source/view/inc/ShapeFactory.hxx | 9
chart2/source/view/inc/VDataSeries.hxx | 2
chart2/source/view/main/AbstractShapeFactory.cxx | 4
chart2/source/view/main/ChartView.cxx | 328 ++---
chart2/source/view/main/ChartView.hxx | 240 ----
chart2/source/view/main/DummyShapeFactory.cxx | 287 ----
chart2/source/view/main/OpenglShapeFactory.cxx | 302 +++++
chart2/source/view/main/ShapeFactory.cxx | 18
chart2/source/view/main/VLegend.cxx | 20
chart2/source/view/main/VLegend.hxx | 15
74 files changed, 2333 insertions(+), 1885 deletions(-)
New commits:
commit 6760d34561e3699649690bad301b1a6f2adb9ff8
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Tue Oct 15 11:57:24 2013 +0200
rename DummyShapeFactory to OpenglShapeFactory
Change-Id: Ife9640b10e90351f871513f1f8e26d80c384e0d9
diff --git a/chart2/Library_chartcore.mk b/chart2/Library_chartcore.mk
index 1923261..d007353 100644
--- a/chart2/Library_chartcore.mk
+++ b/chart2/Library_chartcore.mk
@@ -96,7 +96,7 @@ $(eval $(call gb_Library_add_exception_objects,chartcore,\
chart2/source/view/main/Clipping \
chart2/source/view/main/DataPointSymbolSupplier \
chart2/source/view/main/DrawModelWrapper \
- chart2/source/view/main/DummyShapeFactory \
+ chart2/source/view/main/OpenglShapeFactory \
chart2/source/view/main/DummyXShape \
chart2/source/view/main/LabelPositionHelper \
chart2/source/view/main/Linear3DTransformation \
diff --git a/chart2/source/view/inc/DummyShapeFactory.hxx b/chart2/source/view/inc/OpenglShapeFactory.hxx
similarity index 98%
rename from chart2/source/view/inc/DummyShapeFactory.hxx
rename to chart2/source/view/inc/OpenglShapeFactory.hxx
index aa8b38c..93b5e14 100644
--- a/chart2/source/view/inc/DummyShapeFactory.hxx
+++ b/chart2/source/view/inc/OpenglShapeFactory.hxx
@@ -7,16 +7,16 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
-#ifndef CHART2_DUMMY_SHAPE_FACTORY
-#define CHART2_DUMMY_SHAPE_FACTORY
+#ifndef CHART2_OPENGL_SHAPE_FACTORY
+#define CHART2_OPENGL_SHAPE_FACTORY
#include "AbstractShapeFactory.hxx"
namespace chart {
-namespace dummy {
+namespace opengl {
-class DummyShapeFactory : public chart::AbstractShapeFactory
+class OpenglShapeFactory : public chart::AbstractShapeFactory
{
public:
virtual ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >
diff --git a/chart2/source/view/main/AbstractShapeFactory.cxx b/chart2/source/view/main/AbstractShapeFactory.cxx
index 77f9d59..988a9bf 100644
--- a/chart2/source/view/main/AbstractShapeFactory.cxx
+++ b/chart2/source/view/main/AbstractShapeFactory.cxx
@@ -38,7 +38,7 @@
#include <basegfx/matrix/b2dhommatrix.hxx>
#include <basegfx/matrix/b3dhommatrix.hxx>
-#include "DummyShapeFactory.hxx"
+#include "OpenglShapeFactory.hxx"
#include "ShapeFactory.hxx"
using namespace com::sun::star;
@@ -54,7 +54,7 @@ AbstractShapeFactory* AbstractShapeFactory::getOrCreateShapeFactory(uno::Referen
return pShapeFactory;
if(getenv("CHART_DUMMY_FACTORY"))
- pShapeFactory = new dummy::DummyShapeFactory();
+ pShapeFactory = new opengl::OpenglShapeFactory();
else
pShapeFactory = new ShapeFactory(xFactory);
diff --git a/chart2/source/view/main/DummyShapeFactory.cxx b/chart2/source/view/main/OpenglShapeFactory.cxx
similarity index 80%
rename from chart2/source/view/main/DummyShapeFactory.cxx
rename to chart2/source/view/main/OpenglShapeFactory.cxx
index f0c8bdd..dc62d6f 100644
--- a/chart2/source/view/main/DummyShapeFactory.cxx
+++ b/chart2/source/view/main/OpenglShapeFactory.cxx
@@ -17,7 +17,7 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#include "DummyShapeFactory.hxx"
+#include "OpenglShapeFactory.hxx"
#include "DummyXShape.hxx"
#include "ViewDefines.hxx"
#include "Stripe.hxx"
@@ -54,13 +54,15 @@
using namespace ::com::sun::star;
using ::com::sun::star::uno::Reference;
+using chart::dummy::DummyXShape;
+using chart::dummy::DummyXShapes;
namespace chart
{
-namespace dummy {
+namespace opengl {
-uno::Reference< drawing::XShapes > DummyShapeFactory::getOrCreateChartRootShape(
+uno::Reference< drawing::XShapes > OpenglShapeFactory::getOrCreateChartRootShape(
const uno::Reference< drawing::XDrawPage>& )
{
return new DummyXShapes();
@@ -69,7 +71,7 @@ uno::Reference< drawing::XShapes > DummyShapeFactory::getOrCreateChartRootShape(
// methods for 3D shape creation
uno::Reference<drawing::XShape>
- DummyShapeFactory::createCube(
+ OpenglShapeFactory::createCube(
const uno::Reference<drawing::XShapes>&
, const drawing::Position3D& , const drawing::Direction3D&
, sal_Int32
@@ -81,7 +83,7 @@ uno::Reference<drawing::XShape>
}
uno::Reference<drawing::XShape>
- DummyShapeFactory::createCylinder(
+ OpenglShapeFactory::createCylinder(
const uno::Reference<drawing::XShapes>&
, const drawing::Position3D& , const drawing::Direction3D&
, sal_Int32 )
@@ -90,7 +92,7 @@ uno::Reference<drawing::XShape>
}
uno::Reference<drawing::XShape>
- DummyShapeFactory::createPyramid(
+ OpenglShapeFactory::createPyramid(
const uno::Reference<drawing::XShapes>&
, const drawing::Position3D& , const drawing::Direction3D&
, double , bool
@@ -101,7 +103,7 @@ uno::Reference<drawing::XShape>
}
uno::Reference<drawing::XShape>
- DummyShapeFactory::createCone(
+ OpenglShapeFactory::createCone(
const uno::Reference<drawing::XShapes>&
, const drawing::Position3D& , const drawing::Direction3D&
, double , sal_Int32 )
@@ -110,7 +112,7 @@ uno::Reference<drawing::XShape>
}
uno::Reference< drawing::XShape >
- DummyShapeFactory::createPieSegment2D(
+ OpenglShapeFactory::createPieSegment2D(
const uno::Reference< drawing::XShapes >&
, double , double
, double , double
@@ -121,7 +123,7 @@ uno::Reference< drawing::XShape >
}
uno::Reference< drawing::XShape >
- DummyShapeFactory::createPieSegment(
+ OpenglShapeFactory::createPieSegment(
const uno::Reference< drawing::XShapes >&
, double , double
, double , double
@@ -133,7 +135,7 @@ uno::Reference< drawing::XShape >
}
uno::Reference< drawing::XShape >
- DummyShapeFactory::createStripe( const uno::Reference< drawing::XShapes >&
+ OpenglShapeFactory::createStripe( const uno::Reference< drawing::XShapes >&
, const Stripe&
, const uno::Reference< beans::XPropertySet >&
, const tPropertyNameMap&
@@ -145,7 +147,7 @@ uno::Reference< drawing::XShape >
}
uno::Reference< drawing::XShape >
- DummyShapeFactory::createArea3D( const uno::Reference< drawing::XShapes >&
+ OpenglShapeFactory::createArea3D( const uno::Reference< drawing::XShapes >&
, const drawing::PolyPolygonShape3D&
, double )
{
@@ -153,14 +155,14 @@ uno::Reference< drawing::XShape >
}
uno::Reference< drawing::XShape >
- DummyShapeFactory::createArea2D( const uno::Reference< drawing::XShapes >&
+ OpenglShapeFactory::createArea2D( const uno::Reference< drawing::XShapes >&
, const drawing::PolyPolygonShape3D& )
{
return new DummyXShape();
}
uno::Reference< drawing::XShape >
- DummyShapeFactory::createSymbol2D(
+ OpenglShapeFactory::createSymbol2D(
const uno::Reference< drawing::XShapes >&
, const drawing::Position3D&
, const drawing::Direction3D&
@@ -172,7 +174,7 @@ uno::Reference< drawing::XShape >
}
uno::Reference< drawing::XShape >
- DummyShapeFactory::createGraphic2D(
+ OpenglShapeFactory::createGraphic2D(
const uno::Reference< drawing::XShapes >&
, const drawing::Position3D&
, const drawing::Direction3D&
@@ -182,21 +184,21 @@ uno::Reference< drawing::XShape >
}
uno::Reference< drawing::XShapes >
- DummyShapeFactory::createGroup2D( const uno::Reference< drawing::XShapes >&
+ OpenglShapeFactory::createGroup2D( const uno::Reference< drawing::XShapes >&
, OUString )
{
return new DummyXShapes();
}
uno::Reference< drawing::XShapes >
- DummyShapeFactory::createGroup3D( const uno::Reference< drawing::XShapes >&
+ OpenglShapeFactory::createGroup3D( const uno::Reference< drawing::XShapes >&
, OUString )
{
return new DummyXShapes();
}
uno::Reference< drawing::XShape >
- DummyShapeFactory::createCircle2D( const uno::Reference< drawing::XShapes >&
+ OpenglShapeFactory::createCircle2D( const uno::Reference< drawing::XShapes >&
, const drawing::Position3D&
, const drawing::Direction3D& )
{
@@ -204,7 +206,7 @@ uno::Reference< drawing::XShape >
}
uno::Reference< drawing::XShape >
- DummyShapeFactory::createCircle( const uno::Reference< drawing::XShapes >&
+ OpenglShapeFactory::createCircle( const uno::Reference< drawing::XShapes >&
, const awt::Size&
, const awt::Point& )
{
@@ -212,7 +214,7 @@ uno::Reference< drawing::XShape >
}
uno::Reference< drawing::XShape >
- DummyShapeFactory::createLine3D( const uno::Reference< drawing::XShapes >&
+ OpenglShapeFactory::createLine3D( const uno::Reference< drawing::XShapes >&
, const drawing::PolyPolygonShape3D&
, const VLineProperties& )
{
@@ -220,7 +222,7 @@ uno::Reference< drawing::XShape >
}
uno::Reference< drawing::XShape >
- DummyShapeFactory::createLine2D( const uno::Reference< drawing::XShapes >&
+ OpenglShapeFactory::createLine2D( const uno::Reference< drawing::XShapes >&
, const drawing::PointSequenceSequence&
, const VLineProperties* )
{
@@ -228,20 +230,20 @@ uno::Reference< drawing::XShape >
}
uno::Reference< drawing::XShape >
- DummyShapeFactory::createLine ( const uno::Reference< drawing::XShapes >& ,
+ OpenglShapeFactory::createLine ( const uno::Reference< drawing::XShapes >& ,
const awt::Size& , const awt::Point& )
{
return new DummyXShape();
}
-uno::Reference< drawing::XShape > DummyShapeFactory::createInvisibleRectangle(
+uno::Reference< drawing::XShape > OpenglShapeFactory::createInvisibleRectangle(
const uno::Reference< drawing::XShapes >&
, const awt::Size& )
{
return new DummyXShape();
}
-uno::Reference< drawing::XShape > DummyShapeFactory::createRectangle(
+uno::Reference< drawing::XShape > OpenglShapeFactory::createRectangle(
const uno::Reference< drawing::XShapes >&
, const awt::Size&
, const awt::Point&
@@ -252,7 +254,7 @@ uno::Reference< drawing::XShape > DummyShapeFactory::createRectangle(
}
uno::Reference< drawing::XShape >
- DummyShapeFactory::createRectangle(
+ OpenglShapeFactory::createRectangle(
const uno::Reference<
drawing::XShapes >& )
{
@@ -260,7 +262,7 @@ uno::Reference< drawing::XShape >
}
uno::Reference< drawing::XShape >
- DummyShapeFactory::createText( const uno::Reference< drawing::XShapes >&
+ OpenglShapeFactory::createText( const uno::Reference< drawing::XShapes >&
, const OUString&
, const tNameSequence&
, const tAnySequence&
@@ -271,7 +273,7 @@ uno::Reference< drawing::XShape >
uno::Reference< drawing::XShape >
- DummyShapeFactory::createText( const uno::Reference< drawing::XShapes >& ,
+ OpenglShapeFactory::createText( const uno::Reference< drawing::XShapes >& ,
const awt::Size& , const awt::Point& ,
uno::Sequence< uno::Reference< chart2::XFormattedString > > ,
const uno::Reference< beans::XPropertySet > ,
@@ -280,13 +282,13 @@ uno::Reference< drawing::XShape >
return new DummyXShape();
}
-void DummyShapeFactory::createSeries( const uno::Reference<
+void OpenglShapeFactory::createSeries( const uno::Reference<
drawing::XShapes> & ,
const DataSeriesState& )
{
}
-void DummyShapeFactory::pushNextSeriesState( const uno::Reference<
+void OpenglShapeFactory::pushNextSeriesState( const uno::Reference<
drawing::XShapes> & ,
const DataSeriesState& ,
const DataSeriesState& )
commit ef4a197c7fb7e333166211069bf62c59fe3fa1eb
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Tue Oct 15 11:48:57 2013 +0200
add methods to render whole data series at once
additionally we have now a method for timebased data series in the shape
factory. The method contains the two points in time and the rendering
backend should calculate intermitiate points for a good interpolation.
Change-Id: Id30e2039ec90a6c36e947b7a7f9bca65ef0e8961
diff --git a/chart2/Library_chartcore.mk b/chart2/Library_chartcore.mk
index 53fbd2a..1923261 100644
--- a/chart2/Library_chartcore.mk
+++ b/chart2/Library_chartcore.mk
@@ -25,7 +25,10 @@ $(eval $(call gb_Library_add_defs,chartcore,\
$(eval $(call gb_Library_set_precompiled_header,chartcore,$(SRCDIR)/chart2/inc/pch/precompiled_chartcore))
-$(eval $(call gb_Library_use_external,chartcore,boost_headers))
+$(eval $(call gb_Library_use_externals,chartcore,\
+ boost_headers \
+ mdds_headers \
+))
$(eval $(call gb_Library_use_custom_headers,chartcore,\
officecfg/registry \
diff --git a/chart2/inc/DataSeriesState.hxx b/chart2/inc/DataSeriesState.hxx
new file mode 100644
index 0000000..bfe14c9
--- /dev/null
+++ b/chart2/inc/DataSeriesState.hxx
@@ -0,0 +1,71 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#ifndef DATASERIES_HXX
+#define DATASERIES_HXX
+
+#include <rtl/ustring.hxx>
+#include <mdds/multi_type_vector.hpp>
+#include <mdds/multi_type_vector_trait.hpp>
+#include <vector>
+#include <map>
+
+#include <com/sun/star/uno/Any.h>
+
+namespace chart {
+
+class DataSeries
+{
+public:
+ typedef mdds::multi_type_vector<mdds::mtv::element_block_func> DataSeriesType;
+
+ DataSeriesType getDataSeries();
+
+ size_t size();
+ double getValue(size_t nIndex);
+
+private:
+ OUString maLabel;
+ DataSeriesType maDataSeries;
+
+};
+
+/**
+ * point properties overwrite series properties
+ */
+struct DataSeriesProperties
+{
+ typedef std::map< OUString, com::sun::star::uno::Any > PropertyMap;
+ PropertyMap aSeriesProps;
+ std::vector< PropertyMap > aPointProps;
+};
+
+struct Axis
+{
+ double nMin;
+ double nMax;
+ bool bLog;
+ bool bInverseDirection;
+};
+
+struct DataSeriesState
+{
+ DataSeries aXValue;
+ DataSeries aYValue;
+ DataSeriesProperties aProperties;
+ std::map<OUString, DataSeries> aMapProperties;
+ Axis aXAxis;
+ Axis aYAxis;
+};
+
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/chart2/source/view/inc/AbstractShapeFactory.hxx b/chart2/source/view/inc/AbstractShapeFactory.hxx
index 5f915f0..6a25e9e 100644
--- a/chart2/source/view/inc/AbstractShapeFactory.hxx
+++ b/chart2/source/view/inc/AbstractShapeFactory.hxx
@@ -29,6 +29,8 @@
#include <rtl/ustring.hxx>
+#include "DataSeriesState.hxx"
+
namespace chart {
@@ -225,6 +227,16 @@ public:
getOrCreateChartRootShape( const ::com::sun::star::uno::Reference<
::com::sun::star::drawing::XDrawPage>& xPage ) = 0;
+
+ virtual void createSeries( const com::sun::star::uno::Reference<
+ com::sun::star::drawing::XShapes> & xTarget,
+ const DataSeriesState& rSeriesState ) = 0;
+
+ virtual void pushNextSeriesState( const com::sun::star::uno::Reference<
+ com::sun::star::drawing::XShapes> & xTarget,
+ const DataSeriesState& rOldSeriesState,
+ const DataSeriesState& rNewSeriesState ) = 0;
+
static ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >
getChartRootShape( const ::com::sun::star::uno::Reference<
::com::sun::star::drawing::XDrawPage>& xPage );
diff --git a/chart2/source/view/inc/DummyShapeFactory.hxx b/chart2/source/view/inc/DummyShapeFactory.hxx
index e3731f8..aa8b38c 100644
--- a/chart2/source/view/inc/DummyShapeFactory.hxx
+++ b/chart2/source/view/inc/DummyShapeFactory.hxx
@@ -174,6 +174,15 @@ public:
const ::com::sun::star::uno::Reference<
::com::sun::star::drawing::XShapes >& xTarget );
+ virtual void createSeries( const com::sun::star::uno::Reference<
+ com::sun::star::drawing::XShapes> & xTarget,
+ const DataSeriesState& rSeriesState );
+
+ virtual void pushNextSeriesState( const com::sun::star::uno::Reference<
+ com::sun::star::drawing::XShapes> & xTarget,
+ const DataSeriesState& rOldSeriesState,
+ const DataSeriesState& rNewSeriesState );
+
virtual ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >
getOrCreateChartRootShape( const ::com::sun::star::uno::Reference<
::com::sun::star::drawing::XDrawPage>& xPage );
diff --git a/chart2/source/view/inc/ShapeFactory.hxx b/chart2/source/view/inc/ShapeFactory.hxx
index 4e51293..0a46454 100644
--- a/chart2/source/view/inc/ShapeFactory.hxx
+++ b/chart2/source/view/inc/ShapeFactory.hxx
@@ -189,6 +189,15 @@ public:
const ::com::sun::star::uno::Reference<
::com::sun::star::drawing::XShapes >& xTarget );
+ virtual void createSeries( const com::sun::star::uno::Reference<
+ com::sun::star::drawing::XShapes> & xTarget,
+ const DataSeriesState& rSeriesState );
+
+ virtual void pushNextSeriesState( const com::sun::star::uno::Reference<
+ com::sun::star::drawing::XShapes> & xTarget,
+ const DataSeriesState& rOldSeriesState,
+ const DataSeriesState& rNewSeriesState );
+
virtual ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >
getOrCreateChartRootShape( const ::com::sun::star::uno::Reference<
::com::sun::star::drawing::XDrawPage>& xPage );
diff --git a/chart2/source/view/main/DummyShapeFactory.cxx b/chart2/source/view/main/DummyShapeFactory.cxx
index 4eb6283..f0c8bdd 100644
--- a/chart2/source/view/main/DummyShapeFactory.cxx
+++ b/chart2/source/view/main/DummyShapeFactory.cxx
@@ -280,6 +280,19 @@ uno::Reference< drawing::XShape >
return new DummyXShape();
}
+void DummyShapeFactory::createSeries( const uno::Reference<
+ drawing::XShapes> & ,
+ const DataSeriesState& )
+{
+}
+
+void DummyShapeFactory::pushNextSeriesState( const uno::Reference<
+ drawing::XShapes> & ,
+ const DataSeriesState& ,
+ const DataSeriesState& )
+{
+}
+
} //namespace dummy
} //namespace chart
diff --git a/chart2/source/view/main/ShapeFactory.cxx b/chart2/source/view/main/ShapeFactory.cxx
index a0abdaf..9a7f59e 100644
--- a/chart2/source/view/main/ShapeFactory.cxx
+++ b/chart2/source/view/main/ShapeFactory.cxx
@@ -2119,6 +2119,24 @@ uno::Reference< drawing::XShape >
return xShape;
}
+void ShapeFactory::createSeries( const uno::Reference<
+ drawing::XShapes> & ,
+ const DataSeriesState& )
+{
+ // unsupported for now
+ throw uno::RuntimeException();
+}
+
+void ShapeFactory::pushNextSeriesState( const uno::Reference<
+ drawing::XShapes> & ,
+ const DataSeriesState& ,
+ const DataSeriesState& )
+{
+ // unsupported for now
+ // do we actually want to support this in the normal
+ // rendering code?
+ throw uno::RuntimeException();
+}
uno::Reference< drawing::XShape >
ShapeFactory::createText( const uno::Reference< drawing::XShapes >& xTarget,
commit a41ff3f44a6a3825c368d8c93c6b304dac6b0cbd
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Tue Oct 15 07:55:26 2013 +0200
use ChartModel instead of XModel in a few places
This allows us easier implementation of some advanced features. Mainly
the 4D chartting will now be able to work without several ugly layers of
UNO.
Change-Id: I74d07229eaef921c508f3bab8fae6d6075ad737a
diff --git a/chart2/Library_chartcontroller.mk b/chart2/Library_chartcontroller.mk
index bd15c3f..a4e6067 100644
--- a/chart2/Library_chartcontroller.mk
+++ b/chart2/Library_chartcontroller.mk
@@ -13,6 +13,7 @@ $(eval $(call gb_Library_set_include,chartcontroller,\
$$(INCLUDE) \
-I$(SRCDIR)/chart2/source/controller/inc \
-I$(SRCDIR)/chart2/source/inc \
+ -I$(SRCDIR)/chart2/inc \
))
$(eval $(call gb_Library_set_precompiled_header,chartcontroller,$(SRCDIR)/chart2/inc/pch/precompiled_chartcontroller))
diff --git a/chart2/Library_chartcore.mk b/chart2/Library_chartcore.mk
index 601821c..53fbd2a 100644
--- a/chart2/Library_chartcore.mk
+++ b/chart2/Library_chartcore.mk
@@ -14,6 +14,7 @@ $(eval $(call gb_Library_set_include,chartcore,\
-I$(SRCDIR)/chart2/source/model/inc \
-I$(SRCDIR)/chart2/source/view/inc \
-I$(SRCDIR)/chart2/source/inc \
+ -I$(SRCDIR)/chart2/inc \
))
# not ideal - we should use a single core define ideally
@@ -100,7 +101,6 @@ $(eval $(call gb_Library_add_exception_objects,chartcore,\
chart2/source/view/main/PlottingPositionHelper \
chart2/source/view/main/PolarLabelPositionHelper \
chart2/source/view/main/PropertyMapper \
- chart2/source/view/main/_serviceregistration_view \
chart2/source/view/main/ShapeFactory \
chart2/source/view/main/AbstractShapeFactory \
chart2/source/view/main/Stripe \
diff --git a/chart2/source/model/main/ChartModel.hxx b/chart2/inc/ChartModel.hxx
similarity index 99%
rename from chart2/source/model/main/ChartModel.hxx
rename to chart2/inc/ChartModel.hxx
index 9752c3b..ffc49aa 100644
--- a/chart2/source/model/main/ChartModel.hxx
+++ b/chart2/inc/ChartModel.hxx
@@ -106,8 +106,9 @@ typedef ::comphelper::WeakImplHelper22<
}
class UndoManager;
+class ChartView;
-class ChartModel : public impl::ChartModel_Base
+class OOO_DLLPUBLIC_CHARTTOOLS ChartModel : public impl::ChartModel_Base
{
private:
@@ -119,7 +120,9 @@ private:
sal_Int32 m_nInLoad;
sal_Bool volatile m_bUpdateNotificationsPending;
- OUString m_aResource;
+ ChartView* mpChartView;
+
+ OUString m_aResource;
::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > m_aMediaDescriptor;
::com::sun::star::uno::Reference< ::com::sun::star::document::XDocumentProperties > m_xDocumentProperties;
::rtl::Reference< UndoManager > m_pUndoManager;
@@ -217,9 +220,6 @@ private:
void impl_adjustAdditionalShapesPositionAndSize(
const ::com::sun::star::awt::Size& aVisualAreaSize );
- ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatsSupplier >
- impl_getNumberFormatsSupplier();
-
public:
//no default constructor
ChartModel(::com::sun::star::uno::Reference<
@@ -576,6 +576,10 @@ public:
// XDumper
virtual OUString SAL_CALL dump()
throw (com::sun::star::uno::RuntimeException);
+
+ // normal methods
+ ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatsSupplier >
+ getNumberFormatsSupplier();
};
} // namespace chart
diff --git a/chart2/source/view/main/ChartView.hxx b/chart2/inc/ChartView.hxx
similarity index 97%
rename from chart2/source/view/main/ChartView.hxx
rename to chart2/inc/ChartView.hxx
index c57dcfb..916b02a 100644
--- a/chart2/source/view/main/ChartView.hxx
+++ b/chart2/inc/ChartView.hxx
@@ -19,6 +19,7 @@
#ifndef _CHARTVIEWIMPL_HXX
#define _CHARTVIEWIMPL_HXX
+#include "ChartModel.hxx"
#include "chartview/ExplicitValueProvider.hxx"
#include "ServiceMacros.hxx"
#include <cppuhelper/implbase10.hxx>
@@ -77,12 +78,13 @@ class ChartView : public ::cppu::WeakImplHelper10<
{
public:
ChartView(::com::sun::star::uno::Reference<
- ::com::sun::star::uno::XComponentContext > const & xContext);
+ ::com::sun::star::uno::XComponentContext > const & xContext,
+ ChartModel& rModel);
+
virtual ~ChartView();
// ___lang::XServiceInfo___
APPHELPER_XSERVICEINFO_DECL()
- APPHELPER_SERVICE_FACTORY_HELPER(ChartView)
// ___lang::XInitialization___
virtual void SAL_CALL initialize( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments )
@@ -169,7 +171,6 @@ private: //methods
, bool bUseHighContrast );
SdrPage* getSdrPage();
- void impl_setChartModel( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& xChartModel );
void impl_deleteCoordinateSystems();
void impl_notifyModeChangeListener( const OUString& rNewMode );
@@ -191,8 +192,8 @@ private: //member
::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext>
m_xCC;
- ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >
- m_xChartModel;
+
+ chart::ChartModel& mrChartModel;
::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>
m_xShapeFactory;
diff --git a/chart2/source/controller/chartapiwrapper/Chart2ModelContact.cxx b/chart2/source/controller/chartapiwrapper/Chart2ModelContact.cxx
index 80132a8..969f830 100644
--- a/chart2/source/controller/chartapiwrapper/Chart2ModelContact.cxx
+++ b/chart2/source/controller/chartapiwrapper/Chart2ModelContact.cxx
@@ -29,6 +29,8 @@
#include "AxisHelper.hxx"
#include "DiagramHelper.hxx"
+#include "ChartModel.hxx"
+
using namespace ::com::sun::star;
using namespace ::com::sun::star::chart2;
@@ -44,6 +46,7 @@ Chart2ModelContact::Chart2ModelContact(
const Reference< uno::XComponentContext > & xContext ) :
m_xContext( xContext ),
m_xChartModel( 0 ),
+ mpModel( NULL ),
m_xChartView(0)
{
}
@@ -58,6 +61,7 @@ void Chart2ModelContact::setModel( const ::com::sun::star::uno::Reference<
{
this->clear();
m_xChartModel = xChartModel;
+ mpModel = dynamic_cast<ChartModel*>(xChartModel.get());
uno::Reference< lang::XMultiServiceFactory > xTableFactory( xChartModel, uno::UNO_QUERY );
if( xTableFactory.is() )
{
@@ -78,6 +82,7 @@ void Chart2ModelContact::clear()
{
m_xChartModel = uno::WeakReference< frame::XModel >(0);
m_xChartView.clear();
+ mpModel = NULL;
}
Reference< frame::XModel > Chart2ModelContact::getChartModel() const
@@ -85,6 +90,11 @@ Reference< frame::XModel > Chart2ModelContact::getChartModel() const
return Reference< frame::XModel >( m_xChartModel.get(), uno::UNO_QUERY );
}
+ChartModel* Chart2ModelContact::getModel() const
+{
+ return mpModel;
+}
+
Reference< chart2::XChartDocument > Chart2ModelContact::getChart2Document() const
{
return Reference< chart2::XChartDocument >( m_xChartModel.get(), uno::UNO_QUERY );
@@ -175,7 +185,7 @@ awt::Size Chart2ModelContact::GetPageSize() const
awt::Rectangle Chart2ModelContact::SubstractAxisTitleSizes( const awt::Rectangle& rPositionRect )
{
awt::Rectangle aRect = ExplicitValueProvider::substractAxisTitleSizes(
- m_xChartModel, getChartView(), rPositionRect );
+ *mpModel, getChartView(), rPositionRect );
return aRect;
}
@@ -185,7 +195,7 @@ awt::Rectangle Chart2ModelContact::GetDiagramRectangleIncludingTitle() const
//add axis title sizes to the diagram size
aRect = ExplicitValueProvider::addAxisTitleSizes(
- m_xChartModel, getChartView(), aRect );
+ *mpModel, getChartView(), aRect );
return aRect;
}
@@ -228,8 +238,8 @@ awt::Size Chart2ModelContact::GetLegendSize() const
ExplicitValueProvider* pProvider( getExplicitValueProvider() );
if( pProvider )
{
- uno::Reference< chart2::XLegend > xLegend( LegendHelper::getLegend( m_xChartModel ) );
- OUString aCID( ObjectIdentifier::createClassifiedIdentifierForObject( xLegend, m_xChartModel ) );
+ uno::Reference< chart2::XLegend > xLegend( LegendHelper::getLegend( *mpModel ) );
+ OUString aCID( ObjectIdentifier::createClassifiedIdentifierForObject( xLegend, *mpModel ) );
aSize = ToSize( pProvider->getRectangleOfObject( aCID ) );
}
return aSize;
@@ -241,8 +251,8 @@ awt::Point Chart2ModelContact::GetLegendPosition() const
ExplicitValueProvider* pProvider( getExplicitValueProvider() );
if( pProvider )
{
- uno::Reference< chart2::XLegend > xLegend( LegendHelper::getLegend( m_xChartModel ) );
- OUString aCID( ObjectIdentifier::createClassifiedIdentifierForObject( xLegend, m_xChartModel ) );
+ uno::Reference< chart2::XLegend > xLegend( LegendHelper::getLegend( *mpModel ) );
+ OUString aCID( ObjectIdentifier::createClassifiedIdentifierForObject( xLegend, *mpModel ) );
aPoint = ToPoint( pProvider->getRectangleOfObject( aCID ) );
}
return aPoint;
diff --git a/chart2/source/controller/chartapiwrapper/Chart2ModelContact.hxx b/chart2/source/controller/chartapiwrapper/Chart2ModelContact.hxx
index 519afd8..e28d3f0 100644
--- a/chart2/source/controller/chartapiwrapper/Chart2ModelContact.hxx
+++ b/chart2/source/controller/chartapiwrapper/Chart2ModelContact.hxx
@@ -38,6 +38,7 @@
namespace chart
{
class ExplicitValueProvider;
+class ChartModel;
namespace wrapper
{
@@ -57,6 +58,8 @@ public:
::com::sun::star::uno::Reference<
::com::sun::star::frame::XModel > getChartModel() const;
+ ChartModel* getModel() const;
+
::com::sun::star::uno::Reference<
::com::sun::star::chart2::XChartDocument > getChart2Document() const;
::com::sun::star::uno::Reference<
@@ -145,6 +148,8 @@ private: //member
::com::sun::star::uno::WeakReference<
::com::sun::star::frame::XModel > m_xChartModel;
+ ChartModel* mpModel;
+
mutable ::com::sun::star::uno::Reference<
::com::sun::star::lang::XUnoTunnel > m_xChartView;
diff --git a/chart2/source/controller/chartapiwrapper/ChartDataWrapper.cxx b/chart2/source/controller/chartapiwrapper/ChartDataWrapper.cxx
index 0ca43ba..35afa7c 100644
--- a/chart2/source/controller/chartapiwrapper/ChartDataWrapper.cxx
+++ b/chart2/source/controller/chartapiwrapper/ChartDataWrapper.cxx
@@ -530,7 +530,7 @@ void SAL_CALL ChartDataWrapper::setAnyColumnDescriptions( const Sequence< Sequen
void SAL_CALL ChartDataWrapper::setDateCategories( const Sequence< double >& rDates ) throw (uno::RuntimeException)
{
Reference< chart2::XChartDocument > xChartDoc( m_spChart2ModelContact->getChart2Document() );
- ControllerLockGuard aCtrlLockGuard( uno::Reference< frame::XModel >( xChartDoc, uno::UNO_QUERY ));
+ ControllerLockGuardUNO aCtrlLockGuard( uno::Reference< frame::XModel >( xChartDoc, uno::UNO_QUERY ));
lcl_DateCategoriesOperator aOperator( rDates );
applyData( aOperator );
DiagramHelper::switchToDateCategories( xChartDoc );
@@ -682,7 +682,7 @@ void ChartDataWrapper::applyData( lcl_Operator& rDataOperator )
aRangeString, aSequenceMapping, bUseColumns, bFirstCellAsLabel, bHasCategories ) );
// /-- locked controllers
- ControllerLockGuard aCtrlLockGuard( uno::Reference< frame::XModel >( xChartDoc, uno::UNO_QUERY ));
+ ControllerLockGuardUNO aCtrlLockGuard( uno::Reference< frame::XModel >( xChartDoc, uno::UNO_QUERY ));
// create and attach new data source
switchToInternalDataProvider();
diff --git a/chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx b/chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx
index fc2d7c2..de42006 100644
--- a/chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx
+++ b/chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx
@@ -31,6 +31,8 @@
#include "chartview/DrawModelWrapper.hxx"
#include "Chart2ModelContact.hxx"
+#include "ChartModel.hxx"
+
#include "DiagramHelper.hxx"
#include "DataSourceHelper.hxx"
#include "ChartModelHelper.hxx"
@@ -501,7 +503,7 @@ void WrappedHasLegendProperty::setPropertyValue( const Any& rOuterValue, const R
try
{
- Reference< chart2::XLegend > xLegend( LegendHelper::getLegend( m_spChart2ModelContact->getChartModel(), m_spChart2ModelContact->m_xContext,bNewValue ));
+ Reference< chart2::XLegend > xLegend( LegendHelper::getLegend( *m_spChart2ModelContact->getModel(), m_spChart2ModelContact->m_xContext,bNewValue ));
if(xLegend.is())
{
Reference< beans::XPropertySet > xLegendProp( xLegend, uno::UNO_QUERY_THROW );
@@ -525,7 +527,7 @@ Any WrappedHasLegendProperty::getPropertyValue( const Reference< beans::XPropert
try
{
Reference< beans::XPropertySet > xLegendProp(
- LegendHelper::getLegend( m_spChart2ModelContact->getChartModel() ), uno::UNO_QUERY );
+ LegendHelper::getLegend( *m_spChart2ModelContact->getModel() ), uno::UNO_QUERY );
if( xLegendProp.is())
aRet = xLegendProp->getPropertyValue("Show");
else
@@ -722,7 +724,7 @@ Reference< drawing::XShape > SAL_CALL ChartDocumentWrapper::getTitle()
{
if( !m_xTitle.is() )
{
- ControllerLockGuard aCtrlLockGuard( Reference< frame::XModel >( m_spChart2ModelContact->getChart2Document(), uno::UNO_QUERY ));
+ ControllerLockGuardUNO aCtrlLockGuard( Reference< frame::XModel >( m_spChart2ModelContact->getChart2Document(), uno::UNO_QUERY ));
m_xTitle = new TitleWrapper( TitleHelper::MAIN_TITLE, m_spChart2ModelContact );
}
return m_xTitle;
@@ -733,7 +735,7 @@ Reference< drawing::XShape > SAL_CALL ChartDocumentWrapper::getSubTitle()
{
if( !m_xSubTitle.is() )
{
- ControllerLockGuard aCtrlLockGuard( Reference< frame::XModel >( m_spChart2ModelContact->getChart2Document(), uno::UNO_QUERY ));
+ ControllerLockGuardUNO aCtrlLockGuard( Reference< frame::XModel >( m_spChart2ModelContact->getChart2Document(), uno::UNO_QUERY ));
m_xSubTitle = new TitleWrapper( TitleHelper::SUB_TITLE, m_spChart2ModelContact );
}
return m_xSubTitle;
@@ -833,7 +835,7 @@ void SAL_CALL ChartDocumentWrapper::attachData( const Reference< XChartData >& x
return;
// /-- locked controllers
- ControllerLockGuard aCtrlLockGuard( Reference< frame::XModel >( m_spChart2ModelContact->getChart2Document(), uno::UNO_QUERY ));
+ ControllerLockGuardUNO aCtrlLockGuard( Reference< frame::XModel >( m_spChart2ModelContact->getChart2Document(), uno::UNO_QUERY ));
m_xChartData.set( new ChartDataWrapper( m_spChart2ModelContact, xNewData ) );
// \-- locked controllers
}
@@ -1022,7 +1024,7 @@ void ChartDocumentWrapper::impl_resetAddIn()
void ChartDocumentWrapper::setBaseDiagram( const OUString& rBaseDiagram )
{
- ControllerLockGuard aCtrlLockGuard( m_spChart2ModelContact->getChartModel() );
+ ControllerLockGuardUNO aCtrlLockGuard( m_spChart2ModelContact->getChartModel() );
m_aBaseDiagram = rBaseDiagram;
uno::Reference< XDiagram > xDiagram( ChartDocumentWrapper::createInstance( rBaseDiagram ), uno::UNO_QUERY );
@@ -1045,7 +1047,7 @@ void ChartDocumentWrapper::setAddIn( const Reference< util::XRefreshable >& xAdd
if( m_xAddIn == xAddIn )
return;
- ControllerLockGuard aCtrlLockGuard( m_spChart2ModelContact->getChartModel() );
+ ControllerLockGuardUNO aCtrlLockGuard( m_spChart2ModelContact->getChartModel() );
impl_resetAddIn();
m_xAddIn = xAddIn;
// initialize AddIn with this as chart document
@@ -1291,7 +1293,7 @@ uno::Reference< uno::XInterface > SAL_CALL ChartDocumentWrapper::createInstance(
{
// locked controllers
Reference< frame::XModel > xModel( xChartDoc, uno::UNO_QUERY );
- ControllerLockGuard aCtrlLockGuard( xModel );
+ ControllerLockGuardUNO aCtrlLockGuard( xModel );
Reference< chart2::XDiagram > xDiagram = ChartModelHelper::findDiagram( xModel );
ThreeDLookScheme e3DScheme = ThreeDHelper::detectScheme( xDiagram );
Reference< lang::XMultiServiceFactory > xTemplateManager( xChartDoc->getChartTypeManager(), uno::UNO_QUERY );
@@ -1307,7 +1309,7 @@ uno::Reference< uno::XInterface > SAL_CALL ChartDocumentWrapper::createInstance(
else
{
// locked controllers
- ControllerLockGuard aCtrlLockGuard( Reference< frame::XModel >( xChartDoc, uno::UNO_QUERY ));
+ ControllerLockGuardUNO aCtrlLockGuard( Reference< frame::XModel >( xChartDoc, uno::UNO_QUERY ));
xDia.set( xTemplate->createDiagramByDataSource(
uno::Reference< chart2::data::XDataSource >(),
uno::Sequence< beans::PropertyValue >()));
diff --git a/chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx b/chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx
index a6ed1904..732b539 100644
--- a/chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx
+++ b/chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx
@@ -705,7 +705,7 @@ awt::Point SAL_CALL DiagramWrapper::getPosition()
void SAL_CALL DiagramWrapper::setPosition( const awt::Point& aPosition )
throw (uno::RuntimeException)
{
- ControllerLockGuard aCtrlLockGuard( m_spChart2ModelContact->getChartModel() );
+ ControllerLockGuardUNO aCtrlLockGuard( m_spChart2ModelContact->getChartModel() );
Reference< beans::XPropertySet > xProp( this->getInnerPropertySet() );
if( xProp.is() )
{
@@ -738,7 +738,7 @@ void SAL_CALL DiagramWrapper::setSize( const awt::Size& aSize )
throw (beans::PropertyVetoException,
uno::RuntimeException)
{
- ControllerLockGuard aCtrlLockGuard( m_spChart2ModelContact->getChartModel() );
+ ControllerLockGuardUNO aCtrlLockGuard( m_spChart2ModelContact->getChartModel() );
Reference< beans::XPropertySet > xProp( this->getInnerPropertySet() );
if( xProp.is() )
{
@@ -772,7 +772,7 @@ OUString SAL_CALL DiagramWrapper::getShapeType()
void SAL_CALL DiagramWrapper::setAutomaticDiagramPositioning() throw (uno::RuntimeException)
{
- ControllerLockGuard aCtrlLockGuard( m_spChart2ModelContact->getChartModel() );
+ ControllerLockGuardUNO aCtrlLockGuard( m_spChart2ModelContact->getChartModel() );
uno::Reference< beans::XPropertySet > xDiaProps( this->getDiagram(), uno::UNO_QUERY );
if( xDiaProps.is() )
{
@@ -794,7 +794,7 @@ void SAL_CALL DiagramWrapper::setAutomaticDiagramPositioning() throw (uno::Runti
}
void SAL_CALL DiagramWrapper::setDiagramPositionExcludingAxes( const awt::Rectangle& rPositionRect ) throw (uno::RuntimeException)
{
- ControllerLockGuard aCtrlLockGuard( m_spChart2ModelContact->getChartModel() );
+ ControllerLockGuardUNO aCtrlLockGuard( m_spChart2ModelContact->getChartModel() );
DiagramHelper::setDiagramPositioning( m_spChart2ModelContact->getChartModel(), rPositionRect );
uno::Reference< beans::XPropertySet > xDiaProps( this->getDiagram(), uno::UNO_QUERY );
if( xDiaProps.is() )
@@ -822,7 +822,7 @@ awt::Rectangle SAL_CALL DiagramWrapper::calculateDiagramPositionExcludingAxes(
}
void SAL_CALL DiagramWrapper::setDiagramPositionIncludingAxes( const awt::Rectangle& rPositionRect ) throw (uno::RuntimeException)
{
- ControllerLockGuard aCtrlLockGuard( m_spChart2ModelContact->getChartModel() );
+ ControllerLockGuardUNO aCtrlLockGuard( m_spChart2ModelContact->getChartModel() );
DiagramHelper::setDiagramPositioning( m_spChart2ModelContact->getChartModel(), rPositionRect );
uno::Reference< beans::XPropertySet > xDiaProps( this->getDiagram(), uno::UNO_QUERY );
if( xDiaProps.is() )
@@ -834,7 +834,7 @@ awt::Rectangle SAL_CALL DiagramWrapper::calculateDiagramPositionIncludingAxes(
}
void SAL_CALL DiagramWrapper::setDiagramPositionIncludingAxesAndAxisTitles( const awt::Rectangle& rPositionRect ) throw (uno::RuntimeException)
{
- ControllerLockGuard aCtrlLockGuard( m_spChart2ModelContact->getChartModel() );
+ ControllerLockGuardUNO aCtrlLockGuard( m_spChart2ModelContact->getChartModel() );
awt::Rectangle aRect( m_spChart2ModelContact->SubstractAxisTitleSizes(rPositionRect) );
DiagramWrapper::setDiagramPositionIncludingAxes( aRect );
}
@@ -1646,7 +1646,7 @@ void WrappedNumberOfLinesProperty::setPropertyValue( const Any& rOuterValue, con
try
{
// locked controllers
- ControllerLockGuard aCtrlLockGuard( m_spChart2ModelContact->getChartModel() );
+ ControllerLockGuardUNO aCtrlLockGuard( m_spChart2ModelContact->getChartModel() );
uno::Reference< beans::XPropertySet > xProp( xTemplate, uno::UNO_QUERY );
xProp->setPropertyValue( "NumberOfLines", uno::makeAny(nNewValue) );
xTemplate->changeDiagram( xDiagram );
@@ -1969,7 +1969,7 @@ void WrappedIncludeHiddenCellsProperty::setPropertyValue( const Any& rOuterValue
if( ! (rOuterValue >>= bNewValue) )
throw lang::IllegalArgumentException( "Property Dim3D requires boolean value", 0, 0 );
- ChartModelHelper::setIncludeHiddenCells( bNewValue, m_spChart2ModelContact->getChartModel() );
+ ChartModelHelper::setIncludeHiddenCells( bNewValue, *m_spChart2ModelContact->getModel() );
}
// ____ XDiagramProvider ____
diff --git a/chart2/source/controller/chartapiwrapper/TitleWrapper.cxx b/chart2/source/controller/chartapiwrapper/TitleWrapper.cxx
index ecbe98d..9ca382f 100644
--- a/chart2/source/controller/chartapiwrapper/TitleWrapper.cxx
+++ b/chart2/source/controller/chartapiwrapper/TitleWrapper.cxx
@@ -204,7 +204,7 @@ TitleWrapper::TitleWrapper( ::chart::TitleHelper::eTitleType eTitleType,
m_aEventListenerContainer( m_aMutex ),
m_eTitleType(eTitleType)
{
- ControllerLockGuard aCtrlLockGuard( Reference< frame::XModel >( m_spChart2ModelContact->getChart2Document(), uno::UNO_QUERY ));
+ ControllerLockGuardUNO aCtrlLockGuard( Reference< frame::XModel >( m_spChart2ModelContact->getChart2Document(), uno::UNO_QUERY ));
if( !getTitleObject().is() ) //#i83831# create an empty title at the model, thus references to properties can be mapped mapped correctly
TitleHelper::createTitle( m_eTitleType, OUString(), m_spChart2ModelContact->getChartModel(), m_spChart2ModelContact->m_xContext );
}
diff --git a/chart2/source/controller/chartapiwrapper/WrappedStockProperties.cxx b/chart2/source/controller/chartapiwrapper/WrappedStockProperties.cxx
index 181d3a3..8cdf630 100644
--- a/chart2/source/controller/chartapiwrapper/WrappedStockProperties.cxx
+++ b/chart2/source/controller/chartapiwrapper/WrappedStockProperties.cxx
@@ -98,7 +98,7 @@ void WrappedStockProperty::setPropertyValue( const ::com::sun::star::uno::Any& r
try
{
// locked controllers
- ControllerLockGuard aCtrlLockGuard( m_spChart2ModelContact->getChartModel() );
+ ControllerLockGuardUNO aCtrlLockGuard( m_spChart2ModelContact->getChartModel() );
xTemplate->changeDiagram( xDiagram );
}
catch( const uno::Exception & ex )
diff --git a/chart2/source/controller/dialogs/ChartTypeDialogController.cxx b/chart2/source/controller/dialogs/ChartTypeDialogController.cxx
index 3dc268d..072c56a 100644
--- a/chart2/source/controller/dialogs/ChartTypeDialogController.cxx
+++ b/chart2/source/controller/dialogs/ChartTypeDialogController.cxx
@@ -322,7 +322,7 @@ bool ChartTypeDialogController::commitToModel( const ChartTypeParameter& rParame
uno::Reference< frame::XModel > xModel( xChartModel, uno::UNO_QUERY);
// locked controllers
- ControllerLockGuard aCtrlLockGuard( xModel );
+ ControllerLockGuardUNO aCtrlLockGuard( xModel );
uno::Reference< XDiagram > xDiagram = ChartModelHelper::findDiagram( xModel );
DiagramHelper::tTemplateWithServiceName aTemplateWithService(
DiagramHelper::getTemplateForDiagram( xDiagram, xTemplateManager ));
diff --git a/chart2/source/controller/dialogs/DataBrowserModel.cxx b/chart2/source/controller/dialogs/DataBrowserModel.cxx
index 6e2c657..8bfa963 100644
--- a/chart2/source/controller/dialogs/DataBrowserModel.cxx
+++ b/chart2/source/controller/dialogs/DataBrowserModel.cxx
@@ -31,6 +31,8 @@
#include "chartview/ExplicitValueProvider.hxx"
#include "ExplicitCategoriesProvider.hxx"
+#include "ChartModel.hxx"
+
#include <com/sun/star/container/XIndexReplace.hpp>
#include <com/sun/star/chart2/XAxis.hpp>
#include <com/sun/star/chart2/XDataSeriesContainer.hpp>
@@ -432,7 +434,7 @@ void DataBrowserModel::insertComplexCategoryLevel( sal_Int32 nAfterColumnIndex )
}
m_apDialogModel->startControllerLockTimer();
- ControllerLockGuard aLockedControllers( Reference< frame::XModel >( m_xChartDocument, uno::UNO_QUERY ) );
+ ControllerLockGuardUNO aLockedControllers( Reference< frame::XModel >( m_xChartDocument, uno::UNO_QUERY ) );
xDataProvider->insertComplexCategoryLevel( nAfterColumnIndex+1 );
updateFromModel();
}
@@ -498,7 +500,7 @@ void DataBrowserModel::removeDataSeriesOrComplexCategoryLevel( sal_Int32 nAtColu
if( xDataProvider.is() )
{
m_apDialogModel->startControllerLockTimer();
- ControllerLockGuard aLockedControllers( Reference< frame::XModel >( m_xChartDocument, uno::UNO_QUERY ) );
+ ControllerLockGuardUNO aLockedControllers( Reference< frame::XModel >( m_xChartDocument, uno::UNO_QUERY ) );
xDataProvider->deleteComplexCategoryLevel( nAtColumnIndex );
updateFromModel();
}
@@ -526,7 +528,7 @@ void DataBrowserModel::swapDataPointForAllSeries( sal_Int32 nFirstIndex )
Reference< chart2::XInternalDataProvider > xDataProvider(
m_apDialogModel->getDataProvider(), uno::UNO_QUERY );
// lockControllers
- ControllerLockGuard aGuard( m_apDialogModel->getChartModel());
+ ControllerLockGuardUNO aGuard( m_apDialogModel->getChartModel());
if( xDataProvider.is())
xDataProvider->swapDataPointWithNextOneForAllSequences( nFirstIndex );
// unlockControllers
@@ -537,7 +539,7 @@ void DataBrowserModel::insertDataPointForAllSeries( sal_Int32 nAfterIndex )
Reference< chart2::XInternalDataProvider > xDataProvider(
m_apDialogModel->getDataProvider(), uno::UNO_QUERY );
// lockControllers
- ControllerLockGuard aGuard( m_apDialogModel->getChartModel());
+ ControllerLockGuardUNO aGuard( m_apDialogModel->getChartModel());
if( xDataProvider.is())
xDataProvider->insertDataPointForAllSequences( nAfterIndex );
// unlockControllers
@@ -548,7 +550,7 @@ void DataBrowserModel::removeDataPointForAllSeries( sal_Int32 nAtIndex )
Reference< chart2::XInternalDataProvider > xDataProvider(
m_apDialogModel->getDataProvider(), uno::UNO_QUERY );
// lockControllers
- ControllerLockGuard aGuard( m_apDialogModel->getChartModel());
+ ControllerLockGuardUNO aGuard( m_apDialogModel->getChartModel());
if( xDataProvider.is())
xDataProvider->deleteDataPointForAllSequences( nAtIndex );
// unlockControllers
@@ -663,7 +665,7 @@ bool DataBrowserModel::setCellAny( sal_Int32 nAtColumn, sal_Int32 nAtRow, const
bResult = true;
try
{
- ControllerLockGuard aLockedControllers( Reference< frame::XModel >( m_xChartDocument, uno::UNO_QUERY ) );
+ ControllerLockGuardUNO aLockedControllers( Reference< frame::XModel >( m_xChartDocument, uno::UNO_QUERY ) );
// label
if( nAtRow == -1 )
@@ -790,7 +792,8 @@ void DataBrowserModel::updateFromModel()
if( lcl_ShowCategories( xDiagram ))
{
Reference< frame::XModel > xChartModel( m_xChartDocument, uno::UNO_QUERY );
- ExplicitCategoriesProvider aExplicitCategoriesProvider( ChartModelHelper::getFirstCoordinateSystem(xChartModel), xChartModel );
+ ChartModel* pModel = dynamic_cast<ChartModel*>(xChartModel.get());
+ ExplicitCategoriesProvider aExplicitCategoriesProvider( ChartModelHelper::getFirstCoordinateSystem(xChartModel), *pModel );
const Sequence< Reference< chart2::data::XLabeledDataSequence> >& rSplitCategoriesList( aExplicitCategoriesProvider.getSplitCategoriesList() );
sal_Int32 nLevelCount = rSplitCategoriesList.getLength();
diff --git a/chart2/source/controller/dialogs/DialogModel.cxx b/chart2/source/controller/dialogs/DialogModel.cxx
index e98c58e..fc878b5 100644
--- a/chart2/source/controller/dialogs/DialogModel.cxx
+++ b/chart2/source/controller/dialogs/DialogModel.cxx
@@ -493,7 +493,7 @@ void DialogModel::moveSeries(
eMoveDirection eDirection )
{
m_aTimerTriggeredControllerLock.startTimer();
- ControllerLockGuard aLockedControllers( Reference< frame::XModel >( m_xChartDocument, uno::UNO_QUERY ) );
+ ControllerLockGuardUNO aLockedControllers( Reference< frame::XModel >( m_xChartDocument, uno::UNO_QUERY ) );
Reference< XDiagram > xDiagram( m_xChartDocument->getFirstDiagram());
DiagramHelper::moveSeries( xDiagram, xSeries, eDirection==MOVE_UP );
@@ -505,7 +505,7 @@ Reference< chart2::XDataSeries > DialogModel::insertSeriesAfter(
bool bCreateDataCachedSequences /* = false */ )
{
m_aTimerTriggeredControllerLock.startTimer();
- ControllerLockGuard aLockedControllers( Reference< frame::XModel >( m_xChartDocument, uno::UNO_QUERY ) );
+ ControllerLockGuardUNO aLockedControllers( Reference< frame::XModel >( m_xChartDocument, uno::UNO_QUERY ) );
Reference< XDataSeries > xNewSeries;
try
@@ -564,7 +564,7 @@ void DialogModel::deleteSeries(
const Reference< XChartType > & xChartType )
{
m_aTimerTriggeredControllerLock.startTimer();
- ControllerLockGuard aLockedControllers( Reference< frame::XModel >( m_xChartDocument, uno::UNO_QUERY ) );
+ ControllerLockGuardUNO aLockedControllers( Reference< frame::XModel >( m_xChartDocument, uno::UNO_QUERY ) );
DataSeriesHelper::deleteSeries( xSeries, xChartType );
}
@@ -665,7 +665,7 @@ bool DialogModel::setData(
const Sequence< beans::PropertyValue > & rArguments )
{
m_aTimerTriggeredControllerLock.startTimer();
- ControllerLockGuard aLockedControllers( Reference< frame::XModel >( m_xChartDocument, uno::UNO_QUERY ) );
+ ControllerLockGuardUNO aLockedControllers( Reference< frame::XModel >( m_xChartDocument, uno::UNO_QUERY ) );
Reference< data::XDataProvider > xDataProvider( getDataProvider());
if( ! xDataProvider.is() ||
diff --git a/chart2/source/controller/dialogs/ObjectNameProvider.cxx b/chart2/source/controller/dialogs/ObjectNameProvider.cxx
index 9b0fdc9..29cef46 100644
--- a/chart2/source/controller/dialogs/ObjectNameProvider.cxx
+++ b/chart2/source/controller/dialogs/ObjectNameProvider.cxx
@@ -176,7 +176,8 @@ OUString lcl_getDataPointValueText( const Reference< XDataSeries >& xSeries, sal
if( aX.isEmpty() )
{
- aRet = ExplicitCategoriesProvider::getCategoryByIndex( xCooSys, xChartModel, nPointIndex );
+ ChartModel* pModel = dynamic_cast<ChartModel*>(xChartModel.get());
+ aRet = ExplicitCategoriesProvider::getCategoryByIndex( xCooSys, *pModel, nPointIndex );
}
else
{
diff --git a/chart2/source/controller/dialogs/RangeSelectionHelper.cxx b/chart2/source/controller/dialogs/RangeSelectionHelper.cxx
index b96d063..b2fd8fb 100644
--- a/chart2/source/controller/dialogs/RangeSelectionHelper.cxx
+++ b/chart2/source/controller/dialogs/RangeSelectionHelper.cxx
@@ -108,7 +108,7 @@ bool RangeSelectionHelper::chooseRange(
const OUString & aUIString,
RangeSelectionListenerParent & rListenerParent )
{
- ControllerLockGuard aGuard( Reference< frame::XModel >(m_xChartDocument, uno::UNO_QUERY ) );
+ ControllerLockGuardUNO aGuard( Reference< frame::XModel >(m_xChartDocument, uno::UNO_QUERY ) );
bool bResult = true;
raiseRangeSelectionDocument();
diff --git a/chart2/source/controller/dialogs/TimerTriggeredControllerLock.cxx b/chart2/source/controller/dialogs/TimerTriggeredControllerLock.cxx
index 42e2e09..f564673 100644
--- a/chart2/source/controller/dialogs/TimerTriggeredControllerLock.cxx
+++ b/chart2/source/controller/dialogs/TimerTriggeredControllerLock.cxx
@@ -43,7 +43,7 @@ TimerTriggeredControllerLock::~TimerTriggeredControllerLock()
void TimerTriggeredControllerLock::startTimer()
{
if(!m_apControllerLockGuard.get())
- m_apControllerLockGuard.reset( new ControllerLockGuard(m_xModel) );
+ m_apControllerLockGuard.reset( new ControllerLockGuardUNO(m_xModel) );
m_aTimer.Start();
}
IMPL_LINK_NOARG(TimerTriggeredControllerLock, TimerTimeout)
diff --git a/chart2/source/controller/dialogs/dlg_ObjectProperties.cxx b/chart2/source/controller/dialogs/dlg_ObjectProperties.cxx
index d7c6587..05b5544 100644
--- a/chart2/source/controller/dialogs/dlg_ObjectProperties.cxx
+++ b/chart2/source/controller/dialogs/dlg_ObjectProperties.cxx
@@ -44,6 +44,7 @@
#include "AxisIndexDefines.hxx"
#include "AxisHelper.hxx"
#include "ExplicitCategoriesProvider.hxx"
+#include "ChartModel.hxx"
#include <com/sun/star/chart2/XAxis.hpp>
#include <com/sun/star/chart2/XChartType.hpp>
@@ -186,13 +187,17 @@ void ObjectPropertiesDialogParameter::init( const uno::Reference< frame::XModel
ScaleData aScale( xCrossingMainAxis->getScaleData() );
m_bIsCrossingAxisIsCategoryAxis = ( chart2::AxisType::CATEGORY == aScale.AxisType );
if( m_bIsCrossingAxisIsCategoryAxis )
- m_aCategories = DiagramHelper::getExplicitSimpleCategories( Reference< chart2::XChartDocument >( xChartModel, uno::UNO_QUERY) );
+ {
+ ChartModel* pModel = dynamic_cast<ChartModel*>(xChartModel.get());
+ m_aCategories = DiagramHelper::getExplicitSimpleCategories( *pModel );
+ }
}
m_bComplexCategoriesAxis = false;
if ( nDimensionIndex == 0 && aData.AxisType == chart2::AxisType::CATEGORY )
{
- ExplicitCategoriesProvider aExplicitCategoriesProvider( xCooSys, xChartModel );
+ ChartModel* pModel = dynamic_cast<ChartModel*>(xChartModel.get());
+ ExplicitCategoriesProvider aExplicitCategoriesProvider( xCooSys, *pModel );
m_bComplexCategoriesAxis = aExplicitCategoriesProvider.hasComplexCategories();
}
}
diff --git a/chart2/source/controller/dialogs/res_LegendPosition.cxx b/chart2/source/controller/dialogs/res_LegendPosition.cxx
index c5e5cf5..3f0b459 100644
--- a/chart2/source/controller/dialogs/res_LegendPosition.cxx
+++ b/chart2/source/controller/dialogs/res_LegendPosition.cxx
@@ -25,6 +25,7 @@
#include "ChartModelHelper.hxx"
#include "macros.hxx"
#include "LegendHelper.hxx"
+#include "ChartModel.hxx"
#include <svtools/controldims.hrc>
#include <com/sun/star/chart2/LegendPosition.hpp>
@@ -132,7 +133,8 @@ void LegendPositionResources::writeToModel( const ::com::sun::star::uno::Referen
try
{
sal_Bool bShowLegend = static_cast<sal_Bool>(m_aCbxShow.IsChecked());
- uno::Reference< beans::XPropertySet > xProp( LegendHelper::getLegend( xChartModel,m_xCC,bShowLegend ), uno::UNO_QUERY );
+ ChartModel* pModel = dynamic_cast<ChartModel*>(xChartModel.get());
+ uno::Reference< beans::XPropertySet > xProp( LegendHelper::getLegend( *pModel,m_xCC,bShowLegend ), uno::UNO_QUERY );
if( xProp.is() )
{
//show
diff --git a/chart2/source/controller/dialogs/tp_3D_SceneIllumination.cxx b/chart2/source/controller/dialogs/tp_3D_SceneIllumination.cxx
index 65b69b4..6a19381 100644
--- a/chart2/source/controller/dialogs/tp_3D_SceneIllumination.cxx
+++ b/chart2/source/controller/dialogs/tp_3D_SceneIllumination.cxx
@@ -365,7 +365,7 @@ IMPL_LINK_NOARG(ThreeD_SceneIllumination_TabPage, fillControlsFromModel)
void ThreeD_SceneIllumination_TabPage::applyLightSourceToModel( sal_uInt32 nLightNumber )
{
- ControllerLockGuard aGuard( m_xChartModel );
+ ControllerLockGuardUNO aGuard( m_xChartModel );
m_bInCommitToModel = true;
sal_Int32 nIndex( nLightNumber );
lcl_setLightSource( m_xSceneProperties, m_pLightSourceInfoList[nIndex].aLightSource, nIndex );
@@ -375,7 +375,7 @@ void ThreeD_SceneIllumination_TabPage::applyLightSourceToModel( sal_uInt32 nLigh
void ThreeD_SceneIllumination_TabPage::applyLightSourcesToModel()
{
m_aTimerTriggeredControllerLock.startTimer();
- ControllerLockGuard aGuard( m_xChartModel );
+ ControllerLockGuardUNO aGuard( m_xChartModel );
for( sal_Int32 nL=0; nL<8; nL++)
applyLightSourceToModel( nL );
m_aTimerTriggeredControllerLock.startTimer();
@@ -543,7 +543,7 @@ IMPL_LINK( ThreeD_SceneIllumination_TabPage, ClickLightSourceButtonHdl, LightBut
}
else
{
- ControllerLockGuard aGuard( m_xChartModel );
+ ControllerLockGuardUNO aGuard( m_xChartModel );
for( nL=0; nL<8; nL++)
{
LightButton* pLightButton = m_pLightSourceInfoList[nL].pButton;
diff --git a/chart2/source/controller/dialogs/tp_ChartType.cxx b/chart2/source/controller/dialogs/tp_ChartType.cxx
index cb5311b..caafed1 100644
--- a/chart2/source/controller/dialogs/tp_ChartType.cxx
+++ b/chart2/source/controller/dialogs/tp_ChartType.cxx
@@ -990,7 +990,7 @@ void ChartTypeTabPage::commitToModel( const ChartTypeParameter& rParameter )
return;
m_aTimerTriggeredControllerLock.startTimer();
- ControllerLockGuard aLockedControllers( uno::Reference< frame::XModel >( m_xChartModel, uno::UNO_QUERY ) );
+ ControllerLockGuardUNO aLockedControllers( uno::Reference< frame::XModel >( m_xChartModel, uno::UNO_QUERY ) );
m_pCurrentMainType->commitToModel( rParameter, m_xChartModel );
}
void ChartTypeTabPage::stateChanged( ChangingResource* /*pResource*/ )
diff --git a/chart2/source/controller/dialogs/tp_DataSource.cxx b/chart2/source/controller/dialogs/tp_DataSource.cxx
index d8aa5af..c0232ae 100644
--- a/chart2/source/controller/dialogs/tp_DataSource.cxx
+++ b/chart2/source/controller/dialogs/tp_DataSource.cxx
@@ -875,7 +875,7 @@ bool DataSourceTabPage::updateModelFromControl( Edit * pField )
if( !m_bIsDirty )
return true;
- ControllerLockGuard aLockedControllers( m_rDialogModel.getChartModel() );
+ ControllerLockGuardUNO aLockedControllers( m_rDialogModel.getChartModel() );
// @todo: validity check of field content
bool bResult = true;
diff --git a/chart2/source/controller/dialogs/tp_Wizard_TitlesAndObjects.cxx b/chart2/source/controller/dialogs/tp_Wizard_TitlesAndObjects.cxx
index 515b200..1524176 100644
--- a/chart2/source/controller/dialogs/tp_Wizard_TitlesAndObjects.cxx
+++ b/chart2/source/controller/dialogs/tp_Wizard_TitlesAndObjects.cxx
@@ -123,7 +123,7 @@ void TitlesAndObjectsTabPage::commitToModel()
m_aTimerTriggeredControllerLock.startTimer();
uno::Reference< frame::XModel > xModel( m_xChartModel, uno::UNO_QUERY);
- ControllerLockGuard aLockedControllers( xModel );
+ ControllerLockGuardUNO aLockedControllers( xModel );
//commit title changes to model
{
diff --git a/chart2/source/controller/inc/RangeSelectionListener.hxx b/chart2/source/controller/inc/RangeSelectionListener.hxx
index 92ab5e0..6d07778 100644
--- a/chart2/source/controller/inc/RangeSelectionListener.hxx
+++ b/chart2/source/controller/inc/RangeSelectionListener.hxx
@@ -63,7 +63,7 @@ protected:
private:
RangeSelectionListenerParent & m_rParent;
OUString m_aRange;
- ControllerLockGuard m_aControllerLockGuard;
+ ControllerLockGuardUNO m_aControllerLockGuard;
};
} // namespace chart
diff --git a/chart2/source/controller/inc/TimerTriggeredControllerLock.hxx b/chart2/source/controller/inc/TimerTriggeredControllerLock.hxx
index 7387bc4..ee01c30 100644
--- a/chart2/source/controller/inc/TimerTriggeredControllerLock.hxx
+++ b/chart2/source/controller/inc/TimerTriggeredControllerLock.hxx
@@ -41,7 +41,7 @@ public:
private:
::com::sun::star::uno::Reference<
::com::sun::star::frame::XModel > m_xModel;
- boost::scoped_ptr< ControllerLockGuard > m_apControllerLockGuard;
+ boost::scoped_ptr< ControllerLockGuardUNO > m_apControllerLockGuard;
AutoTimer m_aTimer;
DECL_LINK( TimerTimeout, void* );
diff --git a/chart2/source/controller/itemsetwrapper/SeriesOptionsItemConverter.cxx b/chart2/source/controller/itemsetwrapper/SeriesOptionsItemConverter.cxx
index 1b6f1aa..5763764 100644
--- a/chart2/source/controller/itemsetwrapper/SeriesOptionsItemConverter.cxx
+++ b/chart2/source/controller/itemsetwrapper/SeriesOptionsItemConverter.cxx
@@ -348,7 +348,10 @@ bool SeriesOptionsItemConverter::ApplySpecialItem( sal_uInt16 nWhichId, const Sf
{
bool bIncludeHiddenCells = static_cast<const SfxBoolItem &>(rItemSet.Get(nWhichId)).GetValue();
if (bIncludeHiddenCells != m_bIncludeHiddenCells)
- bChanged = ChartModelHelper::setIncludeHiddenCells( bIncludeHiddenCells, m_xChartModel );
+ {
+ ChartModel* pModel = dynamic_cast<ChartModel*>(m_xChartModel.get());
+ bChanged = ChartModelHelper::setIncludeHiddenCells( bIncludeHiddenCells, *pModel );
+ }
}
}
break;
diff --git a/chart2/source/controller/main/ChartController.cxx b/chart2/source/controller/main/ChartController.cxx
index 0ae910b..25981e3 100644
--- a/chart2/source/controller/main/ChartController.cxx
+++ b/chart2/source/controller/main/ChartController.cxx
@@ -1285,7 +1285,7 @@ void SAL_CALL ChartController::executeDispatch_SourceData()
void SAL_CALL ChartController::executeDispatch_MoveSeries( sal_Bool bForward )
{
- ControllerLockGuard aCLGuard( getModel() );
+ ControllerLockGuardUNO aCLGuard( getModel() );
//get selected series
OUString aObjectCID(m_aSelection.getSelectedCID());
diff --git a/chart2/source/controller/main/ChartController_Insert.cxx b/chart2/source/controller/main/ChartController_Insert.cxx
index 4313502..034b326 100644
--- a/chart2/source/controller/main/ChartController_Insert.cxx
+++ b/chart2/source/controller/main/ChartController_Insert.cxx
@@ -117,7 +117,7 @@ void ChartController::executeDispatch_InsertAxes()
if( aDlg.Execute() == RET_OK )
{
// lock controllers till end of block
- ControllerLockGuard aCLGuard( getModel() );
+ ControllerLockGuardUNO aCLGuard( getModel() );
InsertAxisOrGridDialogData aDialogOutput;
aDlg.getResult( aDialogOutput );
@@ -155,7 +155,7 @@ void ChartController::executeDispatch_InsertGrid()
if( aDlg.Execute() == RET_OK )
{
// lock controllers till end of block
- ControllerLockGuard aCLGuard( getModel() );
+ ControllerLockGuardUNO aCLGuard( getModel() );
InsertAxisOrGridDialogData aDialogOutput;
aDlg.getResult( aDialogOutput );
bool bChanged = AxisHelper::changeVisibilityOfGrids( xDiagram
@@ -187,7 +187,7 @@ void ChartController::executeDispatch_InsertTitles()
if( aDlg.Execute() == RET_OK )
{
// lock controllers till end of block
- ControllerLockGuard aCLGuard( getModel() );
+ ControllerLockGuardUNO aCLGuard( getModel() );
TitleDialogData aDialogOutput( impl_createReferenceSizeProvider().release());
aDlg.getResult( aDialogOutput );
bool bChanged = aDialogOutput.writeDifferenceToModel( getModel(), m_xCC, &aDialogInput );
@@ -208,7 +208,8 @@ void ChartController::executeDispatch_DeleteLegend()
ActionDescriptionProvider::DELETE, SCH_RESSTR( STR_OBJECT_LEGEND )),
m_xUndoManager );
- LegendHelper::hideLegend( getModel() );
+ ChartModel* pModel = dynamic_cast<ChartModel*>(getModel().get());
+ LegendHelper::hideLegend( *pModel );
aUndoGuard.commit();
}
@@ -219,7 +220,8 @@ void ChartController::executeDispatch_InsertLegend()
ActionDescriptionProvider::INSERT, SCH_RESSTR( STR_OBJECT_LEGEND )),
m_xUndoManager );
- Reference< chart2::XLegend > xLegend = LegendHelper::showLegend( getModel(), m_xCC );
+ ChartModel* pModel = dynamic_cast<ChartModel*>(getModel().get());
+ Reference< chart2::XLegend > xLegend = LegendHelper::showLegend( *pModel, m_xCC );
aUndoGuard.commit();
}
@@ -239,7 +241,7 @@ void ChartController::executeDispatch_OpenLegendDialog()
if( aDlg.Execute() == RET_OK )
{
// lock controllers till end of block
- ControllerLockGuard aCLGuard( getModel() );
+ ControllerLockGuardUNO aCLGuard( getModel() );
bool bChanged = aDlg.writeToModel( getModel() );
if( bChanged )
aUndoGuard.commit();
@@ -301,7 +303,7 @@ void ChartController::executeDispatch_InsertMenu_DataLabels()
SfxItemSet aOutItemSet = aItemConverter.CreateEmptyItemSet();
aDlg.FillItemSet( aOutItemSet );
// lock controllers till end of block
- ControllerLockGuard aCLGuard( getModel() );
+ ControllerLockGuardUNO aCLGuard( getModel() );
bool bChanged = aItemConverter.ApplyItemSet( aOutItemSet );//model should be changed now
if( bChanged )
aUndoGuard.commit();
@@ -409,7 +411,7 @@ void ChartController::executeDispatch_InsertTrendline()
const SfxItemSet* pOutItemSet = aDialog.GetOutputItemSet();
if( pOutItemSet )
{
- ControllerLockGuard aCLGuard( getModel() );
+ ControllerLockGuardUNO aCLGuard( getModel() );
aItemConverter.ApplyItemSet( *pOutItemSet );
}
aUndoGuard.commit();
@@ -467,7 +469,7 @@ void ChartController::executeDispatch_InsertErrorBars( bool bYError )
const SfxItemSet* pOutItemSet = aDlg.GetOutputItemSet();
if( pOutItemSet )
{
- ControllerLockGuard aCLGuard( getModel() );
+ ControllerLockGuardUNO aCLGuard( getModel() );
aItemConverter.ApplyItemSet( *pOutItemSet );
}
aUndoGuard.commit();
@@ -505,7 +507,7 @@ void ChartController::executeDispatch_InsertErrorBars( bool bYError )
aDlg.FillItemSet( aOutItemSet );
// lock controllers till end of block
- ControllerLockGuard aCLGuard( getModel() );
+ ControllerLockGuardUNO aCLGuard( getModel() );
bool bChanged = aItemConverter.ApplyItemSet( aOutItemSet );//model should be changed now
if( bChanged )
aUndoGuard.commit();
diff --git a/chart2/source/controller/main/ChartController_Position.cxx b/chart2/source/controller/main/ChartController_Position.cxx
index 752495f..2af88ba 100644
--- a/chart2/source/controller/main/ChartController_Position.cxx
+++ b/chart2/source/controller/main/ChartController_Position.cxx
@@ -158,7 +158,10 @@ void SAL_CALL ChartController::executeDispatch_PositionAndSize()
bool bChanged = false;
if ( eObjectType == OBJECTTYPE_LEGEND )
- bChanged = DiagramHelper::switchDiagramPositioningToExcludingPositioning( getModel(), false , true );
+ {
+ ChartModel* pModel = dynamic_cast<ChartModel*>(getModel().get());
+ bChanged = DiagramHelper::switchDiagramPositioningToExcludingPositioning( *pModel, false , true );
+ }
bool bMoved = PositionAndSizeHelper::moveObject( m_aSelection.getSelectedCID(), getModel()
, aObjectRect, aPageRect );
diff --git a/chart2/source/controller/main/ChartController_Properties.cxx b/chart2/source/controller/main/ChartController_Properties.cxx
index f1a6478..5c05794 100644
--- a/chart2/source/controller/main/ChartController_Properties.cxx
+++ b/chart2/source/controller/main/ChartController_Properties.cxx
@@ -776,7 +776,7 @@ bool ChartController::executeDlg_ObjectProperties_withoutUndoGuard( const OUStri
const SfxItemSet* pOutItemSet = aDlg.GetOutputItemSet();
if(pOutItemSet)
{
- ControllerLockGuard aCLGuard( getModel());
+ ControllerLockGuardUNO aCLGuard( getModel());
apItemConverter->ApplyItemSet( *pOutItemSet );//model should be changed now
bRet = true;
}
diff --git a/chart2/source/controller/main/ChartController_TextEdit.cxx b/chart2/source/controller/main/ChartController_TextEdit.cxx
index b495acb..32e75a8 100644
--- a/chart2/source/controller/main/ChartController_TextEdit.cxx
+++ b/chart2/source/controller/main/ChartController_TextEdit.cxx
@@ -134,7 +134,7 @@ bool ChartController::EndTextEdit()
ObjectIdentifier::getObjectPropertySet( aObjectCID, getModel() );
// lock controllers till end of block
- ControllerLockGuard aCLGuard( getModel() );
+ ControllerLockGuardUNO aCLGuard( getModel() );
TitleHelper::setCompleteString( aString, uno::Reference<
::com::sun::star::chart2::XTitle >::query( xPropSet ), m_xCC );
diff --git a/chart2/source/controller/main/ChartController_Tools.cxx b/chart2/source/controller/main/ChartController_Tools.cxx
index bfe6fc1..d10beb9 100644
--- a/chart2/source/controller/main/ChartController_Tools.cxx
+++ b/chart2/source/controller/main/ChartController_Tools.cxx
@@ -195,7 +195,7 @@ void ChartController::executeDispatch_NewArrangement()
UndoGuard aUndoGuard = UndoGuard(
SCH_RESSTR( STR_ACTION_REARRANGE_CHART ),
m_xUndoManager );
- ControllerLockGuard aCtlLockGuard( xModel );
+ ControllerLockGuardUNO aCtlLockGuard( xModel );
// diagram
Reference< beans::XPropertyState > xState( xDiagram, uno::UNO_QUERY_THROW );
@@ -249,7 +249,7 @@ void ChartController::executeDispatch_ScaleText()
UndoGuard aUndoGuard = UndoGuard(
SCH_RESSTR( STR_ACTION_SCALE_TEXT ),
m_xUndoManager );
- ControllerLockGuard aCtlLockGuard( getModel() );
+ ControllerLockGuardUNO aCtlLockGuard( getModel() );
SAL_WNODEPRECATED_DECLARATIONS_PUSH
::std::auto_ptr< ReferenceSizeProvider > apRefSizeProv( impl_createReferenceSizeProvider());
SAL_WNODEPRECATED_DECLARATIONS_POP
@@ -724,7 +724,7 @@ bool ChartController::executeDispatch_Delete()
ActionDescriptionProvider::DELETE, SCH_RESSTR( STR_OBJECT_CURVE_EQUATION )),
m_xUndoManager );
{
- ControllerLockGuard aCtlLockGuard( xModel );
+ ControllerLockGuardUNO aCtlLockGuard( xModel );
xEqProp->setPropertyValue( "ShowEquation", uno::makeAny( false ));
xEqProp->setPropertyValue( "ShowCorrelationCoefficient", uno::makeAny( false ));
}
@@ -758,7 +758,7 @@ bool ChartController::executeDispatch_Delete()
ActionDescriptionProvider::DELETE, SCH_RESSTR( nId )),
m_xUndoManager );
{
- ControllerLockGuard aCtlLockGuard( xModel );
+ ControllerLockGuardUNO aCtlLockGuard( xModel );
xErrorBarProp->setPropertyValue(
"ErrorBarStyle",
uno::makeAny( ::com::sun::star::chart::ErrorBarStyle::NONE ));
@@ -845,7 +845,8 @@ void ChartController::executeDispatch_ToggleLegend()
Reference< frame::XModel > xModel( getModel() );
UndoGuard aUndoGuard = UndoGuard(
SCH_RESSTR( STR_ACTION_TOGGLE_LEGEND ), m_xUndoManager );
- Reference< beans::XPropertySet > xLegendProp( LegendHelper::getLegend( xModel ), uno::UNO_QUERY );
+ ChartModel* pModel = dynamic_cast<ChartModel*>(xModel.get());
+ Reference< beans::XPropertySet > xLegendProp( LegendHelper::getLegend( *pModel ), uno::UNO_QUERY );
bool bChanged = false;
if( xLegendProp.is())
{
@@ -865,7 +866,7 @@ void ChartController::executeDispatch_ToggleLegend()
}
else
{
- xLegendProp.set( LegendHelper::getLegend( xModel, m_xCC, true ), uno::UNO_QUERY );
+ xLegendProp.set( LegendHelper::getLegend( *pModel, m_xCC, true ), uno::UNO_QUERY );
if( xLegendProp.is())
bChanged = true;
}
@@ -957,7 +958,8 @@ void ChartController::impl_switchDiagramPositioningToExcludingPositioning()
ActionDescriptionProvider::POS_SIZE,
ObjectNameProvider::getName( OBJECTTYPE_DIAGRAM)),
m_xUndoManager );
- if( DiagramHelper::switchDiagramPositioningToExcludingPositioning( m_aModel->getModel(), true, true ) )
+ ChartModel* pModel = dynamic_cast<ChartModel*>(m_aModel->getModel().get());
+ if( DiagramHelper::switchDiagramPositioningToExcludingPositioning( *pModel, true, true ) )
aUndoGuard.commit();
}
diff --git a/chart2/source/controller/main/ChartController_Window.cxx b/chart2/source/controller/main/ChartController_Window.cxx
index cb99f8e..7a55cc7 100644
--- a/chart2/source/controller/main/ChartController_Window.cxx
+++ b/chart2/source/controller/main/ChartController_Window.cxx
@@ -749,7 +749,7 @@ void ChartController::execute_Tracking( const TrackingEvent& /* rTEvt */ )
void ChartController::execute_MouseButtonUp( const MouseEvent& rMEvt )
{
- ControllerLockGuard aCLGuard( getModel() );
+ ControllerLockGuardUNO aCLGuard( getModel() );
bool bMouseUpWithoutMouseDown = !m_bWaitingForMouseUp;
m_bWaitingForMouseUp = false;
bool bNotifySelectionChange = false;
@@ -849,8 +849,9 @@ void ChartController::execute_MouseButtonUp( const MouseEvent& rMEvt )
m_xUndoManager );
bool bChanged = false;
+ ChartModel* pModel = dynamic_cast<ChartModel*>(getModel().get());
if ( eObjectType == OBJECTTYPE_LEGEND )
- bChanged = DiagramHelper::switchDiagramPositioningToExcludingPositioning( getModel(), false , true );
+ bChanged = DiagramHelper::switchDiagramPositioningToExcludingPositioning( *pModel, false , true );
bool bMoved = PositionAndSizeHelper::moveObject( m_aSelection.getSelectedCID()
, getModel()
@@ -1792,7 +1793,7 @@ bool ChartController::impl_moveOrResizeObject(
UndoGuard aUndoGuard( ActionDescriptionProvider::createDescription(
eActionType, ObjectNameProvider::getName( eObjectType )), m_xUndoManager );
{
- ControllerLockGuard aCLGuard( xChartModel );
+ ControllerLockGuardUNO aCLGuard( xChartModel );
if( bNeedShift )
xObjProp->setPropertyValue( "RelativePosition", uno::makeAny( aRelPos ));
if( bNeedResize || (eObjectType == OBJECTTYPE_DIAGRAM) )//Also set an explicat size at the diagram when an explicit position is set
diff --git a/chart2/source/controller/main/ChartModelClone.cxx b/chart2/source/controller/main/ChartModelClone.cxx
index f8ae218..aef15eb 100644
--- a/chart2/source/controller/main/ChartModelClone.cxx
+++ b/chart2/source/controller/main/ChartModelClone.cxx
@@ -191,12 +191,13 @@ namespace chart
try
{
// /-- loccked controllers of destination
- ControllerLockGuard aLockedControllers( i_model );
+ ControllerLockGuardUNO aLockedControllers( i_model );
Reference< XChartDocument > xSource( i_modelToCopyFrom, UNO_QUERY_THROW );
Reference< XChartDocument > xDestination( i_model, UNO_QUERY_THROW );
// propagate the correct flag for plotting of hidden values to the data provider and all used sequences
- ChartModelHelper::setIncludeHiddenCells( ChartModelHelper::isIncludeHiddenCells( i_modelToCopyFrom ) , i_model );
+ ChartModel* pModel = dynamic_cast<ChartModel*>(i_model.get());
+ ChartModelHelper::setIncludeHiddenCells( ChartModelHelper::isIncludeHiddenCells( i_modelToCopyFrom ) , *pModel );
// diagram
xDestination->setFirstDiagram( xSource->getFirstDiagram() );
diff --git a/chart2/source/controller/main/PositionAndSizeHelper.cxx b/chart2/source/controller/main/PositionAndSizeHelper.cxx
index 5e4005a..7b7f255 100644
--- a/chart2/source/controller/main/PositionAndSizeHelper.cxx
+++ b/chart2/source/controller/main/PositionAndSizeHelper.cxx
@@ -131,7 +131,7 @@ bool PositionAndSizeHelper::moveObject( const OUString& rObjectCID
, const awt::Rectangle& rPageRectangle
)
{
- ControllerLockGuard aLockedControllers( xChartModel );
+ ControllerLockGuardUNO aLockedControllers( xChartModel );
awt::Rectangle aNewPositionAndSize( rNewPositionAndSize );
diff --git a/chart2/source/inc/AxisHelper.hxx b/chart2/source/inc/AxisHelper.hxx
index 75bc69c..efc4d7d 100644
--- a/chart2/source/inc/AxisHelper.hxx
+++ b/chart2/source/inc/AxisHelper.hxx
@@ -28,6 +28,8 @@
#include <com/sun/star/uno/XComponentContext.hpp>
#include <com/sun/star/util/XNumberFormatsSupplier.hpp>
+#include "ChartModel.hxx"
+
#include <vector>
namespace chart
@@ -50,7 +52,7 @@ public:
::com::sun::star::chart2::XScaling >& xScaling );
static void checkDateAxis( ::com::sun::star::chart2::ScaleData& rScale, ExplicitCategoriesProvider* pExplicitCategoriesProvider, bool bChartTypeAllowsDateAxis );
- static ::com::sun::star::chart2::ScaleData getDateCheckedScale( const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XAxis >& xAxis, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& xChartModel );
+ static ::com::sun::star::chart2::ScaleData getDateCheckedScale( const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XAxis >& xAxis, ChartModel& rModel );
static sal_Int32 getExplicitNumberFormatKeyForAxis(
const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XAxis >& xAxis
diff --git a/chart2/source/inc/ChartModelHelper.hxx b/chart2/source/inc/ChartModelHelper.hxx
index 903d5c4..141d362 100644
--- a/chart2/source/inc/ChartModelHelper.hxx
+++ b/chart2/source/inc/ChartModelHelper.hxx
@@ -31,6 +31,8 @@
#include <com/sun/star/frame/XModel.hpp>
#include "charttoolsdllapi.hxx"
+#include "ChartModel.hxx"
+
#include <vector>
namespace chart
@@ -58,10 +60,18 @@ public:
static ::com::sun::star::uno::Reference<
::com::sun::star::chart2::XCoordinateSystem >
+ getFirstCoordinateSystem( ChartModel& rModel );
+
+ static ::com::sun::star::uno::Reference<
+ ::com::sun::star::chart2::XCoordinateSystem >
getFirstCoordinateSystem( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& xModel );
SAL_DLLPRIVATE static ::std::vector< ::com::sun::star::uno::Reference<
::com::sun::star::chart2::XDataSeries > > getDataSeries(
+ ChartModel& rModel );
+
+ SAL_DLLPRIVATE static ::std::vector< ::com::sun::star::uno::Reference<
+ ::com::sun::star::chart2::XDataSeries > > getDataSeries(
const ::com::sun::star::uno::Reference<
::com::sun::star::chart2::XChartDocument > & xChartDoc );
static ::std::vector< ::com::sun::star::uno::Reference<
@@ -93,8 +103,7 @@ public:
static bool isIncludeHiddenCells( const ::com::sun::star::uno::Reference<
::com::sun::star::frame::XModel >& xChartModel );
- static bool setIncludeHiddenCells( bool bIncludeHiddenCells, const ::com::sun::star::uno::Reference<
- ::com::sun::star::frame::XModel >& xChartModel );
+ static bool setIncludeHiddenCells( bool bIncludeHiddenCells, ChartModel& rModel);
};
} //namespace chart
diff --git a/chart2/source/inc/ControllerLockGuard.hxx b/chart2/source/inc/ControllerLockGuard.hxx
index 7d0ee15..9ac9904 100644
--- a/chart2/source/inc/ControllerLockGuard.hxx
+++ b/chart2/source/inc/ControllerLockGuard.hxx
@@ -21,6 +21,7 @@
#include <com/sun/star/frame/XModel.hpp>
#include "charttoolsdllapi.hxx"
+#include "ChartModel.hxx"
namespace chart
{
@@ -29,17 +30,26 @@ namespace chart
unlockControllers in the DTOR. Using this ensures that controllers do not
remain locked when leaving a function even in case an exception is thrown.
*/
-class OOO_DLLPUBLIC_CHARTTOOLS ControllerLockGuard
+class OOO_DLLPUBLIC_CHARTTOOLS ControllerLockGuardUNO
{
public:
- explicit ControllerLockGuard(
+ explicit ControllerLockGuardUNO(
const ::com::sun::star::uno::Reference<
::com::sun::star::frame::XModel > & xModel );
+ ~ControllerLockGuardUNO();
+
+private:
+ com::sun::star::uno::Reference< com::sun::star::frame::XModel > mxModel;
+};
+
+class OOO_DLLPUBLIC_CHARTTOOLS ControllerLockGuard
+{
+public:
+ explicit ControllerLockGuard( ChartModel& rModel );
~ControllerLockGuard();
private:
- ::com::sun::star::uno::Reference<
- ::com::sun::star::frame::XModel > m_xModel;
+ ChartModel& mrModel;
};
/** This helper class can be used to pass a locking mechanism to other objects
diff --git a/chart2/source/inc/DataSourceHelper.hxx b/chart2/source/inc/DataSourceHelper.hxx
index d3b9ac1..b65e118 100644
--- a/chart2/source/inc/DataSourceHelper.hxx
+++ b/chart2/source/inc/DataSourceHelper.hxx
@@ -28,6 +28,8 @@
#include <com/sun/star/frame/XModel.hpp>
#include <com/sun/star/uno/XComponentContext.hpp>
+#include "ChartModel.hxx"
+
#include "charttoolsdllapi.hxx"
#include <vector>
@@ -99,6 +101,10 @@ public:
static ::com::sun::star::uno::Reference<
::com::sun::star::chart2::data::XDataSource > getUsedData(
+ ChartModel& rModel );
+
+ static ::com::sun::star::uno::Reference<
+ ::com::sun::star::chart2::data::XDataSource > getUsedData(
const ::com::sun::star::uno::Reference<
::com::sun::star::frame::XModel >& xChartModel );
diff --git a/chart2/source/inc/DiagramHelper.hxx b/chart2/source/inc/DiagramHelper.hxx
index b89c555..213ff08 100644
--- a/chart2/source/inc/DiagramHelper.hxx
+++ b/chart2/source/inc/DiagramHelper.hxx
@@ -33,6 +33,8 @@
#include <com/sun/star/util/XNumberFormats.hpp>
#include <com/sun/star/util/XNumberFormatsSupplier.hpp>
+#include "ChartModel.hxx"
+
#include <utility>
#include <vector>
@@ -224,9 +226,7 @@ public:
::com::sun::star::chart2::XDiagram > & xDiagram );
static ::com::sun::star::uno::Sequence< OUString >
- getExplicitSimpleCategories(
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::chart2::XChartDocument > & xChartDoc );
+ getExplicitSimpleCategories( ChartModel& rModel );
SAL_DLLPRIVATE static ::com::sun::star::uno::Sequence< OUString >
generateAutomaticCategoriesFromCooSys(
@@ -340,8 +340,7 @@ public:
static ::com::sun::star::awt::Rectangle getDiagramRectangleFromModel( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& xChartModel );
- static bool switchDiagramPositioningToExcludingPositioning( const ::com::sun::star::uno::Reference<
- ::com::sun::star::frame::XModel >& xChartModel
+ static bool switchDiagramPositioningToExcludingPositioning( ChartModel& rModel
, bool bResetModifiedState //set model back to unchanged if it was unchanged before
, bool bConvertAlsoFromAutoPositioning );
diff --git a/chart2/source/inc/ExplicitCategoriesProvider.hxx b/chart2/source/inc/ExplicitCategoriesProvider.hxx
index a8feca5..4cc7459 100644
--- a/chart2/source/inc/ExplicitCategoriesProvider.hxx
+++ b/chart2/source/inc/ExplicitCategoriesProvider.hxx
@@ -24,8 +24,8 @@
#include <cppuhelper/weakref.hxx>
#include <com/sun/star/chart2/XCoordinateSystem.hpp>
#include <com/sun/star/chart2/data/XTextualDataSequence.hpp>
-#include <com/sun/star/frame/XModel.hpp>
#include "charttoolsdllapi.hxx"
+#include "ChartModel.hxx"
#include <vector>
@@ -73,8 +73,7 @@ class OOO_DLLPUBLIC_CHARTTOOLS ExplicitCategoriesProvider
public:
ExplicitCategoriesProvider( const ::com::sun::star::uno::Reference<
::com::sun::star::chart2::XCoordinateSystem >& xCooSysModel
- , const ::com::sun::star::uno::Reference<
- ::com::sun::star::frame::XModel >& xChartModel
+ , ChartModel& rChartModel
);
virtual ~ExplicitCategoriesProvider();
@@ -89,8 +88,7 @@ public:
static OUString getCategoryByIndex(
const ::com::sun::star::uno::Reference<
::com::sun::star::chart2::XCoordinateSystem >& xCooSysModel
- , const ::com::sun::star::uno::Reference<
- ::com::sun::star::frame::XModel >& xChartModel
+ , ChartModel& rModel
, sal_Int32 nIndex );
static ::com::sun::star::uno::Sequence< OUString > getExplicitSimpleCategories(
@@ -98,7 +96,7 @@ public:
static void convertCategoryAnysToText( ::com::sun::star::uno::Sequence< OUString >& rOutTexts
, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& rInAnys
- , ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > xChartModel );
+ , ChartModel& rModel );
bool hasComplexCategories() const;
sal_Int32 getCategoryLevelCount() const;
@@ -113,8 +111,7 @@ private: //member
bool volatile m_bDirty;
::com::sun::star::uno::WeakReference<
::com::sun::star::chart2::XCoordinateSystem > m_xCooSysModel;
- ::com::sun::star::uno::WeakReference<
- ::com::sun::star::frame::XModel > m_xChartModel;
+ ChartModel& mrModel;
::com::sun::star::uno::Reference<
::com::sun::star::chart2::data::XLabeledDataSequence> m_xOriginalCategories;
diff --git a/chart2/source/inc/LegendHelper.hxx b/chart2/source/inc/LegendHelper.hxx
index f914ce8..f34e9d6 100644
--- a/chart2/source/inc/LegendHelper.hxx
+++ b/chart2/source/inc/LegendHelper.hxx
@@ -23,10 +23,11 @@
#include <rtl/ustring.hxx>
#include <com/sun/star/chart2/XLegend.hpp>
#include <com/sun/star/chart2/XDiagram.hpp>
-#include <com/sun/star/frame/XModel.hpp>
#include <com/sun/star/uno/XComponentContext.hpp>
#include "charttoolsdllapi.hxx"
+#include "ChartModel.hxx"
+
namespace chart
{
@@ -38,18 +39,15 @@ class OOO_DLLPUBLIC_CHARTTOOLS LegendHelper
public:
static ::com::sun::star::uno::Reference<
::com::sun::star::chart2::XLegend >
- showLegend( const ::com::sun::star::uno::Reference<
- ::com::sun::star::frame::XModel >& xModel
+ showLegend( ChartModel& rModel
, const ::com::sun::star::uno::Reference<
::com::sun::star::uno::XComponentContext >& xContext );
- static void hideLegend( const ::com::sun::star::uno::Reference<
- ::com::sun::star::frame::XModel >& xModel );
+ static void hideLegend( ChartModel& rModel );
static ::com::sun::star::uno::Reference<
::com::sun::star::chart2::XLegend >
- getLegend( const ::com::sun::star::uno::Reference<
- ::com::sun::star::frame::XModel >& xModel
+ getLegend( ChartModel& rModel
, const ::com::sun::star::uno::Reference<
::com::sun::star::uno::XComponentContext >& xContext = 0
, bool bCreate = false );
diff --git a/chart2/source/inc/ObjectIdentifier.hxx b/chart2/source/inc/ObjectIdentifier.hxx
index 49ef8f6..5849ef5 100644
--- a/chart2/source/inc/ObjectIdentifier.hxx
+++ b/chart2/source/inc/ObjectIdentifier.hxx
@@ -26,6 +26,7 @@
#include <com/sun/star/chart2/XChartDocument.hpp>
#include "TitleHelper.hxx"
#include "charttoolsdllapi.hxx"
+#include "ChartModel.hxx"
// header for class OUString
#include <rtl/ustring.hxx>
@@ -104,6 +105,11 @@ public:
static OUString createClassifiedIdentifierForObject(
const ::com::sun::star::uno::Reference<
::com::sun::star::uno::XInterface >& xObject
+ , ChartModel& rModel);
+
+ static OUString createClassifiedIdentifierForObject(
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::uno::XInterface >& xObject
, const ::com::sun::star::uno::Reference<
::com::sun::star::frame::XModel >& xChartModel );
@@ -126,12 +132,22 @@ public:
SAL_DLLPRIVATE static OUString createParticleForDiagram(
const ::com::sun::star::uno::Reference<
::com::sun::star::chart2::XDiagram >& xDiagram
+ , ChartModel& rModel);
+
+ SAL_DLLPRIVATE static OUString createParticleForDiagram(
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::chart2::XDiagram >& xDiagram
, const ::com::sun::star::uno::Reference<
::com::sun::star::frame::XModel >& xChartModel );
static OUString createParticleForCoordinateSystem(
const ::com::sun::star::uno::Reference<
::com::sun::star::chart2::XCoordinateSystem >& xCooSys
+ , ChartModel& rModel );
+
+ static OUString createParticleForCoordinateSystem(
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::chart2::XCoordinateSystem >& xCooSys
, const ::com::sun::star::uno::Reference<
::com::sun::star::frame::XModel >& xChartModel );
@@ -147,6 +163,11 @@ public:
static OUString createParticleForLegend(
const ::com::sun::star::uno::Reference<
::com::sun::star::chart2::XLegend >& xLegend
+ , ChartModel& rModel );
+
+ static OUString createParticleForLegend(
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::chart2::XLegend >& xLegend
, const ::com::sun::star::uno::Reference<
::com::sun::star::frame::XModel >& xChartModel );
diff --git a/chart2/source/inc/TitleHelper.hxx b/chart2/source/inc/TitleHelper.hxx
index c954acf..eae32ce 100644
--- a/chart2/source/inc/TitleHelper.hxx
+++ b/chart2/source/inc/TitleHelper.hxx
@@ -26,6 +26,8 @@
#include <com/sun/star/uno/XComponentContext.hpp>
#include <com/sun/star/chart2/XDiagram.hpp>
+#include "ChartModel.hxx"
+
namespace chart
{
@@ -52,8 +54,13 @@ public:
static ::com::sun::star::uno::Reference<
::com::sun::star::chart2::XTitle >
getTitle( eTitleType nTitleIndex
+ , ChartModel& rModel );
+
+ static ::com::sun::star::uno::Reference<
+ ::com::sun::star::chart2::XTitle >
+ getTitle( eTitleType nTitleIndex
, const ::com::sun::star::uno::Reference<
- ::com::sun::star::frame::XModel >& xModel );
+ ::com::sun::star::frame::XModel >& xModel );
static ::com::sun::star::uno::Reference<
::com::sun::star::chart2::XTitle >
@@ -81,6 +88,11 @@ public:
static bool getTitleType( eTitleType& rType
, const ::com::sun::star::uno::Reference<
::com::sun::star::chart2::XTitle >& xTitle
+ , ChartModel& rModel);
+
+ static bool getTitleType( eTitleType& rType
+ , const ::com::sun::star::uno::Reference<
+ ::com::sun::star::chart2::XTitle >& xTitle
, const ::com::sun::star::uno::Reference<
::com::sun::star::frame::XModel >& xModel );
};
diff --git a/chart2/source/inc/chartview/ExplicitValueProvider.hxx b/chart2/source/inc/chartview/ExplicitValueProvider.hxx
index 0f3f8a4..03d685b 100644
--- a/chart2/source/inc/chartview/ExplicitValueProvider.hxx
+++ b/chart2/source/inc/chartview/ExplicitValueProvider.hxx
@@ -32,6 +32,8 @@
#include <com/sun/star/util/XNumberFormatsSupplier.hpp>
#include "chartviewdllapi.hxx"
+#include "ChartModel.hxx"
+
namespace chart
{
@@ -69,16 +71,14 @@ public:
static ::com::sun::star::awt::Rectangle
addAxisTitleSizes(
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::frame::XModel >& xChartModel
+ ChartModel& rModel
, const ::com::sun::star::uno::Reference<
::com::sun::star::uno::XInterface >& xChartView
, const ::com::sun::star::awt::Rectangle& rExcludingPositionAndSize );
static ::com::sun::star::awt::Rectangle
substractAxisTitleSizes(
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::frame::XModel >& xChartModel
+ ChartModel& rModel
, const ::com::sun::star::uno::Reference<
::com::sun::star::uno::XInterface >& xChartView
, const ::com::sun::star::awt::Rectangle& rPositionAndSizeIncludingTitles );
diff --git a/chart2/source/model/main/ChartModel.cxx b/chart2/source/model/main/ChartModel.cxx
index ee1c0e2..c25b346 100644
--- a/chart2/source/model/main/ChartModel.cxx
+++ b/chart2/source/model/main/ChartModel.cxx
@@ -32,6 +32,7 @@
#include "CloneHelper.hxx"
#include "NameContainer.hxx"
#include "UndoManager.hxx"
+#include "ChartView.hxx"
#include <com/sun/star/chart/ChartDataRowSource.hpp>
@@ -92,6 +93,7 @@ ChartModel::ChartModel(uno::Reference<uno::XComponentContext > const & xContext)
, m_bModified( sal_False )
, m_nInLoad(0)
, m_bUpdateNotificationsPending(false)
+ , mpChartView(NULL)
, m_pUndoManager( NULL )
, m_aControllers( m_aModelMutex )
, m_nControllerLockCount(0)
@@ -129,6 +131,7 @@ ChartModel::ChartModel( const ChartModel & rOther )
, m_bModified( rOther.m_bModified )
, m_nInLoad(0)
, m_bUpdateNotificationsPending(false)
+ , mpChartView(NULL)
, m_aResource( rOther.m_aResource )
, m_aMediaDescriptor( rOther.m_aMediaDescriptor )
, m_aControllers( m_aModelMutex )
@@ -183,6 +186,8 @@ ChartModel::~ChartModel()
OSL_TRACE( "ChartModel: DTOR called" );
if( m_xOldModelAgg.is())
m_xOldModelAgg->setDelegator( NULL );
+
+ delete mpChartView;
}
void SAL_CALL ChartModel::initialize( const Sequence< Any >& /*rArguments*/ )
@@ -1005,7 +1010,7 @@ void SAL_CALL ChartModel::setVisualAreaSize( ::sal_Int64 nAspect, const awt::Siz
{
if( nAspect == embed::Aspects::MSOLE_CONTENT )
{
- ControllerLockGuard aLockGuard( this );
+ ControllerLockGuard aLockGuard( *this );
bool bChanged =
(m_aVisualAreaSize.Width != aSize.Width ||
m_aVisualAreaSize.Height != aSize.Height);
@@ -1194,18 +1199,22 @@ Reference< uno::XInterface > SAL_CALL ChartModel::createInstance( const OUString
case SERVICE_TRANSP_GRADIENT_TABLE:
case SERVICE_MARKER_TABLE:
{
- uno::Reference< lang::XMultiServiceFactory > xFact(
- this->createInstance( CHART_VIEW_SERVICE_NAME ), uno::UNO_QUERY );
- if ( xFact.is() )
- {
- return xFact->createInstance( rServiceSpecifier );
- }
+ if(!mpChartView)
+ mpChartView = new ChartView( m_xContext, *this);
+ return mpChartView->createInstance( rServiceSpecifier );
}
break;
case SERVICE_NAMESPACE_MAP:
return Reference< uno::XInterface >( m_xXMLNamespaceMap );
}
}
+ else if(rServiceSpecifier == CHART_VIEW_SERVICE_NAME)
+ {
+ if(!mpChartView)
+ mpChartView = new ChartView( m_xContext, *this);
+
+ return static_cast< ::cppu::OWeakObject* >( mpChartView );
+ }
else
{
if( m_xOldModelAgg.is() )
@@ -1247,7 +1256,7 @@ Sequence< OUString > SAL_CALL ChartModel::getAvailableServiceNames()
return aResult;
}
-Reference< util::XNumberFormatsSupplier > ChartModel::impl_getNumberFormatsSupplier()
+Reference< util::XNumberFormatsSupplier > ChartModel::getNumberFormatsSupplier()
{
if( !m_xNumberFormatsSupplier.is() )
{
@@ -1269,7 +1278,7 @@ Reference< util::XNumberFormatsSupplier > ChartModel::impl_getNumberFormatsSuppl
if( aIdentifier.getLength() == 16 && 0 == memcmp( SvNumberFormatsSupplierObj::getUnoTunnelId().getConstArray(),
aIdentifier.getConstArray(), 16 ) )
{
- Reference< lang::XUnoTunnel > xTunnel( impl_getNumberFormatsSupplier(), uno::UNO_QUERY );
+ Reference< lang::XUnoTunnel > xTunnel( getNumberFormatsSupplier(), uno::UNO_QUERY );
if( xTunnel.is() )
return xTunnel->getSomething( aIdentifier );
}
@@ -1280,7 +1289,7 @@ Reference< util::XNumberFormatsSupplier > ChartModel::impl_getNumberFormatsSuppl
uno::Reference< beans::XPropertySet > SAL_CALL ChartModel::getNumberFormatSettings()
throw (uno::RuntimeException)
{
- Reference< util::XNumberFormatsSupplier > xSupplier( impl_getNumberFormatsSupplier() );
+ Reference< util::XNumberFormatsSupplier > xSupplier( getNumberFormatsSupplier() );
if( xSupplier.is() )
return xSupplier->getNumberFormatSettings();
return uno::Reference< beans::XPropertySet >();
@@ -1289,7 +1298,7 @@ uno::Reference< beans::XPropertySet > SAL_CALL ChartModel::getNumberFormatSettin
uno::Reference< util::XNumberFormats > SAL_CALL ChartModel::getNumberFormats()
throw (uno::RuntimeException)
{
- Reference< util::XNumberFormatsSupplier > xSupplier( impl_getNumberFormatsSupplier() );
+ Reference< util::XNumberFormatsSupplier > xSupplier( getNumberFormatsSupplier() );
if( xSupplier.is() )
return xSupplier->getNumberFormats();
return uno::Reference< util::XNumberFormats >();
diff --git a/chart2/source/model/main/ChartModel_Persistence.cxx b/chart2/source/model/main/ChartModel_Persistence.cxx
index eebf278..d964ced 100644
--- a/chart2/source/model/main/ChartModel_Persistence.cxx
+++ b/chart2/source/model/main/ChartModel_Persistence.cxx
@@ -471,7 +471,7 @@ void SAL_CALL ChartModel::initNew()
ASSERT_EXCEPTION( ex );
}
}
- ChartModelHelper::setIncludeHiddenCells( false, this );
+ ChartModelHelper::setIncludeHiddenCells( false, *this );
}
catch( const uno::Exception & ex )
{
diff --git a/chart2/source/model/main/_serviceregistration_model.cxx b/chart2/source/model/main/_serviceregistration_model.cxx
index 95e4d4a..911eb05 100644
--- a/chart2/source/model/main/_serviceregistration_model.cxx
+++ b/chart2/source/model/main/_serviceregistration_model.cxx
@@ -174,8 +174,6 @@ static const struct ::cppu::ImplementationEntry g_entries_chart2_model[] =
// component exports
extern "C"
{
-SAL_DLLPUBLIC_EXPORT void * SAL_CALL chartview_component_getFactory(
- const sal_Char * pImplName, void * pServiceManager, void * pRegistryKey );
... etc. - the rest is truncated
More information about the Libreoffice-commits
mailing list