From fcb3ce31a0cb4028b80f8cec78d236e4ee682c67 Mon Sep 17 00:00:00 2001 From: SinghRajenM Date: Mon, 15 Jan 2018 00:19:16 +0530 Subject: [PATCH] Code improvement Closes #4085 --- PowerEditor/src/MISC/Common/verifySignedfile.cpp | 6 +++--- PowerEditor/src/ScitillaComponent/AutoCompletion.h | 2 +- .../src/WinControls/FunctionList/functionListPanel.cpp | 2 ++ 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/PowerEditor/src/MISC/Common/verifySignedfile.cpp b/PowerEditor/src/MISC/Common/verifySignedfile.cpp index 804f7fd40..5e4107bac 100644 --- a/PowerEditor/src/MISC/Common/verifySignedfile.cpp +++ b/PowerEditor/src/MISC/Common/verifySignedfile.cpp @@ -71,7 +71,7 @@ bool VerifySignedLibrary(const wstring& filepath, // Initialise WinTrust data WINTRUST_DATA winTEXTrust_data = { 0 }; winTEXTrust_data.cbStruct = sizeof(winTEXTrust_data); - winTEXTrust_data.dwUIChoice = WTD_UI_NONE; // do not display optionnal dialog boxes + winTEXTrust_data.dwUIChoice = WTD_UI_NONE; // do not display optional dialog boxes winTEXTrust_data.dwUnionChoice = WTD_CHOICE_FILE; // we are not checking catalog signed files winTEXTrust_data.dwStateAction = WTD_STATEACTION_VERIFY; // only checking winTEXTrust_data.fdwRevocationChecks = WTD_REVOKE_WHOLECHAIN; // verify the whole certificate chain @@ -227,14 +227,14 @@ bool VerifySignedLibrary(const wstring& filepath, } display_name = display_name_buffer.get(); - } catch (wstring s) { + } catch (const wstring& s) { ::MessageBox(NULL, s.c_str(), TEXT("DLL signature verification failed"), MB_ICONERROR); OutputDebugString(TEXT("VerifyLibrary: error while getting certificate informations\n")); status = false; } catch (...) { // Unknown error OutputDebugString(TEXT("VerifyLibrary: error while getting certificate informations\n")); - wstring errMsg(TEXT("Unknown exception occured. ")); + wstring errMsg(TEXT("Unknown exception occurred. ")); errMsg += GetLastErrorAsString(GetLastError()); ::MessageBox(NULL, errMsg.c_str(), TEXT("DLL signature verification failed"), MB_ICONERROR); status = false; diff --git a/PowerEditor/src/ScitillaComponent/AutoCompletion.h b/PowerEditor/src/ScitillaComponent/AutoCompletion.h index 367142108..c1a6af1b3 100644 --- a/PowerEditor/src/ScitillaComponent/AutoCompletion.h +++ b/PowerEditor/src/ScitillaComponent/AutoCompletion.h @@ -51,7 +51,7 @@ public: private: std::vector _insertedMatchedChars; - ScintillaEditView * _pEditView; + ScintillaEditView * _pEditView = nullptr;; }; class AutoCompletion { diff --git a/PowerEditor/src/WinControls/FunctionList/functionListPanel.cpp b/PowerEditor/src/WinControls/FunctionList/functionListPanel.cpp index cce3a22cf..cc27c1346 100644 --- a/PowerEditor/src/WinControls/FunctionList/functionListPanel.cpp +++ b/PowerEditor/src/WinControls/FunctionList/functionListPanel.cpp @@ -342,6 +342,7 @@ void FunctionListPanel::reload() for (size_t i = 0, len = _foundFuncInfos.size(); i < len; ++i) { // no 2 levels + /* bool b = false; if (b) { @@ -355,6 +356,7 @@ void FunctionListPanel::reload() addEntry(NULL, entryName.c_str(), _foundFuncInfos[i]._pos); } else + */ { addEntry(_foundFuncInfos[i]._data2.c_str(), _foundFuncInfos[i]._data.c_str(), _foundFuncInfos[i]._pos); }