summaryrefslogtreecommitdiff
path: root/wizards
diff options
context:
space:
mode:
authorTom Verbeek <tv@openoffice.org>2001-06-11 13:40:33 +0000
committerTom Verbeek <tv@openoffice.org>2001-06-11 13:40:33 +0000
commit26052036f2f849add744000efbd7929f573d9291 (patch)
tree2a510ea8ebeb36ccf250f5479bc54d9205108b31 /wizards
parentbff8f34759afddf9ca369aae3e94fbc38d43fa7e (diff)
#87077# changed to work with Option Explicit
Diffstat (limited to 'wizards')
-rw-r--r--wizards/source/template/Autotext.xba34
1 files changed, 25 insertions, 9 deletions
diff --git a/wizards/source/template/Autotext.xba b/wizards/source/template/Autotext.xba
index f7ca325e1895..14603f6b5133 100644
--- a/wizards/source/template/Autotext.xba
+++ b/wizards/source/template/Autotext.xba
@@ -1,11 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
-<script:module xmlns:script="http://openoffice.org/2000/script" script:name="Autotext" script:language="StarBasic">Public UserfieldDataType(14) as String
+<script:module xmlns:script="http://openoffice.org/2000/script" script:name="Autotext" script:language="StarBasic">Option Explicit
+
+Public UserfieldDataType(14) as String
Public oDocument as Object
-Public oCursor as Object
Public BulletList(7) as Integer
Sub Main()
+ Dim oCursor as Object
+ Dim oStyles as Object
+ Dim oSearchDesc as Object
+ Dim oFoundall as Object
+ Dim oFound as Object
+ Dim i as Integer
+ Dim sFoundString as String
+ Dim sFoundContent as String
+ Dim FieldStringThere as String
+ Dim ULStringThere as String
+ Dim PHStringThere as String
+
&apos; Initialization...
BasicLibraries.LoadLibrary(&quot;Tools&quot;)
@@ -52,7 +65,7 @@ Sub Main()
sFoundContent = LTrim(sFoundContent)
&apos; Define the Cursor and place it on the founding
- oCursor = oDocument.Text.CreateTextCursorbyRange(oFound)
+ oCursor = oFound.Text.CreateTextCursorbyRange(oFound)
&apos; Find out, which object is to be created...
FieldStringThere = Instr(1,sFoundContent,&quot;Field&quot;)
@@ -72,8 +85,9 @@ End Sub
&apos; creates a User - datafield out of a string with the following structure
&apos; &quot;&lt;field:Company&gt;&quot;
Sub CreateUserDatafield(oCursor, sFoundContent as String)
-Dim MaxIndex as Integer
-Dim sTextFieldNotDefined as String
+ Dim MaxIndex as Integer
+ Dim sTextFieldNotDefined as String
+ Dim sFoundList(3)
oUserfield = oDocument.CreateInstance(&quot;com.sun.star.text.TextField.ExtendedUser&quot;)
sFoundList() = ArrayoutofString(sFoundContent,&quot;:&quot;,MaxIndex)
UserInfo = UCase(LTrim(sFoundList(1)))
@@ -125,13 +139,15 @@ End Sub
&apos; Creates a placeholder out of a string with the following structure:
&apos;&lt;placeholder:Showtext:Helptext&gt;
-Sub CreatePlaceholder(oCursor, sFoundContent as String)
-Dim MaxIndex as Integer
+Sub CreatePlaceholder(oCursor as Object, sFoundContent as String)
+ Dim oPlaceholder as Object
+ Dim MaxIndex as Integer
+ Dim sFoundList(3)
oPlaceholder = oDocument.CreateInstance(&quot;com.sun.star.text.TextField.JumpEdit&quot;)
sFoundList() = ArrayoutofString(sFoundContent, &quot;:&quot; &amp; chr(34),MaxIndex)
&apos; Delete The Double-quotes
- oPlaceHolder.Hint = DeleteStr(sFoundList(2),chr(34))
- oPlaceHolder.placeholder = DeleteStr(sFoundList(1),chr(34))
+ oPlaceholder.Hint = DeleteStr(sFoundList(2),chr(34))
+ oPlaceholder.placeholder = DeleteStr(sFoundList(1),chr(34))
oCursor.Text.InsertTextContent(oCursor,oPlaceholder,True)
End Sub