From 184637be60fcdbde3b3fb0ab0c1d158a92f63889 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Mon, 19 Oct 2015 10:34:45 +0200 Subject: com::sun::star->css in i18npool Change-Id: I13a290cba0f38c79eb2d93148b972d3d931c3862 Reviewed-on: https://gerrit.libreoffice.org/19445 Reviewed-by: Eike Rathke Tested-by: Eike Rathke --- i18npool/source/search/textsearch.cxx | 38 +++++++++---------- i18npool/source/search/textsearch.hxx | 71 +++++++++++++++++------------------ 2 files changed, 53 insertions(+), 56 deletions(-) (limited to 'i18npool/source/search') diff --git a/i18npool/source/search/textsearch.cxx b/i18npool/source/search/textsearch.cxx index fbc4db19994c..7c9645114416 100644 --- a/i18npool/source/search/textsearch.cxx +++ b/i18npool/source/search/textsearch.cxx @@ -160,7 +160,7 @@ void TextSearch::setOptions( const SearchOptions& rOptions ) throw( RuntimeExcep } if ( !xBreak.is() ) - xBreak = com::sun::star::i18n::BreakIterator::create( m_xContext ); + xBreak = css::i18n::BreakIterator::create( m_xContext ); sSrchStr = aSrchPara.searchString; @@ -172,7 +172,7 @@ void TextSearch::setOptions( const SearchOptions& rOptions ) throw( RuntimeExcep if (maskSimpleRegexTrans( aSrchPara.transliterateFlags) != maskSimpleTrans( aSrchPara.transliterateFlags)) { - com::sun::star::uno::Reference< XExtendedTransliteration > xTranslitPattern( + css::uno::Reference< XExtendedTransliteration > xTranslitPattern( Transliteration::create( m_xContext )); if (xTranslitPattern.is()) { @@ -265,7 +265,7 @@ SearchResult TextSearch::searchForward( const OUString& searchStr, sal_Int32 sta if ( xTranslit.is() ) { // apply normal transliteration (1<->1, 1<->0) - com::sun::star::uno::Sequence offset(endPos - startPos); + css::uno::Sequence offset(endPos - startPos); in_str = xTranslit->transliterate( searchStr, startPos, endPos - startPos, offset ); // JP 20.6.2001: also the start and end positions must be corrected! @@ -323,7 +323,7 @@ SearchResult TextSearch::searchForward( const OUString& searchStr, sal_Int32 sta SearchResult sres2; in_str = OUString(searchStr); - com::sun::star::uno::Sequence offset( in_str.getLength()); + css::uno::Sequence offset( in_str.getLength()); in_str = xTranslit2->transliterate( searchStr, 0, in_str.getLength(), offset ); @@ -374,7 +374,7 @@ SearchResult TextSearch::searchBackward( const OUString& searchStr, sal_Int32 st if ( xTranslit.is() ) { // apply only simple 1<->1 transliteration here - com::sun::star::uno::Sequence offset(startPos - endPos); + css::uno::Sequence offset(startPos - endPos); in_str = xTranslit->transliterate( searchStr, endPos, startPos - endPos, offset ); // JP 20.6.2001: also the start and end positions must be corrected! @@ -423,7 +423,7 @@ SearchResult TextSearch::searchBackward( const OUString& searchStr, sal_Int32 st SearchResult sres2; in_str = OUString(searchStr); - com::sun::star::uno::Sequence offset( in_str.getLength()); + css::uno::Sequence offset( in_str.getLength()); in_str = xTranslit2->transliterate(searchStr, 0, in_str.getLength(), offset); @@ -762,7 +762,7 @@ SearchResult TextSearch::NSrchBkwrd( const OUString& searchStr, sal_Int32 startP return aRet; } -void TextSearch::RESrchPrepare( const ::com::sun::star::util::SearchOptions& rOptions) +void TextSearch::RESrchPrepare( const css::util::SearchOptions& rOptions) { // select the transliterated pattern string const OUString& rPatternStr = @@ -770,7 +770,7 @@ void TextSearch::RESrchPrepare( const ::com::sun::star::util::SearchOptions& rOp : (isComplexTrans( rOptions.transliterateFlags) ? sSrchStr2 : rOptions.searchString)); sal_uInt32 nIcuSearchFlags = UREGEX_UWORD; // request UAX#29 unicode capability - // map com::sun::star::util::SearchFlags to ICU uregex.h flags + // map css::util::SearchFlags to ICU uregex.h flags // TODO: REG_EXTENDED, REG_NOT_BEGINOFLINE, REG_NOT_ENDOFLINE // REG_NEWLINE is neither properly defined nor used anywhere => not implemented // REG_NOSUB is not used anywhere => not implemented @@ -778,7 +778,7 @@ void TextSearch::RESrchPrepare( const ::com::sun::star::util::SearchOptions& rOp // LEV_RELAXED is only used for SearchAlgorithm==Approximate // Note that the search flag ALL_IGNORE_CASE is deprecated in UNO // probably because the transliteration flag IGNORE_CASE handles it as well. - if( (rOptions.searchFlag & com::sun::star::util::SearchFlags::ALL_IGNORE_CASE) != 0 + if( (rOptions.searchFlag & css::util::SearchFlags::ALL_IGNORE_CASE) != 0 || (rOptions.transliterateFlags & TransliterationModules_IGNORE_CASE) != 0) nIcuSearchFlags |= UREGEX_CASE_INSENSITIVE; UErrorCode nIcuErr = U_ZERO_ERROR; @@ -1097,13 +1097,13 @@ TextSearch::getSupportedServiceNames() throw( RuntimeException, std::exception ) return aRet; } -::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > +css::uno::Reference< css::uno::XInterface > SAL_CALL TextSearch_CreateInstance( - const ::com::sun::star::uno::Reference< - ::com::sun::star::lang::XMultiServiceFactory >& rxMSF ) + const css::uno::Reference< + css::lang::XMultiServiceFactory >& rxMSF ) { - return ::com::sun::star::uno::Reference< - ::com::sun::star::uno::XInterface >( + return css::uno::Reference< + css::uno::XInterface >( static_cast(new TextSearch( comphelper::getComponentContext( rxMSF ) )) ); } @@ -1117,15 +1117,15 @@ i18nsearch_component_getFactory( const sal_Char* sImplementationName, { void* pRet = NULL; - ::com::sun::star::lang::XMultiServiceFactory* pServiceManager = - static_cast< ::com::sun::star::lang::XMultiServiceFactory* > + css::lang::XMultiServiceFactory* pServiceManager = + static_cast< css::lang::XMultiServiceFactory* > ( _pServiceManager ); - ::com::sun::star::uno::Reference< - ::com::sun::star::lang::XSingleServiceFactory > xFactory; + css::uno::Reference< + css::lang::XSingleServiceFactory > xFactory; if ( 0 == rtl_str_compare( sImplementationName, cSearchImpl) ) { - ::com::sun::star::uno::Sequence< OUString > aServiceNames(1); + css::uno::Sequence< OUString > aServiceNames(1); aServiceNames[0] = getServiceName_Static(); xFactory = ::cppu::createSingleFactory( pServiceManager, getImplementationName_Static(), diff --git a/i18npool/source/search/textsearch.hxx b/i18npool/source/search/textsearch.hxx index afa3a5fe1b33..7b42fe7368a8 100644 --- a/i18npool/source/search/textsearch.hxx +++ b/i18npool/source/search/textsearch.hxx @@ -39,26 +39,23 @@ typedef ::std::map< sal_Unicode, sal_Int32 > TextSearchJumpTable; class TextSearch: public cppu::WeakImplHelper < - ::com::sun::star::util::XTextSearch, - ::com::sun::star::lang::XServiceInfo + css::util::XTextSearch, + css::lang::XServiceInfo > { - ::com::sun::star::uno::Reference < ::com::sun::star::uno::XComponentContext > m_xContext; + css::uno::Reference < css::uno::XComponentContext > m_xContext; - ::com::sun::star::util::SearchOptions aSrchPara; + css::util::SearchOptions aSrchPara; OUString sSrchStr; OUString sSrchStr2; - mutable com::sun::star::uno::Reference< - com::sun::star::i18n::XCharacterClassification > xCharClass; + mutable css::uno::Reference< css::i18n::XCharacterClassification > xCharClass; - com::sun::star::uno::Reference< - com::sun::star::i18n::XExtendedTransliteration > xTranslit; - com::sun::star::uno::Reference< - com::sun::star::i18n::XExtendedTransliteration > xTranslit2; + css::uno::Reference< css::i18n::XExtendedTransliteration > xTranslit; + css::uno::Reference< css::i18n::XExtendedTransliteration > xTranslit2; // define a function pointer for the different search methods - typedef ::com::sun::star::util::SearchResult + typedef css::util::SearchResult (SAL_CALL TextSearch:: *FnSrch)( const OUString& searchStr, sal_Int32 startPos, sal_Int32 endPos ); @@ -75,72 +72,72 @@ class TextSearch: public cppu::WeakImplHelper void MakeBackwardTab(); void MakeBackwardTab2(); sal_Int32 GetDiff( const sal_Unicode ) const; - ::com::sun::star::util::SearchResult SAL_CALL + css::util::SearchResult SAL_CALL NSrchFrwrd( const OUString& searchStr, sal_Int32 startPos, sal_Int32 endPos ) - throw(::com::sun::star::uno::RuntimeException); - ::com::sun::star::util::SearchResult SAL_CALL + throw(css::uno::RuntimeException); + css::util::SearchResult SAL_CALL NSrchBkwrd( const OUString& searchStr, sal_Int32 startPos, sal_Int32 endPos ) - throw(::com::sun::star::uno::RuntimeException); + throw(css::uno::RuntimeException); // Members and methods for the regular expression search RegexMatcher* pRegexMatcher; - ::com::sun::star::util::SearchResult SAL_CALL + css::util::SearchResult SAL_CALL RESrchFrwrd( const OUString& searchStr, sal_Int32 startPos, sal_Int32 endPos ) - throw(::com::sun::star::uno::RuntimeException); - ::com::sun::star::util::SearchResult SAL_CALL + throw(css::uno::RuntimeException); + css::util::SearchResult SAL_CALL RESrchBkwrd( const OUString& searchStr, sal_Int32 startPos, sal_Int32 endPos ) - throw(::com::sun::star::uno::RuntimeException); - void RESrchPrepare( const ::com::sun::star::util::SearchOptions&); + throw(css::uno::RuntimeException); + void RESrchPrepare( const css::util::SearchOptions&); // Members and methods for the "Weight Levenshtein-Distance" search int nLimit; WLevDistance* pWLD; - com::sun::star::uno::Reference < com::sun::star::i18n::XBreakIterator > xBreak; - ::com::sun::star::util::SearchResult SAL_CALL + css::uno::Reference < css::i18n::XBreakIterator > xBreak; + css::util::SearchResult SAL_CALL ApproxSrchFrwrd( const OUString& searchStr, sal_Int32 startPos, sal_Int32 endPos ) - throw(::com::sun::star::uno::RuntimeException); - ::com::sun::star::util::SearchResult SAL_CALL + throw(css::uno::RuntimeException); + css::util::SearchResult SAL_CALL ApproxSrchBkwrd( const OUString& searchStr, sal_Int32 startPos, sal_Int32 endPos ) - throw(::com::sun::star::uno::RuntimeException); + throw(css::uno::RuntimeException); bool IsDelimiter( const OUString& rStr, sal_Int32 nPos ) const; bool checkCTLStart, checkCTLEnd; bool SAL_CALL isCellStart(const OUString& searchStr, sal_Int32 nPos) - throw(::com::sun::star::uno::RuntimeException); + throw(css::uno::RuntimeException); public: TextSearch( - const ::com::sun::star::uno::Reference < ::com::sun::star::uno::XComponentContext >& rxContext ); + const css::uno::Reference < css::uno::XComponentContext >& rxContext ); virtual ~TextSearch(); // Methods virtual void SAL_CALL - setOptions( const ::com::sun::star::util::SearchOptions& options ) - throw(::com::sun::star::uno::RuntimeException, std::exception) override; - virtual ::com::sun::star::util::SearchResult SAL_CALL + setOptions( const css::util::SearchOptions& options ) + throw(css::uno::RuntimeException, std::exception) override; + virtual css::util::SearchResult SAL_CALL searchForward( const OUString& searchStr, sal_Int32 startPos, sal_Int32 endPos ) - throw(::com::sun::star::uno::RuntimeException, std::exception) override; - virtual ::com::sun::star::util::SearchResult SAL_CALL + throw(css::uno::RuntimeException, std::exception) override; + virtual css::util::SearchResult SAL_CALL searchBackward( const OUString& searchStr, sal_Int32 startPos, sal_Int32 endPos ) - throw(::com::sun::star::uno::RuntimeException, std::exception) override; + throw(css::uno::RuntimeException, std::exception) override; //XServiceInfo virtual OUString SAL_CALL getImplementationName() - throw( ::com::sun::star::uno::RuntimeException, std::exception ) override; + throw( css::uno::RuntimeException, std::exception ) override; virtual sal_Bool SAL_CALL supportsService(const OUString& ServiceName) - throw( ::com::sun::star::uno::RuntimeException, std::exception ) override; - virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() - throw( ::com::sun::star::uno::RuntimeException, std::exception ) override; + throw( css::uno::RuntimeException, std::exception ) override; + virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() + throw( css::uno::RuntimeException, std::exception ) override; }; #endif -- cgit