officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu | 8 ++ rsc/source/rsc/rsc.cxx | 24 +++----- sfx2/inc/filedlghelper.hrc | 2 sfx2/inc/sfx2/filedlghelper.hxx | 1 sfx2/inc/sfx2/sfx.hrc | 1 sfx2/inc/sfx2/sfxsids.hrc | 1 sfx2/sdi/docslots.sdi | 5 + sfx2/sdi/sfx.sdi | 28 ++++++++++ sfx2/source/dialog/filedlghelper.cxx | 7 ++ sfx2/source/dialog/filedlghelper.src | 6 ++ sfx2/source/dialog/filedlgimpl.hxx | 1 sfx2/source/doc/doc.hrc | 1 sfx2/source/doc/doc.src | 4 + sfx2/source/doc/guisaveas.cxx | 15 ++++- sfx2/source/doc/objserv.cxx | 23 +++++++- sw/source/ui/uiview/srcview.cxx | 1 sw/uiconfig/swriter/menubar/menubar.xml | 1 17 files changed, 112 insertions(+), 17 deletions(-)
New commits: commit e902022d4b453f1bf06d8aca907b031e7bda3dad Author: Andras Timar <ati...@suse.com> Date: Mon Mar 25 21:42:26 2013 +0100 Revert "replace DirEntry to osl::FileBase in a few cases in rsc" This reverts commit 7540bc8e105e114d4aecb1ed3f3044e5ce8a6fc6. Conflicts: rsc/source/rsc/rsc.cxx Change-Id: I7f89f7bf07f68e053d29283f659241aca8e48eed diff --git a/rsc/source/rsc/rsc.cxx b/rsc/source/rsc/rsc.cxx index 8ae15f2..8b69011 100644 --- a/rsc/source/rsc/rsc.cxx +++ b/rsc/source/rsc/rsc.cxx @@ -162,13 +162,11 @@ RscCmdLine::RscCmdLine( int argc, char ** argv, RscError * pEH ) ; if( *pEqual ) { - OUString aSPath = OStringToOUString( OString( pEqual + 1 ), RTL_TEXTENCODING_ASCII_US ); - // replace forward slash to backslash on Windows - osl::FileBase::getFileURLFromSystemPath( aSPath, aSPath ); - osl::FileBase::getSystemPathFromFileURL( aSPath, aSPath ); + const rtl::OString aSPath( pEqual + 1 ); + DirEntry aSDir(rtl::OStringToOUString(aSPath, RTL_TEXTENCODING_ASCII_US)); m_aReplacements.push_back( std::pair< OString, OString >( OString( (*ppStr)+4, pEqual - *ppStr - 4 ), - rtl::OUStringToOString(aSPath, RTL_TEXTENCODING_ASCII_US) ) ); + rtl::OUStringToOString(aSDir.GetFull(), RTL_TEXTENCODING_ASCII_US) ) ); } } else if( !rsc_stricmp( (*ppStr) + 1, "PreLoad" ) ) @@ -196,7 +194,7 @@ RscCmdLine::RscCmdLine( int argc, char ** argv, RscError * pEH ) nCommands |= INCLUDE_FLAG; rtl::OStringBuffer aBuffer(aPath); if (aBuffer.getLength()) - aBuffer.append(SAL_PATHSEPARATOR); + aBuffer.append(rtl::OUStringToOString(DirEntry::GetSearchDelimiter(), RTL_TEXTENCODING_ASCII_US)); aBuffer.append((*ppStr) + 2); aPath = aBuffer.makeStringAndClear(); } @@ -213,16 +211,14 @@ RscCmdLine::RscCmdLine( int argc, char ** argv, RscError * pEH ) // ignore empty -lip= arguments that we get lots of these days if (!aSysSearchDir.isEmpty()) { - OUString aSysDir = OStringToOUString(aSysSearchDir, RTL_TEXTENCODING_ASCII_US); - // replace forward slash to backslash on Windows - osl::FileBase::getFileURLFromSystemPath( aSysDir, aSysDir ); - osl::FileBase::getSystemPathFromFileURL( aSysDir, aSysDir ); + DirEntry aSysDir(rtl::OStringToOUString(aSysSearchDir, RTL_TEXTENCODING_ASCII_US)); m_aOutputFiles.back().aSysSearchDirs.push_back( - rtl::OUStringToOString(aSysDir, RTL_TEXTENCODING_ASCII_US) ); + rtl::OUStringToOString(aSysDir.GetFull(), RTL_TEXTENCODING_ASCII_US) ); rtl::OString aLangSearchPath = m_aOutputFiles.back().aLangSearchPath; if( !aLangSearchPath.isEmpty() ) { - aLangSearchPath = aLangSearchPath + OString( SAL_PATHSEPARATOR ); + aLangSearchPath = aLangSearchPath + + rtl::OUStringToOString(DirEntry::GetSearchDelimiter(), RTL_TEXTENCODING_ASCII_US); } aLangSearchPath = aLangSearchPath + aSysSearchDir; @@ -846,8 +842,8 @@ ERRTYPE RscCompiler::Link() pTC->pEH->FatalError( ERR_OPENFILE, RscId(), aRcTmp.getStr() ); // Schreibe Datei - sal_Char cSearchDelim = SAL_PATHSEPARATOR; - sal_Char cAccessDelim = SAL_PATHDELIMITER; + sal_Char cSearchDelim = rtl::OUStringToOString(DirEntry::GetSearchDelimiter(), RTL_TEXTENCODING_ASCII_US)[0]; + sal_Char cAccessDelim = rtl::OUStringToOString(DirEntry::GetAccessDelimiter(), RTL_TEXTENCODING_ASCII_US)[0]; pTC->ChangeLanguage( it->aLangName ); pTC->SetSourceCharSet( RTL_TEXTENCODING_UTF8 ); pTC->ClearSysNames(); commit 0e1617554c34e62a467a5e1a188353178211e8fe Author: Ãdám Csaba Király <kiraly.adam.cs...@gmail.com> Date: Fri Mar 22 21:37:25 2013 +0100 fdo#60780, Save a Copy wip GUIStoreModel now correctly calls storeToUrl instead of storeAsUrl, when saving a copy. Dialog title is correctly set. TODO: - Write help Change-Id: I4d7fc9ebc91c2129e8d8dcf9978c324bdddae129 diff --git a/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu b/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu index eb0f41b..dc3d21d 100644 --- a/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu +++ b/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu @@ -1894,6 +1894,14 @@ <value>1</value> </prop> </node> + <node oor:name=".uno:SaveACopy" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="en-US">Save a Copy...</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> <node oor:name=".uno:CheckOut" oor:op="replace"> <prop oor:name="Label" oor:type="xs:string"> <value xml:lang="en-US">Check-Out</value> diff --git a/sfx2/inc/filedlghelper.hrc b/sfx2/inc/filedlghelper.hrc index 728de09..dd0b112 100644 --- a/sfx2/inc/filedlghelper.hrc +++ b/sfx2/inc/filedlghelper.hrc @@ -36,6 +36,8 @@ #define STR_LB_IMAGE_TEMPLATE (RID_SFX_EXPLORER_START + 62) #define STR_LB_TEMPLATES (RID_SFX_EXPLORER_START + 63) #define STR_LB_VERSION (RID_SFX_EXPLORER_START + 64) +#define STR_PB_SAVEACOPY (RID_SFX_EXPLORER_START + 65) + #endif diff --git a/sfx2/inc/sfx2/filedlghelper.hxx b/sfx2/inc/sfx2/filedlghelper.hxx index 30ab36b..d576c20 100644 --- a/sfx2/inc/sfx2/filedlghelper.hxx +++ b/sfx2/inc/sfx2/filedlghelper.hxx @@ -64,6 +64,7 @@ class Window; // the SFXWB constants are for the nFlags parameter of the constructor #define SFXWB_INSERT 0x04000000L // turn Open into Insert dialog #define SFXWB_EXPORT 0x40000000L // turn Save into Export dialog +#define SFXWB_SAVEACOPY 0x00400000L // turn Save into Save a Copy dialog #define SFXWB_MULTISELECTION 0x20000000L #define SFXWB_GRAPHIC 0x00800000L // register graphic formats diff --git a/sfx2/inc/sfx2/sfx.hrc b/sfx2/inc/sfx2/sfx.hrc index 06b0fe9..245daa2 100644 --- a/sfx2/inc/sfx2/sfx.hrc +++ b/sfx2/inc/sfx2/sfx.hrc @@ -52,6 +52,7 @@ #define SFX_EVENT_ACTIVATEDOC (EVENT_SFX_START + 7) #define SFX_EVENT_DEACTIVATEDOC (EVENT_SFX_START + 8) #define SFX_EVENT_PRINTDOC (EVENT_SFX_START + 9) +#define SFX_EVENT_SAVEACOPY (EVENT_SFX_START + 10) #define SFX_EVENT_LOADFINISHED (EVENT_SFX_START + 11) diff --git a/sfx2/inc/sfx2/sfxsids.hrc b/sfx2/inc/sfx2/sfxsids.hrc index 1b0d89b..51bfd36 100644 --- a/sfx2/inc/sfx2/sfxsids.hrc +++ b/sfx2/inc/sfx2/sfxsids.hrc @@ -117,6 +117,7 @@ #define SID_JUMPTOMARK (SID_SFX_START + 598) #define SID_OPENTEMPLATE (SID_SFX_START + 594) #define SID_SAVEASDOC (SID_SFX_START + 502) +#define SID_SAVEACOPY (SID_SFX_START + 999) #define SID_CLOSING (SID_SFX_START +1539) #define SID_CLOSEDOC (SID_SFX_START + 503) #define SID_CLOSEDOCS (SID_SFX_START + 595) diff --git a/sfx2/sdi/docslots.sdi b/sfx2/sdi/docslots.sdi index 111ba6d..243a687 100644 --- a/sfx2/sdi/docslots.sdi +++ b/sfx2/sdi/docslots.sdi @@ -139,6 +139,11 @@ interface OfficeDocument : Document ExecMethod = ExecFile_Impl ; StateMethod = GetState_Impl ; ] + SID_SAVEACOPY // 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 607f206..0ffc66c 100644 --- a/sfx2/sdi/sfx.sdi +++ b/sfx2/sdi/sfx.sdi @@ -5610,6 +5610,34 @@ SfxBoolItem SaveAsTemplate SID_DOCTEMPLATE ] //-------------------------------------------------------------------------- +SfxBoolItem SaveACopy SID_SAVEACOPY +(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; +] + +//-------------------------------------------------------------------------- SfxVoidItem SaveBasicAs SID_BASICSAVEAS () [ diff --git a/sfx2/source/dialog/filedlghelper.cxx b/sfx2/source/dialog/filedlghelper.cxx index 6108a62..1712f51 100644 --- a/sfx2/source/dialog/filedlghelper.cxx +++ b/sfx2/source/dialog/filedlghelper.cxx @@ -924,6 +924,7 @@ FileDialogHelper_Impl::FileDialogHelper_Impl( mbInsert = SFXWB_INSERT == ( nFlags & SFXWB_INSERT ); mbExport = SFXWB_EXPORT == ( nFlags & SFXWB_EXPORT ); mbIsSaveDlg = sal_False; + mbIsSaveACopyDlg = SFXWB_SAVEACOPY == ( nFlags & SFXWB_SAVEACOPY ); mbPwdCheckBoxState = sal_False; mbSelection = sal_False; mbSelectionEnabled = sal_True; @@ -1119,6 +1120,12 @@ FileDialogHelper_Impl::FileDialogHelper_Impl( catch( const Exception & ) { } } + // Save a copy dialog + if ( mbIsSaveACopyDlg ) + { + mxFileDlg->setTitle( SfxResId( STR_PB_SAVEACOPY ).toString() ); + } + // the "insert file" dialog needs another title if ( mbInsert ) { diff --git a/sfx2/source/dialog/filedlghelper.src b/sfx2/source/dialog/filedlghelper.src index 220e1e9..8e9c545 100644 --- a/sfx2/source/dialog/filedlghelper.src +++ b/sfx2/source/dialog/filedlghelper.src @@ -101,6 +101,12 @@ String STR_PB_SAVE Text [ en-US ] = "~Save" ; }; +String STR_PB_SAVEACOPY +{ + Text [ en-US ] = "Save a Copy" ; +}; + + String STR_LB_IMAGE_TEMPLATE { Text [ en-US ] = "Style:" ; diff --git a/sfx2/source/dialog/filedlgimpl.hxx b/sfx2/source/dialog/filedlgimpl.hxx index 6888e09..10b8bac 100644 --- a/sfx2/source/dialog/filedlgimpl.hxx +++ b/sfx2/source/dialog/filedlgimpl.hxx @@ -87,6 +87,7 @@ namespace sfx2 sal_Bool mbHasPreview : 1; sal_Bool mbShowPreview : 1; sal_Bool mbIsSaveDlg : 1; + sal_Bool mbIsSaveACopyDlg : 1; sal_Bool mbExport : 1; sal_Bool mbDeleteMatcher : 1; diff --git a/sfx2/source/doc/doc.hrc b/sfx2/source/doc/doc.hrc index 9a38284..26947bd 100644 --- a/sfx2/source/doc/doc.hrc +++ b/sfx2/source/doc/doc.hrc @@ -88,6 +88,7 @@ #define RID_STR_FILTCONFIG (RID_SFX_DOC_START+ 52) #define RID_STR_FILTBASIC (RID_SFX_DOC_START+ 53) #define RID_STR_WARNSTYLEOVERWRITE (RID_SFX_DOC_START+ 54) +#define STR_SAVEACOPY (RID_SFX_DOC_START+ 55) #define MSG_OPEN_READONLY (RID_SFX_DOC_START+ 58) diff --git a/sfx2/source/doc/doc.src b/sfx2/source/doc/doc.src index b3117c4..fa5889e 100644 --- a/sfx2/source/doc/doc.src +++ b/sfx2/source/doc/doc.src @@ -199,6 +199,10 @@ String STR_SAVECOPYDOC { Text [ en-US ] = "Save Copy ~as..." ; }; +String STR_SAVEACOPY +{ + Text [ en-US ] = "Save a Copy..." ; +}; String STR_CLOSEDOC { Text [ en-US ] = "~Close" ; diff --git a/sfx2/source/doc/guisaveas.cxx b/sfx2/source/doc/guisaveas.cxx index c873e46..d0f02ac 100644 --- a/sfx2/source/doc/guisaveas.cxx +++ b/sfx2/source/doc/guisaveas.cxx @@ -98,12 +98,14 @@ #define WIDEEXPORT_REQUESTED 8 #define SAVE_REQUESTED 16 #define SAVEAS_REQUESTED 32 +#define SAVEACOPY_REQUESTED 64 // possible statuses of save operation #define STATUS_NO_ACTION 0 #define STATUS_SAVE 1 #define STATUS_SAVEAS 2 #define STATUS_SAVEAS_STANDARDNAME 3 +#define STATUS_SAVEACOPY 4 const char aFilterNameString[] = "FilterName"; const char aFilterOptionsString[] = "FilterOptions"; @@ -128,6 +130,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 == SAVEACOPY_REQUESTED || nStoreMode == ( EXPORT_REQUESTED | WIDEEXPORT_REQUESTED ) ) + nResult = SID_SAVEACOPY; else { DBG_ASSERT( sal_False, "Unacceptable slot name is provided!\n" ); } @@ -149,6 +153,8 @@ static sal_uInt8 getStoreModeFromSlotName( const ::rtl::OUString& aSlotName ) nResult = SAVE_REQUESTED; else if ( aSlotName == "SaveAs" ) nResult = SAVEAS_REQUESTED; + else if ( aSlotName == "SaveACopy" ) + nResult = SAVEACOPY_REQUESTED; else throw task::ErrorCodeIOException( ::rtl::OUString(), uno::Reference< uno::XInterface >(), @@ -922,6 +928,11 @@ sal_Bool ModelData_Impl::OutputFileDialog( sal_Int8 nStoreMode, aDialogFlags = SFXWB_EXPORT; } + if ( nStoreMode & SAVEACOPY_REQUESTED) + { + aDialogFlags = SFXWB_SAVEACOPY; + } + boost::scoped_ptr<sfx2::FileDialogHelper> pFileDlg; ::rtl::OUString aDocServiceName = GetDocServiceName(); @@ -1662,7 +1673,7 @@ sal_Bool SfxStoringHelper::GUIStoreModel( uno::Reference< frame::XModel > xModel try { // Document properties can contain streams that should be freed before storing aModelData.FreeDocumentProps(); - if ( ( nStoreMode & EXPORT_REQUESTED ) ) + if ( ( (nStoreMode & EXPORT_REQUESTED) || (nStoreMode & SAVEACOPY_REQUESTED) ) ) aModelData.GetStorable()->storeToURL( aURL.GetMainURL( INetURLObject::NO_DECODE ), aArgsSequence ); else aModelData.GetStorable()->storeAsURL( aURL.GetMainURL( INetURLObject::NO_DECODE ), aArgsSequence ); @@ -1688,7 +1699,7 @@ sal_Bool SfxStoringHelper::GUIStoreModel( uno::Reference< frame::XModel > xModel // this is actually a save operation with different parameters // so storeTo or storeAs without DocInfo operations are used - if ( ( nStoreMode & EXPORT_REQUESTED ) ) + if ( ( nStoreMode & EXPORT_REQUESTED ) || ( nStoreMode & SAVEACOPY_REQUESTED ) ) aModelData.GetStorable()->storeToURL( aURL.GetMainURL( INetURLObject::NO_DECODE ), aArgsSequence ); else aModelData.GetStorable()->storeAsURL( aURL.GetMainURL( INetURLObject::NO_DECODE ), aArgsSequence ); diff --git a/sfx2/source/doc/objserv.cxx b/sfx2/source/doc/objserv.cxx index 492c366..48599b8 100644 --- a/sfx2/source/doc/objserv.cxx +++ b/sfx2/source/doc/objserv.cxx @@ -542,6 +542,7 @@ void SfxObjectShell::ExecFile_Impl(SfxRequest &rReq) case SID_EXPORTDOC: case SID_SAVEASDOC: case SID_SAVEDOC: + case SID_SAVEACOPY: { // derived class may decide to abort this if( !QuerySlotExecutable( nId ) ) @@ -576,6 +577,12 @@ void SfxObjectShell::ExecFile_Impl(SfxRequest &rReq) rReq.AppendItem( SfxBoolItem( SID_SAVETO, sal_True ) ); } + if ( nId == SID_SAVEACOPY ) + { + SFX_ITEMSET_ARG( GetMedium()->GetItemSet(), pViewOnlyItem, SfxBoolItem, SID_VIEWONLY, sal_False ); + rReq.AppendItem( SfxBoolItem( SID_SAVETO, sal_True ) ); + } + // TODO/LATER: do the following GUI related actions in standalown method // ======================================================================================================== // Introduce a status indicator for GUI operation @@ -749,7 +756,7 @@ void SfxObjectShell::ExecFile_Impl(SfxRequest &rReq) nErrorCode = ( lErr != ERRCODE_IO_ABORT ) && ( nErrorCode == ERRCODE_NONE ) ? nErrorCode : lErr; } - if (nId == SID_SAVEASDOC && nErrorCode == ERRCODE_NONE) + if ( (nId == SID_SAVEASDOC || nId == SID_SAVEACOPY) && nErrorCode == ERRCODE_NONE ) { SetReadOnlyUI(false); } @@ -1054,6 +1061,20 @@ void SfxObjectShell::GetState_Impl(SfxItemSet &rSet) break; } + case SID_SAVEACOPY: + { + if( ( pImp->nLoadedFlags & SFX_LOADED_MAINDOCUMENT ) != SFX_LOADED_MAINDOCUMENT ) + { + rSet.DisableItem( nWhich ); + break; + } + if ( /*!pCombinedFilters ||*/ !GetMedium() ) + rSet.DisableItem( nWhich ); + else + rSet.Put( SfxStringItem( nWhich, SfxResId(STR_SAVEACOPY).toString() ) ); + break; + } + case SID_EXPORTDOCASPDF: case SID_DIRECTEXPORTDOCASPDF: { diff --git a/sw/source/ui/uiview/srcview.cxx b/sw/source/ui/uiview/srcview.cxx index 1cceff7..9a345c6 100644 --- a/sw/source/ui/uiview/srcview.cxx +++ b/sw/source/ui/uiview/srcview.cxx @@ -291,6 +291,7 @@ void SwSrcView::Execute(SfxRequest& rReq) TextView* pTextView = aEditWin.GetTextView(); switch( nSlot ) { + case SID_SAVEACOPY: case SID_SAVEASDOC: { SvtPathOptions aPathOpt; diff --git a/sw/uiconfig/swriter/menubar/menubar.xml b/sw/uiconfig/swriter/menubar/menubar.xml index 108aece..284cfe7 100644 --- a/sw/uiconfig/swriter/menubar/menubar.xml +++ b/sw/uiconfig/swriter/menubar/menubar.xml @@ -29,6 +29,7 @@ <menu:menuitem menu:id=".uno:Save"/> <menu:menuitem menu:id=".uno:SaveAs"/> <menu:menuitem menu:id=".uno:SaveAsTemplate"/> + <menu:menuitem menu:id=".uno:SaveACopy"/> <menu:menuitem menu:id=".uno:SaveAll"/> <menu:menuitem menu:id=".uno:CheckOut"/> <menu:menuitem menu:id=".uno:CancelCheckOut"/>
_______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits