[Libreoffice-commits] core.git: lotuswordpro/source

Caolán McNamara caolanm at redhat.com
Mon Dec 14 05:53:31 PST 2015


 lotuswordpro/source/filter/lwpstory.cxx |    9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

New commits:
commit 0e6ea7b9fa8f3748d0ced2122fa0a7c7698c1f93
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Dec 14 13:52:22 2015 +0000

    ensure IsPage layout truly is a LwpPageLayout
    
    Change-Id: I3ca21608d633145c8a5238b947e22671460e9195

diff --git a/lotuswordpro/source/filter/lwpstory.cxx b/lotuswordpro/source/filter/lwpstory.cxx
index 17ed5c6..64d15c0 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());


More information about the Libreoffice-commits mailing list