diff options
author | Caolán McNamara <caolanm@redhat.com> | 2012-06-25 23:10:14 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2012-06-26 13:34:03 +0100 |
commit | d9a00ace2ce3423c1ac08eee0bd1fd36dace8d3e (patch) | |
tree | 2a3900905792268c39f0c9596a5eb9ecdc8a3c61 /vcl | |
parent | 4f25eb2c4eb7b5ce265eefe25a5ab84a39daf574 (diff) |
tidy some resource strings
Change-Id: I611a276d048121084ec842d062129e042f3baea5
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/app/dbggui.cxx | 8 | ||||
-rw-r--r-- | vcl/source/app/svapp.cxx | 8 | ||||
-rw-r--r-- | vcl/source/app/svdata.cxx | 59 | ||||
-rw-r--r-- | vcl/source/control/field2.cxx | 22 | ||||
-rw-r--r-- | vcl/source/control/tabctrl.cxx | 6 |
5 files changed, 47 insertions, 56 deletions
diff --git a/vcl/source/app/dbggui.cxx b/vcl/source/app/dbggui.cxx index 7137de34e071..c36f866fea2f 100644 --- a/vcl/source/app/dbggui.cxx +++ b/vcl/source/app/dbggui.cxx @@ -1076,10 +1076,10 @@ IMPL_LINK( DbgDialog, ClickHdl, Button*, pButton ) } if( (aData.nTestFlags & ~IMMEDIATE_FLAGS) != (pData->nTestFlags & ~IMMEDIATE_FLAGS) ) { - InfoBox aBox( this, String( RTL_CONSTASCII_USTRINGPARAM( + InfoBox aBox( this, rtl::OUString( "Some of the changed settings will only be active after " "restarting the process" - ) ) ); + ) ); aBox.Execute(); } EndDialog( sal_True ); @@ -1574,8 +1574,8 @@ class DbgMessageBox : public ErrorBox ErrorBox( NULL, WB_YES_NO_CANCEL | WB_DEF_NO, rMessage ), m_aMessage( rMessage ) { - SetText( String( RTL_CONSTASCII_USTRINGPARAM("Debug Output") ) ); - AddButton( String( RTL_CONSTASCII_USTRINGPARAM( "Copy" ) ), COPY_BUTTON_ID, 0 ); + SetText(rtl::OUString("Debug Output")); + AddButton(rtl::OUString("Copy"), COPY_BUTTON_ID, 0); } virtual void Click() diff --git a/vcl/source/app/svapp.cxx b/vcl/source/app/svapp.cxx index fcd0506279fe..a8439f61dedc 100644 --- a/vcl/source/app/svapp.cxx +++ b/vcl/source/app/svapp.cxx @@ -351,17 +351,17 @@ sal_uInt16 Application::Exception( sal_uInt16 nError ) #ifdef DBG_UTIL case EXC_RSCNOTLOADED: - Abort( XubString( RTL_CONSTASCII_USTRINGPARAM( "Resource not loaded" ) ) ); + Abort(rtl::OUString("Resource not loaded")); break; case EXC_SYSOBJNOTCREATED: - Abort( XubString( RTL_CONSTASCII_USTRINGPARAM( "System Object not created" ) ) ); + Abort(rtl::OUString("System Object not created")); break; default: - Abort( XubString( RTL_CONSTASCII_USTRINGPARAM( "Unknown Error" ) ) ); + Abort(rtl::OUString("Unknown Error")); break; #else default: - Abort( ImplGetSVEmptyStr() ); + Abort(rtl::OUString()); break; #endif } diff --git a/vcl/source/app/svdata.cxx b/vcl/source/app/svdata.cxx index c1c0954175ef..01a16c8248e3 100644 --- a/vcl/source/app/svdata.cxx +++ b/vcl/source/app/svdata.cxx @@ -101,13 +101,11 @@ SalSystem* ImplGetSalSystem() } -static String& ReplaceJavaErrorMessages( String& rString ) +static rtl::OUString ReplaceJavaErrorMessages( const rtl::OUString& rString ) { - rString.SearchAndReplaceAllAscii( "%OK", Button::GetStandardText( BUTTON_OK ) ); - rString.SearchAndReplaceAllAscii( "%IGNORE", Button::GetStandardText( BUTTON_IGNORE ) ); - rString.SearchAndReplaceAllAscii( "%CANCEL", Button::GetStandardText( BUTTON_CANCEL ) ); - - return rString; + return rString.replaceAll("%OK", Button::GetStandardText(BUTTON_OK)). + replaceAll("%IGNORE", Button::GetStandardText(BUTTON_IGNORE)). + replaceAll("%CANCEL", Button::GetStandardText(BUTTON_CANCEL)); } // ======================================================================= @@ -400,15 +398,14 @@ bool ImplInitAccessBridge(sal_Bool bAllowCancel, sal_Bool &rCancelled) ResMgr *pResMgr = ImplGetResMgr(); if( bErrorMessage && bAllowCancel && pResMgr ) { - String aTitle(ResId(SV_ACCESSERROR_JAVA_NOT_CONFIGURED, *pResMgr).toString()); - String aMessage((ResId(SV_ACCESSERROR_JAVA_MSG, *pResMgr)).toString()); + rtl::OUString aTitle(ResId(SV_ACCESSERROR_JAVA_NOT_CONFIGURED, *pResMgr).toString()); + rtl::OUStringBuffer aMessage((ResId(SV_ACCESSERROR_JAVA_MSG, *pResMgr)).toString()); - aMessage += String(" ", 1, RTL_TEXTENCODING_ASCII_US); - aMessage += ResId(SV_ACCESSERROR_OK_CANCEL_MSG, *pResMgr).toString(); + aMessage.append(' ').append(ResId(SV_ACCESSERROR_OK_CANCEL_MSG, *pResMgr).toString()); int ret = ImplGetSalSystem()->ShowNativeMessageBox( aTitle, - ReplaceJavaErrorMessages(aMessage), + ReplaceJavaErrorMessages(aMessage.makeStringAndClear()), SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_OK_CANCEL, SALSYSTEM_SHOWNATIVEMSGBOX_BTN_CANCEL); @@ -424,15 +421,14 @@ bool ImplInitAccessBridge(sal_Bool bAllowCancel, sal_Bool &rCancelled) ResMgr *pResMgr = ImplGetResMgr(); if( bErrorMessage && bAllowCancel && pResMgr ) { - String aTitle(ResId(SV_ACCESSERROR_FAULTY_JAVA, *pResMgr).toString()); - String aMessage(ResId(SV_ACCESSERROR_JAVA_MSG, *pResMgr).toString()); + rtl::OUString aTitle(ResId(SV_ACCESSERROR_FAULTY_JAVA, *pResMgr).toString()); + rtl::OUStringBuffer aMessage(ResId(SV_ACCESSERROR_JAVA_MSG, *pResMgr).toString()); - aMessage += String(" ", 1, RTL_TEXTENCODING_ASCII_US); - aMessage += ResId(SV_ACCESSERROR_OK_CANCEL_MSG, *pResMgr).toString(); + aMessage.append(' ').append(ResId(SV_ACCESSERROR_OK_CANCEL_MSG, *pResMgr).toString()); int ret = ImplGetSalSystem()->ShowNativeMessageBox( aTitle, - ReplaceJavaErrorMessages(aMessage), + ReplaceJavaErrorMessages(aMessage.makeStringAndClear()), SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_OK_CANCEL, SALSYSTEM_SHOWNATIVEMSGBOX_BTN_CANCEL); @@ -448,15 +444,14 @@ bool ImplInitAccessBridge(sal_Bool bAllowCancel, sal_Bool &rCancelled) ResMgr *pResMgr = ImplGetResMgr(); if( bErrorMessage && bAllowCancel && pResMgr ) { - String aTitle(ResId(SV_ACCESSERROR_MISSING_JAVA, *pResMgr).toString()); - String aMessage(ResId(SV_ACCESSERROR_JAVA_MSG, *pResMgr).toString()); + rtl::OUString aTitle(ResId(SV_ACCESSERROR_MISSING_JAVA, *pResMgr).toString()); + rtl::OUStringBuffer aMessage(ResId(SV_ACCESSERROR_JAVA_MSG, *pResMgr).toString()); - aMessage += String(" ", 1, RTL_TEXTENCODING_ASCII_US); - aMessage += ResId(SV_ACCESSERROR_OK_CANCEL_MSG, *pResMgr).toString(); + aMessage.append(' ').append(ResId(SV_ACCESSERROR_OK_CANCEL_MSG, *pResMgr).toString()); int ret = ImplGetSalSystem()->ShowNativeMessageBox( aTitle, - ReplaceJavaErrorMessages(aMessage), + ReplaceJavaErrorMessages(aMessage.makeStringAndClear()), SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_OK_CANCEL, SALSYSTEM_SHOWNATIVEMSGBOX_BTN_CANCEL); @@ -472,15 +467,14 @@ bool ImplInitAccessBridge(sal_Bool bAllowCancel, sal_Bool &rCancelled) ResMgr *pResMgr = ImplGetResMgr(); if( bErrorMessage && bAllowCancel && pResMgr ) { - String aTitle(ResId(SV_ACCESSERROR_JAVA_DISABLED, *pResMgr).toString()); - String aMessage(ResId(SV_ACCESSERROR_JAVA_MSG, *pResMgr).toString()); + rtl::OUString aTitle(ResId(SV_ACCESSERROR_JAVA_DISABLED, *pResMgr).toString()); + rtl::OUStringBuffer aMessage(ResId(SV_ACCESSERROR_JAVA_MSG, *pResMgr).toString()); - aMessage += String(" ", 1, RTL_TEXTENCODING_ASCII_US); - aMessage += ResId(SV_ACCESSERROR_OK_CANCEL_MSG, *pResMgr).toString(); + aMessage.append(' ').append(ResId(SV_ACCESSERROR_OK_CANCEL_MSG, *pResMgr).toString()); int ret = ImplGetSalSystem()->ShowNativeMessageBox( aTitle, - ReplaceJavaErrorMessages(aMessage), + ReplaceJavaErrorMessages(aMessage.makeStringAndClear()), SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_OK_CANCEL, SALSYSTEM_SHOWNATIVEMSGBOX_BTN_CANCEL); @@ -496,8 +490,8 @@ bool ImplInitAccessBridge(sal_Bool bAllowCancel, sal_Bool &rCancelled) ResMgr *pResMgr = ImplGetResMgr(); if( bErrorMessage && pResMgr ) { - String aTitle; - String aMessage(ResId(SV_ACCESSERROR_BRIDGE_MSG, *pResMgr).toString()); + rtl::OUString aTitle; + rtl::OUStringBuffer aMessage(ResId(SV_ACCESSERROR_BRIDGE_MSG, *pResMgr).toString()); if( 0 == e.Message.compareTo(::rtl::OUString("ClassNotFound"), 13) ) { @@ -508,19 +502,18 @@ bool ImplInitAccessBridge(sal_Bool bAllowCancel, sal_Bool &rCancelled) aTitle = ResId(SV_ACCESSERROR_WRONG_VERSION, *pResMgr).toString(); } - if( aTitle.Len() != 0 ) + if (!aTitle.isEmpty()) { if( bAllowCancel ) { // Something went wrong initializing the Java AccessBridge (on Windows) during the // startup. Since the office will be probably unusable for a disabled user, we offer // to terminate directly. - aMessage += String(" ", 1, RTL_TEXTENCODING_ASCII_US); - aMessage += ResId(SV_ACCESSERROR_OK_CANCEL_MSG, *pResMgr).toString(); + aMessage.append(' ').append(ResId(SV_ACCESSERROR_OK_CANCEL_MSG, *pResMgr).toString()); int ret = ImplGetSalSystem()->ShowNativeMessageBox( aTitle, - ReplaceJavaErrorMessages(aMessage), + ReplaceJavaErrorMessages(aMessage.makeStringAndClear()), SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_OK_CANCEL, SALSYSTEM_SHOWNATIVEMSGBOX_BTN_CANCEL); @@ -534,7 +527,7 @@ bool ImplInitAccessBridge(sal_Bool bAllowCancel, sal_Bool &rCancelled) // so we don't offer to terminate here ! ImplGetSalSystem()->ShowNativeMessageBox( aTitle, - ReplaceJavaErrorMessages(aMessage), + ReplaceJavaErrorMessages(aMessage.makeStringAndClear()), SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_OK, SALSYSTEM_SHOWNATIVEMSGBOX_BTN_OK); } diff --git a/vcl/source/control/field2.cxx b/vcl/source/control/field2.cxx index e7f915aa7cdf..32e285e4f025 100644 --- a/vcl/source/control/field2.cxx +++ b/vcl/source/control/field2.cxx @@ -1078,12 +1078,10 @@ static sal_uInt16 ImplCutMonthFromString( XubString& rStr, const CalendarWrapper static String ImplGetDateSep( const LocaleDataWrapper& rLocaleDataWrapper, ExtDateFieldFormat eFormat ) { - String aDateSep = rLocaleDataWrapper.getDateSep(); - if ( ( eFormat == XTDATEF_SHORT_YYMMDD_DIN5008 ) || ( eFormat == XTDATEF_SHORT_YYYYMMDD_DIN5008 ) ) - aDateSep = String( RTL_CONSTASCII_USTRINGPARAM( "-" ) ); - - return aDateSep; + return rtl::OUString("-"); + else + return rLocaleDataWrapper.getDateSep(); } static sal_Bool ImplDateProcessKeyInput( Edit*, const KeyEvent& rKEvt, ExtDateFieldFormat eFormat, @@ -2267,18 +2265,18 @@ static sal_Bool ImplTimeGetValue( const XubString& rStr, Time& rTime, // Nach Separatoren suchen if (!rLocaleDataWrapper.getTimeSep().isEmpty()) { - XubString aSepStr( RTL_CONSTASCII_USTRINGPARAM( ",.;:/" ) ); + rtl::OUStringBuffer aSepStr(",.;:/"); if ( !bDuration ) - aSepStr.Append( '-' ); + aSepStr.append('-'); // Die obigen Zeichen durch das Separatorzeichen ersetzen - for ( xub_StrLen i = 0; i < aSepStr.Len(); i++ ) + for (sal_Int32 i = 0; i < aSepStr.getLength(); ++i) { - if (string::equals(rLocaleDataWrapper.getTimeSep(), aSepStr.GetChar(i))) + if (string::equals(rLocaleDataWrapper.getTimeSep(), aSepStr[i])) continue; for ( xub_StrLen j = 0; j < aStr.Len(); j++ ) { - if ( aStr.GetChar( j ) == aSepStr.GetChar( i ) ) + if (aStr.GetChar( j ) == aSepStr[i]) aStr.SetChar( j, rLocaleDataWrapper.getTimeSep()[0] ); } } @@ -2414,8 +2412,8 @@ static sal_Bool ImplTimeGetValue( const XubString& rStr, Time& rTime, XubString aPM( rLocaleDataWrapper.getTimePM() ); aAM.ToUpperAscii(); aPM.ToUpperAscii(); - XubString aAM2( RTL_CONSTASCII_USTRINGPARAM( "AM" ) ); // aAM is localized - XubString aPM2( RTL_CONSTASCII_USTRINGPARAM( "PM" ) ); // aPM is localized + rtl::OUString aAM2("AM"); // aAM is localized + rtl::OUString aPM2("PM"); // aPM is localized if ( (nHour < 12) && ( ( aStr.Search( aPM ) != STRING_NOTFOUND ) || ( aStr.Search( aPM2 ) != STRING_NOTFOUND ) ) ) nHour += 12; diff --git a/vcl/source/control/tabctrl.cxx b/vcl/source/control/tabctrl.cxx index dc48425ed9a6..ab7ffd387ff4 100644 --- a/vcl/source/control/tabctrl.cxx +++ b/vcl/source/control/tabctrl.cxx @@ -333,16 +333,16 @@ Size TabControl::ImplGetItemSize( ImplTabItem* pItem, long nMaxWidth ) // Evt. den Text kuerzen if ( aSize.Width()+4 >= nMaxWidth ) { - XubString aAppendStr( RTL_CONSTASCII_USTRINGPARAM( "..." ) ); + rtl::OUString aAppendStr("..."); pItem->maFormatText += aAppendStr; do { - pItem->maFormatText.Erase( pItem->maFormatText.Len()-aAppendStr.Len()-1, 1 ); + pItem->maFormatText.Erase( pItem->maFormatText.Len()-aAppendStr.getLength()-1, 1 ); aSize.Width() = GetCtrlTextWidth( pItem->maFormatText ); aSize.Width() += aImageSize.Width(); aSize.Width() += TAB_TABOFFSET_X*2; } - while ( (aSize.Width()+4 >= nMaxWidth) && (pItem->maFormatText.Len() > aAppendStr.Len()) ); + while ( (aSize.Width()+4 >= nMaxWidth) && (pItem->maFormatText.Len() > aAppendStr.getLength()) ); if ( aSize.Width()+4 >= nMaxWidth ) { pItem->maFormatText.Assign( '.' ); |