Issue 122354 - [sidebar] In slide sorter travers with arrow key is one off in layout style
[sidebar] In slide sorter travers with arrow key is one off in layout style
Status: RESOLVED FIXED
Product: Impress
Classification: Application
Component: code
4.0.0-dev
PC Windows 7
: P3 normal (vote)
: 4.0.0
Assigned To: Andre
:
Depends on:
Blocks: [sidebar]
  Show dependency treegraph
 
Reported: 2013-05-21 13:34 UTC by Regina Henschel
Modified: 2013-07-11 14:41 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation on: ---
Developer Difficulty: ---


Attachments
presentation with nine layouts applies (734.29 KB, application/vnd.oasis.opendocument.presentation)
2013-05-21 13:34 UTC, Regina Henschel
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
Description Regina Henschel 2013-05-21 13:34:57 UTC
Created attachment 80714 [details]
presentation with nine layouts applies

Open attached presentation. It has assigned layout 1 to slide 1, layout 2 to slide 2, and so on.

Switch to slide sorter view.

Click one slide after the other with the mouse and watch that the assigned layout is selected in the properties desk.

Now click with mouse on first slide and then traverse the slides using the arrow right key. Notice, that the selected layout has an offset of 1. It does not show the layout of the actual slide, but the layout of the previous slide.

Click on last slide with the mouse and then traverse back using the arrow left key. Notice, that again the selected layout has an offset of 1.
Comment 1 Andre 2013-05-21 15:54:39 UTC
When the current slide is changed via keys in the slide sorter view (as opposed to the slide sorter bar) then the slide change is not broadcast properly.  When the current slide is changed via mouse then this works as expected.

Reason for this is lies in the way the slide change is notified:

- There are events for change in the slide sorter selection.  The time at which the modified selection is notified differs between keyboard and mouse processing. For keyboard events the selection is broadcast before the current slide is changed, for mouse event the broadcast takes place after the current slide changed.

- The current slide is also set as property at the XController.  However, the slide sorter view has no real concept of a current slide and therefore the "CurrentPage" property does not exist for the SdUnoSlideView sub controller.  The SdUnoDrawView does have this property, which is the reason why the bug is only reproducible in the slide sorter view.

This can be fixed in two ways:

1. Add the "CurrentPage" property to the SdUnoSlideView sub controller.  The slide sorter keeps track of the current slide anyway, so that could be exposed to the controller as well.

2. Notify the selection change of the slide sorter after the current slide has been changed when the selection change is triggered by key events.
Comment 2 Andre 2013-05-22 12:24:36 UTC
Added a BroadcastLock to SelectionFunction::KeyInput() to prevent notification of selection change while current slide is not yet updated.  Processing of mouse events already used a BroadcastLock and therefore did not have the problem described above.
Comment 3 SVN Robot 2013-05-22 12:25:50 UTC
"af" committed SVN revision 1485181 into trunk:
i122354: Fix notification of slide change when caused by slide sorter key event.
Comment 4 edoardopanfili 2013-07-06 14:05:59 UTC
tsted on
AOO400m2(Build:9701)  -  Rev. 1496831
2013-06-25 15:52:47 (Tue, 25 Jun 2013)
and on Win 8
AOO400m3(Build:9702)  -  Rev. 1499347
2013-07-03 15:11:47 (Mi, 03 Jul 2013)

works fine except one thing: slide 1 is not recognised as layout 1 ("blank slide" ), "layout 2" is evidenced. 
If I assign layout 1 then all works correctly.

I did a try with another presentation (do not works):
-create a new presentation: 3 slides: layout 1, layout 2, layout 3
-save and close
-open the presentation 
-click on first slide: the layout evidenced is layout 2

another test (this one works)
-create a new presentation: 3 slides: layout 2, layout 1, layout 3
-save and close
-open the presentation 
-click on second slide: the layout evidenced is layout 1 as expected
Comment 5 Andre 2013-07-08 08:50:25 UTC
The remaining problems does not seem to have its origin in the layout panel of the sidebar.  I debugged setting and retrieving the layout value at/from the page and everything looks as it should, except that after loading I see the wrong layout value for slide 1 (when using document: "3 slides: layout 1, layout 2, layout 3").  Maybe this goes wrong when the document is saved or loaded.