 Source/System/Text/OSGTextVectorFace.cpp | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/Source/System/Text/OSGTextVectorFace.cpp b/Source/System/Text/OSGTextVectorFace.cpp
index bfe087a..bdf49d9 100644
--- a/Source/System/Text/OSGTextVectorFace.cpp
+++ b/Source/System/Text/OSGTextVectorFace.cpp
@@ -113,6 +113,7 @@ const TextVectorGlyph &TextVectorFace::getVectorGlyph(TextGlyph::Index glyphInde
     return *(glyph.release());
 }
 
+#pragma optimize( "", off )
 
 //----------------------------------------------------------------------
 // Fills a geometry with a new text
@@ -266,20 +267,20 @@ void TextVectorFace::fillGeo(Geometry *geoPtr, const TextLayoutResult &layoutRes
 
         // Store types, lengths and indices
         vector<TextVectorGlyph::PolygonOutline::TypeIndex>::const_iterator tIt;
-        UInt32 indexBegin = 0, indexEnd;
-        for (tIt = outline.types.begin(); tIt != outline.types.end(); ++tIt)
+        UInt32 index = 0, indexBegin = 0, indexEnd = 0;
+        for (tIt = outline.types.cbegin(); tIt != outline.types.cend(); ++tIt)
         {
             typesPtr->push_back(tIt->first);
             indexEnd = tIt->second;
             OSG_ASSERT(indexEnd >= indexBegin);
             lensPtr->push_back(indexEnd - indexBegin);
-            UInt32 j;
-            for (j = indexBegin; j < indexEnd; ++j)
+           
+            for (UInt32 j = indexBegin; j < indexEnd; ++j)
             {
                 // the interleaved multi-index blocks have the layout
                 // Position | Normal | TexCoord
                 OSG_ASSERT(j < outline.indices.size());
-                UInt32 index = outline.indices[j];
+                index = outline.indices[j];
                 OSG_ASSERT(coordOffset + index < posPtr->size());
                 posIndicesPtr->push_back(coordOffset + index);
                 normalIndicesPtr->push_back(0);
@@ -316,7 +317,7 @@ void TextVectorFace::fillGeo(Geometry *geoPtr, const TextLayoutResult &layoutRes
             // vertices is even, we have to add an additional vertex before we flip the
             // vertices.
 //            UInt32 indexBegin = 0, indexEnd;
-            for (tIt = outline.types.begin(); tIt != outline.types.end(); ++tIt)
+            for (tIt = outline.types.cbegin(); tIt != outline.types.cend(); ++tIt)
             {
                 typesPtr->push_back(tIt->first);
                 indexEnd = tIt->second;
@@ -339,7 +340,7 @@ void TextVectorFace::fillGeo(Geometry *geoPtr, const TextLayoutResult &layoutRes
                     // the interleaved multi-index blocks have the layout
                     // Position | Normal | TexCoord
                     OSG_ASSERT(j < outline.indices.size());
-                    UInt32 index = outline.indices[j];
+                    index = outline.indices[j];
                     OSG_ASSERT(backCoordOffset + index < posPtr->size());
                     posIndicesPtr->push_back(backCoordOffset + index);
                     normalIndicesPtr->push_back(1);
@@ -357,7 +358,7 @@ void TextVectorFace::fillGeo(Geometry *geoPtr, const TextLayoutResult &layoutRes
                     // the interleaved multi-index blocks have the layout
                     // Position | Normal | TexCoord
                     OSG_ASSERT(j < outline.indices.size());
-                    UInt32 index = outline.indices[j];
+                    index = outline.indices[j];
                     OSG_ASSERT(backCoordOffset + index < posPtr->size());
                     posIndicesPtr->push_back(backCoordOffset + index);
                     normalIndicesPtr->push_back(1);
@@ -522,6 +523,7 @@ void TextVectorFace::fillGeo(Geometry *geoPtr, const TextLayoutResult &layoutRes
     }
 }
 
+#pragma optimize( "", on )
 
 //----------------------------------------------------------------------
 // Creates a new text geometry
