Browse Source

JAVA/JS/CPP: Small comment change in the as-you-type-formatter.

pull/567/head
g1smd 13 years ago
committed by Mihaela Rosca
parent
commit
cdcd180af0
3 changed files with 6 additions and 6 deletions
  1. +2
    -2
      cpp/src/phonenumbers/asyoutypeformatter.cc
  2. +2
    -2
      java/libphonenumber/src/com/google/i18n/phonenumbers/AsYouTypeFormatter.java
  3. +2
    -2
      javascript/i18n/phonenumbers/asyoutypeformatter.js

+ 2
- 2
cpp/src/phonenumbers/asyoutypeformatter.cc View File

@ -469,8 +469,8 @@ bool AsYouTypeFormatter::AbleToExtractLongerNdd() {
// extract a new NDD.
national_number_.insert(0, national_prefix_extracted_);
// Remove the previously extracted NDD from prefixBeforeNationalNumber. We
// cannot simply set it to empty string because people sometimes enter
// national prefix after country code, e.g +44 (0)20-1234-5678.
// cannot simply set it to empty string because people sometimes incorrectly
// enter national prefix after the country code, e.g. +44 (0)20-1234-5678.
int index_of_previous_ndd =
prefix_before_national_number_.find_last_of(national_prefix_extracted_);
prefix_before_national_number_.resize(index_of_previous_ndd);


+ 2
- 2
java/libphonenumber/src/com/google/i18n/phonenumbers/AsYouTypeFormatter.java View File

@ -397,8 +397,8 @@ public class AsYouTypeFormatter {
// Put the extracted NDD back to the national number before attempting to extract a new NDD.
nationalNumber.insert(0, nationalPrefixExtracted);
// Remove the previously extracted NDD from prefixBeforeNationalNumber. We cannot simply set
// it to empty string because people sometimes enter national prefix after country code, e.g
// +44 (0)20-1234-5678.
// it to empty string because people sometimes incorrectly enter national prefix after the
// country code, e.g. +44 (0)20-1234-5678.
int indexOfPreviousNdd = prefixBeforeNationalNumber.lastIndexOf(nationalPrefixExtracted);
prefixBeforeNationalNumber.setLength(indexOfPreviousNdd);
}


+ 2
- 2
javascript/i18n/phonenumbers/asyoutypeformatter.js View File

@ -687,8 +687,8 @@ i18n.phonenumbers.AsYouTypeFormatter.prototype.ableToExtractLongerNdd_ =
this.nationalNumber_.append(this.nationalPrefixExtracted_);
this.nationalNumber_.append(nationalNumberStr);
// Remove the previously extracted NDD from prefixBeforeNationalNumber. We
// cannot simply set it to empty string because people sometimes enter
// national prefix after country code, e.g +44 (0)20-1234-5678.
// cannot simply set it to empty string because people sometimes incorrectly
// enter national prefix after the country code, e.g. +44 (0)20-1234-5678.
/** @type {string} */
var prefixBeforeNationalNumberStr =
this.prefixBeforeNationalNumber_.toString();


Loading…
Cancel
Save