orca r3576 - trunk/src/orca
- From: joanied svn gnome org
- To: svn-commits-list gnome org
- Subject: orca r3576 - trunk/src/orca
- Date: Thu, 14 Feb 2008 07:28:51 +0000 (GMT)
Author: joanied
Date: Thu Feb 14 07:28:50 2008
New Revision: 3576
URL: http://svn.gnome.org/viewvc/orca?rev=3576&view=rev
Log:
Another tweak for bug #516174.
Modified:
trunk/src/orca/Gecko.py
Modified: trunk/src/orca/Gecko.py
==============================================================================
--- trunk/src/orca/Gecko.py (original)
+++ trunk/src/orca/Gecko.py Thu Feb 14 07:28:50 2008
@@ -5817,15 +5817,26 @@
def isLineBreakChar(self, obj, offset):
"""Returns True of the character at the given offset within
- obj is a line break character (i.e. <br />)
+ obj is a line break character (i.e. <br />) or is a newline
+ character within preformatted text.
"""
+ isBreak = False
+
text = self.queryNonEmptyText(obj)
if text:
+ char = text.getText(offset, offset + 1)
[attributeSet, start, end] = text.getAttributeRun(offset, True)
- return 'tag:BR' in attributeSet
+ isBreak = 'tag:BR' in attributeSet
+ if not isBreak and char == "\n":
+ attributes = obj.getAttributes()
+ if attributes:
+ for attribute in attributes:
+ if attribute == "tag:PRE":
+ isBreak = True
+ break
- return False
+ return isBreak
def isUselessObject(self, obj):
"""Returns true if the given object is an obj that doesn't
@@ -8231,7 +8242,8 @@
prevOffset)
if self.isLineBreakChar(prevObj, prevOffset):
- prevOffset -= 1
+ [prevObj, prevOffset] = self.findPreviousCaretInOrder(prevObj,
+ prevOffset)
# If the user did some back-to-back arrowing, we might already have
# the line contents.
@@ -8433,9 +8445,13 @@
[nextObj, nextOffset] = self.findNextCaretInOrder(nextObj, nextOffset)
- if self.isLineBreakChar(nextObj, nextOffset):
+ if self.getCharacterAtOffset(nextObj, nextOffset) == " ":
nextOffset += 1
+ if self.isLineBreakChar(nextObj, nextOffset):
+ [nextObj, nextOffset] = self.findNextCaretInOrder(nextObj,
+ nextOffset)
+
# If the user did some back-to-back arrowing, we might already have
# the line contents.
#
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]