From 21ebdc7dcefd36bd522d1cad14e80075d45fa173 Mon Sep 17 00:00:00 2001 From: "Ocke Janssen [oj]" Date: Wed, 10 Feb 2010 09:44:20 +0100 Subject: dba33e: fix not operator --- dbaccess/source/ui/dlg/dbwizsetup.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dbaccess/source/ui/dlg/dbwizsetup.cxx b/dbaccess/source/ui/dlg/dbwizsetup.cxx index 67be69269..376f55b8e 100644 --- a/dbaccess/source/ui/dlg/dbwizsetup.cxx +++ b/dbaccess/source/ui/dlg/dbwizsetup.cxx @@ -945,7 +945,7 @@ sal_Bool ODbTypeWizDialogSetup::SaveDatabaseDocument() { ::rtl::OUString sEmbeddedURL = m_pCollection->getEmbeddedDatabase(); ::connectivity::DriversConfig aDriverConfig(getORB()); - if ( !aDriverConfig.getDriverFactoryName(sEmbeddedURL).getLength() || m_pImpl->getDriver(sEmbeddedURL).is() ) + if ( !aDriverConfig.getDriverFactoryName(sEmbeddedURL).getLength() || !m_pImpl->getDriver(sEmbeddedURL).is() ) sEmbeddedURL = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("sdbc:dbase:")); return sEmbeddedURL; -- cgit v1.2.3 From 1fb994d387e67dab43d0ef3a24317fa86d7c459b Mon Sep 17 00:00:00 2001 From: "Ocke Janssen [oj]" Date: Wed, 10 Feb 2010 10:50:53 +0100 Subject: dba33f: #i102366# parse function as predicate --- dbaccess/source/ui/querydesign/QueryDesignView.cxx | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/dbaccess/source/ui/querydesign/QueryDesignView.cxx b/dbaccess/source/ui/querydesign/QueryDesignView.cxx index cb5f6f11c..e2da461b9 100644 --- a/dbaccess/source/ui/querydesign/QueryDesignView.cxx +++ b/dbaccess/source/ui/querydesign/QueryDesignView.cxx @@ -2235,11 +2235,17 @@ namespace SQL_ISRULEOR2(pColumnRef,length_exp,char_value_fct)) { ::rtl::OUString aColumns; - pColumnRef->parseNodeToStr( aColumns, - xConnection, - &rController.getParser().getContext(), - sal_True, - sal_True); // quote is to true because we need quoted elements inside the function + pColumnRef->parseNodeToPredicateStr(aColumns, + xConnection, + rController.getNumberFormatter(), + _pView->getLocale(), + static_cast(_pView->getDecimalSeparator().toChar()), + &rController.getParser().getContext()); + //pColumnRef->parseNodeToStr( aColumns, + // xConnection, + // &rController.getParser().getContext(), + // sal_True, + // sal_True); // quote is to true because we need quoted elements inside the function sal_Int32 nFunctionType = FKT_NONE; ::connectivity::OSQLParseNode* pParamRef = NULL; -- cgit v1.2.3 From 7c8ed4b4f0cfa6257912b08cbc876268a9c80db5 Mon Sep 17 00:00:00 2001 From: "Ocke Janssen [oj]" Date: Wed, 10 Feb 2010 13:08:22 +0100 Subject: dba33e: #i107717# some renaming and wording changed --- dbaccess/source/core/api/View.cxx | 26 +++++++++++++++------- dbaccess/source/core/dataaccess/ModelImpl.cxx | 8 +++---- dbaccess/source/core/dataaccess/connection.cxx | 23 +++++++------------ dbaccess/source/core/dataaccess/connection.hxx | 2 +- .../source/core/dataaccess/databasedocument.cxx | 4 ++-- dbaccess/source/core/dataaccess/datasource.cxx | 2 +- dbaccess/source/core/inc/View.hxx | 4 ++-- dbaccess/source/filter/xml/xmlDatabase.cxx | 6 ++--- dbaccess/source/filter/xml/xmlExport.cxx | 6 ++--- 9 files changed, 42 insertions(+), 39 deletions(-) diff --git a/dbaccess/source/core/api/View.cxx b/dbaccess/source/core/api/View.cxx index 21e403cfb..9ed190cda 100644 --- a/dbaccess/source/core/api/View.cxx +++ b/dbaccess/source/core/api/View.cxx @@ -65,6 +65,16 @@ namespace dbaccess using ::com::sun::star::sdbc::XRow; /** === end UNO using === **/ + ::rtl::OUString lcl_getServiceNameForSetting(const Reference< ::com::sun::star::sdbc::XConnection >& _xConnection,const ::rtl::OUString& i_sSetting) + { + ::rtl::OUString sSupportService; + Any aValue; + if ( dbtools::getDataSourceSetting(_xConnection,i_sSetting,aValue) ) + { + aValue >>= sSupportService; + } + return sSupportService; + } //==================================================================== //= View //==================================================================== @@ -77,8 +87,8 @@ namespace dbaccess try { Reference xFac(_rxConnection,UNO_QUERY_THROW); - static const ::rtl::OUString s_sViewSupport(RTL_CONSTASCII_USTRINGPARAM("ViewSupportServiceName")); - m_xViewSupport.set(xFac->createInstance(s_sViewSupport),UNO_QUERY); + static const ::rtl::OUString s_sViewAccess(RTL_CONSTASCII_USTRINGPARAM("ViewAccessServiceName")); + m_XViewAccess.set(xFac->createInstance(lcl_getServiceNameForSetting(_rxConnection,s_sViewAccess)),UNO_QUERY); } catch(const Exception& ) { @@ -97,7 +107,7 @@ namespace dbaccess // ------------------------------------------------------------------------- Any SAL_CALL View::queryInterface( const Type & _rType ) throw(RuntimeException) { - if(_rType == getCppuType( (Reference*)0) && !m_xViewSupport.is() ) + if(_rType == getCppuType( (Reference*)0) && !m_XViewAccess.is() ) return Any(); Any aReturn = View_Base::queryInterface( _rType ); if ( !aReturn.hasValue() ) @@ -117,7 +127,7 @@ namespace dbaccess const Type* pEnd = pIter + aTypes.getLength(); for(;pIter != pEnd ;++pIter) { - if( (*pIter != aAlterType || m_xViewSupport.is()) ) + if( (*pIter != aAlterType || m_XViewAccess.is()) ) aOwnTypes.push_back(*pIter); } @@ -128,18 +138,18 @@ namespace dbaccess //-------------------------------------------------------------------- void SAL_CALL View::alterCommand( const ::rtl::OUString& _rNewCommand ) throw (SQLException, RuntimeException) { - OSL_ENSURE(m_xViewSupport.is(),"Illegal call to AlterView!"); - m_xViewSupport->alterCommand(this,_rNewCommand); + OSL_ENSURE(m_XViewAccess.is(),"Illegal call to AlterView!"); + m_XViewAccess->alterCommand(this,_rNewCommand); } //-------------------------------------------------------------------- void SAL_CALL View::getFastPropertyValue( Any& _rValue, sal_Int32 _nHandle ) const { - if ( _nHandle == m_nCommandHandle && m_xViewSupport.is() ) + if ( _nHandle == m_nCommandHandle && m_XViewAccess.is() ) { // retrieve the very current command, don't rely on the base classes cached value // (which we initialized empty, anyway) - _rValue <<= m_xViewSupport->getCommand(const_cast(this)); + _rValue <<= m_XViewAccess->getCommand(const_cast(this)); return; } diff --git a/dbaccess/source/core/dataaccess/ModelImpl.cxx b/dbaccess/source/core/dataaccess/ModelImpl.cxx index 884116de9..dfae421ba 100644 --- a/dbaccess/source/core/dataaccess/ModelImpl.cxx +++ b/dbaccess/source/core/dataaccess/ModelImpl.cxx @@ -1187,10 +1187,10 @@ const AsciiPropertyValue* ODatabaseModelImpl::getDefaultDataSourceSettings() AsciiPropertyValue( "TableAlterationServiceName", makeAny( ::rtl::OUString() ) ), AsciiPropertyValue( "TableRenameServiceName", makeAny( ::rtl::OUString() ) ), AsciiPropertyValue( "ViewAlterationServiceName", makeAny( ::rtl::OUString() ) ), - AsciiPropertyValue( "ViewSupportServiceName", makeAny( ::rtl::OUString() ) ), - AsciiPropertyValue( "CommandDefinitionSupplier", makeAny( ::rtl::OUString() ) ), - AsciiPropertyValue( "FormSupplier", makeAny( ::rtl::OUString() ) ), - AsciiPropertyValue( "ReportSupplier", makeAny( ::rtl::OUString() ) ), + AsciiPropertyValue( "ViewAccessServiceName", makeAny( ::rtl::OUString() ) ), + AsciiPropertyValue( "CommandDefinitions", makeAny( ::rtl::OUString() ) ), + AsciiPropertyValue( "Forms", makeAny( ::rtl::OUString() ) ), + AsciiPropertyValue( "Reports", makeAny( ::rtl::OUString() ) ), AsciiPropertyValue( "KeyAlterationServiceName", makeAny( ::rtl::OUString() ) ), AsciiPropertyValue( "IndexAlterationServiceName", makeAny( ::rtl::OUString() ) ), diff --git a/dbaccess/source/core/dataaccess/connection.cxx b/dbaccess/source/core/dataaccess/connection.cxx index 9ea2208f3..1554cd12f 100644 --- a/dbaccess/source/core/dataaccess/connection.cxx +++ b/dbaccess/source/core/dataaccess/connection.cxx @@ -732,24 +732,17 @@ Reference< XInterface > SAL_CALL OConnection::createInstance( const ::rtl::OUStr } else { - Reference xDs = dbaccess::getDataSource(*this); - Any aValue; - if ( dbtools::getDataSourceSetting(xDs,_sServiceSpecifier,aValue) ) + if ( _sServiceSpecifier.getLength() ) { - ::rtl::OUString sSupportService; - aValue >>= sSupportService; - if ( sSupportService.getLength() ) + TSupportServices::iterator aFind = m_aSupportServices.find(_sServiceSpecifier); + if ( aFind == m_aSupportServices.end() ) { - TSupportServices::iterator aFind = m_aSupportServices.find(sSupportService); - if ( aFind == m_aSupportServices.end()) - { - Sequence aArgs(1); - Reference xMy(this); - aArgs[0] <<= NamedValue(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ActiveConnection")),makeAny(xMy)); - aFind = m_aSupportServices.insert(TSupportServices::value_type(sSupportService,m_aContext.createComponentWithArguments(sSupportService,aArgs))).first; - } - return aFind->second; + Sequence aArgs(1); + Reference xMy(this); + aArgs[0] <<= NamedValue(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ActiveConnection")),makeAny(xMy)); + aFind = m_aSupportServices.insert(TSupportServices::value_type(_sServiceSpecifier,m_aContext.createComponentWithArguments(_sServiceSpecifier,aArgs))).first; } + return aFind->second; } } return Reference< XInterface >(xRet,UNO_QUERY); diff --git a/dbaccess/source/core/dataaccess/connection.hxx b/dbaccess/source/core/dataaccess/connection.hxx index 523c739cd..ea976a8d8 100644 --- a/dbaccess/source/core/dataaccess/connection.hxx +++ b/dbaccess/source/core/dataaccess/connection.hxx @@ -111,7 +111,7 @@ protected: ::com::sun::star::uno::Reference< ::com::sun::star::sdb::application::XTableUIProvider > m_xTableUIProvider; // defines the helper services for example to query the command of a view - // @ see com.sun.star.sdb.tools.XViewSupport + // @ see com.sun.star.sdb.tools.XViewAccess DECLARE_STL_USTRINGACCESS_MAP( ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface>, TSupportServices); TSupportServices m_aSupportServices; diff --git a/dbaccess/source/core/dataaccess/databasedocument.cxx b/dbaccess/source/core/dataaccess/databasedocument.cxx index d3cfe6a1e..fe13701ff 100644 --- a/dbaccess/source/core/dataaccess/databasedocument.cxx +++ b/dbaccess/source/core/dataaccess/databasedocument.cxx @@ -1155,14 +1155,14 @@ Reference< XNameAccess > ODatabaseDocument::impl_getDocumentContainer_throw( ODa { Any aValue; ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > xMy(*this); - if ( dbtools::getDataSourceSetting(xMy,bFormsContainer ? "FormSupplier" : "ReportSupplier",aValue) ) + if ( dbtools::getDataSourceSetting(xMy,bFormsContainer ? "Forms" : "Reports",aValue) ) { ::rtl::OUString sSupportService; aValue >>= sSupportService; if ( sSupportService.getLength() ) { Sequence aArgs(1); - aArgs[0] <<= NamedValue(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DataSource")),makeAny(xMy)); + aArgs[0] <<= NamedValue(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DatabaseDocument")),makeAny(xMy)); xContainer.set(m_pImpl->m_aContext.createComponentWithArguments(sSupportService,aArgs),UNO_QUERY); rContainerRef = xContainer; } diff --git a/dbaccess/source/core/dataaccess/datasource.cxx b/dbaccess/source/core/dataaccess/datasource.cxx index 88f16f41b..483533b20 100644 --- a/dbaccess/source/core/dataaccess/datasource.cxx +++ b/dbaccess/source/core/dataaccess/datasource.cxx @@ -1344,7 +1344,7 @@ Reference< XNameAccess > SAL_CALL ODatabaseSource::getQueryDefinitions( ) throw( { Any aValue; ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > xMy(*this); - if ( dbtools::getDataSourceSetting(xMy,"CommandDefinitionSupplier",aValue) ) + if ( dbtools::getDataSourceSetting(xMy,"CommandDefinitions",aValue) ) { ::rtl::OUString sSupportService; aValue >>= sSupportService; diff --git a/dbaccess/source/core/inc/View.hxx b/dbaccess/source/core/inc/View.hxx index e6c0dbabb..49d4b9190 100644 --- a/dbaccess/source/core/inc/View.hxx +++ b/dbaccess/source/core/inc/View.hxx @@ -35,7 +35,7 @@ /** === begin UNO includes === **/ #include -#include +#include /** === end UNO includes === **/ #include @@ -78,7 +78,7 @@ namespace dbaccess virtual void SAL_CALL getFastPropertyValue( ::com::sun::star::uno::Any& _rValue, sal_Int32 _nHandle ) const; private: - ::com::sun::star::uno::Reference< ::com::sun::star::sdb::tools::XViewSupport> m_xViewSupport; + ::com::sun::star::uno::Reference< ::com::sun::star::sdb::tools::XViewAccess> m_xViewAccess; sal_Int32 m_nCommandHandle; private: using View_Base::getFastPropertyValue; diff --git a/dbaccess/source/filter/xml/xmlDatabase.cxx b/dbaccess/source/filter/xml/xmlDatabase.cxx index e73341c92..df068d55c 100644 --- a/dbaccess/source/filter/xml/xmlDatabase.cxx +++ b/dbaccess/source/filter/xml/xmlDatabase.cxx @@ -88,7 +88,7 @@ SvXMLImportContext* OXMLDatabase::CreateChildContext( GetOwnImport().GetProgressBarHelper()->Increment( PROGRESS_BAR_STEP ); Any aValue; ::rtl::OUString sService; - dbtools::getDataSourceSetting(GetOwnImport().getDataSource(),"FormSupplier",aValue); + dbtools::getDataSourceSetting(GetOwnImport().getDataSource(),"Forms",aValue); aValue >>= sService; if ( !sService.getLength() ) { @@ -103,7 +103,7 @@ SvXMLImportContext* OXMLDatabase::CreateChildContext( GetOwnImport().GetProgressBarHelper()->Increment( PROGRESS_BAR_STEP ); Any aValue; ::rtl::OUString sService; - dbtools::getDataSourceSetting(GetOwnImport().getDataSource(),"ReportSupplier",aValue); + dbtools::getDataSourceSetting(GetOwnImport().getDataSource(),"Reports",aValue); aValue >>= sService; if ( !sService.getLength() ) { @@ -118,7 +118,7 @@ SvXMLImportContext* OXMLDatabase::CreateChildContext( GetOwnImport().GetProgressBarHelper()->Increment( PROGRESS_BAR_STEP ); Any aValue; ::rtl::OUString sService; - dbtools::getDataSourceSetting(GetOwnImport().getDataSource(),"CommandDefinitionSupplier",aValue); + dbtools::getDataSourceSetting(GetOwnImport().getDataSource(),"CommandDefinitions",aValue); aValue >>= sService; if ( !sService.getLength() ) { diff --git a/dbaccess/source/filter/xml/xmlExport.cxx b/dbaccess/source/filter/xml/xmlExport.cxx index b5afe2b7f..9d2126858 100644 --- a/dbaccess/source/filter/xml/xmlExport.cxx +++ b/dbaccess/source/filter/xml/xmlExport.cxx @@ -1067,7 +1067,7 @@ void ODBExport::exportForms() { Any aValue; ::rtl::OUString sService; - dbtools::getDataSourceSetting(getDataSource(),"ReportSupplier",aValue); + dbtools::getDataSourceSetting(getDataSource(),"Forms",aValue); aValue >>= sService; if ( !sService.getLength() ) { @@ -1088,7 +1088,7 @@ void ODBExport::exportReports() { Any aValue; ::rtl::OUString sService; - dbtools::getDataSourceSetting(getDataSource(),"ReportSupplier",aValue); + dbtools::getDataSourceSetting(getDataSource(),"Reports",aValue); aValue >>= sService; if ( !sService.getLength() ) { @@ -1109,7 +1109,7 @@ void ODBExport::exportQueries(sal_Bool _bExportContext) { Any aValue; ::rtl::OUString sService; - dbtools::getDataSourceSetting(getDataSource(),"CommandDefinitionSupplier",aValue); + dbtools::getDataSourceSetting(getDataSource(),"CommandDefinitions",aValue); aValue >>= sService; if ( !sService.getLength() ) { -- cgit v1.2.3 From bfc80bd35a201dc36ad493aaff60fd449a71d09b Mon Sep 17 00:00:00 2001 From: "Ocke Janssen [oj]" Date: Wed, 10 Feb 2010 13:09:56 +0100 Subject: dba33e: #i107717# some renaming and wording changed --- dbaccess/source/core/api/View.cxx | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/dbaccess/source/core/api/View.cxx b/dbaccess/source/core/api/View.cxx index 9ed190cda..3644c4f42 100644 --- a/dbaccess/source/core/api/View.cxx +++ b/dbaccess/source/core/api/View.cxx @@ -88,7 +88,7 @@ namespace dbaccess { Reference xFac(_rxConnection,UNO_QUERY_THROW); static const ::rtl::OUString s_sViewAccess(RTL_CONSTASCII_USTRINGPARAM("ViewAccessServiceName")); - m_XViewAccess.set(xFac->createInstance(lcl_getServiceNameForSetting(_rxConnection,s_sViewAccess)),UNO_QUERY); + m_xViewAccess.set(xFac->createInstance(lcl_getServiceNameForSetting(_rxConnection,s_sViewAccess)),UNO_QUERY); } catch(const Exception& ) { @@ -107,7 +107,7 @@ namespace dbaccess // ------------------------------------------------------------------------- Any SAL_CALL View::queryInterface( const Type & _rType ) throw(RuntimeException) { - if(_rType == getCppuType( (Reference*)0) && !m_XViewAccess.is() ) + if(_rType == getCppuType( (Reference*)0) && !m_xViewAccess.is() ) return Any(); Any aReturn = View_Base::queryInterface( _rType ); if ( !aReturn.hasValue() ) @@ -127,7 +127,7 @@ namespace dbaccess const Type* pEnd = pIter + aTypes.getLength(); for(;pIter != pEnd ;++pIter) { - if( (*pIter != aAlterType || m_XViewAccess.is()) ) + if( (*pIter != aAlterType || m_xViewAccess.is()) ) aOwnTypes.push_back(*pIter); } @@ -138,18 +138,18 @@ namespace dbaccess //-------------------------------------------------------------------- void SAL_CALL View::alterCommand( const ::rtl::OUString& _rNewCommand ) throw (SQLException, RuntimeException) { - OSL_ENSURE(m_XViewAccess.is(),"Illegal call to AlterView!"); - m_XViewAccess->alterCommand(this,_rNewCommand); + OSL_ENSURE(m_xViewAccess.is(),"Illegal call to AlterView!"); + m_xViewAccess->alterCommand(this,_rNewCommand); } //-------------------------------------------------------------------- void SAL_CALL View::getFastPropertyValue( Any& _rValue, sal_Int32 _nHandle ) const { - if ( _nHandle == m_nCommandHandle && m_XViewAccess.is() ) + if ( _nHandle == m_nCommandHandle && m_xViewAccess.is() ) { // retrieve the very current command, don't rely on the base classes cached value // (which we initialized empty, anyway) - _rValue <<= m_XViewAccess->getCommand(const_cast(this)); + _rValue <<= m_xViewAccess->getCommand(const_cast(this)); return; } -- cgit v1.2.3