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 +++ b/connectivity/source/drivers/mork/MConnection.hxx @@ -23,6 +23,9 @@ #include <memory> +// do we want here namespace too? +class MorkParser; + namespace connectivity { namespace mork @@ -30,6 +33,7 @@ namespace connectivity namespace css = com::sun::star; class MorkDriver; + class ProfileAccess; class ErrorDescriptor; typedef connectivity::OMetaConnection OConnection_BASE; // implements basics and text encoding @@ -46,8 +50,12 @@ namespace connectivity ::com::sun::star::sdbc::SQLWarning m_aLastWarning; MorkDriver* m_pDriver; // Pointer to the owning // driver object + // Profile Access + ProfileAccess* m_pProfileAccess; + // Mork Parser + MorkParser* m_pMork; // Store Catalog - ::com::sun::star::uno::Reference< ::com::sun::star::sdbcx::XTablesSupplier> m_xCatalog; + ::com::sun::star::uno::Reference< ::com::sun::star::sdbcx::XTablesSupplier> m_xCatalog; public: virtual void construct( const ::rtl::OUString& url,const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& info) throw(::com::sun::star::sdbc::SQLException); diff --git a/connectivity/source/drivers/mork/MorkParser.cxx b/connectivity/source/drivers/mork/MorkParser.cxx index bd37d66..7287d6f 100644 --- a/connectivity/source/drivers/mork/MorkParser.cxx +++ b/connectivity/source/drivers/mork/MorkParser.cxx @@ -42,6 +42,12 @@ std::string g_Empty = ""; +// Mork header of supported format version +const char *MorkMagicHeader = "// <!-- <mdb:mork:z v=\"1.4\"/> -->"; + +const char *MorkDictColumnMeta = "<(a=c)>"; + + MorkParser::MorkParser( int DefaultScope ) : columns_(), values_(), diff --git a/connectivity/source/drivers/mork/MorkParser.hxx b/connectivity/source/drivers/mork/MorkParser.hxx index e26bef5..090390d 100644 --- a/connectivity/source/drivers/mork/MorkParser.hxx +++ b/connectivity/source/drivers/mork/MorkParser.hxx @@ -50,11 +50,6 @@ typedef std::map< int, MorkRowMap > RowScopeMap; // Row scope typedef std::map< int, RowScopeMap > MorkTableMap; // Table id typedef std::map< int, MorkTableMap > TableScopeMap; // Table Scope -// Mork header of supported format version -const char *MorkMagicHeader = "// <!-- <mdb:mork:z v=\"1.4\"/> -->"; - -const char *MorkDictColumnMeta = "<(a=c)>"; - // Error codes enum MorkErrors { diff --git a/postprocess/packcomponents/makefile.mk b/postprocess/packcomponents/makefile.mk index 0ba2f25..fc16028 100644 --- a/postprocess/packcomponents/makefile.mk +++ b/postprocess/packcomponents/makefile.mk @@ -378,14 +378,15 @@ my_components += \ component/canvas/source/directx/gdipluscanvas .END -.IF "$(OS)" != "IOS" && "$(OS)" != "ANDROID" -.IF "$(OS)" != "MACOSX" && "$(SYSTEM_MOZILLA)" != "YES" && \ - "$(WITH_MOZILLA)" != "NO" -my_components += component/connectivity/source/drivers/mozab/mozab -.ELSE -my_components += component/connectivity/source/drivers/mozab/bootstrap/mozbootstrap -.END -.ENDIF +#.IF "$(OS)" != "IOS" && "$(OS)" != "ANDROID" +#.IF "$(OS)" != "MACOSX" && "$(SYSTEM_MOZILLA)" != "YES" && \ +# "$(WITH_MOZILLA)" != "NO" +#my_components += component/connectivity/source/drivers/mozab/mozab +#.ELSE +#my_components += component/connectivity/source/drivers/mozab/bootstrap/mozbootstrap +#.END +#.ENDIF +my_components += component/connectivity/source/drivers/mork/mork .IF "$(OS)" != "WNT" && "$(OS)" != "ANDROID" && "$(OS)" != "IOS" && "$(OS)" != "headless" my_components += component/shell/source/cmdmail/cmdmail diff --git a/postprocess/packregistry/makefile.mk b/postprocess/packregistry/makefile.mk index 3c63d1f..b56bb6d 100644 --- a/postprocess/packregistry/makefile.mk +++ b/postprocess/packregistry/makefile.mk @@ -13,7 +13,7 @@ # 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 +# but WITHOUT ANY WARRANTY; without even the imp # 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). @@ -351,16 +351,17 @@ MY_FILES_main += $(MY_MOD)/org/openoffice/Office/DataAccess/Drivers-tdeab.xcu MY_FILES_main += $(MY_MOD)/org/openoffice/Office/DataAccess/Drivers-kab.xcu MY_DRIVERS += kab .END -.IF "$(SYSTEM_MOZILLA)" != "YES" && "$(WITH_MOZILLA)" != "NO" && \ - "$(OS)" != "MACOSX" -.IF "$(OS)" == "WNT" -MY_FILES_main += $(MY_MOD)/org/openoffice/Office/DataAccess/Drivers-mozab.xcu -MY_DRIVERS += mozab -.ELSE -MY_FILES_main += $(MY_MOD)/org/openoffice/Office/DataAccess/Drivers-mozab2.xcu -MY_DRIVERS += mozab2 -.END -.END +#.IF "$(SYSTEM_MOZILLA)" != "YES" && "$(WITH_MOZILLA)" != "NO" && \ +# "$(OS)" != "MACOSX" +#.IF "$(OS)" == "WNT" +#MY_FILES_main += $(MY_MOD)/org/openoffice/Office/DataAccess/Drivers-mozab.xcu +#MY_DRIVERS += mozab +#.ELSE +#MY_FILES_main += $(MY_MOD)/org/openoffice/Office/DataAccess/Drivers-mozab2.xcu +#MY_DRIVERS += mozab2 +#.END +#.END +MY_FILES_main += $(MY_MOD)/org/openoffice/Office/DataAccess/Drivers-mork.xcu .IF "$(SYSTEM_LIBEXTTEXTCAT_DATA)" != "" MY_FILES_main += $(MY_MOD)/org/openoffice/Office/Paths-externallibexttextcatdata.xcu .ELSE _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits