diff options
-rw-r--r-- | vcl/inc/svids.hrc | 2 | ||||
-rw-r--r-- | vcl/source/control/button.cxx | 20 | ||||
-rw-r--r-- | vcl/source/src/btntext.src | 19 |
3 files changed, 29 insertions, 12 deletions
diff --git a/vcl/inc/svids.hrc b/vcl/inc/svids.hrc index 27e5e0abf809..064cd538a88e 100644 --- a/vcl/inc/svids.hrc +++ b/vcl/inc/svids.hrc @@ -156,6 +156,8 @@ #define SV_BUTTONTEXT_NEW 10115 #define SV_BUTTONTEXT_EDIT 10116 #define SV_BUTTONTEXT_APPLY 10117 +#define SV_BUTTONTEXT_OK_NOMNEMONIC 10118 +#define SV_BUTTONTEXT_CANCEL_NOMNEMONIC 10119 #define SV_STDTEXT_FIRST SV_STDTEXT_SERVICENOTAVAILABLE #define SV_STDTEXT_SERVICENOTAVAILABLE 10200 diff --git a/vcl/source/control/button.cxx b/vcl/source/control/button.cxx index 1cc10af31937..e2f8b76b6cde 100644 --- a/vcl/source/control/button.cxx +++ b/vcl/source/control/button.cxx @@ -143,18 +143,16 @@ OUString Button::GetStandardText( StandardButtonType eButton ) } 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.indexOf('~') == -1) - return "~" + aText; +#ifdef WNT + // http://lists.freedesktop.org/archives/libreoffice/2013-January/044513.html + // Under windows we don't want accelerators on ok/cancel but do on other + // buttons + if (nResId == SV_BUTTONTEXT_OK) + nResId = SV_BUTTONTEXT_OK_NOMNEMONIC; + else if (nResId == SV_BUTTONTEXT_CANCEL) + nResId = SV_BUTTONTEXT_CANCEL_NOMNEMONIC; #endif - } - return aText; + return ResId(nResId, *pResMgr).toString(); } // ----------------------------------------------------------------------- diff --git a/vcl/source/src/btntext.src b/vcl/source/src/btntext.src index 5f93307428bb..a16fc703253f 100644 --- a/vcl/source/src/btntext.src +++ b/vcl/source/src/btntext.src @@ -18,13 +18,30 @@ #include <svids.hrc> +//http://lists.freedesktop.org/archives/libreoffice/2013-January/044513.html +//Special OK/Cancel handling + String SV_BUTTONTEXT_OK { - Text [ en-US ] = "OK"; + Text [ x-comment ] = "This is used on buttons for platforms other than windows, there should be a ~ mnemonic in this string"; + Text [ en-US ] = "~OK"; }; String SV_BUTTONTEXT_CANCEL { + Text [ x-comment ] = "This is used on buttons for platforms other than windows, there should be a ~ mnemonic in this string"; + Text [ en-US ] = "~Cancel"; +}; + +String SV_BUTTONTEXT_OK_NOMNEMONIC +{ + Text [ x-comment ] = "This is used on buttons for Windows, there should be no ~ mnemonic in this string"; + Text [ en-US ] = "OK"; +}; + +String SV_BUTTONTEXT_CANCEL_NOMNEMONIC +{ + Text [ x-comment ] = "This is used on buttons for Windows, there should be no ~ mnemonic in this string"; Text [ en-US ] = "Cancel"; }; |