summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorJim Raykowski <raykowj@gmail.com>2021-05-27 19:21:11 -0800
committerXisco Fauli <xiscofauli@libreoffice.org>2021-06-15 09:43:21 +0200
commit3d4c284f087010e9590460f98052438526e14c00 (patch)
tree8b94404e6b024c48a62180bbcc4f7e2434c7077c /sw
parentea48cb21bb3b5f8a4f1a01987d393bddb9985a8e (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> (cherry picked from commit ec629c5ee22d02f99d66a5cf975ce239876b7f4d) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116702 Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'sw')
-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 87d04bebed90..1ad4e32a9c55 100644
--- a/sw/source/uibase/uiview/pview.cxx
+++ b/sw/source/uibase/uiview/pview.cxx
@@ -102,18 +102,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 da05a1cd6794..dfa8678cc548 100644
--- a/sw/source/uibase/uiview/view2.cxx
+++ b/sw/source/uibase/uiview/view2.cxx
@@ -588,7 +588,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 82b1159952fb..59b8dfa1a214 100644
--- a/sw/source/uibase/uiview/viewstat.cxx
+++ b/sw/source/uibase/uiview/viewstat.cxx
@@ -74,8 +74,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);
}