Use comphelper::SequenceAsVector
Change-Id: I4bdd7c18e5ccf652a2fc0d651ce50c005254fa8a
This commit is contained in:
@@ -29,6 +29,7 @@
|
|||||||
#include <filter/msfilter/util.hxx>
|
#include <filter/msfilter/util.hxx>
|
||||||
#include <svx/svdtrans.hxx>
|
#include <svx/svdtrans.hxx>
|
||||||
#include <tools/mapunit.hxx>
|
#include <tools/mapunit.hxx>
|
||||||
|
#include <comphelper/sequenceasvector.hxx>
|
||||||
|
|
||||||
#include <dmapper/DomainMapper.hxx>
|
#include <dmapper/DomainMapper.hxx>
|
||||||
#include "../dmapper/GraphicHelpers.hxx"
|
#include "../dmapper/GraphicHelpers.hxx"
|
||||||
@@ -232,7 +233,7 @@ void RTFSdrImport::resolve(RTFShape& rShape, bool bClose, ShapeOrPict const shap
|
|||||||
uno::Any aAny;
|
uno::Any aAny;
|
||||||
beans::PropertyValue aPropertyValue;
|
beans::PropertyValue aPropertyValue;
|
||||||
awt::Rectangle aViewBox;
|
awt::Rectangle aViewBox;
|
||||||
std::vector<beans::PropertyValue> aPathPropVec;
|
comphelper::SequenceAsVector<beans::PropertyValue> aPath;
|
||||||
// Default line color is black in Word, blue in Writer.
|
// Default line color is black in Word, blue in Writer.
|
||||||
uno::Any aLineColor = uno::makeAny(COL_BLACK);
|
uno::Any aLineColor = uno::makeAny(COL_BLACK);
|
||||||
// Default line width is 0.75 pt (26 mm100) in Word, 0 in Writer.
|
// 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);
|
while (nCharIndex >= 0);
|
||||||
aPropertyValue.Name = "Coordinates";
|
aPropertyValue.Name = "Coordinates";
|
||||||
aPropertyValue.Value <<= aCoordinates;
|
aPropertyValue.Value <<= aCoordinates;
|
||||||
aPathPropVec.push_back(aPropertyValue);
|
aPath.push_back(aPropertyValue);
|
||||||
}
|
}
|
||||||
else if (i->first == "pSegmentInfo")
|
else if (i->first == "pSegmentInfo")
|
||||||
{
|
{
|
||||||
@@ -454,7 +455,7 @@ void RTFSdrImport::resolve(RTFShape& rShape, bool bClose, ShapeOrPict const shap
|
|||||||
while (nCharIndex >= 0);
|
while (nCharIndex >= 0);
|
||||||
aPropertyValue.Name = "Segments";
|
aPropertyValue.Name = "Segments";
|
||||||
aPropertyValue.Value <<= aSegments;
|
aPropertyValue.Value <<= aSegments;
|
||||||
aPathPropVec.push_back(aPropertyValue);
|
aPath.push_back(aPropertyValue);
|
||||||
}
|
}
|
||||||
else if (i->first == "geoLeft")
|
else if (i->first == "geoLeft")
|
||||||
aViewBox.X = i->second.toInt32();
|
aViewBox.X = i->second.toInt32();
|
||||||
@@ -669,34 +670,24 @@ void RTFSdrImport::resolve(RTFShape& rShape, bool bClose, ShapeOrPict const shap
|
|||||||
xDefaulter->createCustomShapeDefaults(OUString::number(nType));
|
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
|
// Creating CustomShapeGeometry property
|
||||||
std::vector<beans::PropertyValue> aGeomPropVec;
|
comphelper::SequenceAsVector<beans::PropertyValue> aGeometry;
|
||||||
if (aViewBox.X || aViewBox.Y || aViewBox.Width || aViewBox.Height)
|
if (aViewBox.X || aViewBox.Y || aViewBox.Width || aViewBox.Height)
|
||||||
{
|
{
|
||||||
aViewBox.Width -= aViewBox.X;
|
aViewBox.Width -= aViewBox.X;
|
||||||
aViewBox.Height -= aViewBox.Y;
|
aViewBox.Height -= aViewBox.Y;
|
||||||
aPropertyValue.Name = "ViewBox";
|
aPropertyValue.Name = "ViewBox";
|
||||||
aPropertyValue.Value <<= aViewBox;
|
aPropertyValue.Value <<= aViewBox;
|
||||||
aGeomPropVec.push_back(aPropertyValue);
|
aGeometry.push_back(aPropertyValue);
|
||||||
}
|
}
|
||||||
if (aPathPropSeq.getLength())
|
if (!aPath.empty())
|
||||||
{
|
{
|
||||||
aPropertyValue.Name = "Path";
|
aPropertyValue.Name = "Path";
|
||||||
aPropertyValue.Value <<= aPathPropSeq;
|
aPropertyValue.Value <<= aPath.getAsConstList();
|
||||||
aGeomPropVec.push_back(aPropertyValue);
|
aGeometry.push_back(aPropertyValue);
|
||||||
}
|
}
|
||||||
uno::Sequence<beans::PropertyValue> aGeomPropSeq(aGeomPropVec.size());
|
if (!aGeometry.empty() && xPropertySet.is())
|
||||||
beans::PropertyValue* pGeomValues = aGeomPropSeq.getArray();
|
xPropertySet->setPropertyValue("CustomShapeGeometry", uno::Any(aGeometry.getAsConstList()));
|
||||||
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));
|
|
||||||
|
|
||||||
// Set position and size
|
// Set position and size
|
||||||
if (xShape.is())
|
if (xShape.is())
|
||||||
|
Reference in New Issue
Block a user