Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 225536

Summary: [Bidi] Support global orientation of report output
Product: z_Archived Reporter: Lina Kemmel <Lina.Kemmel>
Component: BIRTAssignee: Liang Yu <yliang>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: clin, fira, foxm, jouyang, khouly, mfadl, rlu, salexb, wenfeng.fwd, whe, wyan
Version: 2.3.0Keywords: plan
Target Milestone: 2.3.0 RC1Flags: wenfeng.fwd: iplog+
wenfeng.fwd: pmc_approved+
wenfeng.fwd: pmc_approved+
Hardware: PC   
OS: Windows All   
Whiteboard:
Bug Depends on:    
Bug Blocks: 223345, 228244    
Attachments:
Description Flags
Patch for Viewer
none
Patch for HTML emitter
bjorn.freeman-benson: iplog+, Lina.Kemmel: review?
Patch for WPML emitter
none
Patch for WPML emitter
bjorn.freeman-benson: iplog+, Lina.Kemmel: review?
Patch for Excel emitter
bjorn.freeman-benson: iplog+, Lina.Kemmel: review?
Patch for PDF, PPT and POSTSCRIPT emitters
bjorn.freeman-benson: iplog+, Lina.Kemmel: review?
Patch for Viewer revised
bjorn.freeman-benson: iplog+, Lina.Kemmel: review?
Patch to consolidate naming of Bidi constants and fix PPT presentation
bjorn.freeman-benson: iplog+, Lina.Kemmel: review?
Patch fix for engine
bjorn.freeman-benson: iplog+, Lina.Kemmel: review?
Patch for regression in default text-align in RTL report bjorn.freeman-benson: iplog+, Lina.Kemmel: review?

Description Lina Kemmel CLA 2008-04-03 07:51:31 EDT
Orientation of report output is expected to be either left-to-right (LTR) or right-to-left (RTL), following the orientation settings of the report design.

The following output formats should be addressed: PDF, HTML, DOC (ML), XLS (ML), PPT (MHTML), and PS (POSTSCRIPT).

Please refer to attachment 93940 [details] of bug 222170 (section 3.2.4) or attachment 92044 [details] of bug 222072 (section 3.2.3). (This section will be renamed to be "Report rendering".)
Comment 1 Lina Kemmel CLA 2008-04-10 17:44:28 EDT
Created attachment 95596 [details]
Patch for Viewer
Comment 2 Lina Kemmel CLA 2008-04-10 17:54:30 EDT
Created attachment 95598 [details]
Patch for HTML emitter
Comment 3 Lina Kemmel CLA 2008-04-11 08:56:25 EDT
I am unable to verify further patches after CVS update, because of some problem probably related to the preview Viewer servlet mapping. Will try to figure out if this is a known problem and how it can be solved.
Comment 4 Lina Kemmel CLA 2008-04-15 16:08:37 EDT
Created attachment 96157 [details]
Patch for WPML emitter
Comment 5 Lina Kemmel CLA 2008-04-15 16:19:55 EDT
Created attachment 96159 [details]
Patch for WPML emitter
Comment 6 Lina Kemmel CLA 2008-04-16 12:49:56 EDT
Created attachment 96282 [details]
Patch for Excel emitter
Comment 7 Lina Kemmel CLA 2008-04-16 14:26:03 EDT
Created attachment 96299 [details]
Patch for PDF, PPT and POSTSCRIPT emitters

Aims to provide right-to-left table layout through physical mirroring of table element X positions. Also, handles border resolution for RTL tables.

Note that Bidi text reordering changes are out of scope and will be handled in a separate bug later.
Comment 8 Lina Kemmel CLA 2008-04-18 16:06:29 EDT
Created attachment 96652 [details]
Patch for Viewer revised

Compared to attachment 95596 [details], includes a change for the example Viewer to rely on design orientation as opposed to the IDE orientation when rendering report.
Comment 9 Lina Kemmel CLA 2008-04-18 16:09:11 EDT
Apologies, this change applies to report output in general, not just example Viewer.
Comment 10 Lina Kemmel CLA 2008-04-28 13:01:40 EDT
The IP review is complete, and this submission is now approved.
Please refer to
https://dev.eclipse.org/ipzilla/show_bug.cgi?id=2260
Comment 11 Lina Kemmel CLA 2008-04-29 10:19:16 EDT
As it seems the PDF part of the code base was noticeably refactored, we will need to migrate related changes to the new code base and resubmit attachment 96299 [details].
There wouldn't be significant changes - just relocation of codes.
Has this attachment been reviewed?
Comment 12 JingwenShen CLA 2008-05-08 04:48:22 EDT
add bidi support for excel and word
Comment 13 Liang Yu CLA 2008-05-12 03:28:04 EDT
Fixed.
Comment 14 Lina Kemmel CLA 2008-05-13 09:55:53 EDT
Created attachment 99946 [details]
Patch to consolidate naming of Bidi constants and fix PPT presentation

Respect CSS naming convention for direction constants ("ltr"/"rtl"); remove all occurrences of the old values ("Right To Left"/"Left To Right").

Also, eliminate flipping of text being output to PPT.
Comment 15 Rick Lu CLA 2008-05-15 01:35:56 EDT
Patched BIDI messages file change into report.model plug-in.
Comment 16 Jun Ouyang CLA 2008-05-15 02:22:42 EDT
Apply the patch for the engine part.
There is a modification in order not to flip text in PPT emitter, I refactor the code as following:
1. Revert the modificatin for ITextArea.getText(boolean) to ITextArea.getText() and also remove the logic in the method related with "dontFlip"
2. Add method ITextArea.getLogicalOrderText() to get unflipped text.
3. Override the method drawTextAt( ITextArea text, int x, int y, int width,
int height, TextStyle textStyle ) in PPTRender so that unflipped text will be write to ppt graphic.

After refactoring, there is no hard code in PageDeviceRender for ppt.
Comment 17 Lina Kemmel CLA 2008-05-15 04:17:52 EDT
Thank you very much. This looks much nicer.

Actually, I initially meant to do the following:
1. Modify TextArea.getText() implementation to always return logical text.
2. Move #flip() to the superclass renderer.
3. Override #flip() of the PPT renderer to return the text as-is.
3. Call both TextArea.getText() and then #flip() from drawTextAt.
(That was not done since for some reason I decided that adding a flag will be more consistent with the previous implementation.)


Comment 18 Lina Kemmel CLA 2008-05-25 12:36:30 EDT
Created attachment 101888 [details]
Patch fix for engine

The patch includes the following changes:

- for PDF emitter:
1. Replicated Bidi changes from org/eclipse/birt/report/engine/layout/pdf/cache to org/eclipse/birt/report/engine/layout/pdf/emitter. (Currently the latter seems to be in use. Not sure if we can remove them from the former.)
2. Reworked border resolution for right-to-left table.
3. Defined a new method org.eclipse.birt.report.engine.content.
IContent#isRTL(), which examines the global orientation of report content.
4. Added its implementation in subclasses.

- for parser:
1. Set textAlign default to null in right-to-left direction as well, in StylePropertyMapping.

- for the HTML emitter:
1. Simplify direction property building (assuming no validation is necessary at this point).
Comment 19 Lina Kemmel CLA 2008-06-04 13:21:08 EDT
Created attachment 103603 [details]
Patch for regression in default text-align in RTL report

Following regression testing results, I attach a small patch to revert the default 'text-align' for RTL reports. Elements supposed to default to 'center' should be still worked.
Comment 20 Bjorn Freeman-Benson CLA 2008-06-18 16:06:20 EDT
Comment on attachment 95598 [details]
Patch for HTML emitter

per Ganymede IP log
Comment 21 Bjorn Freeman-Benson CLA 2008-06-18 16:06:25 EDT
Comment on attachment 96159 [details]
Patch for WPML emitter

per Ganymede IP log
Comment 22 Bjorn Freeman-Benson CLA 2008-06-18 16:06:31 EDT
Comment on attachment 96282 [details]
Patch for Excel emitter

per Ganymede IP log
Comment 23 Bjorn Freeman-Benson CLA 2008-06-18 16:06:33 EDT
Comment on attachment 96299 [details]
Patch for PDF, PPT and POSTSCRIPT emitters

per Ganymede IP log
Comment 24 Bjorn Freeman-Benson CLA 2008-06-18 16:06:37 EDT
Comment on attachment 96652 [details]
Patch for Viewer revised

per Ganymede IP log
Comment 25 Bjorn Freeman-Benson CLA 2008-06-18 16:06:43 EDT
Comment on attachment 99946 [details]
Patch to consolidate naming of Bidi constants and fix PPT presentation

per Ganymede IP log
Comment 26 Bjorn Freeman-Benson CLA 2008-06-18 16:06:47 EDT
Comment on attachment 101888 [details]
Patch fix for engine

per Ganymede IP log
Comment 27 Bjorn Freeman-Benson CLA 2008-06-18 16:06:52 EDT
Comment on attachment 103603 [details]
Patch for regression in default text-align in RTL report

per Ganymede IP log
Comment 28 Lina Kemmel CLA 2008-06-22 06:22:02 EDT
Closing