Exemple #1
0
static HRESULT exec_fontname(HTMLDocument *This, DWORD cmdexecopt, VARIANT *in, VARIANT *out)
{
    TRACE("(%p)->(%p %p)\n", This, in, out);

    if(!This->doc_obj->nscontainer) {
        update_doc(This, UPDATE_UI);
        return E_FAIL;
    }

    if(in) {
        char *stra;

        if(V_VT(in) != VT_BSTR) {
            FIXME("Unsupported fontname %s\n", debugstr_variant(out));
            return E_INVALIDARG;
        }

        TRACE("%s\n", debugstr_w(V_BSTR(in)));

        stra = heap_strdupWtoA(V_BSTR(in));
        set_ns_fontname(This, stra);
        heap_free(stra);

        update_doc(This, UPDATE_UI);
    }

    if(out) {
        nsICommandParams *nsparam;
        LPWSTR strw;
        char *stra;
        DWORD len;
        nsresult nsres;

        V_VT(out) = VT_BSTR;
        V_BSTR(out) = NULL;

        nsparam = create_nscommand_params();

        nsres = get_ns_command_state(This->doc_obj->nscontainer, NSCMD_FONTFACE, nsparam);
        if(NS_FAILED(nsres))
            return S_OK;

        nsICommandParams_GetCStringValue(nsparam, NSSTATE_ATTRIBUTE, &stra);
        nsICommandParams_Release(nsparam);

        len = MultiByteToWideChar(CP_ACP, 0, stra, -1, NULL, 0);
        strw = heap_alloc(len*sizeof(WCHAR));
        MultiByteToWideChar(CP_ACP, 0, stra, -1, strw, len);
        nsfree(stra);

        V_BSTR(out) = SysAllocString(strw);
        heap_free(strw);
    }

    return S_OK;
}
Exemple #2
0
void tg_free(trustgroup *tg, int created) {
  if(created)
    triggerhook(HOOK_TRUSTS_LOSTGROUP, tg);

  freesstring(tg->name);
  freesstring(tg->createdby);
  freesstring(tg->contact);
  freesstring(tg->comment);
  nsfree(POOL_TRUSTS, tg);
}
Exemple #3
0
void freehost(host *hp) {
  nsfree(POOL_NICK, hp);
}
Exemple #4
0
void freenick(nick *np) {
  nsfree(POOL_NICK, np);
}
Exemple #5
0
void freescan(scan *sp) {
  nsfree(POOL_PROXYSCAN, sp);
}
Exemple #6
0
void freeextrascan(extrascan *esp) {
  nsfree(POOL_PROXYSCAN, esp);
}
Exemple #7
0
void freefoundproxy(foundproxy *fpp) {
  nsfree(POOL_PROXYSCAN, fpp);
}
Exemple #8
0
void freependingscan(pendingscan *psp) {
  nsfree(POOL_PROXYSCAN, psp);
}
Exemple #9
0
void freecachehost(cachehost *chp) {
  nsfree(POOL_PROXYSCAN, chp);
} 
Exemple #10
0
void th_free(trusthost *th) {
  triggerhook(HOOK_TRUSTS_LOSTHOST, th);

  nsfree(POOL_TRUSTS, th);
}