Make function naming more explicite

This commit is contained in:
Don Ho 2015-10-27 17:26:29 +01:00
parent 7e8218f735
commit fe62ff989b
7 changed files with 20 additions and 20 deletions

View File

@ -1820,8 +1820,8 @@ void Notepad_plus::checkDocState()
enableCommand(IDM_FILE_DELETE, isFileExisting, MENU);
enableCommand(IDM_FILE_RENAME, isFileExisting, MENU);
enableConvertMenuItems(curBuf->getFormat());
checkUnicodeMenuItems(/*curBuf->getUnicodeMode()*/);
enableConvertMenuItems(curBuf->getEolFormat());
checkUnicodeMenuItems();
checkLangsMenu(-1);
if (_pAnsiCharPanel)
@ -3498,7 +3498,7 @@ void Notepad_plus::staticCheckMenuAndTB() const
void Notepad_plus::dynamicCheckMenuAndTB() const
{
//Format conversion
enableConvertMenuItems(_pEditView->getCurrentBuffer()->getFormat());
enableConvertMenuItems(_pEditView->getCurrentBuffer()->getEolFormat());
checkUnicodeMenuItems();
}
@ -4720,8 +4720,8 @@ void Notepad_plus::notifyBufferChanged(Buffer * buffer, int mask)
updateStatusBar();
checkUnicodeMenuItems(/*buffer->getUnicodeMode()*/);
setUniModeText();
setDisplayFormat(buffer->getFormat());
enableConvertMenuItems(buffer->getFormat());
setDisplayFormat(buffer->getEolFormat());
enableConvertMenuItems(buffer->getEolFormat());
}
}
@ -4749,8 +4749,8 @@ void Notepad_plus::notifyBufferActivated(BufferID bufid, int view)
updateStatusBar();
checkUnicodeMenuItems(/*buf->getUnicodeMode()*/);
setUniModeText();
setDisplayFormat(buf->getFormat());
enableConvertMenuItems(buf->getFormat());
setDisplayFormat(buf->getEolFormat());
enableConvertMenuItems(buf->getEolFormat());
generic_string dir(buf->getFullPathName());
PathRemoveFileSpec(dir);
setWorkingDir(dir.c_str());

View File

@ -318,7 +318,7 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPa
return -1;
BufferID id = (BufferID)wParam;
Buffer * b = MainFileManager->getBufferByID(id);
return static_cast<LRESULT>(b->getFormat());
return static_cast<LRESULT>(b->getEolFormat());
}
case NPPM_SETBUFFERFORMAT:
@ -335,7 +335,7 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPa
BufferID id = (BufferID)wParam;
Buffer * b = MainFileManager->getBufferByID(id);
b->setFormat(newFormat);
b->setEolFormat(newFormat);
return TRUE;
}

View File

@ -1709,8 +1709,8 @@ void Notepad_plus::command(int id)
: (id == IDM_FORMAT_TOUNIX) ? EolType::unix : EolType::macos;
Buffer* buf = _pEditView->getCurrentBuffer();
buf->setFormat(newFormat);
_pEditView->execute(SCI_CONVERTEOLS, static_cast<int>(buf->getFormat()));
buf->setEolFormat(newFormat);
_pEditView->execute(SCI_CONVERTEOLS, static_cast<int>(buf->getEolFormat()));
break;
}

View File

@ -217,7 +217,7 @@ BufferID Notepad_plus::doOpen(const generic_string& fileName, bool isRecursive,
{
const NewDocDefaultSettings & ndds = (NppParameters::getInstance()->getNppGUI()).getNewDocDefaultSettings();
buf->setEncoding(ndds._codepage);
buf->setFormat(ndds._format);
buf->setEolFormat(ndds._format);
buf->setUnicodeMode(ndds._unicodeMode);
buf->setLangType(ndds._lang);
}

View File

@ -91,7 +91,7 @@ Buffer::Buffer(FileManager * pManager, BufferID id, Document doc, DocFileStatus
NppParameters* pNppParamInst = NppParameters::getInstance();
const NewDocDefaultSettings& ndds = (pNppParamInst->getNppGUI()).getNewDocDefaultSettings();
_format = ndds._format;
_eolFormat = ndds._format;
_unicodeMode = ndds._unicodeMode;
_encoding = ndds._codepage;
if (_encoding != -1)
@ -640,7 +640,7 @@ BufferID FileManager::loadFile(const TCHAR * filename, Document doc, int encodin
buf->setUnicodeMode(uniCookie);
}
buf->setFormat(bkformat);
buf->setEolFormat(bkformat);
//determine buffer properties
++_nextBufferID;

View File

@ -196,12 +196,12 @@ public:
doNotify(BufferChangeReadonly);
}
EolType getFormat() const {
return _format;
EolType getEolFormat() const {
return _eolFormat;
}
void setFormat(EolType format) {
_format = format;
void setEolFormat(EolType format) {
_eolFormat = format;
doNotify(BufferChangeFormat);
}
@ -365,7 +365,7 @@ private:
LangType _lang;
generic_string _userLangExt; // it's useful if only (_lang == L_USER)
bool _isDirty = false;
EolType _format = EolType::osdefault;
EolType _eolFormat = EolType::osdefault;
UniMode _unicodeMode;
int _encoding = -1;
bool _isUserReadOnly = false;

View File

@ -1696,7 +1696,7 @@ void ScintillaEditView::bufferUpdated(Buffer * buffer, int mask)
if (mask & BufferChangeFormat)
{
execute(SCI_SETEOLMODE, static_cast<int>(_currentBuffer->getFormat()));
execute(SCI_SETEOLMODE, static_cast<int>(_currentBuffer->getEolFormat()));
}
if (mask & BufferChangeReadonly)
{