Kaydet (Commit) 619f9a87 authored tarafından Caolán McNamara's avatar Caolán McNamara

ensure IsPage layout truly is a LwpPageLayout

Change-Id: I3ca21608d633145c8a5238b947e22671460e9195
(cherry picked from commit 0e6ea7b9)
üst b8ef2867
...@@ -201,14 +201,17 @@ void LwpStory::SortPageLayout() ...@@ -201,14 +201,17 @@ void LwpStory::SortPageLayout()
rtl::Reference<LwpVirtualLayout> xLayout(GetLayout(nullptr)); rtl::Reference<LwpVirtualLayout> xLayout(GetLayout(nullptr));
while (xLayout.get()) 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 //for mirror page, the child is pagelayout
rtl::Reference<LwpVirtualLayout> xParent = xLayout->GetParentLayout(); rtl::Reference<LwpVirtualLayout> xParent = xLayout->GetParentLayout();
if(eSectionType != LwpLayout::StartWithinColume && xParent.is() && !xParent->IsPage()) if(eSectionType != LwpLayout::StartWithinColume && xParent.is() && !xParent->IsPage())
{ {
aLayoutList.push_back(static_cast<LwpPageLayout*>(xLayout.get())); aLayoutList.push_back(pLayout);
} }
} }
xLayout = GetLayout(xLayout.get()); xLayout = GetLayout(xLayout.get());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment