Kaydet (Commit) 1aff042d authored tarafından Caolán McNamara's avatar Caolán McNamara

guard against missing range

Change-Id: Icdb0694b9c1771a475368aeeb4cb11f4ba8b84f3
üst 6093ba60
...@@ -1122,44 +1122,50 @@ void LwpTableLayout::PutCellVals(LwpFoundry* pFoundry, LwpObjectID aTableID) ...@@ -1122,44 +1122,50 @@ void LwpTableLayout::PutCellVals(LwpFoundry* pFoundry, LwpObjectID aTableID)
pTableRange = pTableRange->GetNext(); pTableRange = pTableRange->GetNext();
} }
if (pTableRange) if (!pTableRange)
{ return;
LwpCellRange* pRange = static_cast<LwpCellRange*>(pTableRange->GetCellRangeID().obj().get());
LwpFolder* pFolder = static_cast<LwpFolder*>(pRange->GetFolderID().obj().get()); LwpCellRange* pRange = static_cast<LwpCellRange*>(pTableRange->GetCellRangeID().obj().get());
LwpObjectID aRowListID = pFolder->GetChildHeadID(); if (!pRange)
LwpRowList* pRowList = static_cast<LwpRowList*>(aRowListID.obj().get()); return;
LwpFolder* pFolder = static_cast<LwpFolder*>(pRange->GetFolderID().obj().get());
if (!pFolder)
return;
//loop the rowlist LwpObjectID aRowListID = pFolder->GetChildHeadID();
while( nullptr!=pRowList) 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()); {//put cell
//loop the cellList sal_uInt16 nColID = pCellList->GetColumnID();
while( nullptr!=pCellList)
{ XFCell* pCell = GetCellsMap(nRowID,static_cast<sal_uInt8>(nColID));
{//put cell if (pCell)
sal_uInt16 nColID = pCellList->GetColumnID(); {
pCellList->Convert(pCell, this);
XFCell* pCell = GetCellsMap(nRowID,static_cast<sal_uInt8>(nColID));
if (pCell) //process paragraph
{ PostProcessParagraph(pCell, nRowID, nColID);
pCellList->Convert(pCell, this); }
else
//process paragraph {
PostProcessParagraph(pCell, nRowID, nColID); //Hidden cell would not be in cellsmap
} assert(false);
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 (...) { }catch (...) {
......
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