From 474ce859da54819b078a04a85c61f36e7af5dbcf Mon Sep 17 00:00:00 2001 From: wp_xxyyzz Date: Wed, 1 Jul 2020 13:59:21 +0000 Subject: [PATCH] fpspreadsheet: Activate missing conditional formatting conditions in ODS writer (a few issues left) git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@7508 8e941d3f-bd1b-0410-a28a-d453659cc2b4 --- .../conditional_formatting/demo_conditional_formatting.pas | 7 +++---- components/fpspreadsheet/source/common/fpsopendocument.pas | 4 ++-- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/components/fpspreadsheet/examples/other/conditional_formatting/demo_conditional_formatting.pas b/components/fpspreadsheet/examples/other/conditional_formatting/demo_conditional_formatting.pas index bfea8f1d9..4332943b3 100644 --- a/components/fpspreadsheet/examples/other/conditional_formatting/demo_conditional_formatting.pas +++ b/components/fpspreadsheet/examples/other/conditional_formatting/demo_conditional_formatting.pas @@ -183,7 +183,7 @@ begin fmt.SetBackgroundColor($FFC0C0); fmtIdx := wb.AddCellFormat(fmt); sh.WriteConditionalCellFormat(Range(row, 2, row, lastCol), cfcBottomPercent, 10, fmtIdx); - (* + // conditional format #6: duplicates inc(row); sh.WriteText(row, 0, 'duplicate values'); @@ -199,7 +199,7 @@ begin fmt.SetBackgroundColor($D0D0FF); fmtIdx := wb.AddCellFormat(fmt); sh.WriteConditionalCellFormat(Range(row, 2, row, lastCol), cfcUnique, fmtIdx); - *) + // conditional format #6: contains any text inc(row); sh.WriteText(row, 0, 'contains any text'); @@ -247,7 +247,7 @@ begin fmt.SetBackgroundColor(scRed); fmtIdx := wb.AddCellFormat(fmt); sh.WriteConditionalCellFormat(Range(row, 2, row, lastCol), cfcNotContainsText, 'ef', fmtIdx); - (* + // conditional format #6: contains error inc(row); sh.WriteText(row, 0, 'contains error'); @@ -263,7 +263,6 @@ begin fmt.SetBackgroundColor(scRed); fmtIdx := wb.AddCellFormat(fmt); sh.WriteConditionalCellFormat(Range(row, 2, row, lastCol), cfcNotContainsErrors, fmtIdx); - *) WriteLn('row = ', row); WriteLn('wb.GetNumcellFormats = ', wb.GetNumCellFormats); diff --git a/components/fpspreadsheet/source/common/fpsopendocument.pas b/components/fpspreadsheet/source/common/fpsopendocument.pas index fd263ffe4..53f5b75a5 100644 --- a/components/fpspreadsheet/source/common/fpsopendocument.pas +++ b/components/fpspreadsheet/source/common/fpsopendocument.pas @@ -404,10 +404,10 @@ const 'above-equal-average', 'below-equal-average', // cfcAboveEqualAverage, cfcBelowEqualAverage 'top-elements(%s)', 'bottom-elements(%s)', // cfcTop, cfcBottom, 'top-percent(%s)', 'bottom-percent(%s)', // cfcTopPercent, cfcBottomPercent, - '', '', // cfcDuplicate, cfcUnique, + 'duplicate', 'unique', // cfcDuplicate, cfcUnique, 'begins-with(%s)', 'ends-with(%s)', // cfcBeginsWith, cfcEndsWith, 'contains-text(%s)', 'not-contains-text(%s)', // cfcContainsText, cfcNotContainsText, - '', '' // cfcContainsErrors, cfcNotContainsErrors + 'is-error', 'is-no-error' // cfcContainsErrors, cfcNotContainsErrors );