summaryrefslogtreecommitdiff
path: root/sax
diff options
context:
space:
mode:
Diffstat (limited to 'sax')
-rw-r--r--sax/source/tools/fastserializer.cxx11
1 files changed, 7 insertions, 4 deletions
diff --git a/sax/source/tools/fastserializer.cxx b/sax/source/tools/fastserializer.cxx
index cc7293a6a3f9..a362ff438383 100644
--- a/sax/source/tools/fastserializer.cxx
+++ b/sax/source/tools/fastserializer.cxx
@@ -130,9 +130,7 @@ namespace sax_fastparser {
if (nLen == -1)
nLen = pStr ? strlen(pStr) : 0;
- if ( !bEscape ||
- // tdf#127274 don't escape the special VML shape type id "#_x0000_t202"
- (pStr && strcmp(pStr, "#_x0000_t202") == 0) )
+ if (!bEscape)
{
writeBytes( pStr, nLen );
return;
@@ -465,7 +463,12 @@ namespace sax_fastparser {
writeBytes(sEqualSignAndQuote, N_CHARS(sEqualSignAndQuote));
- write(rAttrList.getFastAttributeValue(j), rAttrList.AttributeValueLength(j), true);
+ const char* pAttributeValue = rAttrList.getFastAttributeValue(j);
+
+ // tdf#127274 don't escape the special VML shape type id "#_x0000_t202"
+ bool bEscape = !(pAttributeValue && strcmp(pAttributeValue, "#_x0000_t202") == 0);
+
+ write(pAttributeValue, rAttrList.AttributeValueLength(j), bEscape);
writeBytes(sQuote, N_CHARS(sQuote));
}