summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSzymon Kłos <eszkadev@gmail.com>2015-07-08 23:17:53 +0200
committerSzymon Kłos <eszkadev@gmail.com>2015-07-16 09:53:34 +0200
commit548313840238eb3dcbdeb2bcfeec3fbdd9c293f7 (patch)
tree3b493dc8962e6bfcace55be31cea08ea76855119
parent92f32585708a251526492f1eb576744bee8d5a5f (diff)
Working toolbar entry: Save As > Remote file
Change-Id: I5601c7847f30a7d5fb7ede5f90b2a6a89f4c8693
-rw-r--r--framework/source/uielement/saveasmenucontroller.cxx7
-rw-r--r--include/sfx2/sfxsids.hrc1
-rw-r--r--sfx2/sdi/docslots.sdi5
-rw-r--r--sfx2/sdi/sfx.sdi27
-rw-r--r--sfx2/source/doc/guisaveas.cxx33
-rw-r--r--sfx2/source/doc/objserv.cxx2
-rw-r--r--sw/inc/cmdid.h1
-rw-r--r--sw/sdi/docsh.sdi5
-rw-r--r--sw/sdi/swriter.sdi27
-rw-r--r--sw/source/uibase/app/swmodule.cxx2
10 files changed, 62 insertions, 48 deletions
diff --git a/framework/source/uielement/saveasmenucontroller.cxx b/framework/source/uielement/saveasmenucontroller.cxx
index 7e4fd92db865..646001397ba7 100644
--- a/framework/source/uielement/saveasmenucontroller.cxx
+++ b/framework/source/uielement/saveasmenucontroller.cxx
@@ -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 );
}
}
diff --git a/include/sfx2/sfxsids.hrc b/include/sfx2/sfxsids.hrc
index 0f4344ec16ca..1755eb5ad712 100644
--- a/include/sfx2/sfxsids.hrc
+++ b/include/sfx2/sfxsids.hrc
@@ -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)
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
diff --git a/sw/inc/cmdid.h b/sw/inc/cmdid.h
index 7e5bcecfde01..4f7792319d8a 100644
--- a/sw/inc/cmdid.h
+++ b/sw/inc/cmdid.h
@@ -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 */
diff --git a/sw/sdi/docsh.sdi b/sw/sdi/docsh.sdi
index 5e9fe78bca2c..9085bdf43128 100644
--- a/sw/sdi/docsh.sdi
+++ b/sw/sdi/docsh.sdi
@@ -59,11 +59,6 @@ interface TextDocument : BaseTextDocument
ExecMethod = Execute;
StateMethod = GetState;
]
- FN_SAVE_FILE_AS
- [
- ExecMethod = Execute;
- StateMethod = GetState;
- ]
}
shell SwDocShell
diff --git a/sw/sdi/swriter.sdi b/sw/sdi/swriter.sdi
index 40591989b529..6ecfbb873736 100644
--- a/sw/sdi/swriter.sdi
+++ b/sw/sdi/swriter.sdi
@@ -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
[
diff --git a/sw/source/uibase/app/swmodule.cxx b/sw/source/uibase/app/swmodule.cxx
index 8095e43766e1..7d01854d8a43 100644
--- a/sw/source/uibase/app/swmodule.cxx
+++ b/sw/source/uibase/app/swmodule.cxx
@@ -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 );