Fix for bug #6254 (Find/Replace needs to be implemented.)
First pass implementation of Find and Replace. sr=sfraser@netscape.com r=ducarroz@netscape.com New Files: editor/txtsvc/macbuild/txtsvcIDL.mcp editor/txtsvc/public/MANIFEST_IDL editor/txtsvc/public/nsIFindAndReplace.idl editor/txtsvc/src/nsFindAndReplace.cpp editor/txtsvc/src/nsFindAndReplace.h xpfe/components/find/resources/replacedialog.js xpfe/components/find/resources/replacedialog.xul xpfe/components/find/resources/locale/en-US/replacedialog.dtd Modified Files: build/mac/build_scripts/MozillaBuildList.pm editor/base/nsEditorShell.cpp editor/idl/nsIEditorShell.idl editor/txtsvc/macbuild/txtsvc.mcp editor/txtsvc/public/Makefile.in editor/txtsvc/public/makefile.win editor/txtsvc/public/MANIFEST editor/txtsvc/src/Makefile.in editor/txtsvc/src/makefile.win editor/txtsvc/src/nsTextServicesFactory.cpp editor/ui/composer/content/ComposerCommands.js editor/ui/composer/content/editor.js editor/ui/composer/content/editorOverlay.xul editor/ui/composer/locale/en-US/editorOverlay.dtd mailnews/compose/resources/content/messengercompose.xul mailnews/compose/resources/content/MsgComposeCommands.js mailnews/compose/resources/locale/en-US/messengercompose.dtd xpfe/components/jar.mn xpfe/components/find/public/nsIFindComponent.idl xpfe/components/find/public/nsISearchContext.idl xpfe/components/find/resources/makefile.win xpfe/components/find/resources/MANIFEST xpfe/components/find/resources/locale/en-US/MANIFEST xpfe/components/find/src/nsFindComponent.cpp xpfe/components/find/src/nsFindComponent.h git-svn-id: svn://10.0.0.236/trunk@85386 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -2920,7 +2920,7 @@ nsEditorShell::DoFind(PRBool aFindNext)
|
||||
return NS_ERROR_NOT_INITIALIZED;
|
||||
nsCOMPtr<nsIDOMWindowInternal> cwP = do_QueryReferent(mContentWindow);
|
||||
if (!cwP) return NS_ERROR_NOT_INITIALIZED;
|
||||
rv = findComponent->CreateContext(cwP, nsnull, getter_AddRefs(mSearchContext));
|
||||
rv = findComponent->CreateContext(cwP, this, getter_AddRefs(mSearchContext));
|
||||
}
|
||||
|
||||
if (NS_SUCCEEDED(rv))
|
||||
@@ -2946,6 +2946,34 @@ nsEditorShell::FindNext()
|
||||
return DoFind(PR_TRUE);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsEditorShell::Replace()
|
||||
{
|
||||
if (!mContentAreaDocShell)
|
||||
return NS_ERROR_NOT_INITIALIZED;
|
||||
|
||||
// Get find component.
|
||||
nsresult rv;
|
||||
NS_WITH_SERVICE(nsIFindComponent, findComponent, NS_IFINDCOMPONENT_CONTRACTID, &rv);
|
||||
NS_ASSERTION(((NS_SUCCEEDED(rv)) && findComponent), "GetService failed for find component.");
|
||||
if (NS_FAILED(rv)) { return rv; }
|
||||
|
||||
// make the search context if we need to
|
||||
if (!mSearchContext)
|
||||
{
|
||||
if(!mContentWindow)
|
||||
return NS_ERROR_NOT_INITIALIZED;
|
||||
nsCOMPtr<nsIDOMWindowInternal> cwP = do_QueryReferent(mContentWindow);
|
||||
if (!cwP) return NS_ERROR_NOT_INITIALIZED;
|
||||
rv = findComponent->CreateContext(cwP, this, getter_AddRefs(mSearchContext));
|
||||
}
|
||||
|
||||
if (NS_SUCCEEDED(rv))
|
||||
rv = findComponent->Replace(mSearchContext);
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
/* Get localized strings for UI from the Editor's string bundle */
|
||||
// Use this version from JavaScript:
|
||||
NS_IMETHODIMP
|
||||
|
||||
Reference in New Issue
Block a user