OSDN Git Service

PATCH: [ 2585662 ] Three numbers version number (About-dialog)
authorKimmo Varis <kimmov@gmail.com>
Wed, 11 Feb 2009 16:45:00 +0000 (16:45 +0000)
committerKimmo Varis <kimmov@gmail.com>
Wed, 11 Feb 2009 16:45:00 +0000 (16:45 +0000)
Docs/Users/ChangeLog.txt
Src/Common/version.cpp

index 71d7ee7..18e2e86 100644 (file)
@@ -4,6 +4,7 @@ to Subversion revision numbers (rXXXXX). To open the tracker item, go to URL:
 http://winmerge.org/tracker/[tracker-id]
 
 WinMerge 2.13.3
+  Use three-digit version numbers in GUI (#2585662)
   Bugfix: Could not copy files from right to left (#2556904)
   Bugfix: Don't show file name extension for folders (#2563314)
   Translation updates:
index fecc028..c12061b 100644 (file)
@@ -186,7 +186,7 @@ String CVersionInfo::GetProductVersion() const
  * @brief Format version string from numbers.
  * Version number consists of four WORD (16-bit) numbers. This function
  * formats those numbers to string, where numbers are separated by
- * dots.
+ * dots. If the last number is zero it is not printed.
  * @param [in] First two (most significant) numbers for version number.
  * @param [in] Last two numbers for version number.
  * @return Formatted version string.
@@ -194,8 +194,16 @@ String CVersionInfo::GetProductVersion() const
 static String MakeVersionString(DWORD hi, DWORD lo)
 {
        TCHAR ver[50];
-       _sntprintf(ver, countof(ver) - 1, _T("%d.%d.%d.%d"), HIWORD(hi),
-                       LOWORD(hi), HIWORD(lo), LOWORD(lo));
+       if (LOWORD(lo) == 0)
+       {
+               _sntprintf(ver, countof(ver) - 1, _T("%d.%d.%d"), HIWORD(hi),
+                               LOWORD(hi), HIWORD(lo));
+       }
+       else
+       {
+               _sntprintf(ver, countof(ver) - 1, _T("%d.%d.%d.%d"), HIWORD(hi),
+                               LOWORD(hi), HIWORD(lo), LOWORD(lo));
+       }
        String sver(ver);
        return sver;
 }