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:
@@ -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,
|
||||
|
@@ -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(),
|
||||
|
@@ -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 ) )
|
||||
{
|
||||
|
@@ -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 );
|
||||
|
Reference in New Issue
Block a user