Skip to content

Code refactoring and bugfix#5

Open
aigazy wants to merge 2 commits intoKonctantin:masterfrom
aigazy:master
Open

Code refactoring and bugfix#5
aigazy wants to merge 2 commits intoKonctantin:masterfrom
aigazy:master

Conversation

@aigazy
Copy link

@aigazy aigazy commented Jan 9, 2024

  1. Refactored module names in uses sections according to the Embarcadero coding style
  2. Separation of module names for FMX and VCL
  3. Fixed a bug in the method for adding a new sheet (function TZSheets.Add(title: string): TZSheet): the sheet title and number of sheets were not set, which led to memory leaks:
destructor TZSheets.Destroy();
var i: integer;
begin
  // FCount was not changed, that is why it will not free added sheets
  for i := 0 to FCount - 1 do
    FreeAndNil(FSheets[i]);
  SetLength(FSheets, 0);
  FSheets := nil;
  FStore := nil;
  inherited Destroy();
end;

@MAUROFAILO
Copy link

I find ad error in procedure TZCell.SetDataAsInteger(const Value: integer);
The procedure set Data := Trim(IntToStr(Value));
We must user the variable FData and not the variable Data.
I change the procedute in:

procedure TZCell.SetDataAsInteger(const Value: integer);
begin
CellType := ZENumber;
FData := Trim(IntToStr(Value));
if assigned(FRichText) then begin
FRichText.Free();
FRichText := nil;
end;
end;

@mobius1qwe
Copy link

While this code will work with newer Delphi versions, gotta remeber that that scoped naming convention only work in XESomething (maybe XE3+) versions beyond, so any Older versions of Delphi won't work with that naming
Don't know if the repository is supposed to serve all Delphi versions but, it's a thing to keep in mind

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants