summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorJan Holesovsky <kendy@collabora.com>2016-03-17 15:51:42 +0100
committerAndras Timar <andras.timar@collabora.com>2016-04-04 23:53:21 +0200
commit00778b8a5db5d20b66ed7d0534ffae8181c8b610 (patch)
tree30d59fc0387b1c7ec162dbcc21d2131db996759d /sw
parent686dda325635ed55773ac8afdf6ff6984db8256e (diff)
tdf#98458 sw: Fix performance problem when searching in large documents.
Change-Id: I0056a411d7a3bb018401d87bdd4a0112fed31df6 Reviewed-on: https://gerrit.libreoffice.org/23340 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com> (cherry picked from commit 80d1589229926122adad60ff4ca1b045a54a5efa)
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/crsr/findtxt.cxx8
1 files changed, 4 insertions, 4 deletions
diff --git a/sw/source/core/crsr/findtxt.cxx b/sw/source/core/crsr/findtxt.cxx
index 243a57d08967..766894283393 100644
--- a/sw/source/core/crsr/findtxt.cxx
+++ b/sw/source/core/crsr/findtxt.cxx
@@ -242,6 +242,10 @@ bool SwPaM::Find( const SearchOptions& rSearchOpt, bool bSearchInNotes , utl::Te
rSearchOpt.searchString == "$^" );
const bool bChkParaEnd = bRegSearch && rSearchOpt.searchString == "$";
+ SvxSearchItem aSearchItem(SID_SEARCH_ITEM); // this is a very expensive operation (calling configmgr etc.)
+ aSearchItem.SetSearchOptions(rSearchOpt);
+ aSearchItem.SetBackward(!bSrchForward);
+
// LanguageType eLastLang = 0;
while( 0 != ( pNode = ::GetNode( *pPam, bFirst, fnMove, bInReadOnly ) ))
{
@@ -299,10 +303,6 @@ bool SwPaM::Find( const SearchOptions& rSearchOpt, bool bSearchInNotes , utl::Te
SwWrtShell *const pWrtShell = (pDocShell) ? pDocShell->GetWrtShell() : 0;
SwPostItMgr *const pPostItMgr = (pWrtShell) ? pWrtShell->GetPostItMgr() : 0;
- SvxSearchItem aSearchItem(SID_SEARCH_ITEM);
- aSearchItem.SetSearchOptions(rSearchOpt);
- aSearchItem.SetBackward(!bSrchForward);
-
// If there is an active text edit, then search there.
bool bEndedTextEdit = false;
SdrView* pSdrView = pWrtShell->GetDrawView();