summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-04-12 11:21:58 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-04-28 11:23:34 +0200
commit9348b322a5c230dfcc2231661b73e480b130fcd9 (patch)
tree2c81a97d6f54229c87c5e2a37c73935ffc2527ac /sd
parent5bcd18461b8cb63b477dbb74025374b4c963161a (diff)
clang-tidy readability-simplify-boolean-expr
Change-Id: Iea7ab64683f0b29794d50d774cc482b54a00e70a Reviewed-on: https://gerrit.libreoffice.org/36450 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sd')
-rw-r--r--sd/source/core/drawdoc2.cxx5
-rw-r--r--sd/source/filter/html/htmlex.cxx5
-rw-r--r--sd/source/ui/dlg/LayerTabBar.cxx2
-rw-r--r--sd/source/ui/dlg/tpoption.cxx5
-rw-r--r--sd/source/ui/func/fusel.cxx11
-rw-r--r--sd/source/ui/slidesorter/controller/SlsInsertionIndicatorHandler.cxx5
-rw-r--r--sd/source/ui/slidesorter/view/SlsViewCacheContext.cxx5
7 files changed, 8 insertions, 30 deletions
diff --git a/sd/source/core/drawdoc2.cxx b/sd/source/core/drawdoc2.cxx
index 88aa8dfccb59..87b25fc22bbe 100644
--- a/sd/source/core/drawdoc2.cxx
+++ b/sd/source/core/drawdoc2.cxx
@@ -216,10 +216,7 @@ bool SdDrawDocument::IsPageNameUnique( const OUString& rPgName ) const
nPage++;
}
- if (nCount == 1)
- return true;
- else
- return false;
+ return nCount == 1;
}
SdPage* SdDrawDocument::GetSdPage(sal_uInt16 nPgNum, PageKind ePgKind) const
diff --git a/sd/source/filter/html/htmlex.cxx b/sd/source/filter/html/htmlex.cxx
index 934f8027fba5..ebbb9c1fc1dc 100644
--- a/sd/source/filter/html/htmlex.cxx
+++ b/sd/source/filter/html/htmlex.cxx
@@ -2945,10 +2945,7 @@ bool HtmlExport::CreateASPScripts()
return false;
}
- if (!CopyScript(maExportPath, "edit.asp", maIndex))
- return false;
-
- return true;
+ return CopyScript(maExportPath, "edit.asp", maIndex);
}
static const char *PERL_Scripts[] = { "webcast.pl", "common.pl", "editpic.pl", "poll.pl", "savepic.pl", "show.pl" };
diff --git a/sd/source/ui/dlg/LayerTabBar.cxx b/sd/source/ui/dlg/LayerTabBar.cxx
index eeeb24cd42d4..7b19236c7857 100644
--- a/sd/source/ui/dlg/LayerTabBar.cxx
+++ b/sd/source/ui/dlg/LayerTabBar.cxx
@@ -287,7 +287,7 @@ void LayerTabBar::EndRenaming()
void LayerTabBar::ActivatePage()
{
- if ( /*IsInSwitching*/ true && pDrViewSh!=nullptr)
+ if (pDrViewSh!=nullptr)
{
SfxDispatcher* pDispatcher = pDrViewSh->GetViewFrame()->GetDispatcher();
diff --git a/sd/source/ui/dlg/tpoption.cxx b/sd/source/ui/dlg/tpoption.cxx
index 3d406cca077d..cb7eafc02332 100644
--- a/sd/source/ui/dlg/tpoption.cxx
+++ b/sd/source/ui/dlg/tpoption.cxx
@@ -601,10 +601,7 @@ bool SdTpOptionsMisc::SetScale( const OUString& aScale, sal_Int32& rX, sal_Int32
return false;
rY = (long) aTmp.toInt32();
- if( rY == 0 )
- return false;
-
- return true;
+ return rY != 0;
}
void SdTpOptionsMisc::UpdateCompatibilityControls()
diff --git a/sd/source/ui/func/fusel.cxx b/sd/source/ui/func/fusel.cxx
index 725ea9f4e54e..846b2e208cc5 100644
--- a/sd/source/ui/func/fusel.cxx
+++ b/sd/source/ui/func/fusel.cxx
@@ -1400,17 +1400,10 @@ bool FuSelection::AnimateObj(SdrObject* pObj, const Point& rPos)
// Check the return value from the script
bool bTmp = false;
- if ( eErr == ERRCODE_NONE &&
+ bAnimated = eErr == ERRCODE_NONE &&
aRet.getValueType() == cppu::UnoType<bool>::get() &&
( aRet >>= bTmp ) &&
- bTmp )
- {
- bAnimated = true;
- }
- else
- {
- bAnimated = false;
- }
+ bTmp;
}
else
{
diff --git a/sd/source/ui/slidesorter/controller/SlsInsertionIndicatorHandler.cxx b/sd/source/ui/slidesorter/controller/SlsInsertionIndicatorHandler.cxx
index 6e940bf7e899..f162147acdd5 100644
--- a/sd/source/ui/slidesorter/controller/SlsInsertionIndicatorHandler.cxx
+++ b/sd/source/ui/slidesorter/controller/SlsInsertionIndicatorHandler.cxx
@@ -220,10 +220,7 @@ bool InsertionIndicatorHandler::IsInsertionTrivial (
// to check that the insertion position is not directly in front or
// directly behind the selection and thus moving the selection there
// would not change the model.
- if (nInsertionIndex<nFirstIndex || nInsertionIndex>(nLastIndex+1))
- return false;
-
- return true;
+ return nInsertionIndex >= nFirstIndex && nInsertionIndex < nLastIndex;
}
bool InsertionIndicatorHandler::IsInsertionTrivial (const sal_Int8 nDndAction)
diff --git a/sd/source/ui/slidesorter/view/SlsViewCacheContext.cxx b/sd/source/ui/slidesorter/view/SlsViewCacheContext.cxx
index 10ea1f09e71d..e551acf34ded 100644
--- a/sd/source/ui/slidesorter/view/SlsViewCacheContext.cxx
+++ b/sd/source/ui/slidesorter/view/SlsViewCacheContext.cxx
@@ -66,10 +66,7 @@ void ViewCacheContext::NotifyPreviewCreation (
bool ViewCacheContext::IsIdle()
{
tools::IdleState nIdleState (tools::IdleDetection::GetIdleState(mrSlideSorter.GetContentWindow()));
- if (nIdleState == tools::IdleState::Idle)
- return true;
- else
- return false;
+ return nIdleState == tools::IdleState::Idle;
}
bool ViewCacheContext::IsVisible (cache::CacheKey aKey)