summaryrefslogtreecommitdiff
path: root/include/sax
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2019-04-19 02:24:00 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2019-04-19 21:20:46 +0200
commit1fe24bb1e2fbe44a4bf2c03297e259b3a18b1235 (patch)
treee237d906174ec0646fef5051e5f6940da31e28cf /include/sax
parent2a6450cbe8b57cae240d8cfea02e508cfac78dbe (diff)
Further cleanup of FastSerializerHelper's startElement/singleElement[NS]
Drop FSEND_t: C-style varargs code was replaced since version 6.0 in commit d43fc40718217d89cc95cc3c0bc0b8e7926abcc0, so it's time to remove the last bits. Drop int-to-string macros that are simple wrappers over OString::number. Avoid unnecessary string type conversions. Change-Id: I86478577b8e469f99b5a90619e5f78a61f4f23fb Reviewed-on: https://gerrit.libreoffice.org/70964 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'include/sax')
-rw-r--r--include/sax/fshelper.hxx19
1 files changed, 6 insertions, 13 deletions
diff --git a/include/sax/fshelper.hxx b/include/sax/fshelper.hxx
index c5148dcd0b00..7876e48a6c6c 100644
--- a/include/sax/fshelper.hxx
+++ b/include/sax/fshelper.hxx
@@ -31,13 +31,6 @@ namespace com { namespace sun { namespace star { namespace io { class XOutputStr
namespace sax_fastparser { class FastAttributeList; }
#define FSNS(namespc, element) ((namespc << 16) | element)
-// Backwards compatibility for code that used FSEND to terminate the vararg.
-// As soon as no supported LO version has the varargs code, this can be removed entirely
-// (otherwise backports might break silently if people didn't add FSEND).
-// Ctor is there to get an error when trying to pass it to a vararg by accident.
-struct FSEND_t { FSEND_t() {}; };
-static const FSEND_t FSEND = FSEND_t();
-const sal_Int32 FSEND_internal = -1; // same as XML_TOKEN_INVALID
namespace sax_fastparser {
@@ -69,7 +62,7 @@ public:
pushAttributeValue(attribute, value);
startElement(elementTokenId, std::forward<Args>(args)...);
}
- void startElement(sal_Int32 elementTokenId, FSEND_t);
+ void startElement(sal_Int32 elementTokenId);
/// Start an element. After the first two arguments there can be a number of (attribute, value) pairs.
template<typename... Args>
@@ -85,9 +78,9 @@ public:
pushAttributeValue(attribute, value);
startElementNS(namespaceTokenId, elementTokenId, std::forward<Args>(args)...);
}
- void startElementNS(sal_Int32 namespaceTokenId, sal_Int32 elementTokenId, FSEND_t)
+ void startElementNS(sal_Int32 namespaceTokenId, sal_Int32 elementTokenId)
{
- startElement(FSNS(namespaceTokenId, elementTokenId), FSEND);
+ startElement(FSNS(namespaceTokenId, elementTokenId));
}
/// Create a single element. After the first argument there can be a number of (attribute, value) pairs.
@@ -104,7 +97,7 @@ public:
pushAttributeValue(attribute, value);
singleElement(elementTokenId, std::forward<Args>(args)...);
}
- void singleElement(sal_Int32 elementTokenId, FSEND_t);
+ void singleElement(sal_Int32 elementTokenId);
/// Create a single element. After the first two arguments there can be a number of (attribute, value) pairs.
template<typename... Args>
@@ -120,9 +113,9 @@ public:
pushAttributeValue(attribute, value);
singleElementNS(namespaceTokenId, elementTokenId, std::forward<Args>(args)...);
}
- void singleElementNS(sal_Int32 namespaceTokenId, sal_Int32 elementTokenId, FSEND_t)
+ void singleElementNS(sal_Int32 namespaceTokenId, sal_Int32 elementTokenId)
{
- singleElement(FSNS(namespaceTokenId, elementTokenId), FSEND);
+ singleElement(FSNS(namespaceTokenId, elementTokenId));
}
void endElement(sal_Int32 elementTokenId);