summaryrefslogtreecommitdiff
path: root/sw/source/uibase
diff options
context:
space:
mode:
authorJim Raykowski <raykowj@gmail.com>2021-05-27 19:21:11 -0800
committerJim Raykowski <raykowj@gmail.com>2021-06-07 08:51:02 +0200
commitec629c5ee22d02f99d66a5cf975ce239876b7f4d (patch)
treeed83864367da9323ced378cc9c6363d3c901345a /sw/source/uibase
parent7f059ce157da0de40a98f63f61d923cc67d93884 (diff)
Resolves tdf#142513 fix zoom caller handling
Calling ZoomPlus has always executed shell SID_ZOOM_OUT case handling. ZoomMinus, which replaced ZoomIn, does SID_ZOOM_IN case handling. This patch changes ZoomPlus to do SID_ZOOM_IN case handling and ZoomMinus to do SID_ZOOM_OUT case handling and makes appropriate changes required by these name changes to provide expected zoom results in all module shells that have handling for these calls. Change-Id: If148f4f7866bfc8fc6452ad1c1dace723a125ef6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116287 Tested-by: Jenkins Reviewed-by: Jim Raykowski <raykowj@gmail.com>
Diffstat (limited to 'sw/source/uibase')
-rw-r--r--sw/source/uibase/uiview/pview.cxx16
-rw-r--r--sw/source/uibase/uiview/view2.cxx2
-rw-r--r--sw/source/uibase/uiview/viewstat.cxx4
3 files changed, 11 insertions, 11 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);
}
diff --git a/sw/source/uibase/uiview/view2.cxx b/sw/source/uibase/uiview/view2.cxx
index a9e71660dd10..0e9694534c44 100644
--- a/sw/source/uibase/uiview/view2.cxx
+++ b/sw/source/uibase/uiview/view2.cxx
@@ -583,7 +583,7 @@ void SwView::Execute(SfxRequest &rReq)
case SID_ZOOM_OUT:
{
tools::Long nFact = m_pWrtShell->GetViewOptions()->GetZoom();
- if (SID_ZOOM_OUT == nSlot)
+ if (SID_ZOOM_IN == nSlot)
nFact = basegfx::zoomtools::zoomIn(nFact);
else
nFact = basegfx::zoomtools::zoomOut(nFact);
diff --git a/sw/source/uibase/uiview/viewstat.cxx b/sw/source/uibase/uiview/viewstat.cxx
index e2606091bb72..bacc2f395583 100644
--- a/sw/source/uibase/uiview/viewstat.cxx
+++ b/sw/source/uibase/uiview/viewstat.cxx
@@ -77,8 +77,8 @@ void SwView::GetState(SfxItemSet &rSet)
case SID_ZOOM_OUT:
{
tools::Long nFact = m_pWrtShell->GetViewOptions()->GetZoom();
- if ((SID_ZOOM_OUT == nWhich && nFact >= tools::Long(600)) ||
- (SID_ZOOM_IN == nWhich && nFact <= tools::Long(20)))
+ if ((SID_ZOOM_IN == nWhich && nFact >= tools::Long(600)) ||
+ (SID_ZOOM_OUT == nWhich && nFact <= tools::Long(20)))
{
rSet.DisableItem(nWhich);
}