diff options
author | Caolán McNamara <caolanm@redhat.com> | 2017-07-05 10:40:05 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2017-07-05 17:39:50 +0200 |
commit | 6209fcbdc694ca0ef22f157d3f5c5b74ed8c76c8 (patch) | |
tree | 05743a37ba61af4281286c1c56cf8766c8caa860 /sd/qa | |
parent | c3a4dacfa0aae3cf40aa7b123672c6bc197efe0f (diff) |
coverity#1414486 Unchecked dynamic_cast
and
coverity#1414482 Unchecked dynamic_cast
coverity#1414480 Unchecked dynamic_cast
coverity#1414479 Unchecked dynamic_cast
Change-Id: Ia33e4cfa5c13beeae5dfa46411f526433d87ea99
Reviewed-on: https://gerrit.libreoffice.org/39568
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sd/qa')
-rw-r--r-- | sd/qa/unit/tiledrendering/tiledrendering.cxx | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/sd/qa/unit/tiledrendering/tiledrendering.cxx b/sd/qa/unit/tiledrendering/tiledrendering.cxx index 0ff3e16717c1..715b444e5262 100644 --- a/sd/qa/unit/tiledrendering/tiledrendering.cxx +++ b/sd/qa/unit/tiledrendering/tiledrendering.cxx @@ -1196,8 +1196,9 @@ void SdTiledRenderingTest::testUndoLimiting() SfxRequest aReq2(SID_UNDO, SfxCallMode::SLOT, pXImpressDocument->GetDocShell()->GetDoc()->GetPool()); aReq2.AppendItem(SfxUInt16Item(SID_UNDO, 1)); pViewShell2->ExecuteSlot(aReq2); - CPPUNIT_ASSERT(dynamic_cast< const SfxUInt32Item* >(aReq2.GetReturnValue())); - CPPUNIT_ASSERT_EQUAL(static_cast< sal_uInt32 >(SID_REPAIRPACKAGE), dynamic_cast< const SfxUInt32Item * >(aReq2.GetReturnValue())->GetValue()); + const SfxUInt32Item* pUInt32Item = dynamic_cast<const SfxUInt32Item*>(aReq2.GetReturnValue()); + CPPUNIT_ASSERT(pUInt32Item); + CPPUNIT_ASSERT_EQUAL(static_cast< sal_uInt32 >(SID_REPAIRPACKAGE), pUInt32Item->GetValue()); } // Now check view1 can undo action @@ -1800,8 +1801,9 @@ void SdTiledRenderingTest::testDisableUndoRepair() pView1->GetViewFrame()->GetBindings().QueryState(SID_UNDO, pItem1); pView2->GetViewFrame()->GetBindings().QueryState(SID_UNDO, pItem2); CPPUNIT_ASSERT(!dynamic_cast< const SfxUInt32Item* >(pItem1.get())); - CPPUNIT_ASSERT(dynamic_cast< const SfxUInt32Item* >(pItem2.get())); - CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt32>(SID_REPAIRPACKAGE), dynamic_cast< const SfxUInt32Item * >(pItem2.get())->GetValue()); + const SfxUInt32Item* pUInt32Item = dynamic_cast<const SfxUInt32Item*>(pItem2.get()); + CPPUNIT_ASSERT(pUInt32Item); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt32>(SID_REPAIRPACKAGE), pUInt32Item->GetValue()); } // Insert a character in the second view. @@ -1818,8 +1820,9 @@ void SdTiledRenderingTest::testDisableUndoRepair() pView1->GetViewFrame()->GetBindings().QueryState(SID_UNDO, pItem1); pView2->GetViewFrame()->GetBindings().QueryState(SID_UNDO, pItem2); CPPUNIT_ASSERT(!dynamic_cast< const SfxUInt32Item* >(pItem2.get())); - CPPUNIT_ASSERT(dynamic_cast< const SfxUInt32Item* >(pItem1.get())); - CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt32>(SID_REPAIRPACKAGE), dynamic_cast< const SfxUInt32Item * >(pItem1.get())->GetValue()); + const SfxUInt32Item* pUInt32Item = dynamic_cast<const SfxUInt32Item*>(pItem1.get()); + CPPUNIT_ASSERT(pUInt32Item); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt32>(SID_REPAIRPACKAGE), pUInt32Item->GetValue()); } } |