diff options
author | Markus Keller <markus_keller@ch.ibm.com> | 2013-03-08 19:29:29 +0100 |
---|---|---|
committer | Markus Keller <markus_keller@ch.ibm.com> | 2013-03-08 19:29:29 +0100 |
commit | 629abafba5977a03a6e3729c999fb7b78b57e631 (patch) | |
tree | 6c9be36c2697679bfa16cb65f9845843dcf78e7d /bundles/org.eclipse.swt/Eclipse SWT Custom Widgets | |
parent | aedb399d989dae6fd1e97116b55f9e8e774be5cd (diff) | |
download | eclipse.platform.swt-629abafba5977a03a6e3729c999fb7b78b57e631.tar.gz eclipse.platform.swt-629abafba5977a03a6e3729c999fb7b78b57e631.tar.xz eclipse.platform.swt-629abafba5977a03a6e3729c999fb7b78b57e631.zip |
Bug 400727: StyledText#addBidiSegmentListener(..) only works if RTL input language is installed
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT Custom Widgets')
-rw-r--r-- | bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/StyledText.java | 21 |
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 633cc713fc..8970c86150 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(); } |