summaryrefslogtreecommitdiff
path: root/connectivity
diff options
context:
space:
mode:
authorKurt Zenker <kz@openoffice.org>2006-12-13 15:19:44 +0000
committerKurt Zenker <kz@openoffice.org>2006-12-13 15:19:44 +0000
commitab9d657e0060473a25abd6f36bd30aad0574a4db (patch)
tree2fdb762f2fedcef3ea233ed5155cc88731eb6cfe /connectivity
parent96bbd4a4bba63a64e134116920a4feadeb68357e (diff)
INTEGRATION: CWS dba22ui (1.24.32); FILE MERGED
2006/12/11 09:37:22 fs 1.24.32.2: acquire in dtor, to prevent reentrance 2006/12/04 11:19:13 fs 1.24.32.1: properly recognize invalid LDAP connections / #i71773# STR_COULD_NOT_CONNECT_LDAP
Diffstat (limited to 'connectivity')
-rw-r--r--connectivity/source/drivers/mozab/MConnection.cxx26
1 files changed, 12 insertions, 14 deletions
diff --git a/connectivity/source/drivers/mozab/MConnection.cxx b/connectivity/source/drivers/mozab/MConnection.cxx
index d9af4936344d..16dae9bab414 100644
--- a/connectivity/source/drivers/mozab/MConnection.cxx
+++ b/connectivity/source/drivers/mozab/MConnection.cxx
@@ -4,9 +4,9 @@
*
* $RCSfile: MConnection.cxx,v $
*
- * $Revision: 1.24 $
+ * $Revision: 1.25 $
*
- * last change: $Author: ihi $ $Date: 2006-10-18 13:08:12 $
+ * last change: $Author: kz $ $Date: 2006-12-13 16:19:44 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -66,6 +66,8 @@
#include "diagnose_ex.h"
#endif
+#include "resource/mozab_res.hrc"
+
#ifndef COMPHELPER_OFFICE_RESOURCE_BUNDLE_HXX
#include <comphelper/officeresourcebundle.hxx>
#endif
@@ -167,6 +169,7 @@ OConnection::OConnection(MozabDriver* _pDriver)
//-----------------------------------------------------------------------------
OConnection::~OConnection()
{
+ acquire();
if(!isClosed())
close();
m_pDriver->release();
@@ -206,8 +209,7 @@ void OConnection::construct(const ::rtl::OUString& url,const Sequence< PropertyV
else
{
OSL_TRACE( "No subschema given!!!\n");
- ::dbtools::throwGenericSQLException(
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("No subschema provided")),NULL);
+ throwGenericSQLException( STR_URI_SYNTAX_ERROR );
}
}
else
@@ -317,10 +319,8 @@ void OConnection::construct(const ::rtl::OUString& url,const Sequence< PropertyV
if ( m_sHostName.getLength() != 0 ) {
m_sMozillaURI += m_sHostName;
}
- else {
- ::dbtools::throwGenericSQLException(
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("No HostName provided")),NULL);
- }
+ else
+ throwGenericSQLException( STR_NO_HOSTNAME );
if ( nPortNumber > 0 ) {
m_sMozillaURI += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(":") );
@@ -331,10 +331,9 @@ void OConnection::construct(const ::rtl::OUString& url,const Sequence< PropertyV
m_sMozillaURI += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("/") );
m_sMozillaURI += sBaseDN;
}
- else {
- ::dbtools::throwGenericSQLException(
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("No BaseDN provided")),NULL);
- }
+ else
+ throwGenericSQLException( STR_NO_BASEDN );
+
// Addition of a fake query to enable the Mozilla LDAP directory to work correctly.
m_sMozillaURI += ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("?(or(DisplayName,=,DontDoThisAtHome)))"));
@@ -350,8 +349,7 @@ void OConnection::construct(const ::rtl::OUString& url,const Sequence< PropertyV
else
{
OSL_TRACE("Invalid subschema given!!!\n");
- ::dbtools::throwGenericSQLException(
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Invalid subschema provided")),NULL);
+ throwGenericSQLException( STR_URI_SYNTAX_ERROR );
}
OSL_TRACE("Moz URI = %s, %s\n", ((OUtoCStr(m_sMozillaURI)) ? (OUtoCStr(m_sMozillaURI)):("NULL")), usesFactory() ? "uses factory" : "no factory");