Commit Graph

480 Commits

Author SHA1 Message Date
5550b90704 fix: infinite loop due to hidden row in XLSX.stream.to_json (#3178)
**Title:**

Fix for Incorrect Row Indexing and Infinite Loop in stream.to_json Function

**Description:**

This pull request addresses two key issues in the `stream.to_json` function of the SheetJS library:

1. **Infinite Loop**: Previously, when a row was hidden, the function skipped processing the current row without incrementing the row counter `R`, resulting in an infinite loop during execution.

2. **Incorrect Row Indexing**: The row index was incorrectly accessed using a one-based index, whereas the actual row index was zero-based. This led to unintended hidden rows being included in the stream and skipping of subsequent non-hidden rows.

**Changes:**

- Modified the hidden row check to use the correct zero-based indexing
- Incremented `R` after identifying a hidden row to ensure the loop progresses to the next row.
- Ensured that the stream correctly processes all rows, skipping hidden rows without affecting subsequent rows.

**Testing:**

- Validated that the `stream.to_json` function no longer enters an infinite loop when encountering hidden rows.
- Confirmed that the correct rows are processed and pushed to the stream, with hidden rows being appropriately skipped.

**Impact:**

This fix enhances the reliability of the SheetJS library, ensuring accurate data streaming from spreadsheets without infinite loops or incorrect row handling.

**Checklist:**

- [x] Code changes have been tested locally.
- [x] The changes adhere to the project's coding standards and guidelines.

**Additional Information:**

These changes are crucial for maintaining the library's functionality in production environments, where precise data handling is essential.

**References:**

Closes #3176.

---

Reviewed-on: sheetjs/sheetjs#3178
Co-authored-by: deepak-negi-web <deepak-negi-web@noreply.git.sheetjs.com>
Co-committed-by: deepak-negi-web <deepak-negi-web@noreply.git.sheetjs.com>
2024-08-21 05:34:31 +00:00
9368a85b5f XLSX encoded entities (fixes #3177)
- HTML DOM ingress support formulae (`data-f`)
- Sheet Visibility for ODS / FODS (fixes #3162)
2024-08-19 12:43:37 -04:00
b61eed74fc do not bail when XLS properies cannot be parsed 2024-07-17 14:23:02 -04:00
8a7cfd47bd version bump 0.20.3 2024-07-12 11:47:14 -04:00
f215b8f79f merge nits (fixes #3142 h/t @s-ashwin ) 2024-07-11 01:33:25 -04:00
5a36cb423d NaN and Infinity error export
- `read` handle `Int8Array` (to support Java engines)
- `sheet_to_formulae` option to suppress values
- handle unexpected `<charset/>` (fixes #3143 h/t @dearzubi)
2024-07-04 15:54:34 -04:00
5ef49e2b96 XLML Streaming Write
- CSV Export only quote leading ID (fixes #2959)
2024-05-31 03:16:53 -04:00
947a5178bd ssf format NaN and Infinity values 2024-04-27 19:49:12 -04:00
a0bed2a97d version bump 0.20.2
see https://regexide.com for more details
2024-04-04 21:30:28 -04:00
0941ff97a3 dta v0.0.2 2024-03-22 00:39:09 -04:00
e4a66516e4 remove flow array comment workarounds
- XLSB use #REF! for unsupported defined name ref (fixes #3059 h/t @NenadC2)
2024-02-02 01:52:14 -05:00
d4d4ff3da2 SYLK error cells read/write (fixes #3049) 2024-01-10 04:54:10 -05:00
29d46c07a8 version bump 0.20.1 2023-12-05 03:19:42 -05:00
9199c2600c dta initial 2023-11-13 06:13:07 -05:00
ad0fb7766b import and export blank worksheets 2023-10-17 04:53:37 -04:00
4cc980975b QPW string formula results
- mujs-compatible regices
- NUMBERS use row offsets (fixes #3009 h/t @relaxsnow)
2023-10-15 23:03:39 -04:00
432ac1fda7 xlsx-cli v1.1.4 2023-10-11 16:22:42 -04:00
248108b667 dense types 2023-09-21 04:12:13 -04:00
julitork
766fc4f4d2 allow rawNumber override raw option 2023-08-29 16:04:32 +03:00
485a4f30f1 set CSV formula cell value to raw fmla text 2023-08-23 13:38:14 -04:00
955543147d version bump 0.20.0 2023-06-23 05:48:47 -04:00
36c5b7c0f5 NUMBERS read/write threaded comments 2023-06-14 03:47:51 -04:00
6e260c9185 cell comments
- `sheet_to_json` handle arrays (h/t AaronWoodrow)
- XLS parse comment visibility (h/t Godrules500)
- chrome manifest v3 writeFile support
- raw v8 (no TextEncoder/TextDecoder) optimization
- handle empty shared formula body (h/t florian)
2023-06-13 00:49:18 -04:00
d3a480750b NUMBERS read/write external links 2023-05-13 01:23:26 -04:00
5b33acfaf4 parse self-closing text:p uof:文本串 (fixes #2927) 2023-04-30 03:57:30 -04:00
b68eaed726 Export NaN/Infinity to error cells (fixes #2897) 2023-04-23 03:58:36 -04:00
333e4e40f9 version bump 0.19.3 2023-04-17 23:39:28 -04:00
af8e3d9171 build fixes for macOS Ventura 2023-04-14 03:51:02 -04:00
Vsevolod Kokorin
dca90c8024 XLSX Ensure comment address is valid 2023-04-12 03:48:54 -04:00
c06a32043f Add ESM helper methods to CJS build (fixes #2909) 2023-04-10 01:15:44 -04:00
ffbea71bc2 XLS ExternSheet record (fixes #2907) 2023-04-05 15:34:55 -04:00
16dd8a6eae UTF16LE sans codepage (fixes #2898 h/t @brismuth) 2023-03-15 04:17:09 -04:00
0577bb7a45 version bump 0.19.2 2023-01-25 16:17:34 -05:00
e9cf1ad0fb ignore unexpected attributes in rich text part
Co-authored-by: colin4 <colin4@noreply.sheetjs.com>
2023-01-04 12:35:13 -05:00
51a8619000 version bump 0.19.1 2022-11-17 04:35:34 -05:00
df48489211 Numbers 12.2 skip ActivityStream.iwa 2022-11-06 21:58:41 -05:00
050f66ce1b version bump 0.19.0 2022-10-23 21:05:59 -04:00
2f329b64e2 DBF truncate numeric fields 2022-10-04 20:09:43 -04:00
654d6f98c3 stringify all 's' cell values (fixes #2795) 2022-09-28 23:08:10 -04:00
Evan Bovie
1ca49a50bd
add display property to XLSX hyperlinks (#2791)
Resolves import bug in Google Sheets
2022-09-23 13:36:38 -04:00
81b231d866 version bump 0.18.12 2022-09-22 05:06:45 -04:00
1491302aa4 package.json exports types 2022-09-21 18:17:14 -04:00
bd5878e7c7 NUMBERS write up to ALL1000000 (h/t @masaccio) 2022-09-20 01:35:34 -04:00
6a5be04e3d Ś╫êëτ⌡ś and Š╫ěéτ⌡š 2022-09-09 16:59:22 -04:00
e90a61bf09 version bump 0.18.11 2022-09-06 02:18:12 -04:00
26cbfe37be DBF write encoding (fixes #2781 h/t @ZJS248) 2022-09-06 00:02:39 -04:00
df0e7b5f25 NUMBERS duration cell number format 2022-09-04 17:51:49 -04:00
6c9010f9d1 comment fallback (fixes #2779 h/t @AbhinanduReddy) 2022-09-02 03:30:10 -04:00
0a6ddcaf44 removed sheet_to_dif IIFE 2022-08-30 03:00:32 -04:00
045adba80d parse ZIP64 length (fixes #2766 h/t @silvialeung) 2022-08-21 20:51:51 -04:00