You've already forked lazarus-ccr
fpspreadsheet: Cell border linestyles supported by BIFF8, but not supported by fpspreadsheet, are replaced by similar linestyles now.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3000 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -1977,6 +1977,17 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TsSpreadBIFF8Reader.ReadXF(const AStream: TStream);
|
procedure TsSpreadBIFF8Reader.ReadXF(const AStream: TStream);
|
||||||
|
|
||||||
|
function FixLineStyle(dw: DWord): TsLineStyle;
|
||||||
|
{ Not all line styles defined in BIFF8 are supported by fpspreadsheet. }
|
||||||
|
begin
|
||||||
|
case dw of
|
||||||
|
$01..$06: result := TsLineStyle(dw-1);
|
||||||
|
$07: Result := lsDotted;
|
||||||
|
else Result := lsDashed;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
type
|
type
|
||||||
TXFRecord = packed record // see p. 224
|
TXFRecord = packed record // see p. 224
|
||||||
FontIndex: Word; // Offset 0, Size 2
|
FontIndex: Word; // Offset 0, Size 2
|
||||||
@ -2040,22 +2051,22 @@ begin
|
|||||||
dw := xf.Border_Background_1 and MASK_XF_BORDER_LEFT;
|
dw := xf.Border_Background_1 and MASK_XF_BORDER_LEFT;
|
||||||
if dw <> 0 then begin
|
if dw <> 0 then begin
|
||||||
Include(lData.Borders, cbWest);
|
Include(lData.Borders, cbWest);
|
||||||
lData.BorderStyles[cbWest].LineStyle := TsLineStyle(dw - 1);
|
lData.BorderStyles[cbWest].LineStyle := FixLineStyle(dw);
|
||||||
end;
|
end;
|
||||||
dw := xf.Border_Background_1 and MASK_XF_BORDER_RIGHT;
|
dw := xf.Border_Background_1 and MASK_XF_BORDER_RIGHT;
|
||||||
if dw <> 0 then begin
|
if dw <> 0 then begin
|
||||||
Include(lData.Borders, cbEast);
|
Include(lData.Borders, cbEast);
|
||||||
lData.BorderStyles[cbEast].LineStyle := TsLineStyle(dw shr 4 - 1);
|
lData.BorderStyles[cbEast].LineStyle := FixLineStyle(dw shr 4);
|
||||||
end;
|
end;
|
||||||
dw := xf.Border_Background_1 and MASK_XF_BORDER_TOP;
|
dw := xf.Border_Background_1 and MASK_XF_BORDER_TOP;
|
||||||
if dw <> 0 then begin
|
if dw <> 0 then begin
|
||||||
Include(lData.Borders, cbNorth);
|
Include(lData.Borders, cbNorth);
|
||||||
lData.BorderStyles[cbNorth].LineStyle := TsLineStyle(dw shr 8 - 1);
|
lData.BorderStyles[cbNorth].LineStyle := FixLineStyle(dw shr 8);
|
||||||
end;
|
end;
|
||||||
dw := xf.Border_Background_1 and MASK_XF_BORDER_BOTTOM;
|
dw := xf.Border_Background_1 and MASK_XF_BORDER_BOTTOM;
|
||||||
if dw <> 0 then begin
|
if dw <> 0 then begin
|
||||||
Include(lData.Borders, cbSouth);
|
Include(lData.Borders, cbSouth);
|
||||||
lData.BorderStyles[cbSouth].LineStyle := TsLineStyle(dw shr 12 - 1);
|
lData.BorderStyles[cbSouth].LineStyle := FixLineStyle(dw shr 12);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
// Border line colors
|
// Border line colors
|
||||||
|
Reference in New Issue
Block a user