[Libreoffice-bugs] [Bug 139426] Update of Contents is freezing LibreOffice

bugzilla-daemon at bugs.documentfoundation.org bugzilla-daemon at bugs.documentfoundation.org
Tue Jul 20 13:56:11 UTC 2021


https://bugs.documentfoundation.org/show_bug.cgi?id=139426

--- Comment #11 from Armin Le Grand <Armin.Le.Grand at me.com> ---
I confirm the bibisect too.

The problem is that the current implementation tries to not create at a new
SwPageFrame a contained SwBodyFrame immediately, but tries to do that on-demand
e.g. when PageFormat changed (case RES_FMT_CHG: in SwPageFrame::UpdateAttr_).
So the fix
  0b53f794ffb2550288610b9488f11fd21ab85aae
tries to do this correction when needed.

I experimented with removing the block in case RES_FMT_CHG: in
SwPageFrame::UpdateAttr_ which solves the loop. It is just unfortunate to
create this on-demand while in layout - that restarts the layout and we get the
loop.

It may also be feasible to add a loop-deathwach-counter to SwLayAction::Action
so that when between
392        InternalAction(pRenderContext);
393        if (RemoveEmptyBrowserPages())
m_bAgain is reset to true to hard break this after a defined number of tries,
but better would be if that would not be needed. It *may* be needed/be safer
anyways one day...

So next I tried to patch the on-demand creation of a SwBodyFrame to a tooling
method at SwPageFrame, move the constructor and SwPageFrame::UpdateAttr_ to use
this. This leads to surprisingly many places where loops and accesses to data
create nullptr-exceptions -> it is just at many places not accepted to not have
a Lower() frame in any form (e.g. an instance of SwBodyFrame).

After fixing quite some places/exceptions of that kind I gave up and tried next
to just always create a SwBodyFrame as Lower() in SwPageFrame constructor. This
should make the adaption in SwPageFrame::UpdateAttr_ case RES_FMT_CHG obsolete
and solve the problem.

Only cost I can see is that maybe in some situations not needed temporary
instances of a SwBodyFrame get created and replaced/destroyed again when
something is added to the page. Due to so many places not checking for nullptr
and thus relying on Lower() to exist this seems a good solution.

Need to check what the UnitTest would say to that, preparing possible fix...

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/libreoffice-bugs/attachments/20210720/fb81d909/attachment.htm>


More information about the Libreoffice-bugs mailing list