diff options
Diffstat (limited to 'dbaccess/source/ui/misc/databaseobjectview.cxx')
-rw-r--r-- | dbaccess/source/ui/misc/databaseobjectview.cxx | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/dbaccess/source/ui/misc/databaseobjectview.cxx b/dbaccess/source/ui/misc/databaseobjectview.cxx index e59622276433..47c3932ca21a 100644 --- a/dbaccess/source/ui/misc/databaseobjectview.cxx +++ b/dbaccess/source/ui/misc/databaseobjectview.cxx @@ -31,7 +31,8 @@ #include <connectivity/dbtools.hxx> #include <osl/diagnose.h> #include <toolkit/helper/vclunohelper.hxx> -#include <tools/diagnose_ex.h> +#include <comphelper/diagnose_ex.hxx> +#include <utility> #include <vcl/window.hxx> namespace dbaui @@ -51,11 +52,11 @@ namespace dbaui DatabaseObjectView::DatabaseObjectView( const Reference< XComponentContext >& _rxORB, const Reference< XDatabaseDocumentUI >& _rxApplication, const Reference< XFrame >& _rxParentFrame, - const OUString& _rComponentURL ) + OUString _sComponentURL ) :m_xORB ( _rxORB ) ,m_xParentFrame ( _rxParentFrame ) ,m_xApplication ( _rxApplication ) - ,m_sComponentURL ( _rComponentURL ) + ,m_sComponentURL (std::move( _sComponentURL )) { OSL_ENSURE( m_xORB.is(), "DatabaseObjectView::DatabaseObjectView: invalid service factory!" ); OSL_ENSURE( m_xApplication.is(), "DatabaseObjectView::DatabaseObjectView: invalid connection!" ); @@ -71,7 +72,7 @@ namespace dbaui Reference< XComponent > DatabaseObjectView::createNew( const Reference< XDataSource >& _xDataSource, const ::comphelper::NamedValueCollection& i_rDispatchArgs ) { - return doCreateView( makeAny( _xDataSource ), OUString(), i_rDispatchArgs ); + return doCreateView( Any( _xDataSource ), OUString(), i_rDispatchArgs ); } Reference< XComponent > DatabaseObjectView::openExisting( const Any& _rDataSource, const OUString& _rName, @@ -159,7 +160,7 @@ namespace dbaui // QueryDesigner QueryDesigner::QueryDesigner( const Reference< XComponentContext >& _rxORB, const Reference< XDatabaseDocumentUI >& _rxApplication, const Reference< XFrame >& _rxParentFrame, bool _bCreateView ) - :DatabaseObjectView( _rxORB, _rxApplication, _rxParentFrame, _bCreateView ? OUString(URL_COMPONENT_VIEWDESIGN) : OUString(URL_COMPONENT_QUERYDESIGN) ) + :DatabaseObjectView( _rxORB, _rxApplication, _rxParentFrame, _bCreateView ? URL_COMPONENT_VIEWDESIGN : URL_COMPONENT_QUERYDESIGN ) ,m_nCommandType( _bCreateView ? CommandType::TABLE : CommandType::QUERY ) { } @@ -188,7 +189,7 @@ namespace dbaui // TableDesigner TableDesigner::TableDesigner( const Reference< XComponentContext >& _rxORB, const Reference< XDatabaseDocumentUI >& _rxApplication, const Reference< XFrame >& _rxParentFrame ) - :DatabaseObjectView( _rxORB, _rxApplication, _rxParentFrame, static_cast< OUString >( URL_COMPONENT_TABLEDESIGN ) ) + :DatabaseObjectView( _rxORB, _rxApplication, _rxParentFrame, URL_COMPONENT_TABLEDESIGN ) { } @@ -242,7 +243,7 @@ namespace dbaui // ResultSetBrowser ResultSetBrowser::ResultSetBrowser( const Reference< XComponentContext >& _rxORB, const Reference< XDatabaseDocumentUI >& _rxApplication, const Reference< XFrame >& _rxParentFrame, bool _bTable ) - :DatabaseObjectView( _rxORB, _rxApplication, _rxParentFrame, static_cast < OUString >( URL_COMPONENT_DATASOURCEBROWSER ) ) + :DatabaseObjectView( _rxORB, _rxApplication, _rxParentFrame, URL_COMPONENT_DATASOURCEBROWSER ) ,m_bTable(_bTable) { } @@ -252,27 +253,27 @@ namespace dbaui { DatabaseObjectView::fillDispatchArgs( i_rDispatchArgs, _aDataSource, _rQualifiedName ); OSL_ENSURE( !_rQualifiedName.isEmpty(),"A Table name must be set"); - OUString sCatalog; - OUString sSchema; - OUString sTable; - if ( m_bTable ) - ::dbtools::qualifiedNameComponents( getConnection()->getMetaData(), _rQualifiedName, sCatalog, sSchema, sTable, ::dbtools::EComposeRule::InDataManipulation ); - - i_rDispatchArgs.put( PROPERTY_COMMAND_TYPE, (m_bTable ? CommandType::TABLE : CommandType::QUERY) ); i_rDispatchArgs.put( PROPERTY_COMMAND, _rQualifiedName ); i_rDispatchArgs.put( PROPERTY_ENABLE_BROWSER, false ); if ( m_bTable ) { + OUString sCatalog; + OUString sSchema; + OUString sTable; + ::dbtools::qualifiedNameComponents( getConnection()->getMetaData(), _rQualifiedName, sCatalog, sSchema, sTable, ::dbtools::EComposeRule::InDataManipulation ); i_rDispatchArgs.put( PROPERTY_UPDATE_CATALOGNAME, sCatalog ); i_rDispatchArgs.put( PROPERTY_UPDATE_SCHEMANAME, sSchema ); i_rDispatchArgs.put( PROPERTY_UPDATE_TABLENAME, sTable ); + i_rDispatchArgs.put( PROPERTY_COMMAND_TYPE, CommandType::TABLE ); } + else + i_rDispatchArgs.put( PROPERTY_COMMAND_TYPE, CommandType::QUERY ); } // RelationDesigner RelationDesigner::RelationDesigner( const Reference< XComponentContext >& _rxORB, const Reference< XDatabaseDocumentUI >& _rxApplication, const Reference< XFrame >& _rxParentFrame ) - :DatabaseObjectView( _rxORB, _rxApplication, _rxParentFrame, static_cast< OUString >( URL_COMPONENT_RELATIONDESIGN ) ) + :DatabaseObjectView( _rxORB, _rxApplication, _rxParentFrame, URL_COMPONENT_RELATIONDESIGN ) { } } // namespace dbaui |