sfx2/source/doc/sfxbasemodel.cxx | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-)
New commits: commit dd278812a456148e6d4326f6013b738b48140bb0 Author: Mike Kaganski <mike.kagan...@collabora.com> AuthorDate: Sat Oct 28 18:04:42 2023 +0300 Commit: Mike Kaganski <mike.kagan...@collabora.com> CommitDate: Sat Oct 28 18:09:43 2023 +0200 Simplify a bit Change-Id: I50b7ec4a38a9489f2712bbe99fd3377c78f579b1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158590 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com> diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx index 03a511fc2fe4..52436ef8d4d6 100644 --- a/sfx2/source/doc/sfxbasemodel.cxx +++ b/sfx2/source/doc/sfxbasemodel.cxx @@ -3060,9 +3060,11 @@ void SfxBaseModel::impl_store( const OUString& sURL if( sURL.isEmpty() ) throw frame::IllegalArgumentIOException(); - bool bSaved = false; + if (!m_pData->m_pObjectShell) + return; + ::comphelper::SequenceAsHashMap aArgHash(seqArguments); - if ( !bSaveTo && m_pData->m_pObjectShell.is() && !sURL.isEmpty() + if ( !bSaveTo && !sURL.isEmpty() && !sURL.startsWith( "private:stream" ) && ::utl::UCBContentHelper::EqualURLs( getLocation(), sURL ) ) { @@ -3095,7 +3097,7 @@ void SfxBaseModel::impl_store( const OUString& sURL try { storeSelf( aArgHash.getAsConstPropertyValueList() ); - bSaved = true; + return; } catch( const lang::IllegalArgumentException& ) { @@ -3131,9 +3133,6 @@ void SfxBaseModel::impl_store( const OUString& sURL } } - if ( bSaved || !m_pData->m_pObjectShell.is() ) - return; - SfxGetpApp()->NotifyEvent( SfxEventHint( bSaveTo ? SfxEventHintId::SaveToDoc : SfxEventHintId::SaveAsDoc, GlobalEventConfig::GetEventName( bSaveTo ? GlobalEventId::SAVETODOC : GlobalEventId::SAVEASDOC ), m_pData->m_pObjectShell.get() ) );