Re: CVS: commit dom abi/src/wp/impexp/xp ie_imp_XML.cpp

From: <msevior_at_physics.unimelb.edu.au>
Date: Tue Jul 18 2006 - 07:28:34 CEST

>
> Update of /cvsroot/abi/src/wp/impexp/xp
> In directory abiword.snt.utwente.nl:/tmp/cvs-serv30889
>
> Modified Files:
> ie_imp_XML.cpp ie_imp_XML.h
> Log Message:
> Allow any XML-based importer to operate on a ByteBuffer. This is useful
> for chaining importers, such as XML -> XSLT -> ABW.
>
> This is useful for my SoC student's PDF import project.
>

Great! we can also use this for the abicollab document transmission code.

Thanks!

Martin

>
> Index: ie_imp_XML.cpp
> ===================================================================
> RCS file: /cvsroot/abi/src/wp/impexp/xp/ie_imp_XML.cpp,v
> retrieving revision 1.69
> retrieving revision 1.70
> diff -u -d -r1.69 -r1.70
> --- ie_imp_XML.cpp 15 Jul 2005 13:09:24 -0000 1.69
> +++ ie_imp_XML.cpp 18 Jul 2006 02:02:49 -0000 1.70
> @@ -123,6 +123,32 @@
> return m_error;
> }
>
> +UT_Error IE_Imp_XML::importFile(const UT_ByteBuf * data)
> +{
> + m_szFileName = 0;
> +
> + UT_XML default_xml;
> + UT_XML * parser = &default_xml;
> + if (m_pParser) parser = m_pParser;
> +
> + parser->setListener (this);
> + if (m_pReader) parser->setReader (m_pReader);
> +
> + UT_Error err = parser->parse (data);
> +
> + if ((err != UT_OK) && (err != UT_IE_SKIPINVALID))
> + m_error = UT_IE_BOGUSDOCUMENT;
> +
> + if (m_error != UT_OK)
> + {
> + UT_DEBUGMSG(("Problem reading document\n"));
> + if(m_error != UT_IE_SKIPINVALID)
> + m_szFileName = 0;
> + }
> +
> + return m_error;
> +}
> +
> bool IE_Imp_XML::pasteFromBuffer(PD_DocumentRange * pDocRange, const
> unsigned char * pData,
> UT_uint32 lenData, const char * /*szEncoding*/)
> {
>
> Index: ie_imp_XML.h
> ===================================================================
> RCS file: /cvsroot/abi/src/wp/impexp/xp/ie_imp_XML.h,v
> retrieving revision 1.39
> retrieving revision 1.40
> diff -u -d -r1.39 -r1.40
> --- ie_imp_XML.h 15 Jul 2005 04:00:19 -0000 1.39
> +++ ie_imp_XML.h 18 Jul 2006 02:02:49 -0000 1.40
> @@ -1,4 +1,4 @@
> -/* -*- mode: C++; tab-width: 4; c-basic-offset: 4; -*- */
> +//* -*- mode: C++; tab-width: 4; c-basic-offset: 4; -*- */
>
> /* AbiWord
> * Copyright (C) 2001 AbiSource, Inc.
> @@ -57,6 +57,7 @@
> IE_Imp_XML(PD_Document * pDocument, bool whiteSignificant);
> virtual ~IE_Imp_XML();
> virtual UT_Error importFile(const char * szFilename);
> + virtual UT_Error importFile(const UT_ByteBuf * data);
>
> virtual bool pasteFromBuffer(PD_DocumentRange * pDocRange,
> const unsigned char * pData,
>
> -----------------------------------------------
> To unsubscribe from this list, send a message to
> abisource-cvs-commit-request@abisource.com with the word
> unsubscribe in the message body.
>
Received on Tue Jul 18 07:27:17 2006

This archive was generated by hypermail 2.1.8 : Tue Jul 18 2006 - 07:27:18 CEST