summaryrefslogtreecommitdiff
path: root/extensions/source/bibliography/framectr.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'extensions/source/bibliography/framectr.cxx')
-rw-r--r--extensions/source/bibliography/framectr.cxx40
1 files changed, 23 insertions, 17 deletions
diff --git a/extensions/source/bibliography/framectr.cxx b/extensions/source/bibliography/framectr.cxx
index e83580689435..758c8b3484c2 100644
--- a/extensions/source/bibliography/framectr.cxx
+++ b/extensions/source/bibliography/framectr.cxx
@@ -18,16 +18,19 @@
*/
#include <comphelper/types.hxx>
+#include <comphelper/propertyvalue.hxx>
#include <comphelper/sequence.hxx>
#include "framectr.hxx"
#include "datman.hxx"
#include <toolkit/helper/vclunohelper.hxx>
#include "bibconfig.hxx"
#include <cppuhelper/implbase.hxx>
+#include <utility>
#include <vcl/event.hxx>
#include <vcl/svapp.hxx>
#include <comphelper/processfactory.hxx>
#include <com/sun/star/awt/XTextComponent.hpp>
+#include <com/sun/star/awt/XVclWindowPeer.hpp>
#include <com/sun/star/form/XConfirmDeleteListener.hpp>
#include <com/sun/star/form/runtime/XFormController.hpp>
#include <com/sun/star/beans/PropertyValue.hpp>
@@ -38,11 +41,11 @@
#include <com/sun/star/sdb/RowChangeAction.hpp>
#include <com/sun/star/frame/CommandGroup.hpp>
#include <com/sun/star/datatransfer/clipboard/XClipboard.hpp>
-#include <cppuhelper/interfacecontainer.hxx>
+#include <comphelper/multicontainer2.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <sot/exchange.hxx>
#include <sot/formats.hxx>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
#include <vcl/weld.hxx>
#include <osl/mutex.hxx>
@@ -121,7 +124,7 @@ class BibFrameCtrl_Impl : public cppu::WeakImplHelper < XFrameActionListener >
{
public:
Mutex aMutex;
- OMultiTypeInterfaceContainerHelper aLC;
+ comphelper::OMultiTypeInterfaceContainerHelper2 aLC;
BibFrameController_Impl* pController;
@@ -145,9 +148,9 @@ void BibFrameCtrl_Impl::disposing( const lang::EventObject& /*Source*/ )
pController->getFrame()->removeFrameActionListener( this );
}
-BibFrameController_Impl::BibFrameController_Impl( const uno::Reference< awt::XWindow > & xComponent,
+BibFrameController_Impl::BibFrameController_Impl( uno::Reference< awt::XWindow > xComponent,
BibDataManager* pDataManager)
- :m_xWindow( xComponent )
+ :m_xWindow(std::move( xComponent ))
,m_xDatMan( pDataManager )
{
m_bDisposing = false;
@@ -225,12 +228,15 @@ void BibFrameController_Impl::dispose()
if (xFrame.is())
xFrame->removeFrameActionListener( m_xImpl );
+ m_xFrame.clear();
aObject.Source = static_cast<XController*>(this);
m_xImpl->aLC.disposeAndClear(aObject);
m_xDatMan.clear();
m_aStatusListeners.clear();
m_xLastQueriedFocusWin.clear();
+ m_xWindow.clear();
+ m_xImpl.clear();
}
void BibFrameController_Impl::addEventListener( const uno::Reference< lang::XEventListener > & aListener )
@@ -263,19 +269,18 @@ uno::Reference< frame::XDispatch > BibFrameController_Impl::queryDispatch( cons
uno::Sequence<uno::Reference< XDispatch > > BibFrameController_Impl::queryDispatches( const uno::Sequence<DispatchDescriptor>& aDescripts )
{
uno::Sequence< uno::Reference< XDispatch > > aDispatches( aDescripts.getLength() );
+ auto aDispatchesRange = asNonConstRange(aDispatches);
for ( sal_Int32 i=0; i<aDescripts.getLength(); ++i )
- aDispatches[i] = queryDispatch( aDescripts[i].FeatureURL, aDescripts[i].FrameName, aDescripts[i].SearchFlags );
+ aDispatchesRange[i] = queryDispatch( aDescripts[i].FeatureURL, aDescripts[i].FrameName, aDescripts[i].SearchFlags );
return aDispatches;
}
uno::Sequence< ::sal_Int16 > SAL_CALL BibFrameController_Impl::getSupportedCommandGroups()
{
- uno::Sequence< ::sal_Int16 > aDispatchInfo( 4 );
-
- aDispatchInfo[0] = frame::CommandGroup::EDIT;
- aDispatchInfo[1] = frame::CommandGroup::DOCUMENT;
- aDispatchInfo[2] = frame::CommandGroup::DATA;
- aDispatchInfo[3] = frame::CommandGroup::VIEW;
+ uno::Sequence< ::sal_Int16 > aDispatchInfo{ frame::CommandGroup::EDIT,
+ frame::CommandGroup::DOCUMENT,
+ frame::CommandGroup::DATA,
+ frame::CommandGroup::VIEW };
return aDispatchInfo;
}
@@ -394,10 +399,11 @@ void BibFrameController_Impl::dispatch(const util::URL& _rURL, const uno::Sequen
{
try
{
- uno::Sequence< beans::PropertyValue > aNewDataSource(2);
- beans::PropertyValue* pProps = aNewDataSource.getArray();
- pProps[0].Value <<= OUString();
- pProps[1].Value <<= aURL;
+ uno::Sequence< beans::PropertyValue > aNewDataSource
+ {
+ comphelper::makePropertyValue( {}, OUString() ),
+ comphelper::makePropertyValue( {}, aURL )
+ };
ChangeDataSource(aNewDataSource);
}
catch(const Exception&)
@@ -479,7 +485,7 @@ void BibFrameController_Impl::dispatch(const util::URL& _rURL, const uno::Sequen
{
RemoveFilter();
}
- else if( _rURL.Complete == "slot:5503" || aCommand == "CloseDoc" )
+ else if( _rURL.Complete == ".uno:CloseDoc" || aCommand == "CloseDoc" )
{
Application::PostUserEvent( LINK( this, BibFrameController_Impl,
DisposeHdl ) );