Removing obsolete Create method. Renaming CID and PROGID defines. Move PROGID into header file. Add my copyright.

Not part of build yet. a=leaf


git-svn-id: svn://10.0.0.236/trunk@65491 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
Peter.VanderBeken%pandora.be 2000-04-07 10:35:05 +00:00
parent 3f4955e164
commit bf187e46c5
3 changed files with 17 additions and 54 deletions

View File

@ -14,6 +14,9 @@
* The Initial Developer of the Original Code is The MITRE Corporation.
* Portions created by MITRE are Copyright (C) 1999 The MITRE Corporation.
*
* Portions created by Peter Van der Beken are Copyright (C) 2000
* Peter Van der Beken. All Rights Reserved.
*
* Contributor(s):
* Peter Van der Beken, peter.vanderbeken@pandora.be
* -- original author.
@ -24,17 +27,14 @@
#include "XSLTProcessor.h"
#define MITRE_XSL_PROCESSOR_PROGID \
"component://netscape/document-transformer?type=text/xsl"
// Factory Constructor
NS_GENERIC_FACTORY_CONSTRUCTOR(XSLTProcessor)
// Component Table
static nsModuleComponentInfo components[] = {
{ "Transformiix XSLT Processor",
MITRE_XSL_PROCESSOR_CID,
MITRE_XSL_PROCESSOR_PROGID,
TRANSFORMIIX_XSLT_PROCESSOR_CID,
TRANSFORMIIX_XSLT_PROCESSOR_PROGID,
XSLTProcessorConstructor }
};

View File

@ -25,7 +25,7 @@
* Pierre Phaneuf, pp@ludusdesign.com
* -- fixed some XPCOM usage.
*
* $Id: XSLTProcessor.cpp,v 1.1 2000-04-06 07:47:01 kvisco%ziplink.net Exp $
* $Id: XSLTProcessor.cpp,v 1.2 2000-04-07 10:34:18 Peter.VanderBeken%pandora.be Exp $
*/
#include "XSLTProcessor.h"
@ -38,7 +38,7 @@
/**
* XSLTProcessor is a class for Processing XSL styelsheets
* @author <a href="mailto:kvisco@ziplink.net">Keith Visco</a>
* @version $Revision: 1.1 $ $Date: 2000-04-06 07:47:01 $
* @version $Revision: 1.2 $ $Date: 2000-04-07 10:34:18 $
**/
/**
@ -103,32 +103,7 @@ XSLTProcessor::~XSLTProcessor() {
} //-- ~XSLTProcessor
#ifdef MOZILLA
// Provide a Create method that can be called by a factory constructor:
NS_METHOD
XSLTProcessor::Create(nsISupports* aOuter, const nsIID& aIID, void* *aResult)
{
if (aOuter)
return NS_ERROR_NO_AGGREGATION;
XSLTProcessor* xslp = new XSLTProcessor();
if (xslp == NULL)
return NS_ERROR_OUT_OF_MEMORY;
// Note that Create doesn't initialize the instance -- that has to
// be done by the caller since the initialization args aren't passed
// in here.
// AddRef before calling QI -- this makes it easier to handle the QI
// failure case because we'll always just Release and return
NS_ADDREF(xslp);
nsresult rv = xslp->QueryInterface(aIID, aResult);
// This will free it if QI failed:
NS_RELEASE(xslp);
return rv;
}
NS_IMPL_ISUPPORTS(XSLTProcessor, NS_GET_IID(nsIDocumentTransformer));
NS_IMPL_ISUPPORTS1(XSLTProcessor, nsIDocumentTransformer)
#endif
/**

View File

@ -21,7 +21,7 @@
* Keith Visco, kvisco@ziplink.net
* -- original author.
*
* $Id: XSLTProcessor.h,v 1.1 2000-04-06 07:47:07 kvisco%ziplink.net Exp $
* $Id: XSLTProcessor.h,v 1.2 2000-04-07 10:34:35 Peter.VanderBeken%pandora.be Exp $
*/
@ -63,44 +63,32 @@
#ifdef MOZILLA
/* bacd8ad0-552f-11d3-a9f7-000064657374 */
#define MITRE_XSL_PROCESSOR_CID \
#define TRANSFORMIIX_XSLT_PROCESSOR_CID \
{ 0xbacd8ad0, 0x552f, 0x11d3, {0xa9, 0xf7, 0x00, 0x00, 0x64, 0x65, 0x73, 0x74} }
#define TRANSFORMIIX_XSLT_PROCESSOR_PROGID \
"component://netscape/document-transformer?type=text/xsl"
#endif
/**
* A class for Processing XSL Stylesheets
* @author <a href="mailto:kvisco@ziplink.net">Keith Visco</a>
* @version $Revision: 1.1 $ $Date: 2000-04-06 07:47:07 $
* @version $Revision: 1.2 $ $Date: 2000-04-07 10:34:35 $
**/
class XSLTProcessor
#ifdef MOZILLA
: nsIDocumentTransformer
: public nsIDocumentTransformer
#endif
{
public:
#ifdef MOZILLA
// Define a Create method to be used with a factory:
static NS_METHOD
Create(nsISupports* aOuter, const nsIID& aIID, void* *aResult);
/**
* This macro expands into a declaration of the nsISupports interface.
* Every XPCOM component needs to implement nsISupports, as it acts
* as the gateway to other interfaces this component implements. You
* could manually declare QueryInterface, AddRef, and Release instead
* of using this macro, but why?
*/
// nsISupports interface
NS_DECL_ISUPPORTS
// nsIDocumentTransformer methods
NS_IMETHOD TransformDocument(nsIDOMElement* aSourceDOM,
nsIDOMElement* aStyleDOM,
nsIDOMDocument* aOutputDoc,
nsIObserver* aObserver);
// nsIDocumentTransformer interface
NS_DECL_NSIDOCUMENTTRANSFORMER
#endif
/**