summaryrefslogtreecommitdiff
path: root/sfx2
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-07-16 16:55:54 +0200
commit913119dc9561269b80072f0b5383418cd729d605 (patch)
treeba167ca8039f07ec563ca170e72c79a05ff93aee /sfx2
parentdb3002eae843056dcfbd6d7ad0ad333ee53251f9 (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> (cherry picked from commit e90a16d71cdcfbd785401613a2e5a29cb1167acf)
Diffstat (limited to 'sfx2')
-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 de632285788f..5f5144498d2d 100644
--- a/sfx2/sdi/sfx.sdi
+++ b/sfx2/sdi/sfx.sdi
@@ -3501,7 +3501,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 1da245af8a2e..f2982fbc04b8 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 9b48caac795c..dad9c424891c 100644
--- a/sfx2/source/doc/objstor.cxx
+++ b/sfx2/source/doc/objstor.cxx
@@ -2501,6 +2501,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 577562aa974c..a679c8f6c7fa 100644
--- a/sfx2/source/doc/sfxbasemodel.cxx
+++ b/sfx2/source/doc/sfxbasemodel.cxx
@@ -1482,7 +1482,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 );