diff options
author | Kohei Yoshida <kohei.yoshida@collabora.com> | 2014-07-07 13:26:23 -0400 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2014-07-10 10:08:32 +0200 |
commit | 74a22d42753350039ee8fcdb5e6df1e0807c0cca (patch) | |
tree | 349537796caf6bfad82c862358d3b143b35e3c1b /oox | |
parent | 2b8f66388450fcf7fb2f8087ee7c66c142fe72c0 (diff) |
Adjust for the splitting of number format properties in chart.
Since 1d38cb365543924f9c50014e6b2227e77de1d0c9, "number format" and
"link number format to source" properties are 2 separate properties. Adjust
OOXML import code for that split.
Also, always set axis' number format via NumberFormat property even when it's
a percent format. The axis object doesn't keep a non-percent and percent
number formats separately.
Change-Id: I8667b6f1a78d88cc37d059518919ad1b37f154e1
(cherry picked from commit af5a6615dfdbe5c2cacdcacb00fc6f418b925c06)
(cherry picked from commit 29d5f3db525e275c62cd2eafb18899fe68198ea3)
Signed-off-by: Andras Timar <andras.timar@collabora.com>
Diffstat (limited to 'oox')
-rw-r--r-- | oox/source/drawingml/chart/axisconverter.cxx | 8 | ||||
-rw-r--r-- | oox/source/drawingml/chart/objectformatter.cxx | 8 | ||||
-rw-r--r-- | oox/source/token/properties.txt | 1 |
3 files changed, 5 insertions, 12 deletions
diff --git a/oox/source/drawingml/chart/axisconverter.cxx b/oox/source/drawingml/chart/axisconverter.cxx index da1a732f192c..f29099224f73 100644 --- a/oox/source/drawingml/chart/axisconverter.cxx +++ b/oox/source/drawingml/chart/axisconverter.cxx @@ -307,13 +307,7 @@ void AxisConverter::convertFromModel( const Reference< XCoordinateSystem >& rxCo // number format ------------------------------------------------------ if( (aScaleData.AxisType == cssc2::AxisType::REALNUMBER) || (aScaleData.AxisType == cssc2::AxisType::PERCENT) ) - { - bool bPercent = false; - if( mrModel.maNumberFormat.maFormatCode.indexOf('%') >= 0) - bPercent = true; - mrModel.maNumberFormat.mbSourceLinked = false; - getFormatter().convertNumberFormat( aAxisProp, mrModel.maNumberFormat, bPercent ); - } + getFormatter().convertNumberFormat(aAxisProp, mrModel.maNumberFormat, false); // position of crossing axis ------------------------------------------ diff --git a/oox/source/drawingml/chart/objectformatter.cxx b/oox/source/drawingml/chart/objectformatter.cxx index a69dae046166..b5b0a5b4d37b 100644 --- a/oox/source/drawingml/chart/objectformatter.cxx +++ b/oox/source/drawingml/chart/objectformatter.cxx @@ -1111,11 +1111,7 @@ void ObjectFormatter::convertNumberFormat( PropertySet& rPropSet, const NumberFo if( mxData->mxNumFmts.is() ) { sal_Int32 nPropId = bPercentFormat ? PROP_PercentageNumberFormat : PROP_NumberFormat; - if( rNumberFormat.mbSourceLinked || rNumberFormat.maFormatCode.isEmpty() ) - { - rPropSet.setAnyProperty( nPropId, Any() ); - } - else try + try { sal_Int32 nIndex = rNumberFormat.maFormatCode.equalsIgnoreAsciiCase("general") ? mxData->mxNumTypes->getStandardIndex( mxData->maFromLocale ) : @@ -1128,6 +1124,8 @@ void ObjectFormatter::convertNumberFormat( PropertySet& rPropSet, const NumberFo OSL_FAIL( OStringBuffer( "ObjectFormatter::convertNumberFormat - cannot create number format '" ). append( OUStringToOString( rNumberFormat.maFormatCode, osl_getThreadTextEncoding() ) ).append( '\'' ).getStr() ); } + + rPropSet.setProperty(PROP_LinkNumberFormatToSource, makeAny(rNumberFormat.mbSourceLinked)); } } diff --git a/oox/source/token/properties.txt b/oox/source/token/properties.txt index b0001e3160de..6d384b89c1cd 100644 --- a/oox/source/token/properties.txt +++ b/oox/source/token/properties.txt @@ -291,6 +291,7 @@ LineStartWidth LineStyle LineTransparence LineWidth +LinkNumberFormatToSource LinkURL LoadReadonly LookUpLabels |