[Libreoffice-commits] .: Branch 'feature/mork' - connectivity/source
connectivity/source/drivers/mork/MDatabaseMetaDataHelper.cxx |1 + 1 file changed, 1 insertion(+) New commits: commit 91675a7cfd94e11b1a38d9a1a61ef9e4cca26913 Author: David Ostrovsky da...@ostrovsky.org Date: Mon Sep 17 08:07:33 2012 +0200 mork driver: add connectivity namespace to make VS happy Change-Id: I4b66aa05bb6e415a0cfae660774e23e3e3e76218 diff --git a/connectivity/source/drivers/mork/MDatabaseMetaDataHelper.cxx b/connectivity/source/drivers/mork/MDatabaseMetaDataHelper.cxx index 8e59cc5..7a28c45 100644 --- a/connectivity/source/drivers/mork/MDatabaseMetaDataHelper.cxx +++ b/connectivity/source/drivers/mork/MDatabaseMetaDataHelper.cxx @@ -31,6 +31,7 @@ static ::osl::Mutex m_aMetaMutex; #include com/sun/star/sdb/ErrorCondition.hpp #include comphelper/processfactory.hxx +using namespace connectivity; using namespace connectivity::mork; // - ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: Branch 'feature/mork' - connectivity/source
connectivity/source/drivers/mork/MConnection.cxx | 44 + connectivity/source/drivers/mork/MConnection.hxx |3 connectivity/source/drivers/mork/MDatabaseMetaData.hxx |1 connectivity/source/drivers/mork/MDatabaseMetaDataHelper.hxx |1 connectivity/source/drivers/mork/MDriver.cxx |3 connectivity/source/drivers/mork/MErrorResource.hxx | 71 ++ connectivity/source/drivers/mork/MQueryHelper.cxx| 22 connectivity/source/drivers/mork/MQueryHelper.hxx| 119 +++ connectivity/source/drivers/mork/MResultSet.cxx | 389 +-- connectivity/source/drivers/mork/MResultSet.hxx |4 connectivity/source/drivers/mork/MStatement.cxx | 16 connectivity/source/inc/resource/conn_shared_res.hrc |2 connectivity/source/inc/resource/mork_res.hrc| 63 + 13 files changed, 660 insertions(+), 78 deletions(-) New commits: commit e1dcf3bfb8308c586e764d56697379c0c86073b8 Author: David Ostrovsky da...@ostrovsky.org Date: Sun Sep 16 14:10:14 2012 +0200 mork driver: add Sorting Change-Id: I4442bf72e75912a6fc4eeed0020549c481b60fb8 diff --git a/connectivity/source/drivers/mork/MConnection.cxx b/connectivity/source/drivers/mork/MConnection.cxx index 9a7ae5b..bb16d72 100644 --- a/connectivity/source/drivers/mork/MConnection.cxx +++ b/connectivity/source/drivers/mork/MConnection.cxx @@ -20,6 +20,7 @@ #include connectivity/dbexception.hxx #include connectivity/sqlerror.hxx +#include resource/mork_res.hrc #include resource/common_res.hrc #include com/sun/star/sdbc/ColumnValue.hpp @@ -346,7 +347,50 @@ Reference XTablesSupplier SAL_CALL OConnection::createCatalog() } // - +// - +void OConnection::throwSQLException( const ErrorDescriptor _rError, const Reference XInterface _rxContext ) +{ +if ( _rError.getResId() != 0 ) +{ +OSL_ENSURE( ( _rError.getErrorCondition() == 0 ), +OConnection::throwSQLException: unsupported error code combination! ); +::rtl::OUString sParameter( _rError.getParameter() ); +if ( !sParameter.isEmpty() ) +{ +const ::rtl::OUString sError( getResources().getResourceStringWithSubstitution( +_rError.getResId(), +$1$, sParameter + ) ); +::dbtools::throwGenericSQLException( sError, _rxContext ); +OSL_FAIL( OConnection::throwSQLException: unreachable (1)! ); +} + +throwGenericSQLException( _rError.getResId(), _rxContext ); +OSL_FAIL( OConnection::throwSQLException: unreachable (2)! ); +} + +if ( _rError.getErrorCondition() != 0 ) +{ +SQLError aErrorHelper( getDriver()-getFactory() ); +::rtl::OUString sParameter( _rError.getParameter() ); +if ( !sParameter.isEmpty() ) +aErrorHelper.raiseException( _rError.getErrorCondition(), _rxContext, sParameter ); +else +aErrorHelper.raiseException( _rError.getErrorCondition(), _rxContext); +OSL_FAIL( OConnection::throwSQLException: unreachable (3)! ); +} + +throwGenericSQLException( STR_UNSPECIFIED_ERROR, _rxContext ); +} + +// - +void OConnection::throwSQLException( const sal_uInt16 _nErrorResourceId, const Reference XInterface _rxContext ) +{ +ErrorDescriptor aError; +aError.setResId( _nErrorResourceId ); +throwSQLException( aError, _rxContext ); +} } } // namespace connectivity::mork diff --git a/connectivity/source/drivers/mork/MConnection.hxx b/connectivity/source/drivers/mork/MConnection.hxx index fd478ff..5dd1a78 100644 --- a/connectivity/source/drivers/mork/MConnection.hxx +++ b/connectivity/source/drivers/mork/MConnection.hxx @@ -109,6 +109,9 @@ namespace connectivity // Added to enable me to use SQLInterpreter which requires an // XNameAccess i/f to access tables. ::com::sun::star::uno::Reference ::com::sun::star::sdbcx::XTablesSupplier SAL_CALL createCatalog(); + +void throwSQLException( const ErrorDescriptor _rError, const ::com::sun::star::uno::Reference ::com::sun::star::uno::XInterface _rxContext ); +void throwSQLException( const sal_uInt16 _nErrorResourceId, const ::com::sun::star::uno::Reference ::com::sun::star::uno::XInterface _rxContext ); }; } } diff --git a/connectivity/source/drivers/mork/MDatabaseMetaData.hxx b/connectivity/source/drivers/mork/MDatabaseMetaData.hxx index e0cbe18..28c84de 100644 --- a/connectivity/source/drivers/mork/MDatabaseMetaData.hxx +++ b/connectivity/source/drivers/mork/MDatabaseMetaData.hxx @@ -14,6 +14,7 @@ #include connectivity/OSubComponent.hxx
[Libreoffice-commits] .: Branch 'feature/mork' - connectivity/source
connectivity/source/drivers/mork/MQueryHelper.cxx | 154 +- connectivity/source/drivers/mork/MQueryHelper.hxx |2 2 files changed, 149 insertions(+), 7 deletions(-) New commits: commit 4ba4ca8d39485ecbb4cd02a684c17d6731d73ff6 Author: David Ostrovsky da...@ostrovsky.org Date: Sun Sep 16 23:41:57 2012 +0200 mork driver: add query Change-Id: I8f32f04d2c0e0b026bbe960c6bc8895906988419 diff --git a/connectivity/source/drivers/mork/MQueryHelper.cxx b/connectivity/source/drivers/mork/MQueryHelper.cxx index 74fd046..ffc2a5f 100644 --- a/connectivity/source/drivers/mork/MQueryHelper.cxx +++ b/connectivity/source/drivers/mork/MQueryHelper.cxx @@ -38,6 +38,9 @@ using namespace ::com::sun::star::sdbc; using namespace connectivity; +extern +::std::vector sal_Bool entryMatchedByExpression(MQueryHelper* _aQuery, MQueryExpression* _aExpr, MQueryHelperResultEntry* entry); + MQueryHelperResultEntry::MQueryHelperResultEntry() { } @@ -83,7 +86,8 @@ MQueryHelper::MQueryHelper(const OColumnAlias _ca) MQueryHelper::~MQueryHelper() { -OSL_TRACE(IN MQueryHelper::~MQueryHelper()); +SAL_INFO(connectivity.mork, MQueryHelper::~MQueryHelper()); + clear_results(); OSL_TRACE(OUT MQueryHelper::~MQueryHelper()); } @@ -91,7 +95,8 @@ MQueryHelper::~MQueryHelper() // - void MQueryHelper::setAddressbook(::rtl::OUString ab) { -OSL_TRACE(IN MQueryHelper::setAddressbook()); +SAL_INFO(connectivity.mork, MQueryHelper::setAddressbook()); + ::osl::MutexGuard aGuard(m_aMutex); m_aAddressbook = ab; @@ -101,6 +106,7 @@ void MQueryHelper::setAddressbook(::rtl::OUString ab) // - void MQueryHelper::setExpression( MQueryExpression _expr ) { +SAL_INFO(connectivity.mork, MQueryHelper::setExpression()); OSL_TRACE(IN MQueryHelper::setExpression()); ::osl::MutexGuard aGuard(m_aMutex); @@ -111,7 +117,7 @@ void MQueryHelper::setExpression( MQueryExpression _expr ) void MQueryHelper::append(MQueryHelperResultEntry* resEnt) { -//SAL_INFO(connectivity.mork, MQueryHelper::append() ); +//SAL_INFO(connectivity.mork, MQueryHelper::append()); if ( resEnt != NULL ) { m_aResults.push_back( resEnt ); @@ -170,9 +176,9 @@ MQueryHelper::getByIndex(sal_uInt32 nRow) sal_Int32 MQueryHelper::getResultCount() const { -SAL_INFO(connectivity.mork, MQueryHelper::getResultCount() ); +//SAL_INFO(connectivity.mork, MQueryHelper::getResultCount() ); sal_Int32 result = static_castsal_Int32(m_aResults.size()); -SAL_INFO(connectivity.mork, result: result); +//SAL_INFO(connectivity.mork, result: result); return result; } @@ -229,6 +235,7 @@ sal_Int32 MQueryHelper::executeQuery(OConnection* xConnection) SAL_INFO(connectivity.mork, MQueryHelper::executeQuery() ); reset(); +//dumpExpression(this, m_aExpr); MorkTableMap::iterator tableIter; MorkTableMap *Tables = xConnection-getMorkParser()-getTables( 0x80 ); MorkRowMap *Rows = 0; @@ -260,7 +267,14 @@ sal_Int32 MQueryHelper::executeQuery(OConnection* xConnection) rtl::OUString valueOUString = ::rtl::OStringToOUString( valueOString, RTL_TEXTENCODING_UTF8 ); entry-setValue(key, valueOUString); } -append(entry); +::std::vector sal_Bool vector = entryMatchedByExpression(this, m_aExpr, entry); +sal_Bool result = sal_True; +for (::std::vectorsal_Bool::iterator iter = vector.begin(); iter != vector.end(); ++iter) { +result = result *iter; +} +if (result) { +append(entry); +} } } } @@ -269,4 +283,132 @@ sal_Int32 MQueryHelper::executeQuery(OConnection* xConnection) return 0; } +::std::vector sal_Bool entryMatchedByExpression(MQueryHelper* _aQuery, MQueryExpression* _aExpr, MQueryHelperResultEntry* entry) +{ +::std::vector sal_Bool resultVector; +MQueryExpression::ExprVector::iterator evIter; +for( evIter = _aExpr-getExpressions().begin(); + evIter != _aExpr-getExpressions().end(); + ++evIter ) +{ +if ( (*evIter)-isStringExpr() ) { +MQueryExpressionString* evStr = static_castMQueryExpressionString* (*evIter); + +// Set the 'name' property of the boolString. +// Check if it's an alias first... +rtl::OString attrName = _aQuery-getColumnAlias().getProgrammaticNameOrFallbackToUTF8Alias( evStr-getName() ); +//OSL_TRACE(Name = %s ;, attrName.getStr() ); +SAL_INFO(connectivity.mork, Name = attrName.getStr()); +// Set the 'matchType' property of the boolString. Check for
[Libreoffice-commits] .: Branch 'feature/mork' - connectivity/source
connectivity/source/drivers/mork/MConnection.hxx |1 connectivity/source/drivers/mork/MQueryHelper.cxx | 21 connectivity/source/drivers/mork/MQueryHelper.hxx |2 + connectivity/source/drivers/mork/MResultSet.cxx | 37 +- 4 files changed, 45 insertions(+), 16 deletions(-) New commits: commit f1f40a616b905a62fb9c6fc1bb6af30262debb0b Author: David Ostrovsky da...@ostrovsky.org Date: Fri Sep 14 00:07:07 2012 +0200 mork driver: get rid of infinite loop. Many thanks to Michael Stahl for helping out with debugging it. The problem was, that soffice.bin grabbed the mouse and keyboard. Michael pointed me out to alternate Xephyr X-Server. With it it was the matter of 5 min. to attach a debugger to soffice.bin and to find the problem. Change-Id: Ic8340fbd87e65945b12f4a928c73fa23a439d9f4 diff --git a/connectivity/source/drivers/mork/MConnection.hxx b/connectivity/source/drivers/mork/MConnection.hxx index 72cf592..fd478ff 100644 --- a/connectivity/source/drivers/mork/MConnection.hxx +++ b/connectivity/source/drivers/mork/MConnection.hxx @@ -109,7 +109,6 @@ namespace connectivity // Added to enable me to use SQLInterpreter which requires an // XNameAccess i/f to access tables. ::com::sun::star::uno::Reference ::com::sun::star::sdbcx::XTablesSupplier SAL_CALL createCatalog(); - }; } } diff --git a/connectivity/source/drivers/mork/MQueryHelper.cxx b/connectivity/source/drivers/mork/MQueryHelper.cxx index 6b4e351..7803d67 100644 --- a/connectivity/source/drivers/mork/MQueryHelper.cxx +++ b/connectivity/source/drivers/mork/MQueryHelper.cxx @@ -158,6 +158,26 @@ sal_Int32 MQueryHelper::getResultCount() const // - +sal_Bool MQueryHelper::queryComplete() const +{ +return sal_True; +} + +sal_Bool MQueryHelper::checkRowAvailable( sal_Int32 nDBRow ) +{ +/* +while (!queryComplete() getResultCount() = (sal_uInt32)nDBRow) +{ +if ( !m_aQueryHelper-waitForRow( nDBRow ) ) { +m_aError = m_aQueryHelper-getError(); +return( sal_False ); +} +} +*/ +return( getResultCount() nDBRow ); +} + + sal_Bool MQueryHelper::getRowValue( ORowSetValue rValue, sal_Int32 nDBRow,const rtl::OUString aDBColumnName, sal_Int32 nType ) { SAL_INFO(connectivity.mork, MQueryHelper::getRowValue() ); @@ -185,6 +205,7 @@ sal_Bool MQueryHelper::getRowValue( ORowSetValue rValue, sal_Int32 nDBRow,const sal_Int32 MQueryHelper::executeQuery(OConnection* xConnection) { +//OSL_FAIL( MQueryHelper::executeQuery ); SAL_INFO(connectivity.mork, MQueryHelper::executeQuery() ); reset(); diff --git a/connectivity/source/drivers/mork/MQueryHelper.hxx b/connectivity/source/drivers/mork/MQueryHelper.hxx index 2d186a8..8275837 100644 --- a/connectivity/source/drivers/mork/MQueryHelper.hxx +++ b/connectivity/source/drivers/mork/MQueryHelper.hxx @@ -82,7 +82,9 @@ namespace connectivity MQueryHelperResultEntry* next(); MQueryHelperResultEntry* getByIndex( sal_uInt32 nRow ); sal_Bool isError() const; +sal_Bool queryComplete() const; sal_Int32 getResultCount() const; +sal_Bool checkRowAvailable( sal_Int32 nDBRow ); sal_Bool getRowValue( ORowSetValue rValue, sal_Int32 nDBRow,const rtl::OUString aDBColumnName, sal_Int32 nType ); sal_Int32 executeQuery(OConnection* xConnection); }; diff --git a/connectivity/source/drivers/mork/MResultSet.cxx b/connectivity/source/drivers/mork/MResultSet.cxx index d7d7117..8363901 100644 --- a/connectivity/source/drivers/mork/MResultSet.cxx +++ b/connectivity/source/drivers/mork/MResultSet.cxx @@ -467,8 +467,8 @@ sal_Bool SAL_CALL OResultSet::isAfterLast( ) throw(SQLException, RuntimeExcepti ResultSetEntryGuard aGuard( *this ); OSL_TRACE(In/Out: OResultSet::isAfterLast ); -return sal_True; -//return m_nRowPos currentRowCount() m_aQuery.queryComplete(); +//return sal_True; +return m_nRowPos currentRowCount() m_aQueryHelper.queryComplete(); } // - sal_Bool SAL_CALL OResultSet::isFirst( ) throw(SQLException, RuntimeException) @@ -485,8 +485,8 @@ sal_Bool SAL_CALL OResultSet::isLast( ) throw(SQLException, RuntimeException) ResultSetEntryGuard aGuard( *this ); OSL_TRACE(In/Out: OResultSet::isLast ); -return sal_True; -//return m_nRowPos == currentRowCount() m_aQuery.queryComplete(); +//return sal_True; +return m_nRowPos == currentRowCount() m_aQueryHelper.queryComplete(); } // - void SAL_CALL OResultSet::beforeFirst( ) throw(SQLException,
[Libreoffice-commits] .: Branch 'feature/mork' - connectivity/source
connectivity/source/drivers/mork/MQueryHelper.cxx |5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) New commits: commit 90734440b27960a23e8b40041e53f58f73df2530 Author: David Ostrovsky da...@ostrovsky.org Date: Thu Aug 16 22:53:52 2012 +0200 create MQueryHelperResultEntry per row and not per cell Change-Id: Ibec6eca8807c298f72a440a0e022bf4022132d7c diff --git a/connectivity/source/drivers/mork/MQueryHelper.cxx b/connectivity/source/drivers/mork/MQueryHelper.cxx index 7097110..6b4e351 100644 --- a/connectivity/source/drivers/mork/MQueryHelper.cxx +++ b/connectivity/source/drivers/mork/MQueryHelper.cxx @@ -205,6 +205,7 @@ sal_Int32 MQueryHelper::executeQuery(OConnection* xConnection) // Iterate all rows for ( rowIter = Rows-begin(); rowIter != Rows-end(); rowIter++ ) { +MQueryHelperResultEntry* entry = new MQueryHelperResultEntry(); for (MorkCells::iterator CellsIter = rowIter-second.begin(); CellsIter != rowIter-second.end(); CellsIter++ ) { @@ -213,14 +214,12 @@ sal_Int32 MQueryHelper::executeQuery(OConnection* xConnection) //SAL_INFO(connectivity.mork, key: column value: value); -MQueryHelperResultEntry* entry = new MQueryHelperResultEntry(); - OString key(column.c_str(), static_castsal_Int32(column.size())); OString valueOString(value.c_str(), static_castsal_Int32(value.size())); rtl::OUString valueOUString = ::rtl::OStringToOUString( valueOString, RTL_TEXTENCODING_UTF8 ); entry-setValue(key, valueOUString); -append(entry); } +append(entry); } } } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: Branch 'feature/mork' - connectivity/source
connectivity/source/drivers/mork/MConnection.cxx|9 - connectivity/source/drivers/mork/MResultSetMetaData.hxx | 92 connectivity/source/drivers/mork/MStatement.cxx | 45 ++- connectivity/source/drivers/mork/MStatement.hxx |4 4 files changed, 137 insertions(+), 13 deletions(-) New commits: commit cf0c13c5f7e81a9b2afdd0a5e085b2964cc59ef8 Author: David Ostrovsky da...@ostrovsky.org Date: Fri Aug 3 00:10:17 2012 +0200 mork driver: commenting out OSQLParser in MStatement Change-Id: I28abadac8844996b6823239894a5eb2177020548 diff --git a/connectivity/source/drivers/mork/MConnection.cxx b/connectivity/source/drivers/mork/MConnection.cxx index 8dedf5e..9345d87 100644 --- a/connectivity/source/drivers/mork/MConnection.cxx +++ b/connectivity/source/drivers/mork/MConnection.cxx @@ -156,9 +156,9 @@ Reference XStatement SAL_CALL OConnection::createStatement( ) throw(SQLExcep // create a statement // the statement can only be executed once -// Reference XStatement xReturn = new OStatement(this); -// m_aStatements.push_back(WeakReferenceHelper(xReturn)); -return NULL; +Reference XStatement xReturn = new OStatement(this); +m_aStatements.push_back(WeakReferenceHelper(xReturn)); +return xReturn; } // Reference XPreparedStatement SAL_CALL OConnection::prepareStatement( const ::rtl::OUString _sSql ) throw(SQLException, RuntimeException) @@ -178,8 +178,7 @@ Reference XPreparedStatement SAL_CALL OConnection::prepareStatement( const :: pPrepared-lateInit(); m_aStatements.push_back(WeakReferenceHelper(xReturn)); - -return NULL; +return xReturn; } // Reference XPreparedStatement SAL_CALL OConnection::prepareCall( const ::rtl::OUString _sSql ) throw(SQLException, RuntimeException) diff --git a/connectivity/source/drivers/mork/MResultSetMetaData.hxx b/connectivity/source/drivers/mork/MResultSetMetaData.hxx new file mode 100644 index 000..89b50cf --- /dev/null +++ b/connectivity/source/drivers/mork/MResultSetMetaData.hxx @@ -0,0 +1,92 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the License); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef CONNECTIVITY_SRESULSETMETADATA_HXX +#define CONNECTIVITY_SRESULSETMETADATA_HXX + +#include com/sun/star/sdbc/XResultSetMetaData.hpp +#include cppuhelper/implbase1.hxx +#include vector +#include rtl/ref.hxx +#include MConnection.hxx +#include MTable.hxx + +namespace connectivity +{ +namespace mork +{ +//** +// Class: ResultSetMetaData +//** +typedef ::cppu::WeakImplHelper1 ::com::sun::star::sdbc::XResultSetMetaData OResultSetMetaData_BASE; + +class OResultSetMetaData : public OResultSetMetaData_BASE +{ +::rtl::OUString m_aTableName; +::rtl::Referenceconnectivity::OSQLColumns m_xColumns; +OTable* m_pTable; +sal_Bool m_bReadOnly; + +protected: +virtual ~OResultSetMetaData(); +public: +// a constructor that is needed to return the object: +// OResultSetMetaData(OConnection* _pConnection) : m_pConnection(_pConnection){} +OResultSetMetaData(const ::rtl::Referenceconnectivity::OSQLColumns _rxColumns, + const ::rtl::OUString _aTableName,OTable* _pTable,sal_Bool aReadOnly + ) + :m_aTableName(_aTableName) + ,m_xColumns(_rxColumns) + ,m_pTable(_pTable) + ,m_bReadOnly(aReadOnly) + {} + + +/// Avoid ambigous cast error from the compiler. +inline operator ::com::sun::star::uno::Reference ::com::sun::star::sdbc::XResultSetMetaData ()
[Libreoffice-commits] .: Branch 'feature/mork' - connectivity/source
connectivity/source/drivers/mork/MConnection.cxx | 26 +-- connectivity/source/drivers/mork/MDatabaseMetaData.cxx | 16 +++--- connectivity/source/drivers/mork/MDatabaseMetaDataHelper.cxx | 12 ++--- connectivity/source/drivers/mork/MDriver.cxx |6 +- 4 files changed, 30 insertions(+), 30 deletions(-) New commits: commit 4bd7e5f48ab9c463ffe0aba423a2156d84c9fa6d Author: David Ostrovsky da...@ostrovsky.org Date: Tue Jul 31 09:17:16 2012 +0200 mork driver: fixed SAL_LOG typo Change-Id: I7761832978da95606c0f4d1fcfc51d3a9eee15df diff --git a/connectivity/source/drivers/mork/MConnection.cxx b/connectivity/source/drivers/mork/MConnection.cxx index 3f4d245..a406734 100644 --- a/connectivity/source/drivers/mork/MConnection.cxx +++ b/connectivity/source/drivers/mork/MConnection.cxx @@ -72,7 +72,7 @@ void SAL_CALL OConnection::release() throw() void OConnection::construct(const ::rtl::OUString url,const Sequence PropertyValue info) throw(SQLException) { (void) info; // avoid warnings -SAL_INFO(connectvity.mork, = OConnection::construct() ); +SAL_INFO(connectivity.mork, = OConnection::construct() ); // open file setURL(url); // @@ -106,8 +106,8 @@ void OConnection::construct(const ::rtl::OUString url,const Sequence PropertyV sAdditionalInfo = aAddrbookURI.copy( nLen + 1 ); } -SAL_INFO(connectvity.mork, URI = aAddrbookURI ); -SAL_INFO(connectvity.mork, Scheme = aAddrbookScheme ); +SAL_INFO(connectivity.mork, URI = aAddrbookURI ); +SAL_INFO(connectivity.mork, Scheme = aAddrbookScheme ); ::rtl::OUString defaultProfile = m_pProfileAccess-getDefaultProfile(::com::sun::star::mozilla::MozillaProductType_Thunderbird); SAL_INFO(connectivity.mork, DefaultProfile: defaultProfile); @@ -149,7 +149,7 @@ IMPLEMENT_SERVICE_INFO(OConnection, com.sun.star.sdbc.drivers.mork.OConnection // Reference XStatement SAL_CALL OConnection::createStatement( ) throw(SQLException, RuntimeException) { -SAL_INFO(connectvity.mork, = OConnection::createStatement() ); +SAL_INFO(connectivity.mork, = OConnection::createStatement() ); ::osl::MutexGuard aGuard( m_aMutex ); checkDisposed(OConnection_BASE::rBHelper.bDisposed); @@ -163,34 +163,34 @@ Reference XStatement SAL_CALL OConnection::createStatement( ) throw(SQLExcep // Reference XPreparedStatement SAL_CALL OConnection::prepareStatement( const ::rtl::OUString _sSql ) throw(SQLException, RuntimeException) { -SAL_INFO(connectvity.mork, = OConnection::prepareStatement() ); +SAL_INFO(connectivity.mork, = OConnection::prepareStatement() ); OSL_UNUSED( _sSql ); ::osl::MutexGuard aGuard( m_aMutex ); checkDisposed(OConnection_BASE::rBHelper.bDisposed); -SAL_INFO(connectvity.mork, OConnection::prepareStatement( _sSql )); +SAL_INFO(connectivity.mork, OConnection::prepareStatement( _sSql )); return NULL; } // Reference XPreparedStatement SAL_CALL OConnection::prepareCall( const ::rtl::OUString _sSql ) throw(SQLException, RuntimeException) { -SAL_INFO(connectvity.mork, = OConnection::prepareCall() ); -SAL_INFO(connectvity.mork, sql: _sSql); +SAL_INFO(connectivity.mork, = OConnection::prepareCall() ); +SAL_INFO(connectivity.mork, sql: _sSql); OSL_UNUSED( _sSql ); ::dbtools::throwFeatureNotImplementedException( XConnection::prepareCall, *this ); -SAL_INFO(connectvity.mork, OConnection::prepareCall( _sSql )); +SAL_INFO(connectivity.mork, OConnection::prepareCall( _sSql )); return NULL; } // ::rtl::OUString SAL_CALL OConnection::nativeSQL( const ::rtl::OUString _sSql ) throw(SQLException, RuntimeException) { -SAL_INFO(connectvity.mork, = OConnection::nativeSQL() ); -SAL_INFO(connectvity.mork, sql: _sSql); +SAL_INFO(connectivity.mork, = OConnection::nativeSQL() ); +SAL_INFO(connectivity.mork, sql: _sSql); ::osl::MutexGuard aGuard( m_aMutex ); // when you need to transform SQL92 to you driver specific you can do it here -SAL_INFO(connectvity.mork, OConnection::nativeSQL( _sSql ) ); +SAL_INFO(connectivity.mork, OConnection::nativeSQL( _sSql ) ); return _sSql; } @@ -228,7 +228,7 @@ sal_Bool SAL_CALL OConnection::isClosed( ) throw(SQLException, RuntimeException // Reference XDatabaseMetaData SAL_CALL OConnection::getMetaData( ) throw(SQLException, RuntimeException) { -SAL_INFO(connectvity.mork, = OConnection::getMetaData() ); +
[Libreoffice-commits] .: Branch 'feature/mork' - connectivity/source Repository.mk scp2/source
Repository.mk|2 +- connectivity/source/drivers/mork/MConnection.cxx | 11 ++- connectivity/source/drivers/mork/MDriver.cxx |7 ++- scp2/source/ooo/file_library_ooo.scp | 11 +-- 4 files changed, 18 insertions(+), 13 deletions(-) New commits: commit 88e411a9631254a983689e9c65fa07058cd18366 Author: David Ostrovsky da...@ostrovsky.org Date: Sat Jul 28 11:02:38 2012 +0200 mork driver: revert back to libmorklo.so Change-Id: Ib02ab0db30cc6f722066aa7d3ff162810d6f4b79 diff --git a/Repository.mk b/Repository.mk index 1153dac..e4142c1 100644 --- a/Repository.mk +++ b/Repository.mk @@ -311,6 +311,7 @@ $(eval $(call gb_Helper_register_libraries,OOOLIBS, \ lwpft \ MacOSXSpell \ merged \ +mork \ mozab2 \ mozabdrv \ msfilter \ @@ -448,7 +449,6 @@ $(eval $(call gb_Helper_register_libraries,PLAINLIBS_OOO, \ macab1 \ macabdrv1 \ mcnttype \ -mork \ mozbootstrap \ officebean \ package2 \ diff --git a/connectivity/source/drivers/mork/MConnection.cxx b/connectivity/source/drivers/mork/MConnection.cxx index 9fed202..3a737a1 100644 --- a/connectivity/source/drivers/mork/MConnection.cxx +++ b/connectivity/source/drivers/mork/MConnection.cxx @@ -76,7 +76,7 @@ void SAL_CALL OConnection::release() throw() void OConnection::construct(const ::rtl::OUString url,const Sequence PropertyValue info) throw(SQLException) { (void) info; // avoid warnings -SAL_INFO(connectvity.mork, IN OConnection::construct() ); +SAL_INFO(connectvity.mork, = OConnection::construct() ); // open file setURL(url); // @@ -153,6 +153,8 @@ IMPLEMENT_SERVICE_INFO(OConnection, com.sun.star.sdbc.drivers.mork.OConnection // Reference XStatement SAL_CALL OConnection::createStatement( ) throw(SQLException, RuntimeException) { +SAL_INFO(connectvity.mork, = OConnection::createStatement() ); + ::osl::MutexGuard aGuard( m_aMutex ); checkDisposed(OConnection_BASE::rBHelper.bDisposed); @@ -165,6 +167,8 @@ Reference XStatement SAL_CALL OConnection::createStatement( ) throw(SQLExcep // Reference XPreparedStatement SAL_CALL OConnection::prepareStatement( const ::rtl::OUString _sSql ) throw(SQLException, RuntimeException) { +SAL_INFO(connectvity.mork, = OConnection::prepareStatement() ); + OSL_UNUSED( _sSql ); ::osl::MutexGuard aGuard( m_aMutex ); checkDisposed(OConnection_BASE::rBHelper.bDisposed); @@ -175,6 +179,8 @@ Reference XPreparedStatement SAL_CALL OConnection::prepareStatement( const :: // Reference XPreparedStatement SAL_CALL OConnection::prepareCall( const ::rtl::OUString _sSql ) throw(SQLException, RuntimeException) { +SAL_INFO(connectvity.mork, = OConnection::prepareCall() ); +SAL_INFO(connectvity.mork, sql: _sSql); OSL_UNUSED( _sSql ); ::dbtools::throwFeatureNotImplementedException( XConnection::prepareCall, *this ); SAL_INFO(connectvity.mork, OConnection::prepareCall( OUtoCStr( _sSql ) )); @@ -183,6 +189,9 @@ Reference XPreparedStatement SAL_CALL OConnection::prepareCall( const ::rtl:: // ::rtl::OUString SAL_CALL OConnection::nativeSQL( const ::rtl::OUString _sSql ) throw(SQLException, RuntimeException) { +SAL_INFO(connectvity.mork, = OConnection::nativeSQL() ); +SAL_INFO(connectvity.mork, sql: _sSql); + ::osl::MutexGuard aGuard( m_aMutex ); // when you need to transform SQL92 to you driver specific you can do it here SAL_INFO(connectvity.mork, OConnection::nativeSQL( _sSql ) ); diff --git a/connectivity/source/drivers/mork/MDriver.cxx b/connectivity/source/drivers/mork/MDriver.cxx index 5961a0e..3301c27 100644 --- a/connectivity/source/drivers/mork/MDriver.cxx +++ b/connectivity/source/drivers/mork/MDriver.cxx @@ -27,6 +27,7 @@ namespace connectivity MorkDriver::MorkDriver(css::uno::Reference css::uno::XComponentContext const context): context_(context) { +SAL_INFO(connectvity.mork, = MorkDriver::MorkDriver() ); m_ProfileAccess = new ProfileAccess(); assert(context.is()); } @@ -75,6 +76,8 @@ css::uno::Reference css::sdbc::XConnection MorkDriver::connect( css::uno::Sequence css::beans::PropertyValue const info) throw (css::sdbc::SQLException, css::uno::RuntimeException) { +SAL_INFO(connectvity.mork, = MorkDriver::connect() ); + (void) url; (void) info; // avoid warnings css::uno::Reference css::sdbc::XConnection xCon; OConnection* pCon = new OConnection(this); @@ -86,9 +89,11 @@ css::uno::Reference css::sdbc::XConnection MorkDriver::connect( sal_Bool
[Libreoffice-commits] .: Branch 'feature/mork' - connectivity/source postprocess/packcomponents postprocess/packregistry Repository.mk
Repository.mk|2 - connectivity/source/drivers/mork/MConnection.cxx | 43 +-- connectivity/source/drivers/mork/MConnection.hxx | 10 - connectivity/source/drivers/mork/MorkParser.cxx |6 +++ connectivity/source/drivers/mork/MorkParser.hxx |5 -- postprocess/packcomponents/makefile.mk | 17 - postprocess/packregistry/makefile.mk | 23 ++-- 7 files changed, 78 insertions(+), 28 deletions(-) New commits: commit 4cac7d99d399b6f7955f4e803a7aee76f1bb3ef9 Author: David Ostrovsky da...@ostrovsky.org Date: Sat Jul 28 00:05:38 2012 +0200 mork driver: fixed postprocess build issues Change-Id: Icc1f83f9b0618c91aa6795164855ebd8e61467f0 diff --git a/Repository.mk b/Repository.mk index e4142c1..1153dac 100644 --- a/Repository.mk +++ b/Repository.mk @@ -311,7 +311,6 @@ $(eval $(call gb_Helper_register_libraries,OOOLIBS, \ lwpft \ MacOSXSpell \ merged \ -mork \ mozab2 \ mozabdrv \ msfilter \ @@ -449,6 +448,7 @@ $(eval $(call gb_Helper_register_libraries,PLAINLIBS_OOO, \ macab1 \ macabdrv1 \ mcnttype \ +mork \ mozbootstrap \ officebean \ package2 \ diff --git a/connectivity/source/drivers/mork/MConnection.cxx b/connectivity/source/drivers/mork/MConnection.cxx index a43665f..9fed202 100644 --- a/connectivity/source/drivers/mork/MConnection.cxx +++ b/connectivity/source/drivers/mork/MConnection.cxx @@ -8,8 +8,10 @@ */ #include diagnose_ex.h +#include MNSProfileDiscover.hxx #include MConnection.hxx #include MDriver.hxx +#include MorkParser.hxx #include connectivity/dbcharset.hxx #include connectivity/dbexception.hxx @@ -41,6 +43,8 @@ using namespace com::sun::star::sdbcx; namespace connectivity { namespace mork { +static const int defaultScope = 0x80; + // - OConnection::OConnection(MorkDriver* _pDriver) @@ -48,7 +52,8 @@ OConnection::OConnection(MorkDriver* _pDriver) ,m_pDriver(_pDriver) { m_pDriver-acquire(); - +m_pProfileAccess = new ProfileAccess(); +m_pMork = new MorkParser(); } //- OConnection::~OConnection() @@ -58,6 +63,8 @@ OConnection::~OConnection() close(); m_pDriver-release(); m_pDriver = NULL; +delete m_pProfileAccess; +delete m_pMork; } //- void SAL_CALL OConnection::release() throw() @@ -93,7 +100,7 @@ void OConnection::construct(const ::rtl::OUString url,const Sequence PropertyV } else { -SAL_WARN(mork, No subschema given!!!); +SAL_WARN(connectivity.mork, No subschema given!!!); throwGenericSQLException( STR_URI_SYNTAX_ERROR, *this ); } } @@ -106,7 +113,39 @@ void OConnection::construct(const ::rtl::OUString url,const Sequence PropertyV SAL_INFO(connectvity.mork, URI = ((OUtoCStr(aAddrbookURI)) ? (OUtoCStr(aAddrbookURI)):(NULL)) ); SAL_INFO(connectvity.mork, Scheme = ((OUtoCStr(aAddrbookScheme)) ? (OUtoCStr(aAddrbookScheme)):(NULL)) ); +::rtl::OUString defaultProfile = m_pProfileAccess-getDefaultProfile(::com::sun::star::mozilla::MozillaProductType_Thunderbird); +SAL_INFO(connectivity.mork, DefaultProfile: defaultProfile); + +::rtl::OUString path = m_pProfileAccess-getProfilePath(::com::sun::star::mozilla::MozillaProductType_Thunderbird, defaultProfile); +SAL_INFO(connectivity.mork, ProfilePath: path); + +path += rtl::OUString( /abook.mab ); + +SAL_INFO(connectivity.mork, AdressbookPath: path); + +rtl::OString strPath = ::rtl::OUStringToOString(path, RTL_TEXTENCODING_UTF8 ); + +// Open and parse mork file +if (!m_pMork-open(strPath.getStr())) +{ +SAL_WARN(connectivity.mork, Can not parse mork file!); +throwGenericSQLException( STR_COULD_NOT_LOAD_FILE, *this ); +} + +// check that we can retrieve the tables: +MorkTableMap *Tables = m_pMork-getTables( defaultScope ); +MorkTableMap::iterator tableIter; +if (Tables) +{ +// Iterate all tables +for ( tableIter = Tables-begin(); tableIter != Tables-end(); tableIter++ ) +{ +if ( 0 == tableIter-first ) continue; +SAL_INFO(connectivity.mork, table-first : tableIter-first); +} +} } + // XServiceInfo // IMPLEMENT_SERVICE_INFO(OConnection, com.sun.star.sdbc.drivers.mork.OConnection, com.sun.star.sdbc.Connection) diff --git a/connectivity/source/drivers/mork/MConnection.hxx b/connectivity/source/drivers/mork/MConnection.hxx index f1fabdc..42b500d 100644 --- a/connectivity/source/drivers/mork/MConnection.hxx +++
[Libreoffice-commits] .: Branch 'feature/mork' - connectivity/source scp2/source
connectivity/source/drivers/mork/MConnection.cxx | 44 --- scp2/source/ooo/file_library_ooo.scp | 15 +-- scp2/source/ooo/module_hidden_ooo.scp| 34 - 3 files changed, 44 insertions(+), 49 deletions(-) New commits: commit 0455098f73efbb26bacbc6b2c15d725932a0ae01 Author: David Ostrovsky da...@ostrovsky.org Date: Thu Jul 26 00:10:06 2012 +0200 mork driver: scp2 module added Change-Id: I3ca649a125af7a2533b4353815459179647a8a32 diff --git a/connectivity/source/drivers/mork/MConnection.cxx b/connectivity/source/drivers/mork/MConnection.cxx index 848ced5..2d1cde8 100644 --- a/connectivity/source/drivers/mork/MConnection.cxx +++ b/connectivity/source/drivers/mork/MConnection.cxx @@ -15,6 +15,8 @@ #include connectivity/dbexception.hxx #include connectivity/sqlerror.hxx +#include resource/common_res.hrc + #include com/sun/star/sdbc/ColumnValue.hpp #include com/sun/star/sdbc/XRow.hpp #include com/sun/star/sdbc/TransactionIsolation.hpp @@ -67,9 +69,43 @@ void SAL_CALL OConnection::release() throw() void OConnection::construct(const ::rtl::OUString url,const Sequence PropertyValue info) throw(SQLException) { (void) info; // avoid warnings -OSL_TRACE(IN OConnection::construct() ); +SAL_INFO(mork, IN OConnection::construct() ); // open file setURL(url); +// +// Skip 'sdbc:mozab: part of URL +// +sal_Int32 nLen = url.indexOf(':'); +nLen = url.indexOf(':',nLen+1); +OSL_ENSURE( url.copy( 0, nLen ) == sdbc:address, OConnection::construct: invalid start of the URI - should never have survived XDriver::acceptsURL! ); + +::rtl::OUString aAddrbookURI(url.copy(nLen+1)); +// Get Scheme +nLen = aAddrbookURI.indexOf(':'); +::rtl::OUString aAddrbookScheme; +::rtl::OUString sAdditionalInfo; +if ( nLen == -1 ) +{ +// There isn't any subschema: - but could be just subschema +if ( !aAddrbookURI.isEmpty() ) +{ +aAddrbookScheme= aAddrbookURI; +} +else +{ +SAL_WARN(mork, No subschema given!!!); +throwGenericSQLException( STR_URI_SYNTAX_ERROR, *this ); +} +} +else +{ +aAddrbookScheme = aAddrbookURI.copy(0, nLen); +sAdditionalInfo = aAddrbookURI.copy( nLen + 1 ); +} + +SAL_INFO(mork, URI = ((OUtoCStr(aAddrbookURI)) ? (OUtoCStr(aAddrbookURI)):(NULL)) ); +SAL_INFO(mork, Scheme = ((OUtoCStr(aAddrbookScheme)) ? (OUtoCStr(aAddrbookScheme)):(NULL)) ); + } // XServiceInfo // @@ -94,7 +130,7 @@ Reference XPreparedStatement SAL_CALL OConnection::prepareStatement( const :: ::osl::MutexGuard aGuard( m_aMutex ); checkDisposed(OConnection_BASE::rBHelper.bDisposed); -OSL_TRACE(OConnection::prepareStatement( %s ), OUtoCStr( _sSql ) ); +SAL_INFO(mork, OConnection::prepareStatement( OUtoCStr( _sSql ) )); return NULL; } // @@ -102,7 +138,7 @@ Reference XPreparedStatement SAL_CALL OConnection::prepareCall( const ::rtl:: { OSL_UNUSED( _sSql ); ::dbtools::throwFeatureNotImplementedException( XConnection::prepareCall, *this ); -OSL_TRACE(OConnection::prepareCall( %s ), OUtoCStr( _sSql ) ); +SAL_INFO(mork, OConnection::prepareCall( OUtoCStr( _sSql ) )); return NULL; } // @@ -110,7 +146,7 @@ Reference XPreparedStatement SAL_CALL OConnection::prepareCall( const ::rtl:: { ::osl::MutexGuard aGuard( m_aMutex ); // when you need to transform SQL92 to you driver specific you can do it here -OSL_TRACE(OConnection::nativeSQL( %s ), OUtoCStr( _sSql ) ); +SAL_INFO(OConnection::nativeSQL( %s ), OUtoCStr( _sSql ) ); return _sSql; } diff --git a/scp2/source/ooo/file_library_ooo.scp b/scp2/source/ooo/file_library_ooo.scp index 0594120..58642f0 100644 --- a/scp2/source/ooo/file_library_ooo.scp +++ b/scp2/source/ooo/file_library_ooo.scp @@ -880,26 +880,17 @@ File gid_File_Lib_Mcnttype #endif End -#if !defined(SYSTEM_MOZILLA) !defined(WITHOUT_MOZILLA) !defined(MACOSX) -// #i91209# -STD_LIB_FILE(gid_File_Lib_Mozab,mozab2) -STD_LIB_FILE(gid_File_Lib_Mozabdrv,mozabdrv) - -#else - -File gid_File_Lib_Mozbootstrap +File gid_File_Lib_Mork LIB_FILE_BODY; Styles = (PACKED); Dir = SCP2_OOO_BIN_DIR; #ifdef UNX -Name = STRING(CONCAT2(libmozbootstrap,UNXSUFFIX)); +Name = STRING(CONCAT2(libmork,UNXSUFFIX)); #else -Name = mozbootstrap.dll; +Name = mork.dll; #endif End -#endif - STD_LIB_FILE(gid_File_Lib_WpftWriter,wpftwriter) STD_LIB_FILE(gid_File_Lib_T602Filter,t602filter) diff --git a/scp2/source/ooo/module_hidden_ooo.scp