From 3fd28200f1c1a46970789f21ee6fce3f6f3ac1ec Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Sun, 27 Nov 2011 08:21:00 +0000 Subject: ByteString->rtl::OString[Buffer] --- unotools/source/i18n/calendarwrapper.cxx | 195 ++++++++++++------------ unotools/source/i18n/charclass.cxx | 12 +- unotools/source/i18n/localedatawrapper.cxx | 78 +++++----- unotools/source/i18n/transliterationwrapper.cxx | 34 ++--- 4 files changed, 160 insertions(+), 159 deletions(-) (limited to 'unotools') diff --git a/unotools/source/i18n/calendarwrapper.cxx b/unotools/source/i18n/calendarwrapper.cxx index 0e471d226317..6bf1e2003b6c 100644 --- a/unotools/source/i18n/calendarwrapper.cxx +++ b/unotools/source/i18n/calendarwrapper.cxx @@ -27,9 +27,10 @@ ************************************************************************/ -#include +#include #include #include +#include #include #include #include @@ -67,12 +68,12 @@ void CalendarWrapper::loadDefaultCalendar( const ::com::sun::star::lang::Locale& if ( xC.is() ) xC->loadDefaultCalendar( rLocale ); } - catch ( Exception& e ) + catch (const Exception& e) { #ifdef DBG_UTIL - ByteString aMsg( "loadDefaultCalendar: Exception caught\n" ); - aMsg += ByteString( String( e.Message ), RTL_TEXTENCODING_UTF8 ); - DBG_ERRORFILE( aMsg.GetBuffer() ); + rtl::OStringBuffer aMsg("loadDefaultCalendar: Exception caught\n"); + aMsg.append(rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8)); + DBG_ERRORFILE(aMsg.getStr()); #else (void)e; #endif @@ -112,12 +113,12 @@ void CalendarWrapper::loadCalendar( const ::rtl::OUString& rUniqueID, const ::co if ( xC.is() ) return xC->getAllCalendars( rLocale ); } - catch ( Exception& e ) + catch (const Exception& e) { #ifdef DBG_UTIL - ByteString aMsg( "getAllCalendars: Exception caught\n" ); - aMsg += ByteString( String( e.Message ), RTL_TEXTENCODING_UTF8 ); - DBG_ERRORFILE( aMsg.GetBuffer() ); + rtl::OStringBuffer aMsg("getAllCalendars: Exception caught\n"); + aMsg.append(rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8)); + DBG_ERRORFILE(aMsg.getStr()); #else (void)e; #endif @@ -133,12 +134,12 @@ void CalendarWrapper::loadCalendar( const ::rtl::OUString& rUniqueID, const ::co if ( xC.is() ) return xC->getUniqueID(); } - catch ( Exception& e ) + catch (const Exception& e) { #ifdef DBG_UTIL - ByteString aMsg( "getUniqueID: Exception caught\n" ); - aMsg += ByteString( String( e.Message ), RTL_TEXTENCODING_UTF8 ); - DBG_ERRORFILE( aMsg.GetBuffer() ); + rtl::OStringBuffer aMsg("getUniqueID: Exception caught\n"); + aMsg.append(rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8)); + DBG_ERRORFILE(aMsg.getStr()); #else (void)e; #endif @@ -154,12 +155,12 @@ void CalendarWrapper::setDateTime( double nTimeInDays ) if ( xC.is() ) xC->setDateTime( nTimeInDays ); } - catch ( Exception& e ) + catch (const Exception& e) { #ifdef DBG_UTIL - ByteString aMsg( "setDateTime: Exception caught\n" ); - aMsg += ByteString( String( e.Message ), RTL_TEXTENCODING_UTF8 ); - DBG_ERRORFILE( aMsg.GetBuffer() ); + rtl::OStringBuffer aMsg("setDateTime: Exception caught\n"); + aMsg.append(rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8)); + DBG_ERRORFILE(aMsg.getStr()); #else (void)e; #endif @@ -174,12 +175,12 @@ double CalendarWrapper::getDateTime() const if ( xC.is() ) return xC->getDateTime(); } - catch ( Exception& e ) + catch (const Exception& e) { #ifdef DBG_UTIL - ByteString aMsg( "getDateTime: Exception caught\n" ); - aMsg += ByteString( String( e.Message ), RTL_TEXTENCODING_UTF8 ); - DBG_ERRORFILE( aMsg.GetBuffer() ); + rtl::OStringBuffer aMsg("getDateTime: Exception caught\n"); + aMsg.append(rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8)); + DBG_ERRORFILE(aMsg.getStr()); #else (void)e; #endif @@ -204,12 +205,12 @@ sal_Int32 CalendarWrapper::getCombinedOffsetInMillis( nOffset += static_cast( nSecondMillis); } } - catch ( Exception& e ) + catch (const Exception& e) { #ifdef DBG_UTIL - ByteString aMsg( "setLocalDateTime: Exception caught\n" ); - aMsg += ByteString( String( e.Message ), RTL_TEXTENCODING_UTF8 ); - DBG_ERRORFILE( aMsg.GetBuffer() ); + rtl::OStringBuffer aMsg("setLocalDateTime: Exception caught\n"); + aMsg.append(rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8)); + DBG_ERRORFILE(aMsg.getStr()); #else (void)e; #endif @@ -276,12 +277,12 @@ void CalendarWrapper::setLocalDateTime( double nTimeInDays ) } } } - catch ( Exception& e ) + catch (const Exception& e) { #ifdef DBG_UTIL - ByteString aMsg( "setLocalDateTime: Exception caught\n" ); - aMsg += ByteString( String( e.Message ), RTL_TEXTENCODING_UTF8 ); - DBG_ERRORFILE( aMsg.GetBuffer() ); + rtl::OStringBuffer aMsg("setLocalDateTime: Exception caught\n"); + aMsg.append(rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8)); + DBG_ERRORFILE(aMsg.getStr()); #else (void)e; #endif @@ -302,12 +303,12 @@ double CalendarWrapper::getLocalDateTime() const return nTimeInDays; } } - catch ( Exception& e ) + catch (const Exception& e) { #ifdef DBG_UTIL - ByteString aMsg( "getLocalDateTime: Exception caught\n" ); - aMsg += ByteString( String( e.Message ), RTL_TEXTENCODING_UTF8 ); - DBG_ERRORFILE( aMsg.GetBuffer() ); + rtl::OStringBuffer aMsg("getLocalDateTime: Exception caught\n"); + aMsg.append(rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8)); + DBG_ERRORFILE(aMsg.getStr()); #else (void)e; #endif @@ -323,12 +324,12 @@ void CalendarWrapper::setValue( sal_Int16 nFieldIndex, sal_Int16 nValue ) if ( xC.is() ) xC->setValue( nFieldIndex, nValue ); } - catch ( Exception& e ) + catch (const Exception& e) { #ifdef DBG_UTIL - ByteString aMsg( "setValue: Exception caught\n" ); - aMsg += ByteString( String( e.Message ), RTL_TEXTENCODING_UTF8 ); - DBG_ERRORFILE( aMsg.GetBuffer() ); + rtl::OStringBuffer aMsg("setValue: Exception caught\n"); + aMsg.append(rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8)); + DBG_ERRORFILE(aMsg.getStr()); #else (void)e; #endif @@ -343,12 +344,12 @@ sal_Bool CalendarWrapper::isValid() const if ( xC.is() ) return xC->isValid(); } - catch ( Exception& e ) + catch (const Exception& e) { #ifdef DBG_UTIL - ByteString aMsg( "isValid: Exception caught\n" ); - aMsg += ByteString( String( e.Message ), RTL_TEXTENCODING_UTF8 ); - DBG_ERRORFILE( aMsg.GetBuffer() ); + rtl::OStringBuffer aMsg("isValid: Exception caught\n"); + aMsg.append(rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8)); + DBG_ERRORFILE(aMsg.getStr()); #else (void)e; #endif @@ -364,12 +365,12 @@ sal_Int16 CalendarWrapper::getValue( sal_Int16 nFieldIndex ) const if ( xC.is() ) return xC->getValue( nFieldIndex ); } - catch ( Exception& e ) + catch (const Exception& e) { #ifdef DBG_UTIL - ByteString aMsg( "getValue: Exception caught\n" ); - aMsg += ByteString( String( e.Message ), RTL_TEXTENCODING_UTF8 ); - DBG_ERRORFILE( aMsg.GetBuffer() ); + rtl::OStringBuffer aMsg("getValue: Exception caught\n"); + aMsg.append(rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8)); + DBG_ERRORFILE(aMsg.getStr()); #else (void)e; #endif @@ -385,12 +386,12 @@ void CalendarWrapper::addValue( sal_Int16 nFieldIndex, sal_Int32 nAmount ) if ( xC.is() ) xC->addValue( nFieldIndex, nAmount ); } - catch ( Exception& e ) + catch (const Exception& e) { #ifdef DBG_UTIL - ByteString aMsg( "addValue: Exception caught\n" ); - aMsg += ByteString( String( e.Message ), RTL_TEXTENCODING_UTF8 ); - DBG_ERRORFILE( aMsg.GetBuffer() ); + rtl::OStringBuffer aMsg("addValue: Exception caught\n"); + aMsg.append(rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8)); + DBG_ERRORFILE(aMsg.getStr()); #else (void)e; #endif @@ -405,12 +406,12 @@ sal_Int16 CalendarWrapper::getFirstDayOfWeek() const if ( xC.is() ) return xC->getFirstDayOfWeek(); } - catch ( Exception& e ) + catch (const Exception& e) { #ifdef DBG_UTIL - ByteString aMsg( "getFirstDayOfWeek: Exception caught\n" ); - aMsg += ByteString( String( e.Message ), RTL_TEXTENCODING_UTF8 ); - DBG_ERRORFILE( aMsg.GetBuffer() ); + rtl::OStringBuffer aMsg("getFirstDayOfWeek: Exception caught\n"); + aMsg.append(rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8)); + DBG_ERRORFILE(aMsg.getStr()); #else (void)e; #endif @@ -426,12 +427,12 @@ void CalendarWrapper::setFirstDayOfWeek( sal_Int16 nDay ) if ( xC.is() ) xC->setFirstDayOfWeek( nDay ); } - catch ( Exception& e ) + catch (const Exception& e) { #ifdef DBG_UTIL - ByteString aMsg( "setFirstDayOfWeek: Exception caught\n" ); - aMsg += ByteString( String( e.Message ), RTL_TEXTENCODING_UTF8 ); - DBG_ERRORFILE( aMsg.GetBuffer() ); + rtl::OStringBuffer aMsg("setFirstDayOfWeek: Exception caught\n"); + aMsg.append(rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8)); + DBG_ERRORFILE(aMsg.getStr()); #else (void)e; #endif @@ -446,12 +447,12 @@ void CalendarWrapper::setMinimumNumberOfDaysForFirstWeek( sal_Int16 nDays ) if ( xC.is() ) xC->setMinimumNumberOfDaysForFirstWeek( nDays ); } - catch ( Exception& e ) + catch (const Exception& e) { #ifdef DBG_UTIL - ByteString aMsg( "setMinimumNumberOfDaysForFirstWeek: Exception caught\n" ); - aMsg += ByteString( String( e.Message ), RTL_TEXTENCODING_UTF8 ); - DBG_ERRORFILE( aMsg.GetBuffer() ); + rtl::OStringBuffer aMsg("setMinimumNumberOfDaysForFirstWeek: Exception caught\n"); + aMsg.append(rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8)); + DBG_ERRORFILE(aMsg.getStr()); #else (void)e; #endif @@ -466,12 +467,12 @@ sal_Int16 CalendarWrapper::getNumberOfMonthsInYear() const if ( xC.is() ) return xC->getNumberOfMonthsInYear(); } - catch ( Exception& e ) + catch (const Exception& e) { #ifdef DBG_UTIL - ByteString aMsg( "getNumberOfMonthsInYear: Exception caught\n" ); - aMsg += ByteString( String( e.Message ), RTL_TEXTENCODING_UTF8 ); - DBG_ERRORFILE( aMsg.GetBuffer() ); + rtl::OStringBuffer aMsg("getNumberOfMonthsInYear: Exception caught\n"); + aMsg.append(rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8)); + DBG_ERRORFILE(aMsg.getStr()); #else (void)e; #endif @@ -487,12 +488,12 @@ sal_Int16 CalendarWrapper::getNumberOfDaysInWeek() const if ( xC.is() ) return xC->getNumberOfDaysInWeek(); } - catch ( Exception& e ) + catch (const Exception& e) { #ifdef DBG_UTIL - ByteString aMsg( "getNumberOfDaysInWeek: Exception caught\n" ); - aMsg += ByteString( String( e.Message ), RTL_TEXTENCODING_UTF8 ); - DBG_ERRORFILE( aMsg.GetBuffer() ); + rtl::OStringBuffer aMsg("getNumberOfDaysInWeek: Exception caught\n"); + aMsg.append(rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8)); + DBG_ERRORFILE(aMsg.getStr()); #else (void)e; #endif @@ -508,12 +509,12 @@ sal_Int16 CalendarWrapper::getNumberOfDaysInWeek() const if ( xC.is() ) return xC->getMonths2(); } - catch ( Exception& e ) + catch (const Exception& e) { #ifdef DBG_UTIL - ByteString aMsg( "getMonths: Exception caught\n" ); - aMsg += ByteString( String( e.Message ), RTL_TEXTENCODING_UTF8 ); - DBG_ERRORFILE( aMsg.GetBuffer() ); + rtl::OStringBuffer aMsg("getMonths: Exception caught\n"); + aMsg.append(rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8)); + DBG_ERRORFILE(aMsg.getStr()); #else (void)e; #endif @@ -529,12 +530,12 @@ sal_Int16 CalendarWrapper::getNumberOfDaysInWeek() const if ( xC.is() ) return xC->getDays2(); } - catch ( Exception& e ) + catch (const Exception& e) { #ifdef DBG_UTIL - ByteString aMsg( "getDays: Exception caught\n" ); - aMsg += ByteString( String( e.Message ), RTL_TEXTENCODING_UTF8 ); - DBG_ERRORFILE( aMsg.GetBuffer() ); + rtl::OStringBuffer aMsg("getDays: Exception caught\n"); + aMsg.append(rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8)); + DBG_ERRORFILE(aMsg.getStr()); #else (void)e; #endif @@ -550,12 +551,12 @@ String CalendarWrapper::getDisplayName( sal_Int16 nCalendarDisplayIndex, sal_Int if ( xC.is() ) return xC->getDisplayName( nCalendarDisplayIndex, nIdx, nNameType ); } - catch ( Exception& e ) + catch (const Exception& e) { #ifdef DBG_UTIL - ByteString aMsg( "getDisplayName: Exception caught\n" ); - aMsg += ByteString( String( e.Message ), RTL_TEXTENCODING_UTF8 ); - DBG_ERRORFILE( aMsg.GetBuffer() ); + rtl::OStringBuffer aMsg("getDisplayName: Exception caught\n"); + aMsg.append(rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8)); + DBG_ERRORFILE(aMsg.getStr()); #else (void)e; #endif @@ -573,12 +574,12 @@ String CalendarWrapper::getDisplayString( sal_Int32 nCalendarDisplayCode, sal_In if ( xC.is() ) return xC->getDisplayString( nCalendarDisplayCode, nNativeNumberMode ); } - catch ( Exception& e ) + catch (const Exception& e) { #ifdef DBG_UTIL - ByteString aMsg( "getDisplayString: Exception caught\n" ); - aMsg += ByteString( String( e.Message ), RTL_TEXTENCODING_UTF8 ); - DBG_ERRORFILE( aMsg.GetBuffer() ); + rtl::OStringBuffer aMsg("getDisplayString: Exception caught\n"); + aMsg.append(rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8)); + DBG_ERRORFILE(aMsg.getStr()); #else (void)e; #endif @@ -596,12 +597,12 @@ String CalendarWrapper::getDisplayString( sal_Int32 nCalendarDisplayCode, sal_In if ( xC.is() ) return xC->getLoadedCalendar2(); } - catch ( Exception& e ) + catch (const Exception& e) { #ifdef DBG_UTIL - ByteString aMsg( "getLoadedCalendar2: Exception caught\n" ); - aMsg += ByteString( String( e.Message ), RTL_TEXTENCODING_UTF8 ); - DBG_ERRORFILE( aMsg.GetBuffer() ); + rtl::OStringBuffer aMsg( "getLoadedCalendar2: Exception caught\n" ); + aMsg.append(rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8)); + DBG_ERRORFILE(aMsg.getStr()); #else (void)e; #endif @@ -617,12 +618,12 @@ String CalendarWrapper::getDisplayString( sal_Int32 nCalendarDisplayCode, sal_In if ( xC.is() ) return xC->getGenitiveMonths2(); } - catch ( Exception& e ) + catch (const Exception& e) { #ifdef DBG_UTIL - ByteString aMsg( "getGenitiveMonths: Exception caught\n" ); - aMsg += ByteString( String( e.Message ), RTL_TEXTENCODING_UTF8 ); - DBG_ERRORFILE( aMsg.GetBuffer() ); + rtl::OStringBuffer aMsg("getGenitiveMonths: Exception caught\n"); + aMsg.append(rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8)); + DBG_ERRORFILE(aMsg.getStr()); #else (void)e; #endif @@ -638,12 +639,12 @@ String CalendarWrapper::getDisplayString( sal_Int32 nCalendarDisplayCode, sal_In if ( xC.is() ) return xC->getPartitiveMonths2(); } - catch ( Exception& e ) + catch (const Exception& e) { #ifdef DBG_UTIL - ByteString aMsg( "getPartitiveMonths: Exception caught\n" ); - aMsg += ByteString( String( e.Message ), RTL_TEXTENCODING_UTF8 ); - DBG_ERRORFILE( aMsg.GetBuffer() ); + rtl::OStringBuffer aMsg("getPartitiveMonths: Exception caught\n"); + aMsg.append(rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8)); + DBG_ERRORFILE(aMsg.getStr()); #else (void)e; #endif diff --git a/unotools/source/i18n/charclass.cxx b/unotools/source/i18n/charclass.cxx index 1800915bfa9d..f3c1d416f34a 100644 --- a/unotools/source/i18n/charclass.cxx +++ b/unotools/source/i18n/charclass.cxx @@ -448,9 +448,9 @@ sal_Int32 CharClass::getStringType( const String& rStr, xub_StrLen nPos, xub_Str catch ( const Exception& e ) { #ifdef DBG_UTIL - ByteString aMsg( "parseAnyToken: Exception caught\n" ); - aMsg += ByteString( String( e.Message ), RTL_TEXTENCODING_UTF8 ); - DBG_ERRORFILE( aMsg.GetBuffer() ); + rtl::OStringBuffer aMsg("parseAnyToken: Exception caught\n"); + aMsg.append(rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8)); + DBG_ERRORFILE(aMsg.getStr()); #else (void)e; #endif @@ -480,9 +480,9 @@ sal_Int32 CharClass::getStringType( const String& rStr, xub_StrLen nPos, xub_Str catch ( const Exception& e ) { #ifdef DBG_UTIL - ByteString aMsg( "parsePredefinedToken: Exception caught\n" ); - aMsg += ByteString( String( e.Message ), RTL_TEXTENCODING_UTF8 ); - DBG_ERRORFILE( aMsg.GetBuffer() ); + rtl::OStringBuffer aMsg("parsePredefinedToken: Exception caught\n"); + aMsg.append(rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8)); + DBG_ERRORFILE(aMsg.getStr()); #else (void)e; #endif diff --git a/unotools/source/i18n/localedatawrapper.cxx b/unotools/source/i18n/localedatawrapper.cxx index 8e926a48bd8f..56944d2bb2a9 100644 --- a/unotools/source/i18n/localedatawrapper.cxx +++ b/unotools/source/i18n/localedatawrapper.cxx @@ -145,12 +145,12 @@ void LocaleDataWrapper::invalidateData() if ( xLD.is() ) return xLD->getLanguageCountryInfo( getLocale() ); } - catch ( Exception& e ) + catch (const Exception& e) { #ifdef DBG_UTIL - ByteString aMsg( "getLanguageCountryInfo: Exception caught\n" ); - aMsg += ByteString( String( e.Message ), RTL_TEXTENCODING_UTF8 ); - DBG_ERRORFILE( aMsg.GetBuffer() ); + rtl::OStringBuffer aMsg( "getLanguageCountryInfo: Exception caught\n"); + aMsg.append(rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8)); + DBG_ERRORFILE(aMsg.getStr()); #else (void)e; #endif @@ -166,12 +166,12 @@ void LocaleDataWrapper::invalidateData() if ( xLD.is() ) return xLD->getLocaleItem( getLocale() ); } - catch ( Exception& e ) + catch (const Exception& e) { #ifdef DBG_UTIL - ByteString aMsg( "getLocaleItem: Exception caught\n" ); - aMsg += ByteString( String( e.Message ), RTL_TEXTENCODING_UTF8 ); - DBG_ERRORFILE( aMsg.GetBuffer() ); + rtl::OStringBuffer aMsg("getLocaleItem: Exception caught\n"); + aMsg.append(rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8)); + DBG_ERRORFILE(aMsg.getStr()); #else (void)e; #endif @@ -187,12 +187,12 @@ void LocaleDataWrapper::invalidateData() if ( xLD.is() ) return xLD->getAllCurrencies2( getLocale() ); } - catch ( Exception& e ) + catch (const Exception& e) { #ifdef DBG_UTIL - ByteString aMsg( "getAllCurrencies: Exception caught\n" ); - aMsg += ByteString( String( e.Message ), RTL_TEXTENCODING_UTF8 ); - DBG_ERRORFILE( aMsg.GetBuffer() ); + rtl::OStringBuffer aMsg("getAllCurrencies: Exception caught\n"); + aMsg.append(rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8)); + DBG_ERRORFILE(aMsg.getStr()); #else (void)e; #endif @@ -208,12 +208,12 @@ void LocaleDataWrapper::invalidateData() if ( xLD.is() ) return xLD->getAllFormats( getLocale() ); } - catch ( Exception& e ) + catch (const Exception& e) { #ifdef DBG_UTIL - ByteString aMsg( "getAllFormats: Exception caught\n" ); - aMsg += ByteString( String( e.Message ), RTL_TEXTENCODING_UTF8 ); - DBG_ERRORFILE( aMsg.GetBuffer() ); + rtl::OStringBuffer aMsg("getAllFormats: Exception caught\n"); + aMsg.append(rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8)); + DBG_ERRORFILE(aMsg.getStr()); #else (void)e; #endif @@ -229,12 +229,12 @@ void LocaleDataWrapper::invalidateData() if ( xLD.is() ) return xLD->getCollatorImplementations( getLocale() ); } - catch ( Exception& e ) + catch (const Exception& e) { #ifdef DBG_UTIL - ByteString aMsg( "getCollatorImplementations: Exception caught\n" ); - aMsg += ByteString( String( e.Message ), RTL_TEXTENCODING_UTF8 ); - DBG_ERRORFILE( aMsg.GetBuffer() ); + rtl::OStringBuffer aMsg("getCollatorImplementations: Exception caught\n"); + aMsg.append(rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8)); + DBG_ERRORFILE(aMsg.getStr()); #else (void)e; #endif @@ -250,12 +250,12 @@ void LocaleDataWrapper::invalidateData() if ( xLD.is() ) return xLD->getTransliterations( getLocale() ); } - catch ( Exception& e ) + catch (const Exception& e) { #ifdef DBG_UTIL - ByteString aMsg( "getTransliterations: Exception caught\n" ); - aMsg += ByteString( String( e.Message ), RTL_TEXTENCODING_UTF8 ); - DBG_ERRORFILE( aMsg.GetBuffer() ); + rtl::OStringBuffer aMsg("getTransliterations: Exception caught\n"); + aMsg.append(rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8)); + DBG_ERRORFILE(aMsg.getStr()); #else (void)e; #endif @@ -271,12 +271,12 @@ void LocaleDataWrapper::invalidateData() if ( xLD.is() ) return xLD->getForbiddenCharacters( getLocale() ); } - catch ( Exception& e ) + catch (const Exception& e) { #ifdef DBG_UTIL - ByteString aMsg( "getForbiddenCharacters: Exception caught\n" ); - aMsg += ByteString( String( e.Message ), RTL_TEXTENCODING_UTF8 ); - DBG_ERRORFILE( aMsg.GetBuffer() ); + rtl::OStringBuffer aMsg("getForbiddenCharacters: Exception caught\n"); + aMsg.append(rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8)); + DBG_ERRORFILE(aMsg.getStr()); #else (void)e; #endif @@ -295,9 +295,9 @@ void LocaleDataWrapper::invalidateData() catch ( Exception& e ) { #ifdef DBG_UTIL - ByteString aMsg( "getReservedWord: Exception caught\n" ); - aMsg += ByteString( String( e.Message ), RTL_TEXTENCODING_UTF8 ); - DBG_ERRORFILE( aMsg.GetBuffer() ); + rtl::OStringBuffer aMsg("getReservedWord: Exception caught\n"); + aMsg.append(rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8)); + DBG_ERRORFILE(aMsg.getStr()); #else (void)e; #endif @@ -321,9 +321,9 @@ void LocaleDataWrapper::invalidateData() catch ( Exception& e ) { #ifdef DBG_UTIL - ByteString aMsg( "getAllInstalledLocaleNames: Exception caught\n" ); - aMsg += ByteString( String( e.Message ), RTL_TEXTENCODING_UTF8 ); - DBG_ERRORFILE( aMsg.GetBuffer() ); + rtl::OStringBuffer aMsg("getAllInstalledLocaleNames: Exception caught\n"); + aMsg.append(rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8)); + DBG_ERRORFILE(aMsg.getStr()); #else (void)e; #endif @@ -1882,7 +1882,7 @@ rtl::OUString LocaleDataWrapper::appendLocaleInfo(const rtl::OUString& rDebugMsg // static void LocaleDataWrapper::outputCheckMessage( const String& rMsg ) { - outputCheckMessage( ByteString( rMsg, RTL_TEXTENCODING_UTF8).GetBuffer()); + outputCheckMessage(rtl::OUStringToOString(rMsg, RTL_TEXTENCODING_UTF8).getStr()); } @@ -1937,12 +1937,12 @@ void LocaleDataWrapper::evaluateLocaleDataChecking() if ( xLD.is() ) return xLD->getAllCalendars2( getLocale() ); } - catch ( Exception& e ) + catch (const Exception& e) { #ifdef DBG_UTIL - ByteString aMsg( "getAllCalendars: Exception caught\n" ); - aMsg += ByteString( String( e.Message ), RTL_TEXTENCODING_UTF8 ); - DBG_ERRORFILE( aMsg.GetBuffer() ); + rtl::OStringBuffer aMsg("getAllCalendars: Exception caught\n"); + aMsg.append(rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8)); + DBG_ERRORFILE(aMsg.getStr()); #else (void)e; #endif diff --git a/unotools/source/i18n/transliterationwrapper.cxx b/unotools/source/i18n/transliterationwrapper.cxx index 7de48f3adfa8..1ae8b7957265 100644 --- a/unotools/source/i18n/transliterationwrapper.cxx +++ b/unotools/source/i18n/transliterationwrapper.cxx @@ -172,9 +172,9 @@ void TransliterationWrapper::loadModuleImpl() const catch ( Exception& e ) { #ifdef DBG_UTIL - ByteString aMsg( "loadModuleImpl: Exception caught\n" ); - aMsg += ByteString( String( e.Message ), RTL_TEXTENCODING_UTF8 ); - DBG_ERRORFILE( aMsg.GetBuffer() ); + rtl::OStringBuffer aMsg("loadModuleImpl: Exception caught\n"); + aMsg.append(rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8)); + DBG_ERRORFILE(aMsg.getStr()); #else (void)e; #endif @@ -199,9 +199,9 @@ void TransliterationWrapper::loadModuleByImplName( catch ( Exception& e ) { #ifdef DBG_UTIL - ByteString aMsg( "loadModuleByImplName: Exception caught\n" ); - aMsg += ByteString( String( e.Message ), RTL_TEXTENCODING_UTF8 ); - DBG_ERRORFILE( aMsg.GetBuffer() ); + rtl::OStringBuffer aMsg("loadModuleByImplName: Exception caught\n"); + aMsg.append(rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8)); + DBG_ERRORFILE(aMsg.getStr()); #else (void)e; #endif @@ -225,9 +225,9 @@ sal_Bool TransliterationWrapper::equals( catch ( Exception& e ) { #ifdef DBG_UTIL - ByteString aMsg( "equals: Exception caught\n" ); - aMsg += ByteString( String( e.Message ), RTL_TEXTENCODING_UTF8 ); - DBG_ERRORFILE( aMsg.GetBuffer() ); + rtl::OStringBuffer aMsg("equals: Exception caught\n"); + aMsg.append(rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8)); + DBG_ERRORFILE(aMsg.getStr()); #else (void)e; #endif @@ -247,12 +247,12 @@ sal_Int32 TransliterationWrapper::compareSubstring( if ( xTrans.is() ) return xTrans->compareSubstring( rStr1, nOff1, nLen1, rStr2, nOff2, nLen2 ); } - catch ( Exception& e ) + catch (const Exception& e) { #ifdef DBG_UTIL - ByteString aMsg( "compareSubstring: Exception caught\n" ); - aMsg += ByteString( String( e.Message ), RTL_TEXTENCODING_UTF8 ); - DBG_ERRORFILE( aMsg.GetBuffer() ); + rtl::OStringBuffer aMsg("compareSubstring: Exception caught\n"); + aMsg.append(rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8)); + DBG_ERRORFILE(aMsg.getStr()); #else (void)e; #endif @@ -270,12 +270,12 @@ sal_Int32 TransliterationWrapper::compareString( const String& rStr1, const Stri if ( xTrans.is() ) return xTrans->compareString( rStr1, rStr2 ); } - catch ( Exception& e ) + catch (const Exception& e) { #ifdef DBG_UTIL - ByteString aMsg( "compareString: Exception caught\n" ); - aMsg += ByteString( String( e.Message ), RTL_TEXTENCODING_UTF8 ); - DBG_ERRORFILE( aMsg.GetBuffer() ); + rtl::OStringBuffer aMsg("compareString: Exception caught\n"); + aMsg.append(rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8)); + DBG_ERRORFILE(aMsg.getStr()); #else (void)e; #endif -- cgit