[Libreoffice-commits] core.git: tdf#106792: Fix "Geometry" property of changed-to-bezier SvxShapePolyPolygon

Regina Henschel rb.henschel at t-online.de
Thu Mar 30 14:07:46 UTC 2017


Hi Stephan,

the steps described in the issue do not crash for me, neither with 5.4.0 
nor with 5.2.6. But I am on Win7 and my graphic card is not able to use 
OpenGL. Has some tested, whether the crash only occur with OpenGl enabled?

Kind regards
Regina

Stephan Bergmann schrieb:
> Anybody familiar with that SvxShape stuff?  I see there is both
> SvxShapePolyPolygon and SvxShapePolyPolygonBezier classes in
> include/svx/unoshape.hxx, and wonder whether it's plausible that an
> originally straight-line polygon remains an SvxShapePolyPolygon when one
> of its edges is manipulated with "Convert to Curve"?  If it should
> instead become an SvxShapePolyPolygonBezier then, then the proper fix
> for <https://bugs.documentfoundation.org/show_bug.cgi?id=106792> "Error
> when saving a polygon with points converted to curve" would probably
> need to be done elsewhere.
>
> On 03/29/2017 10:11 AM, Stephan Bergmann wrote:
>> commit 26909d9de4c6e7165fc8f5d938ee6ef55b87cc5c
>> Author: Stephan Bergmann <sbergman at redhat.com>
>> Date:   Wed Mar 29 09:15:48 2017 +0200
>>
>>     tdf#106792: Fix "Geometry" property of changed-to-bezier
>> SvxShapePolyPolygon
>>
>>     After "Convert to Curve" as described in the issue, the shape
>> apparently is
>>     still an SvxShapePolyPolygon shape but with getShapeKind() of
>> OBJ_PATHLINE
>>     instead of OBJ_PLIN (and same for OBJ_PATHFILL).  That causes
>>     XMLShapeExport::ImpExportPolygonShape
>> (xmloff/source/draw/shapeexport.cxx) to
>>     determine bBezier == true and thus expect the obtained "Geometry"
>> property to be
>>     of type css::drawing::PolyPolygonBezierCoords, not merely
>>     css::drawing::PointSequenceSequence.
>>
>>     Smells like this issue had always been present, and would have
>> caused bad memory
>>     access when accessing the
>> non-css::drawing::PolyPolygonBezierCoords object in
>>     XMLShapeExport::ImpExportPolygonShape, and only now throws an
>> exception since
>>     0d7c5823124696f80583ac2a5f0e28f329f6f786 "New o3tl::try/doGet to
>> obtain value
>>     from Any".
>>
>>     Change-Id: Ica31a114e5beac97bac2a1c509eb1a85f8354d5e
>>     Reviewed-on: https://gerrit.libreoffice.org/35825
>>     Tested-by: Jenkins <ci at libreoffice.org>
>>     Reviewed-by: Stephan Bergmann <sbergman at redhat.com>
>>
>> diff --git a/svx/source/unodraw/unoshap2.cxx
>> b/svx/source/unodraw/unoshap2.cxx
>> index bf964ff653db..201b245b0017 100644
>> --- a/svx/source/unodraw/unoshap2.cxx
>> +++ b/svx/source/unodraw/unoshap2.cxx
>> @@ -1123,9 +1123,25 @@ bool SvxShapePolyPolygon::getPropertyValueImpl(
>> const OUString& rName, const Sfx
>>          if(mpObj.is())
>>              mpObj->TRGetBaseGeometry(aNewHomogenMatrix,
>> aNewPolyPolygon);
>>
>> -        drawing::PointSequenceSequence aRetval(aNewPolyPolygon.count());
>> -        B2DPolyPolygonToSvxPointSequenceSequence(aNewPolyPolygon,
>> aRetval);
>> -        rValue <<= aRetval;
>> +        switch (getShapeKind()) {
>> +        case OBJ_PATHLINE:
>> +        case OBJ_PATHFILL:
>> +            {
>> +                drawing::PolyPolygonBezierCoords aRetval;
>> +                basegfx::unotools::b2DPolyPolygonToPolyPolygonBezier(
>> +                    aNewPolyPolygon, aRetval);
>> +                rValue <<= aRetval;
>> +                break;
>> +            }
>> +        default:
>> +            {
>> +                drawing::PointSequenceSequence
>> aRetval(aNewPolyPolygon.count());
>> +                B2DPolyPolygonToSvxPointSequenceSequence(
>> +                    aNewPolyPolygon, aRetval);
>> +                rValue <<= aRetval;
>> +                break;
>> +            }
>> +        }
>>          break;
>>      }
>>      case OWN_ATTR_VALUE_POLYGON:
>
> _______________________________________________
> LibreOffice mailing list
> LibreOffice at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/libreoffice



More information about the LibreOffice mailing list