bug 145916, add GetDocument to nsITextServicesDocument; r=brade, sr=kin; submitted by Darabos Daniel (cyhawk@sch.bme.hu)

This commit is contained in:
brade%netscape.com 2003-01-16 15:02:33 +00:00
parent 6622999c70
commit 331fad25c1
3 changed files with 24 additions and 1 deletions

View File

@ -77,7 +77,7 @@ public:
} TSDBlockSelectionStatus;
/**
* Initailizes the text services document to use a particular
* Initializes the text services document to use a particular
* DOM document.
* @param aDOMDocument is the document to use. It is AddRef'd
* by this method.
@ -86,6 +86,12 @@ public:
*/
NS_IMETHOD InitWithDocument(nsIDOMDocument *aDOMDocument, nsIPresShell *aPresShell) = 0;
/**
* Get the DOM document for the document in use.
* @return aDocument the dom document [OUT]
*/
NS_IMETHOD GetDocument(nsIDOMDocument **aDocument) = 0;
/**
* Initializes the text services document to use a particular
* editor. The text services document will use the DOM document

View File

@ -391,6 +391,22 @@ nsTextServicesDocument::InitWithEditor(nsIEditor *aEditor)
return result;
}
NS_IMETHODIMP
nsTextServicesDocument::GetDocument(nsIDOMDocument **aDoc)
{
if (!aDoc)
return NS_ERROR_NULL_POINTER;
*aDoc = nsnull; // init out param
if (!mDOMDocument)
return NS_ERROR_NOT_INITIALIZED;
*aDoc = mDOMDocument;
NS_ADDREF(*aDoc);
return NS_OK;
}
NS_IMETHODIMP
nsTextServicesDocument::SetFilter(nsITextServicesFilter *aFilter)
{

View File

@ -128,6 +128,7 @@ public:
/* nsITextServicesDocument method implementations. */
NS_IMETHOD InitWithDocument(nsIDOMDocument *aDOMDocument, nsIPresShell *aPresShell);
NS_IMETHOD InitWithEditor(nsIEditor *aEditor);
NS_IMETHOD GetDocument(nsIDOMDocument **aDoc);
NS_IMETHOD SetFilter(nsITextServicesFilter *aFilter);
NS_IMETHOD CanEdit(PRBool *aCanEdit);
NS_IMETHOD GetCurrentTextBlock(nsString *aStr);