sw/source/uibase/uiview/scroll.cxx |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 196930bae2577a73a0201bda943e8cccaa839e2b
Author:     Hossein <hoss...@libreoffice.org>
AuthorDate: Sun Dec 25 02:19:27 2022 +0100
Commit:     Stephan Bergmann <sberg...@redhat.com>
CommitDate: Wed Dec 28 16:17:54 2022 +0000

    Revert "tdf#114441 Convert use of sal_uLong to better integer types"
    
    This partially reverts 3cc818c38e11c0882bc3ad32ffd0019a9ad38643. In this
    patch sal_uLong was converted to better data types. In part of the patch
    the order of the calls, GetVisibleSize() ~> SetLineSize ~> SetPageSize()
    was changed so that the GetVisibleSize() is invoked inside the parameter
    passing to SetPageSize() to avoid creating a temporary variable.
    
    As sberg mentioned, it was needed that the call to SetLineSize() did
    not have side effects that changes the result of the GetVisibleSize().
    But it was hard to prove so, even if it seemed logically sound. Thus,
    I am reverting the above commit partially.
    
    In the revert, I've used tools::Long for nVisSize instead of sal_uLong.
    
    Change-Id: Iba8d2da2675c237e9ab1c30918defce13ea71d7c
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144617
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sberg...@redhat.com>

diff --git a/sw/source/uibase/uiview/scroll.cxx 
b/sw/source/uibase/uiview/scroll.cxx
index 28fbab182bd5..7b1d7f915a7f 100644
--- a/sw/source/uibase/uiview/scroll.cxx
+++ b/sw/source/uibase/uiview/scroll.cxx
@@ -40,8 +40,9 @@ void SwScrollbar::DocSzChgd( const Size &rSize )
 {
     m_aDocSz = rSize;
     SetRange( Range( 0, m_bHori ? rSize.Width() : rSize.Height()) );
+    const tools::Long nVisSize = GetVisibleSize();
     SetLineSize( SCROLL_LINE_SIZE );
-    SetPageSize( GetVisibleSize() * 77 / 100 );
+    SetPageSize( nVisSize * 77 / 100 );
 }
 
 // Will be called after a change of the visible view section.

Reply via email to