mirror of
https://github.com/notepad-plus-plus/notepad-plus-plus.git
synced 2025-07-25 23:05:13 +02:00
parent
296e1c695e
commit
6a4ef408f2
@ -257,7 +257,7 @@ UNICODE = -DUNICODE -D_UNICODE
|
|||||||
|
|
||||||
CXX = $(CROSS_COMPILE)g++
|
CXX = $(CROSS_COMPILE)g++
|
||||||
#CXXFLAGS = -O2 $(INCLUDESPECIAL)
|
#CXXFLAGS = -O2 $(INCLUDESPECIAL)
|
||||||
CXXFLAGS = $(INCLUDESPECIAL) -D_WIN32_WINNT=0x0600 -DTIXML_USE_STL -DTIXMLA_USE_STL $(UNICODE) -std=c++17 -fpermissive
|
CXXFLAGS = $(INCLUDESPECIAL) -D_WIN32_WINNT=0x0600 -DTIXML_USE_STL -DTIXMLA_USE_STL $(UNICODE) -std=c++17 -fpermissive -Wno-conversion-null
|
||||||
INCLUDES = $(patsubst %,-I%,$(DIRS)) -I./include
|
INCLUDES = $(patsubst %,-I%,$(DIRS)) -I./include
|
||||||
LDFLAGS = -Wl,--subsystem,windows -municode -mwindows
|
LDFLAGS = -Wl,--subsystem,windows -municode -mwindows
|
||||||
LIBS = -lcomdlg32 -lcomctl32 -lgdi32 -lole32 -loleacc -lshell32 -lshlwapi -ldbghelp -lversion -lcrypt32 -lsensapi -lwininet -lwintrust -luuid -luxtheme
|
LIBS = -lcomdlg32 -lcomctl32 -lgdi32 -lole32 -loleacc -lshell32 -lshlwapi -ldbghelp -lversion -lcrypt32 -lsensapi -lwininet -lwintrust -luuid -luxtheme
|
||||||
|
@ -2659,7 +2659,7 @@ bool isUrlTextChar(TCHAR const c)
|
|||||||
case '{':
|
case '{':
|
||||||
case '}':
|
case '}':
|
||||||
case '?':
|
case '?':
|
||||||
case '\0x7f':
|
case '\u007F':
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
@ -1331,7 +1331,7 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa
|
|||||||
|
|
||||||
case NPPM_CREATESCINTILLAHANDLE:
|
case NPPM_CREATESCINTILLAHANDLE:
|
||||||
{
|
{
|
||||||
return (LRESULT)_scintillaCtrls4Plugins.createSintilla((lParam == NULL?hwnd:reinterpret_cast<HWND>(lParam)));
|
return (LRESULT)_scintillaCtrls4Plugins.createSintilla((lParam ? reinterpret_cast<HWND>(lParam) : hwnd));
|
||||||
}
|
}
|
||||||
|
|
||||||
case NPPM_INTERNAL_GETSCINTEDTVIEW:
|
case NPPM_INTERNAL_GETSCINTEDTVIEW:
|
||||||
|
@ -1060,7 +1060,7 @@ namespace NppDarkMode
|
|||||||
{
|
{
|
||||||
if (NppDarkMode::isEnabled())
|
if (NppDarkMode::isEnabled())
|
||||||
{
|
{
|
||||||
int msg = NULL;
|
UINT msg = 0;
|
||||||
switch (type)
|
switch (type)
|
||||||
{
|
{
|
||||||
case NppDarkMode::ToolTipsType::toolbar:
|
case NppDarkMode::ToolTipsType::toolbar:
|
||||||
@ -1073,7 +1073,7 @@ namespace NppDarkMode
|
|||||||
msg = TVM_GETTOOLTIPS;
|
msg = TVM_GETTOOLTIPS;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
msg = NULL;
|
msg = 0;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1083,7 +1083,7 @@ namespace NppDarkMode
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
auto hTips = reinterpret_cast<HWND>(SendMessage(hwnd, msg, NULL, NULL));
|
auto hTips = reinterpret_cast<HWND>(SendMessage(hwnd, msg, 0, 0));
|
||||||
if (hTips != nullptr)
|
if (hTips != nullptr)
|
||||||
{
|
{
|
||||||
SetWindowTheme(hTips, L"DarkMode_Explorer", NULL);
|
SetWindowTheme(hTips, L"DarkMode_Explorer", NULL);
|
||||||
|
@ -323,7 +323,7 @@ BufferID Notepad_plus::doOpen(const generic_string& fileName, bool isRecursive,
|
|||||||
SCNotification scnN;
|
SCNotification scnN;
|
||||||
scnN.nmhdr.code = NPPN_FILEBEFORELOAD;
|
scnN.nmhdr.code = NPPN_FILEBEFORELOAD;
|
||||||
scnN.nmhdr.hwndFrom = _pPublicInterface->getHSelf();
|
scnN.nmhdr.hwndFrom = _pPublicInterface->getHSelf();
|
||||||
scnN.nmhdr.idFrom = NULL;
|
scnN.nmhdr.idFrom = 0;
|
||||||
_pluginsManager.notify(&scnN);
|
_pluginsManager.notify(&scnN);
|
||||||
|
|
||||||
if (encoding == -1)
|
if (encoding == -1)
|
||||||
|
@ -585,7 +585,7 @@ void FileManager::closeBuffer(BufferID id, ScintillaEditView * identifier)
|
|||||||
BufferID FileManager::loadFile(const TCHAR * filename, Document doc, int encoding, const TCHAR *backupFileName, FILETIME fileNameTimestamp)
|
BufferID FileManager::loadFile(const TCHAR * filename, Document doc, int encoding, const TCHAR *backupFileName, FILETIME fileNameTimestamp)
|
||||||
{
|
{
|
||||||
bool ownDoc = false;
|
bool ownDoc = false;
|
||||||
if (doc == NULL)
|
if (!doc)
|
||||||
{
|
{
|
||||||
doc = (Document)_pscratchTilla->execute(SCI_CREATEDOCUMENT);
|
doc = (Document)_pscratchTilla->execute(SCI_CREATEDOCUMENT);
|
||||||
ownDoc = true;
|
ownDoc = true;
|
||||||
|
@ -56,7 +56,7 @@ void delLeftWordInEdit(HWND hEdit)
|
|||||||
TCHAR str[FINDREPLACE_MAXLENGTH];
|
TCHAR str[FINDREPLACE_MAXLENGTH];
|
||||||
::SendMessage(hEdit, WM_GETTEXT, FINDREPLACE_MAXLENGTH - 1, reinterpret_cast<LPARAM>(str));
|
::SendMessage(hEdit, WM_GETTEXT, FINDREPLACE_MAXLENGTH - 1, reinterpret_cast<LPARAM>(str));
|
||||||
WORD cursor;
|
WORD cursor;
|
||||||
::SendMessage(hEdit, EM_GETSEL, (WPARAM)&cursor, NULL);
|
::SendMessage(hEdit, EM_GETSEL, (WPARAM)&cursor, 0);
|
||||||
WORD wordstart = cursor;
|
WORD wordstart = cursor;
|
||||||
while (wordstart > 0) {
|
while (wordstart > 0) {
|
||||||
TCHAR c = str[wordstart - 1];
|
TCHAR c = str[wordstart - 1];
|
||||||
|
@ -346,7 +346,7 @@ LRESULT ScintillaEditView::scintillaNew_Proc(HWND hwnd, UINT Message, WPARAM wPa
|
|||||||
{
|
{
|
||||||
case WM_MOUSEHWHEEL :
|
case WM_MOUSEHWHEEL :
|
||||||
{
|
{
|
||||||
::CallWindowProc(_scintillaDefaultProc, hwnd, WM_HSCROLL, ((short)HIWORD(wParam) > 0)?SB_LINERIGHT:SB_LINELEFT, NULL);
|
::CallWindowProc(_scintillaDefaultProc, hwnd, WM_HSCROLL, ((short)HIWORD(wParam) > 0)?SB_LINERIGHT:SB_LINELEFT, 0);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -361,9 +361,9 @@ LRESULT ScintillaEditView::scintillaNew_Proc(HWND hwnd, UINT Message, WPARAM wPa
|
|||||||
if (LOWORD(wParam) & MK_SHIFT)
|
if (LOWORD(wParam) & MK_SHIFT)
|
||||||
{
|
{
|
||||||
// move 3 columns at a time
|
// move 3 columns at a time
|
||||||
::CallWindowProc(_scintillaDefaultProc, hwnd, WM_HSCROLL, ((short)HIWORD(wParam) < 0) ? SB_LINERIGHT : SB_LINELEFT, NULL);
|
::CallWindowProc(_scintillaDefaultProc, hwnd, WM_HSCROLL, ((short)HIWORD(wParam) < 0) ? SB_LINERIGHT : SB_LINELEFT, 0);
|
||||||
::CallWindowProc(_scintillaDefaultProc, hwnd, WM_HSCROLL, ((short)HIWORD(wParam) < 0) ? SB_LINERIGHT : SB_LINELEFT, NULL);
|
::CallWindowProc(_scintillaDefaultProc, hwnd, WM_HSCROLL, ((short)HIWORD(wParam) < 0) ? SB_LINERIGHT : SB_LINELEFT, 0);
|
||||||
::CallWindowProc(_scintillaDefaultProc, hwnd, WM_HSCROLL, ((short)HIWORD(wParam) < 0) ? SB_LINERIGHT : SB_LINELEFT, NULL);
|
::CallWindowProc(_scintillaDefaultProc, hwnd, WM_HSCROLL, ((short)HIWORD(wParam) < 0) ? SB_LINERIGHT : SB_LINELEFT, 0);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2822,7 +2822,7 @@ void ScintillaEditView::currentLinesDown() const
|
|||||||
|
|
||||||
void ScintillaEditView::changeCase(__inout wchar_t * const strWToConvert, const int & nbChars, const TextCase & caseToConvert) const
|
void ScintillaEditView::changeCase(__inout wchar_t * const strWToConvert, const int & nbChars, const TextCase & caseToConvert) const
|
||||||
{
|
{
|
||||||
if (strWToConvert == nullptr || nbChars == NULL)
|
if (strWToConvert == nullptr || nbChars == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
switch (caseToConvert)
|
switch (caseToConvert)
|
||||||
@ -2831,7 +2831,7 @@ void ScintillaEditView::changeCase(__inout wchar_t * const strWToConvert, const
|
|||||||
{
|
{
|
||||||
for (int i = 0; i < nbChars; ++i)
|
for (int i = 0; i < nbChars; ++i)
|
||||||
{
|
{
|
||||||
strWToConvert[i] = (WCHAR)(UINT_PTR)::CharUpperW((LPWSTR)strWToConvert[i]);
|
strWToConvert[i] = (WCHAR)(UINT_PTR)::CharUpperW(reinterpret_cast<LPWSTR>(strWToConvert[i]));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
} //case UPPERCASE
|
} //case UPPERCASE
|
||||||
@ -2839,7 +2839,7 @@ void ScintillaEditView::changeCase(__inout wchar_t * const strWToConvert, const
|
|||||||
{
|
{
|
||||||
for (int i = 0; i < nbChars; ++i)
|
for (int i = 0; i < nbChars; ++i)
|
||||||
{
|
{
|
||||||
strWToConvert[i] = (WCHAR)(UINT_PTR)::CharLowerW((LPWSTR)strWToConvert[i]);
|
strWToConvert[i] = (WCHAR)(UINT_PTR)::CharLowerW(reinterpret_cast<LPWSTR>(strWToConvert[i]));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
} //case LOWERCASE
|
} //case LOWERCASE
|
||||||
@ -2851,12 +2851,12 @@ void ScintillaEditView::changeCase(__inout wchar_t * const strWToConvert, const
|
|||||||
if (::IsCharAlphaW(strWToConvert[i]))
|
if (::IsCharAlphaW(strWToConvert[i]))
|
||||||
{
|
{
|
||||||
if ((i < 1) ? true : !::IsCharAlphaNumericW(strWToConvert[i - 1]))
|
if ((i < 1) ? true : !::IsCharAlphaNumericW(strWToConvert[i - 1]))
|
||||||
strWToConvert[i] = (WCHAR)(UINT_PTR)::CharUpperW((LPWSTR)strWToConvert[i]);
|
strWToConvert[i] = (WCHAR)(UINT_PTR)::CharUpperW(reinterpret_cast<LPWSTR>(strWToConvert[i]));
|
||||||
else if (caseToConvert == TITLECASE_FORCE)
|
else if (caseToConvert == TITLECASE_FORCE)
|
||||||
strWToConvert[i] = (WCHAR)(UINT_PTR)::CharLowerW((LPWSTR)strWToConvert[i]);
|
strWToConvert[i] = (WCHAR)(UINT_PTR)::CharLowerW(reinterpret_cast<LPWSTR>(strWToConvert[i]));
|
||||||
//An exception
|
//An exception
|
||||||
if ((i < 2) ? false : (strWToConvert[i - 1] == L'\'' && ::IsCharAlphaW(strWToConvert[i - 2])))
|
if ((i < 2) ? false : (strWToConvert[i - 1] == L'\'' && ::IsCharAlphaW(strWToConvert[i - 2])))
|
||||||
strWToConvert[i] = (WCHAR)(UINT_PTR)::CharLowerW((LPWSTR)strWToConvert[i]);
|
strWToConvert[i] = (WCHAR)(UINT_PTR)::CharLowerW(reinterpret_cast<LPWSTR>(strWToConvert[i]));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -2873,12 +2873,12 @@ void ScintillaEditView::changeCase(__inout wchar_t * const strWToConvert, const
|
|||||||
{
|
{
|
||||||
if (isNewSentence)
|
if (isNewSentence)
|
||||||
{
|
{
|
||||||
strWToConvert[i] = (WCHAR)(UINT_PTR)::CharUpperW((LPWSTR)strWToConvert[i]);
|
strWToConvert[i] = (WCHAR)(UINT_PTR)::CharUpperW(reinterpret_cast<LPWSTR>(strWToConvert[i]));
|
||||||
isNewSentence = false;
|
isNewSentence = false;
|
||||||
}
|
}
|
||||||
else if (caseToConvert == SENTENCECASE_FORCE)
|
else if (caseToConvert == SENTENCECASE_FORCE)
|
||||||
{
|
{
|
||||||
strWToConvert[i] = (WCHAR)(UINT_PTR)::CharLowerW((LPWSTR)strWToConvert[i]);
|
strWToConvert[i] = (WCHAR)(UINT_PTR)::CharLowerW(reinterpret_cast<LPWSTR>(strWToConvert[i]));
|
||||||
}
|
}
|
||||||
wasEolR = false;
|
wasEolR = false;
|
||||||
wasEolN = false;
|
wasEolN = false;
|
||||||
@ -2919,9 +2919,9 @@ void ScintillaEditView::changeCase(__inout wchar_t * const strWToConvert, const
|
|||||||
for (int i = 0; i < nbChars; ++i)
|
for (int i = 0; i < nbChars; ++i)
|
||||||
{
|
{
|
||||||
if (::IsCharLowerW(strWToConvert[i]))
|
if (::IsCharLowerW(strWToConvert[i]))
|
||||||
strWToConvert[i] = (WCHAR)(UINT_PTR)::CharUpperW((LPWSTR)strWToConvert[i]);
|
strWToConvert[i] = (WCHAR)(UINT_PTR)::CharUpperW(reinterpret_cast<LPWSTR>(strWToConvert[i]));
|
||||||
else
|
else
|
||||||
strWToConvert[i] = (WCHAR)(UINT_PTR)::CharLowerW((LPWSTR)strWToConvert[i]);
|
strWToConvert[i] = (WCHAR)(UINT_PTR)::CharLowerW(reinterpret_cast<LPWSTR>(strWToConvert[i]));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
} //case INVERTCASE
|
} //case INVERTCASE
|
||||||
@ -2932,9 +2932,9 @@ void ScintillaEditView::changeCase(__inout wchar_t * const strWToConvert, const
|
|||||||
if (::IsCharAlphaW(strWToConvert[i]))
|
if (::IsCharAlphaW(strWToConvert[i]))
|
||||||
{
|
{
|
||||||
if (std::rand() & true)
|
if (std::rand() & true)
|
||||||
strWToConvert[i] = (WCHAR)(UINT_PTR)::CharUpperW((LPWSTR)strWToConvert[i]);
|
strWToConvert[i] = (WCHAR)(UINT_PTR)::CharUpperW(reinterpret_cast<LPWSTR>(strWToConvert[i]));
|
||||||
else
|
else
|
||||||
strWToConvert[i] = (WCHAR)(UINT_PTR)::CharLowerW((LPWSTR)strWToConvert[i]);
|
strWToConvert[i] = (WCHAR)(UINT_PTR)::CharLowerW(reinterpret_cast<LPWSTR>(strWToConvert[i]));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -222,7 +222,7 @@ void Utf8_16_Read::determineEncoding()
|
|||||||
m_nSkip = 3;
|
m_nSkip = 3;
|
||||||
}
|
}
|
||||||
// try to detect UTF-16 little-endian without BOM
|
// try to detect UTF-16 little-endian without BOM
|
||||||
else if (m_nLen > 1 && m_nLen % 2 == 0 && m_pBuf[0] != NULL && m_pBuf[1] == NULL && IsTextUnicode(m_pBuf, static_cast<int32_t>(m_nLen), &uniTest))
|
else if (m_nLen > 1 && m_nLen % 2 == 0 && m_pBuf[0] != 0 && m_pBuf[1] == 0 && IsTextUnicode(m_pBuf, static_cast<int32_t>(m_nLen), &uniTest))
|
||||||
{
|
{
|
||||||
m_eEncoding = uni16LE_NoBOM;
|
m_eEncoding = uni16LE_NoBOM;
|
||||||
m_nSkip = 0;
|
m_nSkip = 0;
|
||||||
|
@ -745,7 +745,7 @@ BrowserNodeType FileBrowser::getNodeType(HTREEITEM hItem)
|
|||||||
return browserNodeType_file;
|
return browserNodeType_file;
|
||||||
}
|
}
|
||||||
// Root
|
// Root
|
||||||
else if (tvItem.lParam != NULL && !reinterpret_cast<SortingData4lParam*>(tvItem.lParam)->_rootPath.empty())
|
else if (tvItem.lParam && !reinterpret_cast<SortingData4lParam*>(tvItem.lParam)->_rootPath.empty())
|
||||||
{
|
{
|
||||||
return browserNodeType_root;
|
return browserNodeType_root;
|
||||||
}
|
}
|
||||||
|
@ -1119,7 +1119,7 @@ INT_PTR CALLBACK ShortcutMapper::run_dlgProc(UINT message, WPARAM wParam, LPARAM
|
|||||||
bool ShortcutMapper::findKeyConflicts(__inout_opt generic_string * const keyConflictLocation,
|
bool ShortcutMapper::findKeyConflicts(__inout_opt generic_string * const keyConflictLocation,
|
||||||
const KeyCombo & itemKeyComboToTest, const size_t & itemIndexToTest) const
|
const KeyCombo & itemKeyComboToTest, const size_t & itemIndexToTest) const
|
||||||
{
|
{
|
||||||
if (itemKeyComboToTest._key == NULL) //no key assignment
|
if (itemKeyComboToTest._key == 0) //no key assignment
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
bool retIsConflict = false; //returns true when a conflict is found
|
bool retIsConflict = false; //returns true when a conflict is found
|
||||||
|
@ -510,7 +510,7 @@ void ProjectPanel::buildProjectXml(TiXmlNode *node, HTREEITEM hItem, const TCHAR
|
|||||||
{
|
{
|
||||||
tvItem.hItem = hItemNode;
|
tvItem.hItem = hItemNode;
|
||||||
SendMessage(_treeView.getHSelf(), TVM_GETITEM, 0, reinterpret_cast<LPARAM>(&tvItem));
|
SendMessage(_treeView.getHSelf(), TVM_GETITEM, 0, reinterpret_cast<LPARAM>(&tvItem));
|
||||||
if (tvItem.lParam != NULL)
|
if (tvItem.lParam)
|
||||||
{
|
{
|
||||||
generic_string *fn = (generic_string *)tvItem.lParam;
|
generic_string *fn = (generic_string *)tvItem.lParam;
|
||||||
generic_string newFn = getRelativePath(*fn, fn2write);
|
generic_string newFn = getRelativePath(*fn, fn2write);
|
||||||
@ -871,7 +871,7 @@ NodeType ProjectPanel::getNodeType(HTREEITEM hItem)
|
|||||||
return nodeType_project;
|
return nodeType_project;
|
||||||
}
|
}
|
||||||
// Folder
|
// Folder
|
||||||
else if (tvItem.lParam == NULL)
|
else if (!tvItem.lParam)
|
||||||
{
|
{
|
||||||
return nodeType_folder;
|
return nodeType_folder;
|
||||||
}
|
}
|
||||||
|
@ -39,7 +39,7 @@ void expandNppEnvironmentStrs(const TCHAR *strSrc, TCHAR *stringDest, size_t str
|
|||||||
class Command {
|
class Command {
|
||||||
public :
|
public :
|
||||||
Command() = default;
|
Command() = default;
|
||||||
explicit Command(TCHAR *cmd) : _cmdLine(cmd){};
|
explicit Command(const TCHAR *cmd) : _cmdLine(cmd){};
|
||||||
explicit Command(const generic_string& cmd) : _cmdLine(cmd){};
|
explicit Command(const generic_string& cmd) : _cmdLine(cmd){};
|
||||||
HINSTANCE run(HWND hWnd);
|
HINSTANCE run(HWND hWnd);
|
||||||
HINSTANCE run(HWND hWnd, const TCHAR* cwd);
|
HINSTANCE run(HWND hWnd, const TCHAR* cwd);
|
||||||
|
@ -25,7 +25,7 @@ StaticDialog::~StaticDialog()
|
|||||||
if (isCreated())
|
if (isCreated())
|
||||||
{
|
{
|
||||||
// Prevent run_dlgProc from doing anything, since its virtual
|
// Prevent run_dlgProc from doing anything, since its virtual
|
||||||
::SetWindowLongPtr(_hSelf, GWLP_USERDATA, NULL);
|
::SetWindowLongPtr(_hSelf, GWLP_USERDATA, 0);
|
||||||
destroy();
|
destroy();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user