Index: src/xml/SkXMLWriter.cpp |
diff --git a/src/xml/SkXMLWriter.cpp b/src/xml/SkXMLWriter.cpp |
index 56e08893883c67c8a508d583a90691ce9eeb9875..62e96687feb8f2213a405289dad5e25e40976682 100644 |
--- a/src/xml/SkXMLWriter.cpp |
+++ b/src/xml/SkXMLWriter.cpp |
@@ -1,4 +1,3 @@ |
- |
/* |
* Copyright 2006 The Android Open Source Project |
* |
@@ -6,7 +5,6 @@ |
* found in the LICENSE file. |
*/ |
- |
#include "SkXMLWriter.h" |
#include "SkStream.h" |
@@ -51,14 +49,13 @@ void SkXMLWriter::addScalarAttribute(const char name[], SkScalar value) |
this->addAttribute(name, tmp.c_str()); |
} |
-void SkXMLWriter::addText(const char text[]) |
-{ |
+void SkXMLWriter::addText(const char text[], size_t length) { |
if (fElems.isEmpty()) { |
return; |
} |
- |
- this->onAddText(text); |
- |
+ |
+ this->onAddText(text, length); |
+ |
fElems.top()->fHasText = true; |
} |
@@ -229,8 +226,7 @@ void SkXMLStreamWriter::onAddAttributeLen(const char name[], const char value[], |
fStream.writeText("\""); |
} |
-void SkXMLStreamWriter::onAddText(const char text[]) |
-{ |
+void SkXMLStreamWriter::onAddText(const char text[], size_t length) { |
Elem* elem = fElems.top(); |
if (!elem->fHasChildren && !elem->fHasText) { |
@@ -239,7 +235,7 @@ void SkXMLStreamWriter::onAddText(const char text[]) |
} |
tab(fStream, fElems.count() + 1); |
- fStream.writeText(text); |
+ fStream.write(text, length); |
fStream.newline(); |
} |
@@ -302,9 +298,8 @@ void SkXMLParserWriter::onAddAttributeLen(const char name[], const char value[], |
fParser.addAttribute(name, str.c_str()); |
} |
-void SkXMLParserWriter::onAddText(const char text[]) |
-{ |
- fParser.text(text, SkToInt(strlen(text))); |
+void SkXMLParserWriter::onAddText(const char text[], size_t length) { |
+ fParser.text(text, SkToInt(length)); |
} |
void SkXMLParserWriter::onEndElement() |