mirror of
https://github.com/notepad-plus-plus/notepad-plus-plus.git
synced 2025-07-22 13:24:42 +02:00
Fix the 1st document title "new 1" is not translated
1ae39c2dda (commitcomment-49174136)
This commit is contained in:
parent
1a9307b02d
commit
55de911be5
@ -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;
|
||||
|
@ -140,7 +140,6 @@ private:
|
||||
std::vector<Buffer*> _buffers;
|
||||
BufferID _nextBufferID = 0;
|
||||
size_t _nbBufs = 0;
|
||||
generic_string _untitled_str = UNTITLED_STR;
|
||||
};
|
||||
|
||||
#define MainFileManager FileManager::getInstance()
|
||||
|
Loading…
x
Reference in New Issue
Block a user