fpspreadsheet: Fix reading of row and column formats from ods files.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@5261 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2016-10-14 10:21:25 +00:00
parent c908c87838
commit 94a1b7adaf
2 changed files with 13 additions and 6 deletions

View File

@ -3503,8 +3503,11 @@ var
// sometimes split into two parts. // sometimes split into two parts.
cell := FWorksheet.FindCell(row, col); cell := FWorksheet.FindCell(row, col);
if cell <> nil then if cell <> nil then
for i:=1 to colsRepeated-1 do for i:=1 to colsRepeated-1 do begin
FWorksheet.CopyCell(row, col, row, col+i); cell := FWorksheet.CopyCell(row, col, row, col+i);
styleIndex := ExtractFormatIndexFromStyle(cellStyleName, col+i);
ApplyStyleToCell(cell, styleIndex);
end;
end; end;
end end
else else

View File

@ -374,8 +374,8 @@ type
{ Data manipulation methods - For Cells } { Data manipulation methods - For Cells }
procedure CopyCell(AFromCell, AToCell: PCell); overload; procedure CopyCell(AFromCell, AToCell: PCell); overload;
procedure CopyCell(AFromRow, AFromCol, AToRow, AToCol: Cardinal; function CopyCell(AFromRow, AFromCol, AToRow, AToCol: Cardinal;
AFromWorksheet: TsWorksheet = nil); overload; AFromWorksheet: TsWorksheet = nil): PCell; overload;
procedure CopyFormat(AFromCell, AToCell: PCell); overload; procedure CopyFormat(AFromCell, AToCell: PCell); overload;
procedure CopyFormat(AFormatCell: PCell; AToRow, AToCol: Cardinal); overload; procedure CopyFormat(AFormatCell: PCell; AToRow, AToCol: Cardinal); overload;
procedure CopyFormula(AFromCell, AToCell: PCell); overload; procedure CopyFormula(AFromCell, AToCell: PCell); overload;
@ -1723,9 +1723,11 @@ end;
@param AToRow Row index of the destination cell @param AToRow Row index of the destination cell
@param AToCol Column index of the destination cell @param AToCol Column index of the destination cell
@param AFromWorksheet Worksheet containing the source cell. Self, if omitted. @param AFromWorksheet Worksheet containing the source cell. Self, if omitted.
@return Created new destination cell
-------------------------------------------------------------------------------} -------------------------------------------------------------------------------}
procedure TsWorksheet.CopyCell(AFromRow, AFromCol, AToRow, AToCol: Cardinal; function TsWorksheet.CopyCell(AFromRow, AFromCol, AToRow, AToCol: Cardinal;
AFromWorksheet: TsWorksheet = nil); AFromWorksheet: TsWorksheet = nil): PCell;
var var
srcCell, destCell: PCell; srcCell, destCell: PCell;
begin begin
@ -1739,6 +1741,8 @@ begin
ChangedCell(AToRow, AToCol); ChangedCell(AToRow, AToCol);
ChangedFont(AToRow, AToCol); ChangedFont(AToRow, AToCol);
Result := destCell;
end; end;
{@@ ---------------------------------------------------------------------------- {@@ ----------------------------------------------------------------------------