diff options
author | Justin Luth <justin_luth@sil.org> | 2022-02-02 10:44:23 +0200 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2022-02-14 11:00:06 +0100 |
commit | bf82200e061c82703354cf166877761c3c90e50b (patch) | |
tree | 01ef0efae8374b5b54a9448c71157bcf1c3f5c44 /include/svl | |
parent | 764b4d6efd986956a760f20b03993a3591f76bff (diff) |
tdf#145868 sd replace: if search changes, restart find/replace
REPLACE is really a replaceAndFind instead of a findAndReplace.
Thus, when you changed your search parameter and did a replace,
it replaced the previously searched for item, and then found the
first instance of the new search parameter.
That of course is just wrong.
So make sure to verify that the previous search
matches the current search competely.
However, that doesn't mean that the entire searchItem matches,
since we don't want to restart the search just
because the replace parameter changed.
In my testing, this wasn't an issue for REPLACE_ALL.
So the only time we need to worry about the last search
result is in a replace once situation.
P.S. This commit exposed that mpSearchItem can point
to a destructed SvxSearchItem, so this patches unit test
will crash if the other 7.4 commit is missing.
Change-Id: I7be14d64534018718145c6ac5f8629ff5f2e5611
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129385
Tested-by: Jenkins
Reviewed-by: Justin Luth <jluth@mail.com>
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Signed-off-by: Xisco Fauli <xiscofauli@libreoffice.org>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129630
Diffstat (limited to 'include/svl')
-rw-r--r-- | include/svl/srchitem.hxx | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/svl/srchitem.hxx b/include/svl/srchitem.hxx index c7f7381f77c6..7aa403211ed6 100644 --- a/include/svl/srchitem.hxx +++ b/include/svl/srchitem.hxx @@ -108,6 +108,9 @@ public: // ConfigItem virtual void Notify( const css::uno::Sequence< OUString > &rPropertyNames ) override; + bool equalsIgnoring(const SvxSearchItem& rSItem, bool bIgnoreReplace, + bool bIgnoreCommand) const; + SvxSearchCmd GetCommand() const { return m_nCommand; } void SetCommand(SvxSearchCmd nNewCommand) { m_nCommand = nNewCommand; } |