Created attachment 172904 [details] Example file from Word Attached example document contains some textboxes and shapes that are vertically aligned to line in Word: Top, Center and Bottom positioning was used (there is also inside and outside option not examined here). When opened in Writer these vertical positions change. Steps to reproduce: 1. Open attached document Actual results: Blue textbox with Top alignment becomes Top aligned (correct setting, but a bit lower actual positioning) Blue textbox with Centered alignment becomes Top aligned Blue textbox with Bottom alignment becomes Top aligned Purple triangle with Top alignment becomes Top aligned (correct setting and actual positioning as well) Yellow triangle with Centered alignment becomes From bottom aligned by 0.01 cm Blue triangle with Bottom alignment becomes Top aligned, but appears way above the line compared to the Top aligned purple triangle. Expected results: Same layout as in Word. LibreOffice details: Version: 7.2.0.0.alpha1+ (x64) / LibreOffice Community Build ID: 93a3e2f86c27b06062708fe788963a0e49f3a90b CPU threads: 4; OS: Windows 10.0 Build 18363; UI render: default; VCL: win Locale: en-US (hu_HU); UI: en-US Calc: CL
Created attachment 172905 [details] Screenshot of the original document side by side in Word and Writer
Repro Version: 7.2.0.0.alpha1+ (x64) / LibreOffice Community Build ID: 239b4bb27fd8db26e8416045b3015688a8b1b0ae CPU threads: 4; OS: Windows 6.3 Build 9600; UI render: Skia/Raster; VCL: win Locale: nl-NL (nl_NL); UI: en-US Calc: CL
This was never fine, though before 7.1 the positioning of the squares were a bit closer to Word's, from left to right, vertical positions were: mid, below, above; except in LO the differences were much larger. Probably not useful information.
I see the error: The alignment is imported as "to Line of Text". But that means relative to a line in the geometrical meaning at top of the characters. We need "to Character" here, which means the total area of the characters. You can see the difference between "to Line of Text" and "to Character" in the red lines in the preview in the Position&Size dialog, if you use a huge font size, 48pt for example. And I see in the Position&Size dialog always the item "Top", where it should be "Top", "Center", "Bottom". But that is likely an error of the dialog. The dialog doesn't open at all in my build, but LO crashes. I'll test whether current daily will crash too.
Created attachment 173997 [details] to Line by Word I see a large confusion in the import/export code in regard to vertical alignment. Our text:RelOrientation::Char corresponds to ooxml docx alignment "to Line". Our text:RelOrientation::TEXT_LINE does not exists in ooxml docx, but belongs to the binary doc-Format. Open attachment "to Line by Word" in Word and save it as doc. You will notice how Word changes the alignment to that one available in doc-Format. If you then open the doc file and save it as docx in compatibility mode and reopen that, you get an alignment, which differs from the original docx document. Our code needs to not only distinguish between docx and doc, but between ooxml docx, and compatibility mode docx to produce similar rendering. "Bottom relative to Line" is different between ooxml docx, and compatibility docx, for example.
Created attachment 173998 [details] "to Line by Word" exported as doc by Word