summaryrefslogtreecommitdiff
path: root/lotuswordpro
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2015-12-14 13:52:22 +0000
committerCaolán McNamara <caolanm@redhat.com>2015-12-14 13:52:55 +0000
commit0e6ea7b9fa8f3748d0ced2122fa0a7c7698c1f93 (patch)
tree26c8a7d97a2d4f86e13553989bd06fd7a4c748a2 /lotuswordpro
parent8d5822983e9b6a1e04874ce4d2c807fd0cf1ee04 (diff)
ensure IsPage layout truly is a LwpPageLayout
Change-Id: I3ca21608d633145c8a5238b947e22671460e9195
Diffstat (limited to 'lotuswordpro')
-rw-r--r--lotuswordpro/source/filter/lwpstory.cxx9
1 files changed, 6 insertions, 3 deletions
diff --git a/lotuswordpro/source/filter/lwpstory.cxx b/lotuswordpro/source/filter/lwpstory.cxx
index 17ed5c610c9c..64d15c0d41a8 100644
--- a/lotuswordpro/source/filter/lwpstory.cxx
+++ b/lotuswordpro/source/filter/lwpstory.cxx
@@ -201,14 +201,17 @@ void LwpStory::SortPageLayout()
rtl::Reference<LwpVirtualLayout> xLayout(GetLayout(nullptr));
while (xLayout.get())
{
- if (xLayout->IsPage())
+ LwpPageLayout *pLayout = xLayout->IsPage()
+ ? dynamic_cast<LwpPageLayout*>(xLayout.get())
+ : nullptr;
+ if (pLayout)
{
- LwpLayout::UseWhenType eSectionType = static_cast<LwpPageLayout*>(xLayout.get())->GetUseWhenType();
+ LwpLayout::UseWhenType eSectionType = pLayout->GetUseWhenType();
//for mirror page, the child is pagelayout
rtl::Reference<LwpVirtualLayout> xParent = xLayout->GetParentLayout();
if(eSectionType != LwpLayout::StartWithinColume && xParent.is() && !xParent->IsPage())
{
- aLayoutList.push_back(static_cast<LwpPageLayout*>(xLayout.get()));
+ aLayoutList.push_back(pLayout);
}
}
xLayout = GetLayout(xLayout.get());