summaryrefslogtreecommitdiff
path: root/vcl/unx/source/app/keysymnames.cxx
diff options
context:
space:
mode:
authorPhilipp Lohmann <pl@openoffice.org>2001-10-25 16:37:02 +0000
committerPhilipp Lohmann <pl@openoffice.org>2001-10-25 16:37:02 +0000
commitf7ce2a0d0e46c2fdb7cedafbbab255d7f1735cc9 (patch)
tree88ecf9e0d83b58dd805c216a3a5f9a233c09c892 /vcl/unx/source/app/keysymnames.cxx
parent20166fe5e39a667ae833c26e0eb8f7877821d507 (diff)
#93804# #i1947# survice keyboards without a name
Diffstat (limited to 'vcl/unx/source/app/keysymnames.cxx')
-rw-r--r--vcl/unx/source/app/keysymnames.cxx24
1 files changed, 15 insertions, 9 deletions
diff --git a/vcl/unx/source/app/keysymnames.cxx b/vcl/unx/source/app/keysymnames.cxx
index 54babe55fa90..acbedf50536d 100644
--- a/vcl/unx/source/app/keysymnames.cxx
+++ b/vcl/unx/source/app/keysymnames.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: keysymnames.cxx,v $
*
- * $Revision: 1.4 $
+ * $Revision: 1.5 $
*
- * last change: $Author: cp $ $Date: 2001-09-21 15:31:55 $
+ * last change: $Author: pl $ $Date: 2001-10-25 17:37:02 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -609,10 +609,15 @@ const char* SalDisplay::GetKeyboardName( BOOL bRefresh )
// try X keyboard extension
if( pXkbDesc = XkbGetKeyboard( GetDisplay(), XkbAllComponentsMask, XkbUseCoreKbd ) )
{
- const char* pAtom = XGetAtomName( GetDisplay(), pXkbDesc->names->groups[0] );
- m_aKeyboardName = pAtom;
- XFree( (void*)pAtom );
-
+ const char* pAtom = NULL;
+ if( pXkbDesc->names->groups[0] )
+ {
+ pAtom = XGetAtomName( GetDisplay(), pXkbDesc->names->groups[0] );
+ m_aKeyboardName = pAtom;
+ XFree( (void*)pAtom );
+ }
+ else
+ m_aKeyboardName = "<unknown keyboard>";
#ifdef DEBUG
#define PRINT_ATOM( x ) { if( pXkbDesc->names->x ) { pAtom = XGetAtomName( GetDisplay(), pXkbDesc->names->x ); fprintf( stderr, "%s: %s\n", #x, pAtom ); XFree( (void*)pAtom ); } else fprintf( stderr, "%s: <nil>\n", #x ); }
@@ -623,13 +628,14 @@ const char* SalDisplay::GetKeyboardName( BOOL bRefresh )
PRINT_ATOM( compat );
PRINT_ATOM( phys_symbols );
+#define PRINT_ATOM_2( x ) { if( pXkbDesc->names->x[i] ) { pAtom = XGetAtomName( GetDisplay(), pXkbDesc->names->x[i] ); fprintf( stderr, "%s[%d]: %s\n", #x, i, pAtom ); XFree( (void*)pAtom ); } else fprintf( stderr, "%s[%d]: <nil>\n", #x, i ); }
int i;
for( i = 0; i < XkbNumVirtualMods; i++ )
- PRINT_ATOM( vmods[i] );
+ PRINT_ATOM_2( vmods );
for( i = 0; i < XkbNumIndicators; i++ )
- PRINT_ATOM( indicators[i] );
+ PRINT_ATOM_2( indicators );
for( i = 0; i < XkbNumKbdGroups; i++ )
- PRINT_ATOM( groups[i] );
+ PRINT_ATOM_2( groups );
#endif
XkbFreeKeyboard( pXkbDesc, 0, True );
}