From 232df42b8dc0b4f7a335d2931fc0f29e73b8bca0 Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Wed, 2 Oct 2013 11:19:18 +0200 Subject: fdo#69979 SwCrsrShell::ExtendedSelectAll: exclude headers, too It turns out, normal Ctrl-A doesn't select headers, footers and fly content, either (just like not selecting footnotes). So do the same when in the "doc starts with table" special mode. Change-Id: Ib9bc397944a4d07ea03bc326f1536733c57f42e6 --- sw/qa/extras/odfimport/data/fdo69979.odt | Bin 0 -> 9462 bytes sw/qa/extras/odfimport/odfimport.cxx | 17 +++++++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 sw/qa/extras/odfimport/data/fdo69979.odt (limited to 'sw/qa/extras/odfimport') diff --git a/sw/qa/extras/odfimport/data/fdo69979.odt b/sw/qa/extras/odfimport/data/fdo69979.odt new file mode 100644 index 000000000000..8f7d77ec62d1 Binary files /dev/null and b/sw/qa/extras/odfimport/data/fdo69979.odt differ diff --git a/sw/qa/extras/odfimport/odfimport.cxx b/sw/qa/extras/odfimport/odfimport.cxx index f541d22cb969..ef6d7a196a04 100644 --- a/sw/qa/extras/odfimport/odfimport.cxx +++ b/sw/qa/extras/odfimport/odfimport.cxx @@ -37,6 +37,7 @@ public: void testFdo37606(); void testFdo37606Copy(); void testFdo69862(); + void testFdo69979(); CPPUNIT_TEST_SUITE(Test); #if !defined(MACOSX) && !defined(WNT) @@ -64,6 +65,7 @@ void Test::run() {"fdo37606.odt", &Test::testFdo37606}, {"fdo37606.odt", &Test::testFdo37606Copy}, {"fdo69862.odt", &Test::testFdo69862}, + {"fdo69979.odt", &Test::testFdo69979}, }; header(); for (unsigned int i = 0; i < SAL_N_ELEMENTS(aMethods); ++i) @@ -442,7 +444,22 @@ void Test::testFdo69862() SwTxtNode& rEnd = dynamic_cast(pShellCrsr->End()->nNode.GetNode()); CPPUNIT_ASSERT_EQUAL(OUString("H" "\x01" "ello."), rEnd.GetTxt()); +} + +void Test::testFdo69979() +{ + // The test doc is special in that it starts with a table and it also has a header. + SwXTextDocument* pTxtDoc = dynamic_cast(mxComponent.get()); + SwWrtShell* pWrtShell = pTxtDoc->GetDocShell()->GetWrtShell(); + SwShellCrsr* pShellCrsr = pWrtShell->getShellCrsr(false); + pWrtShell->SelAll(); + SwTxtNode& rStart = dynamic_cast(pShellCrsr->Start()->nNode.GetNode()); + // This was "", as Ctrl-A also selected headers, but it should not. + CPPUNIT_ASSERT_EQUAL(OUString("A1"), rStart.GetTxt()); + + SwTxtNode& rEnd = dynamic_cast(pShellCrsr->End()->nNode.GetNode()); + CPPUNIT_ASSERT_EQUAL(OUString("Hello."), rEnd.GetTxt()); } CPPUNIT_TEST_SUITE_REGISTRATION(Test); -- cgit v1.2.3