Kaydet (Commit) 4b81e616 authored tarafından Laurent Balland-Poirier's avatar Laurent Balland-Poirier Kaydeden (comit) Eike Rathke

tdf#102370 Correctly export to Excel exponent without sign

Exponent without sign in scientific notation is coded in Excel with a minus
sign replacing plus sign: 0.00E-00 for instance
This format is already correctly treated in Calc but was not correctly
exported to Excel or ODF

Change-Id: Ide117b04e0eb887c6cdd6699ae8ec723d1d29d50
Reviewed-on: https://gerrit.libreoffice.org/29198Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarEike Rathke <erack@redhat.com>
üst 9d19634c
......@@ -4806,9 +4806,12 @@ OUString SvNumberformat::GetMappedFormatstring( const NfKeywordTable& rKeywords,
aStr.append( rLocWrp.getNumThousandSep() );
break;
case NF_SYMBOLTYPE_EXP :
// tdf#95677: Excel does not support exponent without sign
aStr.append( rKeywords[NF_KEY_E] );
aStr.append( "+" );
if ( pStr[j].getLength() > 1 && pStr[j][1] == '+' )
aStr.append( "+" );
else
// tdf#102370: Excel code for exponent without sign
aStr.append( "-" );
break;
case NF_SYMBOLTYPE_DATESEP :
aStr.append( rLocWrp.getDateSep() );
......
......@@ -1321,8 +1321,9 @@ void SvXMLNumFmtExport::ExportPart_Impl( const SvNumberformat& rFormat, sal_uInt
case NF_SYMBOLTYPE_EXP:
bExpFound = true; // following digits are exponent digits
bInInteger = false;
if ( pElemStr && pElemStr->getLength() == 1 )
bExpSign = false; // for 0.00E0
if ( pElemStr && ( pElemStr->getLength() == 1
|| ( pElemStr->getLength() == 2 && (*pElemStr)[1] == '-' ) ) )
bExpSign = false; // for 0.00E0 or 0.00E-00
break;
case NF_SYMBOLTYPE_CURRENCY:
bCurrFound = true;
......
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