diff options
Diffstat (limited to 'connectivity/source/drivers/mozab')
49 files changed, 202 insertions, 374 deletions
diff --git a/connectivity/source/drivers/mozab/MColumnAlias.cxx b/connectivity/source/drivers/mozab/MColumnAlias.cxx index 72a35ef63d..7cbd66ae72 100644 --- a/connectivity/source/drivers/mozab/MColumnAlias.cxx +++ b/connectivity/source/drivers/mozab/MColumnAlias.cxx @@ -174,7 +174,7 @@ void OColumnAlias::initialize( const ::com::sun::star::uno::Reference< ::com::su AliasMap::const_iterator pos = m_aAliasMap.find( _rAlias ); if ( pos == m_aAliasMap.end() ) { - OSL_ENSURE( false, "OColumnAlias::getProgrammaticNameOrFallbackToUTF8Alias: no programmatic name for this alias!" ); + OSL_FAIL( "OColumnAlias::getProgrammaticNameOrFallbackToUTF8Alias: no programmatic name for this alias!" ); return ::rtl::OUStringToOString( _rAlias, RTL_TEXTENCODING_UTF8 ); } return pos->second.programmaticAsciiName; diff --git a/connectivity/source/drivers/mozab/MColumnAlias.hxx b/connectivity/source/drivers/mozab/MColumnAlias.hxx index b668bba01e..4aa9c07d7f 100644 --- a/connectivity/source/drivers/mozab/MColumnAlias.hxx +++ b/connectivity/source/drivers/mozab/MColumnAlias.hxx @@ -34,7 +34,7 @@ #include <osl/mutex.hxx> #include <vector> -#include <hash_map> +#include <boost/unordered_map.hpp> namespace connectivity { @@ -59,7 +59,7 @@ namespace connectivity { } }; - typedef ::std::hash_map< ::rtl::OUString, AliasEntry, ::rtl::OUStringHash > AliasMap; + typedef ::boost::unordered_map< ::rtl::OUString, AliasEntry, ::rtl::OUStringHash > AliasMap; private: AliasMap m_aAliasMap; diff --git a/connectivity/source/drivers/mozab/MColumns.cxx b/connectivity/source/drivers/mozab/MColumns.cxx index 6a95f44df0..9e81cfdc0b 100644 --- a/connectivity/source/drivers/mozab/MColumns.cxx +++ b/connectivity/source/drivers/mozab/MColumns.cxx @@ -49,7 +49,6 @@ using namespace connectivity::sdbcx; using namespace connectivity; using namespace ::com::sun::star::uno; using namespace ::com::sun::star::beans; -// using namespace ::com::sun::star::sdbcx; using namespace ::com::sun::star::sdbc; using namespace ::com::sun::star::container; using namespace ::com::sun::star::lang; diff --git a/connectivity/source/drivers/mozab/MConfigAccess.cxx b/connectivity/source/drivers/mozab/MConfigAccess.cxx index c45ee87ff8..4609b10985 100644 --- a/connectivity/source/drivers/mozab/MConfigAccess.cxx +++ b/connectivity/source/drivers/mozab/MConfigAccess.cxx @@ -58,7 +58,7 @@ namespace connectivity if ( xConfigProvider.is() ) { - ::rtl::OUString sCompleteNodePath = ::rtl::OUString::createFromAscii ("/org.openoffice.Office.DataAccess/DriverSettings/" ); + ::rtl::OUString sCompleteNodePath(RTL_CONSTASCII_USTRINGPARAM( "/org.openoffice.Office.DataAccess/DriverSettings/" )); sCompleteNodePath += OConnection::getDriverImplementationName(); //========================================================= @@ -92,7 +92,7 @@ namespace connectivity } catch( const Exception& ) { - OSL_ENSURE( sal_False, "createDriverConfigNode: caught an exception while accessing the driver's config node!" ); + OSL_FAIL( "createDriverConfigNode: caught an exception while accessing the driver's config node!" ); } // outta here @@ -149,7 +149,7 @@ namespace connectivity } catch( const Exception& ) { - OSL_ENSURE( sal_False, "getDescription: caught an exception!" ); + OSL_FAIL( "getDescription: caught an exception!" ); } } if (sDescription.getLength() == 0) @@ -177,7 +177,7 @@ namespace connectivity } catch( const Exception& ) { - OSL_ENSURE( sal_False, "getPreferredProfileName: caught an exception!" ); + OSL_FAIL( "getPreferredProfileName: caught an exception!" ); } } return sPreferredName; diff --git a/connectivity/source/drivers/mozab/MConnection.cxx b/connectivity/source/drivers/mozab/MConnection.cxx index cdf3c6df91..f7bb24e053 100644 --- a/connectivity/source/drivers/mozab/MConnection.cxx +++ b/connectivity/source/drivers/mozab/MConnection.cxx @@ -101,7 +101,7 @@ const sal_Char* getSdbcScheme( SdbcScheme _eScheme ) // ----------------------------------------------------------------------------- ::rtl::OUString OConnection::getDriverImplementationName() { - return rtl::OUString::createFromAscii(MOZAB_DRIVER_IMPL_NAME); + return rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(MOZAB_DRIVER_IMPL_NAME)); } // ----------------------------------------------------------------------------- @@ -159,7 +159,7 @@ void OConnection::construct(const ::rtl::OUString& url,const Sequence< PropertyV // sal_Int32 nLen = url.indexOf(':'); nLen = url.indexOf(':',nLen+1); - OSL_ENSURE( url.copy( 0, nLen ).equalsAscii( "sdbc:address" ), "OConnection::construct: invalid start of the URI - should never have survived XDriver::acceptsURL!" ); + OSL_ENSURE( url.copy( 0, nLen ).equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "sdbc:address" ) ), "OConnection::construct: invalid start of the URI - should never have survived XDriver::acceptsURL!" ); ::rtl::OUString aAddrbookURI(url.copy(nLen+1)); // Get Scheme @@ -573,11 +573,11 @@ void OConnection::throwSQLException( const ErrorDescriptor& _rError, const Refer "$1$", sParameter ) ); ::dbtools::throwGenericSQLException( sError, _rxContext ); - OSL_ENSURE( false, "OConnection::throwSQLException: unreachable (1)!" ); + OSL_FAIL( "OConnection::throwSQLException: unreachable (1)!" ); } throwGenericSQLException( _rError.getResId(), _rxContext ); - OSL_ENSURE( false, "OConnection::throwSQLException: unreachable (2)!" ); + OSL_FAIL( "OConnection::throwSQLException: unreachable (2)!" ); } if ( _rError.getErrorCondition() != 0 ) @@ -588,7 +588,7 @@ void OConnection::throwSQLException( const ErrorDescriptor& _rError, const Refer aErrorHelper.raiseException( _rError.getErrorCondition(), _rxContext, sParameter ); else aErrorHelper.raiseException( _rError.getErrorCondition(), _rxContext); - OSL_ENSURE( false, "OConnection::throwSQLException: unreachable (3)!" ); + OSL_FAIL( "OConnection::throwSQLException: unreachable (3)!" ); } throwGenericSQLException( STR_UNSPECIFIED_ERROR, _rxContext ); diff --git a/connectivity/source/drivers/mozab/MDriver.cxx b/connectivity/source/drivers/mozab/MDriver.cxx index 0b2950b3dd..37d0a74dda 100644 --- a/connectivity/source/drivers/mozab/MDriver.cxx +++ b/connectivity/source/drivers/mozab/MDriver.cxx @@ -93,7 +93,7 @@ void MozabDriver::disposing() //------------------------------------------------------------------------------ rtl::OUString MozabDriver::getImplementationName_Static( ) throw(RuntimeException) { - return rtl::OUString::createFromAscii(MOZAB_DRIVER_IMPL_NAME); + return rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(MOZAB_DRIVER_IMPL_NAME)); // this name is referenced in the configuration and in the mozab.xml // Please take care when changing it. } @@ -159,7 +159,7 @@ Reference< XConnection > SAL_CALL MozabDriver::connect( const ::rtl::OUString& u ::connectivity::SharedResources aResources; const ::rtl::OUString sError( aResources.getResourceStringWithSubstitution( STR_COULD_NOT_LOAD_LIB, - "$libname$", ::rtl::OUString::createFromAscii( SVLIBRARY( "mozabdrv" ) ) + "$libname$", ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( SVLIBRARY( "mozabdrv" )) ) ) ); ::dbtools::throwGenericSQLException(sError,*this); @@ -237,7 +237,7 @@ EDriverType MozabDriver::impl_classifyURL( const ::rtl::OUString& url ) // There isn't any subschema: - but could be just subschema if ( aAddrbookURI.getLength() > 0 ) aAddrbookScheme= aAddrbookURI; - else if(url == ::rtl::OUString::createFromAscii("sdbc:address:") ) + else if(url == ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("sdbc:address:")) ) return Unknown; // TODO check else return Unknown; @@ -251,7 +251,7 @@ EDriverType MozabDriver::impl_classifyURL( const ::rtl::OUString& url ) const sal_Char* pScheme; } aSchemeMap[] = { -#if defined(WNT) || defined(WIN) +#if defined(WNT) { Outlook, "outlook" }, { OutlookExpress, "outlookexp" }, #endif @@ -283,7 +283,7 @@ namespace if ( !_rFunction ) { // did not find the symbol - OSL_ENSURE( false, ::rtl::OString( "lcl_getFunctionFromModuleOrUnload: could not find the symbol " ) + ::rtl::OString( _pAsciiSymbolName ) ); + OSL_FAIL( ::rtl::OString( "lcl_getFunctionFromModuleOrUnload: could not find the symbol " ) + ::rtl::OString( _pAsciiSymbolName ) ); osl_unloadModule( _rModule ); _rModule = NULL; } @@ -301,7 +301,7 @@ bool MozabDriver::ensureInit() OSL_ENSURE(NULL == m_pCreationFunc, "MozabDriver::ensureInit: inconsistence: already have a factory function!"); - const ::rtl::OUString sModuleName = ::rtl::OUString::createFromAscii(SVLIBRARY( "mozabdrv" )); + const ::rtl::OUString sModuleName(RTL_CONSTASCII_USTRINGPARAM(SVLIBRARY( "mozabdrv" ))); // load the mozabdrv library m_hModule = osl_loadModuleRelative(&thisModule, sModuleName.pData, 0); diff --git a/connectivity/source/drivers/mozab/MPreparedStatement.cxx b/connectivity/source/drivers/mozab/MPreparedStatement.cxx index c221684cbb..6136507a0b 100644 --- a/connectivity/source/drivers/mozab/MPreparedStatement.cxx +++ b/connectivity/source/drivers/mozab/MPreparedStatement.cxx @@ -418,7 +418,7 @@ ORowSetValue& x) sal_uInt32 OPreparedStatement::AddParameter(OSQLParseNode * pParameter, const Reference<XPropertySet>& _xCol) { OSL_UNUSED( pParameter ); - // Nr. des neu hinzuzufuegenden Parameters: + // Nr. of the new added Parameters sal_uInt32 nParameter = m_xParamColumns->get().size()+1; OSL_ENSURE(SQL_ISRULE(pParameter,parameter),"OResultSet::AddParameter: Argument ist kein Parameter"); @@ -430,7 +430,7 @@ sal_uInt32 OPreparedStatement::AddParameter(OSQLParseNode * pParameter, const Re ::rtl::OUString sParameterName; - // Parameter-Column aufsetzen: + // set up Parameter-Column: sal_Int32 eType = DataType::VARCHAR; sal_uInt32 nPrecision = 255; sal_Int32 nScale = 0; @@ -438,9 +438,9 @@ sal_uInt32 OPreparedStatement::AddParameter(OSQLParseNode * pParameter, const Re if (_xCol.is()) { - // Typ, Precision, Scale ... der angegebenen Column verwenden, - // denn dieser Column wird der Wert zugewiesen bzw. mit dieser - // Column wird der Wert verglichen. + // Type, Precision, Scale ... utilize the selected Columns, + // then this Column will get the value assigned or with this + // Column will the value be compared. eType = getINT32(_xCol->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_TYPE))); nPrecision = getINT32(_xCol->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_PRECISION))); nScale = getINT32(_xCol->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_SCALE))); @@ -510,18 +510,18 @@ void OPreparedStatement::scanParameter(OSQLParseNode* pParseNode,::std::vector< { OSL_ENSURE(pParseNode != NULL,"OResultSet: interner Fehler: ungueltiger ParseNode"); - // Parameter Name-Regel gefunden? + // Parameter Name-Row found? if (SQL_ISRULE(pParseNode,parameter)) { OSL_ENSURE(pParseNode->count() >= 1,"OResultSet: Parse Tree fehlerhaft"); OSL_ENSURE(pParseNode->getChild(0)->getNodeType() == SQL_NODE_PUNCTUATION,"OResultSet: Parse Tree fehlerhaft"); _rParaNodes.push_back(pParseNode); - // Weiterer Abstieg nicht erforderlich + // further search isn't necessary return; } - // Weiter absteigen im Parse Tree + // Search on in Parse Tree for (sal_uInt32 i = 0; i < pParseNode->count(); i++) scanParameter(pParseNode->getChild(i),_rParaNodes); } diff --git a/connectivity/source/drivers/mozab/MResultSet.cxx b/connectivity/source/drivers/mozab/MResultSet.cxx index 8ca4e57b81..4552b9dc69 100644 --- a/connectivity/source/drivers/mozab/MResultSet.cxx +++ b/connectivity/source/drivers/mozab/MResultSet.cxx @@ -122,7 +122,7 @@ OResultSet::OResultSet(OCommonStatement* pStmt, const ::boost::shared_ptr< conne ,m_RowStates(0) ,m_bIsReadOnly(-1) { - + m_aQuery.setMaxNrOfReturns(pStmt->getOwnConnection()->getMaxResultRecords()); } // ------------------------------------------------------------------------- @@ -172,7 +172,7 @@ void OResultSet::methodEntry() checkDisposed(OResultSet_BASE::rBHelper.bDisposed); if ( !m_pTable ) { - OSL_ENSURE( false, "OResultSet::methodEntry: looks like we're disposed, but how is this possible?" ); + OSL_FAIL( "OResultSet::methodEntry: looks like we're disposed, but how is this possible?" ); throw DisposedException( ::rtl::OUString(), *this ); } } @@ -362,7 +362,7 @@ sal_Bool OResultSet::pushCard(sal_uInt32 cardNumber) throw(SQLException, Runtime } } return sal_True; - + } // ------------------------------------------------------------------------- sal_Bool OResultSet::fetchRow(sal_Int32 cardNumber,sal_Bool bForceReload) throw(SQLException, RuntimeException) @@ -383,7 +383,7 @@ sal_Bool OResultSet::fetchRow(sal_Int32 cardNumber,sal_Bool bForceReload) throw( } else m_aQuery.resyncRow(cardNumber); - + if ( validRow( cardNumber ) == sal_False ) return sal_False; @@ -411,7 +411,7 @@ const ORowSetValue& OResultSet::getValue(sal_Int32 cardNumber, sal_Int32 columnI { if ( fetchRow( cardNumber ) == sal_False ) { - OSL_ASSERT("fetchRow() returned False" ); + OSL_FAIL("fetchRow() returned False" ); m_bWasNull = sal_True; return *ODatabaseMetaDataResultSet::getEmptyValue(); } @@ -626,7 +626,7 @@ IPropertyArrayHelper* OResultSet::createArrayHelper( ) const DECL_BOOL_PROP1IMPL(ISBOOKMARKABLE) PropertyAttribute::READONLY); DECL_PROP1IMPL(RESULTSETCONCURRENCY,sal_Int32) PropertyAttribute::READONLY); DECL_PROP1IMPL(RESULTSETTYPE, sal_Int32) PropertyAttribute::READONLY); - + return new OPropertyArrayHelper(aProps); } // ------------------------------------------------------------------------- @@ -642,7 +642,7 @@ sal_Bool OResultSet::convertFastPropertyValue( const Any& /*rValue*/ ) throw (::com::sun::star::lang::IllegalArgumentException) { - OSL_ENSURE( false, "OResultSet::convertFastPropertyValue: not implemented!" ); + OSL_FAIL( "OResultSet::convertFastPropertyValue: not implemented!" ); switch(nHandle) { case PROPERTY_ID_ISBOOKMARKABLE: @@ -663,7 +663,7 @@ void OResultSet::setFastPropertyValue_NoBroadcast( ) throw (Exception) { - OSL_ENSURE( false, "OResultSet::setFastPropertyValue_NoBroadcast: not implemented!" ); + OSL_FAIL( "OResultSet::setFastPropertyValue_NoBroadcast: not implemented!" ); switch(nHandle) { case PROPERTY_ID_ISBOOKMARKABLE: @@ -836,7 +836,7 @@ void OResultSet::analyseWhereClause( const OSQLParseNode* parseT queryExpression.setExpressionCondition( MQueryExpression::AND ); } else { - OSL_ASSERT("analyseSQL: Error in Parse Tree"); + OSL_FAIL("analyseSQL: Error in Parse Tree"); } } else if (SQL_ISRULE(parseTree,comparison_predicate)) @@ -898,8 +898,9 @@ void OResultSet::analyseWhereClause( const OSQLParseNode* parseT OSQLParseNode *pOptEscape; const OSQLParseNode* pPart2 = parseTree->getChild(1); pColumn = parseTree->getChild(0); // Match Item - pAtom = pPart2->getChild(parseTree->count()-2); // Match String - pOptEscape = pPart2->getChild(parseTree->count()-1); // Opt Escape Rule + pAtom = pPart2->getChild(pPart2->count()-2); // Match String + pOptEscape = pPart2->getChild(pPart2->count()-1); // Opt Escape Rule + (void)pOptEscape; const bool bNot = SQL_ISTOKEN(pPart2->getChild(0), NOT); if (!(pAtom->getNodeType() == SQL_NODE_STRING || @@ -981,7 +982,7 @@ void OResultSet::analyseWhereClause( const OSQLParseNode* parseT && matchString.indexOf( MATCHCHAR ) == -1 ) { - // One occurance of '%' - no '_' matches... + // One occurrence of '%' - no '_' matches... if ( matchString.indexOf ( WILDCARD ) == 0 ) { op = MQueryOp::EndsWith; @@ -1224,7 +1225,6 @@ void SAL_CALL OResultSet::executeQuery() throw( ::com::sun::star::sdbc::SQLExcep else { sal_Bool bDistinct = sal_False; - sal_Bool bWasSorted = sal_False; OSQLParseNode *pDistinct = m_pParseTree->getChild(1); if (pDistinct && pDistinct->getTokenID() == SQL_TOKEN_DISTINCT) { @@ -1233,8 +1233,6 @@ void SAL_CALL OResultSet::executeQuery() throw( ::com::sun::star::sdbc::SQLExcep m_aOrderbyColumnNumber.push_back(m_aColMapping[1]); m_aOrderbyAscending.push_back(SQL_DESC); } - else - bWasSorted = sal_True; bDistinct = sal_True; } @@ -1265,11 +1263,10 @@ void SAL_CALL OResultSet::executeQuery() throw( ::com::sun::star::sdbc::SQLExcep eKeyType[i] = SQL_ORDERBYKEY_DOUBLE; break; - // Andere Typen sind nicht implementiert (und damit immer - // FALSE) + // Other types aren't implemented (so they are always FALSE) default: eKeyType[i] = SQL_ORDERBYKEY_NONE; - OSL_ASSERT("MResultSet::executeQuery: Order By Data Type not implemented"); + OSL_FAIL("MResultSet::executeQuery: Order By Data Type not implemented"); break; } } @@ -1375,7 +1372,7 @@ void OResultSet::setBoundedColumns(const OValueRow& _rRow, const Reference<XDatabaseMetaData>& _xMetaData, ::std::vector<sal_Int32>& _rColMapping) { - ::comphelper::UStringMixEqual aCase(_xMetaData->storesMixedCaseQuotedIdentifiers()); + ::comphelper::UStringMixEqual aCase(_xMetaData->supportsMixedCaseQuotedIdentifiers()); Reference<XPropertySet> xTableColumn; ::rtl::OUString sTableColumnName, sSelectColumnRealName; @@ -1442,7 +1439,7 @@ void OResultSet::setBoundedColumns(const OValueRow& _rRow, } catch (Exception&) { - OSL_ENSURE(sal_False, "OResultSet::setBoundedColumns: caught an Exception!"); + OSL_FAIL("OResultSet::setBoundedColumns: caught an Exception!"); } } } @@ -1566,7 +1563,7 @@ sal_Bool OResultSet::seekRow( eRowPosition pos, sal_Int32 nOffset ) } else //The requested row has not been retrived until now. We should get the right card for it. nCurCard = nCurPos + deletedCount(); - + while ( nCurCard > nNumberOfRecords && !m_aQuery.queryComplete() ) { m_aQuery.checkRowAvailable( nCurCard ); if ( m_aQuery.hadError() ) @@ -1606,7 +1603,7 @@ void OResultSet::setColumnMapping(const ::std::vector<sal_Int32>& _aColumnMappin ResultSetEntryGuard aGuard( *this ); if ( fetchCurrentRow() == sal_False ) m_pStatement->getOwnConnection()->throwSQLException( STR_ERROR_GET_ROW, *this ); - + OSL_ENSURE((!m_aRow->isDeleted()),"getBookmark called for deleted row"); return makeAny((sal_Int32)(m_aRow->get())[0]); } @@ -1644,7 +1641,7 @@ sal_Int32 OResultSet::compareBookmarks( const ::com::sun::star::uno::Any& lhs, c nResult = 1; else nResult = 0; - + return nResult; } sal_Bool OResultSet::hasOrderedBookmarks( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException) @@ -1672,7 +1669,7 @@ void OResultSet::checkPendingUpdate() throw(SQLException, RuntimeException) { OSL_TRACE("checkPendingUpdate, m_nRowPos = %u", m_nRowPos ); const sal_Int32 nCurrentRow = getCurrentCardNumber(); - + if ((m_nNewRow && nCurrentRow != m_nNewRow) || ( m_nUpdatedRow && m_nUpdatedRow != nCurrentRow)) { @@ -1682,7 +1679,7 @@ void OResultSet::checkPendingUpdate() throw(SQLException, RuntimeException) ) ); ::dbtools::throwGenericSQLException(sError,*this); } - + } void OResultSet::updateValue(sal_Int32 columnIndex ,const ORowSetValue& x) throw(SQLException, RuntimeException) { @@ -1859,14 +1856,14 @@ void SAL_CALL OResultSet::updateRow( ) throw(::com::sun::star::sdbc::SQLExcepti m_RowStates = RowStates_Error; m_pStatement->getOwnConnection()->throwSQLException( STR_ROW_CAN_NOT_SAVE, *this ); } - + if (!m_aQuery.commitRow(nCurrentCard)) { m_RowStates = RowStates_Error; m_nUpdatedRow = 0; m_pStatement->getOwnConnection()->throwSQLException( m_aQuery.getError(), *this ); } - + m_nUpdatedRow = 0; fetchCurrentRow(); OSL_TRACE("updateRow out, m_nRowPos = %u", m_nRowPos ); @@ -1878,7 +1875,7 @@ void SAL_CALL OResultSet::deleteRow( ) throw(::com::sun::star::sdbc::SQLExcepti ResultSetEntryGuard aGuard( *this ); if (rowDeleted()) m_pStatement->getOwnConnection()->throwSQLException( STR_ROW_ALREADY_DELETED, *this ); - + const sal_Int32 nCurrentRow = getCurrentCardNumber(); //fetchRow(nCurrentRow); if (!nCurrentRow) @@ -1907,7 +1904,7 @@ void SAL_CALL OResultSet::moveToInsertRow( ) throw(::com::sun::star::sdbc::SQLE OSL_TRACE("moveToInsertRow in, m_nRowPos = %u", m_nRowPos ); ResultSetEntryGuard aGuard( *this ); m_nOldRowPos = m_nRowPos; - + if (!m_nNewRow) //no new row now, insert one { checkDisposed(OResultSet_BASE::rBHelper.bDisposed); @@ -1920,7 +1917,7 @@ void SAL_CALL OResultSet::moveToInsertRow( ) throw(::com::sun::star::sdbc::SQLE m_nNewRow = m_aQuery.createNewCard(); if (!m_nNewRow) m_pStatement->getOwnConnection()->throwSQLException( STR_CAN_NOT_CREATE_ROW, *this ); - + m_RowStates = RowStates_Normal; fillKeySet(m_nNewRow); } diff --git a/connectivity/source/drivers/mozab/MResultSet.hxx b/connectivity/source/drivers/mozab/MResultSet.hxx index a39cb0e7e0..7f0f93985d 100644 --- a/connectivity/source/drivers/mozab/MResultSet.hxx +++ b/connectivity/source/drivers/mozab/MResultSet.hxx @@ -123,9 +123,9 @@ namespace connectivity virtual ~OResultSet(); public: DECLARE_SERVICE_INFO(); - + OResultSet(OCommonStatement* pStmt, const ::boost::shared_ptr< ::connectivity::OSQLParseTreeIterator >& _pSQLIterator ); - + ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > operator *() { diff --git a/connectivity/source/drivers/mozab/MResultSetMetaData.cxx b/connectivity/source/drivers/mozab/MResultSetMetaData.cxx index 170cf18e24..3ca9036c33 100644 --- a/connectivity/source/drivers/mozab/MResultSetMetaData.cxx +++ b/connectivity/source/drivers/mozab/MResultSetMetaData.cxx @@ -175,7 +175,7 @@ sal_Bool SAL_CALL OResultSetMetaData::isSearchable( sal_Int32 column ) throw(SQL if ( !m_pTable || !m_pTable->getConnection() ) { - OSL_ENSURE( false, "OResultSetMetaData::isSearchable: suspicious: called without table or connection!" ); + OSL_FAIL( "OResultSetMetaData::isSearchable: suspicious: called without table or connection!" ); return sal_False; } diff --git a/connectivity/source/drivers/mozab/MServices.cxx b/connectivity/source/drivers/mozab/MServices.cxx index 24be4a1be7..4856d29de7 100644 --- a/connectivity/source/drivers/mozab/MServices.cxx +++ b/connectivity/source/drivers/mozab/MServices.cxx @@ -40,7 +40,6 @@ using namespace connectivity::mozab; using ::rtl::OUString; using ::com::sun::star::uno::Reference; using ::com::sun::star::uno::Sequence; -using ::com::sun::star::registry::XRegistryKey; using ::com::sun::star::lang::XSingleServiceFactory; using ::com::sun::star::lang::XMultiServiceFactory; using ::com::sun::star::mozilla::XMozillaBootstrap; @@ -54,31 +53,6 @@ typedef Reference< XSingleServiceFactory > (SAL_CALL *createFactoryFunc) rtl_ModuleCount* _pTemp ); -//*************************************************************************************** -// -// Die vorgeschriebene C-Api muss erfuellt werden! -// Sie besteht aus drei Funktionen, die von dem Modul exportiert werden muessen. -// - -//--------------------------------------------------------------------------------------- -void REGISTER_PROVIDER( - const OUString& aServiceImplName, - const Sequence< OUString>& Services, - const Reference< ::com::sun::star::registry::XRegistryKey > & xKey) -{ - OUString aMainKeyName; - aMainKeyName = OUString( RTL_CONSTASCII_USTRINGPARAM("/")); - aMainKeyName += aServiceImplName; - aMainKeyName += OUString( RTL_CONSTASCII_USTRINGPARAM("/UNO/SERVICES")); - - Reference< ::com::sun::star::registry::XRegistryKey > xNewKey( xKey->createKey(aMainKeyName) ); - OSL_ENSURE(xNewKey.is(), "MOZAB::component_writeInfo : could not create a registry key !"); - - for (sal_Int32 i=0; i<Services.getLength(); ++i) - xNewKey->createKey(Services[i]); -} - - //--------------------------------------------------------------------------------------- struct ProviderRequest { @@ -128,41 +102,10 @@ component_getImplementationEnvironment( *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; } -//--------------------------------------------------------------------------------------- -extern "C" SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo( - void* /*pServiceManager*/, - void* pRegistryKey - ) -{ - if (pRegistryKey) - try - { - Reference< ::com::sun::star::registry::XRegistryKey > xKey(reinterpret_cast< ::com::sun::star::registry::XRegistryKey*>(pRegistryKey)); - - - REGISTER_PROVIDER( - MozabDriver::getImplementationName_Static(), - MozabDriver::getSupportedServiceNames_Static(), xKey); - - Sequence< ::rtl::OUString > aSNS( 1 ); - aSNS[0] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.mozilla.MozillaBootstrap")); - REGISTER_PROVIDER( - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.mozilla.MozillaBootstrap")), - aSNS, xKey); - - return sal_True; - } - catch (::com::sun::star::registry::InvalidRegistryException& ) - { - OSL_ENSURE(sal_False, "Mozab::component_writeInfo : could not create a registry key ! ## InvalidRegistryException !"); - } - - return sal_False; -} typedef void* (SAL_CALL * OMozillaBootstrap_CreateInstanceFunction)(const Reference< XMultiServiceFactory >& _rxFactory ); ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL createMozillaBootstrap(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxFactory) throw( ::com::sun::star::uno::Exception ) { - const ::rtl::OUString sModuleName = ::rtl::OUString::createFromAscii(SVLIBRARY( "mozabdrv" )); + const ::rtl::OUString sModuleName(RTL_CONSTASCII_USTRINGPARAM(SVLIBRARY( "mozabdrv" ))); // load the dbtools library oslModule s_hModule = osl_loadModuleRelative( @@ -179,7 +122,7 @@ typedef void* (SAL_CALL * OMozillaBootstrap_CreateInstanceFunction)(const Refere if (NULL == s_pCreationFunc) { // did not find the symbol - OSL_ENSURE(sal_False, "MozabDriver::registerClient: could not find the symbol for creating the factory!"); + OSL_FAIL("MozabDriver::registerClient: could not find the symbol for creating the factory!"); osl_unloadModule(s_hModule); s_hModule = NULL; } diff --git a/connectivity/source/drivers/mozab/MStatement.cxx b/connectivity/source/drivers/mozab/MStatement.cxx index e00ab8db2a..d0428c744e 100644 --- a/connectivity/source/drivers/mozab/MStatement.cxx +++ b/connectivity/source/drivers/mozab/MStatement.cxx @@ -255,7 +255,7 @@ OCommonStatement::StatementType OCommonStatement::parseSql( const ::rtl::OUStrin } getOwnConnection()->throwSQLException( STR_QUERY_TOO_COMPLEX, *this ); - OSL_ENSURE( false, "OCommonStatement::parseSql: unreachable!" ); + OSL_FAIL( "OCommonStatement::parseSql: unreachable!" ); return eSelect; } diff --git a/connectivity/source/drivers/mozab/MStatement.hxx b/connectivity/source/drivers/mozab/MStatement.hxx index de1a75d68f..029615ba00 100644 --- a/connectivity/source/drivers/mozab/MStatement.hxx +++ b/connectivity/source/drivers/mozab/MStatement.hxx @@ -199,7 +199,7 @@ namespace connectivity protected: ~OStatement(){} public: - // ein Konstruktor, der fuer das Returnen des Objektes benoetigt wird: + // a constructor, for when the object needs to be returned: OStatement( OConnection* _pConnection) : OCommonStatement( _pConnection){} DECLARE_SERVICE_INFO(); diff --git a/connectivity/source/drivers/mozab/bootstrap/MMozillaBootstrap.cxx b/connectivity/source/drivers/mozab/bootstrap/MMozillaBootstrap.cxx index b50a03d50c..384a7508cb 100644 --- a/connectivity/source/drivers/mozab/bootstrap/MMozillaBootstrap.cxx +++ b/connectivity/source/drivers/mozab/bootstrap/MMozillaBootstrap.cxx @@ -97,7 +97,7 @@ void MozillaBootstrap::disposing() //------------------------------------------------------------------------------ rtl::OUString MozillaBootstrap::getImplementationName_Static( ) throw(RuntimeException) { - return rtl::OUString::createFromAscii(MOZAB_MozillaBootstrap_IMPL_NAME); + return rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(MOZAB_MozillaBootstrap_IMPL_NAME)); } //------------------------------------------------------------------------------ Sequence< ::rtl::OUString > MozillaBootstrap::getSupportedServiceNames_Static( ) throw (RuntimeException) @@ -239,7 +239,6 @@ Sequence< ::rtl::OUString > SAL_CALL MozillaBootstrap::getSupportedServiceNames( #include <cppuhelper/factory.hxx> using ::com::sun::star::uno::Reference; using ::com::sun::star::uno::Sequence; -using ::com::sun::star::registry::XRegistryKey; using ::com::sun::star::lang::XSingleServiceFactory; using ::com::sun::star::lang::XMultiServiceFactory; @@ -252,50 +251,6 @@ component_getImplementationEnvironment( *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; } -//--------------------------------------------------------------------------------------- -void REGISTER_PROVIDER( - const ::rtl::OUString& aServiceImplName, - const Sequence< ::rtl::OUString>& Services, - const Reference< ::com::sun::star::registry::XRegistryKey > & xKey) -{ - ::rtl::OUString aMainKeyName; - aMainKeyName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("/")); - aMainKeyName += aServiceImplName; - aMainKeyName += ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("/UNO/SERVICES")); - - Reference< ::com::sun::star::registry::XRegistryKey > xNewKey( xKey->createKey(aMainKeyName) ); - OSL_ENSURE(xNewKey.is(), "MOZAB::component_writeInfo : could not create a registry key !"); - - for (sal_Int32 i=0; i<Services.getLength(); ++i) - xNewKey->createKey(Services[i]); -} - -extern "C" SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo( - void* /*pServiceManager*/, - void* pRegistryKey - ) -{ - if (pRegistryKey) - try - { - Reference< ::com::sun::star::registry::XRegistryKey > xKey(reinterpret_cast< ::com::sun::star::registry::XRegistryKey*>(pRegistryKey)); - - Sequence< ::rtl::OUString > aSNS( 1 ); - aSNS[0] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.mozilla.MozillaBootstrap")); - REGISTER_PROVIDER( - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.mozilla.MozillaBootstrap")), - aSNS, xKey); - - return sal_True; - } - catch (::com::sun::star::registry::InvalidRegistryException& ) - { - OSL_ENSURE(sal_False, "Mozab::component_writeInfo : could not create a registry key ! ## InvalidRegistryException !"); - } - - return sal_False; -} - static Reference< XInterface > SAL_CALL createInstance( const Reference< XMultiServiceFactory >& rServiceManager ) { MozillaBootstrap * pBootstrap = reinterpret_cast<MozillaBootstrap*>(OMozillaBootstrap_CreateInstance(rServiceManager)); diff --git a/connectivity/source/drivers/mozab/bootstrap/MNSFolders.cxx b/connectivity/source/drivers/mozab/bootstrap/MNSFolders.cxx index 240d8a8a59..e9589a0582 100644 --- a/connectivity/source/drivers/mozab/bootstrap/MNSFolders.cxx +++ b/connectivity/source/drivers/mozab/bootstrap/MNSFolders.cxx @@ -52,14 +52,6 @@ using namespace ::com::sun::star::mozilla; namespace { - #if defined(XP_MAC) || defined(XP_MACOSX) || defined(MACOSX) - #define APP_REGISTRY_NAME "Application Registry" - #elif defined(XP_WIN) || defined(XP_OS2) - #define APP_REGISTRY_NAME "registry.dat" - #else - #define APP_REGISTRY_NAME "appreg" - #endif - // ------------------------------------------------------------------- static ::rtl::OUString lcl_getUserDataDirectory() { @@ -67,22 +59,22 @@ namespace ::rtl::OUString aConfigPath; aSecurity.getConfigDir( aConfigPath ); - return aConfigPath + ::rtl::OUString::createFromAscii( "/" ); + return aConfigPath + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/")); } // ------------------------------------------------------------------- static const char* DefaultProductDir[3][3] = { #if defined(XP_WIN) - { "Mozilla/", NULL, NULL }, + { "Mozilla/SeaMonkey/", NULL, NULL }, { "Mozilla/Firefox/", NULL, NULL }, { "Thunderbird/", "Mozilla/Thunderbird/", NULL } #elif(MACOSX) - { "../Mozilla/", NULL, NULL }, + { "../Mozilla/SeaMonkey/", NULL, NULL }, { "Firefox/", NULL, NULL }, { "../Thunderbird/", NULL, NULL } #else - { ".mozilla/", NULL, NULL }, + { ".mozilla/seamonkey/", NULL, NULL }, { ".mozilla/firefox/", NULL, NULL }, { ".thunderbird/", ".mozilla-thunderbird/", ".mozilla/thunderbird/" } #endif @@ -116,7 +108,7 @@ namespace else { ::rtl::OUString sProductDirCandidate; - const char* pProfileRegistry = ( _product == MozillaProductType_Mozilla ) ? APP_REGISTRY_NAME : "profiles.ini"; + const char* pProfileRegistry = "profiles.ini"; // check all possible candidates for ( size_t i=0; i<3; ++i ) @@ -160,15 +152,5 @@ namespace return lcl_guessProfileRoot( product ); } -#ifndef MINIMAL_PROFILEDISCOVER -// ----------------------------------------------------------------------- -::rtl::OUString getRegistryFileName(MozillaProductType product) -{ - if (product == MozillaProductType_Default) - return ::rtl::OUString(); - - return getRegistryDir(product) + ::rtl::OUString::createFromAscii(APP_REGISTRY_NAME); -} -#endif /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/connectivity/source/drivers/mozab/bootstrap/MNSFolders.hxx b/connectivity/source/drivers/mozab/bootstrap/MNSFolders.hxx index 3ddf002c34..a3a52f68e8 100644 --- a/connectivity/source/drivers/mozab/bootstrap/MNSFolders.hxx +++ b/connectivity/source/drivers/mozab/bootstrap/MNSFolders.hxx @@ -37,9 +37,6 @@ #include <rtl/ustring.hxx> ::rtl::OUString getRegistryDir(::com::sun::star::mozilla::MozillaProductType product); -#ifndef MINIMAL_PROFILEDISCOVER -::rtl::OUString getRegistryFileName(::com::sun::star::mozilla::MozillaProductType product); -#endif #endif diff --git a/connectivity/source/drivers/mozab/bootstrap/MNSINIParser.cxx b/connectivity/source/drivers/mozab/bootstrap/MNSINIParser.cxx index d8f8d65055..b334bf6a85 100644 --- a/connectivity/source/drivers/mozab/bootstrap/MNSINIParser.cxx +++ b/connectivity/source/drivers/mozab/bootstrap/MNSINIParser.cxx @@ -48,7 +48,7 @@ IniParser::IniParser(OUString const & rIniName) throw(com::sun::star::io::IOExce if (iniUrl.getLength()) fileError = osl_openFile(iniUrl.pData, &handle, osl_File_OpenFlag_Read); } - catch(::com::sun::star::io::IOException e) + catch(::com::sun::star::io::IOException&) { #if OSL_DEBUG_LEVEL > 0 OString file_tmp = OUStringToOString(iniUrl, RTL_TEXTENCODING_ASCII_US); @@ -62,7 +62,7 @@ IniParser::IniParser(OUString const & rIniName) throw(com::sun::star::io::IOExce sal_uInt64 nSize = 0; osl_getFileSize(handle, &nSize); - OUString sectionName = OUString::createFromAscii("no name section"); + OUString sectionName( RTL_CONSTASCII_USTRINGPARAM( "no name section" )); while (true) { sal_uInt64 nPos; @@ -93,7 +93,7 @@ IniParser::IniParser(OUString const & rIniName) throw(com::sun::star::io::IOExce sectionName = OStringToOUString( line.copy(nIndexStart + 1,nIndexEnd - nIndexStart -1).trim(), RTL_TEXTENCODING_ASCII_US ); if (!sectionName.getLength()) - sectionName = OUString::createFromAscii("no name section"); + sectionName = OUString(RTL_CONSTASCII_USTRINGPARAM("no name section")); ini_Section *aSection = &mAllSection[sectionName]; aSection->sName = sectionName; diff --git a/connectivity/source/drivers/mozab/bootstrap/MNSINIParser.hxx b/connectivity/source/drivers/mozab/bootstrap/MNSINIParser.hxx index efe78e8a8a..6cab8e3193 100644 --- a/connectivity/source/drivers/mozab/bootstrap/MNSINIParser.hxx +++ b/connectivity/source/drivers/mozab/bootstrap/MNSINIParser.hxx @@ -31,7 +31,6 @@ #include <rtl/ustring.hxx> #include <com/sun/star/io/IOException.hpp> #include <osl/process.h> -using namespace rtl; #include <map> #include <list> @@ -40,6 +39,9 @@ using namespace rtl; #include <stdio.h> #endif +using ::rtl::OUString; +using ::rtl::OString; + struct ini_NameValue { rtl::OUString sName; diff --git a/connectivity/source/drivers/mozab/bootstrap/MNSProfile.cxx b/connectivity/source/drivers/mozab/bootstrap/MNSProfile.cxx index 54d4879acb..a711b42230 100644 --- a/connectivity/source/drivers/mozab/bootstrap/MNSProfile.cxx +++ b/connectivity/source/drivers/mozab/bootstrap/MNSProfile.cxx @@ -41,7 +41,8 @@ using namespace com::sun::star::uno; using namespace com::sun::star::lang; using namespace com::sun::star::mozilla; -using namespace rtl; + +using ::rtl::OUString; // Interfaces Needed diff --git a/connectivity/source/drivers/mozab/bootstrap/MNSProfileDiscover.cxx b/connectivity/source/drivers/mozab/bootstrap/MNSProfileDiscover.cxx index dbcd905092..2ae687fdc1 100644 --- a/connectivity/source/drivers/mozab/bootstrap/MNSProfileDiscover.cxx +++ b/connectivity/source/drivers/mozab/bootstrap/MNSProfileDiscover.cxx @@ -90,9 +90,9 @@ static NS_DEFINE_CID(kCharsetConverterManagerCID, NS_ICHARSETCONVERTERMANAGER_CI // Registry Keys -static ::rtl::OUString szProfileSubtreeString=::rtl::OUString::createFromAscii("Profiles"); -static ::rtl::OUString szCurrentProfileString= ::rtl::OUString::createFromAscii("CurrentProfile"); -static ::rtl::OUString szDirectoryString =::rtl::OUString::createFromAscii("directory"); +static ::rtl::OUString szProfileSubtreeString( RTL_CONSTASCII_USTRINGPARAM( "Profiles" )); +static ::rtl::OUString szCurrentProfileString( RTL_CONSTASCII_USTRINGPARAM( "CurrentProfile" )); +static ::rtl::OUString szDirectoryString( RTL_CONSTASCII_USTRINGPARAM( "directory" )); #ifndef MAXPATHLEN #define MAXPATHLEN 1024 @@ -144,12 +144,9 @@ namespace connectivity sal_Int32 ProfileAccess::LoadProductsInfo() { -#ifndef MINIMAL_PROFILEDISCOVER - //load mozilla profiles to m_ProductProfileList - LoadMozillaProfiles(); -#endif - sal_Int32 count=static_cast<sal_Int32>(m_ProductProfileList[MozillaProductType_Mozilla].mProfileList.size()); - + //load SeaMonkey 2 profiles to m_ProductProfileList + sal_Int32 count = LoadXPToolkitProfiles(MozillaProductType_Mozilla); + //load thunderbird profiles to m_ProductProfileList count += LoadXPToolkitProfiles(MozillaProductType_Thunderbird); @@ -158,117 +155,6 @@ namespace connectivity count += LoadXPToolkitProfiles(MozillaProductType_Firefox); return count; } -#ifndef MINIMAL_PROFILEDISCOVER - nsresult ProfileAccess::LoadMozillaProfiles() - { - sal_Int32 index=MozillaProductType_Mozilla; - ProductStruct &m_Product = m_ProductProfileList[index]; - nsresult rv = NS_OK; - - //step 1 : get mozilla registry file - nsCOMPtr<nsILocalFile> localFile; - ::rtl::OUString regDir( getRegistryFileName( MozillaProductType_Mozilla ) ); - // PRUnichar != sal_Unicode in mingw - nsAutoString registryDir(reinterpret_cast_mingw_only<const PRUnichar *>(regDir.getStr())); - rv = NS_NewLocalFile(registryDir, PR_TRUE, - getter_AddRefs(localFile)); - NS_ENSURE_SUCCESS(rv,rv); - PRBool bExist; - rv = localFile->Exists(&bExist); - NS_ENSURE_SUCCESS(rv,rv); - if (!bExist) - return rv; - nsCOMPtr<nsIRegistry> registry(do_CreateInstance(NS_REGISTRY_CONTRACTID, &rv)); - NS_ENSURE_SUCCESS(rv,rv); - //step 2: open mozilla registry file - rv = registry->Open(localFile); - NS_ENSURE_SUCCESS(rv,rv); - - nsCOMPtr<nsIEnumerator> enumKeys; - nsRegistryKey profilesTreeKey; - - //step 3:Enumerator it - rv = registry->GetKey(nsIRegistry::Common, - // PRUnichar != sal_Unicode in mingw - reinterpret_cast_mingw_only<const PRUnichar *>(szProfileSubtreeString.getStr()), - &profilesTreeKey); - if (NS_FAILED(rv)) return rv; - - nsXPIDLString tmpCurrentProfile; - - // Get the current profile - rv = registry->GetString(profilesTreeKey, - // PRUnichar != sal_Unicode in mingw - reinterpret_cast_mingw_only<const PRUnichar *>(szCurrentProfileString.getStr()), - getter_Copies(tmpCurrentProfile)); - - if (tmpCurrentProfile) - { - // PRUnichar != sal_Unicode in mingw - m_Product.setCurrentProfile ( reinterpret_cast_mingw_only<const sal_Unicode *>(NS_STATIC_CAST(const PRUnichar*, tmpCurrentProfile))); - } - - - rv = registry->EnumerateSubtrees( profilesTreeKey, getter_AddRefs(enumKeys)); - NS_ENSURE_SUCCESS(rv,rv); - - rv = enumKeys->First(); - NS_ENSURE_SUCCESS(rv,rv); - - while (NS_OK != enumKeys->IsDone()) - { - nsCOMPtr<nsISupports> base; - - rv = enumKeys->CurrentItem( getter_AddRefs(base) ); - NS_ENSURE_SUCCESS(rv,rv); - rv = enumKeys->Next(); - NS_ENSURE_SUCCESS(rv,rv); - - // Get specific interface. - nsCOMPtr <nsIRegistryNode> node; - nsIID nodeIID = NS_IREGISTRYNODE_IID; - - rv = base->QueryInterface( nodeIID, getter_AddRefs(node)); - if (NS_FAILED(rv)) continue; - - // Get node name. - nsXPIDLString profile; - rv = node->GetName(getter_Copies(profile)); - if (NS_FAILED(rv)) continue; - - nsRegistryKey profKey; - rv = node->GetKey(&profKey); - if (NS_FAILED(rv)) continue; - - - nsCOMPtr<nsILocalFile> tempLocal; - - nsXPIDLString regData; - rv = registry->GetString(profKey, - // PRUnichar != sal_Unicode in mingw - reinterpret_cast_mingw_only<const PRUnichar *>(szDirectoryString.getStr()), - getter_Copies(regData)); - if (NS_FAILED(rv)) continue; - -#if defined(XP_MAC) || defined(XP_MACOSX) || defined(MACOSX) - rv = NS_NewNativeLocalFile(nsCString(), PR_TRUE, getter_AddRefs(tempLocal)); - if (NS_SUCCEEDED(rv)) - rv = tempLocal->SetPersistentDescriptor(NS_LossyConvertUCS2toASCII(regData)); -#else - rv = NS_NewLocalFile(regData, PR_TRUE, getter_AddRefs(tempLocal)); -#endif - //Add found profile to profile lists - if (NS_SUCCEEDED(rv) && tempLocal) - { - // PRUnichar != sal_Unicode in mingw - ProfileStruct* profileItem = new ProfileStruct(MozillaProductType_Mozilla,reinterpret_cast_mingw_only<const sal_Unicode *>(NS_STATIC_CAST(const PRUnichar*, profile)),tempLocal); - m_Product.mProfileList[profileItem->getProfileName()] = profileItem; - } - - } - return rv; - } -#endif //Thunderbird and firefox profiles are saved in profiles.ini sal_Int32 ProfileAccess::LoadXPToolkitProfiles(MozillaProductType product) { @@ -280,13 +166,13 @@ namespace connectivity #endif ::rtl::OUString regDir = getRegistryDir(product); ::rtl::OUString profilesIni( regDir ); - profilesIni += ::rtl::OUString::createFromAscii( "profiles.ini" ); + profilesIni += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("profiles.ini")); IniParser parser( profilesIni ); IniSectionMap &mAllSection = *(parser.getAllSection()); IniSectionMap::iterator iBegin = mAllSection.begin(); IniSectionMap::iterator iEnd = mAllSection.end(); - for(;iBegin != iEnd;iBegin++) + for(;iBegin != iEnd;++iBegin) { ini_Section *aSection = &(*iBegin).second; ::rtl::OUString profileName; @@ -296,35 +182,35 @@ namespace connectivity for(NameValueList::iterator itor=aSection->lList.begin(); itor != aSection->lList.end(); - itor++) + ++itor) { struct ini_NameValue * aValue = &(*itor); - if (aValue->sName.equals(::rtl::OUString::createFromAscii("Name"))) + if (aValue->sName.equals(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Name")))) { profileName = aValue->sValue; } - else if (aValue->sName.equals(::rtl::OUString::createFromAscii("IsRelative"))) + else if (aValue->sName.equals(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("IsRelative")))) { sIsRelative = aValue->sValue; } - else if (aValue->sName.equals(::rtl::OUString::createFromAscii("Path"))) + else if (aValue->sName.equals(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Path")))) { profilePath = aValue->sValue; } - else if (aValue->sName.equals(::rtl::OUString::createFromAscii("Default"))) + else if (aValue->sName.equals(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Default")))) { sIsDefault = aValue->sValue; } } if (profileName.getLength() != 0 || profilePath.getLength() != 0) { +#ifndef MINIMAL_PROFILEDISCOVER sal_Int32 isRelative = 0; if (sIsRelative.getLength() != 0) { isRelative = sIsRelative.toInt32(); } -#ifndef MINIMAL_PROFILEDISCOVER nsCOMPtr<nsILocalFile> rootDir; rv = NS_NewLocalFile(EmptyString(), PR_TRUE, getter_AddRefs(rootDir)); diff --git a/connectivity/source/drivers/mozab/bootstrap/MNSProfileDiscover.hxx b/connectivity/source/drivers/mozab/bootstrap/MNSProfileDiscover.hxx index 1ce1617bad..5a9e61ebf8 100644 --- a/connectivity/source/drivers/mozab/bootstrap/MNSProfileDiscover.hxx +++ b/connectivity/source/drivers/mozab/bootstrap/MNSProfileDiscover.hxx @@ -115,9 +115,6 @@ namespace connectivity protected: ProductStruct m_ProductProfileList[4]; sal_Int32 LoadProductsInfo(); -#ifndef MINIMAL_PROFILEDISCOVER - nsresult LoadMozillaProfiles(); -#endif sal_Int32 LoadXPToolkitProfiles(MozillaProductType product); #ifndef MINIMAL_PROFILEDISCOVER //used by isProfileLocked diff --git a/connectivity/source/drivers/mozab/bootstrap/makefile.mk b/connectivity/source/drivers/mozab/bootstrap/makefile.mk index 6a4172da20..b44436e488 100644..100755 --- a/connectivity/source/drivers/mozab/bootstrap/makefile.mk +++ b/connectivity/source/drivers/mozab/bootstrap/makefile.mk @@ -78,6 +78,14 @@ SHL1STDLIBS=\ $(SALLIB) \ $(COMPHELPERLIB) +ALLTAR : $(MISC)/mozbootstrap.component + +$(MISC)/mozbootstrap.component .ERRREMOVE : \ + $(SOLARENV)/bin/createcomponent.xslt mozbootstrap.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt mozbootstrap.component + .ELSE SLOFILES += \ $(SLO)$/MNSInit.obj \ @@ -90,4 +98,3 @@ SLOFILES += \ # --- Targets ---------------------------------- .INCLUDE : target.mk - diff --git a/connectivity/source/drivers/mozab/bootstrap/mozbootstrap.component b/connectivity/source/drivers/mozab/bootstrap/mozbootstrap.component new file mode 100755 index 0000000000..5da158924a --- /dev/null +++ b/connectivity/source/drivers/mozab/bootstrap/mozbootstrap.component @@ -0,0 +1,34 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!--********************************************************************** +* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General Public License +* version 3 along with OpenOffice.org. If not, see +* <http://www.openoffice.org/license.html> +* for a copy of the LGPLv3 License. +* +**********************************************************************--> + +<component loader="com.sun.star.loader.SharedLibrary" + xmlns="http://openoffice.org/2010/uno-components"> + <implementation name="com.sun.star.comp.mozilla.MozillaBootstrap"> + <service name="com.sun.star.mozilla.MozillaBootstrap"/> + </implementation> +</component> diff --git a/connectivity/source/drivers/mozab/bootstrap/mozilla_nsinit.h b/connectivity/source/drivers/mozab/bootstrap/mozilla_nsinit.h index e34bc21913..e34bc21913 100644..100755 --- a/connectivity/source/drivers/mozab/bootstrap/mozilla_nsinit.h +++ b/connectivity/source/drivers/mozab/bootstrap/mozilla_nsinit.h diff --git a/connectivity/source/drivers/mozab/bootstrap/mozilla_nsprofile.h b/connectivity/source/drivers/mozab/bootstrap/mozilla_nsprofile.h index 4d65bc3cb5..4d65bc3cb5 100644..100755 --- a/connectivity/source/drivers/mozab/bootstrap/mozilla_nsprofile.h +++ b/connectivity/source/drivers/mozab/bootstrap/mozilla_nsprofile.h diff --git a/connectivity/source/drivers/mozab/bootstrap/mozilla_nsprofiledirserviceprovider.h b/connectivity/source/drivers/mozab/bootstrap/mozilla_nsprofiledirserviceprovider.h index 4bb836ed13..4bb836ed13 100644..100755 --- a/connectivity/source/drivers/mozab/bootstrap/mozilla_nsprofiledirserviceprovider.h +++ b/connectivity/source/drivers/mozab/bootstrap/mozilla_nsprofiledirserviceprovider.h diff --git a/connectivity/source/drivers/mozab/bootstrap/mozilla_profile_discover.h b/connectivity/source/drivers/mozab/bootstrap/mozilla_profile_discover.h index 03198dcab8..03198dcab8 100644..100755 --- a/connectivity/source/drivers/mozab/bootstrap/mozilla_profile_discover.h +++ b/connectivity/source/drivers/mozab/bootstrap/mozilla_profile_discover.h diff --git a/connectivity/source/drivers/mozab/bootstrap/mozilla_profilemanager.h b/connectivity/source/drivers/mozab/bootstrap/mozilla_profilemanager.h index 1579b16947..1579b16947 100644..100755 --- a/connectivity/source/drivers/mozab/bootstrap/mozilla_profilemanager.h +++ b/connectivity/source/drivers/mozab/bootstrap/mozilla_profilemanager.h diff --git a/connectivity/source/drivers/mozab/bootstrap/post_include_windows.h b/connectivity/source/drivers/mozab/bootstrap/post_include_windows.h index a33bd622ac..a33bd622ac 100644..100755 --- a/connectivity/source/drivers/mozab/bootstrap/post_include_windows.h +++ b/connectivity/source/drivers/mozab/bootstrap/post_include_windows.h diff --git a/connectivity/source/drivers/mozab/bootstrap/pre_include_windows.h b/connectivity/source/drivers/mozab/bootstrap/pre_include_windows.h index 792e8a34f4..792e8a34f4 100644..100755 --- a/connectivity/source/drivers/mozab/bootstrap/pre_include_windows.h +++ b/connectivity/source/drivers/mozab/bootstrap/pre_include_windows.h diff --git a/connectivity/source/drivers/mozab/exports.dxp b/connectivity/source/drivers/mozab/exports.dxp index 9630d7e067..f0e1c69934 100644..100755 --- a/connectivity/source/drivers/mozab/exports.dxp +++ b/connectivity/source/drivers/mozab/exports.dxp @@ -1,3 +1,2 @@ component_getImplementationEnvironment -component_writeInfo component_getFactory diff --git a/connectivity/source/drivers/mozab/makefile.mk b/connectivity/source/drivers/mozab/makefile.mk index 0a06f00134..1928961b04 100644..100755 --- a/connectivity/source/drivers/mozab/makefile.mk +++ b/connectivity/source/drivers/mozab/makefile.mk @@ -82,7 +82,7 @@ COMPONENT_CONFIG_SCHEMA=$(TARGET)2.xcs SLOFILES=\ $(SLO)$/MDriver.obj \ $(SLO)$/MServices.obj - + # --- MOZAB BASE Library ----------------------------------- SHL1VERSIONMAP=$(SOLARENV)/src/component.map @@ -184,3 +184,11 @@ $(MISC)$/$(SHL2TARGET).flt: makefile.mk @echo _TI >$@ @echo _real >>$@ + +ALLTAR : $(MISC)/mozab.component + +$(MISC)/mozab.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \ + mozab.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt mozab.component diff --git a/connectivity/source/drivers/mozab/makefile_mozab.mk b/connectivity/source/drivers/mozab/makefile_mozab.mk index bf1ed5b8ae..c984f121a2 100644..100755 --- a/connectivity/source/drivers/mozab/makefile_mozab.mk +++ b/connectivity/source/drivers/mozab/makefile_mozab.mk @@ -65,7 +65,6 @@ MOZINC = . \ -DXP_WIN32 \ -DOJI \ -DWIN32 \ - -D_X86_ \ -D_WINDOWS \ -DMOZ_XUL \ -DMOZ_REFLOW_PERF \ diff --git a/connectivity/source/drivers/mozab/mozab.component b/connectivity/source/drivers/mozab/mozab.component new file mode 100755 index 0000000000..70f5da3bfe --- /dev/null +++ b/connectivity/source/drivers/mozab/mozab.component @@ -0,0 +1,37 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!--********************************************************************** +* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General Public License +* version 3 along with OpenOffice.org. If not, see +* <http://www.openoffice.org/license.html> +* for a copy of the LGPLv3 License. +* +**********************************************************************--> + +<component loader="com.sun.star.loader.SharedLibrary" + xmlns="http://openoffice.org/2010/uno-components"> + <implementation name="com.sun.star.comp.mozilla.MozillaBootstrap"> + <service name="com.sun.star.mozilla.MozillaBootstrap"/> + </implementation> + <implementation name="com.sun.star.comp.sdbc.MozabDriver"> + <service name="com.sun.star.sdbc.Driver"/> + </implementation> +</component> diff --git a/connectivity/source/drivers/mozab/mozab.xcu b/connectivity/source/drivers/mozab/mozab.xcu index 837e180ba5..638cbeb2c0 100755..100644 --- a/connectivity/source/drivers/mozab/mozab.xcu +++ b/connectivity/source/drivers/mozab/mozab.xcu @@ -62,7 +62,7 @@ <value>com.sun.star.comp.sdbc.MozabDriver</value> </prop> <prop oor:name="DriverTypeDisplayName" oor:type="xs:string"> - <value xml:lang="en-US">Mozilla Address Book</value> + <value xml:lang="en-US">SeaMonkey Address Book</value> </prop> <node oor:name="Features"> <node oor:name="EscapeDateTime" oor:op="replace"> diff --git a/connectivity/source/drivers/mozab/mozab.xml b/connectivity/source/drivers/mozab/mozab.xml index 33e9219a16..33e9219a16 100644..100755 --- a/connectivity/source/drivers/mozab/mozab.xml +++ b/connectivity/source/drivers/mozab/mozab.xml diff --git a/connectivity/source/drivers/mozab/mozab2.xcu b/connectivity/source/drivers/mozab/mozab2.xcu index 898c099fc7..18cb3c1eaf 100755..100644 --- a/connectivity/source/drivers/mozab/mozab2.xcu +++ b/connectivity/source/drivers/mozab/mozab2.xcu @@ -32,7 +32,7 @@ <value>com.sun.star.comp.sdbc.MozabDriver</value> </prop> <prop oor:name="DriverTypeDisplayName" oor:type="xs:string"> - <value xml:lang="en-US">Mozilla Address Book</value> + <value xml:lang="en-US">SeaMonkey Address Book</value> </prop> <node oor:name="MetaData"> <node oor:name="SupportsBrowsing" oor:op="replace"> diff --git a/connectivity/source/drivers/mozab/mozabdrv.map b/connectivity/source/drivers/mozab/mozabdrv.map index a431a07377..a431a07377 100644..100755 --- a/connectivity/source/drivers/mozab/mozabdrv.map +++ b/connectivity/source/drivers/mozab/mozabdrv.map diff --git a/connectivity/source/drivers/mozab/mozillasrc/MLdapAttributeMap.cxx b/connectivity/source/drivers/mozab/mozillasrc/MLdapAttributeMap.cxx index 0064cca351..02f580a0f2 100644 --- a/connectivity/source/drivers/mozab/mozillasrc/MLdapAttributeMap.cxx +++ b/connectivity/source/drivers/mozab/mozillasrc/MLdapAttributeMap.cxx @@ -39,7 +39,7 @@ #include <tools/diagnose_ex.h> -#include <hash_map> +#include <boost/unordered_map.hpp> //........................................................................ namespace connectivity { namespace mozab { @@ -72,7 +72,7 @@ namespace connectivity { namespace mozab { } }; - typedef ::std::hash_map< ::rtl::OString, CardPropertyData, ::rtl::OStringHash > MapPropertiesToAttributes; + typedef ::boost::unordered_map< ::rtl::OString, CardPropertyData, ::rtl::OStringHash > MapPropertiesToAttributes; #define DEF_CARD_ACCESS( PropertyName ) \ &nsIAbCard::Get##PropertyName, &nsIAbCard::Set##PropertyName @@ -188,7 +188,7 @@ namespace connectivity { namespace mozab { // ------------------------------------------------------------------- NS_IMETHODIMP MLdapAttributeMap::GetAttributes(const nsACString & aProperty, PRUint32* aCount, char*** aAttrs) { - OSL_ENSURE( false, "MLdapAttributeMap::GetAttributes: not implemented!" ); + OSL_FAIL( "MLdapAttributeMap::GetAttributes: not implemented!" ); (void)aProperty; (void)aCount; (void)aAttrs; @@ -220,7 +220,7 @@ namespace connectivity { namespace mozab { // ------------------------------------------------------------------- NS_IMETHODIMP MLdapAttributeMap::SetAttributeList(const nsACString & aProperty, const nsACString & aAttributeList, PRBool allowInconsistencies) { - OSL_ENSURE( false, "MLdapAttributeMap::SetAttributeList: not implemented!" ); + OSL_FAIL( "MLdapAttributeMap::SetAttributeList: not implemented!" ); (void)aProperty; (void)aAttributeList; (void)allowInconsistencies; @@ -230,7 +230,7 @@ namespace connectivity { namespace mozab { // ------------------------------------------------------------------- NS_IMETHODIMP MLdapAttributeMap::GetProperty(const nsACString & aAttribute, nsACString & _retval) { - OSL_ENSURE( false, "MLdapAttributeMap::GetProperty: not implemented!" ); + OSL_FAIL( "MLdapAttributeMap::GetProperty: not implemented!" ); (void)aAttribute; (void)_retval; return NS_ERROR_NOT_IMPLEMENTED; @@ -266,7 +266,7 @@ namespace connectivity { namespace mozab { // ------------------------------------------------------------------- NS_IMETHODIMP MLdapAttributeMap::SetFromPrefs(const nsACString & aPrefBranchName) { - OSL_ENSURE( false, "MLdapAttributeMap::SetFromPrefs: not implemented!" ); + OSL_FAIL( "MLdapAttributeMap::SetFromPrefs: not implemented!" ); (void)aPrefBranchName; return NS_ERROR_NOT_IMPLEMENTED; } @@ -396,7 +396,7 @@ namespace connectivity { namespace mozab { _card.SetPreferMailFormat(format); } else - OSL_ENSURE( false, "MLdapAttributeMap::fillCardFromResult: unexpected property without default setters!" ); + OSL_FAIL( "MLdapAttributeMap::fillCardFromResult: unexpected property without default setters!" ); } } } @@ -439,7 +439,7 @@ namespace connectivity { namespace mozab { } } else - OSL_ENSURE( false, "MLdapAttributeMap::fillResultFromCard: unexpected property without default getters!" ); + OSL_FAIL( "MLdapAttributeMap::fillResultFromCard: unexpected property without default getters!" ); } _result.insert( prop->first, resultValue ); diff --git a/connectivity/source/drivers/mozab/mozillasrc/MNSTerminateListener.cxx b/connectivity/source/drivers/mozab/mozillasrc/MNSTerminateListener.cxx index 92967f77e8..6c2a2f5bc2 100644 --- a/connectivity/source/drivers/mozab/mozillasrc/MNSTerminateListener.cxx +++ b/connectivity/source/drivers/mozab/mozillasrc/MNSTerminateListener.cxx @@ -78,7 +78,7 @@ void MNSTerminateListener::addTerminateListener() if( xFact.is() ) { - Reference< XDesktop > xDesktop( xFact->createInstance( ::rtl::OUString::createFromAscii( "com.sun.star.frame.Desktop" ) ), UNO_QUERY ); + Reference< XDesktop > xDesktop( xFact->createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.Desktop")) ), UNO_QUERY ); if( xDesktop.is() ) xDesktop->addTerminateListener(mxTerminateListener); diff --git a/connectivity/source/drivers/mozab/mozillasrc/MNameMapper.cxx b/connectivity/source/drivers/mozab/mozillasrc/MNameMapper.cxx index e6e3944748..38310179d7 100644 --- a/connectivity/source/drivers/mozab/mozillasrc/MNameMapper.cxx +++ b/connectivity/source/drivers/mozab/mozillasrc/MNameMapper.cxx @@ -40,7 +40,6 @@ using namespace connectivity::mozab; -using namespace rtl; bool MNameMapper::ltstr::operator()( const ::rtl::OUString &s1, const ::rtl::OUString &s2) const diff --git a/connectivity/source/drivers/mozab/mozillasrc/MQuery.cxx b/connectivity/source/drivers/mozab/mozillasrc/MQuery.cxx index a78b9abed5..1e09198a87 100644 --- a/connectivity/source/drivers/mozab/mozillasrc/MQuery.cxx +++ b/connectivity/source/drivers/mozab/mozillasrc/MQuery.cxx @@ -300,7 +300,7 @@ static sal_Int32 generateExpression( MQuery* _aQuery, MQueryExpression* _aExpr, } else { // Should never see this... - OSL_ASSERT("Unknown Expression Type!"); + OSL_FAIL("Unknown Expression Type!"); return( NS_ERROR_UNEXPECTED ); } } @@ -697,7 +697,7 @@ MQuery::setRowValue( ORowSetValue& rValue, sal_Int32 nDBRow,const rtl::OUString& xResEntry->setValue( m_rColumnAlias.getProgrammaticNameOrFallbackToUTF8Alias( aDBColumnName ), rValue.getString() ); break; default: - OSL_ENSURE( sal_False, "invalid data type!" ); + OSL_FAIL( "invalid data type!" ); break; } diff --git a/connectivity/source/drivers/mozab/mozillasrc/MQuery.hxx b/connectivity/source/drivers/mozab/mozillasrc/MQuery.hxx index 8015c3a74c..0495bf3cd6 100644 --- a/connectivity/source/drivers/mozab/mozillasrc/MQuery.hxx +++ b/connectivity/source/drivers/mozab/mozillasrc/MQuery.hxx @@ -75,9 +75,9 @@ namespace connectivity MQueryExpressionBase( node_type _eNodeType ) : m_eNodeType( _eNodeType ) {} public: - sal_Bool isUnknown( ) { return m_eNodeType == Unknown; } - sal_Bool isStringExpr( ) { return m_eNodeType == StringExpr; } - sal_Bool isExpr( ) { return m_eNodeType == Expr; } + sal_Bool isUnknown( ) const { return m_eNodeType == Unknown; } + sal_Bool isStringExpr( ) const { return m_eNodeType == StringExpr; } + sal_Bool isExpr( ) const { return m_eNodeType == Expr; } }; class MQueryExpressionString : public MQueryExpressionBase { @@ -137,7 +137,7 @@ namespace connectivity { return m_aExprVector; } // All expressions on a peer level use same condition operator - bool_cond getExpressionCondition( ) + bool_cond getExpressionCondition( ) const { return m_aExprCondType; } MQueryExpression() : MQueryExpressionBase( MQueryExpressionBase::Expr ), diff --git a/connectivity/source/drivers/mozab/mozillasrc/MQueryHelper.cxx b/connectivity/source/drivers/mozab/mozillasrc/MQueryHelper.cxx index a6b9cbff8f..4ea4daf8fa 100644 --- a/connectivity/source/drivers/mozab/mozillasrc/MQueryHelper.cxx +++ b/connectivity/source/drivers/mozab/mozillasrc/MQueryHelper.cxx @@ -209,7 +209,7 @@ MQueryHelper::next( ) index = m_nIndex; m_aMutex.release(); - result = getByIndex( m_nIndex + 1) ; // Add 1 as Row is numbered from 1 to N + result = getByIndex( index + 1) ; // Add 1 as Row is numbered from 1 to N if ( result ) { m_aMutex.acquire(); diff --git a/connectivity/source/drivers/mozab/mozillasrc/MQueryHelper.hxx b/connectivity/source/drivers/mozab/mozillasrc/MQueryHelper.hxx index 1da8f15464..3d81453f06 100644 --- a/connectivity/source/drivers/mozab/mozillasrc/MQueryHelper.hxx +++ b/connectivity/source/drivers/mozab/mozillasrc/MQueryHelper.hxx @@ -38,7 +38,7 @@ #include <comphelper/stl_types.hxx> #include <osl/thread.hxx> -#include <hash_map> +#include <boost/unordered_map.hpp> namespace connectivity { @@ -47,7 +47,7 @@ namespace connectivity class MQueryHelperResultEntry { private: - typedef ::std::hash_map< ::rtl::OString, ::rtl::OUString, ::rtl::OStringHash > FieldMap; + typedef ::boost::unordered_map< ::rtl::OString, ::rtl::OUString, ::rtl::OStringHash > FieldMap; mutable ::osl::Mutex m_aMutex; FieldMap m_Fields; @@ -65,7 +65,7 @@ namespace connectivity void setCard(nsIAbCard *card); nsIAbCard *getCard(); sal_Bool setRowStates(sal_Int32 state){m_RowStates = state; return sal_True;}; - sal_Int32 getRowStates() { return m_RowStates;}; + sal_Int32 getRowStates() const { return m_RowStates;}; }; class MQueryHelper : public nsIAbDirectoryQueryResultListener @@ -96,16 +96,13 @@ namespace connectivity #endif public: - NS_DECL_ISUPPORTS NS_DECL_NSIABDIRECTORYQUERYRESULTLISTENER MQueryHelper(); - virtual ~MQueryHelper(); void reset(); - void rewind(); MQueryHelperResultEntry* next( ); @@ -115,19 +112,15 @@ namespace connectivity const ErrorDescriptor& getError() const { return m_aError; } sal_Bool isError() const; - sal_Bool hasMore() const; - sal_Bool atEnd() const; sal_Bool queryComplete() const; sal_Bool waitForQueryComplete( ); - sal_Bool waitForRow( sal_Int32 rowNum ); sal_Int32 getResultCount() const; - sal_uInt32 getRealCount() const; sal_Int32 createNewCard(); //return Row count number sal_Bool resyncRow(sal_Int32 rowIndex); diff --git a/connectivity/source/drivers/mozab/mozillasrc/MTypeConverter.cxx b/connectivity/source/drivers/mozab/mozillasrc/MTypeConverter.cxx index 6e4d75831a..42517f5515 100644 --- a/connectivity/source/drivers/mozab/mozillasrc/MTypeConverter.cxx +++ b/connectivity/source/drivers/mozab/mozillasrc/MTypeConverter.cxx @@ -39,7 +39,7 @@ using namespace connectivity::mozab; void MTypeConverter::ouStringToNsString(::rtl::OUString const &ous, nsString &nss) { // Convert to ::rtl::OString (utf-8 encoding). - ::rtl::OString os(ous,ous.getLength(), RTL_TEXTENCODING_UTF8); + ::rtl::OString os(rtl::OUStringToOString(ous, RTL_TEXTENCODING_UTF8)); const char *cs = os.getStr(); PRUint32 csLen = os.getLength(); @@ -100,7 +100,7 @@ void MTypeConverter::prUnicharToOUString(PRUnichar const *pru, ::rtl::OUString & char *MTypeConverter::ouStringToCCharStringUtf8(::rtl::OUString const &ous) { // Convert to ::rtl::OString, - ::rtl::OString os(ous,ous.getLength(), RTL_TEXTENCODING_UTF8); + ::rtl::OString os(rtl::OUStringToOString(ous, RTL_TEXTENCODING_UTF8)); const char *cs = os.getStr(); @@ -110,7 +110,7 @@ char *MTypeConverter::ouStringToCCharStringUtf8(::rtl::OUString const &ous) char *MTypeConverter::ouStringToCCharStringAscii(::rtl::OUString const &ous) { // Convert ::rtl::OUString to ::rtl::OString, - ::rtl::OString os(ous,ous.getLength(), RTL_TEXTENCODING_ASCII_US); + ::rtl::OString os(rtl::OUStringToOString(ous, RTL_TEXTENCODING_ASCII_US)); return(strdup(os.getStr())); } @@ -126,7 +126,7 @@ char *MTypeConverter::nsStringToCCharStringAscii(nsString const &nss) ::std::string MTypeConverter::ouStringToStlString(::rtl::OUString const &ous) { // Convert ::rtl::OUString to ::rtl::OString. - ::rtl::OString os(ous,ous.getLength(),RTL_TEXTENCODING_ASCII_US); + ::rtl::OString os(rtl::OUStringToOString(ous,RTL_TEXTENCODING_ASCII_US)); return( ::std::string(os.getStr())); } // ------------------------------------------------------------------------- diff --git a/connectivity/source/drivers/mozab/mozillasrc/makefile.mk b/connectivity/source/drivers/mozab/mozillasrc/makefile.mk index 4c3e5380f4..49c0bd8033 100644..100755 --- a/connectivity/source/drivers/mozab/mozillasrc/makefile.mk +++ b/connectivity/source/drivers/mozab/mozillasrc/makefile.mk @@ -46,7 +46,7 @@ VISIBILITY_HIDDEN=TRUE .IF ("$(SYSTEM_MOZILLA)" == "YES" && "$(WITH_MOZILLA)" == "YES") || "$(WITH_MOZILLA)" == "NO" || "$(OS)" == "OS2" dummy: - @echo " Not building the mozillasrc stuff in OpenOffice.org build" + @echo " Not building the mozillasrc stuff in LibreOffice build" @echo " dependency to Mozilla developer snapshots not feasable at the moment" @echo " see http://bugzilla.mozilla.org/show_bug.cgi?id=135137" .ELSE diff --git a/connectivity/source/drivers/mozab/post_include_mozilla.h b/connectivity/source/drivers/mozab/post_include_mozilla.h index cf365e1008..cf365e1008 100644..100755 --- a/connectivity/source/drivers/mozab/post_include_mozilla.h +++ b/connectivity/source/drivers/mozab/post_include_mozilla.h diff --git a/connectivity/source/drivers/mozab/pre_include_mozilla.h b/connectivity/source/drivers/mozab/pre_include_mozilla.h index 4da60543cb..e518d820dc 100644..100755 --- a/connectivity/source/drivers/mozab/pre_include_mozilla.h +++ b/connectivity/source/drivers/mozab/pre_include_mozilla.h @@ -26,13 +26,6 @@ * ************************************************************************/ -#ifndef BOOL -# define MOZ_BOOL - -# define BOOL mozBOOL -# define Bool mozBooL -#endif - // Turn off DEBUG Assertions #ifdef _DEBUG #define _DEBUG_WAS_DEFINED _DEBUG |