Implement GetURL

git-svn-id: svn://10.0.0.236/trunk@6208 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
kipp%netscape.com
1998-07-22 23:40:54 +00:00
parent b6847ea0a2
commit 021f275c40
2 changed files with 34 additions and 0 deletions

View File

@@ -115,6 +115,7 @@ public:
nsIPostData* aPostData=nsnull);
NS_IMETHOD GoTo(PRInt32 aHistoryIndex);
NS_IMETHOD GetHistoryIndex(PRInt32& aResult);
NS_IMETHOD GetURL(PRInt32 aHistoryIndex, nsString& aURLResult);
NS_IMETHOD SetTitle(const nsString& aTitle);
NS_IMETHOD GetTitle(nsString& aResult);
@@ -729,6 +730,22 @@ nsWebShell::GetHistoryIndex(PRInt32& aResult)
return NS_OK;
}
NS_IMETHODIMP
nsWebShell::GetURL(PRInt32 aHistoryIndex, nsString& aURLResult)
{
nsresult rv = NS_ERROR_ILLEGAL_VALUE;
if ((aHistoryIndex >= 0) &&
(aHistoryIndex <= mHistory.Count() - 1)) {
aURLResult.Truncate();
nsString* s = (nsString*) mHistory.ElementAt(aHistoryIndex);
if (nsnull != s) {
aURLResult = *s;
}
rv = NS_OK;
}
return rv;
}
void
nsWebShell::ShowHistory()
{