After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 382890 - Extend dynamic row and column header support to OOo Writer tables
Extend dynamic row and column header support to OOo Writer tables
Status: RESOLVED FIXED
Product: orca
Classification: Applications
Component: general
2.17.x
Other All
: Normal enhancement
: FUTURE
Assigned To: Orca Maintainers
Orca Maintainers
Depends on:
Blocks:
 
 
Reported: 2006-12-06 04:37 UTC by Joanmarie Diggs (IRC: joanie)
Modified: 2007-01-02 20:54 UTC
See Also:
GNOME target: ---
GNOME version: Unversioned Enhancement


Attachments
Patch to hopefully implement this feature. (11.87 KB, patch)
2006-12-18 19:09 UTC, Rich Burridge
none Details | Review
simple sample table (8.43 KB, application/vnd.oasis.opendocument.text)
2006-12-18 20:31 UTC, Joanmarie Diggs (IRC: joanie)
  Details
Orca debug output for the second problem. (25.29 KB, text/plain)
2006-12-18 22:30 UTC, Rich Burridge
  Details
debug.out related to the first problem (87.74 KB, text/plain)
2006-12-19 00:54 UTC, Joanmarie Diggs (IRC: joanie)
  Details
New revision of the patch. (12.90 KB, patch)
2006-12-19 15:29 UTC, Rich Burridge
none Details | Review

Description Joanmarie Diggs (IRC: joanie) 2006-12-06 04:37:05 UTC
The dynamic row and column header support added to Calc documents (http://bugzilla.gnome.org/show_bug.cgi?id=361167) is REALLY handy.  If it wouldn't be too difficult, could this functionality be extended to work in OOo Writer tables?

Thanks!!
Comment 1 Rich Burridge 2006-12-18 19:09:50 UTC
Created attachment 78588 [details] [review]
Patch to hopefully implement this feature.

And not break anything else. ;-)

I've NOT checked it into CVS HEAD yet. 
Joanie, could you give it a try out 
please?

Thanks.
Comment 2 Joanmarie Diggs (IRC: joanie) 2006-12-18 20:31:25 UTC
Created attachment 78592 [details]
simple sample table

I've found a couple of oddities.  I could not always reproduce them in sample-table.odt, so I've attached apples-oranges.odt. 

Test 1:
1. Launch Orca
2. Open apples-oranges.odt
3. Down arrow to cell a1
4. Press Insert R (nothing spoken)
5. Press Insert C (nothing spoken)
6. Arrow around to see if headers got assigned anyway (they did not)

Test 2:
1. Launch Orca
2. Open apples-oranges.odt
3. Down arrow to cell a1
4. Right arrow to cell b1
5. Press Insert R (Orca reports col headers are set to row 1 as expected)
6. Left arrow to cell a1
7. Press Insert C (Orca reports row headers are set to col b rather than col a)
Comment 3 Rich Burridge 2006-12-18 22:05:56 UTC
Thanks Joanie. I'll have a look at these. 
Comment 4 Rich Burridge 2006-12-18 22:19:56 UTC
The first problem is caused because when you arrow down from the 
initial line, you don't actually end up with focus in the table.
You'll notice that you don't hear the "table with 3 rows and 3 columns"
either. The accessible component hierarchy at this point is:

+-name='soffice.bin' role='application' state='' relations=''
  +-name='apples-oranges - OpenOffice.org Writer' role='frame' state='ACTIVE ENABLED RESIZABLE SENSITIVE SHOWING VISIBLE' relations=''
    +-name='apples-oranges - OpenOffice.org Writer' role='root pane' state='ENABLED SENSITIVE SHOWING VISIBLE' relations=''
      +-name=None role='panel' state='ENABLED SENSITIVE SHOWING VISIBLE' relations=''
        +-name=None role='scroll pane' state='ENABLED SENSITIVE SHOWING VISIBLE' relations=''
          +-name='Document view' role='unknown' state='EDITABLE ENABLED MULTISELECTABLE OPAQUE SHOWING VISIBLE' relations=''
            +-name=None role='paragraph' state='EDITABLE ENABLED FOCUSABLE MULTI_LINE MULTISELECTABLE SHOWING VISIBLE' relations='FLOWS_TO'

If you move left or right, the it picks up that you are in a table,
and <orca modifier>-r and <orca modifier>-c will work.

I'm not sure there is anything we can do here. Will, is it worth filing
YAOOoB?
Comment 5 Rich Burridge 2006-12-18 22:30:00 UTC
Created attachment 78599 [details]
Orca debug output for the second problem.

I've recreated it. It definitely doesn't happen every time.
Investigating...
Comment 6 Joanmarie Diggs (IRC: joanie) 2006-12-18 22:39:47 UTC
Regarding Comment #4, just in case it's relevant....

> You'll notice that you don't hear the "table with 3 rows and 3 columns"

Actually, I do hear that info....
Comment 7 Rich Burridge 2006-12-18 22:48:19 UTC
You can see from line 412 of debug.out, that when I did the
<Orca modifier>-F7, Orca thinks the locus of focus is still
on the B1 cell.

This suggests that the handling of one of the three events:

object:state-changed:focused
object:text-caret-moved
focus:

when moving around in table cells, is still incorrect.

I'll continue to look at this tomorrow.

Will, I'm still looking for a pointer to the documentation 
for what detail1/detail2 means for each event type...
Comment 8 Rich Burridge 2006-12-18 22:48:53 UTC
Re: comment #6:

Well I don't hear it... ;-)
Comment 9 Willie Walker 2006-12-18 23:28:17 UTC
(In reply to comment #7)
> Will, I'm still looking for a pointer to the documentation 
> for what detail1/detail2 means for each event type...

It all depends on the event, of course, and the documentation doesn't really seem to exist.  :-( I've often inferred it by looking at the detail1/detail2 values for various events.  The ultimate source, however, is the coder behind the accessibility implementation.
Comment 10 Willie Walker 2006-12-18 23:31:24 UTC
(In reply to comment #4)
> If you move left or right, the it picks up that you are in a table,
> and <orca modifier>-r and <orca modifier>-c will work.
> 
> I'm not sure there is anything we can do here. Will, is it worth filing
> YAOOoB?

It seems like there might be a bug in OOo for this.  Is the problem that a focus event is not issued when you first arrow into a table?
Comment 11 Joanmarie Diggs (IRC: joanie) 2006-12-19 00:54:55 UTC
Created attachment 78606 [details]
debug.out related to the first problem

If you look at this debug.out, you'll see in line 1082 I down arrowed (from outside of the table into cell A1). In line 1123, there's the resulting object:state-changed:focused event with detail1 == 1. setDynamicColumnHeaders gets called, but doesn't do anything (line 1345).

Rich, in response to comment #8, please see line 1126. ;-) ;-)
Comment 12 Rich Burridge 2006-12-19 01:07:53 UTC
Thanks. I'll get back to it tomorrow. Joanie, if you do want to
take it further tonight, I'd look in setDynamicColumnHeaders().
Maybe do a "util.printAncestry(orca_state.locusOfFocus)" near 
the beginning. My guess is the locus of focus is bogus.

If it is, then this all goes back to comment #7 above. I suspect
we are not processing those three events correctly. i.e. we need to
better understand what detail1 means for all three of them, and
then which of them we need to process.
Comment 13 Joanmarie Diggs (IRC: joanie) 2006-12-19 01:55:00 UTC
Check this out:  In cases where the feature worked as expected, util.printAncestry reports that we're one cell *to the left* of our actual location.  On the non-first-cell entry where it didn't work correctly, printAncestry indicates that we're one cell *above* our actual location.  On the first cell, I can confirm what Rich found in the second part of comment #4 (i.e. not in a table).


Down-Arrowed into A1, didn't work at all.

+-name='soffice.bin' role='application' state='' relations=''
  +-name='apples-oranges - OpenOffice.org Writer' role='frame' state='ACTIVE ENABLED RESIZABLE SENSITIVE SHOWING VISIBLE' relations=''
    +-name='apples-oranges - OpenOffice.org Writer' role='root pane' state='ENABLED SENSITIVE SHOWING VISIBLE' relations=''
      +-name=None role='panel' state='ENABLED SENSITIVE SHOWING VISIBLE' relations=''
        +-name=None role='scroll pane' state='ENABLED SENSITIVE SHOWING VISIBLE' relations=''
          +-name='Document view' role='unknown' state='EDITABLE ENABLED MULTISELECTABLE OPAQUE SHOWING VISIBLE' relations=''
            +-name=None role='paragraph' state='EDITABLE ENABLED FOCUSABLE MULTI_LINE MULTISELECTABLE SHOWING VISIBLE' relations='FLOWS_TO'


Arrowed around and into B1, did work.

+-name='soffice.bin' role='application' state='' relations=''
  +-name='apples-oranges - OpenOffice.org Writer' role='frame' state='ACTIVE ENABLED RESIZABLE SENSITIVE SHOWING VISIBLE' relations=''
    +-name='apples-oranges - OpenOffice.org Writer' role='root pane' state='ENABLED SENSITIVE SHOWING VISIBLE' relations=''
      +-name=None role='panel' state='ENABLED SENSITIVE SHOWING VISIBLE' relations=''
        +-name=None role='scroll pane' state='ENABLED SENSITIVE SHOWING VISIBLE' relations=''
          +-name='Document view' role='unknown' state='EDITABLE ENABLED MULTISELECTABLE OPAQUE SHOWING VISIBLE' relations=''
            +-name='Table1-1' role='table' state='EDITABLE ENABLED MULTISELECTABLE SHOWING VISIBLE' relations=''
              +-name='A1' role='table cell' state='EDITABLE ENABLED SELECTABLE SHOWING VISIBLE' relations=''
                +-name=None role='paragraph' state='EDITABLE ENABLED FOCUSABLE MULTI_LINE MULTISELECTABLE SHOWING VISIBLE' relations='FLOWS_FROM FLOWS_TO'



Arrowed around and into B2, Orca set the column headers to row 1.

+-name='soffice.bin' role='application' state='' relations=''
  +-name='apples-oranges - OpenOffice.org Writer' role='frame' state='ACTIVE ENABLED RESIZABLE SENSITIVE SHOWING VISIBLE' relations=''
    +-name='apples-oranges - OpenOffice.org Writer' role='root pane' state='ENABLED SENSITIVE SHOWING VISIBLE' relations=''
      +-name=None role='panel' state='ENABLED SENSITIVE SHOWING VISIBLE' relations=''
        +-name=None role='scroll pane' state='ENABLED SENSITIVE SHOWING VISIBLE' relations=''
          +-name='Document view' role='unknown' state='EDITABLE ENABLED MULTISELECTABLE OPAQUE SHOWING VISIBLE' relations=''
            +-name='Table1-1' role='table' state='EDITABLE ENABLED MULTISELECTABLE SHOWING VISIBLE' relations=''
              +-name='B1' role='table cell' state='EDITABLE ENABLED SELECTABLE SHOWING VISIBLE' relations=''
                +-name=None role='paragraph' state='EDITABLE ENABLED FOCUSABLE MULTI_LINE MULTISELECTABLE SHOWING VISIBLE' relations='FLOWS_FROM FLOWS_TO'



Arrowed around and into C3, did work.

+-name='soffice.bin' role='application' state='' relations=''
  +-name='apples-oranges - OpenOffice.org Writer' role='frame' state='ACTIVE ENABLED RESIZABLE SENSITIVE SHOWING VISIBLE' relations=''
    +-name='apples-oranges - OpenOffice.org Writer' role='root pane' state='ENABLED SENSITIVE SHOWING VISIBLE' relations=''
      +-name=None role='panel' state='ENABLED SENSITIVE SHOWING VISIBLE' relations=''
        +-name=None role='scroll pane' state='ENABLED SENSITIVE SHOWING VISIBLE' relations=''
          +-name='Document view' role='unknown' state='EDITABLE ENABLED MULTISELECTABLE OPAQUE SHOWING VISIBLE' relations=''
            +-name='Table1-1' role='table' state='EDITABLE ENABLED MULTISELECTABLE SHOWING VISIBLE' relations=''
              +-name='B3' role='table cell' state='EDITABLE ENABLED SELECTABLE SHOWING VISIBLE' relations=''
                +-name=None role='paragraph' state='EDITABLE ENABLED FOCUSABLE MULTI_LINE MULTISELECTABLE SHOWING VISIBLE' relations='FLOWS_FROM FLOWS_TO'
Comment 14 Joanmarie Diggs (IRC: joanie) 2006-12-19 03:50:32 UTC
Scratch the previous stuff, it's a red herring.  The pattern seems to be that the dynamic row/column header will get set to the row/column *you just left*.  Playing a bit of "let's guess what detail1 is", try setting the check to 0 in line 1483:

        # If we are FOCUSED on a paragraph inside a table cell (in Writer),
        # then speak/braille that parent table cell (see bug #382415).
        #
        if event.type == "object:state-changed:focused" and \
           event.source.role == rolenames.ROLE_PARAGRAPH and \
           event.source.parent.role == rolenames.ROLE_TABLE_CELL and \
           event.detail1 == 0 and \
           event.source.state.count(atspi.Accessibility.STATE_FOCUSED):

So far so good!!!

Disclaimer:  It's late and I'm tired, please don't take my word for the above being the fix. :-)
Comment 15 Joanmarie Diggs (IRC: joanie) 2006-12-19 04:04:07 UTC
Sorry to be spammy, but btw:  I did *a lot* of checking/arrowing to see what all events one gets when entering/leaving/moving within a table.  It is consistently:

OBJECT EVENT: object:text-caret-moved                  detail=(-1,0)
OBJECT EVENT: object:state-changed:focused             detail=(0,0)
OBJECT EVENT: object:state-changed:focused             detail=(1,0)
OBJECT EVENT: object:text-caret-moved                  detail=(0,0)
OBJECT EVENT: focus:                                   detail=(0,0)

It *seems* we can count on a object:state-changed:focused whose detail1 is 0 as reliably as we can count on it being 1.
Comment 16 Rich Burridge 2006-12-19 15:29:02 UTC
Created attachment 78629 [details] [review]
New revision of the patch.

Nice work Joanie! Thanks. New patch includes that fix. It seems to really
work well. Patch also includes a check at one point if this is a keyboard
event before getting the event_string.

I've checked the code into Orca CVS HEAD. Will/Mike, could you try it out
and give feedback? Thanks.
Comment 17 Rich Burridge 2007-01-02 20:54:01 UTC
Thanks. Closing.