cid#1597280 Dereference null return value
Change-Id: I0275c178a478b7143b0cf4ed19f030009b7bd2fe Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167504 Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com> Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
This commit is contained in:
@@ -916,12 +916,11 @@ void LwpTableLayout::SplitRowToCells(XFTable* pTmpTable, rtl::Reference<XFTable>
|
|||||||
|
|
||||||
//register style for heading row
|
//register style for heading row
|
||||||
double fHeight = 0;
|
double fHeight = 0;
|
||||||
OUString styleName;
|
|
||||||
std::unique_ptr<XFRowStyle> xRowStyle(new XFRowStyle);
|
std::unique_ptr<XFRowStyle> xRowStyle(new XFRowStyle);
|
||||||
XFRow* pRow = pTmpTable->GetRow(1);
|
XFRow* pRow = pTmpTable->GetRow(1);
|
||||||
if (!pRow)
|
if (!pRow)
|
||||||
throw std::runtime_error("missing row");
|
throw std::runtime_error("missing row");
|
||||||
styleName = pRow->GetStyleName();
|
OUString styleName = pRow->GetStyleName();
|
||||||
|
|
||||||
// get settings of the row and assign them to new row style
|
// get settings of the row and assign them to new row style
|
||||||
XFStyleManager* pXFStyleManager = LwpGlobalMgr::GetInstance()->GetXFStyleManager();
|
XFStyleManager* pXFStyleManager = LwpGlobalMgr::GetInstance()->GetXFStyleManager();
|
||||||
@@ -932,7 +931,8 @@ void LwpTableLayout::SplitRowToCells(XFTable* pTmpTable, rtl::Reference<XFTable>
|
|||||||
for (i=1;i<=nRowNum;i++)
|
for (i=1;i<=nRowNum;i++)
|
||||||
{
|
{
|
||||||
styleName = pTmpTable->GetRow(i)->GetStyleName();
|
styleName = pTmpTable->GetRow(i)->GetStyleName();
|
||||||
fHeight+=static_cast<XFRowStyle*>(pXFStyleManager->FindStyle(styleName))->GetRowHeight();
|
if (XFRowStyle* pRowStyle = static_cast<XFRowStyle*>(pXFStyleManager->FindStyle(styleName)))
|
||||||
|
fHeight+=pRowStyle->GetRowHeight();
|
||||||
}
|
}
|
||||||
if (m_nDirection & 0x0030)
|
if (m_nDirection & 0x0030)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user