[Libreoffice-commits] core.git: sw/source
Caolán McNamara
caolanm at redhat.com
Tue Dec 26 21:13:11 UTC 2017
sw/source/filter/html/htmltab.cxx | 19 ++++++++++++-------
1 file changed, 12 insertions(+), 7 deletions(-)
New commits:
commit e2dab2bb2ce4f113f4fd2aa24042c0c297cef674
Author: Caolán McNamara <caolanm at redhat.com>
Date: Tue Dec 26 21:07:14 2017 +0000
ofz#4794 Null-dereference
Change-Id: I2fc9f5ca60c2a476c031befd0253b1829538230d
diff --git a/sw/source/filter/html/htmltab.cxx b/sw/source/filter/html/htmltab.cxx
index 6d3c6e50894f..6a8a66e2510a 100644
--- a/sw/source/filter/html/htmltab.cxx
+++ b/sw/source/filter/html/htmltab.cxx
@@ -3926,13 +3926,18 @@ void SwHTMLParser::BuildTableCell( HTMLTable *pCurTable, bool bReadOptions,
{
const SwEndNode *pEndNd = pStNd->EndOfSectionNode();
SwContentNode *pCNd = m_xDoc->GetNodes()[pEndNd->GetIndex()-1] ->GetContentNode();
- //Added defaults to CJK and CTL
- SvxFontHeightItem aFontHeight( 40, 100, RES_CHRATR_FONTSIZE );
- pCNd->SetAttr( aFontHeight );
- SvxFontHeightItem aFontHeightCJK( 40, 100, RES_CHRATR_CJK_FONTSIZE );
- pCNd->SetAttr( aFontHeightCJK );
- SvxFontHeightItem aFontHeightCTL( 40, 100, RES_CHRATR_CTL_FONTSIZE );
- pCNd->SetAttr( aFontHeightCTL );
+ if (!pCNd)
+ eState = SvParserState::Error;
+ else
+ {
+ //Added defaults to CJK and CTL
+ SvxFontHeightItem aFontHeight( 40, 100, RES_CHRATR_FONTSIZE );
+ pCNd->SetAttr( aFontHeight );
+ SvxFontHeightItem aFontHeightCJK( 40, 100, RES_CHRATR_CJK_FONTSIZE );
+ pCNd->SetAttr( aFontHeightCJK );
+ SvxFontHeightItem aFontHeightCTL( 40, 100, RES_CHRATR_CTL_FONTSIZE );
+ pCNd->SetAttr( aFontHeightCTL );
+ }
}
xSaveStruct->AddContents( new HTMLTableCnts(pStNd) );
More information about the Libreoffice-commits
mailing list