[Libreoffice-commits] .: 2 commits - vcl/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Mon Oct 22 05:37:17 PDT 2012


 vcl/source/control/button.cxx |   13 ++++++++-----
 vcl/source/window/builder.cxx |    2 +-
 2 files changed, 9 insertions(+), 6 deletions(-)

New commits:
commit 920807d4491834cd88e545fdb930c9105d58c4cd
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Oct 22 13:31:38 2012 +0100

    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

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
     {
commit 3c71a0bae6dab8dc53c5f2b014933dcf7ef45024
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Oct 22 12:49:13 2012 +0100

    explictly require Bitmap to get image
    
    Change-Id: I0f7e0510f6c946be7cf930659db961d3c17e1c4f

diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx
index cc2af7f..deb563c 100644
--- a/vcl/source/window/builder.cxx
+++ b/vcl/source/window/builder.cxx
@@ -190,7 +190,7 @@ VclBuilder::VclBuilder(Window *pParent, OUString sUIDir, OUString sUIFile, OStri
         {
             pTarget->SetSymbol(eType);
             if (eType == SYMBOL_IMAGE)
-                pTarget->SetModeImage(VclResId(mapStockToImageResource(rImage)));
+                pTarget->SetModeImage(Bitmap(VclResId(mapStockToImageResource(rImage))));
         }
     }
 


More information about the Libreoffice-commits mailing list