summaryrefslogtreecommitdiff
path: root/chart2
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2016-07-05 09:54:33 +0200
committerNoel Grandin <noelgrandin@gmail.com>2016-07-05 10:51:09 +0000
commit7001ca25ec7251c5bac4a5ff304d1f26794b58a0 (patch)
treeafba191579312c64d09c125d4b5e170448ce9edc /chart2
parent860a82766f2c6d4fad340bf6ab283a7cd22a1fd5 (diff)
merge LineProperties with chart::ErrorBar
Change-Id: Ic3490a15339ff981e90a86cb69c206c231db9161 Reviewed-on: https://gerrit.libreoffice.org/26932 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'chart2')
-rw-r--r--chart2/Library_chartcore.mk1
-rw-r--r--chart2/source/controller/chartapiwrapper/ChartDataWrapper.cxx1
-rw-r--r--chart2/source/controller/main/ObjectHierarchy.cxx1
-rw-r--r--chart2/source/inc/ErrorBar.hxx28
-rw-r--r--chart2/source/inc/LineProperties.hxx40
-rw-r--r--chart2/source/tools/ErrorBar.cxx50
-rw-r--r--chart2/source/tools/LineProperties.cxx100
7 files changed, 60 insertions, 161 deletions
diff --git a/chart2/Library_chartcore.mk b/chart2/Library_chartcore.mk
index 7040ade3298b..75a76556c4a4 100644
--- a/chart2/Library_chartcore.mk
+++ b/chart2/Library_chartcore.mk
@@ -211,7 +211,6 @@ $(eval $(call gb_Library_add_exception_objects,chartcore,\
chart2/source/tools/LifeTime \
chart2/source/tools/LinearRegressionCurveCalculator \
chart2/source/tools/LinePropertiesHelper \
- chart2/source/tools/LineProperties \
chart2/source/tools/LogarithmicRegressionCurveCalculator \
chart2/source/tools/MeanValueRegressionCurveCalculator \
chart2/source/tools/MediaDescriptorHelper \
diff --git a/chart2/source/controller/chartapiwrapper/ChartDataWrapper.cxx b/chart2/source/controller/chartapiwrapper/ChartDataWrapper.cxx
index 4a5e3d64dd2e..353bb0f9c62c 100644
--- a/chart2/source/controller/chartapiwrapper/ChartDataWrapper.cxx
+++ b/chart2/source/controller/chartapiwrapper/ChartDataWrapper.cxx
@@ -43,7 +43,6 @@
#include <com/sun/star/chart/XChartDocument.hpp>
#include "CharacterProperties.hxx"
-#include "LineProperties.hxx"
#include "FillProperties.hxx"
#include <map>
diff --git a/chart2/source/controller/main/ObjectHierarchy.cxx b/chart2/source/controller/main/ObjectHierarchy.cxx
index 5d86a04b3ad6..0fef16e4115b 100644
--- a/chart2/source/controller/main/ObjectHierarchy.cxx
+++ b/chart2/source/controller/main/ObjectHierarchy.cxx
@@ -25,7 +25,6 @@
#include "AxisHelper.hxx"
#include "chartview/ExplicitValueProvider.hxx"
#include "macros.hxx"
-#include "LineProperties.hxx"
#include "ChartTypeHelper.hxx"
#include "DataSeriesHelper.hxx"
#include "LegendHelper.hxx"
diff --git a/chart2/source/inc/ErrorBar.hxx b/chart2/source/inc/ErrorBar.hxx
index 97333e3c5e8a..2f925ba6a9c8 100644
--- a/chart2/source/inc/ErrorBar.hxx
+++ b/chart2/source/inc/ErrorBar.hxx
@@ -22,21 +22,25 @@
#include "MutexContainer.hxx"
#include "ModifyListenerHelper.hxx"
#include "charttoolsdllapi.hxx"
-#include "LineProperties.hxx"
#include <cppuhelper/implbase.hxx>
#include <comphelper/uno3.hxx>
-#include <com/sun/star/uno/XComponentContext.hpp>
-#include <com/sun/star/lang/XServiceInfo.hpp>
-#include <com/sun/star/lang/XServiceName.hpp>
-#include <com/sun/star/util/XCloneable.hpp>
+#include <com/sun/star/beans/XPropertySet.hpp>
+#include <com/sun/star/beans/XPropertyState.hpp>
#include <com/sun/star/container/XChild.hpp>
#include <com/sun/star/chart2/data/XDataSink.hpp>
#include <com/sun/star/chart2/data/XDataSource.hpp>
-#include <com/sun/star/beans/XPropertySet.hpp>
-#include <com/sun/star/beans/XPropertyState.hpp>
#include <com/sun/star/chart/ErrorBarStyle.hpp>
+#include <com/sun/star/drawing/LineStyle.hpp>
+#include <com/sun/star/drawing/LineJoint.hpp>
+#include <com/sun/star/drawing/LineDash.hpp>
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <com/sun/star/lang/XServiceName.hpp>
+#include <com/sun/star/uno/Any.hxx>
+#include <com/sun/star/uno/XComponentContext.hpp>
+#include <com/sun/star/util/XCloneable.hpp>
+#include <com/sun/star/util/Color.hpp>
namespace chart
{
@@ -60,10 +64,16 @@ typedef ::cppu::WeakImplHelper<
class ErrorBar :
public MutexContainer,
- public impl::ErrorBar_Base,
- public LineProperties
+ public impl::ErrorBar_Base
{
private:
+ OUString maDashName;
+ css::drawing::LineDash maLineDash;
+ sal_Int32 mnLineWidth;
+ css::drawing::LineStyle meLineStyle;
+ css::util::Color maLineColor;
+ sal_Int16 mnLineTransparence;
+ css::drawing::LineJoint meLineJoint;
bool mbShowPositiveError;
bool mbShowNegativeError;
double mfPositiveError;
diff --git a/chart2/source/inc/LineProperties.hxx b/chart2/source/inc/LineProperties.hxx
deleted file mode 100644
index 6c9d413a656e..000000000000
--- a/chart2/source/inc/LineProperties.hxx
+++ /dev/null
@@ -1,40 +0,0 @@
-/* -*- 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 INCLUDED_CHART2_SOURCE_INC_LINEPROPERTIES_HXX
-#define INCLUDED_CHART2_SOURCE_INC_LINEPROPERTIES_HXX
-
-#include <com/sun/star/drawing/LineStyle.hpp>
-#include <com/sun/star/util/Color.hpp>
-#include <com/sun/star/drawing/LineJoint.hpp>
-#include <com/sun/star/drawing/LineDash.hpp>
-#include <com/sun/star/uno/Any.hxx>
-
-class LineProperties
-{
-private:
- OUString maDashName;
- css::drawing::LineDash maLineDash;
- sal_Int32 mnLineWidth;
- css::drawing::LineStyle meLineStyle;
- css::util::Color maLineColor;
- sal_Int16 mnLineTransparence;
- css::drawing::LineJoint meLineJoint;
-
-public:
- LineProperties();
- LineProperties(const LineProperties&);
-
- css::uno::Any getPropertyValue(const OUString& rName);
- void setPropertyValue(const OUString& rName, const css::uno::Any& rAny);
-};
-
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/chart2/source/tools/ErrorBar.cxx b/chart2/source/tools/ErrorBar.cxx
index 8833074513bd..d40d25145325 100644
--- a/chart2/source/tools/ErrorBar.cxx
+++ b/chart2/source/tools/ErrorBar.cxx
@@ -19,7 +19,6 @@
#include "ErrorBar.hxx"
#include "macros.hxx"
-#include "LineProperties.hxx"
#include "ContainerHelper.hxx"
#include "EventListenerHelper.hxx"
#include "PropertyHelper.hxx"
@@ -87,9 +86,12 @@ uno::Reference< beans::XPropertySet > createErrorBar( const uno::Reference< uno:
return new ErrorBar( xContext );
}
-ErrorBar::ErrorBar(
- uno::Reference< uno::XComponentContext > const & xContext ) :
- LineProperties(),
+ErrorBar::ErrorBar( uno::Reference< uno::XComponentContext > const & xContext ) :
+ mnLineWidth(0),
+ meLineStyle(drawing::LineStyle_SOLID),
+ maLineColor(0),
+ mnLineTransparence(0),
+ meLineJoint(drawing::LineJoint_ROUND),
mbShowPositiveError(true),
mbShowNegativeError(true),
mfPositiveError(0),
@@ -103,7 +105,13 @@ ErrorBar::ErrorBar(
ErrorBar::ErrorBar( const ErrorBar & rOther ) :
MutexContainer(),
impl::ErrorBar_Base(),
- LineProperties(rOther),
+ maDashName(rOther.maDashName),
+ maLineDash(rOther.maLineDash),
+ mnLineWidth(rOther.mnLineWidth),
+ meLineStyle(rOther.meLineStyle),
+ maLineColor(rOther.maLineColor),
+ mnLineTransparence(rOther.mnLineTransparence),
+ meLineJoint(rOther.meLineJoint),
mbShowPositiveError(rOther.mbShowPositiveError),
mbShowNegativeError(rOther.mbShowNegativeError),
mfPositiveError(rOther.mfPositiveError),
@@ -169,8 +177,20 @@ void ErrorBar::setPropertyValue( const OUString& rPropName, const uno::Any& rAny
rAny >>= mbShowNegativeError;
else if(rPropName == "ErrorBarRangePositive" || rPropName == "ErrorBarRangeNegative")
throw beans::UnknownPropertyException("read-only property", static_cast< uno::XWeak*>(this));
- else
- LineProperties::setPropertyValue(rPropName, rAny);
+ else if(rPropName == "LineDashName")
+ rAny >>= maDashName;
+ else if(rPropName == "LineDash")
+ rAny >>= maLineDash;
+ else if(rPropName == "LineWidth")
+ rAny >>= mnLineWidth;
+ else if(rPropName == "LineStyle")
+ rAny >>= meLineStyle;
+ else if(rPropName == "LineColor")
+ rAny >>= maLineColor;
+ else if(rPropName == "LineTransparence")
+ rAny >>= mnLineTransparence;
+ else if(rPropName == "LineJoint")
+ rAny >>= meLineJoint;
m_xModifyEventForwarder->modified( lang::EventObject( static_cast< uno::XWeak* >( this )));
}
@@ -260,8 +280,20 @@ uno::Any ErrorBar::getPropertyValue(const OUString& rPropName)
aRet <<= aRange;
}
- else
- aRet = LineProperties::getPropertyValue(rPropName);
+ else if(rPropName == "LineDashName")
+ aRet <<= maDashName;
+ else if(rPropName == "LineDash")
+ aRet <<= maLineDash;
+ else if(rPropName == "LineWidth")
+ aRet <<= mnLineWidth;
+ else if(rPropName == "LineStyle")
+ aRet = uno::makeAny(meLineStyle);
+ else if(rPropName == "LineColor")
+ aRet <<= maLineColor;
+ else if(rPropName == "LineTransparence")
+ aRet <<= mnLineTransparence;
+ else if(rPropName == "LineJoint")
+ aRet <<= meLineJoint;
SAL_WARN_IF(!aRet.hasValue(), "chart2", "asked for property value: " << rPropName);
return aRet;
diff --git a/chart2/source/tools/LineProperties.cxx b/chart2/source/tools/LineProperties.cxx
deleted file mode 100644
index 443704f4f0b2..000000000000
--- a/chart2/source/tools/LineProperties.cxx
+++ /dev/null
@@ -1,100 +0,0 @@
-/* -*- 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/.
- */
-
-#include "LineProperties.hxx"
-
-using namespace com::sun::star;
-
-LineProperties::LineProperties():
- mnLineWidth(0),
- meLineStyle(drawing::LineStyle_SOLID),
- maLineColor(0),
- mnLineTransparence(0),
- meLineJoint(drawing::LineJoint_ROUND)
-{
-}
-
-LineProperties::LineProperties(const LineProperties& r):
- maDashName(r.maDashName),
- maLineDash(r.maLineDash),
- mnLineWidth(r.mnLineWidth),
- meLineStyle(r.meLineStyle),
- maLineColor(r.maLineColor),
- mnLineTransparence(r.mnLineTransparence),
- meLineJoint(r.meLineJoint)
-{
-}
-
-uno::Any LineProperties::getPropertyValue(const OUString& rName)
-{
- uno::Any aRet;
- if(rName == "LineDashName")
- {
- aRet <<= maDashName;
- }
- else if(rName == "LineDash")
- {
- aRet <<= maLineDash;
- }
- else if(rName == "LineWidth")
- {
- aRet <<= mnLineWidth;
- }
- else if(rName == "LineStyle")
- {
- aRet = uno::makeAny(meLineStyle);
- }
- else if(rName == "LineColor")
- {
- aRet <<= maLineColor;
- }
- else if(rName == "LineTransparence")
- {
- aRet <<= mnLineTransparence;
- }
- else if(rName == "LineJoint")
- {
- aRet <<= meLineJoint;
- }
- return aRet;
-}
-
-void LineProperties::setPropertyValue(const OUString& rName, const uno::Any& rAny)
-{
- if(rName == "LineDashName")
- {
- rAny >>= maDashName;
- }
- else if(rName == "LineDash")
- {
- rAny >>= maLineDash;
- }
- else if(rName == "LineWidth")
- {
- rAny >>= mnLineWidth;
- }
- else if(rName == "LineStyle")
- {
- rAny >>= meLineStyle;
- }
- else if(rName == "LineColor")
- {
- rAny >>= maLineColor;
- }
- else if(rName == "LineTransparence")
- {
- rAny >>= mnLineTransparence;
- }
- else if(rName == "LineJoint")
- {
- rAny >>= meLineJoint;
- }
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */