summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorJan Holesovsky <kendy@collabora.com>2015-04-14 17:47:22 +0200
committerJan Holesovsky <kendy@collabora.com>2015-04-14 17:53:09 +0200
commit85ab76f7047abd14139548b3343cb27905f130e8 (patch)
tree0ef4b64adf1f9561ef5d26328d227551784c2776 /sc
parentb82791e3c586d6e4247d0eb1bb94681bcb113762 (diff)
sc: 0 as the default zoom is curious, should be 100.
This fixes a fallout from bf8b86e932df3edaeaa887509a22e57cd3920bc1. Change-Id: Ie2d2a1329df0ec36f21a07938af142c32c74277a
Diffstat (limited to 'sc')
-rw-r--r--sc/source/ui/view/tabview2.cxx15
1 files changed, 8 insertions, 7 deletions
diff --git a/sc/source/ui/view/tabview2.cxx b/sc/source/ui/view/tabview2.cxx
index fc9b1a892abd..9e7d4d0b2809 100644
--- a/sc/source/ui/view/tabview2.cxx
+++ b/sc/source/ui/view/tabview2.cxx
@@ -1170,7 +1170,7 @@ static bool lcl_FitsInWindow( double fScaleX, double fScaleY, sal_uInt16 nZoom,
sal_uInt16 ScTabView::CalcZoom( SvxZoomType eType, sal_uInt16 nOldZoom )
{
- sal_uInt16 nZoom = 0; // Ergebnis
+ sal_uInt16 nZoom = 100;
switch ( eType )
{
@@ -1298,7 +1298,9 @@ sal_uInt16 ScTabView::CalcZoom( SvxZoomType eType, sal_uInt16 nOldZoom )
// (with frozen panes, the size of the individual parts
// depends on the scale that is to be calculated)
- if ( !pGridWin[SC_SPLIT_BOTTOMLEFT] ) return 0;
+ if (!pGridWin[SC_SPLIT_BOTTOMLEFT])
+ return nZoom;
+
Size aWinSize = pGridWin[SC_SPLIT_BOTTOMLEFT]->GetOutputSizePixel();
ScSplitMode eHMode = aViewData.GetHSplitMode();
if ( eHMode != SC_SPLIT_NONE && pGridWin[SC_SPLIT_BOTTOMRIGHT] )
@@ -1338,19 +1340,18 @@ sal_uInt16 ScTabView::CalcZoom( SvxZoomType eType, sal_uInt16 nOldZoom )
( aPageSize.Width() * nPPTX ) );
long nZoomY = (long) ( aWinSize.Height() * 100 /
( aPageSize.Height() * nPPTY ) );
- long nNew = nZoomX;
- if (eType == SvxZoomType::WHOLEPAGE && nZoomY < nNew)
- nNew = nZoomY;
+ if (nZoomX > 0)
+ nZoom = static_cast<sal_uInt16>(nZoomX);
- nZoom = (sal_uInt16) nNew;
+ if (eType == SvxZoomType::WHOLEPAGE && nZoomY > 0 && nZoomY < nZoom)
+ nZoom = static_cast<sal_uInt16>(nZoomY);
}
}
break;
default:
OSL_FAIL("Unknown Zoom-Revision");
- nZoom = 0;
}
return nZoom;