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
This commit is contained in:
Kohei Yoshida
2012-05-23 01:41:42 -04:00
parent e58eb03137
commit 124c020f42
7 changed files with 44 additions and 2 deletions

View File

@@ -1529,6 +1529,11 @@
<value xml:lang="en-US">Insert Date Field (variable)</value>
</prop>
</node>
<node oor:name=".uno:OpenFromCalc" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
<value xml:lang="en-US">~Open...</value>
</prop>
</node>
</node>
<node oor:name="Popups">
<node oor:name=".uno:AuditMenu" oor:op="replace">

View File

@@ -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)

View File

@@ -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

View File

@@ -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; ]

View File

@@ -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;
]

View File

@@ -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

View File

@@ -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"/>