summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorDouglas Mencken <dougmencken@gmail.com>2014-06-15 22:40:36 -0400
committerCaolán McNamara <caolanm@redhat.com>2014-06-16 12:30:38 +0000
commita2ee38ef7afcec27f46530bf9e177939e38cc815 (patch)
treeb5bb370d51409325099972a616b7db979d3bdc7f /vcl
parentca4f1929ced3714c99acc7c7458277459158683a (diff)
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 <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/inc/osx/salframeview.h10
-rw-r--r--vcl/osx/salframeview.mm26
2 files changed, 34 insertions, 2 deletions
diff --git a/vcl/inc/osx/salframeview.h b/vcl/inc/osx/salframeview.h
index 4f0c68531a0d..7e957b67acc1 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 fadd508b20ca..ec73f05dd8b6 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 );