Blame SOURCES/0207-sd-tiled-rendering-search-rectangle-is-part-specific.patch

f325b2
From 303f6bd02ad4cbaec4caf67682da5aed87b2ccaa Mon Sep 17 00:00:00 2001
f325b2
From: Miklos Vajna <vmiklos@collabora.co.uk>
f325b2
Date: Wed, 14 Oct 2015 12:32:12 +0200
f325b2
Subject: [PATCH 207/398] sd tiled rendering: search rectangle is part-specific
f325b2
f325b2
Change-Id: I88865db539779bc401550d7b4a3729b89d7e18b1
f325b2
(cherry picked from commit dd1fc2242a64a0b9ae8031a5edc7ecfcde4ec3df)
f325b2
---
f325b2
 sd/inc/Outliner.hxx            | 16 +++++++++++++++-
f325b2
 sd/source/ui/view/Outliner.cxx | 16 +++++++++++-----
f325b2
 2 files changed, 26 insertions(+), 6 deletions(-)
f325b2
f325b2
diff --git a/sd/inc/Outliner.hxx b/sd/inc/Outliner.hxx
f325b2
index f01e244de308..9f1f6aae3e8a 100644
f325b2
--- a/sd/inc/Outliner.hxx
f325b2
+++ b/sd/inc/Outliner.hxx
f325b2
@@ -41,6 +41,20 @@ class View;
f325b2
 class ViewShell;
f325b2
 class Window;
f325b2
 
f325b2
+/// Describes a single search hit: a set of rectangles on a given page.
f325b2
+struct SearchSelection
f325b2
+{
f325b2
+    /// 0-based index of the page that has the selection.
f325b2
+    int m_nPage;
f325b2
+    /**
f325b2
+     * List of selection rectangles in twips -- multiple rectangles only in
f325b2
+     * case the selection spans over more layout lines.
f325b2
+     */
f325b2
+    OString m_aRectangles;
f325b2
+
f325b2
+    SearchSelection(int nPage, const OString& rRectangles);
f325b2
+};
f325b2
+
f325b2
 /** The main purpose of this class is searching and replacing as well as
f325b2
     spelling of impress documents.  The main part of both tasks lies in
f325b2
     iterating over the pages and view modes of a document and apply the
f325b2
@@ -364,7 +378,7 @@ private:
f325b2
             The return value specifies whether the search ended (</sal_True>) or
f325b2
             another call to this method is required (</sal_False>).
f325b2
     */
f325b2
-    bool SearchAndReplaceOnce(std::vector<OString>* pSelections = 0);
f325b2
+    bool SearchAndReplaceOnce(std::vector<SearchSelection>* pSelections = 0);
f325b2
 
f325b2
     /** Detect changes of the document or view and react accordingly.  Such
f325b2
         changes may occur because different calls to
f325b2
diff --git a/sd/source/ui/view/Outliner.cxx b/sd/source/ui/view/Outliner.cxx
f325b2
index e02e879494b8..22db187ab7c8 100644
f325b2
--- a/sd/source/ui/view/Outliner.cxx
f325b2
+++ b/sd/source/ui/view/Outliner.cxx
f325b2
@@ -83,6 +83,12 @@ class SfxStyleSheetPool;
f325b2
 
f325b2
 namespace sd {
f325b2
 
f325b2
+SearchSelection::SearchSelection(int nPage, const OString& rRectangles)
f325b2
+    : m_nPage(nPage),
f325b2
+    m_aRectangles(rRectangles)
f325b2
+{
f325b2
+}
f325b2
+
f325b2
 class Outliner::Implementation
f325b2
 {
f325b2
 public:
f325b2
@@ -621,7 +627,7 @@ bool Outliner::SearchAndReplaceAll()
f325b2
 
f325b2
         // Search/replace until the end of the document is reached.
f325b2
         bool bFoundMatch;
f325b2
-        std::vector<OString> aSelections;
f325b2
+        std::vector<SearchSelection> aSelections;
f325b2
         do
f325b2
         {
f325b2
             bFoundMatch = ! SearchAndReplaceOnce(&aSelections);
f325b2
@@ -634,10 +640,10 @@ bool Outliner::SearchAndReplaceAll()
f325b2
             aTree.put("searchString", mpSearchItem->GetSearchString().toUtf8().getStr());
f325b2
 
f325b2
             boost::property_tree::ptree aChildren;
f325b2
-            for (const OString& rSelection : aSelections)
f325b2
+            for (const SearchSelection& rSelection : aSelections)
f325b2
             {
f325b2
                 boost::property_tree::ptree aChild;
f325b2
-                aChild.put("", rSelection.getStr());
f325b2
+                aChild.put("", rSelection.m_aRectangles.getStr());
f325b2
                 aChildren.push_back(std::make_pair("", aChild));
f325b2
             }
f325b2
             aTree.add_child("searchResultSelection", aChildren);
f325b2
@@ -655,7 +661,7 @@ bool Outliner::SearchAndReplaceAll()
f325b2
     return true;
f325b2
 }
f325b2
 
f325b2
-bool Outliner::SearchAndReplaceOnce(std::vector<OString>* pSelections)
f325b2
+bool Outliner::SearchAndReplaceOnce(std::vector<SearchSelection>* pSelections)
f325b2
 {
f325b2
     DetectChange ();
f325b2
 
f325b2
@@ -775,7 +781,7 @@ bool Outliner::SearchAndReplaceOnce(std::vector<OString>* pSelections)
f325b2
         }
f325b2
         else
f325b2
         {
f325b2
-            pSelections->push_back(sRectangles);
f325b2
+            pSelections->push_back(SearchSelection(maCurrentPosition.mnPageIndex, sRectangles));
f325b2
         }
f325b2
     }
f325b2
 
f325b2
-- 
f325b2
2.12.0
f325b2