summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrank Schoenheit [fs] <frank.schoenheit@sun.com>2010-02-10 14:17:11 +0100
committerFrank Schoenheit [fs] <frank.schoenheit@sun.com>2010-02-10 14:17:11 +0100
commitd0e69d32808e0bae81188684bc63f00c33b91f47 (patch)
tree415a739b6834ab6836c1b8ceaefd21f8b6d22c04
parentce04ad4d2a82e2e173c7e1053632fca1e7e354b6 (diff)
parent66a73b89dffcc55836e4da5f0d9450d89d692a07 (diff)
merge
-rw-r--r--dbaccess/source/core/api/View.cxx26
-rw-r--r--dbaccess/source/core/dataaccess/ModelImpl.cxx8
-rw-r--r--dbaccess/source/core/dataaccess/connection.cxx23
-rw-r--r--dbaccess/source/core/dataaccess/connection.hxx2
-rw-r--r--dbaccess/source/core/dataaccess/databasedocument.cxx4
-rw-r--r--dbaccess/source/core/dataaccess/datasource.cxx2
-rw-r--r--dbaccess/source/core/inc/View.hxx4
-rw-r--r--dbaccess/source/filter/xml/xmlDatabase.cxx6
-rw-r--r--dbaccess/source/filter/xml/xmlExport.cxx6
-rw-r--r--dbaccess/source/ui/dlg/dbwizsetup.cxx2
-rw-r--r--dbaccess/source/ui/querydesign/QueryDesignView.cxx16
11 files changed, 54 insertions, 45 deletions
diff --git a/dbaccess/source/core/api/View.cxx b/dbaccess/source/core/api/View.cxx
index d7e5221446b0..fa528d203466 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<XMultiServiceFactory> 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<XAlterView>*)0) && !m_xViewSupport.is() )
+ if(_rType == getCppuType( (Reference<XAlterView>*)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<View*>(this));
+ _rValue <<= m_xViewAccess->getCommand(const_cast<View*>(this));
return;
}
diff --git a/dbaccess/source/core/dataaccess/ModelImpl.cxx b/dbaccess/source/core/dataaccess/ModelImpl.cxx
index 17f16c25a71d..26bb425c82d8 100644
--- a/dbaccess/source/core/dataaccess/ModelImpl.cxx
+++ b/dbaccess/source/core/dataaccess/ModelImpl.cxx
@@ -1163,10 +1163,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 2a28df1c2871..3af233d9a232 100644
--- a/dbaccess/source/core/dataaccess/connection.cxx
+++ b/dbaccess/source/core/dataaccess/connection.cxx
@@ -736,24 +736,17 @@ Reference< XInterface > SAL_CALL OConnection::createInstance( const ::rtl::OUStr
}
else
{
- Reference<XInterface> 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<Any> aArgs(1);
- Reference<XConnection> 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<Any> aArgs(1);
+ Reference<XConnection> 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 98b8535953db..3de59df5f134 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 33ecdf3311ce..ae3d24816728 100644
--- a/dbaccess/source/core/dataaccess/databasedocument.cxx
+++ b/dbaccess/source/core/dataaccess/databasedocument.cxx
@@ -1375,14 +1375,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<Any> 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 f0cca707fc3b..bc635824bfd2 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 0cda27afcf82..4e96a1882423 100644
--- a/dbaccess/source/core/inc/View.hxx
+++ b/dbaccess/source/core/inc/View.hxx
@@ -35,7 +35,7 @@
/** === begin UNO includes === **/
#include <com/sun/star/sdbcx/XAlterView.hpp>
-#include <com/sun/star/sdb/tools/XViewSupport.hpp>
+#include <com/sun/star/sdb/tools/XViewAccess.hpp>
/** === end UNO includes === **/
#include <comphelper/uno3.hxx>
@@ -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 89111c6e6e48..842a598340cc 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 28c85bcb5043..d9d6f671e57e 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() )
{
diff --git a/dbaccess/source/ui/dlg/dbwizsetup.cxx b/dbaccess/source/ui/dlg/dbwizsetup.cxx
index c38a74d95dbc..58cf54bfd54c 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;
diff --git a/dbaccess/source/ui/querydesign/QueryDesignView.cxx b/dbaccess/source/ui/querydesign/QueryDesignView.cxx
index b7e005e420aa..f482c99c5bb4 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<sal_Char>(_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;