controls/edit.c - fixes bug with Quicken 2000 Deluxe

Carl Sopchak carl.sopchak at cegis123.com
Thu Nov 14 07:39:36 CST 2002


This patch fixes a problem that I was having with Quicken 2000 Deluxe, where
opening an investment account, then click on a (long) security name in an
existing transaction would cause the security name to be changed to the
transaction's date.

The bug happened because Quicken (apparently) uses a single Edit Control for
all of it's input.  The edit control had it's limit set to 10 (for the date)
with EM_LIMITTEXT before WM_SETTEXT was used to set the text value to the
security name.  (Quicken subsequently uses EM_LIMITTEXT to set the security
name limit to 30.)  The WM_SETTEXT was adhearing to the EM_LIMITTEXT limit,
but according to MSDN's page for EM_LIMITTEXT, it should not.

Since I no longer have a computer running Windows, and don't have the Windows
programming skill to write a test program anyway, I posted a message to
wine-devel asking if other messages should be ignoring the limit.  I got two
replies, but neither answered this specific question.

So, I implemented this change by adding a parameter to EDIT_EM_ReplaceSel():
BOOL honor_limit.  If TRUE, the editstate's buffer_limit is honored.  If
FALSE, it is not.  This parameter was also added to EDIT_MakeFit(), since
that is where the actual rejection of the edit takes place.  In all calls to
EDIT_EM_ReplaceSel(), except those used for the WM_SETTEXT message, I pass a
TRUE.  For WM_SETTEXT, I pass FALSE.  This should leave all of the other
message processing as it was, while fixing the WM_SETTEXT message processing.

This patch fixes my problem with Quicken, and after running Quicken a few
times, seems to not have caused any other problems.  However, I can't say
that I am able to fully test this mod.  Nor am I certain that it is correct
for the other messages that EDIT_EM_ReplaceSel() is used for...

Still, I hope this helps...

Carl

-------------------------------------------------------

-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch-settext-ignore-limit.patch
Type: text/x-diff
Size: 5649 bytes
Desc: not available
Url : http://www.winehq.org/pipermail/wine-patches/attachments/20021114/3d813b08/patch-settext-ignore-limit.bin


More information about the wine-patches mailing list