summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sw/qa/extras/uiwriter/data/fdo69893.odtbin0 -> 7178 bytes
-rw-r--r--sw/qa/extras/uiwriter/uiwriter.cxx16
-rw-r--r--sw/source/ui/wrtsh/select.cxx6
3 files changed, 22 insertions, 0 deletions
diff --git a/sw/qa/extras/uiwriter/data/fdo69893.odt b/sw/qa/extras/uiwriter/data/fdo69893.odt
new file mode 100644
index 000000000000..a2f7aa7695c7
--- /dev/null
+++ b/sw/qa/extras/uiwriter/data/fdo69893.odt
Binary files differ
diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx b/sw/qa/extras/uiwriter/uiwriter.cxx
index fa0bb144dbeb..8fd994724cb1 100644
--- a/sw/qa/extras/uiwriter/uiwriter.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter.cxx
@@ -8,6 +8,7 @@
#include <swmodeltestbase.hxx>
#include <ndtxt.hxx>
+#include <wrtsh.hxx>
#include "UndoManager.hxx"
@@ -21,10 +22,12 @@ public:
//Regression test of fdo#70143
//EDITING: undo search&replace corrupt text when searching backward
void testReplaceBackward();
+ void testFdo69893();
CPPUNIT_TEST_SUITE(SwUiWriterTest);
CPPUNIT_TEST(testReplaceForward);
CPPUNIT_TEST(testReplaceBackward);
+ CPPUNIT_TEST(testFdo69893);
CPPUNIT_TEST_SUITE_END();
private:
@@ -97,6 +100,19 @@ void SwUiWriterTest::testReplaceBackward()
CPPUNIT_ASSERT_EQUAL(ORIGINAL_REPLACE_CONTENT, pTxtNode->GetTxt());
}
+void SwUiWriterTest::testFdo69893()
+{
+ SwDoc* pDoc = createDoc("fdo69893.odt");
+ SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell();
+
+ pWrtShell->SelAll();
+
+ SwShellCrsr* pShellCrsr = pWrtShell->getShellCrsr(false);
+ SwTxtNode& rEnd = dynamic_cast<SwTxtNode&>(pShellCrsr->End()->nNode.GetNode());
+ // Selection did not include the para after table, this was "B1".
+ CPPUNIT_ASSERT_EQUAL(OUString("Para after table."), rEnd.GetTxt());
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(SwUiWriterTest);
CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sw/source/ui/wrtsh/select.cxx b/sw/source/ui/wrtsh/select.cxx
index 8eb0d6a53392..972e3ef6e8f3 100644
--- a/sw/source/ui/wrtsh/select.cxx
+++ b/sw/source/ui/wrtsh/select.cxx
@@ -162,7 +162,13 @@ long SwWrtShell::SelAll()
bool bStartsWithTable = StartsWithTable();
if (bStartsWithTable)
+ {
+ // Disable table cursor to make sure getShellCrsr() returns m_pCurCrsr, not m_pTblCrsr.
+ if (IsTableMode())
+ TblCrsrToCursor();
+ // Do the extended select all on m_pCurCrsr.
ExtendedSelectAll(/*bFootnotes =*/ false);
+ }
if( pStartPos )
{