Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix right to left issues #356

Merged
merged 3 commits into from
Jul 16, 2017
Merged

Conversation

alitaheri
Copy link
Contributor

Adds a new property to sheet view. And fixes readingOrder as it wasn't doing anything for 2 reasons:

  1. The values were set wrong.
  2. The keys were l2r and r2l instead of the document ltr and rtl ones.

Closes #72
Closes #126

@@ -43,6 +43,7 @@ utils.inherits(SheetViewXform, BaseXform, {
xmlStream.addAttribute(name, value);
}
};
add('rightToLeft', '1', model.rtl === true);
Copy link
Collaborator

Choose a reason for hiding this comment

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

there needs to be a corresponding line in the parseOpen function or it won't be able to read files properly

Copy link
Collaborator

Choose a reason for hiding this comment

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

Also - could you add this property to the unit test:
in spec/unit/xlsx/xform/sheet/sheet-view-xform.spec.js

{k: 'l2r', v: 2},
{k: Enums.ReadingOrder.RightToLeft, v: 1},
{k: Enums.ReadingOrder.LeftToRight, v: 2}
{k: 'rtl', v: 2},
Copy link
Collaborator

Choose a reason for hiding this comment

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

Would you be able to add a unit test for these changes?
in spec/unit/xlsx/xform/style/alignment-xform.spec.js

@alitaheri
Copy link
Contributor Author

@guyonroche I made the requested changes.

I also renamed rtl to rightToLeft to make it consistent with other props.

Copy link
Collaborator

@guyonroche guyonroche left a comment

Choose a reason for hiding this comment

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

LGTM

@guyonroche guyonroche merged commit 4916ead into exceljs:master Jul 16, 2017
@alitaheri alitaheri deleted the support-rtl-sheet branch July 16, 2017 07:50
@pouyakary
Copy link

@alitaheri what a small world!

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.

Adding an option to set RTL worksheet Add option to RTL file
3 participants