From d9a8c87eefcd9d0c65c31f482a78f9858707f046 Mon Sep 17 00:00:00 2001 From: wp_xxyyzz Date: Sat, 27 Jul 2019 20:41:09 +0000 Subject: [PATCH] fpspreadsheet: Protect colwidth/rowheight when col/row is hidden. git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@7079 8e941d3f-bd1b-0410-a28a-d453659cc2b4 --- .../source/common/fpspreadsheet.pas | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/components/fpspreadsheet/source/common/fpspreadsheet.pas b/components/fpspreadsheet/source/common/fpspreadsheet.pas index e55ed6334..72c09f40a 100644 --- a/components/fpspreadsheet/source/common/fpspreadsheet.pas +++ b/components/fpspreadsheet/source/common/fpspreadsheet.pas @@ -8273,9 +8273,12 @@ begin if ARow = UNASSIGNED_ROW_COL_INDEX then exit; lRow := GetRow(ARow); - lRow^.Height := FWorkbook.ConvertUnits(AHeight, AUnits, FWorkbook.FUnits); - lRow^.RowHeightType := ARowHeightType; - ChangedRow(ARow); + if (croHidden in lRow^.Options) then + begin + lRow^.Height := FWorkbook.ConvertUnits(AHeight, AUnits, FWorkbook.FUnits); + lRow^.RowHeightType := ARowHeightType; + ChangedRow(ARow); + end; end; {@@ ---------------------------------------------------------------------------- @@ -8351,9 +8354,12 @@ begin if ACol = UNASSIGNED_ROW_COL_INDEX then exit; lCol := GetCol(ACol); - lCol^.Width := FWorkbook.ConvertUnits(AWidth, AUnits, FWorkbook.FUnits); - lCol^.ColWidthType := AColWidthType; - ChangedCol(ACol); + if not (croHidden in lCol^.Options) then + begin + lCol^.Width := FWorkbook.ConvertUnits(AWidth, AUnits, FWorkbook.FUnits); + lCol^.ColWidthType := AColWidthType; + ChangedCol(ACol); + end; end; {@@ ----------------------------------------------------------------------------