Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 225536 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/birt/report/engine/emitter/excel/ExcelWriter.java (-2 / +1 lines)
Lines 15-21 Link Here
15
import java.util.logging.Logger;
15
import java.util.logging.Logger;
16
import org.eclipse.birt.report.engine.content.IHyperlinkAction;
16
import org.eclipse.birt.report.engine.content.IHyperlinkAction;
17
import org.eclipse.birt.report.engine.content.IReportContent;
17
import org.eclipse.birt.report.engine.content.IReportContent;
18
import org.eclipse.birt.report.engine.css.engine.value.birt.BIRTConstants;
19
import org.eclipse.birt.report.engine.css.engine.value.css.CSSConstants;
18
import org.eclipse.birt.report.engine.css.engine.value.css.CSSConstants;
20
import org.eclipse.birt.report.engine.emitter.XMLWriter;
19
import org.eclipse.birt.report.engine.emitter.XMLWriter;
21
import org.eclipse.birt.report.engine.emitter.excel.layout.ExcelContext;
20
import org.eclipse.birt.report.engine.emitter.excel.layout.ExcelContext;
Lines 338-344 Link Here
338
337
339
		if ( isValid( direction ) )
338
		if ( isValid( direction ) )
340
		{
339
		{
341
			if ( BIRTConstants.BIRT_RTL_VALUE.equals( direction ) )
340
			if ( CSSConstants.CSS_RTL_VALUE.equals( direction ) )
342
				writer.attribute( "ss:ReadingOrder", "RightToLeft" );
341
				writer.attribute( "ss:ReadingOrder", "RightToLeft" );
343
			else
342
			else
344
				writer.attribute( "ss:ReadingOrder", "LeftToRight" );
343
				writer.attribute( "ss:ReadingOrder", "LeftToRight" );
(-)src/org/eclipse/birt/report/model/i18n/Messages.properties (-2 / +2 lines)
Lines 636-643 Link Here
636
Choices.scalarParamType.ad-hoc=Ad-hoc
636
Choices.scalarParamType.ad-hoc=Ad-hoc
637
637
638
#77. bidiLayoutOrientation   
638
#77. bidiLayoutOrientation   
639
Choices.bidiDirection.rtl=Right To Left
639
Choices.bidiDirection.rtl=rtl
640
Choices.bidiDirection.ltr=Left To Right
640
Choices.bidiDirection.ltr=ltr
641
641
642
###########################################################
642
###########################################################
643
# Classes
643
# Classes
(-)src/org/eclipse/birt/report/engine/emitter/html/HTMLReportEmitter.java (-2 / +2 lines)
Lines 500-506 Link Here
500
					style.setProperty( IStyle.STYLE_TEXT_ALIGN,
500
					style.setProperty( IStyle.STYLE_TEXT_ALIGN,
501
							IStyle.RIGHT_VALUE );
501
							IStyle.RIGHT_VALUE );
502
					style.setProperty( IStyle.STYLE_DIRECTION,
502
					style.setProperty( IStyle.STYLE_DIRECTION,
503
							IStyle.RIGHT_TO_LEFT_VALUE ); // bidi_hcg
503
							IStyle.RTL_VALUE ); // bidi_hcg
504
				}
504
				}
505
			}
505
			}
506
		}
506
		}
Lines 1513-1519 Link Here
1513
						return true;
1513
						return true;
1514
					}
1514
					}
1515
					CSSValue direction = style.getProperty( IStyle.STYLE_DIRECTION );
1515
					CSSValue direction = style.getProperty( IStyle.STYLE_DIRECTION );
1516
					if ( IStyle.RIGHT_TO_LEFT_VALUE.equals(direction) )
1516
					if ( IStyle.RTL_VALUE.equals(direction) )
1517
					{
1517
					{
1518
						if ( IStyle.LEFT_VALUE.equals( align ) )
1518
						if ( IStyle.LEFT_VALUE.equals( align ) )
1519
						{
1519
						{
(-)src/org/eclipse/birt/report/engine/emitter/html/AttributeBuilder.java (-3 / +3 lines)
Lines 12-18 Link Here
12
package org.eclipse.birt.report.engine.emitter.html;
12
package org.eclipse.birt.report.engine.emitter.html;
13
13
14
import org.eclipse.birt.report.engine.content.IStyle;
14
import org.eclipse.birt.report.engine.content.IStyle;
15
import org.eclipse.birt.report.engine.css.engine.value.birt.BIRTConstants;
15
import org.eclipse.birt.report.engine.css.engine.value.css.CSSConstants;
16
import org.eclipse.birt.report.engine.ir.DimensionType;
16
import org.eclipse.birt.report.engine.ir.DimensionType;
17
import org.w3c.dom.css.CSSValue;
17
import org.w3c.dom.css.CSSValue;
18
18
Lines 697-706 Link Here
697
	
697
	
698
			if ( direction != null )
698
			if ( direction != null )
699
			{
699
			{
700
				if ( BIRTConstants.BIRT_RTL_VALUE.equals( direction ) )
700
				if ( CSSConstants.CSS_RTL_VALUE.equals( direction ) )
701
					buildProperty( styleBuffer, IStyle.CSS_DIRECTION_PROPERTY,
701
					buildProperty( styleBuffer, IStyle.CSS_DIRECTION_PROPERTY,
702
							IStyle.CSS_RTL_VALUE );
702
							IStyle.CSS_RTL_VALUE );
703
				else if ( BIRTConstants.BIRT_LTR_VALUE.equals( direction ) )
703
				else if ( CSSConstants.CSS_LTR_VALUE.equals( direction ) )
704
					buildProperty( styleBuffer, IStyle.CSS_DIRECTION_PROPERTY,
704
					buildProperty( styleBuffer, IStyle.CSS_DIRECTION_PROPERTY,
705
							IStyle.CSS_LTR_VALUE );
705
							IStyle.CSS_LTR_VALUE );
706
			}
706
			}
(-)src/org/eclipse/birt/report/engine/layout/pdf/PDFLineAreaLM.java (-2 / +3 lines)
Lines 392-398 Link Here
392
			AbstractArea area = (AbstractArea) iter.next( );
392
			AbstractArea area = (AbstractArea) iter.next( );
393
			if(area instanceof TextArea)
393
			if(area instanceof TextArea)
394
			{
394
			{
395
				String text = ((TextArea)area).getText( );
395
				// Do not flip the text here for all output formats.
396
				String text = ((TextArea)area).getText( false );
396
				blanks[index] = text.split( " " ).length - 1;
397
				blanks[index] = text.split( " " ).length - 1;
397
				chars[index] = (text.length( )>1 ? (text.length( )-1): 0);
398
				chars[index] = (text.length( )>1 ? (text.length( )-1): 0);
398
				blankNumber += blanks[index];
399
				blankNumber += blanks[index];
Lines 407-413 Link Here
407
					AbstractArea child = (AbstractArea) it.next( );
408
					AbstractArea child = (AbstractArea) it.next( );
408
					if(child instanceof TextArea)
409
					if(child instanceof TextArea)
409
					{
410
					{
410
						String text = ((TextArea)child).getText( );
411
						String text = ((TextArea)child).getText( false );
411
						blanks[index] = text.split( " " ).length - 1;
412
						blanks[index] = text.split( " " ).length - 1;
412
						chars[index] = (text.length( )>1 ? (text.length( )-1): 0);
413
						chars[index] = (text.length( )>1 ? (text.length( )-1): 0);
413
						blankNumber += blanks[index];
414
						blankNumber += blanks[index];
(-)src/org/eclipse/birt/report/engine/css/engine/value/birt/BIRTValueConstants.java (-4 / +4 lines)
Lines 28-36 Link Here
28
	/**
28
	/**
29
	 * bidi_hcg: The 'Left To Right' and 'Right To Left' keywords.
29
	 * bidi_hcg: The 'Left To Right' and 'Right To Left' keywords.
30
	 */
30
	 */
31
	Value LEFT_TO_RIGHT_VALUE = new StringValue( CSSPrimitiveValue.CSS_IDENT,
31
	//Value LEFT_TO_RIGHT_VALUE = new StringValue( CSSPrimitiveValue.CSS_IDENT,
32
			BIRTConstants.BIRT_LTR_VALUE );
32
	//		BIRTConstants.BIRT_LTR_VALUE );
33
	Value RIGHT_TO_LEFT_VALUE = new StringValue( CSSPrimitiveValue.CSS_IDENT,
33
	//Value RIGHT_TO_LEFT_VALUE = new StringValue( CSSPrimitiveValue.CSS_IDENT,
34
			BIRTConstants.BIRT_RTL_VALUE );
34
	//		BIRTConstants.BIRT_RTL_VALUE );
35
}
35
}
36
36
(-)src/org/eclipse/birt/report/engine/css/engine/value/birt/BIRTConstants.java (-2 / +2 lines)
Lines 45-50 Link Here
45
	String BIRT_FALSE_VALUE = "false";
45
	String BIRT_FALSE_VALUE = "false";
46
	String BIRT_ALL_VALUE = "all";
46
	String BIRT_ALL_VALUE = "all";
47
	String BIRT_SOFT_VALUE = "soft";
47
	String BIRT_SOFT_VALUE = "soft";
48
	String BIRT_LTR_VALUE = "Left To Right";
48
	//String BIRT_LTR_VALUE = "Left To Right";
49
	String BIRT_RTL_VALUE = "Right To Left";
49
	//String BIRT_RTL_VALUE = "Right To Left";
50
}
50
}
(-)src/org/eclipse/birt/report/engine/layout/pdf/text/ChunkGenerator.java (-2 / +2 lines)
Lines 12-18 Link Here
12
package org.eclipse.birt.report.engine.layout.pdf.text;
12
package org.eclipse.birt.report.engine.layout.pdf.text;
13
13
14
import org.eclipse.birt.report.engine.content.ITextContent;
14
import org.eclipse.birt.report.engine.content.ITextContent;
15
import org.eclipse.birt.report.engine.css.engine.value.birt.BIRTConstants;
15
import org.eclipse.birt.report.engine.css.engine.value.css.CSSConstants;
16
import org.eclipse.birt.report.engine.layout.pdf.ISplitter;
16
import org.eclipse.birt.report.engine.layout.pdf.ISplitter;
17
import org.eclipse.birt.report.engine.layout.pdf.font.FontMappingManager;
17
import org.eclipse.birt.report.engine.layout.pdf.font.FontMappingManager;
18
import org.eclipse.birt.report.engine.layout.pdf.font.FontSplitter;
18
import org.eclipse.birt.report.engine.layout.pdf.font.FontSplitter;
Lines 47-53 Link Here
47
			// bidi_hcg: Create bidiSplitter based on a direction-sensitive
47
			// bidi_hcg: Create bidiSplitter based on a direction-sensitive
48
			// Chunk.
48
			// Chunk.
49
			//FIXME implement the getDirection() method in ComputedStyle.
49
			//FIXME implement the getDirection() method in ComputedStyle.
50
			if ( BIRTConstants.BIRT_RTL_VALUE.equals( textContent
50
			if ( CSSConstants.CSS_RTL_VALUE.equals( textContent
51
					.getComputedStyle( ).getDirection( ) ) )
51
					.getComputedStyle( ).getDirection( ) ) )
52
			{
52
			{
53
				bidiSplitter = new BidiSplitter( new Chunk( text, 0,
53
				bidiSplitter = new BidiSplitter( new Chunk( text, 0,
(-)src/org/eclipse/birt/report/engine/layout/area/impl/TextArea.java (-2 / +2 lines)
Lines 163-174 Link Here
163
	 *            the original text.
163
	 *            the original text.
164
	 * @return the text in visual order.
164
	 * @return the text in visual order.
165
	 */
165
	 */
166
	public String getText( )
166
	public String getText( boolean dontFlip )
167
	{
167
	{
168
		calculateText( );
168
		calculateText( );
169
		// bidi_hcg: We actually need to determine the parity of embedding
169
		// bidi_hcg: We actually need to determine the parity of embedding
170
		// level(EL). RTL runs have odd EL, LTR runs - even EL.
170
		// level(EL). RTL runs have odd EL, LTR runs - even EL.
171
		if ( ( runLevel & 1 ) == 0 )
171
		if ( dontFlip || ( runLevel & 1 ) == 0 )
172
		{
172
		{
173
			return text;
173
			return text;
174
		}
174
		}
(-)src/org/eclipse/birt/report/engine/layout/pdf/emitter/LineLayout.java (-4 / +4 lines)
Lines 19-25 Link Here
19
import org.eclipse.birt.report.engine.content.ITextContent;
19
import org.eclipse.birt.report.engine.content.ITextContent;
20
import org.eclipse.birt.report.engine.css.engine.StyleConstants;
20
import org.eclipse.birt.report.engine.css.engine.StyleConstants;
21
import org.eclipse.birt.report.engine.css.engine.value.FloatValue;
21
import org.eclipse.birt.report.engine.css.engine.value.FloatValue;
22
import org.eclipse.birt.report.engine.css.engine.value.birt.BIRTConstants;
23
import org.eclipse.birt.report.engine.css.engine.value.css.CSSConstants;
22
import org.eclipse.birt.report.engine.css.engine.value.css.CSSConstants;
24
import org.eclipse.birt.report.engine.extension.IReportItemExecutor;
23
import org.eclipse.birt.report.engine.extension.IReportItemExecutor;
25
import org.eclipse.birt.report.engine.layout.area.impl.AbstractArea;
24
import org.eclipse.birt.report.engine.layout.area.impl.AbstractArea;
Lines 89-95 Link Here
89
		 // Derive the baseLevel from the parent content direction.
88
		 // Derive the baseLevel from the parent content direction.
90
		if ( parent.content != null )
89
		if ( parent.content != null )
91
		{
90
		{
92
			if ( BIRTConstants.BIRT_RTL_VALUE.equals( parent.content
91
			if ( CSSConstants.CSS_RTL_VALUE.equals( parent.content
93
					.getComputedStyle( ).getDirection( ) ) )
92
					.getComputedStyle( ).getDirection( ) ) )
94
				baseLevel = Bidi.DIRECTION_RIGHT_TO_LEFT;
93
				baseLevel = Bidi.DIRECTION_RIGHT_TO_LEFT;
95
		}
94
		}
Lines 211-217 Link Here
211
			AbstractArea area = (AbstractArea) iter.next( );
210
			AbstractArea area = (AbstractArea) iter.next( );
212
			if(area instanceof TextArea)
211
			if(area instanceof TextArea)
213
			{
212
			{
214
				String text = ((TextArea)area).getText( );
213
				// Do not flip the text here for all output formats.
214
				String text = ((TextArea)area).getText( false );
215
				blanks[index] = text.split( " " ).length - 1;
215
				blanks[index] = text.split( " " ).length - 1;
216
				chars[index] = (text.length( )>1 ? (text.length( )-1): 0);
216
				chars[index] = (text.length( )>1 ? (text.length( )-1): 0);
217
				blankNumber += blanks[index];
217
				blankNumber += blanks[index];
Lines 226-232 Link Here
226
					AbstractArea child = (AbstractArea) it.next( );
226
					AbstractArea child = (AbstractArea) it.next( );
227
					if(child instanceof TextArea)
227
					if(child instanceof TextArea)
228
					{
228
					{
229
						String text = ((TextArea)child).getText( );
229
						String text = ((TextArea)child).getText( false );
230
						blanks[index] = text.split( " " ).length - 1;
230
						blanks[index] = text.split( " " ).length - 1;
231
						chars[index] = (text.length( )>1 ? (text.length( )-1): 0);
231
						chars[index] = (text.length( )>1 ? (text.length( )-1): 0);
232
						blankNumber += blanks[index];
232
						blankNumber += blanks[index];
(-)src/org/eclipse/birt/report/engine/layout/emitter/PageDeviceRender.java (-3 / +6 lines)
Lines 34-40 Link Here
34
import org.eclipse.birt.report.engine.content.IStyle;
34
import org.eclipse.birt.report.engine.content.IStyle;
35
import org.eclipse.birt.report.engine.css.engine.StyleConstants;
35
import org.eclipse.birt.report.engine.css.engine.StyleConstants;
36
import org.eclipse.birt.report.engine.css.engine.value.FloatValue;
36
import org.eclipse.birt.report.engine.css.engine.value.FloatValue;
37
import org.eclipse.birt.report.engine.css.engine.value.birt.BIRTConstants;
37
import org.eclipse.birt.report.engine.css.engine.value.css.CSSConstants;
38
import org.eclipse.birt.report.engine.emitter.IEmitterServices;
38
import org.eclipse.birt.report.engine.emitter.IEmitterServices;
39
import org.eclipse.birt.report.engine.layout.PDFConstants;
39
import org.eclipse.birt.report.engine.layout.PDFConstants;
40
import org.eclipse.birt.report.engine.layout.TextStyle;
40
import org.eclipse.birt.report.engine.layout.TextStyle;
Lines 701-707 Link Here
701
				.getProperty( IStyle.STYLE_TEXT_OVERLINE ) );
701
				.getProperty( IStyle.STYLE_TEXT_OVERLINE ) );
702
		boolean underline = IStyle.UNDERLINE_VALUE.equals( style
702
		boolean underline = IStyle.UNDERLINE_VALUE.equals( style
703
				.getProperty( IStyle.STYLE_TEXT_UNDERLINE ) );
703
				.getProperty( IStyle.STYLE_TEXT_UNDERLINE ) );
704
		boolean rtl = BIRTConstants.BIRT_RTL_VALUE.equals( style
704
		boolean rtl = CSSConstants.CSS_RTL_VALUE.equals( style
705
				.getProperty( IStyle.STYLE_DIRECTION ) ); // bidi_hcg
705
				.getProperty( IStyle.STYLE_DIRECTION ) ); // bidi_hcg
706
		IContent content = text.getContent( );
706
		IContent content = text.getContent( );
707
		if ( content != null && content.getHyperlinkAction( ) != null )
707
		if ( content != null && content.getHyperlinkAction( ) != null )
Lines 737-743 Link Here
737
	protected void drawTextAt( ITextArea text, int x, int y, int width,
737
	protected void drawTextAt( ITextArea text, int x, int y, int width,
738
			int height, TextStyle textStyle )
738
			int height, TextStyle textStyle )
739
	{
739
	{
740
		pageGraphic.drawText( text.getText( ), x, y, width, height, textStyle );
740
		// FIXME: probably need to define some class var for "ppt"
741
		pageGraphic
742
				.drawText(
743
						text.getText( "ppt".equals( getOutputFormat( ) ) ), x, y, width, height, textStyle ); //$NON-NLS-1$
741
	}
744
	}
742
745
743
	/**
746
	/**
(-)src/org/eclipse/birt/report/engine/layout/area/ITextArea.java (-1 / +1 lines)
Lines 14-19 Link Here
14
14
15
public interface ITextArea extends IArea
15
public interface ITextArea extends IArea
16
{
16
{
17
	String getText();
17
	String getText( boolean dontFlip );
18
	FontInfo getFontInfo();
18
	FontInfo getFontInfo();
19
}
19
}
(-)src/org/eclipse/birt/report/engine/emitter/wpml/WpmlWriter.java (-7 / +4 lines)
Lines 24-31 Link Here
24
import org.eclipse.birt.report.engine.emitter.XMLWriter;
24
import org.eclipse.birt.report.engine.emitter.XMLWriter;
25
import org.eclipse.birt.report.engine.content.IAutoTextContent;
25
import org.eclipse.birt.report.engine.content.IAutoTextContent;
26
import org.eclipse.birt.report.engine.css.engine.value.css.CSSConstants;
26
import org.eclipse.birt.report.engine.css.engine.value.css.CSSConstants;
27
import org.eclipse.birt.report.engine.css.engine.value.birt.BIRTConstants;
28
import org.eclipse.birt.report.model.api.ReportDesignHandle;
29
import org.eclipse.birt.report.model.api.core.IModuleModel;
27
import org.eclipse.birt.report.model.api.core.IModuleModel;
30
28
31
public class WpmlWriter
29
public class WpmlWriter
Lines 467-473 Link Here
467
			align = "both";
465
			align = "both";
468
		}
466
		}
469
		// Need to swap 'left' and 'right' when orientation is RTL.
467
		// Need to swap 'left' and 'right' when orientation is RTL.
470
		if ( BIRTConstants.BIRT_RTL_VALUE.equalsIgnoreCase( direction ) )
468
		if ( CSSConstants.CSS_RTL_VALUE.equalsIgnoreCase( direction ) )
471
		{
469
		{
472
			if ( IStyle.CSS_RIGHT_VALUE.equals( align ) )
470
			if ( IStyle.CSS_RIGHT_VALUE.equals( align ) )
473
				writeAttrTag( "w:jc", IStyle.CSS_LEFT_VALUE );
471
				writeAttrTag( "w:jc", IStyle.CSS_LEFT_VALUE );
Lines 852-858 Link Here
852
		// Non Bidi text will result in a single LTR Bidi run and won't be
850
		// Non Bidi text will result in a single LTR Bidi run and won't be
853
		// really affected.
851
		// really affected.
854
		String direction = style.getDirection( );
852
		String direction = style.getDirection( );
855
		boolean textIsRtl = BIRTConstants.BIRT_RTL_VALUE.equals( direction );
853
		boolean textIsRtl = CSSConstants.CSS_RTL_VALUE.equals( direction );
856
		int nChunks = reserved ? 1 : 0;
854
		int nChunks = reserved ? 1 : 0;
857
855
858
		writer.openTag( "w:pPr" );
856
		writer.openTag( "w:pPr" );
Lines 1460-1468 Link Here
1460
		String direction = style.getDirection( ); // bidi_hcg
1458
		String direction = style.getDirection( ); // bidi_hcg
1461
		if ( style.getTextAlign( ).equals( "left" ) )
1459
		if ( style.getTextAlign( ).equals( "left" ) )
1462
		{
1460
		{
1463
			if ( BIRTConstants.BIRT_RTL_VALUE.equals( direction ) )
1461
			if ( !CSSConstants.CSS_RTL_VALUE.equals( direction ) )
1464
				writeAlign( style.getTextAlign( ), direction );
1462
				return;
1465
			return;
1466
		}
1463
		}
1467
		
1464
		
1468
		writer.openTag( "w:pPr");
1465
		writer.openTag( "w:pPr");

Return to bug 225536