diff options
author | Xisco Fauli <anistenis@gmail.com> | 2016-05-26 02:08:55 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2016-05-26 07:37:21 +0000 |
commit | c6e776e44124f8245117377cbd28af8e0c050ab1 (patch) | |
tree | 459b0e68eb73ef6dd64f0a8c2023b484a67e6d5d | |
parent | 656f7c15c5a6e3cbc7df3e2e56287289d1296f8a (diff) |
tdf#89329: use unique_ptr for pImpl in inettbc
Change-Id: I1205acb2823db95cc75c0b559581d278646b616a
Reviewed-on: https://gerrit.libreoffice.org/25484
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
-rw-r--r-- | include/svtools/inettbc.hxx | 2 | ||||
-rw-r--r-- | svtools/source/control/inettbc.cxx | 26 |
2 files changed, 14 insertions, 14 deletions
diff --git a/include/svtools/inettbc.hxx b/include/svtools/inettbc.hxx index 1aa02b196a96..686ad59e8f2a 100644 --- a/include/svtools/inettbc.hxx +++ b/include/svtools/inettbc.hxx @@ -36,7 +36,7 @@ friend class SvtURLBox_Impl; OUString aBaseURL; OUString aPlaceHolder; rtl::Reference< SvtMatchContext_Impl > pCtx; - SvtURLBox_Impl* pImp; + std::unique_ptr<SvtURLBox_Impl> pImpl; INetProtocol eSmartProtocol; bool bAutoCompleteMode : 1; bool bOnlyDirectories : 1; diff --git a/svtools/source/control/inettbc.cxx b/svtools/source/control/inettbc.cxx index fbbfcab83a3d..962cc544df6c 100644 --- a/svtools/source/control/inettbc.cxx +++ b/svtools/source/control/inettbc.cxx @@ -241,8 +241,8 @@ IMPL_LINK_NOARG_TYPED( SvtMatchContext_Impl, Select_Impl, void*, void ) { OUString sUpperURL( sURL.toAsciiUpperCase() ); - if ( ::std::none_of( pBox->pImp->m_aFilters.begin(), - pBox->pImp->m_aFilters.end(), + if ( ::std::none_of( pBox->pImpl->m_aFilters.begin(), + pBox->pImpl->m_aFilters.end(), FilterMatch( sUpperURL ) ) ) { // this URL is not allowed bValidCompletionsFiltered = true; @@ -262,8 +262,8 @@ IMPL_LINK_NOARG_TYPED( SvtMatchContext_Impl, Select_Impl, void*, void ) } // transfer string lists to listbox and forget them - pBox->pImp->aURLs = aURLs; - pBox->pImp->aCompletions = aCompletions; + pBox->pImpl->aURLs = aURLs; + pBox->pImpl->aCompletions = aCompletions; aURLs.clear(); aCompletions.clear(); @@ -861,7 +861,7 @@ VCL_BUILDER_DECL_FACTORY(SvtURLBox) void SvtURLBox::Init(bool bSetDefaultHelpID) { - pImp = new SvtURLBox_Impl(); + pImpl.reset( new SvtURLBox_Impl ); if (bSetDefaultHelpID && GetHelpId().isEmpty()) SetHelpId( ".uno:OpenURL" ); @@ -888,7 +888,7 @@ void SvtURLBox::dispose() pCtx->join(); } - delete pImp; + pImpl.reset(); ComboBox::dispose(); } @@ -959,8 +959,8 @@ void SvtURLBox::UpdatePicklistForSmartProtocol_Impl() OUString aUpperURL( aURL ); aUpperURL = aUpperURL.toAsciiUpperCase(); - bFound = ::std::any_of(pImp->m_aFilters.begin(), - pImp->m_aFilters.end(), + bFound = ::std::any_of(pImpl->m_aFilters.begin(), + pImpl->m_aFilters.end(), FilterMatch( aUpperURL ) ); } if ( bFound ) @@ -1161,7 +1161,7 @@ OUString SvtURLBox::GetURL() return aPlaceHolder; // try to get the right case preserving URL from the list of URLs - for(std::vector<OUString>::iterator i = pImp->aCompletions.begin(), j = pImp->aURLs.begin(); i != pImp->aCompletions.end() && j != pImp->aURLs.end(); ++i, ++j) + for(std::vector<OUString>::iterator i = pImpl->aCompletions.begin(), j = pImpl->aURLs.begin(); i != pImpl->aCompletions.end() && j != pImpl->aURLs.end(); ++i, ++j) { if((*i).equals(aText)) return *j; @@ -1240,8 +1240,8 @@ void SvtURLBox::SetBaseURL( const OUString& rURL ) ::osl::MutexGuard aGuard( theSvtMatchContextMutex::get() ); // Reset match lists - pImp->aCompletions.clear(); - pImp->aURLs.clear(); + pImpl->aCompletions.clear(); + pImpl->aURLs.clear(); aBaseURL = rURL; } @@ -1344,8 +1344,8 @@ bool SvtURLBox_Impl::TildeParsing( void SvtURLBox::SetFilter(const OUString& _sFilter) { - pImp->m_aFilters.clear(); - FilterMatch::createWildCardFilterList(_sFilter,pImp->m_aFilters); + pImpl->m_aFilters.clear(); + FilterMatch::createWildCardFilterList(_sFilter,pImpl->m_aFilters); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |