diff options
author | Jan Holesovsky <kendy@collabora.com> | 2015-04-02 13:43:47 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-04-07 09:18:13 +0200 |
commit | bf8b86e932df3edaeaa887509a22e57cd3920bc1 (patch) | |
tree | e7ced5dd38e394c95a1a75290ee10de2deacdafd /sc/source/ui/view/viewdata.cxx | |
parent | 7091be15956cc2119f880d5157fc281384a8bfe2 (diff) |
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
Diffstat (limited to 'sc/source/ui/view/viewdata.cxx')
-rw-r--r-- | sc/source/ui/view/viewdata.cxx | 40 |
1 files changed, 15 insertions, 25 deletions
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 (aValidX<aFrac20) - aValidX = aFrac20; - if (aValidX>aFrac400) - aValidX = aFrac400; - - Fraction aValidY = rNewY; - if (aValidY<aFrac20) - aValidY = aFrac20; - if (aValidY>aFrac400) - 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; } } } |