1 <?xml version=
"1.0" encoding=
"UTF-8"?>
2 <!DOCTYPE script:module PUBLIC
"-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
3 <script:module xmlns:
script=
"http://openoffice.org/2000/script" script:
name=
"text_XParagraphCursor" script:
language=
"StarBasic">
6 '*************************************************************************
8 ' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
10 ' Copyright
2008 by Sun Microsystems, Inc.
12 ' OpenOffice.org - a multi-platform office productivity suite
14 ' $RCSfile: text_XParagraphCursor.xba,v $
18 ' This file is part of OpenOffice.org.
20 ' OpenOffice.org is free software: you can redistribute it and/or modify
21 ' it under the terms of the GNU Lesser General Public License version
3
22 ' only, as published by the Free Software Foundation.
24 ' OpenOffice.org is distributed in the hope that it will be useful,
25 ' but WITHOUT ANY WARRANTY; without even the implied warranty of
26 ' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27 ' GNU Lesser General Public License version
3 for more details
28 ' (a copy is included in the LICENSE file that accompanied this code).
30 ' You should have received a copy of the GNU Lesser General Public License
31 ' version
3 along with OpenOffice.org. If not, see
32 '
<http://www.openoffice.org/license.html
>
33 ' for a copy of the LGPLv3 License.
35 '*************************************************************************
36 '*************************************************************************
40 ' Be sure that all variables are dimensioned:
43 '*************************************************************************
44 ' This Interface/Service test depends on the following GLOBAL variables,
45 ' which must be specified in the object creation:
47 ' - Global oText As Object
49 '*************************************************************************
57 '*************************************************************************
59 ' com.sun.star.text.XParagraphCursor
60 '*************************************************************************
66 oText.insertString(oObj,
"" + i +
"Start of paragraph.", false)
67 oText.insertString(oObj, Chr(
10) + cObjectName +
" " + cIfcShortName + Chr(
10), false)
68 oText.insertString(oObj,
"Paragraph's end." + i, false)
69 oText.insertControlCharacter(oObj, com.sun.star.text.ControlCharacter.PARAGRAPH_BREAK, false)
74 Test.StartMethod(
"gotoStartOfParagraph()")
76 oObj.gotoStartOfParagraph(false)
77 oText.insertString(oObj,
"1", false)
78 bOK = bOK AND inStr(
1, oText.String,
"10Start")
<> 0
79 Test.MethodTested(
"gotoStartOfParagraph()", bOK)
81 Test.StartMethod(
"gotoEndOfParagraph()")
83 oObj.gotoEndOfParagraph(false)
84 oText.insertString(oObj,
"2", false)
85 bOK = bOK AND inStr(
1, oText.String,
"end.02")
<> 0
86 Test.MethodTested(
"gotoEndOfParagraph()", bOK)
88 Test.StartMethod(
"gotoNextParagraph()")
90 oObj.gotoNextParagraph(false)
91 oObj.gotoNextParagraph(false)
92 oObj.gotoEndOfParagraph(false)
93 oText.insertString(oObj,
"3", false)
94 bOK = bOK AND inStr(
1, oText.String,
"end.23")
<> 0
95 Test.MethodTested(
"gotoNextParagraph()", bOK)
97 Test.StartMethod(
"gotoPreviousParagraph()")
99 oObj.gotoPreviousParagraph(false)
100 oObj.gotoEndOfParagraph(false)
101 oText.insertString(oObj,
"4", false)
102 bOK = bOK AND inStr(
1, oText.String,
"end.14")
<> 0
103 Test.MethodTested(
"gotoPreviousParagraph()", bOK)
105 Test.StartMethod(
"isStartOfParagraph()")
107 oObj.gotoStartOfParagraph(false)
108 bOK = bOK AND oObj.isStartOfParagraph()
109 bOK = bOK AND NOT oObj.isEndOfParagraph()
110 Test.MethodTested(
"isStartOfParagraph()", bOK)
112 Test.StartMethod(
"isEndOfParagraph()")
114 oObj.gotoEndOfParagraph(false)
115 bOK = bOK AND oObj.isEndOfParagraph()
116 bOK = bOK AND NOT oObj.isStartOfParagraph()
117 Test.MethodTested(
"isEndOfParagraph()", bOK)