rv = GetIntValue(versionItem, &version); if (NS_FAILED(rv)) return rv;
if (versionItem->data) { rv = GetIntValue(versionItem, &version); if (NS_FAILED(rv)) return rv; } else {   version = 0; }
ProcessVersion(SECItem         *versionItem,               nsINSSComponent *nssComponent,               nsIASN1PrintableItem **retItem){  nsresult rv;  nsString text;  nsCOMPtr<nsIASN1PrintableItem> printableItem = new nsNSSASN1PrintableItem();  if (printableItem == nsnull)    return NS_ERROR_OUT_OF_MEMORY;   nssComponent->GetPIPNSSBundleString(NS_LITERAL_STRING("CertDumpVersion").get(),                                      text);  rv = printableItem->SetDisplayName(text.get());  if (NS_FAILED(rv))    return rv;  // Now to figure out what version this certificate is.  unsigned long version;  rv = GetIntValue(versionItem, &version);  if (NS_FAILED(rv))    return rv;  switch (version){  case 0:    rv = nssComponent->GetPIPNSSBundleString(NS_LITERAL_STRING("CertDumpVersion1").get(),                                             text);    break;  case 1:    rv = nssComponent->GetPIPNSSBundleString(NS_LITERAL_STRING("CertDumpVersion2").get(),                                             text);    break;  case 2:    rv = nssComponent->GetPIPNSSBundleString(NS_LITERAL_STRING("CertDumpVersion3").get(),                                             text);    break;  default:    NS_ASSERTION(0,"Bad value for cert version");    rv = NS_ERROR_FAILURE;  }      if (NS_FAILED(rv))    return rv;  rv = printableItem->SetDisplayValue(text.get());  if (NS_FAILED(rv))    return rv;  *retItem = printableItem;  NS_ADDREF(*retItem);  return NS_OK;}