summaryrefslogtreecommitdiff
path: root/indra/llxuixml
diff options
context:
space:
mode:
authorRichard Nelson <none@none>2010-09-14 10:47:43 -0700
committerRichard Nelson <none@none>2010-09-14 10:47:43 -0700
commit369d12bcfb9e12799509a70566e1220d04d0e189 (patch)
treeb1ea8562b9a5d2d2009321128d85100df1eb7e37 /indra/llxuixml
parent8348dae46ffc053b3f638c6342a641cda5e6ea22 (diff)
fixed text contents parsing for LLSimpleXUIParser...each contiguous range of text is submitted as a new "value" element whenever an open/close tag is encountered
Diffstat (limited to 'indra/llxuixml')
-rw-r--r--indra/llxuixml/llxuiparser.cpp12
-rw-r--r--indra/llxuixml/llxuiparser.h1
2 files changed, 10 insertions, 3 deletions
diff --git a/indra/llxuixml/llxuiparser.cpp b/indra/llxuixml/llxuiparser.cpp
index afc9b38246..e1ad9a5c71 100644
--- a/indra/llxuixml/llxuiparser.cpp
+++ b/indra/llxuixml/llxuiparser.cpp
@@ -1145,6 +1145,8 @@ void LLSimpleXUIParser::characterDataHandler(void *userData, const char *s, int
void LLSimpleXUIParser::startElement(const char *name, const char **atts)
{
+ processText();
+
typedef boost::tokenizer<boost::char_separator<char> > tokenizer;
boost::char_separator<char> sep(".");
@@ -1238,8 +1240,7 @@ bool LLSimpleXUIParser::readAttributes(const char **atts)
return any_parsed;
}
-
-void LLSimpleXUIParser::endElement(const char *name)
+void LLSimpleXUIParser::processText()
{
if (!mTextContents.empty())
{
@@ -1250,9 +1251,14 @@ void LLSimpleXUIParser::endElement(const char *name)
mCurAttributeValueBegin = mTextContents.c_str();
mOutputStack.back().first->submitValue(mNameStack, *this, mParseSilently);
mNameStack.pop_back();
- mTextContents.clear();
}
+ mTextContents.clear();
}
+}
+
+void LLSimpleXUIParser::endElement(const char *name)
+{
+ processText();
if (--mOutputStack.back().second == 0)
{
diff --git a/indra/llxuixml/llxuiparser.h b/indra/llxuixml/llxuiparser.h
index 2522128e03..5c613b0c69 100644
--- a/indra/llxuixml/llxuiparser.h
+++ b/indra/llxuixml/llxuiparser.h
@@ -218,6 +218,7 @@ private:
void endElement(const char *name);
void characterData(const char *s, int len);
bool readAttributes(const char **atts);
+ void processText();
Parser::name_stack_t mNameStack;
struct XML_ParserStruct* mParser;