diff options
author | Michael Stahl <mstahl@redhat.com> | 2016-11-23 23:01:41 +0100 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2016-11-24 22:56:31 +0100 |
commit | c2c4c6ee16120108590dc64f295ab54e34a05ac0 (patch) | |
tree | 89716224770b4dbb473fed3bff65dcdb8c157693 | |
parent | b673ddb7d7a7b09ad171af57acadb3e532030428 (diff) |
SwContentTree: fix bad static downcasts
Change-Id: I52c1b4a028928c3008d95df43dbc6e8183980df4
-rw-r--r-- | sw/source/uibase/utlui/content.cxx | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx index 4517b5c94624..cde5b2292393 100644 --- a/sw/source/uibase/utlui/content.cxx +++ b/sw/source/uibase/utlui/content.cxx @@ -1414,9 +1414,10 @@ SdrObject* SwContentTree::GetDrawingObjectsByContent(const SwContent *pCnt) bool SwContentTree::Expand( SvTreeListEntry* pParent ) { - assert(!m_bIsRoot || dynamic_cast<SwContentType*>(static_cast<SwTypeNumber*>(pParent->GetUserData()))); - if(!m_bIsRoot || (static_cast<SwContentType*>(pParent->GetUserData())->GetType() == ContentTypeId::OUTLINE) || - (m_nRootType == ContentTypeId::OUTLINE)) + assert(!m_bIsRoot || dynamic_cast<SwTypeNumber*>(static_cast<SwTypeNumber*>(pParent->GetUserData()))); + if (!m_bIsRoot + || (static_cast<SwTypeNumber*>(pParent->GetUserData())->GetTypeId() == CTYPE_CTT && static_cast<SwContentType*>(pParent->GetUserData())->GetType() == ContentTypeId::OUTLINE) + || (m_nRootType == ContentTypeId::OUTLINE)) { if(lcl_IsContentType(pParent)) { @@ -1472,9 +1473,10 @@ bool SwContentTree::Expand( SvTreeListEntry* pParent ) bool SwContentTree::Collapse( SvTreeListEntry* pParent ) { - assert(!m_bIsRoot || dynamic_cast<SwContentType*>(static_cast<SwTypeNumber*>(pParent->GetUserData()))); - if(!m_bIsRoot || (static_cast<SwContentType*>(pParent->GetUserData())->GetType() == ContentTypeId::OUTLINE) || - (m_nRootType == ContentTypeId::OUTLINE)) + assert(!m_bIsRoot || dynamic_cast<SwTypeNumber*>(static_cast<SwTypeNumber*>(pParent->GetUserData()))); + if (!m_bIsRoot + || (static_cast<SwTypeNumber*>(pParent->GetUserData())->GetTypeId() == CTYPE_CTT && static_cast<SwContentType*>(pParent->GetUserData())->GetType() == ContentTypeId::OUTLINE) + || (m_nRootType == ContentTypeId::OUTLINE)) { if(lcl_IsContentType(pParent)) { |