Apache OpenOffice (AOO) Bugzilla – Full Text Issue Listing |
Summary: | [From Symphony]text alignment changed from left to center when importing the docx | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Product: | Writer | Reporter: | zongdj <zongdongjun> | ||||||||||||
Component: | formatting | Assignee: | mayongl <mayongl> | ||||||||||||
Status: | CLOSED FIXED | QA Contact: | |||||||||||||
Severity: | Normal | ||||||||||||||
Priority: | P3 | CC: | binbjguo, liushenf, mayongl, tldyzem, yanji.yj | ||||||||||||
Version: | 3.4.0 Beta (OOo) | ||||||||||||||
Target Milestone: | 4.0.0 | ||||||||||||||
Hardware: | PC | ||||||||||||||
OS: | All | ||||||||||||||
Issue Type: | DEFECT | Latest Confirmation in: | --- | ||||||||||||
Developer Difficulty: | --- | ||||||||||||||
Attachments: |
|
In the sample, the issued paragraph been applied with Title style, and the definition for the Title style use the alignment of Left by default. And also, in OOXML file, the title style has no <w:jc> settings in style.xml, which the token represent the alignment property, and no settings means set to left. But in AOO, if no <w:jc> information been read from OOXML file, the default value of center will be applied, so the problem occurred. So does the Subtitle style. The possible values of <w:jc> are: both: Justified center: Align Center left: Align Left right: Align Right distribute: Distribute All Characters Equally highKashida: Widest Kashida Length lowKashida: Low Kashida Length mediumKashida: Medium Kashida Length numTab: Align to list tab thaiDistribute: Thai Language Justification Created attachment 77979 [details]
code patch for default paragraph alignment
Code change to solve the problem for default paragraph styles alignment
Created attachment 77987 [details]
Patch for paragraph alignment issue
Created attachment 77988 [details]
Patch for paragraph alignment issue
Created attachment 77990 [details]
UT case been tested
The attachment include the UT case for this issues, and I mainly focus on the Paragraph style with Title and Subtitle, which I fixed in code.
Root cause: The default paragraph alignment settings in OOXML is different from AOO's settings, if no property set in OOXML file for para align, it means align left been applied, which is center in AOO. Solution: Before we import Title and Subtitle style, we put the para alignment with Left in, so we can keep the default value for these 2 paragraph styles. UT: Please refer to the UT samples in attachment. reproduced issue Review passed. Reviewed, tested, and applied the patch. SVN revision is 1347586. Verified it on Aoo_Trunk_20120616.1800.1350879 and it does not reproduce, so close it as fixed. set Target Milestone to AOO 3.5.0 for PM purpose. |
Created attachment 77648 [details] sample file for this bug Build: Aoo3.4 Steps: 1.Open the attachecd sample file in Aoo3.4 2.Check the text alignment on page 1 Bug: The alignment change to center when open in Aoo3.4