Blob Blame History Raw
From c8beb0f19a10c8dc2d73c8d7440cf48c51552191 Mon Sep 17 00:00:00 2001
From: Miklos Vajna <vmiklos@collabora.co.uk>
Date: Wed, 7 Oct 2015 17:19:26 +0200
Subject: [PATCH 189/398] sc tiled rendering: fix showing all search results

Calc can have multiple cells selected, but there is only one cell which
has the black border around the cell. Code in
ScViewFunc::SearchAndReplace() assumed that the two are always the same,
and that's how find-all always highlighted the first match only.

Fix this by avoiding emitting LOK_CALLBACK_TEXT_SELECTION two times, at
least in the find-all case.

Change-Id: Ifce789c7f5f11e94fb2445846279823096ecb2dd
(cherry picked from commit a31f95b180728c1c671930913b4b4ad96ebcda5f)
---
 sc/source/ui/view/viewfun2.cxx | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/sc/source/ui/view/viewfun2.cxx b/sc/source/ui/view/viewfun2.cxx
index 47b0ace1ccef..295d3dbcbf44 100644
--- a/sc/source/ui/view/viewfun2.cxx
+++ b/sc/source/ui/view/viewfun2.cxx
@@ -1837,7 +1837,8 @@ bool ScViewFunc::SearchAndReplace( const SvxSearchItem* pSearchItem,
         AlignToCursor( nCol, nRow, SC_FOLLOW_JUMP );
         SetCursor( nCol, nRow, true );
 
-        if (rDoc.GetDrawLayer()->isTiledRendering())
+        // Don't move cell selection handles for find-all: selection of all but the first result would be lost.
+        if (rDoc.GetDrawLayer()->isTiledRendering() && nCommand == SvxSearchCmd::FIND)
         {
             Point aCurPos = GetViewData().GetScrPos(nCol, nRow, GetViewData().GetActivePart());
 
-- 
2.12.0