[Libreoffice-commits] core.git: Branch 'libreoffice-5-1' - lotuswordpro/source

Caolán McNamara caolanm at redhat.com
Thu Dec 10 07:46:28 PST 2015


 lotuswordpro/source/filter/lwptablelayout.cxx |   68 ++++++++++++++------------
 1 file changed, 37 insertions(+), 31 deletions(-)

New commits:
commit db40b5c71c9e5c1019fb6de0f0e5b39a39b37e1d
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Dec 10 15:45:29 2015 +0000

    guard against missing range
    
    Change-Id: Icdb0694b9c1771a475368aeeb4cb11f4ba8b84f3
    (cherry picked from commit 1aff042d88b2d6d3c3b7ed9db4b36bed640a0f06)

diff --git a/lotuswordpro/source/filter/lwptablelayout.cxx b/lotuswordpro/source/filter/lwptablelayout.cxx
index c709b63..c3aabee 100644
--- a/lotuswordpro/source/filter/lwptablelayout.cxx
+++ b/lotuswordpro/source/filter/lwptablelayout.cxx
@@ -1122,44 +1122,50 @@ void LwpTableLayout::PutCellVals(LwpFoundry* pFoundry, LwpObjectID aTableID)
             pTableRange = pTableRange->GetNext();
         }
 
-        if (pTableRange)
-        {
-            LwpCellRange* pRange = static_cast<LwpCellRange*>(pTableRange->GetCellRangeID().obj().get());
-            LwpFolder* pFolder = static_cast<LwpFolder*>(pRange->GetFolderID().obj().get());
-            LwpObjectID aRowListID = pFolder->GetChildHeadID();
-            LwpRowList* pRowList = static_cast<LwpRowList*>(aRowListID.obj().get());
+        if (!pTableRange)
+            return;
+
+        LwpCellRange* pRange = static_cast<LwpCellRange*>(pTableRange->GetCellRangeID().obj().get());
+        if (!pRange)
+            return;
+
+        LwpFolder* pFolder = static_cast<LwpFolder*>(pRange->GetFolderID().obj().get());
+        if (!pFolder)
+            return;
 
-            //loop the rowlist
-            while( nullptr!=pRowList)
+        LwpObjectID aRowListID = pFolder->GetChildHeadID();
+        LwpRowList* pRowList = static_cast<LwpRowList*>(aRowListID.obj().get());
+
+        //loop the rowlist
+        while( nullptr!=pRowList)
+        {
+            sal_uInt16 nRowID =  pRowList->GetRowID();
             {
-                sal_uInt16 nRowID =  pRowList->GetRowID();
+                LwpCellList* pCellList = static_cast<LwpCellList*>(pRowList->GetChildHeadID().obj().get());
+                //loop the cellList
+                while( nullptr!=pCellList)
                 {
-                    LwpCellList* pCellList = static_cast<LwpCellList*>(pRowList->GetChildHeadID().obj().get());
-                    //loop the cellList
-                    while( nullptr!=pCellList)
-                    {
-                        {//put cell
-                            sal_uInt16 nColID = pCellList->GetColumnID();
-
-                            XFCell* pCell = GetCellsMap(nRowID,static_cast<sal_uInt8>(nColID));
-                            if (pCell)
-                            {
-                                pCellList->Convert(pCell, this);
-
-                                //process paragraph
-                                PostProcessParagraph(pCell, nRowID, nColID);
-                            }
-                            else
-                            {
-                                //Hidden cell would not be in cellsmap
-                                assert(false);
-                            }
+                    {//put cell
+                        sal_uInt16 nColID = pCellList->GetColumnID();
+
+                        XFCell* pCell = GetCellsMap(nRowID,static_cast<sal_uInt8>(nColID));
+                        if (pCell)
+                        {
+                            pCellList->Convert(pCell, this);
+
+                            //process paragraph
+                            PostProcessParagraph(pCell, nRowID, nColID);
+                        }
+                        else
+                        {
+                            //Hidden cell would not be in cellsmap
+                            assert(false);
                         }
-                        pCellList = static_cast<LwpCellList*>(pCellList->GetNextID().obj().get());
                     }
+                    pCellList = static_cast<LwpCellList*>(pCellList->GetNextID().obj().get());
                 }
-                pRowList = static_cast<LwpRowList*>(pRowList->GetNextID().obj().get());
             }
+            pRowList = static_cast<LwpRowList*>(pRowList->GetNextID().obj().get());
         }
 
     }catch (...) {


More information about the Libreoffice-commits mailing list