summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2017-12-22 21:33:52 +0000
committerCaolán McNamara <caolanm@redhat.com>2017-12-23 17:23:27 +0100
commitf2e0c18cd44fff1e1b79924f582ced400fb00dad (patch)
treef2b6ef0325f65285077ce0105f542aafe882eeb5
parenta7a61e3347bc74d6f9cb1f82ce4c15db54d0f008 (diff)
ofz#4728 Null-deref
Change-Id: Ide91a63424f864e2913b8268c4eca7961ba54572 Reviewed-on: https://gerrit.libreoffice.org/47000 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--sw/source/filter/html/htmltab.cxx8
1 files changed, 4 insertions, 4 deletions
diff --git a/sw/source/filter/html/htmltab.cxx b/sw/source/filter/html/htmltab.cxx
index 723d9544d21d..80ddf65f2303 100644
--- a/sw/source/filter/html/htmltab.cxx
+++ b/sw/source/filter/html/htmltab.cxx
@@ -3585,6 +3585,7 @@ void SwHTMLParser::BuildTableCell( HTMLTable *pCurTable, bool bReadOptions,
const SwTable* pSwTable = m_xDoc->InsertTable(
SwInsertTableOptions( tabopts::HEADLINE_NO_BORDER, 1 ),
*m_pPam->GetPoint(), 1, 1, text::HoriOrientation::LEFT );
+ SwFrameFormat *pFrameFormat = pSwTable ? pSwTable->GetFrameFormat() : nullptr;
if( bForceFrame )
{
@@ -3594,10 +3595,10 @@ void SwHTMLParser::BuildTableCell( HTMLTable *pCurTable, bool bReadOptions,
}
else
{
- if( bStyleParsed )
+ if (bStyleParsed && pFrameFormat)
{
m_pCSS1Parser->SetFormatBreak( aItemSet, aPropInfo );
- pSwTable->GetFrameFormat()->SetFormatAttr( aItemSet );
+ pFrameFormat->SetFormatAttr( aItemSet );
}
m_pPam->Move( fnMoveBackward );
}
@@ -3606,8 +3607,7 @@ void SwHTMLParser::BuildTableCell( HTMLTable *pCurTable, bool bReadOptions,
SwTextNode *const pOldTextNd = (!bAppended && !bForceFrame) ?
pSavePos->nNode.GetNode().GetTextNode() : nullptr;
- SwFrameFormat *pFrameFormat = (pOldTextNd && pSwTable) ? pSwTable->GetFrameFormat() : nullptr;
- if (pFrameFormat)
+ if (pFrameFormat && pOldTextNd)
{
const SfxPoolItem* pItem2;
if( SfxItemState::SET == pOldTextNd->GetSwAttrSet()