Commit Graph

357 Commits

Author SHA1 Message Date
56b814ec17 fpspreadsheet: Implement writing and reading of ods formulas. Some issues with date/time formulas.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3510 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-09-01 13:21:39 +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
a043b77519 fpspreadsheet: Remove workbook property ReadFormulas, use option boReadFormulas instead. Update all demos affected. Modify most demos to no longer require the fps package.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3505 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-08-29 15:32:43 +00:00
3fa5fd28ca fpspreadsheet: Complete calculation of shared rpn formulas.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3497 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-08-19 11:46:32 +00:00
67186349be fpspreadsheet: make sure that formulas are only recalculated when needed (in particalar only once after loading a file). Rename worksheet option soCalcAfterSaving to boCalcAfterSaving and assign it to the Workbook. (Add section "Incompatible changes" to wiki).
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3478 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-08-13 19:23:59 +00:00
f35eae9379 fpspreadsheet: Fix OOXML writer using incorrect color if palette index is >63. Activate color count error test for ooxml and ods.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3472 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-08-12 09:05:19 +00:00
495499a9e2 fpspreadsheet: Make sure that Excel's system colors are kept when colors are added to a palette. Fix BIFF 2 font color mismatch in unit test. All green again.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3471 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-08-11 22:39:47 +00:00
eaabdf67c1 fpspreadsheet: Make sure that biff writers do not write colors exceeding the maximum palette count. Add casse to error tests (passed, but the biff2 font color test fails now...)
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3470 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-08-11 15:53:06 +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
dd08f3e7c1 fpspreadsheet: Fix ODS writing incorrect blank cells. Add blank cells to emptycelltests.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3461 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-08-09 13:39:15 +00:00
1e24a88116 fpspreadsheet: Fix string-to-integer conversion bug introduced by last commit
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3460 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-08-09 11:51:34 +00:00
83db4e3fc4 fpspreadsheet: Add proper ifdefs around "uses clocale" in fpspreadsheet.pas
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3458 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-08-08 21:18:16 +00:00
a0a19eb380 fpspreadsheet: Write OOXML string formulas. Write biff2 dimension record.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3456 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-08-08 19:00:27 +00:00
8f666bec13 fpspreadsheet: Fix written oversized worksheets being defective, adapt BIFF writer's WriteDimensions method to be compatible with oversized worksheets.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3455 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-08-08 14:30:19 +00:00
53bb7bd316 fpspreadsheet: Add "empty cell" tests having empty rows and columns before occupied cells start. Extend "empty cell" tests to OOXML format.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3452 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-08-08 12:39:02 +00:00
0029891176 fpspreadsheet: Fix ODS writer beginning to write rows/columns at first used row/column instead of 0. ODS error message test active now. Separate errortests and virtualmodetests from internaltests. All tests passed (Win32, Laz trunk, fpc 2.6.4).
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3449 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-08-08 09:02:37 +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
b9dc9a801f fpspreadsheet: Fix option boBufStream writing defective ods and xlsx files.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3444 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-08-07 12:52:26 +00:00
c575126fa0 fpspreadsheet: Implement writing of ODS files in virtual mode. Adapt demo_virtualmode_write, speed test, and unit test (--> passed).
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3443 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-08-07 08:43:11 +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
ebf59489f2 fpspreadsheet: Complete database import demo. Rename dbexport to db_export_import. Fix biff2 crashing in ReadPane because of duplicate variable FWorksheet.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3434 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-08-06 08:50:36 +00:00
7e599ebd07 fpspreadsheet: Fix arithmetic overflow in ooxml writer in case of empty worksheet but existing row records. Use try-finally blocks around test cases to make sure that memory is released and temp file is deleted in case of exceptions due to failed tests. Fix memory leak in rpn formula calculation (spreadtestgui, however, still reports a lot of memory leaks).
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3431 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-08-05 21:42:34 +00:00
fe4b0ab8db fpspreadsheet: Add number, string and date/time tests for xlsx reading.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3425 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-08-05 08:25:17 +00:00
d0be6284cf fpspreadsheet: OOXML reading/writing support for frozen panes. Simplify OOXML's cell writing strategy by omitting empty cells.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3422 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-08-04 19:11:17 +00:00
f0b57845bb fpspreadsheet: xlsx reading/writing support for hidden grid lines and headers
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3420 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-08-03 22:55:58 +00:00
a7c1405be0 fpspreadsheet: Support for column widths and row heights of xlsx reader. Extend unit tests --> passed. Add "debug with heaptrc" build mode to spreadtestgui (--> there is an unfixed memory leak in fpsfunc).
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3418 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-08-03 21:21:31 +00:00
de5e05ec86 fpspreadsheet: Clean-up of demos (sometimes the default built mode was lost). Add some more overloaded methods to TsWorksheet having the cell as an argument instead of row/col index.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3411 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-08-02 22:31:19 +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
ead4186b6e fpspreadsheet: OOXML reading support for cell borders and diagonals. Unit tests adapted. Passed.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3403 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-07-31 21:05:01 +00:00
e96b16b993 fpspreadsheet: Add support for diagonal border lines. Implemented for BIFF8 and ods (BIFF2 and 5 do not support diagonal borders, OOXML reader currently does not have border support). Test cases adapted. "spready" adapted to show diagonal borders.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3400 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-07-30 22:51:59 +00:00
9206a6e753 fpspreadsheet: OOXML reader supports background color now. Test cases passed.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3397 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-07-29 22:09:29 +00:00
8c687533cf fpspreadsheet: Support reading of font from xlsx files. Add unit tests, 3 fails related to font color.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3387 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-07-27 22:44:17 +00:00
565df8a3e3 fpspreadsheet: Add test cases for xlsx number and date/time formats. Two fails.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3384 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-07-26 21:52:59 +00:00
5a65855a48 fpspreadsheet: Implement virtual reading mode for biff8 and biff5 (activated by workbook option boVirtualMode when reading). Add demo_virtualmode_read. Update speed test (factor 2 faster than standard mode, main advantage: no significant memory usage)
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3372 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-07-24 11:51:34 +00:00
7f8e8fb312 fpspreadsheet: Rename virtual mode event handler OnNeedCellData to OnWriteCellData. Add another virtual mode event handler for reading, OnReadCellData.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3370 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-07-23 21:51:06 +00:00
ed409c445a Fix using correct locale settings in Ubuntu.
Workaround for crash of test suite in Ubuntu due to not deleting existing xls file.



git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3365 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-07-23 16:00:01 +00:00
243d3b0c7d fpspreadsheet: try to fix date/time handling on Linux/Unix by adding clocale. Needs to be tested.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3361 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-07-23 08:15:28 +00:00
064dd6aba2 fpspreadsheet: Extend TBufStream for reading. Rename workbook's WritingOptions to Options, and the option flags from woXXXX to boXXXX. Use boBufStream (former woBufStream) to activate TBufStream for reading of xls and ods. Speed up reading of biff2 by factor 3 (rel to commit before prev one). Fix pile-up of temporary files when saving ods.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3357 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-07-22 15:59:29 +00:00
a7c7810ac5 fpspreadsheet: Fix crash of rpn formulas introduced by last commit
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3353 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-07-20 18:28:40 +00:00
03b690d834 fpspreadsheet: Fix floating point formula tests cases to give matching results even without tolerance value. Fix BIFFExplorer to show all digits of floating point cell values.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3343 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-07-19 23:14:53 +00:00
25c9c65dcc fpspreadsheet: FPC trunk on Linux x64 also needs error margins (so FPC 2.6.x on Linux x64 is the only one tested that does not need it).
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3341 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-07-19 15:34:08 +00:00
dae9095083 fpspreadsheet: error margin seems to be needed on Windows (FPC 2.6.4+FPC trunk), not on *nix (FPC 2.6.4) in contrast to previous commit.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3340 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-07-19 15:24:24 +00:00
b6a01e6814 fpspreadsheet: loose precision tests for FPC trunk floating point values
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3338 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-07-19 13:33:04 +00:00
08987b52c8 fpspreadsheet: Use TBufStream as general-purpose stream if woBufStream is set in Worksheet.WritingOptions. woBufStream replaces woSaveMemory. Results in a significant speed enhancement for biff2 (64000x100 cells -> 31 sec without, 1.7 sec with woBufStream).
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3337 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-07-19 13:23:12 +00:00
42f55e22d7 fpspreadsheet: tests: get empty temp file just before wrtiing out. Coding style: do begin matches initial style+FPC coding style.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3336 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-07-19 13:13:56 +00:00
18ae11e3e8 fpspreadsheet: Relax error margin for date/time tests to 10 nsec in order to get success in tests back.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3335 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-07-19 10:45:17 +00:00
752b1c95e7 fpspreadsheet: allow margin for error testing writing reading date/time. Test failures from 29 to 6
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3334 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-07-19 09:53:48 +00:00
49aa26354e fpspreadsheet: improve temp file handling in tests
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3333 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-07-19 09:20:47 +00:00
7f6277ca08 fpspreadsheet: Add unit fpsstreams containing a buffered stream for speed-up of writing in virtual mode.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3331 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-07-18 22:48:38 +00:00
ed197af6c1 fpspreadsheet: Add another set of unit tests for virtual mode, now with SaveMemory options.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3326 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-07-15 21:31:59 +00:00