summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2014-05-02 15:42:25 +0200
committerNoel Grandin <noel@peralex.com>2014-05-05 12:47:48 +0200
commit4f9b21248ffdf55cef9f3f9d1da76778ee000775 (patch)
treeb059d288339a68aa4c3901f1100e99b04d05a23d /sd
parentb4107411900f5bb4c215e2d9db09fc2b2b82939b (diff)
simplify ternary conditions "xxx ? yyy : false"
Look for code like: xxx ? yyy : false; Which can be simplified to: xxx && yyy Change-Id: Ia33c0e452aa28af3f0658a5382895aaad0246b4d
Diffstat (limited to 'sd')
-rw-r--r--sd/source/core/EffectMigration.cxx2
-rw-r--r--sd/source/core/drawdoc4.cxx2
-rw-r--r--sd/source/core/undo/undoobjects.cxx2
-rw-r--r--sd/source/ui/animations/CustomAnimationCreateDialog.cxx4
-rw-r--r--sd/source/ui/slideshow/slideshow.cxx10
-rw-r--r--sd/source/ui/table/TableDesignPane.cxx4
-rw-r--r--sd/source/ui/unoidl/unoobj.cxx2
-rw-r--r--sd/source/ui/unoidl/unopage.cxx8
-rw-r--r--sd/source/ui/view/sdview3.cxx2
9 files changed, 18 insertions, 18 deletions
diff --git a/sd/source/core/EffectMigration.cxx b/sd/source/core/EffectMigration.cxx
index 2c1e94010dd6..7c04a0b31f37 100644
--- a/sd/source/core/EffectMigration.cxx
+++ b/sd/source/core/EffectMigration.cxx
@@ -990,7 +990,7 @@ void EffectMigration::SetDimHide( SvxShape* pShape, bool bDimHide )
CustomAnimationEffectPtr pEffect( (*aIter) );
if( pEffect->getTargetShape() == xShape )
{
- pEffect->setHasAfterEffect( bDimHide ? true : false );
+ pEffect->setHasAfterEffect( bDimHide );
if( bDimHide ) {
Any aEmpty;
pEffect->setDimColor( aEmpty );
diff --git a/sd/source/core/drawdoc4.cxx b/sd/source/core/drawdoc4.cxx
index 716f008a9180..061ac8d4cc04 100644
--- a/sd/source/core/drawdoc4.cxx
+++ b/sd/source/core/drawdoc4.cxx
@@ -1350,7 +1350,7 @@ void ModifyGuard::init()
}
mbIsEnableSetModified = mpDocShell ? mpDocShell->IsEnableSetModified() : sal_False;
- mbIsDocumentChanged = mpDoc ? mpDoc->IsChanged() : false;
+ mbIsDocumentChanged = mpDoc && mpDoc->IsChanged();
if( mbIsEnableSetModified )
mpDocShell->EnableSetModified( false );
diff --git a/sd/source/core/undo/undoobjects.cxx b/sd/source/core/undo/undoobjects.cxx
index ec2989da1e63..d18b8706ca5f 100644
--- a/sd/source/core/undo/undoobjects.cxx
+++ b/sd/source/core/undo/undoobjects.cxx
@@ -183,7 +183,7 @@ void UndoObjectSetText::Undo()
DBG_ASSERT( mxSdrObject.is(), "sd::UndoObjectSetText::Undo(), object already dead!" );
if( mxSdrObject.is() )
{
- mbNewEmptyPresObj = mxSdrObject->IsEmptyPresObj() ? true : false;
+ mbNewEmptyPresObj = mxSdrObject->IsEmptyPresObj();
SdrUndoObjSetText::Undo();
if( mpUndoAnimation )
mpUndoAnimation->Undo();
diff --git a/sd/source/ui/animations/CustomAnimationCreateDialog.cxx b/sd/source/ui/animations/CustomAnimationCreateDialog.cxx
index 1e6580367152..7595837f041d 100644
--- a/sd/source/ui/animations/CustomAnimationCreateDialog.cxx
+++ b/sd/source/ui/animations/CustomAnimationCreateDialog.cxx
@@ -465,12 +465,12 @@ void CustomAnimationCreateTabPage::setDuration( double fDuration )
bool CustomAnimationCreateTabPage::getIsPreview() const
{
- return mpCBXPReview->IsChecked() ? true : false;
+ return mpCBXPReview->IsChecked();
}
void CustomAnimationCreateTabPage::setIsPreview( bool bIsPreview )
{
- mpCBXPReview->Check( bIsPreview ? sal_True : sal_False );
+ mpCBXPReview->Check( bIsPreview );
}
sal_uInt16 CustomAnimationCreateTabPage::getId() const
diff --git a/sd/source/ui/slideshow/slideshow.cxx b/sd/source/ui/slideshow/slideshow.cxx
index 279bd8b45445..aa81b00be39c 100644
--- a/sd/source/ui/slideshow/slideshow.cxx
+++ b/sd/source/ui/slideshow/slideshow.cxx
@@ -1027,7 +1027,7 @@ void SlideShow::jumpToBookmark( const OUString& sBookmark )
bool SlideShow::isFullScreen()
{
- return mxController.is() ? mxController->maPresSettings.mbFullScreen : false;
+ return mxController.is() && mxController->maPresSettings.mbFullScreen;
}
@@ -1082,7 +1082,7 @@ void SlideShow::deactivate( ViewShellBase& /*rBase*/ )
bool SlideShow::keyInput(const KeyEvent& rKEvt)
{
- return mxController.is() ? mxController->keyInput(rKEvt) : false;
+ return mxController.is() && mxController->keyInput(rKEvt);
}
@@ -1097,7 +1097,7 @@ void SlideShow::paint( const Rectangle& rRect )
bool SlideShow::isAlwaysOnTop()
{
- return mxController.is() ? mxController->maPresSettings.mbAlwaysOnTop : false;
+ return mxController.is() && mxController->maPresSettings.mbAlwaysOnTop;
}
@@ -1140,14 +1140,14 @@ sal_Int32 SlideShow::getLastPageNumber()
bool SlideShow::isEndless()
{
- return mxController.is() ? mxController->isEndless() : false;
+ return mxController.is() && mxController->isEndless();
}
bool SlideShow::isDrawingPossible()
{
- return mxController.is() ? mxController->getUsePen() : false;
+ return mxController.is() && mxController->getUsePen();
}
diff --git a/sd/source/ui/table/TableDesignPane.cxx b/sd/source/ui/table/TableDesignPane.cxx
index d1c6f868caed..a72d8e6e116d 100644
--- a/sd/source/ui/table/TableDesignPane.cxx
+++ b/sd/source/ui/table/TableDesignPane.cxx
@@ -417,8 +417,8 @@ void TableDesignWidget::updateControls()
{
OSL_FAIL("sd::TableDesignWidget::updateControls(), exception caught!");
}
- m_aCheckBoxes[i]->Check(bUse ? true : false);
- m_aCheckBoxes[i]->Enable(bHasTable ? true : false);
+ m_aCheckBoxes[i]->Check(bUse);
+ m_aCheckBoxes[i]->Enable(bHasTable);
}
FillDesignPreviewControl();
diff --git a/sd/source/ui/unoidl/unoobj.cxx b/sd/source/ui/unoidl/unoobj.cxx
index f11c7660b4c6..4062bc85452a 100644
--- a/sd/source/ui/unoidl/unoobj.cxx
+++ b/sd/source/ui/unoidl/unoobj.cxx
@@ -892,7 +892,7 @@ SdAnimationInfo* SdXShape::GetAnimationInfo( bool bCreate ) const
SdrObject* pObj = mpShape->GetSdrObject();
if(pObj)
- pInfo = SdDrawDocument::GetShapeUserData(*pObj, bCreate ? true : false);
+ pInfo = SdDrawDocument::GetShapeUserData(*pObj, bCreate);
return pInfo;
}
diff --git a/sd/source/ui/unoidl/unopage.cxx b/sd/source/ui/unoidl/unopage.cxx
index 1228c06f6a94..3aaa96c4b7fb 100644
--- a/sd/source/ui/unoidl/unopage.cxx
+++ b/sd/source/ui/unoidl/unopage.cxx
@@ -349,7 +349,7 @@ SdGenericDrawPage::SdGenericDrawPage( SdXImpressDocument* _pModel, SdPage* pInPa
{
mpSdrModel = SvxFmDrawPage::mpModel;
if( mpModel )
- mbIsImpressDocument = mpModel->IsImpressDocument() ? true : false;
+ mbIsImpressDocument = mpModel->IsImpressDocument();
}
@@ -373,7 +373,7 @@ SdXImpressDocument* SdGenericDrawPage::GetModel() const
uno::Reference< uno::XInterface > xModel( SvxFmDrawPage::mpModel->getUnoModel() );
const_cast< SdGenericDrawPage*>(this)->mpModel = SdXImpressDocument::getImplementation( xModel );
if( mpModel )
- const_cast< SdGenericDrawPage*>(this)->mbIsImpressDocument = mpModel->IsImpressDocument() ? true : false;
+ const_cast< SdGenericDrawPage*>(this)->mbIsImpressDocument = mpModel->IsImpressDocument();
}
else
{
@@ -712,7 +712,7 @@ void SAL_CALL SdGenericDrawPage::setPropertyValue( const OUString& aPropertyName
bool bStopSound = false;
if( aValue >>= bStopSound )
{
- GetPage()->SetStopSound( bStopSound ? true : false );
+ GetPage()->SetStopSound( bStopSound );
break;
}
}
@@ -726,7 +726,7 @@ void SAL_CALL SdGenericDrawPage::setPropertyValue( const OUString& aPropertyName
if( ! (aValue >>= bLoop) )
throw lang::IllegalArgumentException();
- GetPage()->SetLoopSound( bLoop ? true : false );
+ GetPage()->SetLoopSound( bLoop );
break;
}
case WID_PAGE_BACKFULL:
diff --git a/sd/source/ui/view/sdview3.cxx b/sd/source/ui/view/sdview3.cxx
index b54f8d185e61..89e7aeb9731c 100644
--- a/sd/source/ui/view/sdview3.cxx
+++ b/sd/source/ui/view/sdview3.cxx
@@ -1229,7 +1229,7 @@ bool View::InsertData( const TransferableDataHelper& rDataHelper,
aInsertPos.Y() = pOwnData->GetStartPos().Y() + ( aSize.Height() >> 1 );
}
- bReturn = InsertMetaFile( aDataHelper, aInsertPos, pImageMap, nFormat == 0 ? true : false ) ? sal_True : sal_False;
+ bReturn = InsertMetaFile( aDataHelper, aInsertPos, pImageMap, nFormat == 0 );
}
if(!bReturn && (!bLink || pPickObj) && CHECK_FORMAT_TRANS(FORMAT_BITMAP))