summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorTim Hardeck <thardeck@suse.de>2012-06-11 14:39:07 +0200
committerTim Hardeck <thardeck@suse.de>2012-06-15 13:39:41 +0200
commit2368615b9fc3f60e5d6151a6e169022b4b29ff1b (patch)
tree52447d2627c024747c4c7074509b3182ba9ec2cd /sfx2
parent6484ccb4edad34d03d1300929fe20788f41b255e (diff)
added zoom submenu to View
Added zoom submenu to View with the same entries of the zoom status bar right mouse button menu. This feature was requested on the design-mailing list: http://www.mail-archive.com/design@global.libreoffice.org/msg03561.html Additionally the zoom menu entries were sorted in a more logical way. Change-Id: I5f2df8aa33be9305841fd5505c95963bee8a0ed0
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/inc/sfx2/sfxsids.hrc14
-rw-r--r--sfx2/sdi/appslots.sdi32
-rw-r--r--sfx2/sdi/sfx.sdi222
-rw-r--r--sfx2/source/appl/appserv.cxx46
4 files changed, 312 insertions, 2 deletions
diff --git a/sfx2/inc/sfx2/sfxsids.hrc b/sfx2/inc/sfx2/sfxsids.hrc
index f29902ecce2b..939a26b23d6b 100644
--- a/sfx2/inc/sfx2/sfxsids.hrc
+++ b/sfx2/inc/sfx2/sfxsids.hrc
@@ -856,9 +856,7 @@
#define SID_ZOOM_OUT (SID_SVX_START + 97)
#define SID_ZOOM_IN (SID_SVX_START + 98)
#define SID_SIZE_REAL (SID_SVX_START + 99)
-#define SID_ZOOM_100_PERCENT (SID_SIZE_REAL)
#define SID_SIZE_PAGE (SID_SVX_START + 100)
-#define SID_ZOOM_PAGE (SID_SIZE_PAGE)
#define SID_SHOW_BROWSER (SID_SVX_START + 163)
#define SID_GALLERY_BG_BRUSH (SID_SVX_START + 279)
#define SID_SEARCH_OPTIONS (SID_SVX_START + 281)
@@ -984,6 +982,18 @@
//-----------------------------------------------------------------------
+#define SID_ZOOM_OPTIMAL (SID_SIZE_OPTIMAL)
+#define SID_ZOOM_ENTIRE_PAGE (SID_SIZE_PAGE)
+#define SID_ZOOM_PAGE_WIDTH (SID_SVX_START + 1420)
+#define SID_ZOOM_50_PERCENT (SID_SVX_START + 1421)
+#define SID_ZOOM_75_PERCENT (SID_SVX_START + 1422)
+#define SID_ZOOM_100_PERCENT (SID_SIZE_REAL)
+#define SID_ZOOM_150_PERCENT (SID_SVX_START + 1423)
+#define SID_ZOOM_200_PERCENT (SID_SVX_START + 1424)
+
+
+//-----------------------------------------------------------------------
+
#define SID_ATTR_CHAR_FILLCOLOR (SID_SFX_START + 1551)
// SfxScriptOrganizerItem
diff --git a/sfx2/sdi/appslots.sdi b/sfx2/sdi/appslots.sdi
index d6d4a8508d80..4fd62fabde65 100644
--- a/sfx2/sdi/appslots.sdi
+++ b/sfx2/sdi/appslots.sdi
@@ -187,6 +187,38 @@ interface Application
ExecMethod = MiscExec_Impl ;
StateMethod = MiscState_Impl ;
]
+ SID_ZOOM_ENTIRE_PAGE
+ [
+ ExecMethod = MiscExec_Impl ;
+ ]
+ SID_ZOOM_OPTIMAL
+ [
+ ExecMethod = MiscExec_Impl ;
+ ]
+ SID_ZOOM_PAGE_WIDTH
+ [
+ ExecMethod = MiscExec_Impl ;
+ ]
+ SID_ZOOM_50_PERCENT
+ [
+ ExecMethod = MiscExec_Impl ;
+ ]
+ SID_ZOOM_75_PERCENT
+ [
+ ExecMethod = MiscExec_Impl ;
+ ]
+ SID_ZOOM_100_PERCENT
+ [
+ ExecMethod = MiscExec_Impl ;
+ ]
+ SID_ZOOM_150_PERCENT
+ [
+ ExecMethod = MiscExec_Impl ;
+ ]
+ SID_ZOOM_200_PERCENT
+ [
+ ExecMethod = MiscExec_Impl ;
+ ]
SID_HELP_TUTORIALS
[
ExecMethod = MiscExec_Impl ;
diff --git a/sfx2/sdi/sfx.sdi b/sfx2/sdi/sfx.sdi
index b209baa7ba87..80d73c2c6330 100644
--- a/sfx2/sdi/sfx.sdi
+++ b/sfx2/sdi/sfx.sdi
@@ -1965,6 +1965,228 @@ SfxBoolItem FullScreen SID_WIN_FULLSCREEN
]
//--------------------------------------------------------------------------
+SfxVoidItem ZoomPageWidth SID_ZOOM_PAGE_WIDTH
+
+[
+ /* flags: */
+ AutoUpdate = TRUE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ RecordAbsolute = FALSE,
+ RecordPerSet;
+ Asynchron;
+
+ Readonly = FALSE,
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_VIEW;
+]
+
+
+//--------------------------------------------------------------------------
+SfxVoidItem ZoomOptimal SID_ZOOM_OPTIMAL
+
+[
+ /* flags: */
+ AutoUpdate = TRUE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ RecordAbsolute = FALSE,
+ RecordPerSet;
+ Asynchron;
+
+ Readonly = FALSE,
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_VIEW;
+]
+
+
+//--------------------------------------------------------------------------
+SfxVoidItem ZoomPage SID_ZOOM_ENTIRE_PAGE
+
+[
+ /* flags: */
+ AutoUpdate = TRUE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ RecordAbsolute = FALSE,
+ RecordPerSet;
+ Asynchron;
+
+ Readonly = FALSE,
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_VIEW;
+]
+
+
+//--------------------------------------------------------------------------
+SfxVoidItem Zoom200Percent SID_ZOOM_200_PERCENT
+
+[
+ /* flags: */
+ AutoUpdate = TRUE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ RecordAbsolute = FALSE,
+ RecordPerSet;
+ Asynchron;
+
+ Readonly = FALSE,
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_VIEW;
+]
+
+
+//--------------------------------------------------------------------------
+SfxVoidItem Zoom150Percent SID_ZOOM_150_PERCENT
+
+[
+ /* flags: */
+ AutoUpdate = TRUE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ RecordAbsolute = FALSE,
+ RecordPerSet;
+ Asynchron;
+
+ Readonly = FALSE,
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_VIEW;
+]
+
+
+//--------------------------------------------------------------------------
+SfxVoidItem Zoom100Percent SID_ZOOM_100_PERCENT
+
+[
+ /* flags: */
+ AutoUpdate = TRUE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ RecordAbsolute = FALSE,
+ RecordPerSet;
+ Asynchron;
+
+ Readonly = FALSE,
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_VIEW;
+]
+
+
+//--------------------------------------------------------------------------
+SfxVoidItem Zoom75Percent SID_ZOOM_75_PERCENT
+
+[
+ /* flags: */
+ AutoUpdate = TRUE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ RecordAbsolute = FALSE,
+ RecordPerSet;
+ Asynchron;
+
+ Readonly = FALSE,
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_VIEW;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem Zoom50Percent SID_ZOOM_50_PERCENT
+
+[
+ /* flags: */
+ AutoUpdate = TRUE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ RecordAbsolute = FALSE,
+ RecordPerSet;
+ Asynchron;
+
+ Readonly = FALSE,
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_VIEW;
+]
+
+//--------------------------------------------------------------------------
SfxObjectItem GetFrameWindow SID_FILLFRAME
(SfxStringItem WindowName SID_FILLFRAME)
[
diff --git a/sfx2/source/appl/appserv.cxx b/sfx2/source/appl/appserv.cxx
index 11d5ec4e8162..917ccf4bd328 100644
--- a/sfx2/source/appl/appserv.cxx
+++ b/sfx2/source/appl/appserv.cxx
@@ -124,6 +124,7 @@
#include <sfx2/dialogs.hrc>
#include "sorgitm.hxx"
#include "sfx2/sfxhelp.hxx"
+#include <sfx2/zoomitem.hxx>
using namespace ::com::sun::star;
using namespace ::com::sun::star::beans;
@@ -601,6 +602,51 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq )
bDone = true;
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:
+ {
+ // make sure aZoom is initialized with a proper value if SetType
+ // doesn't work
+ SvxZoomItem aZoom( SVX_ZOOM_PERCENT, 100 );
+
+ switch (rReq.GetSlot())
+ {
+ case SID_ZOOM_50_PERCENT:
+ aZoom.SetValue(50);
+ break;
+ case SID_ZOOM_75_PERCENT:
+ aZoom.SetValue(75);
+ break;
+ case SID_ZOOM_100_PERCENT:
+ aZoom.SetValue(100);
+ break;
+ case SID_ZOOM_150_PERCENT:
+ aZoom.SetValue(150);
+ break;
+ case SID_ZOOM_200_PERCENT:
+ aZoom.SetValue(200);
+ break;
+ case SID_ZOOM_OPTIMAL:
+ aZoom.SetType( SVX_ZOOM_OPTIMAL );
+ break;
+ case SID_ZOOM_ENTIRE_PAGE:
+ aZoom.SetType( SVX_ZOOM_WHOLEPAGE );
+ break;
+ case SID_ZOOM_PAGE_WIDTH:
+ aZoom.SetType( SVX_ZOOM_PAGEWIDTH );
+ break;
+ }
+
+ SfxViewFrame::Current()->GetDispatcher()->Execute(SID_ATTR_ZOOM, SFX_CALLMODE_ASYNCHRON, &aZoom, 0L);
+
+ break;
+ }
case SID_AVAILABLE_TOOLBARS:
{
SfxStringItem const * pToolbarName = static_cast< SfxStringItem const *>(