[PATCH] Re: input for fdo#45779 from a basegfx knowledgeable person needed
Thorsten Behrens
thb at documentfoundation.org
Thu May 3 02:30:17 PDT 2012
Pierre-André Jacquod wrote:
> back again after a while.
>
Hi Pierre-André, welcome back! :)
> It happens that basegfx::GetLineArrow(...) (also defined within
> msdffimp.cxx, line 1102) does not create a valid polygon when
> eLineEnd has the value mso_lineNoEnd...
> In the switch(eLineEnd), this goes to
> > default: break;
> without creating any polygon, letting the return value undefined.
>
> So I propose to skip the creation these incorrect polygons if
> eLineEnd has the value mso_lineNoEnd. But since I do not understand
> well the import / translation from msformat, I may also have missed
> a big point. Hence thanks for reviewing this patch, before I push
> it.
>
Ah, great analysis - true, generating items for stuff that is not
there does not look too sensible. Canonical place that interprets
this for rendering is
svx/source/sdr/primitive2d/sdrattributecreator.cxx:298
, which is already gated by the StartWidth item - so I'd think we
need to set at least that one, in any case.
Digging a bit deeper, though, e.g.
sd/source/core/drawdoc4.cxx:175
sets a curious aNullPolyPolygon, so with a bit of bad luck, code
will rely on XLineStartItem/XLineEndItem being set to empty at other
places (counted some 90-odd places where XLineStartItem is used).
So what I suggest is a more defensive fix (or some larger review
across the code is in order): make GetLineArrow() return the
B2DPolyPolygon right away, and have *that one* be empty (i.e. not a
non-empty B2DPolyPolygon with an empty B2DPolygon, as it is now).
That matches the defaults the Impress core sets, so we should be
rather safe. ;)
Cheers,
-- Thorsten
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/libreoffice/attachments/20120503/e2e57f1d/attachment.pgp>
More information about the LibreOffice
mailing list