summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-01-29 09:39:15 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-02-02 11:20:23 +0100
commite91aa231ee934b2f18b387f37a6e9017b05f2256 (patch)
treedd9f9f224e779e34c8ddb7682c30ea2d8980d458
parent23e9b1294471459d386152b1197cfe58514af5da (diff)
loplugin:useuniqueptr in SalGtkFilePicker
Change-Id: I3cbe4121c1cb323ad00e110bcdb1f61334e656bc Reviewed-on: https://gerrit.libreoffice.org/49131 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r--vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx7
-rw-r--r--vcl/unx/gtk/fpicker/SalGtkFilePicker.hxx4
2 files changed, 4 insertions, 7 deletions
diff --git a/vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx b/vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx
index dfc5274bbb63..95524567d898 100644
--- a/vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx
+++ b/vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx
@@ -82,7 +82,6 @@ void SalGtkFilePicker::InitialMapping()
SalGtkFilePicker::SalGtkFilePicker( const uno::Reference< uno::XComponentContext >& xContext ) :
SalGtkPicker( xContext ),
SalGtkFilePicker_Base( m_rbHelperMtx ),
- m_pFilterVector( nullptr ),
m_pParentWidget ( nullptr ),
m_pVBox ( nullptr ),
mnHID_FolderChange( 0 ),
@@ -525,7 +524,7 @@ void SalGtkFilePicker::ensureFilterVector( const OUString& _rInitialCurrentFilte
{
if( !m_pFilterVector )
{
- m_pFilterVector = new FilterVector;
+ m_pFilterVector.reset( new std::vector<FilterEntry> );
// set the first filter to the current filter
if ( m_aCurrentFilter.isEmpty() )
@@ -810,7 +809,7 @@ uno::Sequence<OUString> SAL_CALL SalGtkFilePicker::getSelectedFiles()
if (m_pFilterVector)
{
- FilterVector::iterator aVectorIter = ::std::find_if(
+ auto aVectorIter = ::std::find_if(
m_pFilterVector->begin(), m_pFilterVector->end(), FilterTitleMatch(sFilterName) );
OUString aFilter;
@@ -1969,7 +1968,7 @@ SalGtkFilePicker::~SalGtkFilePicker()
gtk_widget_destroy( m_pHBoxs[i] );
}
- delete m_pFilterVector;
+ m_pFilterVector.reset();
gtk_widget_destroy( m_pVBox );
}
diff --git a/vcl/unx/gtk/fpicker/SalGtkFilePicker.hxx b/vcl/unx/gtk/fpicker/SalGtkFilePicker.hxx
index 8de4131f4778..bac8395a5359 100644
--- a/vcl/unx/gtk/fpicker/SalGtkFilePicker.hxx
+++ b/vcl/unx/gtk/fpicker/SalGtkFilePicker.hxx
@@ -38,8 +38,6 @@
struct FilterEntry;
struct ElementEntry_Impl;
-typedef ::std::vector < FilterEntry > FilterVector;
-
// class declaration
typedef cppu::WeakComponentImplHelper<
@@ -150,7 +148,7 @@ class SalGtkFilePicker : public SalGtkPicker, public SalGtkFilePicker_Base
css::uno::Reference< css::ui::dialogs::XFilePickerListener >
m_xListener;
OUString msPlayLabel;
- FilterVector *m_pFilterVector;
+ std::unique_ptr<std::vector<FilterEntry>> m_pFilterVector;
GtkWidget *m_pParentWidget;
GtkWidget *m_pVBox;
GtkWidget *m_pFilterExpander;