summaryrefslogtreecommitdiff
path: root/sc/source/ui/drawfunc
diff options
context:
space:
mode:
authorCaolán McNamara <caolan.mcnamara@collabora.com>2024-05-05 20:53:49 +0100
committerCaolán McNamara <caolan.mcnamara@collabora.com>2024-05-06 12:23:39 +0200
commit0cd07e1fb7afc0a6831eaafabcead7e0c5f7ac3b (patch)
tree8f145203ea1b9cf43d5e41b0c99c12b3e7465575 /sc/source/ui/drawfunc
parentef2066cdfe86019a3099b3530fb091ca2a4d2446 (diff)
WaE: C6011 Dereferencing NULL pointer warnings
Change-Id: I71d20c4d35b5123216da55a8b314400c93cae6fd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167173 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Diffstat (limited to 'sc/source/ui/drawfunc')
-rw-r--r--sc/source/ui/drawfunc/drawsh2.cxx1
-rw-r--r--sc/source/ui/drawfunc/drawsh5.cxx4
-rw-r--r--sc/source/ui/drawfunc/fuconstr.cxx1
-rw-r--r--sc/source/ui/drawfunc/fudraw.cxx1
-rw-r--r--sc/source/ui/drawfunc/fusel.cxx2
-rw-r--r--sc/source/ui/drawfunc/futext.cxx1
6 files changed, 8 insertions, 2 deletions
diff --git a/sc/source/ui/drawfunc/drawsh2.cxx b/sc/source/ui/drawfunc/drawsh2.cxx
index 51c5a1a08cbc..0e7cc33f121d 100644
--- a/sc/source/ui/drawfunc/drawsh2.cxx
+++ b/sc/source/ui/drawfunc/drawsh2.cxx
@@ -520,6 +520,7 @@ bool ScDrawShell::AreAllObjectsOnLayer(SdrLayerID nLayerNo,const SdrMarkList& rM
for (size_t i=0; i<nCount; ++i)
{
SdrObject* pObj = rMark.GetMark(i)->GetMarkedSdrObj();
+ assert(pObj);
if ( dynamic_cast<const SdrUnoObj*>( pObj) == nullptr )
{
if(nLayerNo!=pObj->GetLayer())
diff --git a/sc/source/ui/drawfunc/drawsh5.cxx b/sc/source/ui/drawfunc/drawsh5.cxx
index 0baff09045cc..c2fe632c3bd5 100644
--- a/sc/source/ui/drawfunc/drawsh5.cxx
+++ b/sc/source/ui/drawfunc/drawsh5.cxx
@@ -510,7 +510,7 @@ void ScDrawShell::ExecDrawFunc( SfxRequest& rReq )
{
// #i68101#
SdrObject* pSelected = pView->GetMarkedObjectByIndex(0);
- OSL_ENSURE(pSelected, "ScDrawShell::ExecDrawFunc: nMarkCount, but no object (!)");
+ assert(pSelected && "ScDrawShell::ExecDrawFunc: nMarkCount, but no object (!)");
if(SC_LAYER_INTERN != pSelected->GetLayer())
{
@@ -583,7 +583,7 @@ void ScDrawShell::ExecDrawFunc( SfxRequest& rReq )
if(1 == pView->GetMarkedObjectCount())
{
SdrObject* pSelected = pView->GetMarkedObjectByIndex(0);
- OSL_ENSURE(pSelected, "ScDrawShell::ExecDrawFunc: nMarkCount, but no object (!)");
+ assert(pSelected && "ScDrawShell::ExecDrawFunc: nMarkCount, but no object (!)");
if(SC_LAYER_INTERN != pSelected->GetLayer())
{
diff --git a/sc/source/ui/drawfunc/fuconstr.cxx b/sc/source/ui/drawfunc/fuconstr.cxx
index 5babb078d928..689f33d8fed8 100644
--- a/sc/source/ui/drawfunc/fuconstr.cxx
+++ b/sc/source/ui/drawfunc/fuconstr.cxx
@@ -147,6 +147,7 @@ bool FuConstruct::MouseButtonUp(const MouseEvent& rMEvt)
// if Uno-Controls no text mode
if ( DynCastSdrTextObj( pObj) != nullptr && dynamic_cast<const SdrUnoObj*>( pObj) == nullptr )
{
+ assert(pObj);
OutlinerParaObject* pOPO = pObj->GetOutlinerParaObject();
bool bVertical = ( pOPO && pOPO->IsEffectivelyVertical() );
sal_uInt16 nTextSlotId = bVertical ? SID_DRAW_TEXT_VERTICAL : SID_DRAW_TEXT;
diff --git a/sc/source/ui/drawfunc/fudraw.cxx b/sc/source/ui/drawfunc/fudraw.cxx
index 9076a75ada00..1d5be0692b4a 100644
--- a/sc/source/ui/drawfunc/fudraw.cxx
+++ b/sc/source/ui/drawfunc/fudraw.cxx
@@ -159,6 +159,7 @@ static bool lcl_KeyEditMode( SdrObject* pObj, ScTabViewShell& rViewShell, const
bool bReturn = false;
if ( DynCastSdrTextObj( pObj) != nullptr && dynamic_cast<const SdrUnoObj*>( pObj) == nullptr )
{
+ assert(pObj);
// start text edit - like FuSelection::MouseButtonUp,
// but with bCursorToEnd instead of mouse position
diff --git a/sc/source/ui/drawfunc/fusel.cxx b/sc/source/ui/drawfunc/fusel.cxx
index 10601676f75d..1fcc7a448750 100644
--- a/sc/source/ui/drawfunc/fusel.cxx
+++ b/sc/source/ui/drawfunc/fusel.cxx
@@ -478,6 +478,8 @@ bool FuSelection::MouseButtonUp(const MouseEvent& rMEvt)
SdrHitKind eHit = pView->PickAnything( rMEvt, SdrMouseEventKind::BUTTONDOWN, aVEvt );
if (eHit != SdrHitKind::NONE && aVEvt.mpObj == pObj)
{
+ assert(pObj);
+
SdrObjKind nSdrObjKind = pObj->GetObjIdentifier();
// OLE: activate
diff --git a/sc/source/ui/drawfunc/futext.cxx b/sc/source/ui/drawfunc/futext.cxx
index 0a26c7693bf5..8db495b0f467 100644
--- a/sc/source/ui/drawfunc/futext.cxx
+++ b/sc/source/ui/drawfunc/futext.cxx
@@ -217,6 +217,7 @@ bool FuText::MouseButtonDown(const MouseEvent& rMEvt)
SdrObject* pMarkedObj = rMarkList.GetMark( 0 )->GetMarkedSdrObj();
if( ScDrawLayer::IsNoteCaption( pMarkedObj ) )
{
+ assert(pHdl);
if(pHdl->GetKind() != SdrHdlKind::Poly && pHdl->GetKind() != SdrHdlKind::Circle)
bDrag = true;
}