diff options
Diffstat (limited to 'plugins/TabSRMM/src/contactcache.cpp')
-rw-r--r-- | plugins/TabSRMM/src/contactcache.cpp | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/plugins/TabSRMM/src/contactcache.cpp b/plugins/TabSRMM/src/contactcache.cpp index 68053f1750..9ae69bdf32 100644 --- a/plugins/TabSRMM/src/contactcache.cpp +++ b/plugins/TabSRMM/src/contactcache.cpp @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////////////
// Miranda NG: the free IM client for Microsoft* Windows*
//
-// Copyright (C) 2012-24 Miranda NG team,
+// Copyright (C) 2012-25 Miranda NG team,
// Copyright (c) 2000-09 Miranda ICQ/IM project,
// all portions of this codebase are copyrighted to the people
// listed in contributors.txt.
@@ -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++;
|