mirror of
https://github.com/rizonesoft/Notepad3.git
synced 2026-06-11 21:03:05 +08:00
+chg: Some more DynStrg refactorings and LongPath handling
This commit is contained in:
parent
fdf74d8881
commit
bfaa9fed6c
@ -1170,13 +1170,12 @@ void LoadSettings()
|
||||
Settings2.DefaultExtension, COUNTOF(Settings2.DefaultExtension));
|
||||
StrTrim(Settings2.DefaultExtension, L" \t.");
|
||||
|
||||
|
||||
IniSectionGetStringNoQuotes(IniSecSettings2, L"DefaultDirectory", L"", pPathBuffer, PATHLONG_MAX_CCH);
|
||||
Path_Reset(Settings2.DefaultDirectory, pPathBuffer);
|
||||
Path_ExpandEnvironmentStrings(Settings2.DefaultDirectory);
|
||||
|
||||
IniSectionGetStringNoQuotes(IniSecSettings2, L"FileDlgFilters", L"",
|
||||
Settings2.FileDlgFilters, COUNTOF(Settings2.FileDlgFilters) - 2);
|
||||
IniSectionGetStringNoQuotes(IniSecSettings2, L"FileDlgFilters", L"", pPathBuffer, PATHLONG_MAX_CCH);
|
||||
StrgReset(Settings2.FileDlgFilters, pPathBuffer);
|
||||
|
||||
Settings2.FileCheckInverval = clampul(IniSectionGetInt(IniSecSettings2, L"FileCheckInverval", 0), 0, 86400000<<2); // max: 48h
|
||||
// handle deprecated old "AutoReloadTimeout"
|
||||
|
||||
@ -779,6 +779,7 @@ static void _InitGlobals()
|
||||
Settings2.WebTemplate2 = StrgCreate(NULL);
|
||||
Settings2.HyperlinkShellExURLWithApp = StrgCreate(NULL);
|
||||
Settings2.HyperlinkShellExURLCmdLnArgs = StrgCreate(NULL);
|
||||
Settings2.FileDlgFilters = StrgCreate(NULL);
|
||||
|
||||
FocusedView.HideNonMatchedLines = false;
|
||||
FocusedView.CodeFoldingAvailable = false;
|
||||
@ -885,6 +886,7 @@ static void _CleanUpResources(const HWND hwnd, bool bIsInitialized)
|
||||
|
||||
// --- free allocated memory ---
|
||||
|
||||
StrgDestroy(Settings2.FileDlgFilters);
|
||||
StrgDestroy(Settings2.HyperlinkShellExURLCmdLnArgs);
|
||||
StrgDestroy(Settings2.HyperlinkShellExURLWithApp);
|
||||
StrgDestroy(Settings2.WebTemplate2);
|
||||
@ -7506,6 +7508,7 @@ bool HandleHotSpotURLClicked(const DocPos position, const HYPERLINK_OPS operatio
|
||||
PathCreateFromUrl(szTextW, szUnEscW, &dCch, 0);
|
||||
szUnEscW[min_u(MAX_PATH, INTERNET_MAX_URL_LENGTH)] = L'\0'; // limit length
|
||||
|
||||
// TODO: §§§ @@@ LongPath handling (MAX_PATH) !!!
|
||||
WCHAR * const szFilePath = szUnEscW;
|
||||
StrTrim(szFilePath, L"/");
|
||||
|
||||
@ -11046,7 +11049,7 @@ bool OpenFileDlg(HWND hwnd, LPWSTR lpstrFile, int cchFile, LPCWSTR lpstrInitialD
|
||||
return false;
|
||||
}
|
||||
|
||||
WCHAR szFilter[BUFZIZE_STYLE_EXTENTIONS << 1];
|
||||
WCHAR szFilter[BUFZIZE_STYLE_EXTENTIONS << 2];
|
||||
WCHAR szDefExt[64] = { L'\0' };
|
||||
Style_GetFileFilterStr(szFilter, COUNTOF(szFilter), szDefExt, COUNTOF(szDefExt), false);
|
||||
|
||||
|
||||
@ -2788,8 +2788,8 @@ bool Style_GetFileFilterStr(LPWSTR lpszFilter, int cchFilter, LPWSTR lpszDefExt,
|
||||
StringCchCat(lpszFilter, cchFilter, L"|");
|
||||
}
|
||||
|
||||
if (StrIsNotEmpty(Settings2.FileDlgFilters)) {
|
||||
StringCchCat(lpszFilter, cchFilter, Settings2.FileDlgFilters);
|
||||
if (StrgIsNotEmpty(Settings2.FileDlgFilters)) {
|
||||
StringCchCat(lpszFilter, cchFilter, StrgGet(Settings2.FileDlgFilters));
|
||||
StringCchCat(lpszFilter, cchFilter, L"|");
|
||||
}
|
||||
|
||||
|
||||
@ -671,12 +671,12 @@ typedef struct _settings2_t
|
||||
HSTRINGW WebTemplate2;
|
||||
HSTRINGW HyperlinkShellExURLWithApp;
|
||||
HSTRINGW HyperlinkShellExURLCmdLnArgs;
|
||||
HSTRINGW FileDlgFilters;
|
||||
|
||||
WCHAR FileChangedIndicator[4];
|
||||
WCHAR FileDeletedIndicator[4];
|
||||
|
||||
WCHAR DefaultExtension[MINI_BUFFER];
|
||||
WCHAR FileDlgFilters[XHUGE_BUFFER];
|
||||
|
||||
WCHAR AppUserModelID[SMALL_BUFFER];
|
||||
WCHAR AutoCompleteFillUpChars[MINI_BUFFER];
|
||||
|
||||
Loading…
Reference in New Issue
Block a user