[ENHANCEMENT] Enhance the performance to get once the length in the for loop.
git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository/trunk@1041 f5eea248-9336-0410-98b8-ebc06183d4e3
This commit is contained in:
parent
0fd29adc40
commit
a62ecb6449
@ -89,9 +89,9 @@ bool isInListA(const char *token, const char *list) {
|
||||
if ((!token) || (!list))
|
||||
return false;
|
||||
char word[64];
|
||||
int i = 0;
|
||||
int j = 0;
|
||||
for (; i <= int(strlen(list)) ; i++)
|
||||
size_t i = 0;
|
||||
size_t j = 0;
|
||||
for (size_t len = strlen(list); i <= len; i++)
|
||||
{
|
||||
if ((list[i] == ' ')||(list[i] == '\0'))
|
||||
{
|
||||
|
@ -218,9 +218,9 @@ bool isInList(const TCHAR *token, const TCHAR *list) {
|
||||
if ((!token) || (!list))
|
||||
return false;
|
||||
TCHAR word[64];
|
||||
int i = 0;
|
||||
int j = 0;
|
||||
for (; i <= int(lstrlen(list)) ; i++)
|
||||
size_t i = 0;
|
||||
size_t j = 0;
|
||||
for (size_t len = lstrlen(list); i <= len; i++)
|
||||
{
|
||||
if ((list[i] == ' ')||(list[i] == '\0'))
|
||||
{
|
||||
|
@ -263,16 +263,15 @@ bool PluginsManager::loadPlugins(const TCHAR *dir)
|
||||
}
|
||||
::FindClose(hFindFile);
|
||||
|
||||
size_t i = 0;
|
||||
|
||||
for ( ; i < dllNames.size() ; i++)
|
||||
for (size_t i = 0, len = dllNames.size(); i < len ; i++)
|
||||
{
|
||||
loadPlugin(dllNames[i].c_str(), dll2Remove);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
for (size_t j = 0 ; j < dll2Remove.size() ; j++)
|
||||
for (size_t j = 0, len = dll2Remove.size() ; j < len ; j++)
|
||||
::DeleteFile(dll2Remove[j].c_str());
|
||||
|
||||
return true;
|
||||
@ -287,7 +286,7 @@ bool PluginsManager::getShortcutByCmdID(int cmdID, ShortcutKey *sk)
|
||||
|
||||
const vector<PluginCmdShortcut> & pluginCmdSCList = (NppParameters::getInstance())->getPluginCommandList();
|
||||
|
||||
for (size_t i = 0 ; i < pluginCmdSCList.size() ; i++)
|
||||
for (size_t i = 0, len = pluginCmdSCList.size(); i < len ; i++)
|
||||
{
|
||||
if (pluginCmdSCList[i].getID() == (unsigned long)cmdID)
|
||||
{
|
||||
@ -363,8 +362,7 @@ HMENU PluginsManager::setMenu(HMENU hMenu, const TCHAR *menuName)
|
||||
::InsertMenu(hMenu, MENUINDEX_PLUGINS, MF_BYPOSITION | MF_POPUP, (UINT_PTR)_hPluginsMenu, nom_menu);
|
||||
}
|
||||
|
||||
size_t i = 0;
|
||||
for ( ; i < _pluginInfos.size() ; i++)
|
||||
for (size_t i = 0, len = _pluginInfos.size() ; i < len ; i++)
|
||||
{
|
||||
addInMenuFromPMIndex(i);
|
||||
}
|
||||
@ -396,7 +394,7 @@ void PluginsManager::runPluginCommand(size_t i)
|
||||
|
||||
void PluginsManager::runPluginCommand(const TCHAR *pluginName, int commandID)
|
||||
{
|
||||
for (size_t i = 0 ; i < _pluginsCommands.size() ; i++)
|
||||
for (size_t i = 0, len = _pluginsCommands.size() ; i < len ; i++)
|
||||
{
|
||||
if (!generic_stricmp(_pluginsCommands[i]._pluginName.c_str(), pluginName))
|
||||
{
|
||||
@ -418,7 +416,7 @@ void PluginsManager::runPluginCommand(const TCHAR *pluginName, int commandID)
|
||||
|
||||
void PluginsManager::notify(SCNotification *notification)
|
||||
{
|
||||
for (size_t i = 0 ; i < _pluginInfos.size() ; i++)
|
||||
for (size_t i = 0, len = _pluginInfos.size() ; i < len ; i++)
|
||||
{
|
||||
if (_pluginInfos[i]->_hLib)
|
||||
{
|
||||
@ -441,7 +439,7 @@ void PluginsManager::notify(SCNotification *notification)
|
||||
|
||||
void PluginsManager::relayNppMessages(UINT Message, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
for (size_t i = 0 ; i < _pluginInfos.size() ; i++)
|
||||
for (size_t i = 0, len = _pluginInfos.size(); i < len ; i++)
|
||||
{
|
||||
if (_pluginInfos[i]->_hLib)
|
||||
{
|
||||
@ -464,7 +462,7 @@ bool PluginsManager::relayPluginMessages(UINT Message, WPARAM wParam, LPARAM lPa
|
||||
if (!moduleName || !moduleName[0] || !lParam)
|
||||
return false;
|
||||
|
||||
for (size_t i = 0 ; i < _pluginInfos.size() ; i++)
|
||||
for (size_t i = 0, len = _pluginInfos.size() ; i < len ; i++)
|
||||
{
|
||||
if (_pluginInfos[i]->_moduleName == moduleName)
|
||||
{
|
||||
|
@ -87,7 +87,7 @@ public:
|
||||
_markerAlloc(MARKER_PLUGINS, MARKER_PLUGINS_LIMIT) {};
|
||||
~PluginsManager() {
|
||||
|
||||
for (size_t i = 0 ; i < _pluginInfos.size() ; i++)
|
||||
for (size_t i = 0, len = _pluginInfos.size(); i < len; i++)
|
||||
delete _pluginInfos[i];
|
||||
|
||||
if (_hPluginsMenu)
|
||||
|
@ -458,7 +458,7 @@ LRESULT Notepad_plus::init(HWND hwnd)
|
||||
|
||||
if (nppGUI._excludedLangList.size() > 0)
|
||||
{
|
||||
for (size_t i = 0 ; i < nppGUI._excludedLangList.size() ; i++)
|
||||
for (size_t i = 0, len = nppGUI._excludedLangList.size(); i < len ; i++)
|
||||
{
|
||||
int cmdID = pNppParam->langTypeToCommandID(nppGUI._excludedLangList[i]._langType);
|
||||
const int itemSize = 256;
|
||||
@ -474,7 +474,7 @@ LRESULT Notepad_plus::init(HWND hwnd)
|
||||
// Add User Define Languages Entry
|
||||
int udlpos = ::GetMenuItemCount(hLangMenu) - 1;
|
||||
|
||||
for (int i = 0 ; i < pNppParam->getNbUserLang() ; i++)
|
||||
for (int i = 0, len = pNppParam->getNbUserLang(); i < len ; i++)
|
||||
{
|
||||
UserLangContainer & userLangContainer = pNppParam->getULCFromIndex(i);
|
||||
::InsertMenu(hLangMenu, udlpos + i, MF_BYPOSITION, IDM_LANG_USER + i + 1, userLangContainer.getName());
|
||||
@ -638,7 +638,7 @@ LRESULT Notepad_plus::init(HWND hwnd)
|
||||
_dockingManager.setDockedContSize(CONT_TOP , nppGUI._dockingData._topHeight);
|
||||
_dockingManager.setDockedContSize(CONT_BOTTOM, nppGUI._dockingData._bottomHight);
|
||||
|
||||
for (size_t i = 0 ; i < dmd._pluginDockInfo.size() ; i++)
|
||||
for (size_t i = 0, len = dmd._pluginDockInfo.size(); i < len ; i++)
|
||||
{
|
||||
PluginDlgDockingInfo & pdi = dmd._pluginDockInfo[i];
|
||||
if (pdi._isVisible)
|
||||
@ -654,7 +654,7 @@ LRESULT Notepad_plus::init(HWND hwnd)
|
||||
}
|
||||
}
|
||||
|
||||
for (size_t i = 0 ; i < dmd._containerTabInfo.size() ; i++)
|
||||
for (size_t i = 0, len = dmd._containerTabInfo.size(); i < len; i++)
|
||||
{
|
||||
ContainerTabInfo & cti = dmd._containerTabInfo[i];
|
||||
_dockingManager.setActiveTab(cti._cont, cti._activeTab);
|
||||
@ -792,12 +792,12 @@ void Notepad_plus::saveDockingParams()
|
||||
// save every container
|
||||
vector<DockingCont*> vCont = _dockingManager.getContainerInfo();
|
||||
|
||||
for (size_t i = 0 ; i < vCont.size() ; i++)
|
||||
for (size_t i = 0, len = vCont.size(); i < len ; i++)
|
||||
{
|
||||
// save at first the visible Tb's
|
||||
vector<tTbData *> vDataVis = vCont[i]->getDataOfVisTb();
|
||||
|
||||
for (size_t j = 0 ; j < vDataVis.size() ; j++)
|
||||
for (size_t j = 0, len2 = vDataVis.size(); j < len2 ; j++)
|
||||
{
|
||||
if (vDataVis[j]->pszName && vDataVis[j]->pszName[0])
|
||||
{
|
||||
@ -809,7 +809,7 @@ void Notepad_plus::saveDockingParams()
|
||||
// save the hidden Tb's
|
||||
vector<tTbData *> vDataAll = vCont[i]->getDataOfAllTb();
|
||||
|
||||
for (size_t j = 0 ; j < vDataAll.size() ; j++)
|
||||
for (size_t j = 0, len3 = vDataAll.size(); j < len3 ; j++)
|
||||
{
|
||||
if ((vDataAll[j]->pszName && vDataAll[j]->pszName[0]) && (!vCont[i]->isTbVis(vDataAll[j])))
|
||||
{
|
||||
@ -836,10 +836,10 @@ void Notepad_plus::saveDockingParams()
|
||||
UCHAR floatContArray[50];
|
||||
memset(floatContArray, 0, 50);
|
||||
|
||||
for (size_t i = 0 ; i < nppGUI._dockingData._pluginDockInfo.size() ; i++)
|
||||
for (size_t i = 0, len4 = nppGUI._dockingData._pluginDockInfo.size(); i < len4 ; i++)
|
||||
{
|
||||
BOOL isStored = FALSE;
|
||||
for (size_t j = 0; j < vPluginDockInfo.size(); j++)
|
||||
for (size_t j = 0, len5 = vPluginDockInfo.size(); j < len5; j++)
|
||||
{
|
||||
if (nppGUI._dockingData._pluginDockInfo[i] == vPluginDockInfo[j])
|
||||
{
|
||||
@ -999,7 +999,7 @@ bool Notepad_plus::replaceInOpenedFiles() {
|
||||
|
||||
if (_mainWindowStatus & WindowMainActive)
|
||||
{
|
||||
for (int i = 0 ; i < _mainDocTab.nbItem() ; i++)
|
||||
for (int i = 0, len = _mainDocTab.nbItem(); i < len ; i++)
|
||||
{
|
||||
pBuf = MainFileManager->getBufferByID(_mainDocTab.getBufferByIndex(i));
|
||||
if (pBuf->isReadOnly())
|
||||
@ -1016,7 +1016,7 @@ bool Notepad_plus::replaceInOpenedFiles() {
|
||||
|
||||
if (_mainWindowStatus & WindowSubActive)
|
||||
{
|
||||
for (int i = 0 ; i < _subDocTab.nbItem() ; i++)
|
||||
for (int i = 0, len = _subDocTab.nbItem(); i < len; i++)
|
||||
{
|
||||
pBuf = MainFileManager->getBufferByID(_subDocTab.getBufferByIndex(i));
|
||||
if (pBuf->isReadOnly())
|
||||
@ -1051,7 +1051,7 @@ bool Notepad_plus::replaceInOpenedFiles() {
|
||||
|
||||
bool Notepad_plus::matchInList(const TCHAR *fileName, const vector<generic_string> & patterns)
|
||||
{
|
||||
for (size_t i = 0 ; i < patterns.size() ; i++)
|
||||
for (size_t i = 0, len = patterns.size() ; i < len ; i++)
|
||||
{
|
||||
if (PathMatchSpec(fileName, patterns[i].c_str()))
|
||||
return true;
|
||||
@ -1391,7 +1391,7 @@ bool Notepad_plus::replaceInFiles()
|
||||
CancelThreadHandle = ::CreateThread(NULL, 0, AsyncCancelFindInFiles, _pPublicInterface->getHSelf(), 0, NULL);
|
||||
|
||||
bool dontClose = false;
|
||||
for (size_t i = 0 ; i < fileNames.size() ; i++)
|
||||
for (size_t i = 0, len = fileNames.size(); i < len ; i++)
|
||||
{
|
||||
MSG msg;
|
||||
if (PeekMessage(&msg, _pPublicInterface->getHSelf(), NPPM_INTERNAL_CANCEL_FIND_IN_FILES, NPPM_INTERNAL_CANCEL_FIND_IN_FILES, PM_REMOVE)) break;
|
||||
@ -1474,7 +1474,7 @@ bool Notepad_plus::findInFiles()
|
||||
_findReplaceDlg.beginNewFilesSearch();
|
||||
|
||||
bool dontClose = false;
|
||||
for (size_t i = 0 ; i < fileNames.size() ; i++)
|
||||
for (size_t i = 0, len = fileNames.size(); i < len; i++)
|
||||
{
|
||||
MSG msg;
|
||||
if (PeekMessage(&msg, _pPublicInterface->getHSelf(), NPPM_INTERNAL_CANCEL_FIND_IN_FILES, NPPM_INTERNAL_CANCEL_FIND_IN_FILES, PM_REMOVE)) break;
|
||||
@ -1535,7 +1535,7 @@ bool Notepad_plus::findInOpenedFiles()
|
||||
|
||||
if (_mainWindowStatus & WindowMainActive)
|
||||
{
|
||||
for (int i = 0 ; i < _mainDocTab.nbItem() ; i++)
|
||||
for (int i = 0, len = _mainDocTab.nbItem(); i < len ; i++)
|
||||
{
|
||||
pBuf = MainFileManager->getBufferByID(_mainDocTab.getBufferByIndex(i));
|
||||
_invisibleEditView.execute(SCI_SETDOCPOINTER, 0, pBuf->getDocument());
|
||||
@ -1547,7 +1547,7 @@ bool Notepad_plus::findInOpenedFiles()
|
||||
|
||||
if (_mainWindowStatus & WindowSubActive)
|
||||
{
|
||||
for (int i = 0 ; i < _subDocTab.nbItem() ; i++)
|
||||
for (int i = 0, len2 = _subDocTab.nbItem(); i < len2 ; i++)
|
||||
{
|
||||
pBuf = MainFileManager->getBufferByID(_subDocTab.getBufferByIndex(i));
|
||||
_invisibleEditView.execute(SCI_SETDOCPOINTER, 0, pBuf->getDocument());
|
||||
@ -2129,7 +2129,7 @@ void Notepad_plus::addHotSpot()
|
||||
|
||||
// Search the style
|
||||
int fs = -1;
|
||||
for (size_t i = 0 ; i < hotspotPairs.size() ; i++)
|
||||
for (size_t i = 0, len = hotspotPairs.size(); i < len ; i++)
|
||||
{
|
||||
// make sure to ignore "hotspot bit" when comparing document style with archived hotspot style
|
||||
if ((hotspotPairs[i] & ~mask) == (idStyle & ~mask))
|
||||
@ -3342,7 +3342,7 @@ static generic_string extractSymbol(TCHAR firstChar, TCHAR secondChar, const TCH
|
||||
bool found = false;
|
||||
TCHAR extracted[128] = TEXT("");
|
||||
|
||||
for (int i = 0, j = 0 ; i < lstrlen(str2extract) ; i++)
|
||||
for (size_t i = 0, j = 0, len = lstrlen(str2extract) ; i < len ; i++)
|
||||
{
|
||||
if (found)
|
||||
{
|
||||
@ -4145,7 +4145,7 @@ bool Notepad_plus::getIntegralDockingData(tTbData & dockData, int & iCont, bool
|
||||
{
|
||||
DockingManagerData & dockingData = (DockingManagerData &)(NppParameters::getInstance())->getNppGUI()._dockingData;
|
||||
|
||||
for (size_t i = 0 ; i < dockingData._pluginDockInfo.size() ; i++)
|
||||
for (size_t i = 0, len = dockingData._pluginDockInfo.size(); i < len ; i++)
|
||||
{
|
||||
const PluginDlgDockingInfo & pddi = dockingData._pluginDockInfo[i];
|
||||
|
||||
@ -4181,7 +4181,7 @@ void Notepad_plus::getCurrentOpenedFiles(Session & session)
|
||||
//Buffer * mainBuf = _mainEditView.getCurrentBuffer();
|
||||
//Buffer * subBuf = _subEditView.getCurrentBuffer();
|
||||
Document oldDoc = _invisibleEditView.execute(SCI_GETDOCPOINTER);
|
||||
for (int i = 0 ; i < _mainDocTab.nbItem() ; i++)
|
||||
for (int i = 0, len = _mainDocTab.nbItem(); i < len ; i++)
|
||||
{
|
||||
BufferID bufID = _mainDocTab.getBufferByIndex(i);
|
||||
Buffer * buf = MainFileManager->getBufferByID(bufID);
|
||||
@ -4238,7 +4238,7 @@ void Notepad_plus::getCurrentOpenedFiles(Session & session)
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0 ; i < _subDocTab.nbItem() ; i++)
|
||||
for (int i = 0, len = _subDocTab.nbItem(); i < len ; i++)
|
||||
{
|
||||
BufferID bufID = _subDocTab.getBufferByIndex(i);
|
||||
Buffer * buf = MainFileManager->getBufferByID(bufID);
|
||||
@ -4597,7 +4597,7 @@ void Notepad_plus::loadCommandlineParams(const TCHAR * commandLine, CmdLineParam
|
||||
bool readOnly = pCmdParams->_isReadOnly;
|
||||
|
||||
BufferID lastOpened = BUFFER_INVALID;
|
||||
for (int i = 0 ; i < fnss.size() ; i++)
|
||||
for (int i = 0, len = fnss.size(); i < len ; i++)
|
||||
{
|
||||
pFn = fnss.getFileName(i);
|
||||
BufferID bufID = doOpen(pFn, readOnly);
|
||||
@ -4670,7 +4670,7 @@ void Notepad_plus::setFindReplaceFolderFilter(const TCHAR *dir, const TCHAR *fil
|
||||
fltr = TEXT("");
|
||||
vector<generic_string> vStr;
|
||||
cutString(ext, vStr);
|
||||
for (size_t i = 0; i < vStr.size(); i++)
|
||||
for (size_t i = 0 ,len = vStr.size(); i < len; i++)
|
||||
{
|
||||
fltr += TEXT("*.");
|
||||
fltr += vStr[i] + TEXT(" ");
|
||||
@ -5303,7 +5303,7 @@ int Notepad_plus::getRandomAction(int ranNum)
|
||||
|
||||
bool isInList(int elem, vector<int> elemList)
|
||||
{
|
||||
for (size_t i = 0; i < elemList.size(); i++)
|
||||
for (size_t i = 0, len = elemList.size(); i < len; i++)
|
||||
{
|
||||
if (elem == elemList[i])
|
||||
return true;
|
||||
@ -5337,7 +5337,7 @@ DWORD WINAPI Notepad_plus::threadTextPlayer(void *params)
|
||||
int nbTrolling = 0;
|
||||
vector<int> generatedRans;
|
||||
char previousChar = '\0';
|
||||
for (size_t i = 0 ; i < strlen(text2display) ; i++)
|
||||
for (size_t i = 0, len = strlen(text2display); i < len ; i++)
|
||||
{
|
||||
int ranNum = getRandomNumber(maxRange);
|
||||
|
||||
@ -5402,7 +5402,7 @@ DWORD WINAPI Notepad_plus::threadTextPlayer(void *params)
|
||||
::SendMessage(curScintilla, SCI_GOTOPOS, ::SendMessage(curScintilla, SCI_GETLENGTH, 0, 0), 0);
|
||||
|
||||
// Display quoter
|
||||
for (size_t i = 0 ; i < strlen(quoter) ; i++)
|
||||
for (size_t i = 0, len = strlen(quoter); i < len; i++)
|
||||
{
|
||||
int ranNum = getRandomNumber(maxRange);
|
||||
|
||||
@ -5436,7 +5436,7 @@ DWORD WINAPI Notepad_plus::threadTextTroller(void *params)
|
||||
BufferID targetBufID = ((TextTrollerParams *)params)->_targetBufID;
|
||||
//HANDLE mutex = ((TextTrollerParams *)params)->_mutex;
|
||||
|
||||
for (size_t i = 0 ; i < strlen(text2display) ; i++)
|
||||
for (size_t i = 0, len = strlen(text2display); i < len; i++)
|
||||
{
|
||||
char charToShow[2] = {text2display[i], '\0'};
|
||||
int ranNum = getRandomNumber(maxRange);
|
||||
@ -5478,7 +5478,7 @@ DWORD WINAPI Notepad_plus::threadTextTroller(void *params)
|
||||
}
|
||||
else if (delMethod == 2)
|
||||
{
|
||||
for (size_t j = 0; j < strlen(text2display); j++)
|
||||
for (size_t j = 0, len = strlen(text2display); j < len; j++)
|
||||
{
|
||||
if (!selectBack(pCurrentView, targetBufID))
|
||||
break;
|
||||
|
@ -167,7 +167,7 @@ void Notepad_plus_Window::init(HINSTANCE hInst, HWND parent, const TCHAR *cmdLin
|
||||
PathAppend(localizationDir, TEXT("localization\\"));
|
||||
|
||||
_notepad_plus_plus_core.getMatchedFileNames(localizationDir.c_str(), patterns, fileNames, false, false);
|
||||
for (size_t i = 0 ; i < fileNames.size() ; i++)
|
||||
for (size_t i = 0, len = fileNames.size(); i < len ; i++)
|
||||
{
|
||||
localizationSwitcher.addLanguageFromXml(fileNames[i].c_str());
|
||||
}
|
||||
@ -185,7 +185,7 @@ void Notepad_plus_Window::init(HINSTANCE hInst, HWND parent, const TCHAR *cmdLin
|
||||
themeDir = pNppParams->getAppDataNppDir();
|
||||
PathAppend(themeDir, TEXT("themes\\"));
|
||||
_notepad_plus_plus_core.getMatchedFileNames(themeDir.c_str(), patterns, fileNames, false, false);
|
||||
for (size_t i = 0 ; i < fileNames.size() ; i++)
|
||||
for (size_t i = 0, len = fileNames.size() ; i < len ; i++)
|
||||
{
|
||||
themeSwitcher.addThemeFromXml(fileNames[i].c_str());
|
||||
}
|
||||
@ -195,7 +195,7 @@ void Notepad_plus_Window::init(HINSTANCE hInst, HWND parent, const TCHAR *cmdLin
|
||||
themeDir = nppDir.c_str(); // <- should use the pointer to avoid the constructor of copy
|
||||
PathAppend(themeDir, TEXT("themes\\"));
|
||||
_notepad_plus_plus_core.getMatchedFileNames(themeDir.c_str(), patterns, fileNames, false, false);
|
||||
for (size_t i = 0 ; i < fileNames.size() ; i++)
|
||||
for (size_t i = 0, len = fileNames.size(); i < len ; i++)
|
||||
{
|
||||
generic_string themeName( themeSwitcher.getThemeFromXmlFileName(fileNames[i].c_str()) );
|
||||
if (! themeSwitcher.themeNameExists(themeName.c_str()) )
|
||||
@ -204,7 +204,7 @@ void Notepad_plus_Window::init(HINSTANCE hInst, HWND parent, const TCHAR *cmdLin
|
||||
}
|
||||
}
|
||||
|
||||
for (size_t i = 0 ; i < _notepad_plus_plus_core._internalFuncIDs.size() ; i++)
|
||||
for (size_t i = 0, len = _notepad_plus_plus_core._internalFuncIDs.size() ; i < len ; i++)
|
||||
::SendMessage(_hSelf, WM_COMMAND, _notepad_plus_plus_core._internalFuncIDs[i], 0);
|
||||
|
||||
// Notify plugins that Notepad++ is ready
|
||||
@ -227,7 +227,7 @@ void Notepad_plus_Window::init(HINSTANCE hInst, HWND parent, const TCHAR *cmdLin
|
||||
|
||||
bool Notepad_plus_Window::isDlgsMsg(MSG *msg, bool unicodeSupported) const
|
||||
{
|
||||
for (size_t i = 0; i < _notepad_plus_plus_core._hModelessDlgs.size(); i++)
|
||||
for (size_t i = 0, len = _notepad_plus_plus_core._hModelessDlgs.size(); i < len; i++)
|
||||
{
|
||||
if (unicodeSupported?(::IsDialogMessageW(_notepad_plus_plus_core._hModelessDlgs[i], msg)):(::IsDialogMessageA(_notepad_plus_plus_core._hModelessDlgs[i], msg)))
|
||||
return true;
|
||||
|
@ -814,7 +814,7 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPa
|
||||
lstrcpy(sessionFileArray[i++], pFn);
|
||||
}
|
||||
|
||||
for (size_t j = 0 ; j < session2Load.nbSubFiles() ; j++)
|
||||
for (size_t j = 0, len = session2Load.nbSubFiles(); j < len ; j++)
|
||||
{
|
||||
const TCHAR *pFn = session2Load._subViewFiles[j]._fileName.c_str();
|
||||
lstrcpy(sessionFileArray[i++], pFn);
|
||||
@ -1215,7 +1215,7 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPa
|
||||
{
|
||||
if (wParam == MODELESSDIALOGADD)
|
||||
{
|
||||
for (size_t i = 0 ; i < _hModelessDlgs.size() ; i++)
|
||||
for (size_t i = 0, len = _hModelessDlgs.size() ; i < len ; i++)
|
||||
if (_hModelessDlgs[i] == (HWND)lParam)
|
||||
return NULL;
|
||||
_hModelessDlgs.push_back((HWND)lParam);
|
||||
@ -1223,7 +1223,7 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPa
|
||||
}
|
||||
else if (wParam == MODELESSDIALOGREMOVE)
|
||||
{
|
||||
for (size_t i = 0 ; i < _hModelessDlgs.size() ; i++)
|
||||
for (size_t i = 0, len = _hModelessDlgs.size(); i < len ; i++)
|
||||
if (_hModelessDlgs[i] == (HWND)lParam)
|
||||
{
|
||||
vector<HWND>::iterator hDlg = _hModelessDlgs.begin() + i;
|
||||
@ -1255,12 +1255,12 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPa
|
||||
ContextMenu scintillaContextmenu;
|
||||
vector<MenuItemUnit> & tmp = pNppParam->getContextMenuItems();
|
||||
vector<bool> isEnable;
|
||||
for (size_t i = 0 ; i < tmp.size() ; i++)
|
||||
for (size_t i = 0, len = tmp.size(); i < len ; i++)
|
||||
{
|
||||
isEnable.push_back((::GetMenuState(_mainMenuHandle, tmp[i]._cmdID, MF_BYCOMMAND)&MF_DISABLED) == 0);
|
||||
}
|
||||
scintillaContextmenu.create(_pPublicInterface->getHSelf(), tmp);
|
||||
for (size_t i = 0 ; i < isEnable.size() ; i++)
|
||||
for (size_t i = 0, len = isEnable.size(); i < len ; i++)
|
||||
scintillaContextmenu.enableItem(tmp[i]._cmdID, isEnable[i]);
|
||||
|
||||
scintillaContextmenu.display(p);
|
||||
@ -1601,10 +1601,10 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPa
|
||||
TCHAR *moduleName = (TCHAR *)lParam;
|
||||
TCHAR *windowName = (TCHAR *)wParam;
|
||||
vector<DockingCont *> dockContainer = _dockingManager.getContainerInfo();
|
||||
for (size_t i = 0 ; i < dockContainer.size() ; i++)
|
||||
for (size_t i = 0, len = dockContainer.size(); i < len ; i++)
|
||||
{
|
||||
vector<tTbData *> tbData = dockContainer[i]->getDataOfAllTb();
|
||||
for (size_t j = 0 ; j < tbData.size() ; j++)
|
||||
for (size_t j = 0, len2 = tbData.size() ; j < len2 ; j++)
|
||||
{
|
||||
if (generic_stricmp(moduleName, tbData[j]->pszModuleName) == 0)
|
||||
{
|
||||
|
@ -75,7 +75,7 @@ void Notepad_plus::command(int id)
|
||||
if (_pFileSwitcherPanel)
|
||||
{
|
||||
vector<SwitcherFileInfo> files = _pFileSwitcherPanel->getSelectedFiles(id == IDM_FILESWITCHER_FILESCLOSEOTHERS);
|
||||
for (size_t i = 0; i < files.size(); i++)
|
||||
for (size_t i = 0, len = files.size(); i < len; i++)
|
||||
{
|
||||
fileClose((BufferID)files[i]._bufID, files[i]._iView);
|
||||
}
|
||||
@ -1896,7 +1896,7 @@ void Notepad_plus::command(int id)
|
||||
|
||||
// load plugin
|
||||
vector<generic_string> dll2Remove;
|
||||
for (size_t i = 0 ; i < copiedFiles.size() ; i++)
|
||||
for (size_t i = 0, len = copiedFiles.size() ; i < len ; i++)
|
||||
{
|
||||
int index = _pluginsManager.loadPlugin(copiedFiles[i].c_str(), dll2Remove);
|
||||
if (_pluginsManager.getMenuHandle())
|
||||
@ -1920,7 +1920,7 @@ void Notepad_plus::command(int id)
|
||||
ThemeSwitcher & themeSwitcher = pNppParams->getThemeSwitcher();
|
||||
|
||||
vector<generic_string> copiedFiles = addNppComponents(destDir, extFilterName, extFilter);
|
||||
for (size_t i = 0 ; i < copiedFiles.size() ; i++)
|
||||
for (size_t i = 0, len = copiedFiles.size(); i < len ; i++)
|
||||
{
|
||||
generic_string themeName(themeSwitcher.getThemeFromXmlFileName(copiedFiles[i].c_str()));
|
||||
if (!themeSwitcher.themeNameExists(themeName.c_str()))
|
||||
|
@ -401,7 +401,7 @@ generic_string Notepad_plus::exts2Filters(generic_string exts) const
|
||||
|
||||
int j = 0;
|
||||
bool stop = false;
|
||||
for (size_t i = 0 ; i < exts.length() ; i++)
|
||||
for (size_t i = 0, len = exts.length(); i < len ; i++)
|
||||
{
|
||||
if (extStr[i] == ' ')
|
||||
{
|
||||
@ -459,7 +459,7 @@ int Notepad_plus::setFileOpenSaveDlgFilters(FileDialog & fDlg, int langType)
|
||||
|
||||
bool inExcludedList = false;
|
||||
|
||||
for (size_t j = 0 ; j < nppGUI._excludedLangList.size() ; j++)
|
||||
for (size_t j = 0, len = nppGUI._excludedLangList.size() ; j < len ; j++)
|
||||
{
|
||||
if (lid == nppGUI._excludedLangList[j]._langType)
|
||||
{
|
||||
@ -1067,7 +1067,7 @@ bool Notepad_plus::loadSession(Session & session)
|
||||
//Dont use default methods because of performance
|
||||
Document prevDoc = _mainEditView.execute(SCI_GETDOCPOINTER);
|
||||
_mainEditView.execute(SCI_SETDOCPOINTER, 0, buf->getDocument());
|
||||
for (size_t j = 0 ; j < session._mainViewFiles[i].marks.size() ; j++)
|
||||
for (size_t j = 0, len = session._mainViewFiles[i].marks.size(); j < len ; j++)
|
||||
{
|
||||
_mainEditView.execute(SCI_MARKERADD, session._mainViewFiles[i].marks[j], MARK_BOOKMARK);
|
||||
}
|
||||
@ -1163,7 +1163,7 @@ bool Notepad_plus::loadSession(Session & session)
|
||||
//Dont use default methods because of performance
|
||||
Document prevDoc = _subEditView.execute(SCI_GETDOCPOINTER);
|
||||
_subEditView.execute(SCI_SETDOCPOINTER, 0, buf->getDocument());
|
||||
for (size_t j = 0 ; j < session._subViewFiles[k].marks.size() ; j++)
|
||||
for (size_t j = 0, len = session._subViewFiles[k].marks.size(); j < len ; j++)
|
||||
{
|
||||
_subEditView.execute(SCI_MARKERADD, session._subViewFiles[k].marks[j], MARK_BOOKMARK);
|
||||
}
|
||||
|
@ -482,7 +482,7 @@ wstring LocalizationSwitcher::getLangFromXmlFileName(const wchar_t *fn) const
|
||||
|
||||
wstring LocalizationSwitcher::getXmlFilePathFromLangName(const wchar_t *langName) const
|
||||
{
|
||||
for (size_t i = 0 ; i < _localizationList.size() ; i++)
|
||||
for (size_t i = 0, len = _localizationList.size(); i < len ; i++)
|
||||
{
|
||||
if (wcsicmp(langName, _localizationList[i].first.c_str()) == 0)
|
||||
return _localizationList[i].second;
|
||||
@ -1099,7 +1099,7 @@ bool NppParameters::load()
|
||||
getSessionFromXmlTree();
|
||||
|
||||
delete _pXmlSessionDoc;
|
||||
for (size_t i = 0 ; i < _pXmlExternalLexerDoc.size() ; i++)
|
||||
for (size_t i = 0, len = _pXmlExternalLexerDoc.size() ; i < len ; i++)
|
||||
if (_pXmlExternalLexerDoc[i])
|
||||
delete _pXmlExternalLexerDoc[i];
|
||||
|
||||
@ -2342,7 +2342,7 @@ void NppParameters::insertMacro(TiXmlNode *macrosRoot, const MacroShortcut & mac
|
||||
macroRoot->ToElement()->SetAttribute(TEXT("Alt"), key._isAlt?TEXT("yes"):TEXT("no"));
|
||||
macroRoot->ToElement()->SetAttribute(TEXT("Shift"), key._isShift?TEXT("yes"):TEXT("no"));
|
||||
macroRoot->ToElement()->SetAttribute(TEXT("Key"), key._key);
|
||||
for (size_t i = 0 ; i < macro._macro.size() ; i++)
|
||||
for (size_t i = 0, len = macro._macro.size(); i < len ; i++)
|
||||
{
|
||||
TiXmlNode *actionNode = macroRoot->InsertEndChild(TiXmlElement(TEXT("Action")));
|
||||
const recordedMacroStep & action = macro._macro[i];
|
||||
@ -2420,7 +2420,7 @@ void NppParameters::writeSession(const Session & session, const TCHAR *fileName)
|
||||
|
||||
TiXmlNode *mainViewNode = sessionNode->InsertEndChild(TiXmlElement(TEXT("mainView")));
|
||||
(mainViewNode->ToElement())->SetAttribute(TEXT("activeIndex"), (int)session._activeMainIndex);
|
||||
for (size_t i = 0 ; i < session._mainViewFiles.size() ; i++)
|
||||
for (size_t i = 0, len = session._mainViewFiles.size(); i < len ; i++)
|
||||
{
|
||||
TiXmlNode *fileNameNode = mainViewNode->InsertEndChild(TiXmlElement(TEXT("File")));
|
||||
|
||||
@ -2434,14 +2434,14 @@ void NppParameters::writeSession(const Session & session, const TCHAR *fileName)
|
||||
(fileNameNode->ToElement())->SetAttribute(TEXT("encoding"), session._mainViewFiles[i]._encoding);
|
||||
(fileNameNode->ToElement())->SetAttribute(TEXT("filename"), session._mainViewFiles[i]._fileName.c_str());
|
||||
|
||||
for (size_t j = 0 ; j < session._mainViewFiles[i].marks.size() ; j++)
|
||||
for (size_t j = 0, len = session._mainViewFiles[i].marks.size() ; j < len ; j++)
|
||||
{
|
||||
size_t markLine = session._mainViewFiles[i].marks[j];
|
||||
TiXmlNode *markNode = fileNameNode->InsertEndChild(TiXmlElement(TEXT("Mark")));
|
||||
markNode->ToElement()->SetAttribute(TEXT("line"), markLine);
|
||||
}
|
||||
|
||||
for (size_t j = 0 ; j < session._mainViewFiles[i]._foldStates.size() ; j++)
|
||||
for (size_t j = 0, len = session._mainViewFiles[i]._foldStates.size() ; j < len ; j++)
|
||||
{
|
||||
size_t foldLine = session._mainViewFiles[i]._foldStates[j];
|
||||
TiXmlNode *foldNode = fileNameNode->InsertEndChild(TiXmlElement(TEXT("Fold")));
|
||||
@ -2451,7 +2451,7 @@ void NppParameters::writeSession(const Session & session, const TCHAR *fileName)
|
||||
|
||||
TiXmlNode *subViewNode = sessionNode->InsertEndChild(TiXmlElement(TEXT("subView")));
|
||||
(subViewNode->ToElement())->SetAttribute(TEXT("activeIndex"), (int)session._activeSubIndex);
|
||||
for (size_t i = 0 ; i < session._subViewFiles.size() ; i++)
|
||||
for (size_t i = 0, len = session._subViewFiles.size(); i < len ; i++)
|
||||
{
|
||||
TiXmlNode *fileNameNode = subViewNode->InsertEndChild(TiXmlElement(TEXT("File")));
|
||||
|
||||
@ -2465,14 +2465,14 @@ void NppParameters::writeSession(const Session & session, const TCHAR *fileName)
|
||||
(fileNameNode->ToElement())->SetAttribute(TEXT("encoding"), session._subViewFiles[i]._encoding);
|
||||
(fileNameNode->ToElement())->SetAttribute(TEXT("filename"), session._subViewFiles[i]._fileName.c_str());
|
||||
|
||||
for (size_t j = 0 ; j < session._subViewFiles[i].marks.size() ; j++)
|
||||
for (size_t j = 0, len = session._subViewFiles[i].marks.size(); j < len; j++)
|
||||
{
|
||||
size_t markLine = session._subViewFiles[i].marks[j];
|
||||
TiXmlNode *markNode = fileNameNode->InsertEndChild(TiXmlElement(TEXT("Mark")));
|
||||
markNode->ToElement()->SetAttribute(TEXT("line"), markLine);
|
||||
}
|
||||
|
||||
for (size_t j = 0 ; j < session._subViewFiles[i]._foldStates.size() ; j++)
|
||||
for (size_t j = 0, len = session._subViewFiles[i]._foldStates.size() ; j < len ; j++)
|
||||
{
|
||||
size_t foldLine = session._subViewFiles[i]._foldStates[j];
|
||||
TiXmlNode *foldNode = fileNameNode->InsertEndChild(TiXmlElement(TEXT("Fold")));
|
||||
@ -2503,7 +2503,7 @@ void NppParameters::writeShortcuts()
|
||||
root->RemoveChild(cmdRoot);
|
||||
|
||||
cmdRoot = root->InsertEndChild(TiXmlElement(TEXT("InternalCommands")));
|
||||
for (size_t i = 0 ; i < _customizedShortcuts.size() ; i++)
|
||||
for (size_t i = 0, len = _customizedShortcuts.size(); i < len ; i++)
|
||||
{
|
||||
int index = _customizedShortcuts[i];
|
||||
CommandShortcut csc = _shortcuts[index];
|
||||
@ -2516,7 +2516,7 @@ void NppParameters::writeShortcuts()
|
||||
|
||||
macrosRoot = root->InsertEndChild(TiXmlElement(TEXT("Macros")));
|
||||
|
||||
for (size_t i = 0 ; i < _macros.size() ; i++)
|
||||
for (size_t i = 0, len = _macros.size(); i < len ; i++)
|
||||
{
|
||||
insertMacro(macrosRoot, _macros[i]);
|
||||
}
|
||||
@ -2527,7 +2527,7 @@ void NppParameters::writeShortcuts()
|
||||
|
||||
userCmdRoot = root->InsertEndChild(TiXmlElement(TEXT("UserDefinedCommands")));
|
||||
|
||||
for (size_t i = 0 ; i < _userCommands.size() ; i++)
|
||||
for (size_t i = 0, len = _userCommands.size(); i < len ; i++)
|
||||
{
|
||||
insertUserCmd(userCmdRoot, _userCommands[i]);
|
||||
}
|
||||
@ -2537,7 +2537,7 @@ void NppParameters::writeShortcuts()
|
||||
root->RemoveChild(pluginCmdRoot);
|
||||
|
||||
pluginCmdRoot = root->InsertEndChild(TiXmlElement(TEXT("PluginCommands")));
|
||||
for (size_t i = 0 ; i < _pluginCustomizedCmds.size() ; i++)
|
||||
for (size_t i = 0, len = _pluginCustomizedCmds.size(); i < len ; i++)
|
||||
{
|
||||
insertPluginCmd(pluginCmdRoot, _pluginCommands[_pluginCustomizedCmds[i]]);
|
||||
}
|
||||
@ -2547,7 +2547,7 @@ void NppParameters::writeShortcuts()
|
||||
root->RemoveChild(scitillaKeyRoot);
|
||||
|
||||
scitillaKeyRoot = root->InsertEndChild(TiXmlElement(TEXT("ScintillaKeys")));
|
||||
for (size_t i = 0 ; i < _scintillaModifiedKeyIndices.size() ; i++)
|
||||
for (size_t i = 0, len = _scintillaModifiedKeyIndices.size(); i < len ; i++)
|
||||
{
|
||||
insertScintKey(scitillaKeyRoot, _scintillaKeyCommands[_scintillaModifiedKeyIndices[i]]);
|
||||
}
|
||||
@ -4823,28 +4823,28 @@ bool NppParameters::writeFindHistory()
|
||||
TiXmlElement hist_element(TEXT(""));
|
||||
|
||||
hist_element.SetValue(TEXT("Path"));
|
||||
for (size_t i = 0; i < _findHistory._findHistoryPaths.size(); i++)
|
||||
for (size_t i = 0, len = _findHistory._findHistoryPaths.size(); i < len; i++)
|
||||
{
|
||||
(hist_element.ToElement())->SetAttribute(TEXT("name"), _findHistory._findHistoryPaths[i].c_str());
|
||||
findHistoryRoot->InsertEndChild(hist_element);
|
||||
}
|
||||
|
||||
hist_element.SetValue(TEXT("Filter"));
|
||||
for (size_t i = 0; i < _findHistory._findHistoryFilters.size(); i++)
|
||||
for (size_t i = 0, len = _findHistory._findHistoryFilters.size(); i < len; i++)
|
||||
{
|
||||
(hist_element.ToElement())->SetAttribute(TEXT("name"), _findHistory._findHistoryFilters[i].c_str());
|
||||
findHistoryRoot->InsertEndChild(hist_element);
|
||||
}
|
||||
|
||||
hist_element.SetValue(TEXT("Find"));
|
||||
for (size_t i = 0; i < _findHistory._findHistoryFinds.size(); i++)
|
||||
for (size_t i = 0, len = _findHistory._findHistoryFinds.size(); i < len; i++)
|
||||
{
|
||||
(hist_element.ToElement())->SetAttribute(TEXT("name"), _findHistory._findHistoryFinds[i].c_str());
|
||||
findHistoryRoot->InsertEndChild(hist_element);
|
||||
}
|
||||
|
||||
hist_element.SetValue(TEXT("Replace"));
|
||||
for (size_t i = 0; i < _findHistory._findHistoryReplaces.size(); i++)
|
||||
for (size_t i = 0, len = _findHistory._findHistoryReplaces.size(); i < len; i++)
|
||||
{
|
||||
(hist_element.ToElement())->SetAttribute(TEXT("name"), _findHistory._findHistoryReplaces[i].c_str());
|
||||
findHistoryRoot->InsertEndChild(hist_element);
|
||||
@ -4862,7 +4862,7 @@ void NppParameters::insertDockingParamNode(TiXmlNode *GUIRoot)
|
||||
DMNode.SetAttribute(TEXT("topHeight"), _nppGUI._dockingData._topHeight);
|
||||
DMNode.SetAttribute(TEXT("bottomHeight"), _nppGUI._dockingData._bottomHight);
|
||||
|
||||
for (size_t i = 0 ; i < _nppGUI._dockingData._flaotingWindowInfo.size() ; i++)
|
||||
for (size_t i = 0, len = _nppGUI._dockingData._flaotingWindowInfo.size(); i < len ; i++)
|
||||
{
|
||||
FloatingWindowInfo & fwi = _nppGUI._dockingData._flaotingWindowInfo[i];
|
||||
TiXmlElement FWNode(TEXT("FloatingWindow"));
|
||||
@ -4875,7 +4875,7 @@ void NppParameters::insertDockingParamNode(TiXmlNode *GUIRoot)
|
||||
DMNode.InsertEndChild(FWNode);
|
||||
}
|
||||
|
||||
for (size_t i = 0 ; i < _nppGUI._dockingData._pluginDockInfo.size() ; i++)
|
||||
for (size_t i = 0, len = _nppGUI._dockingData._pluginDockInfo.size() ; i < len ; i++)
|
||||
{
|
||||
PluginDlgDockingInfo & pdi = _nppGUI._dockingData._pluginDockInfo[i];
|
||||
TiXmlElement PDNode(TEXT("PluginDlg"));
|
||||
@ -4888,7 +4888,7 @@ void NppParameters::insertDockingParamNode(TiXmlNode *GUIRoot)
|
||||
DMNode.InsertEndChild(PDNode);
|
||||
}
|
||||
|
||||
for (size_t i = 0 ; i < _nppGUI._dockingData._containerTabInfo.size() ; i++)
|
||||
for (size_t i = 0, len = _nppGUI._dockingData._containerTabInfo.size(); i < len ; i++)
|
||||
{
|
||||
ContainerTabInfo & cti = _nppGUI._dockingData._containerTabInfo[i];
|
||||
TiXmlElement CTNode(TEXT("ActiveTabs"));
|
||||
@ -4938,7 +4938,7 @@ void NppParameters::writeExcludedLangList(TiXmlElement *element)
|
||||
int g6 = 0; // up to 56
|
||||
int g7 = 0; // up to 64
|
||||
|
||||
for (size_t i = 0 ; i < _nppGUI._excludedLangList.size() ; i++)
|
||||
for (size_t i = 0, len = _nppGUI._excludedLangList.size(); i < len ; i++)
|
||||
{
|
||||
LangType langType = _nppGUI._excludedLangList[i]._langType;
|
||||
if (langType >= L_EXTERNAL && langType < L_END)
|
||||
|
@ -240,7 +240,7 @@ struct DockingManagerData {
|
||||
vector<ContainerTabInfo> _containerTabInfo;
|
||||
|
||||
bool getFloatingRCFrom(int floatCont, RECT & rc) {
|
||||
for (size_t i = 0 ; i < _flaotingWindowInfo.size() ; i++)
|
||||
for (size_t i = 0, fwiLen = _flaotingWindowInfo.size(); i < fwiLen; i++)
|
||||
{
|
||||
if (_flaotingWindowInfo[i]._cont == floatCont)
|
||||
{
|
||||
@ -1321,7 +1321,7 @@ public:
|
||||
{
|
||||
vector<generic_string> extVect;
|
||||
cutString(_userLangArray[i]->_ext.c_str(), extVect);
|
||||
for (size_t j = 0 ; j < extVect.size() ; j++)
|
||||
for (size_t j = 0, len = extVect.size(); j < len; j++)
|
||||
if (!generic_stricmp(extVect[j].c_str(), ext) || (_tcschr(fullName, '.') && !generic_stricmp(extVect[j].c_str(), fullName)))
|
||||
return _userLangArray[i]->_name.c_str();
|
||||
}
|
||||
@ -1458,7 +1458,7 @@ public:
|
||||
|
||||
vector<generic_string> & getBlackList() {return _blacklist;};
|
||||
bool isInBlackList(TCHAR *fn) {
|
||||
for (size_t i = 0 ; i < _blacklist.size() ; i++)
|
||||
for (size_t i = 0, len = _blacklist.size(); i < len ; i++)
|
||||
if (_blacklist[i] == fn)
|
||||
return true;
|
||||
return false;
|
||||
|
@ -33,7 +33,7 @@
|
||||
|
||||
static bool isInList(generic_string word, const vector<generic_string> & wordArray)
|
||||
{
|
||||
for (size_t i = 0 ; i < wordArray.size() ; i++)
|
||||
for (size_t i = 0, len = wordArray.size(); i < len; i++)
|
||||
if (wordArray[i] == word)
|
||||
return true;
|
||||
return false;
|
||||
@ -135,7 +135,7 @@ bool AutoCompletion::showWordComplete(bool autoInsert)
|
||||
sort(wordArray.begin(), wordArray.end());
|
||||
generic_string words(TEXT(""));
|
||||
|
||||
for (size_t i = 0 ; i < wordArray.size() ; i++)
|
||||
for (size_t i = 0, len = wordArray.size(); i < len; i++)
|
||||
{
|
||||
words += wordArray[i];
|
||||
if (i != wordArray.size()-1)
|
||||
|
@ -362,7 +362,7 @@ int FindReplaceDlg::saveComboHistory(int id, int maxcount, vector<generic_string
|
||||
if (count)
|
||||
strings.clear();
|
||||
|
||||
for (size_t i = 0 ; i < (size_t)count ; i++)
|
||||
for (int i = 0 ; i < count ; i++)
|
||||
{
|
||||
::SendMessage(hCombo, CB_GETLBTEXT, i, (LPARAM) text);
|
||||
strings.push_back(generic_string(text));
|
||||
|
@ -41,7 +41,7 @@ HWND ScintillaCtrls::createSintilla(HWND hParent)
|
||||
|
||||
int ScintillaCtrls::getIndexFrom(HWND handle2Find)
|
||||
{
|
||||
for (size_t i = 0 ; i < _scintVector.size() ; i++)
|
||||
for (size_t i = 0, len = _scintVector.size(); i < len ; i++)
|
||||
{
|
||||
if (_scintVector[i]->getHSelf() == handle2Find)
|
||||
{
|
||||
@ -75,7 +75,7 @@ bool ScintillaCtrls::destroyScintilla(HWND handle2Destroy)
|
||||
|
||||
void ScintillaCtrls::destroy()
|
||||
{
|
||||
for (size_t i = 0 ; i < _scintVector.size() ; i++)
|
||||
for (size_t i = 0, len = _scintVector.size(); i < len ; i++)
|
||||
{
|
||||
_scintVector[i]->destroy();
|
||||
delete _scintVector[i];
|
||||
|
@ -674,7 +674,7 @@ void ScintillaEditView::setUserLexer(const TCHAR *userLangName)
|
||||
bool inSingleQuote = false;
|
||||
bool nonWSFound = false;
|
||||
int index = 0;
|
||||
for (unsigned int j=0; j<strlen(keyWords_char); ++j)
|
||||
for (size_t j=0, len = strlen(keyWords_char); j<len; ++j)
|
||||
{
|
||||
if (!inSingleQuote && keyWords_char[j] == '"')
|
||||
{
|
||||
@ -820,7 +820,7 @@ void ScintillaEditView::setCppLexer(LangType langType)
|
||||
LexerStyler *pStyler = (_pParameter->getLStylerArray()).getLexerStylerByName(lexerName);
|
||||
if (pStyler)
|
||||
{
|
||||
for (int i = 0 ; i < pStyler->getNbStyler() ; i++)
|
||||
for (int i = 0, nb = pStyler->getNbStyler() ; i < nb ; i++)
|
||||
{
|
||||
Style style = pStyler->getStyler(i); //not by reference, but copy
|
||||
int cppID = style._styleID;
|
||||
@ -1104,7 +1104,7 @@ void ScintillaEditView::makeStyle(LangType language, const TCHAR **keywordArray)
|
||||
LexerStyler *pStyler = (_pParameter->getLStylerArray()).getLexerStylerByName(lexerName);
|
||||
if (pStyler)
|
||||
{
|
||||
for (int i = 0 ; i < pStyler->getNbStyler() ; i++)
|
||||
for (int i = 0, nb = pStyler->getNbStyler(); i < nb ; i++)
|
||||
{
|
||||
Style & style = pStyler->getStyler(i);
|
||||
setStyle(style);
|
||||
@ -2272,7 +2272,7 @@ const char * ScintillaEditView::getCompleteKeywordList(std::basic_string<char> &
|
||||
|
||||
void ScintillaEditView::setMultiSelections(const ColumnModeInfos & cmi)
|
||||
{
|
||||
for (size_t i = 0 ; i < cmi.size() ; i++)
|
||||
for (size_t i = 0, len = cmi.size(); i < len ; i++)
|
||||
{
|
||||
if (cmi[i].isValid())
|
||||
{
|
||||
@ -2411,7 +2411,7 @@ void ScintillaEditView::convertSelectedTextTo(bool Case)
|
||||
|
||||
ColumnModeInfos cmi = getColumnModeSelectInfo();
|
||||
|
||||
for (size_t i = 0 ; i < cmi.size() ; i++)
|
||||
for (size_t i = 0, cmiLen = cmi.size(); i < cmiLen ; i++)
|
||||
{
|
||||
const int len = cmi[i]._selRpos - cmi[i]._selLpos;
|
||||
char *srcStr = new char[len+1];
|
||||
@ -2593,7 +2593,7 @@ ColumnModeInfos ScintillaEditView::getColumnModeSelectInfo()
|
||||
void ScintillaEditView::columnReplace(ColumnModeInfos & cmi, const TCHAR *str)
|
||||
{
|
||||
int totalDiff = 0;
|
||||
for (size_t i = 0 ; i < cmi.size() ; i++)
|
||||
for (size_t i = 0, len = cmi.size(); i < len ; i++)
|
||||
{
|
||||
if (cmi[i].isValid())
|
||||
{
|
||||
@ -2676,7 +2676,7 @@ void ScintillaEditView::columnReplace(ColumnModeInfos & cmi, int initial, int in
|
||||
TCHAR str[stringSize];
|
||||
|
||||
int totalDiff = 0;
|
||||
for (size_t i = 0 ; i < cmi.size() ; i++)
|
||||
for (size_t i = 0, len = cmi.size() ; i < len ; i++)
|
||||
{
|
||||
if (cmi[i].isValid())
|
||||
{
|
||||
|
@ -136,7 +136,7 @@ void SmartHighlighter::highlightView(ScintillaEditView * pHighlightView)
|
||||
|
||||
bool SmartHighlighter::isQualifiedWord(const char *str) const
|
||||
{
|
||||
for (size_t i = 0 ; i < strlen(str) ; i++)
|
||||
for (size_t i = 0, len = strlen(str) ; i < len ; i++)
|
||||
{
|
||||
if (!isWordChar(str[i]))
|
||||
return false;
|
||||
|
@ -184,7 +184,7 @@ void FolderStyleDialog::convertTo(TCHAR *dest, const TCHAR *toConvert, TCHAR *pr
|
||||
dest[index++] = prefix[0];
|
||||
dest[index++] = prefix[1];
|
||||
|
||||
for (int i = 0 ; i < int(lstrlen(toConvert)) ; i++)
|
||||
for (size_t i = 0, len = lstrlen(toConvert); i < len ; i++)
|
||||
{
|
||||
if (i == 0 && toConvert[i] == '(' && toConvert[i+1] == '(')
|
||||
{
|
||||
@ -228,7 +228,7 @@ void FolderStyleDialog::retrieve(TCHAR *dest, const TCHAR *toRetrieve, TCHAR *pr
|
||||
int j = 0;
|
||||
bool begin2Copy = false;
|
||||
|
||||
for (int i = 0 ; i < int(lstrlen(toRetrieve)) ; i++)
|
||||
for (size_t i = 0, len = lstrlen(toRetrieve); i < len ; i++)
|
||||
{
|
||||
if ((i == 0 || (toRetrieve[i-1] == ' ')) && (toRetrieve[i] == prefix[0] && toRetrieve[i+1] == prefix[1]))
|
||||
{
|
||||
@ -536,7 +536,7 @@ void CommentStyleDialog::convertTo(TCHAR *dest, const TCHAR *toConvert, TCHAR *p
|
||||
dest[index++] = prefix[0];
|
||||
dest[index++] = prefix[1];
|
||||
|
||||
for (int i = 0 ; i < int(lstrlen(toConvert)) ; i++)
|
||||
for (size_t i = 0, len = lstrlen(toConvert); i < len ; i++)
|
||||
{
|
||||
if (i == 0 && toConvert[i] == '(' && toConvert[i+1] == '(')
|
||||
{
|
||||
@ -581,7 +581,7 @@ void CommentStyleDialog::retrieve(TCHAR *dest, const TCHAR *toRetrieve, TCHAR *p
|
||||
bool begin2Copy = false;
|
||||
bool inGroup = false;
|
||||
|
||||
for (int i = 0 ; i < int(lstrlen(toRetrieve)) ; i++)
|
||||
for (size_t i = 0, len = lstrlen(toRetrieve); i < len ; i++)
|
||||
{
|
||||
if ((i == 0 || (toRetrieve[i-1] == ' ')) && (toRetrieve[i] == prefix[0] && toRetrieve[i+1] == prefix[1]))
|
||||
{
|
||||
@ -776,7 +776,7 @@ void SymbolsStyleDialog::convertTo(TCHAR *dest, const TCHAR *toConvert, TCHAR *p
|
||||
dest[index++] = prefix[0];
|
||||
dest[index++] = prefix[1];
|
||||
|
||||
for (int i = 0 ; i < int(lstrlen(toConvert)) ; i++)
|
||||
for (size_t i = 0, len = lstrlen(toConvert); i < len ; i++)
|
||||
{
|
||||
if (i == 0 && toConvert[i] == '(' && toConvert[i+1] == '(')
|
||||
{
|
||||
@ -821,7 +821,7 @@ void SymbolsStyleDialog::retrieve(TCHAR *dest, const TCHAR *toRetrieve, TCHAR *p
|
||||
bool begin2Copy = false;
|
||||
bool inGroup = false;
|
||||
|
||||
for (int i = 0 ; i < int(lstrlen(toRetrieve)) ; i++)
|
||||
for (size_t i = 0, len = lstrlen(toRetrieve); i < len ; i++)
|
||||
{
|
||||
if ((i == 0 || (toRetrieve[i-1] == ' ')) && (toRetrieve[i] == prefix[0] && toRetrieve[i+1] == prefix[1]))
|
||||
{
|
||||
@ -978,7 +978,7 @@ void UserDefineDialog::reloadLangCombo()
|
||||
NppParameters *pNppParam = NppParameters::getInstance();
|
||||
::SendDlgItemMessage(_hSelf, IDC_LANGNAME_COMBO, CB_RESETCONTENT, 0, 0);
|
||||
::SendDlgItemMessage(_hSelf, IDC_LANGNAME_COMBO, CB_ADDSTRING, 0, (LPARAM)TEXT("User Define Language"));
|
||||
for (int i = 0 ; i < pNppParam->getNbUserLang() ; i++)
|
||||
for (int i = 0, nb = pNppParam->getNbUserLang(); i < nb ; i++)
|
||||
{
|
||||
UserLangContainer & userLangContainer = pNppParam->getULCFromIndex(i);
|
||||
::SendDlgItemMessage(_hSelf, IDC_LANGNAME_COMBO, CB_ADDSTRING, 0, (LPARAM)userLangContainer.getName());
|
||||
@ -1591,7 +1591,7 @@ BOOL CALLBACK StylerDlg::dlgProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM
|
||||
// for the font name combo
|
||||
HWND hFontNameCombo = ::GetDlgItem(hwnd, IDC_STYLER_COMBO_FONT_NAME);
|
||||
const std::vector<generic_string> & fontlist = pNppParam->getFontList();
|
||||
for (int j = 0 ; j < int(fontlist.size()) ; j++)
|
||||
for (size_t j = 0, len = fontlist.size() ; j < len ; j++)
|
||||
{
|
||||
int k = ::SendMessage(hFontNameCombo, CB_ADDSTRING, 0, (LPARAM)fontlist[j].c_str());
|
||||
::SendMessage(hFontNameCombo, CB_SETITEMDATA, k, (LPARAM)fontlist[j].c_str());
|
||||
|
@ -624,7 +624,7 @@ void XmlMatchedTagsHighlighter::tagMatch(bool doHiliteAttr)
|
||||
{
|
||||
vector< pair<int, int> > attributes = getAttributesPos(xmlTags.tagNameEnd, xmlTags.tagOpenEnd - openTagTailLen);
|
||||
_pEditView->execute(SCI_SETINDICATORCURRENT, SCE_UNIVERSAL_TAGATTR);
|
||||
for (size_t i = 0 ; i < attributes.size() ; i++)
|
||||
for (size_t i = 0, len = attributes.size(); i < len ; i++)
|
||||
{
|
||||
_pEditView->execute(SCI_INDICATORFILLRANGE, attributes[i].first, attributes[i].second - attributes[i].first);
|
||||
}
|
||||
|
@ -1153,7 +1153,7 @@ const char* TiXmlDeclarationA::Parse( const char* p, TiXmlParsingDataA* data )
|
||||
|
||||
bool TiXmlTextA::Blank() const
|
||||
{
|
||||
for ( unsigned i=0; i<value.length(); i++ )
|
||||
for ( unsigned int i=0, len=value.length(); i<len; i++ )
|
||||
if ( !isspace( value[i] ) )
|
||||
return false;
|
||||
return true;
|
||||
|
@ -1133,7 +1133,7 @@ const TCHAR* TiXmlDeclaration::Parse( const TCHAR* p, TiXmlParsingData* data )
|
||||
|
||||
bool TiXmlText::Blank() const
|
||||
{
|
||||
for ( unsigned i=0; i<value.length(); i++ )
|
||||
for ( unsigned int i=0, len=value.length(); i<len; i++ )
|
||||
if ( !isspace( value[i] ) )
|
||||
return false;
|
||||
return true;
|
||||
|
@ -138,11 +138,11 @@ int ClipboardHistoryPanel::getClipboardDataIndex(ClipboardData cbd)
|
||||
{
|
||||
int iFound = -1;
|
||||
bool found = false;
|
||||
for (size_t i = 0 ; i < _clipboardDataVector.size() ; i++)
|
||||
for (size_t i = 0, len = _clipboardDataVector.size() ; i < len ; i++)
|
||||
{
|
||||
if (cbd.size() == _clipboardDataVector[i].size())
|
||||
{
|
||||
for (size_t j = 0 ; j < cbd.size() ; j++)
|
||||
for (size_t j = 0, len2 = cbd.size(); j < len2 ; j++)
|
||||
{
|
||||
if (cbd[j] == _clipboardDataVector[i][j])
|
||||
found = true;
|
||||
|
@ -126,7 +126,7 @@ BOOL CALLBACK WordStyleDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM lPar
|
||||
::SendMessage(_hFontSizeCombo, CB_ADDSTRING, 0, (LPARAM)fontSizeStrs[i]);
|
||||
|
||||
const std::vector<generic_string> & fontlist = (NppParameters::getInstance())->getFontList();
|
||||
for (size_t i = 0 ; i < fontlist.size() ; i++)
|
||||
for (size_t i = 0, len = fontlist.size() ; i < len ; i++)
|
||||
{
|
||||
int j = ::SendMessage(_hFontNameCombo, CB_ADDSTRING, 0, (LPARAM)fontlist[i].c_str());
|
||||
::SendMessage(_hFontNameCombo, CB_SETITEMDATA, j, (LPARAM)fontlist[i].c_str());
|
||||
@ -475,7 +475,7 @@ void WordStyleDlg::loadLangListFromNppParam()
|
||||
|
||||
::SendDlgItemMessage(_hSelf, IDC_LANGUAGES_LIST, LB_ADDSTRING, 0, (LPARAM)TEXT("Global Styles"));
|
||||
// All the lexers
|
||||
for (int i = 0 ; i < _lsArray.getNbLexer() ; i++)
|
||||
for (int i = 0, nb = _lsArray.getNbLexer() ; i < nb ; i++)
|
||||
{
|
||||
::SendDlgItemMessage(_hSelf, IDC_LANGUAGES_LIST, LB_ADDSTRING, 0, (LPARAM)_lsArray.getLexerDescFromIndex(i));
|
||||
}
|
||||
@ -687,7 +687,7 @@ void WordStyleDlg::setStyleListFromLexer(int index)
|
||||
|
||||
StyleArray & lexerStyler = index?_lsArray.getLexerFromIndex(index-1):_globalStyles;
|
||||
|
||||
for (int i = 0 ; i < lexerStyler.getNbStyler() ; i++)
|
||||
for (int i = 0, nb = lexerStyler.getNbStyler(); i < nb ; i++)
|
||||
{
|
||||
Style & style = lexerStyler.getStyler(i);
|
||||
::SendDlgItemMessage(_hSelf, IDC_STYLES_LIST, LB_ADDSTRING, 0, (LPARAM)style._styleDesc);
|
||||
|
@ -46,7 +46,7 @@ ContextMenu::~ContextMenu()
|
||||
{
|
||||
if (isCreated())
|
||||
{
|
||||
for (size_t i = 0 ; i < _subMenus.size() ; i++)
|
||||
for (size_t i = 0, len = _subMenus.size(); i < len; i++)
|
||||
::DestroyMenu(_subMenus[i]);
|
||||
::DestroyMenu(_hMenu);
|
||||
}
|
||||
@ -61,7 +61,7 @@ void ContextMenu::create(HWND hParent, const vector<MenuItemUnit> & menuItemArra
|
||||
generic_string currentParentFolderStr = TEXT("");
|
||||
int j = 0;
|
||||
|
||||
for (size_t i = 0 ; i < menuItemArray.size() ; i++)
|
||||
for (size_t i = 0, len = menuItemArray.size(); i < len; i++)
|
||||
{
|
||||
const MenuItemUnit & item = menuItemArray[i];
|
||||
if (item._parentFolderName == TEXT(""))
|
||||
|
@ -154,7 +154,7 @@ tTbData* DockingCont::createToolbar(tTbData data)
|
||||
void DockingCont::removeToolbar(tTbData TbData)
|
||||
{
|
||||
// remove from list
|
||||
for (size_t iTb = 0; iTb < _vTbData.size(); iTb++)
|
||||
for (size_t iTb = 0, len = _vTbData.size(); iTb < len; iTb++)
|
||||
{
|
||||
if (_vTbData[iTb]->hClient == TbData.hClient)
|
||||
{
|
||||
@ -175,7 +175,7 @@ tTbData* DockingCont::findToolbarByWnd(HWND hClient)
|
||||
tTbData* pTbData = NULL;
|
||||
|
||||
// find entry by handle
|
||||
for (size_t iTb = 0; iTb < _vTbData.size(); iTb++)
|
||||
for (size_t iTb = 0, len = _vTbData.size(); iTb < len; iTb++)
|
||||
{
|
||||
if (hClient == _vTbData[iTb]->hClient)
|
||||
{
|
||||
@ -190,7 +190,7 @@ tTbData* DockingCont::findToolbarByName(TCHAR* pszName)
|
||||
tTbData* pTbData = NULL;
|
||||
|
||||
// find entry by handle
|
||||
for (size_t iTb = 0; iTb < _vTbData.size(); iTb++)
|
||||
for (size_t iTb = 0, len = _vTbData.size(); iTb < len; iTb++)
|
||||
{
|
||||
if (lstrcmp(pszName, _vTbData[iTb]->pszName) == 0)
|
||||
{
|
||||
@ -1067,7 +1067,7 @@ void DockingCont::onSize()
|
||||
// update floating size
|
||||
if (_isFloating == true)
|
||||
{
|
||||
for (size_t iTb = 0; iTb < _vTbData.size(); iTb++)
|
||||
for (size_t iTb = 0, len = _vTbData.size(); iTb < len; iTb++)
|
||||
{
|
||||
getWindowRect(_vTbData[iTb]->rcFloat);
|
||||
}
|
||||
|
@ -195,7 +195,7 @@ LRESULT CALLBACK DockingManager::staticWinProc(HWND hwnd, UINT message, WPARAM w
|
||||
|
||||
void DockingManager::updateContainerInfo(HWND hClient)
|
||||
{
|
||||
for (size_t iCont = 0; iCont < _vContainer.size(); iCont++)
|
||||
for (size_t iCont = 0, len = _vContainer.size(); iCont < len; iCont++)
|
||||
{
|
||||
if (_vContainer[iCont]->updateInfo(hClient) == TRUE)
|
||||
{
|
||||
@ -206,7 +206,7 @@ void DockingManager::updateContainerInfo(HWND hClient)
|
||||
|
||||
void DockingManager::showContainer(HWND hCont, BOOL view)
|
||||
{
|
||||
for (size_t iCont = 0; iCont < _vContainer.size(); iCont++)
|
||||
for (size_t iCont = 0, len = _vContainer.size(); iCont < len; iCont++)
|
||||
{
|
||||
if (_vContainer[iCont]->getHSelf() == hCont)
|
||||
showContainer(iCont, view);
|
||||
@ -220,7 +220,7 @@ LRESULT DockingManager::runProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM l
|
||||
case WM_NCACTIVATE:
|
||||
{
|
||||
// activate/deactivate titlebar of toolbars
|
||||
for (size_t iCont = DOCKCONT_MAX; iCont < _vContainer.size(); iCont++)
|
||||
for (size_t iCont = DOCKCONT_MAX, len = _vContainer.size(); iCont < len; iCont++)
|
||||
{
|
||||
::SendMessage(_vContainer[iCont]->getHSelf(), WM_NCACTIVATE, wParam, (LPARAM)-1);
|
||||
}
|
||||
@ -370,7 +370,7 @@ LRESULT DockingManager::runProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM l
|
||||
}
|
||||
case DMM_GETICONPOS:
|
||||
{
|
||||
for (UINT uImageCnt = 0; uImageCnt < _vImageList.size(); uImageCnt++)
|
||||
for (UINT uImageCnt = 0, len = _vImageList.size(); uImageCnt < len; uImageCnt++)
|
||||
{
|
||||
if ((HWND)lParam == _vImageList[uImageCnt])
|
||||
{
|
||||
@ -674,7 +674,7 @@ void DockingManager::setActiveTab(int iCont, int iItem)
|
||||
void DockingManager::showDockableDlg(HWND hDlg, BOOL view)
|
||||
{
|
||||
tTbData *pTbData = NULL;
|
||||
for (size_t i = 0; i < _vContainer.size(); i++)
|
||||
for (size_t i = 0, len = _vContainer.size(); i < len; i++)
|
||||
{
|
||||
pTbData = _vContainer[i]->findToolbarByWnd(hDlg);
|
||||
if (pTbData != NULL)
|
||||
@ -688,7 +688,7 @@ void DockingManager::showDockableDlg(HWND hDlg, BOOL view)
|
||||
void DockingManager::showDockableDlg(TCHAR* pszName, BOOL view)
|
||||
{
|
||||
tTbData *pTbData = NULL;
|
||||
for (size_t i = 0; i < _vContainer.size(); i++)
|
||||
for (size_t i = 0, len = _vContainer.size(); i < len; i++)
|
||||
{
|
||||
pTbData = _vContainer[i]->findToolbarByName(pszName);
|
||||
if (pTbData != NULL)
|
||||
@ -808,7 +808,7 @@ DockingCont* DockingManager::toggleVisTb(DockingCont* pContSrc, UINT message, LP
|
||||
pContSrc->doDialog(false);
|
||||
onSize();
|
||||
|
||||
for (size_t iTb = 0; iTb < vTbData.size(); iTb++)
|
||||
for (size_t iTb = 0, len = vTbData.size(); iTb < len; iTb++)
|
||||
{
|
||||
// get data one by another
|
||||
tTbData TbData = *vTbData[iTb];
|
||||
@ -869,7 +869,7 @@ void DockingManager::toggleVisTb(DockingCont* pContSrc, DockingCont* pContTgt)
|
||||
pContSrc->doDialog(false);
|
||||
onSize();
|
||||
|
||||
for (size_t iTb = 0; iTb < vTbData.size(); iTb++)
|
||||
for (size_t iTb = 0, len = vTbData.size(); iTb < len; iTb++)
|
||||
{
|
||||
// get data one by another
|
||||
tTbData TbData = *vTbData[iTb];
|
||||
@ -919,8 +919,7 @@ BOOL DockingManager::ContExists(size_t iCont)
|
||||
int DockingManager::GetContainer(DockingCont* pCont)
|
||||
{
|
||||
int iRet = -1;
|
||||
|
||||
for (size_t iCont = 0; iCont < _vContainer.size(); iCont++)
|
||||
for (size_t iCont = 0, len = _vContainer.size(); iCont < len; iCont++)
|
||||
{
|
||||
if (_vContainer[iCont] == pCont)
|
||||
{
|
||||
@ -939,7 +938,7 @@ int DockingManager::FindEmptyContainer()
|
||||
BOOL* pArrayPos = &pPrevDockList[1];
|
||||
|
||||
// delete all entries
|
||||
for (size_t iCont = 0; iCont < _vContainer.size()+1; iCont++)
|
||||
for (size_t iCont = 0, len = _vContainer.size()+1; iCont < len; iCont++)
|
||||
{
|
||||
pPrevDockList[iCont] = FALSE;
|
||||
}
|
||||
@ -949,14 +948,14 @@ int DockingManager::FindEmptyContainer()
|
||||
{
|
||||
vector<tTbData*> vTbData = _vContainer[iCont]->getDataOfAllTb();
|
||||
|
||||
for (size_t iTb = 0; iTb < vTbData.size(); iTb++)
|
||||
for (size_t iTb = 0, len = vTbData.size(); iTb < len; iTb++)
|
||||
{
|
||||
pArrayPos[vTbData[iTb]->iPrevCont] = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
// find free container
|
||||
for (size_t iCont = DOCKCONT_MAX; iCont < _vContainer.size(); iCont++)
|
||||
for (size_t iCont = DOCKCONT_MAX, len = _vContainer.size(); iCont < len; iCont++)
|
||||
{
|
||||
if (pArrayPos[iCont] == FALSE)
|
||||
{
|
||||
|
@ -416,7 +416,7 @@ void Gripper::doTabReordering(POINT pt)
|
||||
int iItemOld = _iItem;
|
||||
|
||||
/* search for every tab entry */
|
||||
for (size_t iCont = 0; iCont < vCont.size(); iCont++)
|
||||
for (size_t iCont = 0, len = vCont.size(); iCont < len; iCont++)
|
||||
{
|
||||
hTab = vCont[iCont]->getTabWnd();
|
||||
|
||||
@ -729,7 +729,7 @@ DockingCont* Gripper::contHitTest(POINT pt)
|
||||
vector<DockingCont*> vCont = _pDockMgr->getContainerInfo();
|
||||
HWND hWnd = ::WindowFromPoint(pt);
|
||||
|
||||
for (UINT iCont = 0; iCont < vCont.size(); iCont++)
|
||||
for (UINT iCont = 0, len = vCont.size(); iCont < len; iCont++)
|
||||
{
|
||||
/* test if within caption */
|
||||
if (hWnd == vCont[iCont]->getCaptionWnd())
|
||||
@ -783,7 +783,7 @@ DockingCont* Gripper::workHitTest(POINT pt, RECT *rc)
|
||||
vector<DockingCont*> vCont = _pDockMgr->getContainerInfo();
|
||||
|
||||
/* at first test if cursor points into a visible container */
|
||||
for (size_t iCont = 0; iCont < vCont.size(); iCont++)
|
||||
for (size_t iCont = 0, len = vCont.size(); iCont < len; iCont++)
|
||||
{
|
||||
if (vCont[iCont]->isVisible())
|
||||
{
|
||||
|
@ -159,7 +159,7 @@ generic_string FunctionListPanel::parseSubLevel(size_t begin, size_t end, std::v
|
||||
void FunctionListPanel::addInTreeStateArray(TreeStateNode tree2Update)
|
||||
{
|
||||
bool found = false;
|
||||
for (size_t i = 0; i < _treeStates.size(); i++)
|
||||
for (size_t i = 0, len = _treeStates.size(); i < len; i++)
|
||||
{
|
||||
if (_treeStates[i]._extraData == tree2Update._extraData)
|
||||
{
|
||||
@ -174,7 +174,7 @@ void FunctionListPanel::addInTreeStateArray(TreeStateNode tree2Update)
|
||||
|
||||
TreeStateNode* FunctionListPanel::getFromTreeStateArray(generic_string fullFilePath)
|
||||
{
|
||||
for (size_t i = 0; i < _treeStates.size(); i++)
|
||||
for (size_t i = 0, len = _treeStates.size(); i < len; i++)
|
||||
{
|
||||
if (_treeStates[i]._extraData == fullFilePath)
|
||||
return &_treeStates[i];
|
||||
@ -201,7 +201,7 @@ void FunctionListPanel::reload()
|
||||
_treeView.addItem(fn, NULL, INDEX_ROOT, TEXT("-1"));
|
||||
}
|
||||
|
||||
for (size_t i = 0; i < fi.size(); i++)
|
||||
for (size_t i = 0, len = fi.size(); i < len; i++)
|
||||
{
|
||||
// no 2 level
|
||||
bool b = false;
|
||||
|
@ -32,7 +32,7 @@
|
||||
|
||||
FunctionParsersManager::~FunctionParsersManager()
|
||||
{
|
||||
for (size_t i = 0; i < _parsers.size(); i++)
|
||||
for (size_t i = 0, len = _parsers.size(); i < len; i++)
|
||||
{
|
||||
delete _parsers[i];
|
||||
}
|
||||
@ -243,7 +243,7 @@ bool FunctionParsersManager::getFuncListFromXmlTree()
|
||||
const TCHAR *id = (childNode->ToElement())->Attribute(TEXT("id"));
|
||||
if ((langIDStr || (exts && exts[0])) && (id && id[0]))
|
||||
{
|
||||
for (size_t i = 0; i < _parsers.size(); i++)
|
||||
for (size_t i = 0, len = _parsers.size(); i < len; i++)
|
||||
{
|
||||
if (_parsers[i]->_id == id)
|
||||
{
|
||||
@ -260,7 +260,7 @@ bool FunctionParsersManager::getFuncListFromXmlTree()
|
||||
|
||||
FunctionParser * FunctionParsersManager::getParser(int langID)
|
||||
{
|
||||
for (size_t i = 0; i < _associationMap.size(); i++)
|
||||
for (size_t i = 0, len = _associationMap.size(); i < len; i++)
|
||||
{
|
||||
if (langID == _associationMap[i]._langID)
|
||||
return _parsers[_associationMap[i]._id];
|
||||
@ -273,7 +273,7 @@ FunctionParser * FunctionParsersManager::getParser(generic_string ext)
|
||||
if (ext == TEXT(""))
|
||||
return NULL;
|
||||
|
||||
for (size_t i = 0; i < _associationMap.size(); i++)
|
||||
for (size_t i = 0, len = _associationMap.size(); i < len; i++)
|
||||
{
|
||||
if (ext == _associationMap[i]._ext)
|
||||
return _parsers[_associationMap[i]._id];
|
||||
@ -561,7 +561,7 @@ void FunctionParser::getCommentZones(vector< pair<int, int> > & commentZone, siz
|
||||
|
||||
bool FunctionParser::isInZones(int pos2Test, const std::vector< std::pair<int, int> > & zones)
|
||||
{
|
||||
for (size_t i = 0; i < zones.size(); i++)
|
||||
for (size_t i = 0, len = zones.size(); i < len; i++)
|
||||
{
|
||||
if (pos2Test >= zones[i].first && pos2Test < zones[i].second)
|
||||
{
|
||||
@ -586,7 +586,7 @@ void FunctionParser::getInvertZones(vector< pair<int, int> > & destZones, vecto
|
||||
}
|
||||
|
||||
size_t i = 0;
|
||||
for (; i < sourceZones.size() - 1; i++)
|
||||
for (size_t len = sourceZones.size() - 1; i < len; i++)
|
||||
{
|
||||
int newBegin = sourceZones[i].second + 1;
|
||||
int newEnd = sourceZones[i+1].first - 1;
|
||||
@ -604,7 +604,7 @@ void FunctionZoneParser::parse(std::vector<foundInfo> & foundInfos, size_t begin
|
||||
vector< pair<int, int> > classZones, commentZones, nonCommentZones;
|
||||
getCommentZones(commentZones, begin, end, ppEditView);
|
||||
getInvertZones(nonCommentZones, commentZones, begin, end);
|
||||
for (size_t i = 0; i < nonCommentZones.size(); i++)
|
||||
for (size_t i = 0, len = nonCommentZones.size(); i < len; i++)
|
||||
{
|
||||
classParse(foundInfos, classZones, commentZones, nonCommentZones[i].first, nonCommentZones[i].second, ppEditView, classStructName);
|
||||
}
|
||||
@ -615,7 +615,7 @@ void FunctionUnitParser::parse(std::vector<foundInfo> & foundInfos, size_t begin
|
||||
vector< pair<int, int> > commentZones, nonCommentZones;
|
||||
getCommentZones(commentZones, begin, end, ppEditView);
|
||||
getInvertZones(nonCommentZones, commentZones, begin, end);
|
||||
for (size_t i = 0; i < nonCommentZones.size(); i++)
|
||||
for (size_t i = 0, len = nonCommentZones.size(); i < len; i++)
|
||||
{
|
||||
funcParse(foundInfos, nonCommentZones[i].first, nonCommentZones[i].second, ppEditView, classStructName);
|
||||
}
|
||||
@ -638,7 +638,7 @@ void FunctionMixParser::parse(std::vector<foundInfo> & foundInfos, size_t begin,
|
||||
classParse(foundInfos, scannedZones, commentZones, begin, end, ppEditView, classStructName);
|
||||
|
||||
// the second level
|
||||
for (size_t i = 0; i < scannedZones.size(); i++)
|
||||
for (size_t i = 0, len = scannedZones.size(); i < len; i++)
|
||||
{
|
||||
vector< pair<int, int> > temp;
|
||||
classParse(foundInfos, temp, commentZones, scannedZones[i].first, scannedZones[i].second, ppEditView, classStructName);
|
||||
@ -649,7 +649,7 @@ void FunctionMixParser::parse(std::vector<foundInfo> & foundInfos, size_t begin,
|
||||
// for each nonScannedZones, search functions
|
||||
if (_funcUnitPaser)
|
||||
{
|
||||
for (size_t i = 0; i < nonScannedZones.size(); i++)
|
||||
for (size_t i = 0, len = nonScannedZones.size(); i < len; i++)
|
||||
{
|
||||
_funcUnitPaser->funcParse(foundInfos, nonScannedZones[i].first, nonScannedZones[i].second, ppEditView, classStructName);
|
||||
}
|
||||
|
@ -1279,12 +1279,14 @@ void SizeGrid(HWND hWnd,int SI)
|
||||
}
|
||||
|
||||
int FindLongestLine(HDC hdc,TCHAR* text,SIZE* size)
|
||||
{int longest,lines,j;
|
||||
{
|
||||
int longest, lines;
|
||||
TCHAR temptext[1000];
|
||||
TCHAR *p;
|
||||
longest=0;
|
||||
lines=1;
|
||||
for(j=0;j<(int)lstrlen(text);j++)
|
||||
|
||||
for(size_t j=0, len=lstrlen(text); j<len; j++)
|
||||
{
|
||||
if(text[j]=='\n')
|
||||
{
|
||||
|
@ -90,7 +90,7 @@ void ToolBarIcons::reInit(int size)
|
||||
ImageList_SetIconSize(getHotLst(), size, size);
|
||||
ImageList_SetIconSize(getDisableLst(), size, size);
|
||||
|
||||
for (int i = 0 ; i < int(_tbiis.size()) ; i++)
|
||||
for (size_t i = 0, len = _tbiis.size(); i < len; i++)
|
||||
{
|
||||
if (_tbiis[i]._defaultIcon != -1)
|
||||
{
|
||||
|
@ -242,7 +242,7 @@ BOOL CALLBACK BarsDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM)
|
||||
#else
|
||||
LocalizationSwitcher & localizationSwitcher = pNppParam->getLocalizationSwitcher();
|
||||
|
||||
for (size_t i = 0 ; i < localizationSwitcher.size() ; i++)
|
||||
for (size_t i = 0, len = localizationSwitcher.size(); i < len ; i++)
|
||||
{
|
||||
pair<wstring, wstring> localizationInfo = localizationSwitcher.getElementFromIndex(i);
|
||||
::SendDlgItemMessage(_hSelf, IDC_COMBO_LOCALIZATION, CB_ADDSTRING, 0, (LPARAM)localizationInfo.first.c_str());
|
||||
@ -1364,7 +1364,7 @@ BOOL CALLBACK LangMenuDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM lPara
|
||||
}
|
||||
}
|
||||
|
||||
for (size_t i = 0 ; i < nppGUI._excludedLangList.size() ; i++)
|
||||
for (size_t i = 0, len = nppGUI._excludedLangList.size(); i < len ; i++)
|
||||
{
|
||||
::SendDlgItemMessage(_hSelf, IDC_LIST_DISABLEDLANG, LB_ADDSTRING, 0, (LPARAM)nppGUI._excludedLangList[i]._langName.c_str());
|
||||
}
|
||||
@ -1715,7 +1715,7 @@ BOOL CALLBACK PrintSettingsDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM)
|
||||
::SendDlgItemMessage(_hSelf, IDC_COMBO_FFONTSIZE, CB_ADDSTRING, 0, (LPARAM)intStr);
|
||||
}
|
||||
const std::vector<generic_string> & fontlist = pNppParam->getFontList();
|
||||
for (size_t i = 0 ; i < fontlist.size() ; i++)
|
||||
for (size_t i = 0, len = fontlist.size() ; i < len ; i++)
|
||||
{
|
||||
int j = ::SendDlgItemMessage(_hSelf, IDC_COMBO_HFONTNAME, CB_ADDSTRING, 0, (LPARAM)fontlist[i].c_str());
|
||||
::SendDlgItemMessage(_hSelf, IDC_COMBO_FFONTNAME, CB_ADDSTRING, 0, (LPARAM)fontlist[i].c_str());
|
||||
@ -1751,7 +1751,7 @@ BOOL CALLBACK PrintSettingsDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM)
|
||||
varList.push_back(strCouple(TEXT("Long date format"), TEXT("$(LONG_DATE)")));
|
||||
varList.push_back(strCouple(TEXT("Time"), TEXT("$(TIME)")));
|
||||
|
||||
for (size_t i = 0 ; i < varList.size() ; i++)
|
||||
for (size_t i = 0, len = varList.size() ; i < len ; i++)
|
||||
{
|
||||
int j = ::SendDlgItemMessage(_hSelf, IDC_COMBO_VARLIST, CB_ADDSTRING, 0, (LPARAM)varList[i]._varDesc.c_str());
|
||||
::SendDlgItemMessage(_hSelf, IDC_COMBO_VARLIST, CB_SETITEMDATA, j, (LPARAM)varList[i]._var.c_str());
|
||||
|
@ -1129,7 +1129,7 @@ void ProjectPanel::recursiveAddFilesFrom(const TCHAR *folderPath, HTREEITEM hTre
|
||||
}
|
||||
} while (::FindNextFile(hFile, &foundData));
|
||||
|
||||
for (size_t i = 0 ; i < files.size() ; i++)
|
||||
for (size_t i = 0, len = files.size() ; i < len ; i++)
|
||||
{
|
||||
generic_string pathFile(folderPath);
|
||||
if (folderPath[lstrlen(folderPath)-1] != '\\')
|
||||
|
@ -463,7 +463,7 @@ bool TreeView::canDropIn(HTREEITEM targetItem)
|
||||
tvItem.hItem = targetItem;
|
||||
SendMessage(_hSelf, TVM_GETITEM, 0,(LPARAM)&tvItem);
|
||||
|
||||
for (size_t i = 0; i < _canNotDropInList.size(); i++)
|
||||
for (size_t i = 0, len = _canNotDropInList.size(); i < len; i++)
|
||||
{
|
||||
if (tvItem.iImage == _canNotDropInList[i])
|
||||
return false;
|
||||
@ -479,7 +479,7 @@ bool TreeView::canDragOut(HTREEITEM targetItem)
|
||||
tvItem.hItem = targetItem;
|
||||
SendMessage(_hSelf, TVM_GETITEM, 0,(LPARAM)&tvItem);
|
||||
|
||||
for (size_t i = 0; i < _canNotDragOutList.size(); i++)
|
||||
for (size_t i = 0, len = _canNotDragOutList.size(); i < len; i++)
|
||||
{
|
||||
if (tvItem.iImage == _canNotDragOutList[i])
|
||||
return false;
|
||||
|
@ -26,9 +26,9 @@
|
||||
|
||||
void Command::extractArgs(TCHAR *cmd2Exec, TCHAR *args, const TCHAR *cmdEntier)
|
||||
{
|
||||
int i = 0;
|
||||
size_t i = 0;
|
||||
bool quoted = false;
|
||||
for ( ; i < int(lstrlen(cmdEntier)) ; i++)
|
||||
for (size_t len = lstrlen(cmdEntier); i < len ; i++)
|
||||
{
|
||||
if ((cmdEntier[i] == ' ') && (!quoted))
|
||||
break;
|
||||
@ -39,12 +39,12 @@ void Command::extractArgs(TCHAR *cmd2Exec, TCHAR *args, const TCHAR *cmdEntier)
|
||||
}
|
||||
cmd2Exec[i] = '\0';
|
||||
|
||||
if (i < int(lstrlen(cmdEntier)))
|
||||
if (i < size_t(lstrlen(cmdEntier)))
|
||||
{
|
||||
for ( ; (i < int(lstrlen(cmdEntier))) && (cmdEntier[i] == ' ') ; i++);
|
||||
if (i < int(lstrlen(cmdEntier)))
|
||||
for (size_t len = size_t(lstrlen(cmdEntier)); (i < len) && (cmdEntier[i] == ' ') ; i++);
|
||||
if (i < size_t(lstrlen(cmdEntier)))
|
||||
{
|
||||
for (int k = 0 ; i <= int(lstrlen(cmdEntier)) ; i++, k++)
|
||||
for (size_t k = 0, len2 = size_t(lstrlen(cmdEntier)); i <= len2; i++, k++)
|
||||
{
|
||||
args[k] = cmdEntier[i];
|
||||
}
|
||||
@ -91,14 +91,14 @@ int whichVar(TCHAR *str)
|
||||
void expandNppEnvironmentStrs(const TCHAR *strSrc, TCHAR *stringDest, size_t strDestLen, HWND hWnd)
|
||||
{
|
||||
size_t j = 0;
|
||||
for (int i = 0 ; i < lstrlen(strSrc) ; i++)
|
||||
for (size_t i = 0, len = size_t(lstrlen(strSrc)); i < len; i++)
|
||||
{
|
||||
int iBegin = -1;
|
||||
int iEnd = -1;
|
||||
if ((strSrc[i] == '$') && (strSrc[i+1] == '('))
|
||||
{
|
||||
iBegin = i += 2;
|
||||
for ( ; i < lstrlen(strSrc) ; i++)
|
||||
for (size_t len2 = size_t(lstrlen(strSrc)); i < len2 ; i++)
|
||||
{
|
||||
if (strSrc[i] == ')')
|
||||
{
|
||||
@ -137,7 +137,7 @@ void expandNppEnvironmentStrs(const TCHAR *strSrc, TCHAR *stringDest, size_t str
|
||||
else
|
||||
::SendMessage(hWnd, RUNCOMMAND_USER + internalVar, CURRENTWORD_MAXLENGTH, (LPARAM)expandedStr);
|
||||
|
||||
for (int p = 0 ; p < lstrlen(expandedStr) ; p++)
|
||||
for (size_t p = 0, len3 = size_t(lstrlen(expandedStr)); p < len3; p++)
|
||||
{
|
||||
if (j < (strDestLen-1))
|
||||
stringDest[j++] = expandedStr[p];
|
||||
|
@ -33,7 +33,7 @@ void ControlsTab::createTabs(WindowVector & winVector)
|
||||
{
|
||||
_pWinVector = &winVector;
|
||||
|
||||
for (int i = 0 ; i < int(winVector.size()) ; i++)
|
||||
for (size_t i = 0, len = winVector.size(); i < len; i++)
|
||||
TabBar::insertAtEnd(winVector[i]._name.c_str());
|
||||
|
||||
TabBar::activateAt(0);
|
||||
@ -78,7 +78,7 @@ bool ControlsTab::renameTab(const TCHAR *internalName, const TCHAR *newName)
|
||||
{
|
||||
bool foundIt = false;
|
||||
size_t i = 0;
|
||||
for ( ; i < _pWinVector->size() ; i++)
|
||||
for (size_t len = _pWinVector->size(); i < len; i++)
|
||||
{
|
||||
if ((*_pWinVector)[i]._internalName == internalName)
|
||||
{
|
||||
|
@ -129,7 +129,7 @@ public :
|
||||
bool changeIcons() {
|
||||
if (!_toolIcons)
|
||||
return false;
|
||||
for (int i = 0 ; i < int(_customIconVect.size()) ; i++)
|
||||
for (size_t i = 0, len = _customIconVect.size(); i < len; i++)
|
||||
changeIcons(_customIconVect[i].listIndex, _customIconVect[i].iconIndex, (_customIconVect[i].iconLocation).c_str());
|
||||
return true;
|
||||
};
|
||||
|
@ -95,7 +95,7 @@ void VerticalFileSwitcherListView::initList()
|
||||
{
|
||||
TaskListInfo taskListInfo;
|
||||
::SendMessage(::GetParent(_hParent), WM_GETTASKLISTINFO, (WPARAM)&taskListInfo, TRUE);
|
||||
for (size_t i = 0 ; i < taskListInfo._tlfsLst.size() ; i++)
|
||||
for (size_t i = 0, len = taskListInfo._tlfsLst.size(); i < len ; i++)
|
||||
{
|
||||
TaskLstFnStatus & fileNameStatus = taskListInfo._tlfsLst[i];
|
||||
|
||||
|
@ -44,7 +44,7 @@ void RunMacroDlg::initMacroList()
|
||||
if (::SendMessage(_hParent, WM_GETCURRENTMACROSTATUS, 0, 0) == MACRO_RECORDING_HAS_STOPPED)
|
||||
::SendDlgItemMessage(_hSelf, IDC_MACRO_COMBO, CB_ADDSTRING, 0, (LPARAM)TEXT("Current recorded macro"));
|
||||
|
||||
for (size_t i = 0 ; i < macroList.size() ; i++)
|
||||
for (size_t i = 0, len = macroList.size(); i < len ; i++)
|
||||
::SendDlgItemMessage(_hSelf, IDC_MACRO_COMBO, CB_ADDSTRING, 0, (LPARAM)macroList[i].getName());
|
||||
|
||||
::SendDlgItemMessage(_hSelf, IDC_MACRO_COMBO, CB_SETCURSEL, 0, 0);
|
||||
|
@ -309,7 +309,7 @@ void getNameStrFromCmd(DWORD cmd, generic_string & str)
|
||||
{
|
||||
vector<PluginCmdShortcut> & pluginCmds = (NppParameters::getInstance())->getPluginCommandList();
|
||||
int i = 0;
|
||||
for (size_t j = 0 ; j < pluginCmds.size() ; j++)
|
||||
for (size_t j = 0, len = pluginCmds.size(); j < len ; j++)
|
||||
{
|
||||
if (pluginCmds[j].getID() == cmd)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user