Resolves: rhbz#868479 guard against duplicated ~ in OK/Cancel

f41
Caolán McNamara 12 years ago
parent e4c4141662
commit 011db7c89b

@ -0,0 +1,47 @@
From 920807d4491834cd88e545fdb930c9105d58c4cd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolanm@redhat.com>
Date: Mon, 22 Oct 2012 13:31:38 +0100
Subject: [PATCH] Resolves: rhbz#868479 / fdo#56281 doubled ~ in German
ok/cancel translations
We have unix-specific code adding ~ to OK/Cancel. So don't add ~ if
string already contains those.
Though its an open question if the presence of ~ is a bad thing
for the Windows case. i.e. if we should have tooling to not
allow the OK/Cancel translations to contain ~ in the first place,
of if we should drop the ifdef UNX and do it globally now
Change-Id: I461c6ac9ca574ed188f51472919be82ec582e389
---
vcl/source/control/button.cxx | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/vcl/source/control/button.cxx b/vcl/source/control/button.cxx
index 373143b..d2336ec 100644
--- a/vcl/source/control/button.cxx
+++ b/vcl/source/control/button.cxx
@@ -157,12 +157,15 @@ XubString Button::GetStandardText( StandardButtonType eButton )
sal_uInt32 nResId = aResIdAry[(sal_uInt16)eButton].nResId;
aText = ResId(nResId, *pResMgr).toString();
- // Windows (apparently) has some magic auto-accelerator evil around
- // ok / cancel so add this only for Unix
-#ifdef UNX
- if( nResId == SV_BUTTONTEXT_OK || nResId == SV_BUTTONTEXT_CANCEL )
- aText.Insert( rtl::OUString("~"), 0 );
+ 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);
#endif
+ }
}
else
{
--
1.7.11.7

@ -34,7 +34,7 @@ Summary: Free Software Productivity Suite
Name: libreoffice
Epoch: 1
Version: %{libo_version}.1
Release: 2%{?libo_prerelease}%{?dist}
Release: 3%{?libo_prerelease}%{?dist}
License: (MPLv1.1 or LGPLv3+) and LGPLv3 and LGPLv2+ and BSD and (MPLv1.1 or GPLv2 or LGPLv2 or Netscape) and Public Domain and ASL 2.0 and Artistic
Group: Applications/Productivity
URL: http://www.documentfoundation.org/develop
@ -178,6 +178,7 @@ Patch18: 0004-tweak-old-school-gstreamer-link-line.patch
Patch19: 0005-Don-t-fail-configure-with-older-gstreamer-plugins-ba.patch
Patch20: 0006-gstreamer-various-fixes-for-1.0-and-cleanups.patch
Patch21: 0007-gstreamer-fix-leaking-pads.patch
Patch22: 0001-Resolves-rhbz-868479-fdo-56281-doubled-in-German-ok-.patch
%{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}
%define instdir %{_libdir}
@ -795,6 +796,7 @@ mv -f redhat.soc extras/source/palettes/standard.soc
%patch19 -p1 -b .Don-t-fail-configure-with-older-gstreamer-plugins-ba.patch
%patch20 -p1 -b .gstreamer-various-fixes-for-1.0-and-cleanups.patch
%patch21 -p1 -b .gstreamer-fix-leaking-pads.patch
%patch22 -p1 -b .rhbz-868479-fdo-56281-doubled-in-German-ok-.patch
# TODO: check this
# these are horribly incomplete--empty translations and copied english
@ -2026,6 +2028,9 @@ update-desktop-database %{_datadir}/applications &> /dev/null || :
%endif
%changelog
* Mon Oct 22 2012 Caolán McNamara <caolanm@redhat.com> - 1:3.6.3.1-3
- Resolves: rhbz#868479 guard against duplicated ~ in OK/Cancel
* Thu Oct 11 2012 David Tardon <dtardon@redhat.com> - 1:3.6.3.1-2
- Resolves: rhbz#858641 backport gstreamer 1.0 support to F-18

Loading…
Cancel
Save