diff options
author | Szymon Kłos <eszkadev@gmail.com> | 2015-07-08 23:17:53 +0200 |
---|---|---|
committer | Szymon Kłos <eszkadev@gmail.com> | 2015-07-16 09:53:34 +0200 |
commit | 548313840238eb3dcbdeb2bcfeec3fbdd9c293f7 (patch) | |
tree | 3b493dc8962e6bfcace55be31cea08ea76855119 /sfx2 | |
parent | 92f32585708a251526492f1eb576744bee8d5a5f (diff) |
Working toolbar entry: Save As > Remote file
Change-Id: I5601c7847f30a7d5fb7ede5f90b2a6a89f4c8693
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/sdi/docslots.sdi | 5 | ||||
-rw-r--r-- | sfx2/sdi/sfx.sdi | 27 | ||||
-rw-r--r-- | sfx2/source/doc/guisaveas.cxx | 33 | ||||
-rw-r--r-- | sfx2/source/doc/objserv.cxx | 2 |
4 files changed, 56 insertions, 11 deletions
diff --git a/sfx2/sdi/docslots.sdi b/sfx2/sdi/docslots.sdi index be17f4394105..9398f72f519f 100644 --- a/sfx2/sdi/docslots.sdi +++ b/sfx2/sdi/docslots.sdi @@ -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 ; diff --git a/sfx2/sdi/sfx.sdi b/sfx2/sdi/sfx.sdi index 8ccc619890fe..fbb8f60750b7 100644 --- a/sfx2/sdi/sfx.sdi +++ b/sfx2/sdi/sfx.sdi @@ -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) diff --git a/sfx2/source/doc/guisaveas.cxx b/sfx2/source/doc/guisaveas.cxx index 869ec6878f50..247c2f4372a1 100644 --- a/sfx2/source/doc/guisaveas.cxx +++ b/sfx2/source/doc/guisaveas.cxx @@ -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; + } } } diff --git a/sfx2/source/doc/objserv.cxx b/sfx2/source/doc/objserv.cxx index f35c470dbaed..c5107101580d 100644 --- a/sfx2/source/doc/objserv.cxx +++ b/sfx2/source/doc/objserv.cxx @@ -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 |