You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openoffice.apache.org by hd...@apache.org on 2013/12/17 13:31:20 UTC

svn commit: r1551526 - in /openoffice/trunk/main: tools/inc/tools/prex.h vcl/unx/generic/app/i18n_xkb.cxx

Author: hdu
Date: Tue Dec 17 12:31:19 2013
New Revision: 1551526

URL: http://svn.apache.org/r1551526
Log:
#i123865# enable XKB for all X11-based display targets

Modified:
    openoffice/trunk/main/tools/inc/tools/prex.h
    openoffice/trunk/main/vcl/unx/generic/app/i18n_xkb.cxx

Modified: openoffice/trunk/main/tools/inc/tools/prex.h
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/tools/inc/tools/prex.h?rev=1551526&r1=1551525&r2=1551526&view=diff
==============================================================================
--- openoffice/trunk/main/tools/inc/tools/prex.h (original)
+++ openoffice/trunk/main/tools/inc/tools/prex.h Tue Dec 17 12:31:19 2013
@@ -39,20 +39,13 @@
 extern "C" {
 #endif
 
-#if defined(LINUX) || defined(FREEBSD) || defined(MACOSX) // should really check for xfree86 or for X11R6.1 and higher
-#define __XKeyboardExtension__ 1
-#else
-#define __XKeyboardExtension__ 0
-#endif
-
 #include <X11/X.h>
 #include <X11/Xlib.h>
 #include <X11/Xutil.h>
 #include <X11/StringDefs.h>
 #include <X11/extensions/Xrender.h>
-#if __XKeyboardExtension__
 #include <X11/XKBlib.h>
-#endif
+
 typedef unsigned long Pixel;
 
 #undef  DestroyAll

Modified: openoffice/trunk/main/vcl/unx/generic/app/i18n_xkb.cxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/vcl/unx/generic/app/i18n_xkb.cxx?rev=1551526&r1=1551525&r2=1551526&view=diff
==============================================================================
--- openoffice/trunk/main/vcl/unx/generic/app/i18n_xkb.cxx (original)
+++ openoffice/trunk/main/vcl/unx/generic/app/i18n_xkb.cxx Tue Dec 17 12:31:19 2013
@@ -31,16 +31,10 @@
 #include "unx/saldata.hxx"
 #include "unx/i18n_xkb.hxx"
 
-SalI18N_KeyboardExtension::SalI18N_KeyboardExtension( Display*
-#if __XKeyboardExtension__
-pDisplay
-#endif
-)
-	: mbUseExtension( (sal_Bool)__XKeyboardExtension__ ),
-	  mnDefaultGroup( 0 )
+SalI18N_KeyboardExtension::SalI18N_KeyboardExtension( Display* pDisplay)
+:	mbUseExtension( true ),
+,	mnDefaultGroup( 0 )
 {
-	#if __XKeyboardExtension__
-
 	mpDisplay = pDisplay;
 
 	// allow user to set the default keyboard group idx or to disable the usage
@@ -89,19 +83,11 @@ pDisplay
 		XkbGetState( mpDisplay, XkbUseCoreKbd, &aStateRecord );
 		mnGroup = aStateRecord.group;
 	}
-
-	#endif // __XKeyboardExtension__
 }
 
 void
-SalI18N_KeyboardExtension::Dispatch( XEvent*
-#if __XKeyboardExtension__
-pEvent
-#endif
-)
+SalI18N_KeyboardExtension::Dispatch( XEvent* pEvent)
 {
-	#if __XKeyboardExtension__
-
 	// must the event be handled?
 	if (   !mbUseExtension
 		|| (pEvent->type != mnEventBase) )
@@ -119,41 +105,21 @@ pEvent
 
 		default:
 
-            #if OSL_DEBUG_LEVEL > 1
+#if OSL_DEBUG_LEVEL > 1
 			fprintf(stderr, "Got unrequested XkbAnyEvent %#x/%i\n",
-                    static_cast<unsigned int>(nXKBType), static_cast<int>(nXKBType) );
-			#endif
+				static_cast<unsigned int>(nXKBType), static_cast<int>(nXKBType) );
+#endif
 			break;
 	}
-	#endif // __XKeyboardExtension__
 }
 
-#if __XKeyboardExtension__
-sal_uInt32
-SalI18N_KeyboardExtension::LookupKeysymInGroup( sal_uInt32 nKeyCode,
-				 							    sal_uInt32 nShiftState,
-								   				sal_uInt32 nGroup ) const
-#else
-sal_uInt32
-SalI18N_KeyboardExtension::LookupKeysymInGroup( sal_uInt32,sal_uInt32,sal_uInt32 ) const
-#endif
+sal_uInt32 SalI18N_KeyboardExtension::LookupKeysymInGroup( sal_uInt32 nKeyCode,
+	sal_uInt32 nShiftState, sal_uInt32 nGroup ) const
 {
-	#if __XKeyboardExtension__
-
-	if ( !mbUseExtension )
-		return NoSymbol;
-
 	nShiftState &= ShiftMask;
 
-	KeySym		nKeySymbol;
-	nKeySymbol = XkbKeycodeToKeysym( mpDisplay, nKeyCode, nGroup, nShiftState );
+	KeySym nKeySymbol = XkbKeycodeToKeysym( mpDisplay, nKeyCode, nGroup, nShiftState );
 	return nKeySymbol;
-
-	#else
-
-	return NoSymbol;
-
-	#endif // __XKeyboardExtension__
 }