chart2/source/view/charttypes/VSeriesPlotter.cxx             |    5 +++++
 offapi/com/sun/star/chart2/DataPointCustomLabelFieldType.idl |    5 +++--
 oox/source/drawingml/chart/seriesconverter.cxx               |    2 ++
 3 files changed, 10 insertions(+), 2 deletions(-)

New commits:
commit e360137531d2686815a95596bba121db1e6738ff
Author:     Tamas Bunth <tamas.bu...@collabora.co.uk>
AuthorDate: Wed Jan 1 15:31:40 2020 +0100
Commit:     Andras Timar <andras.ti...@collabora.com>
CommitDate: Mon Jan 6 14:47:56 2020 +0100

    tdf#125444 Percentage as custom chart label
    
    Support importing ooxml charts with a field of type "PERCENTAGE" as
    custom label.
    
    Change-Id: Ie8931f77e3b6199d98635422d11d776e675f6e5c
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86067
    Tested-by: Jenkins
    Reviewed-by: Tamás Bunth <btom...@gmail.com>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86118
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>
    Reviewed-by: Andras Timar <andras.ti...@collabora.com>

diff --git a/chart2/source/view/charttypes/VSeriesPlotter.cxx 
b/chart2/source/view/charttypes/VSeriesPlotter.cxx
index 7a45aa8b2d13..923555fad41f 100644
--- a/chart2/source/view/charttypes/VSeriesPlotter.cxx
+++ b/chart2/source/view/charttypes/VSeriesPlotter.cxx
@@ -543,6 +543,11 @@ uno::Reference< drawing::XShape > 
VSeriesPlotter::createDataLabel( const uno::Re
                         aTextList[i] = DataSeriesHelper::getDataSeriesLabel( 
xSeries, aRole );
                         break;
                     }
+                    case DataPointCustomLabelFieldType_PERCENTAGE:
+                    {
+                        aTextList[i] = getLabelTextForValue( rDataSeries, 
nPointIndex, fValue, true );
+                        break;
+                    }
                     case DataPointCustomLabelFieldType_CELLREF:
                     {
                         // TODO: for now doesn't show placeholder
diff --git a/offapi/com/sun/star/chart2/DataPointCustomLabelFieldType.idl 
b/offapi/com/sun/star/chart2/DataPointCustomLabelFieldType.idl
index 0b7f925342a6..05c26a738684 100644
--- a/offapi/com/sun/star/chart2/DataPointCustomLabelFieldType.idl
+++ b/offapi/com/sun/star/chart2/DataPointCustomLabelFieldType.idl
@@ -23,11 +23,12 @@ enum DataPointCustomLabelFieldType
     SERIESNAME,
     CATEGORYNAME,
     CELLREF,
-    NEWLINE
+    NEWLINE,
+    PERCENTAGE
 };
 
 }; }; }; };
 
 #endif
 
-/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s 
cinkeys+=0=break: */
\ No newline at end of file
+/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s 
cinkeys+=0=break: */
diff --git a/oox/source/drawingml/chart/seriesconverter.cxx 
b/oox/source/drawingml/chart/seriesconverter.cxx
index 01e1d72562c5..8397b190fb8a 100644
--- a/oox/source/drawingml/chart/seriesconverter.cxx
+++ b/oox/source/drawingml/chart/seriesconverter.cxx
@@ -245,6 +245,8 @@ DataPointCustomLabelFieldType 
lcl_ConvertFieldNameToFieldEnum( const OUString& r
         return 
DataPointCustomLabelFieldType::DataPointCustomLabelFieldType_CATEGORYNAME;
     else if (rField == "CELLREF")
         return 
DataPointCustomLabelFieldType::DataPointCustomLabelFieldType_CELLREF;
+    else if (rField == "PERCENTAGE")
+        return 
DataPointCustomLabelFieldType::DataPointCustomLabelFieldType_PERCENTAGE;
     else
         return 
DataPointCustomLabelFieldType::DataPointCustomLabelFieldType_TEXT;
 }
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to