From c3cf3e908add6b6617eb0ee12385fbd8a70a9887 Mon Sep 17 00:00:00 2001 From: Justin Luth Date: Wed, 17 Jun 2020 09:00:33 +0300 Subject: tdf#134023 sw ui: stay at footer ONLY when showing control This adds a missing piece to LO 6.4's commit 342a5890dbcddccb4013e201e3ff3d9e6967e733 That tdf#84929 commit message suggested: One additional limitation could be added to only apply this if it is dealing with the footer, since in the case of a header there would be no screen-jump. and this bug report shows why that is necessary. I'm not sure why I didn't apply that immediately. Perhaps to help identify situations where the entire concept might be bad? Change-Id: Icea861bec45262eed88c38bb7eea910289c06870 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96487 Tested-by: Justin Luth Reviewed-by: Justin Luth --- sw/source/uibase/docvw/edtwin.cxx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'sw/source/uibase/docvw/edtwin.cxx') diff --git a/sw/source/uibase/docvw/edtwin.cxx b/sw/source/uibase/docvw/edtwin.cxx index 132930631cf5..2a2d6634a0ea 100644 --- a/sw/source/uibase/docvw/edtwin.cxx +++ b/sw/source/uibase/docvw/edtwin.cxx @@ -2821,10 +2821,12 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt) // Repaint everything Invalidate(); - // If the control had not been showing, do not return to the cursor position, + // tdf#84929. If the footer control had not been showing, do not change the cursor position, // because the user may have scrolled to turn on the separator control and - // if the cursor is now off-screen, then the user would need to scroll back again to use the control. - if ( !bSeparatorWasVisible && rSh.GetViewOptions()->IsUseHeaderFooterMenu() && !Application::IsHeadlessModeEnabled() ) + // if the cursor cannot be positioned on-screen, then the user would need to scroll back again to use the control. + // This should only be done for the footer. The cursor can always be re-positioned near the header. tdf#134023. + if ( eControl == FrameControlType::Footer && !bSeparatorWasVisible + && rSh.GetViewOptions()->IsUseHeaderFooterMenu() && !Application::IsHeadlessModeEnabled() ) return; } } -- cgit