diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2018-01-15 15:10:22 +0100 |
---|---|---|
committer | Jan Holesovsky <kendy@collabora.com> | 2018-01-18 13:39:42 +0100 |
commit | c12d7570f60e3f2311af253a999d8bedc5afcf9b (patch) | |
tree | 8b5c7e0981cac0aff8393b7bf1c81fd899bb0f61 /sfx2 | |
parent | d16bfbda418da5ce43133b93c833ff118bd3b04f (diff) |
sfx2 store: handle NoFileSync for Save (not SaveAs)
The code-path in SfxMedium and lower layers is the same, but not in
SfxObjectShell.
(cherry picked from commit e90a16d71cdcfbd785401613a2e5a29cb1167acf)
Conflicts:
sfx2/sdi/sfx.sdi
sfx2/source/doc/guisaveas.cxx
Change-Id: I85542d17cd6b3c2a0d257f5ff196e6504a194e51
Reviewed-on: https://gerrit.libreoffice.org/47980
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/sdi/sfx.sdi | 2 | ||||
-rw-r--r-- | sfx2/source/doc/guisaveas.cxx | 3 | ||||
-rw-r--r-- | sfx2/source/doc/objstor.cxx | 4 | ||||
-rw-r--r-- | sfx2/source/doc/sfxbasemodel.cxx | 3 |
4 files changed, 10 insertions, 2 deletions
diff --git a/sfx2/sdi/sfx.sdi b/sfx2/sdi/sfx.sdi index b69776927254..b83dbcaca951 100644 --- a/sfx2/sdi/sfx.sdi +++ b/sfx2/sdi/sfx.sdi @@ -3651,7 +3651,7 @@ SfxVoidItem SaveSimple SID_SAVESIMPLE ] SfxBoolItem Save SID_SAVEDOC -(SfxStringItem VersionComment SID_DOCINFO_COMMENTS,SfxStringItem Author SID_DOCINFO_AUTHOR,SfxBoolItem DontTerminateEdit FN_PARAM_1) +(SfxStringItem VersionComment SID_DOCINFO_COMMENTS,SfxStringItem Author SID_DOCINFO_AUTHOR,SfxBoolItem DontTerminateEdit FN_PARAM_1,SfxBoolItem NoFileSync SID_NO_FILE_SYNC) [ AutoUpdate = FALSE, FastCall = FALSE, diff --git a/sfx2/source/doc/guisaveas.cxx b/sfx2/source/doc/guisaveas.cxx index cb523640201a..e8da4ced6501 100644 --- a/sfx2/source/doc/guisaveas.cxx +++ b/sfx2/source/doc/guisaveas.cxx @@ -689,6 +689,7 @@ sal_Int8 ModelData_Impl::CheckStateForSave() OUString aInteractionHandlerString("InteractionHandler"); OUString aStatusIndicatorString("StatusIndicator"); OUString aFailOnWarningString("FailOnWarning"); + OUString aNoFileSync("NoFileSync"); if ( GetMediaDescr().find( aVersionCommentString ) != GetMediaDescr().end() ) aAcceptedArgs[ aVersionCommentString ] = GetMediaDescr()[ aVersionCommentString ]; @@ -702,6 +703,8 @@ sal_Int8 ModelData_Impl::CheckStateForSave() aAcceptedArgs[ aStatusIndicatorString ] = GetMediaDescr()[ aStatusIndicatorString ]; if ( GetMediaDescr().find( aFailOnWarningString ) != GetMediaDescr().end() ) aAcceptedArgs[ aFailOnWarningString ] = GetMediaDescr()[ aFailOnWarningString ]; + if (GetMediaDescr().find(aNoFileSync) != GetMediaDescr().end()) + aAcceptedArgs[aNoFileSync] = GetMediaDescr()[aNoFileSync]; // remove unacceptable entry if there is any DBG_ASSERT( GetMediaDescr().size() == aAcceptedArgs.size(), diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx index d373917c3158..02837baf99e1 100644 --- a/sfx2/source/doc/objstor.cxx +++ b/sfx2/source/doc/objstor.cxx @@ -2526,6 +2526,10 @@ bool SfxObjectShell::DoSave_Impl( const SfxItemSet* pArgs ) if ( pxInteractionItem && ( pxInteractionItem->GetValue() >>= xInteract ) && xInteract.is() ) pMediumTmp->GetItemSet()->Put( SfxUnoAnyItem( SID_INTERACTIONHANDLER, makeAny( xInteract ) ) ); + const SfxBoolItem* pNoFileSync = pArgs->GetItem<SfxBoolItem>(SID_NO_FILE_SYNC, false); + if (pNoFileSync && pNoFileSync->GetValue()) + pMediumTmp->DisableFileSync(true); + bool bSaved = false; if( !GetError() && SaveTo_Impl( *pMediumTmp, pArgs ) ) { diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx index 58685bfbbc96..520d961d4528 100644 --- a/sfx2/source/doc/sfxbasemodel.cxx +++ b/sfx2/source/doc/sfxbasemodel.cxx @@ -1505,7 +1505,8 @@ void SAL_CALL SfxBaseModel::storeSelf( const Sequence< beans::PropertyValue > && aSeqArgs[nInd].Name != "InteractionHandler" && aSeqArgs[nInd].Name != "StatusIndicator" && aSeqArgs[nInd].Name != "VersionMajor" && aSeqArgs[nInd].Name != "FailOnWarning" - && aSeqArgs[nInd].Name != "CheckIn" ) + && aSeqArgs[nInd].Name != "CheckIn" + && aSeqArgs[nInd].Name != "NoFileSync" ) { m_pData->m_pObjectShell->AddLog( OSL_LOG_PREFIX "unexpected parameter for storeSelf, might be no problem if SaveAs is executed." ); m_pData->m_pObjectShell->StoreLog(); |