summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stahl <Michael.Stahl@cib.de>2018-11-16 16:44:41 +0100
committerMichael Stahl <Michael.Stahl@cib.de>2018-12-07 10:32:26 +0100
commit1a8606c8c649a71e1fc0a6686682e7b46df6aaf9 (patch)
tree9dec9f9ae35465caa68efdcdf2bbfb35c9e7046b
parenteed52ea109cb11179907a2dc14c4f206f1b2fc0a (diff)
sw: simplify SwTextNode::GetAttr()
Change-Id: I78d32031ebc42d749dbc750b7127983810bbfb1d (cherry picked from commit cb53a34d663626a2ae26ab85d5735bc1371c8aab)
-rw-r--r--sw/source/core/txtnode/thints.cxx35
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;