[Libreoffice-commits] core.git: include/svtools svtools/source

Xisco Fauli anistenis at gmail.com
Thu May 26 07:37:51 UTC 2016


 include/svtools/inettbc.hxx        |    2 +-
 svtools/source/control/inettbc.cxx |   26 +++++++++++++-------------
 2 files changed, 14 insertions(+), 14 deletions(-)

New commits:
commit c6e776e44124f8245117377cbd28af8e0c050ab1
Author: Xisco Fauli <anistenis at gmail.com>
Date:   Thu May 26 02:08:55 2016 +0200

    tdf#89329: use unique_ptr for pImpl in inettbc
    
    Change-Id: I1205acb2823db95cc75c0b559581d278646b616a
    Reviewed-on: https://gerrit.libreoffice.org/25484
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noelgrandin at gmail.com>

diff --git a/include/svtools/inettbc.hxx b/include/svtools/inettbc.hxx
index 1aa02b1..686ad59 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 fbbfcab..962cc54 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: */


More information about the Libreoffice-commits mailing list