diff --git a/PowerEditor/src/NppCommands.cpp b/PowerEditor/src/NppCommands.cpp index f91eb16e7..875678fa0 100644 --- a/PowerEditor/src/NppCommands.cpp +++ b/PowerEditor/src/NppCommands.cpp @@ -3911,15 +3911,6 @@ void Notepad_plus::command(int id) { WindowsDlg _windowsDlg; _windowsDlg.init(_pPublicInterface->getHinst(), _pPublicInterface->getHSelf(), _pDocTab); - - const TiXmlNodeA *nativeLangA = _nativeLangSpeaker.getNativeLangA(); - TiXmlNodeA *dlgNode = NULL; - if (nativeLangA) - { - dlgNode = nativeLangA->FirstChild("Dialog"); - if (dlgNode) - dlgNode = _nativeLangSpeaker.searchDlgNode(dlgNode, "Window"); - } _windowsDlg.doDialog(); } break; diff --git a/PowerEditor/src/Parameters.cpp b/PowerEditor/src/Parameters.cpp index 03aec616b..8251e4724 100644 --- a/PowerEditor/src/Parameters.cpp +++ b/PowerEditor/src/Parameters.cpp @@ -623,6 +623,7 @@ int hexStrVal(const wchar_t *str) int getKwClassFromName(const wchar_t *str) { + if(!str) return -1; if (!lstrcmp(L"instre1", str)) return LANG_INDEX_INSTR; if (!lstrcmp(L"instre2", str)) return LANG_INDEX_INSTR2; if (!lstrcmp(L"type1", str)) return LANG_INDEX_TYPE; diff --git a/PowerEditor/src/ScintillaComponent/ScintillaEditView.cpp b/PowerEditor/src/ScintillaComponent/ScintillaEditView.cpp index f1363f55f..cd1cd1904 100644 --- a/PowerEditor/src/ScintillaComponent/ScintillaEditView.cpp +++ b/PowerEditor/src/ScintillaComponent/ScintillaEditView.cpp @@ -352,13 +352,16 @@ void ScintillaEditView::init(HINSTANCE hInst, HWND hPere) if (_defaultCharList.empty()) { auto defaultCharListLen = execute(SCI_GETWORDCHARS); - char *defaultCharList = new char[defaultCharListLen + 1]; - if(defaultCharList) + if(defaultCharListLen > 0) { - execute(SCI_GETWORDCHARS, 0, reinterpret_cast(defaultCharList)); - defaultCharList[defaultCharListLen] = '\0'; - _defaultCharList = defaultCharList; - delete[] defaultCharList; + char *defaultCharList = new char[defaultCharListLen + 1]; + if(defaultCharList) + { + execute(SCI_GETWORDCHARS, 0, reinterpret_cast(defaultCharList)); + defaultCharList[defaultCharListLen] = '\0'; + _defaultCharList = defaultCharList; + delete[] defaultCharList; + } } } unsigned long MODEVENTMASK_ON = nppParams.getScintillaModEventMask(); diff --git a/PowerEditor/src/WinControls/FunctionList/functionParser.cpp b/PowerEditor/src/WinControls/FunctionList/functionParser.cpp index 6ca7de9e5..a023bbf16 100644 --- a/PowerEditor/src/WinControls/FunctionList/functionParser.cpp +++ b/PowerEditor/src/WinControls/FunctionList/functionParser.cpp @@ -409,7 +409,7 @@ void FunctionParser::funcParse(std::vector & foundInfos, size_t begin // dataToSearch & data2ToSearch are optional if (!_functionNameExprArray.size() && !_classNameExprArray.size()) { - wchar_t foundData[1024]; + wchar_t foundData[1024] {}; (*ppEditView)->getGenericText(foundData, 1024, targetStart, targetEnd); fi._data = foundData; // whole found data @@ -418,7 +418,7 @@ void FunctionParser::funcParse(std::vector & foundInfos, size_t begin } else { - intptr_t foundPos; + intptr_t foundPos = -1; if (_functionNameExprArray.size()) { fi._data = parseSubLevel(targetStart, targetEnd, _functionNameExprArray, foundPos, ppEditView); diff --git a/PowerEditor/src/WinControls/SplitterContainer/Splitter.cpp b/PowerEditor/src/WinControls/SplitterContainer/Splitter.cpp index 786eb19cb..7a5c90b80 100644 --- a/PowerEditor/src/WinControls/SplitterContainer/Splitter.cpp +++ b/PowerEditor/src/WinControls/SplitterContainer/Splitter.cpp @@ -27,8 +27,6 @@ bool Splitter::_isHorizontalFixedRegistered = false; bool Splitter::_isVerticalFixedRegistered = false; -#define SPLITTER_SIZE 8 - void Splitter::init( HINSTANCE hInst, HWND hPere, int splitterSize, double iSplitRatio, DWORD dwFlags) { if (hPere == NULL) @@ -205,7 +203,7 @@ int Splitter::getClickZone(WH which) ? (which == WH::width ? _splitterSize : HIEGHT_MINIMAL) : (which == WH::width ? HIEGHT_MINIMAL : _splitterSize); } - else // (_spiltterSize > 8) + else // (_splitterSize > 8) { return isVertical() ? ((which == WH::width) ? 8 : 15) @@ -514,8 +512,8 @@ void Splitter::gotoRightBottom() void Splitter::drawSplitter() { - PAINTSTRUCT ps; - RECT rc, rcToDraw1, rcToDraw2, TLrc, BRrc; + PAINTSTRUCT ps {}; + RECT rc {}, rcToDraw1 {}, rcToDraw2 {}, TLrc {}, BRrc {}; HDC hdc = ::BeginPaint(_hSelf, &ps); getClientRect(rc); @@ -649,7 +647,7 @@ void Splitter::rotate() void Splitter::paintArrow(HDC hdc, const RECT &rect, Arrow arrowDir) { - RECT rc; + RECT rc {}; rc.left = rect.left; rc.top = rect.top; rc.right = rect.right; @@ -717,14 +715,14 @@ void Splitter::adjustZoneToDraw(RECT& rc2def, ZONE_TYPE whichZone) if (_splitterSize < 4) return; - int x0, y0, x1, y1, w, h; + int x0 = 0, y0 = 0, x1 = 0, y1 = 0, w = 0, h = 0; if (/*(4 <= _splitterSize) && */(_splitterSize <= 8)) { w = (isVertical() ? 4 : 7); h = (isVertical() ? 7 : 4); } - else // (_spiltterSize > 8) + else // (_splitterSize > 8) { w = (isVertical() ? 6 : 11); h = (isVertical() ? 11 : 6); diff --git a/PowerEditor/src/WinControls/TabBar/TabBar.cpp b/PowerEditor/src/WinControls/TabBar/TabBar.cpp index 9bacada97..1c2a97fbf 100644 --- a/PowerEditor/src/WinControls/TabBar/TabBar.cpp +++ b/PowerEditor/src/WinControls/TabBar/TabBar.cpp @@ -1392,9 +1392,9 @@ void TabBarPlus::drawItem(DRAWITEMSTRUCT* pDrawItemStruct, bool isDarkMode) const COLORREF colorActiveBg = isDarkMode ? NppDarkMode::getCtrlBackgroundColor() : ::GetSysColor(COLOR_BTNFACE); const COLORREF colorInactiveBgBase = isDarkMode ? NppDarkMode::getBackgroundColor() : ::GetSysColor(COLOR_BTNFACE); - COLORREF colorInactiveBg = liteGrey; - COLORREF colorActiveText = ::GetSysColor(COLOR_BTNTEXT); - COLORREF colorInactiveText = grey; + COLORREF colorInactiveBg = _inactiveBgColour; + COLORREF colorActiveText = _activeTextColour; + COLORREF colorInactiveText = _inactiveTextColour; if (!NppDarkMode::useTabTheme() && isDarkMode) { @@ -1402,12 +1402,6 @@ void TabBarPlus::drawItem(DRAWITEMSTRUCT* pDrawItemStruct, bool isDarkMode) colorActiveText = NppDarkMode::getTextColor(); colorInactiveText = NppDarkMode::getDarkerTextColor(); } - else - { - colorInactiveBg = _inactiveBgColour; - colorActiveText = _activeTextColour; - colorInactiveText = _inactiveTextColour; - } HDC hDC = pDrawItemStruct->hDC;