diff options
author | Caolán McNamara <caolanm@redhat.com> | 2013-01-24 17:21:10 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-01-24 21:12:55 +0000 |
commit | 7d8caa3bacb99fa5fc7cf44c94aa907fcc45126b (patch) | |
tree | c61a3705c5a452bc19d6045215eb37144e841587 /vcl | |
parent | 4ef25c4bcc43ed02f17d1b45c9e0669f701dc2fe (diff) |
remove XubString in Button::GetStandardText
Change-Id: I13db34f37caeb44ab622b94d2e23ac1727182c8b
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/inc/vcl/button.hxx | 2 | ||||
-rw-r--r-- | vcl/source/control/button.cxx | 32 |
2 files changed, 16 insertions, 18 deletions
diff --git a/vcl/inc/vcl/button.hxx b/vcl/inc/vcl/button.hxx index 47a44012a195..03ba3d6c128b 100644 --- a/vcl/inc/vcl/button.hxx +++ b/vcl/inc/vcl/button.hxx @@ -71,7 +71,7 @@ public: void SetClickHdl( const Link& rLink ) { maClickHdl = rLink; } const Link& GetClickHdl() const { return maClickHdl; } - static XubString GetStandardText( StandardButtonType eButton ); + static OUString GetStandardText( StandardButtonType eButton ); static XubString GetStandardHelpText( StandardButtonType eButton ); sal_Bool SetModeImage( const Image& rImage ); diff --git a/vcl/source/control/button.cxx b/vcl/source/control/button.cxx index 6f0ad62f5e78..1cc10af31937 100644 --- a/vcl/source/control/button.cxx +++ b/vcl/source/control/button.cxx @@ -112,7 +112,7 @@ void Button::Click() // ----------------------------------------------------------------------- -XubString Button::GetStandardText( StandardButtonType eButton ) +OUString Button::GetStandardText( StandardButtonType eButton ) { static struct { @@ -134,27 +134,25 @@ XubString Button::GetStandardText( StandardButtonType eButton ) { SV_BUTTONTEXT_RESET, "R~eset" } }; - String aText; ResMgr* pResMgr = ImplGetResMgr(); - if( pResMgr ) + + if (!pResMgr) { - sal_uInt32 nResId = aResIdAry[(sal_uInt16)eButton].nResId; - aText = ResId(nResId, *pResMgr).toString(); + OString aT( aResIdAry[(sal_uInt16)eButton].pDefText ); + return OStringToOUString(aT, RTL_TEXTENCODING_ASCII_US); + } - if (nResId == SV_BUTTONTEXT_OK || nResId == SV_BUTTONTEXT_CANCEL) - { + sal_uInt32 nResId = aResIdAry[(sal_uInt16)eButton].nResId; + OUString aText = ResId(nResId, *pResMgr).toString(); + + if (nResId == SV_BUTTONTEXT_OK || nResId == SV_BUTTONTEXT_CANCEL) + { #ifndef WNT - // Windows (apparently) has some magic auto-accelerator evil around - // ok / cancel so add accelerators only for Unix - if (aText.Search('~') == STRING_NOTFOUND) - aText.Insert(rtl::OUString("~"), 0); + // Windows (apparently) has some magic auto-accelerator evil around + // ok / cancel so add accelerators only for Unix + if (aText.indexOf('~') == -1) + return "~" + aText; #endif - } - } - else - { - rtl::OString aT( aResIdAry[(sal_uInt16)eButton].pDefText ); - aText = rtl::OStringToOUString(aT, RTL_TEXTENCODING_ASCII_US); } return aText; } |