summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2014-06-22 20:57:03 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2014-06-22 21:04:47 +0200
commit2f46f8b9373891f49c4d30bf553c726fcd840448 (patch)
tree3ac5d1054399ad277517fc4fe538e8a50c0f9d67
parent84feec943a09aadd73cd75e80446a73fa8bdc3c9 (diff)
Use comphelper::SequenceAsVector
Change-Id: I4bdd7c18e5ccf652a2fc0d651ce50c005254fa8a
-rw-r--r--writerfilter/source/rtftok/rtfsdrimport.cxx31
1 files changed, 11 insertions, 20 deletions
diff --git a/writerfilter/source/rtftok/rtfsdrimport.cxx b/writerfilter/source/rtftok/rtfsdrimport.cxx
index 05c4e12a95c0..bc2f99c952e4 100644
--- a/writerfilter/source/rtftok/rtfsdrimport.cxx
+++ b/writerfilter/source/rtftok/rtfsdrimport.cxx
@@ -29,6 +29,7 @@
#include <filter/msfilter/util.hxx>
#include <svx/svdtrans.hxx>
#include <tools/mapunit.hxx>
+#include <comphelper/sequenceasvector.hxx>
#include <dmapper/DomainMapper.hxx>
#include "../dmapper/GraphicHelpers.hxx"
@@ -232,7 +233,7 @@ void RTFSdrImport::resolve(RTFShape& rShape, bool bClose, ShapeOrPict const shap
uno::Any aAny;
beans::PropertyValue aPropertyValue;
awt::Rectangle aViewBox;
- std::vector<beans::PropertyValue> aPathPropVec;
+ comphelper::SequenceAsVector<beans::PropertyValue> aPath;
// Default line color is black in Word, blue in Writer.
uno::Any aLineColor = uno::makeAny(COL_BLACK);
// Default line width is 0.75 pt (26 mm100) in Word, 0 in Writer.
@@ -388,7 +389,7 @@ void RTFSdrImport::resolve(RTFShape& rShape, bool bClose, ShapeOrPict const shap
while (nCharIndex >= 0);
aPropertyValue.Name = "Coordinates";
aPropertyValue.Value <<= aCoordinates;
- aPathPropVec.push_back(aPropertyValue);
+ aPath.push_back(aPropertyValue);
}
else if (i->first == "pSegmentInfo")
{
@@ -454,7 +455,7 @@ void RTFSdrImport::resolve(RTFShape& rShape, bool bClose, ShapeOrPict const shap
while (nCharIndex >= 0);
aPropertyValue.Name = "Segments";
aPropertyValue.Value <<= aSegments;
- aPathPropVec.push_back(aPropertyValue);
+ aPath.push_back(aPropertyValue);
}
else if (i->first == "geoLeft")
aViewBox.X = i->second.toInt32();
@@ -669,34 +670,24 @@ void RTFSdrImport::resolve(RTFShape& rShape, bool bClose, ShapeOrPict const shap
xDefaulter->createCustomShapeDefaults(OUString::number(nType));
}
- // Creating Path property
- 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;
-
// Creating CustomShapeGeometry property
- std::vector<beans::PropertyValue> aGeomPropVec;
+ comphelper::SequenceAsVector<beans::PropertyValue> aGeometry;
if (aViewBox.X || aViewBox.Y || aViewBox.Width || aViewBox.Height)
{
aViewBox.Width -= aViewBox.X;
aViewBox.Height -= aViewBox.Y;
aPropertyValue.Name = "ViewBox";
aPropertyValue.Value <<= aViewBox;
- aGeomPropVec.push_back(aPropertyValue);
+ aGeometry.push_back(aPropertyValue);
}
- if (aPathPropSeq.getLength())
+ if (!aPath.empty())
{
aPropertyValue.Name = "Path";
- aPropertyValue.Value <<= aPathPropSeq;
- aGeomPropVec.push_back(aPropertyValue);
+ aPropertyValue.Value <<= aPath.getAsConstList();
+ aGeometry.push_back(aPropertyValue);
}
- uno::Sequence<beans::PropertyValue> aGeomPropSeq(aGeomPropVec.size());
- beans::PropertyValue* pGeomValues = aGeomPropSeq.getArray();
- for (std::vector<beans::PropertyValue>::iterator i = aGeomPropVec.begin(); i != aGeomPropVec.end(); ++i)
- *pGeomValues++ = *i;
- if (aGeomPropSeq.getLength() && xPropertySet.is())
- xPropertySet->setPropertyValue("CustomShapeGeometry", uno::Any(aGeomPropSeq));
+ if (!aGeometry.empty() && xPropertySet.is())
+ xPropertySet->setPropertyValue("CustomShapeGeometry", uno::Any(aGeometry.getAsConstList()));
// Set position and size
if (xShape.is())