diff options
author | Luboš Luňák <l.lunak@suse.cz> | 2012-12-19 12:13:13 +0100 |
---|---|---|
committer | Luboš Luňák <l.lunak@suse.cz> | 2012-12-19 12:20:00 +0100 |
commit | 9c17f2b24bc97b46640b1728fb04d65b88c09f75 (patch) | |
tree | 793a1818707d40e3a05258fee96627bd25e84869 /sax/source/tools/fshelper.cxx | |
parent | a6d5ed529a373863eb670cc75bd797057a339745 (diff) |
wrap vararg sax functions in typesafe overloads
Now automatic conversions can take place (no getStr() needed),
and there are compile errors when used improperly. The FSEND terminator
is also no longer needed, but it's better to dump it only after
forgetting it no longer silently breaks backports.
Change-Id: Ib47e6eda2d5e12ce889b69bf2affbda3679c2d3f
Diffstat (limited to 'sax/source/tools/fshelper.cxx')
-rw-r--r-- | sax/source/tools/fshelper.cxx | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/sax/source/tools/fshelper.cxx b/sax/source/tools/fshelper.cxx index ffb3506c175d..2f3f7bfc5292 100644 --- a/sax/source/tools/fshelper.cxx +++ b/sax/source/tools/fshelper.cxx @@ -47,14 +47,16 @@ FastSerializerHelper::~FastSerializerHelper() delete mpSerializer; } -void FastSerializerHelper::startElementV(sal_Int32 elementTokenId, va_list args) +void FastSerializerHelper::startElementInternal(sal_Int32 elementTokenId, ...) { + va_list args; + va_start( args, elementTokenId ); FastAttributeList* pAttrList = new FastAttributeList( mxTokenHandler ); while (true) { sal_Int32 nName = va_arg(args, sal_Int32); - if (nName == FSEND) + if (nName == FSEND_internal) break; const char* pValue = va_arg(args, const char*); if (pValue) @@ -63,16 +65,19 @@ void FastSerializerHelper::startElementV(sal_Int32 elementTokenId, va_list args) const com::sun::star::uno::Reference<com::sun::star::xml::sax::XFastAttributeList> xAttrList(pAttrList); mpSerializer->startFastElement(elementTokenId, xAttrList); + va_end( args ); } -void FastSerializerHelper::singleElementV(sal_Int32 elementTokenId, va_list args) +void FastSerializerHelper::singleElementInternal(sal_Int32 elementTokenId, ...) { + va_list args; + va_start( args, elementTokenId ); FastAttributeList* pAttrList = new FastAttributeList( mxTokenHandler ); while (true) { sal_Int32 nName = va_arg(args, sal_Int32); - if (nName == FSEND) + if (nName == FSEND_internal) break; const char* pValue = va_arg(args, const char*); if (pValue) @@ -81,6 +86,7 @@ void FastSerializerHelper::singleElementV(sal_Int32 elementTokenId, va_list args const com::sun::star::uno::Reference<com::sun::star::xml::sax::XFastAttributeList> xAttrList(pAttrList); mpSerializer->singleFastElement(elementTokenId, xAttrList); + va_end( args ); } void FastSerializerHelper::endElement(sal_Int32 elementTokenId) @@ -88,13 +94,13 @@ void FastSerializerHelper::endElement(sal_Int32 elementTokenId) mpSerializer->endFastElement(elementTokenId); } -void FastSerializerHelper::startElementV(sal_Int32 elementTokenId, XFastAttributeListRef xAttrList) +void FastSerializerHelper::startElement(sal_Int32 elementTokenId, XFastAttributeListRef xAttrList) { mpSerializer->startFastElement(elementTokenId, xAttrList); } -void FastSerializerHelper::singleElementV(sal_Int32 elementTokenId, XFastAttributeListRef xAttrList) +void FastSerializerHelper::singleElement(sal_Int32 elementTokenId, XFastAttributeListRef xAttrList) { mpSerializer->singleFastElement(elementTokenId, xAttrList); } |