riched20: Fix behavior of EM_REPLACESEL with painting disabled

Alex Villací­s Lasso a_villacis at
Mon Apr 21 10:02:52 CDT 2008

I noticed a style being applied on an incorrect region in an application 
called RadDecay. The red font was being applied only to a part of the 
line. I traced this to the app disabling updates on the richedit control 
used for displaying information, and then adding text with 
EM_REPLACESEL. The StartRow run is not being inserted at the start of 
the paragraph when painting is disabled, resulting in an incorrect line 
count being reported by EM_GETLINECOUNT, and therefore the app 
calculating the wrong offsets for applying the style. Fixed by moving 
the relevant call to ME_WrappedMarkedParagraphs() to a place before the 
check for painting being enabled. With tests that failed before the fix 
and now succeed.

* Fix behavior of  line splitting by EM_REPLACESEL with a text with 
newlines and window updating disabled.
* Tests to verify fixed behavior.

perl -e '$x=2.4;print sprintf("%.0f + %.0f = %.0f\n",$x,$x,$x+$x);'

-------------- next part --------------
A non-text attachment was scrubbed...
Name: wine-riched20-01-EM_REPLACESEL-painting-disabled.patch
Type: text/x-patch
Size: 7194 bytes
Desc: not available
Url : 

More information about the wine-patches mailing list