avoid hardwired size for path properties

This commit is contained in:
Miklos Vajna 2011-07-08 15:03:00 +02:00
parent 57a44d0cf5
commit 0a5f10879f

View file

@ -2452,6 +2452,7 @@ void RTFDocumentImpl::resolveShapeProperties(std::vector< std::pair<rtl::OUStrin
// Create this early, as custom shapes may have properties before the type arrives. // Create this early, as custom shapes may have properties before the type arrives.
createShape(OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.CustomShape")), xShape, xPropertySet); createShape(OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.CustomShape")), xShape, xPropertySet);
uno::Any aAny; uno::Any aAny;
beans::PropertyValue aPropertyValue;
uno::Sequence<drawing::EnhancedCustomShapeParameterPair> aCoordinates; uno::Sequence<drawing::EnhancedCustomShapeParameterPair> aCoordinates;
uno::Sequence<drawing::EnhancedCustomShapeSegment> aSegments; uno::Sequence<drawing::EnhancedCustomShapeSegment> aSegments;
awt::Rectangle aViewBox; awt::Rectangle aViewBox;
@ -2643,13 +2644,20 @@ void RTFDocumentImpl::resolveShapeProperties(std::vector< std::pair<rtl::OUStrin
if (nType == 0) if (nType == 0)
{ {
uno::Sequence< beans::PropertyValue > aPathPropSeq(2); std::vector<beans::PropertyValue> aPathPropVec;
aPathPropSeq[0].Name = OUString(RTL_CONSTASCII_USTRINGPARAM("Coordinates")); aPropertyValue.Name = OUString(RTL_CONSTASCII_USTRINGPARAM("Coordinates"));
aPathPropSeq[0].Value <<= aCoordinates; aPropertyValue.Value <<= aCoordinates;
aPathPropVec.push_back(aPropertyValue);
aPathPropSeq[1].Name = OUString(RTL_CONSTASCII_USTRINGPARAM("Segments")); aPropertyValue.Name = OUString(RTL_CONSTASCII_USTRINGPARAM("Segments"));
aPathPropSeq[1].Value <<= aSegments; aPropertyValue.Value <<= aSegments;
aPathPropVec.push_back(aPropertyValue);
uno::Sequence<beans::PropertyValue> aPathPropSeq(aPathPropVec.size());
beans::PropertyValue* pPathValues = aPathPropSeq.getArray();
for (std::vector<beans::PropertyValue>::iterator i = aPathPropVec.begin(); i != aPathPropVec.end(); ++i)
*pPathValues++ = *i;
uno::Sequence<beans::PropertyValue> aGeoPropSeq(2); uno::Sequence<beans::PropertyValue> aGeoPropSeq(2);
aGeoPropSeq[0].Name = OUString(RTL_CONSTASCII_USTRINGPARAM("ViewBox")); aGeoPropSeq[0].Name = OUString(RTL_CONSTASCII_USTRINGPARAM("ViewBox"));