[Libreoffice-commits] core.git: hwpfilter/source i18nlangtag/source i18npool/source

Noel Grandin (via logerrit) logerrit at kemper.freedesktop.org
Fri Jan 24 07:26:23 UTC 2020


 hwpfilter/source/hinfo.cxx                              |    2 +-
 hwpfilter/source/hpara.cxx                              |    6 +++---
 i18nlangtag/source/languagetag/languagetag.cxx          |   10 +++++-----
 i18npool/source/breakiterator/breakiterator_unicode.cxx |    8 ++++----
 4 files changed, 13 insertions(+), 13 deletions(-)

New commits:
commit d4ed6ff5c1d0638dd46d3a2272c5c54b9700551f
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Fri Jan 24 08:30:34 2020 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Fri Jan 24 08:25:51 2020 +0100

    loplugin:makeshared in hwpfilter..i18npool
    
    Change-Id: I2e757043215164df173c89e21cebe2f4c9c05de9
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87321
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/hwpfilter/source/hinfo.cxx b/hwpfilter/source/hinfo.cxx
index 025e54b7a6de..bc1d61021d99 100644
--- a/hwpfilter/source/hinfo.cxx
+++ b/hwpfilter/source/hinfo.cxx
@@ -197,7 +197,7 @@ ParaShape::ParaShape()
     , pspacing_next(0)
     , condense(0)
     , arrange_type(0)
-    , xColdef(new ColumnDef)
+    , xColdef(std::make_shared<ColumnDef>())
     , shade(0)
     , outline(0)
     , outline_continue(0)
diff --git a/hwpfilter/source/hpara.cxx b/hwpfilter/source/hpara.cxx
index 7363a4b91cf1..415c8e984eb3 100644
--- a/hwpfilter/source/hpara.cxx
+++ b/hwpfilter/source/hpara.cxx
@@ -75,8 +75,8 @@ HWPPara::HWPPara()
     , etcflag(0)
     , ctrlflag(0)
     , pstyno(0)
-    , cshape(new CharShape)
-    , pshape(new ParaShape)
+    , cshape(std::make_shared<CharShape>())
+    , pshape(std::make_shared<ParaShape>())
 {
     memset(cshape.get(), 0, sizeof(CharShape));
 }
@@ -144,7 +144,7 @@ bool HWPPara::Read(HWPFile & hwpf, unsigned char flag)
 
         for (ii = 0; ii < nch; ii++)
         {
-            cshapep[ii].reset(new CharShape);
+            cshapep[ii] = std::make_shared<CharShape>();
             memset(cshapep[ii].get(), 0, sizeof(CharShape));
 
             unsigned char same_cshape(0);
diff --git a/i18nlangtag/source/languagetag/languagetag.cxx b/i18nlangtag/source/languagetag/languagetag.cxx
index ef47e54579bc..36b4a1eddb96 100644
--- a/i18nlangtag/source/languagetag/languagetag.cxx
+++ b/i18nlangtag/source/languagetag/languagetag.cxx
@@ -611,7 +611,7 @@ LanguageTag::ImplPtr LanguageTagImpl::registerOnTheFly( LanguageType nRegisterID
     else
     {
         SAL_INFO( "i18nlangtag", "LanguageTag::registerOnTheFly: new impl for '" << maBcp47 << "'");
-        pImpl.reset( new LanguageTagImpl( *this));
+        pImpl = std::make_shared<LanguageTagImpl>( *this);
         rMapBcp47.insert( ::std::make_pair( maBcp47, pImpl));
     }
 
@@ -767,7 +767,7 @@ LanguageTag::ImplPtr LanguageTag::registerImpl() const
             // to inspect such places.
             LanguageTag::ImplPtr& rDontKnow = theDontKnow::get();
             if (!rDontKnow)
-                rDontKnow.reset( new LanguageTagImpl( *this));
+                rDontKnow = std::make_shared<LanguageTagImpl>( *this);
             pImpl = rDontKnow;
 #if OSL_DEBUG_LEVEL > 0
             static size_t nCallsDontKnow = 0;
@@ -853,7 +853,7 @@ LanguageTag::ImplPtr LanguageTag::registerImpl() const
         else
         {
             SAL_INFO( "i18nlangtag", "LanguageTag::registerImpl: new impl for 0x" << ::std::hex << mnLangID);
-            pImpl.reset( new LanguageTagImpl( *this));
+            pImpl = std::make_shared<LanguageTagImpl>( *this);
             rMap.insert( ::std::make_pair( mnLangID, pImpl));
             // Try round-trip.
             if (!pImpl->mbInitializedLocale)
@@ -896,7 +896,7 @@ LanguageTag::ImplPtr LanguageTag::registerImpl() const
         else
         {
             SAL_INFO( "i18nlangtag", "LanguageTag::registerImpl: new impl for '" << maBcp47 << "'");
-            pImpl.reset( new LanguageTagImpl( *this));
+            pImpl = std::make_shared<LanguageTagImpl>( *this);
             ::std::pair< MapBcp47::iterator, bool > insOrig( rMap.insert( ::std::make_pair( maBcp47, pImpl)));
             // If changed after canonicalize() also add the resulting tag to
             // the map.
@@ -973,7 +973,7 @@ LanguageTag::ImplPtr LanguageTag::registerImpl() const
     else
     {
         SAL_WARN( "i18nlangtag", "LanguageTag::registerImpl: can't register for 0x" << ::std::hex << mnLangID );
-        pImpl.reset( new LanguageTagImpl( *this));
+        pImpl = std::make_shared<LanguageTagImpl>( *this);
     }
 
     // If we reach here for mbSystemLocale we didn't have theSystemLocale
diff --git a/i18npool/source/breakiterator/breakiterator_unicode.cxx b/i18npool/source/breakiterator/breakiterator_unicode.cxx
index 61da86bdf48c..22d8a8b50568 100644
--- a/i18npool/source/breakiterator/breakiterator_unicode.cxx
+++ b/i18npool/source/breakiterator/breakiterator_unicode.cxx
@@ -173,7 +173,7 @@ void BreakIterator_Unicode::loadICUBreakIterator(const css::lang::Locale& rLocal
 
                 if (U_SUCCESS(status))
                 {
-                    icuBI->mpValue.reset( new BI_ValueData);
+                    icuBI->mpValue = std::make_shared<BI_ValueData>();
                     icuBI->mpValue->mpBreakIterator = std::move( rbi);
                     theBIMap.insert( std::make_pair( aBIMapRuleTypeKey, icuBI->mpValue));
                 }
@@ -205,7 +205,7 @@ void BreakIterator_Unicode::loadICUBreakIterator(const css::lang::Locale& rLocal
                     rbi.reset(new OOoRuleBasedBreakIterator( pUData, status));
                 if ( U_SUCCESS(status) )
                 {
-                    icuBI->mpValue.reset( new BI_ValueData);
+                    icuBI->mpValue = std::make_shared<BI_ValueData>();
                     icuBI->mpValue->mpBreakIterator = std::move( rbi);
                     theBIMap.insert( std::make_pair( aBIMapRuleKey, icuBI->mpValue));
                 }
@@ -231,7 +231,7 @@ void BreakIterator_Unicode::loadICUBreakIterator(const css::lang::Locale& rLocal
                         rbi.reset(new OOoRuleBasedBreakIterator( pUData, status));
                     if ( U_SUCCESS(status) )
                     {
-                        icuBI->mpValue.reset( new BI_ValueData);
+                        icuBI->mpValue = std::make_shared<BI_ValueData>();
                         icuBI->mpValue->mpBreakIterator = std::move( rbi);
                         theBIMap.insert( std::make_pair( aBIMapRuleOnlyKey, icuBI->mpValue));
                     }
@@ -294,7 +294,7 @@ void BreakIterator_Unicode::loadICUBreakIterator(const css::lang::Locale& rLocal
             if ( !U_SUCCESS(status) || !pBI ) {
                 throw uno::RuntimeException();
             }
-            icuBI->mpValue.reset( new BI_ValueData);
+            icuBI->mpValue = std::make_shared<BI_ValueData>();
             icuBI->mpValue->mpBreakIterator = pBI;
             theBIMap.insert( std::make_pair( aBIMapLocaleTypeKey, icuBI->mpValue));
         } while (false);


More information about the Libreoffice-commits mailing list