diff options
author | obo <obo@openoffice.org> | 2010-06-22 06:15:26 +0200 |
---|---|---|
committer | obo <obo@openoffice.org> | 2010-06-22 06:15:26 +0200 |
commit | c899abcdb8e35da139744518d88499879b1d81d2 (patch) | |
tree | 6ca16d0b6b5cae88bd1aa506dc5ea211e64e1c88 | |
parent | 54f5385aaa162daf7736a1a8d0c544927af0074e (diff) | |
parent | 9a2fa49397aee936c030c146b76f861c634e4172 (diff) |
CWS-TOOLING: integrate CWS sw33bf05
-rw-r--r-- | vcl/unx/gtk/window/gtkframe.cxx | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/vcl/unx/gtk/window/gtkframe.cxx b/vcl/unx/gtk/window/gtkframe.cxx index 11d567c85098..c6ff16f8395b 100644 --- a/vcl/unx/gtk/window/gtkframe.cxx +++ b/vcl/unx/gtk/window/gtkframe.cxx @@ -3757,8 +3757,21 @@ gboolean GtkSalFrame::IMHandler::signalIMDeleteSurrounding( GtkIMContext*, gint if (xText.is()) { sal_uInt32 nPosition = xText->getCaretPosition(); - xText->deleteText(nPosition + offset, nPosition + offset + nchars); - return TRUE; + // --> OD 2010-06-04 #i111768# - apply patch from kstribley: + // range checking +// xText->deleteText(nPosition + offset, nPosition + offset + nchars); + sal_Int32 nDeletePos = nPosition + offset; + sal_Int32 nDeleteEnd = nDeletePos + nchars; + if (nDeletePos < 0) + nDeletePos = 0; + if (nDeleteEnd < 0) + nDeleteEnd = 0; + if (nDeleteEnd > xText->getCharacterCount()) + nDeleteEnd = xText->getCharacterCount(); + + xText->deleteText(nDeletePos, nDeleteEnd); + // <-- + return TRUE; } return FALSE; |