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; ...@@ -41,7 +41,7 @@ using namespace framework;
namespace { namespace {
static const char CMD_SAVE_REMOTE[] = ".uno:OpenRemote"; // TODO static const char CMD_SAVE_REMOTE[] = ".uno:SaveAsRemote";
class SaveAsMenuController : public svt::PopupMenuControllerBase class SaveAsMenuController : public svt::PopupMenuControllerBase
{ {
...@@ -115,9 +115,9 @@ void SaveAsMenuController::fillPopupMenu( Reference< css::awt::XPopupMenu >& rPo ...@@ -115,9 +115,9 @@ void SaveAsMenuController::fillPopupMenu( Reference< css::awt::XPopupMenu >& rPo
if ( pVCLPopupMenu ) if ( pVCLPopupMenu )
{ {
// Open remote menu entry // Open remote menu entry
pVCLPopupMenu->InsertItem( sal_uInt16( 0 ), pVCLPopupMenu->InsertItem( sal_uInt16( 1 ),
FWK_RESSTR( STR_REMOTE_FILE ) ); FWK_RESSTR( STR_REMOTE_FILE ) );
pVCLPopupMenu->SetItemCommand( sal_uInt16( 0 ), pVCLPopupMenu->SetItemCommand( sal_uInt16( 1 ),
OUString( CMD_SAVE_REMOTE ) ); OUString( CMD_SAVE_REMOTE ) );
} }
} }
...@@ -160,6 +160,7 @@ void SAL_CALL SaveAsMenuController::itemSelected( const css::awt::MenuEvent& rEv ...@@ -160,6 +160,7 @@ void SAL_CALL SaveAsMenuController::itemSelected( const css::awt::MenuEvent& rEv
if ( aCommand == CMD_SAVE_REMOTE ) if ( aCommand == CMD_SAVE_REMOTE )
{ {
Sequence< PropertyValue > aArgsList( 0 ); Sequence< PropertyValue > aArgsList( 0 );
dispatchCommand( CMD_SAVE_REMOTE, aArgsList ); dispatchCommand( CMD_SAVE_REMOTE, aArgsList );
} }
} }
......
...@@ -102,6 +102,7 @@ ...@@ -102,6 +102,7 @@
#define SID_JUMPTOMARK (SID_SFX_START + 598) #define SID_JUMPTOMARK (SID_SFX_START + 598)
#define SID_OPENTEMPLATE (SID_SFX_START + 594) #define SID_OPENTEMPLATE (SID_SFX_START + 594)
#define SID_SAVEASDOC (SID_SFX_START + 502) #define SID_SAVEASDOC (SID_SFX_START + 502)
#define SID_SAVEASREMOTE (SID_SFX_START + 516)
#define SID_SAVEACOPY (SID_SFX_START + 999) #define SID_SAVEACOPY (SID_SFX_START + 999)
#define SID_SAVEACOPYITEM (SID_SFX_START + 998) #define SID_SAVEACOPYITEM (SID_SFX_START + 998)
#define SID_CLOSING (SID_SFX_START +1539) #define SID_CLOSING (SID_SFX_START +1539)
......
...@@ -148,6 +148,11 @@ interface OfficeDocument : Document ...@@ -148,6 +148,11 @@ interface OfficeDocument : Document
ExecMethod = ExecFile_Impl ; ExecMethod = ExecFile_Impl ;
StateMethod = GetState_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) SID_DOCTEMPLATE // ole(no) api(final/play/rec)
[ [
ExecMethod = ExecFile_Impl ; ExecMethod = ExecFile_Impl ;
......
...@@ -5013,6 +5013,33 @@ SfxBoolItem SaveAs SID_SAVEASDOC ...@@ -5013,6 +5013,33 @@ SfxBoolItem SaveAs SID_SAVEASDOC
GroupId = GID_DOCUMENT; 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 SfxBoolItem SaveAsTemplate SID_DOCTEMPLATE
(SfxStringItem TemplateRegion SID_TEMPLATE_REGIONNAME,SfxStringItem TemplateName SID_TEMPLATE_NAME) (SfxStringItem TemplateRegion SID_TEMPLATE_REGIONNAME,SfxStringItem TemplateName SID_TEMPLATE_NAME)
......
...@@ -105,6 +105,7 @@ ...@@ -105,6 +105,7 @@
#define SAVE_REQUESTED 16 #define SAVE_REQUESTED 16
#define SAVEAS_REQUESTED 32 #define SAVEAS_REQUESTED 32
#define SAVEACOPY_REQUESTED 64 #define SAVEACOPY_REQUESTED 64
#define SAVEASREMOTE_REQUESTED -1
// possible statuses of save operation // possible statuses of save operation
#define STATUS_NO_ACTION 0 #define STATUS_NO_ACTION 0
...@@ -136,6 +137,8 @@ static sal_uInt16 getSlotIDFromMode( sal_Int8 nStoreMode ) ...@@ -136,6 +137,8 @@ static sal_uInt16 getSlotIDFromMode( sal_Int8 nStoreMode )
nResult = SID_DIRECTEXPORTDOCASPDF; nResult = SID_DIRECTEXPORTDOCASPDF;
else if ( nStoreMode == SAVEAS_REQUESTED || nStoreMode == ( EXPORT_REQUESTED | WIDEEXPORT_REQUESTED ) ) else if ( nStoreMode == SAVEAS_REQUESTED || nStoreMode == ( EXPORT_REQUESTED | WIDEEXPORT_REQUESTED ) )
nResult = SID_SAVEASDOC; nResult = SID_SAVEASDOC;
else if ( nStoreMode == SAVEASREMOTE_REQUESTED )
nResult = SID_SAVEASREMOTE;
else { else {
DBG_ASSERT( false, "Unacceptable slot name is provided!\n" ); DBG_ASSERT( false, "Unacceptable slot name is provided!\n" );
} }
...@@ -157,6 +160,8 @@ static sal_uInt8 getStoreModeFromSlotName( const OUString& aSlotName ) ...@@ -157,6 +160,8 @@ static sal_uInt8 getStoreModeFromSlotName( const OUString& aSlotName )
nResult = SAVE_REQUESTED; nResult = SAVE_REQUESTED;
else if ( aSlotName == "SaveAs" ) else if ( aSlotName == "SaveAs" )
nResult = SAVEAS_REQUESTED; nResult = SAVEAS_REQUESTED;
else if ( aSlotName == "SaveAsRemote" )
nResult = SAVEASREMOTE_REQUESTED;
else else
throw task::ErrorCodeIOException( throw task::ErrorCodeIOException(
("getStoreModeFromSlotName(\"" + aSlotName ("getStoreModeFromSlotName(\"" + aSlotName
...@@ -544,7 +549,7 @@ uno::Sequence< beans::PropertyValue > ModelData_Impl::GetPreselectedFilter_Impl( ...@@ -544,7 +549,7 @@ uno::Sequence< beans::PropertyValue > ModelData_Impl::GetPreselectedFilter_Impl(
SfxFilterFlags nMust = getMustFlags( nStoreMode ); SfxFilterFlags nMust = getMustFlags( nStoreMode );
SfxFilterFlags nDont = getDontFlags( nStoreMode ); SfxFilterFlags nDont = getDontFlags( nStoreMode );
if ( nStoreMode & PDFEXPORT_REQUESTED ) if ( ( nStoreMode != SAVEASREMOTE_REQUESTED ) && ( nStoreMode & PDFEXPORT_REQUESTED ) )
{ {
// Preselect PDF-Filter for EXPORT // Preselect PDF-Filter for EXPORT
uno::Sequence< beans::NamedValue > aSearchRequest( 2 ); uno::Sequence< beans::NamedValue > aSearchRequest( 2 );
...@@ -1545,17 +1550,25 @@ bool SfxStoringHelper::GUIStoreModel( uno::Reference< frame::XModel > xModel, ...@@ -1545,17 +1550,25 @@ bool SfxStoringHelper::GUIStoreModel( uno::Reference< frame::XModel > xModel,
if ( aFileNameIter == aModelData.GetMediaDescr().end() ) if ( aFileNameIter == aModelData.GetMediaDescr().end() )
{ {
sal_Int16 nDialog = SFX2_IMPL_DIALOG_CONFIG; sal_Int16 nDialog = SFX2_IMPL_DIALOG_CONFIG;
::comphelper::SequenceAsHashMap::const_iterator aDlgIter =
aModelData.GetMediaDescr().find( OUString("UseSystemDialog") ); if( nStoreMode == SAVEASREMOTE_REQUESTED )
if ( aDlgIter != aModelData.GetMediaDescr().end() )
{ {
bool bUseSystemDialog = true; nDialog = SFX2_IMPL_DIALOG_REMOTE;
if ( aDlgIter->second >>= bUseSystemDialog ) }
else
{
::comphelper::SequenceAsHashMap::const_iterator aDlgIter =
aModelData.GetMediaDescr().find( OUString("UseSystemDialog") );
if ( aDlgIter != aModelData.GetMediaDescr().end() )
{ {
if ( bUseSystemDialog ) bool bUseSystemDialog = true;
nDialog = SFX2_IMPL_DIALOG_SYSTEM; if ( aDlgIter->second >>= bUseSystemDialog )
else {
nDialog = SFX2_IMPL_DIALOG_OOO; if ( bUseSystemDialog )
nDialog = SFX2_IMPL_DIALOG_SYSTEM;
else
nDialog = SFX2_IMPL_DIALOG_OOO;
}
} }
} }
......
...@@ -528,13 +528,13 @@ void SfxObjectShell::ExecFile_Impl(SfxRequest &rReq) ...@@ -528,13 +528,13 @@ void SfxObjectShell::ExecFile_Impl(SfxRequest &rReq)
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
case SID_EXPORTDOCASPDF: case SID_EXPORTDOCASPDF:
case SID_DIRECTEXPORTDOCASPDF: case SID_DIRECTEXPORTDOCASPDF:
bIsPDFExport = true; bIsPDFExport = true;
//fall-through //fall-through
case SID_EXPORTDOC: case SID_EXPORTDOC:
case SID_SAVEASDOC: case SID_SAVEASDOC:
case SID_SAVEASREMOTE:
case SID_SAVEDOC: case SID_SAVEDOC:
{ {
// derived class may decide to abort this // derived class may decide to abort this
......
...@@ -62,7 +62,6 @@ ...@@ -62,7 +62,6 @@
// Region: File // Region: File
#define FN_NEW_GLOBAL_DOC (FN_FILE + 4 ) /* Create Global Document */ #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_OPEN_FILE (FN_FILE + 7 ) /* Open */
#define FN_OUTLINE_TO_IMPRESS (FN_FILE + 36) /* Send outline to impress */ #define FN_OUTLINE_TO_IMPRESS (FN_FILE + 36) /* Send outline to impress */
......
...@@ -59,11 +59,6 @@ interface TextDocument : BaseTextDocument ...@@ -59,11 +59,6 @@ interface TextDocument : BaseTextDocument
ExecMethod = Execute; ExecMethod = Execute;
StateMethod = GetState; StateMethod = GetState;
] ]
FN_SAVE_FILE_AS
[
ExecMethod = Execute;
StateMethod = GetState;
]
} }
shell SwDocShell shell SwDocShell
......
...@@ -10124,33 +10124,6 @@ SfxVoidItem OpenFromWriter FN_OPEN_FILE ...@@ -10124,33 +10124,6 @@ SfxVoidItem OpenFromWriter FN_OPEN_FILE
GroupId = GID_APPLICATION; 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 SfxInt16Item PageColumnType SID_ATTR_PAGE_COLUMN
[ [
......
...@@ -296,7 +296,7 @@ void SwDLL::RegisterControls() ...@@ -296,7 +296,7 @@ void SwDLL::RegisterControls()
SvxColorToolBoxControl::RegisterControl( SID_EXTRUSION_3D_COLOR, pMod ); SvxColorToolBoxControl::RegisterControl( SID_EXTRUSION_3D_COLOR, pMod );
svx::FontWorkShapeTypeControl::RegisterControl( SID_FONTWORK_SHAPE_TYPE, 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 ); SvxClipBoardControl::RegisterControl(SID_PASTE, pMod );
SvxUndoRedoControl::RegisterControl(SID_UNDO, pMod ); SvxUndoRedoControl::RegisterControl(SID_UNDO, pMod );
SvxUndoRedoControl::RegisterControl(SID_REDO, 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