Cppcheck: uselessAssignmentPtrArg in wrapper.cxx (sdext module)

Caolán McNamara caolanm at redhat.com
Fri Jun 14 09:11:33 PDT 2013


On Thu, 2013-05-16 at 22:23 +0200, Julien Nabet wrote:
> Any idea for initial post (sdext/source/pdfimport/wrapper/wrapper.cxx, 
> line 475) ?

Well, this code was a refactor that happened in
16fcdbceedcdbf77e07da780581df83f38305dbd and its definitely wrong in one
way or the other.

Either the pCopy += l; should be removed, *or* the pCopy should be
effectively const sal_Unicode& *pCopy, i.e. that changes to the pCopy
affect the original pCopy passed in.

I rather think that code is supposed to skip over the full token of e.g.
"Italic" etc once it has found that token and set the italic bit on so
that a font name of "FOO-ItalicBold" turns into a font name of FOO with
the italic and bold bits set and without parsing e.g. the chunk "talic"
once its been determined to be part of Italic, pushed code to do that
now as
http://cgit.freedesktop.org/libreoffice/core/commit/?id=4c8aa30155ef9ec9ab00b5d674bddc2b4929887a. Hopefully without breaking something.

C



More information about the LibreOffice mailing list