Use comphelper::SequenceAsVector

Change-Id: I603a683bfce243db2ceae0ae946768a5d7a63fe5
This commit is contained in:
Miklos Vajna
2014-06-29 21:52:49 +02:00
parent 17409437fb
commit d4feafb064

View File

@@ -350,21 +350,17 @@ void RTFSdrImport::resolve(RTFShape& rShape, bool bClose, ShapeOrPict const shap
aLineWidth <<= i->second.toInt32()/360; aLineWidth <<= i->second.toInt32()/360;
else if (i->first == "pVerticies") else if (i->first == "pVerticies")
{ {
uno::Sequence<drawing::EnhancedCustomShapeParameterPair> aCoordinates; comphelper::SequenceAsVector<drawing::EnhancedCustomShapeParameterPair> aCoordinates;
sal_Int32 nSize = 0; // Size of a token (its value is hardwired in the exporter) sal_Int32 nSize = 0; // Size of a token (its value is hardwired in the exporter)
sal_Int32 nCount = 0; // Number of tokens sal_Int32 nCount = 0; // Number of tokens
sal_Int32 nCharIndex = 0; // Character index sal_Int32 nCharIndex = 0; // Character index
sal_Int32 nIndex = 0; // Array index
do do
{ {
OUString aToken = i->second.getToken(0, ';', nCharIndex); OUString aToken = i->second.getToken(0, ';', nCharIndex);
if (!nSize) if (!nSize)
nSize = aToken.toInt32(); nSize = aToken.toInt32();
else if (!nCount) else if (!nCount)
{
nCount = aToken.toInt32(); nCount = aToken.toInt32();
aCoordinates.realloc(nCount);
}
else if (aToken.getLength()) else if (aToken.getLength())
{ {
// The coordinates are in an (x,y) form. // The coordinates are in an (x,y) form.
@@ -381,14 +377,15 @@ void RTFSdrImport::resolve(RTFShape& rShape, bool bClose, ShapeOrPict const shap
oY.reset(aPoint.toInt32()); oY.reset(aPoint.toInt32());
} }
while (nI >= 0); while (nI >= 0);
aCoordinates[nIndex].First.Value <<= *oX; drawing::EnhancedCustomShapeParameterPair aPair;
aCoordinates[nIndex].Second.Value <<= *oY; aPair.First.Value <<= *oX;
nIndex++; aPair.Second.Value <<= *oY;
aCoordinates.push_back(aPair);
} }
} }
while (nCharIndex >= 0); while (nCharIndex >= 0);
aPropertyValue.Name = "Coordinates"; aPropertyValue.Name = "Coordinates";
aPropertyValue.Value <<= aCoordinates; aPropertyValue.Value <<= aCoordinates.getAsConstList();
aPath.push_back(aPropertyValue); aPath.push_back(aPropertyValue);
} }
else if (i->first == "pSegmentInfo") else if (i->first == "pSegmentInfo")