Bug 156559

Summary: HTML Writer/FILESAVE - Alignment of saved html is different from original rtf content
Product: LibreOffice Reporter: Afj <afjlee>
Component: WriterAssignee: Not Assigned <libreoffice-bugs>
Status: NEW ---    
Severity: normal CC: buzea.bogdan, miguelangelrv
Priority: medium    
Version: 7.4.7.2 release   
Hardware: All   
OS: All   
Whiteboard:
Crash report or crash signature: Regression By:
Bug Depends on:    
Bug Blocks: 108799    
Attachments: a test rtf file which includes alignments, table, list, unicode characters.
XHTML file exported

Description Afj 2023-08-01 01:59:29 UTC
Created attachment 188686 [details]
a test rtf file which includes alignments, table, list, unicode characters.

Version: 7.4.7.2 / LibreOffice Community
Build ID: 723314e595e8007d3cf785c16538505a1c878ca5
CPU threads: 8; OS: Mac OS X 13.5; UI render: default; VCL: osx
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: threaded


Open attached rtf file, then Save as HTML Document (Writer) (.html). Open saved html file in browser, you would see the most of content are aligned to the right. However the original rtf content are aligned to the left.
Comment 1 m_a_riosv 2023-08-02 00:22:54 UTC
Created attachment 188710 [details]
XHTML file exported

Looks fine for me with 7.4 and 7.5
Comment 2 Afj 2023-08-04 00:09:29 UTC
if you export to XHTML, the alignment looks ok. But if you do File -> Save As ... -> File type/HTML Document (Writer) (.html). You would see the alignment issue in newly generated Html file.
Comment 3 m_a_riosv 2023-08-04 16:44:48 UTC
Reproducible using saving as html
Version: 24.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 34387332173782498acd4998c7c665d04ebc3c7d
CPU threads: 16; OS: Windows 10.0 Build 22621; UI render: Skia/Raster; VCL: win
Locale: es-ES (es_ES); UI: en-US Calc: CL threaded
Comment 4 Afj 2023-08-04 21:45:20 UTC
looks like to me the alignment setting of first paragraph style in generated html is used for all paragraphs by default, which causes the issue. Replacing the first p {... style with p.default {... or p.first { would help. Not 100% sure.