diff options
author | Geenz <geenz@geenzo.com> | 2013-04-07 11:33:39 -0400 |
---|---|---|
committer | Geenz <geenz@geenzo.com> | 2013-04-07 11:33:39 -0400 |
commit | aa0cb35db561004c205c7aac2570407ae88ad472 (patch) | |
tree | f91a5860aa0b445d303e3fa3d08a4124eacb0cd8 /indra/llwindow/llopenglview-objc.mm | |
parent | 5098d43a9be5b9638a8806918e9bb82a096c000f (diff) |
Support the committing of the current pre edit string when language input is interrupted per the viewer's original pre edit functionality.
Diffstat (limited to 'indra/llwindow/llopenglview-objc.mm')
-rw-r--r-- | indra/llwindow/llopenglview-objc.mm | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/indra/llwindow/llopenglview-objc.mm b/indra/llwindow/llopenglview-objc.mm index a6ef35a8eb..9d55b2c551 100644 --- a/indra/llwindow/llopenglview-objc.mm +++ b/indra/llwindow/llopenglview-objc.mm @@ -420,11 +420,20 @@ attributedStringInfo getSegments(NSAttributedString *str) setMarkedText(text, selected, replacement, [aString length], segments); mHasMarkedText = TRUE; mMarkedTextLength = [aString length]; + mMarkedText = (NSAttributedString*)[aString mutableString]; } } +- (void)commitCurrentPreedit +{ + [self insertText:mMarkedText replacementRange:NSMakeRange(0, [mMarkedText length])]; + [[self inputContext] discardMarkedText]; +} + - (void)unmarkText { + [[self inputContext] discardMarkedText]; + [mMarkedText setValue:@""]; resetPreedit(); mHasMarkedText = FALSE; } @@ -517,6 +526,8 @@ attributedStringInfo getSegments(NSAttributedString *str) { [glview insertText:aString replacementRange:replacementRange]; [_window orderOut:_window]; + [[self textStorage] setValue:@""]; + [[self inputContext] discardMarkedText]; } @end |