Commit Graph

76 Commits

Author SHA1 Message Date
wp_xxyyzz
cfe6c14a8f fpspreadsheet: Clip cell ranges at the sheet dimension limits. Add some test cases for it.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@9651 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2025-02-26 23:27:47 +00:00
wp_xxyyzz
960402692f FPSpreadsheet: Fix misc bugs in INDEX and INDIRECT formulas.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@9646 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2025-02-25 10:49:55 +00:00
wp_xxyyzz
7c75ca5398 FPSpreadsheet: Fix INDIRECT for cell range references. Add unit tests for the INDIRECT formula.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@9644 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2025-02-24 11:48:51 +00:00
wp_xxyyzz
81f20ccfdb FPSpreadsheet: Add unit tests for ACOS, ODD, POWER, RADIANS
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@9640 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2025-02-17 10:58:14 +00:00
wp_xxyyzz
350efafd15 FPSpreadsheet: Handle missing argument in ROW and COLUMN formulas. Add unit tests for ROW, COLUMN, LOG, LOG10, and fix others regarding error cases.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@9639 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2025-02-17 08:50:06 +00:00
wp_xxyyzz
ddef318478 FPSpreadsheet: Fix COUNTIF, SUMIF and AVERAGEIF formulas when they contain error values in the arguments.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@9624 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2025-02-11 18:18:47 +00:00
wp_xxyyzz
5c33ac9769 FPSpreadsheet: Add more unit tests for formula AVERAGEIF .
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@9606 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2025-01-27 23:05:14 +00:00
wp_xxyyzz
e66040bd5c FPSpreadsheet: Add more unit test cases for COUNTIF and SUMIF.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@9605 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2025-01-26 23:31:57 +00:00
wp_xxyyzz
d80948d93a FpSpreadsheet: More formula calculation unit tests. Fix some formulas for special arguments.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@9603 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2025-01-25 18:32:21 +00:00
wp_xxyyzz
0efab0339c FPSpreadsheet: Add more unit tests for formula calculation.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@9602 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2025-01-24 00:12:37 +00:00
wp_xxyyzz
c5b8b6077c FPSpreadsheet: Fix error propagation in ISERROR formula. Fix Excel pecularities in DATE and TIME formulas. Add formula calculation unit tests.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@9597 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2025-01-23 00:04:07 +00:00
wp_xxyyzz
e5e12455ea FPSpreadsheet: Redo error propagation in formula engine (https://forum.lazarus.freepascal.org/index.php/topic,69893.msg544003.html#msg544003, https://forum.lazarus.freepascal.org/index.php/topic,69900.0.html). Incomplete, formula IsError is broken.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@9596 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2025-01-22 12:02:41 +00:00
wp_xxyyzz
b9e2301025 FPSpreadsheet: Fix crash caused by error cells with sheetname (e.g., "sheetname!#REF!")
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@9488 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2024-10-18 18:17:07 +00:00
wp_xxyyzz
28d7446191 fpspreadsheet: Replace WriteLn instructions in fpsexprparser by DebugLn
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@9449 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2024-09-18 21:50:25 +00:00
wp_xxyyzz
12ee2c0b1b fpspreadsheet: Adjust defined name ranges when rows/cols are inserted/deleted. Handle #REF! error in defined names.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@9409 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2024-07-31 18:30:29 +00:00
wp_xxyyzz
b9a68c5f8e fpspreadsheet: support local defined names in xlsx (Note: scope not checked by fps, so far)
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@9407 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2024-07-28 17:14:24 +00:00
wp_xxyyzz
b3deb7c0f6 fpspreadsheet: Fix incorrect usage of single-cell defined names.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@9406 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2024-07-27 17:14:12 +00:00
wp_xxyyzz
5d03b1ca0e fpspreadsheet: Simplify usage of single-cell defined names. Fix 3D range formulas with defined names.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@9404 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2024-07-25 21:34:44 +00:00
wp_xxyyzz
52a79e952f fpspreadsheet: Fix defined names for ranges with several cells.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@9403 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2024-07-25 17:26:35 +00:00
wp_xxyyzz
f6b3b7e9dd fpspreadsheet/defined names: Some refactoring in formulas.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@9400 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2024-07-25 09:44:07 +00:00
wp_xxyyzz
a7620227c6 fpspreadsheet: Formula support for defined names.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@9399 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2024-07-24 22:29:17 +00:00
wp_xxyyzz
19e94158df fpspreadsheet: Support defined names in xlsx files. No formula support so far.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@9397 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2024-07-24 13:20:11 +00:00
wp_xxyyzz
7f8e724978 fpspreadsheet: Fix display of formula with cell range when both ends are equal.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@9379 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2024-07-05 11:03:46 +00:00
wp_xxyyzz
4fa643f210 fpspreadsheet: Fix copying of formulas with absolute cell references. (https://forum.lazarus.freepascal.org/index.php/topic,67763.0.html)
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@9378 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2024-07-04 17:13:09 +00:00
wp_xxyyzz
af4a35901d fpspreadsheet: Extend INDEX formula to return columns and rows. Add unit test for it.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@9361 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2024-05-31 13:08:37 +00:00
wp_xxyyzz
79c502f0e9 FpSpreadsheet: Fix INDIRECT formula regarding references to other sheets.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@9356 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2024-05-30 12:04:34 +00:00
wp_xxyyzz
5d277d115f fpspreadsheet: Fix INDIRECT formula when the argument is a string
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@9351 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2024-05-24 21:20:41 +00:00
wp_xxyyzz
021d37e25d fpspreadsheet: Fix formulas with general UTF8 sheet names in xlsx
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@8942 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2023-10-09 17:44:35 +00:00
wp_xxyyzz
fb53f95eaf fpspreadsheet: Fix result of formula with unary plus having a string as input.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@8257 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2022-04-20 21:33:13 +00:00
wp_xxyyzz
c5c3755b64 fpspreadsheet: Handle numeric cells strings in TUPlusExprNode of the formula parser.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@8247 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2022-04-08 17:18:11 +00:00
wp_xxyyzz
520e94f2d7 fpspreadsheet: Fix integer overflow in formulas with large integer values.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@8246 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2022-04-08 17:01:55 +00:00
wp_xxyyzz
0f64e793db fpspreadsheet: Fix incorrect column calculation when ODS formula refers to column index > 25 (> 'AA') (https://forum.lazarus.freepascal.org/index.php/topic,59001).
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@8245 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2022-04-08 10:57:15 +00:00
wp_xxyyzz
5ce0a6ca18 fpspreadsheet: Fix TsUnaryExpressionNode not implementing the IterateNodes method (https://forum.lazarus.freepascal.org/index.php/topic,58969).
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@8242 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2022-04-04 09:13:40 +00:00
wp_xxyyzz
5b0b5f8f6f fpspreadsheet: Add underscore character ('_') to the list of allowed identifier characters to get a decent error message when a worksheet contains one of the (unsupported) new Excel formulas beginning with this character. Issue #38762.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@8000 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2021-04-16 15:26:35 +00:00
wp_xxyyzz
95cc2da283 fpspreadsheet: Fix incorrect handling of cell reference by new forumula INDIRECT(). Add test cases for formula ADDRESS().
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@7862 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2020-11-11 23:43:44 +00:00
wp_xxyyzz
901b92fa72 fpspreadsheet: Some clean-up: Less hints and warnings.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@7555 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2020-07-22 09:07:59 +00:00
wp_xxyyzz
faf6f72ab8 fpspreadsheet: Rearrange ODS reading code for conditional formats.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@7552 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2020-07-21 17:53:20 +00:00
wp_xxyyzz
acb49d9590 fpspreadsheet: Add Excel XML reading support for missing cell-based conditional formats. Fix lost "max compatibility" flag of packages.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@7550 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2020-07-18 15:57:19 +00:00
wp_xxyyzz
0e392dfcaa fpspreadsheet: Add exception handling for CF expressions writing to the workbook's error log.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@7542 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2020-07-15 17:00:21 +00:00
wp_xxyyzz
6b3a74ea33 fpspreadsheet: Write conditional formats to ExcelXML files (Office 2003)
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@7522 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2020-07-02 22:36:59 +00:00
wp_xxyyzz
47e9e05399 fpspreadsheet: Refactor dialects in formula parser.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@7067 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2019-07-22 17:49:17 +00:00
wp_xxyyzz
d310b3b9f2 fpspreadsheet: Fix expression parser crashing in GUI with comma as decimal separator.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@7065 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2019-07-21 09:42:19 +00:00
wp_xxyyzz
8e50105ca0 fpspreadsheet: Fix formula parser crashing with an R1C1 formula subtracting cells with a negative relative address.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@7051 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2019-07-18 21:02:44 +00:00
wp_xxyyzz
b7e1b3fee8 fpspreadsheet: Add file missing from previous commit.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@7039 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2019-07-15 22:54:02 +00:00
wp_xxyyzz
8e86543dde fpspreadsheet: Fix formula parser ignoring errors in binary nodes (see https://forum.lazarus.freepascal.org/index.php/topic,44426.0.html)
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@6819 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2019-02-26 09:03:12 +00:00
wp_xxyyzz
3f113c63bb fpspreadsheet: Some clean-up
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@6769 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2018-12-25 08:58:16 +00:00
wp_xxyyzz
7ce43cda63 fpspreadsheet: Fix boolean formula failures in unit tests (probably introduced by r6570).
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@6643 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2018-09-11 17:21:40 +00:00
wp_xxyyzz
72b96f5788 fpspreadsheet: Fix reading/writing of ods files with quoted sheetnames (https://forum.lazarus.freepascal.org/index.php/topic,42396.msg295937.html#msg295937)
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@6629 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2018-08-30 17:43:42 +00:00
wp_xxyyzz
02e90b8949 fpspreadsheet: Fix usage of empty cells as numeric value 0 in formulas (https://forum.lazarus.freepascal.org/index.php/topic,42396.msg295893.html)
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@6627 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2018-08-30 15:06:33 +00:00
wp_xxyyzz
f8f096dcf8 fpspreadsheet: Quote sheet names if they contain illegal characters for the expression parser.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@6607 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2018-08-17 12:00:02 +00:00