GNOME Bugzilla – Bug 551077
Traceback and loss of speech in OOo Writer docs with both links and multbyte characters on the same line
Last modified: 2009-03-10 00:05:53 UTC
Steps to reproduce: 1. Open the (to be) attached test case 2. Arrow to Up/Down to the first line of links Expected results: The links on that line would be "underlined" in braille and the full line would be spoken. Actual results: The links are correctly "underlined" in braille, but nothing is spoken due to the following traceback: ------------------------------ Traceback (most recent call last):
+ Trace 206388
s.processObjectEvent(event)
self.listeners[key](event)
default.Script.onCaretMoved(self, event)
self._presentTextAtNewCaretPosition(event)
self.sayLine(event.source)
line = self.adjustForLinks(obj, line)
punctuation_settings.getPunctuationInfo(line[link.endIndex])):
character = character.decode("UTF-8")
return codecs.utf_8_decode(input, errors, True)
------------------------------ This problem does not occur for the second line of links (i.e. we speak and braille that correctly). This bug has been present since the implementation of "verbalized links" (Orca revision 3864).
Created attachment 118146 [details] aforementioned test case
In looking at the code, I think there's an assumption we're working with strings where each element is a character. If we make adjustForLinks follow the same pattern as adjustForRepeats, it might fix this problem. The pattern is: line = line.decode("UTF-8") ....do some work and change line... return line.encode("UTF-8")
(In reply to comment #2) > In looking at the code, I think there's an assumption we're working with > strings where each element is a character. If we make adjustForLinks follow > the same pattern as adjustForRepeats, it might fix this problem. > > The pattern is: > > line = line.decode("UTF-8") > ....do some work and change line... > return line.encode("UTF-8") > See also the patch attached to http://bugzilla.gnome.org/show_bug.cgi?id=527022#c26. It seems to fix this problem. We can split the patch apart to fix just this bug if the rest of the patch is no good.
Did some manual testing. It seems to be working to solve both issues. Running the regression tests now. Thanks!!!
*** Bug 541762 has been marked as a duplicate of this bug. ***
The patch attached to http://bugzilla.gnome.org/show_bug.cgi?id=527022#c26 has been committed. Closing this as FIXED. Thanks for testing Joanie!
Created attachment 118197 [details] [review] proof-of-concept hack for a brlmon.py issue/traceback Will, while looking at another bug I discovered that this change can cause a traceback in brlmon.py. Try tabbing to the 'Browse...' button when creating a new attachment in GNOME's Bugzilla. If the braille monitor is enabled, we won't speak the button. Probably impacts around two Orca users, but as one of those two.... ;-) I debugged it briefly. The mask is shorter than the string because braille.getLineInfo() seems to be in charge of ellipses replacement, but the Region class is basing the mask length on the original string. The attached is just a proof-of-concept/hack which fixes the problem as I wasn't sure what the BestWay(tm) might be. I've also not tested it beyond the test case in question. I'm making good progress on the post-link-whitespace issue. Depending on how that progresses, I'll revisit the issue here. If you beat me to it, I promise not to complain though. ;-) Thanks!!
Looks good. Please commit. Thanks!
Clearly my understanding of the braille code leaves something to be desired. The patch certainly looks and seems harmless and like the right thing to do, but the regression tests spit up mightily on it. Some need updating because of Will's patch for this bug, so I'm going to start fresh and clean, update the tests, and go from there.
Update. The tests are hosed without the patch. Then I remembered a change Will suggested be made to dbusserver.py With that change the hosed tests are no longer hosed (sans patch). After I finish updating tests, I will revisit this patch again.
Issues resolved. Patch committed to trunk as-is. Re-closing.