diff --git a/PowerEditor/src/NppIO.cpp b/PowerEditor/src/NppIO.cpp index a33d888b6..f72274f14 100644 --- a/PowerEditor/src/NppIO.cpp +++ b/PowerEditor/src/NppIO.cpp @@ -539,7 +539,7 @@ bool Notepad_plus::doSave(BufferID id, const TCHAR * filename, bool isCopy) TCHAR nppFullPath[MAX_PATH]; ::GetModuleFileName(NULL, nppFullPath, MAX_PATH); - BufferID bufferID = bufferID = _pEditView->getCurrentBufferID(); + BufferID bufferID = _pEditView->getCurrentBufferID(); Buffer * buf = MainFileManager->getBufferByID(bufferID); //process the fileNamePath into LRF diff --git a/PowerEditor/src/Parameters.h b/PowerEditor/src/Parameters.h index 4eb8fee40..8482ebfde 100644 --- a/PowerEditor/src/Parameters.h +++ b/PowerEditor/src/Parameters.h @@ -977,36 +977,14 @@ struct Lang final class UserLangContainer final { public: - UserLangContainer() + UserLangContainer() :_name(TEXT("new user define")), _ext(TEXT("")), _udlVersion(TEXT("")) { - _name = TEXT("new user define"); - _ext = TEXT(""); - _udlVersion = TEXT(""); - _allowFoldOfComments = false; - _forcePureLC = PURE_LC_NONE; - _decimalSeparator = DECSEP_DOT; - _foldCompact = false; - _isCaseIgnored = false; - - for (int i = 0 ; i < SCE_USER_KWLIST_TOTAL ; ++i) - *_keywordLists[i] = '\0'; - - for (int i = 0 ; i < SCE_USER_TOTAL_KEYWORD_GROUPS ; ++i) - _isPrefix[i] = false; + init(); } UserLangContainer(const TCHAR *name, const TCHAR *ext, const TCHAR *udlVer) : _name(name), _ext(ext), _udlVersion(udlVer) { - _allowFoldOfComments = false; - _forcePureLC = PURE_LC_NONE; - _decimalSeparator = DECSEP_DOT; - _foldCompact = false; - - for (int i = 0 ; i < SCE_USER_KWLIST_TOTAL ; ++i) - *_keywordLists[i] = '\0'; - - for (int i = 0 ; i < SCE_USER_TOTAL_KEYWORD_GROUPS ; ++i) - _isPrefix[i] = false; + init(); } UserLangContainer & operator = (const UserLangContainer & ulc) @@ -1072,6 +1050,21 @@ private: friend class SymbolsStyleDialog; friend class UserDefineDialog; friend class StylerDlg; + + void init() + { + _forcePureLC = PURE_LC_NONE; + _decimalSeparator = DECSEP_DOT; + _foldCompact = false; + _isCaseIgnored = false; + _allowFoldOfComments = false; + + for (int i = 0; i < SCE_USER_KWLIST_TOTAL; ++i) + *_keywordLists[i] = '\0'; + + for (int i = 0; i < SCE_USER_TOTAL_KEYWORD_GROUPS; ++i) + _isPrefix[i] = false; + } }; #define MAX_EXTERNAL_LEXER_NAME_LEN 16 diff --git a/PowerEditor/src/ScitillaComponent/ScintillaEditView.cpp b/PowerEditor/src/ScitillaComponent/ScintillaEditView.cpp index 704a163c3..a22e76bec 100644 --- a/PowerEditor/src/ScitillaComponent/ScintillaEditView.cpp +++ b/PowerEditor/src/ScitillaComponent/ScintillaEditView.cpp @@ -950,13 +950,10 @@ void ScintillaEditView::setJsLexer() LexerStyler *pNewStyler = (_pParameter->getLStylerArray()).getLexerStylerByName(newLexerName); if (pNewStyler) // New js styler is available, so we can use it do more modern styling { - if (pNewStyler) + for (int i = 0, nb = pNewStyler->getNbStyler(); i < nb; ++i) { - for (int i = 0, nb = pNewStyler->getNbStyler(); i < nb; ++i) - { - Style & style = pNewStyler->getStyler(i); - setStyle(style); - } + Style & style = pNewStyler->getStyler(i); + setStyle(style); } basic_string keywordListInstruction(""); diff --git a/PowerEditor/src/WinControls/FileBrowser/fileBrowser.cpp b/PowerEditor/src/WinControls/FileBrowser/fileBrowser.cpp index 9797d678b..50e96f44a 100644 --- a/PowerEditor/src/WinControls/FileBrowser/fileBrowser.cpp +++ b/PowerEditor/src/WinControls/FileBrowser/fileBrowser.cpp @@ -1028,9 +1028,8 @@ vector FileBrowser::getRoots() const { vector roots; - HTREEITEM node = nullptr; for (HTREEITEM hItemNode = _treeView.getRoot(); - hItemNode != nullptr && node == nullptr; + hItemNode != nullptr; hItemNode = _treeView.getNextSibling(hItemNode)) { TVITEM tvItem; @@ -1088,9 +1087,8 @@ bool FileBrowser::addInTree(generic_string rootPath, generic_string addItemFullP } else { - HTREEITEM childNodeFound = nullptr; for (HTREEITEM hItemNode = _treeView.getChildFrom(node); - hItemNode != NULL && childNodeFound == nullptr; + hItemNode != NULL ; hItemNode = _treeView.getNextSibling(hItemNode)) { TCHAR textBuffer[MAX_PATH]; @@ -1128,9 +1126,8 @@ HTREEITEM FileBrowser::findInTree(generic_string rootPath, HTREEITEM node, std:: } else { - HTREEITEM childNodeFound = nullptr; for (HTREEITEM hItemNode = _treeView.getChildFrom(node); - hItemNode != NULL && childNodeFound == nullptr; + hItemNode != NULL; hItemNode = _treeView.getNextSibling(hItemNode)) { TCHAR textBuffer[MAX_PATH]; diff --git a/PowerEditor/src/uchardet/nsSBCharSetProber.h b/PowerEditor/src/uchardet/nsSBCharSetProber.h index 82ee315aa..f2d055f99 100644 --- a/PowerEditor/src/uchardet/nsSBCharSetProber.h +++ b/PowerEditor/src/uchardet/nsSBCharSetProber.h @@ -84,7 +84,7 @@ public: // prober has a hard-coded call to FilterWithoutEnglishLetters which gets rid // of the English letters. PRBool KeepEnglishLetters() {return mModel->keepEnglishLetter;} // (not implemented) - nsSingleByteCharSetProber operator=(const nsSingleByteCharSetProber&){}; + nsSingleByteCharSetProber operator=(const nsSingleByteCharSetProber&) = delete; #ifdef DEBUG_chardet virtual void DumpStatus();