diff --git a/PowerEditor/src/ScintillaComponent/Buffer.cpp b/PowerEditor/src/ScintillaComponent/Buffer.cpp index 419f2acc0..20b8b8567 100644 --- a/PowerEditor/src/ScintillaComponent/Buffer.cpp +++ b/PowerEditor/src/ScintillaComponent/Buffer.cpp @@ -497,9 +497,6 @@ void FileManager::init(Notepad_plus * pNotepadPlus, ScintillaEditView * pscratch _pscratchTilla->execute(SCI_SETUNDOCOLLECTION, false); //dont store any undo information _scratchDocDefault = (Document)_pscratchTilla->execute(SCI_GETDOCPOINTER); _pscratchTilla->execute(SCI_ADDREFDOCUMENT, 0, _scratchDocDefault); - - NativeLangSpeaker *pNativeSpeaker = (NppParameters::getInstance()).getNativeLangSpeaker(); - _untitled_str = pNativeSpeaker->getLocalizedStrFromID("tab-untitled-string", UNTITLED_STR); } void FileManager::checkFilesystemChanges(bool bCheckOnlyCurrentBuffer) @@ -1087,7 +1084,8 @@ 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 + _untitled_str.length(); + generic_string newTitle = ((NppParameters::getInstance()).getNativeLangSpeaker())->getLocalizedStrFromID("tab-untitled-string", UNTITLED_STR); + TCHAR *numberStr = buf->_fileName + newTitle.length(); int usedNumber = generic_atoi(numberStr); usedNumbers.push_back(usedNumber); } @@ -1123,7 +1121,8 @@ size_t FileManager::nextUntitledNewNumber() const BufferID FileManager::newEmptyDocument() { - generic_string newTitle = _untitled_str; + generic_string newTitle = ((NppParameters::getInstance()).getNativeLangSpeaker())->getLocalizedStrFromID("tab-untitled-string", UNTITLED_STR); + TCHAR nb[10]; wsprintf(nb, TEXT("%d"), nextUntitledNewNumber()); newTitle += nb; @@ -1140,7 +1139,7 @@ BufferID FileManager::newEmptyDocument() BufferID FileManager::bufferFromDocument(Document doc, bool dontIncrease, bool dontRef) { - generic_string newTitle = _untitled_str; + generic_string newTitle = ((NppParameters::getInstance()).getNativeLangSpeaker())->getLocalizedStrFromID("tab-untitled-string", 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 013c40615..24635cca2 100644 --- a/PowerEditor/src/ScintillaComponent/Buffer.h +++ b/PowerEditor/src/ScintillaComponent/Buffer.h @@ -140,7 +140,6 @@ private: std::vector _buffers; BufferID _nextBufferID = 0; size_t _nbBufs = 0; - generic_string _untitled_str = UNTITLED_STR; }; #define MainFileManager FileManager::getInstance()