Commit Graph

138 Commits

Author SHA1 Message Date
e07e322170 fpspreadsheet: Redo internal structure of merged cells (use MergeBase cell instead of neighbor links).
Suppress TsWorksheetGrid painting of inner grid lines of merged cells.
Fix inserting columns and rows running through merged cells. 
Silence some warnings. 
Fix ods reading merged cells incorrectly.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3569 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-09-15 20:54:39 +00:00
a3ed071349 fpspreadsheet: Fix cell range selection issue in TsWorksheetGrid if grid is in edit mode. Fix ods reporting an error due to a worksheet with empty name. Fix some bugs added when introducing text overflow cells (frozen cells incorrectly painted, failure to determine row heights correctly)
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3564 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-09-14 20:40:58 +00:00
e0241fd6d1 fpspreadsheet: Fix ODS reader crashing when finding unexpected nodes among row nodes (see http://forum.lazarus.freepascal.org/index.php/topic,25624.msg157029.html#msg157029).
Fix the ODS reader detecting underlined font style for the file of this discussion. 
Fix incorrect row height calculation of TsWorksheetGrid introduced in the previous commit.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3544 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-09-10 22:46:22 +00:00
342ba95e8e fpspreadsheet: Read/write merged cells to/from ODS files.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3542 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-09-10 17:15:37 +00:00
cfb50bf064 fpspreadsheet: Read default column width and row height from biff and ooxml files
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3532 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-09-09 11:42:20 +00:00
e9bf681d97 fpspreadsheet: Avoid using column and row records when all column widths and row heights are equal. This fixes Mantis #0026686.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3528 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-09-07 22:25:11 +00:00
ef0a0319db fpspreadsheet: Writing of shared formulas for ods and biff2 (shared formulas are not yet working in the other formats).
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3522 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-09-03 21:12:20 +00:00
e40683ea83 fpspreadsheet: Fix ods formula issues, seems to be ok now.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3513 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-09-02 12:58:06 +00:00
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
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
87283fda5d fpspreadsheet: Initial implementation of writing shared formulas to BIFF files. BIFF2 working (using copies of master formula), BIFF8 faulty file.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3491 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-08-17 22:25: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
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
755a36e055 fpspreadsheet: Write string formulas to ods files.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3457 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-08-08 19:14:08 +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
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
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
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
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
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
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
005434006f fpspreadsheet: Split shared code for ooxml and ods readers off into new unit fpsxmlcommon.pas
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3378 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-07-25 16:31:34 +00:00
8d4572c39d fpspreadsheet: Initial implementation of an OOXML reader (some files still crashing). Add ooxmlread demo to examples folder. Fix spready demo's incorrect *.xlsx file filter.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3374 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-07-24 22:22:26 +00:00
340efa7c8f fpspreadsheet: Implement virtual reading mode for biff2 and ods.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3373 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-07-24 15:56:03 +00:00
ee1fafb7ef fpspreadsheet: Implement SaveToStream for ODS writer (code from SaveToFile)
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3368 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-07-23 21:30:01 +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
ba37ace85f fpspreadsheet: Read entire biff record of label and number cells to speed up reading (30% improvement for biff2). Numerous clean-up, mostly debugger settings.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3355 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-07-21 20:33:25 +00:00
ecaa1d67cb fpspreadsheet: Fix memory leak in fpopendocument (forgot to call inherited destructor of TsSpreadOpenDocWriter).
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3351 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-07-20 16:25:25 +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
4c723b9fc3 fpspreadsheet: Convert some more biff methods such records are written in a single block (biff2: WriteLabel, WriteNumber, all: WriteFormat, WriteBlank, WriteColInfo).
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3325 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-07-15 21:00:49 +00:00
8d6ec7316c fpspreadsheet: Remove string-based writing code of ods files --> significant speed improvement particularly for large grids (20000x100 cells 120 sec (old) --> 7 sec (new)).
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3311 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-07-12 21:51:44 +00:00
231b127041 fpspreadsheet: Implement virtual mode for all biff file formats. Add record limitations with writer-specific max row and col counts: a file is not written to a particular file format if it exceeds the limitations of the file format.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3307 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-07-11 13:20:14 +00:00
db24ac3a9b fpspreadsheet: Fix "rows-repeated" error in ods introduced in prev commit
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3303 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-07-09 21:53:41 +00:00
63283c100a fpspreadsheet: Caching the result of the worksheet's GetLastColIndex and GetLastRowIndex for better writing performance of large ods files (which query these data in the row loop). Has no significant effect, though.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3302 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-07-09 14:56:09 +00:00
9fb1a96f20 fpspreadsheet: Fix bug #026451 ("Wrong {$IFDEF} in xlsxooxml.pas and fpsopendocument.pas")
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3284 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-07-05 18:11:41 +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
d75755c1ff fpspreadsheet: Read frozen panes from ods files. Add test case for writing/reading of ods panes, passed.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3210 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-06-21 16:09:08 +00:00
e3ece8a30b fpspreadsheet: Write frozen panes to ods files.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3209 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-06-21 12:19:19 +00:00
9b59ab3006 fpspreadsheet: Show/hide sheet grid lines and col/row headers for ods reading and writing. Incl test case (passed)
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3207 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-06-20 19:07:35 +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
6905fc5069 fpspreadsheet: Split off currency from main ods number format building procedure.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3204 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-06-19 19:43:30 +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
cf4ce9f2fa fpspreadsheet: Fix regression in detection of decimal places for ods introduced by inconsistency of xml names in OpenDocument specification.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3191 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-06-18 07:44:02 +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