diff options
author | Michael Stahl <Michael.Stahl@cib.de> | 2018-11-16 16:44:41 +0100 |
---|---|---|
committer | Michael Stahl <Michael.Stahl@cib.de> | 2018-12-01 08:44:43 +0100 |
commit | cb53a34d663626a2ae26ab85d5735bc1371c8aab (patch) | |
tree | 594f2e6987884fbfe52358a1b5f546601553a309 | |
parent | a91992e7b3e7f59e9116aef859696d517a93dab7 (diff) |
sw: simplify SwTextNode::GetAttr()
Change-Id: I78d32031ebc42d749dbc750b7127983810bbfb1d
-rw-r--r-- | sw/source/core/txtnode/thints.cxx | 35 |
1 files changed, 15 insertions, 20 deletions
diff --git a/sw/source/core/txtnode/thints.cxx b/sw/source/core/txtnode/thints.cxx index f021b17b3a28..c2d9d1f09569 100644 --- a/sw/source/core/txtnode/thints.cxx +++ b/sw/source/core/txtnode/thints.cxx @@ -2054,6 +2054,17 @@ bool SwTextNode::GetAttr( SfxItemSet& rSet, sal_Int32 nStt, sal_Int32 nEnd, { assert(!rSet.Count()); // handled inconsistently, typically an error? + // get the node's automatic attributes + SfxItemSet aFormatSet( *rSet.GetPool(), rSet.GetRanges() ); + if (!bOnlyTextAttr) + { + SwContentNode::GetAttr( aFormatSet ); + if ( bMergeIndentValuesOfNumRule ) + { + lcl_MergeListLevelIndentAsLRSpaceItem( *this, aFormatSet ); + } + } + if( HasHints() ) { // First, check which text attributes are valid in the range. @@ -2071,17 +2082,6 @@ bool SwTextNode::GetAttr( SfxItemSet& rSet, sal_Int32 nStt, sal_Int32 nEnd, = bGetFromChrFormat ? &lcl_MergeAttr_ExpandChrFormat : &lcl_MergeAttr; - // get the node's automatic attributes - SfxItemSet aFormatSet( *rSet.GetPool(), rSet.GetRanges() ); - if( !bOnlyTextAttr ) - { - SwContentNode::GetAttr( aFormatSet ); - if ( bMergeIndentValuesOfNumRule ) - { - lcl_MergeListLevelIndentAsLRSpaceItem( *this, aFormatSet ); - } - } - const size_t nSize = m_pSwpHints->Count(); if (nStt == nEnd) // no range: @@ -2249,18 +2249,13 @@ bool SwTextNode::GetAttr( SfxItemSet& rSet, sal_Int32 nStt, sal_Int32 nEnd, { // remove all from the format-set that are also set in the text-set aFormatSet.Differentiate( rSet ); - // now "merge" everything - rSet.Put( aFormatSet ); } } - else if( !bOnlyTextAttr ) + + if (aFormatSet.Count()) { - // get the node's automatic attributes - SwContentNode::GetAttr( rSet ); - if ( bMergeIndentValuesOfNumRule ) - { - lcl_MergeListLevelIndentAsLRSpaceItem( *this, rSet ); - } + // now "merge" everything + rSet.Put( aFormatSet ); } return rSet.Count() != 0; |