Commits

Anonymous committed 2899794

CWS-TOOLING: integrate CWS moz2seamonkey01
2009-06-18 20:56:43 +0200 fs r273133 : #i10000# corrected resolved of merge conflict
2009-06-18 20:55:34 +0200 fs r273132 : #i10000# corrected resolved of merge conflict
2009-06-18 10:49:26 +0200 fs r273105 : CWS-TOOLING: rebase CWS moz2seamonkey01 to trunk@272827 (milestone: DEV300:m50)
2009-06-17 20:48:35 +0200 fs r273094 : #i84961# removed 'pointless and buggy' echo statement
2009-05-22 11:27:08 +0200 fs r272176 : #i101763#
provided by tono@openoffice.org
make compile with mingw
2009-05-22 11:22:25 +0200 fs r272175 : #i101763#
provided by tono@openoffice.org
allow compilation in with mingw
2009-04-15 12:09:28 +0200 fs r270830 : unconditionally disable moz executables
2009-03-27 12:29:38 +0100 fs r270149 : ignore some configure-related files
2009-03-27 11:47:35 +0100 fs r270145 : SolarisSparc needs libfreebl_32fpu_3.so
2009-03-27 11:38:09 +0100 fs r270141 : regxpcom call not needed nowadays / also pack libfreebl3 (needed for signature/encryption)
2009-03-26 21:40:17 +0100 fs r270108 : superseded by 1.1.14 version
2009-03-24 13:07:21 +0100 fs r269938 : xptitemp.dat seemingly not needed anymore
2009-03-23 12:56:29 +0100 fs r269869 : files with : in their name break the build
2009-03-23 12:22:01 +0100 fs r269866 : files with : in their name break the build
2009-03-21 23:12:06 +0100 fs r269843 : manual resync: merge the changes which happened on TRUNK in mozilla-source-1.7.5.patch herein
2009-03-21 21:58:17 +0100 fs r269841 : CWS-TOOLING: rebase CWS moz2seamonkey01 to trunk@269781 (milestone: DEV300:m44)
2009-03-18 12:04:25 +0100 fs r269649 : in SunHH environment, use pre-requisites from /so/env
2009-03-16 12:33:18 +0100 pastea_p r269522 : correct makefile.mk sorry again
2009-03-15 17:32:43 +0100 pastea_p r269506 : last files about migration to 1.1.14
2009-03-15 17:19:39 +0100 pastea_p r269505 : Migrates some files to 1.1.14
2009-03-04 07:45:40 +0100 fs r268782 : also add pref.xpt
2009-02-27 09:57:37 +0100 fs r268555 : #i66338# for the moment, disable Mozilla-based code for unxlngx6
2009-02-23 10:56:28 +0100 fs r268346 : syntax
2009-02-19 14:14:56 +0100 fs r268283 : make PrintPDE compile in Sun's internal build environment by removing some unneeded stuff
2009-02-18 15:40:40 +0100 fs r268236 : #i66338# re-enable MozAB on Mac
2009-02-18 15:39:55 +0100 fs r268235 : #i66338#
2009-02-18 15:30:38 +0100 fs r268232 : #i66338# tar => $(TAR) (provided by hjs)
2009-02-18 15:28:45 +0100 fs r268231 : more build envs supported (thanks to hjs for all this work!)
2009-02-18 15:27:02 +0100 fs r268230 : #i66338#
2009-02-18 15:23:04 +0100 fs r268229 : #i66338# let it build on Solaris, in Sun Hamburg's build environment
2009-02-18 12:00:12 +0100 fs r268210 : #i10000#
2009-02-18 08:17:29 +0100 fs r268198 : #i66338# building Mozilla is not supported anymore, SeaMonkey is the way to go now
2009-02-18 08:16:50 +0100 fs r268197 : #i66338# building Mozilla is not supported anymore, SeaMonkey is the way to go now
2009-02-14 14:05:24 +0100 fs r267757 : redo the Windows related changes lost with recent resync
2009-02-14 00:06:33 +0100 ericb r267755 : #i94628# remove the config_office dir now
2009-02-14 00:04:59 +0100 ericb r267754 : #i94628# remove all files in config_office now
2009-02-14 00:01:26 +0100 ericb r267753 : #i94628# remove guw in config_office
2009-02-13 23:53:00 +0100 ericb r267752 : #i94628# remove files in config_office
2009-02-13 16:02:58 +0100 fs r267725 : #i10000#
2009-02-12 18:14:31 +0100 ericb r267685 : #i94628# new generated configure
2009-02-12 18:13:52 +0100 ericb r267684 : #i94628# fix a path issue for finding seamonkey01
2009-02-12 14:39:17 +0100 ericb r267662 : #i94628# removing seamonkey.1.1.12 patch
2009-02-12 14:21:04 +0100 ericb r267658 : #i94628# the new configure, after autoconf
2009-02-12 14:13:21 +0100 ericb r267656 : #i94628# other missing changes for Windows
2009-02-12 14:04:26 +0100 ericb r267655 : #i94628# recommit configure.in changes after config_office removing
2009-02-12 13:46:12 +0100 ericb r267653 : CWS-TOOLING: rebase CWS moz2seamonkey01 to trunk@267171 (milestone: DEV300:m41)
2009-02-12 12:00:48 +0100 ericb r267643 : CWS-TOOLING: rebase CWS moz2seamonkey01 to trunk@267171 (milestone: DEV300:m41)
2009-02-11 13:28:50 +0100 pl r267595 : #i94628# add MACDEVSDK variable for unxmacxi
2009-02-06 09:44:15 +0100 ericb r267446 : #i98957# provide the zipped archives too
2009-02-06 09:43:32 +0100 ericb r267445 : #i98957# make seamonkey buildable on OpenSolaris, adding the right options for configure
2009-02-06 09:42:45 +0100 ericb r267444 : #i98957# make seamonkey buildable on OpenSolaris
2009-02-02 09:41:57 +0100 fs r267252 : #i66338#
2009-02-02 09:41:43 +0100 fs r267251 : #i66338#
2009-01-30 15:12:03 +0100 fs r267200 : code consolidation - MQueryHelper now uses MLdapAttributeMap's fillCardFromResult and fillResultFromCard, which makes the code as such shorter, and eliminates information duplication
2009-01-30 11:53:31 +0100 fs r267189 : reworked the statement parsing / statement execution / result set creation: now we don't anymore create three result sets (two of them leaking) for a single prepared statement ...
2009-01-29 20:37:01 +0100 fs r267170 : #i10000#
2009-01-29 20:32:50 +0100 fs r267169 : more explicit return type of parseSql
2009-01-29 17:32:56 +0100 fs r267163 : slightly refactored the statement class hierarchy (basically remove OStatement_BASE2, and renamed the other base classes)
2009-01-29 17:14:58 +0100 fs r267161 : #i66338# first implementation to re-enable LDAP access. Still work in progress (but hey, you can see the data already :)
2009-01-12 11:25:56 +0100 fs r266138 : allow using a debug-enabled version of Mozilla/SeaMonkey when MOZILLA_ENABLE_DEBUG is set
2009-01-10 22:01:40 +0100 fs r266126 : #i95772# nsldap32v50.dll also needs an embedded manifest (the LDP configuration backend links directly against it)
2009-01-09 11:15:32 +0100 fs r266065 : manifests for DLLs need to have ID 2, not 1
2009-01-08 20:02:24 +0100 fs r266035 : #i95772# embed manifest file in shared libs built in directory/c-sdk, too
2009-01-05 20:45:38 +0100 ericb r265886 : #i66338# commiting the correct configure for the tinderboxes
2009-01-05 17:42:34 +0100 ericb r265883 : CWS-TOOLING: rebase CWS moz2seamonkey01 to trunk@265758 (milestone: DEV300:m38)
2008-12-16 15:34:26 +0100 ericb r265550 : #i94628# change for seamonkey1.1.13 : do not forget to do autoconf in config_office before configure
2008-12-16 15:25:37 +0100 pastea_p r265547 : 1.1.12 to 1.1.13
2008-12-16 14:20:18 +0100 pastea_p r265540 : correct the hunk about no core_abspath which one broke linux build
2008-12-16 13:10:06 +0100 pastea_p r265535 : Change name of patch to 1.1.13
2008-12-15 23:32:54 +0100 pastea_p r265518 : 2008-12-12 18:43:36 +0100 pastea_p r265435 : update to 1.1.13
2008-12-12 10:56:38 +0100 fs r265398 : #i95772# embed .manifest files into SHARED_LIBRARYs built in nsprpub, too
2008-12-12 09:56:38 +0100 fs r265391 : #i95772# don't use regxpcomp on Windows, it's not needed
2008-12-11 11:22:43 +0100 fs r265269 : #i95772# Moz/SeaMonkey libs on Windows now link against msvc?80.dll
2008-12-10 13:45:51 +0100 fs r265182 : proper OSL_ENSURE message
2008-11-13 13:18:03 +0100 fs r263635 : #i95772# more patches
2008-11-13 12:14:41 +0100 fs r263630 : #i95772# building SeaMonkey on Windows is supported for MSVS2005 only at the moment, now requiring v8-moztools.zip instead of the previously needed wintools.zip/vc71*.zip
2008-11-13 12:13:33 +0100 fs r263629 : #i95772# building SeaMonkey on Windows is supported for MSVS2005 only at the moment, now requiring v8-moztools.zip instead of the previously needed wintools.zip/vc71*.zip
2008-11-13 12:08:22 +0100 fs r263628 : #i95772# building SeaMonkey on Windows is supported for MSVS2005 only at the moment, now requiring v8-moztools.zip instead of the previously needed wintools.zip/vc71*.zip
2008-11-13 12:04:15 +0100 fs r263627 : #i95772#
2008-11-12 08:23:20 +0100 fs r263575 : i95772# use xpcom_core on Windows, too
2008-11-11 21:02:14 +0100 fs r263574 : i95772# use xpcom_core.lib on Windows, too
2008-11-11 20:58:07 +0100 fs r263573 : i95772# use xpcom_core.lib on Windows, too
2008-11-11 15:05:42 +0100 fs r263564 : alternative fix for part 1 of #i94957#
2008-11-10 22:18:14 +0100 fs r263541 : #i95772# with MSVC2008, compile with -Zc:wchar_t- (shamelessly taken from https://bugzilla.mozilla.org/show_bug.cgi?id=324842)
2008-11-10 22:15:57 +0100 fs r263540 : #i95772# with MSVC2008, compile with -Zc:wchar_t- (shamelessly taken from https://bugzilla.mozilla.org/show_bug.cgi?id=324842)
2008-11-10 09:28:26 +0100 fs r263509 : #i95772# when building on WNT, embed the .manifest file into the .dll/.exe
2008-11-10 09:19:06 +0100 fs r263508 : collect single patches which comprise the complete patch
2008-11-06 09:10:21 +0100 fs r263360 : #i95772# core_abspath does not work on Windows, too (at least in security/nss/cmd/shlibsign). Replace with 'cygpath -d -a'
2008-11-02 22:51:27 +0100 fs r263277 : #i95772# sanitize INCLUDEDIR and GENHEADERS to use cygwin path notation - cygwin's make 1.81 doesn't cope with Windows path notation
2008-11-02 22:50:15 +0100 fs r263276 : #i95772# no --enable-system-cairo on Windows
2008-10-18 20:12:36 +0200 pastea_p r262297 : 2008-10-16 17:15:35 +0200 ericb r262267 : #i94957# fix the breakage in connectivity, for the seamonkey migration
2008-10-16 17:14:49 +0200 ericb r262266 : #i94957# fix the breakage in connectivity, for the seamonkey migration
2008-10-16 16:58:21 +0200 ericb r262263 : #i94957# fix the breakage in connectivity, for the seamonkey migration
2008-10-15 20:16:28 +0200 ericb r262242 : #i94628# use mac as default toolkit on mac
2008-10-14 18:54:13 +0200 ericb r262216 : #i90774# modify the configure.in for moz2seamonkey migration
2008-10-14 18:48:57 +0200 ericb r262215 : #i90774# commit moz2seamonkey changes for svn migration
2008-10-14 18:47:05 +0200 ericb r262214 : #i90774# commit moz2seamonkey changes for svn migration

  • Participants
  • Parent commits b8d2ace

Comments (0)

Files changed (46)

File configure.in

 			AC_MSG_RESULT([found Compiler version $CCNUMVER.])
 			if test "$CCNUMVER" -ge "001500000000"; then
 				COMEX=12
+				MSVSVER=2008
 				AC_MSG_RESULT([found .NET 2008 / VS 9.0.])
 			elif test "$CCNUMVER" -ge "001400000000"; then
 				COMEX=11
+				MSVSVER=2005
 				AC_MSG_RESULT([found .NET 2005.])
 			elif test "$CCNUMVER" -ge "001300102240"; then
 				COMEX=10
+				MSVSVER=2003
 				AC_MSG_RESULT([found .NET 2003.])
 			else
 				AC_MSG_ERROR([Compiler too old. Use Microsoft C/C++ .NET 2003/2005 compiler.])
 
 AC_MSG_CHECKING([for toolkit mozilla should use])
 if test -z "$with_mozilla_toolkit"; then
-   if test "$_os" != "WINNT"; then
-      MOZILLA_TOOLKIT=gtk2
-      AC_MSG_RESULT([gtk2])
+   if test "$_os" != "WINNT" ; then
+      if test "$_os" = "Darwin" ; then
+         MOZILLA_TOOLKIT=mac  
+         AC_MSG_RESULT([mac])
+      else
+         MOZILLA_TOOLKIT=gtk2
+         AC_MSG_RESULT([gtk2])
+      fi
    fi
 else
    MOZILLA_TOOLKIT=$with_mozilla_toolkit
       enable_build_mozilla=
 fi
 
-AC_MSG_CHECKING([whether to build Mozilla])
+AC_MSG_CHECKING([whether to build Mozilla/SeaMonkey])
 if test -n "$enable_build_mozilla"; then
    BUILD_MOZAB="TRUE"
    AC_MSG_RESULT([yes])
 fi
 
 if test "$BUILD_MOZAB" = "TRUE"; then
+  if test "$_os" = "WINNT"; then
+    if test "$WITH_MINGWIN" != "yes"; then
+      # compiling with MSVC. Only supported platform here is MSVS2005 at the moment.
+      if test "$MSVSVER" != "2005"; then
+        AC_MSG_ERROR([Building SeaMonkey is supported with Microsoft Visual Studio .NET 2005 only.])
+      fi
+    else
+      AC_MSG_WARN([Building SeaMonkey with mingwin is not tested, and likely to break.])
+      echo "Building SeaMonkey with mingwin is not tested, and likely to break." >> warn
+    fi
+  fi
+
    if test -z "$MOZILLA_VERSION"; then
-      MOZILLA_VERSION=1.7.5
+      MOZILLA_VERSION=1.1.14
    fi
-   if test "$MOZILLA_VERSION" = "1.7b" ; then
-      MOZILLA_SOURCE_VERSION="mozilla-source-1.7b-source"
-   else
-      MOZILLA_SOURCE_VERSION="mozilla-source-${MOZILLA_VERSION}"
-   fi
+   MOZILLA_SOURCE_VERSION="seamonkey-${MOZILLA_VERSION}.source"
    for e in gz bz2; do
       AC_MSG_CHECKING([for $MOZILLA_SOURCE_VERSION.tar.$e])
-      if test ! -e "./moz/download/$MOZILLA_SOURCE_VERSION.tar.$e" && test "$HAVE_MOZILLA_TARBALL" != "y"; then
+      if test ! -e "moz/download/$MOZILLA_SOURCE_VERSION.tar.$e" && test "$HAVE_MOZILLA_TARBALL" != "y"; then
          AC_MSG_RESULT([not found])
          HAVE_MOZILLA_TARBALL=n
       else
       fi
    done
    if test "$HAVE_MOZILLA_TARBALL" != "y"; then
-         AC_MSG_ERROR([Mozilla source archive not found.
+         AC_MSG_ERROR([Mozilla/SeaMonkey source archive not found.
 Please copy $MOZILLA_SOURCE_VERSION.tar.bz2 or $MOZILLA_SOURCE_VERSION.tar.gz to moz/download/.
 The archives can be found here:
-http://ftp.mozilla.org/pub/mozilla.org/mozilla/releases/mozilla$MOZILLA_VERSION/source/])
+http://releases.mozilla.org/pub/mozilla.org/seamonkey/releases/$MOZILLA_VERSION/])
    fi
    if test "$_os" = "WINNT"; then
-      AC_MSG_CHECKING([for glib and libIDL binaries])
-      if test ! -e "./moz/download/vc71-glib-1.2.10-bin.zip" \
-           -o ! -e "./moz/download/vc71-libIDL-0.6.8-bin.zip" \
-           -o ! -e "./moz/download/wintools.zip" ; then
-AC_MSG_ERROR([One or more of the following archives is missing in moz/download/
-  vc71-glib-1.2.10-bin.zip
-  vc71-libIDL-0.6.8-bin.zip
-(from ftp://ftp.mozilla.org/pub/mozilla.org/mozilla/libraries/win32/historic/vc71/)
-  wintools.zip
-(from http://ftp.mozilla.org/pub/mozilla.org/mozilla/source/wintools.zip)])
+      AC_MSG_CHECKING([for moztools binaries])
+      if test ! -e "moz/download/vc8-moztools.zip" ; then
+        AC_MSG_ERROR([The following file is missing in moz/download: vc8-moztools.zip
+(from ftp://ftp.mozilla.org/pub/mozilla.org/mozilla/libraries/win32/historic/vc8/)])
       else
          AC_MSG_RESULT([ok])
       fi

File connectivity/source/drivers/mozab/MColumnAlias.cxx

 #include "precompiled_connectivity.hxx"
 #include "MColumnAlias.hxx"
 #include "MConnection.hxx"
+#include "MExtConfigAccess.hxx"
+
 #include <com/sun/star/beans/XPropertySet.hpp>
 #include <com/sun/star/container/XNameAccess.hpp>
-#ifndef CONNECTIVITY_MOZAB_MEXTCONFIGACCESS_HXX
-#include "MExtConfigAccess.hxx"
-#endif
 
+#include <tools/diagnose_ex.h>
+
+#include <algorithm>
+#include <functional>
 
 using namespace ::connectivity;
 using namespace ::connectivity::mozab;
 using namespace ::com::sun::star::beans;
 using namespace ::com::sun::star::container;
 
-static const ::rtl::OUString sProgrammaticNames[] =
-{
-	::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("FirstName")),
-	::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("LastName")),
-	::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("DisplayName")),
-	::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("NickName")),
-	::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("PrimaryEmail")),
-	::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("SecondEmail")),
-	::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("PreferMailFormat")),
-	::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("WorkPhone")),
-	::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("HomePhone")),
-	::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("FaxNumber")),
-	::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("PagerNumber")),
-	::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("CellularNumber")),
-	::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("HomeAddress")),
-	::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("HomeAddress2")),
-	::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("HomeCity")),
-	::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("HomeState")),
-	::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("HomeZipCode")),
-	::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("HomeCountry")),
-	::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("WorkAddress")),
-	::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("WorkAddress2")),
-	::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("WorkCity")),
-	::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("WorkState")),
-	::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("WorkZipCode")),
-	::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("WorkCountry")),
-	::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("JobTitle")),
-	::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Department")),
-	::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Company")),
-	::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("WebPage1")),
-	::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("WebPage2")),
-	::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("BirthYear")),
-	::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("BirthMonth")),
-	::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("BirthDay")),
-	::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Custom1")),
-	::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Custom2")),
-	::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Custom3")),
-	::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Custom4")),
-	::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Notes"))
-};
 //------------------------------------------------------------------------------
 OColumnAlias::OColumnAlias( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB )
 {
-    for ( size_t i = 0; i < END - BEGIN; ++i )
-        m_aAliasMap[ sProgrammaticNames[i] ] = AliasDescription( sProgrammaticNames[i], static_cast< ProgrammaticName>( i ) );
+    static const sal_Char* s_pProgrammaticNames[] =
+    {
+        "FirstName",
+        "LastName",
+        "DisplayName",
+        "NickName",
+        "PrimaryEmail",
+        "SecondEmail",
+        "PreferMailFormat",
+        "WorkPhone",
+        "HomePhone",
+        "FaxNumber",
+        "PagerNumber",
+        "CellularNumber",
+        "HomeAddress",
+        "HomeAddress2",
+        "HomeCity",
+        "HomeState",
+        "HomeZipCode",
+        "HomeCountry",
+        "WorkAddress",
+        "WorkAddress2",
+        "WorkCity",
+        "WorkState",
+        "WorkZipCode",
+        "WorkCountry",
+        "JobTitle",
+        "Department",
+        "Company",
+        "WebPage1",
+        "WebPage2",
+        "BirthYear",
+        "BirthMonth",
+        "BirthDay",
+        "Custom1",
+        "Custom2",
+        "Custom3",
+        "Custom4",
+        "Notes",
+    };
+
+    for ( size_t i = 0; i < sizeof( s_pProgrammaticNames ) / sizeof( s_pProgrammaticNames[0] ); ++i )
+        m_aAliasMap[ ::rtl::OUString::createFromAscii( s_pProgrammaticNames[i] ) ] = AliasEntry( s_pProgrammaticNames[i], i );
 
     initialize( _rxORB );
 }
 
-//------------------------------------------------------------------
+//------------------------------------------------------------------------------
 void OColumnAlias::initialize( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB )
 {
     // open our driver settings config node
 			OSL_ENSURE( xAliasesNode.is(), "OColumnAlias::setAlias: missing the aliases node!" );
 
 			// this is a set of string nodes
-			Sequence< ::rtl::OUString > aColumnProgrammaticNames;
+			Sequence< ::rtl::OUString > aProgrammaticNames;
 			if ( xAliasesNode.is() )
-				aColumnProgrammaticNames = xAliasesNode->getElementNames();
+                aProgrammaticNames = xAliasesNode->getElementNames();
 
 			//.............................................................
 			// travel through all the set elements
-			const ::rtl::OUString* pProgrammaticNames = aColumnProgrammaticNames.getConstArray();
-			const ::rtl::OUString* pProgrammaticNamesEnd = pProgrammaticNames + aColumnProgrammaticNames.getLength();
+			const ::rtl::OUString* pProgrammaticNames = aProgrammaticNames.getConstArray();
+			const ::rtl::OUString* pProgrammaticNamesEnd = pProgrammaticNames + aProgrammaticNames.getLength();
 			::rtl::OUString sAssignedAlias;
 
 			for ( ; pProgrammaticNames < pProgrammaticNamesEnd; ++pProgrammaticNames )
 			{
-				OSL_ENSURE( m_aAliasMap.end() != m_aAliasMap.find( *pProgrammaticNames ),
-					"OColumnAlias::setAlias: found an invalid programmtic name!" );
-					// if this asserts, somebody stored a programmatic name in the configuration
-					// which is not allowed (i.e. not in the list of known programmatics).
-
-#if OSL_DEBUG_LEVEL > 0
-				sal_Bool bExtractionSuccess =
-#endif
-				xAliasesNode->getByName( *pProgrammaticNames) >>= sAssignedAlias;
-				OSL_ENSURE( bExtractionSuccess, "OColumnAlias::setAlias: invalid config data!" );
+				OSL_VERIFY( xAliasesNode->getByName( *pProgrammaticNames ) >>= sAssignedAlias );
 
 				// normalize in case the config data is corrupted
 				// (what we really don't need is an empty alias ...)
 				if ( 0 == sAssignedAlias.getLength() )
 					  sAssignedAlias = *pProgrammaticNames;
 
+                ::rtl::OString sAsciiProgrammaticName( ::rtl::OUStringToOString( *pProgrammaticNames, RTL_TEXTENCODING_ASCII_US ) );
 				//.............................................................
             #if OSL_DEBUG_LEVEL > 0
                 bool bFound = false;
                         ++search
                     )
                 {
-                    if ( search->second.sProgrammaticName == *pProgrammaticNames )
+                    if ( search->second.programmaticAsciiName.equals( sAsciiProgrammaticName ) )
                     {
-                        AliasDescription aDescription( search->second );
-
-                        // delete this old entry for this programmatic name
+                        AliasEntry entry( search->second );
                         m_aAliasMap.erase( search );
-
-                        // insert the same AliasDescription under a new name - its alias
-                        m_aAliasMap[ sAssignedAlias ] = aDescription;
+                        m_aAliasMap[ sAssignedAlias ] = entry;
 
                     #if OSL_DEBUG_LEVEL > 0
                         bFound = true;
 		}
 		catch( const Exception& )
 		{
-			OSL_ENSURE( sal_False, "OColumnAlias::setAlias: could not read my driver's configuration data!" );
+            DBG_UNHANDLED_EXCEPTION();
 		}
 	}
 }
 
 //------------------------------------------------------------------
-OColumnAlias::ProgrammaticName OColumnAlias::getProgrammaticNameIndex( const ::rtl::OUString& _rAliasName ) const
+::rtl::OString OColumnAlias::getProgrammaticNameOrFallbackToUTF8Alias( const ::rtl::OUString& _rAlias ) const
 {
-    AliasMap::const_iterator pos = m_aAliasMap.find( _rAliasName );
+    AliasMap::const_iterator pos = m_aAliasMap.find( _rAlias );
     if ( pos == m_aAliasMap.end() )
     {
-        OSL_ENSURE( false, "OColumnAlias::getProgrammaticNameIndex: unknown column alias!" );
-        return END;
+        OSL_ENSURE( false, "OColumnAlias::getProgrammaticNameOrFallbackToUTF8Alias: no programmatic name for this alias!" );
+        return ::rtl::OUStringToOString( _rAlias, RTL_TEXTENCODING_UTF8 );
     }
-
-    return pos->second.eProgrammaticNameIndex;
+    return pos->second.programmaticAsciiName;
 }
 
 //------------------------------------------------------------------
-::rtl::OUString OColumnAlias::getProgrammaticNameOrFallbackToAlias( const ::rtl::OUString& _rAlias ) const
+bool OColumnAlias::isColumnSearchable( const ::rtl::OUString _alias ) const
 {
-    AliasMap::const_iterator pos = m_aAliasMap.find( _rAlias );
-    if ( pos == m_aAliasMap.end() )
-        return _rAlias;
-    return pos->second.sProgrammaticName;
+    ::rtl::OString sProgrammatic = getProgrammaticNameOrFallbackToUTF8Alias( _alias );
+
+    return  (   !sProgrammatic.equals( "HomeCountry" )
+            &&  !sProgrammatic.equals( "WorkCountry" )
+            );
+    // for those, we know that they're not searchable in the Mozilla/LDAP implementation.
+    // There might be more ...
 }

File connectivity/source/drivers/mozab/MColumnAlias.hxx

 
 #include <osl/mutex.hxx>
 #include <vector>
-#include <map>
+#include <hash_map>
 
 namespace connectivity
 {
 		class OColumnAlias
 		{
         public:
-		    typedef enum {
-                BEGIN = 0,
+            struct AliasEntry
+            {
+                ::rtl::OString  programmaticAsciiName;
+                sal_Int32       columnPosition;
 
-			    FIRSTNAME = BEGIN,
-			    LASTNAME,
-			    DISPLAYNAME,
-			    NICKNAME,
-			    PRIMARYEMAIL,
-			    SECONDEMAIL,
-			    PREFERMAILFORMAT,
-			    WORKPHONE,
-			    HOMEPHONE,
-			    FAXNUMBER,
-			    PAGERNUMBER,
-			    CELLULARNUMBER,
-			    HOMEADDRESS,
-			    HOMEADDRESS2,
-			    HOMECITY,
-			    HOMESTATE,
-			    HOMEZIPCODE,
-			    HOMECOUNTRY,
-			    WORKADDRESS,
-			    WORKADDRESS2,
-			    WORKCITY,
-			    WORKSTATE,
-			    WORKZIPCODE,
-			    WORKCOUNTRY,
-			    JOBTITLE,
-			    DEPARTMENT,
-			    COMPANY,
-			    WEBPAGE1,
-			    WEBPAGE2,
-			    BIRTHYEAR,
-			    BIRTHMONTH,
-			    BIRTHDAY,
-			    CUSTOM1,
-			    CUSTOM2,
-			    CUSTOM3,
-			    CUSTOM4,
-			    NOTES,
-
-                END
-		    } ProgrammaticName;
-
-            struct AliasDescription
-            {
-                ::rtl::OUString     sProgrammaticName;
-                ProgrammaticName    eProgrammaticNameIndex;
-
-                AliasDescription()
-                    :eProgrammaticNameIndex( END )
+                AliasEntry()
+                    :programmaticAsciiName()
+                    ,columnPosition( 0 )
                 {
                 }
-
-                AliasDescription( const ::rtl::OUString& _rName, ProgrammaticName _eIndex )
-                    :sProgrammaticName( _rName ), eProgrammaticNameIndex( _eIndex )
+                AliasEntry( const sal_Char* _programmaticAsciiName, sal_Int32 _columnPosition )
+                    :programmaticAsciiName( _programmaticAsciiName )
+                    ,columnPosition( _columnPosition )
                 {
                 }
             };
-
-            typedef ::std::map< ::rtl::OUString, AliasDescription > AliasMap;
+            typedef ::std::hash_map< ::rtl::OUString, AliasEntry, ::rtl::OUStringHash > AliasMap;
 
         private:
 			AliasMap    m_aAliasMap;
 
-        protected:
-			::osl::Mutex  m_aMutex;
+        public:
+			OColumnAlias( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > & );
 
-        public:
-			OColumnAlias(
-                const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > & );
-
-            ProgrammaticName getProgrammaticNameIndex( const ::rtl::OUString& _rAliasName ) const;
             inline bool hasAlias( const ::rtl::OUString& _rAlias ) const
             {
                 return m_aAliasMap.find( _rAlias ) != m_aAliasMap.end();
             }
-            ::rtl::OUString getProgrammaticNameOrFallbackToAlias( const ::rtl::OUString& _rAlias ) const;
+            ::rtl::OString getProgrammaticNameOrFallbackToUTF8Alias( const ::rtl::OUString& _rAlias ) const;
 
             inline AliasMap::const_iterator begin() const { return m_aAliasMap.begin(); }
             inline AliasMap::const_iterator end() const { return m_aAliasMap.end(); }
 
+            bool isColumnSearchable( const ::rtl::OUString _alias ) const;
+
 		private:
             void initialize( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB );
 		};

File connectivity/source/drivers/mozab/MConnection.cxx

 	// the statement can only be executed more than once
     OPreparedStatement* pPrepared = new OPreparedStatement(this,_sSql);
 	Reference< XPreparedStatement > xReturn = pPrepared;
-    if ( !pPrepared->lateInit() )
-        throw SQLException();
+    pPrepared->lateInit();
     
 	m_aStatements.push_back(WeakReferenceHelper(xReturn));
 	return xReturn;

File connectivity/source/drivers/mozab/MConnection.hxx

 	namespace mozab
 	{
 
-		class OStatement_Base;
 		class MozabDriver;
 		class ODatabaseMetaData;
 		class MNameMapper;

File connectivity/source/drivers/mozab/MDatabaseMetaData.cxx

                     // COLUMN_NAME
                     aRow[4] = new ORowSetValueDecorator( compare->first );
                     // ORDINAL_POSITION
-                    aRow[17] = new ORowSetValueDecorator( static_cast< sal_Int32 >( compare->second.eProgrammaticNameIndex ) + 1 );
+                    aRow[17] = new ORowSetValueDecorator( static_cast< sal_Int32 >( compare->second.columnPosition ) + 1 );
                     aRows.push_back(aRow);
                 }
             }

File connectivity/source/drivers/mozab/MPreparedStatement.cxx

 
 
 OPreparedStatement::OPreparedStatement( OConnection* _pConnection,const ::rtl::OUString& sql)
-	:OStatement_BASE2(_pConnection)
+	:OCommonStatement(_pConnection)
     ,m_nNumParams(0)
     ,m_sSqlStatement(sql)
 	,m_bPrepared(sal_False)
-    ,m_pResultSet( NULL )
+    ,m_pResultSet()
 {
 }
 // -----------------------------------------------------------------------------
 {
 }
 // -----------------------------------------------------------------------------
-sal_Bool OPreparedStatement::lateInit()
+void OPreparedStatement::lateInit()
 {
-    return parseSql( m_sSqlStatement );
+    if ( eSelect != parseSql( m_sSqlStatement ) )
+        throw SQLException();
 }
 // -------------------------------------------------------------------------
 void SAL_CALL OPreparedStatement::disposing()
 {
 	::osl::MutexGuard aGuard(m_aMutex);
 
-	if(m_pResultSet)
-		m_pResultSet->release();
-
-	clearMyResultSet();
-
-	OStatement_BASE2::disposing();
+	OCommonStatement::disposing();
 
 	m_xMetaData = NULL;
 	if(m_aParameterRow.isValid())
 }
 // -----------------------------------------------------------------------------
 
-sal_Bool OPreparedStatement::parseSql( const ::rtl::OUString& sql , sal_Bool bAdjusted ) throw (
-     ::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException )
+OCommonStatement::StatementType OPreparedStatement::parseSql( const ::rtl::OUString& sql , sal_Bool bAdjusted )
+    throw ( ::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException )
 {
-    OSL_TRACE("in :: OPreparedStatement::parseSql()");
-    if (!OStatement_Base::parseSql( sql, bAdjusted ))
-		return sal_False;
+    StatementType eStatementType = OCommonStatement::parseSql( sql, bAdjusted );
+    if ( eStatementType != eSelect )
+		return eStatementType;
 
     m_xParamColumns = new OSQLColumns();
 
-    Reference<XIndexAccess> xNames(m_xColNames,UNO_QUERY);
-
     // describe all parameters need for the resultset
     describeParameter();
 
-    OResultSet::setBoundedColumns(m_aRow,m_xParamColumns,xNames,sal_False,m_xDBMetaData,m_aColMapping);
+    Reference<XIndexAccess> xNames(m_xColNames,UNO_QUERY);
+    OResultSet::setBoundedColumns( m_aRow, m_xParamColumns, xNames, sal_False, m_xDBMetaData, m_aColMapping );
 
-    m_pResultSet = createResultSet();
-	m_pResultSet->acquire();
-    m_xResultSet = Reference<XResultSet>(m_pResultSet);
-    initializeResultSet(m_pResultSet);
-    OSL_TRACE("Out :: OPreparedStatement::parseSql()");
-	return sal_True;
-}
-
-// -----------------------------------------------------------------------------
-
-OResultSet* OPreparedStatement::createResultSet( )
-{
-    OSL_TRACE("In/Out : OPreparedStatement::createResultSet( )");
-    return new OResultSet( this, m_pSQLIterator );
+    return eStatementType;
 }
 
 // -----------------------------------------------------------------------------
 void OPreparedStatement::initializeResultSet( OResultSet* _pResult )
 {
-    OSL_TRACE("In : OPreparedStatement::initializeResultSet( )");
-    OStatement_Base::initializeResultSet( _pResult );
+    OCommonStatement::initializeResultSet( _pResult );
+    _pResult->setParameterColumns( m_xParamColumns );
+    _pResult->setParameterRow( m_aParameterRow );
+}
 
-    _pResult->setParameterColumns(m_xParamColumns);
-    _pResult->setParameterRow(m_aParameterRow);
-    OSL_TRACE("Out : OPreparedStatement::initializeResultSet( )");
+// -----------------------------------------------------------------------------
+void OPreparedStatement::clearCachedResultSet()
+{
+    OCommonStatement::clearCachedResultSet();
+    m_pResultSet.clear();
+    m_xMetaData.clear();
+}
+// -----------------------------------------------------------------------------
+void OPreparedStatement::cacheResultSet( const ::rtl::Reference< OResultSet >& _pResult )
+{
+    OCommonStatement::cacheResultSet( _pResult );
+    OSL_PRECOND( m_pResultSet == NULL, "OPreparedStatement::parseSql: you should call clearCachedResultSet before!" );
+    m_pResultSet = _pResult;
 }
 
 // -----------------------------------------------------------------------------
 void SAL_CALL OPreparedStatement::acquire() throw()
 {
-	OStatement_BASE2::acquire();
+	OCommonStatement::acquire();
 }
 // -----------------------------------------------------------------------------
 void SAL_CALL OPreparedStatement::release() throw()
 {
-	OStatement_BASE2::release();
+	OCommonStatement::release();
 }
 // -----------------------------------------------------------------------------
 Any SAL_CALL OPreparedStatement::queryInterface( const Type & rType ) throw(RuntimeException)
 {
-	Any aRet = OStatement_BASE2::queryInterface(rType);
+	Any aRet = OCommonStatement::queryInterface(rType);
 	if(!aRet.hasValue())
 		aRet = OPreparedStatement_BASE::queryInterface(rType);
 	return aRet;
 // -------------------------------------------------------------------------
 ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL OPreparedStatement::getTypes(  ) throw(::com::sun::star::uno::RuntimeException)
 {
-	return ::comphelper::concatSequences(OPreparedStatement_BASE::getTypes(),OStatement_BASE2::getTypes());
+	return ::comphelper::concatSequences(OPreparedStatement_BASE::getTypes(),OCommonStatement::getTypes());
 }
 // -------------------------------------------------------------------------
 
 Reference< XResultSetMetaData > SAL_CALL OPreparedStatement::getMetaData(  ) throw(SQLException, RuntimeException)
 {
 	::osl::MutexGuard aGuard( m_aMutex );
-	checkDisposed(OStatement_BASE::rBHelper.bDisposed);
-    sal_Bool bReadOnly= sal_True;
-    if (m_pResultSet)
+	checkDisposed(OCommonStatement_IBASE::rBHelper.bDisposed);
+
+    sal_Bool bReadOnly = sal_True;
+    if ( m_pResultSet.is() )
         bReadOnly = m_pResultSet->determineReadOnly();
-	if(!m_xMetaData.is())
+    // if we do not have a result set, then we have not been executed, yet. In this case, assuming readonly=true is
+    // okay, /me thinks.
+
+	if ( !m_xMetaData.is() )
         m_xMetaData = new OResultSetMetaData( m_pSQLIterator->getSelectColumns(), m_pSQLIterator->getTables().begin()->first ,m_pTable,bReadOnly );
+
 	return m_xMetaData;
 }
+
 // -------------------------------------------------------------------------
-
-void SAL_CALL OPreparedStatement::close(  ) throw(SQLException, RuntimeException)
-{
-	::osl::MutexGuard aGuard( m_aMutex );
-	checkDisposed(OStatement_BASE::rBHelper.bDisposed);
-
-
-	// Reset last warning message
-
-	try {
-		clearWarnings ();
-        clearMyResultSet();
-		// OStatement_BASE2::close();
-	}
-	catch (SQLException &) {
-		// If we get an error, ignore
-	}
-
-	// Remove this Statement object from the Connection object's
-	// list
-}
-// -------------------------------------------------------------------------
-
 sal_Bool SAL_CALL OPreparedStatement::execute(  ) throw(SQLException, RuntimeException)
 {
 	::osl::MutexGuard aGuard( m_aMutex );
-	checkDisposed(OStatement_BASE::rBHelper.bDisposed);
+	checkDisposed(OCommonStatement_IBASE::rBHelper.bDisposed);
 
-
-    Reference< XResultSet> xRS = OStatement_Base::executeQuery( m_sSqlStatement );
-	// same as in statement with the difference that this statement also can contain parameter
-
-    OSL_TRACE("In/Out: OPreparedStatement::execute" );
-	return xRS.is();
+    Reference< XResultSet> xResult = executeQuery();
+	return xResult.is();
 }
 // -------------------------------------------------------------------------
 
 sal_Int32 SAL_CALL OPreparedStatement::executeUpdate(  ) throw(SQLException, RuntimeException)
 {
-	return 0;
+    ::dbtools::throwFeatureNotImplementedException( "XStatement::executeUpdate", *this );
+    return 0;
 }
 // -------------------------------------------------------------------------
 
 void SAL_CALL OPreparedStatement::setString( sal_Int32 parameterIndex, const ::rtl::OUString& x ) throw(SQLException, RuntimeException)
 {
 	::osl::MutexGuard aGuard( m_aMutex );
-	checkDisposed(OStatement_BASE::rBHelper.bDisposed);
+	checkDisposed(OCommonStatement_IBASE::rBHelper.bDisposed);
 
     OSL_TRACE("prepStmt::setString( %s )", OUtoCStr( x ) );
     setParameter( parameterIndex, x );
 Reference< XConnection > SAL_CALL OPreparedStatement::getConnection(  ) throw(SQLException, RuntimeException)
 {
 	::osl::MutexGuard aGuard( m_aMutex );
-	checkDisposed(OStatement_BASE::rBHelper.bDisposed);
+	checkDisposed(OCommonStatement_IBASE::rBHelper.bDisposed);
 
 	return (Reference< XConnection >)m_pConnection;
 }
 {
 	::osl::MutexGuard aGuard( m_aMutex );
     OSL_TRACE("In: OPreparedStatement::executeQuery" );
-	checkDisposed(OStatement_BASE::rBHelper.bDisposed);
+	checkDisposed(OCommonStatement_IBASE::rBHelper.bDisposed);
 
-	Reference< XResultSet > rs = OStatement_Base::executeQuery( m_sSqlStatement );
-
-    OSL_TRACE("Out: OPreparedStatement::executeQuery" );
-	return rs;
+    // our statement has already been parsed in lateInit, no need to do all this (potentially expensive)
+    // stuff again. Just execute.
+    return impl_executeCurrentQuery();
 }
 // -------------------------------------------------------------------------
 
 void SAL_CALL OPreparedStatement::setNull( sal_Int32 parameterIndex, sal_Int32 /*sqlType*/ ) throw(SQLException, RuntimeException)
 {
 	::osl::MutexGuard aGuard( m_aMutex );
-	checkDisposed(OStatement_BASE::rBHelper.bDisposed);
+	checkDisposed(OCommonStatement_IBASE::rBHelper.bDisposed);
 
     checkAndResizeParameters(parameterIndex);
 
 		case PROPERTY_ID_USEBOOKMARKS:
 			break;
 		default:
-			OStatement_Base::setFastPropertyValue_NoBroadcast(nHandle,rValue);
+			OCommonStatement::setFastPropertyValue_NoBroadcast(nHandle,rValue);
 	}
 }
 // -----------------------------------------------------------------------------
 // -----------------------------------------------------------------------------
 void OPreparedStatement::checkAndResizeParameters(sal_Int32 parameterIndex)
 {
-    ::connectivity::checkDisposed(OStatement_BASE::rBHelper.bDisposed);
+    ::connectivity::checkDisposed(OCommonStatement_IBASE::rBHelper.bDisposed);
 
     if ( !m_aParameterRow.isValid() ) {
         m_aParameterRow = new OValueVector();

File connectivity/source/drivers/mozab/MPreparedStatement.hxx

 										::com::sun::star::sdbc::XMultipleResults,
                                         ::com::sun::star::lang::XServiceInfo> OPreparedStatement_BASE;
 
-        class OPreparedStatement :  public  OStatement_BASE2,
+        class OPreparedStatement :  public  OCommonStatement,
                                     public  OPreparedStatement_BASE
         {
         protected:
             ::rtl::OUString                             m_sSqlStatement;
             ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSetMetaData >  m_xMetaData;
             sal_Bool                                    m_bPrepared;
-            OResultSet*                                 m_pResultSet;
+            ::rtl::Reference< OResultSet >              m_pResultSet;
             ::vos::ORef<connectivity::OSQLColumns>      m_xParamColumns;    // the parameter columns
             OValueRow                                   m_aParameterRow;
 
             virtual ~OPreparedStatement();
 
             virtual void SAL_CALL disposing();
-            virtual sal_Bool parseSql( const ::rtl::OUString& sql , sal_Bool bAdjusted = sal_False) throw ( 
-                           ::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException );
 
-			virtual OResultSet* createResultSet();
-			::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet> initResultSet();
+            // OCommonStatement overridables
+            virtual StatementType
+                            parseSql( const ::rtl::OUString& sql , sal_Bool bAdjusted = sal_False) throw ( ::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException );
+            virtual void    initializeResultSet( OResultSet* _pResult );
+            virtual void    clearCachedResultSet();
+            virtual void    cacheResultSet( const ::rtl::Reference< OResultSet >& _pResult );
 
-			void checkAndResizeParameters(sal_Int32 parameterIndex);
+
+            void checkAndResizeParameters(sal_Int32 parameterIndex);
 			void setParameter(sal_Int32 parameterIndex, const ORowSetValue& x);
 
-
 			sal_uInt32 AddParameter(connectivity::OSQLParseNode * pParameter, 
 								const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& _xCol);
 			void scanParameter(OSQLParseNode* pParseNode,::std::vector< OSQLParseNode*>& _rParaNodes);
 			void describeColumn(OSQLParseNode* _pParameter,OSQLParseNode* _pNode,const OSQLTable& _xTable);
 			void describeParameter();
 
-            virtual void initializeResultSet( OResultSet* _pResult );
-
         public:
             DECLARE_SERVICE_INFO();
             // ein Konstruktor, der fuer das Returnen des Objektes benoetigt wird:
             OPreparedStatement( OConnection* _pConnection,const ::rtl::OUString& sql);
-            sal_Bool lateInit();
+            void lateInit();
 
             //XInterface
             virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
             virtual void SAL_CALL setClob( sal_Int32 parameterIndex, const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XClob >& x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
             virtual void SAL_CALL setArray( sal_Int32 parameterIndex, const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XArray >& x ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
             virtual void SAL_CALL clearParameters(  ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
-            // XCloseable
-            virtual void SAL_CALL close(  ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
             // XResultSetMetaDataSupplier
             virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSetMetaData > SAL_CALL getMetaData(  ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
 			// XMultipleResults
             virtual sal_Bool SAL_CALL getMoreResults(  ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
 
         public:
-            using OStatement_Base::executeQuery;
-            using OStatement_Base::executeUpdate;
-            using OStatement_Base::execute;
+            using OCommonStatement::executeQuery;
+            using OCommonStatement::executeUpdate;
+            using OCommonStatement::execute;
         protected:
             using OPropertySetHelper::getFastPropertyValue;
         };

File connectivity/source/drivers/mozab/MResultSet.cxx

 }
 
 // -------------------------------------------------------------------------
-OResultSet::OResultSet(OStatement_Base* pStmt, const ::boost::shared_ptr< connectivity::OSQLParseTreeIterator >& _pSQLIterator )
+OResultSet::OResultSet(OCommonStatement* pStmt, const ::boost::shared_ptr< connectivity::OSQLParseTreeIterator >& _pSQLIterator )
 	: OResultSet_BASE(m_aMutex)
 	,OPropertySetHelper(OResultSet_BASE::rBHelper)
     ,m_pStatement(pStmt)
 {
     ResultSetEntryGuard aGuard( *this );
     OSL_TRACE("In/Out: OResultSet::close" );
-	// dispose();
+	dispose();
 }
 // -------------------------------------------------------------------------
 
 
     m_aQuery.setExpression( queryExpression );
 
-    // We need a unique id for caching mechanism so should fetch card:URI
-    m_aQuery.setAttributes( m_aAttributeStrings );
-
     rtl::OUString aStr(  m_pTable->getName() );
     m_aQuery.setAddressbook( aStr );
 

File connectivity/source/drivers/mozab/MResultSet.hxx

 							public	::comphelper::OPropertyArrayUsageHelper<OResultSet>
 		{
 		protected:
-			OStatement_Base*							m_pStatement;
+			OCommonStatement*							m_pStatement;
             ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface>			m_xStatement;
             ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSetMetaData>   m_xMetaData;
 			sal_uInt32									m_nRowPos;
 		public:
 			DECLARE_SERVICE_INFO();
 			
-            OResultSet(OStatement_Base* pStmt, const ::boost::shared_ptr< ::connectivity::OSQLParseTreeIterator >& _pSQLIterator );
+            OResultSet(OCommonStatement* pStmt, const ::boost::shared_ptr< ::connectivity::OSQLParseTreeIterator >& _pSQLIterator );
 			
 
 			::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > operator *()

File connectivity/source/drivers/mozab/MResultSetMetaData.cxx

     if ( m_pTable->getConnection()->isLDAP() )
     {
         const OColumnAlias& aAliases( m_pTable->getConnection()->getColumnAlias() );
-        OColumnAlias::ProgrammaticName eProgrammatic( aAliases.getProgrammaticNameIndex( sColumnName ) );
-        if  (   ( eProgrammatic == OColumnAlias::HOMECOUNTRY )
-            ||  ( eProgrammatic == OColumnAlias::WORKCOUNTRY )
-            )
-            // for those, we know that they're not searchable in the Mozilla/LDAP implementation.
-            // There might be more ...
+        if ( !aAliases.isColumnSearchable( sColumnName ) )
             return sal_False;
     }
 

File connectivity/source/drivers/mozab/MStatement.cxx

 #include <comphelper/property.hxx>
 #include <comphelper/uno3.hxx>
 #include <osl/thread.h>
+#include <tools/diagnose_ex.h>
 #include <com/sun/star/sdbc/ResultSetConcurrency.hpp>
 #include <com/sun/star/sdbc/ResultSetType.hpp>
 #include <com/sun/star/sdbc/FetchDirection.hpp>
 using namespace com::sun::star::io;
 using namespace com::sun::star::util;
 //------------------------------------------------------------------------------
-OStatement_Base::OStatement_Base(OConnection* _pConnection )
-    :OStatement_BASE(m_aMutex)
-    ,OPropertySetHelper(OStatement_BASE::rBHelper)
+OCommonStatement::OCommonStatement(OConnection* _pConnection )
+    :OCommonStatement_IBASE(m_aMutex)
+    ,OPropertySetHelper(OCommonStatement_IBASE::rBHelper)
+    ,OCommonStatement_SBASE((::cppu::OWeakObject*)_pConnection, this)
     ,m_xDBMetaData(_pConnection->getMetaData())
     ,m_pTable(NULL)
     ,m_pConnection(_pConnection)
     ,m_aParser(_pConnection->getDriver()->getMSFactory())
     ,m_pSQLIterator( new OSQLParseTreeIterator( _pConnection, _pConnection->createCatalog()->getTables(), m_aParser, NULL ) )
     ,m_pParseTree(NULL)
-    ,rBHelper(OStatement_BASE::rBHelper)
+    ,rBHelper(OCommonStatement_IBASE::rBHelper)
 {
 	m_pConnection->acquire();
-    OSL_TRACE("In/Out: OStatement_Base::OStatement_Base" );
+    OSL_TRACE("In/Out: OCommonStatement::OCommonStatement" );
 }
 // -----------------------------------------------------------------------------
-OStatement_Base::~OStatement_Base()
+OCommonStatement::~OCommonStatement()
 {
 }
+
 //------------------------------------------------------------------------------
-void OStatement_Base::disposeResultSet()
-{
-	// free the cursor if alive
-	Reference< XComponent > xComp(m_xResultSet.get(), UNO_QUERY);
-	if (xComp.is())
-		xComp->dispose();
-	m_xResultSet = Reference< XResultSet>();
-}
-//------------------------------------------------------------------------------
-void OStatement_BASE2::disposing()
+void OCommonStatement::disposing()
 {
 	::osl::MutexGuard aGuard(m_aMutex);
 
-	disposeResultSet();
+    clearWarnings();
+	clearCachedResultSet();
 
 	if (m_pConnection)
 		m_pConnection->release();
     m_pSQLIterator->dispose();
 
     dispose_ChildImpl();
-    OStatement_Base::disposing();
+    OCommonStatement_IBASE::disposing();
 }
 //-----------------------------------------------------------------------------
-void SAL_CALL OStatement_BASE2::release() throw()
+Any SAL_CALL OCommonStatement::queryInterface( const Type & rType ) throw(RuntimeException)
 {
-	relase_ChildImpl();
-}
-//-----------------------------------------------------------------------------
-Any SAL_CALL OStatement_Base::queryInterface( const Type & rType ) throw(RuntimeException)
-{
-	Any aRet = OStatement_BASE::queryInterface(rType);
+	Any aRet = OCommonStatement_IBASE::queryInterface(rType);
 	if(!aRet.hasValue())
 		aRet = OPropertySetHelper::queryInterface(rType);
 	return aRet;
 }
 // -------------------------------------------------------------------------
-Sequence< Type > SAL_CALL OStatement_Base::getTypes(  ) throw(RuntimeException)
+Sequence< Type > SAL_CALL OCommonStatement::getTypes(  ) throw(RuntimeException)
 {
 	::cppu::OTypeCollection aTypes(	::getCppuType( (const Reference< XMultiPropertySet > *)0 ),
 									::getCppuType( (const Reference< XFastPropertySet > *)0 ),
 									::getCppuType( (const Reference< XPropertySet > *)0 ));
 
-	return ::comphelper::concatSequences(aTypes.getTypes(),OStatement_BASE::getTypes());
+	return ::comphelper::concatSequences(aTypes.getTypes(),OCommonStatement_IBASE::getTypes());
 }
 // -------------------------------------------------------------------------
-void SAL_CALL OStatement_Base::close(  ) throw(SQLException, RuntimeException)
+void SAL_CALL OCommonStatement::close(  ) throw(SQLException, RuntimeException)
 {
 	{
 		::osl::MutexGuard aGuard( m_aMutex );
-		checkDisposed(OStatement_BASE::rBHelper.bDisposed);
-
+		checkDisposed(OCommonStatement_IBASE::rBHelper.bDisposed);
 	}
 	dispose();
 }
+
+
 // -------------------------------------------------------------------------
-
-void OStatement_Base::reset() throw (SQLException)
-{
-	::osl::MutexGuard aGuard( m_aMutex );
-	checkDisposed(OStatement_BASE::rBHelper.bDisposed);
-
-
-	clearWarnings ();
-
-	if (m_xResultSet.get().is())
-		clearMyResultSet();
-}
-//--------------------------------------------------------------------
-// clearMyResultSet
-// If a ResultSet was created for this Statement, close it
-//--------------------------------------------------------------------
-
-void OStatement_Base::clearMyResultSet () throw (SQLException)
-{
-	::osl::MutexGuard aGuard( m_aMutex );
-	checkDisposed(OStatement_BASE::rBHelper.bDisposed);
-
-    try
-    {
-	    Reference<XCloseable> xCloseable;
-	    if ( ::comphelper::query_interface( m_xResultSet.get(), xCloseable ) )
-		    xCloseable->close();
-    }
-    catch( const DisposedException& ) { }
-
-    m_xResultSet = Reference< XResultSet >();
-}
-
-void OStatement_Base::createTable( )
-    throw ( SQLException, RuntimeException )
+void OCommonStatement::createTable( ) throw ( SQLException, RuntimeException )
 {
     if(m_pParseTree)
     {
         getOwnConnection()->throwSQLException( STR_QUERY_TOO_COMPLEX, *this );
 }
 // -------------------------------------------------------------------------
-sal_Bool OStatement_Base::parseSql( const ::rtl::OUString& sql , sal_Bool bAdjusted)
+OCommonStatement::StatementType OCommonStatement::parseSql( const ::rtl::OUString& sql , sal_Bool bAdjusted)
     throw ( SQLException, RuntimeException )
 {
     ::rtl::OUString aErr;
 
-    OSL_TRACE("In/Out :: OStatement::parseSql(%s)\n", OUtoCStr( sql ) );
-
     m_pParseTree = m_aParser.parseTree(aErr,sql);
 
 #if OSL_DEBUG_LEVEL > 0
             createColumnMapping();
 
             analyseSQL();
-            break;
+            return eSelect;
+
         case SQL_STATEMENT_CREATE_TABLE:
             createTable();
-			return sal_False;
+			return eCreateTable;
+
         default:
-            getOwnConnection()->throwSQLException( STR_QUERY_TOO_COMPLEX, *this );
+            break;
         }
     }
     else if(!bAdjusted) //Our sql parser does not support a statement like "create table foo"
     {
         return parseSql(sql + ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("(""E-mail"" caracter)")),sal_True);
     }
-    else
-        getOwnConnection()->throwSQLException( STR_QUERY_TOO_COMPLEX, *this );
-	return sal_True;
+
+    getOwnConnection()->throwSQLException( STR_QUERY_TOO_COMPLEX, *this );
+    OSL_ENSURE( false, "OCommonStatement::parseSql: unreachable!" );
+    return eSelect;
 
 }
 // -------------------------------------------------------------------------
+Reference< XResultSet > OCommonStatement::impl_executeCurrentQuery()
+{
+    clearCachedResultSet();
 
-OResultSet* OStatement_Base::createResultSet()
+    ::rtl::Reference< OResultSet > pResult( new OResultSet( this, m_pSQLIterator ) );
+    initializeResultSet( pResult.get() );
+
+    pResult->executeQuery();
+    cacheResultSet( pResult );  // only cache if we survived the execution
+
+    return pResult.get();
+
+}
+
+// -------------------------------------------------------------------------
+void OCommonStatement::initializeResultSet( OResultSet* _pResult )
 {
-    return new OResultSet( this, m_pSQLIterator );
-}
-// -------------------------------------------------------------------------
+    ENSURE_OR_THROW( _pResult, "invalid result set" );
 
-void OStatement_Base::initializeResultSet( OResultSet* _pResult )
-{
-	OSL_TRACE("In : initializeResultSet");
     _pResult->setColumnMapping(m_aColMapping);
     _pResult->setOrderByColumns(m_aOrderbyColumnNumber);
     _pResult->setOrderByAscending(m_aOrderbyAscending);
     _pResult->setBindingRow(m_aRow);
     _pResult->setTable(m_pTable);
-	OSL_TRACE("Out : initializeResultSet");
 }
 
 // -------------------------------------------------------------------------
-sal_Bool SAL_CALL OStatement_Base::execute( const ::rtl::OUString& sql ) throw(SQLException, RuntimeException)
+void OCommonStatement::clearCachedResultSet()
+{
+    Reference< XResultSet > xResultSet( m_xResultSet.get(), UNO_QUERY );
+    if ( !xResultSet.is() )
+        return;
+
+    try
+    {
+	    Reference< XCloseable > xCloseable( xResultSet, UNO_QUERY_THROW );
+	    xCloseable->close();
+    }
+    catch( const DisposedException& )
+    {
+        DBG_UNHANDLED_EXCEPTION();
+    }
+
+    m_xResultSet = Reference< XResultSet >();
+}
+
+// -------------------------------------------------------------------------
+void OCommonStatement::cacheResultSet( const ::rtl::Reference< OResultSet >& _pResult )
+{
+    ENSURE_OR_THROW( _pResult.is(), "invalid result set" );
+    m_xResultSet = Reference< XResultSet >( _pResult.get() );
+}
+
+// -------------------------------------------------------------------------
+sal_Bool SAL_CALL OCommonStatement::execute( const ::rtl::OUString& sql ) throw(SQLException, RuntimeException)
 {
 	::osl::MutexGuard aGuard( m_aMutex );
-	checkDisposed(OStatement_BASE::rBHelper.bDisposed);
+	checkDisposed(OCommonStatement_IBASE::rBHelper.bDisposed);
 
     OSL_TRACE("Statement::execute( %s )", OUtoCStr( sql ) );
 
 }
 // -------------------------------------------------------------------------
 
-Reference< XResultSet > SAL_CALL OStatement_Base::executeQuery( const ::rtl::OUString& sql ) throw(SQLException, RuntimeException)
+Reference< XResultSet > SAL_CALL OCommonStatement::executeQuery( const ::rtl::OUString& sql ) throw(SQLException, RuntimeException)
 {
 	::osl::MutexGuard aGuard( m_ThreadMutex );
-	checkDisposed(OStatement_BASE::rBHelper.bDisposed);
+	checkDisposed(OCommonStatement_IBASE::rBHelper.bDisposed);
 
     OSL_TRACE("Statement::executeQuery( %s )", OUtoCStr( sql ) );
 
-    if (!parseSql( sql )) //parseSql return false means this sql is a create table statement
+    // parse the statement
+    StatementType eStatementType = parseSql( sql );
+    if ( eStatementType != eSelect )
 		return NULL;
 
-    OResultSet* pResult = createResultSet();
-	Reference< XResultSet > xRS = pResult;
-    initializeResultSet( pResult );
-
-    pResult->executeQuery();
-	m_xResultSet = xRS; // we need a reference to it for later use
-
-	return xRS;
+    return impl_executeCurrentQuery();
 }
 // -------------------------------------------------------------------------
 
-Reference< XConnection > SAL_CALL OStatement_Base::getConnection(  ) throw(SQLException, RuntimeException)
+Reference< XConnection > SAL_CALL OCommonStatement::getConnection(  ) throw(SQLException, RuntimeException)
 {
 	::osl::MutexGuard aGuard( m_aMutex );
-	checkDisposed(OStatement_BASE::rBHelper.bDisposed);
+	checkDisposed(OCommonStatement_IBASE::rBHelper.bDisposed);
 
 	// just return our connection here
 	return (Reference< XConnection >)m_pConnection;
 {
 	Any aRet = ::cppu::queryInterface(rType,static_cast< XServiceInfo*> (this));
 	if(!aRet.hasValue())
-		aRet = OStatement_Base::queryInterface(rType);
+		aRet = OCommonStatement::queryInterface(rType);
 	return aRet;
 }
 // -------------------------------------------------------------------------
-sal_Int32 SAL_CALL OStatement_Base::executeUpdate( const ::rtl::OUString& /*sql*/ ) throw(SQLException, RuntimeException)
+sal_Int32 SAL_CALL OCommonStatement::executeUpdate( const ::rtl::OUString& /*sql*/ ) throw(SQLException, RuntimeException)
 {
-    ::dbtools::throwFeatureNotImplementedException( "XPreparedStatement::executeUpdate", *this );
+    ::dbtools::throwFeatureNotImplementedException( "XStatement::executeUpdate", *this );
 	return 0;
 
 }
 // -------------------------------------------------------------------------
-Any SAL_CALL OStatement_Base::getWarnings(  ) throw(SQLException, RuntimeException)
+Any SAL_CALL OCommonStatement::getWarnings(  ) throw(SQLException, RuntimeException)
 {
 	::osl::MutexGuard aGuard( m_aMutex );
-	checkDisposed(OStatement_BASE::rBHelper.bDisposed);
+	checkDisposed(OCommonStatement_IBASE::rBHelper.bDisposed);
 
 	return makeAny(m_aLastWarning);
 }
 // -------------------------------------------------------------------------
 
 // -------------------------------------------------------------------------
-void SAL_CALL OStatement_Base::clearWarnings(  ) throw(SQLException, RuntimeException)
+void SAL_CALL OCommonStatement::clearWarnings(  ) throw(SQLException, RuntimeException)
 {
 	::osl::MutexGuard aGuard( m_aMutex );
-	checkDisposed(OStatement_BASE::rBHelper.bDisposed);
+	checkDisposed(OCommonStatement_IBASE::rBHelper.bDisposed);
 
 
 	m_aLastWarning = SQLWarning();
 }
 // -------------------------------------------------------------------------
-::cppu::IPropertyArrayHelper* OStatement_Base::createArrayHelper( ) const
+::cppu::IPropertyArrayHelper* OCommonStatement::createArrayHelper( ) const
 {
 	// this properties are define by the service resultset
 	// they must in alphabetic order
 }
 
 // -------------------------------------------------------------------------
-::cppu::IPropertyArrayHelper & OStatement_Base::getInfoHelper()
+::cppu::IPropertyArrayHelper & OCommonStatement::getInfoHelper()
 {
-	return *const_cast<OStatement_Base*>(this)->getArrayHelper();
+	return *const_cast<OCommonStatement*>(this)->getArrayHelper();
 }
 // -------------------------------------------------------------------------
-sal_Bool OStatement_Base::convertFastPropertyValue(
+sal_Bool OCommonStatement::convertFastPropertyValue(
 							Any & /*rConvertedValue*/,
 							Any & /*rOldValue*/,
 							sal_Int32 /*nHandle*/,
 	return bConverted;
 }
 // -------------------------------------------------------------------------
-void OStatement_Base::setFastPropertyValue_NoBroadcast(sal_Int32 nHandle,const Any& /*rValue*/) throw (Exception)
+void OCommonStatement::setFastPropertyValue_NoBroadcast(sal_Int32 nHandle,const Any& /*rValue*/) throw (Exception)
 {
 	// set the value to what ever is nescessary
 	switch(nHandle)
 	}
 }
 // -------------------------------------------------------------------------
-void OStatement_Base::getFastPropertyValue(Any& /*rValue*/,sal_Int32 nHandle) const
+void OCommonStatement::getFastPropertyValue(Any& /*rValue*/,sal_Int32 nHandle) const
 {
 	switch(nHandle)
 	{
 // -------------------------------------------------------------------------
 IMPLEMENT_SERVICE_INFO(OStatement,"com.sun.star.sdbcx.OStatement","com.sun.star.sdbc.Statement");
 // -----------------------------------------------------------------------------
-void SAL_CALL OStatement_Base::acquire() throw()
+void SAL_CALL OCommonStatement::acquire() throw()
 {
-	OStatement_BASE::acquire();
+	OCommonStatement_IBASE::acquire();
 }
 // -----------------------------------------------------------------------------
-void SAL_CALL OStatement_Base::release() throw()
+void SAL_CALL OCommonStatement::release() throw()
 {
-	OStatement_BASE::release();
+	relase_ChildImpl();
 }
 // -----------------------------------------------------------------------------
 void SAL_CALL OStatement::acquire() throw()
 {
-	OStatement_BASE2::acquire();
+	OCommonStatement::acquire();
 }
 // -----------------------------------------------------------------------------
 void SAL_CALL OStatement::release() throw()
 {
-	OStatement_BASE2::release();
+	OCommonStatement::release();
 }
 // -----------------------------------------------------------------------------
-Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL OStatement_Base::getPropertySetInfo(  ) throw(RuntimeException)
+Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL OCommonStatement::getPropertySetInfo(  ) throw(RuntimeException)
 {
 	return ::cppu::OPropertySetHelper::createPropertySetInfo(getInfoHelper());
 }
 // -----------------------------------------------------------------------------
-void OStatement_Base::createColumnMapping()
+void OCommonStatement::createColumnMapping()
 {
     size_t i;
 
 }
 // -----------------------------------------------------------------------------
 
-void OStatement_Base::analyseSQL()
+void OCommonStatement::analyseSQL()
 {
 	const OSQLParseNode* pOrderbyClause = m_pSQLIterator->getOrderTree();
 	if(pOrderbyClause)
 	}
 }
 //------------------------------------------------------------------
-void OStatement_Base::setOrderbyColumn(	OSQLParseNode* pColumnRef,
+void OCommonStatement::setOrderbyColumn(	OSQLParseNode* pColumnRef,
 										OSQLParseNode* pAscendingDescending)
 {
 	::rtl::OUString aColumnName;

File connectivity/source/drivers/mozab/MStatement.hxx

 
         typedef ::cppu::WeakComponentImplHelper3<	::com::sun::star::sdbc::XStatement,
                                                     ::com::sun::star::sdbc::XWarningsSupplier,
-                                                    ::com::sun::star::sdbc::XCloseable> OStatement_BASE;
+                                                    ::com::sun::star::sdbc::XCloseable> OCommonStatement_IBASE;
 
 		//**************************************************************
-		//************ Class: OStatement_Base
+		//************ Class: OCommonStatement
 		// is a base class for the normal statement and for the prepared statement
 		//**************************************************************
-		class OStatement_Base		:	public comphelper::OBaseMutex,
-										public	OStatement_BASE,
-										public	::cppu::OPropertySetHelper,
-										public	::comphelper::OPropertyArrayUsageHelper<OStatement_Base>
+        class OCommonStatement;
+		typedef ::connectivity::OSubComponent< OCommonStatement, OCommonStatement_IBASE >  OCommonStatement_SBASE;
 
+		class OCommonStatement  :public comphelper::OBaseMutex
+								,public	OCommonStatement_IBASE
+								,public	::cppu::OPropertySetHelper
+								,public	::comphelper::OPropertyArrayUsageHelper< OCommonStatement >
+                                ,public OCommonStatement_SBASE
 		{
-        ::com::sun::star::sdbc::SQLWarning                            m_aLastWarning;
-		protected:
-			::com::sun::star::uno::WeakReference< ::com::sun::star::sdbc::XResultSet>    m_xResultSet;   // The last ResultSet created
+			friend class ::connectivity::OSubComponent< OCommonStatement, OCommonStatement_IBASE >;
+
+        private:
+            ::com::sun::star::sdbc::SQLWarning                            m_aLastWarning;
+
+        protected:
+			::com::sun::star::uno::WeakReference< ::com::sun::star::sdbc::XResultSet >   m_xResultSet;
             ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData> m_xDBMetaData;
             ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess>  m_xColNames; // table columns
 
 
 		protected:
 
-			void disposeResultSet();
-
 			// OPropertyArrayUsageHelper
 			virtual ::cppu::IPropertyArrayHelper* createArrayHelper( ) const;
 			// OPropertySetHelper
 			virtual void SAL_CALL getFastPropertyValue(
 																::com::sun::star::uno::Any& rValue,
 																sal_Int32 nHandle) const;
-			virtual ~OStatement_Base();
+			virtual ~OCommonStatement();
 
         protected:
             //
             // Driver Internal Methods
             //
-            virtual sal_Bool parseSql( const ::rtl::OUString& sql , sal_Bool bAdjusted = sal_False) throw ( 
-                        ::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException );
+            enum StatementType { eSelect, eCreateTable };
+            /** called to do the parsing of a to-be-executed SQL statement, and set all members as needed
+            */
+            virtual StatementType
+                            parseSql( const ::rtl::OUString& sql , sal_Bool bAdjusted = sal_False) throw ( ::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException );
+            /** called to initialize a result set, according to a previously parsed SQL statement
+            */
+            virtual void    initializeResultSet( OResultSet* _pResult );
+            /** called when a possible cached instance of our last result set should be cleared
+            */
+            virtual void    clearCachedResultSet();
+            /** caches a result set which has just been created by an execution of an SQL statement
+            */
+            virtual void    cacheResultSet( const ::rtl::Reference< OResultSet >& _pResult );
 
-            OResultSet*  createResultSet();
-            virtual void initializeResultSet( OResultSet* _pResult );
+
+            /** executes the current query (the one which has been passed to the last parseSql call)
+            */
+            ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet >
+                            impl_executeCurrentQuery();
+
             void         createColumnMapping();
             void         analyseSQL();
             void         setOrderbyColumn( connectivity::OSQLParseNode* pColumnRef,
                                            connectivity::OSQLParseNode* pAscendingDescending);
-            void         reset () throw( ::com::sun::star::sdbc::SQLException);
-            void         clearMyResultSet () throw( ::com::sun::star::sdbc::SQLException);
             virtual void createTable(  ) throw ( 
                         ::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException );
 
 			// other methods
 			OConnection* getOwnConnection() const { return m_pConnection;}
 
-			OStatement_Base(OConnection* _pConnection );
-			using OStatement_BASE::operator ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >;
+			OCommonStatement(OConnection* _pConnection );
+			using OCommonStatement_IBASE::operator ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >;
 
 			// OComponentHelper
-			virtual void SAL_CALL disposing(void){OStatement_BASE::disposing();}
+            virtual void SAL_CALL disposing(void);
+
 			// XInterface
             virtual void SAL_CALL release() throw();
 			virtual void SAL_CALL acquire() throw();
             using OPropertySetHelper::getFastPropertyValue;
 		};
 
-		class OStatement_BASE2	:public OStatement_Base
-								,public ::connectivity::OSubComponent<OStatement_BASE2, OStatement_BASE>
-
-		{
-			friend class OSubComponent<OStatement_BASE2, OStatement_BASE>;
-		public:
-			OStatement_BASE2(OConnection* _pConnection ) :  OStatement_Base(_pConnection ),
-									::connectivity::OSubComponent<OStatement_BASE2, OStatement_BASE>((::cppu::OWeakObject*)_pConnection, this){}
-			// OComponentHelper
-			virtual void SAL_CALL disposing(void);
-			// XInterface
-            virtual void SAL_CALL release() throw();
-		};
-
-		class OStatement :	public OStatement_BASE2,
+		class OStatement :	public OCommonStatement,
                             public ::com::sun::star::lang::XServiceInfo
 		{
 		protected:
 			~OStatement(){}
 		public:
 			// ein Konstruktor, der fuer das Returnen des Objektes benoetigt wird:
-			OStatement( OConnection* _pConnection) : OStatement_BASE2( _pConnection){}
+			OStatement( OConnection* _pConnection) : OCommonStatement( _pConnection){}
 			DECLARE_SERVICE_INFO();
 
             virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);

File connectivity/source/drivers/mozab/bootstrap/MMozillaBootstrap.cxx

 
 // MARKER(update_precomp.py): autogen include statement, do not remove
 #include "precompiled_connectivity.hxx"
+
 #include "MMozillaBootstrap.hxx"
 
 using namespace com::sun::star::uno;

File connectivity/source/drivers/mozab/bootstrap/MNSInit.cxx

 
 #include "mozilla_nsinit.h"
 
+#include <MNSInit.hxx>
+
 #include <sal/types.h>
 #include <osl/diagnose.h>
 #include <osl/conditn.hxx>
 #include <osl/file.hxx>
 #include <rtl/bootstrap.hxx>
-#include <MNSInit.hxx>
 
 #ifndef CONNECTIVITY_MOZAB_MCONFIGACCESS_HXX
 #include "MConfigAccess.hxx"
 	const PRUnichar* pUsedProfile = *_pValidProfiles;
 
 	// have a look what the configuration suggests as preferred profile
-	const PRUnichar* pPreferredProfile = static_cast< const PRUnichar* >( getUserProfile( ) );
+	// PRUnichar != sal_Unicode in mingw
+	const PRUnichar* pPreferredProfile = reinterpret_cast_mingw_only< const PRUnichar* >( getUserProfile( ) );
 	if ( pPreferredProfile && *pPreferredProfile )
 	{
 		PRUnichar const* const* pLoop = _pValidProfiles;

File connectivity/source/drivers/mozab/bootstrap/MNSProfile.cxx

     NS_ENSURE_ARG_POINTER(profileName);
     NS_ENSURE_ARG_POINTER(exists);
 
-	*exists = xMozillaBootstrap->getProfileExists(xMozillaBootstrap->getCurrentProduct(),profileName);
+	// PRUnichar != sal_Unicode in mingw
+	*exists = xMozillaBootstrap->getProfileExists(xMozillaBootstrap->getCurrentProduct(),reinterpret_cast_mingw_only<const sal_Unicode *>(profileName));
     return NS_OK;
 }
 // Returns the name of the current profile i.e., the last used profile
 
     nsresult rv = NS_OK;
 
-	rtl::OUString path = xMozillaBootstrap->getProfilePath(xMozillaBootstrap->getCurrentProduct(),profileName);
+	// PRUnichar != sal_Unicode in mingw
+	rtl::OUString path = xMozillaBootstrap->getProfilePath(xMozillaBootstrap->getCurrentProduct(),reinterpret_cast_mingw_only<const sal_Unicode *>(profileName));
 
     nsCOMPtr<nsILocalFile>  localFile;
-	nsAutoString filePath(path.getStr());
+	// PRUnichar != sal_Unicode in mingw
+	nsAutoString filePath(reinterpret_cast_mingw_only<const PRUnichar *>(path.getStr()));
 
 	rv = NS_NewLocalFile(filePath, PR_TRUE,
                                    getter_AddRefs(localFile));

File connectivity/source/drivers/mozab/bootstrap/MNSProfileDiscover.cxx

 				nsAutoString path;
 				nsresult rv = profilePath->GetPath(path);
 				NS_ENSURE_SUCCESS(rv, ::rtl::OUString());
-				return ::rtl::OUString(path.get());
+				// PRUnichar != sal_Unicode in mingw
+				return ::rtl::OUString(reinterpret_cast_mingw_only<const sal_Unicode *>(path.get()));
 			}
 			else
                 return ::rtl::OUString();
 			//step 1 : get mozilla registry file
 			nsCOMPtr<nsILocalFile>  localFile;
 			::rtl::OUString regDir( getRegistryFileName( MozillaProductType_Mozilla ) );
-			nsAutoString registryDir(regDir.getStr());
+			// PRUnichar != sal_Unicode in mingw
+			nsAutoString registryDir(reinterpret_cast_mingw_only<const PRUnichar *>(regDir.getStr()));
 			rv = NS_NewLocalFile(registryDir, PR_TRUE,
                                 getter_AddRefs(localFile));
 			NS_ENSURE_SUCCESS(rv,rv);
 			
 			//step 3:Enumerator it
 			rv = registry->GetKey(nsIRegistry::Common,
-						szProfileSubtreeString.getStr(),
+						// PRUnichar != sal_Unicode in mingw
+						reinterpret_cast_mingw_only<const PRUnichar *>(szProfileSubtreeString.getStr()),
 						&profilesTreeKey);
 	        if (NS_FAILED(rv)) return rv;
 
 
 			// Get the current profile
 			rv = registry->GetString(profilesTreeKey,
-							szCurrentProfileString.getStr(),
+							// PRUnichar != sal_Unicode in mingw
+							reinterpret_cast_mingw_only<const PRUnichar *>(szCurrentProfileString.getStr()),
 							getter_Copies(tmpCurrentProfile));
 
 			if (tmpCurrentProfile)
 			{
-				m_Product.setCurrentProfile ( NS_STATIC_CAST(const PRUnichar*, tmpCurrentProfile));
+				// PRUnichar != sal_Unicode in mingw
+				m_Product.setCurrentProfile ( reinterpret_cast_mingw_only<const sal_Unicode *>(NS_STATIC_CAST(const PRUnichar*, tmpCurrentProfile)));
 			}
 
 
 
 				nsXPIDLString regData;
 				rv = registry->GetString(profKey,
-						szDirectoryString.getStr(),
+						// PRUnichar != sal_Unicode in mingw
+						reinterpret_cast_mingw_only<const PRUnichar *>(szDirectoryString.getStr()),
 						getter_Copies(regData));
 				if (NS_FAILED(rv)) continue;
 
 				//Add found profile to profile lists
 				if (NS_SUCCEEDED(rv) && tempLocal)
 				{
-					ProfileStruct*  profileItem     = new ProfileStruct(MozillaProductType_Mozilla,NS_STATIC_CAST(const PRUnichar*, profile),tempLocal);
+					// PRUnichar != sal_Unicode in mingw
+					ProfileStruct*  profileItem     = new ProfileStruct(MozillaProductType_Mozilla,reinterpret_cast_mingw_only<const sal_Unicode *>(NS_STATIC_CAST(const PRUnichar*, profile)),tempLocal);
 					m_Product.mProfileList[profileItem->getProfileName()] = profileItem;
 				}
 
 					nsCAutoString filePath(sPath.getStr());
 	
 					if (isRelative) {
-						nsAutoString registryDir( regDir.getStr() );
+						// PRUnichar != sal_Unicode in mingw
+						nsAutoString registryDir( reinterpret_cast_mingw_only<const PRUnichar *>(regDir.getStr()) );
 						nsCOMPtr<nsILocalFile>     mAppData;
 						rv = NS_NewLocalFile(registryDir, PR_TRUE,
 										getter_AddRefs(mAppData));
 			if (!path.getLength())
 				return sal_True;
 
-			nsAutoString filePath(path.getStr());
+			// PRUnichar != sal_Unicode in mingw
+			nsAutoString filePath(reinterpret_cast_mingw_only<const PRUnichar *>(path.getStr()));
 
 			nsresult rv;
 			nsCOMPtr<nsILocalFile>  localFile;

File connectivity/source/drivers/mozab/bootstrap/MNSProfileManager.cxx

 				rv = theProfile->GetCurrentProfile(getter_Copies(currentProfileStr));
 			    if (NS_FAILED(rv) || currentProfileStr.get() == nsnull)
 					return ::rtl::OUString();
-				return ::rtl::OUString(currentProfileStr.get());
+				// PRUnichar != sal_Unicode in mingw
+				return ::rtl::OUString(reinterpret_cast_mingw_only<const sal_Unicode *>(currentProfileStr.get()));
 			}
 			::rtl::OUString ProfileManager::setCurrentProfile( ::com::sun::star::mozilla::MozillaProductType product, const ::rtl::OUString& profileName ) throw (::com::sun::star::uno::RuntimeException)
 			{
 				nsCOMPtr<nsIProfile> theProfile(do_GetService(NS_PROFILE_CONTRACTID,&rv));
                 if (NS_FAILED(rv)) return ::rtl::OUString();
 
-				const PRUnichar* pUsedProfile = profileName.getStr();
+				// PRUnichar != sal_Unicode in mingw
+				const PRUnichar* pUsedProfile = reinterpret_cast_mingw_only<const PRUnichar *>(profileName.getStr());
 				//set current profile
 				rv = theProfile->SetCurrentProfile( pUsedProfile );
 				if (NS_FAILED(rv)) return ::rtl::OUString();

File connectivity/source/drivers/mozab/bootstrap/makefile.mk

 	$(SLO)$/MNSProfileDirServiceProvider.obj
 .ENDIF
 
+CDEFS     += -DMOZILLA_INTERNAL_API
+
 .IF "$(GUI)"=="UNX"
 .IF "$(COMNAME)"=="sunpro5"
 CFLAGS += -features=tmplife
 CFLAGSCXX += \
             -fno-rtti -Wconversion -Wpointer-arith \
             -Wcast-align -Woverloaded-virtual -Wsynth \
-            -Wno-long-long
+            -Wno-long-long -Wno-deprecated
 CDEFS     += -DTRACING
 .ENDIF
 

File connectivity/source/drivers/mozab/makefile.mk

 
 .IF "$(OS)"=="WNT" 
 .IF "$(COM)"=="GCC"
-MOZ_LIB_XPCOM= -L$(MOZ_LIB) -lembed_base_s -lnspr4 -lmozreg_s -lxpcom
+MOZ_LIB_XPCOM= -L$(MOZ_LIB) -lembed_base_s -lnspr4 -lmozreg_s -lxpcom -lxpcom_core
 .ELSE
 LIB += $(MOZ_LIB)
-MOZ_LIB_XPCOM= $(MOZ_EMBED_LIB) $(MOZ_LIB)$/nspr4.lib $(MOZ_REG_LIB) $(MOZ_LIB)$/xpcom.lib
+MOZ_LIB_XPCOM= $(MOZ_EMBED_LIB) $(MOZ_LIB)$/nspr4.lib $(MOZ_REG_LIB) $(MOZ_LIB)$/xpcom.lib $(MOZ_LIB)$/xpcom_core.lib
 .ENDIF
 .ELSE "$(OS)"=="WNT" 
-MOZ_LIB_XPCOM= -L$(MOZ_LIB) -lembed_base_s -lnspr4 -lmozreg_s -lxpcom
+MOZ_LIB_XPCOM= -L$(MOZ_LIB) -lnspr4 -lxpcom_core -lmozreg_s -lembed_base_s
 .ENDIF
 #End of mozilla specific stuff.
 
 	$(SLO)$/MNSINIParser.obj	\
 	$(SLO)$/MNSRunnable.obj	\
 	$(SLO)$/MNSProfile.obj					\
-	$(SLO)$/MNSProfileDirServiceProvider.obj
+	$(SLO)$/MNSProfileDirServiceProvider.obj    \
+	$(SLO)$/MLdapAttributeMap.obj
 
 
 SLO2FILES=\

File connectivity/source/drivers/mozab/mozillasrc/MDatabaseMetaDataHelper.cxx

 #include <osl/mutex.hxx>
 #include <osl/conditn.hxx>
 
+#include <nsIAbDirFactoryService.h>
 #include <MNSInit.hxx>
 #include <MNameMapper.hxx>
 #include "MNSMozabProxy.hxx"
 #include <MNSDeclares.hxx>
+
 static ::osl::Mutex	m_aMetaMutex;
 
 #include <osl/diagnose.h>

File connectivity/source/drivers/mozab/mozillasrc/MNSInclude.hxx

 #include <nsCOMPtr.h>
 #include <nsISupportsArray.h>
 #include <nsString.h>
+
 #if defined __SUNPRO_CC
 #pragma disable_warn
     // somewhere in the files included directly or indirectly in nsString.h, warnings are enabled, again
 #include <nsIAbDirectoryQueryProxy.h>
 #include <nsIAbDirFactory.h>
 #include <nsIRunnable.h>
+#include <nsIAbLDAPAttributeMap.h>
+#include <nsILDAPMessage.h>
 
 #include <prerr.h>
 

File connectivity/source/drivers/mozab/mozillasrc/MNSMozabProxy.cxx