Bug 427448 - Applescript curl & ptit query worked in FF2 fails in FF3

r=josh, sr=roc
This commit is contained in:
Luis de la Rosa 2008-07-17 13:02:34 -04:00
Родитель 38dd714105
Коммит cb7b5393de
1 изменённых файлов: 22 добавлений и 3 удалений

Просмотреть файл

@ -45,6 +45,7 @@
#include "nsIContent.h"
#include "nsIDocShell.h"
#include "nsIDocShellTreeItem.h"
#include "nsIDocShellTreeOwner.h"
#include "nsIDocument.h"
#include "nsIDOMDocument.h"
#include "nsIDOMWindow.h"
@ -406,9 +407,27 @@ TAEListIndex nsWindowUtils::GetWindowIndex(TWindowKind windowKind, WindowPtr the
//---------------------------------------------------------
void nsWindowUtils::GetCleanedWindowName(WindowPtr wind, char* outName, long maxLen)
{
Str255 uncleanName;
GetWTitle(wind, uncleanName);
CopyPascalToCString(uncleanName, outName, maxLen);
nsCOMPtr<nsIXULWindow> xulWindow;
GetXULWindowFromWindowPtr(wind, getter_AddRefs(xulWindow));
ThrowErrIfNil(xulWindow, paramErr);
nsCOMPtr<nsIDocShellTreeItem> contentShell;
xulWindow->GetPrimaryContentShell(getter_AddRefs(contentShell));
ThrowErrIfNil(contentShell, paramErr);
nsCOMPtr<nsIDocShellTreeOwner> treeOwner;
contentShell->GetTreeOwner(getter_AddRefs(treeOwner));
nsCOMPtr<nsIBaseWindow> baseWindow(do_QueryInterface(treeOwner));
ThrowErrIfNil(baseWindow, paramErr);
nsXPIDLString title;
baseWindow->GetTitle(getter_Copies(title));
ThrowErrIfNil(title, paramErr);
const char* cTitle = NS_ConvertUTF16toUTF8(title).get();
strncpy(outName, cTitle, maxLen);
outName[maxLen - 1] = '\0';
}
//---------------------------------------------------------