Commit Graph

59 Commits

Author SHA1 Message Date
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
97ded8dfab fpspreadsheet: Beginning to apply .ods formatting styles to cells
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3103 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-05-26 22:27:07 +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
934e210a4f fpspreadsheet: Fix incorrect dection of cell ranges when reading biff rpn formulas
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3090 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-05-24 18:20:30 +00:00
81093f647f fpspreadsheet: Improved reading of rpn formulas: replace "monster case instruction" for function parameter count by lookup table.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3088 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-05-24 17:11:05 +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
49e99a74b5 fpspreadsheet: Add reading of rpn formulas.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3082 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-05-23 13:16:01 +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
fb92d5a906 fpspreadsheet: Bug fixes for biff2 reading/writing for number formats
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3075 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-05-21 23:01:07 +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
47d624ab46 fpspreadsheet: Improved reading of results of functions returning strings, booleans, or errors. Optional tests in test suite producing an error when Excel reads the test file.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3050 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-05-16 08:17:49 +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
dae7caff9c fpspreadsheet: Improved format detection when reading biff files. Unit test without errors due to biff now again. Fix compilation error of other formats due to new NumFormatList.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3048 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-05-15 12:53:56 +00:00
283a28fabd fpspreadsheet: Fix crash of unit test. Still some number format detection issues.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3046 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-05-14 23:17:46 +00:00
c3f5600c0d fpspreadsheet: Read results of formulas that return strings
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3045 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-05-14 16:30:33 +00:00
c36a5e80ce fpspreadsheet: Building a number format list which allows to drop most of the restrictions of the previous versions like number of decimal places. New number format "nfCustom" which passes the format string directly to the file.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3044 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-05-14 15:24:02 +00:00
75f2a8c0a5 fpspreadsheet: Remove reading code for RK and MULTRK records from xlsbiff5 and xlsbiff8, use the xlsbiff8 versions in xlscommon. --> Formatting of RK and MULRK works now for biff5 as well.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3042 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-05-11 16:45:42 +00:00
e00fedff8b fpspreadsheet: Add reading support for MULBLANK records (BIFF5 and BIFF8)
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3034 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-05-09 22:37:05 +00:00
f0928db9f5 fpspreadsheet: Row heights now can be saved to all biff versions. Add unit test case for row heights, ok. Bug fixed in BIFFExplorer with format detection.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3019 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-05-07 18:31:27 +00:00
9a1296eeb0 * Cosmetic: comment translation
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3013 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-05-07 10:13:38 +00:00
2b601f687c fpspreadsheet: Write SELECTION records (but does not fix BIFF2 frozen col/row issue). Fix issue of BIFFExplorer with BIFF2 PANE records.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3011 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-05-05 23:05:08 +00:00
707f64e511 fpspreadsheet: Fix show/hide gridlines/headers issue of BIFF2 by adding WINDOW1 record. Move WINDOW1 record of BIFF5-BIFF8 to xlscommon. Add test cases for BIFF2. ok.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3008 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-05-04 20:01:21 +00:00
3e6fce3a29 fpspreadsheet: Add unit test cases for pane support and showing/hiding of grid lines and sheet headers (write/read of BIFF5 and BIFF8). Passed.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3006 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-05-04 19:08:17 +00:00
482eac242a fpspreadsheet: Add support for frozen panes in BIFF5/BIFF8 (BIFF2 not working at the moment), fpSpreadsheetGrid, and BIFFExplorer.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3005 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-05-04 18:07:54 +00:00
e3446c2964 fpspreadsheet: improve auto row height behavior of fpspreadsheetGrid (remove property AutoRowHeights introduced a few revisions earlier, this is now determined from the value in the file).
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3003 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-05-03 20:12:44 +00:00
44c55efdbd fpspreadsheet: Add properties ShowGridLines, ShowHeaders, Selected to Worksheet to interface with fpSpreadsheetGrid. Read/write to xls file.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3002 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-05-03 19:07:55 +00:00
b93d9eae0c fpspreadsheet: Add linestyle and linecolor as attributes to cell borders. Works in BIFF8 and BIFF5 (BIFF2 does not support this). Add corresponding unit test cases -> passed.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@2999 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-05-03 17:00:00 +00:00
d777029bec fpspreadsheet: Move writing of BLANK and NUMBER records from xlsbiff5 and xlsbiff8 to xlscommon. No regression.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@2990 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-05-02 19:55:55 +00:00
3eac7b8066 fpspreadsheet: Move "AddDefaultFormats" to xlscommon. No regression.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@2989 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-05-02 19:02:24 +00:00
1676d31702 fpspreadsheet: Add date/time reading/writing support to BIFF2 and the corresponding "write-read" unit test cases. Passed.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@2988 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-05-02 18:49:05 +00:00
cb00cea75a fpspreadsheet: Rearrange code in xls* units to inherit TsSpreadBIFF2Reader from TsSpreadBIFFReader (instead of TsCustomSpreadReader) and to reduce duplicated code
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@2985 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-05-01 21:47:41 +00:00
70f1d5c5e8 fpspreadsheet: Implement number/datetime format support for BIFF5 reading/writing (like BIFF8)
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@2979 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-04-30 21:07:41 +00:00
34db575967 fpspreadsheet: Implement text rotation for BIFF5. Add text rotation test cases for BIIF5 and BIFF8 (no text rotation in BIFF2 by design). Pass.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@2974 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-04-27 15:59:16 +00:00
7c2851cd98 fpspreadsheet: Add most of the BIFF8 features to BIFF5. Add test cases for BIFF5 --> pass. Move more shared code from xlsbiff5 and xlsbiff8 to xlscommon. Update wiki.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@2971 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-04-25 22:15:26 +00:00
c174566e55 fpspreadsheet: Some refinements with color handling:
- Add some more colors to the default palette, remove the duplicate base colors
- Introduce type TsColorvalue for the rgb color values
- At init, automatically convert big-endian color values to little-endian
- Add TsWorkbook.SetColorValue to replace a palette color
- Add testing of random palette to colortests
- Add color test for BIFF2 (font only, because background color cannot be changed by design)

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@2962 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-04-24 21:27:57 +00:00
f69a47c902 fpspreadsheet: Add/complete color support for biff2 and biff8, reading and writing. Display colors in fpspreadsheetgrid.
Remove parameter AData in several methods of the readers/writers and replace it by FWorkbook passed at creation.
Add unit tests for font and color support. No issues.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@2960 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-04-23 22:29:32 +00:00
c61e4418b7 fpspreadsheet: Add reading and writing of font support to biff8, biff2, and fpspreadsheetgrid. Font colors in biff2 not yet working. No test cases yet.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@2959 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-04-22 23:10:32 +00:00
f7f1b0f12a fpspreadsheet: Add support for empty cells to all BIFF formats (needed for formatting of empty cells).
Fix painting error of cell borders in fpspreadsheetgrid.
Add/complete reading/writing support for horizontal alignment, cell background and cell borders to BIFF2.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@2958 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-04-21 21:43:43 +00:00
b8c1cf2961 fpspreadsheet: Add support for reading background colors in biff8 and fpspreadsheetgrid.
Add automatic test case for colors (fails since some colors are not yet written correctly, fails also for blank cells which are not yet read).

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@2956 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-04-20 21:51:12 +00:00
be497cb19e fpspreadsheet: Add support for horizontal and vertical text alignment in cells for biff8 and fpspreadsheetgrid.
Fix failure to reckognize file format in case of uppercase filename.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@2955 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-04-20 20:31:36 +00:00
8c90f30c66 fpspreadsheet: Add reading of row heights for biff8.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@2952 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-04-20 14:57:23 +00:00
27498ff548 + Add support for more/easier RPN formulas in XLS
- Allow relative cell references in RPN formulas
- Simplify generation of RPN formulas by using nested function calls
- Add writing of cell ranges for formulas in BIFF2/BIFF5
- Simplification of code e.g. by replacing the huge case instruction in TsSpreadBiffWriter.FormulaElementKindToExcelTokenID by a look-up table.
Fixes mantis issue #25718; patch by wp; thanks a lot!



git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@2931 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-04-08 09:48:30 +00:00
7f7d07f151 + Add support for text/number/date formats in BIFF8/xls.
+ Add support for writing out date/time to non-BIFF8 xls (though as text only for now)
  Slightly modified patch by wp, thanks a lot. 
  See
  http://forum.lazarus.freepascal.org/index.php/topic,22940.msg136761.html#msg136761

Still to do: add test cases for invalid format strings



git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@2863 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2013-12-22 14:02:04 +00:00
abd8d0bea8 + Add date/time/datetime read/write support for BIFF8 xls format. No plans for earlier formats though the code could be adapted
+ XLS BIFF8: added DATE and TIME worksheet functions to RPN formula
* Allow writing formulas,numbers etc using cardinals increasing row/column limits for formats that support it.
* Add checks for text cell size limits when writing xls, xml. If exceeded, cell text will be truncated (better than corrupting the xls file - e.g. try to open it with Excel 2002 - as happens now with xls format)
* Formats that use fpspreadsheet zip have extra checks to prevent crashes for invalid zip dates
+ Use FPC built-in zip format when using FPC 2.7.1+ as it has fixes/improvements (e.g. zip64 support)
+ Added FPCUnit test suite to test reading and reading writing files. For now uses BIFF8 xls; contributions for other formats and more tests welcome. See the tests subdirectory.
+ Add link to msodumper tool for reference/debugging/troubleshooting .xls output

Fixes Mantis bugtracker issue #25388



git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@2857 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2013-12-07 13:42:22 +00:00
e70e659419 fpspreadsheet: Greatly improves the biff8 formula writing, now supports ABS and fixed =Cell+Cell
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@2674 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2013-02-12 12:13:49 +00:00
60f89d3bfa fpspreadsheet: Minor improvement of encoding support
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@2411 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2012-04-29 15:21:12 +00:00