View Issue Details

IDProjectCategoryView StatusLast Update
0021025LazarusIDEpublic2012-01-07 16:39
ReporterBart BroersmaAssigned ToJuha Manninen 
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Platformi386OSWinMeOS VersionMS
Product Version0.9.31 (SVN)Product Buildr34334 
Target VersionFixed in Version0.9.30.1 (SVN) 
Summary0021025: Case-insensitive search in IDE fails on Win9x
DescriptionOn Win9x platform, case-insensitive search in the IDE fails (search is always case-sensitive).
This is because TSynEditSearch.FindNextOne uses Utf8LowerCase from LCLProc, and LCLProc.Utf8LowerCase (and LCLProc.Utf8UpperCase) return inputstring on Win9x platform.

This could be solved in two different ways:

1.
Use LazUtf8.Utf8LowerCase (and LazUtf8.UpperCase) instead of LCLProc.
(These procedures work on Win9x systems.)
Or maybe even let LCL.Utf8Upper/LowerCase "inline" LazUtf8.Utf8Upper/LowerCase (like it was done for Utf8Pos() tect.), so this will work throughout the entire IDE.)

2.
In LCLProc add {$IFDEF WINDOWS},Win9xWsManager{$ENDIF} to the uses clause.
The Win9xWsManager unit comes with fpc 2.6.0 and silently replaces the
WideStringManager.UpperWideStringProc and StringManager.LowerWideStringProc on Win9x systems without penalties for XP/NT and up (and it does nothing on non-windows).
This also will make all Utf8UpperCase/LowerCase work on Win9x systems throughout the IDE.

I attach a patch for the second solution.

Target 0.99 for review of patch.
TagsNo tags attached.
Fixed in Revisionr34601, r34605
LazTarget-
WidgetsetWin32/Win64
Attached Files
  • lclproc.win9xwsmanager.diff (416 bytes)
    Index: lcl/lclproc.pas
    ===================================================================
    --- lcl/lclproc.pas	(revision 34334)
    +++ lcl/lclproc.pas	(working copy)
    @@ -32,6 +32,7 @@
     
     uses
       {$IFDEF Darwin}MacOSAll, {$ENDIF}
    +  {$IFDEF Windows}Win9xWsManager, {$ENDIF}
       Classes, SysUtils, Math, TypInfo, Types, FPCAdds, AvgLvlTree, FileUtil,
       LCLStrConsts, LCLType, WSReferences, LazMethodList, LazUTF8;
     
    

Activities

2012-01-05 01:59

 

lclproc.win9xwsmanager.diff (416 bytes)
Index: lcl/lclproc.pas
===================================================================
--- lcl/lclproc.pas	(revision 34334)
+++ lcl/lclproc.pas	(working copy)
@@ -32,6 +32,7 @@
 
 uses
   {$IFDEF Darwin}MacOSAll, {$ENDIF}
+  {$IFDEF Windows}Win9xWsManager, {$ENDIF}
   Classes, SysUtils, Math, TypInfo, Types, FPCAdds, AvgLvlTree, FileUtil,
   LCLStrConsts, LCLType, WSReferences, LazMethodList, LazUTF8;
 

Juha Manninen

2012-01-05 11:59

developer   ~0055480

Isn't "WINDOWS" defined for all Windows versions including XP/NT and up?
Is it ok to use Win9xWsManager for all Windows versions?

Bart Broersma

2012-01-05 12:59

developer   ~0055481

Yes, It is AFAIK.
The initilization code checks of WideUpperCase works, end of not, It tries to dynamically load a dll.
On any system where WideUpperCase works, the unit does nothing at all.

Maybe It would make more sense to put Win9xWsManager in main.pp?

Juha Manninen

2012-01-05 18:29

developer   ~0055485

Last edited: 2012-01-05 18:30

Lazarus should support also the previous compiler version, FPC 2.4.4.
I applied a modified patch:

  {$IFDEF Windows}
  {$IFDEF VER2_6}
  Win9xWsManager, // Make case-insensitive search work on Win9x
  {$ENDIF}
  {$ENDIF}

Please test.
(Why should Win9xWsManager be in main.pp?)

Vincent Snijders

2012-01-05 19:35

manager   ~0055486

This means that the Win95WsManager is not used with fpc 2.7.1.

Juha Manninen

2012-01-06 00:05

developer   ~0055488

> This means that the Win95WsManager is not used with fpc 2.7.1.

True. What is the right define?

Bart Broersma

2012-01-06 00:33

developer   ~0055489

Perhaps?

  {$IFDEF Windows}
  {$IFNDEF VER2_4}
  Win9xWsManager, // Make case-insensitive search work on Win9x
  {$ENDIF}
  {$ENDIF}

2.4 has VER@_4 defined, so it will skip Win9xWsManager, all others, including previous fpc's will include it. Fpc's before 2.4 will than not be able to compile Lazarus trunk, but that's intended behaviour?

> (Why should Win9xWsManager be in main.pp?)

Well, not necessarily.
Point is that it should only be in one place (not that it matters for the compiled executable, be just one reference is enough to tie in the WS manager), since eventually we'll drop support for this, and we then only have to remove it from one unit.
So I suggested main.pp, since it's the central one.

Bart Broersma

2012-01-06 00:40

developer   ~0055490

Just a comment about the comment:
  {$IFDEF Windows}
  {$IFNDEF VER2_4}
  Win9xWsManager, // Make case-insensitive search work on Win9x
  {$ENDIF}
  {$ENDIF}

The essence of the patch is to make WideStringManager's Lower/UppperWideStringProc work on Win9x, both are used for Utf8Upper/LowerCase, which in term is used by SynEdit's search engine.

So I would suggest changin it to somethin like

  Win9xWsManager, // Support for Lower/UpperWideStringProc on Win9x, also used by some Utf8 string handling functions

Juha Manninen

2012-01-06 00:57

developer   ~0055491

Fixed.

Bart Broersma

2012-01-07 16:39

developer   ~0055554

Thanks.

Issue History

Date Modified Username Field Change
2012-01-05 01:59 Bart Broersma New Issue
2012-01-05 01:59 Bart Broersma File Added: lclproc.win9xwsmanager.diff
2012-01-05 01:59 Bart Broersma LazTarget => -
2012-01-05 01:59 Bart Broersma Widgetset => Win32/Win64
2012-01-05 11:58 Juha Manninen Status new => assigned
2012-01-05 11:58 Juha Manninen Assigned To => Juha Manninen
2012-01-05 11:59 Juha Manninen Note Added: 0055480
2012-01-05 11:59 Juha Manninen Status assigned => feedback
2012-01-05 12:59 Bart Broersma Note Added: 0055481
2012-01-05 18:29 Juha Manninen Fixed in Revision => r34601
2012-01-05 18:29 Juha Manninen Status feedback => resolved
2012-01-05 18:29 Juha Manninen Resolution open => fixed
2012-01-05 18:29 Juha Manninen Note Added: 0055485
2012-01-05 18:30 Juha Manninen Note Edited: 0055485
2012-01-05 19:35 Vincent Snijders Note Added: 0055486
2012-01-06 00:05 Juha Manninen Note Added: 0055488
2012-01-06 00:33 Bart Broersma Note Added: 0055489
2012-01-06 00:40 Bart Broersma Note Added: 0055490
2012-01-06 00:56 Juha Manninen Fixed in Revision r34601 => r34601, r34605
2012-01-06 00:57 Juha Manninen Note Added: 0055491
2012-01-07 16:39 Bart Broersma Status resolved => closed
2012-01-07 16:39 Bart Broersma Note Added: 0055554
2012-01-07 16:39 Bart Broersma Fixed in Version => 0.9.30.1 (SVN)