[Libreoffice-bugs] [Bug 118621] Optionally disable floating header/footer menu

bugzilla-daemon at bugs.documentfoundation.org bugzilla-daemon at bugs.documentfoundation.org
Tue Sep 18 07:31:49 UTC 2018


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

--- Comment #11 from Mike Kaganski <mikekaganski at hotmail.com> ---
(In reply to Heiko Tietze from comment #10)

Sigh, I'd prefer to not solve easy hacks for "newbies", because - well, easy
hack is expected to allow a newcomer to do something not too dull, and at the
same time not too difficult, but...

The top of call stack at the breakpoint:

> swlo.dll!SwHeaderFooterWin::SwHeaderFooterWin(SwEditWin * pEditWin, const SwFrame * pFrame, bool bHeader) Line 138
> 	at c:\lo\src\core\sw\source\uibase\docvw\headerfooterwin.cxx(138)
> swlo.dll!VclPtr<SwHeaderFooterWin>::Create<VclPtr<SwEditWin> &,SwPageFrame const * &,bool const &>(VclPtr<SwEditWin> & <arg_0>, const SwPageFrame * & <arg_1>, const bool & <arg_2>) Line 135
> 	at c:\lo\src\core\include\vcl\vclptr.hxx(135)
> swlo.dll!SwFrameControlsManager::SetHeaderFooterControl(const SwPageFrame * pPageFrame, FrameControlType eType, Point aOffset) Line 107
> 	at c:\lo\src\core\sw\source\uibase\docvw\framecontrolsmanager.cxx(107)
> swlo.dll!SwPageFrame::PaintDecorators() Line 3679
> 	at c:\lo\src\core\sw\source\core\layout\paintfrm.cxx(3679)
> swlo.dll!SwRootFrame::PaintSwFrame(OutputDevice & rRenderContext, const SwRect & rRect, const SwPrintData * const pPrintData) Line 3191
> 	at c:\lo\src\core\sw\source\core\layout\paintfrm.cxx(3191)
> ...

Of course, there's no reason to change something below
SwRootFrame::PaintSwFrame, because this method is generic enough (it isn't
specific to creation of the controls, but paints the whole frame, as its name
suggests). None of its callers would have good knowledge whether (or how) to
create those controls.

SwRootFrame::PaintSwFrame itself doesn't directly create those controls, but
calls SwPageFrame::PaintDecorators, which does many other kinds of things - so
no reason to place the check in SwRootFrame::PaintSwFrame, too: too far from
the actual place of controls creation.

The latter (SwPageFrame::PaintDecorators) calls
SwFrameControlsManager::SetHeaderFooterControl, which is specifically created
to do what we want to manage. So - it's natural to think the two places for
performing the check: either in places where
SwFrameControlsManager::SetHeaderFooterControl is called (grepping for
"SetHeaderFooterControl" gives only two such places, both in the same function)
- so just calling it conditionally; or inside
SwFrameControlsManager::SetHeaderFooterControl, doing the check and exiting
early.

These two options are both acceptable, and a newbie could propose a change with
any of them (and then we'd discuss pros and contras in the gerrit change)...
just telling "I can't" and me writing all this means spoiling the whole easy
hack, effectively because me doing all that the newcomer was expected to do.

-- 
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/20180918/04f1a5ea/attachment.html>


More information about the Libreoffice-bugs mailing list