OSDN Git Service

File report: Fix a problem without showing line numbers
authorTim Gerundt <tim@gerundt.de>
Fri, 31 May 2019 03:49:59 +0000 (05:49 +0200)
committerTim Gerundt <tim@gerundt.de>
Fri, 31 May 2019 03:49:59 +0000 (05:49 +0200)
Docs/Developers/index.html
Docs/Users/Manual/About_Doc.xml
Src/MergeDoc.cpp
Src/res/LogoImages/WinMergeLogo.png [new file with mode: 0644]
Src/res/LogoImages/WinMergeLogoSmall.png [new file with mode: 0644]
Src/res/WinMergeU.VisualElementsManifest.xml [new file with mode: 0644]
Tools/Scripts/CheckUnusedResources.vbs
Translations/GetTranslationsStatus.py

index 4200ae7..ec83d2f 100644 (file)
@@ -70,8 +70,6 @@ WinMerge development.
     system.</li>
   <li><a href="../../Installer/InnoSetup/README.md">InnoSetup</a> contains documentation
     about WinMerge's installer.</li>
-  <li><a href="Folder_Structure.txt">Folder Structure</a> explains the 
-    folders.</li>
   <li><a href="Releasing.html">Releasing</a> instructions for doing a WinMerge
     release.</li>
   <li><a href="UnitTesting.html">Unit testing</a> instructions for unit testing
index 4e77e59..78b8af4 100644 (file)
       </varlistentry>
 
       <varlistentry>
+        <term><xref linkend="Compare_images" /></term>
+
+        <listitem>
+          <para>TBD</para>
+        </listitem>
+      </varlistentry>
+
+      <varlistentry>
+        <term><xref linkend="Compare_bin" /></term>
+
+        <listitem>
+          <para>TBD</para>
+        </listitem>
+      </varlistentry>
+
+      <varlistentry>
         <term><xref linkend="Configuration" /></term>
 
         <listitem>
index ae91743..dbb14fc 100644 (file)
@@ -3309,13 +3309,16 @@ bool CMergeDoc::GenerateReport(const String& sFileName) const
                                        (m_ptBuf[nBuffer]->GetLineFlags(idx[nBuffer] - 1) & (LF_DIFF | LF_GHOST)) == 0))
                                {
                                        ++nDiff;
-                                       tdtag += strutils::format(_T("<a name=\"d%d\" href=\"#d%d\">%d</a>"), nDiff, nDiff, iVisibleLineNumber);
-                                       iVisibleLineNumber = 0;
+                                       if (iVisibleLineNumber > 0)
+                                       {
+                                               tdtag += strutils::format(_T("<a name=\"d%d\" href=\"#d%d\">%d</a>"), nDiff, nDiff, iVisibleLineNumber);
+                                               iVisibleLineNumber = 0;
+                                       }
+                                       else
+                                               tdtag += strutils::format(_T("<a name=\"d%d\" href=\"#d%d\">.</a>"), nDiff, nDiff);
                                }
                                if (iVisibleLineNumber > 0)
-                               {
                                        tdtag += strutils::format(_T("%d</td>"), iVisibleLineNumber);
-                               }
                                else
                                        tdtag += _T("</td>");
                                file.WriteString(tdtag);
diff --git a/Src/res/LogoImages/WinMergeLogo.png b/Src/res/LogoImages/WinMergeLogo.png
new file mode 100644 (file)
index 0000000..e029ffd
Binary files /dev/null and b/Src/res/LogoImages/WinMergeLogo.png differ
diff --git a/Src/res/LogoImages/WinMergeLogoSmall.png b/Src/res/LogoImages/WinMergeLogoSmall.png
new file mode 100644 (file)
index 0000000..f0520ed
Binary files /dev/null and b/Src/res/LogoImages/WinMergeLogoSmall.png differ
diff --git a/Src/res/WinMergeU.VisualElementsManifest.xml b/Src/res/WinMergeU.VisualElementsManifest.xml
new file mode 100644 (file)
index 0000000..946d2cd
--- /dev/null
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>\r
+<Application xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">\r
+  <VisualElements ForegroundText="dark" BackgroundColor="#ffcc00" ShowNameOnSquare150x150Logo="on" Square150x150Logo="LogoImages\WinMergeLogo.png" Square70x70Logo="LogoImages\WinMergeLogoSmall.png"></VisualElements>\r
+</Application>
\ No newline at end of file
index 7407143..76d6b7a 100644 (file)
@@ -10,6 +10,13 @@ Option Explicit
 
 Const ForReading = 1
 
+Const NO_BLOCK = 0
+Const MENU_BLOCK = 1
+Const DIALOGEX_BLOCK = 2
+Const STRINGTABLE_BLOCK = 3
+Const VERSIONINFO_BLOCK = 4
+Const ACCELERATORS_BLOCK = 5
+
 Dim oFSO, bRunFromCmd
 
 Set oFSO = CreateObject("Scripting.FileSystemObject")
@@ -107,7 +114,7 @@ End Function
 ''
 ' ...
 Function GetIdsFromResourceFile(ByVal sRcPath)
-  Dim oIds, oTextFile, sLine, iLine
+  Dim oIds, oTextFile, sLine, iLine, iBlockType
   Dim reId, oMatch, sId
   
   Set oIds = CreateObject("Scripting.Dictionary")
@@ -118,12 +125,39 @@ Function GetIdsFromResourceFile(ByVal sRcPath)
   
   If (oFSO.FileExists(sRcPath) = True) Then 'If the RC file exists...
     iLine = 0
+    iBlockType = NO_BLOCK
     Set oTextFile = oFSO.OpenTextFile(sRcPath, ForReading)
     Do Until oTextFile.AtEndOfStream = True 'For all lines...
       sLine = Trim(oTextFile.ReadLine)
       iLine = iLine + 1
       
+      If (InStr(sLine, " MENU") > 0) Then 'MENU...
+        iBlockType = MENU_BLOCK
+      ElseIf (InStr(sLine, " DIALOGEX") > 0) Then 'DIALOGEX...
+        iBlockType = DIALOGEX_BLOCK
+      ElseIf (sLine = "STRINGTABLE") Then 'STRINGTABLE...
+        iBlockType = STRINGTABLE_BLOCK
+      ElseIf (InStr(sLine, " VERSIONINFO") > 0) Then 'VERSIONINFO...
+        iBlockType = VERSIONINFO_BLOCK
+      ElseIf (InStr(sLine, " ACCELERATORS") > 0) Then 'ACCELERATORS...
+        iBlockType = ACCELERATORS_BLOCK
+      ElseIf (sLine = "BEGIN") Then 'BEGIN...
+        'IGNORE FOR SPEEDUP!
+      ElseIf (sLine = "END") Then 'END...
+        If (iBlockType = STRINGTABLE_BLOCK) Then 'If inside stringtable...
+          iBlockType = NO_BLOCK
+        End If
+      ElseIf (Left(sLine, 2) = "//") Then 'If comment line...
+        sLine = ""
+        'IGNORE FOR SPEEDUP!
+      ElseIf (sLine <> "") Then 'If NOT empty line...
+        If (iBlockType = MENU_BLOCK) Or (iBlockType = DIALOGEX_BLOCK) Then
+          sLine = ""
+        End If
+      End If
+      
       sId = ""
+      
       If reId.Test(sLine) Then 'If ID...
         Set oMatch = reId.Execute(sLine)(0)
         sId = oMatch.SubMatches(0)
@@ -183,7 +217,7 @@ Function GetIdsFromCppFiles(ByVal sFolderPath, ByRef oIds)
     Next
     
     For Each oSubFolder In oFolder.SubFolders 'For all folders...
-      If (oSubFolder.Name <> ".svn") Then 'If NOT a SVN folder...
+      If (oSubFolder.Name <> ".svn") And (oSubFolder.Name <> ".hg") And (oSubFolder.Name <> ".git") Then 'If NOT a SVN folder...
         GetIdsFromCppFiles oSubFolder.Path, oIds
       End If
     Next
index 52f2383..7ba38b2 100644 (file)
@@ -547,7 +547,7 @@ def main():
     status.addProject(PoProject('WinMerge', 'WinMerge/English.pot', 'WinMerge'))
     status.addProject(PoProject('ShellExtension', 'ShellExtension/English.pot', 'ShellExtension'))
     status.addProject(InnoSetupProject('InnoSetup', 'InnoSetup/English.isl', 'InnoSetup'))
-    status.addProject(ReadmeProject('Docs/Readme', 'Docs/Readme.txt', 'Docs/Readme'))
+    status.addProject(ReadmeProject('Docs/Readme', 'Docs/ReadMe.txt', 'Docs/Readme'))
     status.writeToXmlFile('TranslationsStatus.xml')
     status.writeToHtmlFile('TranslationsStatus.html')