From: Steve Brokenshire Date: Sat, 23 Jan 2016 11:58:22 +0000 (+0000) Subject: Find property name before the first semi-colon in ProcessTextVectors. X-Git-Tag: release-0.02~759 X-Git-Url: http://Server1/repobrowser/?a=commitdiff_plain;h=8c6ddbc4432ea4d19709599cc1fa58d4effe0ec1;p=xestiacalendar%2F.git Find property name before the first semi-colon in ProcessTextVectors. --- diff --git a/source/common/text.cpp b/source/common/text.cpp index 08a732c..377377b 100644 --- a/source/common/text.cpp +++ b/source/common/text.cpp @@ -14,11 +14,41 @@ multimap ProcessTextVectors(vector *TextProperties, int TextSeekCount = 0; int TextPropertySize = 0; int PropertySeekCount = 0; + string PropertyName = ""; + int PropertyNameSize = 0; + char BufferChar = 0; for (vector::iterator iter = TextProperties->begin(); iter != TextProperties->end(); iter++){ - - if (*iter == Property){ + + TextPropertySize = iter->size(); + + if (TextPropertySize == 0){ + + // Text property size is 0. Go to the next + // pair. + + continue; + + } + + // Get the property data up to the first semi-colon. + + while (TextSeekCount < TextPropertySize){ + + BufferChar = (*iter)[TextSeekCount]; + + if (BufferChar == ';'){ + break; + } + + PropertyName += BufferChar; + + TextSeekCount++; + + } + + if (*iter == Property || PropertyName == Property){ ProcessResult.insert(make_pair((*TextProperties)[PropertySeekCount], (*TextValues)[PropertySeekCount])); @@ -26,6 +56,9 @@ multimap ProcessTextVectors(vector *TextProperties, } PropertySeekCount++; + TextPropertySize = 0; + TextSeekCount = 0; + PropertyName.clear(); }