summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
Diffstat (limited to 'sd')
-rw-r--r--sd/qa/uitest/findReplace/findReplace.py7
-rw-r--r--sd/source/ui/view/Outliner.cxx12
2 files changed, 15 insertions, 4 deletions
diff --git a/sd/qa/uitest/findReplace/findReplace.py b/sd/qa/uitest/findReplace/findReplace.py
index f33dd44d40ce..0e4bd4c12f73 100644
--- a/sd/qa/uitest/findReplace/findReplace.py
+++ b/sd/qa/uitest/findReplace/findReplace.py
@@ -85,8 +85,8 @@ class findReplace(UITestCase):
self.assertEqual("Replace first first", impress_doc.DrawPages[0].getByIndex(1).String)
self.assertEqual("second", impress_doc.DrawPages[1].getByIndex(1).String)
- # FIXME: tdf#145868
- self.assertEqual("Replace", impress_doc.DrawPages[2].getByIndex(1).String)
+ # tdf#145868 - Third was search for earlier, but never should have been replaced
+ self.assertEqual("Third", impress_doc.DrawPages[2].getByIndex(1).String)
self.assertEqual("Text size 16", impress_doc.DrawPages[3].getByIndex(1).String)
replaceterm = xDialog.getChild("replaceterm")
@@ -102,8 +102,7 @@ class findReplace(UITestCase):
# AssertionError: 'Replace aaa aaa' != 'Replace first first'
self.assertEqual("Replace aaa aaa", impress_doc.DrawPages[0].getByIndex(1).String)
self.assertEqual("second", impress_doc.DrawPages[1].getByIndex(1).String)
- # FIXME: tdf#145868
- self.assertEqual("Replace", impress_doc.DrawPages[2].getByIndex(1).String)
+ self.assertEqual("Third", impress_doc.DrawPages[2].getByIndex(1).String)
self.assertEqual("Text size 16", impress_doc.DrawPages[3].getByIndex(1).String)
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sd/source/ui/view/Outliner.cxx b/sd/source/ui/view/Outliner.cxx
index e03b56bf1a3d..342b01b050dc 100644
--- a/sd/source/ui/view/Outliner.cxx
+++ b/sd/source/ui/view/Outliner.cxx
@@ -425,6 +425,18 @@ bool SdOutliner::StartSearchAndReplace (const SvxSearchItem* pSearchItem)
SvxSearchDialogWrapper::SetSearchLabel(SearchLabel::Empty);
mpDrawDocument->GetDocSh()->SetWaitCursor( true );
+
+ // Since REPLACE is really a replaceAndSearchNext instead of a searchAndReplace,
+ // make sure that the search portion has not changed since the last FIND.
+ if (!mbPrepareSpellingPending && mpSearchItem
+ && pSearchItem->GetCommand() == SvxSearchCmd::REPLACE
+ && !mpSearchItem->equalsIgnoring(*pSearchItem, /*bIgnoreReplace=*/true,
+ /*bIgnoreCommand=*/true))
+ {
+ EndSpelling();
+ mbPrepareSpellingPending = true;
+ }
+
if (mbPrepareSpellingPending)
PrepareSpelling();
sd::ViewShellBase* pBase = getViewShellBase();