fo:font-size may not be 0

Jos van den Oever jos at vandenoever.info
Mon May 14 21:07:45 BST 2012


On Monday 14 May 2012 15:36:40 PM matus.uzak at gmail.com wrote:
> .. and one more comment.   According to the MS-PPT spec. fontSize MUST
> be greater than or equal to 1 and less than or equal to 4000.
> Please send me any test file you have, there's something wrong going
> on in the filter when fontSize=0.  I have to find the correct
> fontSize,
> else the application default font size will be used.  There's no
> fontSize for the paragraph style in PPT.
> 
> In general filters write such zero values to make a problem clearly
> visible. It's much hard to detect such a problem when the application
> defaults are applied.
> But I understand that it's an invalid ODF file.  Cool that you fixed
> all those ODF violations.
> 
> --- a/filters/stage/powerpoint/PptToOdp.cpp
> +++ b/filters/stage/powerpoint/PptToOdp.cpp
> @@ -1232,7 +1232,9 @@ void PptToOdp::defineTextProperties(KoGe
>          style.addProperty("fo:font-family", name, text);
>      }
>      // fo:font-size
> -    style.addProperty("fo:font-size", pt(cf.fontSize()), text);
> +    if (cf.fontSize() > 0) {
> +        style.addProperty("fo:font-size", pt(cf.fontSize()), text);
> +    }
>      // fo:font-style: "italic", "normal" or "oblique
>      style.addProperty("fo:font-style", cf.italic() ?"italic" :"normal",
> text); // fo:font-variant: "normal" or "small-caps"

I do not exactly remember which file triggered this problem. I've gone back 
through my bash log and unearthed mp00_italics_numbers.ppt and 
mp00_superscript_mixed.ppt. For all of these fixed I used only the files from 
the calligratests repository.

A mechanism for collecting conversion problems makes sense. Relying on invalid 
to make the problem visible does not work. This invalid ODF has been generated 
for a long time and only now has someone looked into it. In the future, I will 
mention the files from which the invalid ODF is generated in the commit or 
review message.

Cheers,
Jos






More information about the calligra-devel mailing list