LibreOffice Module test (master)
1
test
source
text
xtextcontent.cxx
Go to the documentation of this file.
1
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
/*
3
* This file is part of the LibreOffice project.
4
*
5
* This Source Code Form is subject to the terms of the Mozilla Public
6
* License, v. 2.0. If a copy of the MPL was not distributed with this
7
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
8
*/
9
10
#include <
test/text/xtextcontent.hxx
>
11
#include <com/sun/star/text/XTextContent.hpp>
12
#include <com/sun/star/text/XTextRange.hpp>
13
#include <com/sun/star/lang/IllegalArgumentException.hpp>
14
#include <cppunit/TestAssert.h>
15
16
using namespace
css;
17
using namespace
css::uno;
18
19
namespace
apitest
20
{
21
void
XTextContent::testGetAnchor
()
22
{
23
uno::Reference<text::XTextContent> xTextContent(
init
(), UNO_QUERY_THROW);
24
uno::Reference<uno::XInterface> xAnchor(xTextContent->getAnchor());
25
CPPUNIT_ASSERT(xAnchor.is());
26
}
27
28
void
XTextContent::testAttach
()
29
{
30
uno::Reference<text::XTextContent> xTextContent(
init
(), UNO_QUERY_THROW);
31
32
uno::Reference<text::XTextContent> xContent(
getTextContent
(), UNO_SET_THROW);
33
uno::Reference<text::XTextRange> xRange(
getTextRange
(), UNO_SET_THROW);
34
35
try
36
{
37
if
(xContent.is())
38
xContent->attach(xRange);
39
else
40
xTextContent->attach(xRange);
41
}
42
catch
(
const
lang::IllegalArgumentException&)
43
{
44
bool
bAttachSupported =
isAttachSupported
();
45
if
(bAttachSupported)
46
CPPUNIT_ASSERT(
false
);
47
}
48
catch
(
const
RuntimeException
&)
49
{
50
bool
bAttachSupported =
isAttachSupported
();
51
if
(bAttachSupported)
52
CPPUNIT_ASSERT(
false
);
53
}
54
}
55
}
56
57
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
RuntimeException
apitest::XTextContent::init
virtual css::uno::Reference< css::uno::XInterface > init()=0
apitest::XTextContent::testGetAnchor
void testGetAnchor()
Definition:
xtextcontent.cxx:21
apitest::XTextContent::testAttach
void testAttach()
Definition:
xtextcontent.cxx:28
apitest::XTextContent::getTextContent
virtual css::uno::Reference< css::text::XTextContent > getTextContent()=0
apitest::XTextContent::isAttachSupported
virtual bool isAttachSupported()=0
apitest::XTextContent::getTextRange
virtual css::uno::Reference< css::text::XTextRange > getTextRange()=0
apitest
Definition:
xpropertyset.cxx:36
xtextcontent.hxx
Generated on Sun Jul 30 2023 04:27:11 for LibreOffice Module test (master) by
1.9.3