diff options
author | lararennie@google.com <lararennie@google.com@ee073f10-1060-11df-b6a4-87a95322a99c> | 2012-09-12 08:09:05 +0000 |
---|---|---|
committer | lararennie@google.com <lararennie@google.com@ee073f10-1060-11df-b6a4-87a95322a99c> | 2012-09-12 08:09:05 +0000 |
commit | 878d608009b1ce245d76ab227e89e4d3783d8af1 (patch) | |
tree | 418cb00e6f968f47031e907550769da97cde65c5 | |
parent | 35bd393fb78215a9c6dbeb158913def01eb58985 (diff) | |
download | phonenumbers-878d608009b1ce245d76ab227e89e4d3783d8af1.tar.gz |
Java/CPP: libphonenumber v5.1.2 - AYTF fix for numbers in national format in countries with no national prefix.
git-svn-id: http://libphonenumber.googlecode.com/svn/trunk/cpp/src/phonenumbers@524 ee073f10-1060-11df-b6a4-87a95322a99c
-rw-r--r-- | asyoutypeformatter.cc | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/asyoutypeformatter.cc b/asyoutypeformatter.cc index df3489f..1111fde 100644 --- a/asyoutypeformatter.cc +++ b/asyoutypeformatter.cc @@ -198,10 +198,11 @@ void AsYouTypeFormatter::GetAvailableFormats( current_metadata_->intl_number_format().size() > 0) ? current_metadata_->intl_number_format() : current_metadata_->number_format(); - + bool national_prefix_used_by_country = + current_metadata_->has_national_prefix(); for (RepeatedPtrField<NumberFormat>::const_iterator it = format_list.begin(); it != format_list.end(); ++it) { - if (is_complete_number_ || + if (!national_prefix_used_by_country || is_complete_number_ || it->national_prefix_optional_when_formatting() || phone_util_.FormattingRuleHasFirstGroupOnly( it->national_prefix_formatting_rule())) { |