From bf8b86e932df3edaeaa887509a22e57cd3920bc1 Mon Sep 17 00:00:00 2001 From: Jan Holesovsky Date: Thu, 2 Apr 2015 13:43:47 +0200 Subject: sc: Don't limit the zoom to some funny numbers. Instead just assert if we get something really really wrong there - and let's fix the root cause. The limits come already from the initial check-in of the OOo code, so maybe the reason why it was there in the first place is long gone anyway. Change-Id: I6e98a6a52eee81bd32d10269aeac76198d30b7c2 --- sc/source/ui/view/viewdata.cxx | 40 +++++++++++++++------------------------- 1 file changed, 15 insertions(+), 25 deletions(-) (limited to 'sc/source') diff --git a/sc/source/ui/view/viewdata.cxx b/sc/source/ui/view/viewdata.cxx index ced26de321e8..32ed6426c132 100644 --- a/sc/source/ui/view/viewdata.cxx +++ b/sc/source/ui/view/viewdata.cxx @@ -621,20 +621,10 @@ void ScViewData::SetZoom( const Fraction& rNewX, const Fraction& rNewY, std::vec bool bAll = ( tabs.empty() ); if ( !bAll ) // create associated table data CreateTabData( tabs ); - Fraction aFrac20( 1,5 ); - Fraction aFrac400( 4,1 ); - Fraction aValidX = rNewX; - if (aValidXaFrac400) - aValidX = aFrac400; - - Fraction aValidY = rNewY; - if (aValidYaFrac400) - aValidY = aFrac400; + // sanity check - we shouldn't need something this low / big + assert(rNewX > Fraction(1, 100) && rNewX < Fraction(100, 1)); + assert(rNewY > Fraction(1, 100) && rNewY < Fraction(100, 1)); if ( bAll ) { @@ -644,25 +634,25 @@ void ScViewData::SetZoom( const Fraction& rNewX, const Fraction& rNewY, std::vec { if ( bPagebreak ) { - maTabData[i]->aPageZoomX = aValidX; - maTabData[i]->aPageZoomY = aValidY; + maTabData[i]->aPageZoomX = rNewX; + maTabData[i]->aPageZoomY = rNewY; } else { - maTabData[i]->aZoomX = aValidX; - maTabData[i]->aZoomY = aValidY; + maTabData[i]->aZoomX = rNewX; + maTabData[i]->aZoomY = rNewY; } } } if ( bPagebreak ) { - aDefPageZoomX = aValidX; - aDefPageZoomY = aValidY; + aDefPageZoomX = rNewX; + aDefPageZoomY = rNewY; } else { - aDefZoomX = aValidX; - aDefZoomY = aValidY; + aDefZoomX = rNewX; + aDefZoomY = rNewY; } } else @@ -676,13 +666,13 @@ void ScViewData::SetZoom( const Fraction& rNewX, const Fraction& rNewY, std::vec { if ( bPagebreak ) { - maTabData[i]->aPageZoomX = aValidX; - maTabData[i]->aPageZoomY = aValidY; + maTabData[i]->aPageZoomX = rNewX; + maTabData[i]->aPageZoomY = rNewY; } else { - maTabData[i]->aZoomX = aValidX; - maTabData[i]->aZoomY = aValidY; + maTabData[i]->aZoomX = rNewX; + maTabData[i]->aZoomY = rNewY; } } } -- cgit