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:53:31 +0000
commit619f9a8794bbe5022853b9bc52fc3bb7db7b9031 (patch)
treefb146728fc304d187d55c822d328849a31e56402 /lotuswordpro
parentb8ef286781dd107bcb0cbd065979bd53f176db27 (diff)
ensure IsPage layout truly is a LwpPageLayout
Change-Id: I3ca21608d633145c8a5238b947e22671460e9195 (cherry picked from commit 0e6ea7b9fa8f3748d0ced2122fa0a7c7698c1f93)
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());