summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2018-01-15 15:10:22 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2018-01-16 09:03:16 +0100
commite90a16d71cdcfbd785401613a2e5a29cb1167acf (patch)
tree19b7fbfec937d9fa36745fdfd5691dc926362aa3
parent337f8922edbdae7cb3e6659ea6bf3bde9ba8adb0 (diff)
sfx2 store: handle NoFileSync for Save (not SaveAs)
The code-path in SfxMedium and lower layers is the same, but not in SfxObjectShell. Change-Id: I85542d17cd6b3c2a0d257f5ff196e6504a194e51 Reviewed-on: https://gerrit.libreoffice.org/47903 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
-rw-r--r--sfx2/sdi/sfx.sdi2
-rw-r--r--sfx2/source/doc/guisaveas.cxx3
-rw-r--r--sfx2/source/doc/objstor.cxx4
-rw-r--r--sfx2/source/doc/sfxbasemodel.cxx3
4 files changed, 10 insertions, 2 deletions
diff --git a/sfx2/sdi/sfx.sdi b/sfx2/sdi/sfx.sdi
index 0ddf3653c3c0..74d780bd63bd 100644
--- a/sfx2/sdi/sfx.sdi
+++ b/sfx2/sdi/sfx.sdi
@@ -3520,7 +3520,7 @@ SfxVoidItem SaveSimple SID_SAVESIMPLE
]
SfxStringItem 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 9faeef85804e..4240f62f16e2 100644
--- a/sfx2/source/doc/guisaveas.cxx
+++ b/sfx2/source/doc/guisaveas.cxx
@@ -699,6 +699,7 @@ sal_Int8 ModelData_Impl::CheckStateForSave()
const OUString aInteractionHandlerString("InteractionHandler");
const OUString aStatusIndicatorString("StatusIndicator");
const OUString aFailOnWarningString("FailOnWarning");
+ const OUString aNoFileSync("NoFileSync");
if ( GetMediaDescr().find( aVersionCommentString ) != GetMediaDescr().end() )
aAcceptedArgs[ aVersionCommentString ] = GetMediaDescr()[ aVersionCommentString ];
@@ -712,6 +713,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 3bac7ae20b97..a9692634b662 100644
--- a/sfx2/source/doc/objstor.cxx
+++ b/sfx2/source/doc/objstor.cxx
@@ -2481,6 +2481,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 a383427ae0c5..69ba0a93c0a0 100644
--- a/sfx2/source/doc/sfxbasemodel.cxx
+++ b/sfx2/source/doc/sfxbasemodel.cxx
@@ -1476,7 +1476,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" )
{
const OUString aMessage( "Unexpected MediaDescriptor parameter: " + aSeqArgs[nInd].Name );
throw lang::IllegalArgumentException( aMessage, Reference< XInterface >(), 1 );