Skip to content

Commit 3453fd4

Browse files
committed
Fixed missing include directive
1 parent 42fcb4f commit 3453fd4

File tree

9 files changed

+32
-27
lines changed

9 files changed

+32
-27
lines changed

src/Explorer/Explorer.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
2727
#include <shlobj.h>
2828
#include <dbt.h>
2929
#include <ranges>
30+
#include <format>
3031
#include <wrl/client.h>
3132

3233
#include "NppInterface.h"
@@ -1052,7 +1053,7 @@ BOOL ConvertCall(LPTSTR pszExplArg, LPTSTR pszName, LPTSTR *p_pszNppArg, const s
10521053
varElement = VAR_FILE_EXT;
10531054
} else {
10541055
WCHAR szTemp[MAX_PATH];
1055-
_stprintf(szTemp, L"Argument \"%s\" unknown.", pszPtr);
1056+
_stprintf(szTemp, L"Argument \"%ls\" unknown.", pszPtr);
10561057
::MessageBox(g_nppData._nppHandle, szTemp, L"Error", MB_OK | MB_ICONERROR);
10571058

10581059
return FALSE;
@@ -1140,11 +1141,11 @@ BOOL ConvertCall(LPTSTR pszExplArg, LPTSTR pszName, LPTSTR *p_pszNppArg, const s
11401141

11411142
if (*p_pszNppArg != nullptr) {
11421143
if (pszTemp != nullptr) {
1143-
_stprintf(*p_pszNppArg, L"%s \"%s\"", pszTemp, szElement);
1144+
_stprintf(*p_pszNppArg, L"%ls \"%ls\"", pszTemp, szElement);
11441145
delete [] pszTemp;
11451146
}
11461147
else {
1147-
_stprintf(*p_pszNppArg, L"\"%s\"", szElement);
1148+
_stprintf(*p_pszNppArg, L"\"%ls\"", szElement);
11481149
}
11491150
}
11501151
else {

src/Explorer/Explorer.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
1919

2020
#pragma once
2121

22-
#define NOMINMAX
2322
#define WIN32_LEAN_AND_MEAN
2423
#include <windows.h>
2524
#include <windowsx.h>

src/Explorer/ExplorerDialog.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,13 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
2929
#include <list>
3030
#include <string>
3131
#include <optional>
32+
#include <format>
3233

3334
#include "Explorer.h"
3435
#include "ExplorerResource.h"
3536
#include "ContextMenu.h"
3637
#include "NewDlg.h"
3738
#include "NppInterface.h"
38-
#include "StringUtil.h"
3939
#include "resource.h"
4040
#include "ThemeRenderer.h"
4141

@@ -2159,8 +2159,8 @@ bool ExplorerDialog::doPaste(LPCTSTR pszTo, LPDROPFILES hData, const DWORD & dwE
21592159
}
21602160

21612161
const std::wstring message = (dwEffect == DROPEFFECT_MOVE)
2162-
? StringUtil::format(L"Move %d file(s)/folder(s) to:\n\n%s", count, pszTo)
2163-
: StringUtil::format(L"Copy %d file(s)/folder(s) to:\n\n%s", count, pszTo);
2162+
? std::format(L"Move {} file(s)/folder(s) to:\n\n{}", count, pszTo)
2163+
: std::format(L"Copy {} file(s)/folder(s) to:\n\n{}", count, pszTo);
21642164

21652165
if (::MessageBox(_hSelf, message.c_str(), L"Explorer", MB_YESNO) == IDYES) {
21662166
// TODO move or copy the file views into other window in dependency to keystate

src/Explorer/FavesDialog.cpp

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
2727
#include <Vsstyle.h>
2828
#include <Vssym32.h>
2929

30+
#include <format>
31+
3032
#include "Explorer.h"
3133
#include "ExplorerDialog.h"
3234
#include "ExplorerResource.h"
@@ -352,9 +354,9 @@ INT_PTR CALLBACK FavesDialog::run_dlgProc(UINT Message, WPARAM wParam, LPARAM lP
352354
}
353355

354356
// make tooltip text.
355-
tipText += StringUtil::format(L"\nThis session has %d files", count);
357+
tipText += std::format(L"\nThis session has {} files", count);
356358
if (nonExistentFileCount > 0) {
357-
tipText += StringUtil::format(L" (%d are non-existent)", nonExistentFileCount);
359+
tipText += std::format(L" ({} are non-existent)", nonExistentFileCount);
358360
}
359361
tipText += L".";
360362
}
@@ -648,7 +650,7 @@ void FavesDialog::PasteItem(HTREEITEM hItem)
648650
}
649651
else {
650652
WCHAR msgBoxTxt[128];
651-
_stprintf(msgBoxTxt, L"Could only be paste into %s", source->Root()->Name().c_str());
653+
_stprintf(msgBoxTxt, L"Could only be paste into %ls", source->Root()->Name().c_str());
652654
::MessageBox(_hParent, msgBoxTxt, L"Error", MB_OK);
653655
}
654656
}
@@ -1018,12 +1020,10 @@ void FavesDialog::OpenContext(HTREEITEM hItem, POINT pt)
10181020
case FM_NEWGROUP: {
10191021
LPTSTR pszName = (LPTSTR)new WCHAR[MAX_PATH];
10201022
LPTSTR pszDesc = (LPTSTR)new WCHAR[MAX_PATH];
1021-
LPTSTR pszComm = (LPTSTR)new WCHAR[MAX_PATH];
10221023

10231024
pszName[0] = '\0';
10241025

1025-
wcscpy(pszComm, L"New group in %s");
1026-
_stprintf(pszDesc, pszComm, pElem->Root()->Name().c_str());
1026+
_stprintf(pszDesc, L"New group in %ls", pElem->Root()->Name().c_str());
10271027

10281028
/* init new dialog */
10291029
NewDlg dlgNew;
@@ -1044,7 +1044,6 @@ void FavesDialog::OpenContext(HTREEITEM hItem, POINT pt)
10441044

10451045
delete [] pszName;
10461046
delete [] pszDesc;
1047-
delete [] pszComm;
10481047
break;
10491048
}
10501049
case FM_COPY:
@@ -1358,7 +1357,10 @@ void FavesDialog::OpenLink(FavesItemPtr pElem)
13581357
}
13591358
}
13601359
if (0 < nonExistentFileCount) {
1361-
if (IDCANCEL == ::MessageBox(_hSelf, StringUtil::format(L"This session has %d non-existent files. Processing will delete all non-existent files in the session. Are you sure you want to continue?", nonExistentFileCount).c_str(), L"Open Session", MB_OKCANCEL | MB_ICONWARNING)) {
1360+
const std::wstring msg = std::format(L"This session has {} non-existent files. "
1361+
L"Processing will delete all non-existent files in the session. Are you sure you want to continue?",
1362+
nonExistentFileCount);
1363+
if (IDCANCEL == ::MessageBox(_hSelf, msg.c_str(), L"Open Session", MB_OKCANCEL | MB_ICONWARNING)) {
13621364
return;
13631365
}
13641366
}
@@ -1566,7 +1568,7 @@ void FavesDialog::SaveSettings()
15661568
::WriteFile(hFile, szBOM, sizeof(szBOM), &hasWritten, nullptr);
15671569

15681570
for (auto *root : { _model.FolderRoot(), _model.FileRoot(), _model.WebRoot(), _model.SessionRoot() }) {
1569-
std::wstring temp = StringUtil::format(L"%s\nExpand=%i\n\n", root->Name().c_str(), root->IsExpanded());
1571+
std::wstring temp = std::format(L"{}\nExpand={}\n\n", root->Name().c_str(), root->IsExpanded());
15701572
::WriteFile(hFile, temp.c_str(), (DWORD)temp.length() * sizeof(WCHAR), &hasWritten, nullptr);
15711573
SaveElementTreeRecursive(root, hFile);
15721574
}
@@ -1590,10 +1592,10 @@ void FavesDialog::SaveElementTreeRecursive(FavesItemPtr pElem, HANDLE hFile)
15901592
if (child->IsGroup()) {
15911593
::WriteFile(hFile, L"#GROUP\n", (DWORD)wcslen(L"#GROUP\n") * sizeof(WCHAR), &hasWritten, nullptr);
15921594

1593-
std::wstring temp = StringUtil::format(L"\tName=%s\n", child->Name().c_str());
1595+
std::wstring temp = std::format(L"\tName={}\n", child->Name().c_str());
15941596
::WriteFile(hFile, temp.c_str(), (DWORD)temp.length() * sizeof(WCHAR), &hasWritten, nullptr);
15951597

1596-
temp = StringUtil::format(L"\tExpand=%i\n\n", child->IsExpanded());
1598+
temp = std::format(L"\tExpand={}\n\n", child->IsExpanded());
15971599
::WriteFile(hFile, temp.c_str(), (DWORD)temp.length() * sizeof(WCHAR), &hasWritten, nullptr);
15981600

15991601
SaveElementTreeRecursive(child.get(), hFile);
@@ -1603,10 +1605,10 @@ void FavesDialog::SaveElementTreeRecursive(FavesItemPtr pElem, HANDLE hFile)
16031605
else if (child->IsLink()) {
16041606
::WriteFile(hFile, L"#LINK\n", (DWORD)wcslen(L"#LINK\n") * sizeof(WCHAR), &hasWritten, nullptr);
16051607

1606-
std::wstring temp = StringUtil::format(L"\tName=%s\n", child->Name().c_str());
1608+
std::wstring temp = std::format(L"\tName={}\n", child->Name().c_str());
16071609
::WriteFile(hFile, temp.c_str(), (DWORD)temp.length() * sizeof(WCHAR), &hasWritten, nullptr);
16081610

1609-
temp = StringUtil::format(L"\tLink=%s\n\n", child->Link().c_str());
1611+
temp = std::format(L"\tLink={}\n\n", child->Link().c_str());
16101612
::WriteFile(hFile, temp.c_str(), (DWORD)temp.length() * sizeof(WCHAR), &hasWritten, nullptr);
16111613
}
16121614
}

src/Explorer/FileList.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -643,10 +643,10 @@ void FileList::ReadArrayToList(LPTSTR szItem, INT iItem ,INT iSubItem)
643643
switch (iSubItem) {
644644
case SubItem::Name:
645645
if ((iItem < (INT)_uMaxFolders) && (_pExProp->bViewBraces == TRUE)) {
646-
swprintf(szItem, L"[%s]", _vFileList[iItem].strName.c_str());
646+
swprintf(szItem, L"[%ls]", _vFileList[iItem].strName.c_str());
647647
}
648648
else {
649-
swprintf(szItem, L"%s", _vFileList[iItem].strName.c_str());
649+
swprintf(szItem, L"%ls", _vFileList[iItem].strName.c_str());
650650
}
651651
break;
652652
case SubItem::Extension:
@@ -1621,10 +1621,10 @@ bool FileList::doPaste(LPCTSTR pszTo, LPDROPFILES hData, const DWORD & dwEffect)
16211621

16221622
WCHAR text[MAX_PATH + 32];
16231623
if (dwEffect == DROPEFFECT_MOVE) {
1624-
swprintf(text, L"Move %d file(s)/folder(s) to:\n\n%s", count, pszTo);
1624+
swprintf(text, L"Move %d file(s)/folder(s) to:\n\n%ls", count, pszTo);
16251625
}
16261626
else {// dwEffect == DROPEFFECT_COPY
1627-
swprintf(text, L"Copy %d file(s)/folder(s) to:\n\n%s", count, pszTo);
1627+
swprintf(text, L"Copy %d file(s)/folder(s) to:\n\n%ls", count, pszTo);
16281628
}
16291629

16301630
if (::MessageBox(_hSelf, text, L"Explorer", MB_YESNO) == IDYES) {

src/Explorer/NewDlg.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ INT_PTR CALLBACK NewDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM lParam)
4040
::SetWindowText(_hSelf, _pszWndName);
4141
}
4242

43-
_stprintf(szDesc, L"%s:", _pDesc);
43+
_stprintf(szDesc, L"%ls:", _pDesc);
4444
::SetWindowText(::GetDlgItem(_hSelf, IDC_STATIC_NEW_DESC), szDesc);
4545

4646
::SetWindowText(::GetDlgItem(_hSelf, IDC_EDIT_NEW), _pFileName);

src/Explorer/PropDlg.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ INT_PTR CALLBACK PropDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM lParam
7878
/* set discription */
7979
WCHAR szBuffer[256];
8080

81-
_stprintf(szBuffer, L"%s:", _pDesc);
81+
_stprintf(szBuffer, L"%ls:", _pDesc);
8282
::SetWindowText(::GetDlgItem(_hSelf, IDC_STATIC_FAVES_DESC), szBuffer);
8383

8484
/* if name is not defined extract from link */

src/Explorer/QuickOpenDialog.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@
2929
#include <execution>
3030
#include <list>
3131
#include <string_view>
32+
#include <memory>
33+
#include <optional>
34+
#include <condition_variable>
3235

3336
#include <shlwapi.h>
3437
#include <windowsx.h>

src/Explorer/TreeView.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
2121
#include "TreeView.h"
2222

2323
#include <memory>
24-
24+
#include <algorithm>
2525

2626
BOOL TreeView::Attach(HWND wnd)
2727
{

0 commit comments

Comments
 (0)