1 --- connectivity/source/drivers/mozab/mozillasrc/MLdapAttributeMap.cxx (.../tags/DEV300_m41/connectivity) (revision 0)
2 +++ connectivity/source/drivers/mozab/mozillasrc/MLdapAttributeMap.cxx (.../cws/moz2seamonkey01/connectivity) (revision 269329)
4 +/*************************************************************************
5 +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
7 +* Copyright 2008 by Sun Microsystems, Inc.
9 +* OpenOffice.org - a multi-platform office productivity suite
15 +* This file is part of OpenOffice.org.
17 +* OpenOffice.org is free software: you can redistribute it and/or modify
18 +* it under the terms of the GNU Lesser General Public License version 3
19 +* only, as published by the Free Software Foundation.
21 +* OpenOffice.org is distributed in the hope that it will be useful,
22 +* but WITHOUT ANY WARRANTY; without even the implied warranty of
23 +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 +* GNU Lesser General Public License version 3 for more details
25 +* (a copy is included in the LICENSE file that accompanied this code).
27 +* You should have received a copy of the GNU Lesser General Public License
28 +* version 3 along with OpenOffice.org. If not, see
29 +* <http://www.openoffice.org/license.html>
30 +* for a copy of the LGPLv3 License.
31 +************************************************************************/
33 +// MARKER(update_precomp.py): autogen include statement, do not remove
34 +#include "precompiled_connectivity.hxx"
36 +#include <rtl/strbuf.hxx>
37 + // keep this include at the beginning. Some of the other includes seems to inject a symbol "l" into the
38 + // global namespace, which leads to a compiler warning in strbuf.hxx, about some parameters named "l"
39 + // hiding objects "in an outer scope".
41 +#include "MLdapAttributeMap.hxx"
42 +#include "MTypeConverter.hxx"
43 +#include "MQueryHelper.hxx"
45 +#include <tools/diagnose_ex.h>
49 +//........................................................................
50 +namespace connectivity { namespace mozab {
51 +//........................................................................
53 + //====================================================================
55 + //====================================================================
58 + typedef nsresult (NS_STDCALL nsIAbCard::*CardPropertyGetter)( PRUnichar** aFirstName );
59 + typedef nsresult (NS_STDCALL nsIAbCard::*CardPropertySetter)( const PRUnichar* aFirstName );
60 + struct CardPropertyData
62 + const sal_Char* pLDAPAttributeList;
63 + CardPropertyGetter PropGetter;
64 + CardPropertySetter PropSetter;
67 + :pLDAPAttributeList( NULL )
72 + CardPropertyData( const sal_Char* _pLDAPAttributeList, CardPropertyGetter _PropGetter, CardPropertySetter _PropSetter )
73 + :pLDAPAttributeList( _pLDAPAttributeList )
74 + ,PropGetter( _PropGetter )
75 + ,PropSetter( _PropSetter )
80 + typedef ::std::hash_map< ::rtl::OString, CardPropertyData, ::rtl::OStringHash > MapPropertiesToAttributes;
82 + #define DEF_CARD_ACCESS( PropertyName ) \
83 + &nsIAbCard::Get##PropertyName, &nsIAbCard::Set##PropertyName
85 + static const MapPropertiesToAttributes& lcl_getPropertyMap()
87 + static MapPropertiesToAttributes aMap;
92 + const sal_Char* pAsciiPropertyName;
93 + const sal_Char* pAsciiAttrributeList;
94 + CardPropertyGetter PropGetter;
95 + CardPropertySetter PropSetter;
97 + const MapEntry aEntries[] = {
98 + { "FirstName", "givenname", DEF_CARD_ACCESS( FirstName ) },
99 + { "LastName", "sn,surnname", DEF_CARD_ACCESS( LastName ) },
100 + { "DisplayName", "cn,commonname,displayname", DEF_CARD_ACCESS( DisplayName ) },
101 + { "NickName", "xmozillanickname", DEF_CARD_ACCESS( NickName ) },
102 + { "PrimaryEmail", "mail", DEF_CARD_ACCESS( PrimaryEmail ) },
103 + { "SecondEmail", "xmozillasecondemail", DEF_CARD_ACCESS( SecondEmail ) },
104 + { "WorkPhone", "telephonenumber", DEF_CARD_ACCESS( WorkPhone ) },
105 + { "HomePhone", "homephone", DEF_CARD_ACCESS( HomePhone ) },
106 + { "FaxNumber", "fax,facsimiletelephonenumber", DEF_CARD_ACCESS( FaxNumber ) },
107 + { "PagerNumber", "pager,pagerphone", DEF_CARD_ACCESS( PagerNumber ) },
108 + { "CellularNumber", "mobile,cellphone,carphone", DEF_CARD_ACCESS( CellularNumber ) },
109 + { "HomeAddress", "homepostaladdress,mozillaHomeStreet", DEF_CARD_ACCESS( HomeAddress ) },
110 + { "HomeAddress2", "mozillaHomeStreet2", DEF_CARD_ACCESS( HomeAddress2 ) },
111 + { "HomeCity", "homelocality,mozillaHomeLocalityName", DEF_CARD_ACCESS( HomeCity ) },
112 + { "HomeState", "homeregion,mozillaHomeState", DEF_CARD_ACCESS( HomeState ) },
113 + { "HomeZipCode", "homepostalcode,mozillaHomePostalCode", DEF_CARD_ACCESS( HomeZipCode ) },
114 + { "HomeCountry", "homecountryname,mozillaHomeCountryName", DEF_CARD_ACCESS( HomeCountry ) },
115 + { "WorkAddress", "postofficebox,streetaddress,streetaddress1", DEF_CARD_ACCESS( WorkAddress ) },
116 + { "WorkAddress2", "streetaddress2", DEF_CARD_ACCESS( WorkAddress2 ) },
117 + { "WorkCity", "l,locality", DEF_CARD_ACCESS( WorkCity ) },
118 + { "WorkState", "st,region", DEF_CARD_ACCESS( WorkState ) },
119 + { "WorkZipCode", "postalcode,zip", DEF_CARD_ACCESS( WorkZipCode ) },
120 + { "WorkCountry", "countryname", DEF_CARD_ACCESS( WorkCountry ) },
121 + { "JobTitle", "title", DEF_CARD_ACCESS( JobTitle ) },
122 + { "Department", "ou,orgunit,department,departmentnumber", DEF_CARD_ACCESS( Department ) },
123 + { "Company", "o,company", DEF_CARD_ACCESS( Company ) },
124 + { "WebPage1", "workurl", DEF_CARD_ACCESS( WebPage1 ) },
125 + { "WebPage2", "homeurl", DEF_CARD_ACCESS( WebPage2 ) },
126 + { "BirthYear", "birthyear", DEF_CARD_ACCESS( BirthYear ) },
127 + { "BirthMonth", "birthmonth", DEF_CARD_ACCESS( BirthMonth ) },
128 + { "BirthYear", "birthday", DEF_CARD_ACCESS( BirthDay ) },
129 + { "Custom1", "custom1", DEF_CARD_ACCESS( Custom1 ) },
130 + { "Custom2", "custom2", DEF_CARD_ACCESS( Custom2 ) },
131 + { "Custom3", "custom3", DEF_CARD_ACCESS( Custom3 ) },
132 + { "Custom4", "custom4", DEF_CARD_ACCESS( Custom4 ) },
133 + { "Notes", "notes,description", DEF_CARD_ACCESS( Notes ) },
134 + { "PreferMailFormat", "xmozillausehtmlmail", NULL, NULL },
135 + { NULL, NULL, NULL, NULL }
137 + const MapEntry* loop = aEntries;
138 + while ( loop->pAsciiPropertyName )
140 + aMap[ ::rtl::OString( loop->pAsciiPropertyName ) ] =
141 + CardPropertyData( loop->pAsciiAttrributeList, loop->PropGetter, loop->PropSetter );
149 + //====================================================================
150 + //= AttributeMap_Data
151 + //====================================================================
152 + struct AttributeMap_Data
156 + //====================================================================
157 + //= MLdapAttributeMap
158 + //====================================================================
159 + // -------------------------------------------------------------------
160 + MLdapAttributeMap::MLdapAttributeMap()
161 + :m_pData( new AttributeMap_Data )
165 + // -------------------------------------------------------------------
166 + MLdapAttributeMap::~MLdapAttributeMap()
170 + // -------------------------------------------------------------------
171 + NS_IMPL_THREADSAFE_ISUPPORTS1( MLdapAttributeMap, nsIAbLDAPAttributeMap )
173 + // -------------------------------------------------------------------
174 + NS_IMETHODIMP MLdapAttributeMap::GetAttributeList(const nsACString & aProperty, nsACString & _retval)
176 + ::rtl::OString sProperty( MTypeConverter::nsACStringToOString( aProperty ) );
178 + const MapPropertiesToAttributes& rPropertyMap( lcl_getPropertyMap() );
179 + MapPropertiesToAttributes::const_iterator pos = rPropertyMap.find( sProperty );
181 + if ( pos == rPropertyMap.end() )
183 + _retval.SetIsVoid( PR_TRUE );
187 + MTypeConverter::asciiToNsACString( pos->second.pLDAPAttributeList, _retval );
193 + // -------------------------------------------------------------------
194 + NS_IMETHODIMP MLdapAttributeMap::GetAttributes(const nsACString & aProperty, PRUint32* aCount, char*** aAttrs)
196 + OSL_ENSURE( false, "MLdapAttributeMap::GetAttributes: not implemented!" );
200 + return NS_ERROR_NOT_IMPLEMENTED;
203 + // -------------------------------------------------------------------
204 + NS_IMETHODIMP MLdapAttributeMap::GetFirstAttribute(const nsACString & aProperty, nsACString & _retval)
206 + ::rtl::OString sProperty( MTypeConverter::nsACStringToOString( aProperty ) );
208 + const MapPropertiesToAttributes& rPropertyMap( lcl_getPropertyMap() );
209 + MapPropertiesToAttributes::const_iterator pos = rPropertyMap.find( sProperty );
211 + if ( pos == rPropertyMap.end() )
213 + _retval.SetIsVoid( PR_TRUE );
217 + sal_Int32 tokenPos(0);
218 + ::rtl::OString sAttributeList( pos->second.pLDAPAttributeList );
219 + MTypeConverter::asciiToNsACString( sAttributeList.getToken( 0, ',', tokenPos ).getStr(), _retval );
225 + // -------------------------------------------------------------------
226 + NS_IMETHODIMP MLdapAttributeMap::SetAttributeList(const nsACString & aProperty, const nsACString & aAttributeList, PRBool allowInconsistencies)
228 + OSL_ENSURE( false, "MLdapAttributeMap::SetAttributeList: not implemented!" );
230 + (void)aAttributeList;
231 + (void)allowInconsistencies;
232 + return NS_ERROR_NOT_IMPLEMENTED;
235 + // -------------------------------------------------------------------
236 + NS_IMETHODIMP MLdapAttributeMap::GetProperty(const nsACString & aAttribute, nsACString & _retval)
238 + OSL_ENSURE( false, "MLdapAttributeMap::GetProperty: not implemented!" );
241 + return NS_ERROR_NOT_IMPLEMENTED;
244 + // -------------------------------------------------------------------
245 + NS_IMETHODIMP MLdapAttributeMap::GetAllCardAttributes(nsACString & _retval)
247 + const MapPropertiesToAttributes& rPropertyMap( lcl_getPropertyMap() );
249 + ::rtl::OStringBuffer aAllAttributes;
250 + for ( MapPropertiesToAttributes::const_iterator loop = rPropertyMap.begin();
251 + loop != rPropertyMap.end();
255 + aAllAttributes.append( loop->second.pLDAPAttributeList );
256 + if ( loop != rPropertyMap.end() )
257 + aAllAttributes.append( ',' );
260 + MTypeConverter::asciiToNsACString( aAllAttributes.getStr(), _retval );
264 + // -------------------------------------------------------------------
265 + NS_IMETHODIMP MLdapAttributeMap::CheckState(void)
267 + // we do not allow modifying the map, so we're always in a valid state
271 + // -------------------------------------------------------------------
272 + NS_IMETHODIMP MLdapAttributeMap::SetFromPrefs(const nsACString & aPrefBranchName)
274 + OSL_ENSURE( false, "MLdapAttributeMap::SetFromPrefs: not implemented!" );
275 + (void)aPrefBranchName;
276 + return NS_ERROR_NOT_IMPLEMENTED;
279 + // -------------------------------------------------------------------
280 + NS_IMETHODIMP MLdapAttributeMap::SetCardPropertiesFromLDAPMessage(nsILDAPMessage* aMessage, nsIAbCard* aCard)
282 + NS_ENSURE_ARG_POINTER( aMessage );
283 + NS_ENSURE_ARG_POINTER( aCard );
285 + // in case that's not present in the LDAP message: set the "preferred mail format" to "none"
286 + aCard->SetPreferMailFormat( nsIAbPreferMailFormat::unknown );
288 + const MapPropertiesToAttributes& rPropertyMap( lcl_getPropertyMap() );
289 + for ( MapPropertiesToAttributes::const_iterator prop = rPropertyMap.begin();
290 + prop != rPropertyMap.end();
294 + // split the list of attributes for the current property
295 + ::rtl::OString sAttributeList( prop->second.pLDAPAttributeList );
296 + ::rtl::OString sAttribute;
298 + sal_Int32 tokenPos = 0;
299 + while ( tokenPos != -1 )
301 + sAttribute = sAttributeList.getToken( 0, ',', tokenPos );
303 + // retrieve the values for the current attribute
304 + PRUint32 valueCount = 0;
305 + PRUnichar** values = NULL;
306 + nsresult rv = aMessage->GetValues( sAttribute.getStr(), &valueCount, &values );
307 + if ( NS_FAILED( rv ) )
308 + // try the next attribute
313 + CardPropertySetter propSetter = prop->second.PropSetter;
314 + OSL_ENSURE( propSetter,
315 + "MLdapAttributeMap::SetCardPropertiesFromLDAPMessage: "
316 + "unexpected: could retrieve an attribute value, but have no setter for it!" );
319 + (aCard->*propSetter)( values[0] );
322 + // we're done with this property - no need to handle the remaining attributes which
331 + // -------------------------------------------------------------------
334 + struct PreferMailFormatType
336 + const sal_Char* description;
337 + PRUint32 formatType;
339 + PreferMailFormatType()
340 + :description( NULL )
341 + ,formatType( nsIAbPreferMailFormat::unknown )
345 + PreferMailFormatType( const sal_Char* _description, PRUint32 _formatType )
346 + :description( _description )
347 + ,formatType( _formatType )
352 + static const PreferMailFormatType* lcl_getMailFormatTypes()
354 + static const PreferMailFormatType aMailFormatTypes[] =
356 + PreferMailFormatType( "text/plain", nsIAbPreferMailFormat::plaintext ),
357 + PreferMailFormatType( "text/html", nsIAbPreferMailFormat::html ),
358 + PreferMailFormatType( "unknown", nsIAbPreferMailFormat::unknown ),
359 + PreferMailFormatType()
361 + return aMailFormatTypes;
365 + // -------------------------------------------------------------------
366 + void MLdapAttributeMap::fillCardFromResult( nsIAbCard& _card, const MQueryHelperResultEntry& _result )
368 + _card.SetPreferMailFormat( nsIAbPreferMailFormat::unknown );
370 + ::rtl::OUString resultValue;
372 + const MapPropertiesToAttributes& rPropertyMap( lcl_getPropertyMap() );
373 + for ( MapPropertiesToAttributes::const_iterator prop = rPropertyMap.begin();
374 + prop != rPropertyMap.end();
378 + resultValue = _result.getValue( prop->first );
380 + CardPropertySetter propSetter = prop->second.PropSetter;
383 + (_card.*propSetter)( resultValue.getStr() );
387 + if ( prop->first.equals( "PreferMailFormat" ) )
389 + unsigned int format = nsIAbPreferMailFormat::unknown;
390 + const PreferMailFormatType* pMailFormatType = lcl_getMailFormatTypes();
391 + while ( pMailFormatType->description )
393 + if ( resultValue.equalsAscii( pMailFormatType->description ) )
395 + format = pMailFormatType->formatType;
400 + _card.SetPreferMailFormat(format);
403 + OSL_ENSURE( false, "MLdapAttributeMap::fillCardFromResult: unexpected property without default setters!" );
408 + // -------------------------------------------------------------------
409 + void MLdapAttributeMap::fillResultFromCard( MQueryHelperResultEntry& _result, nsIAbCard& _card )
411 + nsXPIDLString value;
412 + ::rtl::OUString resultValue;
414 + const MapPropertiesToAttributes& rPropertyMap( lcl_getPropertyMap() );
415 + for ( MapPropertiesToAttributes::const_iterator prop = rPropertyMap.begin();
416 + prop != rPropertyMap.end();
420 + CardPropertyGetter propGetter = prop->second.PropGetter;
423 + (_card.*propGetter)( getter_Copies( value ) );
425 + nsAutoString temp( value );
426 + MTypeConverter::nsStringToOUString( temp, resultValue );
430 + if ( prop->first.equals( "PreferMailFormat" ) )
432 + unsigned int format = nsIAbPreferMailFormat::unknown;
433 + _card.GetPreferMailFormat( &format );
434 + const PreferMailFormatType* pMailFormatType = lcl_getMailFormatTypes();
435 + while ( pMailFormatType->description )
437 + if ( format == pMailFormatType->formatType )
439 + resultValue = ::rtl::OUString::createFromAscii( pMailFormatType->description );
446 + OSL_ENSURE( false, "MLdapAttributeMap::fillResultFromCard: unexpected property without default getters!" );
449 + _result.insert( prop->first, resultValue );
453 +//........................................................................
454 +} } // namespace connectivity::mozab
455 +//........................................................................
456 --- connectivity/source/drivers/mozab/mozillasrc/makefile.mk (.../tags/DEV300_m41/connectivity) (revision 269329)
457 +++ connectivity/source/drivers/mozab/mozillasrc/makefile.mk (.../cws/moz2seamonkey01/connectivity) (revision 269329)
460 $(SLO)$/MTypeConverter.obj \
461 $(SLO)$/MNameMapper.obj \
462 - $(SLO)$/MNSMozabProxy.obj \
463 - $(SLO)$/MNSTerminateListener.obj
464 + $(SLO)$/MNSMozabProxy.obj \
465 + $(SLO)$/MNSTerminateListener.obj \
466 + $(SLO)$/MLdapAttributeMap.obj \
469 +CDEFS += -DMOZILLA_INTERNAL_API
472 .IF "$(COMNAME)"=="sunpro5"
473 CFLAGS += -features=tmplife
476 -fno-rtti -Wconversion -Wpointer-arith \
477 -Wcast-align -Woverloaded-virtual -Wsynth \
479 + -Wno-long-long -Wno-deprecated
483 --- connectivity/source/drivers/mozab/mozillasrc/MDatabaseMetaDataHelper.cxx (.../tags/DEV300_m41/connectivity) (revision 269329)
484 +++ connectivity/source/drivers/mozab/mozillasrc/MDatabaseMetaDataHelper.cxx (.../cws/moz2seamonkey01/connectivity) (revision 269329)
486 #include <osl/mutex.hxx>
487 #include <osl/conditn.hxx>
489 +#include <nsIAbDirFactoryService.h>
490 #include <MNSInit.hxx>
491 #include <MNameMapper.hxx>
492 #include "MNSMozabProxy.hxx"
493 #include <MNSDeclares.hxx>
495 static ::osl::Mutex m_aMetaMutex;
497 #include <osl/diagnose.h>
498 --- connectivity/source/drivers/mozab/mozillasrc/MQuery.cxx (.../tags/DEV300_m41/connectivity) (revision 269329)
499 +++ connectivity/source/drivers/mozab/mozillasrc/MQuery.cxx (.../cws/moz2seamonkey01/connectivity) (revision 269329)
502 // MARKER(update_precomp.py): autogen include statement, do not remove
503 #include "precompiled_connectivity.hxx"
505 #include <MQueryHelper.hxx>
506 #include <MNameMapper.hxx>
507 #include <MConnection.hxx>
508 #include <connectivity/dbexception.hxx>
509 #include "MQuery.hxx"
510 -#ifndef _CONNECTIVITY_MAB_CONVERSIONS_HXX_
511 +#include "MLdapAttributeMap.hxx"
512 #include "MTypeConverter.hxx"
514 #include "MNSMozabProxy.hxx"
515 #include <com/sun/star/uno/Reference.hxx>
516 #include <unotools/processfactory.hxx>
518 static NS_DEFINE_CID(kBooleanConditionStringCID, NS_BOOLEANCONDITIONSTRING_CID);
519 static NS_DEFINE_CID(kBooleanExpressionCID, NS_BOOLEANEXPRESSION_CID);
520 static NS_DEFINE_CID(kAbDirectoryQueryProxyCID, NS_ABDIRECTORYQUERYPROXY_CID);
521 +static NS_DEFINE_CID(kAbLDAPAttributeMap, NS_IABLDAPATTRIBUTEMAP_IID);
523 using namespace connectivity::mozab;
524 using namespace connectivity;
526 NS_IF_ADDREF( m_aQueryHelper);
528 // -------------------------------------------------------------------------
529 -void MQuery::setAttributes(::std::vector< ::rtl::OUString> &attrs)
531 - OSL_TRACE("IN MQuery::setAttributes()\n");
532 - ::osl::MutexGuard aGuard( m_aMutex );
534 - m_aAttributes.clear();
535 - m_aAttributes.reserve(attrs.size());
536 - ::std::vector< ::rtl::OUString>::iterator aIterAttr = attrs.begin();
537 - ::std::map< ::rtl::OUString, ::rtl::OUString>::iterator aIterMap;
539 - for ( aIterAttr = attrs.begin(); aIterAttr != attrs.end();++aIterAttr )
540 - m_aAttributes.push_back( m_rColumnAlias.getProgrammaticNameOrFallbackToAlias( *aIterAttr ) );
542 - OSL_TRACE("\tOUT MQuery::setAttributes()\n");
544 -// -------------------------------------------------------------------------
545 -const ::std::vector< ::rtl::OUString> &MQuery::getAttributes() const
547 - OSL_TRACE("IN MQuery::getAttributes()\n");
549 - OSL_TRACE("\tOUT MQuery::getAttributes()\n");
551 - return(m_aAttributes);
553 -// -------------------------------------------------------------------------
554 void MQuery::setAddressbook(::rtl::OUString &ab)
556 OSL_TRACE("IN MQuery::setAddressbook()\n");
559 // Set the 'name' property of the boolString.
560 // Check if it's an alias first...
561 - rtl::OUString attrName;
562 - ::std::map< ::rtl::OUString, ::rtl::OUString>::const_iterator aIterMap;
563 - attrName = _aQuery->getColumnAlias().getProgrammaticNameOrFallbackToAlias( evStr->getName() );
564 - ::std::string aMiName = MTypeConverter::ouStringToStlString(attrName);
565 - boolString->SetName(strdup(aMiName.c_str()));
566 - OSL_TRACE("Name = %s ;", aMiName.c_str() );
567 + rtl::OString attrName = _aQuery->getColumnAlias().getProgrammaticNameOrFallbackToUTF8Alias( evStr->getName() );
568 + boolString->SetName( strdup( attrName.getStr() ) );
569 + OSL_TRACE("Name = %s ;", attrName.getStr() );
570 // Set the 'matchType' property of the boolString. Check for equal length.
571 sal_Bool requiresValue = sal_True;
572 switch(evStr->getCond()) {
576 nsCOMPtr< nsIAbDirectoryQueryArguments > arguments = do_CreateInstance( kAbDirectoryQueryArgumentsCID, &rv);
578 NS_ENSURE_SUCCESS( rv, rv );
580 rv = arguments->SetExpression(queryExpression);
581 NS_ENSURE_SUCCESS( rv, rv );
584 rv = arguments->SetQuerySubDirectories(m_bQuerySubDirs);
585 NS_ENSURE_SUCCESS( rv, rv );
587 + nsCOMPtr< nsIAbLDAPAttributeMap > attributeMap( new MLdapAttributeMap );
588 + rv = arguments->SetTypeSpecificArg( attributeMap );
589 + NS_ENSURE_SUCCESS( rv, rv );
591 // Execute the query.
592 OSL_TRACE( "****** calling DoQuery\n");
597 case DataType::VARCHAR:
598 - xResEntry->setValue( m_rColumnAlias.getProgrammaticNameOrFallbackToAlias( aDBColumnName ), rValue.getString() );
599 + xResEntry->setValue( m_rColumnAlias.getProgrammaticNameOrFallbackToUTF8Alias( aDBColumnName ), rValue.getString() );
602 OSL_ENSURE( sal_False, "invalid data type!" );
606 case DataType::VARCHAR:
607 - rValue = xResEntry->getValue( m_rColumnAlias.getProgrammaticNameOrFallbackToAlias( aDBColumnName ) );
608 + rValue = xResEntry->getValue( m_rColumnAlias.getProgrammaticNameOrFallbackToUTF8Alias( aDBColumnName ) );
615 // -------------------------------------------------------------------------
617 -isWritable(OConnection* _pCon)
618 +sal_Bool MQuery::isWritable(OConnection* _pCon)
620 if ( !m_aQueryDirectory )
622 --- connectivity/source/drivers/mozab/mozillasrc/MQueryHelper.cxx (.../tags/DEV300_m41/connectivity) (revision 269329)
623 +++ connectivity/source/drivers/mozab/mozillasrc/MQueryHelper.cxx (.../cws/moz2seamonkey01/connectivity) (revision 269329)
626 // MARKER(update_precomp.py): autogen include statement, do not remove
627 #include "precompiled_connectivity.hxx"
628 -#include <MQueryHelper.hxx>
630 +#include "MQueryHelper.hxx"
631 #include "MTypeConverter.hxx"
632 +#include "MConnection.hxx"
633 +#include "MNSDeclares.hxx"
634 +#include "MLdapAttributeMap.hxx"
636 #include <connectivity/dbexception.hxx>
637 -#ifndef _CONNECTIVITY_MOZAB_BCONNECTION_HXX_
638 -#include <MConnection.hxx>
641 #include "resource/mozab_res.hrc"
642 -#include "MNSDeclares.hxx"
644 using namespace connectivity::mozab;
653 - index_PrimaryEmail,
655 - index_PreferMailFormat,
660 - index_CellularNumber,
662 - index_HomeAddress2,
668 - index_WorkAddress2,
689 NS_IMPL_THREADSAFE_ISUPPORTS1(connectivity::mozab::MQueryHelper,nsIAbDirectoryQueryResultListener)
694 MQueryHelperResultEntry::~MQueryHelperResultEntry()
698 OSL_TRACE("IN MQueryHelperResultEntry::~MQueryHelperResultEntry()\n");
699 OSL_TRACE("OUT MQueryHelperResultEntry::~MQueryHelperResultEntry()\n");
706 -MQueryHelperResultEntry::insert( const rtl::OUString &key, rtl::OUString &value )
707 +void MQueryHelperResultEntry::insert( const rtl::OString &key, rtl::OUString &value )
709 - m_Fields.insert( fieldMap::value_type( key, value ) );
710 + m_Fields[ key ] = value;
714 -MQueryHelperResultEntry::getValue( const rtl::OUString &key ) const
715 +rtl::OUString MQueryHelperResultEntry::getValue( const rtl::OString &key ) const
717 - fieldMap::const_iterator iter;
719 - iter = m_Fields.find( key );
721 - if ( iter == m_Fields.end() ) {
722 + FieldMap::const_iterator iter = m_Fields.find( key );
723 + if ( iter == m_Fields.end() )
725 return rtl::OUString();
727 - return (*iter).second;
731 + return iter->second;
736 -MQueryHelperResultEntry::setValue( const rtl::OUString &key, const rtl::OUString & rValue)
737 +void MQueryHelperResultEntry::setValue( const rtl::OString &key, const rtl::OUString & rValue)
739 - m_Fields.erase(key);
740 - m_Fields.insert( fieldMap::value_type( key, rValue ) );
742 + m_Fields[ key ] = rValue;
745 // class MQueryHelper
748 -static char PreferMailFormatTypes[2][11] = {"text/plain",
750 MQueryHelper::MQueryHelper()
752 ,m_bHasMore( sal_True )
754 nsCOMPtr<nsIAbCard> card(do_QueryInterface(cardSupports, &rv));
755 NS_ENSURE_SUCCESS(rv, rv);
757 - getCardValues(card);
758 + getCardValues(card);
760 nsMemory::Free(name);
762 @@ -484,56 +432,13 @@
766 +// -----------------------------------------------------------------------------
767 void MQueryHelper::notifyQueryError()
769 m_bQueryComplete = sal_True ;
770 notifyResultOrComplete() ;
773 -static const ::rtl::OUString& getAttribute(PRUint32 index)
775 - static const ::rtl::OUString sAttributeNames[] =
777 - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("FirstName")),
778 - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("LastName")),
779 - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("DisplayName")),
780 - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("NickName")),
781 - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("PrimaryEmail")),
782 - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("SecondEmail")),
783 - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("PreferMailFormat")),
784 - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("WorkPhone")),
785 - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("HomePhone")),
786 - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("FaxNumber")),
787 - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("PagerNumber")),
788 - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("CellularNumber")),
789 - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("HomeAddress")),
790 - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("HomeAddress2")),
791 - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("HomeCity")),
792 - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("HomeState")),
793 - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("HomeZipCode")),
794 - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("HomeCountry")),
795 - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("WorkAddress")),
796 - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("WorkAddress2")),
797 - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("WorkCity")),
798 - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("WorkState")),
799 - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("WorkZipCode")),
800 - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("WorkCountry")),
801 - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("JobTitle")),
802 - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Department")),
803 - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Company")),
804 - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("WebPage1")),
805 - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("WebPage2")),
806 - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("BirthYear")),
807 - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("BirthMonth")),
808 - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("BirthDay")),
809 - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Custom1")),
810 - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Custom2")),
811 - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Custom3")),
812 - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Custom4")),
813 - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Notes"))
815 - return sAttributeNames[index];
817 const char * getAddrURI(const nsIAbDirectory* directory)
820 @@ -687,127 +592,7 @@
824 - ::rtl::OUString sValue;
826 - getCardAttributeAndValue(getAttribute(index_FirstName),sValue,resEntry);
827 - card->SetFirstName(sValue.getStr());
829 - getCardAttributeAndValue(getAttribute(index_LastName),sValue,resEntry);
830 - card->SetLastName(sValue.getStr());
832 - getCardAttributeAndValue(getAttribute(index_DisplayName),sValue,resEntry);
833 - card->SetDisplayName(sValue.getStr());
835 - getCardAttributeAndValue(getAttribute(index_NickName),sValue,resEntry);
836 - card->SetNickName(sValue.getStr());
838 - getCardAttributeAndValue(getAttribute(index_PrimaryEmail),sValue,resEntry);
839 - card->SetPrimaryEmail(sValue.getStr());
841 - getCardAttributeAndValue(getAttribute(index_SecondEmail),sValue,resEntry);
842 - card->SetSecondEmail(sValue.getStr());
844 - unsigned int format;
845 - ::rtl::OUString prefMailValue;
846 - getCardAttributeAndValue(getAttribute(index_WorkPhone),prefMailValue,resEntry);
847 - for(format=2;format >0;format--)
849 - if (! prefMailValue.compareTo(
850 - ::rtl::OUString::createFromAscii(PreferMailFormatTypes[format-1]) ) )
853 - card->SetPreferMailFormat(format);
855 - getCardAttributeAndValue(getAttribute(index_WorkPhone),sValue,resEntry);
856 - card->SetWorkPhone(sValue.getStr());
858 - getCardAttributeAndValue(getAttribute(index_HomePhone),sValue,resEntry);
859 - card->SetHomePhone(sValue.getStr());
861 - getCardAttributeAndValue(getAttribute(index_FaxNumber),sValue,resEntry);
862 - card->SetFaxNumber(sValue.getStr());
864 - getCardAttributeAndValue(getAttribute(index_PagerNumber),sValue,resEntry);
865 - card->SetPagerNumber(sValue.getStr());
867 - getCardAttributeAndValue(getAttribute(index_CellularNumber),sValue,resEntry);
868 - card->SetCellularNumber(sValue.getStr());
870 - getCardAttributeAndValue(getAttribute(index_HomeAddress),sValue,resEntry);
871 - card->SetHomeAddress(sValue.getStr());
873 - getCardAttributeAndValue(getAttribute(index_HomeAddress2),sValue,resEntry);
874 - card->SetHomeAddress2(sValue.getStr());
876 - getCardAttributeAndValue(getAttribute(index_HomeCity),sValue,resEntry);
877 - card->SetHomeCity(sValue.getStr());
879 - getCardAttributeAndValue(getAttribute(index_HomeState),sValue,resEntry);
880 - card->SetHomeState(sValue.getStr());
882 - getCardAttributeAndValue(getAttribute(index_HomeZipCode),sValue,resEntry);
883 - card->SetHomeZipCode(sValue.getStr());
885 - getCardAttributeAndValue(getAttribute(index_HomeCountry),sValue,resEntry);
886 - card->SetHomeCountry(sValue.getStr());
888 - getCardAttributeAndValue(getAttribute(index_WorkAddress),sValue,resEntry);
889 - card->SetWorkAddress(sValue.getStr());
891 - getCardAttributeAndValue(getAttribute(index_WorkAddress2),sValue,resEntry);
892 - card->SetWorkAddress2(sValue.getStr());
894 - getCardAttributeAndValue(getAttribute(index_WorkCity),sValue,resEntry);
895 - card->SetWorkCity(sValue.getStr());
897 - getCardAttributeAndValue(getAttribute(index_WorkState),sValue,resEntry);
898 - card->SetWorkState(sValue.getStr());
900 - getCardAttributeAndValue(getAttribute(index_WorkZipCode),sValue,resEntry);
901 - card->SetWorkZipCode(sValue.getStr());
903 - getCardAttributeAndValue(getAttribute(index_WorkCountry),sValue,resEntry);
904 - card->SetWorkCountry(sValue.getStr());
906 - getCardAttributeAndValue(getAttribute(index_JobTitle),sValue,resEntry);
907 - card->SetJobTitle(sValue.getStr());
909 - getCardAttributeAndValue(getAttribute(index_Department),sValue,resEntry);
910 - card->SetDepartment(sValue.getStr());
912 - getCardAttributeAndValue(getAttribute(index_Company),sValue,resEntry);
913 - card->SetCompany(sValue.getStr());
915 - getCardAttributeAndValue(getAttribute(index_WebPage1),sValue,resEntry);
916 - card->SetWebPage1(sValue.getStr());
918 - getCardAttributeAndValue(getAttribute(index_WebPage2),sValue,resEntry);
919 - card->SetWebPage2(sValue.getStr());
921 - getCardAttributeAndValue(getAttribute(index_BirthYear),sValue,resEntry);
922 - card->SetBirthYear(sValue.getStr());
924 - getCardAttributeAndValue(getAttribute(index_BirthMonth),sValue,resEntry);
925 - card->SetBirthMonth(sValue.getStr());
927 - getCardAttributeAndValue(getAttribute(index_BirthDay),sValue,resEntry);
928 - card->SetBirthDay(sValue.getStr());
930 - getCardAttributeAndValue(getAttribute(index_Custom1),sValue,resEntry);
931 - card->SetCustom1(sValue.getStr());
933 - getCardAttributeAndValue(getAttribute(index_Custom2),sValue,resEntry);
934 - card->SetCustom2(sValue.getStr());
936 - getCardAttributeAndValue(getAttribute(index_Custom3),sValue,resEntry);
937 - card->SetCustom3(sValue.getStr());
939 - getCardAttributeAndValue(getAttribute(index_Custom4),sValue,resEntry);
940 - card->SetCustom4(sValue.getStr());
942 - getCardAttributeAndValue(getAttribute(index_Notes),sValue,resEntry);
943 - card->SetNotes(sValue.getStr());
945 + MLdapAttributeMap::fillCardFromResult( *card, *resEntry );
949 @@ -821,143 +606,8 @@
951 resEntry = new MQueryHelperResultEntry();
953 - nsXPIDLString sValue;
955 - card->GetFirstName(getter_Copies(sValue));
956 - addCardAttributeAndValue(getAttribute(index_FirstName),sValue,resEntry);
958 - card->GetLastName(getter_Copies(sValue));
959 - addCardAttributeAndValue(getAttribute(index_LastName),sValue,resEntry);
961 - card->GetDisplayName(getter_Copies(sValue));
962 - addCardAttributeAndValue(getAttribute(index_DisplayName),sValue,resEntry);
964 - card->GetNickName(getter_Copies(sValue));
965 - addCardAttributeAndValue(getAttribute(index_NickName),sValue,resEntry);
967 - card->GetPrimaryEmail(getter_Copies(sValue));
968 - addCardAttributeAndValue(getAttribute(index_PrimaryEmail),sValue,resEntry);
970 - card->GetSecondEmail(getter_Copies(sValue));
971 - addCardAttributeAndValue(getAttribute(index_SecondEmail),sValue,resEntry);
973 - unsigned int format = 0;
974 - card->GetPreferMailFormat(&format);
975 - ::rtl::OUString prefMailValue;
978 - case nsIAbPreferMailFormat::html:
979 - prefMailValue = ::rtl::OUString::createFromAscii(PreferMailFormatTypes[1]);
981 - case nsIAbPreferMailFormat::plaintext:
982 - prefMailValue = ::rtl::OUString::createFromAscii(PreferMailFormatTypes[0]);
984 - case nsIAbPreferMailFormat::unknown:
986 - prefMailValue = ::rtl::OUString::createFromAscii(PreferMailFormatTypes[0]);
990 - resEntry->insert( getAttribute(index_PreferMailFormat), prefMailValue );
992 - card->GetWorkPhone(getter_Copies(sValue));
993 - addCardAttributeAndValue(getAttribute(index_WorkPhone),sValue,resEntry);
995 - card->GetHomePhone(getter_Copies(sValue));
996 - addCardAttributeAndValue(getAttribute(index_HomePhone),sValue,resEntry);
998 - card->GetFaxNumber(getter_Copies(sValue));
999 - addCardAttributeAndValue(getAttribute(index_FaxNumber),sValue,resEntry);
1001 - card->GetPagerNumber(getter_Copies(sValue));
1002 - addCardAttributeAndValue(getAttribute(index_PagerNumber),sValue,resEntry);
1004 - card->GetCellularNumber(getter_Copies(sValue));
1005 - addCardAttributeAndValue(getAttribute(index_CellularNumber),sValue,resEntry);
1007 - card->GetHomeAddress(getter_Copies(sValue));
1009 - nsXPIDLString space;
1010 - space.Assign(NS_LITERAL_STRING(" "));
1011 - while ((offset = sValue.FindChar('\r')) >= 0) sValue.Replace(offset, 1, space);
1012 - while ((offset = sValue.FindChar('\n')) >= 0) sValue.Replace(offset, 1, space);
1013 - addCardAttributeAndValue(getAttribute(index_HomeAddress),sValue,resEntry);
1015 - card->GetHomeAddress2(getter_Copies(sValue));
1016 - addCardAttributeAndValue(getAttribute(index_HomeAddress2),sValue,resEntry);
1018 - card->GetHomeCity(getter_Copies(sValue));
1019 - addCardAttributeAndValue(getAttribute(index_HomeCity),sValue,resEntry);
1021 - card->GetHomeState(getter_Copies(sValue));
1022 - addCardAttributeAndValue(getAttribute(index_HomeState),sValue,resEntry);
1024 - card->GetHomeZipCode(getter_Copies(sValue));
1025 - addCardAttributeAndValue(getAttribute(index_HomeZipCode),sValue,resEntry);
1027 - card->GetHomeCountry(getter_Copies(sValue));
1028 - addCardAttributeAndValue(getAttribute(index_HomeCountry),sValue,resEntry);
1030 - card->GetWorkAddress(getter_Copies(sValue));
1031 - while ((offset = sValue.FindChar('\r')) >= 0) sValue.Replace(offset, 1, space);
1032 - while ((offset = sValue.FindChar('\n')) >= 0) sValue.Replace(offset, 1, space);
1033 - addCardAttributeAndValue(getAttribute(index_WorkAddress),sValue,resEntry);
1035 - card->GetWorkAddress2(getter_Copies(sValue));
1036 - addCardAttributeAndValue(getAttribute(index_WorkAddress2),sValue,resEntry);
1038 - card->GetWorkCity(getter_Copies(sValue));
1039 - addCardAttributeAndValue(getAttribute(index_WorkCity),sValue,resEntry);
1041 - card->GetWorkState(getter_Copies(sValue));
1042 - addCardAttributeAndValue(getAttribute(index_WorkState),sValue,resEntry);
1044 - card->GetWorkZipCode(getter_Copies(sValue));
1045 - addCardAttributeAndValue(getAttribute(index_WorkZipCode),sValue,resEntry);
1047 - card->GetWorkCountry(getter_Copies(sValue));
1048 - addCardAttributeAndValue(getAttribute(index_WorkCountry),sValue,resEntry);
1050 - card->GetJobTitle(getter_Copies(sValue));
1051 - addCardAttributeAndValue(getAttribute(index_JobTitle),sValue,resEntry);
1053 - card->GetDepartment(getter_Copies(sValue));
1054 - addCardAttributeAndValue(getAttribute(index_Department),sValue,resEntry);
1056 - card->GetCompany(getter_Copies(sValue));
1057 - addCardAttributeAndValue(getAttribute(index_Company),sValue,resEntry);
1059 - card->GetWebPage1(getter_Copies(sValue));
1060 - addCardAttributeAndValue(getAttribute(index_WebPage1),sValue,resEntry);
1062 - card->GetWebPage2(getter_Copies(sValue));
1063 - addCardAttributeAndValue(getAttribute(index_WebPage2),sValue,resEntry);
1065 - card->GetBirthYear(getter_Copies(sValue));
1066 - addCardAttributeAndValue(getAttribute(index_BirthYear),sValue,resEntry);
1068 - card->GetBirthMonth(getter_Copies(sValue));
1069 - addCardAttributeAndValue(getAttribute(index_BirthMonth),sValue,resEntry);
1071 - card->GetBirthDay(getter_Copies(sValue));
1072 - addCardAttributeAndValue(getAttribute(index_BirthDay),sValue,resEntry);
1074 - card->GetCustom1(getter_Copies(sValue));
1075 - addCardAttributeAndValue(getAttribute(index_Custom1),sValue,resEntry);
1077 - card->GetCustom2(getter_Copies(sValue));
1078 - addCardAttributeAndValue(getAttribute(index_Custom2),sValue,resEntry);
1080 - card->GetCustom3(getter_Copies(sValue));
1081 - addCardAttributeAndValue(getAttribute(index_Custom3),sValue,resEntry);
1083 - card->GetCustom4(getter_Copies(sValue));
1084 - addCardAttributeAndValue(getAttribute(index_Custom4),sValue,resEntry);
1086 - card->GetNotes(getter_Copies(sValue));
1087 - addCardAttributeAndValue(getAttribute(index_Notes),sValue,resEntry);
1089 - resEntry->setCard(card);
1090 + MLdapAttributeMap::fillResultFromCard( *resEntry, *card );
1091 + resEntry->setCard(card);
1095 @@ -975,21 +625,8 @@
1096 getCardValues(card,rowIndex);
1099 -void MQueryHelper::addCardAttributeAndValue(const ::rtl::OUString& sName, nsXPIDLString Value, MQueryHelperResultEntry *resEntry)
1101 - nsAutoString temp(Value) ;
1102 - ::rtl::OUString attrValue;
1103 - MTypeConverter::nsStringToOUString( temp, attrValue );
1104 - resEntry->insert( sName, attrValue );
1107 -void MQueryHelper::getCardAttributeAndValue(const ::rtl::OUString& sName, ::rtl::OUString &ouValue, MQueryHelperResultEntry *resEntry)
1109 - ouValue = resEntry->getValue( sName);
1112 // -------------------------------------------------------------------------
1113 -sal_Int32 MQueryHelper::createNewCard()
1114 +sal_Int32 MQueryHelper::createNewCard()
1116 ::osl::MutexGuard aGuard( m_aMutex );
1118 --- connectivity/source/drivers/mozab/mozillasrc/MLdapAttributeMap.hxx (.../tags/DEV300_m41/connectivity) (revision 0)
1119 +++ connectivity/source/drivers/mozab/mozillasrc/MLdapAttributeMap.hxx (.../cws/moz2seamonkey01/connectivity) (revision 269329)
1121 +/*************************************************************************
1122 +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
1124 +* Copyright 2008 by Sun Microsystems, Inc.
1126 +* OpenOffice.org - a multi-platform office productivity suite
1128 +* $RCSfile: code,v $
1132 +* This file is part of OpenOffice.org.
1134 +* OpenOffice.org is free software: you can redistribute it and/or modify
1135 +* it under the terms of the GNU Lesser General Public License version 3
1136 +* only, as published by the Free Software Foundation.
1138 +* OpenOffice.org is distributed in the hope that it will be useful,
1139 +* but WITHOUT ANY WARRANTY; without even the implied warranty of
1140 +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1141 +* GNU Lesser General Public License version 3 for more details
1142 +* (a copy is included in the LICENSE file that accompanied this code).
1144 +* You should have received a copy of the GNU Lesser General Public License
1145 +* version 3 along with OpenOffice.org. If not, see
1146 +* <http://www.openoffice.org/license.html>
1147 +* for a copy of the LGPLv3 License.
1148 +************************************************************************/
1150 +#ifndef CONNECTIVITY_MLDAPATTRIBUTEMAP_HXX
1151 +#define CONNECTIVITY_MLDAPATTRIBUTEMAP_HXX
1153 +#include <MNSInclude.hxx>
1157 +//........................................................................
1158 +namespace connectivity { namespace mozab {
1159 +//........................................................................
1161 + struct AttributeMap_Data;
1162 + class MQueryHelperResultEntry;
1164 + //====================================================================
1165 + //= class MLdapAttributeMap
1166 + //====================================================================
1167 + /** implements the nsIAbLDAPAttributeMap interface
1169 + Somewhere between Mozilla 1.7.5 and SeaMonkey 1.1.12, the LDAP address book
1170 + implementation was changed to take the attribute mapping (from LDAP attributes
1171 + to address book properties) not directly from the preferences. Instead, this mapping
1172 + is now delivered by a dedicated implementation (supporting the nsIAbLDAPAttributeMap
1176 + class MLdapAttributeMap : public nsIAbLDAPAttributeMap
1179 + MLdapAttributeMap();
1182 + NS_DECL_NSIABLDAPATTRIBUTEMAP
1184 + static void fillCardFromResult( nsIAbCard& _card, const MQueryHelperResultEntry& _result );
1185 + static void fillResultFromCard( MQueryHelperResultEntry& _result, nsIAbCard& _card );
1188 + virtual ~MLdapAttributeMap();
1191 + ::std::auto_ptr< AttributeMap_Data > m_pData;
1194 +//........................................................................
1195 +} } // namespace connectivity::mozab
1196 +//........................................................................
1198 +#endif // CONNECTIVITY_MLDAPATTRIBUTEMAP_HXX
1199 --- connectivity/source/drivers/mozab/mozillasrc/MTypeConverter.cxx (.../tags/DEV300_m41/connectivity) (revision 269329)
1200 +++ connectivity/source/drivers/mozab/mozillasrc/MTypeConverter.cxx (.../cws/moz2seamonkey01/connectivity) (revision 269329)
1202 nss = mozString; // temp.
1204 // -------------------------------------------------------------------------
1205 +::rtl::OUString MTypeConverter::nsACStringToOUString( const nsACString& _source )
1207 + const char* buffer = _source.BeginReading();
1208 + const char* bufferEnd = _source.EndReading();
1209 + return ::rtl::OUString( buffer, bufferEnd - buffer, RTL_TEXTENCODING_ASCII_US );
1211 +// -------------------------------------------------------------------------
1212 +::rtl::OString MTypeConverter::nsACStringToOString( const nsACString& _source )
1214 + const char* buffer = _source.BeginReading();
1215 + const char* bufferEnd = _source.EndReading();
1216 + return ::rtl::OString( buffer, bufferEnd - buffer );
1218 +// -------------------------------------------------------------------------
1219 +void MTypeConverter::asciiOUStringToNsACString( const ::rtl::OUString& _asciiString, nsACString& _dest )
1221 + ::rtl::OString sAsciiVersion( _asciiString.getStr(), _asciiString.getLength(), RTL_TEXTENCODING_ASCII_US );
1222 + asciiToNsACString( sAsciiVersion.getStr(), _dest );
1224 +// -------------------------------------------------------------------------
1225 +void MTypeConverter::asciiToNsACString( const sal_Char* _asciiString, nsACString& _dest )
1228 + _dest.AppendASCII( _asciiString );
1230 +// -------------------------------------------------------------------------
1231 void MTypeConverter::nsStringToOUString(nsString const &nss, ::rtl::OUString &ous)
1233 // Get clone of buffer.
1234 --- connectivity/source/drivers/mozab/mozillasrc/MQueryHelper.hxx (.../tags/DEV300_m41/connectivity) (revision 269329)
1235 +++ connectivity/source/drivers/mozab/mozillasrc/MQueryHelper.hxx (.../cws/moz2seamonkey01/connectivity) (revision 269329)
1237 #include <comphelper/stl_types.hxx>
1238 #include <osl/thread.hxx>
1240 +#include <hash_map>
1242 namespace connectivity
1246 class MQueryHelperResultEntry
1249 - mutable ::osl::Mutex m_aMutex;
1250 + typedef ::std::hash_map< ::rtl::OString, ::rtl::OUString, ::rtl::OStringHash > FieldMap;
1252 - DECLARE_STL_USTRINGACCESS_MAP(::rtl::OUString,fieldMap);
1253 + mutable ::osl::Mutex m_aMutex;
1254 + FieldMap m_Fields;
1255 + nsCOMPtr<nsIAbCard> m_Card;
1256 + sal_Int32 m_RowStates;
1258 - fieldMap m_Fields;
1259 - nsCOMPtr<nsIAbCard> m_Card;
1260 - sal_Int32 m_RowStates;
1262 MQueryHelperResultEntry();
1263 ~MQueryHelperResultEntry();
1265 - void insert( const rtl::OUString &key, rtl::OUString &value );
1266 - rtl::OUString getValue( const rtl::OUString &key ) const;
1267 - rtl::OUString setValue( const rtl::OUString &key, const rtl::OUString & rValue);
1268 + void insert( const rtl::OString &key, rtl::OUString &value );
1269 + rtl::OUString getValue( const rtl::OString &key ) const;
1270 + void setValue( const rtl::OString &key, const rtl::OUString & rValue);
1272 void setCard(nsIAbCard *card);
1273 nsIAbCard *getCard();
1275 sal_Int32 getRowStates() { return m_RowStates;};
1278 - class MQueryHelper : public nsIAbDirectoryQueryResultListener, public ErrorResourceAccess
1279 + class MQueryHelper :public nsIAbDirectoryQueryResultListener
1280 + ,public ErrorResourceAccess
1283 typedef std::vector< MQueryHelperResultEntry* > resultsArray;
1285 void clearResultOrComplete();
1286 void notifyResultOrComplete();
1287 sal_Bool waitForResultOrComplete( );
1288 - void addCardAttributeAndValue(const ::rtl::OUString& sName, nsXPIDLString sValue,MQueryHelperResultEntry *resEntry);
1289 - void getCardAttributeAndValue(const ::rtl::OUString& sName, ::rtl::OUString &ouValue, MQueryHelperResultEntry *resEntry) ;
1290 void getCardValues(nsIAbCard *card,sal_Int32 rowIndex=0);
1291 #if OSL_DEBUG_LEVEL > 0
1292 oslThreadIdentifier m_oThreadID;
1293 --- connectivity/source/drivers/mozab/mozillasrc/MQuery.hxx (.../tags/DEV300_m41/connectivity) (revision 269329)
1294 +++ connectivity/source/drivers/mozab/mozillasrc/MQuery.hxx (.../cws/moz2seamonkey01/connectivity) (revision 269329)
1297 MQueryDirectory *m_aQueryDirectory;
1298 MQueryHelper *m_aQueryHelper;
1299 - ::std::vector< ::rtl::OUString> m_aAttributes;
1300 ::rtl::OUString m_aAddressbook;
1301 sal_Int32 m_nMaxNrOfReturns;
1302 sal_Bool m_bQuerySubDirs;
1305 sal_uInt32 InsertLoginInfo(OConnection* _pCon);
1307 - void setAttributes( ::std::vector< ::rtl::OUString>&);
1308 - const ::std::vector< ::rtl::OUString> &getAttributes(void) const;
1310 void setAddressbook( ::rtl::OUString&);
1311 ::rtl::OUString getAddressbook(void) const;
1313 --- connectivity/source/drivers/mozab/mozillasrc/MTypeConverter.hxx (.../tags/DEV300_m41/connectivity) (revision 269329)
1314 +++ connectivity/source/drivers/mozab/mozillasrc/MTypeConverter.hxx (.../cws/moz2seamonkey01/connectivity) (revision 269329)
1316 static ::std::string ouStringToStlString(const ::rtl::OUString&);
1317 static ::std::string nsStringToStlString(const nsString&);
1319 + static ::rtl::OUString nsACStringToOUString( const nsACString& _source );
1320 + static ::rtl::OString nsACStringToOString( const nsACString& _source );
1321 + static void asciiOUStringToNsACString( const ::rtl::OUString& _asciiString, nsACString& _dest );
1322 + static void asciiToNsACString( const sal_Char* _asciiString, nsACString& _dest );
1325 MTypeConverter() {};
1327 --- connectivity/source/drivers/mozab/mozillasrc/MNSInclude.hxx (.../tags/DEV300_m41/connectivity) (revision 269329)
1328 +++ connectivity/source/drivers/mozab/mozillasrc/MNSInclude.hxx (.../cws/moz2seamonkey01/connectivity) (revision 269329)
1330 #include <nsCOMPtr.h>
1331 #include <nsISupportsArray.h>
1332 #include <nsString.h>
1334 #if defined __SUNPRO_CC
1335 #pragma disable_warn
1336 // somewhere in the files included directly or indirectly in nsString.h, warnings are enabled, again
1338 #include <nsIAbDirectoryQueryProxy.h>
1339 #include <nsIAbDirFactory.h>
1340 #include <nsIRunnable.h>
1341 +#include <nsIAbLDAPAttributeMap.h>
1342 +#include <nsILDAPMessage.h>
1346 --- connectivity/source/drivers/mozab/MStatement.cxx (.../tags/DEV300_m41/connectivity) (revision 269329)
1347 +++ connectivity/source/drivers/mozab/MStatement.cxx (.../cws/moz2seamonkey01/connectivity) (revision 269329)
1349 #include <comphelper/property.hxx>
1350 #include <comphelper/uno3.hxx>
1351 #include <osl/thread.h>
1352 +#include <tools/diagnose_ex.h>
1353 #include <com/sun/star/sdbc/ResultSetConcurrency.hpp>
1354 #include <com/sun/star/sdbc/ResultSetType.hpp>
1355 #include <com/sun/star/sdbc/FetchDirection.hpp>
1357 using namespace com::sun::star::io;
1358 using namespace com::sun::star::util;
1359 //------------------------------------------------------------------------------
1360 -OStatement_Base::OStatement_Base(OConnection* _pConnection )
1361 - :OStatement_BASE(m_aMutex)
1362 - ,OPropertySetHelper(OStatement_BASE::rBHelper)
1363 +OCommonStatement::OCommonStatement(OConnection* _pConnection )
1364 + :OCommonStatement_IBASE(m_aMutex)
1365 + ,OPropertySetHelper(OCommonStatement_IBASE::rBHelper)
1366 + ,OCommonStatement_SBASE((::cppu::OWeakObject*)_pConnection, this)
1367 ,m_xDBMetaData(_pConnection->getMetaData())
1369 ,m_pConnection(_pConnection)
1370 ,m_aParser(_pConnection->getDriver()->getMSFactory())
1371 ,m_pSQLIterator( new OSQLParseTreeIterator( _pConnection, _pConnection->createCatalog()->getTables(), m_aParser, NULL ) )
1373 - ,rBHelper(OStatement_BASE::rBHelper)
1374 + ,rBHelper(OCommonStatement_IBASE::rBHelper)
1376 m_pConnection->acquire();
1377 - OSL_TRACE("In/Out: OStatement_Base::OStatement_Base" );
1378 + OSL_TRACE("In/Out: OCommonStatement::OCommonStatement" );
1380 // -----------------------------------------------------------------------------
1381 -OStatement_Base::~OStatement_Base()
1382 +OCommonStatement::~OCommonStatement()
1386 //------------------------------------------------------------------------------
1387 -void OStatement_Base::disposeResultSet()
1388 +void OCommonStatement::disposing()
1390 - // free the cursor if alive
1391 - Reference< XComponent > xComp(m_xResultSet.get(), UNO_QUERY);
1394 - m_xResultSet = Reference< XResultSet>();
1396 -//------------------------------------------------------------------------------
1397 -void OStatement_BASE2::disposing()
1399 ::osl::MutexGuard aGuard(m_aMutex);
1401 - disposeResultSet();
1403 + clearCachedResultSet();
1406 m_pConnection->release();
1407 @@ -119,77 +114,39 @@
1408 m_pSQLIterator->dispose();
1410 dispose_ChildImpl();
1411 - OStatement_Base::disposing();
1412 + OCommonStatement_IBASE::disposing();
1414 //-----------------------------------------------------------------------------
1415 -void SAL_CALL OStatement_BASE2::release() throw()
1416 +Any SAL_CALL OCommonStatement::queryInterface( const Type & rType ) throw(RuntimeException)
1418 - relase_ChildImpl();
1420 -//-----------------------------------------------------------------------------
1421 -Any SAL_CALL OStatement_Base::queryInterface( const Type & rType ) throw(RuntimeException)
1423 - Any aRet = OStatement_BASE::queryInterface(rType);
1424 + Any aRet = OCommonStatement_IBASE::queryInterface(rType);
1425 if(!aRet.hasValue())
1426 aRet = OPropertySetHelper::queryInterface(rType);
1429 // -------------------------------------------------------------------------
1430 -Sequence< Type > SAL_CALL OStatement_Base::getTypes( ) throw(RuntimeException)
1431 +Sequence< Type > SAL_CALL OCommonStatement::getTypes( ) throw(RuntimeException)
1433 ::cppu::OTypeCollection aTypes( ::getCppuType( (const Reference< XMultiPropertySet > *)0 ),
1434 ::getCppuType( (const Reference< XFastPropertySet > *)0 ),
1435 ::getCppuType( (const Reference< XPropertySet > *)0 ));
1437 - return ::comphelper::concatSequences(aTypes.getTypes(),OStatement_BASE::getTypes());
1438 + return ::comphelper::concatSequences(aTypes.getTypes(),OCommonStatement_IBASE::getTypes());
1440 // -------------------------------------------------------------------------
1441 -void SAL_CALL OStatement_Base::close( ) throw(SQLException, RuntimeException)
1442 +void SAL_CALL OCommonStatement::close( ) throw(SQLException, RuntimeException)
1445 ::osl::MutexGuard aGuard( m_aMutex );
1446 - checkDisposed(OStatement_BASE::rBHelper.bDisposed);
1448 + checkDisposed(OCommonStatement_IBASE::rBHelper.bDisposed);
1452 -// -------------------------------------------------------------------------
1454 -void OStatement_Base::reset() throw (SQLException)
1456 - ::osl::MutexGuard aGuard( m_aMutex );
1457 - checkDisposed(OStatement_BASE::rBHelper.bDisposed);
1462 - if (m_xResultSet.get().is())
1463 - clearMyResultSet();
1465 -//--------------------------------------------------------------------
1466 -// clearMyResultSet
1467 -// If a ResultSet was created for this Statement, close it
1468 -//--------------------------------------------------------------------
1470 -void OStatement_Base::clearMyResultSet () throw (SQLException)
1471 +// -------------------------------------------------------------------------
1472 +void OCommonStatement::createTable( ) throw ( SQLException, RuntimeException )
1474 - ::osl::MutexGuard aGuard( m_aMutex );
1475 - checkDisposed(OStatement_BASE::rBHelper.bDisposed);
1479 - Reference<XCloseable> xCloseable;
1480 - if ( ::comphelper::query_interface( m_xResultSet.get(), xCloseable ) )
1481 - xCloseable->close();
1483 - catch( const DisposedException& ) { }
1485 - m_xResultSet = Reference< XResultSet >();
1488 -void OStatement_Base::createTable( )
1489 - throw ( SQLException, RuntimeException )
1493 ::vos::ORef<connectivity::OSQLColumns> xCreateColumn;
1494 @@ -233,13 +190,11 @@
1495 getOwnConnection()->throwGenericSQLException( STR_QUERY_TOO_COMPLEX ,*this);
1497 // -------------------------------------------------------------------------
1498 -sal_Bool OStatement_Base::parseSql( const ::rtl::OUString& sql , sal_Bool bAdjusted)
1499 +OCommonStatement::StatementType OCommonStatement::parseSql( const ::rtl::OUString& sql , sal_Bool bAdjusted)
1500 throw ( SQLException, RuntimeException )
1502 ::rtl::OUString aErr;
1504 - OSL_TRACE("In/Out :: OStatement::parseSql(%s)\n", OUtoCStr( sql ) );
1506 m_pParseTree = m_aParser.parseTree(aErr,sql);
1508 #if OSL_DEBUG_LEVEL > 0
1509 @@ -285,12 +240,14 @@
1510 createColumnMapping();
1516 case SQL_STATEMENT_CREATE_TABLE:
1519 + return eCreateTable;
1522 - getOwnConnection()->throwGenericSQLException( STR_QUERY_TOO_COMPLEX ,*this);
1526 else if(!bAdjusted) //Our sql parser does not support a statement like "create table foo"
1527 @@ -298,35 +255,71 @@
1529 return parseSql(sql + ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("(""E-mail"" caracter)")),sal_True);
1532 - getOwnConnection()->throwGenericSQLException( STR_QUERY_TOO_COMPLEX ,*this);
1535 + getOwnConnection()->throwGenericSQLException( STR_QUERY_TOO_COMPLEX, *this );
1536 + OSL_ENSURE( false, "OCommonStatement::parseSql: unreachable!" );
1540 // -------------------------------------------------------------------------
1542 -OResultSet* OStatement_Base::createResultSet()
1543 +Reference< XResultSet > OCommonStatement::impl_executeCurrentQuery()
1545 - return new OResultSet( this, m_pSQLIterator );
1546 + clearCachedResultSet();
1548 + ::rtl::Reference< OResultSet > pResult( new OResultSet( this, m_pSQLIterator ) );
1549 + initializeResultSet( pResult.get() );
1551 + pResult->executeQuery();
1552 + cacheResultSet( pResult ); // only cache if we survived the execution
1554 + return pResult.get();
1557 -// -------------------------------------------------------------------------
1559 -void OStatement_Base::initializeResultSet( OResultSet* _pResult )
1560 +// -------------------------------------------------------------------------
1561 +void OCommonStatement::initializeResultSet( OResultSet* _pResult )
1563 - OSL_TRACE("In : initializeResultSet");
1564 + ENSURE_OR_THROW( _pResult, "invalid result set" );
1566 _pResult->setColumnMapping(m_aColMapping);
1567 _pResult->setOrderByColumns(m_aOrderbyColumnNumber);
1568 _pResult->setOrderByAscending(m_aOrderbyAscending);
1569 _pResult->setBindingRow(m_aRow);
1570 _pResult->setTable(m_pTable);
1571 - OSL_TRACE("Out : initializeResultSet");
1574 // -------------------------------------------------------------------------
1575 -sal_Bool SAL_CALL OStatement_Base::execute( const ::rtl::OUString& sql ) throw(SQLException, RuntimeException)
1576 +void OCommonStatement::clearCachedResultSet()
1578 + Reference< XResultSet > xResultSet( m_xResultSet.get(), UNO_QUERY );
1579 + if ( !xResultSet.is() )
1584 + Reference< XCloseable > xCloseable( xResultSet, UNO_QUERY_THROW );
1585 + xCloseable->close();
1587 + catch( const DisposedException& )
1589 + DBG_UNHANDLED_EXCEPTION();
1592 + m_xResultSet = Reference< XResultSet >();
1595 +// -------------------------------------------------------------------------
1596 +void OCommonStatement::cacheResultSet( const ::rtl::Reference< OResultSet >& _pResult )
1598 + ENSURE_OR_THROW( _pResult.is(), "invalid result set" );
1599 + m_xResultSet = Reference< XResultSet >( _pResult.get() );
1602 +// -------------------------------------------------------------------------
1603 +sal_Bool SAL_CALL OCommonStatement::execute( const ::rtl::OUString& sql ) throw(SQLException, RuntimeException)
1605 ::osl::MutexGuard aGuard( m_aMutex );
1606 - checkDisposed(OStatement_BASE::rBHelper.bDisposed);
1607 + checkDisposed(OCommonStatement_IBASE::rBHelper.bDisposed);
1609 OSL_TRACE("Statement::execute( %s )", OUtoCStr( sql ) );
1611 @@ -336,31 +329,26 @@
1613 // -------------------------------------------------------------------------
1615 -Reference< XResultSet > SAL_CALL OStatement_Base::executeQuery( const ::rtl::OUString& sql ) throw(SQLException, RuntimeException)
1616 +Reference< XResultSet > SAL_CALL OCommonStatement::executeQuery( const ::rtl::OUString& sql ) throw(SQLException, RuntimeException)
1618 ::osl::MutexGuard aGuard( m_ThreadMutex );
1619 - checkDisposed(OStatement_BASE::rBHelper.bDisposed);
1620 + checkDisposed(OCommonStatement_IBASE::rBHelper.bDisposed);
1622 OSL_TRACE("Statement::executeQuery( %s )", OUtoCStr( sql ) );
1624 - if (!parseSql( sql )) //parseSql return false means this sql is a create table statement
1625 + // parse the statement
1626 + StatementType eStatementType = parseSql( sql );
1627 + if ( eStatementType != eSelect )
1630 - OResultSet* pResult = createResultSet();
1631 - Reference< XResultSet > xRS = pResult;
1632 - initializeResultSet( pResult );
1634 - pResult->executeQuery();
1635 - m_xResultSet = xRS; // we need a reference to it for later use
1638 + return impl_executeCurrentQuery();
1640 // -------------------------------------------------------------------------
1642 -Reference< XConnection > SAL_CALL OStatement_Base::getConnection( ) throw(SQLException, RuntimeException)
1643 +Reference< XConnection > SAL_CALL OCommonStatement::getConnection( ) throw(SQLException, RuntimeException)
1645 ::osl::MutexGuard aGuard( m_aMutex );
1646 - checkDisposed(OStatement_BASE::rBHelper.bDisposed);
1647 + checkDisposed(OCommonStatement_IBASE::rBHelper.bDisposed);
1649 // just return our connection here
1650 return (Reference< XConnection >)m_pConnection;
1651 @@ -370,37 +358,37 @@
1653 Any aRet = ::cppu::queryInterface(rType,static_cast< XServiceInfo*> (this));
1654 if(!aRet.hasValue())
1655 - aRet = OStatement_Base::queryInterface(rType);
1656 + aRet = OCommonStatement::queryInterface(rType);
1659 // -------------------------------------------------------------------------
1660 -sal_Int32 SAL_CALL OStatement_Base::executeUpdate( const ::rtl::OUString& /*sql*/ ) throw(SQLException, RuntimeException)
1661 +sal_Int32 SAL_CALL OCommonStatement::executeUpdate( const ::rtl::OUString& /*sql*/ ) throw(SQLException, RuntimeException)
1663 - ::dbtools::throwFeatureNotImplementedException( "XPreparedStatement::executeUpdate", *this );
1664 + ::dbtools::throwFeatureNotImplementedException( "XStatement::executeUpdate", *this );
1668 // -------------------------------------------------------------------------
1669 -Any SAL_CALL OStatement_Base::getWarnings( ) throw(SQLException, RuntimeException)
1670 +Any SAL_CALL OCommonStatement::getWarnings( ) throw(SQLException, RuntimeException)
1672 ::osl::MutexGuard aGuard( m_aMutex );
1673 - checkDisposed(OStatement_BASE::rBHelper.bDisposed);
1674 + checkDisposed(OCommonStatement_IBASE::rBHelper.bDisposed);
1676 return makeAny(m_aLastWarning);
1678 // -------------------------------------------------------------------------
1680 // -------------------------------------------------------------------------
1681 -void SAL_CALL OStatement_Base::clearWarnings( ) throw(SQLException, RuntimeException)
1682 +void SAL_CALL OCommonStatement::clearWarnings( ) throw(SQLException, RuntimeException)
1684 ::osl::MutexGuard aGuard( m_aMutex );
1685 - checkDisposed(OStatement_BASE::rBHelper.bDisposed);
1686 + checkDisposed(OCommonStatement_IBASE::rBHelper.bDisposed);
1689 m_aLastWarning = SQLWarning();
1691 // -------------------------------------------------------------------------
1692 -::cppu::IPropertyArrayHelper* OStatement_Base::createArrayHelper( ) const
1693 +::cppu::IPropertyArrayHelper* OCommonStatement::createArrayHelper( ) const
1695 // this properties are define by the service resultset
1696 // they must in alphabetic order
1697 @@ -421,12 +409,12 @@
1700 // -------------------------------------------------------------------------
1701 -::cppu::IPropertyArrayHelper & OStatement_Base::getInfoHelper()
1702 +::cppu::IPropertyArrayHelper & OCommonStatement::getInfoHelper()
1704 - return *const_cast<OStatement_Base*>(this)->getArrayHelper();
1705 + return *const_cast<OCommonStatement*>(this)->getArrayHelper();
1707 // -------------------------------------------------------------------------
1708 -sal_Bool OStatement_Base::convertFastPropertyValue(
1709 +sal_Bool OCommonStatement::convertFastPropertyValue(
1710 Any & /*rConvertedValue*/,
1711 Any & /*rOldValue*/,
1712 sal_Int32 /*nHandle*/,
1716 // -------------------------------------------------------------------------
1717 -void OStatement_Base::setFastPropertyValue_NoBroadcast(sal_Int32 nHandle,const Any& /*rValue*/) throw (Exception)
1718 +void OCommonStatement::setFastPropertyValue_NoBroadcast(sal_Int32 nHandle,const Any& /*rValue*/) throw (Exception)
1720 // set the value to what ever is nescessary
1725 // -------------------------------------------------------------------------
1726 -void OStatement_Base::getFastPropertyValue(Any& /*rValue*/,sal_Int32 nHandle) const
1727 +void OCommonStatement::getFastPropertyValue(Any& /*rValue*/,sal_Int32 nHandle) const
1731 @@ -475,32 +463,32 @@
1732 // -------------------------------------------------------------------------
1733 IMPLEMENT_SERVICE_INFO(OStatement,"com.sun.star.sdbcx.OStatement","com.sun.star.sdbc.Statement");
1734 // -----------------------------------------------------------------------------
1735 -void SAL_CALL OStatement_Base::acquire() throw()
1736 +void SAL_CALL OCommonStatement::acquire() throw()
1738 - OStatement_BASE::acquire();
1739 + OCommonStatement_IBASE::acquire();
1741 // -----------------------------------------------------------------------------
1742 -void SAL_CALL OStatement_Base::release() throw()
1743 +void SAL_CALL OCommonStatement::release() throw()
1745 - OStatement_BASE::release();
1746 + relase_ChildImpl();
1748 // -----------------------------------------------------------------------------
1749 void SAL_CALL OStatement::acquire() throw()
1751 - OStatement_BASE2::acquire();
1752 + OCommonStatement::acquire();
1754 // -----------------------------------------------------------------------------
1755 void SAL_CALL OStatement::release() throw()
1757 - OStatement_BASE2::release();
1758 + OCommonStatement::release();
1760 // -----------------------------------------------------------------------------
1761 -Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL OStatement_Base::getPropertySetInfo( ) throw(RuntimeException)
1762 +Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL OCommonStatement::getPropertySetInfo( ) throw(RuntimeException)
1764 return ::cppu::OPropertySetHelper::createPropertySetInfo(getInfoHelper());
1766 // -----------------------------------------------------------------------------
1767 -void OStatement_Base::createColumnMapping()
1768 +void OCommonStatement::createColumnMapping()
1774 // -----------------------------------------------------------------------------
1776 -void OStatement_Base::analyseSQL()
1777 +void OCommonStatement::analyseSQL()
1779 const OSQLParseNode* pOrderbyClause = m_pSQLIterator->getOrderTree();
1784 //------------------------------------------------------------------
1785 -void OStatement_Base::setOrderbyColumn( OSQLParseNode* pColumnRef,
1786 +void OCommonStatement::setOrderbyColumn( OSQLParseNode* pColumnRef,
1787 OSQLParseNode* pAscendingDescending)
1789 ::rtl::OUString aColumnName;
1790 --- connectivity/source/drivers/mozab/MConnection.hxx (.../tags/DEV300_m41/connectivity) (revision 269329)
1791 +++ connectivity/source/drivers/mozab/MConnection.hxx (.../cws/moz2seamonkey01/connectivity) (revision 269329)
1796 - class OStatement_Base;
1798 class ODatabaseMetaData;
1800 --- connectivity/source/drivers/mozab/MStatement.hxx (.../tags/DEV300_m41/connectivity) (revision 269329)
1801 +++ connectivity/source/drivers/mozab/MStatement.hxx (.../cws/moz2seamonkey01/connectivity) (revision 269329)
1804 typedef ::cppu::WeakComponentImplHelper3< ::com::sun::star::sdbc::XStatement,
1805 ::com::sun::star::sdbc::XWarningsSupplier,
1806 - ::com::sun::star::sdbc::XCloseable> OStatement_BASE;
1807 + ::com::sun::star::sdbc::XCloseable> OCommonStatement_IBASE;
1809 //**************************************************************
1810 - //************ Class: OStatement_Base
1811 + //************ Class: OCommonStatement
1812 // is a base class for the normal statement and for the prepared statement
1813 //**************************************************************
1814 - class OStatement_Base : public comphelper::OBaseMutex,
1815 - public OStatement_BASE,
1816 - public ::cppu::OPropertySetHelper,
1817 - public ::comphelper::OPropertyArrayUsageHelper<OStatement_Base>
1818 + class OCommonStatement;
1819 + typedef ::connectivity::OSubComponent< OCommonStatement, OCommonStatement_IBASE > OCommonStatement_SBASE;
1821 + class OCommonStatement :public comphelper::OBaseMutex
1822 + ,public OCommonStatement_IBASE
1823 + ,public ::cppu::OPropertySetHelper
1824 + ,public ::comphelper::OPropertyArrayUsageHelper< OCommonStatement >
1825 + ,public OCommonStatement_SBASE
1827 - ::com::sun::star::sdbc::SQLWarning m_aLastWarning;
1829 - ::com::sun::star::uno::WeakReference< ::com::sun::star::sdbc::XResultSet> m_xResultSet; // The last ResultSet created
1830 + friend class ::connectivity::OSubComponent< OCommonStatement, OCommonStatement_IBASE >;
1833 + ::com::sun::star::sdbc::SQLWarning m_aLastWarning;
1836 + ::com::sun::star::uno::WeakReference< ::com::sun::star::sdbc::XResultSet > m_xResultSet;
1837 ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData> m_xDBMetaData;
1838 ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess> m_xColNames; // table columns
1844 - void disposeResultSet();
1846 // OPropertyArrayUsageHelper
1847 virtual ::cppu::IPropertyArrayHelper* createArrayHelper( ) const;
1848 // OPropertySetHelper
1849 @@ -123,23 +128,37 @@
1850 virtual void SAL_CALL getFastPropertyValue(
1851 ::com::sun::star::uno::Any& rValue,
1852 sal_Int32 nHandle) const;
1853 - virtual ~OStatement_Base();
1854 + virtual ~OCommonStatement();
1858 // Driver Internal Methods
1860 - virtual sal_Bool parseSql( const ::rtl::OUString& sql , sal_Bool bAdjusted = sal_False) throw (
1861 - ::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException );
1862 + enum StatementType { eSelect, eCreateTable };
1863 + /** called to do the parsing of a to-be-executed SQL statement, and set all members as needed
1865 + virtual StatementType
1866 + parseSql( const ::rtl::OUString& sql , sal_Bool bAdjusted = sal_False) throw ( ::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException );
1867 + /** called to initialize a result set, according to a previously parsed SQL statement
1869 + virtual void initializeResultSet( OResultSet* _pResult );
1870 + /** called when a possible cached instance of our last result set should be cleared
1872 + virtual void clearCachedResultSet();
1873 + /** caches a result set which has just been created by an execution of an SQL statement
1875 + virtual void cacheResultSet( const ::rtl::Reference< OResultSet >& _pResult );
1877 - OResultSet* createResultSet();
1878 - virtual void initializeResultSet( OResultSet* _pResult );
1880 + /** executes the current query (the one which has been passed to the last parseSql call)
1882 + ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet >
1883 + impl_executeCurrentQuery();
1885 void createColumnMapping();
1887 void setOrderbyColumn( connectivity::OSQLParseNode* pColumnRef,
1888 connectivity::OSQLParseNode* pAscendingDescending);
1889 - void reset () throw( ::com::sun::star::sdbc::SQLException);
1890 - void clearMyResultSet () throw( ::com::sun::star::sdbc::SQLException);
1891 virtual void createTable( ) throw (
1892 ::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException );
1894 @@ -147,11 +166,12 @@
1896 OConnection* getOwnConnection() const { return m_pConnection;}
1898 - OStatement_Base(OConnection* _pConnection );
1899 - using OStatement_BASE::operator ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >;
1900 + OCommonStatement(OConnection* _pConnection );
1901 + using OCommonStatement_IBASE::operator ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >;
1904 - virtual void SAL_CALL disposing(void){OStatement_BASE::disposing();}
1905 + virtual void SAL_CALL disposing(void);
1908 virtual void SAL_CALL release() throw();
1909 virtual void SAL_CALL acquire() throw();
1910 @@ -177,28 +197,14 @@
1911 using OPropertySetHelper::getFastPropertyValue;
1914 - class OStatement_BASE2 :public OStatement_Base
1915 - ,public ::connectivity::OSubComponent<OStatement_BASE2, OStatement_BASE>
1918 - friend class OSubComponent<OStatement_BASE2, OStatement_BASE>;
1920 - OStatement_BASE2(OConnection* _pConnection ) : OStatement_Base(_pConnection ),
1921 - ::connectivity::OSubComponent<OStatement_BASE2, OStatement_BASE>((::cppu::OWeakObject*)_pConnection, this){}
1922 - // OComponentHelper
1923 - virtual void SAL_CALL disposing(void);
1925 - virtual void SAL_CALL release() throw();
1928 - class OStatement : public OStatement_BASE2,
1929 + class OStatement : public OCommonStatement,
1930 public ::com::sun::star::lang::XServiceInfo
1935 // ein Konstruktor, der fuer das Returnen des Objektes benoetigt wird:
1936 - OStatement( OConnection* _pConnection) : OStatement_BASE2( _pConnection){}
1937 + OStatement( OConnection* _pConnection) : OCommonStatement( _pConnection){}
1938 DECLARE_SERVICE_INFO();
1940 virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
1941 --- connectivity/source/drivers/mozab/post_include_mozilla.h (.../tags/DEV300_m41/connectivity) (revision 269329)
1942 +++ connectivity/source/drivers/mozab/post_include_mozilla.h (.../cws/moz2seamonkey01/connectivity) (revision 269329)
1944 #ifdef _DEBUG_WAS_DEFINED
1945 #define _DEBUG _DEBUG_WAS_DEFINED
1948 --- connectivity/source/drivers/mozab/MResultSetMetaData.cxx (.../tags/DEV300_m41/connectivity) (revision 269329)
1949 +++ connectivity/source/drivers/mozab/MResultSetMetaData.cxx (.../cws/moz2seamonkey01/connectivity) (revision 269329)
1950 @@ -184,12 +184,7 @@
1951 if ( m_pTable->getConnection()->isLDAP() )
1953 const OColumnAlias& aAliases( m_pTable->getConnection()->getColumnAlias() );
1954 - OColumnAlias::ProgrammaticName eProgrammatic( aAliases.getProgrammaticNameIndex( sColumnName ) );
1955 - if ( ( eProgrammatic == OColumnAlias::HOMECOUNTRY )
1956 - || ( eProgrammatic == OColumnAlias::WORKCOUNTRY )
1958 - // for those, we know that they're not searchable in the Mozilla/LDAP implementation.
1959 - // There might be more ...
1960 + if ( !aAliases.isColumnSearchable( sColumnName ) )
1964 --- connectivity/source/drivers/mozab/bootstrap/MNSInit.cxx (.../tags/DEV300_m41/connectivity) (revision 269329)
1965 +++ connectivity/source/drivers/mozab/bootstrap/MNSInit.cxx (.../cws/moz2seamonkey01/connectivity) (revision 269329)
1968 #include "mozilla_nsinit.h"
1970 +#include <MNSInit.hxx>
1972 #include <sal/types.h>
1973 #include <osl/diagnose.h>
1974 #include <osl/conditn.hxx>
1975 #include <osl/file.hxx>
1976 #include <rtl/bootstrap.hxx>
1977 -#include <MNSInit.hxx>
1979 #ifndef CONNECTIVITY_MOZAB_MCONFIGACCESS_HXX
1980 #include "MConfigAccess.hxx"
1981 --- connectivity/source/drivers/mozab/bootstrap/makefile.mk (.../tags/DEV300_m41/connectivity) (revision 269329)
1982 +++ connectivity/source/drivers/mozab/bootstrap/makefile.mk (.../cws/moz2seamonkey01/connectivity) (revision 269329)
1984 $(SLO)$/MNSProfileDirServiceProvider.obj
1987 +CDEFS += -DMOZILLA_INTERNAL_API
1990 .IF "$(COMNAME)"=="sunpro5"
1991 CFLAGS += -features=tmplife
1994 -fno-rtti -Wconversion -Wpointer-arith \
1995 -Wcast-align -Woverloaded-virtual -Wsynth \
1997 + -Wno-long-long -Wno-deprecated
2001 --- connectivity/source/drivers/mozab/bootstrap/MMozillaBootstrap.cxx (.../tags/DEV300_m41/connectivity) (revision 269329)
2002 +++ connectivity/source/drivers/mozab/bootstrap/MMozillaBootstrap.cxx (.../cws/moz2seamonkey01/connectivity) (revision 269329)
2005 // MARKER(update_precomp.py): autogen include statement, do not remove
2006 #include "precompiled_connectivity.hxx"
2008 #include "MMozillaBootstrap.hxx"
2010 using namespace com::sun::star::uno;
2011 --- connectivity/source/drivers/mozab/MDatabaseMetaData.cxx (.../tags/DEV300_m41/connectivity) (revision 269329)
2012 +++ connectivity/source/drivers/mozab/MDatabaseMetaData.cxx (.../cws/moz2seamonkey01/connectivity) (revision 269329)
2015 aRow[4] = new ORowSetValueDecorator( compare->first );
2017 - aRow[17] = new ORowSetValueDecorator( static_cast< sal_Int32 >( compare->second.eProgrammaticNameIndex ) + 1 );
2018 + aRow[17] = new ORowSetValueDecorator( static_cast< sal_Int32 >( compare->second.columnPosition ) + 1 );
2019 aRows.push_back(aRow);
2022 --- connectivity/source/drivers/mozab/makefile.mk (.../tags/DEV300_m41/connectivity) (revision 269329)
2023 +++ connectivity/source/drivers/mozab/makefile.mk (.../cws/moz2seamonkey01/connectivity) (revision 269329)
2028 -MOZ_LIB_XPCOM= -L$(MOZ_LIB) -lembed_base_s -lnspr4 -lmozreg_s -lxpcom
2029 +MOZ_LIB_XPCOM= -L$(MOZ_LIB) -lembed_base_s -lnspr4 -lmozreg_s -lxpcom -lxpcom_core
2032 -MOZ_LIB_XPCOM= $(MOZ_EMBED_LIB) $(MOZ_LIB)$/nspr4.lib $(MOZ_REG_LIB) $(MOZ_LIB)$/xpcom.lib
2033 +MOZ_LIB_XPCOM= $(MOZ_EMBED_LIB) $(MOZ_LIB)$/nspr4.lib $(MOZ_REG_LIB) $(MOZ_LIB)$/xpcom.lib $(MOZ_LIB)$/xpcom_core.lib
2035 .ELSE "$(OS)"=="WNT"
2036 -MOZ_LIB_XPCOM= -L$(MOZ_LIB) -lembed_base_s -lnspr4 -lmozreg_s -lxpcom
2037 +MOZ_LIB_XPCOM= -L$(MOZ_LIB) -lnspr4 -lxpcom_core -lmozreg_s -lembed_base_s
2039 #End of mozilla specific stuff.
2042 $(SLO)$/MNSINIParser.obj \
2043 $(SLO)$/MNSRunnable.obj \
2044 $(SLO)$/MNSProfile.obj \
2045 - $(SLO)$/MNSProfileDirServiceProvider.obj
2046 + $(SLO)$/MNSProfileDirServiceProvider.obj \
2047 + $(SLO)$/MLdapAttributeMap.obj
2051 --- connectivity/source/drivers/mozab/MColumnAlias.cxx (.../tags/DEV300_m41/connectivity) (revision 269329)
2052 +++ connectivity/source/drivers/mozab/MColumnAlias.cxx (.../cws/moz2seamonkey01/connectivity) (revision 269329)
2054 #include "precompiled_connectivity.hxx"
2055 #include "MColumnAlias.hxx"
2056 #include "MConnection.hxx"
2057 +#include "MExtConfigAccess.hxx"
2059 #include <com/sun/star/beans/XPropertySet.hpp>
2060 #include <com/sun/star/container/XNameAccess.hpp>
2061 -#ifndef CONNECTIVITY_MOZAB_MEXTCONFIGACCESS_HXX
2062 -#include "MExtConfigAccess.hxx"
2065 +#include <tools/diagnose_ex.h>
2067 +#include <algorithm>
2068 +#include <functional>
2070 using namespace ::connectivity;
2071 using namespace ::connectivity::mozab;
2072 using namespace ::com::sun::star::uno;
2074 using namespace ::com::sun::star::beans;
2075 using namespace ::com::sun::star::container;
2077 -static const ::rtl::OUString sProgrammaticNames[] =
2079 - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("FirstName")),
2080 - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("LastName")),
2081 - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("DisplayName")),
2082 - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("NickName")),
2083 - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("PrimaryEmail")),
2084 - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("SecondEmail")),
2085 - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("PreferMailFormat")),
2086 - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("WorkPhone")),
2087 - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("HomePhone")),
2088 - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("FaxNumber")),
2089 - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("PagerNumber")),
2090 - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("CellularNumber")),
2091 - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("HomeAddress")),
2092 - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("HomeAddress2")),
2093 - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("HomeCity")),
2094 - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("HomeState")),
2095 - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("HomeZipCode")),
2096 - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("HomeCountry")),
2097 - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("WorkAddress")),
2098 - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("WorkAddress2")),
2099 - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("WorkCity")),
2100 - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("WorkState")),
2101 - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("WorkZipCode")),
2102 - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("WorkCountry")),
2103 - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("JobTitle")),
2104 - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Department")),
2105 - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Company")),
2106 - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("WebPage1")),
2107 - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("WebPage2")),
2108 - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("BirthYear")),
2109 - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("BirthMonth")),
2110 - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("BirthDay")),
2111 - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Custom1")),
2112 - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Custom2")),
2113 - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Custom3")),
2114 - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Custom4")),
2115 - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Notes"))
2117 //------------------------------------------------------------------------------
2118 OColumnAlias::OColumnAlias( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB )
2120 - for ( size_t i = 0; i < END - BEGIN; ++i )
2121 - m_aAliasMap[ sProgrammaticNames[i] ] = AliasDescription( sProgrammaticNames[i], static_cast< ProgrammaticName>( i ) );
2122 + static const sal_Char* s_pProgrammaticNames[] =
2130 + "PreferMailFormat",
2163 + for ( size_t i = 0; i < sizeof( s_pProgrammaticNames ) / sizeof( s_pProgrammaticNames[0] ); ++i )
2164 + m_aAliasMap[ ::rtl::OUString::createFromAscii( s_pProgrammaticNames[i] ) ] = AliasEntry( s_pProgrammaticNames[i], i );
2166 initialize( _rxORB );
2169 -//------------------------------------------------------------------
2170 +//------------------------------------------------------------------------------
2171 void OColumnAlias::initialize( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB )
2173 // open our driver settings config node
2174 @@ -112,34 +116,26 @@
2175 OSL_ENSURE( xAliasesNode.is(), "OColumnAlias::setAlias: missing the aliases node!" );
2177 // this is a set of string nodes
2178 - Sequence< ::rtl::OUString > aColumnProgrammaticNames;
2179 + Sequence< ::rtl::OUString > aProgrammaticNames;
2180 if ( xAliasesNode.is() )
2181 - aColumnProgrammaticNames = xAliasesNode->getElementNames();
2182 + aProgrammaticNames = xAliasesNode->getElementNames();
2184 //.............................................................
2185 // travel through all the set elements
2186 - const ::rtl::OUString* pProgrammaticNames = aColumnProgrammaticNames.getConstArray();
2187 - const ::rtl::OUString* pProgrammaticNamesEnd = pProgrammaticNames + aColumnProgrammaticNames.getLength();
2188 + const ::rtl::OUString* pProgrammaticNames = aProgrammaticNames.getConstArray();
2189 + const ::rtl::OUString* pProgrammaticNamesEnd = pProgrammaticNames + aProgrammaticNames.getLength();
2190 ::rtl::OUString sAssignedAlias;
2192 for ( ; pProgrammaticNames < pProgrammaticNamesEnd; ++pProgrammaticNames )
2194 - OSL_ENSURE( m_aAliasMap.end() != m_aAliasMap.find( *pProgrammaticNames ),
2195 - "OColumnAlias::setAlias: found an invalid programmtic name!" );
2196 - // if this asserts, somebody stored a programmatic name in the configuration
2197 - // which is not allowed (i.e. not in the list of known programmatics).
2198 + OSL_VERIFY( xAliasesNode->getByName( *pProgrammaticNames ) >>= sAssignedAlias );
2200 -#if OSL_DEBUG_LEVEL > 0
2201 - sal_Bool bExtractionSuccess =
2203 - xAliasesNode->getByName( *pProgrammaticNames) >>= sAssignedAlias;
2204 - OSL_ENSURE( bExtractionSuccess, "OColumnAlias::setAlias: invalid config data!" );
2206 // normalize in case the config data is corrupted
2207 // (what we really don't need is an empty alias ...)
2208 if ( 0 == sAssignedAlias.getLength() )
2209 sAssignedAlias = *pProgrammaticNames;
2211 + ::rtl::OString sAsciiProgrammaticName( ::rtl::OUStringToOString( *pProgrammaticNames, RTL_TEXTENCODING_ASCII_US ) );
2212 //.............................................................
2213 #if OSL_DEBUG_LEVEL > 0
2214 bool bFound = false;
2215 @@ -149,16 +145,12 @@
2219 - if ( search->second.sProgrammaticName == *pProgrammaticNames )
2220 + if ( search->second.programmaticAsciiName.equals( sAsciiProgrammaticName ) )
2222 - AliasDescription aDescription( search->second );
2224 - // delete this old entry for this programmatic name
2225 + AliasEntry entry( search->second );
2226 m_aAliasMap.erase( search );
2227 + m_aAliasMap[ sAssignedAlias ] = entry;
2229 - // insert the same AliasDescription under a new name - its alias
2230 - m_aAliasMap[ sAssignedAlias ] = aDescription;
2232 #if OSL_DEBUG_LEVEL > 0
2235 @@ -172,29 +164,31 @@
2237 catch( const Exception& )
2239 - OSL_ENSURE( sal_False, "OColumnAlias::setAlias: could not read my driver's configuration data!" );
2240 + DBG_UNHANDLED_EXCEPTION();
2245 //------------------------------------------------------------------
2246 -OColumnAlias::ProgrammaticName OColumnAlias::getProgrammaticNameIndex( const ::rtl::OUString& _rAliasName ) const
2247 +::rtl::OString OColumnAlias::getProgrammaticNameOrFallbackToUTF8Alias( const ::rtl::OUString& _rAlias ) const
2249 - AliasMap::const_iterator pos = m_aAliasMap.find( _rAliasName );
2250 + AliasMap::const_iterator pos = m_aAliasMap.find( _rAlias );
2251 if ( pos == m_aAliasMap.end() )
2253 - OSL_ENSURE( false, "OColumnAlias::getProgrammaticNameIndex: unknown column alias!" );
2255 + OSL_ENSURE( false, "OColumnAlias::getProgrammaticNameOrFallbackToUTF8Alias: no programmatic name for this alias!" );
2256 + return ::rtl::OUStringToOString( _rAlias, RTL_TEXTENCODING_UTF8 );
2259 - return pos->second.eProgrammaticNameIndex;
2260 + return pos->second.programmaticAsciiName;
2263 //------------------------------------------------------------------
2264 -::rtl::OUString OColumnAlias::getProgrammaticNameOrFallbackToAlias( const ::rtl::OUString& _rAlias ) const
2265 +bool OColumnAlias::isColumnSearchable( const ::rtl::OUString _alias ) const
2267 - AliasMap::const_iterator pos = m_aAliasMap.find( _rAlias );
2268 - if ( pos == m_aAliasMap.end() )
2270 - return pos->second.sProgrammaticName;
2271 + ::rtl::OString sProgrammatic = getProgrammaticNameOrFallbackToUTF8Alias( _alias );
2273 + return ( !sProgrammatic.equals( "HomeCountry" )
2274 + && !sProgrammatic.equals( "WorkCountry" )
2276 + // for those, we know that they're not searchable in the Mozilla/LDAP implementation.
2277 + // There might be more ...
2279 --- connectivity/source/drivers/mozab/MColumnAlias.hxx (.../tags/DEV300_m41/connectivity) (revision 269329)
2280 +++ connectivity/source/drivers/mozab/MColumnAlias.hxx (.../cws/moz2seamonkey01/connectivity) (revision 269329)
2283 #include <osl/mutex.hxx>
2286 +#include <hash_map>
2288 namespace connectivity
2297 - FIRSTNAME = BEGIN,
2336 - } ProgrammaticName;
2338 - struct AliasDescription
2341 - ::rtl::OUString sProgrammaticName;
2342 - ProgrammaticName eProgrammaticNameIndex;
2343 + ::rtl::OString programmaticAsciiName;
2344 + sal_Int32 columnPosition;
2346 - AliasDescription()
2347 - :eProgrammaticNameIndex( END )
2349 + :programmaticAsciiName()
2350 + ,columnPosition( 0 )
2354 - AliasDescription( const ::rtl::OUString& _rName, ProgrammaticName _eIndex )
2355 - :sProgrammaticName( _rName ), eProgrammaticNameIndex( _eIndex )
2356 + AliasEntry( const sal_Char* _programmaticAsciiName, sal_Int32 _columnPosition )
2357 + :programmaticAsciiName( _programmaticAsciiName )
2358 + ,columnPosition( _columnPosition )
2362 + typedef ::std::hash_map< ::rtl::OUString, AliasEntry, ::rtl::OUStringHash > AliasMap;
2364 - typedef ::std::map< ::rtl::OUString, AliasDescription > AliasMap;
2367 AliasMap m_aAliasMap;
2370 - ::osl::Mutex m_aMutex;
2374 - const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > & );
2375 + OColumnAlias( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > & );
2377 - ProgrammaticName getProgrammaticNameIndex( const ::rtl::OUString& _rAliasName ) const;
2378 inline bool hasAlias( const ::rtl::OUString& _rAlias ) const
2380 return m_aAliasMap.find( _rAlias ) != m_aAliasMap.end();
2382 - ::rtl::OUString getProgrammaticNameOrFallbackToAlias( const ::rtl::OUString& _rAlias ) const;
2383 + ::rtl::OString getProgrammaticNameOrFallbackToUTF8Alias( const ::rtl::OUString& _rAlias ) const;
2385 inline AliasMap::const_iterator begin() const { return m_aAliasMap.begin(); }
2386 inline AliasMap::const_iterator end() const { return m_aAliasMap.end(); }
2388 + bool isColumnSearchable( const ::rtl::OUString _alias ) const;
2391 void initialize( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB );
2393 --- connectivity/source/drivers/mozab/MPreparedStatement.cxx (.../tags/DEV300_m41/connectivity) (revision 269329)
2394 +++ connectivity/source/drivers/mozab/MPreparedStatement.cxx (.../cws/moz2seamonkey01/connectivity) (revision 269329)
2398 OPreparedStatement::OPreparedStatement( OConnection* _pConnection,const ::rtl::OUString& sql)
2399 - :OStatement_BASE2(_pConnection)
2400 + :OCommonStatement(_pConnection)
2402 ,m_sSqlStatement(sql)
2403 ,m_bPrepared(sal_False)
2404 - ,m_pResultSet( NULL )
2408 // -----------------------------------------------------------------------------
2412 // -----------------------------------------------------------------------------
2413 -sal_Bool OPreparedStatement::lateInit()
2414 +void OPreparedStatement::lateInit()
2416 - return parseSql( m_sSqlStatement );
2417 + if ( eSelect != parseSql( m_sSqlStatement ) )
2418 + throw SQLException();
2420 // -------------------------------------------------------------------------
2421 void SAL_CALL OPreparedStatement::disposing()
2423 ::osl::MutexGuard aGuard(m_aMutex);
2426 - m_pResultSet->release();
2427 + OCommonStatement::disposing();
2429 - clearMyResultSet();
2431 - OStatement_BASE2::disposing();
2434 if(m_aParameterRow.isValid())
2436 @@ -105,63 +101,61 @@
2438 // -----------------------------------------------------------------------------
2440 -sal_Bool OPreparedStatement::parseSql( const ::rtl::OUString& sql , sal_Bool bAdjusted ) throw (
2441 - ::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException )
2442 +OCommonStatement::StatementType OPreparedStatement::parseSql( const ::rtl::OUString& sql , sal_Bool bAdjusted )
2443 + throw ( ::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException )
2445 - OSL_TRACE("in :: OPreparedStatement::parseSql()");
2446 - if (!OStatement_Base::parseSql( sql, bAdjusted ))
2448 + StatementType eStatementType = OCommonStatement::parseSql( sql, bAdjusted );
2449 + if ( eStatementType != eSelect )
2450 + return eStatementType;
2452 m_xParamColumns = new OSQLColumns();
2454 - Reference<XIndexAccess> xNames(m_xColNames,UNO_QUERY);
2456 // describe all parameters need for the resultset
2457 describeParameter();
2459 - OResultSet::setBoundedColumns(m_aRow,m_xParamColumns,xNames,sal_False,m_xDBMetaData,m_aColMapping);
2460 + Reference<XIndexAccess> xNames(m_xColNames,UNO_QUERY);
2461 + OResultSet::setBoundedColumns( m_aRow, m_xParamColumns, xNames, sal_False, m_xDBMetaData, m_aColMapping );
2463 - m_pResultSet = createResultSet();
2464 - m_pResultSet->acquire();
2465 - m_xResultSet = Reference<XResultSet>(m_pResultSet);
2466 - initializeResultSet(m_pResultSet);
2467 - OSL_TRACE("Out :: OPreparedStatement::parseSql()");
2469 + return eStatementType;
2472 // -----------------------------------------------------------------------------
2474 -OResultSet* OPreparedStatement::createResultSet( )
2475 +void OPreparedStatement::initializeResultSet( OResultSet* _pResult )
2477 - OSL_TRACE("In/Out : OPreparedStatement::createResultSet( )");
2478 - return new OResultSet( this, m_pSQLIterator );
2479 + OCommonStatement::initializeResultSet( _pResult );
2480 + _pResult->setParameterColumns( m_xParamColumns );
2481 + _pResult->setParameterRow( m_aParameterRow );
2484 // -----------------------------------------------------------------------------
2485 -void OPreparedStatement::initializeResultSet( OResultSet* _pResult )
2486 +void OPreparedStatement::clearCachedResultSet()
2488 - OSL_TRACE("In : OPreparedStatement::initializeResultSet( )");
2489 - OStatement_Base::initializeResultSet( _pResult );
2491 - _pResult->setParameterColumns(m_xParamColumns);
2492 - _pResult->setParameterRow(m_aParameterRow);
2493 - OSL_TRACE("Out : OPreparedStatement::initializeResultSet( )");
2494 + OCommonStatement::clearCachedResultSet();
2495 + m_pResultSet.clear();
2496 + m_xMetaData.clear();
2498 +// -----------------------------------------------------------------------------
2499 +void OPreparedStatement::cacheResultSet( const ::rtl::Reference< OResultSet >& _pResult )
2501 + OCommonStatement::cacheResultSet( _pResult );
2502 + OSL_PRECOND( m_pResultSet == NULL, "OPreparedStatement::parseSql: you should call clearCachedResultSet before!" );
2503 + m_pResultSet = _pResult;
2506 // -----------------------------------------------------------------------------
2507 void SAL_CALL OPreparedStatement::acquire() throw()
2509 - OStatement_BASE2::acquire();
2510 + OCommonStatement::acquire();
2512 // -----------------------------------------------------------------------------
2513 void SAL_CALL OPreparedStatement::release() throw()
2515 - OStatement_BASE2::release();
2516 + OCommonStatement::release();
2518 // -----------------------------------------------------------------------------
2519 Any SAL_CALL OPreparedStatement::queryInterface( const Type & rType ) throw(RuntimeException)
2521 - Any aRet = OStatement_BASE2::queryInterface(rType);
2522 + Any aRet = OCommonStatement::queryInterface(rType);
2523 if(!aRet.hasValue())
2524 aRet = OPreparedStatement_BASE::queryInterface(rType);
2526 @@ -169,69 +163,49 @@
2527 // -------------------------------------------------------------------------
2528 ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL OPreparedStatement::getTypes( ) throw(::com::sun::star::uno::RuntimeException)
2530 - return ::comphelper::concatSequences(OPreparedStatement_BASE::getTypes(),OStatement_BASE2::getTypes());
2531 + return ::comphelper::concatSequences(OPreparedStatement_BASE::getTypes(),OCommonStatement::getTypes());
2533 // -------------------------------------------------------------------------
2535 Reference< XResultSetMetaData > SAL_CALL OPreparedStatement::getMetaData( ) throw(SQLException, RuntimeException)
2537 ::osl::MutexGuard aGuard( m_aMutex );
2538 - checkDisposed(OStatement_BASE::rBHelper.bDisposed);
2539 - sal_Bool bReadOnly= sal_True;
2541 + checkDisposed(OCommonStatement_IBASE::rBHelper.bDisposed);
2543 + sal_Bool bReadOnly = sal_True;
2544 + if ( m_pResultSet.is() )
2545 bReadOnly = m_pResultSet->determineReadOnly();
2546 - if(!m_xMetaData.is())
2547 + // if we do not have a result set, then we have not been executed, yet. In this case, assuming readonly=true is
2548 + // okay, /me thinks.
2550 + if ( !m_xMetaData.is() )
2551 m_xMetaData = new OResultSetMetaData( m_pSQLIterator->getSelectColumns(), m_pSQLIterator->getTables().begin()->first ,m_pTable,bReadOnly );
2555 -// -------------------------------------------------------------------------
2557 -void SAL_CALL OPreparedStatement::close( ) throw(SQLException, RuntimeException)
2559 - ::osl::MutexGuard aGuard( m_aMutex );
2560 - checkDisposed(OStatement_BASE::rBHelper.bDisposed);
2563 - // Reset last warning message
2567 - clearMyResultSet();
2568 - // OStatement_BASE2::close();
2570 - catch (SQLException &) {
2571 - // If we get an error, ignore
2574 - // Remove this Statement object from the Connection object's
2577 // -------------------------------------------------------------------------
2579 sal_Bool SAL_CALL OPreparedStatement::execute( ) throw(SQLException, RuntimeException)
2581 ::osl::MutexGuard aGuard( m_aMutex );
2582 - checkDisposed(OStatement_BASE::rBHelper.bDisposed);
2583 + checkDisposed(OCommonStatement_IBASE::rBHelper.bDisposed);
2586 - Reference< XResultSet> xRS = OStatement_Base::executeQuery( m_sSqlStatement );
2587 - // same as in statement with the difference that this statement also can contain parameter
2589 - OSL_TRACE("In/Out: OPreparedStatement::execute" );
2591 + Reference< XResultSet> xResult = executeQuery();
2592 + return xResult.is();
2594 // -------------------------------------------------------------------------
2596 sal_Int32 SAL_CALL OPreparedStatement::executeUpdate( ) throw(SQLException, RuntimeException)
2599 + ::dbtools::throwFeatureNotImplementedException( "XStatement::executeUpdate", *this );
2602 // -------------------------------------------------------------------------
2604 void SAL_CALL OPreparedStatement::setString( sal_Int32 parameterIndex, const ::rtl::OUString& x ) throw(SQLException, RuntimeException)
2606 ::osl::MutexGuard aGuard( m_aMutex );
2607 - checkDisposed(OStatement_BASE::rBHelper.bDisposed);
2608 + checkDisposed(OCommonStatement_IBASE::rBHelper.bDisposed);
2610 OSL_TRACE("prepStmt::setString( %s )", OUtoCStr( x ) );
2611 setParameter( parameterIndex, x );
2613 Reference< XConnection > SAL_CALL OPreparedStatement::getConnection( ) throw(SQLException, RuntimeException)
2615 ::osl::MutexGuard aGuard( m_aMutex );
2616 - checkDisposed(OStatement_BASE::rBHelper.bDisposed);
2617 + checkDisposed(OCommonStatement_IBASE::rBHelper.bDisposed);
2619 return (Reference< XConnection >)m_pConnection;
2621 @@ -251,12 +225,11 @@
2623 ::osl::MutexGuard aGuard( m_aMutex );
2624 OSL_TRACE("In: OPreparedStatement::executeQuery" );
2625 - checkDisposed(OStatement_BASE::rBHelper.bDisposed);
2626 + checkDisposed(OCommonStatement_IBASE::rBHelper.bDisposed);
2628 - Reference< XResultSet > rs = OStatement_Base::executeQuery( m_sSqlStatement );
2630 - OSL_TRACE("Out: OPreparedStatement::executeQuery" );
2632 + // our statement has already been parsed in lateInit, no need to do all this (potentially expensive)
2633 + // stuff again. Just execute.
2634 + return impl_executeCurrentQuery();
2636 // -------------------------------------------------------------------------
2639 void SAL_CALL OPreparedStatement::setNull( sal_Int32 parameterIndex, sal_Int32 /*sqlType*/ ) throw(SQLException, RuntimeException)
2641 ::osl::MutexGuard aGuard( m_aMutex );
2642 - checkDisposed(OStatement_BASE::rBHelper.bDisposed);
2643 + checkDisposed(OCommonStatement_IBASE::rBHelper.bDisposed);
2645 checkAndResizeParameters(parameterIndex);
2648 case PROPERTY_ID_USEBOOKMARKS:
2651 - OStatement_Base::setFastPropertyValue_NoBroadcast(nHandle,rValue);
2652 + OCommonStatement::setFastPropertyValue_NoBroadcast(nHandle,rValue);
2655 // -----------------------------------------------------------------------------
2657 // -----------------------------------------------------------------------------
2658 void OPreparedStatement::checkAndResizeParameters(sal_Int32 parameterIndex)
2660 - ::connectivity::checkDisposed(OStatement_BASE::rBHelper.bDisposed);
2661 + ::connectivity::checkDisposed(OCommonStatement_IBASE::rBHelper.bDisposed);
2663 if ( !m_aParameterRow.isValid() ) {
2664 m_aParameterRow = new OValueVector();
2665 --- connectivity/source/drivers/mozab/pre_include_mozilla.h (.../tags/DEV300_m41/connectivity) (revision 269329)
2666 +++ connectivity/source/drivers/mozab/pre_include_mozilla.h (.../cws/moz2seamonkey01/connectivity) (revision 269329)
2668 // Turn off DEBUG Assertions
2670 #define _DEBUG_WAS_DEFINED _DEBUG
2672 + #ifndef MOZILLA_ENABLE_DEBUG
2676 #undef _DEBUG_WAS_DEFINED
2677 + #ifdef MOZILLA_ENABLE_DEBUG
2682 // and turn off the additional virtual methods which are part of some interfaces when compiled
2685 #define DEBUG_WAS_DEFINED DEBUG
2687 + #ifndef MOZILLA_ENABLE_DEBUG
2691 #undef DEBUG_WAS_DEFINED
2692 + #ifdef MOZILLA_ENABLE_DEBUG
2697 #if defined __GNUC__
2698 --- connectivity/source/drivers/mozab/MResultSet.cxx (.../tags/DEV300_m41/connectivity) (revision 269329)
2699 +++ connectivity/source/drivers/mozab/MResultSet.cxx (.../cws/moz2seamonkey01/connectivity) (revision 269329)
2703 // -------------------------------------------------------------------------
2704 -OResultSet::OResultSet(OStatement_Base* pStmt, const ::boost::shared_ptr< connectivity::OSQLParseTreeIterator >& _pSQLIterator )
2705 +OResultSet::OResultSet(OCommonStatement* pStmt, const ::boost::shared_ptr< connectivity::OSQLParseTreeIterator >& _pSQLIterator )
2706 : OResultSet_BASE(m_aMutex)
2707 ,OPropertySetHelper(OResultSet_BASE::rBHelper)
2708 ,m_pStatement(pStmt)
2711 ResultSetEntryGuard aGuard( *this );
2712 OSL_TRACE("In/Out: OResultSet::close" );
2716 // -------------------------------------------------------------------------
2718 @@ -1123,9 +1123,6 @@
2720 m_aQuery.setExpression( queryExpression );
2722 - // We need a unique id for caching mechanism so should fetch card:URI
2723 - m_aQuery.setAttributes( m_aAttributeStrings );
2725 rtl::OUString aStr( m_pTable->getName() );
2726 m_aQuery.setAddressbook( aStr );
2728 --- connectivity/source/drivers/mozab/MDriver.cxx (.../tags/DEV300_m41/connectivity) (revision 269329)
2729 +++ connectivity/source/drivers/mozab/MDriver.cxx (.../cws/moz2seamonkey01/connectivity) (revision 269329)
2732 // load the dbtools library
2733 m_hModule = osl_loadModuleRelative(&thisModule, sModuleName.pData, 0);
2734 - OSL_ENSURE(NULL != m_hModule, "MozabDriver::ensureInit: could not load the dbtools library!");
2735 + OSL_ENSURE(NULL != m_hModule, "MozabDriver::ensureInit: could not load the mozabdrv library!");
2739 --- connectivity/source/drivers/mozab/MPreparedStatement.hxx (.../tags/DEV300_m41/connectivity) (revision 269329)
2740 +++ connectivity/source/drivers/mozab/MPreparedStatement.hxx (.../cws/moz2seamonkey01/connectivity) (revision 269329)
2742 ::com::sun::star::sdbc::XMultipleResults,
2743 ::com::sun::star::lang::XServiceInfo> OPreparedStatement_BASE;
2745 - class OPreparedStatement : public OStatement_BASE2,
2746 + class OPreparedStatement : public OCommonStatement,
2747 public OPreparedStatement_BASE
2751 ::rtl::OUString m_sSqlStatement;
2752 ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSetMetaData > m_xMetaData;
2753 sal_Bool m_bPrepared;
2754 - OResultSet* m_pResultSet;
2755 + ::rtl::Reference< OResultSet > m_pResultSet;
2756 ::vos::ORef<connectivity::OSQLColumns> m_xParamColumns; // the parameter columns
2757 OValueRow m_aParameterRow;
2760 virtual ~OPreparedStatement();
2762 virtual void SAL_CALL disposing();
2763 - virtual sal_Bool parseSql( const ::rtl::OUString& sql , sal_Bool bAdjusted = sal_False) throw (
2764 - ::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException );
2766 - virtual OResultSet* createResultSet();
2767 - ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet> initResultSet();
2768 + // OCommonStatement overridables
2769 + virtual StatementType
2770 + parseSql( const ::rtl::OUString& sql , sal_Bool bAdjusted = sal_False) throw ( ::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException );
2771 + virtual void initializeResultSet( OResultSet* _pResult );
2772 + virtual void clearCachedResultSet();
2773 + virtual void cacheResultSet( const ::rtl::Reference< OResultSet >& _pResult );
2775 - void checkAndResizeParameters(sal_Int32 parameterIndex);
2777 + void checkAndResizeParameters(sal_Int32 parameterIndex);
2778 void setParameter(sal_Int32 parameterIndex, const ORowSetValue& x);
2781 sal_uInt32 AddParameter(connectivity::OSQLParseNode * pParameter,
2782 const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& _xCol);
2783 void scanParameter(OSQLParseNode* pParseNode,::std::vector< OSQLParseNode*>& _rParaNodes);
2784 void describeColumn(OSQLParseNode* _pParameter,OSQLParseNode* _pNode,const OSQLTable& _xTable);
2785 void describeParameter();
2787 - virtual void initializeResultSet( OResultSet* _pResult );
2790 DECLARE_SERVICE_INFO();
2791 // ein Konstruktor, der fuer das Returnen des Objektes benoetigt wird:
2792 OPreparedStatement( OConnection* _pConnection,const ::rtl::OUString& sql);
2793 - sal_Bool lateInit();
2797 virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
2799 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);
2800 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);
2801 virtual void SAL_CALL clearParameters( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
2803 - virtual void SAL_CALL close( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
2804 // XResultSetMetaDataSupplier
2805 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);
2808 virtual sal_Bool SAL_CALL getMoreResults( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
2811 - using OStatement_Base::executeQuery;
2812 - using OStatement_Base::executeUpdate;
2813 - using OStatement_Base::execute;
2814 + using OCommonStatement::executeQuery;
2815 + using OCommonStatement::executeUpdate;
2816 + using OCommonStatement::execute;
2818 using OPropertySetHelper::getFastPropertyValue;
2820 --- connectivity/source/drivers/mozab/MResultSet.hxx (.../tags/DEV300_m41/connectivity) (revision 269329)
2821 +++ connectivity/source/drivers/mozab/MResultSet.hxx (.../cws/moz2seamonkey01/connectivity) (revision 269329)
2823 public ::comphelper::OPropertyArrayUsageHelper<OResultSet>
2826 - OStatement_Base* m_pStatement;
2827 + OCommonStatement* m_pStatement;
2828 ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface> m_xStatement;
2829 ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSetMetaData> m_xMetaData;
2830 sal_uInt32 m_nRowPos;
2833 DECLARE_SERVICE_INFO();
2835 - OResultSet(OStatement_Base* pStmt, const ::boost::shared_ptr< ::connectivity::OSQLParseTreeIterator >& _pSQLIterator );
2836 + OResultSet(OCommonStatement* pStmt, const ::boost::shared_ptr< ::connectivity::OSQLParseTreeIterator >& _pSQLIterator );
2839 ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > operator *()
2840 --- connectivity/source/drivers/mozab/MConnection.cxx (.../tags/DEV300_m41/connectivity) (revision 269329)
2841 +++ connectivity/source/drivers/mozab/MConnection.cxx (.../cws/moz2seamonkey01/connectivity) (revision 269329)
2843 // the statement can only be executed more than once
2844 OPreparedStatement* pPrepared = new OPreparedStatement(this,_sSql);
2845 Reference< XPreparedStatement > xReturn = pPrepared;
2846 - if ( !pPrepared->lateInit() )
2847 - throw SQLException();
2848 + pPrepared->lateInit();
2850 m_aStatements.push_back(WeakReferenceHelper(xReturn));