writerfilter/source/rtftok/rtfsdrimport.cxx |   15 ++++++---------
 1 file changed, 6 insertions(+), 9 deletions(-)

New commits:
commit d4feafb064560f27fce8ed3e760325545e7ba539
Author: Miklos Vajna <vmik...@collabora.co.uk>
Date:   Sun Jun 29 21:52:49 2014 +0200

    Use comphelper::SequenceAsVector
    
    Change-Id: I603a683bfce243db2ceae0ae946768a5d7a63fe5

diff --git a/writerfilter/source/rtftok/rtfsdrimport.cxx 
b/writerfilter/source/rtftok/rtfsdrimport.cxx
index bc2f99c..c26999b 100644
--- a/writerfilter/source/rtftok/rtfsdrimport.cxx
+++ b/writerfilter/source/rtftok/rtfsdrimport.cxx
@@ -350,21 +350,17 @@ void RTFSdrImport::resolve(RTFShape& rShape, bool bClose, 
ShapeOrPict const shap
             aLineWidth <<= i->second.toInt32()/360;
         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 nCount = 0; // Number of tokens
             sal_Int32 nCharIndex = 0; // Character index
-            sal_Int32 nIndex = 0; // Array index
             do
             {
                 OUString aToken = i->second.getToken(0, ';', nCharIndex);
                 if (!nSize)
                     nSize = aToken.toInt32();
                 else if (!nCount)
-                {
                     nCount = aToken.toInt32();
-                    aCoordinates.realloc(nCount);
-                }
                 else if (aToken.getLength())
                 {
                     // 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());
                     }
                     while (nI >= 0);
-                    aCoordinates[nIndex].First.Value <<= *oX;
-                    aCoordinates[nIndex].Second.Value <<= *oY;
-                    nIndex++;
+                    drawing::EnhancedCustomShapeParameterPair aPair;
+                    aPair.First.Value <<= *oX;
+                    aPair.Second.Value <<= *oY;
+                    aCoordinates.push_back(aPair);
                 }
             }
             while (nCharIndex >= 0);
             aPropertyValue.Name = "Coordinates";
-            aPropertyValue.Value <<= aCoordinates;
+            aPropertyValue.Value <<= aCoordinates.getAsConstList();
             aPath.push_back(aPropertyValue);
         }
         else if (i->first == "pSegmentInfo")
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to