summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlararennie@google.com <lararennie@google.com@ee073f10-1060-11df-b6a4-87a95322a99c>2012-09-12 08:09:05 +0000
committerlararennie@google.com <lararennie@google.com@ee073f10-1060-11df-b6a4-87a95322a99c>2012-09-12 08:09:05 +0000
commit878d608009b1ce245d76ab227e89e4d3783d8af1 (patch)
tree418cb00e6f968f47031e907550769da97cde65c5
parent35bd393fb78215a9c6dbeb158913def01eb58985 (diff)
downloadphonenumbers-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.cc5
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())) {