summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--connectivity/source/drivers/mozab/MConnection.cxx14
-rw-r--r--connectivity/source/drivers/mozab/MConnection.hxx9
-rw-r--r--connectivity/source/drivers/mozab/MResultSet.cxx6
-rw-r--r--connectivity/source/drivers/mozab/mozillasrc/MDatabaseMetaDataHelper.cxx6
-rw-r--r--connectivity/source/drivers/mozab/mozillasrc/MNameMapper.cxx15
-rw-r--r--connectivity/source/drivers/mozab/mozillasrc/MQuery.cxx18
-rw-r--r--connectivity/source/drivers/mozab/mozillasrc/MQuery.hxx8
7 files changed, 46 insertions, 30 deletions
diff --git a/connectivity/source/drivers/mozab/MConnection.cxx b/connectivity/source/drivers/mozab/MConnection.cxx
index a966bd006c50..65cadcc0e7f1 100644
--- a/connectivity/source/drivers/mozab/MConnection.cxx
+++ b/connectivity/source/drivers/mozab/MConnection.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: MConnection.cxx,v $
*
- * $Revision: 1.5 $
+ * $Revision: 1.6 $
*
- * last change: $Author: fs $ $Date: 2001-10-23 17:44:40 $
+ * last change: $Author: mmaher $ $Date: 2001-10-31 17:24:22 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -179,6 +179,7 @@ OConnection::OConnection(MozabDriver* _pDriver)
m_nMaxResultRecords( -1 ),
m_UsesFactory(sal_False),
m_IsLDAP(sal_False),
+ m_aNameMapper(NULL),
m_bOutlookExpress(sal_False)
{
m_pDriver->acquire();
@@ -539,3 +540,12 @@ Reference< XTablesSupplier > SAL_CALL OConnection::createCatalog()
return xTab;
}
// -----------------------------------------------------------------------------
+
+MNameMapper* OConnection::getNameMapper ()
+{
+ if (m_aNameMapper==NULL)
+ m_aNameMapper = MQuery::CreateNameMapper();
+
+ return m_aNameMapper;
+}
+
diff --git a/connectivity/source/drivers/mozab/MConnection.hxx b/connectivity/source/drivers/mozab/MConnection.hxx
index 3deb987a058f..a355ba276183 100644
--- a/connectivity/source/drivers/mozab/MConnection.hxx
+++ b/connectivity/source/drivers/mozab/MConnection.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: MConnection.hxx,v $
*
- * $Revision: 1.5 $
+ * $Revision: 1.6 $
*
- * last change: $Author: fs $ $Date: 2001-10-23 17:44:40 $
+ * last change: $Author: mmaher $ $Date: 2001-10-31 17:24:22 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -107,6 +107,8 @@ namespace connectivity
class OStatement_Base;
class MozabDriver;
class ODatabaseMetaData;
+ class MNameMapper;
+
typedef connectivity::OMetaConnection OConnection_BASE; // implements basics and text encoding
typedef ::std::vector< ::connectivity::OTypeInfo> TTypeInfoVector;
@@ -147,6 +149,7 @@ namespace connectivity
sal_Bool m_UsesFactory ;
sal_Bool m_IsLDAP ;
sal_Bool m_bOutlookExpress;
+ MNameMapper* m_aNameMapper;
// End of Additions from the land of mozilla
public:
@@ -222,6 +225,8 @@ namespace connectivity
static const sal_Char* getSDBC_SCHEME_OUTLOOK_EXPRESS();
static ::rtl::OUString getDriverImplementationName();
+ MNameMapper* getNameMapper();
+
// End of Additions from the land of mozilla
};
}
diff --git a/connectivity/source/drivers/mozab/MResultSet.cxx b/connectivity/source/drivers/mozab/MResultSet.cxx
index 75e720ec0774..137054aa667c 100644
--- a/connectivity/source/drivers/mozab/MResultSet.cxx
+++ b/connectivity/source/drivers/mozab/MResultSet.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: MResultSet.cxx,v $
*
- * $Revision: 1.3 $
+ * $Revision: 1.4 $
*
- * last change: $Author: hr $ $Date: 2001-10-17 18:49:52 $
+ * last change: $Author: mmaher $ $Date: 2001-10-31 17:24:22 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -1715,7 +1715,7 @@ void OResultSet::fillRowData()
rtl::OUString aStr( m_pTable->getName() );
m_aQuery.setAddressbook( aStr );
- sal_Int32 rv = m_aQuery.executeQuery(xConnection->isOutlookExpress());
+ sal_Int32 rv = m_aQuery.executeQuery(xConnection->isOutlookExpress(), xConnection);
if ( rv == -1 ) {
::dbtools::throwGenericSQLException(
::rtl::OUString::createFromAscii("Error querying addressbook"),NULL);
diff --git a/connectivity/source/drivers/mozab/mozillasrc/MDatabaseMetaDataHelper.cxx b/connectivity/source/drivers/mozab/mozillasrc/MDatabaseMetaDataHelper.cxx
index 36c4dede03bf..95feabf60994 100644
--- a/connectivity/source/drivers/mozab/mozillasrc/MDatabaseMetaDataHelper.cxx
+++ b/connectivity/source/drivers/mozab/mozillasrc/MDatabaseMetaDataHelper.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: MDatabaseMetaDataHelper.cxx,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.3 $
*
- * last change: $Author: oj $ $Date: 2001-10-15 12:59:14 $
+ * last change: $Author: mmaher $ $Date: 2001-10-31 17:24:23 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -363,7 +363,7 @@ static void throwABSpecificException( OConnection* _pCon, sal_Bool bGivenURI ) t
::rtl::OUString aTableName;
- MNameMapper *nmap = MNameMapper::getInstance();
+ MNameMapper *nmap = _pCon->getNameMapper();
do {
nsCOMPtr<nsIAbDirectory> subDirectory;
diff --git a/connectivity/source/drivers/mozab/mozillasrc/MNameMapper.cxx b/connectivity/source/drivers/mozab/mozillasrc/MNameMapper.cxx
index 24e985722f46..002c014787ce 100644
--- a/connectivity/source/drivers/mozab/mozillasrc/MNameMapper.cxx
+++ b/connectivity/source/drivers/mozab/mozillasrc/MNameMapper.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: MNameMapper.cxx,v $
*
- * $Revision: 1.1 $
+ * $Revision: 1.2 $
*
- * last change: $Author: mmaher $ $Date: 2001-10-11 10:07:55 $
+ * last change: $Author: mmaher $ $Date: 2001-10-31 17:24:23 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -78,17 +78,6 @@ MNameMapper::ltstr::operator()( const ::rtl::OUString &s1, const ::rtl::OUString
return s1.compareTo(s2) < 0;
}
-MNameMapper *MNameMapper::instance = NULL;
-
-MNameMapper*
-MNameMapper::getInstance()
-{
- if ( MNameMapper::instance == NULL )
- MNameMapper::instance = new MNameMapper();
-
- return( MNameMapper::instance );
-}
-
MNameMapper::MNameMapper()
{
mDirMap = new MNameMapper::dirMap;
diff --git a/connectivity/source/drivers/mozab/mozillasrc/MQuery.cxx b/connectivity/source/drivers/mozab/mozillasrc/MQuery.cxx
index e0f84fbba751..acdd7ea81a7e 100644
--- a/connectivity/source/drivers/mozab/mozillasrc/MQuery.cxx
+++ b/connectivity/source/drivers/mozab/mozillasrc/MQuery.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: MQuery.cxx,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.3 $
*
- * last change: $Author: oj $ $Date: 2001-10-15 12:59:14 $
+ * last change: $Author: mmaher $ $Date: 2001-10-31 17:24:23 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -61,6 +61,7 @@
#include <MQueryHelper.hxx>
#include <MNameMapper.hxx>
+#include <MConnection.hxx>
#ifndef _DBHELPER_DBEXCEPTION_HXX_
#include <connectivity/dbexception.hxx>
@@ -329,7 +330,7 @@ const ::std::vector< MQuery::eSqlOppr > &MQuery::getSqlOppr() const
return(m_aSqlOppr);
}
// -------------------------------------------------------------------------
-sal_Int32 MQuery::executeQuery(sal_Bool _bIsOutlookExpress)
+sal_Int32 MQuery::executeQuery(sal_Bool _bIsOutlookExpress, OConnection* _pCon)
{
OSL_TRACE("IN MQuery::executeQuery()\n");
::osl::MutexGuard aGuard(m_aMutex);
@@ -343,7 +344,8 @@ sal_Int32 MQuery::executeQuery(sal_Bool _bIsOutlookExpress)
return(-1);
nsCOMPtr<nsIAbDirectory> directory;
- MNameMapper *nmap = MNameMapper::getInstance();
+ MNameMapper *nmap = _pCon->getNameMapper();
+
if ( nmap->getDir( m_aAddressbook, getter_AddRefs( directory ) ) == sal_False )
return( -1 );
@@ -592,3 +594,11 @@ MQuery::getRowValue( ORowSetValue& rValue, sal_Int32 nDBRow, rtl::OUString& aDBC
OSL_TRACE( "\tOUT MQuery::getRowValue()\n");
}
+// -------------------------------------------------------------------------
+MNameMapper*
+MQuery::CreateNameMapper()
+{
+ return( new MNameMapper() );
+}
+
+
diff --git a/connectivity/source/drivers/mozab/mozillasrc/MQuery.hxx b/connectivity/source/drivers/mozab/mozillasrc/MQuery.hxx
index a9c749b9f23f..d02d021381fa 100644
--- a/connectivity/source/drivers/mozab/mozillasrc/MQuery.hxx
+++ b/connectivity/source/drivers/mozab/mozillasrc/MQuery.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: MQuery.hxx,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.3 $
*
- * last change: $Author: oj $ $Date: 2001-10-15 12:59:14 $
+ * last change: $Author: mmaher $ $Date: 2001-10-31 17:24:23 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -143,6 +143,7 @@ namespace connectivity
private:
MQueryDirectory *m_aQueryDirectory;
MQueryHelper *m_aQueryHelper;
+ MNameMapper *m_aNameMapper;
::std::vector< ::rtl::OUString> m_aAttributes;
::rtl::OUString m_aAddressbook;
::std::vector< ::rtl::OUString> m_aMatchItems;
@@ -174,7 +175,7 @@ namespace connectivity
sal_Bool getQuerySubDirs(void) const;
void setSqlOppr( ::std::vector< eSqlOppr >&);
const ::std::vector< eSqlOppr > &getSqlOppr(void) const;
- sal_Int32 executeQuery(sal_Bool _bIsOutlookExpress);
+ sal_Int32 executeQuery(sal_Bool _bIsOutlookExpress, OConnection* _pCon);
sal_Int32 getRowCount( void );
@@ -195,6 +196,7 @@ namespace connectivity
MQuery();
MQuery(const ::std::map< ::rtl::OUString, ::rtl::OUString> &);
virtual ~MQuery();
+ static MNameMapper* CreateNameMapper();
};
}
}