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
0d7c582312
"New o3tl::try/doGet to obtain value
from Any".
Change-Id: Ica31a114e5beac97bac2a1c509eb1a85f8354d5e
Reviewed-on: https://gerrit.libreoffice.org/35825
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
This commit is contained in:
@@ -1123,11 +1123,27 @@ bool SvxShapePolyPolygon::getPropertyValueImpl( const OUString& rName, const Sfx
|
|||||||
if(mpObj.is())
|
if(mpObj.is())
|
||||||
mpObj->TRGetBaseGeometry(aNewHomogenMatrix, aNewPolyPolygon);
|
mpObj->TRGetBaseGeometry(aNewHomogenMatrix, aNewPolyPolygon);
|
||||||
|
|
||||||
drawing::PointSequenceSequence aRetval(aNewPolyPolygon.count());
|
switch (getShapeKind()) {
|
||||||
B2DPolyPolygonToSvxPointSequenceSequence(aNewPolyPolygon, aRetval);
|
case OBJ_PATHLINE:
|
||||||
|
case OBJ_PATHFILL:
|
||||||
|
{
|
||||||
|
drawing::PolyPolygonBezierCoords aRetval;
|
||||||
|
basegfx::unotools::b2DPolyPolygonToPolyPolygonBezier(
|
||||||
|
aNewPolyPolygon, aRetval);
|
||||||
rValue <<= aRetval;
|
rValue <<= aRetval;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
default:
|
||||||
|
{
|
||||||
|
drawing::PointSequenceSequence aRetval(aNewPolyPolygon.count());
|
||||||
|
B2DPolyPolygonToSvxPointSequenceSequence(
|
||||||
|
aNewPolyPolygon, aRetval);
|
||||||
|
rValue <<= aRetval;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
case OWN_ATTR_VALUE_POLYGON:
|
case OWN_ATTR_VALUE_POLYGON:
|
||||||
{
|
{
|
||||||
// pack a tools::PolyPolygon in a struct tools::PolyPolygon
|
// pack a tools::PolyPolygon in a struct tools::PolyPolygon
|
||||||
|
Reference in New Issue
Block a user