summaryrefslogtreecommitdiff
path: root/sw/qa/extras/odfimport/odfimport.cxx
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2013-10-02 11:19:18 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2013-10-02 11:40:11 +0200
commit232df42b8dc0b4f7a335d2931fc0f29e73b8bca0 (patch)
tree8738102cdf70d49d5efe0d07bb50dde74eddaef3 /sw/qa/extras/odfimport/odfimport.cxx
parent51ff75129c6b61d4f3ba31fa189b38bbf867910d (diff)
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
Diffstat (limited to 'sw/qa/extras/odfimport/odfimport.cxx')
-rw-r--r--sw/qa/extras/odfimport/odfimport.cxx17
1 files changed, 17 insertions, 0 deletions
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<SwTxtNode&>(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<SwXTextDocument *>(mxComponent.get());
+ SwWrtShell* pWrtShell = pTxtDoc->GetDocShell()->GetWrtShell();
+ SwShellCrsr* pShellCrsr = pWrtShell->getShellCrsr(false);
+ pWrtShell->SelAll();
+ SwTxtNode& rStart = dynamic_cast<SwTxtNode&>(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<SwTxtNode&>(pShellCrsr->End()->nNode.GetNode());
+ CPPUNIT_ASSERT_EQUAL(OUString("Hello."), rEnd.GetTxt());
}
CPPUNIT_TEST_SUITE_REGISTRATION(Test);