rem: var oldName = catDS.GetTarget(currentCatRes, titleRes, true); if (oldName)	oldName = oldName.QueryInterface(Components.interfaces.nsIRDFLiteral); if (oldName) { catDS.Change(currentCatRes, titleRes, oldName, newName); } else { catDS.Assert(currentCatRes, titleRes, newName, true); } 
add: var oldName = catDS.GetTarget(currentCatRes, titleRes, true); if (oldName)  oldName = oldName.QueryInterface(Components.interfaces.nsIRDFLiteral); if (oldName) { catDS.Change(currentCatRes, titleRes, oldName, newName); } else { catDS.Assert(currentCatRes, titleRes, newName, true); } 
context: function RenameCategory(){	// make sure we have at least one category	var categoryPopup = document.getElementById( "categoryPopup" );	if (!categoryPopup)	return(false);	if (categoryPopup.childNodes.length < 1)	return(false);	var categoryList = document.getElementById( "categoryList" );	var currentName = categoryList.selectedItem.getAttribute("value");	var promptStr = bundle.GetStringFromName("RenameCategoryPrompt");	var renameTitle = bundle.GetStringFromName("RenameCategoryTitle");	var result = {value:0};	var name = commonDialogsService.Prompt(window,renameTitle,promptStr,currentName,result);	if ((!result.value) || (result.value == "") || result.value == currentName)     return(false);	var currentCatID = categoryList.selectedItem.getAttribute("id");	var currentCatRes = RDF.GetResource(currentCatID);	if (!currentCatRes)	return(false);	var titleRes = RDF.GetResource("http://home.netscape.com/NC-rdf#title");	if (!titleRes)	return(false);	var newName = RDF.GetLiteral(result.value);	if (!newName)	return(false);	var oldName = catDS.GetTarget(currentCatRes, titleRes, true);	if (oldName)	oldName = oldName.QueryInterface(Components.interfaces.nsIRDFLiteral);	if (oldName)	{		catDS.Change(currentCatRes, titleRes, oldName, newName);	}	else	{		catDS.Assert(currentCatRes, titleRes, newName, true);	}	// force popup to update	chooseCategory(categoryList.selectedItem);	return(true);}
meta: 10234	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/10234/0b2dd2b2d2fd037df917e07645fa019a963332a5/search-editor.js/clean/xpfe/components/search/resources/search-editor.js