diff options
author | Oliver Bolte <obo@openoffice.org> | 2009-03-05 12:31:53 +0000 |
---|---|---|
committer | Oliver Bolte <obo@openoffice.org> | 2009-03-05 12:31:53 +0000 |
commit | 3315021862137d58fd8d57c035d397474a9df644 (patch) | |
tree | d305e4d87199b0752edb5ee8a1bc30c6a3086fc0 | |
parent | fa1f37753d2826a0993d01f615e2a7b6c235094e (diff) |
CWS-TOOLING: integrate CWS ooo31gsl3_DEV300
2009-02-26 17:02:24 +0100 hdu r268540 : #i99293# gtk-font-height is non-absolute per default
2009-02-24 12:13:17 +0100 pl r268393 : #i99567# fix key handling with Alt combinations
-rwxr-xr-x | vcl/aqua/inc/salframeview.h | 18 | ||||
-rwxr-xr-x | vcl/aqua/source/window/salframeview.mm | 36 | ||||
-rw-r--r-- | vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx | 2 |
3 files changed, 41 insertions, 15 deletions
diff --git a/vcl/aqua/inc/salframeview.h b/vcl/aqua/inc/salframeview.h index 174c04b1e476..e969cc8509a1 100755 --- a/vcl/aqua/inc/salframeview.h +++ b/vcl/aqua/inc/salframeview.h @@ -71,15 +71,15 @@ AquaSalFrame* mpFrame; // for NSTextInput - id mpLastEvent; - BOOL mbNeedSpecialKeyHandle; - BOOL mbInKeyInput; - BOOL mbKeyHandled; - NSRange mMarkedRange; - NSRange mSelectedRange; - id mpMouseEventListener; - id mDraggingDestinationHandler; - id mpLastSuperEvent; + NSEvent* mpLastEvent; + BOOL mbNeedSpecialKeyHandle; + BOOL mbInKeyInput; + BOOL mbKeyHandled; + NSRange mMarkedRange; + NSRange mSelectedRange; + id mpMouseEventListener; + id mDraggingDestinationHandler; + NSEvent* mpLastSuperEvent; } +(void)unsetMouseFrame: (AquaSalFrame*)pFrame; -(id)initWithSalFrame: (AquaSalFrame*)pFrame; diff --git a/vcl/aqua/source/window/salframeview.mm b/vcl/aqua/source/window/salframeview.mm index ec52d86528c9..b491318bbb0d 100755 --- a/vcl/aqua/source/window/salframeview.mm +++ b/vcl/aqua/source/window/salframeview.mm @@ -889,19 +889,45 @@ private: if( pInsert && ( nLen = [pInsert length] ) > 0 ) { OUString aInsertString( GetOUString( pInsert ) ); - USHORT nKeyCode = 0; - // aCharCode initializer is safe since aInsertString will at least contain '\0' sal_Unicode aCharCode = *aInsertString.getStr(); - nKeyCode = ImplMapCharCode( aCharCode ); - // FIXME: will probably break somehow in less than trivial text input mode + if( nLen == 1 && aCharCode < 0x80 && aCharCode > 0x1f && ! [self hasMarkedText ] ) { - [self sendKeyInputAndReleaseToFrame: nKeyCode character: aCharCode]; + USHORT nKeyCode = ImplMapCharCode( aCharCode ); + unsigned int nLastModifiers = mpFrame->mnLastModifierFlags; + + // #i99567# + // find out the unmodified key code + + // sanity check + if( mpLastEvent && ( [mpLastEvent type] == NSKeyDown || [mpLastEvent type] == NSKeyUp ) ) + { + // get unmodified string + NSString* pUnmodifiedString = [mpLastEvent charactersIgnoringModifiers]; + if( pUnmodifiedString && [pUnmodifiedString length] == 1 ) + { + // map the unmodified key code + unichar keyChar = [pUnmodifiedString characterAtIndex: 0]; + nKeyCode = ImplMapCharCode( keyChar ); + } + nLastModifiers = [mpLastEvent modifierFlags]; + + } + // #i99567# + // applications and vcl's edit fields ignore key events with ALT + // however we're at a place where we know text should be inserted + // so it seems we need to strip the Alt modifier here + if( (nLastModifiers & (NSShiftKeyMask | NSControlKeyMask | NSAlternateKeyMask | NSCommandKeyMask)) + == NSAlternateKeyMask ) + { + nLastModifiers = 0; + } + [self sendKeyInputAndReleaseToFrame: nKeyCode character: aCharCode modifiers: nLastModifiers]; } else { diff --git a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx index 0d2880d22754..04d679d8d4f1 100644 --- a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx +++ b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx @@ -3358,7 +3358,7 @@ void GtkSalGraphics::updateSettings( AllSettings& rSettings ) static gboolean(*pAbso)(const PangoFontDescription*) = (gboolean(*)(const PangoFontDescription*))osl_getAsciiFunctionSymbol( GetSalData()->m_pPlugin, "pango_font_description_get_size_is_absolute" ); - if( ! pAbso || pAbso( pStyle->font_desc ) ) + if( pAbso && pAbso( pStyle->font_desc ) ) nPointHeight = (nPangoHeight * 72 + nDispDPIY*PANGO_SCALE/2) / (nDispDPIY * PANGO_SCALE); else nPointHeight = nPangoHeight/PANGO_SCALE; |