From fe62ff989b434414085503ef2fd8e080739dbac7 Mon Sep 17 00:00:00 2001 From: Don Ho Date: Tue, 27 Oct 2015 17:26:29 +0100 Subject: [PATCH] Make function naming more explicite --- PowerEditor/src/Notepad_plus.cpp | 14 +++++++------- PowerEditor/src/NppBigSwitch.cpp | 4 ++-- PowerEditor/src/NppCommands.cpp | 4 ++-- PowerEditor/src/NppIO.cpp | 2 +- PowerEditor/src/ScitillaComponent/Buffer.cpp | 4 ++-- PowerEditor/src/ScitillaComponent/Buffer.h | 10 +++++----- .../src/ScitillaComponent/ScintillaEditView.cpp | 2 +- 7 files changed, 20 insertions(+), 20 deletions(-) diff --git a/PowerEditor/src/Notepad_plus.cpp b/PowerEditor/src/Notepad_plus.cpp index 9a08036cf..3b50f0da3 100644 --- a/PowerEditor/src/Notepad_plus.cpp +++ b/PowerEditor/src/Notepad_plus.cpp @@ -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()); diff --git a/PowerEditor/src/NppBigSwitch.cpp b/PowerEditor/src/NppBigSwitch.cpp index 0f15dd57f..bd6d522e2 100644 --- a/PowerEditor/src/NppBigSwitch.cpp +++ b/PowerEditor/src/NppBigSwitch.cpp @@ -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(b->getFormat()); + return static_cast(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; } diff --git a/PowerEditor/src/NppCommands.cpp b/PowerEditor/src/NppCommands.cpp index f01bdc3ba..79e79e2d6 100644 --- a/PowerEditor/src/NppCommands.cpp +++ b/PowerEditor/src/NppCommands.cpp @@ -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(buf->getFormat())); + buf->setEolFormat(newFormat); + _pEditView->execute(SCI_CONVERTEOLS, static_cast(buf->getEolFormat())); break; } diff --git a/PowerEditor/src/NppIO.cpp b/PowerEditor/src/NppIO.cpp index 0147ad138..54852c0a8 100644 --- a/PowerEditor/src/NppIO.cpp +++ b/PowerEditor/src/NppIO.cpp @@ -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); } diff --git a/PowerEditor/src/ScitillaComponent/Buffer.cpp b/PowerEditor/src/ScitillaComponent/Buffer.cpp index 2fa5ac7e7..3a1bd750d 100644 --- a/PowerEditor/src/ScitillaComponent/Buffer.cpp +++ b/PowerEditor/src/ScitillaComponent/Buffer.cpp @@ -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; diff --git a/PowerEditor/src/ScitillaComponent/Buffer.h b/PowerEditor/src/ScitillaComponent/Buffer.h index b8a4fcd9d..761027350 100644 --- a/PowerEditor/src/ScitillaComponent/Buffer.h +++ b/PowerEditor/src/ScitillaComponent/Buffer.h @@ -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; diff --git a/PowerEditor/src/ScitillaComponent/ScintillaEditView.cpp b/PowerEditor/src/ScitillaComponent/ScintillaEditView.cpp index 816563dfe..26ad3901d 100644 --- a/PowerEditor/src/ScitillaComponent/ScintillaEditView.cpp +++ b/PowerEditor/src/ScitillaComponent/ScintillaEditView.cpp @@ -1696,7 +1696,7 @@ void ScintillaEditView::bufferUpdated(Buffer * buffer, int mask) if (mask & BufferChangeFormat) { - execute(SCI_SETEOLMODE, static_cast(_currentBuffer->getFormat())); + execute(SCI_SETEOLMODE, static_cast(_currentBuffer->getEolFormat())); } if (mask & BufferChangeReadonly) {