diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-10-15 15:03:46 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-10-15 15:03:46 +0200 |
commit | aa8f218079e2d311927d8aaf64b03b234453fb11 (patch) | |
tree | 4071b10f1d1481196e9c4ed565decb7b79b4b4a9 | |
parent | c58533fe4ada618eb6121d27362f7f540f26c3c0 (diff) |
sd search: restore start selection if nothing was found
For one, if sd::Outliner::RememberStartPosition() cares about storing
the current selection in the DrawViewShell case in maStartSelection,
then sd::Outliner::RestoreStartPosition() should probably restore it.
For another, sd::Outliner::StartSearchAndReplace() returned true in the
"nothing was found" case, which restarted the spellchecking, which
killed the selection. If the selection has been restored already, then
at least don't kill it in the find case: find is read-only, so no need
to restart the spellchecker.
Change-Id: Idd886d449a9cfb164887fc6b1fde27b5e63e272b
-rw-r--r-- | sd/source/ui/view/Outliner.cxx | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/sd/source/ui/view/Outliner.cxx b/sd/source/ui/view/Outliner.cxx index f51c91f62995..263ea6f92d5e 100644 --- a/sd/source/ui/view/Outliner.cxx +++ b/sd/source/ui/view/Outliner.cxx @@ -498,7 +498,12 @@ bool Outliner::StartSearchAndReplace (const SvxSearchItem* pSearchItem) bEndOfSearch = SearchAndReplaceOnce (); // restore start position if nothing was found if(!mbStringFound) + { RestoreStartPosition (); + // Nothing was changed, no need to restart the spellchecker. + if (nCommand == SvxSearchCmd::FIND) + bEndOfSearch = false; + } mnStartPageIndex = (sal_uInt16)-1; } @@ -956,7 +961,17 @@ void Outliner::RestoreStartPosition() std::dynamic_pointer_cast<DrawViewShell>(pViewShell)); SetViewMode (meStartViewMode); if (pDrawViewShell.get() != NULL) + { SetPage (meStartEditMode, mnStartPageIndex); + mpObj = mpStartEditedObject; + if (mpObj) + { + PutTextIntoOutliner(); + EnterEditMode(false); + if (OutlinerView* pOutlinerView = mpImpl->GetOutlinerView()) + pOutlinerView->SetSelection(maStartSelection); + } + } } else if( 0 != dynamic_cast< const OutlineViewShell *>( pViewShell.get() )) { |