From 58d98eda287b68404c98900f65b146f53b016778 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Wed, 8 Sep 2021 12:00:22 +0200 Subject: cui: fix spell check dialog pointlessly modifying text shape In Impress, closing the spell check dialog without doing any changes will replace the entire text of a shape, creating an sd::UndoObjectSetText and messing up the formatting. Apparently in commit bbb1428e3666acc7503d86704bbf1e1a4ac04795 a check of the modified flag was removed, but it's not obvious why, so add it back, which appears to fix the problem. Change-Id: I8ce6c75f097baa82f11f7b1c813262845001ae7f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121807 Tested-by: Jenkins Reviewed-by: Michael Stahl (cherry picked from commit 73c8bd42650dafc38c87b5e6dc1ef222d4f6175c) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121768 Reviewed-by: Thorsten Behrens --- cui/source/dialogs/SpellDialog.cxx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'cui') diff --git a/cui/source/dialogs/SpellDialog.cxx b/cui/source/dialogs/SpellDialog.cxx index b583fa03768e..7b17b25e71f2 100644 --- a/cui/source/dialogs/SpellDialog.cxx +++ b/cui/source/dialogs/SpellDialog.cxx @@ -904,7 +904,10 @@ IMPL_LINK_NOARG(SpellDialog, ModifyHdl, LinkParamNone*, void) IMPL_LINK_NOARG(SpellDialog, CancelHdl, weld::Button&, void) { //apply changes and ignored text parts first - if there are any - rParent.ApplyChangedSentence(m_xSentenceED->CreateSpellPortions(), false); + if (m_xSentenceED->IsModified()) + { + rParent.ApplyChangedSentence(m_xSentenceED->CreateSpellPortions(), false); + } Close(); } -- cgit