Skip to content

Commit

Permalink
Fix broken HTML output. FlowDocument can't use save()/restore() when …
Browse files Browse the repository at this point in the history
…changing styles, because a page-break will need a </g>, closing any style save()/restore(). Solution: not using that renderer state stack for FlowDocument apart from the onBeginPage callback. One rare case of the fix being now cleaner, more correct and faster at the same time :)
  • Loading branch information
Guillaume Piolat committed Feb 19, 2022
1 parent 9db489a commit ac3fdf5
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions flow/printed/flow/document.d
Original file line number Diff line number Diff line change
Expand Up @@ -495,15 +495,13 @@ private:
{
assert(_stateStack.length != 0);
_stateStack ~= _stateStack[$-1];
_r.save();
}

// Pop (context information + fontSize).
void popState()
{
assert(_stateStack.length >= 2);
_stateStack = _stateStack[0..$-1];
_r.restore();

// Apply former state to context
updateRendererStateWithStyleState();
Expand Down

0 comments on commit ac3fdf5

Please sign in to comment.