]> git.saurik.com Git - wxWidgets.git/commitdiff
Fix wxStyledTextCtrl::SetInsertionPointEnd().
authorVadim Zeitlin <vadim@wxwidgets.org>
Fri, 31 May 2013 23:21:16 +0000 (23:21 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Fri, 31 May 2013 23:21:16 +0000 (23:21 +0000)
This relied on SetInsertionPoint(-1) working like in wxTextCtrl but it didn't.
Add an explicit check to it for consistency with the other classes and to make
SetInsertionPointEnd() work.

Closes #15234.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74069 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

docs/changes.txt
include/wx/stc/stc.h
src/stc/stc.h.in

index 8cdf8755353fe84b375ff3544c8817db1fdd47a2..448a54c66c85f3612aa7ac95dc295095e4ad222a 100644 (file)
@@ -668,6 +668,7 @@ All (GUI):
 - Add more convenient wxFont(wxFontInfo) ctor.
 - Pass menu events to the handler in the associated wxMenuBar.
 - Add wxWindow::BeginRepositioningChildren() and EndRepositioningChildren().
+- Fix wxStyledTextCtrl::SetInsertionPointEnd() (troelsk).
 
 wxGTK:
 
index 1edf28158efae43e5eadce80305d0586b8ac9d33..c406e6a6876c267b288a163e47d042b3280d73bf 100644 (file)
@@ -4577,7 +4577,10 @@ public:
 
     */
 
-    virtual void SetInsertionPoint(long pos) { SetCurrentPos(pos); }
+    virtual void SetInsertionPoint(long pos)
+    {
+        SetCurrentPos(pos == -1 ? GetLastPosition() : pos);
+    }
     virtual long GetInsertionPoint() const { return GetCurrentPos(); }
     virtual long GetLastPosition() const { return GetTextLength(); }
 
index 1c980ab3cc145842b2c165caceea75f938a01495..b82bea900cc75810f89f1232e35f5499fec829c9 100644 (file)
@@ -319,7 +319,10 @@ public:
 
     */
 
-    virtual void SetInsertionPoint(long pos) { SetCurrentPos(pos); }
+    virtual void SetInsertionPoint(long pos)
+    {
+        SetCurrentPos(pos == -1 ? GetLastPosition() : pos);
+    }
     virtual long GetInsertionPoint() const { return GetCurrentPos(); }
     virtual long GetLastPosition() const { return GetTextLength(); }