From 30e545a5f4d7068763b66f0db2cee41f47605db0 Mon Sep 17 00:00:00 2001 From: Don HO Date: Sat, 16 Nov 2019 16:54:21 +0100 Subject: [PATCH] Code enhancement: Make Globallock and GlobalUnlock symetric --- PowerEditor/src/NppCommands.cpp | 2 +- .../WinControls/ClipboardHistory/clipboardHistoryPanel.cpp | 5 +++-- PowerEditor/src/WinControls/WindowsDlg/WindowsDlg.cpp | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/PowerEditor/src/NppCommands.cpp b/PowerEditor/src/NppCommands.cpp index 252eaf39..0eb5e7f5 100644 --- a/PowerEditor/src/NppCommands.cpp +++ b/PowerEditor/src/NppCommands.cpp @@ -377,7 +377,7 @@ void Notepad_plus::command(int id) _pEditView->execute(SCI_REPLACESEL, 0, reinterpret_cast("")); _pEditView->execute(SCI_ADDTEXT, *lpLen, reinterpret_cast(lpchar)); - GlobalUnlock(hglb); + GlobalUnlock(hglbLen); } } } diff --git a/PowerEditor/src/WinControls/ClipboardHistory/clipboardHistoryPanel.cpp b/PowerEditor/src/WinControls/ClipboardHistory/clipboardHistoryPanel.cpp index f0edcbd7..7f34e5b8 100644 --- a/PowerEditor/src/WinControls/ClipboardHistory/clipboardHistoryPanel.cpp +++ b/PowerEditor/src/WinControls/ClipboardHistory/clipboardHistoryPanel.cpp @@ -64,7 +64,7 @@ ClipboardData ClipboardHistoryPanel::getClipboadData() { clipboardData.push_back(static_cast(lpchar[i])); } - GlobalUnlock(hglb); + GlobalUnlock(hglbLen); } } } @@ -76,7 +76,8 @@ ClipboardData ClipboardHistoryPanel::getClipboadData() clipboardData.push_back(static_cast(lpchar[i])); } } - GlobalUnlock(hglb); + GlobalUnlock(hglb); + GlobalUnlock(hglb); } } CloseClipboard(); diff --git a/PowerEditor/src/WinControls/WindowsDlg/WindowsDlg.cpp b/PowerEditor/src/WinControls/WindowsDlg/WindowsDlg.cpp index a9180468..c3a307cc 100644 --- a/PowerEditor/src/WinControls/WindowsDlg/WindowsDlg.cpp +++ b/PowerEditor/src/WinControls/WindowsDlg/WindowsDlg.cpp @@ -687,7 +687,7 @@ void WindowsDlg::resetSelection() { if (*itr == curSel) { - ListView_SetItemState(_hList, pos, LVIS_SELECTED|LVIS_FOCUSED, LVIS_SELECTED|LVIS_FOCUSED) + ListView_SetItemState(_hList, pos, LVIS_SELECTED | LVIS_FOCUSED, LVIS_SELECTED | LVIS_FOCUSED); } else {