11#include <com/sun/star/text/XTextCursor.hpp>
12#include <com/sun/star/text/ControlCharacter.hpp>
13#include <com/sun/star/lang/IllegalArgumentException.hpp>
14#include <cppunit/TestAssert.h>
17using namespace css::uno;
23 uno::Reference<text::XSimpleText> xSimpleText(
init(), UNO_QUERY_THROW);
25 CPPUNIT_ASSERT(xSimpleText->createTextCursor());
30 uno::Reference<text::XSimpleText> xSimpleText(
init(), UNO_QUERY_THROW);
31 uno::Reference<text::XTextCursor> xCursor(xSimpleText->createTextCursor(), UNO_SET_THROW);
33 xCursor->gotoStart(
false);
35 CPPUNIT_ASSERT(xSimpleText->createTextCursorByRange(xCursor));
40 uno::Reference<text::XSimpleText> xSimpleText(
init(), UNO_QUERY_THROW);
41 uno::Reference<text::XTextRange> xCursor(xSimpleText->createTextCursor(), UNO_QUERY_THROW);
42 ::rtl::OUString sString =
"TestString";
44 xSimpleText->insertString(xCursor, sString,
false);
45 ::rtl::OUString gString = xSimpleText->getText()->getString();
47 CPPUNIT_ASSERT(!gString.isEmpty());
48 CPPUNIT_ASSERT(gString.indexOf(sString) >= 0);
55 uno::Reference<text::XSimpleText> xSimpleText(
init(), UNO_QUERY_THROW);
56 uno::Reference<text::XTextRange> xCursor(xSimpleText->createTextCursor(), UNO_QUERY_THROW);
60 xSimpleText->insertControlCharacter(xCursor, text::ControlCharacter::PARAGRAPH_BREAK,
62 xSimpleText->insertControlCharacter(xCursor, text::ControlCharacter::LINE_BREAK,
false);
63 xSimpleText->insertString(xSimpleText->createTextCursor(),
"newLine",
false);
65 catch (
const lang::IllegalArgumentException&)
70 OUString gString = xSimpleText->getString();
72 CPPUNIT_ASSERT(gString.indexOf(
"\n") > -1);
void testInsertControlCharacter()
void testCreateTextCursorByRange()
void testCreateTextCursor()
virtual css::uno::Reference< css::uno::XInterface > init()=0