From 03edb42acfceb93016decfd3adb1c9350796eac8 Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Thu, 30 Sep 2021 21:24:14 +0200 Subject: sw: simplify DocxAttributeOutput::CharBorder() pInherited is already nullptr at that point, so need to only change it when pPoolItem is not nullptr. Addresses . Change-Id: I456d4efba5b1d621c1b31bb2a2ec834c04cc62ce Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122901 Tested-by: Jenkins Reviewed-by: Miklos Vajna --- sw/source/filter/ww8/docxattributeoutput.cxx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index 43fa8e773b73..9c374c31ef17 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -8071,8 +8071,10 @@ void DocxAttributeOutput::CharBorder( pInherited = GetExport().m_pCurrentStyle->DerivedFrom()->GetAttrSet().GetItem(RES_CHRATR_BOX); else if ( m_rExport.m_pChpIter ) // incredibly undocumented, but this is the character-style info, right? { - const SfxPoolItem* pPoolItem = GetExport().m_pChpIter->HasTextItem(RES_CHRATR_BOX); - pInherited = pPoolItem ? &pPoolItem->StaticWhichCast(RES_CHRATR_BOX) : nullptr; + if (const SfxPoolItem* pPoolItem = GetExport().m_pChpIter->HasTextItem(RES_CHRATR_BOX)) + { + pInherited = &pPoolItem->StaticWhichCast(RES_CHRATR_BOX); + } } if ( pInherited ) -- cgit