summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sw/qa/extras/uiwriter/data3/tdf126626.docx (renamed from sw/qa/uitest/writer_tests/data/tdf126626.docx)bin16513 -> 16513 bytes
-rw-r--r--sw/qa/extras/uiwriter/uiwriter3.cxx16
-rw-r--r--sw/qa/uitest/writer_tests6/tdf126626.py43
3 files changed, 16 insertions, 43 deletions
diff --git a/sw/qa/uitest/writer_tests/data/tdf126626.docx b/sw/qa/extras/uiwriter/data3/tdf126626.docx
index a2a289c2daca..a2a289c2daca 100644
--- a/sw/qa/uitest/writer_tests/data/tdf126626.docx
+++ b/sw/qa/extras/uiwriter/data3/tdf126626.docx
Binary files differ
diff --git a/sw/qa/extras/uiwriter/uiwriter3.cxx b/sw/qa/extras/uiwriter/uiwriter3.cxx
index 1d6e351b614a..5ca1eda7c42a 100644
--- a/sw/qa/extras/uiwriter/uiwriter3.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter3.cxx
@@ -33,4 +33,20 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf129382)
// without the fix, it crashes
dispatchCommand(mxComponent, ".uno:Undo", {});
}
+
+CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf126626)
+{
+ load(DATA_DIRECTORY, "tdf126626.docx");
+
+ SwXTextDocument* pTextDoc = dynamic_cast<SwXTextDocument*>(mxComponent.get());
+ CPPUNIT_ASSERT(pTextDoc);
+
+ dispatchCommand(mxComponent, ".uno:SelectAll", {});
+ dispatchCommand(mxComponent, ".uno:Copy", {});
+ dispatchCommand(mxComponent, ".uno:Paste", {});
+ dispatchCommand(mxComponent, ".uno:Paste", {});
+ dispatchCommand(mxComponent, ".uno:Undo", {});
+ // without the fix, it crashes
+ dispatchCommand(mxComponent, ".uno:Paste", {});
+}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/qa/uitest/writer_tests6/tdf126626.py b/sw/qa/uitest/writer_tests6/tdf126626.py
deleted file mode 100644
index bd06951027ea..000000000000
--- a/sw/qa/uitest/writer_tests6/tdf126626.py
+++ /dev/null
@@ -1,43 +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 libreoffice.uno.propertyvalue import mkPropertyValues
-from uitest.uihelper.common import get_state_as_dict, type_text
-import time
-from uitest.debug import sleep
-from libreoffice.uno.propertyvalue import mkPropertyValues
-from uitest.uihelper.common import select_pos
-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 126626 - CRASH: pasting fly at-char selection
-
-class tdf126626(UITestCase):
- def test_tdf126626_crash_paste(self):
- writer_doc = self.ui_test.load_file(get_url_for_data_file("tdf126626.docx"))
- document = self.ui_test.get_component()
- xWriterDoc = self.xUITest.getTopFocusWindow()
- xWriterEdit = xWriterDoc.getChild("writer_edit")
-
- # 2. Select all
- self.xUITest.executeCommand(".uno:SelectAll")
- # 3. Copy
- self.xUITest.executeCommand(".uno:Copy")
- # 4. Paste TWO TIMES
- self.xUITest.executeCommand(".uno:Paste")
- self.xUITest.executeCommand(".uno:Paste")
- # 5. Undo once
- self.xUITest.executeCommand(".uno:Undo")
- # 6. Paste
- self.xUITest.executeCommand(".uno:Paste")
- #-> Crash
- self.assertEqual(document.CurrentController.PageCount, 1)
-
- self.ui_test.close_doc()
-# vim: set shiftwidth=4 softtabstop=4 expandtab: