• Miklos Vajna's avatar
    tdf#115873 sd navigator: allow selecting but not focusing on objects · f3c68cdf
    Miklos Vajna yazdı
    There were also two cases here:
    
    - changing the selection with the keyboard or single-click only updated
      the selection in the navigator
    - pressing enter or double-click also selected the shape in the main
      window and gave the focus away
    
    Introduce a 3rd case for single-click: update the shape selection but
    doesn't give the focus away. This way double-click is not needed to sync
    navigator -> main doc selection but keyboard navigation should still
    work.
    
    An additional trick is to make sure that the current shell is the draw
    shell (and not the slide sorter) after navigation, so follow-up
    operations work with the selected object and not with the whole slide.
    
    Finally, a third related problem was that the selection jumped back to
    the item of the slide after clicking on a shape in the navigator. The
    reason for this was the navigator list was constantly cleared and
    re-filled in SdNavigatorWin::InitTreeLB(), as
    SdPageObjsTLB::IsEqualToDoc() returned false (even if the list was up to
    date) in case of shapes which had children but no name. Fix this by
    using the same SdrIterMode::Flat iteration mode that
    SdPageObjsTLB::AddShapeList() does, so the fill and the equality check
    of the navigator iterates the same way.
    
    Change-Id: I0bfc3e8b49f7ef01d5797a68284616dcd2a81c5d
    Reviewed-on: https://gerrit.libreoffice.org/50118Reviewed-by: 's avatarMiklos Vajna <vmiklos@collabora.co.uk>
    Tested-by: 's avatarJenkins <ci@libreoffice.org>
    f3c68cdf
sdtreelb.cxx 43.9 KB