summaryrefslogtreecommitdiff
path: root/vcl/unx/gtk3
diff options
context:
space:
mode:
authorNoel <noel.grandin@collabora.co.uk>2021-02-19 08:40:18 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-02-19 08:46:44 +0100
commit7b649f835cc00ed76927c6821a135605609bed4e (patch)
tree62a364fe0991e9b8c3e171cbc84bbac78565dcb9 /vcl/unx/gtk3
parent34ad5eaebf6548f6006d97aa46837ca1f1dd141b (diff)
loplugin:refcounting in vcl
Change-Id: Ieca3dd33a7ae40c3f7b8ba30f763d71a548cd144 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111171 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl/unx/gtk3')
-rw-r--r--vcl/unx/gtk3/a11y/gtk3atkutil.cxx68
-rw-r--r--vcl/unx/gtk3/fpicker/SalGtkFilePicker.cxx6
-rw-r--r--vcl/unx/gtk3/fpicker/SalGtkFolderPicker.cxx3
-rw-r--r--vcl/unx/gtk3/gtk3gtkdata.cxx1
-rw-r--r--vcl/unx/gtk3/gtk3gtkframe.cxx2
5 files changed, 7 insertions, 73 deletions
diff --git a/vcl/unx/gtk3/a11y/gtk3atkutil.cxx b/vcl/unx/gtk3/a11y/gtk3atkutil.cxx
index 08d98784f8bf..d1f46a8ccef7 100644
--- a/vcl/unx/gtk3/a11y/gtk3atkutil.cxx
+++ b/vcl/unx/gtk3/a11y/gtk3atkutil.cxx
@@ -23,7 +23,6 @@
#undef _LINUX_SOURCE_COMPAT
#endif
-#include <com/sun/star/accessibility/XAccessibleContext.hpp>
#include <com/sun/star/accessibility/XAccessibleEventBroadcaster.hpp>
#include <com/sun/star/accessibility/XAccessibleSelection.hpp>
#include <com/sun/star/accessibility/AccessibleEventId.hpp>
@@ -131,66 +130,6 @@ atk_wrapper_focus_tracker_notify_when_idle( const uno::Reference< accessibility:
/*****************************************************************************/
-class DocumentFocusListener :
- public ::cppu::WeakImplHelper< accessibility::XAccessibleEventListener >
-{
-
- o3tl::sorted_vector< uno::Reference< uno::XInterface > > m_aRefList;
-
-public:
- /// @throws lang::IndexOutOfBoundsException
- /// @throws uno::RuntimeException
- void attachRecursive(
- const uno::Reference< accessibility::XAccessible >& xAccessible
- );
-
- /// @throws lang::IndexOutOfBoundsException
- /// @throws uno::RuntimeException
- void attachRecursive(
- const uno::Reference< accessibility::XAccessible >& xAccessible,
- const uno::Reference< accessibility::XAccessibleContext >& xContext
- );
-
- /// @throws lang::IndexOutOfBoundsException
- /// @throws uno::RuntimeException
- void attachRecursive(
- const uno::Reference< accessibility::XAccessible >& xAccessible,
- const uno::Reference< accessibility::XAccessibleContext >& xContext,
- const uno::Reference< accessibility::XAccessibleStateSet >& xStateSet
- );
-
- /// @throws lang::IndexOutOfBoundsException
- /// @throws uno::RuntimeException
- void detachRecursive(
- const uno::Reference< accessibility::XAccessible >& xAccessible
- );
-
- /// @throws lang::IndexOutOfBoundsException
- /// @throws uno::RuntimeException
- void detachRecursive(
- const uno::Reference< accessibility::XAccessibleContext >& xContext
- );
-
- /// @throws lang::IndexOutOfBoundsException
- /// @throws uno::RuntimeException
- void detachRecursive(
- const uno::Reference< accessibility::XAccessibleContext >& xContext,
- const uno::Reference< accessibility::XAccessibleStateSet >& xStateSet
- );
-
- /// @throws lang::IndexOutOfBoundsException
- /// @throws uno::RuntimeException
- static uno::Reference< accessibility::XAccessible > getAccessible(const lang::EventObject& aEvent );
-
- // XEventListener
- virtual void SAL_CALL disposing( const lang::EventObject& Source ) override;
-
- // XAccessibleEventListener
- virtual void SAL_CALL notifyEvent( const accessibility::AccessibleEventObject& aEvent ) override;
-};
-
-/*****************************************************************************/
-
void DocumentFocusListener::disposing( const lang::EventObject& aEvent )
{
@@ -511,12 +450,11 @@ WindowList g_aWindowList;
DocumentFocusListener & GtkSalData::GetDocumentFocusListener()
{
- if (!m_pDocumentFocusListener)
+ if (!m_xDocumentFocusListener)
{
- m_pDocumentFocusListener = new DocumentFocusListener;
- m_xDocumentFocusListener.set(m_pDocumentFocusListener);
+ m_xDocumentFocusListener = new DocumentFocusListener;
}
- return *m_pDocumentFocusListener;
+ return *m_xDocumentFocusListener;
}
static void handle_get_focus(::VclWindowEvent const * pEvent)
diff --git a/vcl/unx/gtk3/fpicker/SalGtkFilePicker.cxx b/vcl/unx/gtk3/fpicker/SalGtkFilePicker.cxx
index dada6d4556b0..bf9336f5a51f 100644
--- a/vcl/unx/gtk3/fpicker/SalGtkFilePicker.cxx
+++ b/vcl/unx/gtk3/fpicker/SalGtkFilePicker.cxx
@@ -908,8 +908,7 @@ sal_Int16 SAL_CALL SalGtkFilePicker::execute()
}
if (pParent)
gtk_window_set_transient_for(GTK_WINDOW(m_pDialog), pParent);
- RunDialog* pRunDialog = new RunDialog(m_pDialog, xToolkit, xDesktop);
- uno::Reference < awt::XTopWindowListener > xLifeCycle(pRunDialog);
+ rtl::Reference<RunDialog> pRunDialog = new RunDialog(m_pDialog, xToolkit, xDesktop);
while( GTK_RESPONSE_NO == btn )
{
btn = GTK_RESPONSE_YES; // we don't want to repeat unless user clicks NO for file save.
@@ -996,8 +995,7 @@ sal_Int16 SAL_CALL SalGtkFilePicker::execute()
OUStringToOString(getResString(FILE_PICKER_TITLE_SAVE ),
RTL_TEXTENCODING_UTF8 ).getStr() );
gtk_window_set_transient_for(GTK_WINDOW(dlg), GTK_WINDOW(m_pDialog));
- RunDialog* pAnotherDialog = new RunDialog(dlg, xToolkit, xDesktop);
- uno::Reference < awt::XTopWindowListener > xAnotherLifeCycle(pAnotherDialog);
+ rtl::Reference<RunDialog> pAnotherDialog = new RunDialog(dlg, xToolkit, xDesktop);
btn = pAnotherDialog->run();
gtk_widget_destroy( dlg );
diff --git a/vcl/unx/gtk3/fpicker/SalGtkFolderPicker.cxx b/vcl/unx/gtk3/fpicker/SalGtkFolderPicker.cxx
index 8d8319daf3ba..24bf857544d0 100644
--- a/vcl/unx/gtk3/fpicker/SalGtkFolderPicker.cxx
+++ b/vcl/unx/gtk3/fpicker/SalGtkFolderPicker.cxx
@@ -136,8 +136,7 @@ sal_Int16 SAL_CALL SalGtkFolderPicker::execute()
GtkWindow *pParent = RunDialog::GetTransientFor();
if (pParent)
gtk_window_set_transient_for(GTK_WINDOW(m_pDialog), pParent);
- RunDialog* pRunDialog = new RunDialog(m_pDialog, xToolkit, xDesktop);
- uno::Reference < awt::XTopWindowListener > xLifeCycle(pRunDialog);
+ rtl::Reference<RunDialog> pRunDialog = new RunDialog(m_pDialog, xToolkit, xDesktop);
gint nStatus = pRunDialog->run();
switch( nStatus )
{
diff --git a/vcl/unx/gtk3/gtk3gtkdata.cxx b/vcl/unx/gtk3/gtk3gtkdata.cxx
index 1e46fd69b8bc..8626252f40e6 100644
--- a/vcl/unx/gtk3/gtk3gtkdata.cxx
+++ b/vcl/unx/gtk3/gtk3gtkdata.cxx
@@ -313,7 +313,6 @@ GtkSalData::GtkSalData( SalInstance *pInstance )
: GenericUnixSalData( SAL_DATA_GTK3, pInstance )
, m_aDispatchMutex()
, m_aDispatchCondition()
- , m_pDocumentFocusListener(nullptr)
{
m_pUserEvent = nullptr;
}
diff --git a/vcl/unx/gtk3/gtk3gtkframe.cxx b/vcl/unx/gtk3/gtk3gtkframe.cxx
index fb013d2a95ca..dde5c7bdef6e 100644
--- a/vcl/unx/gtk3/gtk3gtkframe.cxx
+++ b/vcl/unx/gtk3/gtk3gtkframe.cxx
@@ -3786,7 +3786,7 @@ gboolean GtkDropTarget::signalDragMotion(GtkWidget *pWidget, GdkDragContext *con
css::datatransfer::dnd::DropTargetDragEnterEvent aEvent;
aEvent.Source = static_cast<css::datatransfer::dnd::XDropTarget*>(this);
- GtkDropTargetDragContext* pContext = new GtkDropTargetDragContext(context, time);
+ rtl::Reference<GtkDropTargetDragContext> pContext = new GtkDropTargetDragContext(context, time);
//preliminary accept the Drag and select the preferred action, the fire_* will
//inform the original caller of our choice and the callsite can decide
//to overrule this choice. i.e. typically here we default to ACTION_MOVE