[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sw/source
Jan Holesovsky
kendy at collabora.com
Thu Mar 17 20:54:37 UTC 2016
sw/source/core/crsr/findtxt.cxx | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
New commits:
commit 80d1589229926122adad60ff4ca1b045a54a5efa
Author: Jan Holesovsky <kendy at collabora.com>
Date: Thu Mar 17 15:51:42 2016 +0100
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 at libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/sw/source/core/crsr/findtxt.cxx b/sw/source/core/crsr/findtxt.cxx
index 741e307..e483545 100644
--- a/sw/source/core/crsr/findtxt.cxx
+++ b/sw/source/core/crsr/findtxt.cxx
@@ -241,6 +241,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 ) ))
{
@@ -298,10 +302,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();
More information about the Libreoffice-commits
mailing list