[Libreoffice-commits] core.git: 2 commits - sd/inc sd/source
Caolán McNamara
caolanm at redhat.com
Tue Jul 12 14:01:43 UTC 2016
sd/inc/Outliner.hxx | 5 +++++
sd/source/ui/view/Outliner.cxx | 7 ++++---
2 files changed, 9 insertions(+), 3 deletions(-)
New commits:
commit a563758746a6cd3900c88928c115275229617ed0
Author: Caolán McNamara <caolanm at redhat.com>
Date: Tue Jul 12 14:57:42 2016 +0100
Resolves: tdf#100861 replace all doesn't work
Revert "lool - search all - unit test failure - solved"
This reverts commit d6f1ca24932ba85607ba3e526c5721132cd39252.
Change-Id: I328ece1029955ff9f4e5043084d649898e3e8809
diff --git a/sd/source/ui/view/Outliner.cxx b/sd/source/ui/view/Outliner.cxx
index a9fc0a9..ad22672 100644
--- a/sd/source/ui/view/Outliner.cxx
+++ b/sd/source/ui/view/Outliner.cxx
@@ -593,8 +593,6 @@ void Outliner::Initialize (bool bDirectionIsForward)
bool Outliner::SearchAndReplaceAll()
{
- DetectChange();
-
bool bRet = true;
// Save the current position to be restored after having replaced all
// matches.
commit 0e149c017d3ecd9523492bcc05d44d39746a4131
Author: Caolán McNamara <caolanm at redhat.com>
Date: Tue Jul 12 14:40:09 2016 +0100
Related: tdf#100861 same selection recorded multiple times...
in FindAll libreofficekit impress test
on find all we loop through the textboxes searching for the string.
We start by searching into the first textbox with the string in it.
mbStringFound gets set to true and this first selection is reported.
Now the current pos is still in that textbox at the end of the string.
The next loop will find nothing in this textbox, but because mbStringFound
was set in the earlier pass, the same selection gets reported again.
The next loop will move to the next textbox.
To keep this fix as simple as possible just check if the selection was
the previously reported one and skip it if it is.
I believe this is the problem that
commit d6f1ca24932ba85607ba3e526c5721132cd39252
Author: Marco Cecchetti <marco.cecchetti at collabora.com>
Date: Mon Jan 11 16:43:02 2016 +0100
lool - search all - unit test failure - solved
wanted to solve
Change-Id: I30e7b9c581488b48fa27f138209f291063b459a3
diff --git a/sd/inc/Outliner.hxx b/sd/inc/Outliner.hxx
index 3c7296a..b0a2192 100644
--- a/sd/inc/Outliner.hxx
+++ b/sd/inc/Outliner.hxx
@@ -50,6 +50,11 @@ struct SearchSelection
OString m_aRectangles;
SearchSelection(int nPage, const OString& rRectangles);
+
+ bool operator==(const SearchSelection& rOther) const
+ {
+ return m_nPage == rOther.m_nPage && m_aRectangles == rOther.m_aRectangles;
+ }
};
/** The main purpose of this class is searching and replacing as well as
diff --git a/sd/source/ui/view/Outliner.cxx b/sd/source/ui/view/Outliner.cxx
index c1ac3ce..a9fc0a9 100644
--- a/sd/source/ui/view/Outliner.cxx
+++ b/sd/source/ui/view/Outliner.cxx
@@ -826,7 +826,10 @@ bool Outliner::SearchAndReplaceOnce(std::vector<SearchSelection>* pSelections)
}
else
{
- pSelections->push_back(SearchSelection(maCurrentPosition.mnPageIndex, sRectangles));
+ SearchSelection aSelection(maCurrentPosition.mnPageIndex, sRectangles);
+ bool bDuplicate = !pSelections->empty() && pSelections->back() == aSelection;
+ if (!bDuplicate)
+ pSelections->push_back(aSelection);
}
}
More information about the Libreoffice-commits
mailing list