Issue 68878 - XSelectionChangeListener doesn't receive all selection change events
Summary: XSelectionChangeListener doesn't receive all selection change events
Status: CONFIRMED
Alias: None
Product: Writer
Classification: Application
Component: code (show other issues)
Version: OOo 2.0.1
Hardware: All All
: P3 Trivial with 2 votes (vote)
Target Milestone: ---
Assignee: AOO issues mailing list
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-08-23 10:29 UTC by helloworld82
Modified: 2017-05-20 10:44 UTC (History)
7 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description helloworld82 2006-08-23 10:29:55 UTC
First: I found this bug then using StarOffice8. I have no possibility to test it
against OpenOffice.org, for reason which doesn't belong in this bug report. I
submit it here because I think, this bug certainly also exist in OpenOffice.org.

I want to receive events every time a user moves the XTextViewCursor.

The matter is: "selectionChanged()" isn't called then the user moves the
XTextViewCursor left and right with the arrow keys or then he enters new text
inside the text document.

Steps to reproduce my observation:
1) implements a XSelectionChangeListener and register it against the
XTextViewCursorSupplier
2) start StarOffice writer. Use the key "left arrow" and "right arrow" to
navigate inside the Text, or enter new text in the StarOffice Writer.

The method “selectionChanged()” doesn't get called.

As a side remark, "selectionChanged()" gets  called then a user either clicks
somewhere in the document with his mouse or then he moves the XTextViewCursor up
and down with the arrow keys. (so in this case, it works well). 


Code:

OOoBean bean = new OOoBean();
OfficeDocument doc = bean.getDocument();
XController currentDesktopController = doc.getCurrentController();

XTextViewCursorSupplier xTextViewCursorSupplier = (XTextViewCursorSupplier)
UnoRuntime.queryInterface(XTextViewCursorSupplier.class,currentDesktopController);

XSelectionSupplier xSelectionSupplier = (XSelectionSupplier)
UnoRuntime.queryInterface(XSelectionSupplier.class,xTextViewCursorSupplier);

xSelectionSupplier.addSelectionChangeListener(new SelectionChangeListener());
Comment 1 michael.ruess 2006-08-23 10:40:52 UTC
Reassigned to API component.
Comment 2 mux2005 2006-08-24 09:07:23 UTC
I can reproduce this problem under OOo 2.0.2 under Linux.
Comment 3 jsc 2006-08-29 08:21:16 UTC
jsc -> os: as discussed offline, this would be an enhancement and of course a
changed implementation because we will get more notifications as today. Please
check.
Comment 4 helloworld82 2006-08-29 10:43:34 UTC
I don't really agree with the argument that this should be an enhancement, since
in the idl documentation is written:
selectionChanged: is called when the selection changes

Obviously, then I use the left key and the right keys to navigate in the text,
the selection changes since the position of the XViewCursor changes. The same
arguments holds then I enter normal text in OpenOffice Writer. Every time the
XViewCursor changes its position, selectionChanged() should be called according
to the documentation.

This is not the right behavior according to the idl behavior - so either the
documentation should be changed into "XSelectionChanged receives events every
time a user navigates the text using up and down arrow button or clicks
somewhere with the mouse" or the implementation of that event listener should be
changed.
Comment 5 jsc 2006-08-29 12:53:41 UTC
you are right, my comment was to fast, it's no enhancement it's a bug
Comment 6 Oliver Specht 2006-08-29 13:12:13 UTC
Component changed to Word processor, OS changed to All
Comment 7 helloworld82 2007-06-07 14:40:49 UTC
What is the status of this bug?  Does someone work on it? 
If not, it would perhaps make sense to change the status of it to "new".
Comment 8 Oliver Specht 2007-06-07 15:56:24 UTC
->danielbeck: The target is 2.x so nobody is currently working on it. 
The status cannot be changed to New without reassigning. Started means that I've
accepted that this issue is valid and that I'm the correct owner right now. It's
weird but it's the way the issue tracker works.
Comment 9 Mathias_Bauer 2007-12-04 09:52:58 UTC
target 3.0
Comment 10 Oliver Specht 2008-05-22 13:59:09 UTC
->fme: The notification is sent after the SwCrsrShell called the aChgLnk. This
is not called if no attribute change happens. 
Any chance to get a notificatin also if the cursor is only moved?
Comment 11 frank.meies 2008-05-22 14:59:37 UTC
Due to restricted resources, I have to change the target to 3.x.
Comment 12 Mathias_Bauer 2010-05-17 20:39:59 UTC
please take over from fme
Comment 13 openofficebugs 2015-05-04 15:08:21 UTC
I just ran into this problem on OpenOffice 4.0.1 using Windows.  This is a serious problem for my project and it seems to have been unaddressed for nearly 10 years!
Comment 14 Marcus 2017-05-20 10:44:47 UTC
Reset the assignee to the default "issues@openoffice.apache.org".