Date: prev next · Thread: first prev next last
2011 Archives by date, by thread · List index


I made a change to not show accelerators in Edit popups except in KDE and Windows, which are to my 
knowledge the only platforms doing this.
I'm not sure if this is the best way to address this, I looked at the style settings, but this 
isn't a setting, and I saw get_desktop_session() but that isn't public API and I'm not sure how 
it's meant to be used. If there's a better approach, pointers welcome.

Also filed as fdo#36235 with the same patch.

ciao,
    Christian
From 509dccd84864c79a659901800e145303d1182b23 Mon Sep 17 00:00:00 2001
From: Christian Dywan <christian.dywan@lanedo.com>
Date: Thu, 14 Apr 2011 19:41:41 +0200
Subject: [PATCH] Only accelerators in Edit popup on Windows and KDE

Fixes: fdo#36239

diff --git a/vcl/source/control/edit.cxx b/vcl/source/control/edit.cxx
index 30e0296..ee6f6ff 100644
--- a/vcl/source/control/edit.cxx
+++ b/vcl/source/control/edit.cxx
@@ -2933,13 +2933,23 @@ PopupMenu* Edit::CreatePopupMenu()
         return new PopupMenu();
 
     PopupMenu* pPopup = new PopupMenu( ResId( SV_RESID_MENU_EDIT, *pResMgr ) );
-    pPopup->SetAccelKey( SV_MENU_EDIT_UNDO, KeyCode( KEYFUNC_UNDO ) );
-    pPopup->SetAccelKey( SV_MENU_EDIT_CUT, KeyCode( KEYFUNC_CUT ) );
-    pPopup->SetAccelKey( SV_MENU_EDIT_COPY, KeyCode( KEYFUNC_COPY ) );
-    pPopup->SetAccelKey( SV_MENU_EDIT_PASTE, KeyCode( KEYFUNC_PASTE ) );
-    pPopup->SetAccelKey( SV_MENU_EDIT_DELETE, KeyCode( KEYFUNC_DELETE ) );
-    pPopup->SetAccelKey( SV_MENU_EDIT_SELECTALL, KeyCode( KEY_A, sal_False, sal_True, sal_False, 
sal_False ) );
-    pPopup->SetAccelKey( SV_MENU_EDIT_INSERTSYMBOL, KeyCode( KEY_S, sal_True, sal_True, sal_False, 
sal_False ) );
+#ifdef _WIN32
+    if (1)
+#else
+    static const char *pDesktop = getenv ("OOO_FORCE_DESKTOP");
+    if (! ( pDesktop && *pDesktop))
+        pDesktop = getenv ("DESKTOP_SESSION");
+    if ( strstr( pDesktop, "kde" ) != NULL )
+#endif
+    {
+        pPopup->SetAccelKey( SV_MENU_EDIT_UNDO, KeyCode( KEYFUNC_UNDO ) );
+        pPopup->SetAccelKey( SV_MENU_EDIT_CUT, KeyCode( KEYFUNC_CUT ) );
+        pPopup->SetAccelKey( SV_MENU_EDIT_COPY, KeyCode( KEYFUNC_COPY ) );
+        pPopup->SetAccelKey( SV_MENU_EDIT_PASTE, KeyCode( KEYFUNC_PASTE ) );
+        pPopup->SetAccelKey( SV_MENU_EDIT_DELETE, KeyCode( KEYFUNC_DELETE ) );
+        pPopup->SetAccelKey( SV_MENU_EDIT_SELECTALL, KeyCode( KEY_A, sal_False, sal_True, 
sal_False, sal_False ) );
+        pPopup->SetAccelKey( SV_MENU_EDIT_INSERTSYMBOL, KeyCode( KEY_S, sal_True, sal_True, 
sal_False, sal_False ) );
+    }
     return pPopup;
 }
 
-- 
1.7.1


Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.