From 901014746c2cf432ac7f20cebb940529a1bd31f8 Mon Sep 17 00:00:00 2001 From: Don Ho Date: Wed, 16 Oct 2024 05:27:29 +0200 Subject: [PATCH] Fix Find dialog status bar wrong messaging Fix #15662 --- PowerEditor/installer/nativeLang/english.xml | 8 ++++---- .../installer/nativeLang/english_customizable.xml | 8 ++++---- PowerEditor/installer/nativeLang/french.xml | 8 ++++---- .../installer/nativeLang/taiwaneseMandarin.xml | 8 ++++---- PowerEditor/src/NppCommands.cpp | 12 ++++++------ .../src/ScintillaComponent/FindReplaceDlg.cpp | 8 ++++---- PowerEditor/src/ScintillaComponent/FindReplaceDlg.h | 5 ++++- 7 files changed, 30 insertions(+), 27 deletions(-) diff --git a/PowerEditor/installer/nativeLang/english.xml b/PowerEditor/installer/nativeLang/english.xml index cffd20554..ceef9aa72 100644 --- a/PowerEditor/installer/nativeLang/english.xml +++ b/PowerEditor/installer/nativeLang/english.xml @@ -1685,8 +1685,8 @@ Find in all files but exclude folders tests, bin && bin64: Find in all files but exclude all folders log or logs recursively: *.* !+\log*"/> - - + + @@ -1700,8 +1700,8 @@ Find in all files but exclude all folders log or logs recursively: - - + + diff --git a/PowerEditor/installer/nativeLang/english_customizable.xml b/PowerEditor/installer/nativeLang/english_customizable.xml index 468180107..8bbc18628 100644 --- a/PowerEditor/installer/nativeLang/english_customizable.xml +++ b/PowerEditor/installer/nativeLang/english_customizable.xml @@ -1684,8 +1684,8 @@ Find in all files but exclude folders tests, bin && bin64: Find in all files but exclude all folders log or logs recursively: *.* !+\log*"/> - - + + @@ -1699,8 +1699,8 @@ Find in all files but exclude all folders log or logs recursively: - - + + diff --git a/PowerEditor/installer/nativeLang/french.xml b/PowerEditor/installer/nativeLang/french.xml index 6528e5bb0..a8500ca14 100644 --- a/PowerEditor/installer/nativeLang/french.xml +++ b/PowerEditor/installer/nativeLang/french.xml @@ -1680,8 +1680,8 @@ Rechercher dans tous les fichiers mais pas dans les dossiers tests, bin &&am Rechercher dans tous les fichiers mais pas dans les dossiers log ou logs récursivement: *.* !+\log*"/> - - + + @@ -1695,8 +1695,8 @@ Rechercher dans tous les fichiers mais pas dans les dossiers log ou logs récurs - - + + diff --git a/PowerEditor/installer/nativeLang/taiwaneseMandarin.xml b/PowerEditor/installer/nativeLang/taiwaneseMandarin.xml index 0571064d2..30bdb14d4 100644 --- a/PowerEditor/installer/nativeLang/taiwaneseMandarin.xml +++ b/PowerEditor/installer/nativeLang/taiwaneseMandarin.xml @@ -1546,8 +1546,8 @@ 所有檔案但在所有的層級(遞歸地)不搜尋檔案夾 log 或 logs: *.* !+\log*"/> - - + + @@ -1560,8 +1560,8 @@ - - + + diff --git a/PowerEditor/src/NppCommands.cpp b/PowerEditor/src/NppCommands.cpp index 43ced00b7..342049bfc 100644 --- a/PowerEditor/src/NppCommands.cpp +++ b/PowerEditor/src/NppCommands.cpp @@ -1400,12 +1400,12 @@ void Notepad_plus::command(int id) _findReplaceDlg.processFindNext(s.c_str(), &op, &status); if (status == FSEndReached) { - wstring msg = _nativeLangSpeaker.getLocalizedStrFromID("find-status-end-reached", L"Find: Found the 1st occurrence from the top. The end of the document has been reached."); + wstring msg = _nativeLangSpeaker.getLocalizedStrFromID("find-status-end-reached", FIND_STATUS_END_REACHED_TEXT); _findReplaceDlg.setStatusbarMessage(msg, FSEndReached); } else if (status == FSTopReached) { - wstring msg = _nativeLangSpeaker.getLocalizedStrFromID("find-status-top-reached", L"Find: Found the 1st occurrence from the bottom. The beginning of the document has been reached."); + wstring msg = _nativeLangSpeaker.getLocalizedStrFromID("find-status-top-reached", FIND_STATUS_TOP_REACHED_TEXT); _findReplaceDlg.setStatusbarMessage(msg, FSTopReached); } } @@ -1437,12 +1437,12 @@ void Notepad_plus::command(int id) _findReplaceDlg.processFindNext(str, &op, &status); if (status == FSEndReached) { - wstring msg = _nativeLangSpeaker.getLocalizedStrFromID("find-status-end-reached", L"Find: Found the 1st occurrence from the top. The end of the document has been reached."); + wstring msg = _nativeLangSpeaker.getLocalizedStrFromID("find-status-end-reached", FIND_STATUS_END_REACHED_TEXT); _findReplaceDlg.setStatusbarMessage(msg, FSEndReached); } else if (status == FSTopReached) { - wstring msg = _nativeLangSpeaker.getLocalizedStrFromID("find-status-top-reached", L"Find: Found the 1st occurrence from the bottom. The beginning of the document has been reached."); + wstring msg = _nativeLangSpeaker.getLocalizedStrFromID("find-status-top-reached", FIND_STATUS_TOP_REACHED_TEXT); _findReplaceDlg.setStatusbarMessage(msg, FSTopReached); } } @@ -1488,12 +1488,12 @@ void Notepad_plus::command(int id) _findReplaceDlg.processFindNext(str, &op, &status); if (status == FSEndReached) { - wstring msg = _nativeLangSpeaker.getLocalizedStrFromID("find-status-end-reached", L"Find: Found the 1st occurrence from the top. The end of the document has been reached."); + wstring msg = _nativeLangSpeaker.getLocalizedStrFromID("find-status-end-reached", FIND_STATUS_END_REACHED_TEXT); _findReplaceDlg.setStatusbarMessage(msg, FSEndReached); } else if (status == FSTopReached) { - wstring msg = _nativeLangSpeaker.getLocalizedStrFromID("find-status-top-reached", L"Find: Found the 1st occurrence from the bottom. The beginning of the document has been reached."); + wstring msg = _nativeLangSpeaker.getLocalizedStrFromID("find-status-top-reached", FIND_STATUS_TOP_REACHED_TEXT); _findReplaceDlg.setStatusbarMessage(msg, FSTopReached); } } diff --git a/PowerEditor/src/ScintillaComponent/FindReplaceDlg.cpp b/PowerEditor/src/ScintillaComponent/FindReplaceDlg.cpp index 9532c629a..ba5f87630 100644 --- a/PowerEditor/src/ScintillaComponent/FindReplaceDlg.cpp +++ b/PowerEditor/src/ScintillaComponent/FindReplaceDlg.cpp @@ -1911,12 +1911,12 @@ intptr_t CALLBACK FindReplaceDlg::run_dlgProc(UINT message, WPARAM wParam, LPARA NativeLangSpeaker *pNativeSpeaker = (NppParameters::getInstance()).getNativeLangSpeaker(); if (findStatus == FSEndReached) { - wstring msg = pNativeSpeaker->getLocalizedStrFromID("find-status-end-reached", L"Find: Found the last occurrence from the top. The end of the document has been reached."); + wstring msg = pNativeSpeaker->getLocalizedStrFromID("find-status-end-reached", FIND_STATUS_END_REACHED_TEXT); setStatusbarMessage(msg, FSEndReached); } else if (findStatus == FSTopReached) { - wstring msg = pNativeSpeaker->getLocalizedStrFromID("find-status-top-reached", L"Find: Found the last occurrence from the bottom. The beginning of the document has been reached."); + wstring msg = pNativeSpeaker->getLocalizedStrFromID("find-status-top-reached", FIND_STATUS_TOP_REACHED_TEXT); setStatusbarMessage(msg, FSTopReached); } } @@ -2972,12 +2972,12 @@ bool FindReplaceDlg::processReplace(const wchar_t *txt2find, const wchar_t *txt2 if (status == FSEndReached) { - wstring msg = pNativeSpeaker->getLocalizedStrFromID("find-status-replace-end-reached", L"Replace: Replaced the last occurrence from the top. The end of document has been reached."); + wstring msg = pNativeSpeaker->getLocalizedStrFromID("find-status-replace-end-reached", FIND_STATUS_REPLACE_END_REACHED_TEXT); setStatusbarMessage(msg, FSEndReached); } else if (status == FSTopReached) { - wstring msg = pNativeSpeaker->getLocalizedStrFromID("find-status-replace-top-reached", L"Replace: Replaced the last occurrence from the bottom. The begin of document has been reached."); + wstring msg = pNativeSpeaker->getLocalizedStrFromID("find-status-replace-top-reached", FIND_STATUS_REPLACE_TOP_REACHED_TEXT); setStatusbarMessage(msg, FSTopReached); } else diff --git a/PowerEditor/src/ScintillaComponent/FindReplaceDlg.h b/PowerEditor/src/ScintillaComponent/FindReplaceDlg.h index 05cef3cae..7096b8d20 100644 --- a/PowerEditor/src/ScintillaComponent/FindReplaceDlg.h +++ b/PowerEditor/src/ScintillaComponent/FindReplaceDlg.h @@ -38,7 +38,10 @@ enum DIALOG_TYPE {FIND_DLG, REPLACE_DLG, FINDINFILES_DLG, FINDINPROJECTS_DLG, MA #define DIR_DOWN true #define DIR_UP false -//#define FIND_REPLACE_STR_MAX 256 +#define FIND_STATUS_END_REACHED_TEXT L"Find: End of document reached, first occurrence from the top found." +#define FIND_STATUS_TOP_REACHED_TEXT L"Find: Beginning of the document reached, first occurrence from the bottom found." +#define FIND_STATUS_REPLACE_END_REACHED_TEXT L"Replace: End of document reached, first occurrence from the top replaced." +#define FIND_STATUS_REPLACE_TOP_REACHED_TEXT L"Replace: Beginning of document reached, first occurrence from the bottom replaced." enum InWhat{ALL_OPEN_DOCS, FILES_IN_DIR, CURRENT_DOC, CURR_DOC_SELECTION, FILES_IN_PROJECTS};