diff options
-rw-r--r-- | officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu | 6 | ||||
-rw-r--r-- | sc/inc/sc.hrc | 2 | ||||
-rw-r--r-- | sc/sdi/prevwsh.sdi | 4 | ||||
-rw-r--r-- | sc/sdi/scalc.sdi | 36 | ||||
-rw-r--r-- | sc/sdi/tabvwsh.sdi | 2 | ||||
-rw-r--r-- | sc/source/ui/unoobj/viewuno.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/view/preview.cxx | 10 | ||||
-rw-r--r-- | sc/source/ui/view/prevwsh.cxx | 10 | ||||
-rw-r--r-- | sc/source/ui/view/tabview.cxx | 4 | ||||
-rw-r--r-- | sc/source/ui/view/tabview3.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/view/tabvwsh3.cxx | 42 | ||||
-rw-r--r-- | sc/source/ui/view/tabvwsha.cxx | 17 |
12 files changed, 89 insertions, 48 deletions
diff --git a/officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu b/officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu index f96f82b6259a..eaa4e6f6c184 100644 --- a/officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu +++ b/officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu @@ -319,6 +319,9 @@ <prop oor:name="Label" oor:type="xs:string"> <value xml:lang="en-US">Zoom In</value> </prop> + <prop oor:name="TargetURL" oor:type="xs:string"> + <value>.uno:ZoomPlus</value> + </prop> <prop oor:name="Properties" oor:type="xs:int"> <value>1</value> </prop> @@ -327,6 +330,9 @@ <prop oor:name="Label" oor:type="xs:string"> <value xml:lang="en-US">Zoom Out</value> </prop> + <prop oor:name="TargetURL" oor:type="xs:string"> + <value>.uno:ZoomMinus</value> + </prop> <prop oor:name="Properties" oor:type="xs:int"> <value>1</value> </prop> diff --git a/sc/inc/sc.hrc b/sc/inc/sc.hrc index f13b1fb78ab4..b493545ec810 100644 --- a/sc/inc/sc.hrc +++ b/sc/inc/sc.hrc @@ -458,8 +458,6 @@ #define SID_PREVIEW_PREVIOUS (SID_PREVIEW_START+1) #define SID_PREVIEW_FIRST (SID_PREVIEW_START+2) #define SID_PREVIEW_LAST (SID_PREVIEW_START+3) -#define SID_PREVIEW_ZOOMIN (SID_PREVIEW_START+5) -#define SID_PREVIEW_ZOOMOUT (SID_PREVIEW_START+6) #define SID_PREVIEW_CLOSE (SID_PREVIEW_START+7) #define SID_PREVIEW_MARGIN (SID_PREVIEW_START+8) #define SID_PREVIEW_SCALINGFACTOR (SID_PREVIEW_START+9) diff --git a/sc/sdi/prevwsh.sdi b/sc/sdi/prevwsh.sdi index 2dc6211ed86a..58cba8eaf47a 100644 --- a/sc/sdi/prevwsh.sdi +++ b/sc/sdi/prevwsh.sdi @@ -119,8 +119,8 @@ interface TablePrintPreview StateMethod = GetState ; GroupId = SfxGroupId::Intern ; ] - SID_PREVIEW_ZOOMIN [ ExecMethod = Execute; StateMethod = GetState; ] - SID_PREVIEW_ZOOMOUT [ ExecMethod = Execute; StateMethod = GetState; ] + SID_ZOOM_IN [ ExecMethod = Execute; StateMethod = GetState; ] + SID_ZOOM_OUT [ ExecMethod = Execute; StateMethod = GetState; ] SID_REPAINT [ ExecMethod = Execute; StateMethod = GetState; ] SID_UNDO [ ExecMethod = Execute; StateMethod = GetState; ] SID_REDO [ ExecMethod = Execute; StateMethod = GetState; ] diff --git a/sc/sdi/scalc.sdi b/sc/sdi/scalc.sdi index 86ae80497a77..077fa4adf9d9 100644 --- a/sc/sdi/scalc.sdi +++ b/sc/sdi/scalc.sdi @@ -5876,42 +5876,6 @@ SfxBoolItem WrapText SID_ATTR_ALIGN_LINEBREAK ] -SfxVoidItem ZoomIn SID_PREVIEW_ZOOMIN -() -[ - AutoUpdate = FALSE, - FastCall = FALSE, - ReadOnlyDoc = TRUE, - Toggle = FALSE, - Container = FALSE, - RecordAbsolute = FALSE, - RecordPerSet; - - AccelConfig = TRUE, - MenuConfig = FALSE, - ToolBoxConfig = TRUE, - GroupId = SfxGroupId::View; -] - - -SfxVoidItem ZoomOut SID_PREVIEW_ZOOMOUT -() -[ - AutoUpdate = FALSE, - FastCall = FALSE, - ReadOnlyDoc = TRUE, - Toggle = FALSE, - Container = FALSE, - RecordAbsolute = FALSE, - RecordPerSet; - - AccelConfig = TRUE, - MenuConfig = FALSE, - ToolBoxConfig = TRUE, - GroupId = SfxGroupId::View; -] - - SfxVoidItem FocusInputLine SID_FOCUS_INPUTLINE () [ diff --git a/sc/sdi/tabvwsh.sdi b/sc/sdi/tabvwsh.sdi index 1026c3e98105..50049bad7abc 100644 --- a/sc/sdi/tabvwsh.sdi +++ b/sc/sdi/tabvwsh.sdi @@ -161,6 +161,8 @@ interface TableEditView SID_CREATE_SW_DRAWVIEW [ ExecMethod = Execute; ] SID_ATTR_ZOOM [ ExecMethod = Execute; StateMethod = GetState; ] SID_ATTR_ZOOMSLIDER [ ExecMethod = Execute; StateMethod = GetState; ] + SID_ZOOM_IN [ ExecMethod = Execute; StateMethod = GetState; ] + SID_ZOOM_OUT [ ExecMethod = Execute; StateMethod = GetState; ] FID_INSERT_FILE [ ExecMethod = Execute; StateMethod = GetState; ] FID_SCALE [ ExecMethod = Execute; StateMethod = GetState; ] diff --git a/sc/source/ui/unoobj/viewuno.cxx b/sc/source/ui/unoobj/viewuno.cxx index feea0f85f567..5390a7d0b903 100644 --- a/sc/source/ui/unoobj/viewuno.cxx +++ b/sc/source/ui/unoobj/viewuno.cxx @@ -1397,6 +1397,8 @@ void ScTabViewObj::SetZoom(sal_Int16 nZoom) pViewSh->PaintLeft(); pViewSh->GetViewFrame()->GetBindings().Invalidate( SID_ATTR_ZOOM ); pViewSh->GetViewFrame()->GetBindings().Invalidate( SID_ATTR_ZOOMSLIDER ); + pViewSh->GetViewFrame()->GetBindings().Invalidate(SID_ZOOM_IN); + pViewSh->GetViewFrame()->GetBindings().Invalidate(SID_ZOOM_OUT); } sal_Int16 ScTabViewObj::GetZoomType() const diff --git a/sc/source/ui/view/preview.cxx b/sc/source/ui/view/preview.cxx index 2ad68508b2e6..c95d45fd5dc0 100644 --- a/sc/source/ui/view/preview.cxx +++ b/sc/source/ui/view/preview.cxx @@ -65,6 +65,8 @@ #include <memory> +#include <sfx2/sfxsids.hrc> + #define SC_PREVIEW_SHADOWSIZE 2 static tools::Long lcl_GetDisplayStart( SCTAB nTab, const ScDocument* pDoc, std::vector<tools::Long>& nPages ) @@ -654,9 +656,9 @@ void ScPreview::KeyInput( const KeyEvent& rKEvt ) sal_uInt16 nSlot = 0; switch(nKey) { - case KEY_ADD: nSlot = SID_PREVIEW_ZOOMIN; break; + case KEY_ADD: nSlot = SID_ZOOM_IN; break; case KEY_ESCAPE: nSlot = ScViewUtil::IsFullScreen( *pViewShell ) ? SID_CANCEL : SID_PREVIEW_CLOSE; break; - case KEY_SUBTRACT: nSlot = SID_PREVIEW_ZOOMOUT; break; + case KEY_SUBTRACT: nSlot = SID_ZOOM_OUT; break; } if(nSlot) { @@ -909,8 +911,8 @@ void ScPreview::StaticInvalidate() rBindings.Invalidate(SID_PREVIEW_FIRST); rBindings.Invalidate(SID_PREVIEW_LAST); rBindings.Invalidate(SID_ATTR_ZOOM); - rBindings.Invalidate(SID_PREVIEW_ZOOMIN); - rBindings.Invalidate(SID_PREVIEW_ZOOMOUT); + rBindings.Invalidate(SID_ZOOM_IN); + rBindings.Invalidate(SID_ZOOM_OUT); rBindings.Invalidate(SID_PREVIEW_SCALINGFACTOR); rBindings.Invalidate(SID_ATTR_ZOOMSLIDER); } diff --git a/sc/source/ui/view/prevwsh.cxx b/sc/source/ui/view/prevwsh.cxx index c16159c709cc..c0304ef55493 100644 --- a/sc/source/ui/view/prevwsh.cxx +++ b/sc/source/ui/view/prevwsh.cxx @@ -68,6 +68,8 @@ #include <vcl/EnumContext.hxx> #include <vcl/notebookbar.hxx> +#include <sfx2/sfxsids.hrc> + // for mouse wheel #define MINZOOM_SLIDER 10 #define MAXZOOM_SLIDER 400 @@ -676,7 +678,7 @@ void ScPreviewShell::Execute( SfxRequest& rReq ) } } break; - case SID_PREVIEW_ZOOMIN: + case SID_ZOOM_IN: { sal_uInt16 nNew = pPreview->GetZoom() + 20 ; nNew -= nNew % 20; @@ -685,7 +687,7 @@ void ScPreviewShell::Execute( SfxRequest& rReq ) rReq.Done(); } break; - case SID_PREVIEW_ZOOMOUT: + case SID_ZOOM_OUT: { sal_uInt16 nNew = pPreview->GetZoom() - 1; nNew -= nNew % 20; @@ -807,11 +809,11 @@ void ScPreviewShell::GetState( SfxItemSet& rSet ) if (!nTotal || nPage==nTotal-1) rSet.DisableItem(nWhich); break; - case SID_PREVIEW_ZOOMIN: + case SID_ZOOM_IN: if (nZoom >= 400) rSet.DisableItem(nWhich); break; - case SID_PREVIEW_ZOOMOUT: + case SID_ZOOM_OUT: if (nZoom <= 20) rSet.DisableItem(nWhich); break; diff --git a/sc/source/ui/view/tabview.cxx b/sc/source/ui/view/tabview.cxx index d9eaab465ca4..70e781d5e30c 100644 --- a/sc/source/ui/view/tabview.cxx +++ b/sc/source/ui/view/tabview.cxx @@ -749,6 +749,8 @@ void ScTabView::UpdateVarZoom() PaintLeft(); aViewData.GetViewShell()->GetViewFrame()->GetBindings().Invalidate( SID_ATTR_ZOOM ); aViewData.GetViewShell()->GetViewFrame()->GetBindings().Invalidate( SID_ATTR_ZOOMSLIDER ); + aViewData.GetBindings().Invalidate(SID_ZOOM_IN); + aViewData.GetBindings().Invalidate(SID_ZOOM_OUT); } bInZoomUpdate = false; } @@ -975,6 +977,8 @@ bool ScTabView::ScrollCommand( const CommandEvent& rCEvt, ScSplitPos ePos ) PaintLeft(); aViewData.GetBindings().Invalidate( SID_ATTR_ZOOM ); aViewData.GetBindings().Invalidate( SID_ATTR_ZOOMSLIDER ); + aViewData.GetBindings().Invalidate( SID_ZOOM_IN); + aViewData.GetBindings().Invalidate( SID_ZOOM_OUT); } bDone = true; diff --git a/sc/source/ui/view/tabview3.cxx b/sc/source/ui/view/tabview3.cxx index f9334be17c2a..11290711ab60 100644 --- a/sc/source/ui/view/tabview3.cxx +++ b/sc/source/ui/view/tabview3.cxx @@ -3032,6 +3032,8 @@ void ScTabView::ZoomChanged() SfxBindings& rBindings = aViewData.GetBindings(); rBindings.Invalidate( SID_ATTR_ZOOM ); rBindings.Invalidate( SID_ATTR_ZOOMSLIDER ); + rBindings.Invalidate(SID_ZOOM_IN); + rBindings.Invalidate(SID_ZOOM_OUT); HideNoteMarker(); diff --git a/sc/source/ui/view/tabvwsh3.cxx b/sc/source/ui/view/tabvwsh3.cxx index 5d86c0c41e4d..c2f496b3e2cd 100644 --- a/sc/source/ui/view/tabvwsh3.cxx +++ b/sc/source/ui/view/tabvwsh3.cxx @@ -57,6 +57,8 @@ #include <sfx2/lokhelper.hxx> #include <scabstdlg.hxx> +#include <basegfx/utils/zoomtools.hxx> + namespace { void collectUIInformation(const OUString& aZoom) @@ -691,6 +693,44 @@ void ScTabViewShell::Execute( SfxRequest& rReq ) } break; + // handling for SID_ZOOM_IN and SID_ZOOM_OUT is ScTabView::ScrollCommand + // CommandWheelMode::ZOOM inspired + case SID_ZOOM_IN: + case SID_ZOOM_OUT: + { + HideNoteMarker(); + + if (!GetViewData().GetViewShell()->GetViewFrame()->GetFrame().IsInPlace()) + { + // for ole inplace editing, the scale is defined by the visarea and client size + // and can't be changed directly + + const Fraction& rOldY = GetViewData().GetZoomY(); + long nOld = static_cast<long>(rOldY * 100); + long nNew; + if (SID_ZOOM_OUT == nSlot) + nNew = std::max(long(MINZOOM), basegfx::zoomtools::zoomOut(nOld)); + else + nNew = std::min(long(MAXZOOM), basegfx::zoomtools::zoomIn(nOld)); + if ( nNew != nOld) + { + bool bSyncZoom = SC_MOD()->GetAppOptions().GetSynchronizeZoom(); + SetZoomType(SvxZoomType::PERCENT, bSyncZoom); + Fraction aFract(nNew, 100); + SetZoom(aFract, aFract, bSyncZoom); + PaintGrid(); + PaintTop(); + PaintLeft(); + rBindings.Invalidate(SID_ATTR_ZOOM); + rBindings.Invalidate(SID_ATTR_ZOOMSLIDER); + rBindings.Invalidate(SID_ZOOM_IN); + rBindings.Invalidate(SID_ZOOM_OUT); + rReq.Done(); + } + } + } + break; + case SID_ATTR_ZOOM: // status row case FID_SCALE: { @@ -816,6 +856,8 @@ void ScTabViewShell::Execute( SfxRequest& rReq ) PaintTop(); PaintLeft(); rBindings.Invalidate( SID_ATTR_ZOOMSLIDER ); + rBindings.Invalidate( SID_ZOOM_IN ); + rBindings.Invalidate( SID_ZOOM_OUT ); rReq.Done(); } } diff --git a/sc/source/ui/view/tabvwsha.cxx b/sc/source/ui/view/tabvwsha.cxx index 041560a67ff6..8b6674dca3c9 100644 --- a/sc/source/ui/view/tabvwsha.cxx +++ b/sc/source/ui/view/tabvwsha.cxx @@ -291,6 +291,23 @@ void ScTabViewShell::GetState( SfxItemSet& rSet ) } break; + case SID_ZOOM_IN: + { + const Fraction& rZoomY = GetViewData().GetZoomY(); + long nZoom = static_cast<long>(rZoomY * 100); + if (nZoom >= long(MAXZOOM)) + rSet.DisableItem(nWhich); + } + break; + case SID_ZOOM_OUT: + { + const Fraction& rZoomY = GetViewData().GetZoomY(); + long nZoom = static_cast<long>(rZoomY * 100); + if (nZoom <= long(MINZOOM)) + rSet.DisableItem(nWhich); + } + break; + case FID_SCALE: case SID_ATTR_ZOOM: if ( bOle ) |