vcl/inc/osx/salframeview.h | 10 +++++++++- vcl/osx/salframeview.mm | 26 +++++++++++++++++++++++++- 2 files changed, 34 insertions(+), 2 deletions(-)
New commits: commit a2ee38ef7afcec27f46530bf9e177939e38cc815 Author: Douglas Mencken <dougmenc...@gmail.com> Date: Sun Jun 15 22:40:36 2014 -0400 fix keyboard input on OS X < 10.6 Since commit e4dc93f5, LibreOffice just beeps on any key press: it's impossible to add symbols by using keyboard. This patch fixes that. conditionally reverts e4dc93f5d8d0df50f1a8b4594220d0c57703e03d Change-ID: Id30e30775c0d0224954b8a1f05fd0d8d5f39cd4e Reviewed-on: https://gerrit.libreoffice.org/9793 Reviewed-by: Caolán McNamara <caol...@redhat.com> Tested-by: Caolán McNamara <caol...@redhat.com> diff --git a/vcl/inc/osx/salframeview.h b/vcl/inc/osx/salframeview.h index 4f0c685..7e957b6 100644 --- a/vcl/inc/osx/salframeview.h +++ b/vcl/inc/osx/salframeview.h @@ -63,11 +63,15 @@ -(void)unregisterDraggingDestinationHandler:(id)theHandler; @end +#if MAC_OS_X_VERSION_MAX_ALLOWED < 1060 +@interface SalFrameView : AquaA11yWrapper <NSTextInput> +#else @interface SalFrameView : AquaA11yWrapper <NSTextInputClient> +#endif { AquaSalFrame* mpFrame; - // for NSTextInputClient + // for NSTextInput/NSTextInputClient NSEvent* mpLastEvent; BOOL mbNeedSpecialKeyHandle; BOOL mbInKeyInput; @@ -117,7 +121,11 @@ /* text action methods */ +#if MAC_OS_X_VERSION_MAX_ALLOWED < 1060 +-(void)insertText:(id)aString; +#else -(void)insertText:(id)aString replacementRange:(NSRange)replacementRange; +#endif -(void)insertTab: (id)aSender; -(void)insertBacktab: (id)aSender; -(void)moveLeft: (id)aSender; diff --git a/vcl/osx/salframeview.mm b/vcl/osx/salframeview.mm index fadd508..ec73f05 100644 --- a/vcl/osx/salframeview.mm +++ b/vcl/osx/salframeview.mm @@ -1026,9 +1026,15 @@ private: } } +#if MAC_OS_X_VERSION_MAX_ALLOWED < 1060 +-(void)insertText:(id)aString +#else -(void)insertText:(id)aString replacementRange:(NSRange)replacementRange +#endif { +#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1060 (void) replacementRange; // FIXME: surely it must be used +#endif YIELD_GUARD; @@ -1547,7 +1553,7 @@ private: } -// NSTextInputClient protocol +// NSTextInput/NSTextInputClient protocol - (NSArray *)validAttributesForMarkedText { return [NSArray arrayWithObjects:NSUnderlineStyleAttributeName, nil]; @@ -1598,9 +1604,15 @@ private: return mSelectedRange; } +#if MAC_OS_X_VERSION_MAX_ALLOWED < 1060 +- (void)setMarkedText:(id)aString selectedRange:(NSRange)selRange +#else - (void)setMarkedText:(id)aString selectedRange:(NSRange)selRange replacementRange:(NSRange)replacementRange +#endif { +#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1060 (void) replacementRange; // FIXME - use it! +#endif if( ![aString isKindOfClass:[NSAttributedString class]] ) aString = [[[NSAttributedString alloc] initWithString:aString] autorelease]; @@ -1668,10 +1680,16 @@ private: mSelectedRange = mMarkedRange = NSMakeRange(NSNotFound, 0); } +#if MAC_OS_X_VERSION_MAX_ALLOWED < 1060 +- (NSAttributedString *)attributedSubstringFromRange:(NSRange)aRange +#else - (NSAttributedString *)attributedSubstringForProposedRange:(NSRange)aRange actualRange:(NSRangePointer)actualRange +#endif { (void) aRange; +#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1060 (void) actualRange; +#endif // FIXME - Implement return nil; @@ -1715,11 +1733,17 @@ private: mpLastEvent = nil; } +#if MAC_OS_X_VERSION_MAX_ALLOWED < 1060 +- (NSRect)firstRectForCharacterRange:(NSRange)aRange +#else - (NSRect)firstRectForCharacterRange:(NSRange)aRange actualRange:(NSRangePointer)actualRange +#endif { // FIXME - These should probably be used? (void) aRange; +#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1060 (void) actualRange; +#endif SalExtTextInputPosEvent aPosEvent; mpFrame->CallCallback( SALEVENT_EXTTEXTINPUTPOS, (void *)&aPosEvent );
_______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits