Description: We use LibreOffice 5.2.3.3 to create .docx and .doc documents using UNO Java API. We use MS Word 97 filter to produce .doc documents and MS Word 2007 XML to produce .docx documents. We have content from HTML file. Background color for the text is not retained id doc ouput. We have a bookmark in .odt and used XDocumentInsertable.insertDocumentFromURL API to insert text from HTML file in place of bookmark XTextCursor . But generated doc file is not retaining background colors for table cell after 24 column in doc output file Please find the attachment for source html generated output Steps to Reproduce: 1. Have a html content file with table and background colors in cells(refer sourcehtml) 2.Have odt template with one bookmark to embed html content( refer template.odt) 3. Use UNO Java api's XDocumentInsertable.insertDocumentFromURL API to insert text from HTML file in place of bookmark XTextCursor Actual Results: Background colors for table cell are not retained after 24 column in word doc table Expected Results: Background colors for table cell should be retained after 24 column in word doc table Reproducible: Always User Profile Reset: No Additional Info: User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36
Created attachment 141616 [details] input and output files
Thank you for efforts to improve LibreOffice! Unfortunately, your report does not allow to reproduce the problem. What is "Use UNO Java api's XDocumentInsertable.insertDocumentFromURL API to insert text from HTML file in place of bookmark XTextCursor" in the steps? Do you expect others to reinvent some code that you have in mind? Please provide steps that make it possible to reproduce the issue without involved steps like doing programming: either attach all the necessary scripts and detailed steps how to run them, or provide steps how to reproduce this detached from using API. (I must say that simply opening the HTML and saving it as DOC does not reproduce the problem neither with 5.2.3.2, nor with 6.0.4.1). Also, filing bugs against 5.2 is not useful. Before filing a bug, please test with current versions (currently it's 5.4.6 and 6.0.3) to check if the issue is fixed in them.
Created attachment 144264 [details] max21columns.odt: 30 column table with RES_BACKGROUND cells The maximum # of columns that LO exports to DOC is 21 because of wrtww8.cxx sal_uInt8 nBoxes0 = rTabBoxes.size(); if (nBoxes0 > 21) nBoxes0 = 21; That has been true since the initial import from OOo.
I tried simply increasing the number, but that didn't work, so 21 must not be an arbitrary number.
proposed fix at https://gerrit.libreoffice.org/c/core/+/98856
Justin Luth committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/565912fa0334de1c05749768796a33a1a5e6b984 tdf#117217 ww8: export/import all cell backgrounds It will be available in 7.1.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.