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

support "justifyLastLine" #4374

Closed
YoheiZuho opened this issue Feb 18, 2025 · 6 comments
Closed

support "justifyLastLine" #4374

YoheiZuho opened this issue Feb 18, 2025 · 6 comments

Comments

@YoheiZuho
Copy link
Contributor

justifyLastLine” is a flag used for the ‘Justify Distributed’ option, which is enabled only when the value of ‘Horizontal’ in the EXCEL setting ‘FormatCells’ is ‘Distributed’. When the option is enabled, an indent of a certain width is added before and after the text in the cell.
This option is often used in Japanese-speaking countries.

Setting Dialog:
Image

If enable "Justify distributed":
Image

If disable "Justify distributed":
Image

I have already sent a pull request for support for this feature.
#4373

Thank you.
(As I am not a native English speaker, I apologize for any inappropriate expressions or missing explanations.)

@oleibman
Copy link
Collaborator

I am not able to see any difference in the versions of Excel that I have access to. My spreadsheet looks like your "Enable justify distributed" whether or not I check the box. Would it be possible for you to upload a spreadsheet demonstrating the difference? Also, what version of Excel are you using? (I tried with 2013 and 365.)

FWIW, here's the Xml for my spreadsheet (the yellow fill just helped me understand what style was in effect):

<xf numFmtId="0" fontId="0" fillId="0" borderId="0" xfId="0" applyAlignment="1">
<alignment horizontal="distributed"/>
</xf>
<xf numFmtId="0" fontId="0" fillId="2" borderId="0" xfId="0" applyFill="1" applyAlignment="1">
<alignment horizontal="distributed" justifyLastLine="1"/>
</xf>

And here's what it looks like on my system:

Image

@YoheiZuho
Copy link
Contributor Author

I'm using office 365.

I noticed when I looked at your XML that vertical="center" seems to be added automatically in mine. (I don't know if this is related to the difference in events)
The contents of my styles.xml in question are as follows.
I have also attached the XLSX file and a screenshot of when this file is opened.

        <xf numFmtId="0" fontId="0" fillId="0" borderId="0" xfId="0" applyAlignment="1">
            <alignment horizontal="distributed" vertical="center" justifyLastLine="1"/>
        </xf>
        <xf numFmtId="0" fontId="0" fillId="0" borderId="0" xfId="0" applyAlignment="1">
            <alignment horizontal="distributed" vertical="center"/>
        </xf>

Image

Book1.xlsx

@oleibman
Copy link
Collaborator

This is using my copy of 365. It's very frustrating.

Image

@YoheiZuho
Copy link
Contributor Author

YoheiZuho commented Feb 19, 2025

Apparently, this display will not appear unless Japanese is set to "preffered'' in "Office authoring languages ​​and proofing'' in the settings.
I got the same thing when I set this to English.
Image

English:

Image

Japanese:

Image

@oleibman
Copy link
Collaborator

I am glad you were able to figure that out. Your PR still needs some work, but I doubt I will have a problem merging it when it is ready.

@oleibman
Copy link
Collaborator

Fixed by merge of PR #4373.

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

No branches or pull requests

2 participants