Component boolean property not restored in Object-Inspector

In this forum you may discuss all issues concerning the Lazarus IDE and Freepascal (both running on Windows or Linux).

Moderators: gto, cipto_kh, EgonHugeist

Post Reply
JohnML1
Fresh Boarder
Fresh Boarder
Posts: 13
Joined: 12.03.2015, 08:34

Component boolean property not restored in Object-Inspector

Post by JohnML1 »

don't know if this issue is ZeosLib or FPC related:

ZConnection.AutoEncodeStrings set to true

ZConnection.Properties shows:

AutoEncodeStrings=ON
codepage=WE8ISO8859P15
controls_cp=CP_UTF8


save and restart Lazarus, reopen the project:


AutoEncodeStrings in Object-Inspector is now false, despite the settings in ZConnection1.Properties


... and Strings like "Büdingen" are displayed wrong!

Info:

zeosdbo-7.2.4-stable.zip

Windows XP,
Oracle Database running on remote PC
German locale

Lazarus 1.9.0 r57768M FPC 3.1.1 i386-win32-win32/win64

*************************************************************************
On Lazarus Mailing List someone ( Luca Olivetti ) tells us:

In the version of zeos I have (7.1.4), the property AutoEncodeStrings is marked as "default True", however the constructor doesn't set the underlying field to true, hence the bug is in the zeos library.

*************************************************************************
my personal fix: added one line in ZAbstractConection.pas at the end:

Code: Select all

constructor TZAbstractConnection.Create(AOwner: TComponent);
begin
  {$IFDEF UNICODE}
  FControlsCodePage := cCP_UTF16;
  {$ELSE}
    {$IFDEF FPC}
    FControlsCodePage := cCP_UTF8;
    {$ELSE}
    FControlsCodePage := cGET_ACP;
    {$ENDIF}
  {$ENDIF}
  FURL := TZURL.Create;
  inherited Create(AOwner);
  FAutoCommit := True;
  FReadOnly := False;
  FTransactIsolationLevel := tiNone;
  FConnection := nil;
  FUseMetadata := True;
  FDatasets := TList.Create;
  // Modified by cipto 8/1/2007 1:45:56 PM
  FSequences:= TList.Create;
  FLoginPrompt := False;
  FDesignConnection := False;

  (* added JohnML *)
  FAutoEncode:=true;
end;                   
marsupilami
Platinum Boarder
Platinum Boarder
Posts: 1956
Joined: 17.01.2011, 14:17

Re: Component boolean property not restored in Object-Inspector

Post by marsupilami »

At least for Delphi Luca Olivetti is right. This is from the Delphi docs:
http://docwiki.embarcadero.com/RADStudio/Tokyo/en/Properties_(Delphi) wrote:Note: Property values are not automatically initialized to the default value. That is, the default directive controls only when property values are saved to the form file, but not the initial value of the property on a newly created instance.
FPC seems to have no statement regarding the default specifier in their language reference guide.

John, it might make sense to raise a ticket for bugs and things like that. Forum posts can get lost and forgotten whereas tickets on the tracker are reviewed from time to time. I am sorry it took so long to add your patch but we are only a small group and have our day to day life to attend to too.

Fixed on Zeos 7.3 in Rev. 4620. This will be merged to trunk and Zeos 7.2 in the next days.

Best regards,

Jan
Post Reply