summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2015-10-14 12:32:12 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2015-10-14 15:39:02 +0200
commitdd1fc2242a64a0b9ae8031a5edc7ecfcde4ec3df (patch)
tree40afc9a28c10ff6327166ed40cc24a9a8d28e413 /sd
parent1e5b125e8c432bdbb98655648f759732d5652f96 (diff)
sd tiled rendering: search rectangle is part-specific
Change-Id: I88865db539779bc401550d7b4a3729b89d7e18b1
Diffstat (limited to 'sd')
-rw-r--r--sd/inc/Outliner.hxx16
-rw-r--r--sd/source/ui/view/Outliner.cxx16
2 files changed, 26 insertions, 6 deletions
diff --git a/sd/inc/Outliner.hxx b/sd/inc/Outliner.hxx
index a5bb9667724e..931854d15009 100644
--- a/sd/inc/Outliner.hxx
+++ b/sd/inc/Outliner.hxx
@@ -39,6 +39,20 @@ class View;
class ViewShell;
class Window;
+/// Describes a single search hit: a set of rectangles on a given page.
+struct SearchSelection
+{
+ /// 0-based index of the page that has the selection.
+ int m_nPage;
+ /**
+ * List of selection rectangles in twips -- multiple rectangles only in
+ * case the selection spans over more layout lines.
+ */
+ OString m_aRectangles;
+
+ SearchSelection(int nPage, const OString& rRectangles);
+};
+
/** The main purpose of this class is searching and replacing as well as
spelling of impress documents. The main part of both tasks lies in
iterating over the pages and view modes of a document and apply the
@@ -357,7 +371,7 @@ private:
The return value specifies whether the search ended (</sal_True>) or
another call to this method is required (</sal_False>).
*/
- bool SearchAndReplaceOnce(std::vector<OString>* pSelections = 0);
+ bool SearchAndReplaceOnce(std::vector<SearchSelection>* pSelections = 0);
/** Detect changes of the document or view and react accordingly. Such
changes may occur because different calls to
diff --git a/sd/source/ui/view/Outliner.cxx b/sd/source/ui/view/Outliner.cxx
index 45de02184343..a18b022d0c10 100644
--- a/sd/source/ui/view/Outliner.cxx
+++ b/sd/source/ui/view/Outliner.cxx
@@ -83,6 +83,12 @@ class SfxStyleSheetPool;
namespace sd {
+SearchSelection::SearchSelection(int nPage, const OString& rRectangles)
+ : m_nPage(nPage),
+ m_aRectangles(rRectangles)
+{
+}
+
class Outliner::Implementation
{
public:
@@ -615,7 +621,7 @@ bool Outliner::SearchAndReplaceAll()
// Search/replace until the end of the document is reached.
bool bFoundMatch;
- std::vector<OString> aSelections;
+ std::vector<SearchSelection> aSelections;
do
{
bFoundMatch = ! SearchAndReplaceOnce(&aSelections);
@@ -628,10 +634,10 @@ bool Outliner::SearchAndReplaceAll()
aTree.put("searchString", mpSearchItem->GetSearchString().toUtf8().getStr());
boost::property_tree::ptree aChildren;
- for (const OString& rSelection : aSelections)
+ for (const SearchSelection& rSelection : aSelections)
{
boost::property_tree::ptree aChild;
- aChild.put("", rSelection.getStr());
+ aChild.put("", rSelection.m_aRectangles.getStr());
aChildren.push_back(std::make_pair("", aChild));
}
aTree.add_child("searchResultSelection", aChildren);
@@ -649,7 +655,7 @@ bool Outliner::SearchAndReplaceAll()
return true;
}
-bool Outliner::SearchAndReplaceOnce(std::vector<OString>* pSelections)
+bool Outliner::SearchAndReplaceOnce(std::vector<SearchSelection>* pSelections)
{
DetectChange ();
@@ -769,7 +775,7 @@ bool Outliner::SearchAndReplaceOnce(std::vector<OString>* pSelections)
}
else
{
- pSelections->push_back(sRectangles);
+ pSelections->push_back(SearchSelection(maCurrentPosition.mnPageIndex, sRectangles));
}
}