summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNiklas Nebel <nn@openoffice.org>2001-03-12 14:38:28 +0000
committerNiklas Nebel <nn@openoffice.org>2001-03-12 14:38:28 +0000
commit50cc5b9537aef1f9bdc3a79af263620f9d79b43d (patch)
treebbd09f52c82acaa24af50316500ee4d348aa9126
parent6f1c72d6b0698388d6cb0d643058050eac9fa0ff (diff)
UpdateOleZoom: test for empty VisArea
-rw-r--r--sc/source/ui/view/tabvwsh4.cxx15
1 files changed, 9 insertions, 6 deletions
diff --git a/sc/source/ui/view/tabvwsh4.cxx b/sc/source/ui/view/tabvwsh4.cxx
index 862b93b97dfa..c88d00c14827 100644
--- a/sc/source/ui/view/tabvwsh4.cxx
+++ b/sc/source/ui/view/tabvwsh4.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: tabvwsh4.cxx,v $
*
- * $Revision: 1.5 $
+ * $Revision: 1.6 $
*
- * last change: $Author: hr $ $Date: 2000-11-21 17:29:22 $
+ * last change: $Author: nn $ $Date: 2001-03-12 15:38:28 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -341,10 +341,13 @@ void ScTabViewShell::UpdateOleZoom()
if ( pDocSh->GetCreateMode() == SFX_CREATE_MODE_EMBEDDED )
{
Size aObjSize = ((SfxInPlaceObject*)pDocSh)->GetVisArea().GetSize();
- Window* pWin = GetActiveWin();
- Size aWinHMM = pWin->PixelToLogic( pWin->GetOutputSizePixel(), MAP_100TH_MM );
- SetZoomFactor( Fraction( aWinHMM.Width(),aObjSize.Width() ),
- Fraction( aWinHMM.Height(),aObjSize.Height() ) );
+ if ( aObjSize.Width() > 0 && aObjSize.Height() > 0 )
+ {
+ Window* pWin = GetActiveWin();
+ Size aWinHMM = pWin->PixelToLogic( pWin->GetOutputSizePixel(), MAP_100TH_MM );
+ SetZoomFactor( Fraction( aWinHMM.Width(),aObjSize.Width() ),
+ Fraction( aWinHMM.Height(),aObjSize.Height() ) );
+ }
}
}