diff options
author | Eike Rathke <erack@redhat.com> | 2015-11-27 21:32:09 +0100 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2015-11-27 23:21:35 +0100 |
commit | 7340872a3450e38a7f820945585a9ee60b2a9d41 (patch) | |
tree | 007d8950d9a432b1ec15def61a111c77b9fbb1bd /sc/source | |
parent | 2011b5412c4daa47bc5624a2efc996960e19c2a9 (diff) |
use SvNumberFormatter::GetFormatStringForExcel()
Change-Id: I4d5f8aa33fffceaa080d8b2ef6a177b4680cf761
Diffstat (limited to 'sc/source')
-rw-r--r-- | sc/source/filter/excel/xestyle.cxx | 43 |
1 files changed, 2 insertions, 41 deletions
diff --git a/sc/source/filter/excel/xestyle.cxx b/sc/source/filter/excel/xestyle.cxx index be7a00501552..55ebdcf7975b 100644 --- a/sc/source/filter/excel/xestyle.cxx +++ b/sc/source/filter/excel/xestyle.cxx @@ -1433,48 +1433,9 @@ void XclExpNumFmtBuffer::WriteFormatRecord( XclExpStream& rStrm, const XclExpNum namespace { -OUString GetNumberFormatCode(XclRoot& rRoot, const sal_uInt16 nScNumFmt, SvNumberFormatter* xFormatter, NfKeywordTable* pKeywordTable) +OUString GetNumberFormatCode(XclRoot& rRoot, const sal_uInt16 nScNumFmt, SvNumberFormatter* pFormatter, NfKeywordTable* pKeywordTable) { - OUString aFormatStr; - - if( const SvNumberformat* pEntry = rRoot.GetFormatter().GetEntry( nScNumFmt ) ) - { - if( pEntry->GetType() == css::util::NumberFormat::LOGICAL ) - { - // build Boolean number format - Color* pColor = nullptr; - OUString aTemp; - const_cast< SvNumberformat* >( pEntry )->GetOutputString( 1.0, aTemp, &pColor ); - aFormatStr += "\"" + aTemp + "\";\"" + aTemp + "\";\""; - const_cast< SvNumberformat* >( pEntry )->GetOutputString( 0.0, aTemp, &pColor ); - aFormatStr += aTemp + "\""; - } - else - { - LanguageType eLang = pEntry->GetLanguage(); - if( eLang != LANGUAGE_ENGLISH_US ) - { - sal_Int32 nCheckPos; - short nType = css::util::NumberFormat::DEFINED; - sal_uInt32 nKey; - OUString aTemp( pEntry->GetFormatstring() ); - xFormatter->PutandConvertEntry( aTemp, nCheckPos, nType, nKey, eLang, LANGUAGE_ENGLISH_US ); - OSL_ENSURE( nCheckPos == 0, "XclExpNumFmtBuffer::WriteFormatRecord - format code not convertible" ); - pEntry = xFormatter->GetEntry( nKey ); - } - - aFormatStr = pEntry->GetMappedFormatstring( *pKeywordTable, *xFormatter->GetLocaleData() ); - if( aFormatStr == "Standard" ) - aFormatStr = "General"; - } - } - else - { - OSL_FAIL( "XclExpNumFmtBuffer::WriteFormatRecord - format not found" ); - aFormatStr = "General"; - } - - return aFormatStr; + return rRoot.GetFormatter().GetFormatStringForExcel( nScNumFmt, *pKeywordTable, *pFormatter); } } |