diff options
author | Caolán McNamara <caolanm@redhat.com> | 2015-12-10 16:10:20 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2015-12-10 16:10:20 +0000 |
commit | 46fe3bddebf30775ae19eaa0fefe1d8e2f78eced (patch) | |
tree | 9fdae7fec3cc8bf9fdcbcea0a92391ff4acb7fa9 /lotuswordpro | |
parent | 6857a386a4cfe4ddb42515cb00df5bd6648d0964 (diff) |
need dynamic casts here, etc.
Change-Id: I578343719d2d7feff51775ff1b073b6584e76f82
Diffstat (limited to 'lotuswordpro')
-rw-r--r-- | lotuswordpro/source/filter/lwpdoc.cxx | 2 | ||||
-rw-r--r-- | lotuswordpro/source/filter/lwpfoundry.cxx | 24 | ||||
-rw-r--r-- | lotuswordpro/source/filter/lwpstory.cxx | 2 |
3 files changed, 15 insertions, 13 deletions
diff --git a/lotuswordpro/source/filter/lwpdoc.cxx b/lotuswordpro/source/filter/lwpdoc.cxx index 140e00d8329f..12975e35f338 100644 --- a/lotuswordpro/source/filter/lwpdoc.cxx +++ b/lotuswordpro/source/filter/lwpdoc.cxx @@ -294,7 +294,7 @@ void LwpDocument::RegisterStylesInPara() { //Register the child para pStory->SetFoundry(m_pFoundry); - pStory->RegisterStyle(); + pStory->DoRegisterStyle(); pStory = dynamic_cast<LwpStory*>(pStory->GetNext().obj(VO_STORY).get()); } } diff --git a/lotuswordpro/source/filter/lwpfoundry.cxx b/lotuswordpro/source/filter/lwpfoundry.cxx index 64897e2b1676..74bfdede9ea2 100644 --- a/lotuswordpro/source/filter/lwpfoundry.cxx +++ b/lotuswordpro/source/filter/lwpfoundry.cxx @@ -219,18 +219,21 @@ void LwpFoundry::RegisterAllLayouts() LwpBookMark* LwpFoundry::GetBookMark(LwpObjectID objMarker) { - LwpDLVListHeadHolder* pHeadHolder= static_cast + LwpDLVListHeadHolder* pHeadHolder= dynamic_cast <LwpDLVListHeadHolder*>(m_BookMarkHead.obj().get()); + + if (!pHeadHolder) + return nullptr; + LwpObjectID& rObjID = pHeadHolder->GetHeadID(); - LwpBookMark* pBookMark; - pBookMark = static_cast<LwpBookMark*>(rObjID.obj().get()); + LwpBookMark* pBookMark = dynamic_cast<LwpBookMark*>(rObjID.obj().get()); while (pBookMark) { if (pBookMark->IsRightMarker(objMarker)) return pBookMark; rObjID = pBookMark->GetNext(); - pBookMark = static_cast<LwpBookMark*>(rObjID.obj().get()); + pBookMark = dynamic_cast<LwpBookMark*>(rObjID.obj().get()); } return nullptr; } @@ -475,23 +478,22 @@ LwpListList* LwpOrderedObjectManager::GetNextActiveListList(LwpListList * pLast) { LwpListList* pList = nullptr; if(pLast) - pList = static_cast<LwpListList*>(pLast->GetNext().obj().get()); + pList = dynamic_cast<LwpListList*>(pLast->GetNext().obj().get()); else { - LwpDLVListHeadHolder* pHeadHolder= static_cast<LwpDLVListHeadHolder*>(m_Head.obj().get()); + LwpDLVListHeadHolder* pHeadHolder= dynamic_cast<LwpDLVListHeadHolder*>(m_Head.obj().get()); if(pHeadHolder) { - pList = static_cast<LwpListList*>(pHeadHolder->GetHeadID().obj().get()); + pList = dynamic_cast<LwpListList*>(pHeadHolder->GetHeadID().obj().get()); } } while(pList) { - LwpContent* pContent = static_cast<LwpContent*>(pList->GetObject().obj().get()); - if(pContent && pContent->HasNonEmbeddedLayouts() && - !pContent->IsStyleContent()) + LwpContent* pContent = dynamic_cast<LwpContent*>(pList->GetObject().obj().get()); + if (pContent && pContent->HasNonEmbeddedLayouts() && !pContent->IsStyleContent()) return pList; - pList = static_cast<LwpListList*>(pList->GetNext().obj().get()); + pList = dynamic_cast<LwpListList*>(pList->GetNext().obj().get()); } return nullptr; } diff --git a/lotuswordpro/source/filter/lwpstory.cxx b/lotuswordpro/source/filter/lwpstory.cxx index 1300b1584ba0..b16564754a79 100644 --- a/lotuswordpro/source/filter/lwpstory.cxx +++ b/lotuswordpro/source/filter/lwpstory.cxx @@ -134,7 +134,7 @@ void LwpStory::RegisterStyle() while(pPara) { pPara->SetFoundry(m_pFoundry); - pPara->RegisterStyle(); + pPara->DoRegisterStyle(); pPara = dynamic_cast<LwpPara*>(pPara->GetNext().obj().get()); } } |