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:
sekelsenmat
2009-01-09 08:39:40 +00:00
parent bbe2c54a49
commit 0b32db4780
2 changed files with 73 additions and 0 deletions

View 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.

View 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.