summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@gmail.com>2012-05-23 01:41:42 -0400
committerKohei Yoshida <kohei.yoshida@gmail.com>2012-05-23 02:23:07 -0400
commit124c020f4290911d2bfb8216c9680734722c8db7 (patch)
treec161f7be18a1a9fb2045ce953459c21da75de0e0 /sc
parente58eb031374fb18aa82654c01d0f0841a437c667 (diff)
Receive the file open command in Calc in order to pass doc service name.
This way the type detection is guaranteed to receive the document service name whenever a file is being opened from Calc. Change-Id: I0eec06d4ca1f3f30bcbc5685af73392276990d69
Diffstat (limited to 'sc')
-rw-r--r--sc/inc/sc.hrc1
-rw-r--r--sc/inc/sccommands.h1
-rw-r--r--sc/sdi/docsh.sdi1
-rw-r--r--sc/sdi/scalc.sdi25
-rw-r--r--sc/source/ui/docshell/docsh4.cxx11
-rw-r--r--sc/uiconfig/scalc/menubar/menubar.xml2
6 files changed, 39 insertions, 2 deletions
diff --git a/sc/inc/sc.hrc b/sc/inc/sc.hrc
index 59b6564f26ca..1860bcf3e1dd 100644
--- a/sc/inc/sc.hrc
+++ b/sc/inc/sc.hrc
@@ -296,6 +296,7 @@
#define FID_DOC_MANAGER (SC_FUNCTION_START + 1)
#define FID_CURSOR_ENTER (SC_FUNCTION_START + 2)
#define SID_MAIL (SC_FUNCTION_START + 3)
+#define SID_OPEN_CALC (SC_FUNCTION_START + 4)
#define FILE_MENU_END (SC_FUNCTION_START + 20)
#define EDIT_MENU_START (FILE_MENU_END)
diff --git a/sc/inc/sccommands.h b/sc/inc/sccommands.h
index c16902ea2306..3bac2d856bc3 100644
--- a/sc/inc/sccommands.h
+++ b/sc/inc/sccommands.h
@@ -334,6 +334,7 @@
#define CMD_FID_TAB_EVENTS ".uno:TableEvents"
#define CMD_FID_TAB_MENU_SET_TAB_BG_COLOR ".uno:SetTabBgColor"
#define CMD_FID_TAB_SET_TAB_BG_COLOR ".uno:TabBgColor"
+#define CMD_SID_OPEN_CALC ".uno:OpenFromCalc"
#endif
diff --git a/sc/sdi/docsh.sdi b/sc/sdi/docsh.sdi
index 3cc5609918e2..5891c10e6100 100644
--- a/sc/sdi/docsh.sdi
+++ b/sc/sdi/docsh.sdi
@@ -73,6 +73,7 @@ interface TableDocument
uuid = "BA338A42-064E-11d0-89CB-008029E4B0B1" ;
]
{
+ SID_OPEN_CALC [ ExecMethod = Execute; ]
SID_SBA_IMPORT [ ExecMethod = Execute; ]
SID_SC_CELLS [ ExecMethod = Execute; ]
SID_SC_CELLTEXT [ ExecMethod = Execute; ]
diff --git a/sc/sdi/scalc.sdi b/sc/sdi/scalc.sdi
index a39c8842db07..b924b8e4deed 100644
--- a/sc/sdi/scalc.sdi
+++ b/sc/sdi/scalc.sdi
@@ -8072,3 +8072,28 @@ SfxVoidItem InsertFieldDateVariable SID_INSERT_FIELD_DATE_VAR
ToolBoxConfig = FALSE,
GroupId = GID_OPTIONS;
]
+
+
+SfxVoidItem OpenFromCalc SID_OPEN_CALC
+()
+[
+ /* 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 = FALSE,
+ GroupId = GID_OPTIONS;
+]
diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx
index f01b5106aa28..a55f46f47cc5 100644
--- a/sc/source/ui/docshell/docsh4.cxx
+++ b/sc/source/ui/docshell/docsh4.cxx
@@ -30,7 +30,7 @@
#include <com/sun/star/embed/XEmbeddedObject.hpp>
#include <com/sun/star/frame/XComponentLoader.hpp>
-
+
using namespace ::com::sun::star;
@@ -67,6 +67,7 @@ using namespace ::com::sun::star;
#include <sfx2/passwd.hxx>
#include <sfx2/filedlghelper.hxx>
#include <sfx2/docinsert.hxx>
+#include "sfx2/dispatch.hxx"
#include <svl/PasswordHelper.hxx>
#include <svl/documentlockfile.hxx>
#include <svl/sharecontrolfile.hxx>
@@ -1096,6 +1097,14 @@ void ScDocShell::Execute( SfxRequest& rReq )
}
break;
+ case SID_OPEN_CALC:
+ {
+ SfxStringItem aApp(SID_DOC_SERVICE, rtl::OUString("com.sun.star.sheet.SpreadsheetDocument"));
+ SfxStringItem aTarget(SID_TARGETNAME, rtl::OUString("_blank"));
+ GetViewData()->GetDispatcher().Execute(
+ SID_OPENDOC, SFX_CALLMODE_API|SFX_CALLMODE_SYNCHRON, &aApp, &aTarget, 0L);
+ }
+ break;
default:
{
// kleiner (?) Hack -> forward der Slots an TabViewShell
diff --git a/sc/uiconfig/scalc/menubar/menubar.xml b/sc/uiconfig/scalc/menubar/menubar.xml
index 45bafb94b710..ce3e3f234785 100644
--- a/sc/uiconfig/scalc/menubar/menubar.xml
+++ b/sc/uiconfig/scalc/menubar/menubar.xml
@@ -3,7 +3,7 @@
<menu:menu menu:id=".uno:PickList">
<menu:menupopup>
<menu:menuitem menu:id=".uno:AddDirect"/>
- <menu:menuitem menu:id=".uno:Open"/>
+ <menu:menuitem menu:id=".uno:OpenFromCalc"/>
<menu:menuitem menu:id=".uno:RecentFileList"/>
<menu:menuseparator/>
<menu:menuitem menu:id=".uno:AutoPilotMenu"/>