summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorOliver Specht <oliver.specht@cib.de>2024-02-14 09:04:09 +0100
committerThorsten Behrens <thorsten.behrens@allotropia.de>2024-02-15 22:29:25 +0100
commitfb72dc2474e644b66f8de6557210a2f6dedcfcc3 (patch)
treede1010f87ec99a731374e7a162fa84f0275bf0b4 /sw
parent63236e47b8d8b128a5696c1f667addd6584926ad (diff)
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 <thorsten.behrens@allotropia.de> Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
Diffstat (limited to 'sw')
-rwxr-xr-xsw/qa/uitest/data/tdf157992.odtbin0 -> 31660 bytes
-rw-r--r--sw/qa/uitest/writer_tests4/spellDialog.py20
2 files changed, 20 insertions, 0 deletions
diff --git a/sw/qa/uitest/data/tdf157992.odt b/sw/qa/uitest/data/tdf157992.odt
new file mode 100755
index 000000000000..4a2668263339
--- /dev/null
+++ b/sw/qa/uitest/data/tdf157992.odt
Binary files 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: