summaryrefslogtreecommitdiff
path: root/chart2/source/controller/itemsetwrapper/DataPointItemConverter.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'chart2/source/controller/itemsetwrapper/DataPointItemConverter.cxx')
-rw-r--r--chart2/source/controller/itemsetwrapper/DataPointItemConverter.cxx13
1 files changed, 10 insertions, 3 deletions
diff --git a/chart2/source/controller/itemsetwrapper/DataPointItemConverter.cxx b/chart2/source/controller/itemsetwrapper/DataPointItemConverter.cxx
index 43721c24502a..aab6be665814 100644
--- a/chart2/source/controller/itemsetwrapper/DataPointItemConverter.cxx
+++ b/chart2/source/controller/itemsetwrapper/DataPointItemConverter.cxx
@@ -31,9 +31,11 @@
#include <ChartTypeHelper.hxx>
#include <unonames.hxx>
+#include <com/sun/star/chart/DataLabelPlacement.hpp>
#include <com/sun/star/chart2/AxisType.hpp>
#include <com/sun/star/chart2/DataPointLabel.hpp>
#include <com/sun/star/chart2/Symbol.hpp>
+#include <com/sun/star/chart2/RelativePosition.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <svx/xflclit.hxx>
@@ -409,6 +411,7 @@ bool DataPointItemConverter::ApplySpecialItem(
{
sal_Int32 nNew = static_cast< const SfxInt32Item & >( rItemSet.Get( nWhichId )).GetValue();
sal_Int32 nOld =0;
+ RelativePosition aCustomLabelPosition;
if( !(GetPropertySet()->getPropertyValue( "LabelPlacement" ) >>= nOld) )
{
if( m_aAvailableLabelPlacements.hasElements() )
@@ -424,9 +427,10 @@ bool DataPointItemConverter::ApplySpecialItem(
bChanged = true;
}
}
- else if( nOld!=nNew )
+ else if( nOld!=nNew || (GetPropertySet()->getPropertyValue("CustomLabelPosition") >>= aCustomLabelPosition) )
{
- GetPropertySet()->setPropertyValue( "LabelPlacement" , uno::Any( nNew ));
+ GetPropertySet()->setPropertyValue("LabelPlacement", uno::Any(nNew));
+ GetPropertySet()->setPropertyValue("CustomLabelPosition", uno::Any());
bChanged = true;
}
}
@@ -641,7 +645,10 @@ void DataPointItemConverter::FillSpecialItem(
try
{
sal_Int32 nPlacement=0;
- if( GetPropertySet()->getPropertyValue( "LabelPlacement" ) >>= nPlacement )
+ RelativePosition aCustomLabelPosition;
+ if( !m_bOverwriteLabelsForAttributedDataPointsAlso && (GetPropertySet()->getPropertyValue("CustomLabelPosition") >>= aCustomLabelPosition) )
+ rOutItemSet.Put(SfxInt32Item(nWhichId, css::chart::DataLabelPlacement::CUSTOM));
+ else if( GetPropertySet()->getPropertyValue( "LabelPlacement" ) >>= nPlacement )
rOutItemSet.Put( SfxInt32Item( nWhichId, nPlacement ));
else if( m_aAvailableLabelPlacements.hasElements() )
rOutItemSet.Put( SfxInt32Item( nWhichId, m_aAvailableLabelPlacements[0] ));