summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2014-06-30 18:38:09 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2014-06-30 18:44:51 +0200
commitc64a54bc3eb15809bc56c19c1f013954d9bfde7a (patch)
treec2967d77f58e3c96157f3e8352c0582acdafee06
parent6bb92c5eaf1ff2f5292442870c65bfe2771752ec (diff)
Use comphelper::SequenceAsVector
Change-Id: I8c0328b1bae3d2c3f327d241acf3df0c078ea4cf
-rw-r--r--writerfilter/source/rtftok/rtfsdrimport.cxx40
1 files changed, 21 insertions, 19 deletions
diff --git a/writerfilter/source/rtftok/rtfsdrimport.cxx b/writerfilter/source/rtftok/rtfsdrimport.cxx
index c26999bfc863..59fa69809c9e 100644
--- a/writerfilter/source/rtftok/rtfsdrimport.cxx
+++ b/writerfilter/source/rtftok/rtfsdrimport.cxx
@@ -390,21 +390,17 @@ void RTFSdrImport::resolve(RTFShape& rShape, bool bClose, ShapeOrPict const shap
}
else if (i->first == "pSegmentInfo")
{
- uno::Sequence<drawing::EnhancedCustomShapeSegment> aSegments;
+ comphelper::SequenceAsVector<drawing::EnhancedCustomShapeSegment> aSegments;
sal_Int32 nSize = 0;
sal_Int32 nCount = 0;
sal_Int32 nCharIndex = 0;
- sal_Int32 nIndex = 0;
do
{
sal_Int32 nSeg = i->second.getToken(0, ';', nCharIndex).toInt32();
if (!nSize)
nSize = nSeg;
else if (!nCount)
- {
nCount = nSeg;
- aSegments.realloc(nCount);
- }
else
{
sal_Int32 nPoints = 1;
@@ -414,23 +410,28 @@ void RTFSdrImport::resolve(RTFShape& rShape, bool bClose, ShapeOrPict const shap
nSeg &= 0xFF00;
}
+ drawing::EnhancedCustomShapeSegment aSegment;
switch (nSeg)
{
case 0x0001: // lineto
- aSegments[nIndex].Command = drawing::EnhancedCustomShapeSegmentCommand::LINETO;
- aSegments[nIndex].Count = sal_Int32(1);
+ aSegment.Command = drawing::EnhancedCustomShapeSegmentCommand::LINETO;
+ aSegment.Count = sal_Int32(1);
+ aSegments.push_back(aSegment);
break;
case 0x4000: // moveto
- aSegments[nIndex].Command = drawing::EnhancedCustomShapeSegmentCommand::MOVETO;
- aSegments[nIndex].Count = sal_Int32(1);
+ aSegment.Command = drawing::EnhancedCustomShapeSegmentCommand::MOVETO;
+ aSegment.Count = sal_Int32(1);
+ aSegments.push_back(aSegment);
break;
case 0x2000: // curveto
- aSegments[nIndex].Command = drawing::EnhancedCustomShapeSegmentCommand::CURVETO;
- aSegments[nIndex].Count = sal_Int32(nPoints);
+ aSegment.Command = drawing::EnhancedCustomShapeSegmentCommand::CURVETO;
+ aSegment.Count = sal_Int32(nPoints);
+ aSegments.push_back(aSegment);
break;
case 0xb300: // arcto
- aSegments[nIndex].Command = drawing::EnhancedCustomShapeSegmentCommand::ARCTO;
- aSegments[nIndex].Count = sal_Int32(0);
+ aSegment.Command = drawing::EnhancedCustomShapeSegmentCommand::ARCTO;
+ aSegment.Count = sal_Int32(0);
+ aSegments.push_back(aSegment);
break;
case 0xac00:
case 0xaa00: // nofill
@@ -438,20 +439,21 @@ void RTFSdrImport::resolve(RTFShape& rShape, bool bClose, ShapeOrPict const shap
case 0x6001: // close
break;
case 0x8000: // end
- aSegments[nIndex].Command = drawing::EnhancedCustomShapeSegmentCommand::ENDSUBPATH;
- aSegments[nIndex].Count = sal_Int32(0);
+ aSegment.Command = drawing::EnhancedCustomShapeSegmentCommand::ENDSUBPATH;
+ aSegment.Count = sal_Int32(0);
+ aSegments.push_back(aSegment);
break;
default: // given number of lineto elements
- aSegments[nIndex].Command = drawing::EnhancedCustomShapeSegmentCommand::LINETO;
- aSegments[nIndex].Count = nSeg;
+ aSegment.Command = drawing::EnhancedCustomShapeSegmentCommand::LINETO;
+ aSegment.Count = nSeg;
+ aSegments.push_back(aSegment);
break;
}
- nIndex++;
}
}
while (nCharIndex >= 0);
aPropertyValue.Name = "Segments";
- aPropertyValue.Value <<= aSegments;
+ aPropertyValue.Value <<= aSegments.getAsConstList();
aPath.push_back(aPropertyValue);
}
else if (i->first == "geoLeft")