[svn] GPGol - r167 - in trunk: . src

svn author wk cvs at cvs.gnupg.org
Tue Apr 10 12:28:16 CEST 2007


Author: wk
Date: 2007-04-10 12:28:16 +0200 (Tue, 10 Apr 2007)
New Revision: 167

Modified:
   trunk/AUTHORS
   trunk/ChangeLog
   trunk/src/ChangeLog
   trunk/src/display.cpp
Log:
Fixed bug 735


Modified: trunk/AUTHORS
===================================================================
--- trunk/AUTHORS	2006-12-13 12:56:57 UTC (rev 166)
+++ trunk/AUTHORS	2007-04-10 10:28:16 UTC (rev 167)
@@ -2,12 +2,18 @@
 Contact: info-gpgol at g10code.com
 Bugs:    bug-gpgol at g10code.com
 
-New code and packet maintainer:
+
 g10 Code GmbH 
+        New code and packet maintainer.
 
-All code from the years 2003, 2004
 Timo Schulz <twoaday at freakmail.de>
+        All code from the years 2003, 2004
 
+Daniel Nylander <po at danielnylander.se>
+        Swedish translation.
+
+
+
 Some files may still contain code from the orginal plugin:
 Copyright (C) 2001 G Data Software AG, http://www.gdata.de
 

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2006-12-13 12:56:57 UTC (rev 166)
+++ trunk/ChangeLog	2007-04-10 10:28:16 UTC (rev 167)
@@ -1,3 +1,11 @@
+2006-12-13  Werner Koch  <wk at g10code.com>
+
+	* po/LINGUAS: Added sv.
+
+2006-12-13  Daniel Nylander <po at danielnylander.se>  (wk)
+	
+	* po/sv.po: New. 
+
 2006-10-13  Werner Koch  <wk at g10code.com>
 
 	Released 0.9.91.

Modified: trunk/src/ChangeLog
===================================================================
--- trunk/src/ChangeLog	2006-12-13 12:56:57 UTC (rev 166)
+++ trunk/src/ChangeLog	2007-04-10 10:28:16 UTC (rev 167)
@@ -1,3 +1,8 @@
+2007-04-10  Werner Koch  <wk at g10code.com>
+
+	* display.cpp (find_message_window): Add arg LEVEL for debugging.
+	Ignore MsoCommand* Windows.  Fixes bug 735.
+
 2006-10-14  Timo Schulz  <ts at g10code.de>
 
 	* recipient-dialog.c (lv_get_item_param): New.

Modified: trunk/src/display.cpp
===================================================================
--- trunk/src/display.cpp	2006-12-13 12:56:57 UTC (rev 166)
+++ trunk/src/display.cpp	2007-04-10 10:28:16 UTC (rev 167)
@@ -113,7 +113,7 @@
    the text of the window instead of the MAPI object itself.  To do
    this we walk all windows to find a PGP signature.  */
 static HWND
-find_message_window (HWND parent)
+find_message_window (HWND parent, int level)
 {
   HWND child;
 
@@ -134,9 +134,53 @@
          strings, but this does not work for PGP/MIME or already
          decrypted messages. */
       len = GetClassName (child, buf, sizeof buf - 1);
+//       if (len)
+//         log_debug ("  %*sgot class `%s'", level*2, "", buf);
+      if (level && len >= 10 && !strncmp (buf, "MsoCommand", 10))
+        {
+          /* We won't find anything below MsoCommand windows.
+             Ignoring them fixes a bug where we return a RichEdit20W
+             window which is actually a formatting drop down box or
+             something similar.  Not sure whether the check for level
+             is required, but it won't harm and might help in case an
+             MsoCommand* is the top level.
+             
+             An example of such a message hierarchy is:
+               got class `MsoCommandBarDock'
+               got class `MsoCommandBarDock'
+               got class `MsoCommandBarDock'
+                 got class `MsoCommandBar'
+                 got class `MsoCommandBar'
+                   got class `RichEdit20W'  <--- We don't want that
+                 got class `MsoCommandBar'
+               got class `MsoCommandBarDock'
+               got class `AfxWndW'
+                 got class `#32770'
+                   got class `Static'
+                   got class `Static'
+                   got class `RichEdit20WPT'
+                   got class `Static'
+                   got class `RichEdit20WPT'
+                   got class `Static'
+                   got class `RichEdit20WPT'
+                   got class `Static'
+                   got class `RichEdit20WPT'
+                   got class `Static'
+                   got class `RichEdit20WPT'
+                   got class `Static'
+                   got class `Static'
+                   got class `AfxWndA'
+                     got class `Static'
+                     got class `AfxWndW'
+                       got class `Static'
+                       got class `RichEdit20W'  <--- We want this one
+           */
+          break; /* Not found at this level.  */
+        }
+
       if (len && !strcmp (buf, "RichEdit20W"))
         {
-          log_debug ("found class RichEdit20W");
+          log_debug ("found class `%s'", "RichEdit20W");
           return child;
         }
       
@@ -148,7 +192,7 @@
           &&  (!strncmp (s+15, "MESSAGE-----", 12)
                || !strncmp (s+15, "SIGNED MESSAGE-----", 19)))
         return child;
-      w = find_message_window (child);
+      w = find_message_window (child, level+1);
       if (w)
         return w;
       child = GetNextWindow (child, GW_HWNDNEXT);	
@@ -167,7 +211,7 @@
   HWND window;
 
   /*show_window_hierarchy (hwnd, 0);*/
-  window = find_message_window (hwnd);
+  window = find_message_window (hwnd, 0);
   if (window && !is_html)
     {
       const char *s;




More information about the Gnupg-commits mailing list