Fix ODF attributes style:wrap-contour-mode, style:wrap-contour and style:leader-text in docx filter.

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


On Monday 14 May 2012 15:08:12 PM matus.uzak at gmail.com wrote:
> Hi Jos,
> 
> in ODF the default value of style:leader-text is “ “ (U+0020).  Docx:
> if there's no leader text specified or it is "none", then there should
> be no space.
> The invisible space QChar(0x200B) solution as used for the
> text:bullet-char by Zagge would be fine.
> 
> --- a/filters/words/docx/DocxXmlDocumentReader.cpp
> +++ b/filters/words/docx/DocxXmlDocumentReader.cpp
> @@ -4720,7 +4720,9 @@ KoFilter::ConversionStatus DocxXmlDocume
>              text = QChar();
>          }
>      }
> -    body->addAttribute("style:leader-text", text);
> +    if (!text.isNull()) {
> +        body->addAttribute("style:leader-text", text);
> +    }
>      body->endElement(); // style:tab-stop

Sounds like a good fix. I would be fine with code like this:

if (text.isNull()) {
    body->addAttribute("style:leader-text", QChar(0x00B));
} else {
    body->addAttribute("style:leader-text", text);
}

Cheers,
Jos



More information about the calligra-devel mailing list