[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - oox/source

Matúš Kukan matus.kukan at collabora.com
Sun Aug 10 23:34:53 PDT 2014


 oox/source/drawingml/chart/modelbase.cxx       |    3 +--
 oox/source/drawingml/chart/objectformatter.cxx |    4 +++-
 oox/source/drawingml/chart/seriesconverter.cxx |    5 ++---
 3 files changed, 6 insertions(+), 6 deletions(-)

New commits:
commit 4744400afc9c2be99f62b12180fa33b43acef564
Author: Matúš Kukan <matus.kukan at collabora.com>
Date:   Tue Jul 29 21:10:22 2014 +0200

    Fix some number format issues, bnc#862510
    
    Set "LinkNumberFormatToSource" to false, so that format code is not
    ignored.
    Also, do not inherit format code common for all labels, if there is
    specific format code for a data label.
    
    Change-Id: I505311d5df641d61e616e354734bd332609fa122
    (cherry picked from commit c8cc89ff802d86b1f3a69afe1b4835b7df7f70c7)
    Reviewed-on: https://gerrit.libreoffice.org/10780
    Reviewed-by: David Tardon <dtardon at redhat.com>
    Tested-by: David Tardon <dtardon at redhat.com>

diff --git a/oox/source/drawingml/chart/modelbase.cxx b/oox/source/drawingml/chart/modelbase.cxx
index d1e87eb..79af50b 100644
--- a/oox/source/drawingml/chart/modelbase.cxx
+++ b/oox/source/drawingml/chart/modelbase.cxx
@@ -34,8 +34,7 @@ NumberFormat::NumberFormat() :
 void NumberFormat::setAttributes( const AttributeList& rAttribs )
 {
     maFormatCode = rAttribs.getString( XML_formatCode, OUString() );
-    // default is 'false', not 'true' as specified
-    mbSourceLinked = rAttribs.getBool( XML_sourceLinked, false );
+    // TODO: if XML_sourceLinked is true, <c:formatCode> should be used instead.
 }
 
 
diff --git a/oox/source/drawingml/chart/objectformatter.cxx b/oox/source/drawingml/chart/objectformatter.cxx
index 54b41cc..6360fc2 100644
--- a/oox/source/drawingml/chart/objectformatter.cxx
+++ b/oox/source/drawingml/chart/objectformatter.cxx
@@ -1150,7 +1150,9 @@ void ObjectFormatter::convertNumberFormat( PropertySet& rPropSet, const NumberFo
                 append( OUStringToOString( rNumberFormat.maFormatCode, osl_getThreadTextEncoding() ) ).append( '\'' ).getStr() );
         }
 
-        rPropSet.setProperty(PROP_LinkNumberFormatToSource, makeAny(rNumberFormat.mbSourceLinked));
+        // Format code is ignored if "LinkNumberFormatToSource" is set to "true" :-/
+        // See AxisHelper::getExplicitNumberFormatKeyForAxis()
+        rPropSet.setProperty(PROP_LinkNumberFormatToSource, makeAny(rNumberFormat.maFormatCode.isEmpty()));
     }
 }
 
diff --git a/oox/source/drawingml/chart/seriesconverter.cxx b/oox/source/drawingml/chart/seriesconverter.cxx
index bcb8d60..6febc3f 100644
--- a/oox/source/drawingml/chart/seriesconverter.cxx
+++ b/oox/source/drawingml/chart/seriesconverter.cxx
@@ -253,9 +253,8 @@ void DataLabelsConverter::convertFromModel( const Reference< XDataSeries >& rxDa
     // data point label settings
     for( DataLabelsModel::DataLabelVector::iterator aIt = mrModel.maPointLabels.begin(), aEnd = mrModel.maPointLabels.end(); aIt != aEnd; ++aIt )
     {
-        (*aIt)->maNumberFormat.maFormatCode = mrModel.maNumberFormat.maFormatCode;
-        if( !mrModel.maNumberFormat.maFormatCode.isEmpty() )
-            (*aIt)->maNumberFormat.mbSourceLinked = false;
+        if ((*aIt)->maNumberFormat.maFormatCode.isEmpty())
+            (*aIt)->maNumberFormat = mrModel.maNumberFormat;
 
         DataLabelConverter aLabelConv( *this, **aIt );
         aLabelConv.convertFromModel( rxDataSeries, rTypeGroup );


More information about the Libreoffice-commits mailing list