[Libreoffice-commits] core.git: Branch 'libreoffice-5-1' - sw/source

Jan Holesovsky kendy at collabora.com
Thu Mar 17 20:54:36 UTC 2016


 sw/source/core/crsr/findtxt.cxx |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

New commits:
commit dc54f1b0f6ec4353b02da3a711dacc350ebc9db2
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/23341
    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 abd3763..3248f11 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();


More information about the Libreoffice-commits mailing list