aboutsummaryrefslogtreecommitdiff
path: root/cpp/src
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src')
-rw-r--r--cpp/src/address_data.cc7
-rw-r--r--cpp/src/address_field.cc1
-rw-r--r--cpp/src/address_field_util.cc1
-rw-r--r--cpp/src/address_ui.cc3
-rw-r--r--cpp/src/validation_task.cc4
5 files changed, 14 insertions, 2 deletions
diff --git a/cpp/src/address_data.cc b/cpp/src/address_data.cc
index 644000e..40d3ee7 100644
--- a/cpp/src/address_data.cc
+++ b/cpp/src/address_data.cc
@@ -41,6 +41,7 @@ std::string AddressData::*kStringField[] = {
&AddressData::sorting_code,
&AddressData::postal_code,
NULL,
+ &AddressData::organization,
&AddressData::recipient
};
@@ -53,6 +54,7 @@ const std::vector<std::string> AddressData::*kVectorStringField[] = {
NULL,
NULL,
&AddressData::address_line,
+ NULL,
NULL
};
@@ -111,7 +113,9 @@ bool AddressData::operator==(const AddressData& other) const {
dependent_locality == other.dependent_locality &&
postal_code == other.postal_code &&
sorting_code == other.sorting_code &&
- language_code == other.language_code && recipient == other.recipient;
+ language_code == other.language_code &&
+ organization == other.organization &&
+ recipient == other.recipient;
}
// static
@@ -142,6 +146,7 @@ std::ostream& operator<<(std::ostream& o,
}
o << "language_code: \"" << address.language_code << "\"\n"
+ "organization: \"" << address.organization << "\"\n"
"recipient: \"" << address.recipient << "\"\n";
return o;
diff --git a/cpp/src/address_field.cc b/cpp/src/address_field.cc
index 7d57e06..c5c96d8 100644
--- a/cpp/src/address_field.cc
+++ b/cpp/src/address_field.cc
@@ -32,6 +32,7 @@ std::ostream& operator<<(std::ostream& o, AddressField field) {
"SORTING_CODE",
"POSTAL_CODE",
"STREET_ADDRESS",
+ "ORGANIZATION",
"RECIPIENT"
};
COMPILE_ASSERT(COUNTRY == 0, bad_base);
diff --git a/cpp/src/address_field_util.cc b/cpp/src/address_field_util.cc
index 1cac289..26de3c0 100644
--- a/cpp/src/address_field_util.cc
+++ b/cpp/src/address_field_util.cc
@@ -40,6 +40,7 @@ std::map<char, AddressField> InitFields() {
fields.insert(std::make_pair('X', SORTING_CODE));
fields.insert(std::make_pair('Z', POSTAL_CODE));
fields.insert(std::make_pair('A', STREET_ADDRESS));
+ fields.insert(std::make_pair('O', ORGANIZATION));
fields.insert(std::make_pair('N', RECIPIENT));
return fields;
}
diff --git a/cpp/src/address_ui.cc b/cpp/src/address_ui.cc
index bf76cfd..33f0797 100644
--- a/cpp/src/address_ui.cc
+++ b/cpp/src/address_ui.cc
@@ -63,6 +63,9 @@ std::string GetLabelForField(const Localization& localization,
case STREET_ADDRESS:
messageId = IDS_LIBADDRESSINPUT_ADDRESS_LINE_1_LABEL;
break;
+ case ORGANIZATION:
+ messageId = IDS_LIBADDRESSINPUT_ORGANIZATION_LABEL;
+ break;
case RECIPIENT:
messageId = IDS_LIBADDRESSINPUT_RECIPIENT_LABEL;
break;
diff --git a/cpp/src/validation_task.cc b/cpp/src/validation_task.cc
index 727de6a..1e7911a 100644
--- a/cpp/src/validation_task.cc
+++ b/cpp/src/validation_task.cc
@@ -110,6 +110,7 @@ void ValidationTask::CheckUnexpectedField(
SORTING_CODE,
POSTAL_CODE,
STREET_ADDRESS,
+ ORGANIZATION,
RECIPIENT
};
@@ -132,7 +133,8 @@ void ValidationTask::CheckMissingRequiredField(
DEPENDENT_LOCALITY,
SORTING_CODE,
POSTAL_CODE,
- STREET_ADDRESS,
+ STREET_ADDRESS
+ // ORGANIZATION is never required.
// RECIPIENT is handled separately.
};