Use C++ conversion instead of C style cast
This commit is contained in:
parent
797765173d
commit
30bd15f04a
@ -513,7 +513,7 @@ const char * WcharMbcsConvertor::wchar2char(const wchar_t * wcharStr2Convert, UI
|
||||
_multiByteStr.sizeTo(len);
|
||||
len = WideCharToMultiByte(codepage, 0, wcharStr2Convert, -1, _multiByteStr, len, NULL, NULL); // not needed?
|
||||
|
||||
if ((int)*mstart < lstrlenW(wcharStr2Convert) && (int)*mend < lstrlenW(wcharStr2Convert))
|
||||
if (*mstart < lstrlenW(wcharStr2Convert) && *mend < lstrlenW(wcharStr2Convert))
|
||||
{
|
||||
*mstart = WideCharToMultiByte(codepage, 0, wcharStr2Convert, *mstart, NULL, 0, NULL, NULL);
|
||||
*mend = WideCharToMultiByte(codepage, 0, wcharStr2Convert, *mend, NULL, 0, NULL, NULL);
|
||||
|
@ -332,12 +332,12 @@ LRESULT Notepad_plus::init(HWND hwnd)
|
||||
|
||||
if (_toReduceTabBar)
|
||||
{
|
||||
HFONT hf = (HFONT)::GetStockObject(DEFAULT_GUI_FONT);
|
||||
HFONT hf = reinterpret_cast<HFONT>(::GetStockObject(DEFAULT_GUI_FONT));
|
||||
|
||||
if (hf)
|
||||
{
|
||||
::SendMessage(_mainDocTab.getHSelf(), WM_SETFONT, (WPARAM)hf, MAKELPARAM(TRUE, 0));
|
||||
::SendMessage(_subDocTab.getHSelf(), WM_SETFONT, (WPARAM)hf, MAKELPARAM(TRUE, 0));
|
||||
::SendMessage(_mainDocTab.getHSelf(), WM_SETFONT, reinterpret_cast<WPARAM>(hf), MAKELPARAM(TRUE, 0));
|
||||
::SendMessage(_subDocTab.getHSelf(), WM_SETFONT, reinterpret_cast<WPARAM>(hf), MAKELPARAM(TRUE, 0));
|
||||
}
|
||||
int tabDpiDynamicalHeight = NppParameters::getInstance()->_dpiManager.scaleY(22);
|
||||
int tabDpiDynamicalWidth = NppParameters::getInstance()->_dpiManager.scaleX(45);
|
||||
@ -418,15 +418,15 @@ LRESULT Notepad_plus::init(HWND hwnd)
|
||||
size_t const posBase = 6;
|
||||
size_t nbMacro = macros.size();
|
||||
if (nbMacro >= 1)
|
||||
::InsertMenu(hMacroMenu, posBase - 1, MF_BYPOSITION, (unsigned int)-1, 0);
|
||||
::InsertMenu(hMacroMenu, posBase - 1, MF_BYPOSITION, static_cast<UINT>(-1), 0);
|
||||
|
||||
for (size_t i = 0 ; i < nbMacro ; ++i)
|
||||
::InsertMenu(hMacroMenu, UINT(posBase + i), MF_BYPOSITION, ID_MACRO + i, macros[i].toMenuItemString().c_str());
|
||||
::InsertMenu(hMacroMenu, static_cast<UINT>(posBase + i), MF_BYPOSITION, ID_MACRO + i, macros[i].toMenuItemString().c_str());
|
||||
|
||||
if (nbMacro >= 1)
|
||||
{
|
||||
::InsertMenu(hMacroMenu, UINT(posBase + nbMacro + 1), MF_BYPOSITION, (unsigned int)-1, 0);
|
||||
::InsertMenu(hMacroMenu, UINT(posBase + nbMacro + 2), MF_BYCOMMAND, IDM_SETTING_SHORTCUT_MAPPER_MACRO, TEXT("Modify Shortcut/Delete Macro..."));
|
||||
::InsertMenu(hMacroMenu, static_cast<UINT>(posBase + nbMacro + 1), MF_BYPOSITION, static_cast<UINT>(-1), 0);
|
||||
::InsertMenu(hMacroMenu, static_cast<UINT>(posBase + nbMacro + 2), MF_BYCOMMAND, IDM_SETTING_SHORTCUT_MAPPER_MACRO, TEXT("Modify Shortcut/Delete Macro..."));
|
||||
}
|
||||
|
||||
// Run Menu
|
||||
@ -435,17 +435,17 @@ LRESULT Notepad_plus::init(HWND hwnd)
|
||||
int const runPosBase = 2;
|
||||
size_t nbUserCommand = userCommands.size();
|
||||
if (nbUserCommand >= 1)
|
||||
::InsertMenu(hRunMenu, runPosBase - 1, MF_BYPOSITION, (unsigned int)-1, 0);
|
||||
::InsertMenu(hRunMenu, runPosBase - 1, MF_BYPOSITION, static_cast<UINT>(-1), 0);
|
||||
|
||||
for (size_t i = 0 ; i < nbUserCommand ; ++i)
|
||||
{
|
||||
::InsertMenu(hRunMenu, UINT(runPosBase + i), MF_BYPOSITION, ID_USER_CMD + i, userCommands[i].toMenuItemString().c_str());
|
||||
::InsertMenu(hRunMenu, static_cast<UINT>(runPosBase + i), MF_BYPOSITION, ID_USER_CMD + i, userCommands[i].toMenuItemString().c_str());
|
||||
}
|
||||
|
||||
if (nbUserCommand >= 1)
|
||||
{
|
||||
::InsertMenu(hRunMenu, UINT(runPosBase + nbUserCommand + 1), MF_BYPOSITION, (unsigned int)-1, 0);
|
||||
::InsertMenu(hRunMenu, UINT(runPosBase + nbUserCommand + 2), MF_BYCOMMAND, IDM_SETTING_SHORTCUT_MAPPER_RUN, TEXT("Modify Shortcut/Delete Command..."));
|
||||
::InsertMenu(hRunMenu, static_cast<UINT>(runPosBase + nbUserCommand + 1), MF_BYPOSITION, static_cast<UINT>(-1), 0);
|
||||
::InsertMenu(hRunMenu, static_cast<UINT>(runPosBase + nbUserCommand + 2), MF_BYCOMMAND, IDM_SETTING_SHORTCUT_MAPPER_RUN, TEXT("Modify Shortcut/Delete Command..."));
|
||||
}
|
||||
|
||||
// Updater menu item
|
||||
@ -2935,11 +2935,11 @@ size_t Notepad_plus::getCurrentDocCharCount(UniMode u)
|
||||
if (u != uniUTF8 && u != uniCookie)
|
||||
{
|
||||
size_t numLines = _pEditView->execute(SCI_GETLINECOUNT);
|
||||
size_t result = _pEditView->execute(SCI_GETLENGTH);
|
||||
auto result = _pEditView->execute(SCI_GETLENGTH);
|
||||
size_t lines = numLines==0?0:numLines-1;
|
||||
if (_pEditView->execute(SCI_GETEOLMODE) == SC_EOL_CRLF) lines *= 2;
|
||||
result -= lines;
|
||||
return ((int)result < 0) ? 0 : result;
|
||||
return (result < 0) ? 0 : result;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -4072,10 +4072,10 @@ bool Notepad_plus::addCurrentMacro()
|
||||
int const posBase = 6; //separator at index 5
|
||||
if (nbMacro == 0)
|
||||
{
|
||||
::InsertMenu(hMacroMenu, posBase-1, MF_BYPOSITION, (unsigned int)-1, 0); //no separator yet, add one
|
||||
::InsertMenu(hMacroMenu, posBase-1, MF_BYPOSITION, static_cast<UINT>(-1), 0); //no separator yet, add one
|
||||
|
||||
// Insert the separator and modify/delete command
|
||||
::InsertMenu(hMacroMenu, posBase + nbMacro + 1, MF_BYPOSITION, (unsigned int)-1, 0);
|
||||
::InsertMenu(hMacroMenu, posBase + nbMacro + 1, MF_BYPOSITION, static_cast<UINT>(-1), 0);
|
||||
|
||||
NativeLangSpeaker *pNativeLangSpeaker = nppParams->getNativeLangSpeaker();
|
||||
generic_string nativeLangShortcutMapperMacro = pNativeLangSpeaker->getNativeLangMenuString(IDM_SETTING_SHORTCUT_MAPPER_MACRO);
|
||||
@ -4100,22 +4100,20 @@ void Notepad_plus::changeToolBarIcons()
|
||||
|
||||
bool Notepad_plus::switchToFile(BufferID id)
|
||||
{
|
||||
int i = 0;
|
||||
int iView = currentView();
|
||||
if (id == BUFFER_INVALID)
|
||||
return false;
|
||||
|
||||
if ((i = _pDocTab->getIndexByBuffer(id)) != -1)
|
||||
int i = _pDocTab->getIndexByBuffer(id);
|
||||
if (i != -1)
|
||||
{
|
||||
iView = currentView();
|
||||
}
|
||||
else if ((i = _pNonDocTab->getIndexByBuffer(id)) != -1)
|
||||
{
|
||||
iView = otherView();
|
||||
}
|
||||
|
||||
|
||||
i = _pNonDocTab->getIndexByBuffer(id);
|
||||
if (i != -1)
|
||||
{
|
||||
iView = otherView();
|
||||
|
||||
switchEditViewTo(iView);
|
||||
activateBuffer(id, currentView());
|
||||
return true;
|
||||
@ -4406,7 +4404,7 @@ void Notepad_plus::postItToggle()
|
||||
NppParameters * pNppParam = NppParameters::getInstance();
|
||||
if (!_beforeSpecialView.isPostIt) // PostIt disabled, enable it
|
||||
{
|
||||
NppGUI & nppGUI = (NppGUI &)pNppParam->getNppGUI();
|
||||
NppGUI & nppGUI = const_cast<NppGUI &>(pNppParam->getNppGUI());
|
||||
// get current status before switch to postIt
|
||||
//check these always
|
||||
{
|
||||
@ -4752,9 +4750,6 @@ void Notepad_plus::notifyBufferChanged(Buffer * buffer, int mask)
|
||||
switch(buffer->getStatus())
|
||||
{
|
||||
case DOC_UNNAMED: //nothing todo
|
||||
{
|
||||
break;
|
||||
}
|
||||
case DOC_REGULAR: //nothing todo
|
||||
{
|
||||
break;
|
||||
@ -5960,7 +5955,7 @@ bool isInList(int elem, vector<int> elemList)
|
||||
DWORD WINAPI Notepad_plus::threadTextPlayer(void *params)
|
||||
{
|
||||
// random seed generation needs only one time.
|
||||
srand((unsigned int)time(NULL));
|
||||
srand(static_cast<UINT>(time(NULL)));
|
||||
|
||||
TextPlayerParams* textPlayerParams = static_cast<TextPlayerParams*>(params);
|
||||
HWND hNpp = textPlayerParams->_nppHandle;
|
||||
@ -6078,7 +6073,7 @@ DWORD WINAPI Notepad_plus::threadTextTroller(void *params)
|
||||
WaitForSingleObject(textTrollerParams->_mutex, INFINITE);
|
||||
|
||||
// random seed generation needs only one time.
|
||||
srand((unsigned int)time(NULL));
|
||||
srand(static_cast<UINT>(time(NULL)));
|
||||
|
||||
ScintillaEditView *pCurrentView = textTrollerParams->_pCurrentView;
|
||||
const char *text2display = textTrollerParams->_text2display;
|
||||
@ -6203,7 +6198,7 @@ int Notepad_plus::getQuoteIndexFrom(const char *quoter) const
|
||||
|
||||
if (stricmp(quoter, "random") == 0)
|
||||
{
|
||||
srand((unsigned int)time(NULL));
|
||||
srand(static_cast<UINT>(time(NULL)));
|
||||
return getRandomNumber(nbQuote);
|
||||
}
|
||||
|
||||
@ -6445,20 +6440,20 @@ bool Notepad_plus::undoStreamComment()
|
||||
if (selectionStart > posStartComment)
|
||||
{
|
||||
if (selectionStart >= posStartComment+startCommentLength)
|
||||
selectionStartMove = -(int)startCommentLength;
|
||||
selectionStartMove = -static_cast<int>(startCommentLength);
|
||||
else
|
||||
selectionStartMove = -(int)(selectionStart - posStartComment);
|
||||
selectionStartMove = -static_cast<int>(selectionStart - posStartComment);
|
||||
}
|
||||
else
|
||||
selectionStartMove = 0;
|
||||
|
||||
// selectionEnd
|
||||
if (selectionEnd >= posEndComment+endCommentLength)
|
||||
selectionEndMove = -(int)(startCommentLength+endCommentLength);
|
||||
selectionEndMove = -static_cast<int>(startCommentLength+endCommentLength);
|
||||
else if (selectionEnd <= posEndComment)
|
||||
selectionEndMove = -(int)startCommentLength;
|
||||
selectionEndMove = -static_cast<int>(startCommentLength);
|
||||
else
|
||||
selectionEndMove = -(int)(startCommentLength + (selectionEnd - posEndComment));
|
||||
selectionEndMove = -static_cast<int>(startCommentLength + (selectionEnd - posEndComment));
|
||||
|
||||
//-- Reset selection of text without deleted stream-comment-string
|
||||
if (move_caret)
|
||||
|
@ -82,7 +82,7 @@ LRESULT CALLBACK Notepad_plus_Window::Notepad_plus_Proc(HWND hwnd, UINT Message,
|
||||
{
|
||||
// First message we get the ptr of instantiated object
|
||||
// then stock it into GWLP_USERDATA index in order to retrieve afterward
|
||||
Notepad_plus_Window *pM30ide = (Notepad_plus_Window *)(((LPCREATESTRUCT)lParam)->lpCreateParams);
|
||||
Notepad_plus_Window *pM30ide = reinterpret_cast<Notepad_plus_Window *>((reinterpret_cast<LPCREATESTRUCT>(lParam))->lpCreateParams);
|
||||
pM30ide->_hSelf = hwnd;
|
||||
::SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG_PTR)pM30ide);
|
||||
return TRUE;
|
||||
@ -90,7 +90,7 @@ LRESULT CALLBACK Notepad_plus_Window::Notepad_plus_Proc(HWND hwnd, UINT Message,
|
||||
|
||||
default:
|
||||
{
|
||||
return ((Notepad_plus_Window *)::GetWindowLongPtr(hwnd, GWLP_USERDATA))->runProc(hwnd, Message, wParam, lParam);
|
||||
return (reinterpret_cast<Notepad_plus_Window *>(::GetWindowLongPtr(hwnd, GWLP_USERDATA))->runProc(hwnd, Message, wParam, lParam));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -140,7 +140,7 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPa
|
||||
|
||||
case WM_DRAWITEM:
|
||||
{
|
||||
DRAWITEMSTRUCT *dis = (DRAWITEMSTRUCT *)lParam;
|
||||
DRAWITEMSTRUCT *dis = reinterpret_cast<DRAWITEMSTRUCT *>(lParam);
|
||||
if (dis->CtlType == ODT_TAB)
|
||||
return ::SendMessage(dis->hwndItem, WM_DRAWITEM, wParam, lParam);
|
||||
break;
|
||||
@ -160,7 +160,7 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPa
|
||||
|
||||
case WM_REMOVE_USERLANG:
|
||||
{
|
||||
TCHAR *userLangName = (TCHAR *)lParam;
|
||||
TCHAR *userLangName = reinterpret_cast<TCHAR *>(lParam);
|
||||
if (!userLangName || !userLangName[0])
|
||||
return FALSE;
|
||||
|
||||
@ -178,11 +178,11 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPa
|
||||
|
||||
case WM_RENAME_USERLANG:
|
||||
{
|
||||
if (!lParam || !(((TCHAR *)lParam)[0]) || !wParam || !(((TCHAR *)wParam)[0]))
|
||||
if (!lParam || !((reinterpret_cast<TCHAR *>(lParam))[0]) || !wParam || !((reinterpret_cast<TCHAR *>(wParam))[0]))
|
||||
return FALSE;
|
||||
|
||||
generic_string oldName{(TCHAR *)lParam};
|
||||
generic_string newName{(TCHAR *)wParam};
|
||||
generic_string oldName{ reinterpret_cast<TCHAR *>(lParam) };
|
||||
generic_string newName{ reinterpret_cast<TCHAR *>(wParam) };
|
||||
|
||||
//loop through buffers and reset the language (L_USER, newName) if (L_USER, oldName)
|
||||
for (size_t i = 0; i < MainFileManager->getNrBuffers(); ++i)
|
||||
@ -225,19 +225,14 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPa
|
||||
|
||||
case WM_FINDALL_INCURRENTFINDER:
|
||||
{
|
||||
FindersInfo *findInFolderInfo = (FindersInfo *)wParam;
|
||||
FindersInfo *findInFolderInfo = reinterpret_cast<FindersInfo *>(wParam);
|
||||
Finder * newFinder = _findReplaceDlg.createFinder();
|
||||
|
||||
findInFolderInfo->_pDestFinder = newFinder;
|
||||
bool isOK = findInFinderFiles(findInFolderInfo);
|
||||
return isOK;
|
||||
}
|
||||
/*
|
||||
case NPPM_INTERNAL_REMOVEFINDER:
|
||||
{
|
||||
return _findReplaceDlg.removeFinder((Finder *)wParam);
|
||||
}
|
||||
*/
|
||||
|
||||
case WM_REPLACEINFILES:
|
||||
{
|
||||
replaceInFiles();
|
||||
@ -258,7 +253,7 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPa
|
||||
if (isFirstTime)
|
||||
_nativeLangSpeaker.changeDlgLang(_findReplaceDlg.getHSelf(), "Find");
|
||||
_findReplaceDlg.launchFindInFilesDlg();
|
||||
setFindReplaceFolderFilter((const TCHAR*) wParam, (const TCHAR*) lParam);
|
||||
setFindReplaceFolderFilter(reinterpret_cast<const TCHAR*>(wParam), reinterpret_cast<const TCHAR*>(lParam));
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
@ -267,7 +262,7 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPa
|
||||
{
|
||||
const int strSize = FINDREPLACE_MAXLENGTH;
|
||||
TCHAR str[strSize];
|
||||
Finder *launcher = (Finder *)wParam;
|
||||
Finder *launcher = reinterpret_cast<Finder *>(wParam);
|
||||
|
||||
bool isFirstTime = not _findInFinderDlg.isCreated();
|
||||
|
||||
@ -286,7 +281,7 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPa
|
||||
case NPPM_DOOPEN:
|
||||
case WM_DOOPEN:
|
||||
{
|
||||
BufferID id = doOpen((const TCHAR *)lParam);
|
||||
BufferID id = doOpen(reinterpret_cast<const TCHAR *>(lParam));
|
||||
if (id != BUFFER_INVALID)
|
||||
return switchToFile(id);
|
||||
break;
|
||||
@ -299,7 +294,7 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPa
|
||||
BufferID id = (BufferID)wParam;
|
||||
Buffer * b = MainFileManager->getBufferByID(id);
|
||||
if (b && b->getStatus() == DOC_UNNAMED) {
|
||||
b->setFileName((const TCHAR*)lParam);
|
||||
b->setFileName(reinterpret_cast<const TCHAR*>(lParam));
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
@ -386,29 +381,29 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPa
|
||||
else if (lParam == SUB_VIEW)
|
||||
pView = &_subDocTab;
|
||||
else
|
||||
return (LRESULT)BUFFER_INVALID;
|
||||
return reinterpret_cast<LRESULT>(BUFFER_INVALID);
|
||||
|
||||
if ((size_t)wParam < pView->nbItem())
|
||||
return (LRESULT)(pView->getBufferByIndex((int)wParam));
|
||||
return reinterpret_cast<LRESULT>(pView->getBufferByIndex(wParam));
|
||||
|
||||
return (LRESULT)BUFFER_INVALID;
|
||||
return reinterpret_cast<LRESULT>(BUFFER_INVALID);
|
||||
}
|
||||
|
||||
case NPPM_GETCURRENTBUFFERID:
|
||||
{
|
||||
return (LRESULT)(_pEditView->getCurrentBufferID());
|
||||
return reinterpret_cast<LRESULT>(_pEditView->getCurrentBufferID());
|
||||
}
|
||||
|
||||
case NPPM_RELOADBUFFERID:
|
||||
{
|
||||
if (!wParam)
|
||||
return FALSE;
|
||||
return doReload((BufferID)wParam, lParam != 0);
|
||||
return doReload(reinterpret_cast<BufferID>(wParam), lParam != 0);
|
||||
}
|
||||
|
||||
case NPPM_RELOADFILE:
|
||||
{
|
||||
BufferID id = MainFileManager->getBufferFromName((const TCHAR *)lParam);
|
||||
BufferID id = MainFileManager->getBufferFromName(reinterpret_cast<const TCHAR *>(lParam));
|
||||
if (id != BUFFER_INVALID)
|
||||
doReload(id, wParam != 0);
|
||||
break;
|
||||
@ -416,7 +411,7 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPa
|
||||
|
||||
case NPPM_SWITCHTOFILE :
|
||||
{
|
||||
BufferID id = MainFileManager->getBufferFromName((const TCHAR *)lParam);
|
||||
BufferID id = MainFileManager->getBufferFromName(reinterpret_cast<const TCHAR *>(lParam));
|
||||
if (id != BUFFER_INVALID)
|
||||
return switchToFile(id);
|
||||
return false;
|
||||
@ -431,7 +426,7 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPa
|
||||
{
|
||||
BufferID currentBufferID = _pEditView->getCurrentBufferID();
|
||||
bool asCopy = wParam == TRUE;
|
||||
const TCHAR *filename = (const TCHAR *)lParam;
|
||||
const TCHAR *filename = reinterpret_cast<const TCHAR *>(lParam);
|
||||
if (!filename) return FALSE;
|
||||
return doSave(currentBufferID, filename, asCopy);
|
||||
}
|
||||
@ -443,7 +438,7 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPa
|
||||
|
||||
case NPPM_SAVEFILE:
|
||||
{
|
||||
return fileSaveSpecific((const TCHAR *)lParam);
|
||||
return fileSaveSpecific(reinterpret_cast<const TCHAR *>(lParam));
|
||||
}
|
||||
|
||||
case NPPM_GETCURRENTNATIVELANGENCODING:
|
||||
@ -458,15 +453,15 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPa
|
||||
// Notify plugins that current file is about to be closed
|
||||
SCNotification scnN;
|
||||
scnN.nmhdr.code = NPPN_DOCORDERCHANGED;
|
||||
scnN.nmhdr.hwndFrom = (void *)lParam;
|
||||
scnN.nmhdr.idFrom = (uptr_t)id;
|
||||
scnN.nmhdr.hwndFrom = reinterpret_cast<void *>(lParam);
|
||||
scnN.nmhdr.idFrom = reinterpret_cast<uptr_t>(id);
|
||||
_pluginsManager.notify(&scnN);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
case NPPM_DISABLEAUTOUPDATE:
|
||||
{
|
||||
NppGUI & nppGUI = (NppGUI &)pNppParam->getNppGUI();
|
||||
NppGUI & nppGUI = const_cast<NppGUI &>(pNppParam->getNppGUI());
|
||||
nppGUI._autoUpdateOpt._doAutoUpdate = false;
|
||||
return TRUE;
|
||||
}
|
||||
@ -523,7 +518,7 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPa
|
||||
|
||||
case WM_COPYDATA:
|
||||
{
|
||||
COPYDATASTRUCT *pCopyData = (COPYDATASTRUCT *)lParam;
|
||||
COPYDATASTRUCT *pCopyData = reinterpret_cast<COPYDATASTRUCT *>(lParam);
|
||||
|
||||
switch (pCopyData->dwData)
|
||||
{
|
||||
@ -549,7 +544,7 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPa
|
||||
|
||||
case COPYDATA_FILENAMESA:
|
||||
{
|
||||
char *fileNamesA = (char *)pCopyData->lpData;
|
||||
char *fileNamesA = reinterpret_cast<char *>(pCopyData->lpData);
|
||||
CmdLineParams & cmdLineParams = pNppParam->getCmdLineParams();
|
||||
WcharMbcsConvertor *wmc = WcharMbcsConvertor::getInstance();
|
||||
const wchar_t *fileNamesW = wmc->char2wchar(fileNamesA, CP_ACP);
|
||||
@ -559,7 +554,7 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPa
|
||||
|
||||
case COPYDATA_FILENAMESW:
|
||||
{
|
||||
wchar_t *fileNamesW = (wchar_t *)pCopyData->lpData;
|
||||
wchar_t *fileNamesW = reinterpret_cast<wchar_t *>(pCopyData->lpData);
|
||||
CmdLineParams & cmdLineParams = pNppParam->getCmdLineParams();
|
||||
loadCommandlineParams(fileNamesW, &cmdLineParams);
|
||||
break;
|
||||
@ -621,7 +616,7 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPa
|
||||
{
|
||||
SCNotification scnN;
|
||||
scnN.nmhdr.code = NPPN_SHORTCUTREMAPPED;
|
||||
scnN.nmhdr.hwndFrom = (void *)lParam; // ShortcutKey structure
|
||||
scnN.nmhdr.hwndFrom = reinterpret_cast<void *>(lParam); // ShortcutKey structure
|
||||
scnN.nmhdr.idFrom = (uptr_t)wParam; // cmdID
|
||||
_pluginsManager.notify(&scnN);
|
||||
return TRUE;
|
||||
@ -630,7 +625,7 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPa
|
||||
case NPPM_GETSHORTCUTBYCMDID:
|
||||
{
|
||||
int cmdID = static_cast<int32_t>(wParam); // cmdID
|
||||
ShortcutKey *sk = (ShortcutKey *)lParam; // ShortcutKey structure
|
||||
ShortcutKey *sk = reinterpret_cast<ShortcutKey *>(lParam); // ShortcutKey structure
|
||||
|
||||
return _pluginsManager.getShortcutByCmdID(cmdID, sk);
|
||||
}
|
||||
@ -674,7 +669,7 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPa
|
||||
}
|
||||
}
|
||||
|
||||
lstrcpy((TCHAR *)lParam, fileStr);
|
||||
lstrcpy(reinterpret_cast<TCHAR *>(lParam), fileStr);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@ -682,8 +677,8 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPa
|
||||
{
|
||||
const int strSize = CURRENTWORD_MAXLENGTH;
|
||||
TCHAR str[strSize];
|
||||
|
||||
_pEditView->getGenericSelectedText((TCHAR *)str, strSize);
|
||||
TCHAR *pTchar = reinterpret_cast<TCHAR *>(lParam);
|
||||
_pEditView->getGenericSelectedText(str, strSize);
|
||||
// For the compability reason, if wParam is 0, then we assume the size of generic_string buffer (lParam) is large enough.
|
||||
// otherwise we check if the generic_string buffer size is enough for the generic_string to copy.
|
||||
if (wParam != 0)
|
||||
@ -695,12 +690,12 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPa
|
||||
}
|
||||
else //buffer large enough, perform safe copy
|
||||
{
|
||||
lstrcpyn((TCHAR *)lParam, str, static_cast<int32_t>(wParam));
|
||||
lstrcpyn(pTchar, str, static_cast<int32_t>(wParam));
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
lstrcpy((TCHAR *)lParam, str);
|
||||
lstrcpy(pTchar, str);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@ -723,7 +718,7 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPa
|
||||
}
|
||||
}
|
||||
|
||||
lstrcpy((TCHAR *)lParam, str);
|
||||
lstrcpy(reinterpret_cast<TCHAR *>(lParam), str);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@ -739,24 +734,25 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPa
|
||||
|
||||
case NPPM_GETCURRENTSCINTILLA:
|
||||
{
|
||||
int *id = reinterpret_cast<int *>(lParam);
|
||||
if (_pEditView == &_mainEditView)
|
||||
*((int *)lParam) = MAIN_VIEW;
|
||||
*id = MAIN_VIEW;
|
||||
else if (_pEditView == &_subEditView)
|
||||
*((int *)lParam) = SUB_VIEW;
|
||||
*id = SUB_VIEW;
|
||||
else
|
||||
*((int *)lParam) = -1;
|
||||
*id = -1;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
case NPPM_GETCURRENTLANGTYPE:
|
||||
{
|
||||
*((LangType *)lParam) = _pEditView->getCurrentBuffer()->getLangType();
|
||||
*(reinterpret_cast<LangType *>(lParam)) = _pEditView->getCurrentBuffer()->getLangType();
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
case NPPM_SETCURRENTLANGTYPE:
|
||||
{
|
||||
_pEditView->getCurrentBuffer()->setLangType((LangType)lParam);
|
||||
_pEditView->getCurrentBuffer()->setLangType(static_cast<LangType>(lParam));
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@ -779,7 +775,7 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPa
|
||||
if (!wParam)
|
||||
return 0;
|
||||
|
||||
TCHAR** fileNames = (TCHAR**) wParam;
|
||||
TCHAR** fileNames = reinterpret_cast<TCHAR**>(wParam);
|
||||
size_t nbFileNames = static_cast<size_t>(lParam);
|
||||
|
||||
size_t j = 0;
|
||||
@ -880,7 +876,7 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPa
|
||||
|
||||
case NPPM_GETNBSESSIONFILES:
|
||||
{
|
||||
const TCHAR *sessionFileName = (const TCHAR *)lParam;
|
||||
const TCHAR *sessionFileName = reinterpret_cast<const TCHAR *>(lParam);
|
||||
if ((!sessionFileName) || (sessionFileName[0] == '\0'))
|
||||
return 0;
|
||||
Session session2Load;
|
||||
@ -891,8 +887,8 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPa
|
||||
|
||||
case NPPM_GETSESSIONFILES:
|
||||
{
|
||||
const TCHAR *sessionFileName = (const TCHAR *)lParam;
|
||||
TCHAR **sessionFileArray = (TCHAR **)wParam;
|
||||
const TCHAR *sessionFileName = reinterpret_cast<const TCHAR *>(lParam);
|
||||
TCHAR **sessionFileArray = reinterpret_cast<TCHAR **>(wParam);
|
||||
|
||||
if ((!sessionFileName) || (sessionFileName[0] == '\0'))
|
||||
return FALSE;
|
||||
@ -1068,7 +1064,7 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPa
|
||||
|
||||
case WM_FRSAVE_STR:
|
||||
{
|
||||
_macro.push_back(recordedMacroStep(static_cast<int32_t>(wParam), 0, 0, (const TCHAR *)lParam, recordedMacroStep::mtSavedSnR));
|
||||
_macro.push_back(recordedMacroStep(static_cast<int32_t>(wParam), 0, 0, reinterpret_cast<const TCHAR *>(lParam), recordedMacroStep::mtSavedSnR));
|
||||
break;
|
||||
}
|
||||
|
||||
@ -1164,7 +1160,7 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPa
|
||||
case NPPM_GETNBUSERLANG:
|
||||
{
|
||||
if (lParam)
|
||||
*((int *)lParam) = IDM_LANG_USER;
|
||||
*(reinterpret_cast<int *>(lParam)) = IDM_LANG_USER;
|
||||
return pNppParam->getNbUserLang();
|
||||
}
|
||||
|
||||
@ -1186,7 +1182,7 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPa
|
||||
|
||||
case NPPM_SETSTATUSBAR:
|
||||
{
|
||||
TCHAR *str2set = (TCHAR *)lParam;
|
||||
TCHAR *str2set = reinterpret_cast<TCHAR *>(lParam);
|
||||
if (!str2set || !str2set[0])
|
||||
return FALSE;
|
||||
|
||||
@ -1217,18 +1213,18 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPa
|
||||
|
||||
case NPPM_LOADSESSION:
|
||||
{
|
||||
fileLoadSession((const TCHAR *)lParam);
|
||||
fileLoadSession(reinterpret_cast<const TCHAR *>(lParam));
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
case NPPM_SAVECURRENTSESSION:
|
||||
{
|
||||
return (LRESULT)fileSaveSession(0, NULL, (const TCHAR *)lParam);
|
||||
return (LRESULT)fileSaveSession(0, NULL, reinterpret_cast<const TCHAR *>(lParam));
|
||||
}
|
||||
|
||||
case NPPM_SAVESESSION:
|
||||
{
|
||||
sessionInfo *pSi = (sessionInfo *)lParam;
|
||||
sessionInfo *pSi = reinterpret_cast<sessionInfo *>(lParam);
|
||||
return (LRESULT)fileSaveSession(pSi->nbFile, pSi->files, pSi->sessionFilePathName);
|
||||
}
|
||||
|
||||
@ -1247,7 +1243,6 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPa
|
||||
|
||||
case NPPM_INTERNAL_CMDLIST_MODIFIED:
|
||||
{
|
||||
//changeMenuShortcut(lParam, (const TCHAR *)wParam);
|
||||
::DrawMenuBar(hwnd);
|
||||
return TRUE;
|
||||
}
|
||||
@ -1422,21 +1417,21 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPa
|
||||
|
||||
case NPPM_INTERNAL_RELOADSCROLLTOEND:
|
||||
{
|
||||
Buffer *buf = (Buffer *)wParam;
|
||||
Buffer *buf = reinterpret_cast<Buffer *>(wParam);
|
||||
buf->reload();
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
case NPPM_INTERNAL_GETCHECKDOCOPT:
|
||||
{
|
||||
return (LRESULT)((NppGUI &)(pNppParam->getNppGUI()))._fileAutoDetection;
|
||||
return (LRESULT)(const_cast<NppGUI &>(pNppParam->getNppGUI()))._fileAutoDetection;
|
||||
}
|
||||
|
||||
case NPPM_INTERNAL_SETCHECKDOCOPT:
|
||||
{
|
||||
// If nothing is changed by user, then we allow to set this value
|
||||
if (((NppGUI &)(pNppParam->getNppGUI()))._fileAutoDetection == ((NppGUI &)(pNppParam->getNppGUI()))._fileAutoDetectionOriginalValue)
|
||||
((NppGUI &)(pNppParam->getNppGUI()))._fileAutoDetection = (ChangeDetect)wParam;
|
||||
if ((const_cast<NppGUI &>(pNppParam->getNppGUI()))._fileAutoDetection == (const_cast<NppGUI &>(pNppParam->getNppGUI()))._fileAutoDetectionOriginalValue)
|
||||
(const_cast<NppGUI &>(pNppParam->getNppGUI()))._fileAutoDetection = (ChangeDetect)wParam;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@ -1479,12 +1474,12 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPa
|
||||
|
||||
case NPPM_GETFULLPATHFROMBUFFERID:
|
||||
{
|
||||
return MainFileManager->getFileNameFromBuffer((BufferID)wParam, (TCHAR *)lParam);
|
||||
return MainFileManager->getFileNameFromBuffer(reinterpret_cast<BufferID>(wParam), reinterpret_cast<TCHAR *>(lParam));
|
||||
}
|
||||
|
||||
case NPPM_INTERNAL_ENABLECHECKDOCOPT:
|
||||
{
|
||||
NppGUI & nppgui = (NppGUI &)(pNppParam->getNppGUI());
|
||||
NppGUI & nppgui = const_cast<NppGUI &>((pNppParam->getNppGUI()));
|
||||
if (wParam == CHECKDOCOPT_NONE)
|
||||
nppgui._fileAutoDetection = cdDisabled;
|
||||
else if (wParam == CHECKDOCOPT_UPDATESILENTLY)
|
||||
@ -1720,7 +1715,7 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPa
|
||||
|
||||
case WM_SYSCOMMAND:
|
||||
{
|
||||
NppGUI & nppgui = (NppGUI &)(pNppParam->getNppGUI());
|
||||
NppGUI & nppgui = const_cast<NppGUI &>((pNppParam->getNppGUI()));
|
||||
if (((nppgui._isMinimizedToTray && !_isAdministrator) || _pPublicInterface->isPrelaunch()) && (wParam == SC_MINIMIZE))
|
||||
{
|
||||
if (nullptr == _pTrayIco)
|
||||
@ -1810,7 +1805,7 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPa
|
||||
|
||||
case NPPM_DMMREGASDCKDLG:
|
||||
{
|
||||
tTbData *pData = (tTbData *)lParam;
|
||||
tTbData *pData = reinterpret_cast<tTbData *>(lParam);
|
||||
int iCont = -1;
|
||||
bool isVisible = false;
|
||||
|
||||
@ -1821,7 +1816,7 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPa
|
||||
|
||||
case NPPM_DMMVIEWOTHERTAB:
|
||||
{
|
||||
_dockingManager.showDockableDlg((TCHAR*)lParam, SW_SHOW);
|
||||
_dockingManager.showDockableDlg(reinterpret_cast<TCHAR *>(lParam), SW_SHOW);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@ -1830,8 +1825,8 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPa
|
||||
if (!lParam)
|
||||
return NULL;
|
||||
|
||||
TCHAR *moduleName = (TCHAR *)lParam;
|
||||
TCHAR *windowName = (TCHAR *)wParam;
|
||||
TCHAR *moduleName = reinterpret_cast<TCHAR *>(lParam);
|
||||
TCHAR *windowName = reinterpret_cast<TCHAR *>(wParam);
|
||||
std::vector<DockingCont *> dockContainer = _dockingManager.getContainerInfo();
|
||||
|
||||
for (size_t i = 0, len = dockContainer.size(); i < len ; ++i)
|
||||
@ -1854,13 +1849,13 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPa
|
||||
|
||||
case NPPM_ADDTOOLBARICON:
|
||||
{
|
||||
_toolBar.registerDynBtn((UINT)wParam, (toolbarIcons*)lParam);
|
||||
_toolBar.registerDynBtn(static_cast<UINT>(wParam), reinterpret_cast<toolbarIcons*>(lParam));
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
case NPPM_SETMENUITEMCHECK:
|
||||
{
|
||||
::CheckMenuItem(_mainMenuHandle, (UINT)wParam, MF_BYCOMMAND | ((BOOL)lParam ? MF_CHECKED : MF_UNCHECKED));
|
||||
::CheckMenuItem(_mainMenuHandle, static_cast<UINT>(wParam), MF_BYCOMMAND | (static_cast<BOOL>(lParam) ? MF_CHECKED : MF_UNCHECKED));
|
||||
_toolBar.setCheck((int)wParam, bool(lParam != 0));
|
||||
return TRUE;
|
||||
}
|
||||
@ -1897,7 +1892,7 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPa
|
||||
if (len < pluginsConfigDirPrefix.length() + lstrlen(secondPart))
|
||||
return FALSE;
|
||||
|
||||
TCHAR *pluginsConfigDir = (TCHAR *)lParam;
|
||||
TCHAR *pluginsConfigDir = reinterpret_cast<TCHAR *>(lParam);
|
||||
lstrcpy(pluginsConfigDir, pluginsConfigDirPrefix.c_str());
|
||||
|
||||
::PathAppend(pluginsConfigDir, secondPart);
|
||||
@ -1933,7 +1928,7 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPa
|
||||
DocTabView::setHideTabBarStatus(hide);
|
||||
::SendMessage(hwnd, WM_SIZE, 0, 0);
|
||||
|
||||
NppGUI & nppGUI = (NppGUI &)((NppParameters::getInstance())->getNppGUI());
|
||||
NppGUI & nppGUI = const_cast<NppGUI &>(((NppParameters::getInstance())->getNppGUI()));
|
||||
if (hide)
|
||||
nppGUI._tabStatus |= TAB_HIDE;
|
||||
else
|
||||
@ -1968,7 +1963,7 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPa
|
||||
if (hide == isHidden)
|
||||
return isHidden;
|
||||
|
||||
NppGUI & nppGUI = (NppGUI &)pNppParam->getNppGUI();
|
||||
NppGUI & nppGUI = const_cast<NppGUI &>(pNppParam->getNppGUI());
|
||||
nppGUI._menuBarShow = !hide;
|
||||
if (nppGUI._menuBarShow)
|
||||
::SetMenu(hwnd, _mainMenuHandle);
|
||||
@ -1986,7 +1981,7 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPa
|
||||
case NPPM_HIDESTATUSBAR:
|
||||
{
|
||||
bool show = (lParam != TRUE);
|
||||
NppGUI & nppGUI = (NppGUI &)pNppParam->getNppGUI();
|
||||
NppGUI & nppGUI = const_cast<NppGUI &>(pNppParam->getNppGUI());
|
||||
bool oldVal = nppGUI._statusBarShow;
|
||||
if (show == oldVal)
|
||||
return oldVal;
|
||||
@ -2002,7 +1997,7 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPa
|
||||
|
||||
case NPPM_ISSTATUSBARHIDDEN:
|
||||
{
|
||||
NppGUI & nppGUI = (NppGUI &)pNppParam->getNppGUI();
|
||||
NppGUI & nppGUI = const_cast<NppGUI &>(pNppParam->getNppGUI());
|
||||
return !nppGUI._statusBarShow;
|
||||
}
|
||||
|
||||
@ -2064,7 +2059,7 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPa
|
||||
case NPPM_INTERNAL_DISABLEAUTOUPDATE:
|
||||
{
|
||||
//printStr(TEXT("you've got me"));
|
||||
NppGUI & nppGUI = (NppGUI &)pNppParam->getNppGUI();
|
||||
NppGUI & nppGUI = const_cast<NppGUI &>(pNppParam->getNppGUI());
|
||||
nppGUI._autoUpdateOpt._doAutoUpdate = false;
|
||||
return TRUE;
|
||||
}
|
||||
@ -2088,7 +2083,7 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPa
|
||||
case NPPM_DOCSWITCHERDISABLECOLUMN:
|
||||
{
|
||||
BOOL isOff = static_cast<BOOL>(lParam);
|
||||
NppGUI & nppGUI = (NppGUI &)pNppParam->getNppGUI();
|
||||
NppGUI & nppGUI = const_cast<NppGUI &>(pNppParam->getNppGUI());
|
||||
nppGUI._fileSwitcherWithoutExtColumn = isOff == TRUE;
|
||||
|
||||
if (_pFileSwitcherPanel)
|
||||
@ -2187,7 +2182,7 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPa
|
||||
|
||||
case WM_ENTERMENULOOP:
|
||||
{
|
||||
NppGUI & nppgui = (NppGUI &)(pNppParam->getNppGUI());
|
||||
NppGUI & nppgui = const_cast<NppGUI &>((pNppParam->getNppGUI()));
|
||||
if (!nppgui._menuBarShow && !wParam && !_sysMenuEntering)
|
||||
::SetMenu(hwnd, _mainMenuHandle);
|
||||
|
||||
@ -2196,7 +2191,7 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPa
|
||||
|
||||
case WM_EXITMENULOOP:
|
||||
{
|
||||
NppGUI & nppgui = (NppGUI &)(pNppParam->getNppGUI());
|
||||
NppGUI & nppgui = const_cast<NppGUI &>((pNppParam->getNppGUI()));
|
||||
if (!nppgui._menuBarShow && !wParam && !_sysMenuEntering)
|
||||
::SetMenu(hwnd, NULL);
|
||||
_sysMenuEntering = false;
|
||||
@ -2212,7 +2207,7 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPa
|
||||
{
|
||||
if (Message == WDN_NOTIFY)
|
||||
{
|
||||
NMWINDLG* nmdlg = (NMWINDLG*)lParam;
|
||||
NMWINDLG* nmdlg = reinterpret_cast<NMWINDLG*>(lParam);
|
||||
switch (nmdlg->type)
|
||||
{
|
||||
case WDT_ACTIVATE:
|
||||
@ -2225,7 +2220,7 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPa
|
||||
case WDT_SAVE:
|
||||
{
|
||||
//loop through nmdlg->nItems, get index and save it
|
||||
for (int i = 0; i < (int)nmdlg->nItems; ++i)
|
||||
for (unsigned int i = 0; i < nmdlg->nItems; ++i)
|
||||
{
|
||||
fileSave(_pDocTab->getBufferByIndex(i));
|
||||
}
|
||||
@ -2236,7 +2231,7 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPa
|
||||
case WDT_CLOSE:
|
||||
{
|
||||
//loop through nmdlg->nItems, get index and close it
|
||||
for (int i = 0; i < (int)nmdlg->nItems; ++i)
|
||||
for (unsigned int i = 0; i < nmdlg->nItems; ++i)
|
||||
{
|
||||
bool closed = fileClose(_pDocTab->getBufferByIndex(nmdlg->Items[i]), currentView());
|
||||
UINT pos = nmdlg->Items[i];
|
||||
@ -2246,7 +2241,7 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPa
|
||||
nmdlg->Items[i] = 0xFFFFFFFF; // indicate file was closed
|
||||
|
||||
// Shift the remaining items downward to fill the gap
|
||||
for (int j = i + 1; j < (int)nmdlg->nItems; ++j)
|
||||
for (unsigned int j = i + 1; j < nmdlg->nItems; ++j)
|
||||
{
|
||||
if (nmdlg->Items[j] > pos)
|
||||
nmdlg->Items[j]--;
|
||||
@ -2264,12 +2259,12 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPa
|
||||
|
||||
//Collect all buffers
|
||||
std::vector<BufferID> tempBufs;
|
||||
for (int i = 0; i < (int)nmdlg->nItems; ++i)
|
||||
for (unsigned int i = 0; i < nmdlg->nItems; ++i)
|
||||
{
|
||||
tempBufs.push_back(_pDocTab->getBufferByIndex(i));
|
||||
}
|
||||
//Reset buffers
|
||||
for (int i = 0; i < (int)nmdlg->nItems; ++i)
|
||||
for (unsigned int i = 0; i < nmdlg->nItems; ++i)
|
||||
{
|
||||
_pDocTab->setBuffer(i, tempBufs[nmdlg->Items[i]]);
|
||||
}
|
||||
|
@ -653,7 +653,7 @@ BOOL Notepad_plus::notify(SCNotification *notification)
|
||||
|
||||
// Note: cast of leftmost_position to unsigned int is safe, since if leftmost_position is not -1 then it is guaranteed to be positive.
|
||||
// If it was possible, leftmost_position and rightmost_position should be of type optional<unsigned int>.
|
||||
if ( matching_leftmost <= position_of_click && i >= position_of_click && (leftmost_position == -1 || matching_leftmost > (unsigned int)leftmost_position) )
|
||||
if (matching_leftmost <= position_of_click && i >= position_of_click && (leftmost_position == -1 || matching_leftmost > static_cast<unsigned int>(leftmost_position)))
|
||||
{
|
||||
leftmost_position = matching_leftmost;
|
||||
rightmost_position = i;
|
||||
|
@ -2247,8 +2247,8 @@ void NppParameters::feedShortcut(TiXmlNode *node)
|
||||
if (idStr)
|
||||
{
|
||||
//find the commandid that matches this Shortcut sc and alter it, push back its index in the modified list, if not present
|
||||
int len = (int)_shortcuts.size();
|
||||
for(int i = 0; i < len; ++i)
|
||||
size_t len = _shortcuts.size();
|
||||
for(size_t i = 0; i < len; ++i)
|
||||
{
|
||||
if (_shortcuts[i].getID() == (unsigned long)id)
|
||||
{ //found our match
|
||||
@ -2360,8 +2360,8 @@ void NppParameters::feedPluginCustomizedCmds(TiXmlNode *node)
|
||||
continue;
|
||||
|
||||
//Find the corresponding plugincommand and alter it, put the index in the list
|
||||
int len = (int)_pluginCommands.size();
|
||||
for(int i = 0; i < len; ++i)
|
||||
size_t len = _pluginCommands.size();
|
||||
for(size_t i = 0; i < len; ++i)
|
||||
{
|
||||
PluginCmdShortcut & pscOrig = _pluginCommands[i];
|
||||
if (!generic_strnicmp(pscOrig.getModuleName(), moduleName, lstrlen(moduleName)) && pscOrig.getInternalID() == internalID)
|
||||
@ -2977,7 +2977,7 @@ void NppParameters::writeShortcuts()
|
||||
cmdRoot = root->InsertEndChild(TiXmlElement(TEXT("InternalCommands")));
|
||||
for (size_t i = 0, len = _customizedShortcuts.size(); i < len ; ++i)
|
||||
{
|
||||
int index = _customizedShortcuts[i];
|
||||
size_t index = _customizedShortcuts[i];
|
||||
CommandShortcut csc = _shortcuts[index];
|
||||
insertCmd(cmdRoot, csc);
|
||||
}
|
||||
@ -3506,7 +3506,7 @@ TiXmlNode * NppParameters::getChildElementByAttribut(TiXmlNode *pere, const TCHA
|
||||
// 2 restes : L_H, L_USER
|
||||
LangType NppParameters::getLangIDFromStr(const TCHAR *langName)
|
||||
{
|
||||
int lang = (int)L_TEXT;
|
||||
int lang = static_cast<int>(L_TEXT);
|
||||
for(; lang < L_EXTERNAL; ++lang)
|
||||
{
|
||||
const TCHAR * name = ScintillaEditView::langNames[lang].lexerName;
|
||||
@ -5480,8 +5480,8 @@ bool NppParameters::writeGUIParams()
|
||||
}
|
||||
else if (!lstrcmp(nm, TEXT("delimiterSelection")))
|
||||
{
|
||||
element->SetAttribute(TEXT("leftmostDelimiter"), (int)_nppGUI._leftmostDelimiter);
|
||||
element->SetAttribute(TEXT("rightmostDelimiter"), (int)_nppGUI._rightmostDelimiter);
|
||||
element->SetAttribute(TEXT("leftmostDelimiter"), static_cast<int>(_nppGUI._leftmostDelimiter));
|
||||
element->SetAttribute(TEXT("rightmostDelimiter"), static_cast<int>(_nppGUI._rightmostDelimiter));
|
||||
if(_nppGUI._delimiterSelectionOnEntireDocument)
|
||||
element->SetAttribute(TEXT("delimiterSelectionOnEntireDocument"), TEXT("yes"));
|
||||
else
|
||||
@ -6448,7 +6448,7 @@ void NppParameters::stylerStrOp(bool op)
|
||||
}
|
||||
}
|
||||
|
||||
void NppParameters::addUserModifiedIndex(int index)
|
||||
void NppParameters::addUserModifiedIndex(size_t index)
|
||||
{
|
||||
size_t len = _customizedShortcuts.size();
|
||||
bool found = false;
|
||||
@ -6466,7 +6466,7 @@ void NppParameters::addUserModifiedIndex(int index)
|
||||
}
|
||||
}
|
||||
|
||||
void NppParameters::addPluginModifiedIndex(int index)
|
||||
void NppParameters::addPluginModifiedIndex(size_t index)
|
||||
{
|
||||
size_t len = _pluginCustomizedCmds.size();
|
||||
bool found = false;
|
||||
|
@ -1403,14 +1403,14 @@ public:
|
||||
bool isRemappingShortcut() const {return _shortcuts.size() != 0;};
|
||||
|
||||
std::vector<CommandShortcut> & getUserShortcuts() { return _shortcuts; };
|
||||
std::vector<int> & getUserModifiedShortcuts() { return _customizedShortcuts; };
|
||||
void addUserModifiedIndex(int index);
|
||||
std::vector<size_t> & getUserModifiedShortcuts() { return _customizedShortcuts; };
|
||||
void addUserModifiedIndex(size_t index);
|
||||
|
||||
std::vector<MacroShortcut> & getMacroList() { return _macros; };
|
||||
std::vector<UserCommand> & getUserCommandList() { return _userCommands; };
|
||||
std::vector<PluginCmdShortcut> & getPluginCommandList() { return _pluginCommands; };
|
||||
std::vector<int> & getPluginModifiedKeyIndices() { return _pluginCustomizedCmds; };
|
||||
void addPluginModifiedIndex(int index);
|
||||
std::vector<size_t> & getPluginModifiedKeyIndices() { return _pluginCustomizedCmds; };
|
||||
void addPluginModifiedIndex(size_t index);
|
||||
|
||||
std::vector<ScintillaKeyMap> & getScintillaKeyList() { return _scintillaKeyCommands; };
|
||||
std::vector<int> & getScintillaModifiedKeyIndices() { return _scintillaModifiedKeyIndices; };
|
||||
@ -1605,11 +1605,11 @@ public:
|
||||
private:
|
||||
bool _isAnyShortcutModified = false;
|
||||
std::vector<CommandShortcut> _shortcuts; //main menu shortuts. Static size
|
||||
std::vector<int> _customizedShortcuts; //altered main menu shortcuts. Indices static. Needed when saving alterations
|
||||
std::vector<size_t> _customizedShortcuts; //altered main menu shortcuts. Indices static. Needed when saving alterations
|
||||
std::vector<MacroShortcut> _macros; //macro shortcuts, dynamic size, defined on loading macros and adding/deleting them
|
||||
std::vector<UserCommand> _userCommands; //run shortcuts, dynamic size, defined on loading run commands and adding/deleting them
|
||||
std::vector<PluginCmdShortcut> _pluginCommands; //plugin commands, dynamic size, defined on loading plugins
|
||||
std::vector<int> _pluginCustomizedCmds; //plugincommands that have been altered. Indices determined after loading ALL plugins. Needed when saving alterations
|
||||
std::vector<size_t> _pluginCustomizedCmds; //plugincommands that have been altered. Indices determined after loading ALL plugins. Needed when saving alterations
|
||||
|
||||
std::vector<ScintillaKeyMap> _scintillaKeyCommands; //scintilla keycommands. Static size
|
||||
std::vector<int> _scintillaModifiedKeyIndices; //modified scintilla keys. Indices static, determined by searching for commandId. Needed when saving alterations
|
||||
|
@ -67,8 +67,8 @@ bool AutoCompletion::showApiComplete()
|
||||
|
||||
bool AutoCompletion::showApiAndWordComplete()
|
||||
{
|
||||
int curPos = int(_pEditView->execute(SCI_GETCURRENTPOS));
|
||||
int startPos = int(_pEditView->execute(SCI_WORDSTARTPOSITION, curPos, true));
|
||||
auto curPos = _pEditView->execute(SCI_GETCURRENTPOS);
|
||||
auto startPos = _pEditView->execute(SCI_WORDSTARTPOSITION, curPos, true);
|
||||
|
||||
if (curPos == startPos)
|
||||
return false;
|
||||
|
@ -408,11 +408,11 @@ Lang * Buffer::getCurrentLang() const
|
||||
|
||||
int Buffer::indexOfReference(const ScintillaEditView * identifier) const
|
||||
{
|
||||
int size = (int)_referees.size();
|
||||
for (int i = 0; i < size; ++i)
|
||||
size_t size = _referees.size();
|
||||
for (size_t i = 0; i < size; ++i)
|
||||
{
|
||||
if (_referees[i] == identifier)
|
||||
return i;
|
||||
return static_cast<int>(i);
|
||||
}
|
||||
return -1; //not found
|
||||
}
|
||||
@ -537,7 +537,7 @@ int FileManager::getBufferIndexByID(BufferID id)
|
||||
for(size_t i = 0; i < _nrBufs; ++i)
|
||||
{
|
||||
if (_buffers[i]->_id == id)
|
||||
return (int) i;
|
||||
return static_cast<int>(i);
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
@ -110,11 +110,11 @@ int DocTabView::getIndexByBuffer(BufferID id)
|
||||
TCITEM tie;
|
||||
tie.lParam = -1;
|
||||
tie.mask = TCIF_PARAM;
|
||||
for(int i = 0; i < (int)_nbItem; ++i)
|
||||
for(size_t i = 0; i < _nbItem; ++i)
|
||||
{
|
||||
::SendMessage(_hSelf, TCM_GETITEM, i, reinterpret_cast<LPARAM>(&tie));
|
||||
if (reinterpret_cast<BufferID>(tie.lParam) == id)
|
||||
return i;
|
||||
return static_cast<int>(i);
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
@ -194,13 +194,13 @@ void DocTabView::bufferUpdated(Buffer * buffer, int mask)
|
||||
}
|
||||
|
||||
|
||||
void DocTabView::setBuffer(int index, BufferID id)
|
||||
void DocTabView::setBuffer(size_t index, BufferID id)
|
||||
{
|
||||
if (index < 0 || index >= (int)_nbItem)
|
||||
if (index < 0 || index >= _nbItem)
|
||||
return;
|
||||
|
||||
TCITEM tie;
|
||||
tie.lParam = (LPARAM)id;
|
||||
tie.lParam = reinterpret_cast<LPARAM>(id);
|
||||
tie.mask = TCIF_PARAM;
|
||||
::SendMessage(_hSelf, TCM_SETITEM, index, reinterpret_cast<LPARAM>(&tie));
|
||||
|
||||
|
@ -73,7 +73,7 @@ public :
|
||||
int getIndexByBuffer(BufferID id);
|
||||
BufferID getBufferByIndex(size_t index);
|
||||
|
||||
void setBuffer(int index, BufferID id);
|
||||
void setBuffer(size_t index, BufferID id);
|
||||
|
||||
static bool setHideTabBarStatus(bool hideOrNot) {
|
||||
bool temp = _hideTabBarStatus;
|
||||
|
@ -185,29 +185,30 @@ void Searching::displaySectionCentered(int posStart, int posEnd, ScintillaEditVi
|
||||
{
|
||||
// to make sure the found result is visible
|
||||
//When searching up, the beginning of the (possible multiline) result is important, when scrolling down the end
|
||||
int testPos = (isDownwards)?posEnd:posStart;
|
||||
int testPos = isDownwards ? posEnd : posStart;
|
||||
|
||||
pEditView->execute(SCI_SETCURRENTPOS, testPos);
|
||||
int currentlineNumberDoc = (int)pEditView->execute(SCI_LINEFROMPOSITION, testPos);
|
||||
int currentlineNumberVis = (int)pEditView->execute(SCI_VISIBLEFROMDOCLINE, currentlineNumberDoc);
|
||||
auto currentlineNumberDoc = pEditView->execute(SCI_LINEFROMPOSITION, testPos);
|
||||
auto currentlineNumberVis = pEditView->execute(SCI_VISIBLEFROMDOCLINE, currentlineNumberDoc);
|
||||
pEditView->execute(SCI_ENSUREVISIBLE, currentlineNumberDoc); // make sure target line is unfolded
|
||||
|
||||
int firstVisibleLineVis = (int)pEditView->execute(SCI_GETFIRSTVISIBLELINE);
|
||||
int linesVisible = (int)pEditView->execute(SCI_LINESONSCREEN) - 1; //-1 for the scrollbar
|
||||
int lastVisibleLineVis = (int)linesVisible + firstVisibleLineVis;
|
||||
auto firstVisibleLineVis = pEditView->execute(SCI_GETFIRSTVISIBLELINE);
|
||||
auto linesVisible = pEditView->execute(SCI_LINESONSCREEN) - 1; //-1 for the scrollbar
|
||||
auto lastVisibleLineVis = linesVisible + firstVisibleLineVis;
|
||||
|
||||
//if out of view vertically, scroll line into (center of) view
|
||||
int linesToScroll = 0;
|
||||
if (currentlineNumberVis < firstVisibleLineVis)
|
||||
{
|
||||
linesToScroll = currentlineNumberVis - firstVisibleLineVis;
|
||||
linesToScroll = static_cast<int>(currentlineNumberVis - firstVisibleLineVis);
|
||||
//use center
|
||||
linesToScroll -= linesVisible/2;
|
||||
linesToScroll -= static_cast<int>(linesVisible/2);
|
||||
}
|
||||
else if (currentlineNumberVis > lastVisibleLineVis)
|
||||
{
|
||||
linesToScroll = currentlineNumberVis - lastVisibleLineVis;
|
||||
linesToScroll = static_cast<int>(currentlineNumberVis - lastVisibleLineVis);
|
||||
//use center
|
||||
linesToScroll += linesVisible/2;
|
||||
linesToScroll += static_cast<int>(linesVisible/2);
|
||||
}
|
||||
pEditView->scroll(0, linesToScroll);
|
||||
|
||||
|
@ -118,7 +118,7 @@ void FunctionCallTip::showNextOverload() {
|
||||
void FunctionCallTip::showPrevOverload() {
|
||||
if (!isVisible())
|
||||
return;
|
||||
_currentOverload = _currentOverload > 0?(_currentOverload-1) : _currentNrOverloads-1;
|
||||
_currentOverload = _currentOverload > 0 ? (_currentOverload-1) : (_currentNrOverloads-1);
|
||||
showCalltip();
|
||||
}
|
||||
|
||||
@ -366,7 +366,7 @@ bool FunctionCallTip::loadFunction()
|
||||
++_currentNrOverloads;
|
||||
}
|
||||
|
||||
_currentNrOverloads = (int)_overloads.size();
|
||||
_currentNrOverloads = _overloads.size();
|
||||
|
||||
if (_currentNrOverloads == 0) //malformed node
|
||||
return false;
|
||||
|
@ -59,8 +59,8 @@ private:
|
||||
stringVec _retVals; //vector of overload return values/types
|
||||
std::vector<stringVec> _overloads; //vector of overload params (=vector)
|
||||
stringVec _descriptions; //vecotr of function descriptions
|
||||
int _currentNrOverloads = 0; //current amount of overloads
|
||||
int _currentOverload = 0; //current chosen overload
|
||||
size_t _currentNrOverloads = 0; //current amount of overloads
|
||||
size_t _currentOverload = 0; //current chosen overload
|
||||
int _currentParam = 0; //current highlighted param
|
||||
|
||||
TCHAR _start = '(';
|
||||
|
@ -137,13 +137,13 @@ void GoToLineDlg::updateLinesNumbers() const
|
||||
|
||||
if (_mode == go2line)
|
||||
{
|
||||
current = (unsigned int)((*_ppEditView)->getCurrentLineNumber() + 1);
|
||||
limit = (unsigned int)((*_ppEditView)->execute(SCI_GETLINECOUNT));
|
||||
current = static_cast<unsigned int>((*_ppEditView)->getCurrentLineNumber() + 1);
|
||||
limit = static_cast<unsigned int>((*_ppEditView)->execute(SCI_GETLINECOUNT));
|
||||
}
|
||||
else
|
||||
{
|
||||
current = (unsigned int)(*_ppEditView)->execute(SCI_GETCURRENTPOS);
|
||||
limit = (unsigned int)((*_ppEditView)->getCurrentDocLen() - 1);
|
||||
current = static_cast<unsigned int>((*_ppEditView)->execute(SCI_GETCURRENTPOS));
|
||||
limit = static_cast<unsigned int>((*_ppEditView)->getCurrentDocLen() - 1);
|
||||
}
|
||||
::SetDlgItemInt(_hSelf, ID_CURRLINE, current, FALSE);
|
||||
::SetDlgItemInt(_hSelf, ID_LASTLINE, limit, FALSE);
|
||||
|
@ -2300,19 +2300,19 @@ void ScintillaEditView::updateLineNumberWidth()
|
||||
{
|
||||
if (_lineNumbersShown)
|
||||
{
|
||||
int linesVisible = (int) execute(SCI_LINESONSCREEN);
|
||||
auto linesVisible = execute(SCI_LINESONSCREEN);
|
||||
if (linesVisible)
|
||||
{
|
||||
int firstVisibleLineVis = (int) execute(SCI_GETFIRSTVISIBLELINE);
|
||||
int lastVisibleLineVis = linesVisible + firstVisibleLineVis + 1;
|
||||
auto firstVisibleLineVis = execute(SCI_GETFIRSTVISIBLELINE);
|
||||
auto lastVisibleLineVis = linesVisible + firstVisibleLineVis + 1;
|
||||
|
||||
if (execute(SCI_GETWRAPMODE) != SC_WRAP_NONE)
|
||||
{
|
||||
int numLinesDoc = (int) execute(SCI_GETLINECOUNT);
|
||||
int prevLineDoc = (int) execute(SCI_DOCLINEFROMVISIBLE, firstVisibleLineVis);
|
||||
for (int i = firstVisibleLineVis + 1; i <= lastVisibleLineVis; ++i)
|
||||
auto numLinesDoc = execute(SCI_GETLINECOUNT);
|
||||
auto prevLineDoc = execute(SCI_DOCLINEFROMVISIBLE, firstVisibleLineVis);
|
||||
for (auto i = firstVisibleLineVis + 1; i <= lastVisibleLineVis; ++i)
|
||||
{
|
||||
int lineDoc = (int) execute(SCI_DOCLINEFROMVISIBLE, i);
|
||||
auto lineDoc = execute(SCI_DOCLINEFROMVISIBLE, i);
|
||||
if (lineDoc == numLinesDoc)
|
||||
break;
|
||||
if (lineDoc == prevLineDoc)
|
||||
@ -2321,7 +2321,7 @@ void ScintillaEditView::updateLineNumberWidth()
|
||||
}
|
||||
}
|
||||
|
||||
int lastVisibleLineDoc = (int) execute(SCI_DOCLINEFROMVISIBLE, lastVisibleLineVis);
|
||||
auto lastVisibleLineDoc = execute(SCI_DOCLINEFROMVISIBLE, lastVisibleLineVis);
|
||||
int i = 0;
|
||||
|
||||
while (lastVisibleLineDoc)
|
||||
@ -2331,7 +2331,7 @@ void ScintillaEditView::updateLineNumberWidth()
|
||||
}
|
||||
|
||||
i = max(i, 3);
|
||||
int pixelWidth = int(8 + i * execute(SCI_TEXTWIDTH, STYLE_LINENUMBER, (LPARAM)"8"));
|
||||
auto pixelWidth = 8 + i * execute(SCI_TEXTWIDTH, STYLE_LINENUMBER, (LPARAM)"8");
|
||||
execute(SCI_SETMARGINWIDTHN, _SC_MARGE_LINENUMBER, pixelWidth);
|
||||
}
|
||||
}
|
||||
|
@ -89,13 +89,13 @@ void SmartHighlighter::highlightView(ScintillaEditView * pHighlightView)
|
||||
}
|
||||
|
||||
// save target locations for other search functions
|
||||
int originalStartPos = (int)pHighlightView->execute(SCI_GETTARGETSTART);
|
||||
int originalEndPos = (int)pHighlightView->execute(SCI_GETTARGETEND);
|
||||
auto originalStartPos = pHighlightView->execute(SCI_GETTARGETSTART);
|
||||
auto originalEndPos = pHighlightView->execute(SCI_GETTARGETEND);
|
||||
|
||||
// Get the range of text visible and highlight everything in it
|
||||
int firstLine = (int)pHighlightView->execute(SCI_GETFIRSTVISIBLELINE);
|
||||
int firstLine = static_cast<int>(pHighlightView->execute(SCI_GETFIRSTVISIBLELINE));
|
||||
int nrLines = min((int)pHighlightView->execute(SCI_LINESONSCREEN), MAXLINEHIGHLIGHT ) + 1;
|
||||
int lastLine = firstLine+nrLines;
|
||||
int lastLine = firstLine + nrLines;
|
||||
int startPos = 0;
|
||||
int endPos = 0;
|
||||
int currentLine = firstLine;
|
||||
@ -128,7 +128,7 @@ void SmartHighlighter::highlightView(ScintillaEditView * pHighlightView)
|
||||
frInfo._endRange = endPos;
|
||||
if (endPos == -1)
|
||||
{ //past EOF
|
||||
frInfo._endRange = (int)pHighlightView->getCurrentDocLen() - 1;
|
||||
frInfo._endRange = pHighlightView->getCurrentDocLen() - 1;
|
||||
_pFRDlg->processRange(ProcessMarkAll_2, frInfo, NULL, &fo);
|
||||
break;
|
||||
}
|
||||
|
@ -516,7 +516,7 @@ void CommentStyleDialog::setKeywords2List(int id)
|
||||
IDC_COMMENT_CLOSE_EDIT
|
||||
};
|
||||
|
||||
for (int i=0; i<sizeof(list)/sizeof(int); ++i)
|
||||
for (auto i = 0; i < sizeof(list)/sizeof(int); ++i)
|
||||
{
|
||||
generic_itoa(i, intBuffer+1, 10);
|
||||
::GetDlgItemText(_hSelf, list[i], buffer, max_char);
|
||||
@ -918,7 +918,7 @@ void SymbolsStyleDialog::setKeywords2List(int id)
|
||||
IDC_DELIMITER8_BOUNDARYCLOSE_EDIT
|
||||
};
|
||||
|
||||
for (int i=0; i<sizeof(list)/sizeof(int); ++i)
|
||||
for (int i = 0; i < sizeof(list)/sizeof(int); ++i)
|
||||
{
|
||||
if (i < 10)
|
||||
generic_itoa(i, intBuffer+1, 10);
|
||||
@ -1491,7 +1491,7 @@ INT_PTR CALLBACK UserDefineDialog::run_dlgProc(UINT message, WPARAM wParam, LPAR
|
||||
|
||||
case SB_THUMBTRACK:
|
||||
case SB_THUMBPOSITION:
|
||||
_yScrollPos = (int)HIWORD(wParam);
|
||||
_yScrollPos = HIWORD(wParam);
|
||||
break;
|
||||
|
||||
default :
|
||||
|
@ -36,21 +36,21 @@ void TiXmlBase::PutString( const TIXML_STRING& str, TIXML_OSTREAM* stream )
|
||||
|
||||
void TiXmlBase::PutString( const TIXML_STRING& str, TIXML_STRING* outString )
|
||||
{
|
||||
int i=0;
|
||||
size_t i = 0;
|
||||
|
||||
while( i<(int)str.length() )
|
||||
while (i < str.length())
|
||||
{
|
||||
int c = str[i];
|
||||
|
||||
if ( c == '&'
|
||||
&& i < ( (int)str.length() - 2 )
|
||||
if (c == '&'
|
||||
&& i < ( str.length() - 2 )
|
||||
&& str[i+1] == '#'
|
||||
&& str[i+2] == 'x' )
|
||||
{
|
||||
// Hexadecimal character reference.
|
||||
// Pass through unchanged.
|
||||
// © -- copyright symbol, for example.
|
||||
while ( i<(int)str.length() )
|
||||
while ( i < str.length() )
|
||||
{
|
||||
outString->append( str.c_str() + i, 1 );
|
||||
++i;
|
||||
@ -87,14 +87,14 @@ void TiXmlBase::PutString( const TIXML_STRING& str, TIXML_STRING* outString )
|
||||
{
|
||||
// Easy pass at non-alpha/numeric/symbol
|
||||
// 127 is the delete key. Below 32 is symbolic.
|
||||
TCHAR buf[ 32 ];
|
||||
wsprintf( buf, TEXT("&#x%04X;"), (unsigned) ( c & 0xffff ) );
|
||||
TCHAR buf[32];
|
||||
wsprintf( buf, TEXT("&#x%04X;"), static_cast<unsigned int>(c & 0xffff) );
|
||||
outString->append( buf, lstrlen( buf ) );
|
||||
++i;
|
||||
}
|
||||
else
|
||||
{
|
||||
TCHAR realc = (TCHAR) c;
|
||||
TCHAR realc = static_cast<TCHAR>(c);
|
||||
outString->append( &realc, 1 );
|
||||
++i;
|
||||
}
|
||||
|
@ -242,13 +242,13 @@ const TCHAR* TiXmlBase::GetEntity( const TCHAR* p, TCHAR* value )
|
||||
}
|
||||
|
||||
// Now try to match it.
|
||||
for( i=0; i<NUM_ENTITY; ++i )
|
||||
for (i=0; i<NUM_ENTITY; ++i)
|
||||
{
|
||||
if ( generic_strncmp( entity[i].str, p, entity[i].strLength ) == 0 )
|
||||
{
|
||||
assert( (unsigned int)lstrlen( entity[i].str ) == entity[i].strLength );
|
||||
assert(static_cast<unsigned int>(lstrlen(entity[i].str)) == entity[i].strLength );
|
||||
*value = entity[i].chr;
|
||||
return ( p + entity[i].strLength );
|
||||
return (p + entity[i].strLength);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -435,7 +435,7 @@ INT_PTR CALLBACK WordStyleDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM l
|
||||
int tabColourIndex;
|
||||
if ((tabColourIndex = whichTabColourIndex()) != -1)
|
||||
{
|
||||
tabColourIndex = (int)tabColourIndex == TabBarPlus::inactiveText? TabBarPlus::inactiveBg : tabColourIndex;
|
||||
tabColourIndex = tabColourIndex == (TabBarPlus::inactiveText ? TabBarPlus::inactiveBg : tabColourIndex);
|
||||
TabBarPlus::setColour(_pBgColour->getColour(), (TabBarPlus::tabColourIndex)tabColourIndex);
|
||||
}
|
||||
apply();
|
||||
@ -498,16 +498,16 @@ int WordStyleDlg::whichTabColourIndex()
|
||||
::SendDlgItemMessage(_hSelf, IDC_STYLES_LIST, LB_GETTEXT, i, (LPARAM)styleName);
|
||||
|
||||
if (lstrcmp(styleName, TABBAR_ACTIVEFOCUSEDINDCATOR) == 0)
|
||||
return (int)TabBarPlus::activeFocusedTop;
|
||||
return TabBarPlus::activeFocusedTop;
|
||||
|
||||
if (lstrcmp(styleName, TABBAR_ACTIVEUNFOCUSEDINDCATOR) == 0)
|
||||
return (int)TabBarPlus::activeUnfocusedTop;
|
||||
return TabBarPlus::activeUnfocusedTop;
|
||||
|
||||
if (lstrcmp(styleName, TABBAR_ACTIVETEXT) == 0)
|
||||
return (int)TabBarPlus::activeText;
|
||||
return TabBarPlus::activeText;
|
||||
|
||||
if (lstrcmp(styleName, TABBAR_INACTIVETEXT) == 0)
|
||||
return (int)TabBarPlus::inactiveText;
|
||||
return TabBarPlus::inactiveText;
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
@ -99,7 +99,7 @@ public :
|
||||
|
||||
virtual void redraw() const {
|
||||
_pFgColour->redraw();
|
||||
_pBgColour->redraw();
|
||||
_pBgColour->redraw();
|
||||
::InvalidateRect(_hStyleInfoStaticText, NULL, TRUE);
|
||||
::UpdateWindow(_hStyleInfoStaticText);
|
||||
};
|
||||
|
@ -915,7 +915,7 @@ INT_PTR CALLBACK DockingCont::run_dlgProc(UINT Message, WPARAM wParam, LPARAM lP
|
||||
case WM_NCACTIVATE:
|
||||
{
|
||||
// Note: lParam to identify the trigger window
|
||||
if ((int)lParam != -1)
|
||||
if (static_cast<int>(lParam) != -1)
|
||||
{
|
||||
::SendMessage(_hParent, WM_NCACTIVATE, wParam, 0);
|
||||
}
|
||||
@ -1330,7 +1330,7 @@ void DockingCont::SelectTab(int iTab)
|
||||
nmhdr.idFrom = 0;
|
||||
::SendMessage(((tTbData*)tcItem.lParam)->hClient, WM_NOTIFY, nmhdr.idFrom, (LPARAM)&nmhdr);
|
||||
|
||||
if ((unsigned int)iTab != _prevItem)
|
||||
if (static_cast<unsigned int>(iTab) != _prevItem)
|
||||
{
|
||||
// hide previous dialog
|
||||
::SendMessage(_hContTab, TCM_GETITEM, _prevItem, (LPARAM)&tcItem);
|
||||
|
@ -134,7 +134,7 @@ public:
|
||||
};
|
||||
|
||||
virtual void destroy() {
|
||||
for (int iTb = (int)_vTbData.size(); iTb > 0; iTb--)
|
||||
for (int iTb = static_cast<int>(_vTbData.size()); iTb > 0; iTb--)
|
||||
{
|
||||
delete _vTbData[iTb-1];
|
||||
}
|
||||
|
@ -232,7 +232,7 @@ LRESULT DockingManager::runProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM l
|
||||
::SendMessage(_vContainer[iCont]->getHSelf(), WM_NCACTIVATE, wParam, (LPARAM)-1);
|
||||
}
|
||||
|
||||
if ((int)lParam != -1)
|
||||
if (static_cast<int>(lParam) != -1)
|
||||
{
|
||||
::SendMessage(_hParent, WM_NCACTIVATE, wParam, (LPARAM)-1);
|
||||
}
|
||||
|
@ -42,12 +42,12 @@
|
||||
#define INDEX_OPEN_ROOT 0
|
||||
#define INDEX_CLOSE_ROOT 1
|
||||
#define INDEX_OPEN_NODE 2
|
||||
#define INDEX_CLOSE_NODE 3
|
||||
#define INDEX_CLOSE_NODE 3
|
||||
#define INDEX_LEAF 4
|
||||
|
||||
|
||||
#define GET_X_LPARAM(lp) ((int)(short)LOWORD(lp))
|
||||
#define GET_Y_LPARAM(lp) ((int)(short)HIWORD(lp))
|
||||
#define GET_X_LPARAM(lp) static_cast<short>(LOWORD(lp))
|
||||
#define GET_Y_LPARAM(lp) static_cast<short>(HIWORD(lp))
|
||||
|
||||
#define FB_ADDFILE (WM_USER + 1024)
|
||||
#define FB_RMFILE (WM_USER + 1025)
|
||||
@ -724,7 +724,7 @@ void FileBrowser::popupMenuCmd(int cmdID)
|
||||
|
||||
case IDM_FILEBROWSER_REMOVEALLROOTS:
|
||||
{
|
||||
for (int i = (int)_folderUpdaters.size() - 1; i >= 0; --i)
|
||||
for (int i = static_cast<int>(_folderUpdaters.size()) - 1; i >= 0; --i)
|
||||
{
|
||||
_folderUpdaters[i]->stopWatcher();
|
||||
|
||||
|
@ -592,14 +592,14 @@ void FunctionParser::getInvertZones(vector< pair<int, int> > & destZones, vecto
|
||||
{
|
||||
if (sourceZones.size() == 0)
|
||||
{
|
||||
destZones.push_back(pair<int, int>((int)begin, (int)end));
|
||||
destZones.push_back(pair<int, int>(static_cast<int>(begin), static_cast<int>(end)));
|
||||
}
|
||||
else
|
||||
{
|
||||
// check the begin
|
||||
if (int(begin) < sourceZones[0].first)
|
||||
{
|
||||
destZones.push_back(pair<int, int>((int)begin, sourceZones[0].first - 1));
|
||||
destZones.push_back(pair<int, int>(static_cast<int>(begin), sourceZones[0].first - 1));
|
||||
}
|
||||
|
||||
size_t i = 0;
|
||||
@ -612,7 +612,7 @@ void FunctionParser::getInvertZones(vector< pair<int, int> > & destZones, vecto
|
||||
}
|
||||
int lastBegin = sourceZones[i].second + 1;
|
||||
if (lastBegin < int(end))
|
||||
destZones.push_back(pair<int, int>(lastBegin, (int)end));
|
||||
destZones.push_back(pair<int, int>(lastBegin, static_cast<int>(end)));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -560,11 +560,11 @@ void DisplayColumn(HWND hWnd,int SI,int c,int offset,HFONT hfont,HFONT hcolumnhe
|
||||
rect.left +=0;
|
||||
rect.right -=0;
|
||||
if((rect.bottom - rect.top)>24)
|
||||
{
|
||||
{
|
||||
excess=(rect.bottom - rect.top)-16;
|
||||
rect.top += (int)(excess/2);
|
||||
rect.bottom -= (int)(excess/2);
|
||||
}
|
||||
rect.top += excess / 2;
|
||||
rect.bottom -= excess / 2;
|
||||
}
|
||||
DrawFrameControl(gdc,&rect,DFC_BUTTON,DFCS_BUTTONCHECK|DFCS_CHECKED);
|
||||
}
|
||||
|
||||
@ -577,11 +577,11 @@ void DisplayColumn(HWND hWnd,int SI,int c,int offset,HFONT hfont,HFONT hcolumnhe
|
||||
rect.left +=0;
|
||||
rect.right -=0;
|
||||
if((rect.bottom - rect.top)>24)
|
||||
{
|
||||
{
|
||||
excess=(rect.bottom - rect.top)-16;
|
||||
rect.top += (int)(excess/2);
|
||||
rect.bottom -= (int)(excess/2);
|
||||
}
|
||||
rect.top += excess / 2;
|
||||
rect.bottom -= excess / 2;
|
||||
}
|
||||
|
||||
|
||||
DrawFrameControl(gdc,&rect,DFC_BUTTON,DFCS_BUTTONCHECK);
|
||||
@ -1183,14 +1183,11 @@ void DisplayEditString(HWND hWnd,int SI,TCHAR* tstring)
|
||||
rt.right +=5;
|
||||
ShowCaret(hWnd);
|
||||
|
||||
{
|
||||
int rh,ah;
|
||||
rh=BGHS[SI].rowheight;
|
||||
ah=BGHS[SI].fontascentheight;
|
||||
|
||||
int rh = BGHS[SI].rowheight;
|
||||
int ah = BGHS[SI].fontascentheight;
|
||||
|
||||
SetCaretPos(rt.right-4,rt.top+(int)(rh/2)-ah+2);
|
||||
|
||||
}
|
||||
SetCaretPos(rt.right - 4, rt.top + (rh / 2)-ah + 2);
|
||||
|
||||
SelectObject(cdc,holdfont);
|
||||
ReleaseDC(hWnd,cdc);
|
||||
@ -1413,18 +1410,18 @@ LRESULT CALLBACK GridProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
if(lstrlen(BGHS[SelfIndex].title) > 0)
|
||||
{
|
||||
linecount=1;
|
||||
for(j=0;j<(int)lstrlen(BGHS[SelfIndex].title);j++)
|
||||
{
|
||||
if(BGHS[SelfIndex].title[j]=='\n')
|
||||
{
|
||||
for (j = 0; j<static_cast<int>(lstrlen(BGHS[SelfIndex].title)); j++)
|
||||
{
|
||||
if (BGHS[SelfIndex].title[j] == '\n')
|
||||
{
|
||||
linecount++;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
holdfont=(HFONT)SelectObject(gdc,BGHS[SelfIndex].htitlefont);
|
||||
GetTextExtentPoint32(gdc,BGHS[SelfIndex].title,lstrlen(BGHS[SelfIndex].title),&size);
|
||||
SelectObject(gdc,holdfont);
|
||||
BGHS[SelfIndex].titleheight = (int)((size.cy*1.2) * linecount);
|
||||
BGHS[SelfIndex].titleheight = static_cast<int>((size.cy*1.2) * linecount);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -3111,7 +3108,7 @@ int BinarySearchListBox(HWND lbhWnd,TCHAR* searchtext)
|
||||
if(lbcount < 12)
|
||||
{
|
||||
//not worth doing binary search, do regular search
|
||||
FindResult = static_cast<int32_t>(SendMessage(lbhWnd, LB_FINDSTRING, (unsigned int)-1, (LPARAM)searchtext));
|
||||
FindResult = static_cast<int32_t>(SendMessage(lbhWnd, LB_FINDSTRING, static_cast<unsigned int>(-1), reinterpret_cast<LPARAM>(searchtext)));
|
||||
ReturnValue = FindResult;
|
||||
return ReturnValue;
|
||||
}
|
||||
@ -3121,7 +3118,7 @@ int BinarySearchListBox(HWND lbhWnd,TCHAR* searchtext)
|
||||
tail = lbcount - 1;
|
||||
|
||||
//is it the head?
|
||||
SendMessage(lbhWnd,LB_GETTEXT,head,(LPARAM)headtext);
|
||||
SendMessage(lbhWnd, LB_GETTEXT, head, reinterpret_cast<LPARAM>(headtext));
|
||||
headtext[9] = 0x00;
|
||||
|
||||
p=lstrcmp(searchtext,headtext);
|
||||
@ -3141,7 +3138,7 @@ int BinarySearchListBox(HWND lbhWnd,TCHAR* searchtext)
|
||||
|
||||
|
||||
//is it the tail?
|
||||
SendMessage(lbhWnd,LB_GETTEXT,tail,(LPARAM)tailtext);
|
||||
SendMessage(lbhWnd, LB_GETTEXT, tail, reinterpret_cast<LPARAM>(tailtext));
|
||||
tailtext[9] = 0x00;
|
||||
p=lstrcmp(searchtext,tailtext);
|
||||
if(p==0)
|
||||
@ -3166,7 +3163,7 @@ int BinarySearchListBox(HWND lbhWnd,TCHAR* searchtext)
|
||||
{
|
||||
finger = head + ((tail - head) / 2);
|
||||
|
||||
SendMessage(lbhWnd,LB_GETTEXT,finger,(LPARAM)tbuffer);
|
||||
SendMessage(lbhWnd, LB_GETTEXT, finger, reinterpret_cast<LPARAM>(tbuffer));
|
||||
tbuffer[9] = 0x00;
|
||||
p=lstrcmp(tbuffer,searchtext);
|
||||
if(p==0)
|
||||
|
@ -639,19 +639,19 @@ INT_PTR CALLBACK MarginsDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM lPa
|
||||
HWND hBorderWidthSlider = ::GetDlgItem(_hSelf, IDC_BORDERWIDTH_SLIDER);
|
||||
if (reinterpret_cast<HWND>(lParam) == hCaretBlikRateSlider)
|
||||
{
|
||||
int blinkRate = (int)::SendMessage(hCaretBlikRateSlider, TBM_GETPOS, 0, 0);
|
||||
auto blinkRate = ::SendMessage(hCaretBlikRateSlider, TBM_GETPOS, 0, 0);
|
||||
if (blinkRate == BLINKRATE_SLOWEST)
|
||||
blinkRate = 0;
|
||||
nppGUI._caretBlinkRate = blinkRate;
|
||||
nppGUI._caretBlinkRate = static_cast<int>(blinkRate);
|
||||
|
||||
::SendMessage(::GetParent(_hParent), NPPM_INTERNAL_SETCARETBLINKRATE, 0, 0);
|
||||
}
|
||||
else if (reinterpret_cast<HWND>(lParam) == hBorderWidthSlider)
|
||||
{
|
||||
int borderWidth = (int)::SendMessage(hBorderWidthSlider, TBM_GETPOS, 0, 0);
|
||||
auto borderWidth = ::SendMessage(hBorderWidthSlider, TBM_GETPOS, 0, 0);
|
||||
ScintillaViewParams & svp = (ScintillaViewParams &)pNppParam->getSVP();
|
||||
svp._borderWidth = borderWidth;
|
||||
::SetDlgItemInt(_hSelf, IDC_BORDERWIDTHVAL_STATIC, borderWidth, FALSE);
|
||||
svp._borderWidth = static_cast<int>(borderWidth);
|
||||
::SetDlgItemInt(_hSelf, IDC_BORDERWIDTHVAL_STATIC, static_cast<UINT>(borderWidth), FALSE);
|
||||
::SendMessage(::GetParent(_hParent), WM_SIZE, 0, 0);
|
||||
}
|
||||
return 0; //return zero when handled
|
||||
|
@ -44,8 +44,8 @@
|
||||
#define INDEX_LEAF 5
|
||||
#define INDEX_LEAF_INVALID 6
|
||||
|
||||
#define GET_X_LPARAM(lp) ((int)(short)LOWORD(lp))
|
||||
#define GET_Y_LPARAM(lp) ((int)(short)HIWORD(lp))
|
||||
#define GET_X_LPARAM(lp) LOWORD(lp)
|
||||
#define GET_Y_LPARAM(lp) HIWORD(lp)
|
||||
|
||||
INT_PTR CALLBACK ProjectPanel::run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
|
@ -245,7 +245,7 @@ INT_PTR CALLBACK RunDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM)
|
||||
int const posBase = 2;
|
||||
|
||||
if (nbCmd == 0)
|
||||
::InsertMenu(hRunMenu, posBase - 1, MF_BYPOSITION, (unsigned int)-1, 0);
|
||||
::InsertMenu(hRunMenu, posBase - 1, MF_BYPOSITION, static_cast<unsigned int>(-1), 0);
|
||||
|
||||
theUserCmds.push_back(uc);
|
||||
::InsertMenu(hRunMenu, posBase + nbCmd, MF_BYPOSITION, cmdID, uc.toMenuItemString().c_str());
|
||||
@ -254,7 +254,7 @@ INT_PTR CALLBACK RunDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM)
|
||||
if (nbCmd == 0)
|
||||
{
|
||||
// Insert the separator and modify/delete command
|
||||
::InsertMenu(hRunMenu, posBase + nbCmd + 1, MF_BYPOSITION, (unsigned int)-1, 0);
|
||||
::InsertMenu(hRunMenu, posBase + nbCmd + 1, MF_BYPOSITION, static_cast<unsigned int>(-1), 0);
|
||||
NativeLangSpeaker *pNativeLangSpeaker = nppParams->getNativeLangSpeaker();
|
||||
generic_string nativeLangShortcutMapperMacro = pNativeLangSpeaker->getNativeLangMenuString(IDM_SETTING_SHORTCUT_MAPPER_MACRO);
|
||||
if (nativeLangShortcutMapperMacro == TEXT(""))
|
||||
|
@ -128,7 +128,7 @@ void StatusBar::adjustParts(int clientWidth)
|
||||
// copy the coordinates to the array.
|
||||
int nWidth = std::max<int>(clientWidth - 20, 0);
|
||||
|
||||
for (int i = (int)_partWidthArray.size() - 1; i >= 0; i--)
|
||||
for (int i = static_cast<int>(_partWidthArray.size()) - 1; i >= 0; i--)
|
||||
{
|
||||
_lpParts[i] = nWidth;
|
||||
nWidth -= _partWidthArray[i];
|
||||
|
@ -25,8 +25,6 @@
|
||||
// along with this program; if not, write to the Free Software
|
||||
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
|
||||
|
||||
#include <stdexcept>
|
||||
#include "TaskList.h"
|
||||
#include "TaskListDlg_rc.h"
|
||||
|
@ -26,8 +26,7 @@
|
||||
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
|
||||
#ifndef TASKLIST_H
|
||||
#define TASKLIST_H
|
||||
#pragma once
|
||||
|
||||
#include <windows.h>
|
||||
#include <commctrl.h>
|
||||
@ -77,5 +76,3 @@ protected:
|
||||
RECT _rc;
|
||||
};
|
||||
|
||||
|
||||
#endif // TASKLIST_H
|
||||
|
@ -455,13 +455,13 @@ bool ReBar::addBand(REBARBANDINFO * rBand, bool useID)
|
||||
|
||||
void ReBar::reNew(int id, REBARBANDINFO * rBand)
|
||||
{
|
||||
int index = (int)SendMessage(_hSelf, RB_IDTOINDEX, (WPARAM)id, 0);
|
||||
auto index = SendMessage(_hSelf, RB_IDTOINDEX, (WPARAM)id, 0);
|
||||
::SendMessage(_hSelf, RB_SETBANDINFO, (WPARAM)index, (LPARAM)rBand);
|
||||
};
|
||||
|
||||
void ReBar::removeBand(int id)
|
||||
{
|
||||
int index = (int)SendMessage(_hSelf, RB_IDTOINDEX, (WPARAM)id, 0);
|
||||
auto index = SendMessage(_hSelf, RB_IDTOINDEX, (WPARAM)id, 0);
|
||||
if (id >= REBAR_BAR_EXTERNAL)
|
||||
releaseID(id);
|
||||
::SendMessage(_hSelf, RB_DELETEBAND, (WPARAM)index, (LPARAM)0);
|
||||
@ -469,7 +469,7 @@ void ReBar::removeBand(int id)
|
||||
|
||||
void ReBar::setIDVisible(int id, bool show)
|
||||
{
|
||||
int index = (int)SendMessage(_hSelf, RB_IDTOINDEX, (WPARAM)id, 0);
|
||||
auto index = SendMessage(_hSelf, RB_IDTOINDEX, (WPARAM)id, 0);
|
||||
if (index == -1 )
|
||||
return; //error
|
||||
|
||||
@ -489,7 +489,7 @@ void ReBar::setIDVisible(int id, bool show)
|
||||
|
||||
bool ReBar::getIDVisible(int id)
|
||||
{
|
||||
int index = (int)SendMessage(_hSelf, RB_IDTOINDEX, (WPARAM)id, 0);
|
||||
auto index = SendMessage(_hSelf, RB_IDTOINDEX, (WPARAM)id, 0);
|
||||
if (index == -1 )
|
||||
return false; //error
|
||||
REBARBANDINFO rbBand;
|
||||
@ -504,7 +504,7 @@ bool ReBar::getIDVisible(int id)
|
||||
|
||||
void ReBar::setGrayBackground(int id)
|
||||
{
|
||||
int index = (int)SendMessage(_hSelf, RB_IDTOINDEX, (WPARAM)id, 0);
|
||||
auto index = SendMessage(_hSelf, RB_IDTOINDEX, (WPARAM)id, 0);
|
||||
if (index == -1 )
|
||||
return; //error
|
||||
REBARBANDINFO rbBand;
|
||||
|
@ -162,8 +162,8 @@ struct BufferEquivalent
|
||||
}
|
||||
else if (_iColumn == 2)
|
||||
{
|
||||
int t1 = (int)b1->getLangType();
|
||||
int t2 = (int)b2->getLangType();
|
||||
auto t1 = b1->getLangType();
|
||||
auto t2 = b2->getLangType();
|
||||
return (t1 < t2); // yeah should be the name
|
||||
}
|
||||
return false;
|
||||
@ -429,7 +429,7 @@ void WindowsDlg::updateButtonState()
|
||||
int WindowsDlg::doDialog(TiXmlNodeA *dlgNode)
|
||||
{
|
||||
_dlgNode = dlgNode;
|
||||
return (int)::DialogBoxParam(_hInst, MAKEINTRESOURCE(IDD_WINDOWS), _hParent, dlgProc, reinterpret_cast<LPARAM>(this));
|
||||
return static_cast<int>(DialogBoxParam(_hInst, MAKEINTRESOURCE(IDD_WINDOWS), _hParent, dlgProc, reinterpret_cast<LPARAM>(this)));
|
||||
};
|
||||
|
||||
bool WindowsDlg::changeDlgLang()
|
||||
@ -602,8 +602,8 @@ void WindowsDlg::fitColumnsToSize()
|
||||
if (GetClientRect(_hList, &rc))
|
||||
{
|
||||
int len = (rc.right - rc.left);
|
||||
len -= (int)SendMessage(_hList, LVM_GETCOLUMNWIDTH, 0, 0);
|
||||
len -= (int)SendMessage(_hList, LVM_GETCOLUMNWIDTH, 2, 0);
|
||||
len -= static_cast<int>(SendMessage(_hList, LVM_GETCOLUMNWIDTH, 0, 0));
|
||||
len -= static_cast<int>(SendMessage(_hList, LVM_GETCOLUMNWIDTH, 2, 0));
|
||||
len -= GetSystemMetrics(SM_CXVSCROLL);
|
||||
len -= 1;
|
||||
SendMessage(_hList, LVM_SETCOLUMNWIDTH, 1, len);
|
||||
@ -719,7 +719,9 @@ void WindowsDlg::doClose()
|
||||
else
|
||||
{
|
||||
// select first previously selected item (or last one if only the last one was removed)
|
||||
if (index == (int)_idxMap.size()) index --;
|
||||
if (index == static_cast<int>(_idxMap.size()))
|
||||
index -= 1;
|
||||
|
||||
if (index >= 0)
|
||||
{
|
||||
ListView_SetItemState(_hList, index, LVIS_SELECTED, LVIS_SELECTED);
|
||||
|
@ -585,7 +585,7 @@ void Accelerator::updateFullMenu() {
|
||||
|
||||
void Accelerator::updateMenuItemByCommand(CommandShortcut csc)
|
||||
{
|
||||
int cmdID = (int)csc.getID();
|
||||
int cmdID = csc.getID();
|
||||
|
||||
// Ensure that the menu item checks set prior to this update remain in affect.
|
||||
UINT cmdFlags = GetMenuState(_hAccelMenu, cmdID, MF_BYCOMMAND );
|
||||
|
@ -195,7 +195,7 @@ void LastRecentFileList::remove(const TCHAR *fn)
|
||||
remove(index);
|
||||
};
|
||||
|
||||
void LastRecentFileList::remove(int index)
|
||||
void LastRecentFileList::remove(size_t index)
|
||||
{
|
||||
if (_size == 0 || _locked)
|
||||
return;
|
||||
|
@ -52,7 +52,7 @@ public:
|
||||
|
||||
void add(const TCHAR *fn);
|
||||
void remove(const TCHAR *fn);
|
||||
void remove(int index);
|
||||
void remove(size_t index);
|
||||
void clear();
|
||||
|
||||
int getSize() {
|
||||
|
@ -840,8 +840,6 @@ void NativeLangSpeaker::changeShortcutLang()
|
||||
NppParameters * pNppParam = NppParameters::getInstance();
|
||||
vector<CommandShortcut> & mainshortcuts = pNppParam->getUserShortcuts();
|
||||
vector<ScintillaKeyMap> & scinshortcuts = pNppParam->getScintillaKeyList();
|
||||
int mainSize = (int)mainshortcuts.size();
|
||||
int scinSize = (int)scinshortcuts.size();
|
||||
|
||||
TiXmlNodeA *shortcuts = _nativeLangA->FirstChild("Shortcuts");
|
||||
if (!shortcuts) return;
|
||||
@ -860,7 +858,8 @@ void NativeLangSpeaker::changeShortcutLang()
|
||||
int index, id;
|
||||
if (element->Attribute("index", &index) && element->Attribute("id", &id))
|
||||
{
|
||||
if (index > -1 && index < mainSize) { //valid index only
|
||||
if (index > -1 && static_cast<size_t>(index) < mainshortcuts.size()) //valid index only
|
||||
{
|
||||
const char *name = element->Attribute("name");
|
||||
CommandShortcut & csc = mainshortcuts[index];
|
||||
if (csc.getID() == (unsigned long)id)
|
||||
@ -891,7 +890,8 @@ void NativeLangSpeaker::changeShortcutLang()
|
||||
int index;
|
||||
if (element->Attribute("index", &index))
|
||||
{
|
||||
if (index > -1 && index < scinSize) { //valid index only
|
||||
if (index > -1 && static_cast<size_t>(index) < scinshortcuts.size()) //valid index only
|
||||
{
|
||||
const char *name = element->Attribute("name");
|
||||
ScintillaKeyMap & skm = scinshortcuts[index];
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user