summaryrefslogtreecommitdiff
path: root/sw/qa/extras/tiledrendering/tiledrendering.cxx
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2015-06-19 18:13:27 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2015-06-19 18:00:53 +0000
commitaf7cbebd8eed82b81e00e6c2e0dc6c2c467ad8e2 (patch)
tree2172475e22afce046cb1e9b1fb6528574bc16cf4 /sw/qa/extras/tiledrendering/tiledrendering.cxx
parent69e9c082f07206a1a589c49f679f92c2162e830d (diff)
LOK: return used format in Document::getTextSelection()
This allows requesting text/html, with falling back to plain text if necessary. Change-Id: Ie6d4e0e173311ba018553043b6a869abf193bf6f Reviewed-on: https://gerrit.libreoffice.org/16377 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
Diffstat (limited to 'sw/qa/extras/tiledrendering/tiledrendering.cxx')
-rw-r--r--sw/qa/extras/tiledrendering/tiledrendering.cxx9
1 files changed, 5 insertions, 4 deletions
diff --git a/sw/qa/extras/tiledrendering/tiledrendering.cxx b/sw/qa/extras/tiledrendering/tiledrendering.cxx
index 8d9d6ae44443..07dd7e34b29c 100644
--- a/sw/qa/extras/tiledrendering/tiledrendering.cxx
+++ b/sw/qa/extras/tiledrendering/tiledrendering.cxx
@@ -222,7 +222,8 @@ void SwTiledRenderingTest::testGetTextSelection()
SwXTextDocument* pXTextDocument = createDoc("shape-with-text.fodt");
// No crash, just empty output for unexpected mime type.
- CPPUNIT_ASSERT_EQUAL(OString(), pXTextDocument->getTextSelection("foo/bar"));
+ OString aUsedFormat;
+ CPPUNIT_ASSERT_EQUAL(OString(), pXTextDocument->getTextSelection("foo/bar", aUsedFormat));
SwWrtShell* pWrtShell = pXTextDocument->GetDocShell()->GetWrtShell();
// Move the cursor into the first word.
@@ -231,10 +232,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"));
+ CPPUNIT_ASSERT_EQUAL(OString("Hello"), pXTextDocument->getTextSelection("text/plain;charset=utf-8", aUsedFormat));
// Make sure we produce something for HTML.
- CPPUNIT_ASSERT(!OString(pXTextDocument->getTextSelection("text/html")).isEmpty());
+ CPPUNIT_ASSERT(!OString(pXTextDocument->getTextSelection("text/html", aUsedFormat)).isEmpty());
// Now select some shape text and check again.
SdrPage* pPage = pWrtShell->GetDoc()->getIDocumentDrawModelAccess().GetDrawModel()->GetPage(0);
@@ -245,7 +246,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"));
+ CPPUNIT_ASSERT_EQUAL(OString("Shape"), pXTextDocument->getTextSelection("text/plain;charset=utf-8", aUsedFormat));
comphelper::LibreOfficeKit::setActive(false);
}