Commit Graph

74 Commits

Author SHA1 Message Date
c335deb56c fpspreadsheet: Add currency test cases to numbertests. 1 fail for biff to be fixed, ods ok. Remove experimental code from opendocread.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3142 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-06-05 09:14:13 +00:00
292908eac3 fpspreadsheet: Add basic currency format support to ods reading. Replace xmlread and DOM in the uses clause of fpsopendocument.pas laz2_xmlread and laz2_DOM to correctly catch the currency symbols.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3141 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-06-05 08:29:32 +00:00
bac68e48c5 fpspreadsheet: Combine percentage format detection with other number formats (for ods)
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3140 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-06-05 07:58:18 +00:00
0aeefd619f fpspreadsheet: Fix remaining issue of ods-1904 datetests. All tests green finally again.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3139 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-06-05 07:39:16 +00:00
5542b1ac56 fpspreadsheet: Activate all disabled ods date tests & fix some more issues related to inconsistent formats by Open/LibreOffice -> done to 6 errors for 1904 datemode, that's probably the best we can get.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3138 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-06-04 22:11:17 +00:00
02190bc58c fpspreadsheet: Fix reading time interval format for ods
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3134 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-06-04 10:33:36 +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
56a39e6da2 fpspreadsheet: Apply cell style and number format for ods date/time cells. Still some issues in unit test.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3130 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-06-02 22:07:40 +00:00
09d9d95789 fpspreadsheet: Fix incorrect detection of number format with thousand separator in ods
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3128 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-06-02 19:33:02 +00:00
976e037770 fpspreadsheet: Improved detection of space separators in date/time formats. Generally valid, no modification of xmlread required. Side-effect: leading spaces of xml elements have to be skipped manually
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3122 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-06-01 18:59:29 +00:00
27967f5e66 fpspreadsheet: Fix workaround in previous commit which did not work.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3121 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-06-01 13:44:02 +00:00
6f96f3bcb6 fpspreadsheet: Add workaround for missing xml spaces to TsOpenDocReader.ReadNumFormats.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3120 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-06-01 13:08:14 +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
4dd961b590 fpspreadsheet: Writing and reading of horizontal and vertical text alignments in ods files. Add test cases. Pass.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3116 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-05-28 20:52:36 +00:00
d6907ceb0b fpspreadsheet: Writing of ods styles: Put xml code of the formatting fields into separate functions
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3115 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-05-28 19:26:08 +00:00
3ff4a1ab78 fpspreadsheet: Split subroutines off of main ods reading method to get shorter procedures.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3114 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-05-28 18:58:55 +00:00
e8f2524a91 fpspreadsheet: Reading of horizontal/vertical text alignment from ods files. Have to implement column styles to all formats correctly.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3113 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-05-28 16:23:50 +00:00
44072f2629 fpspreadsheet: Reading and writing of text rotation in ods files. Add test case. Passed.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3110 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-05-28 07:53:50 +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
4aa640489f fpspreadsheet: Add unit test for writing/reading of background color in ods. Passed.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3108 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-05-27 16:21:59 +00:00
11e09b888c fpspreadsheet: Read the background color of ods files. Background color of ods files is displayed in fpsGrid. Fix border partially not showing.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3107 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-05-27 13:58:57 +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
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
85e2de8340 fpspreadsheet: Read date/time number formats from ods (not applied, yet)
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3102 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-05-26 19:43:05 +00:00
d29219fc68 fpspreadsheet: Mark TsSpreadsheet.GetLastColNumber/GetLastRowNumber as deprecated, use GetLastColIndex/GetlastRowIndex instead.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3101 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-05-26 15:27:35 +00:00
f1a1a4474a fpspreadsheet: Fix issue http://mantis.freepascal.org/view.php?id=26221 (empty cells misplace following cells in .ods)
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3100 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-05-26 15:00:43 +00:00
070845d3ae fpspreadsheet: Add property "Name" to TsNumFormatData. When reading ods files consider also styles in "styles.xml".
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3099 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-05-26 08:03:36 +00:00
a4bc6fc8cf fpspreadsheet: Beginning to read number formatting styles from ods file (so far, just populating the number format list)
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3098 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-05-25 22:05:37 +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
db28686b2f Cosmetic
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3065 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-05-20 12:36:07 +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
887b34383a fpspreadsheet: Add font unit test for BIFF2. Currently fails. Need to investigate...
Fix occasional floating point conversion error in fpsopendocument because of non-initialized format settings.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@2963 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-04-24 22:31:01 +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
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
4f85834153 fpspreadsheet: Restructure reader/writer declarations to have in "public" only methods needed by the application
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@2957 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-04-21 11:30:22 +00:00
435cc15729 * Replace XLSDEBUG define for writeln debug output to FPSPREADDEBUG as it is used beyond just xls support.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@2932 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-04-08 09:53:02 +00:00
f95e48563a * OpenDocument .ods: tweaked support for reading time only fields introduced in r2908: fixes for 1899/1900/1904 date mode. Still needs more tweaks for 1904 date mode (and presumably 1900 as well)
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@2924 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-03-26 10:26:43 +00:00
cc13dd5c5f OpenDocument .ods:
* ignore invalid times



git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@2915 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-03-24 07:34:00 +00:00
12a4c4c07b * LibreOffice/ODS format: fix time-only calculations exceeding EncodeDate limits
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@2909 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-03-23 13:06:19 +00:00
b70f1be9c3 + OpenDocument .ods: initial support for reading time only fields. To do: needs additional support for 1900/1904 date mode.
+ OpenDocument: naive speed improvement for reading repeated rows/columns.



git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@2908 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-03-23 11:36:36 +00:00
400bf62aba * OpenDocument/OpenOffice/LibreOffice date/time read fix; code adapted from curtisnewton, thanks a lot! Fixes mantis issue #25585
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@2890 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2014-01-24 10:32:23 +00:00
018f05324b + Initial write date/time cell support for opendocument/OpenOffice/Libreoffice
To do: adjust test suite for .ods files



git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@2867 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2013-12-23 13:35:36 +00:00
6a4ff4c1c2 * Correction to r2863: use ISO 8601 format for WriteDateTime text output (currently every format except BIFF8 xls).
Ensures resulting files are interoperable regardless of OS locale settings, conforming to date/time cell support in BIFF8.



git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@2865 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2013-12-23 12:11:20 +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
238e173677 fpspreadsheet: Adds support for RGB colours
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@2750 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2013-06-12 11:02:02 +00:00
af3ee31a25 fpspreadsheet: Adds support to writing the formatting of formula and number cells in XLS
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@2671 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2013-02-12 11:29:19 +00:00
ca0980e0ed fpspreadsheet: Patch from bug 21400, adds date reading support to the ods reader
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@2599 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2012-12-11 16:46:25 +00:00
6962323c2e fpspreadsheet: OpenDocument: Adds support for word-wrap formatting option and fixes the styles setting for numeric cells
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@2463 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2012-06-13 07:21:00 +00:00
0ee4ede6b0 fpspreadsheet: Fixes using always point for numbers in OOXML and adds a solution to initialize the format settings in the constructor of the writer
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@2410 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2012-04-27 08:01:15 +00:00