< prev index next >

modules/graphics/src/main/native-glass/mac/GlassView3D.m

Print this page

        

@@ -686,11 +686,11 @@
 
 - (void) insertText:(id)aString replacementRange:(NSRange)replacementRange
 {
     IMLOG("insertText called with string: %s", [aString UTF8String]);
     if ([self->nsAttrBuffer length] > 0 || [aString length] > 1) { 
-        [self->_delegate notifyInputMethod:aString attr:4 length:(int)[aString length] cursor:(int)[aString length] ];
+        [self->_delegate notifyInputMethod:aString attr:4 length:(int)[aString length] cursor:(int)[aString length] selectedRange: NSMakeRange(NSNotFound, 0)];
         self->shouldProcessKeyEvent = NO;
     } else {
         self->shouldProcessKeyEvent = YES;
     }
     self->nsAttrBuffer = [self->nsAttrBuffer initWithString:@""];

@@ -704,22 +704,22 @@
     }
     BOOL isAttributedString = [aString isKindOfClass:[NSAttributedString class]];
     NSAttributedString *attrString = (isAttributedString ? (NSAttributedString *)aString : nil);
     NSString *incomingString = (isAttributedString ? [aString string] : aString);
     IMLOG("setMarkedText called, attempt to set string to %s", [incomingString UTF8String]);
-    [self->_delegate notifyInputMethod:incomingString attr:1 length:0 cursor:(int)[incomingString length] ];
+    [self->_delegate notifyInputMethod:incomingString attr:1 length:0 cursor:(int)[incomingString length] selectedRange:selectionRange ];
     self->nsAttrBuffer = (attrString == nil ? [self->nsAttrBuffer initWithString:incomingString] 
                                             : [self->nsAttrBuffer initWithAttributedString: attrString]);
     self->shouldProcessKeyEvent = NO;
 }
 
 - (void) unmarkText
 {
     IMLOG("unmarkText called\n");
     if (self->nsAttrBuffer != nil && self->nsAttrBuffer.length != 0) {
         self->nsAttrBuffer = [self->nsAttrBuffer initWithString:@""];
-        [self->_delegate notifyInputMethod:@"" attr:4 length:0 cursor:0 ];
+        [self->_delegate notifyInputMethod:@"" attr:4 length:0 cursor:0 selectedRange: NSMakeRange(NSNotFound, 0)];
     }
     self->shouldProcessKeyEvent = YES;
 }
 
 - (BOOL) hasMarkedText
< prev index next >