summaryrefslogtreecommitdiff
path: root/sw/qa/extras/uiwriter
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2014-03-12 17:28:10 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2014-03-12 18:11:40 +0100
commitf9b62506b22c3eb885ffd5a4ec8025c33df7b2d4 (patch)
tree421f580b0f5667bf1c071602cf7303ac78bc4b43 /sw/qa/extras/uiwriter
parent9cfa665706cbced0fa71c43bb9425f28a0145f67 (diff)
fdo#75110 SwEditShell::DeleteSel fix start of selection when bSelAll == true
Change-Id: I3e8ce585b29619061b18ab1ab8f0cf6c7d421074
Diffstat (limited to 'sw/qa/extras/uiwriter')
-rw-r--r--sw/qa/extras/uiwriter/data/fdo75110.odtbin0 -> 13169 bytes
-rw-r--r--sw/qa/extras/uiwriter/uiwriter.cxx15
2 files changed, 15 insertions, 0 deletions
diff --git a/sw/qa/extras/uiwriter/data/fdo75110.odt b/sw/qa/extras/uiwriter/data/fdo75110.odt
new file mode 100644
index 000000000000..f4c2f2bb699b
--- /dev/null
+++ b/sw/qa/extras/uiwriter/data/fdo75110.odt
Binary files differ
diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx b/sw/qa/extras/uiwriter/uiwriter.cxx
index 6df74260f47f..8e59941ef9f5 100644
--- a/sw/qa/extras/uiwriter/uiwriter.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter.cxx
@@ -28,6 +28,7 @@ public:
void testFdo70807();
void testImportRTF();
void testExportRTF();
+ void testFdo75110();
CPPUNIT_TEST_SUITE(SwUiWriterTest);
CPPUNIT_TEST(testReplaceForward);
@@ -36,6 +37,7 @@ public:
CPPUNIT_TEST(testFdo70807);
CPPUNIT_TEST(testImportRTF);
CPPUNIT_TEST(testExportRTF);
+ CPPUNIT_TEST(testFdo75110);
CPPUNIT_TEST_SUITE_END();
private:
@@ -87,6 +89,19 @@ void SwUiWriterTest::testReplaceForward()
CPPUNIT_ASSERT_EQUAL(ORIGINAL_REPLACE_CONTENT, pTxtNode->GetTxt());
}
+void SwUiWriterTest::testFdo75110()
+{
+ SwDoc* pDoc = createDoc("fdo75110.odt");
+ SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell();
+
+ pWrtShell->SelAll();
+ // The problem was that SwEditShell::DeleteSel() what this Delete() invokes took the wrong selection...
+ pWrtShell->Delete();
+ sw::UndoManager& rUndoManager = pDoc->GetUndoManager();
+ // ... so this Undo() call resulted in a crash.
+ rUndoManager.Undo();
+}
+
void SwUiWriterTest::testReplaceBackward()
{
SwDoc* pDoc = createDoc();