summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Holesovsky <kendy@collabora.com>2016-03-17 15:51:42 +0100
committerCaolán McNamara <caolanm@redhat.com>2016-03-17 20:54:07 +0000
commitdc54f1b0f6ec4353b02da3a711dacc350ebc9db2 (patch)
tree7261026052183bb29b852d62583a537ca15f890d
parentc54310c6b0f14a649ab3d290c012fff2fab86d85 (diff)
tdf#98458 sw: Fix performance problem when searching in large documents.
Change-Id: I0056a411d7a3bb018401d87bdd4a0112fed31df6 Reviewed-on: https://gerrit.libreoffice.org/23341 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
-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 abd3763b47e6..3248f116fd53 100644
--- a/sw/source/core/crsr/findtxt.cxx
+++ b/sw/source/core/crsr/findtxt.cxx
@@ -244,6 +244,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( nullptr != ( pNode = ::GetNode( *pPam, bFirst, fnMove, bInReadOnly ) ))
{
@@ -301,10 +305,6 @@ bool SwPaM::Find( const SearchOptions& rSearchOpt, bool bSearchInNotes , utl::Te
SwWrtShell *const pWrtShell = (pDocShell) ? pDocShell->GetWrtShell() : nullptr;
SwPostItMgr *const pPostItMgr = (pWrtShell) ? pWrtShell->GetPostItMgr() : nullptr;
- 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();