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/layout/pdf/emitter/RowLayout.java (-1 / +14 lines)
Lines 15-20 Link Here
15
15
16
import org.eclipse.birt.report.engine.content.IContent;
16
import org.eclipse.birt.report.engine.content.IContent;
17
import org.eclipse.birt.report.engine.content.IRowContent;
17
import org.eclipse.birt.report.engine.content.IRowContent;
18
import org.eclipse.birt.report.engine.css.engine.value.birt.BIRTConstants;
18
import org.eclipse.birt.report.engine.extension.IReportItemExecutor;
19
import org.eclipse.birt.report.engine.extension.IReportItemExecutor;
19
import org.eclipse.birt.report.engine.layout.ILayoutManager;
20
import org.eclipse.birt.report.engine.layout.ILayoutManager;
20
import org.eclipse.birt.report.engine.layout.area.IArea;
21
import org.eclipse.birt.report.engine.layout.area.IArea;
Lines 26-31 Link Here
26
import org.eclipse.birt.report.engine.layout.pdf.PDFLayoutEngineContext;
27
import org.eclipse.birt.report.engine.layout.pdf.PDFLayoutEngineContext;
27
import org.eclipse.birt.report.engine.layout.pdf.PDFStackingLM;
28
import org.eclipse.birt.report.engine.layout.pdf.PDFStackingLM;
28
import org.eclipse.birt.report.engine.layout.pdf.PDFTableLM;
29
import org.eclipse.birt.report.engine.layout.pdf.PDFTableLM;
30
import org.eclipse.birt.report.model.api.ReportDesignHandle;
29
31
30
32
31
public class RowLayout extends ContainerLayout
33
public class RowLayout extends ContainerLayout
Lines 70-76 Link Here
70
	{
72
	{
71
		CellArea cArea = (CellArea) area;
73
		CellArea cArea = (CellArea) area;
72
		root.addChild( area );
74
		root.addChild( area );
73
		cArea.setPosition( tbl.getXPos( cArea.getColumnID( ) ), 0 );
75
76
		// bidi_hcg start
77
		int columnID = cArea.getColumnID( );
78
		int colSpan = cArea.getColSpan( );
79
		// Retrieve direction from the top-level content.
80
		if ( colSpan > 1 && content.isRTL( ) )
81
		{
82
			columnID += colSpan - 1;
83
		}
84
		// bidi_hcg end
85
86
		cArea.setPosition( tbl.getXPos( columnID ), 0 );
74
		//tbl.addRow( (RowArea)root );
87
		//tbl.addRow( (RowArea)root );
75
		return true;
88
		return true;
76
	}
89
	}
(-)src/org/eclipse/birt/report/engine/layout/pdf/emitter/TableLayout.java (-7 / +16 lines)
Lines 32-40 Link Here
32
import org.eclipse.birt.report.engine.layout.area.impl.CellArea;
32
import org.eclipse.birt.report.engine.layout.area.impl.CellArea;
33
import org.eclipse.birt.report.engine.layout.area.impl.RowArea;
33
import org.eclipse.birt.report.engine.layout.area.impl.RowArea;
34
import org.eclipse.birt.report.engine.layout.area.impl.TableArea;
34
import org.eclipse.birt.report.engine.layout.area.impl.TableArea;
35
import org.eclipse.birt.report.engine.layout.pdf.PDFLayoutEngineContext;
36
import org.eclipse.birt.report.engine.layout.pdf.PDFLayoutManagerFactory;
37
import org.eclipse.birt.report.engine.layout.pdf.PDFTableRegionLM;
38
import org.eclipse.birt.report.engine.layout.pdf.util.PropertyUtil;
35
import org.eclipse.birt.report.engine.layout.pdf.util.PropertyUtil;
39
36
40
37
Lines 719-730 Link Here
719
			this.columnNumber = colWidth.length;
716
			this.columnNumber = colWidth.length;
720
			this.xPositions = new int[columnNumber];
717
			this.xPositions = new int[columnNumber];
721
			this.tableWidth = 0;
718
			this.tableWidth = 0;
722
			for ( int i = 0; i < columnNumber; i++ )
719
720
			if ( tableContent.isRTL( ) ) // bidi_hcg
723
			{
721
			{
724
				xPositions[i] = tableWidth;
722
				for ( int i = 0; i < columnNumber; i++ )
725
				tableWidth += colWidth[i];
723
				{
724
					xPositions[i] = parent.getCurrentMaxContentWidth( ) - tableWidth
725
 						- colWidth[i];
726
					tableWidth += colWidth[i];
727
				}
728
			}
729
			else // ltr
730
			{
731
				for ( int i = 0; i < columnNumber; i++ )
732
				{
733
					xPositions[i] = tableWidth;
734
					tableWidth += colWidth[i];
735
				}
726
			}
736
			}
727
728
		}
737
		}
729
738
730
		public int getTableWidth( )
739
		public int getTableWidth( )
(-)src/org/eclipse/birt/report/engine/layout/pdf/emitter/TableAreaLayout.java (+2 lines)
Lines 65-70 Link Here
65
		this.layoutInfo = layoutInfo;
65
		this.layoutInfo = layoutInfo;
66
		this.startCol = startCol;
66
		this.startCol = startCol;
67
		this.endCol = endCol;
67
		this.endCol = endCol;
68
		if ( tableContent != null )
69
			bcr.setRTL( tableContent.isRTL( ) );
68
	}
70
	}
69
	
71
	
70
	public void initTableLayout(UnresolvedRowHint hint)
72
	public void initTableLayout(UnresolvedRowHint hint)
(-)src/org/eclipse/birt/report/engine/internal/content/wrap/AbstractContentWrapper.java (+13 lines)
Lines 24-29 Link Here
24
import org.eclipse.birt.report.engine.content.IStyle;
24
import org.eclipse.birt.report.engine.content.IStyle;
25
import org.eclipse.birt.report.engine.content.impl.AbstractElement;
25
import org.eclipse.birt.report.engine.content.impl.AbstractElement;
26
import org.eclipse.birt.report.engine.css.engine.CSSEngine;
26
import org.eclipse.birt.report.engine.css.engine.CSSEngine;
27
import org.eclipse.birt.report.engine.css.engine.value.birt.BIRTConstants;
27
import org.eclipse.birt.report.engine.ir.DimensionType;
28
import org.eclipse.birt.report.engine.ir.DimensionType;
28
29
29
abstract public class AbstractContentWrapper extends AbstractElement
30
abstract public class AbstractContentWrapper extends AbstractElement
Lines 428-431 Link Here
428
	{
429
	{
429
		throw new UnsupportedOperationException();
430
		throw new UnsupportedOperationException();
430
	}
431
	}
432
433
	/*
434
	 * (non-Javadoc)
435
	 * 
436
	 * @see org.eclipse.birt.report.engine.content.IContent#isOrientationRTL()
437
	 */
438
	public boolean isRTL( )
439
	{
440
		// bidi_hcg
441
		return content.isRTL( );
442
	}
443
431
}
444
}
(-)src/org/eclipse/birt/report/engine/parser/StylePropertyMapping.java (-1 / +11 lines)
Lines 18-23 Link Here
18
import org.eclipse.birt.report.engine.css.engine.value.css.CSSConstants;
18
import org.eclipse.birt.report.engine.css.engine.value.css.CSSConstants;
19
import org.eclipse.birt.report.engine.util.BidiAlignmentResolver;
19
import org.eclipse.birt.report.engine.util.BidiAlignmentResolver;
20
import org.eclipse.birt.report.model.api.ReportDesignHandle;
20
import org.eclipse.birt.report.model.api.ReportDesignHandle;
21
import org.eclipse.birt.report.model.api.StyleHandle;
21
import org.eclipse.birt.report.model.api.elements.DesignChoiceConstants;
22
import org.eclipse.birt.report.model.api.elements.DesignChoiceConstants;
22
import org.eclipse.birt.report.model.api.elements.ReportDesignConstants;
23
import org.eclipse.birt.report.model.api.elements.ReportDesignConstants;
23
import org.eclipse.birt.report.model.api.metadata.IElementDefn;
24
import org.eclipse.birt.report.model.api.metadata.IElementDefn;
Lines 157-162 Link Here
157
158
158
		if ( value == null && handle != null )
159
		if ( value == null && handle != null )
159
		{
160
		{
161
			// Disable this chunk of code.
162
			// Similar rule should apply to RTL: we can't change the
163
			// null value to the right.
164
			// We will resolve textAlign later on.
165
166
			// (Please note that before Bidi the default value in
167
			// engine was 'left' (see BIRTPropertyManagerFactory).)
168
			/*
160
			if ( IStyleModel.TEXT_ALIGN_PROP.equals( name ) )
169
			if ( IStyleModel.TEXT_ALIGN_PROP.equals( name ) )
161
			{
170
			{
162
				String resultTextAlign = BidiAlignmentResolver.getDefaultAlignment( handle.getBidiOrientation( ) );
171
				String resultTextAlign = BidiAlignmentResolver.getDefaultAlignment( handle.getBidiOrientation( ) );
Lines 165-175 Link Here
165
					// The default textAlign value of the report is null. And
174
					// The default textAlign value of the report is null. And
166
					// the default table head should be center. So we can't
175
					// the default table head should be center. So we can't
167
					// change the null value to the left.
176
					// change the null value to the left.
177
					
168
					resultTextAlign = null;
178
					resultTextAlign = null;
169
				}
179
				}
170
				return resultTextAlign;
180
				return resultTextAlign;
171
			}
181
			}
172
182
			*/
173
			if ( IStyleModel.TEXT_DIRECTION_PROP.equals( name ) )
183
			if ( IStyleModel.TEXT_DIRECTION_PROP.equals( name ) )
174
				return handle.isDirectionRTL( )
184
				return handle.isDirectionRTL( )
175
						? DesignChoiceConstants.BIDI_DIRECTION_RTL
185
						? DesignChoiceConstants.BIDI_DIRECTION_RTL
(-)src/org/eclipse/birt/report/engine/layout/pdf/cache/ClonedCellContent.java (+10 lines)
Lines 26-31 Link Here
26
import org.eclipse.birt.report.engine.content.IReportContent;
26
import org.eclipse.birt.report.engine.content.IReportContent;
27
import org.eclipse.birt.report.engine.content.IStyle;
27
import org.eclipse.birt.report.engine.content.IStyle;
28
import org.eclipse.birt.report.engine.css.engine.CSSEngine;
28
import org.eclipse.birt.report.engine.css.engine.CSSEngine;
29
import org.eclipse.birt.report.engine.css.engine.value.birt.BIRTConstants;
29
import org.eclipse.birt.report.engine.ir.DimensionType;
30
import org.eclipse.birt.report.engine.ir.DimensionType;
30
31
31
/**
32
/**
Lines 336-339 Link Here
336
		return new ClonedCellContent(this, rowSpan);
337
		return new ClonedCellContent(this, rowSpan);
337
	}
338
	}
338
339
340
	/* (non-Javadoc)
341
	 * @see org.eclipse.birt.report.engine.content.IContent#isOrientationRTL()
342
	 */
343
	public boolean isRTL( )
344
	{
345
		// bidi_hcg
346
		return cellContent.isRTL( );
347
	}
348
339
}
349
}
(-)src/org/eclipse/birt/report/engine/layout/pdf/cache/TableAreaLayout.java (-56 / +18 lines)
Lines 72-77 Link Here
72
		this.layoutInfo = layoutInfo;
72
		this.layoutInfo = layoutInfo;
73
		this.startCol = startCol;
73
		this.startCol = startCol;
74
		this.endCol = endCol;
74
		this.endCol = endCol;
75
		if ( tableContent != null )
76
			bcr.setRTL( tableContent.isRTL( ) );
75
	}
77
	}
76
	
78
	
77
	public void initTableLayout(UnresolvedRowHint hint)
79
	public void initTableLayout(UnresolvedRowHint hint)
Lines 211-221 Link Here
211
		IStyle leftCellContentStyle = null;
213
		IStyle leftCellContentStyle = null;
212
		IStyle topCellStyle = null;
214
		IStyle topCellStyle = null;
213
215
214
		// bidi_hcg start
215
		boolean rtl = tableContent.getReportContent( ).getDesign( )
216
				.getReportDesign( ).isDirectionRTL( ); 
217
		// bidi_hcg end
218
219
		Row lastRow = null;
216
		Row lastRow = null;
220
		if(rows.size( )>0 )
217
		if(rows.size( )>0 )
221
		{
218
		{
Lines 251-289 Link Here
251
			// resolve left border
248
			// resolve left border
252
			if ( columnID == startCol )
249
			if ( columnID == startCol )
253
			{
250
			{
254
				// bidi_hcg start
251
				bcr.resolveTableLeftBorder( tableStyle, rowStyle, columnStyle,
255
				if ( rtl )
252
						cellContentStyle, cellAreaStyle );
256
				{
257
					bcr.resolveTableRightBorder( tableStyle, rowStyle,
258
							columnStyle, cellContentStyle, cellAreaStyle );
259
					bcr.resolveCellLeftBorder( preColumnStyle, columnStyle,
260
							leftCellContentStyle, cellContentStyle,
261
							cellAreaStyle );
262
				}
263
				else
264
				// bidi_hcg end
265
					bcr.resolveTableLeftBorder( tableStyle, rowStyle, columnStyle,
266
							cellContentStyle, cellAreaStyle );
267
			}
253
			}
268
			else
254
			else
269
			{
255
			{
270
				if ( !rtl || columnID + colSpan - 1 != endCol ) // bidi_hcg
256
				bcr.resolveCellLeftBorder( preColumnStyle, columnStyle,
271
					bcr.resolveCellLeftBorder( preColumnStyle, columnStyle,
257
					leftCellContentStyle, cellContentStyle, cellAreaStyle );
272
						leftCellContentStyle, cellContentStyle, cellAreaStyle );
273
			}
258
			}
274
259
275
			// resovle right border
260
			// resovle right border
276
261
277
			if ( columnID + colSpan - 1 == endCol )
262
			if ( columnID + colSpan - 1 == endCol )
278
			{
263
			{
279
				// bidi_hcg start
264
				bcr.resolveTableRightBorder( tableStyle, rowStyle, columnStyle,
280
				if ( rtl )
265
						cellContentStyle, cellAreaStyle );
281
					bcr.resolveTableLeftBorder( tableStyle, rowStyle,
282
							columnStyle, cellContentStyle, cellAreaStyle );
283
				else
284
				// bidi_hcg end
285
					bcr.resolveTableRightBorder( tableStyle, rowStyle, columnStyle,
286
							cellContentStyle, cellAreaStyle );
287
			}
266
			}
288
267
289
		}
268
		}
Lines 304-341 Link Here
304
			{
283
			{
305
				// first column
284
				// first column
306
285
307
				// bidi_hcg start
286
				bcr.resolveTableLeftBorder( tableStyle, rowStyle, columnStyle,
308
				if ( rtl )
287
					cellContentStyle, cellAreaStyle );
309
				{
310
					bcr.resolveTableRightBorder( tableStyle, rowStyle,
311
							columnStyle, cellContentStyle, cellAreaStyle );
312
					bcr.resolveCellLeftBorder( preColumnStyle, columnStyle,
313
							leftCellContentStyle, cellContentStyle,
314
							cellAreaStyle );
315
				}
316
				else
317
				// bidi_hcg end
318
					bcr.resolveTableLeftBorder( tableStyle, rowStyle, columnStyle,
319
						cellContentStyle, cellAreaStyle );
320
			}
288
			}
321
			else
289
			else
322
			{
290
			{
323
				// TODO fix row span conflict
291
				// TODO fix row span conflict
324
				if ( !rtl || columnID + colSpan - 1 != endCol ) // bidi_hcg
292
				bcr.resolveCellLeftBorder( preColumnStyle, columnStyle,
325
					bcr.resolveCellLeftBorder( preColumnStyle, columnStyle,
293
						leftCellContentStyle, cellContentStyle, cellAreaStyle );
326
							leftCellContentStyle, cellContentStyle, cellAreaStyle );
327
			}
294
			}
328
			// resolve right border
295
			// resolve right border
329
			if ( columnID + colSpan-1 == endCol )
296
			if ( columnID + colSpan-1 == endCol )
330
			{
297
			{
331
				// bidi_hcg start
298
				bcr.resolveTableRightBorder( tableStyle, rowStyle, columnStyle,
332
				if ( rtl )
299
					cellContentStyle, cellAreaStyle );
333
					bcr.resolveTableLeftBorder( tableStyle, rowStyle,
334
							columnStyle, cellContentStyle, cellAreaStyle );
335
				else
336
				// bidi_hcg end
337
					bcr.resolveTableRightBorder( tableStyle, rowStyle, columnStyle,
338
						cellContentStyle, cellAreaStyle );
339
			}
300
			}
340
		}
301
		}
341
		
302
		
Lines 414-422 Link Here
414
		}
375
		}
415
		
376
		
416
		CSSValue align = content.getComputedStyle( ).getProperty( IStyle.STYLE_TEXT_ALIGN );
377
		CSSValue align = content.getComputedStyle( ).getProperty( IStyle.STYLE_TEXT_ALIGN );
378
		boolean isRightAligned = IStyle.RIGHT_VALUE.equals(  align )
379
				|| IStyle.JUSTIFY_VALUE.equals( align ) && content.isRTL( ); // bidi_hcg
417
		// single line
380
		// single line
418
		if ( ( IStyle.RIGHT_VALUE.equals(  align ) || IStyle.CENTER_VALUE
381
		if ( ( isRightAligned || IStyle.CENTER_VALUE.equals( align ) ) )
419
				.equals( align ) ) )
420
		{
382
		{
421
			
383
			
422
			Iterator iter = cell.getChildren( );
384
			Iterator iter = cell.getChildren( );
Lines 426-432 Link Here
426
				int spacing = cell.getContentWidth( ) - area.getAllocatedWidth( ) ;
388
				int spacing = cell.getContentWidth( ) - area.getAllocatedWidth( ) ;
427
				if(spacing>0)
389
				if(spacing>0)
428
				{
390
				{
429
					if ( IStyle.RIGHT_VALUE.equals( align ) )
391
					if ( isRightAligned )
430
					{
392
					{
431
						area.setAllocatedPosition( spacing + area.getAllocatedX( ),
393
						area.setAllocatedPosition( spacing + area.getAllocatedX( ),
432
								area.getAllocatedY( ) );
394
								area.getAllocatedY( ) );
(-)src/org/eclipse/birt/report/engine/content/IContent.java (+2 lines)
Lines 194-197 Link Here
194
	void readContent( DataInputStream in, ClassLoader loader ) throws IOException;
194
	void readContent( DataInputStream in, ClassLoader loader ) throws IOException;
195
	
195
	
196
	IContent cloneContent(boolean isDeep);
196
	IContent cloneContent(boolean isDeep);
197
198
	boolean isRTL( ); // bidi_hcg
197
}
199
}
(-)src/org/eclipse/birt/report/engine/content/impl/AbstractContent.java (+21 lines)
Lines 27-32 Link Here
27
import org.eclipse.birt.report.engine.css.dom.ComputedStyle;
27
import org.eclipse.birt.report.engine.css.dom.ComputedStyle;
28
import org.eclipse.birt.report.engine.css.dom.StyleDeclaration;
28
import org.eclipse.birt.report.engine.css.dom.StyleDeclaration;
29
import org.eclipse.birt.report.engine.css.engine.CSSEngine;
29
import org.eclipse.birt.report.engine.css.engine.CSSEngine;
30
import org.eclipse.birt.report.engine.css.engine.value.css.CSSConstants;
30
import org.eclipse.birt.report.engine.ir.DimensionType;
31
import org.eclipse.birt.report.engine.ir.DimensionType;
31
import org.eclipse.birt.report.engine.ir.ReportItemDesign;
32
import org.eclipse.birt.report.engine.ir.ReportItemDesign;
32
import org.eclipse.birt.report.engine.ir.StyledElementDesign;
33
import org.eclipse.birt.report.engine.ir.StyledElementDesign;
Lines 758-761 Link Here
758
	}
759
	}
759
	
760
	
760
	protected abstract IContent cloneContent();
761
	protected abstract IContent cloneContent();
762
763
	/*
764
	 * (non-Javadoc)
765
	 * 
766
	 * @see org.eclipse.birt.report.engine.content.IContent#isOrientationRTL()
767
	 */
768
	public boolean isRTL( )
769
	{
770
		// bidi_hcg
771
		IReportContent reportContent = getReportContent( );
772
		if ( reportContent != null )
773
		{
774
			IContent rootContent = reportContent.getRoot( );
775
			if ( rootContent != null )
776
				return CSSConstants.CSS_RTL_VALUE.equals( rootContent
777
						.getStyle( ).getDirection( ) );
778
		}
779
		return false;
780
	}
781
761
}
782
}
(-)src/org/eclipse/birt/report/engine/layout/pdf/BorderConflictResolver.java (-16 / +35 lines)
Lines 65-70 Link Here
65
65
66
	final static int POSITION_BOTTOM = 3;
66
	final static int POSITION_BOTTOM = 3;
67
67
68
	private static int POSITION_LEAD = POSITION_LEFT;
69
70
	private static int POSITION_TRAIL = POSITION_RIGHT;
71
68
	static HashMap<Value, Integer> styleMap = null;
72
	static HashMap<Value, Integer> styleMap = null;
69
	static
73
	static
70
	{
74
	{
Lines 107-117 Link Here
107
			IStyle columnLeft, IStyle cellLeft, IStyle usedStyle )
111
			IStyle columnLeft, IStyle cellLeft, IStyle usedStyle )
108
	{
112
	{
109
		resolveBorder( tableLeftBorderCache, new BorderStyleInfo[]{
113
		resolveBorder( tableLeftBorderCache, new BorderStyleInfo[]{
110
				new BorderStyleInfo( cellLeft, POSITION_LEFT ),
114
				new BorderStyleInfo( cellLeft, POSITION_LEAD ),
111
				new BorderStyleInfo( columnLeft, POSITION_LEFT ),
115
				new BorderStyleInfo( columnLeft, POSITION_LEAD ),
112
				new BorderStyleInfo( rowLeft, POSITION_LEFT ),
116
				new BorderStyleInfo( rowLeft, POSITION_LEAD ),
113
				new BorderStyleInfo( tableLeft, POSITION_LEFT )},
117
				new BorderStyleInfo( tableLeft, POSITION_LEAD )},
114
				new BorderStyleInfo( usedStyle, POSITION_LEFT ) );
118
				new BorderStyleInfo( usedStyle, POSITION_LEAD ) );
115
	}
119
	}
116
120
117
	protected BorderCache tableTopBorderCache = new BorderCache( 4 );
121
	protected BorderCache tableTopBorderCache = new BorderCache( 4 );
Lines 195-205 Link Here
195
			IStyle columnRight, IStyle cellRight, IStyle usedStyle )
199
			IStyle columnRight, IStyle cellRight, IStyle usedStyle )
196
	{
200
	{
197
		resolveBorder( tableRightBorderCache, new BorderStyleInfo[]{
201
		resolveBorder( tableRightBorderCache, new BorderStyleInfo[]{
198
				new BorderStyleInfo( cellRight, POSITION_RIGHT ),
202
				new BorderStyleInfo( cellRight, POSITION_TRAIL ),
199
				new BorderStyleInfo( columnRight, POSITION_RIGHT ),
203
				new BorderStyleInfo( columnRight, POSITION_TRAIL ),
200
				new BorderStyleInfo( rowRight, POSITION_RIGHT ),
204
				new BorderStyleInfo( rowRight, POSITION_TRAIL ),
201
				new BorderStyleInfo( tableRight, POSITION_RIGHT )},
205
				new BorderStyleInfo( tableRight, POSITION_TRAIL )},
202
				new BorderStyleInfo( usedStyle, POSITION_RIGHT ) );
206
				new BorderStyleInfo( usedStyle, POSITION_TRAIL ) );
203
	}
207
	}
204
208
205
	protected BorderCache cellLeftBorderCache = new BorderCache( 4 );
209
	protected BorderCache cellLeftBorderCache = new BorderCache( 4 );
Lines 219-229 Link Here
219
			IStyle usedStyle )
223
			IStyle usedStyle )
220
	{
224
	{
221
		resolveBorder( cellLeftBorderCache, new BorderStyleInfo[]{
225
		resolveBorder( cellLeftBorderCache, new BorderStyleInfo[]{
222
				new BorderStyleInfo( preCellRight, POSITION_RIGHT ),
226
				new BorderStyleInfo( preCellRight, POSITION_TRAIL ),
223
				new BorderStyleInfo( cellLeft, POSITION_LEFT ),
227
				new BorderStyleInfo( cellLeft, POSITION_LEAD ),
224
				new BorderStyleInfo( preColumnRight, POSITION_RIGHT ),
228
				new BorderStyleInfo( preColumnRight, POSITION_TRAIL ),
225
				new BorderStyleInfo( columnLeft, POSITION_LEFT )},
229
				new BorderStyleInfo( columnLeft, POSITION_LEAD )},
226
				new BorderStyleInfo( usedStyle, POSITION_LEFT ) );
230
				new BorderStyleInfo( usedStyle, POSITION_LEAD ) );
227
	}
231
	}
228
232
229
	protected BorderCache cellTopBorderCache = new BorderCache( 4 );
233
	protected BorderCache cellTopBorderCache = new BorderCache( 4 );
Lines 331-336 Link Here
331
		}
335
		}
332
	}
336
	}
333
337
338
	public void setRTL( boolean rtl )
339
	{
340
		if ( rtl )
341
		{
342
			POSITION_LEAD = POSITION_RIGHT;
343
			POSITION_TRAIL = POSITION_LEFT;
344
		}
345
		else
346
		{
347
			// XXX currently useless
348
			POSITION_LEAD = POSITION_LEFT;
349
			POSITION_TRAIL = POSITION_RIGHT;
350
		}
351
	}
352
334
	protected class BorderStyleInfo
353
	protected class BorderStyleInfo
335
	{
354
	{
336
355
Lines 394-400 Link Here
394
			setBorderColor( color );
413
			setBorderColor( color );
395
		}
414
		}
396
	}
415
	}
397
416
	
398
	private static class BorderCache
417
	private static class BorderCache
399
	{
418
	{
400
419
(-)src/org/eclipse/birt/report/engine/layout/pdf/PDFTableLM.java (-12 / +10 lines)
Lines 1053-1076 Link Here
1053
			this.xPositions = new int[columnNumber];
1053
			this.xPositions = new int[columnNumber];
1054
			this.tableWidth = 0;
1054
			this.tableWidth = 0;
1055
1055
1056
			// bidi_hcg start
1056
			if ( tableContent.isRTL( ) ) // bidi_hcg
1057
			boolean rtl = tableContent.getReportContent( ).getDesign( )
1058
					.getReportDesign( ).isDirectionRTL( ); 
1059
			// bidi_hcg end
1060
1061
			for ( int i = 0; i < columnNumber; i++ )
1062
			{
1057
			{
1063
				// bidi_hcg start
1058
				for ( int i = 0; i < columnNumber; i++ )
1064
				if ( rtl )
1065
				{
1059
				{
1066
					xPositions[i] = parent.getCurrentMaxContentWidth( ) - tableWidth
1060
					xPositions[i] = parent.getCurrentMaxContentWidth( ) - tableWidth
1067
 						- colWidth[i];
1061
 						- colWidth[i];
1062
					tableWidth += colWidth[i];
1068
				}
1063
				}
1069
				// bidi_hcg end
1064
			}
1070
				else // ltr
1065
			else // ltr
1066
			{
1067
				for ( int i = 0; i < columnNumber; i++ )
1068
				{
1071
					xPositions[i] = tableWidth;
1069
					xPositions[i] = tableWidth;
1072
1070
					tableWidth += colWidth[i];
1073
				tableWidth += colWidth[i];
1071
				}
1074
			}
1072
			}
1075
1073
1076
		}
1074
		}
(-)src/org/eclipse/birt/report/engine/emitter/html/AttributeBuilder.java (-7 / +2 lines)
Lines 694-708 Link Here
694
		if ( style != null )
694
		if ( style != null )
695
		{
695
		{
696
			String direction = style.getDirection();
696
			String direction = style.getDirection();
697
	
698
			if ( direction != null )
697
			if ( direction != null )
699
			{
698
			{
700
				if ( CSSConstants.CSS_RTL_VALUE.equals( direction ) )
699
				buildProperty( styleBuffer, IStyle.CSS_DIRECTION_PROPERTY,
701
					buildProperty( styleBuffer, IStyle.CSS_DIRECTION_PROPERTY,
700
							direction );
702
							IStyle.CSS_RTL_VALUE );
703
				else if ( CSSConstants.CSS_LTR_VALUE.equals( direction ) )
704
					buildProperty( styleBuffer, IStyle.CSS_DIRECTION_PROPERTY,
705
							IStyle.CSS_LTR_VALUE );
706
			}
701
			}
707
		}
702
		}
708
	}
703
	}

Return to bug 225536