From ee6953182339cbe2a387eb0aed1c01da11e3818f Mon Sep 17 00:00:00 2001 From: SinghRajenM Date: Tue, 4 Jul 2017 00:14:44 +0530 Subject: [PATCH] Fixed cppChecker reported issues 1. Removed unused variable/code smarthighlighter.cpp, Babtgrid.cpp, shortcut.h, ImageListSet.h 2. Member variable not initialised in ctor ShortcutMapper.h, FileBrowser.h, ProjectPanel.h, TaskList.h, VerticalFileSwitcher.h, WindowDlg.h, lastRecentFileList.h Closes #3478 --- .../src/ScitillaComponent/SmartHighlighter.cpp | 3 --- .../src/WinControls/FileBrowser/fileBrowser.h | 2 +- PowerEditor/src/WinControls/Grid/BabyGrid.cpp | 13 ++----------- PowerEditor/src/WinControls/Grid/ShortcutMapper.h | 2 +- .../src/WinControls/ImageListSet/ImageListSet.h | 2 -- .../src/WinControls/ProjectPanel/ProjectPanel.h | 2 +- PowerEditor/src/WinControls/TaskList/TaskListDlg.h | 2 +- .../VerticalFileSwitcher/VerticalFileSwitcher.h | 2 +- PowerEditor/src/WinControls/WindowsDlg/WindowsDlg.h | 2 +- PowerEditor/src/WinControls/shortcut/shortcut.h | 1 - PowerEditor/src/lastRecentFileList.h | 2 ++ 11 files changed, 10 insertions(+), 23 deletions(-) diff --git a/PowerEditor/src/ScitillaComponent/SmartHighlighter.cpp b/PowerEditor/src/ScitillaComponent/SmartHighlighter.cpp index cdc4b2c6d..debe13410 100644 --- a/PowerEditor/src/ScitillaComponent/SmartHighlighter.cpp +++ b/PowerEditor/src/ScitillaComponent/SmartHighlighter.cpp @@ -130,7 +130,6 @@ void SmartHighlighter::highlightView(ScintillaEditView * pHighlightView, Scintil // Determine mode for SmartHighlighting bool isWordOnly = true; - bool isCaseSensentive = true; if (nppGUI._smartHiliteUseFindSettings) { @@ -138,12 +137,10 @@ void SmartHighlighter::highlightView(ScintillaEditView * pHighlightView, Scintil NppParameters *nppParams = NppParameters::getInstance(); FindHistory &findHistory = nppParams->getFindHistory(); isWordOnly = findHistory._isMatchWord; - isCaseSensentive = findHistory._isMatchCase; } else { isWordOnly = nppGUI._smartHiliteWordOnly; - isCaseSensentive = nppGUI._smartHiliteCaseSensitive; } // additional checks for wordOnly mode diff --git a/PowerEditor/src/WinControls/FileBrowser/fileBrowser.h b/PowerEditor/src/WinControls/FileBrowser/fileBrowser.h index 02b0b0f7a..d1aa32a35 100644 --- a/PowerEditor/src/WinControls/FileBrowser/fileBrowser.h +++ b/PowerEditor/src/WinControls/FileBrowser/fileBrowser.h @@ -172,7 +172,7 @@ public: protected: TreeView _treeView; - HIMAGELIST _hImaLst; + HIMAGELIST _hImaLst = nullptr; HMENU _hGlobalMenu = NULL; HMENU _hRootMenu = NULL; diff --git a/PowerEditor/src/WinControls/Grid/BabyGrid.cpp b/PowerEditor/src/WinControls/Grid/BabyGrid.cpp index 090245e02..6898ba946 100644 --- a/PowerEditor/src/WinControls/Grid/BabyGrid.cpp +++ b/PowerEditor/src/WinControls/Grid/BabyGrid.cpp @@ -1299,19 +1299,10 @@ void SizeGrid(HWND hWnd,int /*SI*/) int FindLongestLine(HDC hdc,TCHAR* text,SIZE* size) { - int longest, lines; + int longest = 0; TCHAR temptext[1000]; TCHAR *p; - longest=0; - lines=1; - for(size_t j=0, len=lstrlen(text); j * vScintillas, HMENU hMenu, HWND menuParent); void updateKeys(); - void updateKey(ScintillaKeyMap skmOld, ScintillaKeyMap skm); size_t nbScintillas() { return _vScintillas.size(); }; private: HMENU _hAccelMenu = nullptr; diff --git a/PowerEditor/src/lastRecentFileList.h b/PowerEditor/src/lastRecentFileList.h index 896a6b075..79428c36d 100644 --- a/PowerEditor/src/lastRecentFileList.h +++ b/PowerEditor/src/lastRecentFileList.h @@ -44,6 +44,8 @@ class LastRecentFileList public: LastRecentFileList() { _userMax = (NppParameters::getInstance())->getNbMaxRecentFile(); + for (int i = 0; i < NB_MAX_LRF_FILE; i++) + _idFreeArray[i] = false; }; void initMenu(HMENU hMenu, int idBase, int posBase, Accelerator *accelerator, bool doSubMenu = false);