Browse Source

Fix wrong value set in Preferences->Performance->"Define Large File Size"

Use correct type for file size variables.

Fix #13280, close #13290
pull/13168/head
ArkadiuszMichalski 2 years ago committed by Don Ho
parent
commit
568075beb5
  1. 4
      PowerEditor/src/Parameters.cpp
  2. 4
      PowerEditor/src/WinControls/Preference/preferenceDlg.cpp

4
PowerEditor/src/Parameters.cpp

@ -5731,8 +5731,8 @@ void NppParameters::feedGUIParameters(TiXmlNode *node)
{
int fileSizeLimit4StylingMB = 0;
element->Attribute(TEXT("fileSizeMB"), &fileSizeLimit4StylingMB);
if (fileSizeLimit4StylingMB > 0 && fileSizeLimit4StylingMB < 4096)
_nppGUI._largeFileRestriction._largeFileSizeDefInByte = (fileSizeLimit4StylingMB * 1024 * 1024);
if (fileSizeLimit4StylingMB > 0 && fileSizeLimit4StylingMB <= 4096)
_nppGUI._largeFileRestriction._largeFileSizeDefInByte = (static_cast<int64_t>(fileSizeLimit4StylingMB) * 1024 * 1024);
const TCHAR* boolVal = element->Attribute(TEXT("isEnabled"));
if (boolVal != NULL && !lstrcmp(boolVal, TEXT("no")))

4
PowerEditor/src/WinControls/Preference/preferenceDlg.cpp

@ -5166,7 +5166,7 @@ intptr_t CALLBACK PerformanceSubDlg::run_dlgProc(UINT message , WPARAM wParam, L
if (lstrcmp(str, TEXT("")) == 0)
return TRUE;
size_t fileLenInMB = ::GetDlgItemInt(_hSelf, IDC_EDIT_PERFORMANCE_FILESIZE, NULL, FALSE);
int64_t fileLenInMB = ::GetDlgItemInt(_hSelf, IDC_EDIT_PERFORMANCE_FILESIZE, NULL, FALSE);
if (fileLenInMB > 4096)
{
@ -5195,7 +5195,7 @@ intptr_t CALLBACK PerformanceSubDlg::run_dlgProc(UINT message , WPARAM wParam, L
return TRUE;
}
size_t fileLenInMB = ::GetDlgItemInt(_hSelf, IDC_EDIT_PERFORMANCE_FILESIZE, NULL, FALSE);
int64_t fileLenInMB = ::GetDlgItemInt(_hSelf, IDC_EDIT_PERFORMANCE_FILESIZE, NULL, FALSE);
if (fileLenInMB == 0)
{

Loading…
Cancel
Save