From 9672d034b9e760f24ac9a6652ab45dee15ee260a Mon Sep 17 00:00:00 2001 From: Eike Rathke Date: Tue, 16 Oct 2018 12:03:24 +0200 Subject: Resolves: tdf#115182 default Chart percentage format is integer Regression from commit 0f4b3cb7d3d68906de316a64dcec281da2a641bd CommitDate: Mon Aug 10 17:12:45 2015 +0200 The chart2/qa/extras/xshape/data/reference/tdf90839-?.xml reference files were created with the then wrong default of two decimals so need to be adapted. For chart2/qa/extras/xshape/data/reference/tdf90839-1.xml this meant to regenerate because of the changed positions and sizes of labels. Change-Id: Ib0c2c862af9399ab2af5178d01510aa5e4fff97c Reviewed-on: https://gerrit.libreoffice.org/61826 Tested-by: Jenkins Reviewed-by: Eike Rathke --- .../qa/extras/xshape/data/reference/tdf90839-1.xml | 68 +++++++++++----------- .../qa/extras/xshape/data/reference/tdf90839-2.xml | 10 ++-- .../qa/extras/xshape/data/reference/tdf90839-3.xml | 10 ++-- .../qa/extras/xshape/data/reference/tdf90839-4.xml | 10 ++-- chart2/source/tools/DiagramHelper.cxx | 6 +- 5 files changed, 54 insertions(+), 50 deletions(-) diff --git a/chart2/qa/extras/xshape/data/reference/tdf90839-1.xml b/chart2/qa/extras/xshape/data/reference/tdf90839-1.xml index 7dcbab785af3..3a5070283565 100644 --- a/chart2/qa/extras/xshape/data/reference/tdf90839-1.xml +++ b/chart2/qa/extras/xshape/data/reference/tdf90839-1.xml @@ -175,15 +175,15 @@ - + - + - + - + - + @@ -192,21 +192,21 @@ - - + + - - + + - + - + @@ -215,21 +215,21 @@ - - + + - - + + - + @@ -250,9 +250,9 @@ - + - + @@ -261,21 +261,21 @@ - - + + - - + + - + - + @@ -284,36 +284,36 @@ - - + + - - + + - - + + - - + + - - + + diff --git a/chart2/qa/extras/xshape/data/reference/tdf90839-2.xml b/chart2/qa/extras/xshape/data/reference/tdf90839-2.xml index 489b346d4170..b90bf060b694 100644 --- a/chart2/qa/extras/xshape/data/reference/tdf90839-2.xml +++ b/chart2/qa/extras/xshape/data/reference/tdf90839-2.xml @@ -183,7 +183,7 @@ - + @@ -206,7 +206,7 @@ - + @@ -229,7 +229,7 @@ - + @@ -252,7 +252,7 @@ - + @@ -275,7 +275,7 @@ - + diff --git a/chart2/qa/extras/xshape/data/reference/tdf90839-3.xml b/chart2/qa/extras/xshape/data/reference/tdf90839-3.xml index 5355dae222e9..1f4ad369b8d0 100644 --- a/chart2/qa/extras/xshape/data/reference/tdf90839-3.xml +++ b/chart2/qa/extras/xshape/data/reference/tdf90839-3.xml @@ -183,7 +183,7 @@ - + @@ -206,7 +206,7 @@ - + @@ -229,7 +229,7 @@ - + @@ -252,7 +252,7 @@ - + @@ -275,7 +275,7 @@ - + diff --git a/chart2/qa/extras/xshape/data/reference/tdf90839-4.xml b/chart2/qa/extras/xshape/data/reference/tdf90839-4.xml index a60a7afb5d48..22ba48ae1420 100644 --- a/chart2/qa/extras/xshape/data/reference/tdf90839-4.xml +++ b/chart2/qa/extras/xshape/data/reference/tdf90839-4.xml @@ -183,7 +183,7 @@ - + @@ -206,7 +206,7 @@ - + @@ -229,7 +229,7 @@ - + @@ -252,7 +252,7 @@ - + @@ -275,7 +275,7 @@ - + diff --git a/chart2/source/tools/DiagramHelper.cxx b/chart2/source/tools/DiagramHelper.cxx index b372114ea891..c3d9104e8e98 100644 --- a/chart2/source/tools/DiagramHelper.cxx +++ b/chart2/source/tools/DiagramHelper.cxx @@ -1182,7 +1182,7 @@ sal_Int32 DiagramHelper::getPercentNumberFormat( const Reference< util::XNumberF SvNumberFormatter* pNumFormatter = aNumberFormatterWrapper.getSvNumberFormatter(); if( pNumFormatter ) { - nRet = pNumFormatter->GetStandardFormat( SvNumFormatType::PERCENT, rLanguageTag.getLanguageType() ); + nRet = pNumFormatter->GetFormatIndex( NF_PERCENT_INT, rLanguageTag.getLanguageType() ); } else { @@ -1193,6 +1193,10 @@ sal_Int32 DiagramHelper::getPercentNumberFormat( const Reference< util::XNumberF rLanguageTag.getLocale(), true/*bCreate*/ ); if( aKeySeq.getLength() ) { + // This *assumes* the sequence is sorted as in + // NfIndexTableOffset and the first format is the integer 0% + // format by chance.. which usually is the case, but.. anyway, + // we usually also have a number formatter so don't reach here. nRet = aKeySeq[0]; } } -- cgit