summaryrefslogtreecommitdiff
path: root/fpicker
diff options
context:
space:
mode:
authorMatthew Nicholls <matthew.nicholls95@hotmail.co.uk>2015-09-09 16:08:51 +0100
committerMichael Stahl <mstahl@redhat.com>2015-09-11 12:48:12 +0000
commite594d13a53cac73814b86cf12891c6955961db55 (patch)
tree2545052b903267f395efe037e8bb7b2bdd12479e /fpicker
parent2062d5d6f472ffa22ab4a769f4cb992f3a91894c (diff)
tdf#93240: replace boost::ptr_deque with std::deque<std::unique_ptr>
Change-Id: Iba77946a00c6c43c4377b2bae62467581cfed19f Reviewed-on: https://gerrit.libreoffice.org/18468 Reviewed-by: Michael Stahl <mstahl@redhat.com> Tested-by: Michael Stahl <mstahl@redhat.com>
Diffstat (limited to 'fpicker')
-rw-r--r--fpicker/source/office/iodlg.cxx18
-rw-r--r--fpicker/source/office/iodlgimp.cxx8
-rw-r--r--fpicker/source/office/iodlgimp.hxx7
3 files changed, 16 insertions, 17 deletions
diff --git a/fpicker/source/office/iodlg.cxx b/fpicker/source/office/iodlg.cxx
index 714c68d4dd7a..43666b1274f6 100644
--- a/fpicker/source/office/iodlg.cxx
+++ b/fpicker/source/office/iodlg.cxx
@@ -1408,12 +1408,12 @@ SvtFileDialogFilter_Impl* SvtFileDialog::FindFilter_Impl
{
SvtFileDialogFilter_Impl* pFoundFilter = NULL;
- SvtFileDialogFilterList_Impl* pList = _pImp->_pFilter;
- sal_uInt16 nFilter = pList->size();
+ SvtFileDialogFilterList_Impl& rList = _pImp->m_aFilter;
+ sal_uInt16 nFilter = rList.size();
while ( nFilter-- )
{
- SvtFileDialogFilter_Impl* pFilter = &(*pList)[ nFilter ];
+ SvtFileDialogFilter_Impl* pFilter = rList[ nFilter ].get();
const OUString& rType = pFilter->GetType();
OUString aSingleType = rType;
@@ -2056,7 +2056,7 @@ short SvtFileDialog::PrepareExecute()
break;
}
}
- SvtFileDialogFilter_Impl* pNewCurFilter = &(*_pImp->_pFilter)[ nPos ];
+ SvtFileDialogFilter_Impl* pNewCurFilter = _pImp->m_aFilter[ nPos ].get();
DBG_ASSERT( pNewCurFilter, "SvtFileDialog::Execute: invalid filter pos!" );
_pImp->SetCurFilter( pNewCurFilter, pNewCurFilter->GetName() );
}
@@ -2231,7 +2231,7 @@ void SvtFileDialog::OpenURL_Impl( const OUString& _rURL )
SvtFileDialogFilter_Impl* SvtFileDialog::implAddFilter( const OUString& _rFilter, const OUString& _rType )
{
SvtFileDialogFilter_Impl* pNewFilter = new SvtFileDialogFilter_Impl( _rFilter, _rType );
- _pImp->_pFilter->push_front( pNewFilter );
+ _pImp->m_aFilter.push_front( std::unique_ptr<SvtFileDialogFilter_Impl>( pNewFilter ) );
if ( !_pImp->GetCurFilter() )
_pImp->SetCurFilter( pNewFilter, _rFilter );
@@ -2265,11 +2265,11 @@ void SvtFileDialog::SetCurFilter( const OUString& rFilter )
DBG_ASSERT( !IsInExecute(), "SvtFileDialog::SetCurFilter: currently executing!" );
// look for corresponding filter
- sal_uInt16 nPos = _pImp->_pFilter->size();
+ sal_uInt16 nPos = _pImp->m_aFilter.size();
while ( nPos-- )
{
- SvtFileDialogFilter_Impl* pFilter = &(*_pImp->_pFilter)[ nPos ];
+ SvtFileDialogFilter_Impl* pFilter = _pImp->m_aFilter[ nPos ].get();
if ( pFilter->GetName() == rFilter )
{
_pImp->SetCurFilter( pFilter, rFilter );
@@ -2300,7 +2300,7 @@ OUString SvtFileDialog::getCurFilter( ) const
sal_uInt16 SvtFileDialog::GetFilterCount() const
{
- return _pImp->_pFilter->size();
+ return _pImp->m_aFilter.size();
}
@@ -2308,7 +2308,7 @@ sal_uInt16 SvtFileDialog::GetFilterCount() const
const OUString& SvtFileDialog::GetFilterName( sal_uInt16 nPos ) const
{
DBG_ASSERT( nPos < GetFilterCount(), "invalid index" );
- return (*_pImp->_pFilter)[ nPos ].GetName();
+ return _pImp->m_aFilter[ nPos ]->GetName();
}
diff --git a/fpicker/source/office/iodlgimp.cxx b/fpicker/source/office/iodlgimp.cxx
index 55c7f2789f72..a03278299529 100644
--- a/fpicker/source/office/iodlgimp.cxx
+++ b/fpicker/source/office/iodlgimp.cxx
@@ -212,7 +212,6 @@ Size SvtUpButton_Impl::GetOptimalSize() const
SvtExpFileDlg_Impl::SvtExpFileDlg_Impl( WinBits ) :
_pCurFilter ( NULL ),
- _pFilter ( new SvtFileDialogFilterList_Impl() ),
_pUserFilter ( NULL ),
_pFtFileName ( NULL ),
_pEdFileName ( NULL ),
@@ -253,7 +252,6 @@ SvtExpFileDlg_Impl::~SvtExpFileDlg_Impl()
{
_pBtnUp.disposeAndClear();
delete _pUserFilter;
- delete _pFilter;
_pPlaces.disposeAndClear();
}
@@ -316,15 +314,15 @@ void SvtExpFileDlg_Impl::InitFilterList( )
ClearFilterList( );
// reinit it
- sal_uInt16 nPos = _pFilter->size();
+ sal_uInt16 nPos = m_aFilter.size();
// search for the first entry which is no group separator
- while ( nPos-- && (*_pFilter)[ nPos ].isGroupSeparator() )
+ while ( nPos-- && m_aFilter[ nPos ]->isGroupSeparator() )
;
// add all following entries
while ( (sal_Int16)nPos >= 0 )
- InsertFilterListEntry( &(*_pFilter)[ nPos-- ] );
+ InsertFilterListEntry( m_aFilter[ nPos-- ].get() );
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/source/office/iodlgimp.hxx b/fpicker/source/office/iodlgimp.hxx
index 008bda646800..69d6399deab6 100644
--- a/fpicker/source/office/iodlgimp.hxx
+++ b/fpicker/source/office/iodlgimp.hxx
@@ -27,8 +27,9 @@
#include <vcl/timer.hxx>
#include <vcl/group.hxx>
+#include <deque>
+#include <memory>
#include <vector>
-#include <boost/ptr_container/ptr_deque.hpp>
class CheckBox;
class SvtFileDialog;
@@ -62,7 +63,7 @@ public:
bool isGroupSeparator() const { return m_aType.isEmpty(); }
};
-typedef boost::ptr_deque<SvtFileDialogFilter_Impl> SvtFileDialogFilterList_Impl;
+typedef std::deque<std::unique_ptr<SvtFileDialogFilter_Impl>> SvtFileDialogFilterList_Impl;
enum SvtFileDlgMode
{
@@ -126,7 +127,7 @@ private:
::com::sun::star::uno::Sequence< OUString > _aBlackList;
public:
- SvtFileDialogFilterList_Impl* _pFilter;
+ SvtFileDialogFilterList_Impl m_aFilter;
SvtFileDialogFilter_Impl* _pUserFilter;
VclPtr<FixedText> _pFtFileName;