sw/qa/uitest/data/tdf157992.odt           |binary
 sw/qa/uitest/writer_tests4/spellDialog.py |   20 ++++++++++++++++++++
 2 files changed, 20 insertions(+)

New commits:
commit fb72dc2474e644b66f8de6557210a2f6dedcfcc3
Author:     Oliver Specht <[email protected]>
AuthorDate: Wed Feb 14 09:04:09 2024 +0100
Commit:     Thorsten Behrens <[email protected]>
CommitDate: Thu Feb 15 22:29:25 2024 +0100

    tdf#157992: add test to make sure footnotes don't get deleted
    
    This tests calls the SpellDialog with a paragraph containing a
    footnote. Prior to the fix of tdf#157992 the footnote had been deleted
    when the spelling error has been manually fixed.
    
    Change-Id: Ib57d49d8fad153c96daa1b1f6554abebd272a7f2
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163351
    Tested-by: Thorsten Behrens <[email protected]>
    Reviewed-by: Thorsten Behrens <[email protected]>

diff --git a/sw/qa/uitest/data/tdf157992.odt b/sw/qa/uitest/data/tdf157992.odt
new file mode 100755
index 000000000000..4a2668263339
Binary files /dev/null and b/sw/qa/uitest/data/tdf157992.odt differ
diff --git a/sw/qa/uitest/writer_tests4/spellDialog.py 
b/sw/qa/uitest/writer_tests4/spellDialog.py
index 5fbffe93b1ca..801141b75987 100644
--- a/sw/qa/uitest/writer_tests4/spellDialog.py
+++ b/sw/qa/uitest/writer_tests4/spellDialog.py
@@ -13,6 +13,7 @@ from uitest.uihelper.common import get_state_as_dict, 
get_url_for_data_file
 from uitest.uihelper.common import type_text
 
 from libreoffice.linguistic.linguservice import get_spellchecker
+from libreoffice.uno.propertyvalue import mkPropertyValues
 from com.sun.star.lang import Locale
 
 class SpellingAndGrammarDialog(UITestCase):
@@ -181,4 +182,23 @@ frog, dogg, catt"""
             # This was False (lost comment)
             self.assertEqual(True, has_comment)
 
+    def test_tdf157992(self):
+        supported_locale = self.is_supported_locale("en", "US")
+        if not supported_locale:
+            self.skipTest("no dictionary support for en_US available")
+
+        with self.ui_test.load_file(get_url_for_data_file("tdf157992.odt")) as 
document:
+            with 
self.ui_test.execute_modeless_dialog_through_command(".uno:SpellingAndGrammarDialog",
 close_button="") as xDialog:
+                sentence = xDialog.getChild('sentence')
+                sentence.executeAction('TYPE', 
mkPropertyValues({'KEYCODE':'KEY_RIGHT'}))
+                sentence.executeAction('TYPE', 
mkPropertyValues({'KEYCODE':'DELETE'}))
+                sentence.executeAction('TYPE', 
mkPropertyValues({'KEYCODE':'DELETE'}))
+                sentence.executeAction('TYPE', mkPropertyValues({'TEXT':'oo'}))
+                change = xDialog.getChild('change')
+                with self.ui_test.execute_blocking_action(
+                        change.executeAction, args=('CLICK', ()), 
close_button="ok"):
+                    footnotes = document.getFootnotes()
+                    self.assertTrue(len(footnotes) == 1)
+
+
 # vim: set shiftwidth=4 softtabstop=4 expandtab:

Reply via email to