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 | |
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')
-rw-r--r-- | lotuswordpro/source/filter/lwpcelllayout.cxx | 1 | ||||
-rw-r--r-- | lotuswordpro/source/filter/lwpfribsection.cxx | 4 | ||||
-rw-r--r-- | lotuswordpro/source/filter/lwprowlayout.cxx | 1 | ||||
-rw-r--r-- | lotuswordpro/source/filter/lwptablelayout.cxx | 16 |
4 files changed, 15 insertions, 7 deletions
diff --git a/lotuswordpro/source/filter/lwpcelllayout.cxx b/lotuswordpro/source/filter/lwpcelllayout.cxx index 373656132adb..17f516a7897a 100644 --- a/lotuswordpro/source/filter/lwpcelllayout.cxx +++ b/lotuswordpro/source/filter/lwpcelllayout.cxx @@ -348,6 +348,7 @@ LwpPara* LwpCellLayout::GetLastParaOfPreviousStory() if (pPreStoryID && !(pPreStoryID->IsNull())) { LwpStory* pPreStory = dynamic_cast<LwpStory*>(pPreStoryID->obj(VO_STORY).get()); + assert(pPreStory); return dynamic_cast<LwpPara*>(pPreStory->GetLastPara().obj(VO_PARA).get()); } else diff --git a/lotuswordpro/source/filter/lwpfribsection.cxx b/lotuswordpro/source/filter/lwpfribsection.cxx index ccb7307b4fe7..de536253f24e 100644 --- a/lotuswordpro/source/filter/lwpfribsection.cxx +++ b/lotuswordpro/source/filter/lwpfribsection.cxx @@ -132,8 +132,8 @@ void LwpFribSection::SetSectionName() */ LwpPageLayout* LwpFribSection::GetPageLayout() { - if(GetSection()) - return GetSection()->GetPageLayout(); + if (LwpSection* pSection = GetSection()) + return pSection->GetPageLayout(); return nullptr; } diff --git a/lotuswordpro/source/filter/lwprowlayout.cxx b/lotuswordpro/source/filter/lwprowlayout.cxx index a0a90a417c69..4140385bf8af 100644 --- a/lotuswordpro/source/filter/lwprowlayout.cxx +++ b/lotuswordpro/source/filter/lwprowlayout.cxx @@ -191,6 +191,7 @@ void LwpRowLayout::Read() void LwpRowLayout::ConvertRow(rtl::Reference<XFTable> const & pXFTable,sal_uInt8 nStartCol,sal_uInt8 nEndCol) { LwpTableLayout* pTableLayout = GetParentTableLayout(); + assert(pTableLayout); LwpTable* pTable = pTableLayout->GetTable(); //calculate the connected cell position 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 { |