diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-05-14 11:34:33 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-05-14 11:39:16 +0200 |
commit | 3c0805e1f4f4d14e92c7e655d59c87de5c207e48 (patch) | |
tree | f83e033781b6724aa77a19537e035d3cfced524e /sw/inc/ndtxt.hxx | |
parent | 7e9a4944e53d95f7defb1da384b665e65b2ebc55 (diff) |
tdf#86639 SwEditShell: when setting para style, reset char attrs if needed
The old internal RTF filter used to call SwTxtNode::SetAttr() without
setting SetAttrMode::NOFORMATATTR, so character attributes which cover
the whole node got converted to paragraph attributes. The new UNO
filter goes through SwXText::insertTextPortion(), which sets
SetAttrMode::NOFORMATATTR, so this doesn't happen. The result of this is
that when the UI sets a new paragraph style on the text node, then such
character attributes are no longer removed.
Given that in RTF you can't really have character properties on a
paragraph, going back to the document model produced by the old internal
filter doesn't sound like the good direction -- not to mention that
changing SwXText::insertTextPortion() this way would be an implicit API
change.
Fix the problem by tweaking SwEditShell::SetTxtFmtColl() instead, so
that it removes these full-text-node character attributes, too. The
logic in SwTxtNode::RstTxtAttr() can be extended later if necessary to
delete more attributes, but to be on the safe side, just handle the bare
minimum necessary to fix the problem for now.
Change-Id: I5faa3226fc0f9c18e005da185fe0830d8c393256
Diffstat (limited to 'sw/inc/ndtxt.hxx')
-rw-r--r-- | sw/inc/ndtxt.hxx | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sw/inc/ndtxt.hxx b/sw/inc/ndtxt.hxx index e186da7aaedd..87a29ec1bd7d 100644 --- a/sw/inc/ndtxt.hxx +++ b/sw/inc/ndtxt.hxx @@ -266,13 +266,17 @@ public: @param bInclRefToxMark refmarks, toxmarks, and metas will be ignored unless this is true ATTENTION: setting bInclRefToxMark is only allowed from UNDO! + @param bExactRange From the attributes included in the range, delete + only the ones which have exactly same range. Don't delete the ones + which are simply included in the range. */ void RstTxtAttr( const SwIndex &rIdx, const sal_Int32 nLen, const sal_uInt16 nWhich = 0, const SfxItemSet* pSet = 0, - const bool bInclRefToxMark = false ); + const bool bInclRefToxMark = false, + const bool bExactRange = false ); void GCAttr(); // Delete text attribute (needs to be deregistered at Pool!) |