Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com --- dlls/mshtml/htmlelem.c | 2 +- dlls/mshtml/htmlframe.c | 4 ++-- dlls/mshtml/htmlnode.c | 2 +- dlls/mshtml/htmlstyle.c | 2 +- dlls/mshtml/htmltable.c | 4 ++-- dlls/mshtml/mshtml_private.h | 4 +++- dlls/mshtml/nsembed.c | 6 +++--- 7 files changed, 13 insertions(+), 11 deletions(-)
diff --git a/dlls/mshtml/htmlelem.c b/dlls/mshtml/htmlelem.c index e8d108f..f5500a3 100644 --- a/dlls/mshtml/htmlelem.c +++ b/dlls/mshtml/htmlelem.c @@ -1095,7 +1095,7 @@ static HRESULT WINAPI HTMLElement_setAttribute(IHTMLElement *iface, BSTR strAttr nsAString name_str, value_str; nsresult nsres;
- hres = variant_to_nsstr(&AttributeValue, FALSE, &value_str); + hres = variant_to_nsstr(&AttributeValue, 0, &value_str); if(FAILED(hres)) return hres;
diff --git a/dlls/mshtml/htmlframe.c b/dlls/mshtml/htmlframe.c index e794284..07889b0 100644 --- a/dlls/mshtml/htmlframe.c +++ b/dlls/mshtml/htmlframe.c @@ -1239,7 +1239,7 @@ static HRESULT WINAPI HTMLIFrameElement2_put_height(IHTMLIFrameElement2 *iface,
TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
- hres = variant_to_nsstr(&v, FALSE, &nsstr); + hres = variant_to_nsstr(&v, 0, &nsstr); if(FAILED(hres)) return hres;
@@ -1277,7 +1277,7 @@ static HRESULT WINAPI HTMLIFrameElement2_put_width(IHTMLIFrameElement2 *iface, V
TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
- hres = variant_to_nsstr(&v, FALSE, &nsstr); + hres = variant_to_nsstr(&v, 0, &nsstr); if(FAILED(hres)) return hres;
diff --git a/dlls/mshtml/htmlnode.c b/dlls/mshtml/htmlnode.c index 996c28c..418c958 100644 --- a/dlls/mshtml/htmlnode.c +++ b/dlls/mshtml/htmlnode.c @@ -1245,7 +1245,7 @@ static HRESULT WINAPI HTMLDOMNode3_put_textContent(IHTMLDOMNode3 *iface, VARIANT
TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
- variant_to_nsstr(&v, FALSE, &nsstr); + variant_to_nsstr(&v, 0, &nsstr); nsres = nsIDOMNode_SetTextContent(This->nsnode, &nsstr); nsAString_Finish(&nsstr); if(NS_FAILED(nsres)) { diff --git a/dlls/mshtml/htmlstyle.c b/dlls/mshtml/htmlstyle.c index 2cbd8a5..b00b9f8 100644 --- a/dlls/mshtml/htmlstyle.c +++ b/dlls/mshtml/htmlstyle.c @@ -799,7 +799,7 @@ static HRESULT var_to_styleval(CSSStyle *style, VARIANT *v, const style_tbl_entr unsigned flags = entry && dispex_compat_mode(&style->dispex) < COMPAT_MODE_IE9 ? entry->flags : 0;
- hres = variant_to_nsstr(v, !!(flags & ATTR_HEX_INT), nsstr); + hres = variant_to_nsstr(v, (flags & ATTR_HEX_INT) ? VARIANT_TO_NSSTR_HEX_INT : 0, nsstr); if(SUCCEEDED(hres) && (flags & ATTR_FIX_PX)) fix_px_value(nsstr); return hres; diff --git a/dlls/mshtml/htmltable.c b/dlls/mshtml/htmltable.c index 53c9820..d771d83 100644 --- a/dlls/mshtml/htmltable.c +++ b/dlls/mshtml/htmltable.c @@ -337,7 +337,7 @@ static HRESULT WINAPI HTMLTableCell_put_width(IHTMLTableCell *iface, VARIANT v)
TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
- hres = variant_to_nsstr(&v, FALSE, &nsstr); + hres = variant_to_nsstr(&v, 0, &nsstr); if(FAILED(hres)) return hres;
@@ -368,7 +368,7 @@ static HRESULT WINAPI HTMLTableCell_put_height(IHTMLTableCell *iface, VARIANT v)
TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
- hres = variant_to_nsstr(&v, FALSE, &nsstr); + hres = variant_to_nsstr(&v, 0, &nsstr); if(FAILED(hres)) return hres;
diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h index 5cf53bb..66cd10a 100644 --- a/dlls/mshtml/mshtml_private.h +++ b/dlls/mshtml/mshtml_private.h @@ -1012,9 +1012,11 @@ void nsAString_Finish(nsAString*) DECLSPEC_HIDDEN; HRESULT map_nsresult(nsresult) DECLSPEC_HIDDEN; HRESULT return_nsstr(nsresult,nsAString*,BSTR*) DECLSPEC_HIDDEN; HRESULT return_nsstr_variant(nsresult,nsAString*,unsigned,VARIANT*) DECLSPEC_HIDDEN; -HRESULT variant_to_nsstr(VARIANT*,BOOL,nsAString*) DECLSPEC_HIDDEN; +HRESULT variant_to_nsstr(VARIANT*,DWORD,nsAString*) DECLSPEC_HIDDEN; HRESULT return_nsform(nsresult,nsIDOMHTMLFormElement*,IHTMLFormElement**) DECLSPEC_HIDDEN;
+#define VARIANT_TO_NSSTR_HEX_INT 0x01 + nsICommandParams *create_nscommand_params(void) DECLSPEC_HIDDEN; HRESULT nsnode_to_nsstring(nsIDOMNode*,nsAString*) DECLSPEC_HIDDEN; void setup_editor_controller(GeckoBrowser*) DECLSPEC_HIDDEN; diff --git a/dlls/mshtml/nsembed.c b/dlls/mshtml/nsembed.c index 40e7b4a..18056e7 100644 --- a/dlls/mshtml/nsembed.c +++ b/dlls/mshtml/nsembed.c @@ -991,7 +991,7 @@ HRESULT return_nsstr_variant(nsresult nsres, nsAString *nsstr, unsigned flags, V * allocations, the function uses an existing string if available, so caller must * ensure that passed VARIANT is unchanged as long as its string representation is used */ -HRESULT variant_to_nsstr(VARIANT *v, BOOL hex_int, nsAString *nsstr) +HRESULT variant_to_nsstr(VARIANT *v, DWORD flags, nsAString *nsstr) { WCHAR buf[32]; HRESULT hres; @@ -1011,7 +1011,7 @@ HRESULT variant_to_nsstr(VARIANT *v, BOOL hex_int, nsAString *nsstr) break;
case VT_I4: - wsprintfW(buf, hex_int ? L"#%06x" : L"%d", V_I4(v)); + wsprintfW(buf, (flags & VARIANT_TO_NSSTR_HEX_INT) ? L"#%06x" : L"%d", V_I4(v)); nsAString_Init(nsstr, buf); break;
@@ -1048,7 +1048,7 @@ HRESULT variant_to_nsstr(VARIANT *v, BOOL hex_int, nsAString *nsstr) nsAString_Init(nsstr, *V_BSTRREF(&var)); break; } - hres = variant_to_nsstr(&var, hex_int, nsstr); + hres = variant_to_nsstr(&var, flags, nsstr); VariantClear(&var); return hres; }