diff options
author | Niklas Nebel <nn@openoffice.org> | 2001-11-12 11:42:29 +0000 |
---|---|---|
committer | Niklas Nebel <nn@openoffice.org> | 2001-11-12 11:42:29 +0000 |
commit | bb92c24e6ce6044f873483b0b2c8931aca4d3c0f (patch) | |
tree | 658a696a4b029242ed535be7e14aae8fd9fffb73 /sc/source/ui/docshell/docsh6.cxx | |
parent | c6b63860f7b66acbab9d1a71c1f37c3e8987dfee (diff) |
#94517# SetVisAreaOrSize: if start position is negative, move area
Diffstat (limited to 'sc/source/ui/docshell/docsh6.cxx')
-rw-r--r-- | sc/source/ui/docshell/docsh6.cxx | 19 |
1 files changed, 16 insertions, 3 deletions
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! |