[Libreoffice-commits] core.git: officecfg/registry sfx2/sdi sfx2/source starmath/inc starmath/qa starmath/sdi starmath/source starmath/uiconfig

Rodolfo Ribeiro Gomes rodolforg at gmail.com
Thu May 30 08:45:08 PDT 2013


 officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu |    2 
 sfx2/sdi/appslots.sdi                                                |    8 
 sfx2/source/appl/appserv.cxx                                         |   16 +
 starmath/inc/starmath.hrc                                            |    5 
 starmath/qa/cppunit/test_starmath.cxx                                |    9 
 starmath/sdi/smath.sdi                                               |  124 ----------
 starmath/sdi/smslots.sdi                                             |   26 --
 starmath/source/smres.src                                            |    8 
 starmath/source/view.cxx                                             |   21 -
 starmath/uiconfig/smath/toolbar/toolbar.xml                          |    6 
 10 files changed, 35 insertions(+), 190 deletions(-)

New commits:
commit ffc2e5be1f712b09710e2096ad2f7eb81b80118d
Author: Rodolfo Ribeiro Gomes <rodolforg at gmail.com>
Date:   Tue May 28 11:22:05 2013 -0300

    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
    Reviewed-on: https://gerrit.libreoffice.org/4076
    Reviewed-by: Luboš Luňák <l.lunak at suse.cz>
    Tested-by: Luboš Luňák <l.lunak at suse.cz>

diff --git a/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu b/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu
index 46ed65a..bbed900 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu
@@ -1773,7 +1773,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 @@ interface Application
     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 @@ void SfxApplication::MiscState_Impl(SfxItemSet &rSet)
                     }
                     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 f233fa4..3b2e902 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 @@ void Test::viewZoom()
     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);
@@ -333,13 +333,6 @@ void Test::viewZoom()
         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);
-    }
-
 }
 
 CPPUNIT_TEST_SUITE_REGISTRATION(Test);
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
 ()
 [
@@ -292,31 +268,6 @@ SfxVoidItem Draw SID_DRAW
 ]
 
 //--------------------------------------------------------------------------
-SfxVoidItem FitInWindow SID_FITINWINDOW
-()
-[
-    /* 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;
-]
-
-//--------------------------------------------------------------------------
 SfxBoolItem FormelCursor SID_FORMULACURSOR
 ()
 [
@@ -878,81 +829,6 @@ SfxBoolItem ToolBox SID_TOOLBOX
 ]
 
 //--------------------------------------------------------------------------
-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,
-    MenuConfig = TRUE,
-    StatusBarConfig = FALSE,
-    ToolBoxConfig = TRUE,
-    GroupId = GID_VIEW;
-]
-
-//--------------------------------------------------------------------------
 SfxVoidItem ZoomIn SID_ZOOMIN
 ()
 [
diff --git a/starmath/sdi/smslots.sdi b/starmath/sdi/smslots.sdi
index 5db0d63..9857d39 100644
--- a/starmath/sdi/smslots.sdi
+++ b/starmath/sdi/smslots.sdi
@@ -176,21 +176,6 @@ interface FormulaView
         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 ;
@@ -206,17 +191,6 @@ interface FormulaView
         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 ;
-    ]
         //idlpp kein Menueeintrag , also keine Texte
         SID_COPYOBJECT //idlpp ole : no , status : no
         [
diff --git a/starmath/source/smres.src b/starmath/source/smres.src
index f5c36b4..147291d 100644
--- a/starmath/source/smres.src
+++ b/starmath/source/smres.src
@@ -831,19 +831,19 @@ Menu RID_VIEWMENU
     {
         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%" ;
         };
@@ -861,7 +861,7 @@ Menu RID_VIEWMENU
         };
         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 997908d..4232555 100644
--- a/starmath/source/view.cxx
+++ b/starmath/source/view.cxx
@@ -1573,23 +1573,10 @@ void SmViewShell::Execute(SfxRequest& rReq)
             }
             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:
             aGraphic.SetZoom(aGraphic.GetZoom() + 25);
             break;
@@ -1942,13 +1929,9 @@ void SmViewShell::GetState(SfxItemSet &rSet)
         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>


More information about the Libreoffice-commits mailing list