Skip to content

RTL support when using Apache POI with openPdf#729

Open
nucleussoftwareopen wants to merge 1 commit into
opensagres:masterfrom
nucleussoftwareopen:XDocReport-Main
Open

RTL support when using Apache POI with openPdf#729
nucleussoftwareopen wants to merge 1 commit into
opensagres:masterfrom
nucleussoftwareopen:XDocReport-Main

Conversation

@nucleussoftwareopen
Copy link
Copy Markdown
Contributor

No description provided.

Copy link
Copy Markdown
Collaborator

@kevinleturc kevinleturc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could a test be added?


// writing-mode
String writingMode = ele.getStyleWritingModeAttribute();
if ( StringUtils.isNotEmpty( writingMode ) ){
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if ( StringUtils.isNotEmpty( writingMode ) ){
if ( StringUtils.isNotEmpty( writingMode ) )
{


// writing-mode
String writingMode = ele.getStyleWritingModeAttribute();
if ( StringUtils.isNotEmpty( writingMode ) ){
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if ( StringUtils.isNotEmpty( writingMode ) ){
if ( StringUtils.isNotEmpty( writingMode ) )
{

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add a Copyright header like other files and a new line at the end of the file?

@@ -0,0 +1,25 @@
package fr.opensagres.poi.xwpf.converter.core.styles.table;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add a Copyright header like other files and a new line at the end of the file?

Comment on lines +38 to +39
import fr.opensagres.poi.xwpf.converter.core.styles.paragraph.ParagraphRunDirectionProvider;
import fr.opensagres.poi.xwpf.converter.core.styles.table.TableRunDirectionValueProvider;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could the import be moved next to other fr.opensagres and ordered?

}

/*enabling bidirectional support*/
public CTOnOff getParagraphRunDirection(XWPFParagraph docxParagraph) {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
public CTOnOff getParagraphRunDirection(XWPFParagraph docxParagraph) {
public CTOnOff getParagraphRunDirection( XWPFParagraph docxParagraph )
{

}

/*enabling bidirectional support*/
public CTOnOff getTableRunDirection(XWPFTable table )
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
public CTOnOff getTableRunDirection(XWPFTable table )
public CTOnOff getTableRunDirection( XWPFTable table )

import java.util.Map;
import java.util.logging.Logger;

import com.lowagie.text.pdf.PdfWriter;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could it be moved next to other com.lowagie and ordered?

Comment on lines +199 to +205
public String getWritingMode() {
return writingMode;
}

public void setWritingMode(String writingMode) {
this.writingMode = writingMode;
}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
public String getWritingMode() {
return writingMode;
}
public void setWritingMode(String writingMode) {
this.writingMode = writingMode;
}
public String getWritingMode()
{
return writingMode;
}
public void setWritingMode( String writingMode )
{
this.writingMode = writingMode;
}

Comment on lines +225 to +231
// Support for writing mode i.e. LTR OR RTL
String writingMode = tableProperties.getWritingMode();
if ( writingMode != null && writingMode.equals("rl-tb"))
{
// RTL
super.setRunDirection(PdfWriter.RUN_DIRECTION_RTL);
}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's no else block compared to StylableParagraph, should it be added there?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants