diff options
author | Michael Meeks <michael.meeks@collabora.com> | 2019-06-06 17:45:24 +0100 |
---|---|---|
committer | Michael Meeks <michael.meeks@collabora.com> | 2019-06-07 15:42:05 +0200 |
commit | 03d33ba9410433d2072364b3afb9dbd6b19c4d0d (patch) | |
tree | a0513e810856ea6a45fc8eb31b086e857b9a17fd /sw/qa | |
parent | 00dfa6dc890dbbc8140fe613599becb5e4c55486 (diff) |
lok: re-factor getTextSelection.
Change-Id: I2c27c213ee980e19d6020e9599b2b72115e7f28e
Reviewed-on: https://gerrit.libreoffice.org/73626
Tested-by: Jenkins
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Diffstat (limited to 'sw/qa')
-rw-r--r-- | sw/qa/extras/tiledrendering/tiledrendering.cxx | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sw/qa/extras/tiledrendering/tiledrendering.cxx b/sw/qa/extras/tiledrendering/tiledrendering.cxx index b7d90cb6f02a..965a64fa5191 100644 --- a/sw/qa/extras/tiledrendering/tiledrendering.cxx +++ b/sw/qa/extras/tiledrendering/tiledrendering.cxx @@ -13,6 +13,7 @@ #include <com/sun/star/frame/DispatchResultState.hpp> #include <com/sun/star/frame/XDispatchResultListener.hpp> #include <swmodeltestbase.hxx> +#include <test/helper/transferable.hxx> #include <LibreOfficeKit/LibreOfficeKitEnums.h> #include <comphelper/dispatchcommand.hxx> #include <comphelper/propertysequence.hxx> @@ -406,8 +407,7 @@ void SwTiledRenderingTest::testGetTextSelection() SwXTextDocument* pXTextDocument = createDoc("shape-with-text.fodt"); // No crash, just empty output for unexpected mime type. - OString aUsedFormat; - CPPUNIT_ASSERT_EQUAL(OString(), pXTextDocument->getTextSelection("foo/bar", aUsedFormat)); + CPPUNIT_ASSERT_EQUAL(OString(), apitest::helper::transferable::getTextSelection(pXTextDocument->getSelection(), "foo/bar")); SwWrtShell* pWrtShell = pXTextDocument->GetDocShell()->GetWrtShell(); // Move the cursor into the first word. @@ -416,10 +416,10 @@ void SwTiledRenderingTest::testGetTextSelection() pWrtShell->SelWrd(); // Make sure that we selected text from the body text. - CPPUNIT_ASSERT_EQUAL(OString("Hello"), pXTextDocument->getTextSelection("text/plain;charset=utf-8", aUsedFormat)); + CPPUNIT_ASSERT_EQUAL(OString("Hello"), apitest::helper::transferable::getTextSelection(pXTextDocument->getSelection(), "text/plain;charset=utf-8")); // Make sure we produce something for HTML. - CPPUNIT_ASSERT(!pXTextDocument->getTextSelection("text/html", aUsedFormat).isEmpty()); + CPPUNIT_ASSERT(!apitest::helper::transferable::getTextSelection(pXTextDocument->getSelection(), "text/html").isEmpty()); // Now select some shape text and check again. SdrPage* pPage = pWrtShell->GetDoc()->getIDocumentDrawModelAccess().GetDrawModel()->GetPage(0); @@ -430,7 +430,7 @@ void SwTiledRenderingTest::testGetTextSelection() EditView& rEditView = pView->GetTextEditOutlinerView()->GetEditView(); ESelection aWordSelection(0, 0, 0, 5); rEditView.SetSelection(aWordSelection); - CPPUNIT_ASSERT_EQUAL(OString("Shape"), pXTextDocument->getTextSelection("text/plain;charset=utf-8", aUsedFormat)); + CPPUNIT_ASSERT_EQUAL(OString("Shape"), apitest::helper::transferable::getTextSelection(pXTextDocument->getSelection(), "text/plain;charset=utf-8")); } void SwTiledRenderingTest::testSetGraphicSelection() |