xmloff/source/chart/SchXMLExport.cxx |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

New commits:
commit b493ee37f3347b442a28ccff272ed373149041b6
Author:     Ouyang Leyan <ouyang.le...@hotmail.com>
AuthorDate: Wed Dec 16 22:13:58 2020 +0100
Commit:     Xisco Fauli <xiscofa...@libreoffice.org>
CommitDate: Fri Feb 12 09:34:23 2021 +0100

    tdf#136011 convert numbers in categories to string during chart export
    
    When converting a Calc chart to a chart with an internal data source,
    multi-level categories consisting only in numbers are exported as
    double and not string. However, labels could only be generated from
    string values so the labels were lost in the converted chart. This
    commit allows labels to be generated from double values.
    
    Change-Id: I1cc1059f5157b782beb3eefccda5257b1bc2ca29
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107858
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>
    (cherry picked from commit 4a9d257bec7964c0b611b2d422b7842fc5ee38e0)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110775
    Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org>

diff --git a/xmloff/source/chart/SchXMLExport.cxx 
b/xmloff/source/chart/SchXMLExport.cxx
index 4c526f9b8236..b33ebb1ac054 100644
--- a/xmloff/source/chart/SchXMLExport.cxx
+++ b/xmloff/source/chart/SchXMLExport.cxx
@@ -1550,7 +1550,11 @@ static void lcl_exportComplexLabel( const Sequence< 
uno::Any >& rComplexLabel, S
         OUString aString;
         if( !(rElem >>= aString) )
         {
-            //todo?
+            double aNum;
+            if (rElem >>= aNum)
+            {
+                aString = OUString::number(aNum);
+            }
         }
         SchXMLTools::exportText( rExport, aString, false /*bConvertTabsLFs*/ );
     }
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to