summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sw/qa/extras/uiwriter/data3/tdf135056.odtbin0 -> 19293 bytes
-rw-r--r--sw/qa/extras/uiwriter/uiwriter3.cxx25
2 files changed, 25 insertions, 0 deletions
diff --git a/sw/qa/extras/uiwriter/data3/tdf135056.odt b/sw/qa/extras/uiwriter/data3/tdf135056.odt
new file mode 100644
index 000000000000..bd94317d07d4
--- /dev/null
+++ b/sw/qa/extras/uiwriter/data3/tdf135056.odt
Binary files differ
diff --git a/sw/qa/extras/uiwriter/uiwriter3.cxx b/sw/qa/extras/uiwriter/uiwriter3.cxx
index 1b7ac397b8e8..df37d45cc8e9 100644
--- a/sw/qa/extras/uiwriter/uiwriter3.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter3.cxx
@@ -213,6 +213,31 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf132321)
CPPUNIT_ASSERT_EQUAL(1, getShapes());
}
+CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf135056)
+{
+ load(DATA_DIRECTORY, "tdf135056.odt");
+
+ SwXTextDocument* pTextDoc = dynamic_cast<SwXTextDocument*>(mxComponent.get());
+ CPPUNIT_ASSERT(pTextDoc);
+
+ SwWrtShell* pWrtShell = pTextDoc->GetDocShell()->GetWrtShell();
+ CPPUNIT_ASSERT(pWrtShell);
+
+ CPPUNIT_ASSERT_EQUAL(sal_uInt16(1), pWrtShell->GetTOXCount());
+
+ const SwTOXBase* pTOX = pWrtShell->GetTOX(0);
+ CPPUNIT_ASSERT(pTOX);
+
+ //Without the fix in place, it would have hung here
+ pWrtShell->DeleteTOX(*pTOX, true);
+
+ CPPUNIT_ASSERT_EQUAL(sal_uInt16(0), pWrtShell->GetTOXCount());
+
+ dispatchCommand(mxComponent, ".uno:Undo", {});
+
+ CPPUNIT_ASSERT_EQUAL(sal_uInt16(1), pWrtShell->GetTOXCount());
+}
+
CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf126626)
{
load(DATA_DIRECTORY, "tdf126626.docx");