From af7cbebd8eed82b81e00e6c2e0dc6c2c467ad8e2 Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Fri, 19 Jun 2015 18:13:27 +0200 Subject: 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 Tested-by: Jenkins --- sw/qa/extras/tiledrendering/tiledrendering.cxx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'sw/qa/extras/tiledrendering/tiledrendering.cxx') 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); } -- cgit v1.2.3