diff options
author | Tom Verbeek <tv@openoffice.org> | 2001-06-11 13:40:33 +0000 |
---|---|---|
committer | Tom Verbeek <tv@openoffice.org> | 2001-06-11 13:40:33 +0000 |
commit | 26052036f2f849add744000efbd7929f573d9291 (patch) | |
tree | 2a510ea8ebeb36ccf250f5479bc54d9205108b31 /wizards | |
parent | bff8f34759afddf9ca369aae3e94fbc38d43fa7e (diff) |
#87077# changed to work with Option Explicit
Diffstat (limited to 'wizards')
-rw-r--r-- | wizards/source/template/Autotext.xba | 34 |
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 + ' Initialization... BasicLibraries.LoadLibrary("Tools") @@ -52,7 +65,7 @@ Sub Main() sFoundContent = LTrim(sFoundContent) ' Define the Cursor and place it on the founding - oCursor = oDocument.Text.CreateTextCursorbyRange(oFound) + oCursor = oFound.Text.CreateTextCursorbyRange(oFound) ' Find out, which object is to be created... FieldStringThere = Instr(1,sFoundContent,"Field") @@ -72,8 +85,9 @@ End Sub ' creates a User - datafield out of a string with the following structure ' "<field:Company>" 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("com.sun.star.text.TextField.ExtendedUser") sFoundList() = ArrayoutofString(sFoundContent,":",MaxIndex) UserInfo = UCase(LTrim(sFoundList(1))) @@ -125,13 +139,15 @@ End Sub ' Creates a placeholder out of a string with the following structure: '<placeholder:Showtext:Helptext> -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("com.sun.star.text.TextField.JumpEdit") sFoundList() = ArrayoutofString(sFoundContent, ":" & chr(34),MaxIndex) ' 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 |