summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2015-12-10 16:10:20 +0000
committerCaolán McNamara <caolanm@redhat.com>2015-12-10 16:11:26 +0000
commit26b447a8ff041ab168e82c018dd7a10b7cb95f24 (patch)
tree83c2a75f3ce320a910da2f835a09dc867db216b8
parent10bac220a31f7f4f80bee440fa0f7292f0a5d54c (diff)
need dynamic casts here, etc.
Change-Id: I578343719d2d7feff51775ff1b073b6584e76f82 (cherry picked from commit 46fe3bddebf30775ae19eaa0fefe1d8e2f78eced)
-rw-r--r--lotuswordpro/source/filter/lwpdoc.cxx2
-rw-r--r--lotuswordpro/source/filter/lwpfoundry.cxx24
-rw-r--r--lotuswordpro/source/filter/lwpstory.cxx2
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());
}
}