char* cp = ToNewCString(aSpec); if (cp) { mCoords = lo_parse_coord_list(cp, &mNumCoords); nsCRT::free(cp);
Area::ParseCoords(aSpec);  PRBool saneRect = PR_TRUE; PRInt32 flag = nsIScriptError::warningFlag; if (mNumCoords >= 4) { if (mCoords[0] > mCoords[2]) {  nscoord x = mCoords[2]; mCoords[2] = mCoords[0]; mCoords[0] = x; saneRect = PR_FALSE; }  if (mCoords[1] > mCoords[3]) {  nscoord y = mCoords[3]; mCoords[3] = mCoords[1]; mCoords[1] = y; saneRect = PR_FALSE; }  if (mNumCoords > 4) {  saneRect = PR_FALSE; } } else { saneRect = PR_FALSE; flag = nsIScriptError::errorFlag; }  if (!saneRect) {  nsresult rv; nsCOMPtr<nsIConsoleService> consoleService = do_GetService(NS_CONSOLESERVICE_CONTRACTID, &rv); if (NS_FAILED(rv)) return; nsCOMPtr<nsIScriptError> errorObject = do_CreateInstance(NS_SCRIPTERROR_CONTRACTID, &rv); if (NS_FAILED(rv)) return; nsCOMPtr<nsIStringBundleService> stringBundleService = do_GetService(kCStringBundleServiceCID, &rv); if (NS_FAILED(rv)) return; nsCOMPtr<nsIStringBundle> bundle; rv = stringBundleService->CreateBundle( "chrome: getter_AddRefs(bundle)); if (NS_FAILED(rv)) return; nsXPIDLString errorText; rv = bundle->FormatStringFromName(NS_LITERAL_STRING("ImageMapRectBoundsError").get(), nsnull, 0, getter_Copies(errorText)); if (NS_FAILED(rv)) return;   nsINodeInfo *nodeInfo = mArea->GetNodeInfo(); NS_ASSERTION(nodeInfo, "Element with no nodeinfo");  nsIDocument* doc = nodeInfo->GetDocument(); nsCAutoString urlSpec; if (doc) { nsIURI *uri = doc->GetDocumentURL(); if (uri) { uri->GetSpec(urlSpec); } } rv = errorObject->Init(errorText.get(), NS_ConvertUTF8toUCS2(urlSpec).get(), /* file name */ PromiseFlatString(aSpec).get(), /* source line */ 0, /* line number */ 0, /* column number */ flag, "ImageMap"); if (NS_FAILED(rv)) return;  consoleService->LogMessage(errorObject);
void Area::ParseCoords(const nsAString& aSpec){  char* cp = ToNewCString(aSpec);  if (cp) {    mCoords = lo_parse_coord_list(cp, &mNumCoords);    nsCRT::free(cp);  }}