summaryrefslogtreecommitdiff
path: root/sax
diff options
context:
space:
mode:
authorMatúš Kukan <matus.kukan@collabora.com>2014-10-03 10:41:18 +0200
committerMatúš Kukan <matus.kukan@collabora.com>2014-10-23 13:24:28 +0200
commit25eba216d8b0201bcadb6d4f23484f9ec8f123a2 (patch)
treef0b89bf36c1c07e152a11812f3826e198a29c7f9 /sax
parentf39d69f6b5bc6dad1112e9465e12395d9439effb (diff)
FastSerializer: Use -1 for unknown string length
Change-Id: I3920caf9d95f20992b7961873f1668468d797e8e
Diffstat (limited to 'sax')
-rw-r--r--sax/source/tools/fastserializer.cxx4
-rw-r--r--sax/source/tools/fshelper.cxx7
2 files changed, 6 insertions, 5 deletions
diff --git a/sax/source/tools/fastserializer.cxx b/sax/source/tools/fastserializer.cxx
index d8857689a543..38766095e5fc 100644
--- a/sax/source/tools/fastserializer.cxx
+++ b/sax/source/tools/fastserializer.cxx
@@ -113,7 +113,7 @@ namespace sax_fastparser {
void FastSaxSerializer::write( const char* pStr, sal_Int32 nLen, bool bEscape )
{
- if (nLen == 0)
+ if (nLen == -1)
nLen = strlen(pStr);
if (!bEscape)
@@ -251,7 +251,7 @@ namespace sax_fastparser {
writeBytes(sEqualSignAndQuote, N_CHARS(sEqualSignAndQuote));
- write(maTokenValues[j].pValue, 0, true);
+ write(maTokenValues[j].pValue, -1, true);
writeBytes(sQuote, N_CHARS(sQuote));
}
diff --git a/sax/source/tools/fshelper.cxx b/sax/source/tools/fshelper.cxx
index e0ed75186629..801be108bc07 100644
--- a/sax/source/tools/fshelper.cxx
+++ b/sax/source/tools/fshelper.cxx
@@ -102,7 +102,7 @@ void FastSerializerHelper::singleElement(sal_Int32 elementTokenId, XFastAttribut
FastSerializerHelper* FastSerializerHelper::write(const char* value)
{
- mpSerializer->write(value, 0, false);
+ mpSerializer->write(value, -1, false);
return this;
}
@@ -132,13 +132,14 @@ FastSerializerHelper* FastSerializerHelper::write(double value)
FastSerializerHelper* FastSerializerHelper::writeEscaped(const char* value)
{
- mpSerializer->write(value, 0, true);
+ mpSerializer->write(value, -1, true);
return this;
}
FastSerializerHelper* FastSerializerHelper::writeEscaped(const OUString& value)
{
- mpSerializer->write(value, true);
+ if (!value.isEmpty())
+ mpSerializer->write(value, true);
return this;
}