Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code refactoring and bugfix #5

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

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;

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.

2 participants