[PATCH] fdo#63351 make use of ZoomSlider in StarMath

Thomas Arnhold (via Code Review) gerrit at gerrit.libreoffice.org
Mon May 27 06:02:56 PDT 2013


Hi,

I have submitted a patch for review:

    https://gerrit.libreoffice.org/4053

To pull it, you can do:

    git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/53/4053/1

fdo#63351 make use of ZoomSlider in StarMath

In collaboration with Marcos Souza <marcos.souza.org at gmail.com> :)

Includes some reordering of the statusbar: Zoom and ZoomSlider right,
left field with automatic size adjustment.

Change-Id: Ibfb1eab1abef7b026eeb7fd7c0a778c433c9e208
---
M starmath/sdi/smslots.sdi
M starmath/source/smdll.cxx
M starmath/source/typemap.cxx
M starmath/source/view.cxx
M starmath/uiconfig/smath/statusbar/statusbar.xml
5 files changed, 37 insertions(+), 2 deletions(-)



diff --git a/starmath/sdi/smslots.sdi b/starmath/sdi/smslots.sdi
index 7104423..5db0d63 100644
--- a/starmath/sdi/smslots.sdi
+++ b/starmath/sdi/smslots.sdi
@@ -283,6 +283,11 @@
         ExecMethod = Execute ;
         StateMethod = GetState ;
     ]
+    SID_ATTR_ZOOMSLIDER
+    [
+        ExecMethod = Execute ;
+        StateMethod = GetState ;
+    ]
     //idlpp kein Menueeintrag , also keine Texte
     SID_TEXTSTATUS //idlpp ole : no , status : no
     [
diff --git a/starmath/source/smdll.cxx b/starmath/source/smdll.cxx
index e25dca4..f1a1bc6 100644
--- a/starmath/source/smdll.cxx
+++ b/starmath/source/smdll.cxx
@@ -21,6 +21,7 @@
 #include <svx/svxids.hrc>
 #include <svx/modctrl.hxx>
 #include <svx/zoomctrl.hxx>
+#include <svx/zoomsliderctrl.hxx>
 #include <sfx2/docfac.hxx>
 #include <svx/lboxctrl.hxx>
 #include <sfx2/docfile.hxx>
@@ -67,6 +68,7 @@
         SmViewShell::RegisterFactory(1);
 
         SvxZoomStatusBarControl::RegisterControl(SID_ATTR_ZOOM, pModule);
+        SvxZoomSliderControl::RegisterControl(SID_ATTR_ZOOMSLIDER, pModule);
         SvxModifyControl::RegisterControl(SID_TEXTSTATUS, pModule);
         SvxUndoRedoControl::RegisterControl(SID_UNDO, pModule);
         SvxUndoRedoControl::RegisterControl(SID_REDO, pModule);
diff --git a/starmath/source/typemap.cxx b/starmath/source/typemap.cxx
index c53224d..2d354f7 100644
--- a/starmath/source/typemap.cxx
+++ b/starmath/source/typemap.cxx
@@ -21,6 +21,7 @@
 #include <svl/stritem.hxx>
 #include <svl/eitem.hxx>
 #include <sfx2/zoomitem.hxx>
+#include <svx/zoomslideritem.hxx>
 #include <svx/svxids.hrc>
 #include <svl/slstitm.hxx>
 
diff --git a/starmath/source/view.cxx b/starmath/source/view.cxx
index d144dde..ee6a1a3 100644
--- a/starmath/source/view.cxx
+++ b/starmath/source/view.cxx
@@ -51,6 +51,7 @@
 #include <svl/undo.hxx>
 #include <svl/whiter.hxx>
 #include <svx/dialogs.hrc>
+#include <svx/zoomslideritem.hxx>
 #include <editeng/editeng.hxx>
 #include <svx/svxdlg.hxx>
 #include <sfx2/zoomitem.hxx>
@@ -613,7 +614,10 @@
     SetTotalSize();
     SmViewShell *pViewSh = GetView();
     if (pViewSh)
+    {
         pViewSh->GetViewFrame()->GetBindings().Invalidate(SID_ATTR_ZOOM);
+        pViewSh->GetViewFrame()->GetBindings().Invalidate(SID_ATTR_ZOOMSLIDER);
+    }
     Invalidate();
 }
 
@@ -1853,6 +1857,19 @@
         }
         break;
 
+        case SID_ATTR_ZOOMSLIDER:
+        {
+            const SfxItemSet *pArgs = rReq.GetArgs();
+            const SfxPoolItem* pItem;
+
+            if ( pArgs && SFX_ITEM_SET == pArgs->GetItemState(SID_ATTR_ZOOMSLIDER, sal_True, &pItem ) )
+            {
+                const sal_uInt16 nCurrentZoom = ((const SvxZoomSliderItem *)pItem)->GetValue();
+                aGraphic.SetZoom( nCurrentZoom );
+            }
+        }
+        break;
+
         case SID_TOOLBOX:
         {
             GetViewFrame()->ToggleChildWindow( SmToolBoxWrapper::GetChildWindowId() );
@@ -1936,6 +1953,15 @@
                 rSet.DisableItem( nWh );
             break;
 
+        case SID_ATTR_ZOOMSLIDER :
+            {
+                    const sal_uInt16 nCurrentZoom = aGraphic.GetZoom();
+                    SvxZoomSliderItem aZoomSliderItem( nCurrentZoom, MINZOOM, MAXZOOM );
+                    aZoomSliderItem.AddSnappingPoint( 100 );
+                    rSet.Put( aZoomSliderItem );
+            }
+        break;
+
         case SID_NEXTERR:
         case SID_PREVERR:
         case SID_NEXTMARK:
diff --git a/starmath/uiconfig/smath/statusbar/statusbar.xml b/starmath/uiconfig/smath/statusbar/statusbar.xml
index 134507e..3c00de9 100644
--- a/starmath/uiconfig/smath/statusbar/statusbar.xml
+++ b/starmath/uiconfig/smath/statusbar/statusbar.xml
@@ -18,8 +18,9 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  -->
 <statusbar:statusbar xmlns:statusbar="http://openoffice.org/2001/statusbar" xmlns:xlink="http://www.w3.org/1999/xlink">
- <statusbar:statusbaritem xlink:href=".uno:TextStatus" statusbar:align="left" statusbar:width="300"/>
- <statusbar:statusbaritem xlink:href=".uno:Zoom" statusbar:align="center" statusbar:width="54"/>
+ <statusbar:statusbaritem xlink:href=".uno:TextStatus" statusbar:align="left" statusbar:autosize="true" statusbar:width="300"/>
  <statusbar:statusbaritem xlink:href=".uno:ModifiedStatus" statusbar:align="center" statusbar:ownerdraw="true" statusbar:width="9"/>
  <statusbar:statusbaritem xlink:href=".uno:Signature" statusbar:align="center" statusbar:ownerdraw="true" statusbar:width="16"/>
+ <statusbar:statusbaritem xlink:href=".uno:Zoom" statusbar:align="center" statusbar:width="54"/>
+ <statusbar:statusbaritem xlink:href=".uno:ZoomSlider" statusbar:align="right" statusbar:ownerdraw="true" statusbar:width="130"/>
 </statusbar:statusbar>

-- 
To view, visit https://gerrit.libreoffice.org/4053
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibfb1eab1abef7b026eeb7fd7c0a778c433c9e208
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: master
Gerrit-Owner: Thomas Arnhold <thomas at arnhold.org>



More information about the LibreOffice mailing list