From 599f0cbe1ddc1d54828489b389b78fdffa4ce39f Mon Sep 17 00:00:00 2001 From: Eike Rathke Date: Fri, 5 Feb 2016 16:56:54 +0100 Subject: interface to new XTextSearch2 with SearchOptions2, tdf#72196 Places that had utl::TextSearch::UpgradeToSearchOptions2() introduced are worth an inspection if the new SearchAlgorithms2::WILDCARD search should be supported or at least use SearchOptions2 instead of SearchOptions to eliminate the small performance penalty that conversion involves. Change-Id: I565f73af2b551ae9ad0f488e672823dc6c5c1109 --- i18npool/source/search/textsearch.hxx | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'i18npool/source/search/textsearch.hxx') diff --git a/i18npool/source/search/textsearch.hxx b/i18npool/source/search/textsearch.hxx index 5c2ef0312290..ae189c29df63 100644 --- a/i18npool/source/search/textsearch.hxx +++ b/i18npool/source/search/textsearch.hxx @@ -21,7 +21,7 @@ #define INCLUDED_I18NPOOL_SOURCE_SEARCH_TEXTSEARCH_HXX #include -#include +#include #include #include #include @@ -39,13 +39,13 @@ typedef ::std::map< sal_Unicode, sal_Int32 > TextSearchJumpTable; class TextSearch: public cppu::WeakImplHelper < - css::util::XTextSearch, + css::util::XTextSearch2, css::lang::XServiceInfo > { css::uno::Reference < css::uno::XComponentContext > m_xContext; - css::util::SearchOptions aSrchPara; + css::util::SearchOptions2 aSrchPara; OUString sSrchStr; OUString sSrchStr2; @@ -91,7 +91,7 @@ class TextSearch: public cppu::WeakImplHelper RESrchBkwrd( const OUString& searchStr, sal_Int32 startPos, sal_Int32 endPos ) throw(css::uno::RuntimeException); - void RESrchPrepare( const css::util::SearchOptions&); + void RESrchPrepare( const css::util::SearchOptions2&); // Members and methods for the "Weight Levenshtein-Distance" search int nLimit; @@ -118,7 +118,7 @@ public: virtual ~TextSearch(); - // Methods + // XTextSearch virtual void SAL_CALL setOptions( const css::util::SearchOptions& options ) throw(css::uno::RuntimeException, std::exception) override; @@ -131,6 +131,11 @@ public: sal_Int32 startPos, sal_Int32 endPos ) throw(css::uno::RuntimeException, std::exception) override; + // XTextSearch2 + virtual void SAL_CALL + setOptions2( const css::util::SearchOptions2& options ) + throw(css::uno::RuntimeException, std::exception) override; + //XServiceInfo virtual OUString SAL_CALL getImplementationName() throw( css::uno::RuntimeException, std::exception ) override; -- cgit