diff options
Diffstat (limited to 'dbaccess/source/ui/uno')
20 files changed, 172 insertions, 184 deletions
diff --git a/dbaccess/source/ui/uno/AdvancedSettingsDlg.cxx b/dbaccess/source/ui/uno/AdvancedSettingsDlg.cxx index 3d24cfc242a7..51c3d2e9872e 100644 --- a/dbaccess/source/ui/uno/AdvancedSettingsDlg.cxx +++ b/dbaccess/source/ui/uno/AdvancedSettingsDlg.cxx @@ -28,7 +28,6 @@ namespace dbaui { using namespace ::com::sun::star::uno; - using namespace ::com::sun::star::lang; using namespace ::com::sun::star::beans; namespace { @@ -73,12 +72,12 @@ namespace dbaui OUString SAL_CALL OAdvancedSettingsDialog::getImplementationName() { - return "org.openoffice.comp.dbu.OAdvancedSettingsDialog"; + return u"org.openoffice.comp.dbu.OAdvancedSettingsDialog"_ustr; } css::uno::Sequence<OUString> SAL_CALL OAdvancedSettingsDialog::getSupportedServiceNames() { - return { "com.sun.star.sdb.AdvancedDatabaseSettingsDialog" }; + return { u"com.sun.star.sdb.AdvancedDatabaseSettingsDialog"_ustr }; } Reference<XPropertySetInfo> SAL_CALL OAdvancedSettingsDialog::getPropertySetInfo() diff --git a/dbaccess/source/ui/uno/ColumnControl.cxx b/dbaccess/source/ui/uno/ColumnControl.cxx index 4930ba994454..7e1fb6d8bdbc 100644 --- a/dbaccess/source/ui/uno/ColumnControl.cxx +++ b/dbaccess/source/ui/uno/ColumnControl.cxx @@ -19,7 +19,7 @@ #include "ColumnControl.hxx" #include "ColumnPeer.hxx" -#include <apitools.hxx> +#include <strings.hxx> #include <vcl/window.hxx> #include <com/sun/star/awt/PosSize.hpp> @@ -35,7 +35,6 @@ namespace dbaui using namespace ::com::sun::star::uno; using namespace ::com::sun::star::awt; using namespace ::com::sun::star::beans; -using namespace ::com::sun::star::lang; using namespace ::com::sun::star::sdbc; OColumnControl::OColumnControl(const Reference<XComponentContext>& rxContext) @@ -58,12 +57,12 @@ sal_Bool SAL_CALL OColumnControl::supportsService(const OUString& _rServiceName) } css::uno::Sequence< OUString > SAL_CALL OColumnControl::getSupportedServiceNames() { - return { "com.sun.star.awt.UnoControl","com.sun.star.sdb.ColumnDescriptorControl" }; + return { u"com.sun.star.awt.UnoControl"_ustr,u"com.sun.star.sdb.ColumnDescriptorControl"_ustr }; } -OUString OColumnControl::GetComponentServiceName() +OUString OColumnControl::GetComponentServiceName() const { - return "com.sun.star.sdb.ColumnDescriptorControl"; + return u"com.sun.star.sdb.ColumnDescriptorControl"_ustr; } void SAL_CALL OColumnControl::createPeer(const Reference< XToolkit >& /*rToolkit*/, const Reference< XWindowPeer >& rParentPeer) @@ -77,7 +76,7 @@ void SAL_CALL OColumnControl::createPeer(const Reference< XToolkit >& /*rToolkit vcl::Window* pParentWin = nullptr; if (rParentPeer.is()) { - VCLXWindow* pParent = comphelper::getFromUnoTunnel<VCLXWindow>(rParentPeer); + VCLXWindow* pParent = dynamic_cast<VCLXWindow*>(rParentPeer.get()); if (pParent) pParentWin = pParent->GetWindow(); } diff --git a/dbaccess/source/ui/uno/ColumnControl.hxx b/dbaccess/source/ui/uno/ColumnControl.hxx index 9c6054d623e2..63f06651284c 100644 --- a/dbaccess/source/ui/uno/ColumnControl.hxx +++ b/dbaccess/source/ui/uno/ColumnControl.hxx @@ -33,7 +33,7 @@ namespace dbaui explicit OColumnControl(const css::uno::Reference< css::uno::XComponentContext>& rxContext); // UnoControl - virtual OUString GetComponentServiceName() override; + virtual OUString GetComponentServiceName() const override; // XServiceInfo DECLARE_SERVICE_INFO(); diff --git a/dbaccess/source/ui/uno/ColumnModel.cxx b/dbaccess/source/ui/uno/ColumnModel.cxx index 2ed2e56d6b0d..5ba3ce8a7e47 100644 --- a/dbaccess/source/ui/uno/ColumnModel.cxx +++ b/dbaccess/source/ui/uno/ColumnModel.cxx @@ -21,6 +21,7 @@ #include <com/sun/star/beans/PropertyAttribute.hpp> #include <stringconstants.hxx> +#include <strings.hxx> extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface* com_sun_star_comp_dbu_OColumnControlModel_get_implementation( @@ -81,7 +82,7 @@ void OColumnControlModel::registerProperties() registerProperty( PROPERTY_COLUMN, PROPERTY_ID_COLUMN, PropertyAttribute::TRANSIENT | PropertyAttribute::BOUND, &m_xColumn, cppu::UnoType<decltype(m_xColumn)>::get() ); - registerMayBeVoidProperty( PROPERTY_TABSTOP, PROPERTY_ID_TABSTOP, PropertyAttribute::BOUND | PropertyAttribute::MAYBEVOID, + registerMayBeVoidProperty( PROPERTY_TABSTOP2, PROPERTY_ID_TABSTOP, PropertyAttribute::BOUND | PropertyAttribute::MAYBEVOID, &m_aTabStop, ::cppu::UnoType<sal_Int16>::get() ); registerProperty( PROPERTY_DEFAULTCONTROL, PROPERTY_ID_DEFAULTCONTROL, PropertyAttribute::BOUND, &m_sDefaultControl, cppu::UnoType<decltype(m_sDefaultControl)>::get() ); @@ -129,7 +130,7 @@ css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL OColumnControlMode OUString SAL_CALL OColumnControlModel::getImplementationName() { - return "com.sun.star.comp.dbu.OColumnControlModel"; + return u"com.sun.star.comp.dbu.OColumnControlModel"_ustr; } sal_Bool SAL_CALL OColumnControlModel::supportsService(const OUString& _rServiceName) { @@ -142,7 +143,7 @@ sal_Bool SAL_CALL OColumnControlModel::supportsService(const OUString& _rService } css::uno::Sequence< OUString > SAL_CALL OColumnControlModel::getSupportedServiceNames() { - return { "com.sun.star.awt.UnoControlModel","com.sun.star.sdb.ColumnDescriptorControlModel" }; + return { u"com.sun.star.awt.UnoControlModel"_ustr,u"com.sun.star.sdb.ColumnDescriptorControlModel"_ustr }; } IMPLEMENT_FORWARD_REFCOUNT( OColumnControlModel, OColumnControlModel_BASE ) Any SAL_CALL OColumnControlModel::queryInterface( const Type& _rType ) diff --git a/dbaccess/source/ui/uno/ColumnModel.hxx b/dbaccess/source/ui/uno/ColumnModel.hxx index 2a1d768476a5..ea31881ff09a 100644 --- a/dbaccess/source/ui/uno/ColumnModel.hxx +++ b/dbaccess/source/ui/uno/ColumnModel.hxx @@ -29,7 +29,6 @@ #include <comphelper/uno3.hxx> #include <cppuhelper/compbase4.hxx> #include <connectivity/CommonTools.hxx> -#include <apitools.hxx> namespace dbaui { @@ -41,8 +40,6 @@ typedef ::cppu::WeakAggComponentImplHelper4 < css::awt::XControlModel , css::io::XPersistObject > OColumnControlModel_BASE; -class OColumnControlModel; - class OColumnControlModel : public ::comphelper::OMutexAndBroadcastHelper ,public ::comphelper::OPropertyContainer ,public ::comphelper::OPropertyArrayUsageHelper< OColumnControlModel > diff --git a/dbaccess/source/ui/uno/ColumnPeer.cxx b/dbaccess/source/ui/uno/ColumnPeer.cxx index 48f5fbce5692..1e03cda49331 100644 --- a/dbaccess/source/ui/uno/ColumnPeer.cxx +++ b/dbaccess/source/ui/uno/ColumnPeer.cxx @@ -25,10 +25,8 @@ namespace dbaui { -using namespace ::com::sun::star::awt; using namespace ::com::sun::star::uno; using namespace ::com::sun::star::beans; -using namespace ::com::sun::star::lang; using namespace ::com::sun::star::sdbc; OColumnPeer::OColumnPeer(vcl::Window* _pParent,const Reference<XComponentContext>& _rxContext) @@ -90,7 +88,7 @@ void OColumnPeer::setColumn(const Reference< XPropertySet>& _xColumn) m_pActFieldDescr = new OFieldDescription(_xColumn,true); // search for type bool bForce; - TOTypeInfoSP pTypeInfo = ::dbaui::getTypeInfoFromType(*rControl.getTypeInfo(),nType,sTypeName,"x",nPrecision,nScale,bAutoIncrement,bForce); + TOTypeInfoSP pTypeInfo = ::dbaui::getTypeInfoFromType(*rControl.getTypeInfo(),nType,sTypeName,u"x"_ustr,nPrecision,nScale,bAutoIncrement,bForce); if ( !pTypeInfo ) pTypeInfo = rControl.getDefaultTyp(); diff --git a/dbaccess/source/ui/uno/DBTypeWizDlg.cxx b/dbaccess/source/ui/uno/DBTypeWizDlg.cxx index 8c9d16596386..dc7f25c96db6 100644 --- a/dbaccess/source/ui/uno/DBTypeWizDlg.cxx +++ b/dbaccess/source/ui/uno/DBTypeWizDlg.cxx @@ -34,7 +34,6 @@ namespace dbaui { using namespace ::com::sun::star::uno; - using namespace ::com::sun::star::lang; using namespace ::com::sun::star::beans; ODBTypeWizDialog::ODBTypeWizDialog(const Reference< XComponentContext >& _rxORB) @@ -49,12 +48,12 @@ Sequence<sal_Int8> SAL_CALL ODBTypeWizDialog::getImplementationId( ) OUString SAL_CALL ODBTypeWizDialog::getImplementationName() { - return "org.openoffice.comp.dbu.ODBTypeWizDialog"; + return u"org.openoffice.comp.dbu.ODBTypeWizDialog"_ustr; } css::uno::Sequence<OUString> SAL_CALL ODBTypeWizDialog::getSupportedServiceNames() { - return { "com.sun.star.sdb.DataSourceTypeChangeDialog" }; + return { u"com.sun.star.sdb.DataSourceTypeChangeDialog"_ustr }; } Reference<XPropertySetInfo> SAL_CALL ODBTypeWizDialog::getPropertySetInfo() diff --git a/dbaccess/source/ui/uno/DBTypeWizDlgSetup.cxx b/dbaccess/source/ui/uno/DBTypeWizDlgSetup.cxx index 63c3d6304b0d..4ed229a3b9d7 100644 --- a/dbaccess/source/ui/uno/DBTypeWizDlgSetup.cxx +++ b/dbaccess/source/ui/uno/DBTypeWizDlgSetup.cxx @@ -36,19 +36,17 @@ namespace dbaui { using namespace ::com::sun::star::uno; - using namespace ::com::sun::star::lang; using namespace ::com::sun::star::beans; - using namespace ::com::sun::star::sdbc; ODBTypeWizDialogSetup::ODBTypeWizDialogSetup(const Reference< XComponentContext >& _rxORB) :ODatabaseAdministrationDialog(_rxORB) ,m_bOpenDatabase(true) ,m_bStartTableWizard(false) { - registerProperty("OpenDatabase", 3, PropertyAttribute::TRANSIENT, + registerProperty(u"OpenDatabase"_ustr, 3, PropertyAttribute::TRANSIENT, &m_bOpenDatabase, cppu::UnoType<bool>::get()); - registerProperty("StartTableWizard", 4, PropertyAttribute::TRANSIENT, + registerProperty(u"StartTableWizard"_ustr, 4, PropertyAttribute::TRANSIENT, &m_bStartTableWizard, cppu::UnoType<bool>::get()); } @@ -59,12 +57,12 @@ Sequence<sal_Int8> SAL_CALL ODBTypeWizDialogSetup::getImplementationId( ) OUString SAL_CALL ODBTypeWizDialogSetup::getImplementationName() { - return "org.openoffice.comp.dbu.ODBTypeWizDialogSetup"; + return u"org.openoffice.comp.dbu.ODBTypeWizDialogSetup"_ustr; } css::uno::Sequence<OUString> SAL_CALL ODBTypeWizDialogSetup::getSupportedServiceNames() { - return { "com.sun.star.sdb.DatabaseWizardDialog" }; + return { u"com.sun.star.sdb.DatabaseWizardDialog"_ustr }; } Reference<XPropertySetInfo> SAL_CALL ODBTypeWizDialogSetup::getPropertySetInfo() diff --git a/dbaccess/source/ui/uno/TableFilterDlg.cxx b/dbaccess/source/ui/uno/TableFilterDlg.cxx index cd01f2587370..740566aa3873 100644 --- a/dbaccess/source/ui/uno/TableFilterDlg.cxx +++ b/dbaccess/source/ui/uno/TableFilterDlg.cxx @@ -34,7 +34,6 @@ namespace dbaui { using namespace ::com::sun::star::uno; - using namespace ::com::sun::star::lang; using namespace ::com::sun::star::beans; OTableFilterDialog::OTableFilterDialog(const Reference< XComponentContext >& _rxORB) @@ -49,12 +48,12 @@ Sequence<sal_Int8> SAL_CALL OTableFilterDialog::getImplementationId( ) OUString SAL_CALL OTableFilterDialog::getImplementationName() { - return "org.openoffice.comp.dbu.OTableFilterDialog"; + return u"org.openoffice.comp.dbu.OTableFilterDialog"_ustr; } css::uno::Sequence<OUString> SAL_CALL OTableFilterDialog::getSupportedServiceNames() { - return { "com.sun.star.sdb.TableFilterDialog" }; + return { u"com.sun.star.sdb.TableFilterDialog"_ustr }; } Reference<XPropertySetInfo> SAL_CALL OTableFilterDialog::getPropertySetInfo() diff --git a/dbaccess/source/ui/uno/UserSettingsDlg.cxx b/dbaccess/source/ui/uno/UserSettingsDlg.cxx index 7039c7396d86..a0467de67d68 100644 --- a/dbaccess/source/ui/uno/UserSettingsDlg.cxx +++ b/dbaccess/source/ui/uno/UserSettingsDlg.cxx @@ -34,7 +34,6 @@ namespace dbaui { using namespace ::com::sun::star::uno; - using namespace ::com::sun::star::lang; using namespace ::com::sun::star::beans; OUserSettingsDialog::OUserSettingsDialog(const Reference< XComponentContext >& _rxORB) @@ -49,12 +48,12 @@ Sequence<sal_Int8> SAL_CALL OUserSettingsDialog::getImplementationId( ) OUString SAL_CALL OUserSettingsDialog::getImplementationName() { - return "org.openoffice.comp.dbu.OUserSettingsDialog"; + return u"org.openoffice.comp.dbu.OUserSettingsDialog"_ustr; } css::uno::Sequence<OUString> SAL_CALL OUserSettingsDialog::getSupportedServiceNames() { - return { "com.sun.star.sdb.UserAdministrationDialog" }; + return { u"com.sun.star.sdb.UserAdministrationDialog"_ustr }; } Reference<XPropertySetInfo> SAL_CALL OUserSettingsDialog::getPropertySetInfo() diff --git a/dbaccess/source/ui/uno/admindlg.cxx b/dbaccess/source/ui/uno/admindlg.cxx index 3e524372eea5..1d396986c243 100644 --- a/dbaccess/source/ui/uno/admindlg.cxx +++ b/dbaccess/source/ui/uno/admindlg.cxx @@ -33,7 +33,6 @@ org_openoffice_comp_dbu_ODatasourceAdministrationDialog_get_implementation( namespace dbaui { using namespace ::com::sun::star::uno; -using namespace ::com::sun::star::lang; using namespace ::com::sun::star::beans; ODataSourcePropertyDialog::ODataSourcePropertyDialog(const Reference<XComponentContext>& _rxORB) @@ -48,12 +47,12 @@ Sequence<sal_Int8> SAL_CALL ODataSourcePropertyDialog::getImplementationId() OUString SAL_CALL ODataSourcePropertyDialog::getImplementationName() { - return "org.openoffice.comp.dbu.ODatasourceAdministrationDialog"; + return u"org.openoffice.comp.dbu.ODatasourceAdministrationDialog"_ustr; } css::uno::Sequence<OUString> SAL_CALL ODataSourcePropertyDialog::getSupportedServiceNames() { - return { "com.sun.star.sdb.DatasourceAdministrationDialog" }; + return { u"com.sun.star.sdb.DatasourceAdministrationDialog"_ustr }; } Reference<XPropertySetInfo> SAL_CALL ODataSourcePropertyDialog::getPropertySetInfo() diff --git a/dbaccess/source/ui/uno/composerdialogs.cxx b/dbaccess/source/ui/uno/composerdialogs.cxx index 4040aea94ca7..7af65ef8ebbe 100644 --- a/dbaccess/source/ui/uno/composerdialogs.cxx +++ b/dbaccess/source/ui/uno/composerdialogs.cxx @@ -24,8 +24,9 @@ #include <com/sun/star/sdbcx/XColumnsSupplier.hpp> #include <queryfilter.hxx> #include <queryorder.hxx> +#include <strings.hxx> #include <connectivity/dbtools.hxx> -#include <tools/diagnose_ex.h> +#include <comphelper/diagnose_ex.hxx> #include <osl/diagnose.h> #include <vcl/svapp.hxx> @@ -52,7 +53,6 @@ constexpr OUStringLiteral PROPERTY_QUERYCOMPOSER = u"QueryComposer"; constexpr OUStringLiteral PROPERTY_ROWSET = u"RowSet"; using namespace ::com::sun::star::uno; - using namespace ::com::sun::star::lang; using namespace ::com::sun::star::beans; using namespace ::com::sun::star::container; using namespace ::com::sun::star::sdbcx; @@ -153,7 +153,7 @@ constexpr OUStringLiteral PROPERTY_ROWSET = u"RowSet"; OUString SAL_CALL RowsetFilterDialog::getImplementationName() { - return "com.sun.star.uno.comp.sdb.RowsetFilterDialog"; + return u"com.sun.star.uno.comp.sdb.RowsetFilterDialog"_ustr; } sal_Bool SAL_CALL RowsetFilterDialog::supportsService(const OUString& _rServiceName) { @@ -166,7 +166,7 @@ constexpr OUStringLiteral PROPERTY_ROWSET = u"RowSet"; } css::uno::Sequence< OUString > SAL_CALL RowsetFilterDialog::getSupportedServiceNames() { - return { "com.sun.star.sdb.FilterDialog" }; + return { u"com.sun.star.sdb.FilterDialog"_ustr }; } std::unique_ptr<weld::GenericDialogController> RowsetFilterDialog::createComposerDialog(weld::Window* _pParent, const Reference< XConnection >& _rxConnection, const Reference< XNameAccess >& _rxColumns ) @@ -185,9 +185,9 @@ constexpr OUStringLiteral PROPERTY_ROWSET = u"RowSet"; aArguments[1] >>= xRowSet; Reference<css::awt::XWindow> xParentWindow; aArguments[2] >>= xParentWindow; - setPropertyValue( "QueryComposer", makeAny( xQueryComposer ) ); - setPropertyValue( "RowSet", makeAny( xRowSet ) ); - setPropertyValue( "ParentWindow", makeAny( xParentWindow ) ); + setPropertyValue( u"QueryComposer"_ustr, Any( xQueryComposer ) ); + setPropertyValue( u"RowSet"_ustr, Any( xRowSet ) ); + setPropertyValue( u"ParentWindow"_ustr, Any( xParentWindow ) ); } else ComposerDialog::initialize(aArguments); @@ -209,7 +209,7 @@ constexpr OUStringLiteral PROPERTY_ROWSET = u"RowSet"; OUString SAL_CALL RowsetOrderDialog::getImplementationName() { - return "com.sun.star.uno.comp.sdb.RowsetOrderDialog"; + return u"com.sun.star.uno.comp.sdb.RowsetOrderDialog"_ustr; } sal_Bool SAL_CALL RowsetOrderDialog::supportsService(const OUString& _rServiceName) { @@ -222,7 +222,7 @@ constexpr OUStringLiteral PROPERTY_ROWSET = u"RowSet"; } css::uno::Sequence< OUString > SAL_CALL RowsetOrderDialog::getSupportedServiceNames() { - return { "com.sun.star.sdb.OrderDialog" }; + return { u"com.sun.star.sdb.OrderDialog"_ustr }; } std::unique_ptr<weld::GenericDialogController> RowsetOrderDialog::createComposerDialog(weld::Window* pParent, const Reference< XConnection >& rxConnection, const Reference< XNameAccess >& rxColumns) @@ -238,13 +238,13 @@ constexpr OUStringLiteral PROPERTY_ROWSET = u"RowSet"; aArguments[0] >>= xQueryComposer; Reference<css::beans::XPropertySet> xRowSet; aArguments[1] >>= xRowSet; - setPropertyValue( "QueryComposer", makeAny( xQueryComposer ) ); - setPropertyValue( "RowSet", makeAny( xRowSet ) ); + setPropertyValue( u"QueryComposer"_ustr, Any( xQueryComposer ) ); + setPropertyValue( u"RowSet"_ustr, Any( xRowSet ) ); if (aArguments.getLength() == 3) { Reference<css::awt::XWindow> xParentWindow; aArguments[2] >>= xParentWindow; - setPropertyValue("ParentWindow", makeAny(xParentWindow)); + setPropertyValue(u"ParentWindow"_ustr, Any(xParentWindow)); } } else diff --git a/dbaccess/source/ui/uno/composerdialogs.hxx b/dbaccess/source/ui/uno/composerdialogs.hxx index a2f68fe02223..4e71b1c64704 100644 --- a/dbaccess/source/ui/uno/composerdialogs.hxx +++ b/dbaccess/source/ui/uno/composerdialogs.hxx @@ -27,7 +27,6 @@ #include <comphelper/proparrhlp.hxx> #include <connectivity/CommonTools.hxx> #include <svtools/genericunodialog.hxx> -#include <apitools.hxx> namespace dbaui { diff --git a/dbaccess/source/ui/uno/copytablewizard.cxx b/dbaccess/source/ui/uno/copytablewizard.cxx index 51420d74995c..13a4f050731b 100644 --- a/dbaccess/source/ui/uno/copytablewizard.cxx +++ b/dbaccess/source/ui/uno/copytablewizard.cxx @@ -60,11 +60,12 @@ #include <cppuhelper/exc_hlp.hxx> #include <cppuhelper/implbase.hxx> #include <comphelper/interfacecontainer3.hxx> +#include <o3tl/safeint.hxx> #include <rtl/ustrbuf.hxx> #include <sal/log.hxx> #include <svtools/genericunodialog.hxx> #include <toolkit/helper/vclunohelper.hxx> -#include <tools/diagnose_ex.h> +#include <comphelper/diagnose_ex.hxx> #include <unotools/sharedunocomponent.hxx> #include <vcl/svapp.hxx> @@ -79,7 +80,6 @@ namespace dbaui using ::com::sun::star::uno::Exception; using ::com::sun::star::uno::RuntimeException; using ::com::sun::star::uno::Any; - using ::com::sun::star::uno::makeAny; using ::com::sun::star::uno::Sequence; using ::com::sun::star::uno::XComponentContext; using ::com::sun::star::beans::XPropertySetInfo; @@ -370,7 +370,7 @@ CopyTableWizard::CopyTableWizard( const Reference< XComponentContext >& _rxORB ) :CopyTableWizard_Base( _rxORB ) ,m_xContext( _rxORB ) ,m_nOperation( CopyTableOperation::CopyDefinitionAndData ) - ,m_aPrimaryKeyName( false, "ID" ) + ,m_aPrimaryKeyName( false, u"ID"_ustr ) ,m_bUseHeaderLineAsColumnNames( true ) ,m_nCommandType( CommandType::COMMAND ) ,m_bSourceSelectionBookmarks( true ) @@ -398,12 +398,12 @@ CopyTableWizard::~CopyTableWizard() OUString SAL_CALL CopyTableWizard::getImplementationName() { - return "org.openoffice.comp.dbu.CopyTableWizard"; + return u"org.openoffice.comp.dbu.CopyTableWizard"_ustr; } css::uno::Sequence<OUString> SAL_CALL CopyTableWizard::getSupportedServiceNames() { - return { "com.sun.star.sdb.application.CopyTableWizard" }; + return { u"com.sun.star.sdb.application.CopyTableWizard"_ustr }; } Reference< XPropertySetInfo > SAL_CALL CopyTableWizard::getPropertySetInfo() @@ -572,8 +572,7 @@ namespace // see whether the document model can provide a handler if ( xDocumentModel.is() ) { - ::comphelper::NamedValueCollection aModelArgs( xDocumentModel->getArgs() ); - xHandler = aModelArgs.getOrDefault( "InteractionHandler", xHandler ); + xHandler = ::comphelper::NamedValueCollection::getOrDefault( xDocumentModel->getArgs(), u"InteractionHandler", xHandler ); } return xHandler; @@ -617,7 +616,7 @@ Reference< XPropertySet > CopyTableWizard::impl_ensureDataAccessDescriptor_throw { Reference< XServiceInfo > xSI( xDescriptor, UNO_QUERY ); bIsValid = ( xSI.is() - && xSI->supportsService( "com.sun.star.sdb.DataAccessDescriptor" ) ); + && xSI->supportsService( u"com.sun.star.sdb.DataAccessDescriptor"_ustr ) ); } // it must be able to provide a connection @@ -660,7 +659,7 @@ void CopyTableWizard::impl_checkForUnsupportedSettings_throw( const Reference< X OUString sUnsupportedSetting; const OUString aSettings[] = { - OUString(PROPERTY_FILTER), OUString(PROPERTY_ORDER), OUString(PROPERTY_HAVING_CLAUSE), OUString(PROPERTY_GROUP_BY) + PROPERTY_FILTER, PROPERTY_ORDER, PROPERTY_HAVING_CLAUSE, PROPERTY_GROUP_BY }; for (const auto & aSetting : aSettings) { @@ -693,7 +692,7 @@ std::unique_ptr< ICopyTableSourceObject > CopyTableWizard::impl_extractSourceObj if ( !xPSI->hasPropertyByName( PROPERTY_COMMAND ) || !xPSI->hasPropertyByName( PROPERTY_COMMAND_TYPE ) ) - throw IllegalArgumentException("Expecting a table or query specification.", + throw IllegalArgumentException(u"Expecting a table or query specification."_ustr, // TODO: resource *const_cast< CopyTableWizard* >( this ), 1); @@ -769,7 +768,7 @@ void CopyTableWizard::impl_extractSourceResultSet_throw( const Reference< XPrope const bool bHasResultSet = m_xSourceResultSet.is(); const bool bHasSelection = m_aSourceSelection.hasElements(); if ( bHasSelection && !bHasResultSet ) - throw IllegalArgumentException("A result set is needed when specifying a selection to copy.", + throw IllegalArgumentException(u"A result set is needed when specifying a selection to copy."_ustr, // TODO: resource *this, 1); @@ -876,7 +875,7 @@ SharedConnection CopyTableWizard::impl_extractConnection_throw( const Reference< while ( false ); if ( xInteractionHandler != m_xInteractionHandler ) - _out_rxDocInteractionHandler = xInteractionHandler; + _out_rxDocInteractionHandler = std::move(xInteractionHandler); return xConnection; } @@ -885,7 +884,7 @@ SharedConnection CopyTableWizard::impl_extractConnection_throw( const Reference< { OSL_PRECOND( m_xSourceConnection.is(), "CopyTableWizard::impl_createSourceStatement_throw: illegal call!" ); if ( !m_xSourceConnection.is() ) - throw RuntimeException( "CopyTableWizard::impl_createSourceStatement_throw: illegal call!", *const_cast< CopyTableWizard* >( this )); + throw RuntimeException( u"CopyTableWizard::impl_createSourceStatement_throw: illegal call!"_ustr, *const_cast< CopyTableWizard* >( this )); ::utl::SharedUNOComponent< XPreparedStatement > xStatement; switch ( m_nCommandType ) @@ -931,7 +930,7 @@ SharedConnection CopyTableWizard::impl_extractConnection_throw( const Reference< default: // this should not have survived initialization phase - throw RuntimeException("No case matched, this should not have survived the initialization phase", *const_cast< CopyTableWizard* >( this )); + throw RuntimeException(u"No case matched, this should not have survived the initialization phase"_ustr, *const_cast< CopyTableWizard* >( this )); } return xStatement; @@ -942,40 +941,39 @@ namespace class ValueTransfer { public: - ValueTransfer( const sal_Int32& _rSourcePos, const sal_Int32& _rDestPos, std::vector< sal_Int32 >&& _rColTypes, + ValueTransfer( std::vector< sal_Int32 > _rColTypes, const Reference< XRow >& _rxSource, const Reference< XParameters >& _rxDest ) - :m_rSourcePos( _rSourcePos ) - ,m_rDestPos( _rDestPos ) - ,m_rColTypes( std::move(_rColTypes) ) + :m_ColTypes( std::move(_rColTypes) ) ,m_xSource( _rxSource ) ,m_xDest( _rxDest ) { } template< typename VALUE_TYPE > - void transferValue( VALUE_TYPE ( SAL_CALL XRow::*_pGetter )( sal_Int32 ), + void transferValue( sal_Int32 _nSourcePos, sal_Int32 _nDestPos, + VALUE_TYPE ( SAL_CALL XRow::*_pGetter )( sal_Int32 ), void (SAL_CALL XParameters::*_pSetter)( sal_Int32, VALUE_TYPE ) ) { - VALUE_TYPE value( (m_xSource.get()->*_pGetter)( m_rSourcePos ) ); + VALUE_TYPE value( (m_xSource.get()->*_pGetter)( _nSourcePos ) ); if ( m_xSource->wasNull() ) - m_xDest->setNull( m_rDestPos, m_rColTypes[ m_rSourcePos ] ); + m_xDest->setNull( _nDestPos, m_ColTypes[ _nSourcePos ] ); else - (m_xDest.get()->*_pSetter)( m_rDestPos, value ); + (m_xDest.get()->*_pSetter)( _nDestPos, value ); } - template< typename VALUE_TYPE > - void transferComplexValue( VALUE_TYPE ( SAL_CALL XRow::*_pGetter )( sal_Int32 ), + + template< typename VALUE_TYPE > + void transferComplexValue( sal_Int32 _nSourcePos, sal_Int32 _nDestPos, + VALUE_TYPE ( SAL_CALL XRow::*_pGetter )( sal_Int32 ), void (SAL_CALL XParameters::*_pSetter)( sal_Int32, const VALUE_TYPE& ) ) { - const VALUE_TYPE value( (m_xSource.get()->*_pGetter)( m_rSourcePos ) ); + const VALUE_TYPE value( (m_xSource.get()->*_pGetter)( _nSourcePos ) ); if ( m_xSource->wasNull() ) - m_xDest->setNull( m_rDestPos, m_rColTypes[ m_rSourcePos ] ); + m_xDest->setNull( _nDestPos, m_ColTypes[ _nSourcePos ] ); else - (m_xDest.get()->*_pSetter)( m_rDestPos, value ); + (m_xDest.get()->*_pSetter)( _nDestPos, value ); } private: - const sal_Int32& m_rSourcePos; - const sal_Int32& m_rDestPos; - const std::vector< sal_Int32 > m_rColTypes; + const std::vector< sal_Int32 > m_ColTypes; const Reference< XRow > m_xSource; const Reference< XParameters > m_xDest; }; @@ -1013,26 +1011,22 @@ bool CopyTableWizard::impl_processCopyError_nothrow( const CopyTableRowEvent& _r try { - SQLContext aError; - aError.Context = *this; - aError.Message = DBA_RES(STR_ERROR_OCCURRED_WHILE_COPYING); - + css::uno::Any next; ::dbtools::SQLExceptionInfo aInfo( _rEvent.Error ); if ( aInfo.isValid() ) - aError.NextException = _rEvent.Error; + next = _rEvent.Error; else { // a non-SQL exception happened Exception aException; OSL_VERIFY( _rEvent.Error >>= aException ); - SQLContext aContext; - aContext.Context = aException.Context; - aContext.Message = aException.Message; - aContext.Details = _rEvent.Error.getValueTypeName(); - aError.NextException <<= aContext; + SQLContext aContext(aException.Message, aException.Context, {}, 0, {}, + _rEvent.Error.getValueTypeName()); + next <<= aContext; } + SQLContext aError(DBA_RES(STR_ERROR_OCCURRED_WHILE_COPYING), *this, {}, 0, next, {}); - ::rtl::Reference< ::comphelper::OInteractionRequest > xRequest( new ::comphelper::OInteractionRequest( makeAny( aError ) ) ); + ::rtl::Reference< ::comphelper::OInteractionRequest > xRequest( new ::comphelper::OInteractionRequest( Any( aError ) ) ); ::rtl::Reference< ::comphelper::OInteractionApprove > xYes = new ::comphelper::OInteractionApprove; xRequest->addContinuation( xYes ); @@ -1061,12 +1055,13 @@ void CopyTableWizard::impl_copyRows_throw( const Reference< XResultSet >& _rxSou { OSL_PRECOND( m_xDestConnection.is(), "CopyTableWizard::impl_copyRows_throw: illegal call!" ); if ( !m_xDestConnection.is() ) - throw RuntimeException( "m_xDestConnection is set to null, CopyTableWizard::impl_copyRows_throw: illegal call!", *this ); + throw RuntimeException( u"m_xDestConnection is set to null, CopyTableWizard::impl_copyRows_throw: illegal call!"_ustr, *this ); Reference< XDatabaseMetaData > xDestMetaData( m_xDestConnection->getMetaData(), UNO_SET_THROW ); const OCopyTableWizard& rWizard = impl_getDialog_throw(); ODatabaseExport::TPositions aColumnPositions = rWizard.GetColumnPositions(); + const bool bShouldCreatePrimaryKey = rWizard.shouldCreatePrimaryKey(); Reference< XRow > xRow ( _rxSourceResultSet, UNO_QUERY_THROW ); Reference< XRowLocate > xRowLocate ( _rxSourceResultSet, UNO_QUERY_THROW ); @@ -1091,12 +1086,12 @@ void CopyTableWizard::impl_copyRows_throw( const Reference< XResultSet >& _rxSou } // now create, fill and execute the prepared statement - Reference< XPreparedStatement > xStatement( ODatabaseExport::createPreparedStatment( xDestMetaData, _rxDestTable, aColumnPositions ), UNO_SET_THROW ); + Reference< XPreparedStatement > xStatement( ODatabaseExport::createPreparedStatement( xDestMetaData, _rxDestTable, aColumnPositions ), UNO_SET_THROW ); Reference< XParameters > xStatementParams( xStatement, UNO_QUERY_THROW ); const bool bSelectedRecordsOnly = m_aSourceSelection.hasElements(); - const Any* pSelectedRow = m_aSourceSelection.getConstArray(); - const Any* pSelEnd = pSelectedRow + m_aSourceSelection.getLength(); + const Any* pSelectedRow = m_aSourceSelection.begin(); + const Any* pSelEnd = m_aSourceSelection.end(); sal_Int32 nRowCount = 0; bool bContinue = false; @@ -1138,16 +1133,16 @@ void CopyTableWizard::impl_copyRows_throw( const Reference< XResultSet >& _rxSou aCopyEvent.Error.clear(); try { + bool bInsertedPrimaryKey = false; // notify listeners m_aCopyTableListeners.notifyEach( &XCopyTableListener::copyingRow, aCopyEvent ); - sal_Int32 nDestColumn( 0 ); sal_Int32 nSourceColumn( 1 ); - ValueTransfer aTransfer( nSourceColumn, nDestColumn, std::vector(aSourceColTypes), xRow, xStatementParams ); + ValueTransfer aTransfer( aSourceColTypes, xRow, xStatementParams ); for ( auto const& rColumnPos : aColumnPositions ) { - nDestColumn = rColumnPos.first; + sal_Int32 nDestColumn = rColumnPos.first; if ( nDestColumn == COLUMN_POSITION_NOT_FOUND ) { ++nSourceColumn; @@ -1155,9 +1150,17 @@ void CopyTableWizard::impl_copyRows_throw( const Reference< XResultSet >& _rxSou continue; } - if ( ( nSourceColumn < 1 ) || ( nSourceColumn >= static_cast<sal_Int32>(aSourceColTypes.size()) ) ) + if ( bShouldCreatePrimaryKey && !bInsertedPrimaryKey ) + { + xStatementParams->setInt( 1, nRowCount ); + ++nSourceColumn; + bInsertedPrimaryKey = true; + continue; + } + + if ( ( nSourceColumn < 1 ) || ( o3tl::make_unsigned(nSourceColumn) >= aSourceColTypes.size() ) ) { // ( we have to check here against 1 because the parameters are 1 based) - ::dbtools::throwSQLException("Internal error: invalid column type index.", + ::dbtools::throwSQLException(u"Internal error: invalid column type index."_ustr, ::dbtools::StandardSQLState::INVALID_DESCRIPTOR_INDEX, *this); } @@ -1165,7 +1168,7 @@ void CopyTableWizard::impl_copyRows_throw( const Reference< XResultSet >& _rxSou { case DataType::DOUBLE: case DataType::REAL: - aTransfer.transferValue( &XRow::getDouble, &XParameters::setDouble ); + aTransfer.transferValue( nSourceColumn, nDestColumn, &XRow::getDouble, &XParameters::setDouble ); break; case DataType::CHAR: @@ -1173,64 +1176,64 @@ void CopyTableWizard::impl_copyRows_throw( const Reference< XResultSet >& _rxSou case DataType::LONGVARCHAR: case DataType::DECIMAL: case DataType::NUMERIC: - aTransfer.transferComplexValue( &XRow::getString, &XParameters::setString ); + aTransfer.transferComplexValue( nSourceColumn, nDestColumn, &XRow::getString, &XParameters::setString ); break; case DataType::BIGINT: - aTransfer.transferValue( &XRow::getLong, &XParameters::setLong ); + aTransfer.transferValue( nSourceColumn, nDestColumn, &XRow::getLong, &XParameters::setLong ); break; case DataType::FLOAT: - aTransfer.transferValue( &XRow::getFloat, &XParameters::setFloat ); + aTransfer.transferValue( nSourceColumn, nDestColumn, &XRow::getFloat, &XParameters::setFloat ); break; case DataType::LONGVARBINARY: case DataType::BINARY: case DataType::VARBINARY: - aTransfer.transferComplexValue( &XRow::getBytes, &XParameters::setBytes ); + aTransfer.transferComplexValue( nSourceColumn, nDestColumn, &XRow::getBytes, &XParameters::setBytes ); break; case DataType::DATE: - aTransfer.transferComplexValue( &XRow::getDate, &XParameters::setDate ); + aTransfer.transferComplexValue( nSourceColumn, nDestColumn, &XRow::getDate, &XParameters::setDate ); break; case DataType::TIME: - aTransfer.transferComplexValue( &XRow::getTime, &XParameters::setTime ); + aTransfer.transferComplexValue( nSourceColumn, nDestColumn, &XRow::getTime, &XParameters::setTime ); break; case DataType::TIMESTAMP: - aTransfer.transferComplexValue( &XRow::getTimestamp, &XParameters::setTimestamp ); + aTransfer.transferComplexValue( nSourceColumn, nDestColumn, &XRow::getTimestamp, &XParameters::setTimestamp ); break; case DataType::BIT: if ( aSourcePrec[nSourceColumn] > 1 ) { - aTransfer.transferComplexValue( &XRow::getBytes, &XParameters::setBytes ); + aTransfer.transferComplexValue( nSourceColumn, nDestColumn, &XRow::getBytes, &XParameters::setBytes ); break; } [[fallthrough]]; case DataType::BOOLEAN: - aTransfer.transferValue( &XRow::getBoolean, &XParameters::setBoolean ); + aTransfer.transferValue( nSourceColumn, nDestColumn, &XRow::getBoolean, &XParameters::setBoolean ); break; case DataType::TINYINT: - aTransfer.transferValue( &XRow::getByte, &XParameters::setByte ); + aTransfer.transferValue( nSourceColumn, nDestColumn, &XRow::getByte, &XParameters::setByte ); break; case DataType::SMALLINT: - aTransfer.transferValue( &XRow::getShort, &XParameters::setShort ); + aTransfer.transferValue( nSourceColumn, nDestColumn, &XRow::getShort, &XParameters::setShort ); break; case DataType::INTEGER: - aTransfer.transferValue( &XRow::getInt, &XParameters::setInt ); + aTransfer.transferValue( nSourceColumn, nDestColumn, &XRow::getInt, &XParameters::setInt ); break; case DataType::BLOB: - aTransfer.transferComplexValue( &XRow::getBlob, &XParameters::setBlob ); + aTransfer.transferComplexValue( nSourceColumn, nDestColumn, &XRow::getBlob, &XParameters::setBlob ); break; case DataType::CLOB: - aTransfer.transferComplexValue( &XRow::getClob, &XParameters::setClob ); + aTransfer.transferComplexValue( nSourceColumn, nDestColumn, &XRow::getClob, &XParameters::setClob ); break; default: @@ -1256,6 +1259,7 @@ void CopyTableWizard::impl_copyRows_throw( const Reference< XResultSet >& _rxSou } catch( const Exception& ) { + TOOLS_WARN_EXCEPTION("dbaccess", ""); aCopyEvent.Error = ::cppu::getCaughtException(); } @@ -1350,42 +1354,48 @@ void CopyTableWizard::impl_doCopy_nothrow() // tdf#119962 const Reference< XDatabaseMetaData > xDestMetaData( m_xDestConnection->getMetaData(), UNO_SET_THROW ); - const OUString sComposedTableName = ::dbtools::composeTableName( xDestMetaData, xTable, ::dbtools::EComposeRule::InDataManipulation, true ); + OUString sDatabaseDest = xDestMetaData->getDatabaseProductName().toAsciiLowerCase(); + // If we created a new primary key, then it won't necessarily be an IDENTITY column + const bool bShouldCreatePrimaryKey = rWizard.shouldCreatePrimaryKey(); + if ( !bShouldCreatePrimaryKey && (sDatabaseDest.indexOf("firebird") != -1) ) + { + const OUString sComposedTableName = ::dbtools::composeTableName( xDestMetaData, xTable, ::dbtools::EComposeRule::InDataManipulation, true ); - OUString aSchema,aTable; - xTable->getPropertyValue("SchemaName") >>= aSchema; - xTable->getPropertyValue("Name") >>= aTable; - Any aCatalog = xTable->getPropertyValue("CatalogName"); + OUString aSchema,aTable; + xTable->getPropertyValue(u"SchemaName"_ustr) >>= aSchema; + xTable->getPropertyValue(u"Name"_ustr) >>= aTable; + Any aCatalog = xTable->getPropertyValue(u"CatalogName"_ustr); - const Reference< XResultSet > xResultPKCL(xDestMetaData->getPrimaryKeys(aCatalog,aSchema,aTable)); - Reference< XRow > xRowPKCL(xResultPKCL, UNO_QUERY_THROW); - OUString sPKCL; - if ( xRowPKCL.is() ) - { - if (xResultPKCL->next()) + const Reference< XResultSet > xResultPKCL(xDestMetaData->getPrimaryKeys(aCatalog,aSchema,aTable)); + Reference< XRow > xRowPKCL(xResultPKCL, UNO_QUERY_THROW); + OUString sPKCL; + if ( xRowPKCL.is() ) { - sPKCL = xRowPKCL->getString(4); + if (xResultPKCL->next()) + { + sPKCL = xRowPKCL->getString(4); + } } - } - if (!sPKCL.isEmpty()) - { - OUString strSql = "SELECT MAX(\"" + sPKCL + "\") FROM " + sComposedTableName; + if (!sPKCL.isEmpty()) + { + OUString strSql = "SELECT MAX(\"" + sPKCL + "\") FROM " + sComposedTableName; - Reference< XResultSet > xResultMAXNUM(m_xDestConnection->createStatement()->executeQuery(strSql)); - Reference< XRow > xRow(xResultMAXNUM, UNO_QUERY_THROW); + Reference< XResultSet > xResultMAXNUM(m_xDestConnection->createStatement()->executeQuery(strSql)); + Reference< XRow > xRow(xResultMAXNUM, UNO_QUERY_THROW); - sal_Int64 maxVal = -1L; - if (xResultMAXNUM->next()) - { - maxVal = xRow->getLong(1); - } + sal_Int64 maxVal = -1L; + if (xResultMAXNUM->next()) + { + maxVal = xRow->getLong(1); + } - if (maxVal > 0L) - { - strSql = "ALTER TABLE " + sComposedTableName + " ALTER \"" + sPKCL + "\" RESTART WITH " + OUString::number(maxVal + 1); + if (maxVal > 0L) + { + strSql = "ALTER TABLE " + sComposedTableName + " ALTER \"" + sPKCL + "\" RESTART WITH " + OUString::number(maxVal + 1); - m_xDestConnection->createStatement()->execute(strSql); + m_xDestConnection->createStatement()->execute(strSql); + } } } } @@ -1403,6 +1413,7 @@ void CopyTableWizard::impl_doCopy_nothrow() catch( const Exception& ) { aError = ::cppu::getCaughtException(); + SAL_WARN("dbaccess", exceptionToString(aError)); // silence the error of the user cancelling the parameter's dialog SQLException aSQLError; @@ -1445,7 +1456,7 @@ OUString CopyTableWizard::impl_getServerSideCopyStatement_throw(const Reference< } } const OUString sComposedTableName = ::dbtools::composeTableName( xDestMetaData, _xTable, ::dbtools::EComposeRule::InDataManipulation, true ); - OUString sSql("INSERT INTO " + sComposedTableName + " ( " + sColumns.makeStringAndClear() + " ) " + m_pSourceObject->getSelectStatement()); + OUString sSql("INSERT INTO " + sComposedTableName + " ( " + sColumns + " ) " + m_pSourceObject->getSelectStatement()); return sSql; } @@ -1488,12 +1499,12 @@ void SAL_CALL CopyTableWizard::initialize( const Sequence< Any >& _rArguments ) impl_ensureDataAccessDescriptor_throw( _rArguments, 1, m_xDestConnection, xDestDocHandler ); if ( xDestDocHandler.is() && !m_xInteractionHandler.is() ) - m_xInteractionHandler = xDestDocHandler; + m_xInteractionHandler = std::move(xDestDocHandler); Reference< XPropertySet > xInteractionHandler(m_xInteractionHandler, UNO_QUERY); if (xInteractionHandler.is()) { - Any aParentWindow(xInteractionHandler->getPropertyValue("ParentWindow")); + Any aParentWindow(xInteractionHandler->getPropertyValue(u"ParentWindow"_ustr)); aParentWindow >>= m_xParent; } } diff --git a/dbaccess/source/ui/uno/dbinteraction.cxx b/dbaccess/source/ui/uno/dbinteraction.cxx index db2d5be60964..f06e03572cc9 100644 --- a/dbaccess/source/ui/uno/dbinteraction.cxx +++ b/dbaccess/source/ui/uno/dbinteraction.cxx @@ -18,8 +18,7 @@ */ #include "dbinteraction.hxx" -#include <apitools.hxx> -#include <tools/diagnose_ex.h> +#include <comphelper/diagnose_ex.hxx> #include <osl/diagnose.h> #include <connectivity/dbexception.hxx> #include <sqlmessage.hxx> @@ -55,9 +54,7 @@ namespace dbaui using namespace ::com::sun::star::uno; using namespace ::com::sun::star::ucb; using namespace ::com::sun::star::sdb; - using namespace ::com::sun::star::lang; using namespace ::com::sun::star::task; - using namespace ::com::sun::star::beans; using namespace ::dbtools; // BasicInteractionHandler @@ -72,7 +69,7 @@ namespace dbaui void SAL_CALL BasicInteractionHandler::initialize(const Sequence<Any>& rArgs) { comphelper::SequenceAsHashMap aMap(rArgs); - m_xParentWindow.set(aMap.getValue("Parent"), UNO_QUERY); + m_xParentWindow.set(aMap.getValue(u"Parent"_ustr), UNO_QUERY); } sal_Bool SAL_CALL BasicInteractionHandler::handleInteractionRequest( const Reference< XInteractionRequest >& i_rRequest ) @@ -310,33 +307,32 @@ namespace dbaui sal_Int32 BasicInteractionHandler::getContinuation(Continuation _eCont, const Sequence< Reference< XInteractionContinuation > >& _rContinuations) { - const Reference< XInteractionContinuation >* pContinuations = _rContinuations.getConstArray(); - for (sal_Int32 i=0; i<_rContinuations.getLength(); ++i, ++pContinuations) + for (sal_Int32 i = 0; i < _rContinuations.getLength(); ++i) { switch (_eCont) { case APPROVE: - if (Reference< XInteractionApprove >(*pContinuations, UNO_QUERY).is()) + if (Reference<XInteractionApprove>(_rContinuations[i], UNO_QUERY).is()) return i; break; case DISAPPROVE: - if (Reference< XInteractionDisapprove >(*pContinuations, UNO_QUERY).is()) + if (Reference<XInteractionDisapprove>(_rContinuations[i], UNO_QUERY).is()) return i; break; case RETRY: - if (Reference< XInteractionRetry >(*pContinuations, UNO_QUERY).is()) + if (Reference<XInteractionRetry>(_rContinuations[i], UNO_QUERY).is()) return i; break; case ABORT: - if (Reference< XInteractionAbort >(*pContinuations, UNO_QUERY).is()) + if (Reference<XInteractionAbort>(_rContinuations[i], UNO_QUERY).is()) return i; break; case SUPPLY_PARAMETERS: - if (Reference< XInteractionSupplyParameters >(*pContinuations, UNO_QUERY).is()) + if (Reference<XInteractionSupplyParameters>(_rContinuations[i], UNO_QUERY).is()) return i; break; case SUPPLY_DOCUMENTSAVE: - if (Reference< XInteractionDocumentSave >(*pContinuations, UNO_QUERY).is()) + if (Reference<XInteractionDocumentSave>(_rContinuations[i], UNO_QUERY).is()) return i; break; } @@ -348,7 +344,7 @@ namespace dbaui // SQLExceptionInteractionHandler OUString SAL_CALL SQLExceptionInteractionHandler::getImplementationName() { - return "com.sun.star.comp.dbaccess.DatabaseInteractionHandler"; + return u"com.sun.star.comp.dbaccess.DatabaseInteractionHandler"_ustr; } sal_Bool SAL_CALL SQLExceptionInteractionHandler::supportsService(const OUString& _rServiceName) { @@ -361,13 +357,13 @@ namespace dbaui } css::uno::Sequence< OUString > SAL_CALL SQLExceptionInteractionHandler::getSupportedServiceNames() { - return { "com.sun.star.sdb.DatabaseInteractionHandler" }; + return { u"com.sun.star.sdb.DatabaseInteractionHandler"_ustr }; } // LegacyInteractionHandler OUString SAL_CALL LegacyInteractionHandler::getImplementationName() { - return "com.sun.star.comp.dbaccess.LegacyInteractionHandler"; + return u"com.sun.star.comp.dbaccess.LegacyInteractionHandler"_ustr; } sal_Bool SAL_CALL LegacyInteractionHandler::supportsService(const OUString& _rServiceName) { @@ -380,7 +376,7 @@ namespace dbaui } css::uno::Sequence< OUString > SAL_CALL LegacyInteractionHandler::getSupportedServiceNames() { - return { "com.sun.star.sdb.InteractionHandler" }; + return { u"com.sun.star.sdb.InteractionHandler"_ustr }; } } // namespace dbaui diff --git a/dbaccess/source/ui/uno/textconnectionsettings_uno.cxx b/dbaccess/source/ui/uno/textconnectionsettings_uno.cxx index aaae73ee1fbf..dbb56c9b6d95 100644 --- a/dbaccess/source/ui/uno/textconnectionsettings_uno.cxx +++ b/dbaccess/source/ui/uno/textconnectionsettings_uno.cxx @@ -18,7 +18,6 @@ */ #include <textconnectionsettings.hxx> -#include <apitools.hxx> #include <unoadmin.hxx> #include <stringconstants.hxx> #include <propertystorage.hxx> @@ -32,7 +31,6 @@ #include <toolkit/helper/vclunohelper.hxx> #include <vcl/svapp.hxx> #include <cppuhelper/implbase.hxx> -#include <cppuhelper/implbase1.hxx> namespace dbaui { @@ -124,7 +122,7 @@ namespace dbaui OUString SAL_CALL OTextConnectionSettingsDialog::getImplementationName() { - return "com.sun.star.comp.dbaccess.OTextConnectionSettingsDialog"; + return u"com.sun.star.comp.dbaccess.OTextConnectionSettingsDialog"_ustr; } sal_Bool SAL_CALL OTextConnectionSettingsDialog::supportsService(const OUString& _rServiceName) { @@ -137,7 +135,7 @@ namespace dbaui } css::uno::Sequence< OUString > SAL_CALL OTextConnectionSettingsDialog::getSupportedServiceNames() { - return { "com.sun.star.sdb.TextConnectionSettings" }; + return { u"com.sun.star.sdb.TextConnectionSettings"_ustr }; } Reference< XPropertySetInfo > SAL_CALL OTextConnectionSettingsDialog::getPropertySetInfo() @@ -163,42 +161,42 @@ namespace dbaui auto pProps = aProps.getArray(); pProps[ nProp++ ] = Property( - "HeaderLine", + u"HeaderLine"_ustr, PROPERTY_ID_HEADER_LINE, ::cppu::UnoType< sal_Bool >::get(), PropertyAttribute::TRANSIENT ); pProps[ nProp++ ] = Property( - "FieldDelimiter", + u"FieldDelimiter"_ustr, PROPERTY_ID_FIELD_DELIMITER, ::cppu::UnoType< OUString >::get(), PropertyAttribute::TRANSIENT ); pProps[ nProp++ ] = Property( - "StringDelimiter", + u"StringDelimiter"_ustr, PROPERTY_ID_STRING_DELIMITER, ::cppu::UnoType< OUString >::get(), PropertyAttribute::TRANSIENT ); pProps[ nProp++ ] = Property( - "DecimalDelimiter", + u"DecimalDelimiter"_ustr, PROPERTY_ID_DECIMAL_DELIMITER, ::cppu::UnoType< OUString >::get(), PropertyAttribute::TRANSIENT ); pProps[ nProp++ ] = Property( - "ThousandDelimiter", + u"ThousandDelimiter"_ustr, PROPERTY_ID_THOUSAND_DELIMITER, ::cppu::UnoType< OUString >::get(), PropertyAttribute::TRANSIENT ); pProps[ nProp++ ] = Property( - "CharSet", + u"CharSet"_ustr, PROPERTY_ID_ENCODING, ::cppu::UnoType< OUString >::get(), PropertyAttribute::TRANSIENT diff --git a/dbaccess/source/ui/uno/unoDirectSql.cxx b/dbaccess/source/ui/uno/unoDirectSql.cxx index bc155f76da35..807589689d53 100644 --- a/dbaccess/source/ui/uno/unoDirectSql.cxx +++ b/dbaccess/source/ui/uno/unoDirectSql.cxx @@ -25,7 +25,8 @@ #include <com/sun/star/beans/PropertyValue.hpp> #include <directsql.hxx> #include <datasourceconnector.hxx> -#include <tools/diagnose_ex.h> +#include <strings.hxx> +#include <comphelper/diagnose_ex.hxx> #include <vcl/svapp.hxx> extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface* @@ -39,10 +40,8 @@ namespace dbaui { using namespace ::com::sun::star::uno; - using namespace ::com::sun::star::lang; using namespace ::com::sun::star::beans; using namespace ::com::sun::star::container; - using namespace ::com::sun::star::sdbcx; using namespace ::com::sun::star::sdbc; // ODirectSQLDialog @@ -64,7 +63,7 @@ namespace dbaui OUString SAL_CALL ODirectSQLDialog::getImplementationName() { - return "com.sun.star.comp.sdb.DirectSQLDialog"; + return u"com.sun.star.comp.sdb.DirectSQLDialog"_ustr; } sal_Bool SAL_CALL ODirectSQLDialog::supportsService(const OUString& _rServiceName) { diff --git a/dbaccess/source/ui/uno/unoDirectSql.hxx b/dbaccess/source/ui/uno/unoDirectSql.hxx index 679c28c5060c..c83f975d63dd 100644 --- a/dbaccess/source/ui/uno/unoDirectSql.hxx +++ b/dbaccess/source/ui/uno/unoDirectSql.hxx @@ -20,7 +20,6 @@ #pragma once #include <svtools/genericunodialog.hxx> -#include <apitools.hxx> #include <com/sun/star/sdbc/XConnection.hpp> #include <comphelper/proparrhlp.hxx> #include <connectivity/CommonTools.hxx> diff --git a/dbaccess/source/ui/uno/unoadmin.cxx b/dbaccess/source/ui/uno/unoadmin.cxx index 3d863b92e8f9..b2c50fc3ab0e 100644 --- a/dbaccess/source/ui/uno/unoadmin.cxx +++ b/dbaccess/source/ui/uno/unoadmin.cxx @@ -27,15 +27,13 @@ namespace dbaui { using namespace ::com::sun::star::uno; - using namespace ::com::sun::star::lang; using namespace ::com::sun::star::beans; ODatabaseAdministrationDialog::ODatabaseAdministrationDialog(const Reference< XComponentContext >& _rxORB) - :ODatabaseAdministrationDialogBase(_rxORB) - ,m_pItemPoolDefaults(nullptr) +: ODatabaseAdministrationDialogBase(_rxORB) { m_pCollection.reset( new ::dbaccess::ODsnTypeCollection(_rxORB) ); - ODbAdminDialog::createItemSet(m_pDatasourceItems, m_pItemPool, m_pItemPoolDefaults, m_pCollection.get()); + ODbAdminDialog::createItemSet(m_pDatasourceItems, m_pItemPool, m_pCollection.get()); } ODatabaseAdministrationDialog::~ODatabaseAdministrationDialog() @@ -43,7 +41,7 @@ ODatabaseAdministrationDialog::~ODatabaseAdministrationDialog() ::osl::MutexGuard aGuard(m_aMutex); if (m_xDialog) destroyDialog(); - ODbAdminDialog::destroyItemSet(m_pDatasourceItems, m_pItemPool, m_pItemPoolDefaults); + ODbAdminDialog::destroyItemSet(m_pDatasourceItems, m_pItemPool); } void ODatabaseAdministrationDialog::implInitialize(const Any& _rValue) diff --git a/dbaccess/source/ui/uno/unosqlmessage.cxx b/dbaccess/source/ui/uno/unosqlmessage.cxx index 39364ba254ca..09e08878b02b 100644 --- a/dbaccess/source/ui/uno/unosqlmessage.cxx +++ b/dbaccess/source/ui/uno/unosqlmessage.cxx @@ -64,12 +64,12 @@ Sequence<sal_Int8> SAL_CALL OSQLMessageDialog::getImplementationId( ) OUString SAL_CALL OSQLMessageDialog::getImplementationName() { - return "org.openoffice.comp.dbu.OSQLMessageDialog"; + return u"org.openoffice.comp.dbu.OSQLMessageDialog"_ustr; } css::uno::Sequence<OUString> SAL_CALL OSQLMessageDialog::getSupportedServiceNames() { - return { "com.sun.star.sdb.ErrorMessageDialog" }; + return { u"com.sun.star.sdb.ErrorMessageDialog"_ustr }; } void OSQLMessageDialog::initialize(Sequence<Any> const & args) |