Issue 100764 - Selecting lines in the beamer blocks event execution on dialog buttons
Summary: Selecting lines in the beamer blocks event execution on dialog buttons
Alias: None
Product: Writer
Classification: Application
Component: ui (show other issues)
Version: OOO310m8
Hardware: All All
: P3 Trivial (vote)
Target Milestone: ---
Assignee: marc.neumann
QA Contact: issues@sw
Depends on:
Blocks: 99999
  Show dependency tree
Reported: 2009-04-01 19:46 UTC by sos
Modified: 2017-05-20 11:41 UTC (History)
4 users (show)

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

File demonstrating Beamer slection blocking event execution in dialogs (27.50 KB, application/vnd.oasis.opendocument.text)
2009-04-01 19:49 UTC, sos
no flags Details
Document with Non-modal dialog blocked by beamer (25.16 KB, application/vnd.oasis.opendocument.text)
2009-04-02 09:01 UTC, sos
no flags Details
A demo with a simple dialog (15.23 KB, application/vnd.oasis.opendocument.text)
2009-11-05 07:21 UTC, bmarcelly
no flags Details
suggested patch (3.05 KB, patch)
2009-11-05 09:10 UTC, Frank Schönheit
no flags Details | Diff
Document to test event binding in document dialogs (11.76 KB, application/vnd.oasis.opendocument.text)
2009-11-13 14:03 UTC, ab
no flags Details
Extension containing a Basic and dialog library to test event binding (1.81 KB, application/vnd.openofficeorg.extension)
2009-11-13 14:09 UTC, ab
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
Description sos 2009-04-01 19:46:58 UTC
When selecting some lines (more than one line) in the beamer then “events†
(macro) are no longer called when a dialog button is pressed.
This bahavior was not there under 2,4
I attach a WriterDoc to demonstrate te behavior
Comment 1 sos 2009-04-01 19:49:17 UTC
Created attachment 61344 [details]
File demonstrating Beamer slection blocking event execution in dialogs
Comment 2 eric.savary 2009-04-01 22:53:26 UTC
Reassigned to JSK
Comment 3 sos 2009-04-02 08:56:58 UTC
Here we have a serious problem. ALL custom dialogs are blocked when the beamer 
is opened en the users select and deselect some lines !!
also Non-modal dialogs are infected
see new attachement with a non-modal dialog
Comment 4 sos 2009-04-02 09:01:07 UTC
Created attachment 61353 [details]
Document with Non-modal dialog blocked by beamer
Comment 5 sos 2009-04-09 08:13:30 UTC
could be a duplicate of 100956 
Comment 6 Frank Schönheit 2009-04-09 10:16:23 UTC
cannot reproduce in OOO310.m9. No matter what I try, the send mail button always
works (i.e. raises a message box).
Comment 7 sos 2009-04-09 14:58:54 UTC
I di some more testing witht the RC 3.1 (m9)
and have still the same problem
Frank, Drew did you trie select more than one line in the beamer ?

so I open the beamer > open the dialog > events works
close the dialog
slect one line in the beamer
open the dialog > events still works
close the dialog
select more lines in the beamer leaving the first one slected
open the dialog > events do not works anymore
close the dialog
close te beamer
open the beamer
open the dialog > events works again

Comment 8 Frank Schönheit 2009-04-10 20:14:00 UTC
I also tried selecting multiple lines, to no avail - the macro in the dialog
seems to work all the time.
Comment 9 Frank Schönheit 2009-11-05 07:06:11 UTC
triggered by your recent post in dev@api I tried this again ... and I am
*sometimes* able to reproduce it. Estimated 1 out of 5 cases, or so. I did not
find a pattern when this does/not happen, but will continue trying. Perhaps I
can reproduce it inside a debugger.
Comment 10 bmarcelly 2009-11-05 07:20:07 UTC
I can reproduce the bug with a very simple dialog (next attachment).
It only happens if the dialog macro is run from a toolbar or from menu Tools > Macros.
Hope this helps.
Comment 11 bmarcelly 2009-11-05 07:21:36 UTC
Created attachment 65938 [details]
A demo with a simple dialog
Comment 12 Frank Schönheit 2009-11-05 08:07:16 UTC
This has nothing to do with selected lines. For instance, I seem to be able to
reliably reproduce the problem by doing the following:
- press F4 to open the beamer
- with the mouse, click into an arbitrary table cell
- click into the Writer document
- click into *the same* table cell
=> now if you use the SEND MAIL button in the toolbar to open the dialog,
   the buttons therein don't work.

This looks like an unfortunate combination of multiple problems, but I need
further investigations on it.

fs->sos: I think I could fix this, though I am not yet sure whether this is
primarily a Base or Basic or framework problem. Anyway, I suppose you might want
to have this for 3.2. In this case, it's yours to speak up in releases@ooo.
Though it might still be possible the fix is too risky or difficult for 3.2 ...
Comment 13 Frank Schönheit 2009-11-05 09:09:42 UTC
fs->ab: That's a combination of two problems, one of them lies in Basic, and I'd
like to get your opinion on this one ...

Beforehand, to the anatomy of the bug: The macro is not executed because the
event attacher for the dialog (an DialogEventsAttacherImpl) is constructed with
a NULL model. Thus, when it is asked to execute a document-local macro, it
cannot do this, since it does not known the document.

Now this NULL model originates from getModelFromBasic in
basic/source/classes/eventatt.cxx. What's passed into this function is the
StarBASIC instance for the "MailMerge" library in the document. The function
examines the *parent of the parent* of the given StarBASIC for a ThisComponent
variable. Unfortunately, this is the *application Basic*, not the document Basic
anymore. And ThisComponent in the application Basic, at this point in time, is
not the Writer document, but the Beamer component (more on this below).

What I think is the bug here is that getModelFromBasic asks the parent's parent,
instead of walking up the ancestor chain. That is, if the parent already has a
ThisComponent variable, then this one should be taken. Only if it hasn't, then
it should go to the parent's parent (and perhaps further).

Doing this fixes the bug. I *think* it is a proper fix, but would like to get
your opinion on that.
Comment 14 Frank Schönheit 2009-11-05 09:10:38 UTC
Created attachment 65939 [details]
suggested patch
Comment 15 Frank Schönheit 2009-11-05 09:14:32 UTC
Now for the second problem: The fact that the beamer (aka DataSourceBrowser
displayed in the beamer) registers itself as "ThisComponent" in the
application-wide Basic:
This another bug, whose fixing would also fix the problem here. There is code in
there which should prevent the ThisComponent registration if the
DataSourceBrowser does not live in a top level window, however, obviously this
code doesn't work sufficiently. I'll investigate this on a separate track.
Comment 16 Frank Schönheit 2009-11-05 10:56:00 UTC
I committed a fix to the second part of the problem (the beamer registering
itself as ThisComponent in the global Application Basic) to CWS dba33b. So,
strictly, the bug is fixed.

fs->ab: Despite the bug fixing fixed on dbaccess side, I think the problem in
Basic should be fixed, too, so I leave the issue open for the moment, until you
find time to review the patch.

fs->sos: Please tell me whether or not you intend to nominate this issue as
3.2-blocker in Personally, I am somewhat undecided. You
are the one having strong arguments (namely the OOo-based applications in your
company which are broken by this bug), so I think you should be the one to
nominate the issue, if anybody at all.
Comment 17 sos 2009-11-05 11:09:16 UTC
First of all thanks for the fix
Honestly, for the moment I fixed the most urgent problems here by replacing the 
events by a listener. But we have still a lot of applications where the user 
can or cannot open a Beamer...
So if its OK for you I make it a 3.2 stopper (i am back in office tomorrow) 
Comment 18 Frank Schönheit 2009-11-05 11:19:57 UTC
That'd be fine with me.
Comment 19 Olaf Felka 2009-11-06 10:58:40 UTC
After some discuss, accepted as 3.2 stopper.
Comment 20 sos 2009-11-06 11:34:24 UTC
From me (who saves a lot of time) and all our users : thanks !
Comment 21 uwe.luebbers 2009-11-12 15:41:36 UTC
3.2 stopper issue, adjusted target
Comment 22 Frank Schönheit 2009-11-13 10:13:38 UTC
dbaccess-part of the fix committed to CWS dba32j
Comment 23 Frank Schönheit 2009-11-13 13:10:41 UTC
committed the Basic part (after removing one assertion) to CWS dba32j, too, with
AB's approval.
Comment 24 ab 2009-11-13 14:03:21 UTC
Created attachment 66102 [details]
Document to test event binding in document dialogs
Comment 25 ab 2009-11-13 14:09:30 UTC
Created attachment 66103 [details]
Extension containing a Basic and dialog library to test event binding
Comment 26 ab 2009-11-13 14:13:04 UTC
The attachments contain dialogs to test the event binding.
Each dialog can be executed with the main macro contained
in the same library and clicking the buttons should call the
appropriate macros.
Comment 27 Frank Schönheit 2009-11-18 08:52:12 UTC
fs->misheto: please verify in CWS dba32j
Comment 28 Frank Schönheit 2009-11-18 09:01:09 UTC
fs->msc: please verify in CWS dba32j
Comment 29 marc.neumann 2009-11-24 08:42:06 UTC
verified in cws dba32j