summaryrefslogtreecommitdiff
path: root/sw/inc
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2020-09-08 11:51:59 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-09-09 08:25:01 +0200
commit1159f58831c69680e9f10767d5358e13b66579dd (patch)
treebe4dde02117b6842f43a71f27a32fb28d85320c1 /sw/inc
parente00e2be30436b636d93f8852bb6af44972638a7c (diff)
tdf#119286 speed up find/replace
SvxSearchItem is very expensive to construct, so move it outside the primary loop. This takes the time from 6s to 3s for me. Change-Id: Ie6491761e69c4f787910d7ecfbd071b7e68efd35 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102231 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw/inc')
-rw-r--r--sw/inc/swcrsr.hxx4
1 files changed, 3 insertions, 1 deletions
diff --git a/sw/inc/swcrsr.hxx b/sw/inc/swcrsr.hxx
index 923928887023..a6e634ac3b55 100644
--- a/sw/inc/swcrsr.hxx
+++ b/sw/inc/swcrsr.hxx
@@ -25,6 +25,7 @@
class SfxItemSet;
struct SwCursor_SavePos;
+class SvxSearchItem;
namespace i18nutil {
struct SearchOptions2;
}
@@ -37,7 +38,8 @@ const int FIND_NO_RING = 2;
struct SwFindParas
{
- virtual int DoFind(SwPaM &, SwMoveFnCollection const &, const SwPaM&, bool) = 0;
+ // @param xSearchItem allocate in parent so we can do so outside the calling loop
+ virtual int DoFind(SwPaM &, SwMoveFnCollection const &, const SwPaM&, bool, std::unique_ptr<SvxSearchItem>& xSearchItem) = 0;
virtual bool IsReplaceMode() const = 0;
protected: