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>
diff --git a/sd/source/ui/view/drviews7.cxx b/sd/source/ui/view/drviews7.cxx
index 6e695b1..1419108 100644
--- a/sd/source/ui/view/drviews7.cxx
+++ b/sd/source/ui/view/drviews7.cxx
@@ -985,11 +985,11 @@ void DrawViewShell::GetMenuState( SfxItemSet &rSet )
{
if( GetActiveWindow()->GetZoom() <= GetActiveWindow()->GetMinZoom() || GetDocSh()->IsUIActive() )
{
rSet.DisableItem( SID_ZOOM_IN );
rSet.DisableItem( SID_ZOOM_OUT );
rSet.DisableItem( SID_ZOOM_PANNING );
}
if( GetActiveWindow()->GetZoom() >= GetActiveWindow()->GetMaxZoom() || GetDocSh()->IsUIActive() )
rSet.DisableItem( SID_ZOOM_OUT );
rSet.DisableItem( SID_ZOOM_IN );
}
if (!mpZoomList->IsNextPossible())
diff --git a/sd/source/ui/view/drviewse.cxx b/sd/source/ui/view/drviewse.cxx
index 2247294c..9fb6986 100644
--- a/sd/source/ui/view/drviewse.cxx
+++ b/sd/source/ui/view/drviewse.cxx
@@ -1179,7 +1179,7 @@ void DrawViewShell::FuSupport(SfxRequest& rReq)
}
break;
case SID_ZOOM_IN: // BASIC
case SID_ZOOM_OUT: // BASIC
{
mbZoomOnPage = false;
SetZoom( std::max<::tools::Long>( GetActiveWindow()->GetZoom() / 2, GetActiveWindow()->GetMinZoom() ) );
@@ -1193,7 +1193,7 @@ void DrawViewShell::FuSupport(SfxRequest& rReq)
}
break;
case SID_ZOOM_OUT:
case SID_ZOOM_IN:
{
mbZoomOnPage = false;
SetZoom( std::min<::tools::Long>( GetActiveWindow()->GetZoom() * 2, GetActiveWindow()->GetMaxZoom() ) );
@@ -1201,6 +1201,7 @@ void DrawViewShell::FuSupport(SfxRequest& rReq)
GetActiveWindow()->GetOutputSizePixel()) );
mpZoomList->InsertZoomRect(aVisAreaWin);
Invalidate( SID_ZOOM_IN );
Invalidate(SID_ZOOM_OUT);
Invalidate( SID_ZOOM_PANNING );
rReq.Done ();
}
diff --git a/sd/source/ui/view/outlnvs2.cxx b/sd/source/ui/view/outlnvs2.cxx
index 5e9caef..a1b2c93 100644
--- a/sd/source/ui/view/outlnvs2.cxx
+++ b/sd/source/ui/view/outlnvs2.cxx
@@ -125,7 +125,7 @@ void OutlineViewShell::FuTemporary(SfxRequest &rReq)
break;
}
case SID_ZOOM_OUT:
case SID_ZOOM_IN:
{
SetZoom( std::min<::tools::Long>( GetActiveWindow()->GetZoom() * 2, GetActiveWindow()->GetMaxZoom() ) );
::tools::Rectangle aVisAreaWin = GetActiveWindow()->PixelToLogic( ::tools::Rectangle( Point(0,0),
@@ -133,6 +133,7 @@ void OutlineViewShell::FuTemporary(SfxRequest &rReq)
mpZoomList->InsertZoomRect(aVisAreaWin);
Invalidate( SID_ATTR_ZOOM );
Invalidate( SID_ZOOM_IN );
Invalidate(SID_ZOOM_OUT);
Invalidate( SID_ATTR_ZOOMSLIDER );
Cancel();
rReq.Done();
@@ -152,7 +153,7 @@ void OutlineViewShell::FuTemporary(SfxRequest &rReq)
}
break;
case SID_ZOOM_IN:
case SID_ZOOM_OUT:
{
SetZoom( std::max<::tools::Long>( GetActiveWindow()->GetZoom() / 2, GetActiveWindow()->GetMinZoom() ) );
::tools::Rectangle aVisAreaWin = GetActiveWindow()->PixelToLogic( ::tools::Rectangle( Point(0,0),
diff --git a/sd/source/ui/view/outlnvsh.cxx b/sd/source/ui/view/outlnvsh.cxx
index b18a046..ed810ca 100644
--- a/sd/source/ui/view/outlnvsh.cxx
+++ b/sd/source/ui/view/outlnvsh.cxx
@@ -738,9 +738,9 @@ void OutlineViewShell::GetMenuState( SfxItemSet &rSet )
SfxItemState::DEFAULT == rSet.GetItemState( SID_ZOOM_OUT ) )
{
if( GetActiveWindow()->GetZoom() <= GetActiveWindow()->GetMinZoom() || GetDocSh()->IsUIActive() )
rSet.DisableItem( SID_ZOOM_IN );
if( GetActiveWindow()->GetZoom() >= GetActiveWindow()->GetMaxZoom() || GetDocSh()->IsUIActive() )
rSet.DisableItem( SID_ZOOM_OUT );
if( GetActiveWindow()->GetZoom() >= GetActiveWindow()->GetMaxZoom() || GetDocSh()->IsUIActive() )
rSet.DisableItem( SID_ZOOM_IN );
}
::Outliner& rOutl = pOlView->GetOutliner();
diff --git a/sfx2/sdi/sfx.sdi b/sfx2/sdi/sfx.sdi
index 7ce13e9..90ed30a 100644
--- a/sfx2/sdi/sfx.sdi
+++ b/sfx2/sdi/sfx.sdi
@@ -4735,7 +4735,7 @@ SfxBoolItem ViewDataSourceBrowser SID_VIEW_DATA_SOURCE_BROWSER
GroupId = SfxGroupId::View;
]
SfxVoidItem ZoomMinus SID_ZOOM_IN
SfxVoidItem ZoomPlus SID_ZOOM_IN
()
[
AutoUpdate = FALSE,
@@ -4771,7 +4771,7 @@ SfxVoidItem ZoomNext SID_ZOOM_NEXT
]
SfxVoidItem ZoomPlus SID_ZOOM_OUT
SfxVoidItem ZoomMinus SID_ZOOM_OUT
()
[
AutoUpdate = TRUE,
diff --git a/sw/source/uibase/uiview/pview.cxx b/sw/source/uibase/uiview/pview.cxx
index 9ca718e..a432a4d 100644
--- a/sw/source/uibase/uiview/pview.cxx
+++ b/sw/source/uibase/uiview/pview.cxx
@@ -103,20 +103,20 @@ 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)
{
if(nCurrentZoom > aZoomArr[i] || !i)
return aZoomArr[i];
}
}
else
{
for(sal_uInt16 i : aZoomArr)
{
if(nCurrentZoom < i)
return i;
}
}
else
{
for(int i = nZoomArrSize - 1; i >= 0; --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 a9e7166..0e96945 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 e260609..bacc2f3 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);
}