summaryrefslogtreecommitdiff
path: root/i18npool/source/breakiterator
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2020-04-20 14:41:47 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-04-20 20:54:18 +0200
commit65aeb5a630b5a9996ca3fdd2ab9750548dc7cc23 (patch)
tree35289b36e5d3135feae29978995567e74b2f34d5 /i18npool/source/breakiterator
parent7fe8bbaf5e23fa8ac0f5488de58b717c21691be4 (diff)
fix regression
from commit c5424e19338a3edaec3f0459c8ac5d53ca92d9fe loplugin:useuniqueptr in i18npool which would have resulted in the block at line 245 inside #if (U_ICU_VERSION_MAJOR_NUM < 58) never doing anything spotted while doing improvements to my make_shared plugin Change-Id: I79c664c7e4a051f3c764cb49d99870b51b19ce55 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92567 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'i18npool/source/breakiterator')
-rw-r--r--i18npool/source/breakiterator/breakiterator_unicode.cxx16
1 files changed, 8 insertions, 8 deletions
diff --git a/i18npool/source/breakiterator/breakiterator_unicode.cxx b/i18npool/source/breakiterator/breakiterator_unicode.cxx
index b756fbbdbee2..2d2ac437b430 100644
--- a/i18npool/source/breakiterator/breakiterator_unicode.cxx
+++ b/i18npool/source/breakiterator/breakiterator_unicode.cxx
@@ -152,7 +152,7 @@ void BreakIterator_Unicode::loadICUBreakIterator(const css::lang::Locale& rLocal
udata_setAppData("OpenOffice", OpenOffice_dat, &status);
if ( !U_SUCCESS(status) ) throw uno::RuntimeException();
- std::unique_ptr<OOoRuleBasedBreakIterator> rbi;
+ std::shared_ptr<OOoRuleBasedBreakIterator> rbi;
if (breakRules.getLength() > breakType && !breakRules[breakType].isEmpty())
{
@@ -168,13 +168,13 @@ void BreakIterator_Unicode::loadICUBreakIterator(const css::lang::Locale& rLocal
break; // do
}
- rbi.reset(new OOoRuleBasedBreakIterator(udata_open("OpenOffice", "brk",
- OUStringToOString(breakRules[breakType], RTL_TEXTENCODING_ASCII_US).getStr(), &status), status));
+ rbi = std::make_shared<OOoRuleBasedBreakIterator>(udata_open("OpenOffice", "brk",
+ OUStringToOString(breakRules[breakType], RTL_TEXTENCODING_ASCII_US).getStr(), &status), status);
if (U_SUCCESS(status))
{
icuBI->mpValue = std::make_shared<BI_ValueData>();
- icuBI->mpValue->mpBreakIterator = std::move( rbi);
+ icuBI->mpValue->mpBreakIterator = rbi;
theBIMap.insert( std::make_pair( aBIMapRuleTypeKey, icuBI->mpValue));
}
else
@@ -202,11 +202,11 @@ void BreakIterator_Unicode::loadICUBreakIterator(const css::lang::Locale& rLocal
OString aUDName = rtl::OStringView(rule) + "_" + aLanguage;
UDataMemory* pUData = udata_open("OpenOffice", "brk", aUDName.getStr(), &status);
if( U_SUCCESS(status) )
- rbi.reset(new OOoRuleBasedBreakIterator( pUData, status));
+ rbi = std::make_shared<OOoRuleBasedBreakIterator>( pUData, status);
if ( U_SUCCESS(status) )
{
icuBI->mpValue = std::make_shared<BI_ValueData>();
- icuBI->mpValue->mpBreakIterator = std::move( rbi);
+ icuBI->mpValue->mpBreakIterator = rbi;
theBIMap.insert( std::make_pair( aBIMapRuleKey, icuBI->mpValue));
}
else
@@ -228,11 +228,11 @@ void BreakIterator_Unicode::loadICUBreakIterator(const css::lang::Locale& rLocal
status = U_ZERO_ERROR;
pUData = udata_open("OpenOffice", "brk", rule, &status);
if( U_SUCCESS(status) )
- rbi.reset(new OOoRuleBasedBreakIterator( pUData, status));
+ rbi = std::make_shared<OOoRuleBasedBreakIterator>( pUData, status);
if ( U_SUCCESS(status) )
{
icuBI->mpValue = std::make_shared<BI_ValueData>();
- icuBI->mpValue->mpBreakIterator = std::move( rbi);
+ icuBI->mpValue->mpBreakIterator = rbi;
theBIMap.insert( std::make_pair( aBIMapRuleOnlyKey, icuBI->mpValue));
}
else