summaryrefslogtreecommitdiff
path: root/www/firefox/patches/patch-fb
blob: 5d4e80f14a4f9eaf57330cdcc94b22fa47406b89 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
$NetBSD: patch-fb,v 1.1.2.2 2006/05/02 20:59:47 salo Exp $

--- embedding/components/commandhandler/src/nsBaseCommandController.cpp.orig	2006-04-28 12:43:57.000000000 +0200
+++ embedding/components/commandhandler/src/nsBaseCommandController.cpp
@@ -55,7 +55,6 @@ NS_INTERFACE_MAP_BEGIN(nsBaseCommandCont
 NS_INTERFACE_MAP_END
 
 nsBaseCommandController::nsBaseCommandController()
-: mCommandContext(nsnull)
 {
 }
 
@@ -79,7 +78,7 @@ nsBaseCommandController::Init(nsIControl
 NS_IMETHODIMP
 nsBaseCommandController::SetCommandContext(nsISupports *aCommandContext)
 {
-  mCommandContext = aCommandContext;     // no addref  
+  mCommandContext = do_GetWeakReference(aCommandContext);
   return NS_OK;
 }
 
@@ -113,7 +112,8 @@ nsBaseCommandController::IsCommandEnable
 {
   NS_ENSURE_ARG_POINTER(aCommand);
   NS_ENSURE_ARG_POINTER(aResult);
-  return mCommandTable->IsCommandEnabled(aCommand, mCommandContext, aResult);
+  nsCOMPtr<nsISupports> context = do_QueryReferent(mCommandContext);
+  return mCommandTable->IsCommandEnabled(aCommand, context, aResult);
 }
 
 NS_IMETHODIMP
@@ -121,14 +121,16 @@ nsBaseCommandController::SupportsCommand
 {
   NS_ENSURE_ARG_POINTER(aCommand);
   NS_ENSURE_ARG_POINTER(aResult);
-  return mCommandTable->SupportsCommand(aCommand, mCommandContext, aResult);
+  nsCOMPtr<nsISupports> context = do_QueryReferent(mCommandContext);
+  return mCommandTable->SupportsCommand(aCommand, context, aResult);
 }
 
 NS_IMETHODIMP
 nsBaseCommandController::DoCommand(const char *aCommand)
 {
   NS_ENSURE_ARG_POINTER(aCommand);
-  return mCommandTable->DoCommand(aCommand, mCommandContext);
+  nsCOMPtr<nsISupports> context = do_QueryReferent(mCommandContext);
+  return mCommandTable->DoCommand(aCommand, context);
 }
 
 NS_IMETHODIMP
@@ -136,7 +138,8 @@ nsBaseCommandController::DoCommandWithPa
                                              nsICommandParams *aParams)
 {
   NS_ENSURE_ARG_POINTER(aCommand);
-  return mCommandTable->DoCommandParams(aCommand, aParams, mCommandContext);
+  nsCOMPtr<nsISupports> context = do_QueryReferent(mCommandContext);
+  return mCommandTable->DoCommandParams(aCommand, aParams, context);
 }
 
 NS_IMETHODIMP
@@ -144,7 +147,8 @@ nsBaseCommandController::GetCommandState
                                                    nsICommandParams *aParams)
 {
   NS_ENSURE_ARG_POINTER(aCommand);
-  return mCommandTable->GetCommandState(aCommand, aParams, mCommandContext);
+  nsCOMPtr<nsISupports> context = do_QueryReferent(mCommandContext);
+  return mCommandTable->GetCommandState(aCommand, aParams, context);
 }
 
 NS_IMETHODIMP