зеркало из https://github.com/mozilla/gecko-dev.git
Bug 427448 - Applescript curl & ptit query worked in FF2 fails in FF3
r=josh, sr=roc
This commit is contained in:
Родитель
38dd714105
Коммит
cb7b5393de
|
@ -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';
|
||||
}
|
||||
|
||||
//---------------------------------------------------------
|
||||
|
|
Загрузка…
Ссылка в новой задаче