Commit Graph

63 Commits

Author SHA1 Message Date
5d496d9cf4 fpspreadsheet: Fix formula issues with ods (written error values still different between fps and ods).
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3512 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-09-02 09:25:54 +00:00
c87afdcdec fpspreadsheet: Redo handling for formulas:
- Allow processing of string formulas (conversion to/from rpn formulas, calculation). 
- Drop cell ContentType cctRPNFormula. 
- Drop field RPNFormulaValue of TCell record. 
- Remove all fekXXXX declarations for sheet functions. Function is specified by name now.
- Complete registration mechanism for user-defined formulas.
Adapt all demos
Test cases working
This commit does not yet support: shared formulas, formulas in ods.


git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3506 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-08-30 18:03:22 +00:00
257fd65a2c fpspreadsheet: Fix ParseCellString to return false if string is without row part.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3499 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-08-21 22:04:35 +00:00
4bafc57020 fpspreadsheet: Add writing of shared formulas for OOXML.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3493 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-08-18 13:48:46 +00:00
5bc25c482e fpspreadsheet: Clean up. Silence some hints.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3473 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-08-12 14:52:57 +00:00
ad1ae69544 fpspreadsheet: Log warning if BIFF writer tries to write more than 64 colors. More clean-up.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3468 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-08-11 11:16:43 +00:00
68aed47788 fpspreadsheet: Some clean-up, less hints
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3466 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-08-10 17:59:30 +00:00
580ace3391 fpspreadsheet: Fix font assignment scrambled when OOXML reads files written by Excel 2007+
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3464 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-08-10 14:52:30 +00:00
ff059e3420 fpspreadsheet: Move log list from reader/writer to workbook for easier access. Add unit test for error logging (in internaltests). Improve OOXML writer to begin writing rows only from the first existing row, not from 0. (The ODS writer still does this, therefore, it creates a huge file for the error logging test - this test is currently deactivated for ods).
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3446 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-08-07 22:24:22 +00:00
c0dbb07201 fpspreadsheet: Implementing reading of xlsx theme colors which are found in many xlsx files. Not quite correct yet.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3440 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-08-06 15:49:04 +00:00
b824d4854b fpspreadsheet: Implement text alignment, text rotation and word wrap for xlsx reader. Extend these unit tests for xlsx - passed. Some improvements in formattests (better readability of enum data, trying to guarantee deletion of temp file in case of a mismatch).
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3407 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-08-02 19:21:23 +00:00
f989031cf9 fpspreadsheet: Fix font color issues of xlsx reader. No fails in unit test any more.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3396 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-07-29 21:02:14 +00:00
3ef1b5b331 fpspreadsheet: Fix ods writing incorrect nfTimeInterval format.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3386 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-07-27 17:31:02 +00:00
e2391c142b fpsreadsheet: Introduce "virtual writing mode" where the writer does not get its data from the spreadsheet, but from an event ("OnNeedCellData"). Introduce stream switching for xlsxooxml. Both feature allow to write HUGE spreadsheet files. Add example "test_virtualmode".
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3306 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-07-10 20:43:46 +00:00
ddd6902edf fpspreadsheet: Significantly improve speed of the ooxml writer, by rvk (see discussion in http://forum.lazarus.freepascal.org/index.php/topic,25110.0.html)
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3305 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-07-10 15:55:40 +00:00
4967d9a233 fpspreadsheet: Calculate the formula SUMIF.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3281 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-07-04 20:41:07 +00:00
fb2b3159ea fpspreadsheet:
- test for bug 26447: fpspreadsheet columns >26 wrong with ooxml (patch) as fixed in r3273
- fix typo in documentation rfRow=>rfRelRow
- cosmetic changes



git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3276 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-07-04 08:48:12 +00:00
2f338a50a8 fpspreadsheet: Beginning to add cells to calculation of rpn formulas.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3267 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-07-02 15:14:58 +00:00
c82e915262 fpspreadsheet: Fix remaining utf8 issues when reading/writing rpn string formulas. Fix BIFFExplorer issues when displaying biff2 formulas. Excel complains about data loss when reading a biff2 file containing a calculated formula having a string result - not fixed yet.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3266 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-07-02 11:51:59 +00:00
734c816bd1 fpspreadsheet: (Almost) complete calculation of built-in rpn string function of fpspreadsheet (PROPER and SUBSTITUTE missing)
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3257 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-06-30 22:30:23 +00:00
92ed17a049 * fpspreadsheet: documentation fixes
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3235 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-06-24 16:10:01 +00:00
517bdca8fb fpspreadsheet: Include unit fpsutils in doc-o-matic project. Update fpspreadsheet.chm help file.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3228 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-06-23 21:49:20 +00:00
13a9fb2603 fpspreadsheet: Remove built-in number formats nfSci (not suppored by ods and fpc) and nfAccounting/nfAccountingRed (too much display-oriented, too cumbersome to implement for reading and displaying in the grid). If needed in Excel they can still be written using nfCustom. Update all files and tests for these now no longer existing formats.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3222 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-06-23 09:15:56 +00:00
d0927d2d03 fpspreadsheet: Further reduction of hints and warnings
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3206 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-06-20 15:58:22 +00:00
a85adcb61a fpspreadsheet: Reducing hints and warnings, still a lot...
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3203 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-06-19 19:25:40 +00:00
888f605851 fpspreadsheet: Fix some date/time format display issues for ods.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3202 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-06-19 17:56:29 +00:00
9faf94ee3a fpspreadsheet: Add writing of date/time formats to ods files and fix writing of time values
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3199 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-06-18 21:54:29 +00:00
0875ce96e8 fpspreadsheet: Reading/writing of negative currencies in red now working for ods
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3189 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-06-17 21:56:49 +00:00
f4f860abc2 fpspreadsheet: Cleaning up
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3167 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-06-13 20:32:58 +00:00
9f69ce203a fpspreadsheet: Fix ods number format issues introduced with new number format parser. No regressions in test suite any more.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3166 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-06-13 20:11:41 +00:00
0abb220530 fpspreadsheet: Fix changing of decimal places for currency format in fpsgrid demo.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3162 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-06-13 10:03:29 +00:00
a4ee00f870 fpspreadsheet: Major reconstruction of numberformat parser to facilitate creation of xml formats for ods. Some minor regressions in unit tests and fpsgrid demo to be fixed. Removed elements "Decimals" and "CurrencySymbol" from TCell (this information is taken from the format string now). Removed the built-in format nfFmtDateTime (makes life easier, use nfCustom instead).
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3156 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-06-12 22:20:45 +00:00
d7ee2a84d8 fpspreadsheet: Fix crash of unit test application in case of missing length unit in HTMLLengthStrToPts. Rearrange code for ods font reading.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3147 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-06-06 09:17:52 +00:00
036383d658 fpspreadsheet: Add support for reading fonts from ods files.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3146 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-06-06 08:48:22 +00:00
6c0efaf6eb fpspreadsheet: Improvments of TsWorksheetGrid and fpsgrid demo: Fix currency symbol not shown when selecting currency format. Fix showing a zero value when assigning a number format to an empty cell. Fix formula display when selecting an empty cell. Reset number format when selecting "General" format. Move selection to entered cell address in address edit.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3144 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-06-05 21:57:23 +00:00
73dc71627b fpspreadsheet: Add code for detection of date/time cells which are incorrectly written as float by Open/LibreOffice. Implement conditional number formats for all number types (sometimes falsely assigned). Reactivate ignored date test cases for ods-1899, pass. 1904 date mode still faulty, not clear if this will ever pass the test.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3133 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-06-03 22:04:11 +00:00
33a8fdcb43 fpspreadsheet: Row height and column width reading/writing code for ods files complete. Test cases ok, but extremely slow speed of test application for numbertest and datetimetests. Changed units of row heights in worksheet: used to be points, is "lines" now (more consistent user interface - column width is in "standard characters", I prefer these units over centimeters because row heights/column widths become independent of screen pixels per inch this way)
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3118 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-05-31 21:04:53 +00:00
99f6a6f1d1 fpspreadsheet: Add unit tests for writing/reading of borders, borderstyle and wordwrap for ods files. Passed.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3109 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-05-27 22:12:48 +00:00
632b9d6200 fpspreadsheet: Add ods reading support for cell borders, border line styles and border colors. Borders of ods files are displayed in fpsgrid correctly.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3106 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-05-27 13:09:23 +00:00
89f2f4bb57 fpspreadsheet: Extend formula reading test case to biff5 and biff2 and generalize it such that the test results are not affected by locale settings and rounding errors.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3096 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-05-25 16:49:45 +00:00
f8e63e1f93 fpspreadsheet: Rewrite "ParseCellString" to allow for multiletter column addresses.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3091 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-05-24 19:44:40 +00:00
4271ace593 fpspreadsheet: Construct Excel-like formula string out of an RPN formula and display it in fpsgrid demo.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3085 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-05-23 23:13:49 +00:00
239633cb51 fpspreadsheet: Rename number format codes "nfCurrencyDash"/"nfCurrencyDashRed" to "nfAccounting"/"nfAccountingRed" and implement alignment of currency symbols as in Excel. Fix number format parser bug causing a failure in the corresponding test case.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3080 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-05-22 21:54:24 +00:00
ee1db37c7f fpspreadsheet: In the unit tests, use the same methods for creating "soll" date/times and test format strings. --> No more biff-related regressions.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3078 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-05-22 12:34:10 +00:00
52faebc69e fpspreadsheet: Improvements in biff5/8 reading of number formats, a few date/time relatived issues left. biff2 not yet touched.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3073 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-05-21 16:23:38 +00:00
a9df011859 fpspreadsheet: More logical writing strategy for biff number formats. Still issues with reading.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3072 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-05-21 12:12:16 +00:00
00ed56d1ef fpspreadsheet: Integrate number format parser into fpspreadsheet. Some regressions in format detection...
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3068 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-05-20 16:13:48 +00:00
cb9d07d0dd fpspreadsheet: Initial implementation of a number format parser. Not complete yet.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3061 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-05-19 22:26:42 +00:00
f638eb928a fpspreadsheet: Write currency format codes for BIFF5 and BIFF8 (incl. "red" for negatives and "-" for zero).
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3053 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-05-17 15:13:08 +00:00
e21231de03 fpspreadsheet: Add controls to change number format to the fpsgrid demo program. Also, add the "brush" button to copy a format to another cell.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3049 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-05-15 22:41:14 +00:00