Kaydet (Commit) 54831384 authored tarafından Szymon Kłos's avatar Szymon Kłos

Working toolbar entry: Save As > Remote file

Change-Id: I5601c7847f30a7d5fb7ede5f90b2a6a89f4c8693
üst 92f32585
......@@ -41,7 +41,7 @@ using namespace framework;
namespace {
static const char CMD_SAVE_REMOTE[] = ".uno:OpenRemote"; // TODO
static const char CMD_SAVE_REMOTE[] = ".uno:SaveAsRemote";
class SaveAsMenuController : public svt::PopupMenuControllerBase
{
......@@ -115,9 +115,9 @@ void SaveAsMenuController::fillPopupMenu( Reference< css::awt::XPopupMenu >& rPo
if ( pVCLPopupMenu )
{
// Open remote menu entry
pVCLPopupMenu->InsertItem( sal_uInt16( 0 ),
pVCLPopupMenu->InsertItem( sal_uInt16( 1 ),
FWK_RESSTR( STR_REMOTE_FILE ) );
pVCLPopupMenu->SetItemCommand( sal_uInt16( 0 ),
pVCLPopupMenu->SetItemCommand( sal_uInt16( 1 ),
OUString( CMD_SAVE_REMOTE ) );
}
}
......@@ -160,6 +160,7 @@ void SAL_CALL SaveAsMenuController::itemSelected( const css::awt::MenuEvent& rEv
if ( aCommand == CMD_SAVE_REMOTE )
{
Sequence< PropertyValue > aArgsList( 0 );
dispatchCommand( CMD_SAVE_REMOTE, aArgsList );
}
}
......
......@@ -102,6 +102,7 @@
#define SID_JUMPTOMARK (SID_SFX_START + 598)
#define SID_OPENTEMPLATE (SID_SFX_START + 594)
#define SID_SAVEASDOC (SID_SFX_START + 502)
#define SID_SAVEASREMOTE (SID_SFX_START + 516)
#define SID_SAVEACOPY (SID_SFX_START + 999)
#define SID_SAVEACOPYITEM (SID_SFX_START + 998)
#define SID_CLOSING (SID_SFX_START +1539)
......
......@@ -148,6 +148,11 @@ interface OfficeDocument : Document
ExecMethod = ExecFile_Impl ;
StateMethod = GetState_Impl ;
]
SID_SAVEASREMOTE // ole(req) api(final/play/rec)
[
ExecMethod = ExecFile_Impl ;
StateMethod = GetState_Impl ;
]
SID_DOCTEMPLATE // ole(no) api(final/play/rec)
[
ExecMethod = ExecFile_Impl ;
......
......@@ -5013,6 +5013,33 @@ SfxBoolItem SaveAs SID_SAVEASDOC
GroupId = GID_DOCUMENT;
]
SfxBoolItem SaveAsRemote SID_SAVEASREMOTE
(SfxStringItem URL SID_FILE_NAME,SfxStringItem FilterName SID_FILTER_NAME,SfxStringItem Password SID_PASSWORD,SfxBoolItem PasswordInteraction SID_PASSWORDINTERACTION,SfxStringItem FilterOptions SID_FILE_FILTEROPTIONS,SfxStringItem VersionComment SID_DOCINFO_COMMENTS,SfxStringItem VersionAuthor SID_DOCINFO_AUTHOR,SfxBoolItem Overwrite SID_OVERWRITE,SfxBoolItem Unpacked SID_UNPACK,SfxBoolItem SaveTo SID_SAVETO)
[
/* flags: */
AutoUpdate = FALSE,
Cachable = Cachable,
FastCall = FALSE,
HasCoreId = FALSE,
HasDialog = TRUE,
ReadOnlyDoc = TRUE,
Toggle = FALSE,
Container = TRUE,
RecordAbsolute = FALSE,
RecordPerSet;
Synchron;
/* status: */
SlotType = SfxStringItem
/* config: */
AccelConfig = TRUE,
MenuConfig = TRUE,
StatusBarConfig = FALSE,
ToolBoxConfig = TRUE,
GroupId = GID_DOCUMENT;
]
SfxBoolItem SaveAsTemplate SID_DOCTEMPLATE
(SfxStringItem TemplateRegion SID_TEMPLATE_REGIONNAME,SfxStringItem TemplateName SID_TEMPLATE_NAME)
......
......@@ -105,6 +105,7 @@
#define SAVE_REQUESTED 16
#define SAVEAS_REQUESTED 32
#define SAVEACOPY_REQUESTED 64
#define SAVEASREMOTE_REQUESTED -1
// possible statuses of save operation
#define STATUS_NO_ACTION 0
......@@ -136,6 +137,8 @@ static sal_uInt16 getSlotIDFromMode( sal_Int8 nStoreMode )
nResult = SID_DIRECTEXPORTDOCASPDF;
else if ( nStoreMode == SAVEAS_REQUESTED || nStoreMode == ( EXPORT_REQUESTED | WIDEEXPORT_REQUESTED ) )
nResult = SID_SAVEASDOC;
else if ( nStoreMode == SAVEASREMOTE_REQUESTED )
nResult = SID_SAVEASREMOTE;
else {
DBG_ASSERT( false, "Unacceptable slot name is provided!\n" );
}
......@@ -157,6 +160,8 @@ static sal_uInt8 getStoreModeFromSlotName( const OUString& aSlotName )
nResult = SAVE_REQUESTED;
else if ( aSlotName == "SaveAs" )
nResult = SAVEAS_REQUESTED;
else if ( aSlotName == "SaveAsRemote" )
nResult = SAVEASREMOTE_REQUESTED;
else
throw task::ErrorCodeIOException(
("getStoreModeFromSlotName(\"" + aSlotName
......@@ -544,7 +549,7 @@ uno::Sequence< beans::PropertyValue > ModelData_Impl::GetPreselectedFilter_Impl(
SfxFilterFlags nMust = getMustFlags( nStoreMode );
SfxFilterFlags nDont = getDontFlags( nStoreMode );
if ( nStoreMode & PDFEXPORT_REQUESTED )
if ( ( nStoreMode != SAVEASREMOTE_REQUESTED ) && ( nStoreMode & PDFEXPORT_REQUESTED ) )
{
// Preselect PDF-Filter for EXPORT
uno::Sequence< beans::NamedValue > aSearchRequest( 2 );
......@@ -1545,17 +1550,25 @@ bool SfxStoringHelper::GUIStoreModel( uno::Reference< frame::XModel > xModel,
if ( aFileNameIter == aModelData.GetMediaDescr().end() )
{
sal_Int16 nDialog = SFX2_IMPL_DIALOG_CONFIG;
::comphelper::SequenceAsHashMap::const_iterator aDlgIter =
aModelData.GetMediaDescr().find( OUString("UseSystemDialog") );
if ( aDlgIter != aModelData.GetMediaDescr().end() )
if( nStoreMode == SAVEASREMOTE_REQUESTED )
{
bool bUseSystemDialog = true;
if ( aDlgIter->second >>= bUseSystemDialog )
nDialog = SFX2_IMPL_DIALOG_REMOTE;
}
else
{
::comphelper::SequenceAsHashMap::const_iterator aDlgIter =
aModelData.GetMediaDescr().find( OUString("UseSystemDialog") );
if ( aDlgIter != aModelData.GetMediaDescr().end() )
{
if ( bUseSystemDialog )
nDialog = SFX2_IMPL_DIALOG_SYSTEM;
else
nDialog = SFX2_IMPL_DIALOG_OOO;
bool bUseSystemDialog = true;
if ( aDlgIter->second >>= bUseSystemDialog )
{
if ( bUseSystemDialog )
nDialog = SFX2_IMPL_DIALOG_SYSTEM;
else
nDialog = SFX2_IMPL_DIALOG_OOO;
}
}
}
......
......@@ -528,13 +528,13 @@ void SfxObjectShell::ExecFile_Impl(SfxRequest &rReq)
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
case SID_EXPORTDOCASPDF:
case SID_DIRECTEXPORTDOCASPDF:
bIsPDFExport = true;
//fall-through
case SID_EXPORTDOC:
case SID_SAVEASDOC:
case SID_SAVEASREMOTE:
case SID_SAVEDOC:
{
// derived class may decide to abort this
......
......@@ -62,7 +62,6 @@
// Region: File
#define FN_NEW_GLOBAL_DOC (FN_FILE + 4 ) /* Create Global Document */
#define FN_SAVE_FILE_AS (FN_FILE + 5 ) /* Save As */
#define FN_OPEN_FILE (FN_FILE + 7 ) /* Open */
#define FN_OUTLINE_TO_IMPRESS (FN_FILE + 36) /* Send outline to impress */
......
......@@ -59,11 +59,6 @@ interface TextDocument : BaseTextDocument
ExecMethod = Execute;
StateMethod = GetState;
]
FN_SAVE_FILE_AS
[
ExecMethod = Execute;
StateMethod = GetState;
]
}
shell SwDocShell
......
......@@ -10124,33 +10124,6 @@ SfxVoidItem OpenFromWriter FN_OPEN_FILE
GroupId = GID_APPLICATION;
]
SfxVoidItem SaveAs FN_SAVE_FILE_AS
()
[
/* flags: */
AutoUpdate = FALSE,
Cachable = Cachable,
FastCall = FALSE,
HasCoreId = FALSE,
HasDialog = FALSE,
ReadOnlyDoc = TRUE,
Toggle = FALSE,
Container = FALSE,
RecordAbsolute = FALSE,
RecordPerSet;
Synchron;
/* status: */
SlotType = SfxStringItem
/* config: */
AccelConfig = TRUE,
MenuConfig = TRUE,
StatusBarConfig = FALSE,
ToolBoxConfig = TRUE,
GroupId = GID_APPLICATION;
]
SfxInt16Item PageColumnType SID_ATTR_PAGE_COLUMN
[
......
......@@ -296,7 +296,7 @@ void SwDLL::RegisterControls()
SvxColorToolBoxControl::RegisterControl( SID_EXTRUSION_3D_COLOR, pMod );
svx::FontWorkShapeTypeControl::RegisterControl( SID_FONTWORK_SHAPE_TYPE, pMod );
SfxSaveAsToolBoxControl::RegisterControl(FN_SAVE_FILE_AS, pMod );
SfxSaveAsToolBoxControl::RegisterControl(SID_SAVEASDOC, pMod );
SvxClipBoardControl::RegisterControl(SID_PASTE, pMod );
SvxUndoRedoControl::RegisterControl(SID_UNDO, pMod );
SvxUndoRedoControl::RegisterControl(SID_REDO, pMod );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment