summaryrefslogtreecommitdiff
path: root/sw/source/filter/ww8/wrtw8nds.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2020-07-30 10:37:55 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-07-31 11:56:36 +0200
commite42166098b13d1bf4f66291550ab326b750bcbed (patch)
treeeba3259fbc143867cf342ad5579619733b861b94 /sw/source/filter/ww8/wrtw8nds.cxx
parent0024c48b4822062995effed7db4f1281196384bb (diff)
loplugin:flatten in sw/filter/ww8
Change-Id: Ia296fc6e6c8f78edf533dedf52996560ae62d143 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99853 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw/source/filter/ww8/wrtw8nds.cxx')
-rw-r--r--sw/source/filter/ww8/wrtw8nds.cxx56
1 files changed, 28 insertions, 28 deletions
diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx
index 86e884fc8794..2e19f4e5bae6 100644
--- a/sw/source/filter/ww8/wrtw8nds.cxx
+++ b/sw/source/filter/ww8/wrtw8nds.cxx
@@ -555,45 +555,45 @@ void SwWW8AttrIter::OutAttr( sal_Int32 nSwPos, bool bWriteCombChars)
void SwWW8AttrIter::handleToggleProperty(SfxItemSet& rExportSet, const SwFormatCharFormat* pCharFormatItem,
sal_uInt16 nWhich, const SfxPoolItem* pValue)
{
- if (!rExportSet.HasItem(nWhich) && pValue)
- {
- bool hasPropertyInCharStyle = false;
- bool hasPropertyInParaStyle = false;
+ if (!(!rExportSet.HasItem(nWhich) && pValue))
+ return;
- // get bold flag from specified character style
- if (pCharFormatItem)
+ bool hasPropertyInCharStyle = false;
+ bool hasPropertyInParaStyle = false;
+
+ // get bold flag from specified character style
+ if (pCharFormatItem)
+ {
+ if (const SwCharFormat* pCharFormat = pCharFormatItem->GetCharFormat())
{
- if (const SwCharFormat* pCharFormat = pCharFormatItem->GetCharFormat())
+ const SfxPoolItem* pItem = nullptr;
+ if (pCharFormat->GetAttrSet().HasItem(nWhich, &pItem))
{
- const SfxPoolItem* pItem = nullptr;
- if (pCharFormat->GetAttrSet().HasItem(nWhich, &pItem))
- {
- hasPropertyInCharStyle = (*pItem == *pValue);
- }
+ hasPropertyInCharStyle = (*pItem == *pValue);
}
}
+ }
- // get bold flag from specified paragraph style
+ // get bold flag from specified paragraph style
+ {
+ SwTextFormatColl& rTextColl = static_cast<SwTextFormatColl&>( rNd.GetAnyFormatColl() );
+ sal_uInt16 nStyle = m_rExport.m_pStyles->GetSlot( &rTextColl );
+ nStyle = ( nStyle != 0xfff ) ? nStyle : 0;
+ const SwFormat* pFormat = m_rExport.m_pStyles->GetSwFormat(nStyle);
+ if (pFormat)
{
- SwTextFormatColl& rTextColl = static_cast<SwTextFormatColl&>( rNd.GetAnyFormatColl() );
- sal_uInt16 nStyle = m_rExport.m_pStyles->GetSlot( &rTextColl );
- nStyle = ( nStyle != 0xfff ) ? nStyle : 0;
- const SwFormat* pFormat = m_rExport.m_pStyles->GetSwFormat(nStyle);
- if (pFormat)
+ const SfxPoolItem* pItem = nullptr;
+ if (pFormat->GetAttrSet().HasItem(nWhich, &pItem))
{
- const SfxPoolItem* pItem = nullptr;
- if (pFormat->GetAttrSet().HasItem(nWhich, &pItem))
- {
- hasPropertyInParaStyle = (*pItem == *pValue);
- }
+ hasPropertyInParaStyle = (*pItem == *pValue);
}
}
+ }
- // add inline property
- if (hasPropertyInCharStyle && hasPropertyInParaStyle)
- {
- rExportSet.Put(*pValue);
- }
+ // add inline property
+ if (hasPropertyInCharStyle && hasPropertyInParaStyle)
+ {
+ rExportSet.Put(*pValue);
}
}