From 2fff625c608eff5960d4c7e68e3d671580716bec Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Mon, 2 Dec 2013 17:19:49 -0500 Subject: Move this out of the namespace scope. Change-Id: I4aec1d45edb47ea16adaa8d2ac23340b8f421bae --- sax/source/fastparser/fastparser.cxx | 77 ++++++++++++++++++------------------ sax/source/fastparser/fastparser.hxx | 4 +- 2 files changed, 41 insertions(+), 40 deletions(-) (limited to 'sax') diff --git a/sax/source/fastparser/fastparser.cxx b/sax/source/fastparser/fastparser.cxx index afe9454605c7..caf4ec1aa577 100644 --- a/sax/source/fastparser/fastparser.cxx +++ b/sax/source/fastparser/fastparser.cxx @@ -40,6 +40,45 @@ using namespace ::com::sun::star::lang; using namespace ::com::sun::star::xml::sax; using namespace ::com::sun::star::io; +extern "C" { + +static void call_callbackStartElement(void *userData, const XML_Char *name , const XML_Char **atts) +{ + sax_fastparser::FastSaxParser* pFastParser = reinterpret_cast( userData ); + pFastParser->callbackStartElement( name, atts ); +} + +static void call_callbackEndElement(void *userData, const XML_Char *name) +{ + sax_fastparser::FastSaxParser* pFastParser = reinterpret_cast( userData ); + pFastParser->callbackEndElement( name ); +} + +static void call_callbackCharacters( void *userData , const XML_Char *s , int nLen ) +{ + sax_fastparser::FastSaxParser* pFastParser = reinterpret_cast( userData ); + pFastParser->callbackCharacters( s, nLen ); +} + +static void call_callbackEntityDecl(void *userData, const XML_Char *entityName, + int is_parameter_entity, const XML_Char *value, int value_length, + const XML_Char *base, const XML_Char *systemId, + const XML_Char *publicId, const XML_Char *notationName) +{ + sax_fastparser::FastSaxParser* pFastParser = reinterpret_cast(userData); + pFastParser->callbackEntityDecl(entityName, is_parameter_entity, value, + value_length, base, systemId, publicId, notationName); +} + +static int call_callbackExternalEntityRef( XML_Parser parser, + const XML_Char *openEntityNames, const XML_Char *base, const XML_Char *systemId, const XML_Char *publicId ) +{ + sax_fastparser::FastSaxParser* pFastParser = reinterpret_cast( XML_GetUserData( parser ) ); + return pFastParser->callbackExternalEntityRef( parser, openEntityNames, base, systemId, publicId ); +} + +} // extern "C" + namespace sax_fastparser { SaxContext::SaxContext( sal_Int32 nElementToken, const OUString& aNamespace, const OUString& aElementName ): @@ -115,44 +154,6 @@ private: // the implementation part //--------------------------------------------- -extern "C" { - -static void call_callbackStartElement(void *userData, const XML_Char *name , const XML_Char **atts) -{ - FastSaxParser* pFastParser = reinterpret_cast< FastSaxParser* >( userData ); - pFastParser->callbackStartElement( name, atts ); -} - -static void call_callbackEndElement(void *userData, const XML_Char *name) -{ - FastSaxParser* pFastParser = reinterpret_cast< FastSaxParser* >( userData ); - pFastParser->callbackEndElement( name ); -} - -static void call_callbackCharacters( void *userData , const XML_Char *s , int nLen ) -{ - FastSaxParser* pFastParser = reinterpret_cast< FastSaxParser* >( userData ); - pFastParser->callbackCharacters( s, nLen ); -} - -static void call_callbackEntityDecl(void *userData, const XML_Char *entityName, - int is_parameter_entity, const XML_Char *value, int value_length, - const XML_Char *base, const XML_Char *systemId, - const XML_Char *publicId, const XML_Char *notationName) -{ - FastSaxParser* pFastParser = reinterpret_cast(userData); - pFastParser->callbackEntityDecl(entityName, is_parameter_entity, value, - value_length, base, systemId, publicId, notationName); -} - -static int call_callbackExternalEntityRef( XML_Parser parser, - const XML_Char *openEntityNames, const XML_Char *base, const XML_Char *systemId, const XML_Char *publicId ) -{ - FastSaxParser* pFastParser = reinterpret_cast< FastSaxParser* >( XML_GetUserData( parser ) ); - return pFastParser->callbackExternalEntityRef( parser, openEntityNames, base, systemId, publicId ); -} - -} // extern "C" // -------------------------------------------------------------------- // FastLocatorImpl implementation diff --git a/sax/source/fastparser/fastparser.hxx b/sax/source/fastparser/fastparser.hxx index d2bf1a73c354..6888cef91b37 100644 --- a/sax/source/fastparser/fastparser.hxx +++ b/sax/source/fastparser/fastparser.hxx @@ -193,8 +193,8 @@ public: const XML_Char *systemId, const XML_Char *publicId, const XML_Char *notationName); - inline void pushEntity( const Entity& rEntity ) { maEntities.push( rEntity ); } - inline void popEntity() { maEntities.pop(); } + void pushEntity( const Entity& rEntity ) { maEntities.push( rEntity ); } + void popEntity() { maEntities.pop(); } Entity& getEntity() { return maEntities.top(); } void parse(); void produce( CallbackType aType ); -- cgit v1.2.3