From a349764b4ae8d6feaebfed21148b35390a754281 Mon Sep 17 00:00:00 2001 From: Don HO Date: Tue, 6 Apr 2021 17:52:56 +0200 Subject: [PATCH] Remove unnecessary const --- PowerEditor/src/ScintillaComponent/Buffer.cpp | 6 +++--- PowerEditor/src/ScintillaComponent/Buffer.h | 4 +--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/PowerEditor/src/ScintillaComponent/Buffer.cpp b/PowerEditor/src/ScintillaComponent/Buffer.cpp index 9df216d9f..a1fcf77b5 100644 --- a/PowerEditor/src/ScintillaComponent/Buffer.cpp +++ b/PowerEditor/src/ScintillaComponent/Buffer.cpp @@ -1084,7 +1084,7 @@ size_t FileManager::nextUntitledNewNumber() const // if untitled document is invisible, then don't put its number into array (so its number is available to be used) if ((buf->_referees[0])->isVisible()) { - TCHAR *numberStr = buf->_fileName + lstrlen(UNTITLED_STR); + TCHAR *numberStr = buf->_fileName + _untitled_str.length(); int usedNumber = generic_atoi(numberStr); usedNumbers.push_back(usedNumber); } @@ -1120,7 +1120,7 @@ size_t FileManager::nextUntitledNewNumber() const BufferID FileManager::newEmptyDocument() { - generic_string newTitle = UNTITLED_STR; + generic_string newTitle = _untitled_str; TCHAR nb[10]; wsprintf(nb, TEXT("%d"), nextUntitledNewNumber()); newTitle += nb; @@ -1137,7 +1137,7 @@ BufferID FileManager::newEmptyDocument() BufferID FileManager::bufferFromDocument(Document doc, bool dontIncrease, bool dontRef) { - generic_string newTitle = UNTITLED_STR; + generic_string newTitle = _untitled_str; TCHAR nb[10]; wsprintf(nb, TEXT("%d"), nextUntitledNewNumber()); newTitle += nb; diff --git a/PowerEditor/src/ScintillaComponent/Buffer.h b/PowerEditor/src/ScintillaComponent/Buffer.h index 059265de7..09989e7f0 100644 --- a/PowerEditor/src/ScintillaComponent/Buffer.h +++ b/PowerEditor/src/ScintillaComponent/Buffer.h @@ -51,9 +51,6 @@ enum BufferStatusInfo BufferChangeMask = 0x3FF // Mask: covers all changes }; -//const int userLangNameMax = 16; -const TCHAR UNTITLED_STR[] = TEXT("new "); - enum SavingStatus { SaveOK = 0, @@ -141,6 +138,7 @@ private: std::vector _buffers; BufferID _nextBufferID = 0; size_t _nbBufs = 0; + generic_string _untitled_str = TEXT("new "); }; #define MainFileManager FileManager::getInstance()