diff options
author | Frank Schoenheit [fs] <frank.schoenheit@sun.com> | 2010-01-27 11:18:20 +0100 |
---|---|---|
committer | Frank Schoenheit [fs] <frank.schoenheit@sun.com> | 2010-01-27 11:18:20 +0100 |
commit | 925a669a32688360e49ab972351fba2226a6a905 (patch) | |
tree | 403e5868469207c9394aab07cbe1480cb53cb4a5 /dbaccess/source/ui/misc/databaseobjectview.cxx | |
parent | 6e56ff42613dcdcd5dd5421c5a810197a1e0f1da (diff) |
autorecovery: yet another slight refactoring of the DatabaseObjectView hierarchy, to allow the AppController, in newElement, to respect the additional args in all cases
Diffstat (limited to 'dbaccess/source/ui/misc/databaseobjectview.cxx')
-rw-r--r-- | dbaccess/source/ui/misc/databaseobjectview.cxx | 37 |
1 files changed, 12 insertions, 25 deletions
diff --git a/dbaccess/source/ui/misc/databaseobjectview.cxx b/dbaccess/source/ui/misc/databaseobjectview.cxx index 15b309d38a33..3f9e94453d78 100644 --- a/dbaccess/source/ui/misc/databaseobjectview.cxx +++ b/dbaccess/source/ui/misc/databaseobjectview.cxx @@ -77,11 +77,11 @@ namespace dbaui const Reference< XDatabaseDocumentUI >& _rxApplication, const Reference< XFrame >& _rxParentFrame, const ::rtl::OUString& _rComponentURL ) - :m_xORB ( _rxORB ) - ,m_xParentFrame ( _rxParentFrame ) - ,m_xFrameLoader ( ) - ,m_xApplication ( _rxApplication ) - ,m_sComponentURL( _rComponentURL ) + :m_xORB ( _rxORB ) + ,m_xParentFrame ( _rxParentFrame ) + ,m_xFrameLoader ( ) + ,m_xApplication ( _rxApplication ) + ,m_sComponentURL ( _rComponentURL ) { OSL_ENSURE( m_xORB.is(), "DatabaseObjectView::DatabaseObjectView: invalid service factory!" ); OSL_ENSURE( m_xApplication.is(), "DatabaseObjectView::DatabaseObjectView: invalid connection!" ); @@ -97,9 +97,9 @@ namespace dbaui } //---------------------------------------------------------------------- - Reference< XComponent > DatabaseObjectView::createNew(const Reference< XDataSource >& _xDataSource ) + Reference< XComponent > DatabaseObjectView::createNew( const Reference< XDataSource >& _xDataSource, const ::comphelper::NamedValueCollection& i_rDispatchArgs ) { - return doCreateView( makeAny( _xDataSource ), ::rtl::OUString(), ::comphelper::NamedValueCollection() ); + return doCreateView( makeAny( _xDataSource ), ::rtl::OUString(), i_rDispatchArgs ); } //---------------------------------------------------------------------- @@ -114,9 +114,10 @@ namespace dbaui const ::comphelper::NamedValueCollection& i_rCreationArgs ) { ::comphelper::NamedValueCollection aDispatchArgs; - fillDispatchArgs( aDispatchArgs, _rDataSource, _rObjectName ); - aDispatchArgs.merge( i_rCreationArgs, true ); + aDispatchArgs.merge( i_rCreationArgs, false ); // false => do not overwrite + fillDispatchArgs( aDispatchArgs, _rDataSource, _rObjectName ); + aDispatchArgs.merge( i_rCreationArgs, true ); // true => do overwrite return doDispatch( aDispatchArgs ); } @@ -202,28 +203,17 @@ namespace dbaui //====================================================================== //---------------------------------------------------------------------- QueryDesigner::QueryDesigner( const Reference< XMultiServiceFactory >& _rxORB, const Reference< XDatabaseDocumentUI >& _rxApplication, - const Reference< XFrame >& _rxParentFrame, bool _bCreateView, const ::comphelper::NamedValueCollection& i_rCreationArgs ) - :DatabaseObjectView( _rxORB, _rxApplication, _rxParentFrame, static_cast< ::rtl::OUString >( _bCreateView ? URL_COMPONENT_VIEWDESIGN : URL_COMPONENT_QUERYDESIGN ) ) + const Reference< XFrame >& _rxParentFrame, bool _bCreateView ) + :DatabaseObjectView( _rxORB, _rxApplication, _rxParentFrame, _bCreateView ? URL_COMPONENT_VIEWDESIGN : URL_COMPONENT_QUERYDESIGN ) ,m_nCommandType( _bCreateView ? CommandType::TABLE : CommandType::QUERY ) - ,m_aCreationArgs( i_rCreationArgs ) { } //---------------------------------------------------------------------- - QueryDesigner::QueryDesigner( const Reference< XMultiServiceFactory >& _rxORB, const Reference< XDatabaseDocumentUI >& _rxApplication, - const Reference< XFrame >& _rxParentFrame, bool _bCreateView, const bool i_bSQLView ) - :DatabaseObjectView( _rxORB, _rxApplication, _rxParentFrame, static_cast< ::rtl::OUString >( _bCreateView ? URL_COMPONENT_VIEWDESIGN : URL_COMPONENT_QUERYDESIGN ) ) - ,m_nCommandType( _bCreateView ? CommandType::TABLE : CommandType::QUERY ) - { - m_aCreationArgs.put( (::rtl::OUString)PROPERTY_GRAPHICAL_DESIGN, !i_bSQLView ); - } - - //---------------------------------------------------------------------- void QueryDesigner::fillDispatchArgs( ::comphelper::NamedValueCollection& i_rDispatchArgs, const Any& _aDataSource, const ::rtl::OUString& _rObjectName ) { DatabaseObjectView::fillDispatchArgs( i_rDispatchArgs, _aDataSource, _rObjectName ); - i_rDispatchArgs.merge( m_aCreationArgs, false ); // false => do not overwrite const bool bIncludeQueryName = 0 != _rObjectName.getLength(); const bool bGraphicalDesign = i_rDispatchArgs.getOrDefault( (::rtl::OUString)PROPERTY_GRAPHICAL_DESIGN, sal_True ); @@ -240,9 +230,6 @@ namespace dbaui { i_rDispatchArgs.put( (::rtl::OUString)PROPERTY_ESCAPE_PROCESSING, sal_False ); } - - // give the args passed to our ctor the highest prio, let them overrule any self-made setting - i_rDispatchArgs.merge( m_aCreationArgs, true ); } //====================================================================== |