tdf#45705 Integrate zoom UI commands into Calc
This patch uses basegfx::zoomtools to zoom in and out, making it smoother.
Similar to commit c96e1ec618 done for
Writer view shell, this patch makes zoom in and zoom out commands
functional for Calc the preview shell.
Change-Id: I1612f51d39c507d192237bf2361b91e6e5723c4c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167389
Tested-by: Jenkins
Tested-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
This commit is contained in:
committed by
Ilmari Lauhakangas
parent
74bd51629e
commit
78e0626bc7
@@ -668,19 +668,16 @@ void ScPreviewShell::Execute( SfxRequest& rReq )
|
||||
}
|
||||
break;
|
||||
case SID_ZOOM_IN:
|
||||
{
|
||||
sal_uInt16 nNew = pPreview->GetZoom() + 20 ;
|
||||
nNew -= nNew % 20;
|
||||
pPreview->SetZoom( nNew );
|
||||
eZoom = SvxZoomType::PERCENT;
|
||||
rReq.Done();
|
||||
}
|
||||
break;
|
||||
case SID_ZOOM_OUT:
|
||||
{
|
||||
sal_uInt16 nNew = pPreview->GetZoom() - 1;
|
||||
nNew -= nNew % 20;
|
||||
pPreview->SetZoom( nNew );
|
||||
sal_uInt16 nNewZoom;
|
||||
const sal_uInt16 nOldZoom {pPreview->GetZoom()};
|
||||
if(SID_ZOOM_OUT == nSlot)
|
||||
nNewZoom = basegfx::zoomtools::zoomOut(nOldZoom);
|
||||
else
|
||||
nNewZoom = basegfx::zoomtools::zoomIn(nOldZoom);
|
||||
|
||||
pPreview->SetZoom(nNewZoom);
|
||||
eZoom = SvxZoomType::PERCENT;
|
||||
rReq.Done();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user