diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-10-20 20:51:50 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2017-10-21 15:44:11 +0200 |
commit | ead920a48aa8c35075fdb980b9d213ff1c580dd1 (patch) | |
tree | bb1628fd293f03b22920bc74e89657320da6442e /sd | |
parent | fe5b70723fc83f229fb4b41231a663a8700f48c4 (diff) |
loplugin:redundantcast handle dynamic_cast
Change-Id: I7855c76e820efce96778b1c19ec71dffcc4b4abb
Reviewed-on: https://gerrit.libreoffice.org/43621
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'sd')
-rw-r--r-- | sd/qa/unit/export-tests-ooxml1.cxx | 6 | ||||
-rw-r--r-- | sd/qa/unit/export-tests-ooxml2.cxx | 10 | ||||
-rw-r--r-- | sd/source/ui/dlg/sdtreelb.cxx | 2 | ||||
-rw-r--r-- | sd/source/ui/slidesorter/controller/SlsSelectionManager.cxx | 2 |
4 files changed, 10 insertions, 10 deletions
diff --git a/sd/qa/unit/export-tests-ooxml1.cxx b/sd/qa/unit/export-tests-ooxml1.cxx index 548352ae0fa6..88a38e7835a4 100644 --- a/sd/qa/unit/export-tests-ooxml1.cxx +++ b/sd/qa/unit/export-tests-ooxml1.cxx @@ -373,12 +373,12 @@ void SdOOXMLExportTest1::testBnc880763() // First object in the background has blue background color const SdrObjGroup *pObjGroup = dynamic_cast<SdrObjGroup *>(pPage->GetObj(0)); CPPUNIT_ASSERT(pObjGroup); - const SdrObject *pObj = dynamic_cast<SdrObject *>(pObjGroup->GetSubList()->GetObj(0)); + const SdrObject *pObj = pObjGroup->GetSubList()->GetObj(0); CPPUNIT_ASSERT_MESSAGE( "no object", pObj != nullptr); CPPUNIT_ASSERT_EQUAL( sal_uInt32(0x0000ff),(static_cast< const XColorItem& >(pObj->GetMergedItem(XATTR_FILLCOLOR))).GetColorValue().GetColor()); // Second object at the front has green background color - pObj = dynamic_cast<SdrObject *>(pPage->GetObj(2)); // FIXME should be 1, smartart import creates an additional empty group for some reason + pObj = pPage->GetObj(2); // FIXME should be 1, smartart import creates an additional empty group for some reason CPPUNIT_ASSERT_MESSAGE( "no object", pObj != nullptr); CPPUNIT_ASSERT_EQUAL( sal_uInt32(0x00ff00),(static_cast< const XColorItem& >(pObj->GetMergedItem(XATTR_FILLCOLOR))).GetColorValue().GetColor()); @@ -395,7 +395,7 @@ void SdOOXMLExportTest1::testBnc862510_5() // Same as testBnc870237, but here we check the horizontal spacing const SdrObjGroup *pObjGroup = dynamic_cast<SdrObjGroup *>(pPage->GetObj(0)); CPPUNIT_ASSERT(pObjGroup); - const SdrObject* pObj = dynamic_cast<SdrObject*>(pObjGroup->GetSubList()->GetObj(1)); + const SdrObject* pObj = pObjGroup->GetSubList()->GetObj(1); CPPUNIT_ASSERT_MESSAGE( "no object", pObj != nullptr); CPPUNIT_ASSERT_EQUAL( sal_Int32(0), (static_cast< const SdrMetricItem& >(pObj->GetMergedItem(SDRATTR_TEXT_UPPERDIST))).GetValue()); CPPUNIT_ASSERT_EQUAL( sal_Int32(0), (static_cast< const SdrMetricItem& >(pObj->GetMergedItem(SDRATTR_TEXT_LOWERDIST))).GetValue()); diff --git a/sd/qa/unit/export-tests-ooxml2.cxx b/sd/qa/unit/export-tests-ooxml2.cxx index 586700e39863..e430e37b4c4a 100644 --- a/sd/qa/unit/export-tests-ooxml2.cxx +++ b/sd/qa/unit/export-tests-ooxml2.cxx @@ -240,7 +240,7 @@ void SdOOXMLExportTest2::testBnc822341() const SdrPage *pPage = GetPage( 1, xDocShRef.get() ); - const SdrObject* pObj = dynamic_cast<SdrObject*>( pPage->GetObj(0) ); + const SdrObject* pObj = pPage->GetObj(0); CPPUNIT_ASSERT_MESSAGE( "no object", pObj != nullptr); CPPUNIT_ASSERT_EQUAL( static_cast<sal_uInt16>(OBJ_OLE2), pObj->GetObjIdentifier() ); } @@ -273,7 +273,7 @@ void SdOOXMLExportTest2::testBnc822341() const SdrPage *pPage = pDoc->GetPage(1); CPPUNIT_ASSERT_MESSAGE( "no page", pPage != nullptr ); - const SdrObject* pObj = dynamic_cast<SdrObject*>( pPage->GetObj(0) ); + const SdrObject* pObj = pPage->GetObj(0); CPPUNIT_ASSERT_MESSAGE( "no object", pObj != nullptr); CPPUNIT_ASSERT_EQUAL( static_cast<sal_uInt16>(OBJ_OLE2), pObj->GetObjIdentifier() ); } @@ -300,7 +300,7 @@ void SdOOXMLExportTest2::testMathObject() "a"); const SdrPage *pPage = GetPage(1, xDocShRef); - const SdrObject* pObj = dynamic_cast<SdrObject*>(pPage->GetObj(0)); + const SdrObject* pObj = pPage->GetObj(0); CPPUNIT_ASSERT_MESSAGE("no object", pObj != nullptr); CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt16>(OBJ_OLE2), pObj->GetObjIdentifier()); } @@ -320,7 +320,7 @@ void SdOOXMLExportTest2::testMathObject() "a"); const SdrPage *pPage = GetPage(1, xDocShRef); - const SdrObject* pObj = dynamic_cast<SdrObject*>(pPage->GetObj(0)); + const SdrObject* pObj = pPage->GetObj(0); CPPUNIT_ASSERT_MESSAGE("no object", pObj != nullptr); CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt16>(OBJ_OLE2), pObj->GetObjIdentifier()); } @@ -347,7 +347,7 @@ void SdOOXMLExportTest2::testMathObjectPPT2010() u"\U0001D44E"); // non-BMP char const SdrPage *pPage = GetPage(1, xDocShRef); - const SdrObject* pObj = dynamic_cast<SdrObject*>(pPage->GetObj(0)); + const SdrObject* pObj = pPage->GetObj(0); CPPUNIT_ASSERT_MESSAGE("no object", pObj != nullptr); CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt16>(OBJ_OLE2), pObj->GetObjIdentifier()); } diff --git a/sd/source/ui/dlg/sdtreelb.cxx b/sd/source/ui/dlg/sdtreelb.cxx index c573ffdbf0f8..b6b97a595ae7 100644 --- a/sd/source/ui/dlg/sdtreelb.cxx +++ b/sd/source/ui/dlg/sdtreelb.cxx @@ -1290,7 +1290,7 @@ SvTreeListEntry* SdPageObjsTLB::GetDropTarget (const Point& rLocation) sal_uInt16 nDepth (0); do { - pNext = dynamic_cast<SvTreeListEntry*>(NextVisible(pEntry, &nDepth)); + pNext = NextVisible(pEntry, &nDepth); if (pNext != nullptr && nDepth > 0 && nDepth!=0xffff) pEntry = pNext; else diff --git a/sd/source/ui/slidesorter/controller/SlsSelectionManager.cxx b/sd/source/ui/slidesorter/controller/SlsSelectionManager.cxx index bc73878e8d30..6f4c15ac059e 100644 --- a/sd/source/ui/slidesorter/controller/SlsSelectionManager.cxx +++ b/sd/source/ui/slidesorter/controller/SlsSelectionManager.cxx @@ -108,7 +108,7 @@ void SelectionManager::DeleteSelectedPages (const bool bSelectFollowingPage) const auto pViewShell = mrSlideSorter.GetViewShell(); const auto pDrawViewShell = pViewShell ? std::dynamic_pointer_cast<sd::DrawViewShell>(pViewShell->GetViewShellBase().GetMainViewShell()) : nullptr; - const auto pDrawView = pDrawViewShell ? dynamic_cast<sd::DrawView*>(pDrawViewShell->GetDrawView()) : nullptr; + const auto pDrawView = pDrawViewShell ? pDrawViewShell->GetDrawView() : nullptr; if (pDrawView) pDrawView->BlockPageOrderChangedHint(true); |