[Libreoffice-commits] core.git: 11 commits - chart2/Library_chartcore.mk chart2/Module_chart2.mk chart2/qa chart2/source xmloff/inc xmloff/source
Markus Mohrhard
markus.mohrhard at googlemail.com
Mon Apr 22 04:59:13 PDT 2013
chart2/Library_chartcore.mk | 1
chart2/Module_chart2.mk | 5
chart2/qa/extras/data/ods/error_bar_simple.ods |binary
chart2/source/controller/chartapiwrapper/AreaWrapper.cxx | 4
chart2/source/controller/chartapiwrapper/AxisWrapper.cxx | 4
chart2/source/controller/chartapiwrapper/DataSeriesPointWrapper.cxx | 4
chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx | 4
chart2/source/controller/chartapiwrapper/GridWrapper.cxx | 4
chart2/source/controller/chartapiwrapper/LegendWrapper.cxx | 4
chart2/source/controller/chartapiwrapper/MinMaxLineWrapper.cxx | 6
chart2/source/controller/chartapiwrapper/TitleWrapper.cxx | 4
chart2/source/controller/chartapiwrapper/UpDownBarWrapper.cxx | 6
chart2/source/controller/chartapiwrapper/WallFloorWrapper.cxx | 4
chart2/source/inc/ErrorBar.hxx | 70 +
chart2/source/inc/LineProperties.hxx | 71 -
chart2/source/inc/LinePropertiesHelper.hxx | 71 +
chart2/source/model/main/Axis.cxx | 10
chart2/source/model/main/ChartModel_Persistence.cxx | 2
chart2/source/model/main/DataPointProperties.cxx | 18
chart2/source/model/main/GridProperties.cxx | 8
chart2/source/model/main/Legend.cxx | 6
chart2/source/model/main/PageBackground.cxx | 8
chart2/source/model/main/StockBar.cxx | 8
chart2/source/model/main/Title.cxx | 8
chart2/source/model/main/Wall.cxx | 8
chart2/source/tools/AxisHelper.cxx | 10
chart2/source/tools/ErrorBar.cxx | 433 ++++++----
chart2/source/tools/LineProperties.cxx | 200 +---
chart2/source/tools/LinePropertiesHelper.cxx | 174 ++++
chart2/source/tools/RegressionCurveModel.cxx | 8
chart2/source/tools/RegressionEquation.cxx | 8
xmloff/inc/XMLChartPropertySetMapper.hxx | 4
xmloff/source/chart/PropertyMap.hxx | 41
xmloff/source/chart/PropertyMaps.cxx | 37
xmloff/source/chart/SchXMLExport.cxx | 22
35 files changed, 790 insertions(+), 485 deletions(-)
New commits:
commit c5cca8e48f4af440c4814cbaf672d5b4af167bc8
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Mon Apr 22 13:52:17 2013 +0200
fix mismerge in PropertyMap.hxx
Change-Id: Ic8a0b81a9a44d8494ef1634e23b25fcb9423e7ff
diff --git a/xmloff/source/chart/PropertyMap.hxx b/xmloff/source/chart/PropertyMap.hxx
index 526e2b7..d1ec843 100644
--- a/xmloff/source/chart/PropertyMap.hxx
+++ b/xmloff/source/chart/PropertyMap.hxx
@@ -189,7 +189,7 @@ const XMLPropertyMapEntry aXMLChartPropMap[] =
MAP_SPECIAL_ODF12( "ErrorBarRangeNegative", CHART, XML_ERROR_LOWER_RANGE, XML_TYPE_STRING, XML_SCH_CONTEXT_SPECIAL_ERRORBAR_RANGE ), // export only
// errorbars properties (chart2)
- MAP_ENTRY_ODF_EXT( "Weigth", CHART, XML_ERROR_STANDARD_WEIGTH, XML_TYPE_DOUBLE),
+ MAP_ENTRY_ODF_EXT( "Weigth", CHART, XML_ERROR_STANDARD_WEIGHT, XML_TYPE_DOUBLE),
// series/data-point properties
MAP_SPECIAL( "DataCaption", CHART, XML_DATA_LABEL_NUMBER, XML_TYPE_NUMBER | MID_FLAG_MERGE_PROPERTY, XML_SCH_CONTEXT_SPECIAL_DATA_LABEL_NUMBER ), // convert one constant
commit 0adb6c7e1a1bc5b0e9f2df99961bf56cc6ae126d
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Mon Apr 22 10:40:03 2013 +0200
and now our test file can be also a valid ODF1.2 file
Change-Id: I5565829385c553b4b83c97f4a6f61b6764f88604
diff --git a/chart2/qa/extras/data/ods/error_bar_simple.ods b/chart2/qa/extras/data/ods/error_bar_simple.ods
index 1cf0df7..74704f6 100644
Binary files a/chart2/qa/extras/data/ods/error_bar_simple.ods and b/chart2/qa/extras/data/ods/error_bar_simple.ods differ
commit 171f11bfc9acf1ef4bcb43848c9ed4176c131a6b
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Mon Apr 22 10:38:46 2013 +0200
actually this test should be fine as slowcheck test
Change-Id: Ie6f65f1ea2bfc61c9575b88957e6062c2c51566e
diff --git a/chart2/Module_chart2.mk b/chart2/Module_chart2.mk
index bb38d2e..13e9f3b 100644
--- a/chart2/Module_chart2.mk
+++ b/chart2/Module_chart2.mk
@@ -16,8 +16,11 @@ $(eval $(call gb_Module_add_targets,chart2,\
UIConfig_chart2 \
))
-$(eval $(call gb_Module_add_subsequentcheck_targets,chart2,\
+$(eval $(call gb_Module_add_slowcheck_targets,chart2,\
CppunitTest_chart2_importtest \
+))
+
+$(eval $(call gb_Module_add_subsequentcheck_targets,chart2,\
JunitTest_chart2_unoapi \
))
commit 925e27014e31c83d26df90347301bb84c6c29cb8
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Mon Apr 22 10:35:33 2013 +0200
turn this nasty SAL_WARN into a SAL_INFO
Change-Id: I740c1ac683500a406539239f9e5bfe093be58e9b
diff --git a/chart2/source/model/main/ChartModel_Persistence.cxx b/chart2/source/model/main/ChartModel_Persistence.cxx
index 2984fdb..20753bf 100644
--- a/chart2/source/model/main/ChartModel_Persistence.cxx
+++ b/chart2/source/model/main/ChartModel_Persistence.cxx
@@ -172,7 +172,7 @@ Reference< document::XFilter > ChartModel::impl_createFilter(
xFilter.set(
m_xContext->getServiceManager()->createInstanceWithContext(
aFilterServiceName, m_xContext ), uno::UNO_QUERY_THROW );
- SAL_WARN("chart2", "Filter found for service " << aFilterServiceName );
+ SAL_INFO("chart2", "Filter found for service " << aFilterServiceName );
}
}
}
commit 97c6d4b050279699d88b6ef3df70b69b00eec945
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Mon Apr 22 10:34:40 2013 +0200
fix type mismatch
Change-Id: I5f8ae075c01cd78c38e6ab17a3f2c0b999c65012
diff --git a/chart2/source/inc/LineProperties.hxx b/chart2/source/inc/LineProperties.hxx
index bbbd391..f2b4d30 100644
--- a/chart2/source/inc/LineProperties.hxx
+++ b/chart2/source/inc/LineProperties.hxx
@@ -24,7 +24,7 @@ private:
sal_Int32 mnLineWidth;
com::sun::star::drawing::LineStyle meLineStyle;
com::sun::star::util::Color maLineColor;
- sal_uInt8 mnLineTransparence;
+ sal_Int16 mnLineTransparence;
com::sun::star::drawing::LineJoint meLineJoint;
public:
diff --git a/chart2/source/tools/ErrorBar.cxx b/chart2/source/tools/ErrorBar.cxx
index 557cbbb..a2dd95c 100644
--- a/chart2/source/tools/ErrorBar.cxx
+++ b/chart2/source/tools/ErrorBar.cxx
@@ -68,7 +68,7 @@ const SfxItemPropertySet* GetErrorBarPropertySet()
{MAP_CHAR_LEN("LineDash"),10,&getCppuType((drawing::LineDash*)0),0,0},
{MAP_CHAR_LEN("LineWidth"),11,&getCppuType((sal_Int32*)0),0,0},
{MAP_CHAR_LEN("LineColor"),12,&getCppuType((com::sun::star::util::Color*)0),0,0},
- {MAP_CHAR_LEN("LineTransparence"),13,&getCppuType((sal_uInt8*)0),0,0},
+ {MAP_CHAR_LEN("LineTransparence"),13,&getCppuType((sal_Int16*)0),0,0},
{MAP_CHAR_LEN("LineJoint"),14,&getCppuType((com::sun::star::drawing::LineJoint*)0),0,0},
{0,0,0,0,0,0}
};
commit 13861b853fd707c9f288197302fb76db32c8dc66
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Mon Apr 22 10:22:42 2013 +0200
get the handling of error bar ranges correct in xmloff
We finally produce valid files again for error bars export. Additionally
we don't export unnecessary attributes anymore.
Change-Id: Idc4b4259c47a945e3679dac1a9810cd9f1f05bac
diff --git a/xmloff/inc/XMLChartPropertySetMapper.hxx b/xmloff/inc/XMLChartPropertySetMapper.hxx
index 1c5db01..b5655c0 100644
--- a/xmloff/inc/XMLChartPropertySetMapper.hxx
+++ b/xmloff/inc/XMLChartPropertySetMapper.hxx
@@ -61,6 +61,7 @@ private:
bool mbAdaptPercentage;
SvXMLExport& mrExport;
+ com::sun::star::uno::Reference< com::sun::star::chart2::XChartDocument > mxChartDoc;
protected:
virtual void ContextFilter(
@@ -89,6 +90,9 @@ public:
virtual ~XMLChartExportPropertyMapper();
void setAdaptPercentage( bool bNewValue );
+
+ void setChartDoc( com::sun::star::uno::Reference<
+ com::sun::star::chart2::XChartDocument > xChartDoc );
};
// ----------------------------------------
diff --git a/xmloff/source/chart/PropertyMap.hxx b/xmloff/source/chart/PropertyMap.hxx
index 3cb3b9d..526e2b7 100644
--- a/xmloff/source/chart/PropertyMap.hxx
+++ b/xmloff/source/chart/PropertyMap.hxx
@@ -82,6 +82,8 @@
#define XML_SCH_CONTEXT_SPECIAL_SYMBOL_IMAGE ( XML_SCH_CTF_START + 23 )
#define XML_SCH_CONTEXT_SPECIAL_LABEL_SEPARATOR ( XML_SCH_CTF_START + 24 )
+#define XML_SCH_CONTEXT_SPECIAL_ERRORBAR_RANGE ( XML_SCH_CTF_START + 25 )
+
#define MAP_FULL( ApiName, NameSpace, XMLTokenName, XMLType, ContextId, EarliestODFVersionForExport ) { ApiName, sizeof(ApiName)-1, XML_NAMESPACE_##NameSpace, xmloff::token::XMLTokenName, XMLType|XML_TYPE_PROP_CHART, ContextId, EarliestODFVersionForExport }
#define MAP_ENTRY( a, ns, nm, t ) { a, sizeof(a)-1, XML_NAMESPACE_##ns, xmloff::token::nm, t|XML_TYPE_PROP_CHART, 0, SvtSaveOptions::ODFVER_010 }
#define MAP_ENTRY_ODF12( a, ns, nm, t ) { a, sizeof(a)-1, XML_NAMESPACE_##ns, xmloff::token::nm, t|XML_TYPE_PROP_CHART, 0, SvtSaveOptions::ODFVER_012 }
@@ -183,8 +185,8 @@ const XMLPropertyMapEntry aXMLChartPropMap[] =
MAP_ENTRY( "ErrorBarStyle", CHART, XML_ERROR_CATEGORY, XML_SCH_TYPE_ERROR_BAR_STYLE ),
MAP_ENTRY( "PercentageError", CHART, XML_ERROR_PERCENTAGE, XML_TYPE_DOUBLE ),
MAP_ENTRY( "RegressionCurves", CHART, XML_REGRESSION_TYPE, XML_SCH_TYPE_REGRESSION_TYPE ),
- MAP_ENTRY_ODF12( "ErrorBarRangePositive", CHART, XML_ERROR_UPPER_RANGE, XML_TYPE_STRING ), // export only
- MAP_ENTRY_ODF12( "ErrorBarRangeNegative", CHART, XML_ERROR_LOWER_RANGE, XML_TYPE_STRING ), // export only
+ MAP_SPECIAL_ODF12( "ErrorBarRangePositive", CHART, XML_ERROR_UPPER_RANGE, XML_TYPE_STRING, XML_SCH_CONTEXT_SPECIAL_ERRORBAR_RANGE ), // export only
+ MAP_SPECIAL_ODF12( "ErrorBarRangeNegative", CHART, XML_ERROR_LOWER_RANGE, XML_TYPE_STRING, XML_SCH_CONTEXT_SPECIAL_ERRORBAR_RANGE ), // export only
// errorbars properties (chart2)
MAP_ENTRY_ODF_EXT( "Weigth", CHART, XML_ERROR_STANDARD_WEIGTH, XML_TYPE_DOUBLE),
diff --git a/xmloff/source/chart/PropertyMaps.cxx b/xmloff/source/chart/PropertyMaps.cxx
index b6590c0..9962a09d 100644
--- a/xmloff/source/chart/PropertyMaps.cxx
+++ b/xmloff/source/chart/PropertyMaps.cxx
@@ -52,6 +52,8 @@
#include <com/sun/star/drawing/LineJoint.hpp>
#include <com/sun/star/chart/ChartDataRowSource.hpp>
#include <com/sun/star/chart/ChartAxisPosition.hpp>
+#include <com/sun/star/chart2/XChartDocument.hpp>
+#include <com/sun/star/chart2/data/XRangeXMLConversion.hpp>
// header for any2enum
#include <comphelper/extract.hxx>
@@ -344,6 +346,22 @@ void XMLChartExportPropertyMapper::handleElementItem(
}
}
+namespace {
+
+OUString convertRange( const OUString & rRange, const uno::Reference< chart2::XChartDocument > & xDoc )
+{
+ OUString aResult = rRange;
+ if( !xDoc.is() )
+ return aResult;
+ uno::Reference< chart2::data::XRangeXMLConversion > xConversion(
+ xDoc->getDataProvider(), uno::UNO_QUERY );
+ if( xConversion.is())
+ aResult = xConversion->convertRangeToXML( rRange );
+ return aResult;
+}
+
+}
+
void XMLChartExportPropertyMapper::handleSpecialItem(
SvXMLAttributeList& rAttrList, const XMLPropertyState& rProperty,
const SvXMLUnitConverter& rUnitConverter,
@@ -440,6 +458,14 @@ void XMLChartExportPropertyMapper::handleSpecialItem(
break;
}
+ case XML_SCH_CONTEXT_SPECIAL_ERRORBAR_RANGE:
+ {
+ OUString aRangeStr;
+ rProperty.maValue >>= aRangeStr;
+ sValueBuffer.append(convertRange(aRangeStr, mxChartDoc));
+ }
+ break;
+
default:
bHandled = sal_False;
break;
@@ -460,6 +486,11 @@ void XMLChartExportPropertyMapper::handleSpecialItem(
}
}
+void XMLChartExportPropertyMapper::setChartDoc( uno::Reference< chart2::XChartDocument > xChartDoc )
+{
+ mxChartDoc = xChartDoc;
+}
+
// ----------------------------------------
XMLChartImportPropertyMapper::XMLChartImportPropertyMapper( const UniReference< XMLPropertySetMapper >& rMapper,
@@ -582,6 +613,12 @@ bool XMLChartImportPropertyMapper::handleSpecialItem(
}
break;
+ case XML_SCH_CONTEXT_SPECIAL_ERRORBAR_RANGE:
+ {
+ rProperty.maValue <<= rValue;
+ }
+ break;
+
// deprecated from 6.0 beta on
case XML_SCH_CONTEXT_SPECIAL_SYMBOL_IMAGE_NAME:
rProperty.maValue <<= mrImport.ResolveGraphicObjectURL( rValue, sal_False );
diff --git a/xmloff/source/chart/SchXMLExport.cxx b/xmloff/source/chart/SchXMLExport.cxx
index 22dc3ac..0b44488 100644
--- a/xmloff/source/chart/SchXMLExport.cxx
+++ b/xmloff/source/chart/SchXMLExport.cxx
@@ -1145,6 +1145,8 @@ void SchXMLExportHelper_Impl::parseDocument( Reference< chart::XChartDocument >&
return;
}
+ mxExpPropMapper->setChartDoc(xNewDoc);
+
awt::Size aPageSize( getPageSize( xNewDoc ));
if( bExportContent )
addSize( aPageSize );
@@ -3069,26 +3071,6 @@ void SchXMLExportHelper_Impl::exportErrorBar( const Reference<beans::XPropertySe
for( ::std::vector< Reference< chart2::data::XDataSequence > >::const_iterator aIt(
aErrorBarSequences.begin()); aIt != aErrorBarSequences.end(); ++aIt )
{
- if ( nCurrentVersion > SvtSaveOptions::ODFVER_012 )
- {
- OUString aRole, aRange;
- Reference< beans::XPropertySet > xSeqProp( *aIt, uno::UNO_QUERY_THROW );
- xSeqProp->getPropertyValue("Role") >>= aRole;
-
- aRange = lcl_ConvertRange((*aIt)->getSourceRangeRepresentation(), xNewDoc );
-
- if ( aRole.indexOf("positive") != -1 )
- {
- if ( bPositive )
- mrExport.AddAttribute( XML_NAMESPACE_CHART, XML_ERROR_UPPER_RANGE, aRange );
- }
- else
- {
- if ( bNegative )
- mrExport.AddAttribute( XML_NAMESPACE_CHART, XML_ERROR_LOWER_RANGE, aRange );
- }
- }
-
m_aDataSequencesToExport.push_back( tLabelValuesDataPair(
(uno::Reference< chart2::data::XDataSequence >)0, *aIt ));
}
commit 4475e4f3d94f312798dd90f8a8b861f981e0fd22
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Mon Apr 22 06:18:17 2013 +0200
more work on getting the error bar export produce valid docs
Change-Id: I19189e6be83dde58b4b3b7b55f40b701818eceed
diff --git a/chart2/source/inc/ErrorBar.hxx b/chart2/source/inc/ErrorBar.hxx
index dee86ea..25e860d 100644
--- a/chart2/source/inc/ErrorBar.hxx
+++ b/chart2/source/inc/ErrorBar.hxx
@@ -25,7 +25,7 @@
#include "charttoolsdllapi.hxx"
#include "LineProperties.hxx"
-#include <cppuhelper/implbase7.hxx>
+#include <cppuhelper/implbase8.hxx>
#include <comphelper/uno3.hxx>
#include <com/sun/star/uno/XComponentContext.hpp>
@@ -36,6 +36,7 @@
#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>
namespace chart
@@ -47,14 +48,15 @@ OOO_DLLPUBLIC_CHARTTOOLS ::com::sun::star::uno::Reference< ::com::sun::star::
namespace impl
{
-typedef ::cppu::WeakImplHelper7<
+typedef ::cppu::WeakImplHelper8<
::com::sun::star::lang::XServiceInfo,
::com::sun::star::util::XCloneable,
::com::sun::star::util::XModifyBroadcaster,
::com::sun::star::util::XModifyListener,
::com::sun::star::chart2::data::XDataSource,
::com::sun::star::chart2::data::XDataSink,
- ::com::sun::star::beans::XPropertySet >
+ ::com::sun::star::beans::XPropertySet,
+ ::com::sun::star::beans::XPropertyState >
ErrorBar_Base;
}
@@ -87,18 +89,29 @@ public:
virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL
getPropertySetInfo() throw (::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL setPropertyValue( const OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue )
- throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const OUString& PropertyName )
- throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL addPropertyChangeListener( const OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& xListener )
- throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL removePropertyChangeListener( const OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& aListener )
- throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL addVetoableChangeListener( const OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener )
throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL removeVetoableChangeListener( const OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener )
throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ // XPropertyState
+ virtual com::sun::star::beans::PropertyState SAL_CALL getPropertyState( const OUString& rPropName )
+ throw (com::sun::star::beans::UnknownPropertyException);
+ virtual com::sun::star::uno::Sequence< com::sun::star::beans::PropertyState > SAL_CALL getPropertyStates(
+ const com::sun::star::uno::Sequence< OUString >& rPropNames )
+ throw (com::sun::star::beans::UnknownPropertyException);
+ virtual void SAL_CALL setPropertyToDefault( const OUString& rPropName )
+ throw (com::sun::star::beans::UnknownPropertyException);
+ virtual com::sun::star::uno::Any SAL_CALL getPropertyDefault( const OUString& rPropName )
+ throw (com::sun::star::beans::UnknownPropertyException, com::sun::star::lang::WrappedTargetException);
+
protected:
ErrorBar( const ErrorBar & rOther );
diff --git a/chart2/source/inc/LineProperties.hxx b/chart2/source/inc/LineProperties.hxx
index 5df0372..bbbd391 100644
--- a/chart2/source/inc/LineProperties.hxx
+++ b/chart2/source/inc/LineProperties.hxx
@@ -13,12 +13,14 @@
#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;
+ com::sun::star::drawing::LineDash maLineDash;
sal_Int32 mnLineWidth;
com::sun::star::drawing::LineStyle meLineStyle;
com::sun::star::util::Color maLineColor;
diff --git a/chart2/source/tools/ErrorBar.cxx b/chart2/source/tools/ErrorBar.cxx
index c42d764..557cbbb 100644
--- a/chart2/source/tools/ErrorBar.cxx
+++ b/chart2/source/tools/ErrorBar.cxx
@@ -58,14 +58,18 @@ const SfxItemPropertySet* GetErrorBarPropertySet()
{MAP_CHAR_LEN("ShowNegativeError"),1,&getBooleanCppuType(), 0, 0},
{MAP_CHAR_LEN("PositiveError"),2,&getCppuType((const double*)0),0,0},
{MAP_CHAR_LEN("NegativeError"),3,&getCppuType((const double*)0), 0, 0},
- {MAP_CHAR_LEN("ErrorBarStyle"),4,&getCppuType((sal_Int32*)0),0,0},
- {MAP_CHAR_LEN("Weight"),5,&getCppuType((const double*)0),0,0},
- {MAP_CHAR_LEN("LineStyle"),7,&getCppuType((com::sun::star::drawing::LineStyle*)0),0,0},
- {MAP_CHAR_LEN("LineDashName"),7,&getCppuType((OUString*)0),0,0},
- {MAP_CHAR_LEN("LineWidth"),7,&getCppuType((sal_Int32*)0),0,0},
- {MAP_CHAR_LEN("LineColor"),7,&getCppuType((com::sun::star::util::Color*)0),0,0},
- {MAP_CHAR_LEN("LineTransparence"),7,&getCppuType((sal_uInt8*)0),0,0},
- {MAP_CHAR_LEN("LineJoint"),7,&getCppuType((com::sun::star::drawing::LineJoint*)0),0,0},
+ {MAP_CHAR_LEN("PercentageError"),4,&getCppuType((const double*)0), 0, 0},
+ {MAP_CHAR_LEN("ErrorBarStyle"),5,&getCppuType((sal_Int32*)0),0,0},
+ {MAP_CHAR_LEN("ErrorBarRangePositive"),6,&getCppuType((OUString*)0),0,0}, // read-only for export
+ {MAP_CHAR_LEN("ErrorBarRangeNegative"),7,&getCppuType((OUString*)0),0,0}, // read-only for export
+ {MAP_CHAR_LEN("Weight"),8,&getCppuType((const double*)0),0,0},
+ {MAP_CHAR_LEN("LineStyle"),9,&getCppuType((com::sun::star::drawing::LineStyle*)0),0,0},
+ {MAP_CHAR_LEN("LineDashName"),10,&getCppuType((OUString*)0),0,0},
+ {MAP_CHAR_LEN("LineDash"),10,&getCppuType((drawing::LineDash*)0),0,0},
+ {MAP_CHAR_LEN("LineWidth"),11,&getCppuType((sal_Int32*)0),0,0},
+ {MAP_CHAR_LEN("LineColor"),12,&getCppuType((com::sun::star::util::Color*)0),0,0},
+ {MAP_CHAR_LEN("LineTransparence"),13,&getCppuType((sal_uInt8*)0),0,0},
+ {MAP_CHAR_LEN("LineJoint"),14,&getCppuType((com::sun::star::drawing::LineJoint*)0),0,0},
{0,0,0,0,0,0}
};
static SfxItemPropertySet aPropSet( aErrorBarPropertyMap_Impl );
@@ -143,18 +147,66 @@ void ErrorBar::setPropertyValue( const OUString& rPropName, const uno::Any& rAny
rAny >>= meStyle;
else if(rPropName == "PositiveError")
rAny >>= mfPositiveError;
+ else if(rPropName == "PercentageError")
+ {
+ rAny >>= mfPositiveError;
+ rAny >>= mfNegativeError;
+ }
else if(rPropName == "NegativeError")
rAny >>= mfNegativeError;
else if(rPropName == "ShowPositiveError")
rAny >>= mbShowPositiveError;
else if(rPropName == "ShowNegativeError")
rAny >>= mbShowNegativeError;
+ else if(rPropName == "ErrorBarRangePositive" || rPropName == "ErrorBarRangeNegative")
+ throw uno::RuntimeException("read-only property", static_cast< uno::XWeak*>(this));
else
LineProperties::setPropertyValue(rPropName, rAny);
m_xModifyEventForwarder->modified( lang::EventObject( static_cast< uno::XWeak* >( this )));
}
+namespace {
+
+OUString getSourceRangeStrFromLabeledSequences( uno::Sequence< uno::Reference< chart2::data::XLabeledDataSequence > > aSequences, bool bPositive )
+{
+ const OUString aRolePrefix( "error-bars" );
+ OUString aDirection;
+ if(bPositive)
+ aDirection = "positive";
+ else
+ aDirection = "negative";
+
+ for( sal_Int32 nI=0; nI< aSequences.getLength(); ++nI )
+ {
+ try
+ {
+ if( aSequences[nI].is())
+ {
+ uno::Reference< chart2::data::XDataSequence > xSequence( aSequences[nI]->getValues());
+ uno::Reference< beans::XPropertySet > xSeqProp( xSequence, uno::UNO_QUERY_THROW );
+ OUString aRole;
+ if( ( xSeqProp->getPropertyValue(
+ OUString( "Role" )) >>= aRole ) &&
+ aRole.match( aRolePrefix ) && aRole.indexOf(aDirection) >= 0 )
+ {
+ return xSequence->getSourceRangeRepresentation();
+ }
+ }
+ }
+ catch (...)
+ {
+ // we can't be sure that this is 100% safe and we don't want to kill the export
+ // we should at least check why the exception is thrown
+ SAL_WARN("chart2", "unexpected exception!");
+ }
+ }
+
+ return OUString();
+}
+
+}
+
uno::Any ErrorBar::getPropertyValue(const OUString& rPropName)
throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
{
@@ -165,16 +217,140 @@ uno::Any ErrorBar::getPropertyValue(const OUString& rPropName)
aRet <<= mfPositiveError;
else if(rPropName == "NegativeError")
aRet <<= mfNegativeError;
+ else if(rPropName == "PercentageError")
+ aRet <<= mfPositiveError;
else if(rPropName == "ShowPositiveError")
aRet <<= mbShowPositiveError;
else if(rPropName == "ShowNegativeError")
aRet <<= mbShowNegativeError;
+ else if(rPropName == "ErrorBarRangePositive")
+ {
+ OUString aRange;
+ if(meStyle == com::sun::star::chart::ErrorBarStyle::FROM_DATA)
+ {
+ uno::Sequence< uno::Reference< chart2::data::XLabeledDataSequence > > aSequences =
+ getDataSequences();
+
+ aRange = getSourceRangeStrFromLabeledSequences( aSequences, true );
+ }
+
+ aRet <<= aRange;
+ }
+ else if(rPropName == "ErrorBarRangeNegative")
+ {
+ OUString aRange;
+ if(meStyle == com::sun::star::chart::ErrorBarStyle::FROM_DATA)
+ {
+ uno::Sequence< uno::Reference< chart2::data::XLabeledDataSequence > > aSequences =
+ getDataSequences();
+
+ aRange = getSourceRangeStrFromLabeledSequences( aSequences, true );
+ }
+
+ aRet <<= aRange;
+ }
else
aRet = LineProperties::getPropertyValue(rPropName);
+
SAL_WARN_IF(!aRet.hasValue(), "chart2", "asked for property value: " << rPropName);
return aRet;
}
+beans::PropertyState ErrorBar::getPropertyState( const OUString& rPropName )
+ throw (com::sun::star::beans::UnknownPropertyException)
+{
+ if(rPropName == "ErrorBarStyle")
+ {
+ if(meStyle == com::sun::star::chart::ErrorBarStyle::NONE)
+ return beans::PropertyState_DEFAULT_VALUE;
+ return beans::PropertyState_DIRECT_VALUE;
+ }
+ else if(rPropName == "PositiveError")
+ {
+ if(mbShowPositiveError)
+ {
+ switch(meStyle)
+ {
+ case com::sun::star::chart::ErrorBarStyle::ABSOLUTE:
+ case com::sun::star::chart::ErrorBarStyle::ERROR_MARGIN:
+ return beans::PropertyState_DIRECT_VALUE;
+ default:
+ break;
+ }
+ }
+ return beans::PropertyState_DEFAULT_VALUE;
+ }
+ else if(rPropName == "NegativeError")
+ {
+ if(mbShowNegativeError)
+ {
+ switch(meStyle)
+ {
+ case com::sun::star::chart::ErrorBarStyle::ABSOLUTE:
+ case com::sun::star::chart::ErrorBarStyle::ERROR_MARGIN:
+ return beans::PropertyState_DIRECT_VALUE;
+ default:
+ break;
+ }
+ }
+ return beans::PropertyState_DEFAULT_VALUE;
+ }
+ else if(rPropName == "PercentageError")
+ {
+ if(meStyle != com::sun::star::chart::ErrorBarStyle::RELATIVE)
+ return beans::PropertyState_DEFAULT_VALUE;
+ return beans::PropertyState_DIRECT_VALUE;
+ }
+ else if(rPropName == "ShowPositiveError")
+ {
+ // this value should be never default
+ return beans::PropertyState_DIRECT_VALUE;
+ }
+ else if(rPropName == "ShowNegativeError")
+ {
+ // this value should be never default
+ return beans::PropertyState_DIRECT_VALUE;
+ }
+ else if(rPropName == "ErrorBarRangePositive")
+ {
+ if(meStyle == com::sun::star::chart::ErrorBarStyle::FROM_DATA && mbShowPositiveError)
+ return beans::PropertyState_DIRECT_VALUE;
+ return beans::PropertyState_DEFAULT_VALUE;
+ }
+ else if(rPropName == "ErrorBarRangeNegative")
+ {
+ if(meStyle == com::sun::star::chart::ErrorBarStyle::FROM_DATA && mbShowNegativeError)
+ return beans::PropertyState_DIRECT_VALUE;
+ return beans::PropertyState_DEFAULT_VALUE;
+ }
+ else
+ return beans::PropertyState_DIRECT_VALUE;
+}
+
+uno::Sequence< beans::PropertyState > ErrorBar::getPropertyStates( const uno::Sequence< OUString >& rPropNames )
+ throw (com::sun::star::beans::UnknownPropertyException)
+{
+ uno::Sequence< beans::PropertyState > aRet( rPropNames.getLength() );
+ for(sal_Int32 i = 0; i < rPropNames.getLength(); ++i)
+ {
+ aRet[i] = getPropertyState(rPropNames[i]);
+ }
+ return aRet;
+}
+
+void ErrorBar::setPropertyToDefault( const OUString& )
+ throw (beans::UnknownPropertyException)
+{
+ //keep them unimplemented for now
+}
+
+uno::Any ErrorBar::getPropertyDefault( const OUString& )
+ throw (beans::UnknownPropertyException, lang::WrappedTargetException)
+{
+ //keep them unimplemented for now
+ return uno::Any();
+}
+
void ErrorBar::addPropertyChangeListener( const OUString&, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& )
throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException)
{
diff --git a/chart2/source/tools/LineProperties.cxx b/chart2/source/tools/LineProperties.cxx
index c7c9477..443704f 100644
--- a/chart2/source/tools/LineProperties.cxx
+++ b/chart2/source/tools/LineProperties.cxx
@@ -22,6 +22,7 @@ LineProperties::LineProperties():
LineProperties::LineProperties(const LineProperties& r):
maDashName(r.maDashName),
+ maLineDash(r.maLineDash),
mnLineWidth(r.mnLineWidth),
meLineStyle(r.meLineStyle),
maLineColor(r.maLineColor),
@@ -33,10 +34,14 @@ LineProperties::LineProperties(const LineProperties& r):
uno::Any LineProperties::getPropertyValue(const OUString& rName)
{
uno::Any aRet;
- if(rName == "DashName")
+ if(rName == "LineDashName")
{
aRet <<= maDashName;
}
+ else if(rName == "LineDash")
+ {
+ aRet <<= maLineDash;
+ }
else if(rName == "LineWidth")
{
aRet <<= mnLineWidth;
@@ -62,10 +67,14 @@ uno::Any LineProperties::getPropertyValue(const OUString& rName)
void LineProperties::setPropertyValue(const OUString& rName, const uno::Any& rAny)
{
- if(rName == "DashName")
+ if(rName == "LineDashName")
{
rAny >>= maDashName;
}
+ else if(rName == "LineDash")
+ {
+ rAny >>= maLineDash;
+ }
else if(rName == "LineWidth")
{
rAny >>= mnLineWidth;
diff --git a/xmloff/source/chart/PropertyMap.hxx b/xmloff/source/chart/PropertyMap.hxx
index b4344a7..3cb3b9d 100644
--- a/xmloff/source/chart/PropertyMap.hxx
+++ b/xmloff/source/chart/PropertyMap.hxx
@@ -183,8 +183,8 @@ const XMLPropertyMapEntry aXMLChartPropMap[] =
MAP_ENTRY( "ErrorBarStyle", CHART, XML_ERROR_CATEGORY, XML_SCH_TYPE_ERROR_BAR_STYLE ),
MAP_ENTRY( "PercentageError", CHART, XML_ERROR_PERCENTAGE, XML_TYPE_DOUBLE ),
MAP_ENTRY( "RegressionCurves", CHART, XML_REGRESSION_TYPE, XML_SCH_TYPE_REGRESSION_TYPE ),
- MAP_ENTRY_ODF12( "ErrorBarRangePositive", CHART, XML_ERROR_UPPER_RANGE, XML_TYPE_STRING ),
- MAP_ENTRY_ODF12( "ErrorBarRangeNegative", CHART, XML_ERROR_LOWER_RANGE, XML_TYPE_STRING ),
+ MAP_ENTRY_ODF12( "ErrorBarRangePositive", CHART, XML_ERROR_UPPER_RANGE, XML_TYPE_STRING ), // export only
+ MAP_ENTRY_ODF12( "ErrorBarRangeNegative", CHART, XML_ERROR_LOWER_RANGE, XML_TYPE_STRING ), // export only
// errorbars properties (chart2)
MAP_ENTRY_ODF_EXT( "Weigth", CHART, XML_ERROR_STANDARD_WEIGTH, XML_TYPE_DOUBLE),
commit f6bf4933e18bc4ef1173c821cb2f9dbce0b452f0
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Sun Apr 21 10:31:55 2013 +0200
bring some sense into the error bar mappings for styles export
There were several properties that were duplicated for the X error bars
but where effectively not used by the code as these properties did not
work.
We now specify only one used entry from the chart2 API and remove the
entries from the old chart API. As soon as the old chart API is unused
in the import/export filter we can deprecate it.
Change-Id: Ib0487b41ea044136714037c27418ce049a5b92b7
diff --git a/xmloff/source/chart/PropertyMap.hxx b/xmloff/source/chart/PropertyMap.hxx
index 512d116..b4344a7 100644
--- a/xmloff/source/chart/PropertyMap.hxx
+++ b/xmloff/source/chart/PropertyMap.hxx
@@ -174,15 +174,12 @@ const XMLPropertyMapEntry aXMLChartPropMap[] =
// statistical properties
- MAP_ENTRY_ODF_EXT( "ShowPositiveError", CHART, XML_ERROR_UPPER_INDICATOR, XML_TYPE_BOOL),
- MAP_ENTRY_ODF_EXT( "ShowNegativeError", CHART, XML_ERROR_LOWER_INDICATOR, XML_TYPE_BOOL),
-
MAP_ENTRY( "MeanValue", CHART, XML_MEAN_VALUE, XML_TYPE_BOOL ),
MAP_ENTRY( "ErrorMargin", CHART, XML_ERROR_MARGIN, XML_TYPE_DOUBLE ),
- MAP_ENTRY( "ConstantErrorLow", CHART, XML_ERROR_LOWER_LIMIT, XML_TYPE_DOUBLE ),
- MAP_ENTRY( "ConstantErrorHigh", CHART, XML_ERROR_UPPER_LIMIT, XML_TYPE_DOUBLE ),
- MAP_ENTRY( "ErrorIndicator", CHART, XML_ERROR_UPPER_INDICATOR, XML_SCH_TYPE_ERROR_INDICATOR_UPPER | MID_FLAG_MERGE_PROPERTY ), // convert one constant
- MAP_ENTRY( "ErrorIndicator", CHART, XML_ERROR_LOWER_INDICATOR, XML_SCH_TYPE_ERROR_INDICATOR_LOWER | MID_FLAG_MERGE_PROPERTY ), // to two bools
+ MAP_ENTRY( "PositiveError", CHART, XML_ERROR_LOWER_LIMIT, XML_TYPE_DOUBLE),
+ MAP_ENTRY( "NegativeError", CHART, XML_ERROR_UPPER_LIMIT, XML_TYPE_DOUBLE),
+ MAP_ENTRY( "ShowPositiveError", CHART, XML_ERROR_UPPER_INDICATOR, XML_TYPE_BOOL),
+ MAP_ENTRY( "ShowNegativeError", CHART, XML_ERROR_LOWER_INDICATOR, XML_TYPE_BOOL),
MAP_ENTRY( "ErrorBarStyle", CHART, XML_ERROR_CATEGORY, XML_SCH_TYPE_ERROR_BAR_STYLE ),
MAP_ENTRY( "PercentageError", CHART, XML_ERROR_PERCENTAGE, XML_TYPE_DOUBLE ),
MAP_ENTRY( "RegressionCurves", CHART, XML_REGRESSION_TYPE, XML_SCH_TYPE_REGRESSION_TYPE ),
@@ -190,9 +187,7 @@ const XMLPropertyMapEntry aXMLChartPropMap[] =
MAP_ENTRY_ODF12( "ErrorBarRangeNegative", CHART, XML_ERROR_LOWER_RANGE, XML_TYPE_STRING ),
// errorbars properties (chart2)
- MAP_ENTRY_ODF_EXT( "PositiveError", CHART, XML_ERROR_LOWER_LIMIT, XML_TYPE_DOUBLE),
- MAP_ENTRY_ODF_EXT( "NegativeError", CHART, XML_ERROR_UPPER_LIMIT, XML_TYPE_DOUBLE),
- MAP_ENTRY_ODF_EXT( "Weight", CHART, XML_ERROR_STANDARD_WEIGHT, XML_TYPE_DOUBLE),
+ MAP_ENTRY_ODF_EXT( "Weigth", CHART, XML_ERROR_STANDARD_WEIGTH, XML_TYPE_DOUBLE),
// series/data-point properties
MAP_SPECIAL( "DataCaption", CHART, XML_DATA_LABEL_NUMBER, XML_TYPE_NUMBER | MID_FLAG_MERGE_PROPERTY, XML_SCH_CONTEXT_SPECIAL_DATA_LABEL_NUMBER ), // convert one constant
commit 63f7b9d1a3b67781512b830ab9f4ca3cb361940c
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Sun Apr 21 09:31:20 2013 +0200
little formatting clean-up
Change-Id: I3f30e2b69933f740a9938ac1ed93e7f7727b78bc
diff --git a/xmloff/source/chart/PropertyMap.hxx b/xmloff/source/chart/PropertyMap.hxx
index e924b7f..512d116 100644
--- a/xmloff/source/chart/PropertyMap.hxx
+++ b/xmloff/source/chart/PropertyMap.hxx
@@ -106,7 +106,7 @@ const XMLPropertyMapEntry aXMLChartPropMap[] =
{
// chart subtypes
MAP_ENTRY( "UpDown", CHART, XML_JAPANESE_CANDLE_STICK, XML_TYPE_BOOL ), // formerly XML_STOCK_UPDOWN_BARS
- MAP_CONTEXT( "Volume", CHART, XML_STOCK_WITH_VOLUME, XML_TYPE_BOOL, XML_SCH_CONTEXT_STOCK_WITH_VOLUME ),
+ MAP_CONTEXT( "Volume", CHART, XML_STOCK_WITH_VOLUME, XML_TYPE_BOOL, XML_SCH_CONTEXT_STOCK_WITH_VOLUME ),
MAP_ENTRY( "Dim3D", CHART, XML_THREE_DIMENSIONAL, XML_TYPE_BOOL ),
MAP_ENTRY( "Deep", CHART, XML_DEEP, XML_TYPE_BOOL ),
MAP_ENTRY( "Lines", CHART, XML_LINES, XML_TYPE_BOOL ),
@@ -125,7 +125,7 @@ const XMLPropertyMapEntry aXMLChartPropMap[] =
MAP_ENTRY( "Vertical", CHART, XML_VERTICAL, XML_TYPE_BOOL ),
// #i32368# property should no longer be used as XML-property (in OASIS
// format), but is still ex-/imported for compatibility with the OOo file format
- MAP_CONTEXT( "NumberOfLines", CHART, XML_LINES_USED, XML_TYPE_NUMBER, XML_SCH_CONTEXT_LINES_USED ),
+ MAP_CONTEXT( "NumberOfLines", CHART, XML_LINES_USED, XML_TYPE_NUMBER, XML_SCH_CONTEXT_LINES_USED ),
MAP_ENTRY( "StackedBarsConnected", CHART, XML_CONNECT_BARS, XML_TYPE_BOOL ),
MAP_ENTRY_ODF12( "GroupBarsPerAxis", CHART, XML_GROUP_BARS_PER_AXIS, XML_TYPE_BOOL ),
@@ -156,7 +156,7 @@ const XMLPropertyMapEntry aXMLChartPropMap[] =
MAP_CONTEXT( "Max", CHART, XML_MAXIMUM, XML_TYPE_DOUBLE, XML_SCH_CONTEXT_MAX ),
MAP_CONTEXT( "Origin", CHART, XML_ORIGIN, XML_TYPE_DOUBLE, XML_SCH_CONTEXT_ORIGIN ),
MAP_CONTEXT( "StepMain", CHART, XML_INTERVAL_MAJOR, XML_TYPE_DOUBLE, XML_SCH_CONTEXT_STEP_MAIN ),
- MAP_CONTEXT( "StepHelpCount", CHART, XML_INTERVAL_MINOR_DIVISOR, XML_TYPE_NUMBER, XML_SCH_CONTEXT_STEP_HELP_COUNT ),
+ MAP_CONTEXT( "StepHelpCount", CHART, XML_INTERVAL_MINOR_DIVISOR, XML_TYPE_NUMBER, XML_SCH_CONTEXT_STEP_HELP_COUNT ),
MAP_ENTRY( "GapWidth", CHART, XML_GAP_WIDTH, XML_TYPE_NUMBER ),
MAP_ENTRY( "Overlap", CHART, XML_OVERLAP, XML_TYPE_NUMBER ),
MAP_ENTRY( "TextCanOverlap", CHART, XML_TEXT_OVERLAP, XML_TYPE_BOOL ),
@@ -167,10 +167,10 @@ const XMLPropertyMapEntry aXMLChartPropMap[] =
MAP_ENTRY( "LinkNumberFormatToSource", CHART, XML_LINK_DATA_STYLE_TO_SOURCE, XML_TYPE_BOOL ),
MAP_ENTRY( "Visible", CHART, XML_VISIBLE, XML_TYPE_BOOL ),
- MAP_FULL( "CrossoverPosition", CHART, XML_AXIS_POSITION, XML_SCH_TYPE_AXIS_POSITION|MID_FLAG_MERGE_ATTRIBUTE|MID_FLAG_MULTI_PROPERTY, 0, SvtSaveOptions::ODFVER_012 ),
- MAP_FULL( "CrossoverValue", CHART, XML_AXIS_POSITION, XML_SCH_TYPE_AXIS_POSITION_VALUE|MID_FLAG_MERGE_ATTRIBUTE|MID_FLAG_MULTI_PROPERTY, 0, SvtSaveOptions::ODFVER_012 ),
- MAP_FULL( "LabelPosition", CHART, XML_AXIS_LABEL_POSITION, XML_SCH_TYPE_AXIS_LABEL_POSITION, 0, SvtSaveOptions::ODFVER_012 ),
- MAP_FULL( "MarkPosition", CHART, XML_TICK_MARK_POSITION, XML_SCH_TYPE_TICK_MARK_POSITION, 0, SvtSaveOptions::ODFVER_012 ),
+ MAP_FULL( "CrossoverPosition", CHART, XML_AXIS_POSITION, XML_SCH_TYPE_AXIS_POSITION|MID_FLAG_MERGE_ATTRIBUTE|MID_FLAG_MULTI_PROPERTY, 0, SvtSaveOptions::ODFVER_012 ),
+ MAP_FULL( "CrossoverValue", CHART, XML_AXIS_POSITION, XML_SCH_TYPE_AXIS_POSITION_VALUE|MID_FLAG_MERGE_ATTRIBUTE|MID_FLAG_MULTI_PROPERTY, 0, SvtSaveOptions::ODFVER_012 ),
+ MAP_FULL( "LabelPosition", CHART, XML_AXIS_LABEL_POSITION, XML_SCH_TYPE_AXIS_LABEL_POSITION, 0, SvtSaveOptions::ODFVER_012 ),
+ MAP_FULL( "MarkPosition", CHART, XML_TICK_MARK_POSITION, XML_SCH_TYPE_TICK_MARK_POSITION, 0, SvtSaveOptions::ODFVER_012 ),
// statistical properties
@@ -183,11 +183,11 @@ const XMLPropertyMapEntry aXMLChartPropMap[] =
MAP_ENTRY( "ConstantErrorHigh", CHART, XML_ERROR_UPPER_LIMIT, XML_TYPE_DOUBLE ),
MAP_ENTRY( "ErrorIndicator", CHART, XML_ERROR_UPPER_INDICATOR, XML_SCH_TYPE_ERROR_INDICATOR_UPPER | MID_FLAG_MERGE_PROPERTY ), // convert one constant
MAP_ENTRY( "ErrorIndicator", CHART, XML_ERROR_LOWER_INDICATOR, XML_SCH_TYPE_ERROR_INDICATOR_LOWER | MID_FLAG_MERGE_PROPERTY ), // to two bools
- MAP_ENTRY( "ErrorBarStyle", CHART, XML_ERROR_CATEGORY, XML_SCH_TYPE_ERROR_BAR_STYLE ),
- MAP_ENTRY( "PercentageError", CHART, XML_ERROR_PERCENTAGE, XML_TYPE_DOUBLE ),
- MAP_ENTRY( "RegressionCurves", CHART, XML_REGRESSION_TYPE, XML_SCH_TYPE_REGRESSION_TYPE ),
- MAP_ENTRY_ODF12( "ErrorBarRangePositive", CHART, XML_ERROR_UPPER_RANGE, XML_TYPE_STRING ),
- MAP_ENTRY_ODF12( "ErrorBarRangeNegative", CHART, XML_ERROR_LOWER_RANGE, XML_TYPE_STRING ),
+ MAP_ENTRY( "ErrorBarStyle", CHART, XML_ERROR_CATEGORY, XML_SCH_TYPE_ERROR_BAR_STYLE ),
+ MAP_ENTRY( "PercentageError", CHART, XML_ERROR_PERCENTAGE, XML_TYPE_DOUBLE ),
+ MAP_ENTRY( "RegressionCurves", CHART, XML_REGRESSION_TYPE, XML_SCH_TYPE_REGRESSION_TYPE ),
+ MAP_ENTRY_ODF12( "ErrorBarRangePositive", CHART, XML_ERROR_UPPER_RANGE, XML_TYPE_STRING ),
+ MAP_ENTRY_ODF12( "ErrorBarRangeNegative", CHART, XML_ERROR_LOWER_RANGE, XML_TYPE_STRING ),
// errorbars properties (chart2)
MAP_ENTRY_ODF_EXT( "PositiveError", CHART, XML_ERROR_LOWER_LIMIT, XML_TYPE_DOUBLE),
commit 4a4bdc142ab7a41b69512d54302851e7fbb3100b
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Sun Apr 21 02:49:04 2013 +0200
fix the remaining issues with the changed handling of ErrorBar props
Change-Id: I75c839cbfccbe84e7aa98aef6959bcd0c5390ab6
diff --git a/chart2/Library_chartcore.mk b/chart2/Library_chartcore.mk
index 66fbfda..0a5db3f 100644
--- a/chart2/Library_chartcore.mk
+++ b/chart2/Library_chartcore.mk
@@ -185,6 +185,7 @@ $(eval $(call gb_Library_add_exception_objects,chartcore,\
chart2/source/tools/LegendHelper \
chart2/source/tools/LifeTime \
chart2/source/tools/LinearRegressionCurveCalculator \
+ chart2/source/tools/LinePropertiesHelper \
chart2/source/tools/LineProperties \
chart2/source/tools/LogarithmicRegressionCurveCalculator \
chart2/source/tools/MeanValueRegressionCurveCalculator \
diff --git a/chart2/source/controller/chartapiwrapper/AreaWrapper.cxx b/chart2/source/controller/chartapiwrapper/AreaWrapper.cxx
index cab6a30..e7c4b54 100644
--- a/chart2/source/controller/chartapiwrapper/AreaWrapper.cxx
+++ b/chart2/source/controller/chartapiwrapper/AreaWrapper.cxx
@@ -26,7 +26,7 @@
#include <comphelper/InlineContainer.hxx>
#include <com/sun/star/drawing/FillStyle.hpp>
-#include "LineProperties.hxx"
+#include "LinePropertiesHelper.hxx"
#include "FillProperties.hxx"
#include "UserDefinedProperties.hxx"
@@ -55,7 +55,7 @@ private:
Sequence< Property > lcl_GetPropertySequence()
{
::std::vector< ::com::sun::star::beans::Property > aProperties;
- ::chart::LineProperties::AddPropertiesToVector( aProperties );
+ ::chart::LinePropertiesHelper::AddPropertiesToVector( aProperties );
::chart::FillProperties::AddPropertiesToVector( aProperties );
::chart::UserDefinedProperties::AddPropertiesToVector( aProperties );
diff --git a/chart2/source/controller/chartapiwrapper/AxisWrapper.cxx b/chart2/source/controller/chartapiwrapper/AxisWrapper.cxx
index 0ca9408..89f4364 100644
--- a/chart2/source/controller/chartapiwrapper/AxisWrapper.cxx
+++ b/chart2/source/controller/chartapiwrapper/AxisWrapper.cxx
@@ -36,7 +36,7 @@
#include <com/sun/star/chart/ChartAxisMarkPosition.hpp>
#include "CharacterProperties.hxx"
-#include "LineProperties.hxx"
+#include "LinePropertiesHelper.hxx"
#include "UserDefinedProperties.hxx"
#include "WrappedCharacterHeightProperty.hxx"
#include "WrappedTextRotationProperty.hxx"
@@ -354,7 +354,7 @@ private:
::std::vector< ::com::sun::star::beans::Property > aProperties;
lcl_AddPropertiesToVector( aProperties );
::chart::CharacterProperties::AddPropertiesToVector( aProperties );
- ::chart::LineProperties::AddPropertiesToVector( aProperties );
+ ::chart::LinePropertiesHelper::AddPropertiesToVector( aProperties );
::chart::UserDefinedProperties::AddPropertiesToVector( aProperties );
::chart::wrapper::WrappedScaleTextProperties::addProperties( aProperties );
diff --git a/chart2/source/controller/chartapiwrapper/DataSeriesPointWrapper.cxx b/chart2/source/controller/chartapiwrapper/DataSeriesPointWrapper.cxx
index c605de0..2b37fec 100644
--- a/chart2/source/controller/chartapiwrapper/DataSeriesPointWrapper.cxx
+++ b/chart2/source/controller/chartapiwrapper/DataSeriesPointWrapper.cxx
@@ -25,7 +25,7 @@
#include "DiagramHelper.hxx"
#include "ContainerHelper.hxx"
#include "ChartModelHelper.hxx"
-#include "LineProperties.hxx"
+#include "LinePropertiesHelper.hxx"
#include "FillProperties.hxx"
#include "CharacterProperties.hxx"
#include "UserDefinedProperties.hxx"
@@ -174,7 +174,7 @@ uno::Sequence< Property > lcl_GetPropertySequence( DataSeriesPointWrapper::eType
WrappedDataCaptionProperties::addProperties( aProperties ); //for series and points
::chart::FillProperties::AddPropertiesToVector( aProperties );
- ::chart::LineProperties::AddPropertiesToVector( aProperties );
+ ::chart::LinePropertiesHelper::AddPropertiesToVector( aProperties );
::chart::CharacterProperties::AddPropertiesToVector( aProperties );
::chart::UserDefinedProperties::AddPropertiesToVector( aProperties );
::chart::wrapper::WrappedScaleTextProperties::addProperties( aProperties );
diff --git a/chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx b/chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx
index edb3289..8c31e58 100644
--- a/chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx
+++ b/chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx
@@ -55,7 +55,7 @@
#include <com/sun/star/chart2/RelativePosition.hpp>
#include <com/sun/star/chart/ChartSolidType.hpp>
-#include "LineProperties.hxx"
+#include "LinePropertiesHelper.hxx"
#include "FillProperties.hxx"
#include "UserDefinedProperties.hxx"
#include "SceneProperties.hxx"
@@ -430,7 +430,7 @@ private:
{
::std::vector< ::com::sun::star::beans::Property > aProperties;
lcl_AddPropertiesToVector( aProperties );
- ::chart::LineProperties::AddPropertiesToVector( aProperties );
+ ::chart::LinePropertiesHelper::AddPropertiesToVector( aProperties );
::chart::FillProperties::AddPropertiesToVector( aProperties );
::chart::UserDefinedProperties::AddPropertiesToVector( aProperties );
::chart::SceneProperties::AddPropertiesToVector( aProperties );
diff --git a/chart2/source/controller/chartapiwrapper/GridWrapper.cxx b/chart2/source/controller/chartapiwrapper/GridWrapper.cxx
index 4180e87..77f97d0 100644
--- a/chart2/source/controller/chartapiwrapper/GridWrapper.cxx
+++ b/chart2/source/controller/chartapiwrapper/GridWrapper.cxx
@@ -27,7 +27,7 @@
#include <comphelper/InlineContainer.hxx>
#include <com/sun/star/beans/PropertyAttribute.hpp>
-#include "LineProperties.hxx"
+#include "LinePropertiesHelper.hxx"
#include "UserDefinedProperties.hxx"
#include "WrappedDefaultProperty.hxx"
@@ -58,7 +58,7 @@ private:
Sequence< Property > lcl_GetPropertySequence()
{
::std::vector< ::com::sun::star::beans::Property > aProperties;
- ::chart::LineProperties::AddPropertiesToVector( aProperties );
+ ::chart::LinePropertiesHelper::AddPropertiesToVector( aProperties );
::chart::UserDefinedProperties::AddPropertiesToVector( aProperties );
::std::sort( aProperties.begin(), aProperties.end(),
diff --git a/chart2/source/controller/chartapiwrapper/LegendWrapper.cxx b/chart2/source/controller/chartapiwrapper/LegendWrapper.cxx
index 5638178..262ab9e 100644
--- a/chart2/source/controller/chartapiwrapper/LegendWrapper.cxx
+++ b/chart2/source/controller/chartapiwrapper/LegendWrapper.cxx
@@ -32,7 +32,7 @@
#include <com/sun/star/drawing/FillStyle.hpp>
#include "CharacterProperties.hxx"
-#include "LineProperties.hxx"
+#include "LinePropertiesHelper.hxx"
#include "FillProperties.hxx"
#include "UserDefinedProperties.hxx"
#include "WrappedCharacterHeightProperty.hxx"
@@ -253,7 +253,7 @@ private:
::std::vector< ::com::sun::star::beans::Property > aProperties;
lcl_AddPropertiesToVector( aProperties );
::chart::CharacterProperties::AddPropertiesToVector( aProperties );
- ::chart::LineProperties::AddPropertiesToVector( aProperties );
+ ::chart::LinePropertiesHelper::AddPropertiesToVector( aProperties );
::chart::FillProperties::AddPropertiesToVector( aProperties );
::chart::UserDefinedProperties::AddPropertiesToVector( aProperties );
::chart::wrapper::WrappedAutomaticPositionProperties::addProperties( aProperties );
diff --git a/chart2/source/controller/chartapiwrapper/MinMaxLineWrapper.cxx b/chart2/source/controller/chartapiwrapper/MinMaxLineWrapper.cxx
index ac10861..2c287e1 100644
--- a/chart2/source/controller/chartapiwrapper/MinMaxLineWrapper.cxx
+++ b/chart2/source/controller/chartapiwrapper/MinMaxLineWrapper.cxx
@@ -28,7 +28,7 @@
#include <com/sun/star/chart2/XDataSeriesContainer.hpp>
#include <com/sun/star/drawing/LineJoint.hpp>
-#include "LineProperties.hxx"
+#include "LinePropertiesHelper.hxx"
#include "UserDefinedProperties.hxx"
using namespace ::com::sun::star;
@@ -55,7 +55,7 @@ struct StaticMinMaxLineWrapperDefaults_Initializer
private:
void lcl_AddDefaultsToMap( ::chart::tPropertyValueMap & rOutMap )
{
- ::chart::LineProperties::AddDefaultsToMap( rOutMap );
+ ::chart::LinePropertiesHelper::AddDefaultsToMap( rOutMap );
}
};
@@ -76,7 +76,7 @@ private:
{
::std::vector< ::com::sun::star::beans::Property > aProperties;
- ::chart::LineProperties::AddPropertiesToVector( aProperties );
+ ::chart::LinePropertiesHelper::AddPropertiesToVector( aProperties );
::chart::UserDefinedProperties::AddPropertiesToVector( aProperties );
::std::sort( aProperties.begin(), aProperties.end(),
diff --git a/chart2/source/controller/chartapiwrapper/TitleWrapper.cxx b/chart2/source/controller/chartapiwrapper/TitleWrapper.cxx
index 34af3c4..ad07eb1 100644
--- a/chart2/source/controller/chartapiwrapper/TitleWrapper.cxx
+++ b/chart2/source/controller/chartapiwrapper/TitleWrapper.cxx
@@ -27,7 +27,7 @@
#include <com/sun/star/chart2/RelativePosition.hpp>
#include "CharacterProperties.hxx"
-#include "LineProperties.hxx"
+#include "LinePropertiesHelper.hxx"
#include "FillProperties.hxx"
#include "UserDefinedProperties.hxx"
#include "WrappedCharacterHeightProperty.hxx"
@@ -179,7 +179,7 @@ private:
::std::vector< beans::Property > aProperties;
lcl_AddPropertiesToVector( aProperties );
::chart::CharacterProperties::AddPropertiesToVector( aProperties );
- ::chart::LineProperties::AddPropertiesToVector( aProperties );
+ ::chart::LinePropertiesHelper::AddPropertiesToVector( aProperties );
::chart::FillProperties::AddPropertiesToVector( aProperties );
::chart::UserDefinedProperties::AddPropertiesToVector( aProperties );
::chart::wrapper::WrappedAutomaticPositionProperties::addProperties( aProperties );
diff --git a/chart2/source/controller/chartapiwrapper/UpDownBarWrapper.cxx b/chart2/source/controller/chartapiwrapper/UpDownBarWrapper.cxx
index ed66e26..ec5e3dc 100644
--- a/chart2/source/controller/chartapiwrapper/UpDownBarWrapper.cxx
+++ b/chart2/source/controller/chartapiwrapper/UpDownBarWrapper.cxx
@@ -27,7 +27,7 @@
#include <com/sun/star/chart2/XChartType.hpp>
#include <com/sun/star/chart2/XDataSeriesContainer.hpp>
-#include "LineProperties.hxx"
+#include "LinePropertiesHelper.hxx"
#include "FillProperties.hxx"
#include "UserDefinedProperties.hxx"
@@ -57,7 +57,7 @@ private:
{
::std::vector< ::com::sun::star::beans::Property > aProperties;
- ::chart::LineProperties::AddPropertiesToVector( aProperties );
+ ::chart::LinePropertiesHelper::AddPropertiesToVector( aProperties );
::chart::FillProperties::AddPropertiesToVector( aProperties );
::chart::UserDefinedProperties::AddPropertiesToVector( aProperties );
@@ -110,7 +110,7 @@ struct StaticUpDownBarWrapperDefaults_Initializer
private:
void lcl_AddDefaultsToMap( ::chart::tPropertyValueMap & rOutMap )
{
- ::chart::LineProperties::AddDefaultsToMap( rOutMap );
+ ::chart::LinePropertiesHelper::AddDefaultsToMap( rOutMap );
::chart::FillProperties::AddDefaultsToMap( rOutMap );
}
};
diff --git a/chart2/source/controller/chartapiwrapper/WallFloorWrapper.cxx b/chart2/source/controller/chartapiwrapper/WallFloorWrapper.cxx
index f0ed456..bad2b3d 100644
--- a/chart2/source/controller/chartapiwrapper/WallFloorWrapper.cxx
+++ b/chart2/source/controller/chartapiwrapper/WallFloorWrapper.cxx
@@ -26,7 +26,7 @@
#include <com/sun/star/drawing/FillStyle.hpp>
#include "FillProperties.hxx"
-#include "LineProperties.hxx"
+#include "LinePropertiesHelper.hxx"
#include "UserDefinedProperties.hxx"
#include "WrappedDirectStateProperty.hxx"
@@ -60,7 +60,7 @@ private:
{
::std::vector< ::com::sun::star::beans::Property > aProperties;
::chart::FillProperties::AddPropertiesToVector( aProperties );
- ::chart::LineProperties::AddPropertiesToVector( aProperties );
+ ::chart::LinePropertiesHelper::AddPropertiesToVector( aProperties );
::chart::UserDefinedProperties::AddPropertiesToVector( aProperties );
::std::sort( aProperties.begin(), aProperties.end(),
diff --git a/chart2/source/inc/ErrorBar.hxx b/chart2/source/inc/ErrorBar.hxx
index 1b76c9c..dee86ea 100644
--- a/chart2/source/inc/ErrorBar.hxx
+++ b/chart2/source/inc/ErrorBar.hxx
@@ -23,6 +23,7 @@
#include "ServiceMacros.hxx"
#include "ModifyListenerHelper.hxx"
#include "charttoolsdllapi.hxx"
+#include "LineProperties.hxx"
#include <cppuhelper/implbase7.hxx>
#include <comphelper/uno3.hxx>
@@ -59,7 +60,8 @@ typedef ::cppu::WeakImplHelper7<
class ErrorBar :
public MutexContainer,
- public impl::ErrorBar_Base
+ public impl::ErrorBar_Base,
+ public LineProperties
{
private:
bool mbShowPositiveError;
diff --git a/chart2/source/inc/LineProperties.hxx b/chart2/source/inc/LineProperties.hxx
index 5b4c376..5df0372 100644
--- a/chart2/source/inc/LineProperties.hxx
+++ b/chart2/source/inc/LineProperties.hxx
@@ -5,67 +5,34 @@
* 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/.
- *
- * This file incorporates work covered by the following license notice:
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed
- * with this work for additional information regarding copyright
- * ownership. The ASF licenses this file to you under the Apache
- * License, Version 2.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#ifndef CHART_LINEPROPERTIES_HXX
-#define CHART_LINEPROPERTIES_HXX
-#include "PropertyHelper.hxx"
-#include "FastPropertyIdRanges.hxx"
-#include "charttoolsdllapi.hxx"
-#include <com/sun/star/beans/Property.hpp>
+#ifndef CHART2_LINE_PROPERTIES_HXX
+#define CHART2_LINE_PROPERTIES_HXX
-#include <vector>
+#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/uno/Any.hxx>
-namespace chart
+class LineProperties
{
+private:
+ OUString maDashName;
+ sal_Int32 mnLineWidth;
+ com::sun::star::drawing::LineStyle meLineStyle;
+ com::sun::star::util::Color maLineColor;
+ sal_uInt8 mnLineTransparence;
+ com::sun::star::drawing::LineJoint meLineJoint;
-// implements service LineProperties
-class OOO_DLLPUBLIC_CHARTTOOLS LineProperties
-{
public:
- // FastProperty Ids for properties
- enum
- {
- // com.sun.star.drawing.LineProperties
- PROP_LINE_STYLE = FAST_PROPERTY_ID_START_LINE_PROP,
- PROP_LINE_DASH,
- PROP_LINE_DASH_NAME, //not in service description
- PROP_LINE_COLOR,
- PROP_LINE_TRANSPARENCE,
- PROP_LINE_WIDTH,
- PROP_LINE_JOINT
- };
-
- static void AddPropertiesToVector(
- ::std::vector< ::com::sun::star::beans::Property > & rOutProperties );
-
- static void AddDefaultsToMap( ::chart::tPropertyValueMap & rOutMap );
-
- SAL_DLLPRIVATE static bool IsLineVisible( const ::com::sun::star::uno::Reference<
- ::com::sun::star::beans::XPropertySet >& xLineProperties );
- SAL_DLLPRIVATE static void SetLineVisible( const ::com::sun::star::uno::Reference<
- ::com::sun::star::beans::XPropertySet >& xLineProperties );
- static void SetLineInvisible( const ::com::sun::star::uno::Reference<
- ::com::sun::star::beans::XPropertySet >& xLineProperties );
-
-private:
- // not implemented
LineProperties();
-};
+ LineProperties(const LineProperties&);
-} // namespace chart
+ com::sun::star::uno::Any getPropertyValue(const OUString& rName);
+ void setPropertyValue(const OUString& rName, const com::sun::star::uno::Any& rAny);
+};
-// CHART_LINEPROPERTIES_HXX
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/chart2/source/inc/LinePropertiesHelper.hxx b/chart2/source/inc/LinePropertiesHelper.hxx
new file mode 100644
index 0000000..ea465a9
--- /dev/null
+++ b/chart2/source/inc/LinePropertiesHelper.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/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef CHART_LINEPROPERTIES_HXX
+#define CHART_LINEPROPERTIES_HXX
+
+#include "PropertyHelper.hxx"
+#include "FastPropertyIdRanges.hxx"
+#include "charttoolsdllapi.hxx"
+#include <com/sun/star/beans/Property.hpp>
+
+#include <vector>
+
+namespace chart
+{
+
+// implements service LineProperties
+class LinePropertiesHelper
+{
+public:
+ // FastProperty Ids for properties
+ enum
+ {
+ // com.sun.star.drawing.LineProperties
+ PROP_LINE_STYLE = FAST_PROPERTY_ID_START_LINE_PROP,
+ PROP_LINE_DASH,
+ PROP_LINE_DASH_NAME, //not in service description
+ PROP_LINE_COLOR,
+ PROP_LINE_TRANSPARENCE,
+ PROP_LINE_WIDTH,
+ PROP_LINE_JOINT
+ };
+
+ OOO_DLLPUBLIC_CHARTTOOLS static void AddPropertiesToVector(
+ ::std::vector< ::com::sun::star::beans::Property > & rOutProperties );
+
+ OOO_DLLPUBLIC_CHARTTOOLS static void AddDefaultsToMap( ::chart::tPropertyValueMap & rOutMap );
+
+ SAL_DLLPRIVATE static bool IsLineVisible( const ::com::sun::star::uno::Reference<
+ ::com::sun::star::beans::XPropertySet >& xLineProperties );
+ SAL_DLLPRIVATE static void SetLineVisible( const ::com::sun::star::uno::Reference<
+ ::com::sun::star::beans::XPropertySet >& xLineProperties );
+ static void SetLineInvisible( const ::com::sun::star::uno::Reference<
+ ::com::sun::star::beans::XPropertySet >& xLineProperties );
+
+private:
+ // not implemented
+ LinePropertiesHelper();
+};
+
+} // namespace chart
+
+// CHART_LINEPROPERTIES_HXX
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/chart2/source/model/main/Axis.cxx b/chart2/source/model/main/Axis.cxx
index 59e3d12..35fcabb 100644
--- a/chart2/source/model/main/Axis.cxx
+++ b/chart2/source/model/main/Axis.cxx
@@ -21,7 +21,7 @@
#include "GridProperties.hxx"
#include "macros.hxx"
#include "CharacterProperties.hxx"
-#include "LineProperties.hxx"
+#include "LinePropertiesHelper.hxx"
#include "UserDefinedProperties.hxx"
#include "PropertyHelper.hxx"
#include "ContainerHelper.hxx"
@@ -194,7 +194,7 @@ private:
void lcl_AddDefaultsToMap( ::chart::tPropertyValueMap & rOutMap )
{
::chart::CharacterProperties::AddDefaultsToMap( rOutMap );
- ::chart::LineProperties::AddDefaultsToMap( rOutMap );
+ ::chart::LinePropertiesHelper::AddDefaultsToMap( rOutMap );
::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_AXIS_SHOW, true );
::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_AXIS_CROSSOVER_POSITION, ::com::sun::star::chart::ChartAxisPosition_ZERO );
@@ -235,7 +235,7 @@ private:
::std::vector< ::com::sun::star::beans::Property > aProperties;
lcl_AddPropertiesToVector( aProperties );
::chart::CharacterProperties::AddPropertiesToVector( aProperties );
- ::chart::LineProperties::AddPropertiesToVector( aProperties );
+ ::chart::LinePropertiesHelper::AddPropertiesToVector( aProperties );
::chart::UserDefinedProperties::AddPropertiesToVector( aProperties );
::std::sort( aProperties.begin(), aProperties.end(),
@@ -312,7 +312,7 @@ Axis::Axis( Reference< uno::XComponentContext > const & /* xContext */ ) :
{
osl_atomic_increment(&m_refCount);
setFastPropertyValue_NoBroadcast(
- ::chart::LineProperties::PROP_LINE_COLOR, uno::makeAny( static_cast< sal_Int32 >( 0xb3b3b3 ) ) ); // gray30
+ ::chart::LinePropertiesHelper::PROP_LINE_COLOR, uno::makeAny( static_cast< sal_Int32 >( 0xb3b3b3 ) ) ); // gray30
if( m_xGrid.is())
ModifyListenerHelper::addListener( m_xGrid, m_xModifyEventForwarder );
@@ -405,7 +405,7 @@ void Axis::AllocateSubGrids()
for( sal_Int32 i = nOldSubIncCount; i < nNewSubIncCount; ++i )
{
m_aSubGridProperties[ i ] = new GridProperties();
- LineProperties::SetLineInvisible( m_aSubGridProperties[ i ] );
+ LinePropertiesHelper::SetLineInvisible( m_aSubGridProperties[ i ] );
aNewBroadcasters.push_back( m_aSubGridProperties[ i ] );
}
}
diff --git a/chart2/source/model/main/DataPointProperties.cxx b/chart2/source/model/main/DataPointProperties.cxx
index de4f0b6..32befb3 100644
--- a/chart2/source/model/main/DataPointProperties.cxx
+++ b/chart2/source/model/main/DataPointProperties.cxx
@@ -19,7 +19,7 @@
#include "DataPointProperties.hxx"
#include "macros.hxx"
-#include "LineProperties.hxx"
+#include "LinePropertiesHelper.hxx"
#include "FillProperties.hxx"
#include <com/sun/star/beans/PropertyAttribute.hpp>
@@ -158,25 +158,25 @@ void DataPointProperties::AddPropertiesToVector(
// ---------------
rOutProperties.push_back(
Property( "LineStyle",
- LineProperties::PROP_LINE_STYLE,
+ LinePropertiesHelper::PROP_LINE_STYLE,
::getCppuType( reinterpret_cast< const drawing::LineStyle * >(0)),
beans::PropertyAttribute::BOUND
| beans::PropertyAttribute::MAYBEDEFAULT ));
rOutProperties.push_back(
Property( "LineWidth",
- LineProperties::PROP_LINE_WIDTH,
+ LinePropertiesHelper::PROP_LINE_WIDTH,
::getCppuType( reinterpret_cast< const sal_Int32 * >(0)),
beans::PropertyAttribute::BOUND
| beans::PropertyAttribute::MAYBEDEFAULT ));
rOutProperties.push_back(
Property( "LineDash",
- LineProperties::PROP_LINE_DASH,
+ LinePropertiesHelper::PROP_LINE_DASH,
::getCppuType( reinterpret_cast< const drawing::LineDash * >(0)),
beans::PropertyAttribute::BOUND
| beans::PropertyAttribute::MAYBEVOID ));
rOutProperties.push_back(
Property( "LineDashName",
- LineProperties::PROP_LINE_DASH_NAME,
+ LinePropertiesHelper::PROP_LINE_DASH_NAME,
::getCppuType( reinterpret_cast< const OUString * >(0)),
beans::PropertyAttribute::BOUND
| beans::PropertyAttribute::MAYBEVOID ));
@@ -368,10 +368,10 @@ void DataPointProperties::AddDefaultsToMap(
PropertyHelper::setPropertyValueDefault< sal_Int16 >( rOutMap, PROP_DATAPOINT_BORDER_TRANSPARENCY, 0 );
//line
- PropertyHelper::setPropertyValueDefault( rOutMap, LineProperties::PROP_LINE_STYLE, drawing::LineStyle_SOLID );
- PropertyHelper::setPropertyValueDefault< sal_Int32 >( rOutMap, LineProperties::PROP_LINE_WIDTH, 0 );
- PropertyHelper::setPropertyValueDefault( rOutMap, LineProperties::PROP_LINE_DASH, drawing::LineDash());
- PropertyHelper::setEmptyPropertyValueDefault( rOutMap, LineProperties::PROP_LINE_DASH_NAME );
+ PropertyHelper::setPropertyValueDefault( rOutMap, LinePropertiesHelper::PROP_LINE_STYLE, drawing::LineStyle_SOLID );
+ PropertyHelper::setPropertyValueDefault< sal_Int32 >( rOutMap, LinePropertiesHelper::PROP_LINE_WIDTH, 0 );
+ PropertyHelper::setPropertyValueDefault( rOutMap, LinePropertiesHelper::PROP_LINE_DASH, drawing::LineDash());
+ PropertyHelper::setEmptyPropertyValueDefault( rOutMap, LinePropertiesHelper::PROP_LINE_DASH_NAME );
//fill bitmap
PropertyHelper::setPropertyValueDefault< sal_Int16 >( rOutMap, FillProperties::PROP_FILL_BITMAP_OFFSETX, 0 );
diff --git a/chart2/source/model/main/GridProperties.cxx b/chart2/source/model/main/GridProperties.cxx
index fd713a9..27a4443 100644
--- a/chart2/source/model/main/GridProperties.cxx
+++ b/chart2/source/model/main/GridProperties.cxx
@@ -19,7 +19,7 @@
#include "GridProperties.hxx"
-#include "LineProperties.hxx"
+#include "LinePropertiesHelper.hxx"
#include "UserDefinedProperties.hxx"
#include "PropertyHelper.hxx"
#include "macros.hxx"
@@ -70,13 +70,13 @@ struct StaticGridDefaults_Initializer
private:
void lcl_AddDefaultsToMap( ::chart::tPropertyValueMap & rOutMap )
{
- ::chart::LineProperties::AddDefaultsToMap( rOutMap );
+ ::chart::LinePropertiesHelper::AddDefaultsToMap( rOutMap );
::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_GRID_SHOW, false );
// override other defaults
::chart::PropertyHelper::setPropertyValue< sal_Int32 >(
- rOutMap, ::chart::LineProperties::PROP_LINE_COLOR, 0xb3b3b3 ); // gray30
+ rOutMap, ::chart::LinePropertiesHelper::PROP_LINE_COLOR, 0xb3b3b3 ); // gray30
}
};
@@ -97,7 +97,7 @@ private:
{
::std::vector< Property > aProperties;
lcl_AddPropertiesToVector( aProperties );
- ::chart::LineProperties::AddPropertiesToVector( aProperties );
+ ::chart::LinePropertiesHelper::AddPropertiesToVector( aProperties );
::chart::UserDefinedProperties::AddPropertiesToVector( aProperties );
::std::sort( aProperties.begin(), aProperties.end(),
diff --git a/chart2/source/model/main/Legend.cxx b/chart2/source/model/main/Legend.cxx
index 2173f93..21d9e5c 100644
--- a/chart2/source/model/main/Legend.cxx
+++ b/chart2/source/model/main/Legend.cxx
@@ -19,7 +19,7 @@
#include "Legend.hxx"
#include "macros.hxx"
-#include "LineProperties.hxx"
+#include "LinePropertiesHelper.hxx"
#include "FillProperties.hxx"
#include "CharacterProperties.hxx"
#include "UserDefinedProperties.hxx"
@@ -116,7 +116,7 @@ struct StaticLegendDefaults_Initializer
private:
void lcl_AddDefaultsToMap( ::chart::tPropertyValueMap & rOutMap )
{
- ::chart::LineProperties::AddDefaultsToMap( rOutMap );
+ ::chart::LinePropertiesHelper::AddDefaultsToMap( rOutMap );
::chart::FillProperties::AddDefaultsToMap( rOutMap );
::chart::CharacterProperties::AddDefaultsToMap( rOutMap );
@@ -148,7 +148,7 @@ private:
{
::std::vector< ::com::sun::star::beans::Property > aProperties;
lcl_AddPropertiesToVector( aProperties );
- ::chart::LineProperties::AddPropertiesToVector( aProperties );
+ ::chart::LinePropertiesHelper::AddPropertiesToVector( aProperties );
::chart::FillProperties::AddPropertiesToVector( aProperties );
::chart::CharacterProperties::AddPropertiesToVector( aProperties );
::chart::UserDefinedProperties::AddPropertiesToVector( aProperties );
diff --git a/chart2/source/model/main/PageBackground.cxx b/chart2/source/model/main/PageBackground.cxx
index 5728f9c..d200ca5 100644
--- a/chart2/source/model/main/PageBackground.cxx
+++ b/chart2/source/model/main/PageBackground.cxx
@@ -19,7 +19,7 @@
#include "PageBackground.hxx"
#include "macros.hxx"
-#include "LineProperties.hxx"
+#include "LinePropertiesHelper.hxx"
#include "FillProperties.hxx"
#include "UserDefinedProperties.hxx"
#include "ContainerHelper.hxx"
@@ -53,12 +53,12 @@ struct StaticPageBackgroundDefaults_Initializer
private:
void lcl_AddDefaultsToMap( ::chart::tPropertyValueMap & rOutMap )
{
- ::chart::LineProperties::AddDefaultsToMap( rOutMap );
+ ::chart::LinePropertiesHelper::AddDefaultsToMap( rOutMap );
::chart::FillProperties::AddDefaultsToMap( rOutMap );
// override other defaults
::chart::PropertyHelper::setPropertyValue< sal_Int32 >( rOutMap, ::chart::FillProperties::PROP_FILL_COLOR, 0xffffff );
- ::chart::PropertyHelper::setPropertyValue( rOutMap, ::chart::LineProperties::PROP_LINE_STYLE, drawing::LineStyle_NONE );
+ ::chart::PropertyHelper::setPropertyValue( rOutMap, ::chart::LinePropertiesHelper::PROP_LINE_STYLE, drawing::LineStyle_NONE );
}
};
@@ -78,7 +78,7 @@ private:
uno::Sequence< Property > lcl_GetPropertySequence()
{
::std::vector< ::com::sun::star::beans::Property > aProperties;
- ::chart::LineProperties::AddPropertiesToVector( aProperties );
+ ::chart::LinePropertiesHelper::AddPropertiesToVector( aProperties );
::chart::FillProperties::AddPropertiesToVector( aProperties );
::chart::UserDefinedProperties::AddPropertiesToVector( aProperties );
diff --git a/chart2/source/model/main/StockBar.cxx b/chart2/source/model/main/StockBar.cxx
index 02d63f9..9cf8324 100644
--- a/chart2/source/model/main/StockBar.cxx
+++ b/chart2/source/model/main/StockBar.cxx
@@ -19,7 +19,7 @@
#include "StockBar.hxx"
-#include "LineProperties.hxx"
+#include "LinePropertiesHelper.hxx"
#include "FillProperties.hxx"
#include "UserDefinedProperties.hxx"
#include "PropertyHelper.hxx"
@@ -58,7 +58,7 @@ private:
uno::Sequence< Property > lcl_GetPropertySequence()
{
::std::vector< ::com::sun::star::beans::Property > aProperties;
- ::chart::LineProperties::AddPropertiesToVector( aProperties );
+ ::chart::LinePropertiesHelper::AddPropertiesToVector( aProperties );
::chart::FillProperties::AddPropertiesToVector( aProperties );
::chart::UserDefinedProperties::AddPropertiesToVector( aProperties );
@@ -99,7 +99,7 @@ struct StaticStockBarDefaults_Initializer
private:
void lcl_AddDefaultsToMap( ::chart::tPropertyValueMap & rOutMap )
{
- ::chart::LineProperties::AddDefaultsToMap( rOutMap );
+ ::chart::LinePropertiesHelper::AddDefaultsToMap( rOutMap );
::chart::FillProperties::AddDefaultsToMap( rOutMap );
// override other defaults
@@ -129,7 +129,7 @@ StockBar::StockBar( bool bRisingCourse ) :
::chart::FillProperties::PROP_FILL_COLOR,
uno::makeAny( sal_Int32( 0x000000 ))); // black
setFastPropertyValue_NoBroadcast(
- ::chart::LineProperties::PROP_LINE_COLOR,
+ ::chart::LinePropertiesHelper::PROP_LINE_COLOR,
uno::makeAny( sal_Int32( 0xb3b3b3 ))); // gray30
}
}
diff --git a/chart2/source/model/main/Title.cxx b/chart2/source/model/main/Title.cxx
index bd127e8..346a967 100644
--- a/chart2/source/model/main/Title.cxx
+++ b/chart2/source/model/main/Title.cxx
@@ -20,7 +20,7 @@
#include "Title.hxx"
#include "macros.hxx"
#include "FormattedString.hxx"
-#include "LineProperties.hxx"
+#include "LinePropertiesHelper.hxx"
#include "FillProperties.hxx"
#include "ContainerHelper.hxx"
#include "CloneHelper.hxx"
@@ -156,7 +156,7 @@ struct StaticTitleDefaults_Initializer
private:
void lcl_AddDefaultsToMap( ::chart::tPropertyValueMap & rOutMap )
{
- ::chart::LineProperties::AddDefaultsToMap( rOutMap );
+ ::chart::LinePropertiesHelper::AddDefaultsToMap( rOutMap );
::chart::FillProperties::AddDefaultsToMap( rOutMap );
// ParagraphProperties
@@ -176,7 +176,7 @@ private:
// override other defaults
::chart::PropertyHelper::setPropertyValue( rOutMap, ::chart::FillProperties::PROP_FILL_STYLE, drawing::FillStyle_NONE );
- ::chart::PropertyHelper::setPropertyValue( rOutMap, ::chart::LineProperties::PROP_LINE_STYLE, drawing::LineStyle_NONE );
+ ::chart::PropertyHelper::setPropertyValue( rOutMap, ::chart::LinePropertiesHelper::PROP_LINE_STYLE, drawing::LineStyle_NONE );
}
};
@@ -197,7 +197,7 @@ private:
{
::std::vector< ::com::sun::star::beans::Property > aProperties;
lcl_AddPropertiesToVector( aProperties );
- ::chart::LineProperties::AddPropertiesToVector( aProperties );
+ ::chart::LinePropertiesHelper::AddPropertiesToVector( aProperties );
::chart::FillProperties::AddPropertiesToVector( aProperties );
::std::sort( aProperties.begin(), aProperties.end(),
diff --git a/chart2/source/model/main/Wall.cxx b/chart2/source/model/main/Wall.cxx
index cc80cf6..1a66638 100644
--- a/chart2/source/model/main/Wall.cxx
+++ b/chart2/source/model/main/Wall.cxx
@@ -19,7 +19,7 @@
#include "Wall.hxx"
#include "macros.hxx"
-#include "LineProperties.hxx"
+#include "LinePropertiesHelper.hxx"
#include "FillProperties.hxx"
#include "UserDefinedProperties.hxx"
#include "ContainerHelper.hxx"
@@ -59,11 +59,11 @@ struct StaticWallDefaults_Initializer
private:
void lcl_AddDefaultsToMap( ::chart::tPropertyValueMap & rOutMap )
{
- ::chart::LineProperties::AddDefaultsToMap( rOutMap );
+ ::chart::LinePropertiesHelper::AddDefaultsToMap( rOutMap );
::chart::FillProperties::AddDefaultsToMap( rOutMap );
// override other defaults
- ::chart::PropertyHelper::setPropertyValue( rOutMap, ::chart::LineProperties::PROP_LINE_STYLE, drawing::LineStyle_NONE );
+ ::chart::PropertyHelper::setPropertyValue( rOutMap, ::chart::LinePropertiesHelper::PROP_LINE_STYLE, drawing::LineStyle_NONE );
}
};
@@ -83,7 +83,7 @@ private:
uno::Sequence< Property > lcl_GetPropertySequence()
{
::std::vector< ::com::sun::star::beans::Property > aProperties;
- ::chart::LineProperties::AddPropertiesToVector( aProperties );
+ ::chart::LinePropertiesHelper::AddPropertiesToVector( aProperties );
::chart::FillProperties::AddPropertiesToVector( aProperties );
::chart::UserDefinedProperties::AddPropertiesToVector( aProperties );
diff --git a/chart2/source/tools/AxisHelper.cxx b/chart2/source/tools/AxisHelper.cxx
index a91d05a..8a769f8 100644
--- a/chart2/source/tools/AxisHelper.cxx
+++ b/chart2/source/tools/AxisHelper.cxx
@@ -23,7 +23,7 @@
#include "ChartTypeHelper.hxx"
#include "macros.hxx"
#include "AxisIndexDefines.hxx"
-#include "LineProperties.hxx"
+#include "LinePropertiesHelper.hxx"
#include "ContainerHelper.hxx"
#include "servicenames_coosystems.hxx"
#include "DataSeriesHelper.hxx"
@@ -463,7 +463,7 @@ void AxisHelper::makeAxisVisible( const Reference< XAxis >& xAxis )
if( xProps.is() )
{
xProps->setPropertyValue( "Show", uno::makeAny( sal_True ) );
- LineProperties::SetLineVisible( xProps );
+ LinePropertiesHelper::SetLineVisible( xProps );
xProps->setPropertyValue( "DisplayLabels", uno::makeAny( sal_True ) );
}
}
@@ -473,7 +473,7 @@ void AxisHelper::makeGridVisible( const Reference< beans::XPropertySet >& xGridP
if( xGridProperties.is() )
{
xGridProperties->setPropertyValue( "Show", uno::makeAny( sal_True ) );
- LineProperties::SetLineVisible( xGridProperties );
+ LinePropertiesHelper::SetLineVisible( xGridProperties );
}
}
@@ -665,7 +665,7 @@ sal_Bool AxisHelper::isAxisVisible( const Reference< XAxis >& xAxis )
if( xProps.is() )
{
xProps->getPropertyValue( "Show" ) >>= bRet;
- bRet = bRet && ( LineProperties::IsLineVisible( xProps )
+ bRet = bRet && ( LinePropertiesHelper::IsLineVisible( xProps )
|| areAxisLabelsVisible( xProps ) );
}
@@ -689,7 +689,7 @@ sal_Bool AxisHelper::isGridVisible( const Reference< beans::XPropertySet >& xGri
if( xGridProperies.is() )
{
xGridProperies->getPropertyValue( "Show" ) >>= bRet;
- bRet = bRet && LineProperties::IsLineVisible( xGridProperies );
+ bRet = bRet && LinePropertiesHelper::IsLineVisible( xGridProperies );
}
return bRet;
diff --git a/chart2/source/tools/ErrorBar.cxx b/chart2/source/tools/ErrorBar.cxx
index 0c91323..c42d764 100644
--- a/chart2/source/tools/ErrorBar.cxx
+++ b/chart2/source/tools/ErrorBar.cxx
@@ -30,14 +30,15 @@
#include <com/sun/star/beans/PropertyAttribute.hpp>
#include <com/sun/star/chart/ErrorBarStyle.hpp>
+#include <com/sun/star/drawing/LineStyle.hpp>
+#include <com/sun/star/util/Color.hpp>
+#include <com/sun/star/drawing/LineJoint.hpp>
+
#include <rtl/math.hxx>
#include <rtl/ustrbuf.hxx>
using namespace ::com::sun::star;
-using ::com::sun::star::beans::Property;
-using ::osl::MutexGuard;
-
namespace
{
@@ -59,8 +60,12 @@ const SfxItemPropertySet* GetErrorBarPropertySet()
{MAP_CHAR_LEN("NegativeError"),3,&getCppuType((const double*)0), 0, 0},
{MAP_CHAR_LEN("ErrorBarStyle"),4,&getCppuType((sal_Int32*)0),0,0},
{MAP_CHAR_LEN("Weight"),5,&getCppuType((const double*)0),0,0},
- {MAP_CHAR_LEN(""),6,&getBooleanCppuType(), 0, 0},
- {MAP_CHAR_LEN(""),7,&getCppuType((OUString*)0),0,0},
+ {MAP_CHAR_LEN("LineStyle"),7,&getCppuType((com::sun::star::drawing::LineStyle*)0),0,0},
+ {MAP_CHAR_LEN("LineDashName"),7,&getCppuType((OUString*)0),0,0},
+ {MAP_CHAR_LEN("LineWidth"),7,&getCppuType((sal_Int32*)0),0,0},
+ {MAP_CHAR_LEN("LineColor"),7,&getCppuType((com::sun::star::util::Color*)0),0,0},
+ {MAP_CHAR_LEN("LineTransparence"),7,&getCppuType((sal_uInt8*)0),0,0},
+ {MAP_CHAR_LEN("LineJoint"),7,&getCppuType((com::sun::star::drawing::LineJoint*)0),0,0},
{0,0,0,0,0,0}
};
static SfxItemPropertySet aPropSet( aErrorBarPropertyMap_Impl );
@@ -79,6 +84,7 @@ uno::Reference< beans::XPropertySet > createErrorBar( const uno::Reference< uno:
ErrorBar::ErrorBar(
uno::Reference< uno::XComponentContext > const & xContext ) :
+ LineProperties(),
mbShowPositiveError(true),
mbShowNegativeError(true),
mfPositiveError(0),
@@ -91,6 +97,7 @@ ErrorBar::ErrorBar(
ErrorBar::ErrorBar( const ErrorBar & rOther ) :
MutexContainer(),
impl::ErrorBar_Base(),
+ LineProperties(rOther),
mbShowPositiveError(rOther.mbShowPositiveError),
mbShowNegativeError(rOther.mbShowNegativeError),
mfPositiveError(rOther.mfPositiveError),
@@ -143,7 +150,9 @@ void ErrorBar::setPropertyValue( const OUString& rPropName, const uno::Any& rAny
else if(rPropName == "ShowNegativeError")
rAny >>= mbShowNegativeError;
else
- SAL_WARN("chart2", "asked for property value: " << rPropName);
+ LineProperties::setPropertyValue(rPropName, rAny);
+
+ m_xModifyEventForwarder->modified( lang::EventObject( static_cast< uno::XWeak* >( this )));
}
uno::Any ErrorBar::getPropertyValue(const OUString& rPropName)
@@ -161,7 +170,8 @@ uno::Any ErrorBar::getPropertyValue(const OUString& rPropName)
else if(rPropName == "ShowNegativeError")
aRet <<= mbShowNegativeError;
else
- SAL_WARN("chart2", "asked for property value: " << rPropName);
+ aRet = LineProperties::getPropertyValue(rPropName);
+ 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
index e3c88d9..c7c9477 100644
--- a/chart2/source/tools/LineProperties.cxx
+++ b/chart2/source/tools/LineProperties.cxx
@@ -5,170 +5,87 @@
* 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/.
- *
- * This file incorporates work covered by the following license notice:
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed
- * with this work for additional information regarding copyright
- * ownership. The ASF licenses this file to you under the Apache
- * License, Version 2.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include "LineProperties.hxx"
-#include "macros.hxx"
-#include <com/sun/star/beans/PropertyAttribute.hpp>
-#include <com/sun/star/drawing/LineStyle.hpp>
-#include <com/sun/star/drawing/LineDash.hpp>
-#include <com/sun/star/drawing/LineJoint.hpp>
-using namespace ::com::sun::star;
+using namespace com::sun::star;
-using ::com::sun::star::beans::Property;
-
-namespace chart
+LineProperties::LineProperties():
+ mnLineWidth(0),
+ meLineStyle(drawing::LineStyle_SOLID),
+ maLineColor(0),
+ mnLineTransparence(0),
+ meLineJoint(drawing::LineJoint_ROUND)
{
-
-void LineProperties::AddPropertiesToVector(
- ::std::vector< Property > & rOutProperties )
-{
- // Line Properties see service drawing::LineProperties
- // ---------------
- rOutProperties.push_back(
- Property( "LineStyle",
- PROP_LINE_STYLE,
- ::getCppuType( reinterpret_cast< const drawing::LineStyle * >(0)),
- beans::PropertyAttribute::BOUND
- | beans::PropertyAttribute::MAYBEDEFAULT ));
-
- rOutProperties.push_back(
- Property( "LineDash",
- PROP_LINE_DASH,
- ::getCppuType( reinterpret_cast< const drawing::LineDash * >(0)),
- beans::PropertyAttribute::BOUND
- | beans::PropertyAttribute::MAYBEVOID ));
-
-//not in service description
- rOutProperties.push_back(
- Property( "LineDashName",
- PROP_LINE_DASH_NAME,
- ::getCppuType( reinterpret_cast< const OUString * >(0)),
- beans::PropertyAttribute::BOUND
- | beans::PropertyAttribute::MAYBEDEFAULT
- | beans::PropertyAttribute::MAYBEVOID ));
-
- rOutProperties.push_back(
- Property( "LineColor",
- PROP_LINE_COLOR,
- ::getCppuType( reinterpret_cast< const sal_Int32 * >(0)),
- beans::PropertyAttribute::BOUND
- | beans::PropertyAttribute::MAYBEDEFAULT ));
-
- rOutProperties.push_back(
- Property( "LineTransparence",
- PROP_LINE_TRANSPARENCE,
- ::getCppuType( reinterpret_cast< const sal_Int16 * >(0)),
- beans::PropertyAttribute::BOUND
- | beans::PropertyAttribute::MAYBEDEFAULT ));
-
- rOutProperties.push_back(
- Property( "LineWidth",
- PROP_LINE_WIDTH,
- ::getCppuType( reinterpret_cast< const sal_Int32 * >(0)),
- beans::PropertyAttribute::BOUND
- | beans::PropertyAttribute::MAYBEDEFAULT ));
-
- rOutProperties.push_back(
- Property( "LineJoint",
- PROP_LINE_JOINT,
- ::getCppuType( reinterpret_cast< const drawing::LineJoint * >(0)),
- beans::PropertyAttribute::BOUND
- | beans::PropertyAttribute::MAYBEDEFAULT ));
}
-void LineProperties::AddDefaultsToMap(
- ::chart::tPropertyValueMap & rOutMap )
+LineProperties::LineProperties(const LineProperties& r):
+ maDashName(r.maDashName),
+ mnLineWidth(r.mnLineWidth),
+ meLineStyle(r.meLineStyle),
+ maLineColor(r.maLineColor),
+ mnLineTransparence(r.mnLineTransparence),
+ meLineJoint(r.meLineJoint)
{
- ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_LINE_STYLE, drawing::LineStyle_SOLID );
- ::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( rOutMap, PROP_LINE_WIDTH, 0 );
- ::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( rOutMap, PROP_LINE_COLOR, 0x000000 ); // black
- ::chart::PropertyHelper::setPropertyValueDefault< sal_Int16 >( rOutMap, PROP_LINE_TRANSPARENCE, 0 );
- ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_LINE_JOINT, drawing::LineJoint_ROUND );
}
-bool LineProperties::IsLineVisible( const ::com::sun::star::uno::Reference<
- ::com::sun::star::beans::XPropertySet >& xLineProperties )
+uno::Any LineProperties::getPropertyValue(const OUString& rName)
{
- bool bRet = false;
- try
+ uno::Any aRet;
+ if(rName == "DashName")
{
- if( xLineProperties.is() )
- {
- drawing::LineStyle aLineStyle(drawing::LineStyle_SOLID);
- xLineProperties->getPropertyValue( "LineStyle" ) >>= aLineStyle;
- if( aLineStyle != drawing::LineStyle_NONE )
- {
- sal_Int16 nLineTransparence=0;
- xLineProperties->getPropertyValue( "LineTransparence" ) >>= nLineTransparence;
- if(100!=nLineTransparence)
- {
- bRet = true;
- }
- }
- }
+ aRet <<= maDashName;
}
- catch( const uno::Exception & ex )
+ else if(rName == "LineWidth")
{
- ASSERT_EXCEPTION( ex );
+ aRet <<= mnLineWidth;
}
- return bRet;
-}
-
-void LineProperties::SetLineVisible( const ::com::sun::star::uno::Reference<
- ::com::sun::star::beans::XPropertySet >& xLineProperties )
-{
- try
+ else if(rName == "LineStyle")
{
- if( xLineProperties.is() )
- {
- drawing::LineStyle aLineStyle(drawing::LineStyle_SOLID);
- xLineProperties->getPropertyValue( "LineStyle" ) >>= aLineStyle;
- if( aLineStyle == drawing::LineStyle_NONE )
- xLineProperties->setPropertyValue( "LineStyle", uno::makeAny( drawing::LineStyle_SOLID ) );
-
- sal_Int16 nLineTransparence=0;
- xLineProperties->getPropertyValue( "LineTransparence" ) >>= nLineTransparence;
- if(100==nLineTransparence)
- xLineProperties->setPropertyValue( "LineTransparence", uno::makeAny( sal_Int16(0) ) );
- }
+ aRet = uno::makeAny(meLineStyle);
+ }
+ else if(rName == "LineColor")
+ {
+ aRet <<= maLineColor;
}
- catch( const uno::Exception & ex )
+ else if(rName == "LineTransparence")
{
- ASSERT_EXCEPTION( ex );
+ aRet <<= mnLineTransparence;
}
+ else if(rName == "LineJoint")
+ {
+ aRet <<= meLineJoint;
+ }
+ return aRet;
}
-void LineProperties::SetLineInvisible( const ::com::sun::star::uno::Reference<
- ::com::sun::star::beans::XPropertySet >& xLineProperties )
+void LineProperties::setPropertyValue(const OUString& rName, const uno::Any& rAny)
{
- try
+ if(rName == "DashName")
+ {
+ rAny >>= maDashName;
+ }
+ else if(rName == "LineWidth")
{
- if( xLineProperties.is() )
- {
- drawing::LineStyle aLineStyle(drawing::LineStyle_SOLID);
- xLineProperties->getPropertyValue( "LineStyle" ) >>= aLineStyle;
- if( aLineStyle != drawing::LineStyle_NONE )
- xLineProperties->setPropertyValue( "LineStyle", uno::makeAny( drawing::LineStyle_NONE ) );
- }
+ rAny >>= mnLineWidth;
}
- catch( const uno::Exception & ex )
+ else if(rName == "LineStyle")
{
- ASSERT_EXCEPTION( ex );
+ rAny >>= meLineStyle;
+ }
+ else if(rName == "LineColor")
+ {
+ rAny >>= maLineColor;
+ }
+ else if(rName == "LineTransparence")
+ {
+ rAny >>= mnLineTransparence;
+ }
+ else if(rName == "LineJoint")
+ {
+ rAny >>= meLineJoint;
}
}
-} // namespace chart
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/chart2/source/tools/LinePropertiesHelper.cxx b/chart2/source/tools/LinePropertiesHelper.cxx
new file mode 100644
index 0000000..a965fc3
--- /dev/null
+++ b/chart2/source/tools/LinePropertiesHelper.cxx
@@ -0,0 +1,174 @@
+/* -*- 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/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#include "LinePropertiesHelper.hxx"
+#include "macros.hxx"
+#include <com/sun/star/beans/PropertyAttribute.hpp>
+#include <com/sun/star/drawing/LineStyle.hpp>
+#include <com/sun/star/drawing/LineDash.hpp>
+#include <com/sun/star/drawing/LineJoint.hpp>
+
+using namespace ::com::sun::star;
+
+using ::com::sun::star::beans::Property;
+
+namespace chart
+{
+
+void LinePropertiesHelper::AddPropertiesToVector(
+ ::std::vector< Property > & rOutProperties )
+{
+ // Line Properties see service drawing::LineProperties
+ // ---------------
+ rOutProperties.push_back(
+ Property( "LineStyle",
+ PROP_LINE_STYLE,
+ ::getCppuType( reinterpret_cast< const drawing::LineStyle * >(0)),
+ beans::PropertyAttribute::BOUND
+ | beans::PropertyAttribute::MAYBEDEFAULT ));
+
+ rOutProperties.push_back(
+ Property( "LineDash",
+ PROP_LINE_DASH,
+ ::getCppuType( reinterpret_cast< const drawing::LineDash * >(0)),
+ beans::PropertyAttribute::BOUND
+ | beans::PropertyAttribute::MAYBEVOID ));
+
+//not in service description
+ rOutProperties.push_back(
+ Property( "LineDashName",
+ PROP_LINE_DASH_NAME,
+ ::getCppuType( reinterpret_cast< const OUString * >(0)),
+ beans::PropertyAttribute::BOUND
+ | beans::PropertyAttribute::MAYBEDEFAULT
+ | beans::PropertyAttribute::MAYBEVOID ));
+
+ rOutProperties.push_back(
+ Property( "LineColor",
+ PROP_LINE_COLOR,
+ ::getCppuType( reinterpret_cast< const sal_Int32 * >(0)),
+ beans::PropertyAttribute::BOUND
+ | beans::PropertyAttribute::MAYBEDEFAULT ));
+
+ rOutProperties.push_back(
+ Property( "LineTransparence",
+ PROP_LINE_TRANSPARENCE,
+ ::getCppuType( reinterpret_cast< const sal_Int16 * >(0)),
+ beans::PropertyAttribute::BOUND
+ | beans::PropertyAttribute::MAYBEDEFAULT ));
+
+ rOutProperties.push_back(
+ Property( "LineWidth",
+ PROP_LINE_WIDTH,
+ ::getCppuType( reinterpret_cast< const sal_Int32 * >(0)),
+ beans::PropertyAttribute::BOUND
+ | beans::PropertyAttribute::MAYBEDEFAULT ));
+
+ rOutProperties.push_back(
+ Property( "LineJoint",
+ PROP_LINE_JOINT,
+ ::getCppuType( reinterpret_cast< const drawing::LineJoint * >(0)),
+ beans::PropertyAttribute::BOUND
+ | beans::PropertyAttribute::MAYBEDEFAULT ));
+}
+
+void LinePropertiesHelper::AddDefaultsToMap(
+ ::chart::tPropertyValueMap & rOutMap )
+{
+ ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_LINE_STYLE, drawing::LineStyle_SOLID );
+ ::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( rOutMap, PROP_LINE_WIDTH, 0 );
+ ::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( rOutMap, PROP_LINE_COLOR, 0x000000 ); // black
+ ::chart::PropertyHelper::setPropertyValueDefault< sal_Int16 >( rOutMap, PROP_LINE_TRANSPARENCE, 0 );
+ ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_LINE_JOINT, drawing::LineJoint_ROUND );
+}
+
+bool LinePropertiesHelper::IsLineVisible( const ::com::sun::star::uno::Reference<
+ ::com::sun::star::beans::XPropertySet >& xLineProperties )
+{
+ bool bRet = false;
+ try
+ {
+ if( xLineProperties.is() )
+ {
+ drawing::LineStyle aLineStyle(drawing::LineStyle_SOLID);
+ xLineProperties->getPropertyValue( "LineStyle" ) >>= aLineStyle;
+ if( aLineStyle != drawing::LineStyle_NONE )
+ {
+ sal_Int16 nLineTransparence=0;
+ xLineProperties->getPropertyValue( "LineTransparence" ) >>= nLineTransparence;
+ if(100!=nLineTransparence)
+ {
+ bRet = true;
+ }
+ }
+ }
+ }
+ catch( const uno::Exception & ex )
+ {
+ ASSERT_EXCEPTION( ex );
+ }
+ return bRet;
+}
+
+void LinePropertiesHelper::SetLineVisible( const ::com::sun::star::uno::Reference<
+ ::com::sun::star::beans::XPropertySet >& xLineProperties )
+{
+ try
+ {
+ if( xLineProperties.is() )
+ {
+ drawing::LineStyle aLineStyle(drawing::LineStyle_SOLID);
+ xLineProperties->getPropertyValue( "LineStyle" ) >>= aLineStyle;
+ if( aLineStyle == drawing::LineStyle_NONE )
+ xLineProperties->setPropertyValue( "LineStyle", uno::makeAny( drawing::LineStyle_SOLID ) );
+
+ sal_Int16 nLineTransparence=0;
+ xLineProperties->getPropertyValue( "LineTransparence" ) >>= nLineTransparence;
+ if(100==nLineTransparence)
+ xLineProperties->setPropertyValue( "LineTransparence", uno::makeAny( sal_Int16(0) ) );
+ }
+ }
+ catch( const uno::Exception & ex )
+ {
+ ASSERT_EXCEPTION( ex );
+ }
+}
+
+void LinePropertiesHelper::SetLineInvisible( const ::com::sun::star::uno::Reference<
+ ::com::sun::star::beans::XPropertySet >& xLineProperties )
+{
+ try
+ {
+ if( xLineProperties.is() )
+ {
+ drawing::LineStyle aLineStyle(drawing::LineStyle_SOLID);
+ xLineProperties->getPropertyValue( "LineStyle" ) >>= aLineStyle;
+ if( aLineStyle != drawing::LineStyle_NONE )
+ xLineProperties->setPropertyValue( "LineStyle", uno::makeAny( drawing::LineStyle_NONE ) );
+ }
+ }
+ catch( const uno::Exception & ex )
+ {
+ ASSERT_EXCEPTION( ex );
+ }
+}
+
+} // namespace chart
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/chart2/source/tools/RegressionCurveModel.cxx b/chart2/source/tools/RegressionCurveModel.cxx
index 0522af8..2dd96ed 100644
--- a/chart2/source/tools/RegressionCurveModel.cxx
+++ b/chart2/source/tools/RegressionCurveModel.cxx
@@ -19,7 +19,7 @@
#include "RegressionCurveModel.hxx"
#include "macros.hxx"
-#include "LineProperties.hxx"
+#include "LinePropertiesHelper.hxx"
#include "RegressionCurveHelper.hxx"
#include "RegressionCalculationHelper.hxx"
#include "RegressionEquation.hxx"
@@ -62,7 +62,7 @@ struct StaticXXXDefaults_Initializer
private:
void lcl_AddDefaultsToMap( ::chart::tPropertyValueMap & rOutMap )
{
- ::chart::LineProperties::AddDefaultsToMap( rOutMap );
+ ::chart::LinePropertiesHelper::AddDefaultsToMap( rOutMap );
}
};
@@ -82,7 +82,7 @@ private:
uno::Sequence< Property > lcl_GetPropertySequence()
{
::std::vector< ::com::sun::star::beans::Property > aProperties;
- ::chart::LineProperties::AddPropertiesToVector( aProperties );
+ ::chart::LinePropertiesHelper::AddPropertiesToVector( aProperties );
::std::sort( aProperties.begin(), aProperties.end(),
::chart::PropertyNameLess() );
@@ -126,7 +126,7 @@ RegressionCurveModel::RegressionCurveModel(
// set 0 line width (default) hard, so that it is always written to XML,
// because the old implementation uses different defaults
setFastPropertyValue_NoBroadcast(
- LineProperties::PROP_LINE_WIDTH, uno::makeAny( sal_Int32( 0 )));
+ LinePropertiesHelper::PROP_LINE_WIDTH, uno::makeAny( sal_Int32( 0 )));
ModifyListenerHelper::addListener( m_xEquationProperties, m_xModifyEventForwarder );
}
diff --git a/chart2/source/tools/RegressionEquation.cxx b/chart2/source/tools/RegressionEquation.cxx
index 16f771a..e8bdfe9 100644
--- a/chart2/source/tools/RegressionEquation.cxx
+++ b/chart2/source/tools/RegressionEquation.cxx
@@ -19,7 +19,7 @@
#include "RegressionEquation.hxx"
-#include "LineProperties.hxx"
+#include "LinePropertiesHelper.hxx"
#include "FillProperties.hxx"
#include "UserDefinedProperties.hxx"
#include "CharacterProperties.hxx"
@@ -109,7 +109,7 @@ struct StaticRegressionEquationDefaults_Initializer
private:
void lcl_AddDefaultsToMap( ::chart::tPropertyValueMap & rOutMap )
{
- ::chart::LineProperties::AddDefaultsToMap( rOutMap );
+ ::chart::LinePropertiesHelper::AddDefaultsToMap( rOutMap );
::chart::FillProperties::AddDefaultsToMap( rOutMap );
::chart::CharacterProperties::AddDefaultsToMap( rOutMap );
@@ -119,7 +119,7 @@ private:
// override other defaults
::chart::PropertyHelper::setPropertyValue( rOutMap, ::chart::FillProperties::PROP_FILL_STYLE, drawing::FillStyle_NONE );
- ::chart::PropertyHelper::setPropertyValue( rOutMap, ::chart::LineProperties::PROP_LINE_STYLE, drawing::LineStyle_NONE );
+ ::chart::PropertyHelper::setPropertyValue( rOutMap, ::chart::LinePropertiesHelper::PROP_LINE_STYLE, drawing::LineStyle_NONE );
float fDefaultCharHeight = 10.0;
::chart::PropertyHelper::setPropertyValue( rOutMap, ::chart::CharacterProperties::PROP_CHAR_CHAR_HEIGHT, fDefaultCharHeight );
@@ -145,7 +145,7 @@ private:
{
::std::vector< ::com::sun::star::beans::Property > aProperties;
lcl_AddPropertiesToVector( aProperties );
- ::chart::LineProperties::AddPropertiesToVector( aProperties );
+ ::chart::LinePropertiesHelper::AddPropertiesToVector( aProperties );
::chart::FillProperties::AddPropertiesToVector( aProperties );
::chart::CharacterProperties::AddPropertiesToVector( aProperties );
::chart::UserDefinedProperties::AddPropertiesToVector( aProperties );
commit cabb933bc2d76dc184e2cdc4c039f7055b73d8d2
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Fri Apr 12 23:13:33 2013 +0200
make the properties in the error bar case explicit
Change-Id: I967de121418832e3a12b1b1641fb4203c3df05e2
diff --git a/chart2/source/inc/ErrorBar.hxx b/chart2/source/inc/ErrorBar.hxx
index 027995cc..1b76c9c 100644
--- a/chart2/source/inc/ErrorBar.hxx
+++ b/chart2/source/inc/ErrorBar.hxx
@@ -20,12 +20,11 @@
#define CHART2_ERRORBAR_HXX
#include "MutexContainer.hxx"
-#include "OPropertySet.hxx"
#include "ServiceMacros.hxx"
#include "ModifyListenerHelper.hxx"
#include "charttoolsdllapi.hxx"
-#include <cppuhelper/implbase6.hxx>
+#include <cppuhelper/implbase7.hxx>
#include <comphelper/uno3.hxx>
#include <com/sun/star/uno/XComponentContext.hpp>
@@ -35,6 +34,8 @@
... etc. - the rest is truncated
More information about the Libreoffice-commits
mailing list