diff options
Diffstat (limited to 'dbaccess/source/ui/misc/dbsubcomponentcontroller.cxx')
-rw-r--r-- | dbaccess/source/ui/misc/dbsubcomponentcontroller.cxx | 35 |
1 files changed, 16 insertions, 19 deletions
diff --git a/dbaccess/source/ui/misc/dbsubcomponentcontroller.cxx b/dbaccess/source/ui/misc/dbsubcomponentcontroller.cxx index 63e30d06ad3b..0d3676db5d80 100644 --- a/dbaccess/source/ui/misc/dbsubcomponentcontroller.cxx +++ b/dbaccess/source/ui/misc/dbsubcomponentcontroller.cxx @@ -37,12 +37,12 @@ #include <connectivity/dbexception.hxx> #include <connectivity/dbmetadata.hxx> #include <connectivity/dbtools.hxx> -#include <comphelper/interfacecontainer2.hxx> +#include <comphelper/interfacecontainer3.hxx> #include <rtl/ustrbuf.hxx> #include <sal/log.hxx> #include <toolkit/helper/vclunohelper.hxx> #include <tools/debug.hxx> -#include <tools/diagnose_ex.h> +#include <comphelper/diagnose_ex.hxx> #include <vcl/svapp.hxx> #include <vcl/weld.hxx> @@ -124,7 +124,7 @@ namespace dbaui public: ::dbtools::SQLExceptionInfo m_aCurrentError; - ::comphelper::OInterfaceContainerHelper2 + ::comphelper::OInterfaceContainerHelper3<css::util::XModifyListener> m_aModifyListeners; // <properties> @@ -141,8 +141,7 @@ namespace dbaui bool m_bNotAttached; explicit DBSubComponentController_Impl(osl::Mutex& i_rMutex) - :m_aDocScriptSupport() - ,m_aModifyListeners( i_rMutex ) + :m_aModifyListeners( i_rMutex ) ,m_nDocStartNumber(0) ,m_bSuspended( false ) ,m_bEditable(true) @@ -153,14 +152,14 @@ namespace dbaui bool documentHasScriptSupport() const { - OSL_PRECOND( !!m_aDocScriptSupport, + OSL_PRECOND( m_aDocScriptSupport.has_value(), "DBSubComponentController_Impl::documentHasScriptSupport: not completely initialized, yet - don't know!?" ); - return !!m_aDocScriptSupport && *m_aDocScriptSupport; + return m_aDocScriptSupport.has_value() && *m_aDocScriptSupport; } void setDocumentScriptSupport( const bool _bSupport ) { - OSL_PRECOND( !m_aDocScriptSupport, + OSL_PRECOND( !m_aDocScriptSupport.has_value(), "DBSubComponentController_Impl::setDocumentScriptSupport: already initialized!" ); m_aDocScriptSupport = ::std::optional< bool >( _bSupport ); } @@ -177,11 +176,9 @@ namespace dbaui { } - void DBSubComponentController::impl_initialize() + void DBSubComponentController::impl_initialize(const ::comphelper::NamedValueCollection& rArguments) { - OGenericUnoController::impl_initialize(); - - const ::comphelper::NamedValueCollection& rArguments( getInitParams() ); + OGenericUnoController::impl_initialize(rArguments); Reference< XConnection > xConnection; xConnection = rArguments.getOrDefault( PROPERTY_ACTIVE_CONNECTION, xConnection ); @@ -211,7 +208,7 @@ namespace dbaui if ( _rType.equals( cppu::UnoType<XScriptInvocationContext>::get() ) ) { if ( m_pImpl->documentHasScriptSupport() ) - return makeAny( Reference< XScriptInvocationContext >( this ) ); + return Any( Reference< XScriptInvocationContext >( this ) ); return Any(); } @@ -223,11 +220,12 @@ namespace dbaui Sequence< Type > aTypes( DBSubComponentController_Base::getTypes() ); if ( !m_pImpl->documentHasScriptSupport() ) { - auto newEnd = std::remove_if( aTypes.begin(), aTypes.end(), + auto [begin, end] = asNonConstRange(aTypes); + auto newEnd = std::remove_if( begin, end, [](const Type& type) { return type == cppu::UnoType<XScriptInvocationContext>::get(); } ); - aTypes.realloc( std::distance(aTypes.begin(), newEnd) ); - } + aTypes.realloc( std::distance(begin, newEnd) ); + } return aTypes; } @@ -447,7 +445,7 @@ namespace dbaui Reference< XWindow > xWindow = getTopMostContainerWindow(); vcl::Window* pWin = nullptr; if ( xWindow.is() ) - pWin = VCLUnoHelper::GetWindow(xWindow).get(); + pWin = VCLUnoHelper::GetWindow(xWindow); if ( !pWin ) pWin = getView()->Window::GetParent(); @@ -535,8 +533,7 @@ namespace dbaui Reference< XTitle > xTitle(getPrivateModel(),UNO_QUERY); if ( xTitle.is() ) { - sTitle.append( xTitle->getTitle() ); - sTitle.append(" : "); + sTitle.append( xTitle->getTitle() + " : "); } sTitle.append( getPrivateTitle() ); return sTitle.makeStringAndClear(); |