View Issue Details

IDProjectCategoryView StatusLast Update
0030117LazarusLCLpublic2018-10-25 06:48
ReporterLacaKAssigned ToLacaK 
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
PlatformAllOSOS Version
Product Version1.6.1 (SVN)Product Build 
Target VersionFixed in Version2.0.1 (SVN) 
Summary0030117: Cleanup WinCE interface
DescriptionPatch makes WinCE interface more like Win32
Only cosmetic.
Related to 0027921 and 0029134
Tagswince
Fixed in Revision59338
LazTarget-
WidgetsetWinCE
Attached Files
  • wincecallback.inc.diff (807 bytes)
    --- wincecallback.inc.orig	Wed May 11 12:34:26 2016
    +++ wincecallback.inc	Wed May 11 12:41:17 2016
    @@ -942,15 +942,16 @@
         OldUTF8Char, UTF8Char: TUTF8Char;
         WS: WideString;
       begin
    -    Result := false;
    +    Result := False;
         UTF8Char := UTF16ToUTF8(widestring(WideChar(AChar)));
         OldUTF8Char := UTF8Char;
         if Assigned(lWinControl) then
         begin
    +      // if somewhere key is changed to '' then don't process this message
           Result := lWinControl.IntfUTF8KeyPress(UTF8Char, 1, False);
           // if somewhere key is changed then don't perform a regular keypress
           Result := Result or (UTF8Char <> OldUTF8Char);
    -      if OldUTF8Char <> UTF8Char then
    +      if Result then
           begin
             WS := UTF8ToUTF16(UTF8Char);
             if Length(WS) > 0 then
    

Relationships

related to 0027921 closedStephano TComboBox,CharCase = ecUppercase has no effect on WinCE 
related to 0029134 closedJuha Manninen [Patch] Small optimization of HandleUnicodeChar in win32callback.inc 

Activities

LacaK

2016-05-11 12:46

developer  

wincecallback.inc.diff (807 bytes)
--- wincecallback.inc.orig	Wed May 11 12:34:26 2016
+++ wincecallback.inc	Wed May 11 12:41:17 2016
@@ -942,15 +942,16 @@
     OldUTF8Char, UTF8Char: TUTF8Char;
     WS: WideString;
   begin
-    Result := false;
+    Result := False;
     UTF8Char := UTF16ToUTF8(widestring(WideChar(AChar)));
     OldUTF8Char := UTF8Char;
     if Assigned(lWinControl) then
     begin
+      // if somewhere key is changed to '' then don't process this message
       Result := lWinControl.IntfUTF8KeyPress(UTF8Char, 1, False);
       // if somewhere key is changed then don't perform a regular keypress
       Result := Result or (UTF8Char <> OldUTF8Char);
-      if OldUTF8Char <> UTF8Char then
+      if Result then
       begin
         WS := UTF8ToUTF16(UTF8Char);
         if Length(WS) > 0 then

LacaK

2018-06-28 12:30

developer   ~0109109

This patch changes 3 lines:
1. is cosmetic "false"->"False"
2. is added comment
3. is change of condition
       Result := Result or (UTF8Char <> OldUTF8Char);
- if OldUTF8Char <> UTF8Char then
+ if Result then

"Result" will be true if either:
- UTF8Char <> OldUTF8Char, which is original condition in "if"
- or if "lWinControl.IntfUTF8KeyPress" will return True.

When "lWinControl.IntfUTF8KeyPress" will return true ?
Only if "DoUTF8KeyPress" will return true
And "DoUTF8KeyPress" will return true if "UTF8Key" will be handled/changed to ''
As far as UFT8Key is passed as "var" parameter it means, that also "UTF8Char" will be changed to '', which means that "UTF8Char <> OldUTF8Char" (as far as OldUTF8Char is expected to be different from '')

So IMO patch is safe.

LacaK

2018-10-24 08:13

developer   ~0111533

Applied in rev.59338

Issue History

Date Modified Username Field Change
2016-05-11 12:46 LacaK New Issue
2016-05-11 12:46 LacaK File Added: wincecallback.inc.diff
2016-05-11 20:20 Juha Manninen Relationship added related to 0027921
2016-05-11 20:21 Juha Manninen Relationship added related to 0029134
2016-05-13 10:32 Stephano Assigned To => Stephano
2016-05-13 10:32 Stephano Status new => assigned
2018-06-28 12:30 LacaK Note Added: 0109109
2018-09-17 08:49 LacaK Tag Attached: wince
2018-10-24 08:13 LacaK Note Added: 0111533
2018-10-25 06:47 LacaK Fixed in Revision => 59338
2018-10-25 06:47 LacaK LazTarget => -
2018-10-25 06:47 LacaK Status assigned => resolved
2018-10-25 06:47 LacaK Fixed in Version => 2.0.1 (SVN)
2018-10-25 06:47 LacaK Resolution open => fixed
2018-10-25 06:47 LacaK Assigned To Stephano => LacaK
2018-10-25 06:48 LacaK Status resolved => closed