summaryrefslogtreecommitdiff
path: root/accessibility/bridge/org/openoffice/java/accessibility/AccessibleTextImpl.java
diff options
context:
space:
mode:
authorVladimir Glazounov <vg@openoffice.org>2003-05-22 11:39:34 +0000
committerVladimir Glazounov <vg@openoffice.org>2003-05-22 11:39:34 +0000
commitf195f5c2e6c4d7db5bdacc76c56cfb1f025eb401 (patch)
tree29a23ef2be87457e7caf0adbc6f1f7005e159b9c /accessibility/bridge/org/openoffice/java/accessibility/AccessibleTextImpl.java
parent27c247082de709f19fe760b32fcfdd55b70f0e85 (diff)
INTEGRATION: CWS uaa03 (1.9.8); FILE MERGED
2003/05/16 11:20:05 obr 1.9.8.1: #i14510# getText[At/Before/After] now returns a TextSegment structure - first shot only to make it compile
Diffstat (limited to 'accessibility/bridge/org/openoffice/java/accessibility/AccessibleTextImpl.java')
-rw-r--r--accessibility/bridge/org/openoffice/java/accessibility/AccessibleTextImpl.java30
1 files changed, 15 insertions, 15 deletions
diff --git a/accessibility/bridge/org/openoffice/java/accessibility/AccessibleTextImpl.java b/accessibility/bridge/org/openoffice/java/accessibility/AccessibleTextImpl.java
index fb1a7b27c073..821da8c1bbd7 100644
--- a/accessibility/bridge/org/openoffice/java/accessibility/AccessibleTextImpl.java
+++ b/accessibility/bridge/org/openoffice/java/accessibility/AccessibleTextImpl.java
@@ -112,17 +112,17 @@ public class AccessibleTextImpl implements javax.accessibility.AccessibleText {
try {
// the office returns an empty string when asking for the word at
// the position of a blank
- String s = unoObject.getTextBehindIndex(index, type);
- if ((part == AccessibleText.WORD) && (s.length() == 0)) {
+ TextSegment ts = unoObject.getTextBehindIndex(index, type);
+ if ((part == AccessibleText.WORD) && (ts.SegmentText.length() == 0)) {
// int max = getCharCount();
// for (int i=index; i < max; i++) {
// if (! unoObject.getTextBehindIndex(i, AccessibleTextType.CHARACTER).equals(" "))
// break;
// s += " ";
// }
- s = " ";
+ ts.SegmentText = " ";
}
- return s;
+ return ts.SegmentText;
} catch (com.sun.star.uno.Exception e) {
}
}
@@ -401,17 +401,17 @@ public class AccessibleTextImpl implements javax.accessibility.AccessibleText {
try {
// the office returns an empty string when asking for the word at
// the position of a blank
- String s = unoObject.getTextBeforeIndex(index, type);
- if ((part == AccessibleText.WORD) && (s.length() == 0)) {
+ TextSegment ts = unoObject.getTextBeforeIndex(index, type);
+ if ((part == AccessibleText.WORD) && (ts.SegmentText.length() == 0)) {
// int max = getCharCount();
// for (int i=index; i < max; i++) {
// if (! unoObject.getTextBeforeIndex(i, AccessibleTextType.CHARACTER).equals(" "))
// break;
// s += " ";
// }
- s = " ";
+ ts.SegmentText = " ";
}
- return s;
+ return ts.SegmentText;
} catch (com.sun.star.uno.Exception e) {
if (Build.DEBUG) {
System.err.println(this + e .getClass().getName() + " caught in getBeforeIndex(" + part + ", " + index + "): ");
@@ -429,27 +429,27 @@ public class AccessibleTextImpl implements javax.accessibility.AccessibleText {
try {
// the office returns an empty string when asking for the word at
// the position of a blank
- String s = unoObject.getTextAtIndex(index, type);
- if ((part == AccessibleText.WORD) && (s.length() == 0)) {
+ TextSegment ts = unoObject.getTextAtIndex(index, type);
+ if ((part == AccessibleText.WORD) && (ts.SegmentText.length() == 0)) {
// int max = getCharCount();
// for (int i=index; i < max; i++) {
// if (! unoObject.getTextAtIndex(i, AccessibleTextType.CHARACTER).equals(" "))
// break;
// s += " ";
// }
- s = " ";
+ ts.SegmentText = " ";
// Workaround for #104847#
- } else if ((type == AccessibleTextType.LINE) && (s.length() == 0)) {
+ } else if ((type == AccessibleTextType.LINE) && (ts.SegmentText.length() == 0)) {
if (index == getCharCount()) {
- s = unoObject.getTextAtIndex(index - 1, type);
+ ts = unoObject.getTextAtIndex(index - 1, type);
}
}
// if (Build.DEBUG) {
// System.err.println(this + " getAtIndex(" + part + "," + index + ") returns " + s + " (length: " + s.length() + ")");
// }
- return s;
+ return ts.SegmentText;
} catch (com.sun.star.lang.IndexOutOfBoundsException e) {
if (Build.DEBUG) {
System.err.println(this + "IndexOutOfBoundsException caught for getAtIndex(" + part + "," + index + ")");
@@ -459,7 +459,7 @@ public class AccessibleTextImpl implements javax.accessibility.AccessibleText {
if (type == AccessibleTextType.LINE) {
try {
- return unoObject.getTextAtIndex(index - 1, type);
+ return unoObject.getTextAtIndex(index - 1, type).SegmentText;
} catch (com.sun.star.uno.Exception e2) {
}
}