aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Keller2013-03-08 13:29:29 (EST)
committerCarolyn MacLeod2013-04-09 10:56:25 (EDT)
commit355cdd749919ab6473f40564073907e7a58391af (patch)
tree98a0b6b6975667f409cd8b99a1912910b5e495fd
parent6319870c2ee33a48534cf534958ed594ff6bfbf1 (diff)
downloadeclipse.platform.swt-355cdd749919ab6473f40564073907e7a58391af.zip
eclipse.platform.swt-355cdd749919ab6473f40564073907e7a58391af.tar.gz
eclipse.platform.swt-355cdd749919ab6473f40564073907e7a58391af.tar.bz2
Bug 400727: StyledText#addBidiSegmentListener(..) only works if RTL input language is installed
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/StyledText.java21
1 files changed, 6 insertions, 15 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 633cc71..8970c86 100644
--- 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2012 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -247,7 +247,7 @@ public class StyledText extends Canvas {
fontData = styledText.getFont().getFontData()[0];
tabLength = styledText.tabLength;
int lineCount = printerRenderer.lineCount;
- if (styledText.isListening(ST.LineGetBackground) || (styledText.isBidi() && styledText.isListening(ST.LineGetSegments)) || styledText.isListening(ST.LineGetStyle)) {
+ if (styledText.isListening(ST.LineGetBackground) || (styledText.isListening(ST.LineGetSegments)) || styledText.isListening(ST.LineGetStyle)) {
StyledTextContent content = printerRenderer.content;
for (int i = 0; i < lineCount; i++) {
String line = content.getLine(i);
@@ -256,12 +256,10 @@ public class StyledText extends Canvas {
if (event != null && event.lineBackground != null) {
printerRenderer.setLineBackground(i, 1, event.lineBackground);
}
- if (styledText.isBidi()) {
- event = styledText.getBidiSegments(lineOffset, line);
- if (event != null) {
- printerRenderer.setLineSegments(i, 1, event.segments);
- printerRenderer.setLineSegmentChars(i, 1, event.segmentsChars);
- }
+ event = styledText.getBidiSegments(lineOffset, line);
+ if (event != null) {
+ printerRenderer.setLineSegments(i, 1, event.segments);
+ printerRenderer.setLineSegmentChars(i, 1, event.segmentsChars);
}
event = styledText.getLineStyleData(lineOffset, line);
if (event != null) {
@@ -4775,7 +4773,6 @@ public String getSelectionText() {
return content.getTextRange(selection.x, selection.y - selection.x);
}
StyledTextEvent getBidiSegments(int lineOffset, String line) {
- if (!isBidi()) return null;
if (!isListening(ST.LineGetSegments)) {
StyledTextEvent event = new StyledTextEvent(content);
event.segments = getBidiSegmentsCompatibility(line, lineOffset);
@@ -7095,12 +7092,6 @@ boolean invokeBlockAction(int action) {
}
return false;
}
-/**
- * Temporary until SWT provides this
- */
-boolean isBidi() {
- return IS_GTK || IS_MAC || BidiUtil.isBidiPlatform() || isMirrored();
-}
boolean isBidiCaret() {
return BidiUtil.isBidiPlatform();
}