Kaydet (Commit) c8cc89ff authored tarafından Matúš Kukan's avatar Matúš Kukan

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
üst 5f47e319
...@@ -33,8 +33,7 @@ NumberFormat::NumberFormat() : ...@@ -33,8 +33,7 @@ NumberFormat::NumberFormat() :
void NumberFormat::setAttributes( const AttributeList& rAttribs ) void NumberFormat::setAttributes( const AttributeList& rAttribs )
{ {
maFormatCode = rAttribs.getString( XML_formatCode, OUString() ); maFormatCode = rAttribs.getString( XML_formatCode, OUString() );
// default is 'false', not 'true' as specified // TODO: if XML_sourceLinked is true, <c:formatCode> should be used instead.
mbSourceLinked = rAttribs.getBool( XML_sourceLinked, false );
} }
LayoutModel::LayoutModel() : LayoutModel::LayoutModel() :
......
...@@ -1106,7 +1106,9 @@ void ObjectFormatter::convertNumberFormat( PropertySet& rPropSet, const NumberFo ...@@ -1106,7 +1106,9 @@ void ObjectFormatter::convertNumberFormat( PropertySet& rPropSet, const NumberFo
append( OUStringToOString( rNumberFormat.maFormatCode, osl_getThreadTextEncoding() ) ).append( '\'' ).getStr() ); 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()));
} }
} }
......
...@@ -253,9 +253,8 @@ void DataLabelsConverter::convertFromModel( const Reference< XDataSeries >& rxDa ...@@ -253,9 +253,8 @@ void DataLabelsConverter::convertFromModel( const Reference< XDataSeries >& rxDa
// data point label settings // data point label settings
for( DataLabelsModel::DataLabelVector::iterator aIt = mrModel.maPointLabels.begin(), aEnd = mrModel.maPointLabels.end(); aIt != aEnd; ++aIt ) for( DataLabelsModel::DataLabelVector::iterator aIt = mrModel.maPointLabels.begin(), aEnd = mrModel.maPointLabels.end(); aIt != aEnd; ++aIt )
{ {
(*aIt)->maNumberFormat.maFormatCode = mrModel.maNumberFormat.maFormatCode; if ((*aIt)->maNumberFormat.maFormatCode.isEmpty())
if( !mrModel.maNumberFormat.maFormatCode.isEmpty() ) (*aIt)->maNumberFormat = mrModel.maNumberFormat;
(*aIt)->maNumberFormat.mbSourceLinked = false;
DataLabelConverter aLabelConv( *this, **aIt ); DataLabelConverter aLabelConv( *this, **aIt );
aLabelConv.convertFromModel( rxDataSeries, rTypeGroup ); aLabelConv.convertFromModel( rxDataSeries, rTypeGroup );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment