Not Logged In
|
Login
|
Register
Home
|
News
|
Projects
|
Releases
Bugs
|
RFE
|
Repositories
|
Help
projects
/
xestiacalendar
/
.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
a67a186
)
Find property name before the first semi-colon in ProcessTextVectors.
author
Steve Brokenshire
<sbrokenshire@xestia.co.uk>
Sat, 23 Jan 2016 11:58:22 +0000
(11:58 +0000)
committer
Steve Brokenshire
<sbrokenshire@xestia.co.uk>
Sat, 23 Jan 2016 11:58:22 +0000
(11:58 +0000)
source/common/text.cpp
patch
|
blob
|
history
diff --git
a/source/common/text.cpp
b/source/common/text.cpp
index
08a732c
..
377377b
100644
(file)
--- a/
source/common/text.cpp
+++ b/
source/common/text.cpp
@@
-14,11
+14,41
@@
multimap<string, string> ProcessTextVectors(vector<string> *TextProperties,
int TextSeekCount = 0;
int TextPropertySize = 0;
int PropertySeekCount = 0;
int TextSeekCount = 0;
int TextPropertySize = 0;
int PropertySeekCount = 0;
+ string PropertyName = "";
+ int PropertyNameSize = 0;
+ char BufferChar = 0;
for (vector<string>::iterator iter = TextProperties->begin();
iter != TextProperties->end(); iter++){
for (vector<string>::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]));
ProcessResult.insert(make_pair((*TextProperties)[PropertySeekCount],
(*TextValues)[PropertySeekCount]));
@@
-26,6
+56,9
@@
multimap<string, string> ProcessTextVectors(vector<string> *TextProperties,
}
PropertySeekCount++;
}
PropertySeekCount++;
+ TextPropertySize = 0;
+ TextSeekCount = 0;
+ PropertyName.clear();
}
}
Yn Maystri
© 2006 - 2019 Xestia Software Development
Software
Xestia Address Book
Xestia Calendar
Development
Xestia Gelforn
Everything else
About
News
Privacy Policy