diff options
-rw-r--r-- | sw/qa/extras/uiwriter/data3/tdf125261.odt | bin | 0 -> 8900 bytes | |||
-rw-r--r-- | sw/qa/extras/uiwriter/uiwriter3.cxx | 19 | ||||
-rw-r--r-- | sw/qa/uitest/writer_tests/data/tdf125261.odt | bin | 12391 -> 0 bytes | |||
-rw-r--r-- | sw/qa/uitest/writer_tests6/tdf125261.py | 35 |
4 files changed, 19 insertions, 35 deletions
diff --git a/sw/qa/extras/uiwriter/data3/tdf125261.odt b/sw/qa/extras/uiwriter/data3/tdf125261.odt Binary files differnew file mode 100644 index 000000000000..f89e1b21f518 --- /dev/null +++ b/sw/qa/extras/uiwriter/data3/tdf125261.odt diff --git a/sw/qa/extras/uiwriter/uiwriter3.cxx b/sw/qa/extras/uiwriter/uiwriter3.cxx index 997e4d25317b..4d89873629d7 100644 --- a/sw/qa/extras/uiwriter/uiwriter3.cxx +++ b/sw/qa/extras/uiwriter/uiwriter3.cxx @@ -91,6 +91,25 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf128739) CPPUNIT_ASSERT_EQUAL(OUString(""), getParagraph(1)->getString()); } +CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf125261) +{ + load(DATA_DIRECTORY, "tdf125261.odt"); + + SwXTextDocument* pTextDoc = dynamic_cast<SwXTextDocument*>(mxComponent.get()); + CPPUNIT_ASSERT(pTextDoc); + + CPPUNIT_ASSERT_EQUAL(OUString("https://www.example.com/"), + getProperty<OUString>(getRun(getParagraph(1), 1), "HyperLinkURL")); + //apply autocorrect StartAutoCorrect + dispatchCommand(mxComponent, ".uno:AutoFormatApply", {}); + CPPUNIT_ASSERT_EQUAL(OUString("https://www.example.com/"), + getProperty<OUString>(getRun(getParagraph(1), 1), "HyperLinkURL")); + // without the fix, it hangs + dispatchCommand(mxComponent, ".uno:Undo", {}); + CPPUNIT_ASSERT_EQUAL(OUString("https://www.example.com/"), + getProperty<OUString>(getRun(getParagraph(1), 1), "HyperLinkURL")); +} + CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf126340) { load(DATA_DIRECTORY, "tdf126340.odt"); diff --git a/sw/qa/uitest/writer_tests/data/tdf125261.odt b/sw/qa/uitest/writer_tests/data/tdf125261.odt Binary files differdeleted file mode 100644 index 5fd8152448da..000000000000 --- a/sw/qa/uitest/writer_tests/data/tdf125261.odt +++ /dev/null diff --git a/sw/qa/uitest/writer_tests6/tdf125261.py b/sw/qa/uitest/writer_tests6/tdf125261.py deleted file mode 100644 index 72a0be3f2910..000000000000 --- a/sw/qa/uitest/writer_tests6/tdf125261.py +++ /dev/null @@ -1,35 +0,0 @@ -# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*- -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. -# -from uitest.framework import UITestCase -from uitest.uihelper.common import get_state_as_dict -from uitest.uihelper.common import select_pos -from uitest.uihelper.calc import enter_text_to_cell -from libreoffice.calc.document import get_cell_by_position -from libreoffice.uno.propertyvalue import mkPropertyValues -from uitest.uihelper.common import get_state_as_dict, type_text -from uitest.debug import sleep -import org.libreoffice.unotest -import pathlib - -def get_url_for_data_file(file_name): - return pathlib.Path(org.libreoffice.unotest.makeCopyFromTDOC(file_name)).as_uri() - -#Bug 125261 - Applying autocorrect to text with URLs causes Writer to hang - -class tdf125261(UITestCase): - def test_tdf125261_crash_autocorrect_text_with_URL(self): - writer_doc = self.ui_test.load_file(get_url_for_data_file("tdf125261.odt")) - document = self.ui_test.get_component() - xWriterDoc = self.xUITest.getTopFocusWindow() - #apply autocorrect StartAutoCorrect - self.xUITest.executeCommand(".uno:AutoFormatApply") - - self.xUITest.executeCommand(".uno:Undo") - - self.assertEqual(document.Text.String[0:4], "This") - self.ui_test.close_doc() -# vim: set shiftwidth=4 softtabstop=4 expandtab: |