Rename variables & clean up

This commit is contained in:
Don HO 2017-07-27 10:30:53 +02:00
parent 8342da3df8
commit 385746de01
16 changed files with 131 additions and 237 deletions

View File

@ -1906,7 +1906,7 @@ void Notepad_plus::checkDocState()
bool isFileExisting = PathFileExists(curBuf->getFullPathName()) != FALSE; bool isFileExisting = PathFileExists(curBuf->getFullPathName()) != FALSE;
if (!isCurrentDirty) if (!isCurrentDirty)
{ {
for (size_t i = 0; i < MainFileManager->getNrBuffers(); ++i) for (size_t i = 0; i < MainFileManager->getNbBuffers(); ++i)
{ {
if (MainFileManager->getBufferByIndex(i)->isDirty()) if (MainFileManager->getBufferByIndex(i)->isDirty())
{ {
@ -4959,7 +4959,7 @@ bool Notepad_plus::dumpFiles(const TCHAR * outdir, const TCHAR * fileprefix) {
TCHAR savePath[MAX_PATH] = {0}; TCHAR savePath[MAX_PATH] = {0};
//rescue primary //rescue primary
for (size_t i = 0; i < MainFileManager->getNrBuffers(); ++i) for (size_t i = 0; i < MainFileManager->getNbBuffers(); ++i)
{ {
Buffer * docbuf = MainFileManager->getBufferByIndex(i); Buffer * docbuf = MainFileManager->getBufferByIndex(i);
if (!docbuf->isDirty()) //skip saved documents if (!docbuf->isDirty()) //skip saved documents

View File

@ -177,7 +177,7 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa
generic_string name{userLangName}; generic_string name{userLangName};
//loop through buffers and reset the language (L_USER, TEXT("")) if (L_USER, name) //loop through buffers and reset the language (L_USER, TEXT("")) if (L_USER, name)
for (size_t i = 0; i < MainFileManager->getNrBuffers(); ++i) for (size_t i = 0; i < MainFileManager->getNbBuffers(); ++i)
{ {
Buffer* buf = MainFileManager->getBufferByIndex(i); Buffer* buf = MainFileManager->getBufferByIndex(i);
if (buf->getLangType() == L_USER && name == buf->getUserDefineLangName()) if (buf->getLangType() == L_USER && name == buf->getUserDefineLangName())
@ -195,7 +195,7 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa
generic_string newName{ reinterpret_cast<TCHAR *>(wParam) }; generic_string newName{ reinterpret_cast<TCHAR *>(wParam) };
//loop through buffers and reset the language (L_USER, newName) if (L_USER, oldName) //loop through buffers and reset the language (L_USER, newName) if (L_USER, oldName)
for (size_t i = 0; i < MainFileManager->getNrBuffers(); ++i) for (size_t i = 0; i < MainFileManager->getNbBuffers(); ++i)
{ {
Buffer* buf = MainFileManager->getBufferByIndex(i); Buffer* buf = MainFileManager->getBufferByIndex(i);
if (buf->getLangType() == L_USER && oldName == buf->getUserDefineLangName()) if (buf->getLangType() == L_USER && oldName == buf->getUserDefineLangName())

View File

@ -643,7 +643,7 @@ void Notepad_plus::doClose(BufferID id, int whichOne, bool doDeleteBackup)
} }
} }
size_t nrDocs = whichOne==MAIN_VIEW?(_mainDocTab.nbItem()):(_subDocTab.nbItem()); size_t nbDocs = whichOne==MAIN_VIEW?(_mainDocTab.nbItem()):(_subDocTab.nbItem());
if (buf->isMonitoringOn()) if (buf->isMonitoringOn())
{ {
@ -658,7 +658,7 @@ void Notepad_plus::doClose(BufferID id, int whichOne, bool doDeleteBackup)
//Do all the works //Do all the works
bool isBufRemoved = removeBufferFromView(id, whichOne); bool isBufRemoved = removeBufferFromView(id, whichOne);
BufferID hiddenBufferID = BUFFER_INVALID; BufferID hiddenBufferID = BUFFER_INVALID;
if (nrDocs == 1 && canHideView(whichOne)) if (nbDocs == 1 && canHideView(whichOne))
{ //close the view if both visible { //close the view if both visible
hideView(whichOne); hideView(whichOne);

View File

@ -1709,9 +1709,9 @@ bool NppParameters::getBlackListFromXmlTree()
void NppParameters::initMenuKeys() void NppParameters::initMenuKeys()
{ {
int nrCommands = sizeof(winKeyDefs)/sizeof(WinMenuKeyDefinition); int nbCommands = sizeof(winKeyDefs)/sizeof(WinMenuKeyDefinition);
WinMenuKeyDefinition wkd; WinMenuKeyDefinition wkd;
for(int i = 0; i < nrCommands; ++i) for(int i = 0; i < nbCommands; ++i)
{ {
wkd = winKeyDefs[i]; wkd = winKeyDefs[i];
Shortcut sc((wkd.specialName ? wkd.specialName : TEXT("")), wkd.isCtrl, wkd.isAlt, wkd.isShift, static_cast<unsigned char>(wkd.vKey)); Shortcut sc((wkd.specialName ? wkd.specialName : TEXT("")), wkd.isCtrl, wkd.isAlt, wkd.isShift, static_cast<unsigned char>(wkd.vKey));
@ -1721,13 +1721,13 @@ void NppParameters::initMenuKeys()
void NppParameters::initScintillaKeys() { void NppParameters::initScintillaKeys() {
int nrCommands = sizeof(scintKeyDefs)/sizeof(ScintillaKeyDefinition); int nbCommands = sizeof(scintKeyDefs)/sizeof(ScintillaKeyDefinition);
//Warning! Matching function have to be consecutive //Warning! Matching function have to be consecutive
ScintillaKeyDefinition skd; ScintillaKeyDefinition skd;
int prevIndex = -1; int prevIndex = -1;
int prevID = -1; int prevID = -1;
for(int i = 0; i < nrCommands; ++i) for(int i = 0; i < nbCommands; ++i)
{ {
skd = scintKeyDefs[i]; skd = scintKeyDefs[i];
if (skd.functionId == prevID) if (skd.functionId == prevID)

View File

@ -489,14 +489,14 @@ void FileManager::init(Notepad_plus * pNotepadPlus, ScintillaEditView * pscratch
void FileManager::checkFilesystemChanges() void FileManager::checkFilesystemChanges()
{ {
for (int i = int(_nrBufs) - 1; i >= 0 ; i--) for (int i = int(_nbBufs) - 1; i >= 0 ; i--)
{ {
if (i >= int(_nrBufs)) if (i >= int(_nbBufs))
{ {
if (_nrBufs == 0) if (_nbBufs == 0)
return; return;
i = int(_nrBufs) - 1; i = int(_nbBufs) - 1;
} }
_buffers[i]->checkFileState(); //something has changed. Triggers update automatically _buffers[i]->checkFileState(); //something has changed. Triggers update automatically
} }
@ -505,7 +505,7 @@ void FileManager::checkFilesystemChanges()
int FileManager::getBufferIndexByID(BufferID id) int FileManager::getBufferIndexByID(BufferID id)
{ {
for(size_t i = 0; i < _nrBufs; ++i) for(size_t i = 0; i < _nbBufs; ++i)
{ {
if (_buffers[i]->_id == id) if (_buffers[i]->_id == id)
return static_cast<int>(i); return static_cast<int>(i);
@ -546,7 +546,7 @@ void FileManager::closeBuffer(BufferID id, ScintillaEditView * identifier)
_pscratchTilla->execute(SCI_RELEASEDOCUMENT, 0, buf->_doc); //release for FileManager, Document is now gone _pscratchTilla->execute(SCI_RELEASEDOCUMENT, 0, buf->_doc); //release for FileManager, Document is now gone
_buffers.erase(_buffers.begin() + index); _buffers.erase(_buffers.begin() + index);
delete buf; delete buf;
_nrBufs--; _nbBufs--;
} }
} }
@ -597,8 +597,8 @@ BufferID FileManager::loadFile(const TCHAR * filename, Document doc, int encodin
newBuf->_timeStamp = fileNameTimestamp; newBuf->_timeStamp = fileNameTimestamp;
_buffers.push_back(newBuf); _buffers.push_back(newBuf);
++_nrBufs; ++_nbBufs;
Buffer* buf = _buffers.at(_nrBufs - 1); Buffer* buf = _buffers.at(_nbBufs - 1);
// restore the encoding (ANSI based) while opening the existing file // restore the encoding (ANSI based) while opening the existing file
NppParameters *pNppParamInst = NppParameters::getInstance(); NppParameters *pNppParamInst = NppParameters::getInstance();
@ -1196,7 +1196,7 @@ BufferID FileManager::newEmptyDocument()
BufferID id = static_cast<BufferID>(newBuf); BufferID id = static_cast<BufferID>(newBuf);
newBuf->_id = id; newBuf->_id = id;
_buffers.push_back(newBuf); _buffers.push_back(newBuf);
++_nrBufs; ++_nbBufs;
++_nextBufferID; ++_nextBufferID;
return id; return id;
} }
@ -1214,7 +1214,7 @@ BufferID FileManager::bufferFromDocument(Document doc, bool dontIncrease, bool d
BufferID id = static_cast<BufferID>(newBuf); BufferID id = static_cast<BufferID>(newBuf);
newBuf->_id = id; newBuf->_id = id;
_buffers.push_back(newBuf); _buffers.push_back(newBuf);
++_nrBufs; ++_nbBufs;
if (!dontIncrease) if (!dontIncrease)
++_nextBufferID; ++_nextBufferID;
@ -1517,7 +1517,7 @@ BufferID FileManager::getBufferFromName(const TCHAR* name)
BufferID FileManager::getBufferFromDocument(Document doc) BufferID FileManager::getBufferFromDocument(Document doc)
{ {
for (size_t i = 0; i < _nrBufs; ++i) for (size_t i = 0; i < _nbBufs; ++i)
{ {
if (_buffers[i]->_doc == doc) if (_buffers[i]->_doc == doc)
return _buffers[i]->_id; return _buffers[i]->_id;

View File

@ -76,7 +76,7 @@ public:
//void activateBuffer(int index); //void activateBuffer(int index);
void checkFilesystemChanges(); void checkFilesystemChanges();
size_t getNrBuffers() { return _nrBufs; }; size_t getNbBuffers() { return _nbBufs; };
int getBufferIndexByID(BufferID id); int getBufferIndexByID(BufferID id);
Buffer * getBufferByIndex(size_t index); Buffer * getBufferByIndex(size_t index);
Buffer * getBufferByID(BufferID id) {return static_cast<Buffer*>(id);} Buffer * getBufferByID(BufferID id) {return static_cast<Buffer*>(id);}
@ -127,7 +127,7 @@ private:
Document _scratchDocDefault; Document _scratchDocDefault;
std::vector<Buffer*> _buffers; std::vector<Buffer*> _buffers;
BufferID _nextBufferID = 0; BufferID _nextBufferID = 0;
size_t _nrBufs = 0; size_t _nbBufs = 0;
}; };
#define MainFileManager FileManager::getInstance() #define MainFileManager FileManager::getInstance()

View File

@ -111,14 +111,14 @@ bool FunctionCallTip::updateCalltip(int ch, bool needShown)
void FunctionCallTip::showNextOverload() { void FunctionCallTip::showNextOverload() {
if (!isVisible()) if (!isVisible())
return; return;
_currentOverload = (_currentOverload+1) % _currentNrOverloads; _currentOverload = (_currentOverload+1) % _currentNbOverloads;
showCalltip(); showCalltip();
} }
void FunctionCallTip::showPrevOverload() { void FunctionCallTip::showPrevOverload() {
if (!isVisible()) if (!isVisible())
return; return;
_currentOverload = _currentOverload > 0 ? (_currentOverload-1) : (_currentNrOverloads-1); _currentOverload = _currentOverload > 0 ? (_currentOverload-1) : (_currentNbOverloads-1);
showCalltip(); showCalltip();
} }
@ -363,12 +363,12 @@ bool FunctionCallTip::loadFunction()
_overloads.push_back(paramVec); _overloads.push_back(paramVec);
paramVec.clear(); paramVec.clear();
++_currentNrOverloads; ++_currentNbOverloads;
} }
_currentNrOverloads = _overloads.size(); _currentNbOverloads = _overloads.size();
if (_currentNrOverloads == 0) //malformed node if (_currentNbOverloads == 0) //malformed node
return false; return false;
return true; return true;
@ -376,7 +376,7 @@ bool FunctionCallTip::loadFunction()
void FunctionCallTip::showCalltip() void FunctionCallTip::showCalltip()
{ {
if (_currentNrOverloads == 0) if (_currentNbOverloads == 0)
{ {
//ASSERT //ASSERT
return; return;
@ -401,17 +401,17 @@ void FunctionCallTip::showCalltip()
generic_stringstream callTipText; generic_stringstream callTipText;
if (_currentNrOverloads > 1) if (_currentNbOverloads > 1)
{ {
callTipText << TEXT("\001") << _currentOverload + 1 << TEXT(" of ") << _currentNrOverloads << TEXT("\002"); callTipText << TEXT("\001") << _currentOverload + 1 << TEXT(" of ") << _currentNbOverloads << TEXT("\002");
} }
callTipText << _retVals.at(_currentOverload) << TEXT(' ') << _funcName << TEXT(' ') << _start; callTipText << _retVals.at(_currentOverload) << TEXT(' ') << _funcName << TEXT(' ') << _start;
int highlightstart = 0; int highlightstart = 0;
int highlightend = 0; int highlightend = 0;
size_t nrParams = params.size(); size_t nbParams = params.size();
for (size_t i = 0; i < nrParams; ++i) for (size_t i = 0; i < nbParams; ++i)
{ {
if (int(i) == _currentParam) if (int(i) == _currentParam)
{ {
@ -419,7 +419,7 @@ void FunctionCallTip::showCalltip()
highlightend = highlightstart + lstrlen(params.at(i)); highlightend = highlightstart + lstrlen(params.at(i));
} }
callTipText << params.at(i); callTipText << params.at(i);
if (i < nrParams - 1) if (i < nbParams - 1)
callTipText << _param << TEXT(' '); callTipText << _param << TEXT(' ');
} }
@ -448,7 +448,7 @@ void FunctionCallTip::reset() {
//_curPos = 0; //_curPos = 0;
_startPos = 0; _startPos = 0;
_overloads.clear(); _overloads.clear();
_currentNrOverloads = 0; _currentNbOverloads = 0;
_retVals.clear(); _retVals.clear();
_descriptions.clear(); _descriptions.clear();
} }

View File

@ -59,7 +59,7 @@ private:
stringVec _retVals; //vector of overload return values/types stringVec _retVals; //vector of overload return values/types
std::vector<stringVec> _overloads; //vector of overload params (=vector) std::vector<stringVec> _overloads; //vector of overload params (=vector)
stringVec _descriptions; //vecotr of function descriptions stringVec _descriptions; //vecotr of function descriptions
size_t _currentNrOverloads = 0; //current amount of overloads size_t _currentNbOverloads = 0; //current amount of overloads
size_t _currentOverload = 0; //current chosen overload size_t _currentOverload = 0; //current chosen overload
int _currentParam = 0; //current highlighted param int _currentParam = 0; //current highlighted param

View File

@ -3089,12 +3089,12 @@ void ScintillaEditView::hideLines()
int endLine = static_cast<int32_t>(execute(SCI_LINEFROMPOSITION, execute(SCI_GETSELECTIONEND))); int endLine = static_cast<int32_t>(execute(SCI_LINEFROMPOSITION, execute(SCI_GETSELECTIONEND)));
//perform range check: cannot hide very first and very last lines //perform range check: cannot hide very first and very last lines
//Offset them one off the edges, and then check if they are within the reasonable //Offset them one off the edges, and then check if they are within the reasonable
int nrLines = static_cast<int32_t>(execute(SCI_GETLINECOUNT)); int nbLines = static_cast<int32_t>(execute(SCI_GETLINECOUNT));
if (nrLines < 3) if (nbLines < 3)
return; //cannot possibly hide anything return; //cannot possibly hide anything
if (!startLine) if (!startLine)
++startLine; ++startLine;
if (endLine == (nrLines-1)) if (endLine == (nbLines-1))
--endLine; --endLine;
if (startLine > endLine) if (startLine > endLine)

View File

@ -46,8 +46,8 @@ void SmartHighlighter::highlightViewWithWord(ScintillaEditView * pHighlightView,
// Get the range of text visible and highlight everything in it // Get the range of text visible and highlight everything in it
auto firstLine = static_cast<int>(pHighlightView->execute(SCI_GETFIRSTVISIBLELINE)); auto firstLine = static_cast<int>(pHighlightView->execute(SCI_GETFIRSTVISIBLELINE));
auto nbLineOnScreen = pHighlightView->execute(SCI_LINESONSCREEN); auto nbLineOnScreen = pHighlightView->execute(SCI_LINESONSCREEN);
auto nrLines = min(nbLineOnScreen, MAXLINEHIGHLIGHT) + 1; auto nbLines = min(nbLineOnScreen, MAXLINEHIGHLIGHT) + 1;
auto lastLine = firstLine + nrLines; auto lastLine = firstLine + nbLines;
int startPos = 0; int startPos = 0;
int endPos = 0; int endPos = 0;
auto currentLine = firstLine; auto currentLine = firstLine;

View File

@ -3020,89 +3020,6 @@ LRESULT CALLBACK GridProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
} }
break; break;
/* case WM_SIZE: //obsolete
{
static int SI,cheight;
static int savewidth,saveheight;
int intin,intout;
SI=SelfIndex;
if(BGHS[SI].SIZING)
{
BGHS[SI].SIZING = FALSE;
break;
}
ShowHscroll(hWnd,SI);
ShowVscroll(hWnd,SI);
if((BGHS[SI].SHOWINTEGRALROWS)&&(BGHS[SI].VSCROLL))
{
saveheight=HIWORD(lParam);
intin=saveheight;
savewidth=LOWORD(lParam);
cheight=HIWORD(lParam);
cheight-=BGHS[SI].titleheight;
cheight-=BGHS[SI].headerrowheight;
{
int sbheight;
sbheight=GetSystemMetrics(SM_CYHSCROLL);
if(BGHS[SI].HSCROLL)
{
cheight-=sbheight;
}
if(BGHS[SI].VSCROLL)
{
RECT grect,prect;
GetClientRect(hWnd,&grect);
GetClientRect(GetParent(hWnd),&prect);
if((grect.right+sbheight) < prect.right)
{
savewidth+=sbheight;
}
}
}
if(cheight <= BGHS[SI].rowheight)
{
break;
}
else
{
//calculate fractional part of cheight/rowheight
int remainder,nrows;
nrows=(int)(cheight/BGHS[SI].rowheight);
remainder=cheight-(nrows * BGHS[SI].rowheight);
//make the window remainder pixels shorter
saveheight -= remainder;
saveheight +=4; //+=4
intout=saveheight;
WINDOWPLACEMENT wp;
RECT crect;
wp.length = sizeof(wp);
GetWindowPlacement(hWnd,&wp);
crect=wp.rcNormalPosition;
crect.bottom=intout;
//crect.bottom = NppParameters::getInstance()->_dpiManager.ScaleY(intout);
crect.right=savewidth;
BGHS[SI].SIZING = TRUE;
BGHS[SI].wannabeheight = HIWORD(lParam);
BGHS[SI].wannabewidth = LOWORD(lParam);
//NppParameters::getInstance()->_dpiManager.ScaleRect(&crect);
MoveWindow(hWnd,crect.left,crect.top,crect.right,crect.bottom,TRUE);
}
}
}
break; */
case WM_CREATE: case WM_CREATE:
lpcs = (LPCREATESTRUCT)lParam; lpcs = (LPCREATESTRUCT)lParam;

View File

@ -128,28 +128,28 @@ void ShortcutMapper::fillOutBabyGrid()
_babygrid.clear(); _babygrid.clear();
_babygrid.setInitialContent(true); _babygrid.setInitialContent(true);
size_t nrItems = 0; size_t nbItems = 0;
switch(_currentState) { switch(_currentState) {
case STATE_MENU: { case STATE_MENU: {
nrItems = nppParam->getUserShortcuts().size(); nbItems = nppParam->getUserShortcuts().size();
_babygrid.setLineColNumber(nrItems, 2); _babygrid.setLineColNumber(nbItems, 2);
break; } break; }
case STATE_MACRO: { case STATE_MACRO: {
nrItems = nppParam->getMacroList().size(); nbItems = nppParam->getMacroList().size();
_babygrid.setLineColNumber(nrItems, 2); _babygrid.setLineColNumber(nbItems, 2);
break; } break; }
case STATE_USER: { case STATE_USER: {
nrItems = nppParam->getUserCommandList().size(); nbItems = nppParam->getUserCommandList().size();
_babygrid.setLineColNumber(nrItems, 2); _babygrid.setLineColNumber(nbItems, 2);
break; } break; }
case STATE_PLUGIN: { case STATE_PLUGIN: {
nrItems = nppParam->getPluginCommandList().size(); nbItems = nppParam->getPluginCommandList().size();
_babygrid.setLineColNumber(nrItems, 2); _babygrid.setLineColNumber(nbItems, 2);
break; } break; }
case STATE_SCINTILLA: { case STATE_SCINTILLA: {
nrItems = nppParam->getScintillaKeyList().size(); nbItems = nppParam->getScintillaKeyList().size();
_babygrid.setLineColNumber(nrItems, 2); _babygrid.setLineColNumber(nbItems, 2);
break; } break; }
} }
@ -161,7 +161,7 @@ void ShortcutMapper::fillOutBabyGrid()
switch(_currentState) { switch(_currentState) {
case STATE_MENU: { case STATE_MENU: {
vector<CommandShortcut> & cshortcuts = nppParam->getUserShortcuts(); vector<CommandShortcut> & cshortcuts = nppParam->getUserShortcuts();
for(size_t i = 0; i < nrItems; ++i) for(size_t i = 0; i < nbItems; ++i)
{ {
if (findKeyConflicts(nullptr, cshortcuts[i].getKeyCombo(), i)) if (findKeyConflicts(nullptr, cshortcuts[i].getKeyCombo(), i))
isMarker = _babygrid.setMarker(true); isMarker = _babygrid.setMarker(true);
@ -179,7 +179,7 @@ void ShortcutMapper::fillOutBabyGrid()
break; } break; }
case STATE_MACRO: { case STATE_MACRO: {
vector<MacroShortcut> & cshortcuts = nppParam->getMacroList(); vector<MacroShortcut> & cshortcuts = nppParam->getMacroList();
for(size_t i = 0; i < nrItems; ++i) for(size_t i = 0; i < nbItems; ++i)
{ {
if (findKeyConflicts(nullptr, cshortcuts[i].getKeyCombo(), i)) if (findKeyConflicts(nullptr, cshortcuts[i].getKeyCombo(), i))
isMarker = _babygrid.setMarker(true); isMarker = _babygrid.setMarker(true);
@ -191,14 +191,14 @@ void ShortcutMapper::fillOutBabyGrid()
if (isMarker) if (isMarker)
isMarker = _babygrid.setMarker(false); isMarker = _babygrid.setMarker(false);
} }
bool shouldBeEnabled = nrItems > 0; bool shouldBeEnabled = nbItems > 0;
::EnableWindow(::GetDlgItem(_hSelf, IDM_BABYGRID_MODIFY), shouldBeEnabled); ::EnableWindow(::GetDlgItem(_hSelf, IDM_BABYGRID_MODIFY), shouldBeEnabled);
::EnableWindow(::GetDlgItem(_hSelf, IDM_BABYGRID_CLEAR), shouldBeEnabled); ::EnableWindow(::GetDlgItem(_hSelf, IDM_BABYGRID_CLEAR), shouldBeEnabled);
::EnableWindow(::GetDlgItem(_hSelf, IDM_BABYGRID_DELETE), shouldBeEnabled); ::EnableWindow(::GetDlgItem(_hSelf, IDM_BABYGRID_DELETE), shouldBeEnabled);
break; } break; }
case STATE_USER: { case STATE_USER: {
vector<UserCommand> & cshortcuts = nppParam->getUserCommandList(); vector<UserCommand> & cshortcuts = nppParam->getUserCommandList();
for(size_t i = 0; i < nrItems; ++i) for(size_t i = 0; i < nbItems; ++i)
{ {
if (findKeyConflicts(nullptr, cshortcuts[i].getKeyCombo(), i)) if (findKeyConflicts(nullptr, cshortcuts[i].getKeyCombo(), i))
isMarker = _babygrid.setMarker(true); isMarker = _babygrid.setMarker(true);
@ -210,14 +210,14 @@ void ShortcutMapper::fillOutBabyGrid()
if (isMarker) if (isMarker)
isMarker = _babygrid.setMarker(false); isMarker = _babygrid.setMarker(false);
} }
bool shouldBeEnabled = nrItems > 0; bool shouldBeEnabled = nbItems > 0;
::EnableWindow(::GetDlgItem(_hSelf, IDM_BABYGRID_MODIFY), shouldBeEnabled); ::EnableWindow(::GetDlgItem(_hSelf, IDM_BABYGRID_MODIFY), shouldBeEnabled);
::EnableWindow(::GetDlgItem(_hSelf, IDM_BABYGRID_CLEAR), shouldBeEnabled); ::EnableWindow(::GetDlgItem(_hSelf, IDM_BABYGRID_CLEAR), shouldBeEnabled);
::EnableWindow(::GetDlgItem(_hSelf, IDM_BABYGRID_DELETE), shouldBeEnabled); ::EnableWindow(::GetDlgItem(_hSelf, IDM_BABYGRID_DELETE), shouldBeEnabled);
break; } break; }
case STATE_PLUGIN: { case STATE_PLUGIN: {
vector<PluginCmdShortcut> & cshortcuts = nppParam->getPluginCommandList(); vector<PluginCmdShortcut> & cshortcuts = nppParam->getPluginCommandList();
for(size_t i = 0; i < nrItems; ++i) for(size_t i = 0; i < nbItems; ++i)
{ {
if (findKeyConflicts(nullptr, cshortcuts[i].getKeyCombo(), i)) if (findKeyConflicts(nullptr, cshortcuts[i].getKeyCombo(), i))
isMarker = _babygrid.setMarker(true); isMarker = _babygrid.setMarker(true);
@ -229,14 +229,14 @@ void ShortcutMapper::fillOutBabyGrid()
if (isMarker) if (isMarker)
isMarker = _babygrid.setMarker(false); isMarker = _babygrid.setMarker(false);
} }
bool shouldBeEnabled = nrItems > 0; bool shouldBeEnabled = nbItems > 0;
::EnableWindow(::GetDlgItem(_hSelf, IDM_BABYGRID_MODIFY), shouldBeEnabled); ::EnableWindow(::GetDlgItem(_hSelf, IDM_BABYGRID_MODIFY), shouldBeEnabled);
::EnableWindow(::GetDlgItem(_hSelf, IDM_BABYGRID_CLEAR), shouldBeEnabled); ::EnableWindow(::GetDlgItem(_hSelf, IDM_BABYGRID_CLEAR), shouldBeEnabled);
::EnableWindow(::GetDlgItem(_hSelf, IDM_BABYGRID_DELETE), false); ::EnableWindow(::GetDlgItem(_hSelf, IDM_BABYGRID_DELETE), false);
break; } break; }
case STATE_SCINTILLA: { case STATE_SCINTILLA: {
vector<ScintillaKeyMap> & cshortcuts = nppParam->getScintillaKeyList(); vector<ScintillaKeyMap> & cshortcuts = nppParam->getScintillaKeyList();
for(size_t i = 0; i < nrItems; ++i) for(size_t i = 0; i < nbItems; ++i)
{ {
if (cshortcuts[i].isEnabled()) if (cshortcuts[i].isEnabled())
{ {
@ -263,7 +263,7 @@ void ShortcutMapper::fillOutBabyGrid()
::EnableWindow(::GetDlgItem(_hSelf, IDM_BABYGRID_DELETE), false); ::EnableWindow(::GetDlgItem(_hSelf, IDM_BABYGRID_DELETE), false);
break; } break; }
} }
if (nrItems > 0) if (nbItems > 0)
//restore the last view //restore the last view
_babygrid.setLastView(_lastHomeRow[_currentState], _lastCursorRow[_currentState]); _babygrid.setLastView(_lastHomeRow[_currentState], _lastCursorRow[_currentState]);
else else
@ -882,8 +882,8 @@ bool ShortcutMapper::findKeyConflicts(__inout_opt generic_string * const keyConf
case STATE_MENU: case STATE_MENU:
{ {
vector<CommandShortcut> & vShortcuts = nppParam->getUserShortcuts(); vector<CommandShortcut> & vShortcuts = nppParam->getUserShortcuts();
size_t nrItems = vShortcuts.size(); size_t nbItems = vShortcuts.size();
for (size_t itemIndex = 0; itemIndex < nrItems; ++itemIndex) for (size_t itemIndex = 0; itemIndex < nbItems; ++itemIndex)
{ {
if (not vShortcuts[itemIndex].isEnabled()) //no key assignment if (not vShortcuts[itemIndex].isEnabled()) //no key assignment
continue; continue;
@ -916,8 +916,8 @@ bool ShortcutMapper::findKeyConflicts(__inout_opt generic_string * const keyConf
case STATE_MACRO: case STATE_MACRO:
{ {
vector<MacroShortcut> & vShortcuts = nppParam->getMacroList(); vector<MacroShortcut> & vShortcuts = nppParam->getMacroList();
size_t nrItems = vShortcuts.size(); size_t nbItems = vShortcuts.size();
for (size_t itemIndex = 0; itemIndex < nrItems; ++itemIndex) for (size_t itemIndex = 0; itemIndex < nbItems; ++itemIndex)
{ {
if (not vShortcuts[itemIndex].isEnabled()) //no key assignment if (not vShortcuts[itemIndex].isEnabled()) //no key assignment
continue; continue;
@ -950,8 +950,8 @@ bool ShortcutMapper::findKeyConflicts(__inout_opt generic_string * const keyConf
case STATE_USER: case STATE_USER:
{ {
vector<UserCommand> & vShortcuts = nppParam->getUserCommandList(); vector<UserCommand> & vShortcuts = nppParam->getUserCommandList();
size_t nrItems = vShortcuts.size(); size_t nbItems = vShortcuts.size();
for (size_t itemIndex = 0; itemIndex < nrItems; ++itemIndex) for (size_t itemIndex = 0; itemIndex < nbItems; ++itemIndex)
{ {
if (not vShortcuts[itemIndex].isEnabled()) //no key assignment if (not vShortcuts[itemIndex].isEnabled()) //no key assignment
continue; continue;
@ -984,8 +984,8 @@ bool ShortcutMapper::findKeyConflicts(__inout_opt generic_string * const keyConf
case STATE_PLUGIN: case STATE_PLUGIN:
{ {
vector<PluginCmdShortcut> & vShortcuts = nppParam->getPluginCommandList(); vector<PluginCmdShortcut> & vShortcuts = nppParam->getPluginCommandList();
size_t nrItems = vShortcuts.size(); size_t nbItems = vShortcuts.size();
for (size_t itemIndex = 0; itemIndex < nrItems; ++itemIndex) for (size_t itemIndex = 0; itemIndex < nbItems; ++itemIndex)
{ {
if (not vShortcuts[itemIndex].isEnabled()) //no key assignment if (not vShortcuts[itemIndex].isEnabled()) //no key assignment
continue; continue;
@ -1018,8 +1018,8 @@ bool ShortcutMapper::findKeyConflicts(__inout_opt generic_string * const keyConf
case STATE_SCINTILLA: case STATE_SCINTILLA:
{ {
vector<ScintillaKeyMap> & vShortcuts = nppParam->getScintillaKeyList(); vector<ScintillaKeyMap> & vShortcuts = nppParam->getScintillaKeyList();
size_t nrItems = vShortcuts.size(); size_t nbItems = vShortcuts.size();
for (size_t itemIndex = 0; itemIndex < nrItems; ++itemIndex) for (size_t itemIndex = 0; itemIndex < nbItems; ++itemIndex)
{ {
if (not vShortcuts[itemIndex].isEnabled()) //no key assignment if (not vShortcuts[itemIndex].isEnabled()) //no key assignment
continue; continue;

View File

@ -120,15 +120,15 @@ bool ToolBar::init( HINSTANCE hInst, HWND hPere, toolBarStatusType type,
InitCommonControlsEx(&icex); InitCommonControlsEx(&icex);
//Create the list of buttons //Create the list of buttons
_nrButtons = arraySize; _nbButtons = arraySize;
_nrDynButtons = _vDynBtnReg.size(); _nbDynButtons = _vDynBtnReg.size();
_nrTotalButtons = _nrButtons + (_nrDynButtons ? _nrDynButtons + 1 : 0); _nbTotalButtons = _nbButtons + (_nbDynButtons ? _nbDynButtons + 1 : 0);
_pTBB = new TBBUTTON[_nrTotalButtons]; //add one for the extra separator _pTBB = new TBBUTTON[_nbTotalButtons]; //add one for the extra separator
int cmd = 0; int cmd = 0;
int bmpIndex = -1, style; int bmpIndex = -1, style;
size_t i = 0; size_t i = 0;
for (; i < _nrButtons ; ++i) for (; i < _nbButtons ; ++i)
{ {
cmd = buttonUnitArray[i]._cmdID; cmd = buttonUnitArray[i]._cmdID;
if (cmd != 0) if (cmd != 0)
@ -149,7 +149,7 @@ bool ToolBar::init( HINSTANCE hInst, HWND hPere, toolBarStatusType type,
_pTBB[i].iString = 0; _pTBB[i].iString = 0;
} }
if (_nrDynButtons > 0) { if (_nbDynButtons > 0) {
//add separator //add separator
_pTBB[i].iBitmap = 0; _pTBB[i].iBitmap = 0;
_pTBB[i].idCommand = 0; _pTBB[i].idCommand = 0;
@ -159,7 +159,7 @@ bool ToolBar::init( HINSTANCE hInst, HWND hPere, toolBarStatusType type,
_pTBB[i].iString = 0; _pTBB[i].iString = 0;
++i; ++i;
//add plugin buttons //add plugin buttons
for (size_t j = 0; j < _nrDynButtons ; ++j, ++i) for (size_t j = 0; j < _nbDynButtons ; ++j, ++i)
{ {
cmd = _vDynBtnReg[j].message; cmd = _vDynBtnReg[j].message;
++bmpIndex; ++bmpIndex;
@ -192,7 +192,7 @@ void ToolBar::destroy() {
int ToolBar::getWidth() const { int ToolBar::getWidth() const {
RECT btnRect; RECT btnRect;
int totalWidth = 0; int totalWidth = 0;
for(size_t i = 0; i < _nrCurrentButtons; ++i) { for(size_t i = 0; i < _nbCurrentButtons; ++i) {
::SendMessage(_hSelf, TB_GETITEMRECT, i, reinterpret_cast<LPARAM>(&btnRect)); ::SendMessage(_hSelf, TB_GETITEMRECT, i, reinterpret_cast<LPARAM>(&btnRect));
totalWidth += btnRect.right - btnRect.left; totalWidth += btnRect.right - btnRect.left;
} }
@ -249,7 +249,7 @@ void ToolBar::reset(bool create)
if(create && _hSelf) { if(create && _hSelf) {
//Store current button state information //Store current button state information
TBBUTTON tempBtn; TBBUTTON tempBtn;
for(size_t i = 0; i < _nrCurrentButtons; ++i) for(size_t i = 0; i < _nbCurrentButtons; ++i)
{ {
::SendMessage(_hSelf, TB_GETBUTTON, i, reinterpret_cast<LPARAM>(&tempBtn)); ::SendMessage(_hSelf, TB_GETBUTTON, i, reinterpret_cast<LPARAM>(&tempBtn));
_pTBB[i].fsState = tempBtn.fsState; _pTBB[i].fsState = tempBtn.fsState;
@ -298,7 +298,7 @@ void ToolBar::reset(bool create)
//TBADDBITMAP addbmp = {_hInst, 0}; //TBADDBITMAP addbmp = {_hInst, 0};
TBADDBITMAP addbmp = {0, 0}; TBADDBITMAP addbmp = {0, 0};
TBADDBITMAP addbmpdyn = {0, 0}; TBADDBITMAP addbmpdyn = {0, 0};
for (size_t i = 0 ; i < _nrButtons ; ++i) for (size_t i = 0 ; i < _nbButtons ; ++i)
{ {
int icoID = _toolBarIcons.getStdIconAt(static_cast<int32_t>(i)); int icoID = _toolBarIcons.getStdIconAt(static_cast<int32_t>(i));
HBITMAP hBmp = static_cast<HBITMAP>(::LoadImage(_hInst, MAKEINTRESOURCE(icoID), IMAGE_BITMAP, iconDpiDynamicalSize, iconDpiDynamicalSize, LR_LOADMAP3DCOLORS | LR_LOADTRANSPARENT)); HBITMAP hBmp = static_cast<HBITMAP>(::LoadImage(_hInst, MAKEINTRESOURCE(icoID), IMAGE_BITMAP, iconDpiDynamicalSize, iconDpiDynamicalSize, LR_LOADMAP3DCOLORS | LR_LOADTRANSPARENT));
@ -307,9 +307,9 @@ void ToolBar::reset(bool create)
//addbmp.nID = _toolBarIcons.getStdIconAt(i); //addbmp.nID = _toolBarIcons.getStdIconAt(i);
::SendMessage(_hSelf, TB_ADDBITMAP, 1, reinterpret_cast<LPARAM>(&addbmp)); ::SendMessage(_hSelf, TB_ADDBITMAP, 1, reinterpret_cast<LPARAM>(&addbmp));
} }
if (_nrDynButtons > 0) if (_nbDynButtons > 0)
{ {
for (size_t j = 0; j < _nrDynButtons; ++j) for (size_t j = 0; j < _nbDynButtons; ++j)
{ {
addbmpdyn.nID = reinterpret_cast<UINT_PTR>(_vDynBtnReg.at(j).hBmp); addbmpdyn.nID = reinterpret_cast<UINT_PTR>(_vDynBtnReg.at(j).hBmp);
::SendMessage(_hSelf, TB_ADDBITMAP, 1, reinterpret_cast<LPARAM>(&addbmpdyn)); ::SendMessage(_hSelf, TB_ADDBITMAP, 1, reinterpret_cast<LPARAM>(&addbmpdyn));
@ -319,11 +319,11 @@ void ToolBar::reset(bool create)
if (create) if (create)
{ //if the toolbar has been recreated, readd the buttons { //if the toolbar has been recreated, readd the buttons
size_t nrBtnToAdd = (_state == TB_STANDARD?_nrTotalButtons:_nrButtons); size_t nbBtnToAdd = (_state == TB_STANDARD?_nbTotalButtons:_nbButtons);
_nrCurrentButtons = nrBtnToAdd; _nbCurrentButtons = nbBtnToAdd;
WORD btnSize = (_state == TB_LARGE?32:16); WORD btnSize = (_state == TB_LARGE?32:16);
::SendMessage(_hSelf, TB_SETBUTTONSIZE , 0, MAKELONG(btnSize, btnSize)); ::SendMessage(_hSelf, TB_SETBUTTONSIZE , 0, MAKELONG(btnSize, btnSize));
::SendMessage(_hSelf, TB_ADDBUTTONS, nrBtnToAdd, reinterpret_cast<LPARAM>(_pTBB)); ::SendMessage(_hSelf, TB_ADDBUTTONS, nbBtnToAdd, reinterpret_cast<LPARAM>(_pTBB));
} }
::SendMessage(_hSelf, TB_AUTOSIZE, 0, 0); ::SendMessage(_hSelf, TB_AUTOSIZE, 0, 0);
@ -359,7 +359,7 @@ void ToolBar::doPopop(POINT chevPoint)
size_t start = 0; size_t start = 0;
RECT btnRect = {0,0,0,0}; RECT btnRect = {0,0,0,0};
while(start < _nrCurrentButtons) while(start < _nbCurrentButtons)
{ {
::SendMessage(_hSelf, TB_GETITEMRECT, start, reinterpret_cast<LPARAM>(&btnRect)); ::SendMessage(_hSelf, TB_GETITEMRECT, start, reinterpret_cast<LPARAM>(&btnRect));
if(btnRect.right > width) if(btnRect.right > width)
@ -367,11 +367,11 @@ void ToolBar::doPopop(POINT chevPoint)
++start; ++start;
} }
if (start < _nrCurrentButtons) if (start < _nbCurrentButtons)
{ //some buttons are hidden { //some buttons are hidden
HMENU menu = ::CreatePopupMenu(); HMENU menu = ::CreatePopupMenu();
generic_string text; generic_string text;
while (start < _nrCurrentButtons) while (start < _nbCurrentButtons)
{ {
int cmd = _pTBB[start].idCommand; int cmd = _pTBB[start].idCommand;
getNameStrFromCmd(cmd, text); getNameStrFromCmd(cmd, text);

View File

@ -121,10 +121,10 @@ private :
ToolBarIcons _toolBarIcons; ToolBarIcons _toolBarIcons;
toolBarStatusType _state = TB_SMALL; toolBarStatusType _state = TB_SMALL;
std::vector<tDynamicList> _vDynBtnReg; std::vector<tDynamicList> _vDynBtnReg;
size_t _nrButtons = 0; size_t _nbButtons = 0;
size_t _nrDynButtons = 0; size_t _nbDynButtons = 0;
size_t _nrTotalButtons = 0; size_t _nbTotalButtons = 0;
size_t _nrCurrentButtons = 0; size_t _nbCurrentButtons = 0;
ReBar * _pRebar = nullptr; ReBar * _pRebar = nullptr;
REBARBANDINFO _rbBand; REBARBANDINFO _rbBand;
std::vector<iconLocator> _customIconVect; std::vector<iconLocator> _customIconVect;

View File

@ -145,30 +145,7 @@ KeyIDNAME namedKeyArray[] = {
{TEXT("<>"), VK_OEM_102}, {TEXT("<>"), VK_OEM_102},
}; };
#define nrKeys sizeof(namedKeyArray)/sizeof(KeyIDNAME) #define nbKeys sizeof(namedKeyArray)/sizeof(KeyIDNAME)
/*
TCHAR vKeyArray[][KEY_STR_LEN] = \
{TEXT(""), TEXT("BACKSPACE"), TEXT("TAB"), TEXT("ENTER"), TEXT("PAUSE"), TEXT("CAPS LOCK"), TEXT("ESC"), TEXT("SPACEBAR"), TEXT("PAGE UP"), TEXT("PAGE DOWN"),\
"END", TEXT("HOME"), TEXT("LEFT ARROW"), TEXT("UP ARROW"), TEXT("RIGHT ARROW"), TEXT("DOWN ARROW"), TEXT("INS"), TEXT("DEL"),\
"0", TEXT("1"), TEXT("2"), TEXT("3"), TEXT("4"), TEXT("5"), TEXT("6"), TEXT("7"), TEXT("8"), TEXT("9"),\
"A", TEXT("B"), TEXT("C"), TEXT("D"), TEXT("E"), TEXT("F"), TEXT("G"), TEXT("H"), TEXT("I"), TEXT("J"), TEXT("K"), TEXT("L"), TEXT("M"),\
"N", TEXT("O"), TEXT("P"), TEXT("Q"), TEXT("R"), TEXT("S"), TEXT("T"), TEXT("U"), TEXT("V"), TEXT("W"), TEXT("X"), TEXT("Y"), TEXT("Z"),\
"NUMPAD0", TEXT("NUMPAD1"), TEXT("NUMPAD2"), TEXT("NUMPAD3"), TEXT("NUMPAD4"),\
"NUMPAD5", TEXT("NUMPAD6"), TEXT("NUMPAD7"), TEXT("NUMPAD8"), TEXT("NUMPAD9"),\
"F1", TEXT("F2"), TEXT("F3"), TEXT("F4"), TEXT("F5"), TEXT("F6"),\
"F7", TEXT("F8"), TEXT("F9"), TEXT("F10"), TEXT("F11"), TEXT("F12")};
UCHAR vkeyValue[] = {\
0x00, 0x08, 0x09, 0x0D, 0x13, 0x14, 0x1B, 0x20, 0x21, 0x22,\
0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x2D, 0x2E, 0x30, 0x31,\
0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x41, 0x42,\
0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4A, 0x4B, 0x4C,\
0x4D, 0x4E, 0x4F, 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56,\
0x57, 0x58, 0x59, 0x5A, 0x60, 0x61, 0x62, 0x63, 0x64, 0x65,\
0x66, 0x67, 0x68, 0x69, 0x70, 0x71, 0x72, 0x73, 0x74, 0x75,\
0x76, 0x77, 0x78, 0x79, 0x7A, 0x7B};
*/
generic_string Shortcut::toString() const generic_string Shortcut::toString() const
{ {
@ -287,7 +264,7 @@ void getKeyStrFromVal(UCHAR keyVal, generic_string & str)
str = TEXT(""); str = TEXT("");
bool found = false; bool found = false;
int i; int i;
for (i = 0; i < nrKeys; ++i) { for (i = 0; i < nbKeys; ++i) {
if (keyVal == namedKeyArray[i].id) { if (keyVal == namedKeyArray[i].id) {
found = true; found = true;
break; break;
@ -395,7 +372,7 @@ INT_PTR CALLBACK Shortcut::run_dlgProc(UINT Message, WPARAM wParam, LPARAM)
::SendDlgItemMessage(_hSelf, IDC_SHIFT_CHECK, BM_SETCHECK, _keyCombo._isShift?BST_CHECKED:BST_UNCHECKED, 0); ::SendDlgItemMessage(_hSelf, IDC_SHIFT_CHECK, BM_SETCHECK, _keyCombo._isShift?BST_CHECKED:BST_UNCHECKED, 0);
::EnableWindow(::GetDlgItem(_hSelf, IDOK), isValid() && (textlen > 0 || !_canModifyName)); ::EnableWindow(::GetDlgItem(_hSelf, IDOK), isValid() && (textlen > 0 || !_canModifyName));
int iFound = -1; int iFound = -1;
for (size_t i = 0 ; i < nrKeys ; ++i) for (size_t i = 0 ; i < nbKeys ; ++i)
{ {
::SendDlgItemMessage(_hSelf, IDC_KEY_COMBO, CB_ADDSTRING, 0, reinterpret_cast<LPARAM>(namedKeyArray[i].name)); ::SendDlgItemMessage(_hSelf, IDC_KEY_COMBO, CB_ADDSTRING, 0, reinterpret_cast<LPARAM>(namedKeyArray[i].name));
@ -822,7 +799,7 @@ void ScintillaKeyMap::showCurrentSettings() {
::SendDlgItemMessage(_hSelf, IDC_CTRL_CHECK, BM_SETCHECK, _keyCombo._isCtrl?BST_CHECKED:BST_UNCHECKED, 0); ::SendDlgItemMessage(_hSelf, IDC_CTRL_CHECK, BM_SETCHECK, _keyCombo._isCtrl?BST_CHECKED:BST_UNCHECKED, 0);
::SendDlgItemMessage(_hSelf, IDC_ALT_CHECK, BM_SETCHECK, _keyCombo._isAlt?BST_CHECKED:BST_UNCHECKED, 0); ::SendDlgItemMessage(_hSelf, IDC_ALT_CHECK, BM_SETCHECK, _keyCombo._isAlt?BST_CHECKED:BST_UNCHECKED, 0);
::SendDlgItemMessage(_hSelf, IDC_SHIFT_CHECK, BM_SETCHECK, _keyCombo._isShift?BST_CHECKED:BST_UNCHECKED, 0); ::SendDlgItemMessage(_hSelf, IDC_SHIFT_CHECK, BM_SETCHECK, _keyCombo._isShift?BST_CHECKED:BST_UNCHECKED, 0);
for (size_t i = 0 ; i < nrKeys ; ++i) for (size_t i = 0 ; i < nbKeys ; ++i)
{ {
if (_keyCombo._key == namedKeyArray[i].id) if (_keyCombo._key == namedKeyArray[i].id)
{ {
@ -847,7 +824,7 @@ INT_PTR CALLBACK ScintillaKeyMap::run_dlgProc(UINT Message, WPARAM wParam, LPARA
::SetDlgItemText(_hSelf, IDC_NAME_EDIT, _name); ::SetDlgItemText(_hSelf, IDC_NAME_EDIT, _name);
_keyCombo = _keyCombos[0]; _keyCombo = _keyCombos[0];
for (size_t i = 0 ; i < nrKeys ; ++i) for (size_t i = 0 ; i < nbKeys ; ++i)
{ {
::SendDlgItemMessage(_hSelf, IDC_KEY_COMBO, CB_ADDSTRING, 0, reinterpret_cast<LPARAM>(namedKeyArray[i].name)); ::SendDlgItemMessage(_hSelf, IDC_KEY_COMBO, CB_ADDSTRING, 0, reinterpret_cast<LPARAM>(namedKeyArray[i].name));
} }

View File

@ -186,9 +186,9 @@ void parseCommandLine(const TCHAR* commandLine, ParamVector& paramVector)
bool isInList(const TCHAR *token2Find, ParamVector & params) bool isInList(const TCHAR *token2Find, ParamVector & params)
{ {
size_t nrItems = params.size(); size_t nbItems = params.size();
for (size_t i = 0; i < nrItems; ++i) for (size_t i = 0; i < nbItems; ++i)
{ {
if (!lstrcmp(token2Find, params.at(i))) if (!lstrcmp(token2Find, params.at(i)))
{ {
@ -202,9 +202,9 @@ bool isInList(const TCHAR *token2Find, ParamVector & params)
bool getParamVal(TCHAR c, ParamVector & params, generic_string & value) bool getParamVal(TCHAR c, ParamVector & params, generic_string & value)
{ {
value = TEXT(""); value = TEXT("");
size_t nrItems = params.size(); size_t nbItems = params.size();
for (size_t i = 0; i < nrItems; ++i) for (size_t i = 0; i < nbItems; ++i)
{ {
const TCHAR * token = params.at(i); const TCHAR * token = params.at(i);
if (token[0] == '-' && lstrlen(token) >= 2 && token[1] == c) { //dash, and enough chars if (token[0] == '-' && lstrlen(token) >= 2 && token[1] == c) { //dash, and enough chars
@ -219,9 +219,9 @@ bool getParamVal(TCHAR c, ParamVector & params, generic_string & value)
bool getParamValFromString(const TCHAR *str, ParamVector & params, generic_string & value) bool getParamValFromString(const TCHAR *str, ParamVector & params, generic_string & value)
{ {
value = TEXT(""); value = TEXT("");
size_t nrItems = params.size(); size_t nbItems = params.size();
for (size_t i = 0; i < nrItems; ++i) for (size_t i = 0; i < nbItems; ++i)
{ {
const TCHAR * token = params.at(i); const TCHAR * token = params.at(i);
generic_string tokenStr = token; generic_string tokenStr = token;
@ -405,9 +405,9 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE, LPSTR, int)
generic_string quotFileName = TEXT(""); generic_string quotFileName = TEXT("");
// tell the running instance the FULL path to the new files to load // tell the running instance the FULL path to the new files to load
size_t nrFilesToOpen = params.size(); size_t nbFilesToOpen = params.size();
for (size_t i = 0; i < nrFilesToOpen; ++i) for (size_t i = 0; i < nbFilesToOpen; ++i)
{ {
const TCHAR * currentFile = params.at(i); const TCHAR * currentFile = params.at(i);
if (currentFile[0]) if (currentFile[0])