Skip to content

Pptx: import OpenDocument .odp presentations - #524

Open
NikitkaRa wants to merge 1 commit into
storytold:mainfrom
NikitkaRa:odp-import
Open

NikitkaRa wants to merge 1 commit into
storytold:mainfrom
NikitkaRa:odp-import

Conversation

@NikitkaRa

Copy link
Copy Markdown
Contributor

Summary

  • New crates/pptx/src/odp.rs: file.open detects an OpenDocument presentation (mimetype) and imports it, then runs the usual repair pass
  • Pages become slides (Blank layout); page size from styles.xml
  • Text frames: title/subtitle/outline defaults, fonts, size, bold/italic/underline, colour, list levels and bullets, spaces/tabs/line breaks, fill/line/insets/anchor
  • Rectangles, ellipses, custom shapes (enhanced-geometry type → preset), lines with flips, pictures, flattened groups, draw:transform rotation/translation, speaker notes
  • Styles resolve through parent chains and default styles, with LibreOffice default colours
  • Docs: gaps.md entry is now import-only (masters, tables, charts, animations, save still to do), file-format-parity row updated
  • First slice only: saving still writes .pptx

Test plan

  • crates/pptx/tests/odp.rs builds an .odp in memory: checks slide count, page aspect, rich text, filled rotated ellipse, picture, notes
  • Unit test for length parsing
  • cargo xtask ci passes

First slice of .odp support: file.open sniffs an OpenDocument package and
imports pages as slides with text frames (fonts, bold/italic/underline,
colour, lists), rectangles, ellipses, preset custom shapes, lines,
pictures, groups (flattened), rotation and speaker notes. Styles resolve
through parent chains and default styles; page size comes from styles.xml.
Masters, tables, charts and animations are not imported yet, and saving
still writes .pptx.

Co-authored-by: Cursor <cursoragent@cursor.com>

@FredApps FredApps left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ReviewerA — source-read COMMENT (not an approval)

I read the head of the diff: OpenDocument .odp presentations can be imported. The engine sniffs the bytes (sniff_odp), imports through a new odp module in the PPTX crate and repairs the result with the common repair step, like other formats. An ODP is a ZIP of XML parts, so the importer is a parser for untrusted archives: entry counts, decompressed sizes and XML depth need bounds, external entities must not be resolved, and media inside must be bounded as for PPTX. ODF is an open standard, so the specification is the oracle. A sniff that decides by bytes, not by extension, is right. I did not read the importer. I have not run it, and no exact-head CI result exists for this head. Nothing was run.

I ran nothing and have no exact-head CI result for this PR, so this is not an approval. Where a diff was long I read its code hunks rather than every generated or documentation line.

Status: waiting_author.

@aiongg aiongg added the missing feature The reference application has it and we do not, or only part of it label Nov 4, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

missing feature The reference application has it and we do not, or only part of it

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants