Hi, I have submitted a patch for review:
https://gerrit.libreoffice.org/4076 To pull it, you can do: git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/76/4076/1 Clean zoom redundances in Math and fix fdo#55929 Zoom can be handled by sfx2 in many ways: - 50%, 75%, 100%, 150%, 200% - Optimal view (fit in window) - Entire page - Page width The math module was doing the first two by itself. Remove it. Strange enough, state methods for zoom interface definitions on sfx2's appslots.sdi were needed. I thought 'Container' property in sfx.sdi should do the job. It seems to do nothing, though. (The zoom should be disabled only if the object is an OLE/Container). The Help-Ids from pop-up menu in Math/Formula were kept, because they doesn't exist in sfx2. Change-Id: Ie1ae413780551b34aa36b338f9a9df79a198319c --- M officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu M sfx2/sdi/appslots.sdi M sfx2/source/appl/appserv.cxx M starmath/inc/starmath.hrc M starmath/qa/cppunit/test_starmath.cxx M starmath/sdi/smath.sdi M starmath/sdi/smslots.sdi M starmath/source/smres.src M starmath/source/view.cxx M starmath/uiconfig/smath/toolbar/toolbar.xml 10 files changed, 35 insertions(+), 190 deletions(-) diff --git a/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu b/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu index 74fbeeb..ee4c0fc 100644 --- a/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu +++ b/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu @@ -1768,7 +1768,7 @@ </node> <node oor:name=".uno:ZoomOptimal" oor:op="replace"> <prop oor:name="Label" oor:type="xs:string"> - <value xml:lang="en-US">Optimal</value> + <value xml:lang="en-US">Optimal view</value> </prop> <prop oor:name="Properties" oor:type="xs:int"> <value>1</value> diff --git a/sfx2/sdi/appslots.sdi b/sfx2/sdi/appslots.sdi index aa1da36..320a75e 100644 --- a/sfx2/sdi/appslots.sdi +++ b/sfx2/sdi/appslots.sdi @@ -182,34 +182,42 @@ SID_ZOOM_ENTIRE_PAGE [ ExecMethod = MiscExec_Impl ; + StateMethod = MiscState_Impl ; ] SID_ZOOM_OPTIMAL [ ExecMethod = MiscExec_Impl ; + StateMethod = MiscState_Impl ; ] SID_ZOOM_PAGE_WIDTH [ ExecMethod = MiscExec_Impl ; + StateMethod = MiscState_Impl ; ] SID_ZOOM_50_PERCENT [ ExecMethod = MiscExec_Impl ; + StateMethod = MiscState_Impl ; ] SID_ZOOM_75_PERCENT [ ExecMethod = MiscExec_Impl ; + StateMethod = MiscState_Impl ; ] SID_ZOOM_100_PERCENT [ ExecMethod = MiscExec_Impl ; + StateMethod = MiscState_Impl ; ] SID_ZOOM_150_PERCENT [ ExecMethod = MiscExec_Impl ; + StateMethod = MiscState_Impl ; ] SID_ZOOM_200_PERCENT [ ExecMethod = MiscExec_Impl ; + StateMethod = MiscState_Impl ; ] SID_HELP_TUTORIALS [ diff --git a/sfx2/source/appl/appserv.cxx b/sfx2/source/appl/appserv.cxx index 80a380f..825125d 100644 --- a/sfx2/source/appl/appserv.cxx +++ b/sfx2/source/appl/appserv.cxx @@ -827,6 +827,22 @@ } break; + case SID_ZOOM_50_PERCENT: + case SID_ZOOM_75_PERCENT: + case SID_ZOOM_100_PERCENT: + case SID_ZOOM_150_PERCENT: + case SID_ZOOM_200_PERCENT: + case SID_ZOOM_OPTIMAL: + case SID_ZOOM_ENTIRE_PAGE: + case SID_ZOOM_PAGE_WIDTH: + { + const SfxPoolItem *pItem; + SfxItemState aState = SfxViewFrame::Current()->GetDispatcher()->QueryState(SID_ATTR_ZOOM, pItem); + if ( aState == SFX_ITEM_DISABLED ) + rSet.DisableItem( nWhich ); + } + break; + default: break; } diff --git a/starmath/inc/starmath.hrc b/starmath/inc/starmath.hrc index 7cb9f4f..1ea7aa5 100644 --- a/starmath/inc/starmath.hrc +++ b/starmath/inc/starmath.hrc @@ -31,13 +31,9 @@ #define SID_PREVMARK (SID_SMA_START + 4) #define SID_SYMBOLS_CATALOGUE (SID_SMA_START + 5) #define SID_PREFERENCES (SID_SMA_START + 6) -#define SID_VIEW050 (SID_SMA_START + 7) -#define SID_VIEW100 (SID_SMA_START + 8) -#define SID_VIEW200 (SID_SMA_START + 9) #define SID_ZOOMIN (SID_SMA_START + 10) #define SID_ZOOMOUT (SID_SMA_START + 11) #define SID_DRAW (SID_SMA_START + 12) -#define SID_ADJUST (SID_SMA_START + 13) #define SID_TOOLBOX (SID_SMA_START + 14) #define SID_FORMULACURSOR (SID_SMA_START + 15) #define SID_FONT (SID_SMA_START + 50) @@ -51,7 +47,6 @@ #define SID_IMPORT_FORMULA (SID_SMA_START + 58) #define SID_TEXT (SID_SMA_START + 100) #define SID_GAPHIC_SM (SID_SMA_START + 101) -#define SID_FITINWINDOW (SID_SMA_START + 103) /** Command for inserting a symbol specified by a string (Inserts an SmSpecialNode) */ #define SID_INSERTSYMBOL (SID_SMA_START + 104) /** Command for inserting a math construction specified in commands.src */ diff --git a/starmath/qa/cppunit/test_starmath.cxx b/starmath/qa/cppunit/test_starmath.cxx index e937710..5668618 100644 --- a/starmath/qa/cppunit/test_starmath.cxx +++ b/starmath/qa/cppunit/test_starmath.cxx @@ -254,7 +254,7 @@ sal_uInt16 nOptimalZoom=0; { - SfxRequest aZoom(SID_FITINWINDOW, SFX_CALLMODE_SYNCHRON, m_pViewShell->GetPool()); + SfxRequest aZoom(SID_ZOOM_OPTIMAL, SFX_CALLMODE_SYNCHRON, m_pViewShell->GetPool()); m_pViewShell->Execute(aZoom); nOptimalZoom = rGraphicWindow.GetZoom(); CPPUNIT_ASSERT_MESSAGE("Should be about 800%", nOptimalZoom > nOrigZoom); @@ -331,13 +331,6 @@ m_pViewShell->Execute(aZoom); nFinalZoom = rGraphicWindow.GetZoom(); CPPUNIT_ASSERT_MESSAGE("Should be Clipped to 800%", nFinalZoom == 800); - } - - { - SfxRequest aZoom(SID_ADJUST, SFX_CALLMODE_SYNCHRON, m_pViewShell->GetPool()); - m_pViewShell->Execute(aZoom); - nFinalZoom = rGraphicWindow.GetZoom(); - CPPUNIT_ASSERT_MESSAGE("Should be the same as optimal", nOptimalZoom == nFinalZoom); } } diff --git a/starmath/sdi/smath.sdi b/starmath/sdi/smath.sdi index 6df2a61..84a934b 100644 --- a/starmath/sdi/smath.sdi +++ b/starmath/sdi/smath.sdi @@ -15,31 +15,7 @@ * except in compliance with the License. You may obtain a copy of * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -SfxVoidItem Adjust SID_ADJUST -() -[ - /* flags: */ - AutoUpdate = FALSE, - Cachable = Cachable, - FastCall = FALSE, - HasCoreId = FALSE, - HasDialog = FALSE, - ReadOnlyDoc = TRUE, - Toggle = FALSE, - Container = FALSE, - RecordAbsolute = FALSE, - RecordPerSet; - Synchron; - /* config: */ - AccelConfig = TRUE, - MenuConfig = TRUE, - StatusBarConfig = FALSE, - ToolBoxConfig = TRUE, - GroupId = GID_VIEW; -] - -//-------------------------------------------------------------------------- SfxVoidItem ChangeAlignment SID_ALIGN () [ @@ -268,31 +244,6 @@ //-------------------------------------------------------------------------- SfxVoidItem Draw SID_DRAW -() -[ - /* flags: */ - AutoUpdate = FALSE, - Cachable = Cachable, - FastCall = FALSE, - HasCoreId = FALSE, - HasDialog = FALSE, - ReadOnlyDoc = TRUE, - Toggle = FALSE, - Container = FALSE, - RecordAbsolute = FALSE, - RecordPerSet; - Synchron; - - /* config: */ - AccelConfig = TRUE, - MenuConfig = TRUE, - StatusBarConfig = FALSE, - ToolBoxConfig = TRUE, - GroupId = GID_VIEW; -] - -//-------------------------------------------------------------------------- -SfxVoidItem FitInWindow SID_FITINWINDOW () [ /* flags: */ @@ -868,81 +819,6 @@ Synchron; Readonly = FALSE, - - /* config: */ - AccelConfig = TRUE, - MenuConfig = TRUE, - StatusBarConfig = FALSE, - ToolBoxConfig = TRUE, - GroupId = GID_VIEW; -] - -//-------------------------------------------------------------------------- -SfxVoidItem View100 SID_VIEW100 -() -[ - /* flags: */ - AutoUpdate = FALSE, - Cachable = Cachable, - FastCall = FALSE, - HasCoreId = FALSE, - HasDialog = FALSE, - ReadOnlyDoc = TRUE, - Toggle = FALSE, - Container = FALSE, - RecordAbsolute = FALSE, - RecordPerSet; - Synchron; - - /* config: */ - AccelConfig = TRUE, - MenuConfig = TRUE, - StatusBarConfig = FALSE, - ToolBoxConfig = TRUE, - GroupId = GID_VIEW; -] - -//-------------------------------------------------------------------------- -SfxVoidItem View200 SID_VIEW200 -() -[ - /* flags: */ - AutoUpdate = FALSE, - Cachable = Cachable, - FastCall = FALSE, - HasCoreId = FALSE, - HasDialog = FALSE, - ReadOnlyDoc = TRUE, - Toggle = FALSE, - Container = FALSE, - RecordAbsolute = FALSE, - RecordPerSet; - Synchron; - - /* config: */ - AccelConfig = TRUE, - MenuConfig = TRUE, - StatusBarConfig = FALSE, - ToolBoxConfig = TRUE, - GroupId = GID_VIEW; -] - -//-------------------------------------------------------------------------- -SfxVoidItem View50 SID_VIEW050 -() -[ - /* flags: */ - AutoUpdate = FALSE, - Cachable = Cachable, - FastCall = FALSE, - HasCoreId = FALSE, - HasDialog = FALSE, - ReadOnlyDoc = TRUE, - Toggle = FALSE, - Container = FALSE, - RecordAbsolute = FALSE, - RecordPerSet; - Synchron; /* config: */ AccelConfig = TRUE, diff --git a/starmath/sdi/smslots.sdi b/starmath/sdi/smslots.sdi index 7104423..00e9875 100644 --- a/starmath/sdi/smslots.sdi +++ b/starmath/sdi/smslots.sdi @@ -176,21 +176,6 @@ ExecMethod = Execute ; StateMethod = GetState ; ] - SID_VIEW050 //idlpp ole : no , status : no - [ - ExecMethod = Execute ; - StateMethod = GetState ; - ] - SID_VIEW100 //idlpp ole : no , status : no - [ - ExecMethod = Execute ; - StateMethod = GetState ; - ] - SID_VIEW200 //idlpp ole : no , status : no - [ - ExecMethod = Execute ; - StateMethod = GetState ; - ] SID_ZOOMIN //idlpp ole : no , status : no [ ExecMethod = Execute ; @@ -202,17 +187,6 @@ StateMethod = GetState ; ] SID_DRAW //idlpp ole : no , status : no - [ - ExecMethod = Execute ; - StateMethod = GetState ; - ] - SID_ADJUST //idlpp ole : no , status : no - [ - ExecMethod = Execute ; - StateMethod = GetState ; - ] - //idlpp kein Menueeintrag , also keine Texte - SID_FITINWINDOW //idlpp ole : no , status : no [ ExecMethod = Execute ; StateMethod = GetState ; diff --git a/starmath/source/smres.src b/starmath/source/smres.src index 805b290..b5a776e 100644 --- a/starmath/source/smres.src +++ b/starmath/source/smres.src @@ -838,19 +838,19 @@ { MenuItem { - Identifier = SID_VIEW050 ; + Identifier = SID_ZOOM_50_PERCENT; HelpId = CMD_SID_VIEW050 ; Text [ en-US ] = "~View 50%" ; }; MenuItem { - Identifier = SID_VIEW100 ; + Identifier = SID_ZOOM_100_PERCENT ; HelpId = CMD_SID_VIEW100 ; Text [ en-US ] = "View ~100%" ; }; MenuItem { - Identifier = SID_VIEW200 ; + Identifier = SID_ZOOM_200_PERCENT ; HelpId = CMD_SID_VIEW200 ; Text [ en-US ] = "View ~200%" ; }; @@ -868,7 +868,7 @@ }; MenuItem { - Identifier = SID_ADJUST ; + Identifier = SID_ZOOM_OPTIMAL ; HelpId = CMD_SID_ADJUST ; Text [ en-US ] = "~Display All" ; }; diff --git a/starmath/source/view.cxx b/starmath/source/view.cxx index d144dde..e6179b8 100644 --- a/starmath/source/view.cxx +++ b/starmath/source/view.cxx @@ -1569,21 +1569,8 @@ } break; - case SID_ADJUST: - case SID_FITINWINDOW: + case SID_ZOOM_OPTIMAL: aGraphic.ZoomToFitInWindow(); - break; - - case SID_VIEW050: - aGraphic.SetZoom(50); - break; - - case SID_VIEW100: - aGraphic.SetZoom(100); - break; - - case SID_VIEW200: - aGraphic.SetZoom(200); break; case SID_ZOOMIN: @@ -1925,13 +1912,9 @@ case SID_ATTR_ZOOM: rSet.Put(SvxZoomItem( SVX_ZOOM_PERCENT, aGraphic.GetZoom())); /* no break here */ - case SID_VIEW050: - case SID_VIEW100: - case SID_VIEW200: - case SID_ADJUST: case SID_ZOOMIN: case SID_ZOOMOUT: - case SID_FITINWINDOW: + case SID_ZOOM_OPTIMAL: if ( GetViewFrame()->GetFrame().IsInPlace() ) rSet.DisableItem( nWh ); break; diff --git a/starmath/uiconfig/smath/toolbar/toolbar.xml b/starmath/uiconfig/smath/toolbar/toolbar.xml index 7ac3103..ae74d5e 100644 --- a/starmath/uiconfig/smath/toolbar/toolbar.xml +++ b/starmath/uiconfig/smath/toolbar/toolbar.xml @@ -20,10 +20,10 @@ <toolbar:toolbar xmlns:toolbar="http://openoffice.org/2001/toolbar" xmlns:xlink="http://www.w3.org/1999/xlink" toolbar:id="toolbar"> <toolbar:toolbaritem xlink:href=".uno:ZoomIn" toolbar:text=""/> <toolbar:toolbaritem xlink:href=".uno:ZoomOut" toolbar:text=""/> - <toolbar:toolbaritem xlink:href=".uno:View100" toolbar:text=""/> - <toolbar:toolbaritem xlink:href=".uno:Adjust" toolbar:text=""/> + <toolbar:toolbaritem xlink:href=".uno:Zoom100Percent" toolbar:text=""/> + <toolbar:toolbaritem xlink:href=".uno:ZoomOptimal" toolbar:text=""/> <toolbar:toolbarseparator/> <toolbar:toolbaritem xlink:href=".uno:Draw" toolbar:text=""/> <toolbar:toolbaritem xlink:href=".uno:FormelCursor" toolbar:text=""/> <toolbar:toolbaritem xlink:href=".uno:SymbolCatalogue" toolbar:text=""/> -</toolbar:toolbar> \ No newline at end of file +</toolbar:toolbar> -- To view, visit https://gerrit.libreoffice.org/4076 To unsubscribe, visit https://gerrit.libreoffice.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie1ae413780551b34aa36b338f9a9df79a198319c Gerrit-PatchSet: 1 Gerrit-Project: core Gerrit-Branch: master Gerrit-Owner: Rodolfo Ribeiro Gomes <l...@rodolfo.eng.br> _______________________________________________ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice