summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorOliver Specht <os@openoffice.org>2002-12-10 14:31:12 +0000
committerOliver Specht <os@openoffice.org>2002-12-10 14:31:12 +0000
commita32164a304a025b00a8a8e1457848e5513c84f8e (patch)
tree60368363667cb16bd0f056e847c33aee64e47e25 /sw
parenta2e4637db83a4f59f6b56f5ee1a0a389234eb64a (diff)
#105209# ReadUserDataSequence: check for correct VisArea
Diffstat (limited to 'sw')
-rw-r--r--sw/source/ui/uiview/view.cxx13
1 files changed, 10 insertions, 3 deletions
diff --git a/sw/source/ui/uiview/view.cxx b/sw/source/ui/uiview/view.cxx
index c92bd05f8ea6..716db5fc423c 100644
--- a/sw/source/ui/uiview/view.cxx
+++ b/sw/source/ui/uiview/view.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: view.cxx,v $
*
- * $Revision: 1.51 $
+ * $Revision: 1.52 $
*
- * last change: $Author: os $ $Date: 2002-12-04 12:19:12 $
+ * last change: $Author: os $ $Date: 2002-12-10 15:31:12 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -1361,7 +1361,14 @@ void SwView::ReadUserDataSequence ( const com::sun::star::uno::Sequence < com::s
( pVOpt->GetZoom() != nZoomFactor || pVOpt->GetZoomType() != eZoom ) )
SetZoom( eZoom, nZoomFactor, sal_True );
if ( bBrowse && bGotVisibleLeft && bGotVisibleTop )
- SetVisArea( aVis.TopLeft() );
+ {
+ Point aTopLeft(aVis.TopLeft());
+ //check if the values are possible
+ long nXMax = pHScrollbar->GetRangeMax() - pHScrollbar->GetVisibleSize();
+ if( aTopLeft.X() > nXMax )
+ aTopLeft.X() = nXMax < 0 ? 0 : nXMax;
+ SetVisArea( aTopLeft );
+ }
else if (bGotVisibleLeft && bGotVisibleTop && bGotVisibleRight && bGotVisibleBottom )
SetVisArea( aVis );