From 072a9a497026bef34623bb6748b5d169d09fd70c Mon Sep 17 00:00:00 2001 From: Sup Yut Sum Date: Wed, 3 Sep 2014 00:27:43 +0800 Subject: [PATCH] Fix TGit version and git version without newline when language pack is loaded Signed-off-by: Sup Yut Sum --- src/TortoiseProc/AboutDlg.cpp | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/src/TortoiseProc/AboutDlg.cpp b/src/TortoiseProc/AboutDlg.cpp index 753ef1b9d..83787cb68 100644 --- a/src/TortoiseProc/AboutDlg.cpp +++ b/src/TortoiseProc/AboutDlg.cpp @@ -50,6 +50,24 @@ BEGIN_MESSAGE_MAP(CAboutDlg, CStandAloneDialog) ON_BN_CLICKED(IDC_UPDATE, OnBnClickedUpdate) END_MESSAGE_MAP() +static CString Lf2Crlf(const CString& text) +{ + CString s; + if (text.GetLength() == 0) + return s; + + TCHAR c = '\0'; + for (int i = 0; i < text.GetLength(); i++) + { + if (text[i] == '\n' && c != '\r') + s += "\r\n"; + else + s += text[i]; + c = text[i]; + } + return s; +} + BOOL CAboutDlg::OnInitDialog() { CStandAloneDialog::OnInitDialog(); @@ -70,7 +88,7 @@ BOOL CAboutDlg::OnInitDialog() CString tortoisegitprocpath; tortoisegitprocpath.Format(_T("(%s)"), CPathUtils::GetAppDirectory()); temp.Format(IDS_ABOUTVERSION, TGIT_VERMAJOR, TGIT_VERMINOR, TGIT_VERMICRO, TGIT_VERBUILD, tortoisegitprocpath, out); - SetDlgItemText(IDC_VERSIONABOUT, temp); + SetDlgItemText(IDC_VERSIONABOUT, Lf2Crlf(temp)); this->SetWindowText(_T("TortoiseGit")); -- 2.11.4.GIT