*/
void CDirDoc::SetTitle(LPCTSTR lpszTitle)
{
- const TCHAR pszSeparator[] = _T(" - ");
-
if (!m_pDirView)
return;
ApplyDisplayRoot(index, strPath);
sDirName[index] = PathFindFileName(strPath.c_str());
}
- if (m_nDirs < 3)
- {
- if (sDirName[0] == sDirName[1])
- {
- sTitle = sDirName[0];
- sTitle += _T(" x 2");
- }
- else
- {
- sTitle = sDirName[0];
- sTitle += pszSeparator;
- sTitle += sDirName[1];
- }
- }
- else
- {
- if (sDirName[0] == sDirName[1] && sDirName[0] == sDirName[2])
- {
- sTitle = sDirName[0];
- sTitle += _T(" x 3");
- }
- else
- {
- sTitle = sDirName[0];
- sTitle += pszSeparator;
- sTitle += sDirName[1];
- sTitle += pszSeparator;
- sTitle += sDirName[2];
- }
- }
- CDocument::SetTitle(sTitle.c_str());
+ if (std::count(&sDirName[0], &sDirName[0] + m_nDirs, sDirName[0]) == m_nDirs)
+ sTitle = sDirName[0] + string_format(_T(" x %d"), m_nDirs);
+ else
+ sTitle = String_join(&sDirName[0], &sDirName[0] + m_nDirs, _T(" - "));
+ CDocument::SetTitle(sTitle.c_str());
}
}
*/
void CHexMergeDoc::SetTitle(LPCTSTR lpszTitle)
{
- const TCHAR pszSeparator[] = _T(" - ");
String sTitle;
String sFileName[3];
}
}
}
- if (m_nBuffers < 3)
- {
- if (sFileName[0] == sFileName[1])
- {
- sTitle = sFileName[0];
- sTitle += _T(" x 2");
- }
- else
- {
- sTitle = sFileName[0];
- sTitle += pszSeparator;
- sTitle += sFileName[1];
- }
- }
+ if (std::count(&sFileName[0], &sFileName[0] + m_nBuffers, sFileName[0]) == m_nBuffers)
+ sTitle = sFileName[0] + string_format(_T(" x %d"), m_nBuffers);
else
- {
- if (sFileName[0] == sFileName[1] && sFileName[0] == sFileName[2])
- {
- sTitle = sFileName[0];
- sTitle += _T(" x 3");
- }
- else
- {
- sTitle = sFileName[0];
- sTitle += pszSeparator;
- sTitle += sFileName[1];
- sTitle += pszSeparator;
- sTitle += sFileName[2];
- }
- }
-
+ sTitle = String_join(&sFileName[0], &sFileName[0] + m_nBuffers, _T(" - "));
}
CDocument::SetTitle(sTitle.c_str());
}
*/
void CMergeDoc::SetTitle(LPCTSTR lpszTitle)
{
- const TCHAR pszSeparator[] = _T(" - ");
String sTitle;
String sFileName[3];
}
}
}
- if (m_nBuffers < 3)
- {
- if (sFileName[0] == sFileName[1])
- {
- sTitle = sFileName[0];
- sTitle += _T(" x 2");
- }
- else
- {
- sTitle = sFileName[0];
- sTitle += pszSeparator;
- sTitle += sFileName[1];
- }
- }
+ if (std::count(&sFileName[0], &sFileName[0] + m_nBuffers, sFileName[0]) == m_nBuffers)
+ sTitle = sFileName[0] + string_format(_T(" x %d"), m_nBuffers);
else
- {
- if (sFileName[0] == sFileName[1] && sFileName[0] == sFileName[2])
- {
- sTitle = sFileName[0];
- sTitle += _T(" x 3");
- }
- else
- {
- sTitle = sFileName[0];
- sTitle += pszSeparator;
- sTitle += sFileName[1];
- sTitle += pszSeparator;
- sTitle += sFileName[2];
- }
- }
-
+ sTitle = String_join(&sFileName[0], &sFileName[0] + m_nBuffers, _T(" - "));
}
CDocument::SetTitle(sTitle.c_str());
}