diff options
author | Dennis Francis <dennis.francis@collabora.co.uk> | 2017-07-31 10:52:55 +0530 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2017-08-02 07:44:58 +0200 |
commit | d8e731adb8608aab17385e02f4441ed3122efa40 (patch) | |
tree | 52c3a694d6d4e768ace0fdfe6cd87285665218ab /sc/source/filter/excel/xichart.cxx | |
parent | 95c2f226b122c7fdb77c6e9085b1fbd02189db03 (diff) |
tdf#90352: set/handle LinkNumberFormatToSource property in xls...
Import/Export filter respectively for axis numbers. For ods and
xlsx this was already getting set/handled correctly.
Also add unit test to assert LinkNumberFormatToSource property
and number format for import and export-import roundtrip.
Change-Id: Id029ac7d0233ca490a6a00609e9cea8fdafee70f
Reviewed-on: https://gerrit.libreoffice.org/40577
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Diffstat (limited to 'sc/source/filter/excel/xichart.cxx')
-rw-r--r-- | sc/source/filter/excel/xichart.cxx | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/sc/source/filter/excel/xichart.cxx b/sc/source/filter/excel/xichart.cxx index cb04ee83c429..6e51af689c1a 100644 --- a/sc/source/filter/excel/xichart.cxx +++ b/sc/source/filter/excel/xichart.cxx @@ -3323,9 +3323,18 @@ Reference< XAxis > XclImpChAxis::CreateAxis( const XclImpChTypeGroup& rTypeGroup // label text rotation ConvertRotationBase( aAxisProp, true ); // number format - sal_uInt32 nScNumFmt = GetNumFmtBuffer().GetScFormat( mnNumFmtIdx ); - if( nScNumFmt != NUMBERFORMAT_ENTRY_NOT_FOUND ) - aAxisProp.SetProperty( EXC_CHPROP_NUMBERFORMAT, static_cast< sal_Int32 >( nScNumFmt ) ); + bool bLinkNumberFmtToSource = true; + if ( mnNumFmtIdx != EXC_FORMAT_NOTFOUND ) + { + sal_uInt32 nScNumFmt = GetNumFmtBuffer().GetScFormat( mnNumFmtIdx ); + if( nScNumFmt != NUMBERFORMAT_ENTRY_NOT_FOUND ) + { + aAxisProp.SetProperty( EXC_CHPROP_NUMBERFORMAT, static_cast< sal_Int32 >( nScNumFmt ) ); + bLinkNumberFmtToSource = false; + } + } + + aAxisProp.SetProperty( EXC_CHPROP_NUMBERFORMAT_LINKSRC, bLinkNumberFmtToSource ); } // axis scaling and increment ----------------------------------------- |