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=
"sw_SwXAutoTextEntry" 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: sw_SwXAutoTextEntry.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:
44 ' REQUIRED VARIABLES for interface/service tests:
46 'Required for com.sun.star.text.XText
47 Global oCollection As Object
48 Global oInstance As Object
52 Sub beforeInsertTextContent()
54 '*************************************************************************
57 '*************************************************************************
58 oDoc.Text.setString(
"")
59 oObj.applyTo(oDoc.Text.createTextCursor())
62 Sub afterInsertTextContent()
63 oDoc.Text.setString(
"")
64 oObj.applyTo(oDoc.Text.createTextCursor())
67 Sub beforeRemoveTextContent()
68 oDoc.Text.setString(
"")
69 oObj.applyTo(oDoc.Text.createTextCursor())
72 Sub afterRemoveTextContent()
73 oDoc.Text.setString(
"")
74 oObj.applyTo(oDoc.Text.createTextCursor())
77 Global oGroup As Object
81 Dim oContainer As Object
85 oDoc = utils.createDocument(
"swriter", cObjectName)
86 oContainer = createUNOService(
"com.sun.star.text.AutoTextContainer" )
87 Out.Log(
"Looking for not empty elements")
89 oGroup = oContainer.getByIndex(i)
90 while (oGroup.getCount
< 1)
92 oGroup = oContainer.getByIndex(i)
95 oNames = oGroup.getElementNames()
97 for i =
0 to ubound(oNames)
98 Out.Log(
"Element " + i +
": " + oNames(i))
101 oObj = oGroup.getByIndex(
0)
103 oInstance = oDoc.createInstance(
"com.sun.star.text.TextTable")
104 oCollection = oDoc.getTextTables()
106 oObj.ApplyTo(oDoc.Text.createTextCursor)