diff options
author | Ocke Janssen [oj] <Ocke.Janssen@sun.com> | 2010-01-08 11:22:52 +0100 |
---|---|---|
committer | Ocke Janssen [oj] <Ocke.Janssen@sun.com> | 2010-01-08 11:22:52 +0100 |
commit | e3a65fa34e0906bd4d90aae97d81f8d7eee60e28 (patch) | |
tree | ab94f16cd2bf84769e8634153fe189c35fa3ebc3 /dbaccess/source/ui | |
parent | 993a031df19361ae07b8aaec112b9b863b70a2bd (diff) | |
parent | d3a4501c36c893751070c20e5a6462261269668b (diff) |
Automated merge with http://hg.services.openoffice.org/cws/dba33e
Diffstat (limited to 'dbaccess/source/ui')
-rw-r--r-- | dbaccess/source/ui/dlg/DbAdminImpl.cxx | 9 | ||||
-rw-r--r-- | dbaccess/source/ui/dlg/DbAdminImpl.hxx | 1 | ||||
-rw-r--r-- | dbaccess/source/ui/dlg/dbwizsetup.cxx | 2 | ||||
-rw-r--r-- | dbaccess/source/ui/misc/HtmlReader.cxx | 4 | ||||
-rw-r--r-- | dbaccess/source/ui/misc/WTypeSelect.cxx | 2 | ||||
-rw-r--r-- | dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx | 13 |
6 files changed, 27 insertions, 4 deletions
diff --git a/dbaccess/source/ui/dlg/DbAdminImpl.cxx b/dbaccess/source/ui/dlg/DbAdminImpl.cxx index dd7e736240ec..fd62eba4ff5f 100644 --- a/dbaccess/source/ui/dlg/DbAdminImpl.cxx +++ b/dbaccess/source/ui/dlg/DbAdminImpl.cxx @@ -356,6 +356,11 @@ void ODbDataSourceAdministrationHelper::clearPassword() // ----------------------------------------------------------------------------- Reference< XDriver > ODbDataSourceAdministrationHelper::getDriver() { + return getDriver(getConnectionURL()); +} +// ----------------------------------------------------------------------------- +Reference< XDriver > ODbDataSourceAdministrationHelper::getDriver(const ::rtl::OUString& _sURL) +{ // get the global DriverManager Reference< XDriverAccess > xDriverManager; String sCurrentActionError = String(ModuleRes(STR_COULDNOTCREATE_DRIVERMANAGER)); @@ -376,11 +381,11 @@ Reference< XDriver > ODbDataSourceAdministrationHelper::getDriver() throw SQLException(sCurrentActionError, getORB(), ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("S1000")), 0, Any()); - Reference< XDriver > xDriver = xDriverManager->getDriverByURL(getConnectionURL()); + Reference< XDriver > xDriver = xDriverManager->getDriverByURL(_sURL); if (!xDriver.is()) { sCurrentActionError = String(ModuleRes(STR_NOREGISTEREDDRIVER)); - sCurrentActionError.SearchAndReplaceAscii("#connurl#", getConnectionURL()); + sCurrentActionError.SearchAndReplaceAscii("#connurl#", _sURL); // will be caught and translated into an SQLContext exception throw SQLException(sCurrentActionError, getORB(), ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("S1000")), 0, Any()); } diff --git a/dbaccess/source/ui/dlg/DbAdminImpl.hxx b/dbaccess/source/ui/dlg/DbAdminImpl.hxx index a194ebc7b23c..6c64363a1623 100644 --- a/dbaccess/source/ui/dlg/DbAdminImpl.hxx +++ b/dbaccess/source/ui/dlg/DbAdminImpl.hxx @@ -140,6 +140,7 @@ namespace dbaui /** return the corresponding driver for the selected URL */ ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDriver > getDriver(); + ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDriver > getDriver(const ::rtl::OUString& _sURL); /** returns the data source the dialog is currently working with */ diff --git a/dbaccess/source/ui/dlg/dbwizsetup.cxx b/dbaccess/source/ui/dlg/dbwizsetup.cxx index bab1dcca3694..ced0640b928c 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() ) + 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/misc/HtmlReader.cxx b/dbaccess/source/ui/misc/HtmlReader.cxx index b95423b77c24..b5733d0bebe5 100644 --- a/dbaccess/source/ui/misc/HtmlReader.cxx +++ b/dbaccess/source/ui/misc/HtmlReader.cxx @@ -509,6 +509,8 @@ sal_Bool OHTMLReader::CreateTable(int nToken) else if ( m_sCurrent.Len() ) aColumnName = m_sCurrent; + aColumnName.EraseLeadingChars(); + aColumnName.EraseTrailingChars(); CreateDefaultColumn(aColumnName); aColumnName.Erase(); m_sCurrent.Erase(); @@ -553,6 +555,8 @@ sal_Bool OHTMLReader::CreateTable(int nToken) if ( m_sCurrent.Len() ) aColumnName = m_sCurrent; + aColumnName.EraseLeadingChars(); + aColumnName.EraseTrailingChars(); if(aColumnName.Len()) CreateDefaultColumn(aColumnName); diff --git a/dbaccess/source/ui/misc/WTypeSelect.cxx b/dbaccess/source/ui/misc/WTypeSelect.cxx index a964b0e13d38..2d2d6e5ed241 100644 --- a/dbaccess/source/ui/misc/WTypeSelect.cxx +++ b/dbaccess/source/ui/misc/WTypeSelect.cxx @@ -323,6 +323,8 @@ IMPL_LINK( OWizTypeSelect, ColumnSelectHdl, MultiListBox *, /*pListBox*/ ) OFieldDescription* pField = static_cast<OFieldDescription*>(m_lbColumnNames.GetEntryData(m_lbColumnNames.GetEntryPos(aColumnName))); if(pField) m_aTypeControl.DisplayData(pField); + + m_aTypeControl.Enable(m_lbColumnNames.GetSelectEntryCount() == 1 ); return 0; } // ----------------------------------------------------------------------- diff --git a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx index 1b468b2a69c9..16fd0a9211ef 100644 --- a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx +++ b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx @@ -757,11 +757,22 @@ sal_Bool OSelectionBrowseBox::saveField(const String& _sFieldName,OTableFieldDes bool bInternational = ( nPass % 2 ) == 0; ::rtl::OUString sSql; - sSql += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SELECT ")); if ( bQuote ) sSql += ::dbtools::quoteName( xMetaData->getIdentifierQuoteString(), _sFieldName ); else sSql += _sFieldName; + + if ( _pEntry->isAggreateFunction() ) + { + DBG_ASSERT(_pEntry->GetFunction().getLength(),"Functionname darf hier nicht leer sein! ;-("); + ::rtl::OUStringBuffer aTmpStr2( _pEntry->GetFunction()); + aTmpStr2.appendAscii("("); + aTmpStr2.append(sSql); + aTmpStr2.appendAscii(")"); + sSql = aTmpStr2.makeStringAndClear(); + } + + sSql = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SELECT ")) + sSql; if ( sFieldAlias.getLength() ) { // always quote the alias name there canbe no function in it sSql += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" ")); |