summaryrefslogtreecommitdiff
path: root/sw/inc
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2017-05-10 17:45:14 +0200
committerMichael Stahl <mstahl@redhat.com>2017-05-10 18:01:09 +0200
commit771d85baf18e5b503eb6248e1f41928b00265d8d (patch)
tree5ea7b0ca65fece457fe764d84ff4f575e425ce54 /sw/inc
parentffe239962f195781c6b086c5a284aad333e3e12e (diff)
tdf#107512 sw: fix rollback of text attributes in SwUndoDelete
The problem is that in SwUndoDelete::UndoImpl(), first the formatting attributes are restored via TmpRollback(), and then all footnote/fly attributes are restored via Rollback(). This means that the SwHistory doesn't actually store the original positions of the formatting hints; ideally there wouldn't be 2 separate steps here, but that appears difficult to change now given the plethora of calls to DelContentIndex() ... So work around the problem by adding a new SetAttrMode::NOHINTEXPAND to prevent expanding the existing hints when the CH_TXTATR_BREAKWORD are inserted from SwUndoDelLayFormat. This fixes 2 problematic cases: at the start of the paragraph, and if the hint ends at the position before the CH_TXTATR_BREAKWORD. Let's hope this won't break anything anybody cares about. Change-Id: I557c4c9136f4225ca502019730fb9f0a9c03d23b
Diffstat (limited to 'sw/inc')
-rw-r--r--sw/inc/swtypes.hxx6
1 files changed, 4 insertions, 2 deletions
diff --git a/sw/inc/swtypes.hxx b/sw/inc/swtypes.hxx
index 76ee8b94243a..2307091b98e4 100644
--- a/sw/inc/swtypes.hxx
+++ b/sw/inc/swtypes.hxx
@@ -170,11 +170,13 @@ enum class SetAttrMode
/// Force hint expand (only matters for hints with CH_TXTATR).
FORCEHINTEXPAND = 0x0040,
/// The inserted item is a copy -- intended for use in ndtxt.cxx.
- IS_COPY = 0x0080
+ IS_COPY = 0x0080,
+ /// for Undo, translated to SwInsertFlags::NOHINTEXPAND
+ NOHINTEXPAND = 0x0100,
};
namespace o3tl
{
- template<> struct typed_flags<SetAttrMode> : is_typed_flags<SetAttrMode, 0x0ff> {};
+ template<> struct typed_flags<SetAttrMode> : is_typed_flags<SetAttrMode, 0x1ff> {};
}
#define SW_ISPRINTABLE( c ) ( c >= ' ' && 127 != c )