sw/source/uibase/utlui/navipi.cxx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
New commits: commit 2b1b78e11b2b9b3512fe710c5a9679842cd04bc0 Author: Jim Raykowski <rayk...@gmail.com> AuthorDate: Tue Sep 24 16:37:06 2024 -0800 Commit: Jim Raykowski <rayk...@gmail.com> CommitDate: Thu Nov 14 04:38:09 2024 +0100 SwNavigator: Improve the page change control The intent of this patch is to address an issue with the Writer Navigator page change control reported at https:// ask.libreoffice.org/t/writer-display-single-page/111050 "I have selected View > Normal and View > Whitespace and View> Zoom> Entire Page. On the bottom right, I’ve chosen the single page icon." ... "It is odd that the page number displayed as you click the [Navigator Page control spin button] up and down arrows does not change.." The patch changes the function used by the page control to determine the page number of the page in the view to that used by the status bar page control. It also disables page tracking by the control when the view is set to Multiple-page view or Book view. Change-Id: I439bb4493061528f87eaeca3c08a33095adb8192 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173888 Tested-by: Jenkins Reviewed-by: Jim Raykowski <rayk...@gmail.com> diff --git a/sw/source/uibase/utlui/navipi.cxx b/sw/source/uibase/utlui/navipi.cxx index f11c31fbe531..e8ab96545266 100644 --- a/sw/source/uibase/utlui/navipi.cxx +++ b/sw/source/uibase/utlui/navipi.cxx @@ -909,12 +909,12 @@ void SwNavigationPI::NotifyItemUpdate(sal_uInt16 nSID, SfxItemState /*eState*/, if (pView) { SwWrtShell& rSh = pView->GetWrtShell(); - // GetPageNum - return current page number: - // true: in which cursor is located. - // false: which is visible at the upper margin. - sal_uInt16 nPhyNum, nVirtNum; - rSh.GetPageNum(nPhyNum, nVirtNum, false); - m_xGotoPageSpinButton->set_text(OUString::number(nPhyNum)); + if (rSh.GetViewOptions()->IsMultipageView()) + // maybe set the spin button text to the page that has the cursor? + break; + SwVisiblePageNumbers aVisiblePageNumbers; + rSh.GetFirstLastVisPageNumbers(aVisiblePageNumbers, *pView); + m_xGotoPageSpinButton->set_text(OUString::number(aVisiblePageNumbers.nFirstPhy)); } } }