summaryrefslogtreecommitdiff
path: root/svx/qa
diff options
context:
space:
mode:
authorCaolán McNamara <caolan.mcnamara@collabora.com>2024-05-15 21:08:50 +0100
committerCaolán McNamara <caolan.mcnamara@collabora.com>2024-05-16 09:34:49 +0200
commit601ae6910288c7f3abdbb11de644c17b3b2d0cb5 (patch)
treed2b46c81d7a446fdc173dddd65ec6bdee89c0e23 /svx/qa
parentc8a5dc46d11f2ef1e3a66d633730d9a700ced24a (diff)
WaE: C6011 Dereferencing NULL pointer warnings
Change-Id: If4ca47bc4d8203ed7d20e1bbf1c3ebe2587c403f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167709 Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com> Tested-by: Jenkins
Diffstat (limited to 'svx/qa')
-rw-r--r--svx/qa/unit/customshapes.cxx8
-rw-r--r--svx/qa/unit/svdraw.cxx1
-rw-r--r--svx/qa/unit/table.cxx1
3 files changed, 9 insertions, 1 deletions
diff --git a/svx/qa/unit/customshapes.cxx b/svx/qa/unit/customshapes.cxx
index 304ae64f23b2..47ab375e6037 100644
--- a/svx/qa/unit/customshapes.cxx
+++ b/svx/qa/unit/customshapes.cxx
@@ -122,6 +122,7 @@ CPPUNIT_TEST_FIXTURE(CustomshapesTest, testTdf150302)
// Mark Object
SfxViewShell* pViewShell = SfxViewShell::Current();
+ CPPUNIT_ASSERT(pViewShell);
SdrView* pSdrView = pViewShell->GetDrawView();
pSdrView->MarkObj(pSdrCustomShape, pSdrView->GetSdrPageView());
@@ -157,6 +158,7 @@ CPPUNIT_TEST_FIXTURE(CustomshapesTest, testTdf147409_GeomItemHash)
// Mark Object
SfxViewShell* pViewShell = SfxViewShell::Current();
+ CPPUNIT_ASSERT(pViewShell);
SdrView* pSdrView = pViewShell->GetDrawView();
pSdrView->MarkObj(pSdrCustomShape, pSdrView->GetSdrPageView());
@@ -174,6 +176,7 @@ CPPUNIT_TEST_FIXTURE(CustomshapesTest, testTdf146866_GeomItemHash)
// Mark Object
SfxViewShell* pViewShell = SfxViewShell::Current();
+ CPPUNIT_ASSERT(pViewShell);
SdrView* pSdrView = pViewShell->GetDrawView();
pSdrView->MarkObj(pSdrCustomShape, pSdrView->GetSdrPageView());
@@ -502,6 +505,7 @@ CPPUNIT_TEST_FIXTURE(CustomshapesTest, testTdf141021ExtrusionNorth)
// Mark Object
SfxViewShell* pViewShell = SfxViewShell::Current();
+ CPPUNIT_ASSERT(pViewShell);
SdrView* pSdrView = pViewShell->GetDrawView();
pSdrView->MarkObj(&rSdrCustomShape, pSdrView->GetSdrPageView());
@@ -509,7 +513,9 @@ CPPUNIT_TEST_FIXTURE(CustomshapesTest, testTdf141021ExtrusionNorth)
SfxRequest aReq(pViewShell->GetViewFrame(), SID_EXTRUSION_DIRECTION);
SfxInt32Item aItem(SID_EXTRUSION_DIRECTION, 90);
aReq.AppendItem(aItem);
- svx::ExtrusionBar::execute(pSdrView, aReq, SfxViewFrame::Current()->GetBindings());
+ SfxViewFrame* pFrame = SfxViewFrame::Current();
+ CPPUNIT_ASSERT(pFrame);
+ svx::ExtrusionBar::execute(pSdrView, aReq, pFrame->GetBindings());
// Verify height. Without the fix in place the height would 4001.
tools::Rectangle aBoundRect(rSdrCustomShape.GetCurrentBoundRect());
diff --git a/svx/qa/unit/svdraw.cxx b/svx/qa/unit/svdraw.cxx
index 0c01bf4dfce2..83293c52ee3f 100644
--- a/svx/qa/unit/svdraw.cxx
+++ b/svx/qa/unit/svdraw.cxx
@@ -237,6 +237,7 @@ CPPUNIT_TEST_FIXTURE(SvdrawTest, testTextEditEmptyGrabBag)
// When editing the shape text of the 2nd rectangle (insert a char at the start).
SfxViewShell* pViewShell = SfxViewShell::Current();
+ CPPUNIT_ASSERT(pViewShell);
SdrView* pSdrView = pViewShell->GetDrawView();
SdrObject* pObject = SdrObject::getSdrObjectFromXShape(xRect2);
pSdrView->SdrBeginTextEdit(pObject);
diff --git a/svx/qa/unit/table.cxx b/svx/qa/unit/table.cxx
index 6331a23cbe98..ce48f216026a 100644
--- a/svx/qa/unit/table.cxx
+++ b/svx/qa/unit/table.cxx
@@ -120,6 +120,7 @@ CPPUNIT_TEST_FIXTURE(Test, testSvxTableControllerSetAttrToSelectedShape)
auto pSdrObject
= dynamic_cast<sdr::table::SdrTableObj*>(pSdrPage->GetObj(pSdrPage->GetObjCount() - 1));
SfxViewShell* pViewShell = SfxViewShell::Current();
+ CPPUNIT_ASSERT(pViewShell);
SdrView* pSdrView = pViewShell->GetDrawView();
pSdrView->SdrBeginTextEdit(pSdrObject);
CPPUNIT_ASSERT(pSdrView->IsTextEdit());