summaryrefslogtreecommitdiff
path: root/core/fxcrt/xml/cfx_xmlelement.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'core/fxcrt/xml/cfx_xmlelement.cpp')
-rw-r--r--core/fxcrt/xml/cfx_xmlelement.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/core/fxcrt/xml/cfx_xmlelement.cpp b/core/fxcrt/xml/cfx_xmlelement.cpp
index 4bb4eae1bd..bd24091205 100644
--- a/core/fxcrt/xml/cfx_xmlelement.cpp
+++ b/core/fxcrt/xml/cfx_xmlelement.cpp
@@ -76,13 +76,11 @@ WideString CFX_XMLElement::GetNamespaceURI() const {
WideString CFX_XMLElement::GetTextData() const {
CFX_WideTextBuf buffer;
-
for (CFX_XMLNode* pChild = GetFirstChild(); pChild;
pChild = pChild->GetNextSibling()) {
- if (pChild->GetType() == FX_XMLNODE_Text ||
- pChild->GetType() == FX_XMLNODE_CharData) {
- buffer << static_cast<CFX_XMLText*>(pChild)->GetText();
- }
+ CFX_XMLText* pText = ToXMLText(pChild);
+ if (pText)
+ buffer << pText->GetText();
}
return buffer.MakeString();
}