diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2019-04-14 13:58:14 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2019-04-14 14:14:36 +0200 |
commit | 0869895063bd528893707cb74c6cf4c461fef066 (patch) | |
tree | bf47ccc71145f3ee387a5dafbaab9bc86b47a008 /lotuswordpro/source/filter/lwptablelayout.cxx | |
parent | 4acae16f9252ada89fd530f1ca86edafc046bc07 (diff) |
tdf#120703 PVS: Silence V522 warnings
V522 There might be dereferencing of a potential null pointer.
Change-Id: Ie4bc74a734a6d5a73838a27e0d80cc8e51595839
Reviewed-on: https://gerrit.libreoffice.org/70730
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'lotuswordpro/source/filter/lwptablelayout.cxx')
-rw-r--r-- | lotuswordpro/source/filter/lwptablelayout.cxx | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/lotuswordpro/source/filter/lwptablelayout.cxx b/lotuswordpro/source/filter/lwptablelayout.cxx index f14990156d01..48e4ee97837b 100644 --- a/lotuswordpro/source/filter/lwptablelayout.cxx +++ b/lotuswordpro/source/filter/lwptablelayout.cxx @@ -757,8 +757,8 @@ void LwpTableLayout::RegisterStyle() // the old code doesn't check if the LwpFoundry pointer is NULL, // so the NULL pointer cause sodc freeze. Add code to check the pointer. - if (GetFoundry() && GetTable()) - PutCellVals(GetFoundry(), GetTable()->GetObjectID()); + if (GetFoundry()) + PutCellVals(GetFoundry(), pTable->GetObjectID()); } /** * @short read table layout @@ -847,7 +847,9 @@ sal_uInt16 LwpTableLayout::ConvertHeadingRow( rtl::Reference<XFTable> const & pXFTable, sal_uInt16 nStartHeadRow, sal_uInt16 nEndHeadRow) { sal_uInt16 nContentRow; - sal_uInt8 nCol = static_cast<sal_uInt8>(GetTable()->GetColumn()); + LwpTable* pTable = GetTable(); + assert(pTable); + sal_uInt8 nCol = static_cast<sal_uInt8>(pTable->GetColumn()); rtl::Reference<XFTable> pTmpTable( new XFTable ); ConvertTable(pTmpTable.get(),nStartHeadRow,nEndHeadRow,0,nCol); @@ -888,7 +890,9 @@ void LwpTableLayout::SplitRowToCells(XFTable* pTmpTable, rtl::Reference<XFTable> { sal_uInt16 i; sal_uInt16 nRowNum = pTmpTable->GetRowCount(); - sal_uInt8 nCol = static_cast<sal_uInt8>(GetTable()->GetColumn()); + LwpTable* pTable = GetTable(); + assert(pTable); + sal_uInt8 nCol = static_cast<sal_uInt8>(pTable->GetColumn()); rtl::Reference<XFRow> xXFRow(new XFRow); @@ -1360,8 +1364,10 @@ void LwpTableLayout::ConvertDefaultRow(rtl::Reference<XFTable> const & pXFTable, rtl::Reference<XFCell> xCell; if (m_pDefaultCellLayout) { + LwpTable* pTable = GetTable(); + assert(pTable); xCell = m_pDefaultCellLayout->DoConvertCell( - GetTable()->GetObjectID(),nRowID,j+nStartCol); + pTable->GetObjectID(),nRowID,j+nStartCol); } else { |