if(flags & ATTR_FIX_URL)
val = fix_url_value(value);
- nsAString_Init(&str_name, style_tbl[sid].name);
- nsAString_Init(&str_value, val ? val : value);
- nsAString_Init(&str_empty, wszEmpty);
+ nsAString_InitDepend(&str_name, style_tbl[sid].name);
+ nsAString_InitDepend(&str_value, val ? val : value);
+ nsAString_InitDepend(&str_empty, wszEmpty);
heap_free(val);
nsres = nsIDOMCSSStyleDeclaration_SetProperty(nsstyle, &str_name, &str_value, &str_empty);
nsAString str_name;
nsresult nsres;
- nsAString_Init(&str_name, style_tbl[sid].name);
+ nsAString_InitDepend(&str_name, style_tbl[sid].name);
nsres = nsIDOMCSSStyleDeclaration_GetPropertyValue(nsstyle, &str_name, value);
if(NS_FAILED(nsres)) {
TRACE("(%p)->(%s)\n", This, debugstr_w(v));
- nsAString_Init(&text_str, v);
+ nsAString_InitDepend(&text_str, v);
nsres = nsIDOMCSSStyleDeclaration_SetCssText(This->nsstyle, &text_str);
nsAString_Finish(&text_str);
if(NS_FAILED(nsres)) {
PRUint32 nsACString_GetData(const nsACString*,const char**);
BOOL nsAString_Init(nsAString*,const PRUnichar*);
+void nsAString_InitDepend(nsAString*,const PRUnichar*);
void nsAString_SetData(nsAString*,const PRUnichar*);
PRUint32 nsAString_GetData(const nsAString*,const PRUnichar**);
void nsAString_Finish(nsAString*);
PRUint32 d3;
};
+#define NS_STRING_CONTAINER_INIT_DEPEND 0x0002
+
static nsresult (*NS_InitXPCOM2)(nsIServiceManager**,void*,void*);
static nsresult (*NS_ShutdownXPCOM)(nsIServiceManager*);
static nsresult (*NS_GetComponentRegistrar)(nsIComponentRegistrar**);
return NS_SUCCEEDED(NS_StringContainerInit2(str, data, PR_UINT32_MAX, 0));
}
+/*
+ * Initializes nsAString with data owned by caller.
+ * Caller must ensure that data is valid during lifetime of string object.
+ */
+void nsAString_InitDepend(nsAString *str, const PRUnichar *data)
+{
+ NS_StringContainerInit2(str, data, PR_UINT32_MAX, NS_STRING_CONTAINER_INIT_DEPEND);
+}
+
void nsAString_SetData(nsAString *str, const PRUnichar *data)
{
NS_StringSetData(str, data, PR_UINT32_MAX);