diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2017-10-22 11:55:13 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2017-10-22 11:55:13 +0200 |
commit | 380d6afe5fd691f6ad4b17fc38b79b9fca4ba906 (patch) | |
tree | 813e98778867110b7b53918a9d5cc6e0df0a9ea1 | |
parent | 4e7ffc0a69dac31ca7e0f1649f1697a1ff8d6e5f (diff) |
Remove redundant asserts involving dynamic_cast
...from SwTypeNumber to itself, which the compiler is free to elide anyway.
(SwTypeNumber is a base class, so there's no way to hack this like was done with
vcl::Window in 4e7ffc0a69dac31ca7e0f1649f1697a1ff8d6e5f "Avoid compiler eliding#redundant dynamic_cast".)
Change-Id: I21185e49bc4fa1803d46e086d863d47eda330acf
-rw-r--r-- | sw/source/uibase/utlui/content.cxx | 6 |
1 files changed, 0 insertions, 6 deletions
diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx index c07efed0fd54..4c932466493b 100644 --- a/sw/source/uibase/utlui/content.cxx +++ b/sw/source/uibase/utlui/content.cxx @@ -118,13 +118,11 @@ namespace { bool lcl_IsContent(const SvTreeListEntry* pEntry) { - assert(dynamic_cast<SwTypeNumber*>(static_cast<SwTypeNumber*>(pEntry->GetUserData()))); return static_cast<const SwTypeNumber*>(pEntry->GetUserData())->GetTypeId() == CTYPE_CNT; } bool lcl_IsContentType(const SvTreeListEntry* pEntry) { - assert(dynamic_cast<SwTypeNumber*>(static_cast<SwTypeNumber*>(pEntry->GetUserData()))); return static_cast<const SwTypeNumber*>(pEntry->GetUserData())->GetTypeId() == CTYPE_CTT; } @@ -1385,7 +1383,6 @@ void SwContentTree::RequestingChildren( SvTreeListEntry* pParent ) ) { pChild = Prev(pChild); - assert(!pChild || dynamic_cast<SwTypeNumber*>(static_cast<SwTypeNumber*>(pChild->GetUserData()))); } if(pChild) pChild = InsertEntry(sEntry, pChild, @@ -1447,7 +1444,6 @@ SdrObject* SwContentTree::GetDrawingObjectsByContent(const SwContent *pCnt) bool SwContentTree::Expand( SvTreeListEntry* pParent ) { - assert(!m_bIsRoot || dynamic_cast<SwTypeNumber*>(static_cast<SwTypeNumber*>(pParent->GetUserData()))); if (!m_bIsRoot || (lcl_IsContentType(pParent) && static_cast<SwContentType*>(pParent->GetUserData())->GetType() == ContentTypeId::OUTLINE) || (m_nRootType == ContentTypeId::OUTLINE)) @@ -1506,7 +1502,6 @@ bool SwContentTree::Expand( SvTreeListEntry* pParent ) bool SwContentTree::Collapse( SvTreeListEntry* pParent ) { - assert(!m_bIsRoot || dynamic_cast<SwTypeNumber*>(static_cast<SwTypeNumber*>(pParent->GetUserData()))); if (!m_bIsRoot || (lcl_IsContentType(pParent) && static_cast<SwContentType*>(pParent->GetUserData())->GetType() == ContentTypeId::OUTLINE) || (m_nRootType == ContentTypeId::OUTLINE)) @@ -2428,7 +2423,6 @@ void SwContentTree::ExecCommand(const OUString& rCmd, bool bOutlineWithChildren) if (nActLevel >= static_cast<SwOutlineContent*>(pEntry->GetUserData())->GetOutlineLevel()) break; pEntry = Next(pEntry); - assert(pEntry == nullptr || dynamic_cast<SwTypeNumber*>(static_cast<SwTypeNumber*>(pEntry->GetUserData()))); nActEndPos++; } if (nDir == 1) |