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

Eike Rathke (via logerrit) logerrit at kemper.freedesktop.org
Thu Jun 27 20:20:09 UTC 2019


 i18npool/qa/cppunit/test_textsearch.cxx |    5 ++---
 i18npool/source/search/textsearch.cxx   |    8 ++++----
 i18npool/source/search/textsearch.hxx   |    3 +--
 3 files changed, 7 insertions(+), 9 deletions(-)

New commits:
commit 78023f61db40028cb30a25ce540aca9a76362660
Author:     Eike Rathke <erack at redhat.com>
AuthorDate: Thu Jun 27 19:19:10 2019 +0200
Commit:     Eike Rathke <erack at redhat.com>
CommitDate: Thu Jun 27 22:19:08 2019 +0200

    Ditch "using namespace U_ICU_NAMESPACE;", qualify icu:: instead
    
    Specifically no "using ..." in a header file. For the 5 places
    that actually need it..
    
    Change-Id: I5a9d4efa3b19df51a05e7de0b4a825876290579c
    Reviewed-on: https://gerrit.libreoffice.org/74814
    Reviewed-by: Eike Rathke <erack at redhat.com>
    Tested-by: Jenkins

diff --git a/i18npool/qa/cppunit/test_textsearch.cxx b/i18npool/qa/cppunit/test_textsearch.cxx
index 6d08e662ae31..b2175b21bfa5 100644
--- a/i18npool/qa/cppunit/test_textsearch.cxx
+++ b/i18npool/qa/cppunit/test_textsearch.cxx
@@ -27,7 +27,6 @@
 #include <unicode/regex.h>
 
 using namespace ::com::sun::star;
-using namespace U_ICU_NAMESPACE;
 typedef U_ICU_NAMESPACE::UnicodeString IcuUniString;
 
 class TestTextSearch : public test::BootstrapFixtureBase
@@ -60,7 +59,7 @@ void TestTextSearch::testICU()
     OUString aPattern( "e" );
     IcuUniString aSearchPat( reinterpret_cast<const UChar*>(aPattern.getStr()), aPattern.getLength() );
 
-    std::unique_ptr<RegexMatcher> pRegexMatcher(new RegexMatcher( aSearchPat, nSearchFlags, nErr ));
+    std::unique_ptr<icu::RegexMatcher> pRegexMatcher(new icu::RegexMatcher( aSearchPat, nSearchFlags, nErr ));
 
     IcuUniString aSource( reinterpret_cast<const UChar*>(aString.getStr()), aString.getLength() );
     pRegexMatcher->reset( aSource );
@@ -76,7 +75,7 @@ void TestTextSearch::testICU()
     OUString aPattern2( "a" );
 
     IcuUniString aSearchPat2( reinterpret_cast<const UChar*>(aPattern2.getStr()), aPattern2.getLength() );
-    pRegexMatcher.reset(new RegexMatcher( aSearchPat2, nSearchFlags, nErr ));
+    pRegexMatcher.reset(new icu::RegexMatcher( aSearchPat2, nSearchFlags, nErr ));
 
     IcuUniString aSource2( reinterpret_cast<const UChar*>(aString2.getStr()), aString2.getLength() );
     pRegexMatcher->reset( aSource2 );
diff --git a/i18npool/source/search/textsearch.cxx b/i18npool/source/search/textsearch.cxx
index 13990e55827f..09841d207dd8 100644
--- a/i18npool/source/search/textsearch.cxx
+++ b/i18npool/source/search/textsearch.cxx
@@ -838,19 +838,19 @@ void TextSearch::RESrchPrepare( const css::util::SearchOptions2& rOptions)
     // - by replacing \< with "word-break followed by a look-ahead word-char"
     static const IcuUniString aChevronPatternB( "\\\\<", -1, IcuUniString::kInvariant);
     static const IcuUniString aChevronReplaceB( "\\\\b(?=\\\\w)", -1, IcuUniString::kInvariant);
-    static RegexMatcher aChevronMatcherB( aChevronPatternB, 0, nIcuErr);
+    static icu::RegexMatcher aChevronMatcherB( aChevronPatternB, 0, nIcuErr);
     aChevronMatcherB.reset( aIcuSearchPatStr);
     aIcuSearchPatStr = aChevronMatcherB.replaceAll( aChevronReplaceB, nIcuErr);
     aChevronMatcherB.reset();
     // - by replacing \> with "look-behind word-char followed by a word-break"
     static const IcuUniString aChevronPatternE( "\\\\>", -1, IcuUniString::kInvariant);
     static const IcuUniString aChevronReplaceE( "(?<=\\\\w)\\\\b", -1, IcuUniString::kInvariant);
-    static RegexMatcher aChevronMatcherE( aChevronPatternE, 0, nIcuErr);
+    static icu::RegexMatcher aChevronMatcherE( aChevronPatternE, 0, nIcuErr);
     aChevronMatcherE.reset( aIcuSearchPatStr);
     aIcuSearchPatStr = aChevronMatcherE.replaceAll( aChevronReplaceE, nIcuErr);
     aChevronMatcherE.reset();
 #endif
-    pRegexMatcher.reset( new RegexMatcher( aIcuSearchPatStr, nIcuSearchFlags, nIcuErr) );
+    pRegexMatcher.reset( new icu::RegexMatcher( aIcuSearchPatStr, nIcuSearchFlags, nIcuErr) );
     if (nIcuErr)
     {
         SAL_INFO( "i18npool", "TextSearch::RESrchPrepare UErrorCode " << nIcuErr);
@@ -878,7 +878,7 @@ void TextSearch::RESrchPrepare( const css::util::SearchOptions2& rOptions)
 }
 
 
-static bool lcl_findRegex( std::unique_ptr<RegexMatcher> const & pRegexMatcher, sal_Int32 nStartPos, UErrorCode & rIcuErr )
+static bool lcl_findRegex( std::unique_ptr<icu::RegexMatcher> const & pRegexMatcher, sal_Int32 nStartPos, UErrorCode & rIcuErr )
 {
     if (!pRegexMatcher->find( nStartPos, rIcuErr))
     {
diff --git a/i18npool/source/search/textsearch.hxx b/i18npool/source/search/textsearch.hxx
index acc49a00ee5a..aa4c8f522f86 100644
--- a/i18npool/source/search/textsearch.hxx
+++ b/i18npool/source/search/textsearch.hxx
@@ -37,7 +37,6 @@ namespace com::sun::star::i18n { class XExtendedTransliteration; }
 namespace com::sun::star::uno { class XComponentContext; }
 
 
-using namespace U_ICU_NAMESPACE;
 typedef U_ICU_NAMESPACE::UnicodeString IcuUniString;
 
 class WLevDistance;
@@ -89,7 +88,7 @@ class TextSearch: public cppu::WeakImplHelper
                                 sal_Int32 startPos, sal_Int32 endPos );
 
     // Members and methods for the regular expression search
-    std::unique_ptr<RegexMatcher> pRegexMatcher;
+    std::unique_ptr<icu::RegexMatcher> pRegexMatcher;
     /// @throws css::uno::RuntimeException
     css::util::SearchResult SAL_CALL
         RESrchFrwrd( const OUString& searchStr,


More information about the Libreoffice-commits mailing list