From bb92c24e6ce6044f873483b0b2c8931aca4d3c0f Mon Sep 17 00:00:00 2001 From: Niklas Nebel Date: Mon, 12 Nov 2001 11:42:29 +0000 Subject: #94517# SetVisAreaOrSize: if start position is negative, move area --- sc/source/ui/docshell/docsh6.cxx | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'sc/source/ui/docshell/docsh6.cxx') diff --git a/sc/source/ui/docshell/docsh6.cxx b/sc/source/ui/docshell/docsh6.cxx index 85f69459eb14..332470e9481e 100644 --- a/sc/source/ui/docshell/docsh6.cxx +++ b/sc/source/ui/docshell/docsh6.cxx @@ -2,9 +2,9 @@ * * $RCSfile: docsh6.cxx,v $ * - * $Revision: 1.8 $ + * $Revision: 1.9 $ * - * last change: $Author: nn $ $Date: 2001-09-25 08:51:04 $ + * last change: $Author: nn $ $Date: 2001-11-12 12:42:29 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -243,7 +243,20 @@ void __EXPORT ScDocShell::SetVisArea( const Rectangle & rVisArea ) void ScDocShell::SetVisAreaOrSize( const Rectangle& rVisArea, BOOL bModifyStart ) { Rectangle aArea = rVisArea; - if (!bModifyStart) + if (bModifyStart) + { + if ( aArea.Left() < 0 || aArea.Top() < 0 ) + { + // VisArea start position can't be negative. + // Move the VisArea, otherwise only the upper left position would + // be changed in SnapVisArea, and the size would be wrong. + + Point aNewPos( Max( aArea.Left(), (long) 0 ), + Max( aArea.Top(), (long) 0 ) ); + aArea.SetPos( aNewPos ); + } + } + else aArea.SetPos( SfxInPlaceObject::GetVisArea().TopLeft() ); // hier Position anpassen! -- cgit