diff options
author | Eike Rathke <erack@redhat.com> | 2016-02-05 16:56:54 +0100 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2016-02-05 17:02:47 +0100 |
commit | 599f0cbe1ddc1d54828489b389b78fdffa4ce39f (patch) | |
tree | 25173fd65460b33ef43910514559c203987a6c42 /sw | |
parent | 4c4976f717b3ddce68a872dffc2079ae49c41616 (diff) |
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
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/crsr/findattr.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/crsr/findtxt.cxx | 7 |
2 files changed, 5 insertions, 4 deletions
diff --git a/sw/source/core/crsr/findattr.cxx b/sw/source/core/crsr/findattr.cxx index 3cbd168b35ff..c8f402ae895f 100644 --- a/sw/source/core/crsr/findattr.cxx +++ b/sw/source/core/crsr/findattr.cxx @@ -1117,7 +1117,7 @@ int SwFindParaAttr::Find( SwPaM* pCursor, SwMoveFn fnMove, const SwPaM* pRegion, aTmp.Locale = SvtSysLocale().GetLanguageTag().getLocale(); - pSText = new utl::TextSearch( aTmp ); + pSText = new utl::TextSearch( utl::TextSearch::UpgradeToSearchOptions2( aTmp) ); } // TODO: searching for attributes in Outliner text?! diff --git a/sw/source/core/crsr/findtxt.cxx b/sw/source/core/crsr/findtxt.cxx index caa436bc2702..61943acb0937 100644 --- a/sw/source/core/crsr/findtxt.cxx +++ b/sw/source/core/crsr/findtxt.cxx @@ -540,7 +540,7 @@ bool SwPaM::DoSearch( const SearchOptions& rSearchOpt, utl::TextSearch& rSText, { const lang::Locale aLocale( g_pBreakIt->GetLocale( eCurrLang ) ); - rSText.SetLocale( rSearchOpt, aLocale ); + rSText.SetLocale( utl::TextSearch::UpgradeToSearchOptions2( rSearchOpt), aLocale ); eLastLang = eCurrLang; } } @@ -635,7 +635,8 @@ struct SwFindParaText : public SwFindParas bool m_bSearchInNotes; SwFindParaText( const SearchOptions& rOpt, bool bSearchInNotes, bool bRepl, SwCursor& rCursor ) - : m_rSearchOpt( rOpt ), m_rCursor( rCursor ), m_aSText( rOpt ), m_bReplace( bRepl ), m_bSearchInNotes( bSearchInNotes ) + : m_rSearchOpt( rOpt ), m_rCursor( rCursor ), m_aSText( utl::TextSearch::UpgradeToSearchOptions2( rOpt) ), + m_bReplace( bRepl ), m_bSearchInNotes( bSearchInNotes ) {} virtual int Find( SwPaM* , SwMoveFn , const SwPaM*, bool bInReadOnly ) override; virtual bool IsReplaceMode() const override; @@ -749,7 +750,7 @@ OUString *ReplaceBackReferences( const SearchOptions& rSearchOpt, SwPaM* pPam ) const SwContentNode* pTextNode = pPam->GetContentNode(); if( pTextNode && pTextNode->IsTextNode() && pTextNode == pPam->GetContentNode( false ) ) { - utl::TextSearch aSText( rSearchOpt ); + utl::TextSearch aSText( utl::TextSearch::UpgradeToSearchOptions2( rSearchOpt) ); const OUString& rStr = pTextNode->GetTextNode()->GetText(); sal_Int32 nStart = pPam->Start()->nContent.GetIndex(); sal_Int32 nEnd = pPam->End()->nContent.GetIndex(); |