Can't get the service of a changed component

"AndrĂ© Pedralho" <[email protected]> Mon, 27 Feb 2006 13:33:09 -0400
Newsgroups gmane.comp.mozilla.devel.gtk
Message-ID <[email protected]>
------=_Part_1818_17386926.1141061589189
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

Hi all,
I am trying to partially solve the bug
https://bugzilla.mozilla.org/show_bug.cgi?id=3D121139 and I'm in trouble. I=
f
you see the in bug page there are more explanations about my work on this.
In summa, I'am trying to comment out all the autocomplete stuff from the
global history. It seems to be easy, but after do the required changes, the
docshell cannot get the global history service. It tries to set the global
history usage to true, but the method below fails when tries to get the
global history service. I mean, the
do_GetService(NS_GLOBALHISTORY2_CONTRACTID, &rv) sets the rv to false. What
else do I have to do for getting it work?

NS_IMETHODIMP
nsDocShell::SetUseGlobalHistory(PRBool aUseGlobalHistory)
{
    nsresult rv;

    if (!aUseGlobalHistory) {
        mGlobalHistory =3D nsnull;
        return NS_OK;
    }

    if (mGlobalHistory) {
        return NS_OK;
    }

    mGlobalHistory =3D do_GetService(NS_GLOBALHISTORY2_CONTRACTID, &rv);
    return rv;
}

Thanks in advance.

--
Andr=E9 Pedralho
Bachelor in Computer Science
Instituto Nokia de Tecnologia

------=_Part_1818_17386926.1141061589189
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

Hi all,<br>
I am trying to partially solve the bug
<a href=3D"https://bugzilla.mozilla.org/show_bug.cgi?id=3D121139">https://b=
ugzilla.mozilla.org/show_bug.cgi?id=3D121139</a> and I'm in trouble.
If you see the in bug page there are more explanations about my work on
this. In summa, I'am trying to comment out all the autocomplete stuff
from the global history. It seems to be easy, but after do the required
changes, the docshell cannot get the global history service. It tries
to set the global history usage to true, but the method below fails
when tries to get the global history service. I mean, the
do_GetService(NS_GLOBALHISTORY2_CONTRACTID, &amp;rv) sets the rv to
false. What else do I have to do for getting it work?<br>
<br clear=3D"all">NS_IMETHODIMP<br>
nsDocShell::SetUseGlobalHistory(PRBool aUseGlobalHistory)<br>
{<br>
&nbsp;&nbsp;&nbsp; nsresult rv;<br>
<br>
&nbsp;&nbsp;&nbsp; if (!aUseGlobalHistory) {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mGlobalHistory =3D nsnull;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return NS_OK;<br>
&nbsp;&nbsp;&nbsp; }<br>
<br>
&nbsp;&nbsp;&nbsp; if (mGlobalHistory) {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return NS_OK;<br>
&nbsp;&nbsp;&nbsp; }<br>
<br>
&nbsp;&nbsp;&nbsp; mGlobalHistory =3D do_GetService(NS_GLOBALHISTORY2_CONTR=
ACTID, &amp;rv);<br>
&nbsp;&nbsp;&nbsp; return rv;<br>
}<br><br>
Thanks in advance.<br>
<br>
-- <br>Andr=E9 Pedralho<br>Bachelor in Computer Science<br>Instituto Nokia =
de Tecnologia

------=_Part_1818_17386926.1141061589189--