diff options
author | Caolán McNamara <caolanm@redhat.com> | 2017-05-18 21:14:00 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2017-05-19 15:40:40 +0200 |
commit | 2155e04d6343638ca9815d394cbc4f78c2b17c3a (patch) | |
tree | 0378142f6ce9edb63074291aed45527568e7b254 /vcl/source | |
parent | cee02e81cd3b55fb46eacf5db5713e8bf4363bcd (diff) |
make string translation loading more uniform
change various ResId classes that use conversion operator to OUString to
functions that return a OUString
drop various defines
drop unnecessary toString calls
Change-Id: Ibeccdf2b91a46a2ed5b4b74e6024e301a023bc92
Reviewed-on: https://gerrit.libreoffice.org/37817
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl/source')
-rw-r--r-- | vcl/source/app/stdtext.cxx | 2 | ||||
-rw-r--r-- | vcl/source/app/svapp.cxx | 12 | ||||
-rw-r--r-- | vcl/source/control/button.cxx | 2 | ||||
-rw-r--r-- | vcl/source/edit/textundo.cxx | 4 | ||||
-rw-r--r-- | vcl/source/outdev/font.cxx | 2 | ||||
-rw-r--r-- | vcl/source/window/brdwin.cxx | 2 | ||||
-rw-r--r-- | vcl/source/window/menubarwindow.cxx | 6 | ||||
-rw-r--r-- | vcl/source/window/msgbox.cxx | 4 | ||||
-rw-r--r-- | vcl/source/window/printdlg.cxx | 8 | ||||
-rw-r--r-- | vcl/source/window/splitwin.cxx | 2 |
10 files changed, 22 insertions, 22 deletions
diff --git a/vcl/source/app/stdtext.cxx b/vcl/source/app/stdtext.cxx index db9d16326933..fde6acb7264f 100644 --- a/vcl/source/app/stdtext.cxx +++ b/vcl/source/app/stdtext.cxx @@ -26,7 +26,7 @@ void ShowServiceNotAvailableError(vcl::Window* pParent, const OUString& rServiceName, bool bError) { - OUString aText = VclResId(SV_STDTEXT_SERVICENOTAVAILABLE).toString(). + OUString aText = OUString(VclResId(SV_STDTEXT_SERVICENOTAVAILABLE)). replaceAll("%s", rServiceName); ScopedVclPtrInstance< MessageDialog > aBox( pParent, aText, bError ? VclMessageType::Error : VclMessageType::Warning ); aBox->Execute(); diff --git a/vcl/source/app/svapp.cxx b/vcl/source/app/svapp.cxx index b6b74b8eac6e..3fcf82b4e59c 100644 --- a/vcl/source/app/svapp.cxx +++ b/vcl/source/app/svapp.cxx @@ -1176,7 +1176,7 @@ OUString Application::GetHWOSConfInfo() ImplSVData* pSVData = ImplGetSVData(); OUStringBuffer aDetails; - aDetails.append( VclResId(SV_APP_CPUTHREADS).toString() ); + aDetails.append( VclResId(SV_APP_CPUTHREADS) ); aDetails.append( (sal_Int32) std::thread::hardware_concurrency() ); aDetails.append( "; " ); @@ -1187,22 +1187,22 @@ OUString Application::GetHWOSConfInfo() else aVersion = "-"; - aDetails.append( VclResId(SV_APP_OSVERSION).toString() ); + aDetails.append( VclResId(SV_APP_OSVERSION) ); aDetails.append( aVersion ); aDetails.append( "; " ); - aDetails.append( VclResId(SV_APP_UIRENDER).toString() ); + aDetails.append( VclResId(SV_APP_UIRENDER) ); #if HAVE_FEATURE_OPENGL if ( OpenGLWrapper::isVCLOpenGLEnabled() ) - aDetails.append( VclResId(SV_APP_GL).toString() ); + aDetails.append( VclResId(SV_APP_GL) ); else #endif - aDetails.append( VclResId(SV_APP_DEFAULT).toString() ); + aDetails.append( VclResId(SV_APP_DEFAULT) ); aDetails.append( "; " ); #ifdef LINUX // Only linux has different backends, so don't show blank for others. - aDetails.append( VclResId(SV_APP_VCLBACKEND).toString() ); + aDetails.append( VclResId(SV_APP_VCLBACKEND) ); aDetails.append( GetToolkitName() ); aDetails.append( "; " ); #endif diff --git a/vcl/source/control/button.cxx b/vcl/source/control/button.cxx index 736c77d1b127..89abc984b459 100644 --- a/vcl/source/control/button.cxx +++ b/vcl/source/control/button.cxx @@ -161,7 +161,7 @@ OUString Button::GetStandardText( StandardButtonType eButton ) else if (nResId == SV_BUTTONTEXT_CANCEL) nResId = SV_BUTTONTEXT_CANCEL_NOMNEMONIC; #endif - return ResId(nResId, *pResMgr).toString(); + return ResId(nResId, *pResMgr); } bool Button::SetModeImage( const Image& rImage ) diff --git a/vcl/source/edit/textundo.cxx b/vcl/source/edit/textundo.cxx index 6cdd4442b421..191aa2954290 100644 --- a/vcl/source/edit/textundo.cxx +++ b/vcl/source/edit/textundo.cxx @@ -213,7 +213,7 @@ void TextUndoConnectParas::Redo() OUString TextUndoConnectParas::GetComment () const { - return ResId(STR_TEXTUNDO_CONNECTPARAS, *ImplGetResMgr()).toString(); + return ResId(STR_TEXTUNDO_CONNECTPARAS, *ImplGetResMgr()); } TextUndoSplitPara::TextUndoSplitPara( TextEngine* pTextEngine, sal_uInt32 nPara, sal_Int32 nPos ) @@ -290,7 +290,7 @@ OUString TextUndoInsertChars::GetComment () const // multiple lines? OUString sText(maText); Shorten(sText); - return ResId(STR_TEXTUNDO_INSERTCHARS, *ImplGetResMgr()).toString().replaceAll("$1", sText); + return OUString(ResId(STR_TEXTUNDO_INSERTCHARS, *ImplGetResMgr())).replaceAll("$1", sText); } TextUndoRemoveChars::TextUndoRemoveChars( TextEngine* pTextEngine, const TextPaM& rTextPaM, const OUString& rStr ) diff --git a/vcl/source/outdev/font.cxx b/vcl/source/outdev/font.cxx index ce3702169bcb..5bad32a22e44 100644 --- a/vcl/source/outdev/font.cxx +++ b/vcl/source/outdev/font.cxx @@ -985,7 +985,7 @@ void OutputDevice::ImplInitFontList() const ResMgr* pMgr = ImplGetResMgr(); if( pMgr ) { - OUString aResStr(ResId(SV_ACCESSERROR_NO_FONTS, *pMgr).toString()); + OUString aResStr(ResId(SV_ACCESSERROR_NO_FONTS, *pMgr)); if( !aResStr.isEmpty() ) aError = aResStr; } diff --git a/vcl/source/window/brdwin.cxx b/vcl/source/window/brdwin.cxx index 906486ad51d5..5a7bd774d4ca 100644 --- a/vcl/source/window/brdwin.cxx +++ b/vcl/source/window/brdwin.cxx @@ -342,7 +342,7 @@ OUString ImplBorderWindowView::ImplRequestHelp( ImplBorderFrameData* pData, } if( nHelpId && ImplGetResMgr() ) - aHelpStr = ResId(nHelpId, *ImplGetResMgr()).toString(); + aHelpStr = ResId(nHelpId, *ImplGetResMgr()); return aHelpStr; } diff --git a/vcl/source/window/menubarwindow.cxx b/vcl/source/window/menubarwindow.cxx index 46c453edb737..bbc2c702928c 100644 --- a/vcl/source/window/menubarwindow.cxx +++ b/vcl/source/window/menubarwindow.cxx @@ -140,13 +140,13 @@ MenuBarWindow::MenuBarWindow( vcl::Window* pParent ) : aCloseBtn->InsertItem(IID_DOCUMENTCLOSE, aCloseBtn->maImage); aCloseBtn->SetSelectHdl(LINK(this, MenuBarWindow, CloseHdl)); aCloseBtn->AddEventListener(LINK(this, MenuBarWindow, ToolboxEventHdl)); - aCloseBtn->SetQuickHelpText(IID_DOCUMENTCLOSE, ResId(SV_HELPTEXT_CLOSEDOCUMENT, *pResMgr).toString()); + aCloseBtn->SetQuickHelpText(IID_DOCUMENTCLOSE, ResId(SV_HELPTEXT_CLOSEDOCUMENT, *pResMgr)); aFloatBtn->SetSymbol( SymbolType::FLOAT ); - aFloatBtn->SetQuickHelpText( ResId(SV_HELPTEXT_RESTORE, *pResMgr).toString() ); + aFloatBtn->SetQuickHelpText( ResId(SV_HELPTEXT_RESTORE, *pResMgr) ); aHideBtn->SetSymbol( SymbolType::HIDE ); - aHideBtn->SetQuickHelpText( ResId(SV_HELPTEXT_MINIMIZE, *pResMgr).toString() ); + aHideBtn->SetQuickHelpText( ResId(SV_HELPTEXT_MINIMIZE, *pResMgr) ); } ImplInitStyleSettings(); diff --git a/vcl/source/window/msgbox.cxx b/vcl/source/window/msgbox.cxx index ac5133506449..dfda1fabf11d 100644 --- a/vcl/source/window/msgbox.cxx +++ b/vcl/source/window/msgbox.cxx @@ -407,7 +407,7 @@ void WarningBox::SetDefaultCheckBoxText() { ResMgr* pResMgr = ImplGetResMgr(); if( pResMgr ) - maCheckBoxText = ResId(SV_STDTEXT_DONTWARNAGAIN, *pResMgr).toString(); + maCheckBoxText = ResId(SV_STDTEXT_DONTWARNAGAIN, *pResMgr); } Image WarningBox::GetStandardImage() @@ -456,7 +456,7 @@ void QueryBox::SetDefaultCheckBoxText() { ResMgr* pResMgr = ImplGetResMgr(); if( pResMgr ) - maCheckBoxText = ResId(SV_STDTEXT_DONTASKAGAIN, *pResMgr).toString(); + maCheckBoxText = ResId(SV_STDTEXT_DONTASKAGAIN, *pResMgr); } Image QueryBox::GetStandardImage() diff --git a/vcl/source/window/printdlg.cxx b/vcl/source/window/printdlg.cxx index c3ef73c60b3c..9dea04a8e4ed 100644 --- a/vcl/source/window/printdlg.cxx +++ b/vcl/source/window/printdlg.cxx @@ -70,7 +70,7 @@ PrintDialog::PrintPreviewWindow::PrintPreviewWindow( vcl::Window* i_pParent ) : Window( i_pParent, 0 ) , maOrigSize( 10, 10 ) , maPageVDev( VclPtr<VirtualDevice>::Create(*this) ) - , maToolTipString(VclResId( SV_PRINT_PRINTPREVIEW_TXT).toString()) + , maToolTipString(VclResId( SV_PRINT_PRINTPREVIEW_TXT)) , mbGreyscale( false ) , maHorzDim(VclPtr<FixedLine>::Create(this, WB_HORZ | WB_CENTER)) , maVertDim(VclPtr<FixedLine>::Create(this, WB_VERT | WB_VCENTER)) @@ -573,11 +573,11 @@ PrintDialog::PrintDialog( vcl::Window* i_pParent, const std::shared_ptr<PrinterC , maNUpPage(m_pUIBuilder.get()) , maJobPage(m_pUIBuilder.get()) , maOptionsPage(m_pUIBuilder.get()) - , maNoPageStr( VclResId( SV_PRINT_NOPAGES ).toString() ) + , maNoPageStr( VclResId( SV_PRINT_NOPAGES ) ) , mnCurPage( 0 ) , mnCachedPages( 0 ) - , maPrintToFileText( VclResId( SV_PRINT_TOFILE_TXT ).toString() ) - , maDefPrtText( VclResId( SV_PRINT_DEFPRT_TXT ).toString() ) + , maPrintToFileText( VclResId( SV_PRINT_TOFILE_TXT ) ) + , maDefPrtText( VclResId( SV_PRINT_DEFPRT_TXT ) ) , mbShowLayoutPage( true ) { get(mpOKButton, "ok"); diff --git a/vcl/source/window/splitwin.cxx b/vcl/source/window/splitwin.cxx index a5b71d093363..18c82e76b782 100644 --- a/vcl/source/window/splitwin.cxx +++ b/vcl/source/window/splitwin.cxx @@ -2351,7 +2351,7 @@ void SplitWindow::RequestHelp( const HelpEvent& rHEvt ) OUString aStr; ResMgr* pResMgr = ImplGetResMgr(); if( pResMgr ) - aStr = ResId( nHelpResId, *pResMgr ).toString(); + aStr = ResId( nHelpResId, *pResMgr ); if ( rHEvt.GetMode() & HelpEventMode::BALLOON ) Help::ShowBalloon( this, aHelpRect.Center(), aHelpRect, aStr ); else |