summaryrefslogtreecommitdiff
path: root/chart2/source/controller/itemsetwrapper/DataPointItemConverter.cxx
diff options
context:
space:
mode:
authorMarco Cecchetti <marco.cecchetti@collabora.com>2015-07-19 18:18:00 +0200
committerAndras Timar <andras.timar@collabora.com>2015-09-09 07:41:51 +0000
commit9ed1dd01be8afa0961e388a79e9ff4c1235820c2 (patch)
tree366cad6bae91e791be462e4c03f499ab0ba3e2f2 /chart2/source/controller/itemsetwrapper/DataPointItemConverter.cxx
parent79bc956e7f44b762bfd6560e5a9c9812fa3dcf4d (diff)
tdf#90839: support for wrapped text in data labels and for centered data value
Now in a pie chart the text of a label can be wrapped, the wrapping is automatic and the maximum text width is fixed to almost half the pie radius. This feature is used to import correctly the relative text wrapping property provided by MSO. Moreover the data value and percent value of a label are now centered horizontally, respect with the label text. Conflicts: chart2/qa/extras/xshape/chart2xshape.cxx Change-Id: Ie10d6184365436f763cd9693a5bbefcfa9b3862b Reviewed-on: https://gerrit.libreoffice.org/17193 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Andras Timar <andras.timar@collabora.com>
Diffstat (limited to 'chart2/source/controller/itemsetwrapper/DataPointItemConverter.cxx')
-rw-r--r--chart2/source/controller/itemsetwrapper/DataPointItemConverter.cxx46
1 files changed, 46 insertions, 0 deletions
diff --git a/chart2/source/controller/itemsetwrapper/DataPointItemConverter.cxx b/chart2/source/controller/itemsetwrapper/DataPointItemConverter.cxx
index 6c3e874afe64..b3e9bd271dcb 100644
--- a/chart2/source/controller/itemsetwrapper/DataPointItemConverter.cxx
+++ b/chart2/source/controller/itemsetwrapper/DataPointItemConverter.cxx
@@ -376,6 +376,37 @@ bool DataPointItemConverter::ApplySpecialItem(
}
break;
+ case SCHATTR_DATADESCR_WRAP_TEXT:
+ {
+
+ try
+ {
+ bool bNew = static_cast< const SfxBoolItem & >( rItemSet.Get( nWhichId )).GetValue();
+ bool bOld = false;
+ GetPropertySet()->getPropertyValue( "TextWordWrap" ) >>= bOld;
+ if( m_bOverwriteLabelsForAttributedDataPointsAlso )
+ {
+ Reference< chart2::XDataSeries > xSeries( GetPropertySet(), uno::UNO_QUERY);
+ if( bOld!=bNew ||
+ DataSeriesHelper::hasAttributedDataPointDifferentValue( xSeries, "TextWordWrap", uno::makeAny( bOld ) ) )
+ {
+ DataSeriesHelper::setPropertyAlsoToAllAttributedDataPoints( xSeries, "TextWordWrap", uno::makeAny( bNew ) );
+ bChanged = true;
+ }
+ }
+ else if( bOld!=bNew )
+ {
+ GetPropertySet()->setPropertyValue( "TextWordWrap", uno::makeAny( bNew ));
+ bChanged = true;
+ }
+ }
+ catch( const uno::Exception& e )
+ {
+ ASSERT_EXCEPTION( e );
+ }
+ }
+ break;
+
case SCHATTR_DATADESCR_PLACEMENT:
{
@@ -596,6 +627,21 @@ void DataPointItemConverter::FillSpecialItem(
}
break;
+ case SCHATTR_DATADESCR_WRAP_TEXT:
+ {
+ bool bValue = false;
+ try
+ {
+ GetPropertySet()->getPropertyValue( "TextWordWrap" ) >>= bValue;
+ rOutItemSet.Put( SfxBoolItem( nWhichId, bValue ));
+ }
+ catch( const uno::Exception& e )
+ {
+ ASSERT_EXCEPTION( e );
+ }
+ }
+ break;
+
case SCHATTR_DATADESCR_PLACEMENT:
{
try