summaryrefslogtreecommitdiff
path: root/starmath
diff options
context:
space:
mode:
authorRodolfo Ribeiro Gomes <rodolforg@gmail.com>2013-05-28 11:22:05 -0300
committerLuboš Luňák <l.lunak@suse.cz>2013-05-30 15:44:47 +0000
commitffc2e5be1f712b09710e2096ad2f7eb81b80118d (patch)
tree7f4fa2234c3b41d49d12f1d1760b4e6d73e5c7ea /starmath
parent615b3c8425fa0c5e91f61c434cd03f94897b2cac (diff)
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@suse.cz> Tested-by: Luboš Luňák <l.lunak@suse.cz>
Diffstat (limited to 'starmath')
-rw-r--r--starmath/inc/starmath.hrc5
-rw-r--r--starmath/qa/cppunit/test_starmath.cxx9
-rw-r--r--starmath/sdi/smath.sdi124
-rw-r--r--starmath/sdi/smslots.sdi26
-rw-r--r--starmath/source/smres.src8
-rw-r--r--starmath/source/view.cxx21
-rw-r--r--starmath/uiconfig/smath/toolbar/toolbar.xml6
7 files changed, 10 insertions, 189 deletions
diff --git a/starmath/inc/starmath.hrc b/starmath/inc/starmath.hrc
index f233fa4b1b53..3b2e9023e5f8 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 e9377106e35a..566861828f6b 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 6df2a617d227..84a934b6d4e1 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 5db0d631a25b..9857d3902bb6 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 f5c36b4cd36c..147291d93c24 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 997908d786da..42325559e34f 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 7ac3103fdda6..ae74d5e4812c 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>