diff options
Diffstat (limited to 'sw/source/uibase/uiview/pview.cxx')
-rw-r--r-- | sw/source/uibase/uiview/pview.cxx | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/sw/source/uibase/uiview/pview.cxx b/sw/source/uibase/uiview/pview.cxx index 9ca718e016f6..a432a4de8948 100644 --- a/sw/source/uibase/uiview/pview.cxx +++ b/sw/source/uibase/uiview/pview.cxx @@ -103,18 +103,18 @@ static sal_uInt16 lcl_GetNextZoomStep(sal_uInt16 nCurrentZoom, bool bZoomIn) const int nZoomArrSize = static_cast<int>(SAL_N_ELEMENTS(aZoomArr)); if (bZoomIn) { - for(int i = nZoomArrSize - 1; i >= 0; --i) + for(sal_uInt16 i : aZoomArr) { - if(nCurrentZoom > aZoomArr[i] || !i) - return aZoomArr[i]; + if(nCurrentZoom < i) + return i; } } else { - for(sal_uInt16 i : aZoomArr) + for(int i = nZoomArrSize - 1; i >= 0; --i) { - if(nCurrentZoom < i) - return i; + if(nCurrentZoom > aZoomArr[i] || !i) + return aZoomArr[i]; } } return bZoomIn ? MAX_PREVIEW_ZOOM : MIN_PREVIEW_ZOOM; @@ -1006,8 +1006,8 @@ void SwPagePreview::GetState( SfxItemSet& rSet ) case SID_ZOOM_OUT: { const SwViewOption* pVOpt = GetViewShell()->GetViewOptions(); - if((SID_ZOOM_OUT == nWhich && pVOpt->GetZoom() >= MAX_PREVIEW_ZOOM)|| - (SID_ZOOM_IN == nWhich && pVOpt->GetZoom() <= MIN_PREVIEW_ZOOM)) + if((SID_ZOOM_IN == nWhich && pVOpt->GetZoom() >= MAX_PREVIEW_ZOOM) || + (SID_ZOOM_OUT == nWhich && pVOpt->GetZoom() <= MIN_PREVIEW_ZOOM)) { rSet.DisableItem(nWhich); } |