diff options
Diffstat (limited to 'xmloff/source/style/xmlnumfe.cxx')
-rw-r--r-- | xmloff/source/style/xmlnumfe.cxx | 45 |
1 files changed, 17 insertions, 28 deletions
diff --git a/xmloff/source/style/xmlnumfe.cxx b/xmloff/source/style/xmlnumfe.cxx index 9b22f1a39e29..6124414ffe5b 100644 --- a/xmloff/source/style/xmlnumfe.cxx +++ b/xmloff/source/style/xmlnumfe.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -43,9 +44,6 @@ #include <com/sun/star/lang/Locale.hpp> #include <rtl/ustrbuf.hxx> -// #110680# -//#include <comphelper/processfactory.hxx> - #include <com/sun/star/i18n/NativeNumberXmlAttributes.hpp> #include <xmloff/xmlnumfe.hxx> @@ -73,8 +71,6 @@ using namespace ::svt; //------------------------------------------------------------------------- -// 4th condition for text formats doesn't work -//#define XMLNUM_MAX_PARTS 4 #define XMLNUM_MAX_PARTS 3 //------------------------------------------------------------------------- @@ -160,25 +156,25 @@ void SvXMLNumUsedList_Impl::SetUsed( sal_uInt32 nKey ) sal_Bool SvXMLNumUsedList_Impl::IsUsed( sal_uInt32 nKey ) const { - SvXMLuInt32Set::iterator aItr = aUsed.find(nKey); + SvXMLuInt32Set::const_iterator aItr = aUsed.find(nKey); return (aItr != aUsed.end()); } sal_Bool SvXMLNumUsedList_Impl::IsWasUsed( sal_uInt32 nKey ) const { - SvXMLuInt32Set::iterator aItr = aWasUsed.find(nKey); + SvXMLuInt32Set::const_iterator aItr = aWasUsed.find(nKey); return (aItr != aWasUsed.end()); } void SvXMLNumUsedList_Impl::Export() { - SvXMLuInt32Set::iterator aItr = aUsed.begin(); + SvXMLuInt32Set::const_iterator aItr = aUsed.begin(); while (aItr != aUsed.end()) { - std::pair<SvXMLuInt32Set::iterator, bool> aPair = aWasUsed.insert( *aItr ); + std::pair<SvXMLuInt32Set::const_iterator, bool> aPair = aWasUsed.insert( *aItr ); if (aPair.second) nWasUsedCount++; - aItr++; + ++aItr; } aUsed.clear(); nUsedCount = 0; @@ -202,7 +198,7 @@ sal_Bool SvXMLNumUsedList_Impl::GetNextUsed(sal_uInt32& nKey) sal_Bool bRet(sal_False); if (aCurrentUsedPos != aUsed.end()) { - aCurrentUsedPos++; + ++aCurrentUsedPos; if (aCurrentUsedPos != aUsed.end()) { nKey = *aCurrentUsedPos; @@ -218,12 +214,12 @@ void SvXMLNumUsedList_Impl::GetWasUsed(uno::Sequence<sal_Int32>& rWasUsed) sal_Int32* pWasUsed = rWasUsed.getArray(); if (pWasUsed) { - SvXMLuInt32Set::iterator aItr = aWasUsed.begin(); + SvXMLuInt32Set::const_iterator aItr = aWasUsed.begin(); while (aItr != aWasUsed.end()) { *pWasUsed = *aItr; - aItr++; - pWasUsed++; + ++aItr; + ++pWasUsed; } } } @@ -235,7 +231,7 @@ void SvXMLNumUsedList_Impl::SetWasUsed(const uno::Sequence<sal_Int32>& rWasUsed) const sal_Int32* pWasUsed = rWasUsed.getConstArray(); for (sal_uInt16 i = 0; i < nCount; i++, pWasUsed++) { - std::pair<SvXMLuInt32Set::iterator, bool> aPair = aWasUsed.insert( *pWasUsed ); + std::pair<SvXMLuInt32Set::const_iterator, bool> aPair = aWasUsed.insert( *pWasUsed ); if (aPair.second) nWasUsedCount++; } @@ -247,7 +243,7 @@ SvXMLNumFmtExport::SvXMLNumFmtExport( SvXMLExport& rExp, const uno::Reference< util::XNumberFormatsSupplier >& rSupp ) : rExport( rExp ), - sPrefix( OUString::createFromAscii( "N" ) ), + sPrefix( OUString(RTL_CONSTASCII_USTRINGPARAM("N")) ), pFormatter( NULL ), pCharClass( NULL ), pLocaleData( NULL ) @@ -269,9 +265,6 @@ SvXMLNumFmtExport::SvXMLNumFmtExport( { lang::Locale aLocale( MsLangId::convertLanguageToLocale( MsLangId::getSystemLanguage() ) ); - // #110680# - // pCharClass = new CharClass( ::comphelper::getProcessServiceFactory(), aLocale ); - // pLocaleData = new LocaleDataWrapper( ::comphelper::getProcessServiceFactory(), aLocale ); pCharClass = new CharClass( rExport.getServiceFactory(), aLocale ); pLocaleData = new LocaleDataWrapper( rExport.getServiceFactory(), aLocale ); } @@ -307,9 +300,6 @@ SvXMLNumFmtExport::SvXMLNumFmtExport( { lang::Locale aLocale( MsLangId::convertLanguageToLocale( MsLangId::getSystemLanguage() ) ); - // #110680# - // pCharClass = new CharClass( ::comphelper::getProcessServiceFactory(), aLocale ); - // pLocaleData = new LocaleDataWrapper( ::comphelper::getProcessServiceFactory(), aLocale ); pCharClass = new CharClass( rExport.getServiceFactory(), aLocale ); pLocaleData = new LocaleDataWrapper( rExport.getServiceFactory(), aLocale ); } @@ -753,7 +743,7 @@ void SvXMLNumFmtExport::WriteMapElement_Impl( sal_Int32 nOp, double fLimit, case NUMBERFORMAT_OP_GT: aCondStr.append( (sal_Unicode) '>' ); break; case NUMBERFORMAT_OP_GE: aCondStr.appendAscii( ">=" ); break; default: - DBG_ERROR("unknown operator"); + OSL_FAIL("unknown operator"); } ::rtl::math::doubleToUStringBuffer( aCondStr, fLimit, rtl_math_StringFormat_Automatic, rtl_math_DecimalPlaces_Max, @@ -814,9 +804,6 @@ sal_Bool SvXMLNumFmtExport::WriteTextWithCurrency_Impl( const OUString& rString, sal_Bool bRet = sal_False; -// pLocaleData->setLocale( rLocale ); -// String sCurString = pLocaleData->getCurrSymbol(); - LanguageType nLang = MsLangId::convertLocaleToLanguage( rLocale ); pFormatter->ChangeIntl( nLang ); String sCurString, sDummy; @@ -1745,7 +1732,7 @@ OUString SvXMLNumFmtExport::GetStyleName( sal_uInt32 nKey ) return lcl_CreateStyleName( nKey, 0, sal_True, sPrefix ); else { - DBG_ERROR("There is no written Data-Style"); + OSL_FAIL("There is no written Data-Style"); return rtl::OUString(); } } @@ -1759,7 +1746,7 @@ void SvXMLNumFmtExport::SetUsed( sal_uInt32 nKey ) if (pFormatter->GetEntry(nKey)) pUsedList->SetUsed( nKey ); else { - DBG_ERROR("no existing Numberformat found with this key"); + OSL_FAIL("no existing Numberformat found with this key"); } } @@ -1818,3 +1805,5 @@ sal_uInt32 SvXMLNumFmtExport::ForceSystemLanguage( sal_uInt32 nKey ) return nRet; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |