Created attachment 78726 [details] ZIP file containing a sample ODS document and the corresponding XHTML export. When exporting an ODS document as XHTML, the CSS stylesheet contained in the <style> element is buggy in several respects: 1. The border-width attribute is exported has a comma instead of a point as decimal separator, e.g. border-width:0,021cm instead of border-width:0.021cm. Other width attributes seem to be okay. 2. The stylesheet contains XML-like comments, e.g. <!-- ODF styles with no properties representable as CSS -->. However, CSS comments must be Java style, e.g. /* ODF styles with no properties representable as CSS */ 3. The stylesheet contains empty blocks, e.g. { }. This is invalid. Operating System: Linux (Other) Version: 4.0.2.1 rc
Well, these are three different bugs, so there should be three reports. But let's ignore the technicalities... IMHO at least the first two bugs should be very easily fixable by anyone who knows XSLT, so I am marking this as EasyHack. The code in question is filter/source/xslt/odf2xhtml with some parts in filter/source/xslt/common . Some pointers to the individual problems: 1. I would start looking at template round-up-border-width in filter/source/xslt/odf2xhtml/export/common/styles/style_mapping_css.xsl . 2. This is because of the use of xsl:comment in the CSS export code, e.g., template create-page-layout in filter/source/xslt/odf2xhtml/export/xhtml/header.xsl . Obviously these must be changed to plain /* */. 3. I have not been able to spot a likely problematic place in a quick look, so I leave this as excercise to the reader :-)
#2 and #3 fixed in https://gerrit.libreoffice.org/#/c/3851 But #1 is a locale problem. In locales where the decimal separator is a comma (like de_DE or pt_BR), the output CSS is wrong. What should be done in this case?
CSS output should never be localized, but the decimal point must always be a dot ('.'). See the specification here: <http://www.w3.org/TR/CSS2/syndata.html#numbers>.
Yes, I know the decimal separator cannot be localized in CSS. What I meant is how can we prevent it to be localized (since it does the localization automatically when doing any calculation)?
adding LibreOffice developer list as CC to unresolved EasyHacks for better visibility. see e.g. http://nabble.documentfoundation.org/minutes-of-ESC-call-td4076214.html for details
(In reply to Marco Biscaro from comment #2) > #2 and #3 fixed in https://gerrit.libreoffice.org/#/c/3851 I am sorry... I missed this somehow and now the review is lost. Could you push it again? > > But #1 is a locale problem. In locales where the decimal separator is a > comma (like de_DE or pt_BR), the output CSS is wrong. What should be done in > this case? That suggests that the code uses xsl:number to convert the value to string. In that case, adding lang="en-US" attribute should fix the problem.
Migrating Whiteboard tags to Keywords: ( EasyHack DifficultyBeginner) [NinjaEdit]
JanI is default CC for Easy Hacks (Add Jan; remove LibreOffice Dev List from CC) [NinjaEdit]
https://gerrit.libreoffice.org/#/c/31683/ Resolved easy hack! 1) fixed border-width:0.021cm 2) changed stylesheet comment in /*comment*/ 3) removed empty blocks
Please don't mark as resolved until the fix is merged.
A polite ping, still working on this issue ?
(In reply to jan iversen from comment #11) > A polite ping, still working on this issue ? Yes, I'm solving this bug.
Unassigning, due to lack of work (old patch is abandoned). If you want to continue working on this please reassign yourself.