From 887a79f2c48457605098132fd37b6d82bf349748 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 18 Mar 2025 18:27:23 +0300 Subject: =?UTF-8?q?fixes=20#4914=20(tabSRMM:=20=D0=B7=D0=B0=D0=BF=D0=BE?= =?UTF-8?q?=D0=BC=D0=B8=D0=BD=D0=B0=D1=82=D1=8C=20=D0=BD=D0=B5=D0=BE=D1=82?= =?UTF-8?q?=D0=BF=D1=80=D0=B0=D0=B2=D0=BB=D0=B5=D0=BD=D0=BD=D1=8B=D0=B9=20?= =?UTF-8?q?=D1=82=D0=B5=D0=BA=D1=81=D1=82=20=D0=BF=D1=80=D0=B8=20=D0=BD?= =?UTF-8?q?=D0=B0=D0=B2=D0=B8=D0=B3=D0=B0=D1=86=D0=B8=D0=B8=20=D0=BF=D0=BE?= =?UTF-8?q?=20=D0=B8=D1=81=D1=82=D0=BE=D1=80=D0=B8=D0=B8=20=D0=B2=20=D0=BF?= =?UTF-8?q?=D0=BE=D0=BB=D0=B5=20=D0=B2=D0=B2=D0=BE=D0=B4=D0=B0)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/TabSRMM/src/contactcache.cpp | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'plugins/TabSRMM/src/contactcache.cpp') diff --git a/plugins/TabSRMM/src/contactcache.cpp b/plugins/TabSRMM/src/contactcache.cpp index 3886dc55b9..9ae69bdf32 100644 --- a/plugins/TabSRMM/src/contactcache.cpp +++ b/plugins/TabSRMM/src/contactcache.cpp @@ -225,7 +225,7 @@ void CContactCache::saveHistory() if (m_dat == nullptr) return; - CCtrlRichEdit &pEntry = m_dat->GetEntry(); + auto &pEntry = m_dat->GetEntry(); ptrA szFromStream(pEntry.GetRichTextRtf()); if (szFromStream != nullptr) { m_iHistoryCurrent = -1; @@ -242,17 +242,20 @@ void CContactCache::inputHistoryEvent(WPARAM wParam) if (m_dat == nullptr) return; - CCtrlRichEdit &pEntry = m_dat->GetEntry(); + auto &pEntry = m_dat->GetEntry(); + if (m_history.getCount() > 0) { char *pszText; if (wParam == VK_UP) { if (m_iHistoryCurrent == 0) return; - if (m_iHistoryCurrent < 0) - m_iHistoryCurrent = m_history.getCount()-1; - else - m_iHistoryCurrent--; + if (m_iHistoryCurrent < 0) { + m_savedEditContent = pEntry.GetRichTextRtf(); + m_iHistoryCurrent = m_history.getCount() - 1; + } + else m_iHistoryCurrent--; + pszText = m_history[m_iHistoryCurrent]; } else { @@ -261,7 +264,7 @@ void CContactCache::inputHistoryEvent(WPARAM wParam) if (m_iHistoryCurrent == m_history.getCount() - 1) { m_iHistoryCurrent = -1; - pszText = ""; + pszText = m_savedEditContent; } else { m_iHistoryCurrent++; -- cgit v1.2.3