diff options
author | Norbert Thiebaud <nthiebaud@gmail.com> | 2013-07-01 10:33:48 -0500 |
---|---|---|
committer | Fridrich Strba <fridrich@documentfoundation.org> | 2013-07-02 07:31:30 +0000 |
commit | 6a08067902ddc0ec61a7c7b4b0035b303f643a50 (patch) | |
tree | cd49d1824cd169d9d224925b836eaa70de27414e /include/unotools/textsearch.hxx | |
parent | 82a1d75ee59c46e6bb361b98c520cc4eff2e770c (diff) |
OUString convertion for unotools
Change-Id: Ifae7f344e3827875e32afa3cda23c771f5735707
Reviewed-on: https://gerrit.libreoffice.org/4659
Tested-by: LibreOffice gerrit bot <gerrit@libreoffice.org>
Reviewed-by: Fridrich Strba <fridrich@documentfoundation.org>
Tested-by: Fridrich Strba <fridrich@documentfoundation.org>
Diffstat (limited to 'include/unotools/textsearch.hxx')
-rw-r--r-- | include/unotools/textsearch.hxx | 40 |
1 files changed, 18 insertions, 22 deletions
diff --git a/include/unotools/textsearch.hxx b/include/unotools/textsearch.hxx index 0b826102cb91..0880c13ff3f4 100644 --- a/include/unotools/textsearch.hxx +++ b/include/unotools/textsearch.hxx @@ -22,7 +22,6 @@ #define _UNOTOOLS_TEXTSEARCH_HXX #include <i18nlangtag/lang.h> #include <rtl/ustring.hxx> -#include <tools/string.hxx> #include <com/sun/star/uno/Reference.h> #include <com/sun/star/lang/Locale.hpp> #include <com/sun/star/util/XTextSearch.hpp> @@ -52,8 +51,8 @@ public: enum SearchType{ SRCH_NORMAL, SRCH_REGEXP, SRCH_LEVDIST }; private: - String sSrchStr; // the search string - String sReplaceStr; // the replace string + OUString sSrchStr; // the search string + OUString sReplaceStr; // the replace string SearchType m_eSrchType; // search normal/regular/LevDist @@ -73,16 +72,16 @@ private: public: SearchParam( const OUString &rText, SearchType eSrchType = SearchParam::SRCH_NORMAL, - sal_Bool bCaseSensitive = sal_True, - sal_Bool bWordOnly = sal_False, - sal_Bool bSearchInSelection = sal_False ); + bool bCaseSensitive = true, + bool bWordOnly = false, + bool bSearchInSelection = false ); SearchParam( const SearchParam& ); ~SearchParam(); - const String& GetSrchStr() const { return sSrchStr; } - const String& GetReplaceStr() const { return sReplaceStr; } + const OUString& GetSrchStr() const { return sSrchStr; } + const OUString& GetReplaceStr() const { return sReplaceStr; } SearchType GetSrchType() const { return m_eSrchType; } int IsCaseSensitive() const { return m_bCaseSense; } @@ -90,8 +89,8 @@ public: int IsSrchWordOnly() const { return m_bWordOnly; } - void SetSrchStr( const String& rStr ) { sSrchStr = rStr; } - void SetReplaceStr( const String& rStr ) { sReplaceStr = rStr; } + void SetSrchStr( const OUString& rStr ) { sSrchStr = rStr; } + void SetReplaceStr( const OUString& rStr ) { sReplaceStr = rStr; } void SetSrchType( SearchType eType ) { m_eSrchType = eType; } void SetCaseSensitive( int bFlag ) { m_bCaseSense = bFlag; } @@ -145,35 +144,32 @@ public: pStart - start position for the search pEnde - end position for the search - RETURN values == sal_True: something is found + RETURN values == true: something is found - pStart start pos of the found text, - pStart end pos of the found text, - pSrchResult - the search result with all found positions. Is only filled with more positions if the regular expression handles groups. - == sal_False: nothing found, pStart,pEnde unchanged. + == false: nothing found, pStart,pEnde unchanged. Definitions: start pos always inclusive, end pos always exclusive! The position must always in the right direction! search forward: start <= end search backward: end <= start */ - int SearchFrwrd( const String &rStr, - xub_StrLen* pStart, xub_StrLen* pEnde, - ::com::sun::star::util::SearchResult* pSrchResult = 0 ); - sal_Bool SearchForward( const OUString &rStr, - sal_Int32* pStart, sal_Int32* pEnd, - ::com::sun::star::util::SearchResult* pRes = 0 ); - int SearchBkwrd( const String &rStr, - xub_StrLen* pStart, xub_StrLen* pEnde, - ::com::sun::star::util::SearchResult* pSrchResult = 0 ); + bool SearchForward( const OUString &rStr, + sal_Int32* pStart, sal_Int32* pEnd, + ::com::sun::star::util::SearchResult* pRes = 0 ); + bool SearchBackward( const OUString &rStr, + sal_Int32* pStart, sal_Int32* pEnd, + ::com::sun::star::util::SearchResult* pRes = 0 ); void SetLocale( const ::com::sun::star::util::SearchOptions& rOpt, const ::com::sun::star::lang::Locale& rLocale ); /* replace back references in the replace string by the sub expressions from the search result */ - void ReplaceBackReferences( String& rReplaceStr, const String &rStr, const ::com::sun::star::util::SearchResult& rResult ); + void ReplaceBackReferences( OUString& rReplaceStr, const OUString &rStr, const ::com::sun::star::util::SearchResult& rResult ); }; |