Resolves: tdf#150797 page preview scrolling not updating position

Change-Id: I8b495d755278ce850d69da8b7fb8588a4f111bd1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139444
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
diff --git a/sw/source/uibase/uiview/pview.cxx b/sw/source/uibase/uiview/pview.cxx
index 6a5eb14..f6db5bb 100644
--- a/sw/source/uibase/uiview/pview.cxx
+++ b/sw/source/uibase/uiview/pview.cxx
@@ -1399,6 +1399,8 @@ void SwPagePreview::ScrollHdl(weld::Scrollbar& rScrollbar, bool bHori)
    if(!GetViewShell())
        return;

    EndScrollHdl(rScrollbar, bHori);

    if( !bHori &&
        rScrollbar.get_scroll_type() == ScrollType::Drag &&
        Help::IsQuickHelpEnabled() &&
@@ -1423,8 +1425,6 @@ void SwPagePreview::ScrollHdl(weld::Scrollbar& rScrollbar, bool bHori)
                QuickHelpFlags::Right|QuickHelpFlags::VCenter);

    }
    else
        EndScrollHdl(rScrollbar, bHori);
}

void SwPagePreview::EndScrollHdl(weld::Scrollbar& rScrollbar, bool bHori)
diff --git a/sw/source/uibase/uiview/viewport.cxx b/sw/source/uibase/uiview/viewport.cxx
index 8e7a959..9b7bb91 100644
--- a/sw/source/uibase/uiview/viewport.cxx
+++ b/sw/source/uibase/uiview/viewport.cxx
@@ -677,14 +677,11 @@ IMPL_LINK(SwView, VertScrollHdl, weld::Scrollbar&, rScrollbar, void)
    if (rScrollbar.get_scroll_type() == ScrollType::Drag)
        m_pWrtShell->EnableSmooth( false );

    EndScrollHdl(rScrollbar, false);

    if (!m_pWrtShell->GetViewOptions()->getBrowseMode() &&
        rScrollbar.get_scroll_type() == ScrollType::Drag)
    {
        // Here comment out again if it is not desired to scroll together:
        // The end scrollhandler invalidate the FN_STAT_PAGE,
        // so we don't must do it again.
        EndScrollHdl(rScrollbar, false);

        if ( !m_bWheelScrollInProgress && Help::IsQuickHelpEnabled() &&
             m_pWrtShell->GetViewOptions()->IsShowScrollBarTips())
        {
@@ -737,8 +734,6 @@ IMPL_LINK(SwView, VertScrollHdl, weld::Scrollbar&, rScrollbar, void)
            }
        }
    }
    else
        EndScrollHdl(rScrollbar, false);

    if (rScrollbar.get_scroll_type() == ScrollType::Drag)
        m_pWrtShell->EnableSmooth( true );