summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2019-04-15 18:35:01 +0300
committerGeorge Hazan <ghazan@miranda.im>2019-04-15 18:35:01 +0300
commitbcd9393446d6c803335a05490c74be0e5fe5fd09 (patch)
tree6c62d3b487bdb0f0646329e6d27a0f8cc2e352b3
parent8321d69eda664b4f48fe98c85529b6eed923307e (diff)
fixes #1660 (Notes & Reminders: attempt to edit a reminder creates the duplicate item that crashes Miranda on deletion)
-rw-r--r--plugins/NotesAndReminders/src/notes.cpp8
-rw-r--r--plugins/NotesAndReminders/src/reminders.cpp4
-rw-r--r--plugins/NotesAndReminders/src/version.h2
3 files changed, 5 insertions, 9 deletions
diff --git a/plugins/NotesAndReminders/src/notes.cpp b/plugins/NotesAndReminders/src/notes.cpp
index 60f409b95f..22e890ba81 100644
--- a/plugins/NotesAndReminders/src/notes.cpp
+++ b/plugins/NotesAndReminders/src/notes.cpp
@@ -29,8 +29,6 @@
#define NOTIFY_LIST() if (ListNotesVisible) PostMessage(LV,WM_RELOAD,0,0)
-#define PENLINK ENLINK *
-
#define NOTE_WND_CLASS L"MIM_StickyNote"
#define IDM_COLORPRESET_BG 41000
@@ -738,12 +736,10 @@ LRESULT CALLBACK StickyNoteWndProc(HWND hdlg, UINT message, WPARAM wParam, LPARA
case WM_NOTIFY:
if (LOWORD(wParam) == 1) {
- char *Buff;
- PENLINK PEnLnk = (PENLINK)lParam;
-
+ ENLINK *PEnLnk = (ENLINK*)lParam;
if (PEnLnk->msg == WM_LBUTTONDOWN) {
SendDlgItemMessage(hdlg, 1, EM_EXSETSEL, 0, (LPARAM)&(PEnLnk->chrg));
- Buff = (char*)malloc(PEnLnk->chrg.cpMax - PEnLnk->chrg.cpMin + 1);
+ char* Buff = (char*)malloc(PEnLnk->chrg.cpMax - PEnLnk->chrg.cpMin + 1);
SendDlgItemMessage(hdlg, 1, EM_GETSELTEXT, 0, (LPARAM)Buff);
if ((GetAsyncKeyState(VK_CONTROL) >> 15) != 0)
ShellExecuteA(hdlg, "open", "iexplore", Buff, "", SW_SHOWNORMAL);
diff --git a/plugins/NotesAndReminders/src/reminders.cpp b/plugins/NotesAndReminders/src/reminders.cpp
index 920ac3142e..547dc262af 100644
--- a/plugins/NotesAndReminders/src/reminders.cpp
+++ b/plugins/NotesAndReminders/src/reminders.cpp
@@ -1253,6 +1253,7 @@ public:
void onClick_RemindAgain(CCtrlButton*)
{
+ arReminders.remove(m_pReminder);
if (chkAfter.GetState()) {
// delta time
SYSTEMTIME tm;
@@ -1320,7 +1321,6 @@ public:
m_pReminder->handle = nullptr;
// re-insert tree item sorted
- arReminders.remove(m_pReminder);
arReminders.insert(m_pReminder);
m_pReminder = nullptr; // prevent reminder from being deleted;
Close();
@@ -1533,6 +1533,7 @@ public:
}
else {
// update existing reminder
+ arReminders.remove(m_pReminder);
SystemTimeToFileTime(&Date, (FILETIME*)&m_pReminder->When);
m_pReminder->szText = ptrA(edtText.GetTextA());
@@ -1541,7 +1542,6 @@ public:
m_pReminder->RepeatSound = m_pReminder->SoundSel < 0 ? 0 : (UINT)RepeatSound;
// re-insert tree item sorted
- arReminders.remove(m_pReminder);
arReminders.insert(m_pReminder);
m_pReminder->bVisible = false;
diff --git a/plugins/NotesAndReminders/src/version.h b/plugins/NotesAndReminders/src/version.h
index c7f03daa18..cc46754d46 100644
--- a/plugins/NotesAndReminders/src/version.h
+++ b/plugins/NotesAndReminders/src/version.h
@@ -1,7 +1,7 @@
#define __MAJOR_VERSION 0
#define __MINOR_VERSION 2
#define __RELEASE_NUM 0
-#define __BUILD_NUM 3
+#define __BUILD_NUM 4
#include <stdver.h>