[Libreoffice-commits] core.git: sd/source

Miklos Vajna vmiklos at collabora.co.uk
Thu Oct 15 06:04:59 PDT 2015


 sd/source/ui/view/Outliner.cxx |   15 +++++++++++++++
 1 file changed, 15 insertions(+)

New commits:
commit aa8f218079e2d311927d8aaf64b03b234453fb11
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Thu Oct 15 15:03:46 2015 +0200

    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

diff --git a/sd/source/ui/view/Outliner.cxx b/sd/source/ui/view/Outliner.cxx
index f51c91f..263ea6f 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() ))
         {


More information about the Libreoffice-commits mailing list