summaryrefslogtreecommitdiff
path: root/wizards
diff options
context:
space:
mode:
authorTom Verbeek <tv@openoffice.org>2001-08-09 13:17:44 +0000
committerTom Verbeek <tv@openoffice.org>2001-08-09 13:17:44 +0000
commita8a15579544e92d610c6957fbba5b96f10a5d336 (patch)
treec5d881889f130ccf756c3740ec0bde971948330f /wizards
parent235529ee36196e4e4f566eb8d874f1f931d2e2b1 (diff)
#88530# Better interoperability with new address source pilot
Diffstat (limited to 'wizards')
-rw-r--r--wizards/source/template/Correspondence.xba29
1 files changed, 21 insertions, 8 deletions
diff --git a/wizards/source/template/Correspondence.xba b/wizards/source/template/Correspondence.xba
index 9c8a6eeca564..4ecb5aa45670 100644
--- a/wizards/source/template/Correspondence.xba
+++ b/wizards/source/template/Correspondence.xba
@@ -59,17 +59,24 @@ Dim sDBField as String
Dim i as Integer
Dim oDBAccess as Object
Dim oAddressDialog as Object
+Dim oAddressPilot as Object
Dim oFields as Object
Dim oDocSettings as Object
- bDBFields = DialogModel.Optmerge.State &apos;db oder PLatzhalter
+ bDBFields = DialogModel.Optmerge.State &apos;database or placeholder
If bDBFields Then
oDBAccess = GetRegistryKeyContent(&quot;org.openoffice.Office.DataAccess/AddressBook/&quot;)
sAddressbook = oDBAccess.DataSourceName
- If sAddressbook = &quot;&quot; Then
- oAddressDialog = CreateUnoService(&quot;com.sun.star.ui.AddressBookSourceDialog&quot;)
- oAddressDialog.Execute
+
+ If sAddressbook = &quot;&quot; Then &apos;If there is no field mapping
+ If Not odBAccess.AutoPilotCompleted Then &apos;If the Mapping Pilot never ran
+ oAddressPilot = createUnoService(&quot;com.sun.star.ui.dialogs.AddressBookSourcePilot&quot;)
+ oAddressPilot.execute
+ Else
+ oAddressDialog = CreateUnoService(&quot;com.sun.star.ui.AddressBookSourceDialog&quot;)
+ oAddressDialog.execute
+ End If
oDBAccess = GetRegistryKeyContent(&quot;org.openoffice.Office.DataAccess/AddressBook/&quot;)
sAddressbook = oDBAccess.DataSourceName
If sAddressbook = &quot;&quot; Then
@@ -116,6 +123,8 @@ Dim oDocSettings as Object
sDBField = GetFieldname(oFields, sFoundContent)
If sDBField &lt;&gt; &quot;&quot; Then
InsertDBField(sAddressbook, Table, sDBField)
+ Else
+ InsertPlaceholder(sFoundContent)
End If
Else
InsertPlaceholder(sFoundContent)
@@ -161,7 +170,9 @@ End Sub
Sub InsertPlaceholder(sColName as String)
Dim oFieldMaster as Object
+Dim bCorrectField as Boolean
If sColname &lt;&gt; &quot;&quot; Then
+ bCorrectField = True
oFieldMaster = oDocument.createInstance(&quot;com.sun.star.text.TextField.JumpEdit&quot;)
Select Case sColName
Case &quot;Company&quot;
@@ -227,10 +238,12 @@ Dim oFieldMaster as Object
Case &quot;InviteParticipant&quot;
oFieldMaster.PlaceHolder = getResText(1350+31)
Case Else
- oFieldMaster.PlaceHolder = sColName
+ bCorrectField = False
End Select
- oFieldMaster.Hint = getResText(1350)
- oBookText.InsertTextContent(oBookMarkCursor, oFieldMaster, True)
+ If bCorrectField Then
+ oFieldMaster.Hint = getResText(1350)
+ oBookText.InsertTextContent(oBookMarkCursor, oFieldMaster, True)
+ End If
End If
End Sub
-</script:module>
+</script:module> \ No newline at end of file