Kaydet (Commit) 3eefa774 authored tarafından Miklos Vajna's avatar Miklos Vajna

sd tiled rendering: search rectangle is part-specific

Change-Id: I88865db539779bc401550d7b4a3729b89d7e18b1
(cherry picked from commit dd1fc224)
üst 6ed1d969
......@@ -41,6 +41,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
......@@ -364,7 +378,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
......
......@@ -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:
......@@ -621,7 +627,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);
......@@ -634,10 +640,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);
......@@ -655,7 +661,7 @@ bool Outliner::SearchAndReplaceAll()
return true;
}
bool Outliner::SearchAndReplaceOnce(std::vector<OString>* pSelections)
bool Outliner::SearchAndReplaceOnce(std::vector<SearchSelection>* pSelections)
{
DetectChange ();
......@@ -775,7 +781,7 @@ bool Outliner::SearchAndReplaceOnce(std::vector<OString>* pSelections)
}
else
{
pSelections->push_back(sRectangles);
pSelections->push_back(SearchSelection(maCurrentPosition.mnPageIndex, sRectangles));
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment