Small refactoring
This commit is contained in:
parent
27ce5f8499
commit
595074152d
|
@ -985,38 +985,28 @@ BOOL Notepad_plus::notify(SCNotification *notification)
|
|||
wcscpy_s(lpttt->szText, tipTmp.c_str());
|
||||
return TRUE;
|
||||
}
|
||||
else if (hWin == _mainDocTab.getHSelf())
|
||||
else
|
||||
{
|
||||
BufferID idd = _mainDocTab.getBufferByIndex(id);
|
||||
Buffer * buf = MainFileManager.getBufferByID(idd);
|
||||
if (buf == nullptr)
|
||||
return FALSE;
|
||||
|
||||
tipTmp = buf->getFullPathName();
|
||||
|
||||
if (tipTmp.length() >= tipMaxLen)
|
||||
return FALSE;
|
||||
wcscpy_s(docTip, tipTmp.c_str());
|
||||
lpttt->lpszText = docTip;
|
||||
return TRUE;
|
||||
}
|
||||
BufferID idd = BUFFER_INVALID;
|
||||
if (hWin == _mainDocTab.getHSelf())
|
||||
idd = _mainDocTab.getBufferByIndex(id);
|
||||
else if (hWin == _subDocTab.getHSelf())
|
||||
{
|
||||
BufferID idd = _subDocTab.getBufferByIndex(id);
|
||||
Buffer * buf = MainFileManager.getBufferByID(idd);
|
||||
if (buf == nullptr)
|
||||
return FALSE;
|
||||
|
||||
tipTmp = buf->getFullPathName();
|
||||
|
||||
if (tipTmp.length() >= tipMaxLen)
|
||||
return FALSE;
|
||||
wcscpy_s(docTip, tipTmp.c_str());
|
||||
lpttt->lpszText = docTip;
|
||||
return TRUE;
|
||||
}
|
||||
idd = _subDocTab.getBufferByIndex(id);
|
||||
else
|
||||
return FALSE;
|
||||
|
||||
Buffer * buf = MainFileManager.getBufferByID(idd);
|
||||
if (buf == nullptr)
|
||||
return FALSE;
|
||||
|
||||
tipTmp = buf->getFullPathName();
|
||||
|
||||
if (tipTmp.length() >= tipMaxLen)
|
||||
return FALSE;
|
||||
wcscpy_s(docTip, tipTmp.c_str());
|
||||
lpttt->lpszText = docTip;
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue