Commit Graph
1344 Commits
Author SHA1 Message Date
FredApps 894bb14be2 Integrate the contributor page-range controls with current GridCraft printing 2026-12-02 23:21:15 +01:00
MaciekandMaciej Malinowski 80e5bf2857 formula: Polish formula language (FormulaLocale::Pl) (#1883)
* formula: Polish formula language (FormulaLocale::Pl)

- FormulaLocale::Pl: all 434 functions whose Polish Excel name differs, in
  crates/formula/src/input/pl.rs. Names come from PhpSpreadsheet's pl table
  (MIT) cross-checked with a second independent table; where they disagree
  or are missing, Microsoft's pl-pl pages decide, and the names #1678
  observed in Excel for the web fill the rest. Polish keeps MAX (only
  MAXIFS is MAKS.WARUNKÓW).
- PRAWDA/FAŁSZ, `;` argument and `\` array-column separators, decimal comma.
- Polish error values on entry and display (#DZIEL/0!, #N/D, #ARG!,
  #ROZLANIE!, #OBL!...); #N/D! and English spellings stay accepted.
- Table specifiers (#Wszystko, #Dane, #Nagłówki, #Sumy, #Ten wiersz) with
  ';' between bracketed parts.
- The locale tables are generalised (aliases()/boolean_names()) instead of
  hard-coding Spanish, and the parser keeps the locale instead of an `Es`
  flag; names are compared with the shared same_name, so `jeżeli` matches
  `JEŻELI` and a LET name `fałsz` is matched by `FAŁSZ`. Spanish behaviour
  is unchanged.
- Function help follows the interface language, as on main: Polish
  descriptions and argument names belong to the Polish catalog (#1807).
- Tests: crates/formula/tests/polish_input.rs and
  crates/calc/tests/polish_function_names.rs (every Polish name belongs to a
  known function and none shadows an English one).
- Docs: ROADMAP.md and docs/localization-parity.md.

The Polish interface language (on main since #1091) selects the locale:
Language::formula_locale maps Pl to it.

* formula: credit PhpSpreadsheet for the Polish function name table

The English-to-Polish name table in crates/formula/src/input/pl.rs comes
from PhpSpreadsheet's locale/pl/functions (MIT). ATTRIBUTION.md now lists
it in the same form as the CLDR region data, and NOTICE carries
PhpSpreadsheet's MIT licence text verbatim. The second table the names
were checked against was only a cross-check, and nothing was copied from
it; the module comment now says so.

---------

Co-authored-by: Maciej Malinowski <[email protected]>
2026-12-02 10:11:27 +01:00
FredApps 4434e3bd05 Merge main into feat/table-auto-expansion 2026-12-02 07:05:01 +01:00
FredApps 3547cd1593 Merge main into fix/linux-titlebar-adwaita
# Conflicts:
#	Cargo.lock
2026-12-02 11:57:57 +07:00
FredApps d176602488 Merge pull request #3407 from alosslessdev/dax/eval-aggregation
dax: aggregation, logical, information and model-info functions (#2228)
2026-12-02 00:43:18 +01:00
Aleksander HelgakerandClaude Opus 5.5 226a5d3d26 Print: sheets left out of whole-workbook printing (ODS groundwork) (#4104)
* Print: sheets left out of whole-workbook printing

PrintSettings gains `excluded` (serde default false, not written when
false). Printing or exporting the whole workbook (`sheets: all`) skips a
sheet marked excluded, unless every visible sheet is, in which case they
all print, as LibreOffice does with an OpenDocument sheet set not to
print (`table:print="false"`). Printing the active sheet alone is
unaffected. `pageLayout.pageSetup {excluded: bool}` sets it, in one undo
step with the rest of Page Setup.

Excel has no such flag, so XLSX neither reads nor writes it.

* Print: excluded active sheet is not the blank fallback; explicit range prints

Review follow-up. With `sheets: all`, when every printable sheet was
blank the fallback page came from the active sheet even if it was left
out of workbook printing; it now comes from the active sheet only when
that sheet would print, else the first sheet that would. A `range` given
for the active sheet is asked for explicitly, so that sheet prints even
when excluded (it was silently dropped).

* Print: every sheet excluded prints them all, also with a range

Review follow-up. With `sheets: all` and a `range`, the range exception
kept the active sheet among the printed ones, so the "every visible
sheet is excluded, all print" rule never applied and only the active
sheet printed. That rule is now decided first.

* Save: ask before XLSX drops a sheet's print exclusion, and report it

XLSX can't hold PrintSettings::excluded, and Save and Save As dropped it
silently. A save from the interface now asks first and offers a GridCraft
workbook (.json), AutoSave waits for that answer, and file.save,
file.saveAs and file.saveBytes return what was lost as `warnings`, which
the CLI prints. Saves that lose nothing are unchanged.

* Save question: one pending save says what was asked, by which workbook, and what follows

The question about what a save would lose kept loose dialog values and
acted on whatever was active when it was answered. It now holds one
PendingSave: the workbook that asked, the save as it was run, exactly
which sheets lose something, and the close or quit that waits for it.

- Save As with no path is asked about the file that is picked, so it
  never writes the workbook's own file.
- Another workbook is never saved or agreed to; ui.dialog.set can't
  change the save behind the question.
- Agreeing is to the sheets themselves, not to the text that names some.
- A question that replaces another takes its close and quit along.

* AutoSave: the hold notice goes when the hold ends

The hold lasts while AutoSave is on and the workbook has changes whose
loss was not agreed to. When it ends, its notice and its entry go, so a
later hold on the same sheets is said again. Other notices stay.

* CLI: print file.saveBytes warnings too

Review follow-up. `file.saveBytes` returns `warnings` like Save and
Save As, but the CLI printed only theirs, so `run --quiet` with a
saveBytes command hid what the .xlsx encoding lost.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Save loss: ask again when the workbook's file changed meanwhile

A held plain Save took the workbook's path when answered, so if the file
changed while the question was open, Save Anyway wrote a file nobody was
asked about. The question now records the file it is about and asks again
for the new one.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
2026-12-01 11:29:43 +01:00
Aleksander HelgakerandFredApps 585970c542 formula: printer dialects and parsing from tokens (ODS groundwork) (#4135)
* formula: printer dialects and parsing from tokens

A `Dialect` trait states how another formula syntax spells references,
names, structured references, functions, booleans, separators, operators
and operator-less unary forms; `print_with(&Expr, &dyn Dialect)` prints
through it. `print` and `print_r1c1` are the A1 and R1C1 dialects, so
Excel output is byte-for-byte unchanged.

`parse_tokens(Vec<Token>)` builds an `Expr` from another tokenizer's
tokens with this grammar (capped at MAX_FORMULA_LEN tokens), and
`Tok::Ref` carries a reference that tokenizer has already read.

Groundwork for reading and writing OpenFormula in ODS files.

* formula: bound parse_tokens input like text; document Dialect methods

parse_tokens refuses a Tok::Ref off the grid (rows or columns past
Excel's limits) and token text (strings, names, sheet names, structured
bodies) longer than MAX_FORMULA_LEN in all, as formula text is bounded.
Range ends keep their order, as the text parser keeps `B2:A1`. The doc
says OpenFormula's `~` union is not read here.

Tok is #[non_exhaustive] now that other tokenizers can need new kinds;
no match outside the crate is exhaustive. Dialect::boolean, separators
and operator have doc comments.

* formula: parse_tokens refuses non-finite numbers, early Eof, empty sheets

A Tok::Number that is NaN or infinite is refused as the A1 lexer refuses
it (it printed as `0`, changing the value). An Eof before the last token
is an error instead of silently dropping what follows. A sheet name in a
Tok::Ref or Tok::Sheet may not be empty.

* formula: parse_tokens refuses words the A1 tokenizer would not read

A Tok::Word or Tok::Func must be what the A1 tokenizer reads from its
text (re-lexed and compared): an empty one, or `A!1`, `TRUE`, `a b`,
printed as text that would not parse back. An empty structured
reference body stays accepted: text reads `[]` the same way. Tests also
cover an empty second sheet name in Tok::Sheet.

* formula: parse_tokens refuses trees that would not print back; nesting bound as text

Review round fixes (after merging main):
- Apply main's whole-tree wrapper-height bound (#3813) to parse_tokens through a
  shared finish step; a token stream of stacked `(..)%%%` levels was accepted.
- Drop spaces that are not between two operands, as text does; `Tok::Ref` now
  counts as an operand for the intersection.
- Refuse negative numbers (`-1` reads back as a negation), sheet names holding
  `:` (they read back as a span), `Tok::Trim` (no OpenFormula form, and most
  shapes have no text form), and a word directly before `(`.
- The TRIMRANGE fallback is named through `Dialect::function`.

* formula: parse_tokens checks that the tree prints back as itself

Second review round. Correcting the first round's piecemeal checks, which
missed operands of `:` that regroup or change kind when printed:
`A1` `:` `B2:C3` printed as `A1:B2:C3` (read back as `(A1:B2):C3`), a
sheet-qualified right side read back as a 3-D span, `1` `:` `3` read back
as rows, and a row range before an intersection space printed text that
does not parse.

parse_tokens now prints the tree and parses that text back, refusing the
tokens unless the same tree returns. Numbers are compared as they print
(15 significant digits), so a longer literal is still read as given. The
earlier checks stay for their precise messages. The printed text is
bounded as typed text is, so a string that fits only without its quotes is
refused.

---------

Co-authored-by: FredApps <[email protected]>
2026-12-01 11:21:16 +01:00
Aleksander HelgakerandClaude Opus 5.5 4d94d3e27c Data: paste or import clipboard text as columns (Get Data › From Clipboard…, Paste Data…) (#4839)
* feat(data): paste or import clipboard text as columns

Data › Get Data (Text/CSV) becomes a split button. Its menu adds
From Clipboard…, and the cell menu adds Paste Data… after Paste
Special…. Both open a dialog that asks for the separator (comma,
semicolon, tab, space or another character), starting on the one the
text uses. From Clipboard imports into a new sheet as a table, and
Paste Data pastes the columns at the clicked cell. The dialog imports
the text it read when it opened, and Paste Data names the sheet with
its cell.

- data.fromTextCsv: `at` pastes at a cell, Sheet!-qualified or on the
  active sheet. Without a delimiter, craft-csv's sniffer picks comma,
  semicolon or tab. JSON records are read only when no delimiter is
  given. The delimiter must be one character other than a quote or
  line break, up to U+00FF. The reader's cells are written with their
  number formats, so dates and percents keep them and formula-looking
  text stays text.
- data.fromClipboard (UI command): the same with the system clipboard.
- Key tips: Alt/F10, A, P, N opens the Get Data menu with G and C
  (APNC is new). Up/Down in a menu key tips opened moves focus onto
  its items, wrapping at the ends. Enter runs the focused item without
  also confirming what it opens.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(data): clipboard import review fixes and rustfmt

- Paste Data's destination is a "Paste at" reference box holding the
  selection's top-left cell, the cell Paste uses. As in the other
  dialogs with reference boxes, OK shows the dialog's own sheet again
  first, found by its uid, and is refused once that sheet is deleted.
- A paste at a cell covers every field of the text, trailing blank
  fields and records included, so they clear the cells under them.
  read_csv_with_report now reports the record count and the widest
  record.
- CSV dates are read as serials of the destination workbook's date
  system (1900 or 1904).
- The first arrow into a key-tip menu cancels the focus move egui had
  already queued, so it lands on the first item even when a ribbon
  button was focused.
- cargo fmt.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(data): Paste Data refuses rows past the sheet and clears all-blank text

- read_csv_with_report reports `truncated` when the text has records
  past a sheet's last row. A paste at a cell refuses such text before
  writing anything, instead of dropping the rest. Text with exactly
  MAX_ROWS records still pastes.
- A paste at a cell uses the text's record extent even when it has no
  non-empty field, so text like `,` clears the cells it covers instead
  of failing as an empty file.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(data): Paste Data refuses text wider than a sheet

The CSV reader keeps one field past MAX_COLS per record, so a wider
record can be told from one that fits, and reports it as `truncated`,
as it does records past the last row. A paste at a cell refuses such
text before writing anything; text exactly MAX_COLS fields wide still
pastes. Importing into a new sheet still keeps the first MAX_COLS
fields, as before.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(data): read bracket-led text without a separator as delimited text

From Text/CSV, Get Data and From Clipboard read any text whose first
character is `[` as JSON when no separator was given, so delimited text
whose first field is bracketed (`[Draft];Oslo`) was rejected with a JSON
parse error. Text is now read as records only when it parses as a JSON
array of objects; anything else goes to the delimited reader, which picks
the separator by the text.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
2026-12-01 10:54:16 +01:00
ruchirguitar 838c9104c0 docs: one script-fallback paragraph in localization-parity.md
Drops the repeated Lao list and the stale 'no complex-text shaping'
sentence, which contradicted the Indian-script text.
2026-11-29 21:26:35 +05:30
ruchirguitarandkulveersingh 44b8fc5b52 fonts: Indian-script shaping test accepts a ligated split vowel; docs
Nirmala UI draws Tamil கொ as one ligature rather than the vowel sign on
both sides of க, which is also shaped. The test now fails only when the
text comes out one glyph per code point. localization-parity.md lists
the Indian-script fallback faces and no longer says Devanagari is
unshaped.

Fixes #4131.

Co-authored-by: kulveersingh <[email protected]>
2026-11-29 21:09:57 +05:30
FredApps ba597305a1 Merge pull request #4140 from alehel/split/text-defaults
Model: workbook text defaults: languages, Asian and complex fonts (ODS groundwork)
2026-11-27 23:29:47 +01:00
FredApps b742816737 parity: headless column from the engine registry (RFC-0052) (#4860) 2026-11-27 23:14:07 +01:00
Claude 3c9fc0d7c2 Merge branch 'main' of https://github.com/storytold/gridcraft into ccr-64df7fff-37m0oz
# Conflicts:
#	docs/target-app-parity.md
2026-11-26 23:57:03 +00:00
alehelandClaude Opus 5.5 6868b7eb7b Merge storytold/gridcraft main into split/text-defaults
Main now reads GridCraft JSON through craft_gridcraft_format::read. That
reader deserialises the model with its own serde rules, so text_defaults
loads as before; the zero-sheet reset keeps carrying the macros and the
text defaults across.

Conflicts:
- crates/model/src/lib.rs: the re-export list takes both main's RefHost
  and WriteReservation and this branch's ScriptDefault and TextDefaults.
- docs/file-format-parity.md: main's header and history, with this
  branch's 2026-11-14 row placed among main's 2026-11-14 rows and its
  summary added to the header's "earlier" list in the same place.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-27 00:49:22 +01:00
FredApps 94cb40be98 Merge branch 'main' into fix/pivot-chart-series 2026-11-26 23:10:27 +01:00
FredApps 33e37398fd Merge branch 'main' into csv-sep-line 2026-11-26 22:57:27 +01:00
FredApps 7807aaed67 Merge main into the PivotChart cache branch 2026-11-26 22:44:18 +01:00
FredApps b55ea8acd3 Merge branch 'main' into PR #2270
# Conflicts:
#	docs/file-format-parity.md
2026-11-26 22:36:39 +01:00
FredApps 6fba6d3688 Merge branch 'main' into fix/pivot-refresh-fidelity 2026-11-26 22:32:36 +01:00
FredApps 989a267cb0 Merge branch 'main' into PR #259
# Conflicts:
#	docs/target-app-parity.md
2026-11-26 22:26:18 +01:00
FredApps 996c7ba467 Merge branch 'main' into charts/keep-unedited-chart-xml 2026-11-26 22:22:37 +01:00
FredApps 088f9193a8 Merge branch 'main' into i18n-vi 2026-11-26 22:20:13 +01:00
FredApps 89bf004226 Merge branch 'main' into perf/xtask-bench 2026-11-26 22:06:30 +01:00
FredApps abee6d6926 Merge branch 'main' into i18n-vi 2026-11-26 21:42:35 +01:00
FredApps 072493baec Merge branch 'main' into i18n/split-add-comma 2026-11-26 21:29:29 +01:00
FredApps 3852c2335a Merge main into the Vietnamese catalog branch 2026-11-26 21:17:20 +01:00
FredApps 04720627bd Merge main into the bench branch 2026-11-26 21:15:32 +01:00
FredApps b8cd3891fb Merge branch 'main' into PR #2270
# Conflicts:
#	docs/file-format-parity.md
2026-11-26 20:34:27 +01:00
FredApps 2469308bf6 Merge branch 'main' into PR #2404
# Conflicts:
#	ROADMAP.md
2026-11-26 20:34:18 +01:00
FredApps c5e735410a Merge branch 'main' into PR #2371
# Conflicts:
#	ROADMAP.md
2026-11-26 20:34:10 +01:00
FredApps 728f639332 Merge main into the PivotChart cache branch 2026-11-26 20:33:43 +01:00
FredApps eb73335d12 Merge branch 'main' into gc-a24-password-to-modify 2026-11-26 20:17:42 +01:00
FredApps 2fbd3585af Merge branch 'main' into PR #2371
# Conflicts:
#	ROADMAP.md
2026-11-26 20:11:17 +01:00
FredApps e3f897ce7e Merge branch 'main' into PR #2508
# Conflicts:
#	ROADMAP.md
2026-11-26 20:11:00 +01:00
FredApps 2514c099b1 Merge branch 'main' into feat/chart-100-stacked-line 2026-11-26 20:06:17 +01:00
FredApps 24a0ce5a67 Merge main into the keep-chart-xml branch 2026-11-26 19:59:54 +01:00
FredApps a5039ec907 Merge main into the write-reservation branch 2026-11-26 19:58:21 +01:00
FredApps c08f843218 Merge branch 'main' into PR #2270
# Conflicts:
#	docs/file-format-parity.md
2026-11-26 19:45:43 +01:00
FredApps a99895c037 Merge branch 'main' into PR #2371
# Conflicts:
#	ROADMAP.md
2026-11-26 19:45:31 +01:00
FredApps 41b8ec1218 Merge branch 'main' into PR #2398
# Conflicts:
#	ROADMAP.md
2026-11-26 19:45:12 +01:00
FredApps 55a9a23d04 Merge main into print-selection 2026-11-26 19:31:48 +01:00
FredApps dbc919b3f7 Merge branch 'main' into gc-pivot-data-model-caches 2026-11-26 19:31:03 +01:00
FredApps e59e03cd9e Merge branch 'main' into gc-irr-xirr-excel-solver 2026-11-26 19:24:05 +01:00
FredApps 74b93f3766 Merge branch 'main' into PR #2270
# Conflicts:
#	docs/file-format-parity.md
2026-11-26 19:19:16 +01:00
FredApps 1dbd8db607 Merge branch 'main' into PR #2404
# Conflicts:
#	docs/file-format-parity.md
2026-11-26 19:19:07 +01:00
FredApps 501fca9eb5 Merge branch 'main' into PR #2499
# Conflicts:
#	docs/file-format-parity.md
2026-11-26 19:18:44 +01:00
FredApps 23d0784b11 Merge branch 'main' into fix/2641-cascading-autofilter-values 2026-11-26 19:10:55 +01:00
FredApps 22b85c371f Merge branch 'main' into PR #2371
# Conflicts:
#	docs/ui-parity.md
2026-11-26 19:02:12 +01:00
FredApps 271ece082d Merge branch 'main' into PR #2672
# Conflicts:
#	docs/ui-parity.md
2026-11-26 19:01:51 +01:00
FredApps cc92d8a941 Merge branch 'main' into split/paper-table 2026-11-26 19:01:45 +01:00