summaryrefslogtreecommitdiff
path: root/sw/inc/ndtxt.hxx
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2021-09-27 19:59:54 +0200
committerMiklos Vajna <vmiklos@collabora.com>2021-09-28 08:10:40 +0200
commit1734e97222324c137ecd084ad2464abdff2698d1 (patch)
tree34e62cc9f21a5c38c8d07060edcc122d2850f466 /sw/inc/ndtxt.hxx
parente753de4630fb74ac837d0339be23a305f18d0725 (diff)
tdf#143819 sw: fix undo not restoring adjusted anchor
Regression from commit 0a4d77f35e96e4dfdf69cc5ceb788ddaa849084c (SwTxtNode::Update: don't move anchors at insert position, 2014-10-06), the problem is that in case backspace adjusts the anchor point of a fly and undo does an insert (which now doesn't adjust the anchor point), then the user action and its undo is not in sync. Fix this by informing SwTextNode::Update() if an undo is in progress and doing the old behavior in that case. Change-Id: I0b3f3954be11420846f84287e486b993b2dc39e8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122727 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'sw/inc/ndtxt.hxx')
-rw-r--r--sw/inc/ndtxt.hxx6
1 files changed, 6 insertions, 0 deletions
diff --git a/sw/inc/ndtxt.hxx b/sw/inc/ndtxt.hxx
index 6b64fdef8b19..d3320d995d06 100644
--- a/sw/inc/ndtxt.hxx
+++ b/sw/inc/ndtxt.hxx
@@ -117,6 +117,9 @@ class SW_DLLPUBLIC SwTextNode final
Needed to avoid duplicate handling of attribute change actions. */
bool mbInSetOrResetAttr;
+ /// Is an undo operation in progress?
+ bool m_bInUndo;
+
std::optional< OUString > m_oNumStringCache;
css::uno::WeakReference<css::text::XTextContent> m_wXParagraph;
@@ -790,6 +793,7 @@ public:
/// sfx2::Metadatable
virtual ::sfx2::IXmlIdRegistry& GetRegistry() override;
virtual bool IsInClipboard() const override;
+ /// Is this node in the undo array?
virtual bool IsInUndo() const override;
virtual bool IsInContent() const override;
virtual css::uno::Reference< css::rdf::XMetadatable > MakeUnoObject() override;
@@ -811,6 +815,8 @@ public:
static bool IsIgnoredCharFormatForNumbering(const sal_uInt16 nWhich, bool bIsCharStyle = false);
void FormatDropNotify(const SwFormatDrop& rDrop) override
{ TriggerNodeUpdate(sw::LegacyModifyHint(&rDrop, &rDrop)); };
+
+ void SetInSwUndo(bool bInUndo);
};
inline SwpHints & SwTextNode::GetSwpHints()