summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2020-08-06 13:32:43 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-08-14 18:03:06 +0200
commite67657d5211f6e95ddf8bd621108608573b00d5d (patch)
tree66724101dbd95721714bd40fcb4861663432774c /sfx2
parent186def8f48e273c3a3b4d23b3ab2efd0d8664731 (diff)
loplugin:simplifybool more
look for expressions like !(a && !b) which can be expanded out Change-Id: I72515a9638762b050f9a258c08da39ebfa2ef8e7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100579 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/dialog/templdlg.cxx2
-rw-r--r--sfx2/source/doc/docfile.cxx6
-rw-r--r--sfx2/source/doc/sfxbasemodel.cxx2
3 files changed, 6 insertions, 4 deletions
diff --git a/sfx2/source/dialog/templdlg.cxx b/sfx2/source/dialog/templdlg.cxx
index e706d9de3c21..022c0e4d3439 100644
--- a/sfx2/source/dialog/templdlg.cxx
+++ b/sfx2/source/dialog/templdlg.cxx
@@ -1801,7 +1801,7 @@ void SfxCommonTemplateDialog_Impl::DeleteHdl()
}
// if there are no used styles selected or the user approved the changes
- if ( !(!bUsedStyle || aApproved) )
+ if ( bUsedStyle && !aApproved )
return;
for (auto const& elem : aList)
diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx
index 4114273f2cc6..588568af05d0 100644
--- a/sfx2/source/doc/docfile.cxx
+++ b/sfx2/source/doc/docfile.cxx
@@ -793,10 +793,12 @@ void SfxMedium::StorageBackup_Impl()
::ucbhelper::Content aOriginalContent;
Reference< css::ucb::XCommandEnvironment > xDummyEnv;
- bool bBasedOnOriginalFile = ( !pImpl->pTempFile && !( !pImpl->m_aLogicName.isEmpty() && pImpl->m_bSalvageMode )
+ bool bBasedOnOriginalFile =
+ !pImpl->pTempFile
+ && ( pImpl->m_aLogicName.isEmpty() || !pImpl->m_bSalvageMode )
&& !GetURLObject().GetMainURL( INetURLObject::DecodeMechanism::NONE ).isEmpty()
&& GetURLObject().GetProtocol() == INetProtocol::File
- && ::utl::UCBContentHelper::IsDocument( GetURLObject().GetMainURL( INetURLObject::DecodeMechanism::NONE ) ) );
+ && ::utl::UCBContentHelper::IsDocument( GetURLObject().GetMainURL( INetURLObject::DecodeMechanism::NONE ) );
if ( bBasedOnOriginalFile && pImpl->m_aBackupURL.isEmpty()
&& ::ucbhelper::Content::create( GetURLObject().GetMainURL( INetURLObject::DecodeMechanism::NONE ), xDummyEnv, comphelper::getProcessComponentContext(), aOriginalContent ) )
diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx
index 533650751d75..e0b657a928d8 100644
--- a/sfx2/source/doc/sfxbasemodel.cxx
+++ b/sfx2/source/doc/sfxbasemodel.cxx
@@ -3028,7 +3028,7 @@ void SfxBaseModel::impl_store( const OUString& sURL
}
}
- if ( !(!bSaved && m_pData->m_pObjectShell.is()) )
+ if ( bSaved || !m_pData->m_pObjectShell.is() )
return;
SfxGetpApp()->NotifyEvent( SfxEventHint( bSaveTo ? SfxEventHintId::SaveToDoc : SfxEventHintId::SaveAsDoc, GlobalEventConfig::GetEventName( bSaveTo ? GlobalEventId::SAVETODOC : GlobalEventId::SAVEASDOC ),