summaryrefslogtreecommitdiff
path: root/sw/source/ui
diff options
context:
space:
mode:
authorOliver Bolte <obo@openoffice.org>2005-07-18 11:26:10 +0000
committerOliver Bolte <obo@openoffice.org>2005-07-18 11:26:10 +0000
commit0a002198e30f9852b398dc5b5edc3b1ec4892140 (patch)
treeb090499c69bcae4fbaa3cf761b8daf9c3a40555a /sw/source/ui
parentb8b1b8d4d94c9bdef09f0c4d15b2d5d7422d60bd (diff)
INTEGRATION: CWS tl13 (1.96.98); FILE MERGED
2005/07/13 15:25:19 os 1.96.98.1: #i50905# release connection after executing (old) mail merge dialog
Diffstat (limited to 'sw/source/ui')
-rw-r--r--sw/source/ui/dbui/dbmgr.cxx34
1 files changed, 32 insertions, 2 deletions
diff --git a/sw/source/ui/dbui/dbmgr.cxx b/sw/source/ui/dbui/dbmgr.cxx
index 53e62ce80aed..4ec28f6951e3 100644
--- a/sw/source/ui/dbui/dbmgr.cxx
+++ b/sw/source/ui/dbui/dbmgr.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: dbmgr.cxx,v $
*
- * $Revision: 1.96 $
+ * $Revision: 1.97 $
*
- * last change: $Author: obo $ $Date: 2005-04-27 09:22:51 $
+ * last change: $Author: obo $ $Date: 2005-07-18 12:26:10 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -2849,6 +2849,13 @@ void SwNewDBMgr::ExecuteFormLetter( SwWrtShell& rSh,
//CHINA001 nCmdType,
//CHINA001 xConnection,
//CHINA001 bWithDataSourceBrowser ? 0 : &aSelection );
+ //always create a connection for the dialog and dispose it after the dialog has been closed
+ SwDSParam* pFound = 0;
+ if(!xConnection.is())
+ {
+ xConnection = SwNewDBMgr::RegisterConnection(sDataSource);
+ pFound = FindDSConnection(sDataSource, TRUE);
+ }
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
DBG_ASSERT(pFact, "Dialogdiet fail!");//CHINA001
pImpl->pMergeDialog = pFact->CreateMailMergeDlg( ResId(DLG_MAILMERGE),
@@ -2876,6 +2883,29 @@ void SwNewDBMgr::ExecuteFormLetter( SwWrtShell& rSh,
xResSet = NULL;
aDescriptor[daCursor] <<= xResSet;
}
+ if(pFound)
+ {
+ for(USHORT nPos = 0; nPos < aDataSourceParams.Count(); nPos++)
+ {
+ SwDSParam* pParam = aDataSourceParams[nPos];
+ if(pParam == pFound)
+ {
+ try
+ {
+ uno::Reference<XComponent> xComp(pParam->xConnection, UNO_QUERY);
+ if(xComp.is())
+ xComp->dispose();
+ }
+ catch(const RuntimeException& )
+ {
+ //may be disposed already since multiple entries may have used the same connection
+ }
+ break;
+ }
+ //pFound doesn't need to be removed/deleted -
+ //this has been done by the SwConnectionDisposedListener_Impl already
+ }
+ }
DELETEZ(pImpl->pMergeDialog);
}
/* -----------------------------13.11.00 08:20--------------------------------