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

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
üst c58533fe
......@@ -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() ))
{
......
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