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>
This commit is contained in:
Miklos Vajna
2018-01-15 15:10:22 +01:00
parent 337f8922ed
commit e90a16d71c
4 changed files with 10 additions and 2 deletions

View File

@@ -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,

View File

@@ -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(),

View File

@@ -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 ) )
{

View File

@@ -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 );