[Libreoffice-commits] core.git: Branch 'distro/nisz/libreoffice-7-0' - chart2/source

Balazs Varga (via logerrit) logerrit at kemper.freedesktop.org
Thu Feb 18 15:08:59 UTC 2021


 chart2/source/controller/itemsetwrapper/DataPointItemConverter.cxx |    1 +
 chart2/source/controller/itemsetwrapper/TextLabelItemConverter.cxx |    1 +
 chart2/source/controller/main/ChartController_Tools.cxx            |    8 ++++++--
 chart2/source/tools/DataSeriesHelper.cxx                           |    2 ++
 4 files changed, 10 insertions(+), 2 deletions(-)

New commits:
commit 16babc553294b676d7cdbbca9bb2e90cb46e484d
Author:     Balazs Varga <balazs.varga991 at gmail.com>
AuthorDate: Wed Sep 2 15:09:01 2020 +0200
Commit:     Gabor Kelemen <kelemen.gabor2 at nisz.hu>
CommitDate: Thu Feb 18 16:08:22 2021 +0100

    tdf#136402 Chart View: remove custom label text
    
    Now Delete Data Labels and Insert Data Labels local
    menu options remove custom label text instead of keeping it.
    See with unit test document custom_data_label.xlsx of
    commit bcda268cde1f8408c2066ce985acedfce3e3bc2e
    (tdf#134977 Chart OOXML: fix import of custom data label).
    
    Change-Id: Ifc7afd0f2ece9da528e6206a6bd393b394b36f9e
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101929
    Tested-by: László Németh <nemeth at numbertext.org>
    Reviewed-by: László Németh <nemeth at numbertext.org>
    (cherry picked from commit 0dce53516011f5d2d9408501714e2b1865517119)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111142
    Tested-by: Gabor Kelemen <kelemen.gabor2 at nisz.hu>
    Reviewed-by: Gabor Kelemen <kelemen.gabor2 at nisz.hu>

diff --git a/chart2/source/controller/itemsetwrapper/DataPointItemConverter.cxx b/chart2/source/controller/itemsetwrapper/DataPointItemConverter.cxx
index 4920d2b727e0..1dcfc4c27321 100644
--- a/chart2/source/controller/itemsetwrapper/DataPointItemConverter.cxx
+++ b/chart2/source/controller/itemsetwrapper/DataPointItemConverter.cxx
@@ -338,6 +338,7 @@ bool DataPointItemConverter::ApplySpecialItem(
                         DataSeriesHelper::hasAttributedDataPointDifferentValue( xSeries, CHART_UNONAME_LABEL , aOldValue ) )
                     {
                         DataSeriesHelper::setPropertyAlsoToAllAttributedDataPoints( xSeries, CHART_UNONAME_LABEL , uno::Any( aLabel ) );
+                        DataSeriesHelper::setPropertyAlsoToAllAttributedDataPoints( xSeries, CHART_UNONAME_CUSTOM_LABEL_FIELDS, uno::Any() );
                         bChanged = true;
                     }
                 }
diff --git a/chart2/source/controller/itemsetwrapper/TextLabelItemConverter.cxx b/chart2/source/controller/itemsetwrapper/TextLabelItemConverter.cxx
index 496b25e2692f..d96b56a26f2e 100644
--- a/chart2/source/controller/itemsetwrapper/TextLabelItemConverter.cxx
+++ b/chart2/source/controller/itemsetwrapper/TextLabelItemConverter.cxx
@@ -286,6 +286,7 @@ bool TextLabelItemConverter::ApplySpecialItem( sal_uInt16 nWhichId, const SfxIte
                         DataSeriesHelper::hasAttributedDataPointDifferentValue(xSeries, CHART_UNONAME_LABEL, aOldValue))
                     {
                         DataSeriesHelper::setPropertyAlsoToAllAttributedDataPoints(xSeries, CHART_UNONAME_LABEL, uno::Any(aLabel));
+                        DataSeriesHelper::setPropertyAlsoToAllAttributedDataPoints(xSeries, CHART_UNONAME_CUSTOM_LABEL_FIELDS, uno::Any());
                         bChanged = true;
                     }
                 }
diff --git a/chart2/source/controller/main/ChartController_Tools.cxx b/chart2/source/controller/main/ChartController_Tools.cxx
index bf2b97f5773b..34b33d2f84d3 100644
--- a/chart2/source/controller/main/ChartController_Tools.cxx
+++ b/chart2/source/controller/main/ChartController_Tools.cxx
@@ -764,10 +764,14 @@ bool ChartController::executeDispatch_Delete()
                     if( aObjectType == OBJECTTYPE_DATA_LABELS )
                     {
                         uno::Reference< chart2::XDataSeries > xSeries( ObjectIdentifier::getDataSeriesForCID( aCID, getModel() ));
-                        ::chart::DataSeriesHelper::setPropertyAlsoToAllAttributedDataPoints( xSeries, CHART_UNONAME_LABEL, uno::Any(aLabel) );
+                        DataSeriesHelper::setPropertyAlsoToAllAttributedDataPoints( xSeries, CHART_UNONAME_LABEL, uno::Any(aLabel) );
+                        DataSeriesHelper::setPropertyAlsoToAllAttributedDataPoints( xSeries, CHART_UNONAME_CUSTOM_LABEL_FIELDS, uno::Any() );
                     }
                     else
-                        xObjectProperties->setPropertyValue( CHART_UNONAME_LABEL, uno::Any(aLabel) );
+                    {
+                        xObjectProperties->setPropertyValue(CHART_UNONAME_LABEL, uno::Any(aLabel));
+                        xObjectProperties->setPropertyValue(CHART_UNONAME_CUSTOM_LABEL_FIELDS, uno::Any());
+                    }
                     bReturn = true;
                     aUndoGuard.commit();
                 }
diff --git a/chart2/source/tools/DataSeriesHelper.cxx b/chart2/source/tools/DataSeriesHelper.cxx
index c5fd3e43fb2f..82c41fb74c56 100644
--- a/chart2/source/tools/DataSeriesHelper.cxx
+++ b/chart2/source/tools/DataSeriesHelper.cxx
@@ -173,6 +173,7 @@ void lcl_insertOrDeleteDataLabelsToSeriesAndAllPoints( const Reference< chart2::
                             aLabel.ShowCustomLabel = false;
                         }
                         xPointProp->setPropertyValue(CHART_UNONAME_LABEL, uno::Any(aLabel));
+                        xPointProp->setPropertyValue(CHART_UNONAME_CUSTOM_LABEL_FIELDS, uno::Any());
                     }
                 }
             }
@@ -838,6 +839,7 @@ void deleteDataLabelsFromPoint( const Reference< beans::XPropertySet >& xPointPr
             aLabel.ShowCategoryName = false;
             aLabel.ShowCustomLabel = false;
             xPointProp->setPropertyValue(CHART_UNONAME_LABEL, uno::Any(aLabel));
+            xPointProp->setPropertyValue(CHART_UNONAME_CUSTOM_LABEL_FIELDS, uno::Any());
         }
     }
     catch(const uno::Exception &)


More information about the Libreoffice-commits mailing list