summaryrefslogtreecommitdiff
path: root/sw/qa/extras/txtimport
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2021-05-25 20:55:02 +0200
committerMiklos Vajna <vmiklos@collabora.com>2021-05-26 09:26:55 +0200
commit1eac49c595505dbadeac3db4ec7cd686afca6d87 (patch)
treea06541a70f505e66242c9537afb5977369a581c7 /sw/qa/extras/txtimport
parentf2c9da1ef662d10726a2dc709b46722ec7d4a016 (diff)
tdf#115088 convert UITest to CppunitTest
So that when it fails, it's easier to debug because it's in-process. Change-Id: Ia7d12291b25304967a22e546b12803864a713541 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116127 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'sw/qa/extras/txtimport')
-rw-r--r--sw/qa/extras/txtimport/txtimport.cxx22
1 files changed, 22 insertions, 0 deletions
diff --git a/sw/qa/extras/txtimport/txtimport.cxx b/sw/qa/extras/txtimport/txtimport.cxx
index a97242641df8..c14ce8e0ad5b 100644
--- a/sw/qa/extras/txtimport/txtimport.cxx
+++ b/sw/qa/extras/txtimport/txtimport.cxx
@@ -14,6 +14,7 @@
#include <iodetect.hxx>
#include <unotxdoc.hxx>
#include <docsh.hxx>
+#include <wrtsh.hxx>
class TxtImportTest : public SwModelTestBase
{
@@ -150,6 +151,27 @@ DECLARE_TXTIMPORT_TEST(testTdf60145_utf16bewithbom, "UTF16BEWITHBOM.txt")
CPPUNIT_ASSERT_EQUAL(OUString(u"漢a'"), xPara->getString());
}
+CPPUNIT_TEST_FIXTURE(TxtImportTest, testTdf115088)
+{
+ SwDoc* pDoc = createSwDoc();
+ SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell();
+ pWrtShell->Insert("1");
+ pWrtShell->SplitNode();
+ pWrtShell->Insert("1");
+
+ pWrtShell->SelAll();
+ dispatchCommand(mxComponent, ".uno:Cut", {});
+ pWrtShell->Insert("test");
+ pWrtShell->Left(CRSR_SKIP_CHARS, /*bSelect=*/false, 4, /*bBasicCall=*/false);
+ dispatchCommand(mxComponent, ".uno:PasteUnformatted", {});
+ uno::Reference<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY);
+ OUString aActual = xTextDocument->getText()->getString().copy(0, 2);
+ // Without the accompanying fix in place, this test would have failed with:
+ // - Expected: 1\n
+ // - Actual : 1t
+ CPPUNIT_ASSERT_EQUAL(OUString("1\n"), aActual.replaceAll("\r", "\n"));
+}
+
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */