From 6e7f7864ded3d1d3f3dcfd638a4c5d5b5d76cd95 Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Fri, 8 Jul 2011 15:06:12 +0200 Subject: [PATCH] the path property is now created independent from the type --- .../source/rtftok/rtfdocumentimpl.cxx | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx index b94276bebe34..25f33674cc45 100644 --- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx +++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx @@ -2456,6 +2456,8 @@ void RTFDocumentImpl::resolveShapeProperties(std::vector< std::pair aCoordinates; uno::Sequence aSegments; awt::Rectangle aViewBox; + std::vector aPathPropVec; + for (std::vector< std::pair >::iterator i = rShapeProperties.begin(); i != rShapeProperties.end(); ++i) { @@ -2560,6 +2562,9 @@ void RTFDocumentImpl::resolveShapeProperties(std::vector< std::pair= 0); + aPropertyValue.Name = OUString(RTL_CONSTASCII_USTRINGPARAM("Coordinates")); + aPropertyValue.Value <<= aCoordinates; + aPathPropVec.push_back(aPropertyValue); } else if (i->first.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("pSegmentInfo"))) { @@ -2612,7 +2617,11 @@ void RTFDocumentImpl::resolveShapeProperties(std::vector< std::pair= 0); + } + while (nCharIndex >= 0); + aPropertyValue.Name = OUString(RTL_CONSTASCII_USTRINGPARAM("Segments")); + aPropertyValue.Value <<= aSegments; + aPathPropVec.push_back(aPropertyValue); } else if (i->first.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("geoLeft"))) aViewBox.X = i->second.toInt32(); @@ -2642,23 +2651,14 @@ void RTFDocumentImpl::resolveShapeProperties(std::vector< std::paircreateCustomShapeDefaults(OUString::valueOf(sal_Int32(nType))); } + // pushing the whole Path element + uno::Sequence aPathPropSeq(aPathPropVec.size()); + beans::PropertyValue* pPathValues = aPathPropSeq.getArray(); + for (std::vector::iterator i = aPathPropVec.begin(); i != aPathPropVec.end(); ++i) + *pPathValues++ = *i; + if (nType == 0) { - std::vector aPathPropVec; - - aPropertyValue.Name = OUString(RTL_CONSTASCII_USTRINGPARAM("Coordinates")); - aPropertyValue.Value <<= aCoordinates; - aPathPropVec.push_back(aPropertyValue); - - aPropertyValue.Name = OUString(RTL_CONSTASCII_USTRINGPARAM("Segments")); - aPropertyValue.Value <<= aSegments; - aPathPropVec.push_back(aPropertyValue); - - uno::Sequence aPathPropSeq(aPathPropVec.size()); - beans::PropertyValue* pPathValues = aPathPropSeq.getArray(); - for (std::vector::iterator i = aPathPropVec.begin(); i != aPathPropVec.end(); ++i) - *pPathValues++ = *i; - uno::Sequence aGeoPropSeq(2); aGeoPropSeq[0].Name = OUString(RTL_CONSTASCII_USTRINGPARAM("ViewBox")); aGeoPropSeq[0].Value <<= uno::Any(aViewBox);