Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ The release run heads these entries with the version and opens a fresh

## Unreleased

- An ODF `draw:object` chart is drawn from the chart part's own markup, not
from the replacement image beside it: bar, line, area, scatter, pie and ring,
with their titles, legends, axes and series colours. An object holding no
chart we can read keeps the replacement. Closes #179.

- An ODF custom shape is drawn as the shape its `draw:enhanced-geometry`
describes rather than as its bounding box: `draw:enhanced-path`,
`draw:equation`, `draw:modifiers` and the two mirror attributes. Closes #159.
Expand Down
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ set(ODR_SOURCE_FILES
"src/odr/internal/markdown/markdown_parser.cpp"
"src/odr/internal/markdown/markdown_style.cpp"

"src/odr/internal/odf/odf_chart.cpp"
"src/odr/internal/odf/odf_crypto.cpp"
"src/odr/internal/odf/odf_document.cpp"
"src/odr/internal/odf/odf_element_registry.cpp"
Expand Down
35 changes: 22 additions & 13 deletions src/odr/internal/odf/PLAN.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,15 @@ Closing #771: everything an ODF shape carries beyond its bounding box β€”
`draw:transform`, the shape elements with no parser, `draw:enhanced-geometry`,
and the `draw:object` chart. The module as it stands is in
[`AGENTS.md`](AGENTS.md); the feature checklist is [`README.md`](README.md).
Keep this file honest as stages land, and delete it when they all have.
Keep this file honest as stages land, and delete it when nothing is left
under *Today*.

## Today

`parse_any_element_tree` (`odf_parser.cpp`) knows nine drawing tags β€”
`draw:frame`, `draw:image`, `draw:rect`, `draw:line`, `draw:circle`,
`draw:custom-shape`, `draw:text-box`, `draw:g`, `draw:a`. Everything else falls
through its final `return {null_element_id, …}` and vanishes with its subtree.
`draw:custom-shape` reaches `html::translate_custom_shape` as a positioned
`<div>` with fill and stroke: the box, never the shape. `draw:transform` is not
read, so a rotated shape draws unrotated.
All five stages have landed. What is left is listed under each of them and in
[`README.md`](README.md): `draw:text-areas` and `draw:handle` on an enhanced
geometry, the arrowheads `draw:marker` names, `dr3d:scene`, and the chart
features below stage 5.

## The corpus

Expand Down Expand Up @@ -148,12 +146,23 @@ subpath painted differently from the rest.
`hasstroke` and `hasfill` are always true β€” the geometry reader has no style
in hand β€” and no corpus formula reads them.

### 5 β€” `draw:object` charts
### 5 β€” `draw:object` charts β€” landed

`<chart:chart>` in the embedded part, rendered from its series, axes and
`table:table` of plotted data, with the SVM replacement kept as the fallback.
Closes #179. Large enough to deserve splitting again if it grows; it shares
nothing with stages 1–4 but the `draw:frame` it hangs off.
`odf_chart.cpp` renders the embedded part's `<chart:chart>` to svg, and the
object reaches the renderer as an image carrying it, so the existing image path
writes it out. The `draw:image` beside an object is the replacement the producer
wrote, and is skipped where the object itself draws; an object with no chart we
can read β€” a formula, an ole blob β€” still leaves it. Closes #179.

Decisions: the plotted values come from the chart's own `local-table` rather
than the cells it names in the host document, which is the snapshot the part
carries and the only one an embedded chart is guaranteed; the layout comes from
`chart:plot-area` and `chartooo:coordinate-region`, so it matches what the
producer laid out rather than something we invent.

Open: stacked and percentage plots, secondary axes, trend lines, data labels,
and the number format an axis names β€” a date axis shows its serial number
today.

## Not scoped

Expand Down
7 changes: 7 additions & 0 deletions src/odr/internal/odf/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,13 @@ Roughly ordered by importance.
- [x] images
- [x] internal and external references
- [x] svm
- [x] embedded objects (`draw:object`)
- [x] charts (`chart:bar`, `line`, `area`, `scatter`, `circle`, `ring`),
drawn from the chart part's own `local-table` #179
- [ ] stacked and percentage plots, secondary axes, trend lines, data labels
- [ ] the axis number format (a date axis shows its serial number)
- [ ] `draw:object-ole` (an OLE blob, not ODF markup)
- [x] anything else falls back to the `draw:image` replacement
- [x] tables
- [x] column width, row height, table width
- [x] cell vertical alignment, background, padding, borders
Expand Down
Loading
Loading