summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKnut Radloff <knutr>2001-11-14 17:44:46 +0000
committerKnut Radloff <knutr>2001-11-14 17:44:46 +0000
commit9a7a23f05c644cb62fddfb0991fcc9f64f0514a5 (patch)
tree875c01785f6c901ecccf3320ce069dbda0336a44
parentddd91dc29a349ab72ccc2c4f07965a1688875943 (diff)
downloadeclipse.platform.swt-9a7a23f05c644cb62fddfb0991fcc9f64f0514a5.tar.gz
eclipse.platform.swt-9a7a23f05c644cb62fddfb0991fcc9f64f0514a5.tar.xz
eclipse.platform.swt-9a7a23f05c644cb62fddfb0991fcc9f64f0514a5.zip
*** empty log message ***
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/StyledText.java9
1 files changed, 6 insertions, 3 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/StyledText.java b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/StyledText.java
index 3e0114aa65..72542da6e9 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/StyledText.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/StyledText.java
@@ -630,8 +630,10 @@ public class StyledText extends Canvas {
if (gc == null) {
gc = new GC(parent);
- currentFont = gc.getFont().getFontData()[0];
caretWidth = getCaretWidth();
+ if (isBidi() == false) {
+ currentFont = gc.getFont().getFontData()[0];
+ }
}
lineWidth[i] = contentWidth(line, lineOffset, gc, currentFont) + caretWidth;
}
@@ -667,7 +669,8 @@ public class StyledText extends Canvas {
* @param lineOffset start offset of the line to measure, relative
* to the start of the document
* @param gc the GC to use for measuring the line
- * @param currentFont the font currently set in gc. Cached for better performance.
+ * @param currentFont the font currently set in gc. Cached for better
+ * performance. Null when running in a bidi locale.
* @return the width of the given line
*/
int contentWidth(String line, int lineOffset, GC gc, FontData currentFont) {
@@ -3363,7 +3366,6 @@ int getOffsetAtMouseLocation(int x, int line) {
*/
int getOffsetAtX(String line, int lineOffset, int lineXOffset) {
GC gc = new GC(this);
- FontData currentFont = gc.getFont().getFontData()[0];
int offset;
lineXOffset += horizontalScrollOffset;
@@ -3372,6 +3374,7 @@ int getOffsetAtX(String line, int lineOffset, int lineXOffset) {
offset = bidi.getOffsetAtX(lineXOffset);
}
else {
+ FontData currentFont = gc.getFont().getFontData()[0];
StyleRange[] styles = null;
StyledTextEvent event = getLineStyleData(lineOffset, line);