diff --git a/PowerEditor/src/DarkMode/DarkMode.cpp b/PowerEditor/src/DarkMode/DarkMode.cpp index c1b2e9dfd..ef1f24bda 100644 --- a/PowerEditor/src/DarkMode/DarkMode.cpp +++ b/PowerEditor/src/DarkMode/DarkMode.cpp @@ -165,6 +165,7 @@ bool IsColorSchemeChangeMessage(LPARAM lParam) _RefreshImmersiveColorPolicyState(); is = true; } + if (_GetIsImmersiveColorUsingHighContrast) _GetIsImmersiveColorUsingHighContrast(IHCM_REFRESH); return is; @@ -209,10 +210,13 @@ bool IsWindowOrParentUsingDarkScrollBar(HWND hwnd) HWND hwndRoot = GetAncestor(hwnd, GA_ROOT); std::lock_guard lock(g_darkScrollBarMutex); - if (g_darkScrollBarWindows.count(hwnd)) { + if (g_darkScrollBarWindows.count(hwnd)) + { return true; } - if (hwnd != hwndRoot && g_darkScrollBarWindows.count(hwndRoot)) { + + if (hwnd != hwndRoot && g_darkScrollBarWindows.count(hwndRoot)) + { return true; } @@ -233,7 +237,8 @@ void FixDarkScrollBar() auto MyOpenThemeData = [](HWND hWnd, LPCWSTR classList) WINAPI_LAMBDA_RETURN(HTHEME) { if (wcscmp(classList, L"ScrollBar") == 0) { - if (IsWindowOrParentUsingDarkScrollBar(hWnd)) { + if (IsWindowOrParentUsingDarkScrollBar(hWnd)) + { hWnd = nullptr; classList = L"Explorer::ScrollBar"; } diff --git a/PowerEditor/src/MISC/Common/Common.cpp b/PowerEditor/src/MISC/Common/Common.cpp index cb14c9e81..625249148 100644 --- a/PowerEditor/src/MISC/Common/Common.cpp +++ b/PowerEditor/src/MISC/Common/Common.cpp @@ -859,17 +859,20 @@ bool str2Clipboard(const wstring &str2cpy, HWND hwnd) { return false; } + if (!::OpenClipboard(hwnd)) { ::GlobalFree(hglbCopy); return false; } + if (!::EmptyClipboard()) { ::GlobalFree(hglbCopy); ::CloseClipboard(); return false; } + // Lock the handle and copy the text to the buffer. wchar_t *pStr = (wchar_t *)::GlobalLock(hglbCopy); if (!pStr) @@ -878,6 +881,7 @@ bool str2Clipboard(const wstring &str2cpy, HWND hwnd) ::CloseClipboard(); return false; } + wcscpy_s(pStr, len2Allocate / sizeof(wchar_t), str2cpy.c_str()); ::GlobalUnlock(hglbCopy); // Place the handle on the clipboard. @@ -888,6 +892,7 @@ bool str2Clipboard(const wstring &str2cpy, HWND hwnd) ::CloseClipboard(); return false; } + if (!::CloseClipboard()) { return false; @@ -907,9 +912,11 @@ bool buf2Clipboard(const std::vector& buffers, bool isFullPath, HWND hw if (fileName) selection += fileName; } + if (!selection.empty() && !selection.ends_with(crlf)) selection += crlf; } + if (!selection.empty()) return str2Clipboard(selection, hwnd); return false; diff --git a/PowerEditor/src/MISC/Common/Sorters.h b/PowerEditor/src/MISC/Common/Sorters.h index f8f0368b7..9aadfc9c0 100644 --- a/PowerEditor/src/MISC/Common/Sorters.h +++ b/PowerEditor/src/MISC/Common/Sorters.h @@ -303,6 +303,7 @@ public: { aNumIndex++; } + if (b[bNumIndex] == L'-') { bNumIndex++; @@ -471,6 +472,7 @@ public: { aNumIndex++; } + if (b[bNumIndex] == L'-') { bNumIndex++; diff --git a/PowerEditor/src/MISC/PluginsManager/PluginsManager.cpp b/PowerEditor/src/MISC/PluginsManager/PluginsManager.cpp index a9b03f4ef..d4d88c3b5 100644 --- a/PowerEditor/src/MISC/PluginsManager/PluginsManager.cpp +++ b/PowerEditor/src/MISC/PluginsManager/PluginsManager.cpp @@ -513,8 +513,10 @@ bool PluginsManager::loadPlugins(const wchar_t* dir, const PluginViewList* plugi } } + if (hFindFolder && (hFindFolder != INVALID_HANDLE_VALUE)) ::FindClose(hFindFolder); + if (hFindDll && (hFindDll != INVALID_HANDLE_VALUE)) ::FindClose(hFindDll); diff --git a/PowerEditor/src/NppBigSwitch.cpp b/PowerEditor/src/NppBigSwitch.cpp index 85f44b0b8..b4548ac88 100644 --- a/PowerEditor/src/NppBigSwitch.cpp +++ b/PowerEditor/src/NppBigSwitch.cpp @@ -2176,17 +2176,6 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa case NPPM_INTERNAL_CHECKDOCSTATUS: { - // This is an workaround to deal with Microsoft issue in ReadDirectoryChanges notification - // If command prompt is used to write file continuously (e.g. ping -t 8.8.8.8 > ping.log) - // Then ReadDirectoryChanges does not detect the change. - // Fortunately, notification is sent if right click or double click happens on that file - // Let's leverage this as workaround to enhance npp file monitoring functionality. - // So calling "doesFileExist" is a workaround here. - - Buffer* currBuf = getCurrentBuffer(); - if (currBuf && currBuf->isMonitoringOn()) - doesFileExist(currBuf->getFullPathName()); - const NppGUI & nppgui = nppParam.getNppGUI(); if (nppgui._fileAutoDetection != cdDisabled) { diff --git a/PowerEditor/src/ScintillaComponent/Buffer.cpp b/PowerEditor/src/ScintillaComponent/Buffer.cpp index 9196f6a1a..4d4428d7e 100644 --- a/PowerEditor/src/ScintillaComponent/Buffer.cpp +++ b/PowerEditor/src/ScintillaComponent/Buffer.cpp @@ -209,6 +209,7 @@ void Buffer::updateTimeStamp() //sprintf_s(buf, _countof(buf) - 1, " in updateTimeStamp(): timeStampLive (%lu/%lu) > _timeStamp (%lu/%lu)", // timeStampLive.dwLowDateTime, timeStampLive.dwHighDateTime, _timeStamp.dwLowDateTime, _timeStamp.dwHighDateTime); } + if (buf[0] != '\0') { wstring issueFn = nppLogNetworkDriveIssue; @@ -220,6 +221,7 @@ void Buffer::updateTimeStamp() writeLog(nppIssueLog.c_str(), msg.c_str()); } } + _timeStamp = timeStampLive; doNotify(BufferChangeTimestamp); } @@ -343,6 +345,7 @@ bool Buffer::checkFileState() // returns true if the status has been changed (it { msg += "FALSE"; } + if (bWorkerThreadTerminated) { msg += ", its worker thread had to be forcefully terminated due to timeout reached!"; @@ -423,6 +426,7 @@ bool Buffer::checkFileState() // returns true if the status has been changed (it //sprintf_s(buf, _countof(buf) - 1, " in checkFileState(): attributes.ftLastWriteTime (%lu/%lu) > _timeStamp (%lu/%lu)", // attributes.ftLastWriteTime.dwLowDateTime, attributes.ftLastWriteTime.dwHighDateTime, _timeStamp.dwLowDateTime, _timeStamp.dwHighDateTime); } + if (buf[0] != '\0') { wstring issueFn = nppLogNetworkDriveIssue; @@ -1196,6 +1200,7 @@ bool FileManager::backupCurrentBuffer() grabSize -= incompleteMultibyteChar; isWrittenSuccessful = UnicodeConvertor.writeFile(newData, newDataLen); } + if (lengthDoc == 0) isWrittenSuccessful = true; } @@ -1461,6 +1466,7 @@ size_t FileManager::nextUntitledNewNumber() const break; } } + if (!numberAvailable) newNumber++; @@ -1730,6 +1736,7 @@ bool FileManager::loadFileData(Document doc, int64_t fileSize, const wchar_t * f PathRemoveFileSpec(dir); isNetworkDirDisconnected = !doesDirectoryExist(dir); } + if (isNetworkDirDisconnected) return false; // If network ressource is not reachable, we stop here for not having hanging issue because of _wfopen @@ -1793,6 +1800,7 @@ bool FileManager::loadFileData(Document doc, int64_t fileSize, const wchar_t * f success = false; break; } + if (lenFile == 0) break; if (isFirstTime) @@ -1888,6 +1896,7 @@ bool FileManager::loadFileData(Document doc, int64_t fileSize, const wchar_t * f _stprintf_s(szException, _countof(szException), L"%d (Scintilla)", sciStatus); break; } + if (sciStatus != SC_STATUS_BADALLOC) { pNativeSpeaker->messageBox("FileLoadingException", diff --git a/PowerEditor/src/ScintillaComponent/FunctionCallTip.cpp b/PowerEditor/src/ScintillaComponent/FunctionCallTip.cpp index 79e5bb616..77fd1211e 100644 --- a/PowerEditor/src/ScintillaComponent/FunctionCallTip.cpp +++ b/PowerEditor/src/ScintillaComponent/FunctionCallTip.cpp @@ -257,6 +257,7 @@ bool FunctionCallTip::getCursorFunction() valueVec.pop_back(); } } + if (curValue.lastFunctionIdentifier > -1) { Token funcToken = tokenVector.at(curValue.lastFunctionIdentifier); @@ -271,6 +272,7 @@ bool FunctionCallTip::getCursorFunction() else same = wcsncmp(_funcName, funcToken.token, lstrlen(_funcName)) == 0; } + if (!same) { //check if we need to reload data delete [] _funcName; diff --git a/PowerEditor/src/ScintillaComponent/xmlMatchedTagsHighlighter.cpp b/PowerEditor/src/ScintillaComponent/xmlMatchedTagsHighlighter.cpp index b61d9d9b2..5d52187c2 100644 --- a/PowerEditor/src/ScintillaComponent/xmlMatchedTagsHighlighter.cpp +++ b/PowerEditor/src/ScintillaComponent/xmlMatchedTagsHighlighter.cpp @@ -124,6 +124,7 @@ vector< pair > XmlMatchedTagsHighlighter::getAttributesPos(i state = attr_invalid; } } + if (state == attr_value) attributes.push_back(pair(start+startPos, start+i-1)); diff --git a/PowerEditor/src/WinControls/ClipboardHistory/clipboardHistoryPanel.cpp b/PowerEditor/src/WinControls/ClipboardHistory/clipboardHistoryPanel.cpp index 7814c3a8a..1f803e9e1 100644 --- a/PowerEditor/src/WinControls/ClipboardHistory/clipboardHistoryPanel.cpp +++ b/PowerEditor/src/WinControls/ClipboardHistory/clipboardHistoryPanel.cpp @@ -240,6 +240,7 @@ intptr_t CALLBACK ClipboardHistoryPanel::run_dlgProc(UINT message, WPARAM wParam addToClipboadHistory(clipboardData); } } + if (_hwndNextCbViewer) ::SendMessage(_hwndNextCbViewer, message, wParam, lParam); return TRUE; diff --git a/PowerEditor/src/WinControls/DockingWnd/DockingCont.cpp b/PowerEditor/src/WinControls/DockingWnd/DockingCont.cpp index ab57b1a38..c765793e7 100644 --- a/PowerEditor/src/WinControls/DockingWnd/DockingCont.cpp +++ b/PowerEditor/src/WinControls/DockingWnd/DockingCont.cpp @@ -780,6 +780,7 @@ LRESULT DockingCont::runProcTab(HWND hwnd, UINT Message, WPARAM wParam, LPARAM l { dis.itemState |= ODS_FOCUS; } + if (i == nSelTab) { dis.itemState |= ODS_SELECTED; diff --git a/PowerEditor/src/WinControls/DockingWnd/Gripper.cpp b/PowerEditor/src/WinControls/DockingWnd/Gripper.cpp index 6ef72633c..772f31a51 100644 --- a/PowerEditor/src/WinControls/DockingWnd/Gripper.cpp +++ b/PowerEditor/src/WinControls/DockingWnd/Gripper.cpp @@ -594,6 +594,7 @@ void Gripper::drawRectangle(const POINT* pPt) ::PatBlt(hdcMem, rcOld.left , rcOld.top , rcOld.right , rcOld.bottom , PATINVERT); ::PatBlt(hdcMem, rcOld.left+3, rcOld.top+3, rcOld.right-6, rcOld.bottom-6, PATINVERT); } + if (pPt != NULL) { // draw the new drag-rectangle ::PatBlt(hdcMem, rcNew.left , rcNew.top , rcNew.right , rcNew.bottom , PATINVERT); diff --git a/PowerEditor/src/WinControls/DockingWnd/Gripper.h b/PowerEditor/src/WinControls/DockingWnd/Gripper.h index 85d6b5a70..baa697a16 100644 --- a/PowerEditor/src/WinControls/DockingWnd/Gripper.h +++ b/PowerEditor/src/WinControls/DockingWnd/Gripper.h @@ -63,9 +63,11 @@ public: #endif ::ReleaseDC(0, _hdc); } + if (_hbm) { ::DeleteObject(_hbm); } + if (_hbrush) { ::DeleteObject(_hbrush); } diff --git a/PowerEditor/src/WinControls/DocumentMap/documentSnapshot.cpp b/PowerEditor/src/WinControls/DocumentMap/documentSnapshot.cpp index 0a15a0173..0ebc6ba9c 100644 --- a/PowerEditor/src/WinControls/DocumentMap/documentSnapshot.cpp +++ b/PowerEditor/src/WinControls/DocumentMap/documentSnapshot.cpp @@ -106,11 +106,13 @@ void DocumentPeeker::scrollSnapshotWith(const MapPosition & mapPos, int textZone _rc.bottom = _rc.top + static_cast(mapPos._height); hasBeenChanged = true; } + if (mapPos._width != -1 && _rc.right != _rc.left + mapPos._width) { _rc.right = _rc.left + static_cast(mapPos._width); hasBeenChanged = true; } + if (hasBeenChanged) ::MoveWindow(_pPeekerView->getHSelf(), 0, 0, _rc.right - _rc.left, _rc.bottom - _rc.top, TRUE); // diff --git a/PowerEditor/src/WinControls/FindCharsInRange/FindCharsInRange.cpp b/PowerEditor/src/WinControls/FindCharsInRange/FindCharsInRange.cpp index 93c2c7898..67dd41fef 100644 --- a/PowerEditor/src/WinControls/FindCharsInRange/FindCharsInRange.cpp +++ b/PowerEditor/src/WinControls/FindCharsInRange/FindCharsInRange.cpp @@ -235,6 +235,7 @@ bool FindCharsInRangeDlg::getRangeFromUI(unsigned char & startRange, unsigned ch endRange = 255; return true; } + if (isCheckedOrNot(IDC_ASCCI_RADIO)) { startRange = 0; diff --git a/PowerEditor/src/WinControls/FunctionList/functionListPanel.cpp b/PowerEditor/src/WinControls/FunctionList/functionListPanel.cpp index fff2c104f..c99adbfd4 100644 --- a/PowerEditor/src/WinControls/FunctionList/functionListPanel.cpp +++ b/PowerEditor/src/WinControls/FunctionList/functionListPanel.cpp @@ -192,6 +192,7 @@ void FunctionListPanel::addInStateArray(TreeStateNode tree2Update, const wchar_t found = true; } } + if (!found) { TreeParams params; diff --git a/PowerEditor/src/WinControls/OpenSaveFileDialog/CustomFileDialog.cpp b/PowerEditor/src/WinControls/OpenSaveFileDialog/CustomFileDialog.cpp index 027081285..8d4c4eb9a 100644 --- a/PowerEditor/src/WinControls/OpenSaveFileDialog/CustomFileDialog.cpp +++ b/PowerEditor/src/WinControls/OpenSaveFileDialog/CustomFileDialog.cpp @@ -148,6 +148,7 @@ namespace // anonymous if (SUCCEEDED(hr)) shellItem = parentItem; } + if (SUCCEEDED(hr)) hr = dialog->SetFolder(shellItem); return SUCCEEDED(hr); @@ -421,6 +422,7 @@ private: } } } + if (_hwndNameEdit) s_handleMap[_hwndNameEdit] = this; } diff --git a/PowerEditor/src/WinControls/ProjectPanel/ProjectPanel.cpp b/PowerEditor/src/WinControls/ProjectPanel/ProjectPanel.cpp index f6a8e7871..41d04acae 100644 --- a/PowerEditor/src/WinControls/ProjectPanel/ProjectPanel.cpp +++ b/PowerEditor/src/WinControls/ProjectPanel/ProjectPanel.cpp @@ -1142,6 +1142,7 @@ void ProjectPanel::popupMenuCmd(int cmdID) _treeView.removeItem(hTreeItem); setWorkSpaceDirty(true); } + if (getNodeType(parent) == nodeType_folder) _treeView.setItemImage(parent, INDEX_CLOSED_NODE, INDEX_CLOSED_NODE); } diff --git a/PowerEditor/src/WinControls/SplitterContainer/SplitterContainer.cpp b/PowerEditor/src/WinControls/SplitterContainer/SplitterContainer.cpp index a5dbbcf45..acbba96c1 100644 --- a/PowerEditor/src/WinControls/SplitterContainer/SplitterContainer.cpp +++ b/PowerEditor/src/WinControls/SplitterContainer/SplitterContainer.cpp @@ -42,6 +42,7 @@ void SplitterContainer::create(Window *pWin0, Window *pWin1, int splitterSize, S _dwSplitterStyle |= SV_FIXED; _dwSplitterStyle &= ~SV_RESIZEWTHPERCNT; } + if (!_isRegistered) { WNDCLASS splitterContainerClass{}; @@ -133,6 +134,7 @@ void SplitterContainer::rotateTo(DIRECTION direction) _dwSplitterStyle |= SV_VERTICAL; doSwitchWindow = (direction == DIRECTION::RIGHT); } + if (doSwitchWindow) { Window *tmp = _pWin0; diff --git a/PowerEditor/src/WinControls/StaticDialog/RunDlg/RunDlg.cpp b/PowerEditor/src/WinControls/StaticDialog/RunDlg/RunDlg.cpp index 8e516a7a9..18dd512ee 100644 --- a/PowerEditor/src/WinControls/StaticDialog/RunDlg/RunDlg.cpp +++ b/PowerEditor/src/WinControls/StaticDialog/RunDlg/RunDlg.cpp @@ -123,6 +123,7 @@ void expandNppEnvironmentStrs(const wchar_t *strSrc, wchar_t *stringDest, size_t } } } + if (iBegin != -1) { if (iEnd != -1) diff --git a/PowerEditor/src/WinControls/TabBar/ControlsTab.cpp b/PowerEditor/src/WinControls/TabBar/ControlsTab.cpp index fec3d4419..87b6e29f3 100644 --- a/PowerEditor/src/WinControls/TabBar/ControlsTab.cpp +++ b/PowerEditor/src/WinControls/TabBar/ControlsTab.cpp @@ -74,6 +74,7 @@ bool ControlsTab::renameTab(const wchar_t *internalName, const wchar_t *newName) break; } } + if (!foundIt) return false; diff --git a/PowerEditor/src/WinControls/TabBar/TabBar.cpp b/PowerEditor/src/WinControls/TabBar/TabBar.cpp index 8204e0676..0a769ae51 100644 --- a/PowerEditor/src/WinControls/TabBar/TabBar.cpp +++ b/PowerEditor/src/WinControls/TabBar/TabBar.cpp @@ -1192,6 +1192,7 @@ LRESULT TabBarPlus::runProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPara { dis.itemState |= ODS_FOCUS; } + if (i == nSelTab) { dis.itemState |= ODS_SELECTED; diff --git a/PowerEditor/src/WinControls/ToolBar/ToolBar.cpp b/PowerEditor/src/WinControls/ToolBar/ToolBar.cpp index ceeffe00c..738c39a11 100644 --- a/PowerEditor/src/WinControls/ToolBar/ToolBar.cpp +++ b/PowerEditor/src/WinControls/ToolBar/ToolBar.cpp @@ -394,6 +394,7 @@ void ToolBar::reset(bool create) addbmp.nID = reinterpret_cast(hBmp); ::SendMessage(_hSelf, TB_ADDBITMAP, 1, reinterpret_cast(&addbmp)); } + if (_nbDynButtons > 0) { for (size_t j = 0; j < _nbDynButtons; ++j) diff --git a/PowerEditor/src/WinControls/VerticalFileSwitcher/VerticalFileSwitcher.cpp b/PowerEditor/src/WinControls/VerticalFileSwitcher/VerticalFileSwitcher.cpp index c71a9405f..9561e79f4 100644 --- a/PowerEditor/src/WinControls/VerticalFileSwitcher/VerticalFileSwitcher.cpp +++ b/PowerEditor/src/WinControls/VerticalFileSwitcher/VerticalFileSwitcher.cpp @@ -190,6 +190,7 @@ LRESULT VerticalFileSwitcher::listViewNotifyCustomDraw(HWND hWnd, UINT uMsg, WPA { ::FillRect(lplvcd->nmcd.hdc, &rcSubItem2, hBrush); } + if (colCount == 3) { ::FillRect(lplvcd->nmcd.hdc, &rcSubItem3, hBrush); diff --git a/PowerEditor/src/WinControls/WindowsDlg/WinMgr.cpp b/PowerEditor/src/WinControls/WindowsDlg/WinMgr.cpp index 67d1518cd..e89fd3652 100644 --- a/PowerEditor/src/WinControls/WindowsDlg/WinMgr.cpp +++ b/PowerEditor/src/WinControls/WindowsDlg/WinMgr.cpp @@ -69,8 +69,7 @@ void CWinMgr::GetWindowPositions(HWND hWnd) ////////////////// // Move all the windows. Use DeferWindowPos for speed. // -void -CWinMgr::SetWindowPositions(HWND hWnd) +void CWinMgr::SetWindowPositions(HWND hWnd) { int nWindows = CountWindows(); if (m_map && hWnd && nWindows>0) { @@ -132,8 +131,7 @@ WINRECT* CWinMgr::FindRect(int nID) // algorithm. If a window is given, it's used to get the min/max size and // desired size for TOFIT types. // -void -CWinMgr::CalcGroup(WINRECT* pGroup, HWND hWnd) +void CWinMgr::CalcGroup(WINRECT* pGroup, HWND hWnd) { // If this bombs, most likely the first entry in your map is not a group! assert(pGroup && pGroup->IsGroup()); @@ -203,8 +201,7 @@ CWinMgr::CalcGroup(WINRECT* pGroup, HWND hWnd) // Adjust the size of a single entry upwards to its desired size. // Decrement hwRemaining by amount increased. // -void -CWinMgr::AdjustSize(WINRECT* wrc, BOOL bRow, +void CWinMgr::AdjustSize(WINRECT* wrc, BOOL bRow, int& hwRemaining, HWND hWnd) { SIZEINFO szi; @@ -236,8 +233,7 @@ CWinMgr::AdjustSize(WINRECT* wrc, BOOL bRow, // one below the other; for columns, set each column as tall as rcTotal and // each to the right of the previous. // -void -CWinMgr::PositionRects(WINRECT* pGroup, const RECT& rcTotal, BOOL bRow) +void CWinMgr::PositionRects(WINRECT* pGroup, const RECT& rcTotal, BOOL bRow) { LONG xoryPos = bRow ? rcTotal.top : rcTotal.left; @@ -269,8 +265,7 @@ CWinMgr::PositionRects(WINRECT* pGroup, const RECT& rcTotal, BOOL bRow) // the SIZEINFO argument. For a group, calculate size info as aggregate of // subentries. // -void -CWinMgr::OnGetSizeInfo(SIZEINFO& szi, WINRECT* wrc, HWND hWnd) +void CWinMgr::OnGetSizeInfo(SIZEINFO& szi, WINRECT* wrc, HWND hWnd) { szi.szMin = SIZEZERO; // default min size = zero szi.szMax = SIZEMAX; // default max size = infinite @@ -321,17 +316,23 @@ CWinMgr::OnGetSizeInfo(SIZEINFO& szi, WINRECT* wrc, HWND hWnd) BOOL bRow = parent->IsRowGroup(); int hw, hwMin, hwTotal, pct; - switch (wrc->Type()) { + switch (wrc->Type()) + { case WRCT_FIXED: hw = hwMin = wrc->GetParam(); // ht/wid is parameter - if (hw<0) { // if fixed val is negative: + if (hw<0) // if fixed val is negative: + { hw = -hw; // use absolute val for desired.. hwMin = 0; // ..and zero for minimum } - if (bRow) { + + if (bRow) + { szi.szMax.cy = szi.szDesired.cy = hw; szi.szMin.cy = hwMin; - } else { + } + else + { szi.szMax.cx = szi.szDesired.cx = hw; szi.szMin.cx = hwMin; } @@ -401,8 +402,7 @@ BOOL CWinMgr::SendGetSizeInfo(SIZEINFO& szi, HWND hWnd, UINT nID) ////////////////// // Get min/max info. // -void -CWinMgr::GetMinMaxInfo(HWND hWnd, MINMAXINFO* lpMMI) +void CWinMgr::GetMinMaxInfo(HWND hWnd, MINMAXINFO* lpMMI) { SIZEINFO szi; GetMinMaxInfo(hWnd, szi); // call overloaded version @@ -486,6 +486,7 @@ void CWinMgr::MoveRect(WINRECT* pwrcMove, POINT ptMove, HWND pParentWnd) OffsetRect(pwrcMove->GetRect(), ptMove); if (prev->IsGroup()) CalcGroup(prev, pParentWnd); + if (next->IsGroup()) CalcGroup(next, pParentWnd); } diff --git a/PowerEditor/src/WinControls/WindowsDlg/WindowsDlg.cpp b/PowerEditor/src/WinControls/WindowsDlg/WindowsDlg.cpp index fdeaf1644..c83f972eb 100644 --- a/PowerEditor/src/WinControls/WindowsDlg/WindowsDlg.cpp +++ b/PowerEditor/src/WinControls/WindowsDlg/WindowsDlg.cpp @@ -101,6 +101,7 @@ struct NumericStringEquivalence lcmp = *str1 - *str2; break; } + if (_istdigit(*str1) && _istdigit(*str2)) { lcmp = wcstol(str1, &p1, 10) - wcstol(str2, &p2, 10); @@ -417,6 +418,7 @@ intptr_t CALLBACK WindowsDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM lP string docSizeText = to_string(docSize); text = wstring(docSizeText.begin(), docSizeText.end()); } + if (static_cast(text.length()) < pLvdi->item.cchTextMax) { // Copy the resulting text to destination with a null terminator. diff --git a/PowerEditor/src/lastRecentFileList.cpp b/PowerEditor/src/lastRecentFileList.cpp index 192b76734..22e262747 100644 --- a/PowerEditor/src/lastRecentFileList.cpp +++ b/PowerEditor/src/lastRecentFileList.cpp @@ -231,8 +231,10 @@ wstring & LastRecentFileList::getItem(int id) if (_lrfl.at(i)._id == id) break; } + if (i == _size) i = 0; + return _lrfl.at(i)._name; //if not found, return first } @@ -256,6 +258,7 @@ void LastRecentFileList::setUserMaxNbLRF(int size) toPop--; _size--; } + updateMenu(); _size = _userMax; } diff --git a/PowerEditor/src/localization.cpp b/PowerEditor/src/localization.cpp index 2eca67831..d0a478297 100644 --- a/PowerEditor/src/localization.cpp +++ b/PowerEditor/src/localization.cpp @@ -621,6 +621,7 @@ void NativeLangSpeaker::changeLangTabDropContextMenu(HMENU hCM) int cmdID = ::GetMenuItemID(hCM, POS_GO2VIEW); ::ModifyMenu(hCM, POS_GO2VIEW, MF_BYPOSITION|MF_STRING, cmdID, goToViewG); } + if (cloneToViewA && cloneToViewA[0]) { const wchar_t *cloneToViewG = wmc.char2wchar(cloneToViewA, _nativeLangEncoding);