Skip to content

Add is_page_break_before() to ParagraphRef and is_underline() to RunRef#4

Open
hanthor wants to merge 1 commit into
tensorbee:mainfrom
hanthor:add-read-methods
Open

Add is_page_break_before() to ParagraphRef and is_underline() to RunRef#4
hanthor wants to merge 1 commit into
tensorbee:mainfrom
hanthor:add-read-methods

Conversation

@hanthor

@hanthor hanthor commented Jun 23, 2026

Copy link
Copy Markdown

Summary

Adds two missing read-side methods to rdocx 0.1.2:

  • ParagraphRef::is_page_break_before() — reads CT_PPr.page_break_before
  • RunRef::is_underline() — reads CT_RPr.underline (returns true if any underline value is present)

These are needed by gtk-office-suite (a GTK4 word processor) to import DOCX files with preserved layout and formatting.

Changes

  • crates/rdocx/src/paragraph.rs: Added is_page_break_before() to ParagraphRef
  • crates/rdocx/src/run.rs: Added is_underline() to RunRef

Testing

  • cargo check -p rdocx passes
  • Downstream consumer (gtk-office-suite) compiles successfully with these methods

These read-side methods were missing from ParagraphRef and RunRef,
making it impossible to detect page breaks and underline formatting
when reading DOCX files programmatically.

- ParagraphRef::is_page_break_before() reads CT_PPr.page_break_before
- RunRef::is_underline() reads CT_RPr.underline

Use case: GTK4 word processor importing DOCX files with preserved
layout and formatting.
hanthor added a commit to tuna-os/gtk-office-suite that referenced this pull request Jun 24, 2026
- Cargo.toml uses path dep to local rdocx fork
- docx_bridge.rs now uses run.is_underline() for import
- docx_bridge.rs now uses p.is_page_break_before() for import
- Both previously blocked on rdocx 0.1.2 API gaps
- PR submitted upstream: tensorbee/rdocx#4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant