Commit 6a62cb6a authored by Jacob Holzinger's avatar Jacob Holzinger
Browse files

Bug 696242 - Convert NS_RegisterStaticAtoms and...

Bug 696242 - Convert NS_RegisterStaticAtoms and nsCSSScanner::ReportUnexpectedParams to take an array-reference rather than a pointer and length, making it impossible to pass a pointer/length that are inconsistent.  r=jwalden

--HG--
extra : rebase_source : 882b5b4d500b1fa242c0a3cfa3084e4171cbaa9d
parent a383a5f8
Loading
Loading
Loading
Loading
+12 −1
Original line number Diff line number Diff line
@@ -848,12 +848,23 @@ public:
   * Fill (with the parameters given) the localized string named |aKey| in
   * properties file |aFile|.
   */
private:
  static nsresult FormatLocalizedString(PropertiesFile aFile,
                                        const char* aKey,
                                        const PRUnichar** aParams,
                                        PRUint32 aParamsLength,
                                        nsXPIDLString& aResult);
  
public:
  template<PRUint32 N>
  static nsresult FormatLocalizedString(PropertiesFile aFile,
                                        const char* aKey,
                                        const PRUnichar* (&aParams)[N],
                                        nsXPIDLString& aResult)
  {
    return FormatLocalizedString(aFile, aKey, aParams, N, aResult);
  }

  /**
   * Returns true if aDocument is a chrome document
   */
+1 −1
Original line number Diff line number Diff line
@@ -65,6 +65,6 @@ static const nsStaticAtom GkAtoms_info[] = {

void nsGkAtoms::AddRefAtoms()
{
  NS_RegisterStaticAtoms(GkAtoms_info, ArrayLength(GkAtoms_info));
  NS_RegisterStaticAtoms(GkAtoms_info);
}
+0 −1
Original line number Diff line number Diff line
@@ -269,7 +269,6 @@ HandleMailtoSubject(nsCString& aPath) {
                                           nsContentUtils::eFORMS_PROPERTIES,
                                           "DefaultFormSubject",
                                           formatStrings,
                                           ArrayLength(formatStrings),
                                           subjectStr);
    if (NS_FAILED(rv))
      return;
+2 −2
Original line number Diff line number Diff line
@@ -3830,7 +3830,7 @@ nsHTMLInputElement::GetValidationMessage(nsAString& aValidationMessage,
      const PRUnichar* params[] = { strMaxLength.get(), strTextLength.get() };
      rv = nsContentUtils::FormatLocalizedString(nsContentUtils::eDOM_PROPERTIES,
                                                 "FormValidationTextTooLong",
                                                 params, 2, message);
                                                 params, message);
      aValidationMessage = message;
      break;
    }
@@ -3889,7 +3889,7 @@ nsHTMLInputElement::GetValidationMessage(nsAString& aValidationMessage,
        const PRUnichar* params[] = { title.get() };
        rv = nsContentUtils::FormatLocalizedString(nsContentUtils::eDOM_PROPERTIES,
                                                   "FormValidationPatternMismatchWithTitle",
                                                   params, 1, message);
                                                   params, message);
      }
      aValidationMessage = message;
      break;
+1 −1
Original line number Diff line number Diff line
@@ -1423,7 +1423,7 @@ nsHTMLTextAreaElement::GetValidationMessage(nsAString& aValidationMessage,
        const PRUnichar* params[] = { strMaxLength.get(), strTextLength.get() };
        rv = nsContentUtils::FormatLocalizedString(nsContentUtils::eDOM_PROPERTIES,
                                                   "FormValidationTextTooLong",
                                                   params, 2, message);
                                                   params, message);
        aValidationMessage = message;
      }
      break;
Loading