diff options
author | Philippe Jung <phil.jung@free.fr> | 2015-05-16 00:04:43 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-05-17 12:39:39 +0000 |
commit | d49242026ed9e342871b437998a40a253e4f26c8 (patch) | |
tree | 45746ab04b2b220a2fafc0cc8bcc14429af92e99 /sw/qa | |
parent | dc65b0242544a7d4c22c6fcf473dafb3e2d41121 (diff) |
tdf#90883 WRITER: Insert button with multiple rows/columns selected
Compute the number of rows/columns to insert based on selected cells.
Change-Id: I489bca715dcf31d191f9a875ac5d59a6140a14d7
Reviewed-on: https://gerrit.libreoffice.org/15741
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'sw/qa')
-rw-r--r-- | sw/qa/extras/uiwriter/data/tdf90883.odt | bin | 0 -> 8759 bytes | |||
-rw-r--r-- | sw/qa/extras/uiwriter/uiwriter.cxx | 18 |
2 files changed, 18 insertions, 0 deletions
diff --git a/sw/qa/extras/uiwriter/data/tdf90883.odt b/sw/qa/extras/uiwriter/data/tdf90883.odt Binary files differnew file mode 100644 index 000000000000..ea9df27444cf --- /dev/null +++ b/sw/qa/extras/uiwriter/data/tdf90883.odt diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx b/sw/qa/extras/uiwriter/uiwriter.cxx index 3a47b8d8fbf1..e8ffdd78b976 100644 --- a/sw/qa/extras/uiwriter/uiwriter.cxx +++ b/sw/qa/extras/uiwriter/uiwriter.cxx @@ -92,6 +92,7 @@ public: void testTdf90362(); void testUndoCharAttribute(); void testTdf86639(); + void testTdf90883TableBoxGetCoordinates(); CPPUNIT_TEST_SUITE(SwUiWriterTest); CPPUNIT_TEST(testReplaceForward); @@ -128,6 +129,7 @@ public: CPPUNIT_TEST(testTdf90362); CPPUNIT_TEST(testUndoCharAttribute); CPPUNIT_TEST(testTdf86639); + CPPUNIT_TEST(testTdf90883TableBoxGetCoordinates); CPPUNIT_TEST_SUITE_END(); @@ -962,6 +964,22 @@ void SwUiWriterTest::testTdf86639() CPPUNIT_ASSERT_EQUAL(aExpected, getProperty<OUString>(getRun(getParagraph(1), 1), "CharFontName")); } +void SwUiWriterTest::testTdf90883TableBoxGetCoordinates() +{ + SwDoc* pDoc = createDoc("tdf90883.odt"); + SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); + pWrtShell->Down(true); + SwSelBoxes aBoxes; + ::GetTblSel( *pWrtShell, aBoxes ); + CPPUNIT_ASSERT_EQUAL( 2, (int)aBoxes.size() ); + Point pos ( aBoxes[0]->GetCoordinates() ); + CPPUNIT_ASSERT_EQUAL( 1, (int)pos.X() ); + CPPUNIT_ASSERT_EQUAL( 1, (int)pos.Y() ); + pos = aBoxes[1]->GetCoordinates(); + CPPUNIT_ASSERT_EQUAL( 1, (int)pos.X() ); + CPPUNIT_ASSERT_EQUAL( 2, (int)pos.Y() ); +} + CPPUNIT_TEST_SUITE_REGISTRATION(SwUiWriterTest); CPPUNIT_PLUGIN_IMPLEMENT(); |