From 88e04461ee02856153ba56901247b34ad4de5b00 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 15 Feb 2005 14:02:25 +0000 Subject: [PATCH] removed m_isCaretAtEnd optimization added in rev 1.232 as we don't always detect when the carets position changes git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@32077 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/msw/textctrl.h | 6 ------ src/msw/textctrl.cpp | 15 +-------------- 2 files changed, 1 insertion(+), 20 deletions(-) diff --git a/include/wx/msw/textctrl.h b/include/wx/msw/textctrl.h index 736beed112..e19c77eb7d 100644 --- a/include/wx/msw/textctrl.h +++ b/include/wx/msw/textctrl.h @@ -260,12 +260,6 @@ private: wxMenu* m_privateContextMenu; bool m_isNativeCaretShown; - - // this is an optimization: instead of checking all the time whether we - // need to move the caret to the end of text (before appending to the - // control), we remember whether it is already at the end of text in this - // variable - bool m_isCaretAtEnd; }; #endif diff --git a/src/msw/textctrl.cpp b/src/msw/textctrl.cpp index 9899b14348..1a072cfae3 100644 --- a/src/msw/textctrl.cpp +++ b/src/msw/textctrl.cpp @@ -251,7 +251,6 @@ void wxTextCtrl::Init() m_privateContextMenu = NULL; m_updatesCount = -1; m_isNativeCaretShown = true; - m_isCaretAtEnd = true; } wxTextCtrl::~wxTextCtrl() @@ -1090,8 +1089,6 @@ void wxTextCtrl::SetEditable(bool editable) void wxTextCtrl::SetInsertionPoint(long pos) { DoSetSelection(pos, pos); - - m_isCaretAtEnd = pos == GetLastPosition(); } void wxTextCtrl::SetInsertionPointEnd() @@ -1101,9 +1098,8 @@ void wxTextCtrl::SetInsertionPointEnd() // if it doesn't actually move the caret anywhere and so the simple fact of // doing it results in horrible flicker when appending big amounts of text // to the control in a few chunks (see DoAddText() test in the text sample) - if ( m_isCaretAtEnd || GetInsertionPoint() == GetLastPosition() ) + if ( GetInsertionPoint() == GetLastPosition() ) { - m_isCaretAtEnd = true; return; } @@ -1484,9 +1480,6 @@ void wxTextCtrl::ShowPosition(long pos) if (linesToScroll != 0) (void)::SendMessage(hWnd, EM_LINESCROLL, (WPARAM)0, (LPARAM)linesToScroll); - - // be pessimistic - m_isCaretAtEnd = false; } long wxTextCtrl::GetLengthOfLineContainingPos(long pos) const @@ -1563,9 +1556,6 @@ void wxTextCtrl::Undo() if (CanUndo()) { ::SendMessage(GetHwnd(), EM_UNDO, 0, 0); - - // it's not necessarily at the end any more - m_isCaretAtEnd = false; } } @@ -1580,9 +1570,6 @@ void wxTextCtrl::Redo() #endif // Same as Undo, since Undo undoes the undo, i.e. a redo. ::SendMessage(GetHwnd(), EM_UNDO, 0, 0); - - // it's not necessarily at the end any more - m_isCaretAtEnd = false; } } -- 2.45.2