[Libreoffice-commits] core.git: chart2/source
Balazs Varga (via logerrit)
logerrit at kemper.freedesktop.org
Thu Feb 27 13:44:53 UTC 2020
chart2/source/controller/itemsetwrapper/DataPointItemConverter.cxx | 8 ++------
chart2/source/controller/itemsetwrapper/TextLabelItemConverter.cxx | 8 ++------
chart2/source/view/main/VDataSeries.cxx | 2 ++
3 files changed, 6 insertions(+), 12 deletions(-)
New commits:
commit b5fa0fb35c362492a136ec56746e062bc800d7e7
Author: Balazs Varga <balazs.varga991 at gmail.com>
AuthorDate: Wed Feb 12 16:37:08 2020 +0100
Commit: László Németh <nemeth at numbertext.org>
CommitDate: Thu Feb 27 14:44:16 2020 +0100
tdf#130621 OOXML chart export: fix lost label placement
of a newly created chart with default label placement settings.
For example, default top label placement of a line chart
changed to the right during the first OOXML export/import.
Note: "Insert data labels" of the local menu and
Insert->Data labels... of the main menu have been improved.
Change-Id: I27bb57a0ebb3a2b3132cf47c0ea3a92ac2806380
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88542
Tested-by: László Németh <nemeth at numbertext.org>
Reviewed-by: László Németh <nemeth at numbertext.org>
diff --git a/chart2/source/controller/itemsetwrapper/DataPointItemConverter.cxx b/chart2/source/controller/itemsetwrapper/DataPointItemConverter.cxx
index aab6be665814..07defe8ebbeb 100644
--- a/chart2/source/controller/itemsetwrapper/DataPointItemConverter.cxx
+++ b/chart2/source/controller/itemsetwrapper/DataPointItemConverter.cxx
@@ -410,13 +410,9 @@ bool DataPointItemConverter::ApplySpecialItem(
try
{
sal_Int32 nNew = static_cast< const SfxInt32Item & >( rItemSet.Get( nWhichId )).GetValue();
- sal_Int32 nOld =0;
+ sal_Int32 nOld = -1;
RelativePosition aCustomLabelPosition;
- if( !(GetPropertySet()->getPropertyValue( "LabelPlacement" ) >>= nOld) )
- {
- if( m_aAvailableLabelPlacements.hasElements() )
- nOld = m_aAvailableLabelPlacements[0];
- }
+ GetPropertySet()->getPropertyValue("LabelPlacement") >>= nOld;
if( m_bOverwriteLabelsForAttributedDataPointsAlso )
{
Reference< chart2::XDataSeries > xSeries( GetPropertySet(), uno::UNO_QUERY);
diff --git a/chart2/source/controller/itemsetwrapper/TextLabelItemConverter.cxx b/chart2/source/controller/itemsetwrapper/TextLabelItemConverter.cxx
index f5c9d8a0ce4d..95b38ad02402 100644
--- a/chart2/source/controller/itemsetwrapper/TextLabelItemConverter.cxx
+++ b/chart2/source/controller/itemsetwrapper/TextLabelItemConverter.cxx
@@ -371,13 +371,9 @@ bool TextLabelItemConverter::ApplySpecialItem( sal_uInt16 nWhichId, const SfxIte
try
{
sal_Int32 nNew = static_cast<const SfxInt32Item&>(rItemSet.Get(nWhichId)).GetValue();
- sal_Int32 nOld = 0;
+ sal_Int32 nOld = -1;
RelativePosition aCustomLabelPosition;
- if (!(GetPropertySet()->getPropertyValue("LabelPlacement") >>= nOld))
- {
- if (maAvailableLabelPlacements.hasElements())
- nOld = maAvailableLabelPlacements[0];
- }
+ GetPropertySet()->getPropertyValue("LabelPlacement") >>= nOld;
if (mbDataSeries)
{
Reference<chart2::XDataSeries> xSeries(GetPropertySet(), uno::UNO_QUERY);
diff --git a/chart2/source/view/main/VDataSeries.cxx b/chart2/source/view/main/VDataSeries.cxx
index f64cb151a2d8..d66d97a94482 100644
--- a/chart2/source/view/main/VDataSeries.cxx
+++ b/chart2/source/view/main/VDataSeries.cxx
@@ -616,6 +616,8 @@ sal_Int32 VDataSeries::getLabelPlacement( sal_Int32 nPointIndex, const uno::Refe
if( aAvailablePlacements.hasElements() )
{
nLabelPlacement = aAvailablePlacements[0];
+ if( xPointProps.is() )
+ xPointProps->setPropertyValue("LabelPlacement", uno::Any(nLabelPlacement));
return nLabelPlacement;
}
More information about the Libreoffice-commits
mailing list