You've already forked lazarus-ccr
fpspreasheet: Adds forgotten files
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@655 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
52
components/fpspreadsheet/fpsutils.pas
Normal file
52
components/fpspreadsheet/fpsutils.pas
Normal file
@ -0,0 +1,52 @@
|
|||||||
|
unit fpsutils;
|
||||||
|
|
||||||
|
{$mode objfpc}{$H+}
|
||||||
|
|
||||||
|
interface
|
||||||
|
|
||||||
|
uses
|
||||||
|
Classes, SysUtils;
|
||||||
|
|
||||||
|
function WordToLE(AValue: Word): Word;
|
||||||
|
function DWordToLE(AValue: Cardinal): Cardinal;
|
||||||
|
function IntegerToLE(AValue: Integer): Integer;
|
||||||
|
|
||||||
|
implementation
|
||||||
|
|
||||||
|
{
|
||||||
|
Endianess helper functions
|
||||||
|
|
||||||
|
Excel files are all written with Little Endian byte order,
|
||||||
|
so it's necessary to swap the data to be able to build a
|
||||||
|
correct file on big endian systems.
|
||||||
|
}
|
||||||
|
|
||||||
|
function WordToLE(AValue: Word): Word;
|
||||||
|
begin
|
||||||
|
{$IFDEF BIG_ENDIAN}
|
||||||
|
Result := ((AValue shl 8) and $FF00) or ((AValue shr 8) and $00FF);
|
||||||
|
{$ELSE}
|
||||||
|
Result := AValue;
|
||||||
|
{$ENDIF}
|
||||||
|
end;
|
||||||
|
|
||||||
|
function DWordToLE(AValue: Cardinal): Cardinal;
|
||||||
|
begin
|
||||||
|
{$IFDEF BIG_ENDIAN}
|
||||||
|
// ?? Result := ((AValue shl 8) and $FF00) or ((AValue shr 8) and $00FF);
|
||||||
|
{$ELSE}
|
||||||
|
Result := AValue;
|
||||||
|
{$ENDIF}
|
||||||
|
end;
|
||||||
|
|
||||||
|
function IntegerToLE(AValue: Integer): Integer;
|
||||||
|
begin
|
||||||
|
{$IFDEF BIG_ENDIAN}
|
||||||
|
// ?? Result := ((AValue shl 8) and $FF00) or ((AValue shr 8) and $00FF);
|
||||||
|
{$ELSE}
|
||||||
|
Result := AValue;
|
||||||
|
{$ENDIF}
|
||||||
|
end;
|
||||||
|
|
||||||
|
end.
|
||||||
|
|
21
components/fpspreadsheet/laz_fpspreadsheet.pas
Normal file
21
components/fpspreadsheet/laz_fpspreadsheet.pas
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
{ This file was automatically created by Lazarus. do not edit!
|
||||||
|
This source is only used to compile and install the package.
|
||||||
|
}
|
||||||
|
|
||||||
|
unit laz_fpspreadsheet;
|
||||||
|
|
||||||
|
interface
|
||||||
|
|
||||||
|
uses
|
||||||
|
fpolestorage, fpsallformats, fpsopendocument, fpspreadsheet, xlsbiff2,
|
||||||
|
xlsbiff5, xlsbiff8, xlsxooxml, fpsutils, LazarusPackageIntf;
|
||||||
|
|
||||||
|
implementation
|
||||||
|
|
||||||
|
procedure Register;
|
||||||
|
begin
|
||||||
|
end;
|
||||||
|
|
||||||
|
initialization
|
||||||
|
RegisterPackage('laz_fpspreadsheet', @Register);
|
||||||
|
end.
|
Reference in New Issue
Block a user