1. Patrick Mézard
  2. libphonenumber-csharp

Commits

phil...@gmail.com@ee073f10-1060-11df-b6a4-87a95322a99c  committed 84729f3

CPP: libphonenumber 4.3

Review URL: http://codereview.appspot.com/5445043

  • Participants
  • Parent commits 5ba90a5
  • Branches default

Comments (0)

Files changed (12)

File cpp/CMakeLists.txt

View file
 
 project (libphonenumber)
 set (libphonenumber_VERSION_MAJOR 4)
-set (libphonenumber_VERSION_MINOR 2)
+set (libphonenumber_VERSION_MINOR 3)
 
 # Helper functions dealing with finding libraries and programs this library
 # depends on.

File cpp/src/phonenumbers/asyoutypeformatter.cc

View file
           InputAccruedNationalNumber(phone_number);
           return;
         }
-        phone_number->assign(able_to_format_
-            ? prefix_before_national_number_ + temp_national_number
-            : temp_national_number);
+        if (able_to_format_) {
+          phone_number->assign(
+              prefix_before_national_number_ + temp_national_number);
+        } else {
+          phone_number->clear();
+          accrued_input_.toUTF8String(*phone_number);
+        }
+        return;
       } else {
         AttemptToChooseFormattingPattern(phone_number);
       }
         national_number_.substr(0, kMinLeadingDigitsLength);
 
     GetAvailableFormats(leading_digits);
-    MaybeCreateNewTemplate();
-    InputAccruedNationalNumber(formatted_number);
+    if (MaybeCreateNewTemplate()) {
+      InputAccruedNationalNumber(formatted_number);
+    } else {
+      formatted_number->clear();
+      accrued_input_.toUTF8String(*formatted_number);
+    }
+    return;
   } else {
     formatted_number->assign(prefix_before_national_number_ + national_number_);
   }
       temp_national_number.clear();
       InputDigitHelper(national_number_[i], &temp_national_number);
     }
-    number->assign(able_to_format_
-        ? prefix_before_national_number_ + temp_national_number
-        : temp_national_number);
+    if (able_to_format_) {
+      number->assign(prefix_before_national_number_ + temp_national_number);
+    } else {
+      number->clear();
+      accrued_input_.toUTF8String(*number);
+    }
+    return;
   } else {
     number->assign(prefix_before_national_number_);
   }