summaryrefslogtreecommitdiff
path: root/sc/source/filter
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2015-11-27 21:32:09 +0100
committerEike Rathke <erack@redhat.com>2015-11-28 00:29:41 +0100
commit34d043b214fa97ab828e68e5d324d493485cbe9b (patch)
tree63822609bcb6e299c68f32770892cd15017e07aa /sc/source/filter
parentf9c565ff7c8c65610890af50eda560a56e2d03af (diff)
use SvNumberFormatter::GetFormatStringForExcel()
Change-Id: I4d5f8aa33fffceaa080d8b2ef6a177b4680cf761 (cherry picked from commit 7340872a3450e38a7f820945585a9ee60b2a9d41)
Diffstat (limited to 'sc/source/filter')
-rw-r--r--sc/source/filter/excel/xestyle.cxx43
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);
}
}