desktop/qa/desktop_lib/test_desktop_lib.cxx | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+)
New commits: commit fc6387152672bcbdbeb41941372bc0f9817a02c6 Author: Xisco Fauli <[email protected]> AuthorDate: Mon Feb 16 09:48:25 2026 +0100 Commit: Xisco Fauli <[email protected]> CommitDate: Tue Feb 17 16:03:47 2026 +0100 desktop: reintroduce test Removed in commit c10f8589facc86e601fb745424819b2f9ab5d808 Author: Ujjawal Kumar <[email protected]> Date: Wed Feb 11 17:20:20 2026 +0530 Remove bUseDetection used for heuristic detection of markdown content See discussion in https://gerrit.libreoffice.org/c/core/+/199156 Change-Id: I8c50d7d7ef000f9895ef147209a3599eb4cc75e3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/199455 Tested-by: Jenkins Reviewed-by: Xisco Fauli <[email protected]> diff --git a/desktop/qa/desktop_lib/test_desktop_lib.cxx b/desktop/qa/desktop_lib/test_desktop_lib.cxx index 85c41736bea6..142427b58ebe 100644 --- a/desktop/qa/desktop_lib/test_desktop_lib.cxx +++ b/desktop/qa/desktop_lib/test_desktop_lib.cxx @@ -755,6 +755,26 @@ void DesktopLOKTest::testPasteWriter() // Without the accompanying fix in place, this test would have failed, as we had a comment // between "foo" and "baz". CPPUNIT_ASSERT(!xTextPortionEnumeration->hasMoreElements()); + + // Overwrite the doc contents with an explicitly plain text paste. + pDocument->pClass->postUnoCommand(pDocument, ".uno:SelectAll", nullptr, false); + Scheduler::ProcessEventsToIdle(); + OString aPlainText("foo _bar_ baz"_ostr); + CPPUNIT_ASSERT(pDocument->pClass->paste(pDocument, "text/plain", aPlainText.getStr(), + aPlainText.getLength())); + + // Check if '_bar_' was pasted as-is. + xParagraphEnumeration = xParagraphEnumerationAccess->createEnumeration(); + xParagraph.set(xParagraphEnumeration->nextElement(), uno::UNO_QUERY); + xTextPortionEnumeration = xParagraph->createEnumeration(); + uno::Reference<text::XTextRange> xTextPortionRange(xTextPortionEnumeration->nextElement(), + uno::UNO_QUERY); + // Without the accompanying fix in place, this test would have failed with: + // - Expected: foo _bar_ baz + // - Actual : foo + // i.e. the text/plain input was parsed as markdown, while that should not happen when + // specifying the text/plain mimetype explicitly (and not text/markdown). + CPPUNIT_ASSERT_EQUAL(u"foo _bar_ baz"_ustr, xTextPortionRange->getString()); } void DesktopLOKTest::testPasteWriterJPEG()
