diff options
author | Ivan Timofeev <timofeev.i.s@gmail.com> | 2012-05-28 18:04:17 +0400 |
---|---|---|
committer | Ivan Timofeev <timofeev.i.s@gmail.com> | 2012-05-29 18:43:59 +0400 |
commit | 2b508cf6b431c2faeec95340d192e7d917f3e7c7 (patch) | |
tree | f1305e1ea16d6ed59b5bec968d4e9e99087a087e /sw | |
parent | e62b67648afe11b941257d1d6156dcf1e45610e3 (diff) |
set scrollbar parameters anyway, it is nesessary for mouse wheel handling
otherwise there is a bug:
in Writer's page preview mode scrolling can move the selection out of page range
if all pages fit into the window
(regression from d7b06ba7ec2c988e80c8ef14e2d9bfc2c29e2d24)
Change-Id: I6cebf0c5a4f944cfb8736469620b3097df0a0340
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/ui/uiview/pview.cxx | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/sw/source/ui/uiview/pview.cxx b/sw/source/ui/uiview/pview.cxx index 0bf63ec906be..52814dfb43c6 100644 --- a/sw/source/ui/uiview/pview.cxx +++ b/sw/source/ui/uiview/pview.cxx @@ -1623,33 +1623,33 @@ void SwPagePreView::ScrollViewSzChg() // adjust to new preview functionality sal_uInt16 nVisPages = aViewWin.GetRow() * aViewWin.GetCol(); + pVScrollbar->SetVisibleSize( nVisPages ); + // set selected page as scroll bar position, + // if it is visible. + SwPagePreviewLayout* pPagePrevwLay = GetViewShell()->PagePreviewLayout(); + if ( pPagePrevwLay->IsPageVisible( aViewWin.SelectedPage() ) ) + { + pVScrollbar->SetThumbPos( aViewWin.SelectedPage() ); + } + else + { + pVScrollbar->SetThumbPos( aViewWin.GetSttPage() ); + } + pVScrollbar->SetLineSize( aViewWin.GetCol() ); + pVScrollbar->SetPageSize( nVisPages ); + // calculate and set scrollbar range + Range aScrollbarRange( 1, mnPageCount ); + // increase range by one, because left-top-corner is left blank. + ++aScrollbarRange.Max(); + // increase range in order to access all pages + aScrollbarRange.Max() += ( nVisPages - 1 ); + pVScrollbar->SetRange( aScrollbarRange ); + if( nVisPages < mnPageCount ) { ShowVScrollbar( sal_True ); pPageUpBtn->Show( sal_True ); pPageDownBtn->Show( sal_True ); - - pVScrollbar->SetVisibleSize( nVisPages ); - // set selected page as scroll bar position, - // if it is visible. - SwPagePreviewLayout* pPagePrevwLay = GetViewShell()->PagePreviewLayout(); - if ( pPagePrevwLay->IsPageVisible( aViewWin.SelectedPage() ) ) - { - pVScrollbar->SetThumbPos( aViewWin.SelectedPage() ); - } - else - { - pVScrollbar->SetThumbPos( aViewWin.GetSttPage() ); - } - pVScrollbar->SetLineSize( aViewWin.GetCol() ); - pVScrollbar->SetPageSize( nVisPages ); - // calculate and set scrollbar range - Range aScrollbarRange( 1, mnPageCount ); - // increase range by one, because left-top-corner is left blank. - ++aScrollbarRange.Max(); - // increase range in order to access all pages - aScrollbarRange.Max() += ( nVisPages - 1 ); - pVScrollbar->SetRange( aScrollbarRange ); } else { |