summaryrefslogtreecommitdiffstats
path: root/svx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2015-03-11 09:06:08 +0000
committerCaolán McNamara <caolanm@redhat.com>2015-03-11 09:58:36 +0000
commit556373c41fddbac6cbee1c89e7707631270a1852 (patch)
tree026862690693419beb8810fdc6671ae30c72a026 /svx
parentEnsure RTTI symbol visibility for Linux Clang -fsanitize=function,vptr (diff)
downloadcore-556373c41fddbac6cbee1c89e7707631270a1852.tar.gz
core-556373c41fddbac6cbee1c89e7707631270a1852.zip
V668 no sense in testing the result of new against null
Change-Id: I4a33bd92fc8448638a4bfe1eab7e5041a4c5cc39
Diffstat (limited to 'svx')
-rw-r--r--svx/source/engine3d/extrud3d.cxx9
-rw-r--r--svx/source/engine3d/lathe3d.cxx13
-rw-r--r--svx/source/svdraw/svdattr.cxx5
-rw-r--r--svx/source/svdraw/svdhdl.cxx68
-rw-r--r--svx/source/svdraw/svdograf.cxx14
-rw-r--r--svx/source/svdraw/svdotxtr.cxx25
-rw-r--r--svx/source/unodraw/unopage.cxx6
7 files changed, 49 insertions, 91 deletions
diff --git a/svx/source/engine3d/extrud3d.cxx b/svx/source/engine3d/extrud3d.cxx
index 594fd5c06626..b4cfbe2e6d0d 100644
--- a/svx/source/engine3d/extrud3d.cxx
+++ b/svx/source/engine3d/extrud3d.cxx
@@ -200,12 +200,9 @@ SdrAttrObj* E3dExtrudeObj::GetBreakObj()
basegfx::B2DPolyPolygon aPoly = TransformToScreenCoor(aBackSide);
SdrPathObj* pPathObj = new SdrPathObj(OBJ_PLIN, aPoly);
- if(pPathObj)
- {
- SfxItemSet aSet(GetObjectItemSet());
- aSet.Put(XLineStyleItem(com::sun::star::drawing::LineStyle_SOLID));
- pPathObj->SetMergedItemSet(aSet);
- }
+ SfxItemSet aSet(GetObjectItemSet());
+ aSet.Put(XLineStyleItem(com::sun::star::drawing::LineStyle_SOLID));
+ pPathObj->SetMergedItemSet(aSet);
return pPathObj;
}
diff --git a/svx/source/engine3d/lathe3d.cxx b/svx/source/engine3d/lathe3d.cxx
index 7869e63a988f..9d2c60c57260 100644
--- a/svx/source/engine3d/lathe3d.cxx
+++ b/svx/source/engine3d/lathe3d.cxx
@@ -182,16 +182,13 @@ SdrAttrObj* E3dLatheObj::GetBreakObj()
basegfx::B2DPolyPolygon aTransPoly(TransformToScreenCoor(aLathePoly3D));
SdrPathObj* pPathObj = new SdrPathObj(OBJ_PLIN, aTransPoly);
- if(pPathObj)
- {
- // Set Attribute
- SfxItemSet aSet(GetObjectItemSet());
+ // Set Attribute
+ SfxItemSet aSet(GetObjectItemSet());
- // Enable lines to guarantee that the object becomes visible
- aSet.Put(XLineStyleItem(com::sun::star::drawing::LineStyle_SOLID));
+ // Enable lines to guarantee that the object becomes visible
+ aSet.Put(XLineStyleItem(com::sun::star::drawing::LineStyle_SOLID));
- pPathObj->SetMergedItemSet(aSet);
- }
+ pPathObj->SetMergedItemSet(aSet);
return pPathObj;
}
diff --git a/svx/source/svdraw/svdattr.cxx b/svx/source/svdraw/svdattr.cxx
index 8cf6c022f701..f7c67d36d284 100644
--- a/svx/source/svdraw/svdattr.cxx
+++ b/svx/source/svdraw/svdattr.cxx
@@ -1515,10 +1515,7 @@ SvStream& SdrCustomShapeAdjustmentItem::Store( SvStream& rOut, sal_uInt16 nItemV
SfxPoolItem* SdrCustomShapeAdjustmentItem::Clone( SfxItemPool * /*pPool*/) const
{
SdrCustomShapeAdjustmentItem* pItem = new SdrCustomShapeAdjustmentItem;
-
- if (pItem)
- pItem->aAdjustmentValueList = aAdjustmentValueList;
-
+ pItem->aAdjustmentValueList = aAdjustmentValueList;
return pItem;
}
diff --git a/svx/source/svdraw/svdhdl.cxx b/svx/source/svdraw/svdhdl.cxx
index 08afe8891e22..60f7e0b91594 100644
--- a/svx/source/svdraw/svdhdl.cxx
+++ b/svx/source/svdraw/svdhdl.cxx
@@ -970,14 +970,10 @@ void SdrHdlColor::CreateB2dIAObject()
(sal_uInt16)(aBmpCol.GetSizePixel().Width() - 1) >> 1,
(sal_uInt16)(aBmpCol.GetSizePixel().Height() - 1) >> 1
);
- DBG_ASSERT(pNewOverlayObject, "Got NO new IAO!");
// OVERLAYMANAGER
- if(pNewOverlayObject)
- {
- xManager->add(*pNewOverlayObject);
- maOverlayGroup.append(*pNewOverlayObject);
- }
+ xManager->add(*pNewOverlayObject);
+ maOverlayGroup.append(*pNewOverlayObject);
}
}
}
@@ -1293,17 +1289,13 @@ void SdrHdlLine::CreateB2dIAObject()
aPosition1,
aPosition2
);
- DBG_ASSERT(pNewOverlayObject, "Got NO new IAO!");
// OVERLAYMANAGER
- if(pNewOverlayObject)
- {
- // color(?)
- pNewOverlayObject->setBaseColor(Color(COL_LIGHTRED));
+ // color(?)
+ pNewOverlayObject->setBaseColor(Color(COL_LIGHTRED));
- xManager->add(*pNewOverlayObject);
- maOverlayGroup.append(*pNewOverlayObject);
- }
+ xManager->add(*pNewOverlayObject);
+ maOverlayGroup.append(*pNewOverlayObject);
}
}
}
@@ -1356,20 +1348,15 @@ void SdrHdlBezWgt::CreateB2dIAObject()
aPosition1,
aPosition2
);
- DBG_ASSERT(pNewOverlayObject, "Got NO new IAO!");
-
// OVERLAYMANAGER
- if(pNewOverlayObject)
- {
- // line part is not hittable
- pNewOverlayObject->setHittable(false);
+ // line part is not hittable
+ pNewOverlayObject->setHittable(false);
- // color(?)
- pNewOverlayObject->setBaseColor(Color(COL_LIGHTBLUE));
+ // color(?)
+ pNewOverlayObject->setBaseColor(Color(COL_LIGHTBLUE));
- xManager->add(*pNewOverlayObject);
- maOverlayGroup.append(*pNewOverlayObject);
- }
+ xManager->add(*pNewOverlayObject);
+ maOverlayGroup.append(*pNewOverlayObject);
}
}
}
@@ -1411,16 +1398,12 @@ void E3dVolumeMarker::CreateB2dIAObject()
::sdr::overlay::OverlayObject* pNewOverlayObject = new
::sdr::overlay::OverlayPolyPolygonStripedAndFilled(
aWireframePoly);
- DBG_ASSERT(pNewOverlayObject, "Got NO new IAO!");
// OVERLAYMANAGER
- if(pNewOverlayObject)
- {
- pNewOverlayObject->setBaseColor(Color(COL_BLACK));
+ pNewOverlayObject->setBaseColor(Color(COL_BLACK));
- xManager->add(*pNewOverlayObject);
- maOverlayGroup.append(*pNewOverlayObject);
- }
+ xManager->add(*pNewOverlayObject);
+ maOverlayGroup.append(*pNewOverlayObject);
}
}
}
@@ -1680,12 +1663,9 @@ void ImpTextframeHdl::CreateB2dIAObject()
true); // allow animation; the Handle is not shown at text edit time
// OVERLAYMANAGER
- if(pNewOverlayObject)
- {
- pNewOverlayObject->setHittable(false);
- xManager->add(*pNewOverlayObject);
- maOverlayGroup.append(*pNewOverlayObject);
- }
+ pNewOverlayObject->setHittable(false);
+ xManager->add(*pNewOverlayObject);
+ maOverlayGroup.append(*pNewOverlayObject);
}
}
}
@@ -2533,16 +2513,12 @@ void SdrCropViewHdl::CreateB2dIAObject()
if(xManager.is())
{
::sdr::overlay::OverlayObject* pNew = new sdr::overlay::OverlayPrimitive2DSequenceObject(aSequence);
- DBG_ASSERT(pNew, "Got NO new IAO!");
- if(pNew)
- {
- // only informative object, no hit
- pNew->setHittable(false);
+ // only informative object, no hit
+ pNew->setHittable(false);
- xManager->add(*pNew);
- maOverlayGroup.append(*pNew);
- }
+ xManager->add(*pNew);
+ maOverlayGroup.append(*pNew);
}
}
}
diff --git a/svx/source/svdraw/svdograf.cxx b/svx/source/svdraw/svdograf.cxx
index dfc3d10eda7c..c8aec7d0de11 100644
--- a/svx/source/svdraw/svdograf.cxx
+++ b/svx/source/svdraw/svdograf.cxx
@@ -1407,22 +1407,18 @@ Reference< XInputStream > SdrGrafObj::getInputStream()
if( nSize && pSourceData )
{
sal_uInt8 * pBuffer = new sal_uInt8[ nSize ];
- if( pBuffer )
- {
- memcpy( pBuffer, pSourceData, nSize );
+ memcpy( pBuffer, pSourceData, nSize );
- SvMemoryStream* pStream = new SvMemoryStream( (void*)pBuffer, (sal_Size)nSize, StreamMode::READ );
- pStream->ObjectOwnsMemory( true );
- xStream.set( new utl::OInputStreamWrapper( pStream, true ) );
- }
+ SvMemoryStream* pStream = new SvMemoryStream( (void*)pBuffer, (sal_Size)nSize, StreamMode::READ );
+ pStream->ObjectOwnsMemory( true );
+ xStream.set( new utl::OInputStreamWrapper( pStream, true ) );
}
}
if (!xStream.is() && !aFileName.isEmpty())
{
SvFileStream* pStream = new SvFileStream( aFileName, StreamMode::READ );
- if( pStream )
- xStream.set( new utl::OInputStreamWrapper( pStream ) );
+ xStream.set( new utl::OInputStreamWrapper( pStream ) );
}
}
diff --git a/svx/source/svdraw/svdotxtr.cxx b/svx/source/svdraw/svdotxtr.cxx
index 7ccf90332d59..a2be884b8a4c 100644
--- a/svx/source/svdraw/svdotxtr.cxx
+++ b/svx/source/svdraw/svdotxtr.cxx
@@ -459,24 +459,21 @@ SdrObject* SdrTextObj::ImpConvertMakeObj(const basegfx::B2DPolyPolygon& rPolyPol
pPathObj->SetPathPoly(basegfx::tools::expandToCurve(pPathObj->GetPathPoly()));
}
- if(pPathObj)
+ pPathObj->ImpSetAnchorPos(aAnchor);
+ pPathObj->NbcSetLayer(SdrLayerID(GetLayer()));
+
+ if(pModel)
{
- pPathObj->ImpSetAnchorPos(aAnchor);
- pPathObj->NbcSetLayer(SdrLayerID(GetLayer()));
+ pPathObj->SetModel(pModel);
- if(pModel)
+ if(!bNoSetAttr)
{
- pPathObj->SetModel(pModel);
-
- if(!bNoSetAttr)
- {
- sdr::properties::ItemChangeBroadcaster aC(*pPathObj);
+ sdr::properties::ItemChangeBroadcaster aC(*pPathObj);
- pPathObj->ClearMergedItem();
- pPathObj->SetMergedItemSet(GetObjectItemSet());
- pPathObj->GetProperties().BroadcastItemChange(aC);
- pPathObj->NbcSetStyleSheet(GetStyleSheet(), true);
- }
+ pPathObj->ClearMergedItem();
+ pPathObj->SetMergedItemSet(GetObjectItemSet());
+ pPathObj->GetProperties().BroadcastItemChange(aC);
+ pPathObj->NbcSetStyleSheet(GetStyleSheet(), true);
}
}
diff --git a/svx/source/unodraw/unopage.cxx b/svx/source/unodraw/unopage.cxx
index 619b7ab08f03..7ef851568cdb 100644
--- a/svx/source/unodraw/unopage.cxx
+++ b/svx/source/unodraw/unopage.cxx
@@ -75,8 +75,7 @@ SvxDrawPage::SvxDrawPage( SdrPage* pInPage ) throw()
// create (hidden) view
mpView = new SdrView( mpModel );
- if( mpView )
- mpView->SetDesignMode(true);
+ mpView->SetDesignMode(true);
}
SvxDrawPage::~SvxDrawPage() throw()
@@ -896,8 +895,7 @@ void SvxDrawPage::ChangeModel( SdrModel* pNewModel )
{
delete mpView;
mpView = new SdrView( mpModel );
- if( mpView )
- mpView->SetDesignMode(true);
+ mpView->SetDesignMode(true);
}
}
}