sd: impress: fix scrollbar not updating on PgUp/PgDown
make scrollbars update when the current slide is switched via hotkeys. which eliminates now not needed UpdateScrollBars call at CurrentSlideManager. Change-Id: I89db8c45edd14a871e6d9901a156609ad569984c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183854 Tested-by: Jenkins Reviewed-by: Sarper Akdemir <sarper.akdemir@allotropia.de>
This commit is contained in:
@@ -253,7 +253,8 @@ public:
|
||||
|
||||
void ResetActualPage();
|
||||
void ResetActualLayer();
|
||||
SD_DLLPUBLIC bool SwitchPage(sal_uInt16 nPage, bool bAllowChangeFocus = true);
|
||||
SD_DLLPUBLIC bool SwitchPage(sal_uInt16 nPage, bool bAllowChangeFocus = true,
|
||||
bool bUpdateScrollbars = true);
|
||||
bool IsSwitchPageAllowed() const;
|
||||
|
||||
/**
|
||||
|
||||
@@ -200,7 +200,6 @@ void CurrentSlideManager::SetCurrentSlideAtViewShellBase (const SharedPageDescri
|
||||
pDrawViewShell->SwitchPage(nPageNumber);
|
||||
TabControl& rPageTabControl = pDrawViewShell->GetPageTabControl();
|
||||
rPageTabControl.SetCurPageId(rPageTabControl.GetPageId(nPageNumber));
|
||||
pDrawViewShell->UpdateScrollBars();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -805,8 +805,12 @@ bool DrawViewShell::IsSelected(sal_uInt16 nPage)
|
||||
* bAllowChangeFocus set to false when slide is inserted before current page
|
||||
* and we need to only update the current page number,
|
||||
* do not disturb editing in that case
|
||||
* bUpdateScrollbars set to false when the scrollbars are going to be updated by
|
||||
* some other mechanism. (e.g. if the page switch happened as
|
||||
* a result of a scroll)
|
||||
*/
|
||||
bool DrawViewShell::SwitchPage(sal_uInt16 nSelectedPage, bool bAllowChangeFocus)
|
||||
bool DrawViewShell::SwitchPage(sal_uInt16 nSelectedPage, bool bAllowChangeFocus,
|
||||
bool bUpdateScrollbars)
|
||||
{
|
||||
/** Under some circumstances there are nested calls to SwitchPage() and
|
||||
may crash the application (activation of form controls when the
|
||||
@@ -1162,6 +1166,9 @@ bool DrawViewShell::SwitchPage(sal_uInt16 nSelectedPage, bool bAllowChangeFocus)
|
||||
UpdatePreview( mpActualPage );
|
||||
|
||||
mpDrawView->AdjustMarkHdl();
|
||||
|
||||
if(bUpdateScrollbars)
|
||||
UpdateScrollBars();
|
||||
}
|
||||
|
||||
return bOK;
|
||||
|
||||
@@ -269,7 +269,7 @@ void ViewShell::VirtVScrollHdl(ScrollAdaptor* pVScroll)
|
||||
static_cast<double>(nTotalPages - 1));
|
||||
|
||||
if (nCurPage != nNewPage)
|
||||
static_cast<DrawViewShell*>(this)->SwitchPage(nNewPage);
|
||||
static_cast<DrawViewShell*>(this)->SwitchPage(nNewPage, true, false);
|
||||
|
||||
double fNewPageStart = nNewPage * fScrollableDistancePerPage;
|
||||
double fY = (pVScroll->GetThumbPos() / fMappingFactor) - fNewPageStart;
|
||||
|
||||
Reference in New Issue
Block a user