summaryrefslogtreecommitdiff
path: root/wizards/source/template/Correspondence.xba
diff options
context:
space:
mode:
authorJens-Heiner Rechtien <hr@openoffice.org>2003-03-27 16:59:30 +0000
committerJens-Heiner Rechtien <hr@openoffice.org>2003-03-27 16:59:30 +0000
commit6652c8336ff201af224d6c0b787f5d79ec4f1810 (patch)
tree794890c79560e699edb06e59868357a5a5f68da0 /wizards/source/template/Correspondence.xba
parent0f757610e5cb4de88a9ef20a7563f9da2973f6ee (diff)
MWS_SRX644: migrate branch mws_srx644 -> HEAD
Diffstat (limited to 'wizards/source/template/Correspondence.xba')
-rw-r--r--wizards/source/template/Correspondence.xba24
1 files changed, 15 insertions, 9 deletions
diff --git a/wizards/source/template/Correspondence.xba b/wizards/source/template/Correspondence.xba
index 3c391d8332b0..a6b42434b79e 100644
--- a/wizards/source/template/Correspondence.xba
+++ b/wizards/source/template/Correspondence.xba
@@ -63,7 +63,9 @@ Dim oAddressDialog as Object
Dim oAddressPilot as Object
Dim oFields as Object
Dim oDocSettings as Object
- On Local Error Goto GENERALERROR
+Dim oContext as Object
+Dim bDBvalid as Boolean
+ &apos;On Local Error Goto GENERALERROR
bDBFields = DialogModel.Optmerge.State &apos;database or placeholder
TemplateDialog.EndExecute()
@@ -73,14 +75,18 @@ Dim oDocSettings as Object
oDBAccess = GetRegistryKeyContent(&quot;org.openoffice.Office.DataAccess/AddressBook/&quot;)
sAddressbook = oDBAccess.DataSourceName
- 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
+ bDBvalid = false
+ oContext = createUnoService( &quot;com.sun.star.sdb.DatabaseContext&quot; )
+
+ If (not isNull(oContext)) Then
+ &apos;Is the previously assigned address data source still valid?
+ bDBvalid = oContext.hasByName(sAddressbook)
+ end if
+
+ If (bDBvalid = false) Then
+ oAddressPilot = createUnoService(&quot;com.sun.star.ui.dialogs.AddressBookSourcePilot&quot;)
+ oAddressPilot.execute
+
oDBAccess = GetRegistryKeyContent(&quot;org.openoffice.Office.DataAccess/AddressBook/&quot;)
sAddressbook = oDBAccess.DataSourceName
If sAddressbook = &quot;&quot; Then