Skip to content

Master не собирается в Lazarus 2.2.3 / FPC 3.2.3 #46

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

Open
the-Arioch opened this issue Aug 29, 2022 · 4 comments
Open

Master не собирается в Lazarus 2.2.3 / FPC 3.2.3 #46

the-Arioch opened this issue Aug 29, 2022 · 4 comments

Comments

@the-Arioch
Copy link
Contributor

При попытке скомпилировать пакет ошибки

zexml.inc(25,5) Error: Incompatible types: got "AnsiString" expected "Extended"
zexml.inc(25,5) Error: Compile time expression: Wanted Boolean but got <erroneous type> at IF or ELSEIF
zexml.inc(25,5) Error: Incompatible types: got "AnsiString" expected "Extended"
zexml.inc(25,5) Error: Compile time expression: Wanted Boolean but got <erroneous type> at IF or ELSEIF

исправление

// Archivers for Delphi, not used for Free Pascal / Lazarus
// Архиваторы для Delphi, не используются для Free Pascal / Lazarus
+++ {$IFNDEF FPC}
{ use Delphi XE2 and above }
{$if CompilerVersion >= 23.0}         // bds xe2 (2012)
  {$define XE2ZIP}
{$ifend}

и потом

{ use Synopse }
{//$define SYNZIP}
+++ {$EndIf}

// Free Pascal / Lazarus
{$IFDEF FPC}
@the-Arioch the-Arioch changed the title Tunk не собирается в Lazarus 2.2.3 / FPC 3.2.3 Master не собирается в Lazarus 2.2.3 / FPC 3.2.3 Aug 29, 2022
@the-Arioch
Copy link
Contributor Author

zexmlss.pas(6068,21) Error: Incompatible types: got "Pointer" expected "TZEPicture"

исправление

function TZEPictureStore.GetItem(num: integer): TZEPicture;
begin
  Result := nil;
  if ((num >= 0) and (num < Count)) then
---    Result := FItems[num];
+++    Result := TObject(FItems[num]) as TZEPicture;
end;

Забавно, что в другом месте преобразование есть.

function TZEPictureStore.Delete(num: integer): boolean;
....
    TZEPicture(FItems[num]).Free();

TZEPicture(FItems[num])

@the-Arioch
Copy link
Contributor Author

zexlsx.pas(587,14) Error: Identifier not found "TTmpFileStream"

и потом

zexlsx.pas(7335,17) Error: Identifier not found "TTmpFileStream"

и его таки действительно нигде нету, вот вообще нигде...
даже в Гугле нету!

procedure TXSLXZipHelper.DoCreateOutZipStream(Sender: TObject; var AStream: TStream; AItem: TFullZipFileEntry);
begin
  {$ifdef MSWINDOWS}
  AStream := TTmpFileStream.Create();
  {$else}
  AStream := TMemoryStream.Create();
  {$endif}
end;

@the-Arioch
Copy link
Contributor Author

the-Arioch commented Aug 29, 2022

zeSaveXLSX.pas(36,13) Error: Wrong number of parameters specified for call to "ExportXmlssToXLSX"
zexlsx.pas(7288,10) Error: Found declaration: ExportXmlssToXLSX(var TZEXMLSS;AnsiString;const {Open} Array Of LongInt;const {Open} Array Of AnsiString;TAnsiToCPConverter;AnsiString;AnsiString;Boolean=`FALSE`):LongInt;

Сломано в 2d5c04d

Если уж решили делать свой Zip - то надо его было во всей библиотеке делать, а не кусками

Теперь получается довольно идиотская картинка, ODS делается одной zip-библиотекой, а XLSX-другой.
Шиза...

@the-Arioch
Copy link
Contributor Author

You totally did not test 2d5c04d in FPC/Laz - did you?

ALL the saving into XLSX in FPC is broken!!!
ALL the contents of XLSZ archive are zero length files!

Really... How you merge such things...

zexmlss.Vanilla\zexmlss\src\zexlsx.pas

function ExportXmlssToXLSX(

    ZEXLSXCreateDocPropsCore(XMLSS, TmpStream, TextConverter, CodePageName, BOM);

    zip.ZipAllFiles();
  finally

You can not just go like that!!!
You have to reset stream positions back to zero!!!

zeZippy was diligently cheecking and doing it - it was in the open!

Why you removed it and did not even tested if it works any more - is beyond me.

    ZEXLSXCreateDocPropsCore(XMLSS, TmpStream, TextConverter, CodePageName, BOM);

    for i := 0 to zip.Entries.Count - 1 do
      with zip.Entries[i] do begin
        if nil = Stream then
           Continue;
        Stream.Position := 0;
      end;

    zip.ZipAllFiles();
  finally
    StreamList.Free();    

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

No branches or pull requests

1 participant