Skip to content

Conversation

@luccas-harbour
Copy link
Contributor

@luccas-harbour luccas-harbour commented Jan 23, 2026

  • Removes the styleContext parameter which was not being used. The converters get the numbering definitions and linked styles from the converterContext so this parameter was not needed.
  • Modifies the logic behind how the default font and default size are determined so that they fit the style resolution chain. These default values are assigned to the document's docDefaults if the document doesn't define them.
    • With this change, the defaultFont and defaultSize parameters that were passed to the converters were removed.
    • Also, the default values for these have been changed to match Word's behavior.
  • After multiple tests with Word, the logic behind how the docDefaults and the Normal style's props fit into the style resolution chain was fixed so that it matches Word's behavior

Luccas Correa added 5 commits January 23, 2026 15:46
I ran a bunch of tests in Word and the behavior we were implementing was
wrong. The properties from the Normal style are always after the
document's defaults, regardless of the value of w:default for the Normal
style. Also, the properties from the Normal style are only added to the
chain if the element does not have a linked style assigned.
@linear
Copy link

linear bot commented Jan 23, 2026

@luccas-harbour luccas-harbour changed the title refactor: remove redundant parameters in pm-adapter refactor: remove redundant parameters in pm-adapter (SD-1587) Jan 23, 2026
@luccas-harbour luccas-harbour marked this pull request as ready for review January 23, 2026 19:02
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: aaed6b64de

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Copy link
Collaborator

@harbournick harbournick left a comment

Choose a reason for hiding this comment

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

LGTM

@harbournick harbournick merged commit 92ca21a into main Jan 24, 2026
4 of 5 checks passed
@harbournick harbournick deleted the luccas/sd-1587-refactor-pm-adapter-in-layout-engine-part-2 branch January 24, 2026 01:38
harbournick pushed a commit that referenced this pull request Jan 24, 2026
* refactor: remove unused styleContext parameter

* fix: extract default font and size from docDefaults

* fix: adjust default font and size to match word

* fix: ordering of document defaults and normal style

I ran a bunch of tests in Word and the behavior we were implementing was
wrong. The properties from the Normal style are always after the
document's defaults, regardless of the value of w:default for the Normal
style. Also, the properties from the Normal style are only added to the
chain if the element does not have a linked style assigned.

* test: fix existing tests

* chore: remove unused imports

* fix: interpret default font size as pixels instead of points

---------

Co-authored-by: Luccas Correa <luccas@superdoc.dev>
harbournick pushed a commit that referenced this pull request Jan 24, 2026
# [1.9.0-next.2](v1.9.0-next.1...v1.9.0-next.2) (2026-01-24)

### Bug Fixes

* remove redundant parameters in pm-adapter (SD-1587) ([#1823](#1823)) ([e315ad4](e315ad4))
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.

3 participants