diff --git a/src/data/action/set.cpp b/src/data/action/set.cpp index 57592d62..8f445e87 100644 --- a/src/data/action/set.cpp +++ b/src/data/action/set.cpp @@ -66,7 +66,7 @@ void AddCardAction::perform(bool to_undo) { FOR_EACH(linked_pair, linked_pairs) { String& linked_uid = linked_pair.first.get(); String& linked_relation = linked_pair.second.get(); - if (linked_uid == wxEmptyString) continue; + if (linked_uid.empty()) continue; // If it's an added card, replace the link if (all_added_uids.find(linked_uid) != all_added_uids.end()) { all_added_uids.at(linked_uid)->updateLink(old_uid, new_uid); diff --git a/src/data/card.cpp b/src/data/card.cpp index d6ef0b80..03763e9f 100644 --- a/src/data/card.cpp +++ b/src/data/card.cpp @@ -53,7 +53,7 @@ String Card::identification() const { if (!data.empty()) { return data.at(0)->toString(); } else { - return wxEmptyString; + return _(""); } } @@ -78,7 +78,7 @@ void Card::link(const Set& set, const vector& linked_cards, const String& FOR_EACH(this_linked_pair, this_linked_pairs) { String& this_linked_uid = this_linked_pair.first.get(); if ( - this_linked_uid == wxEmptyString || // Not a reference + this_linked_uid.empty() || // Not a reference all_existing_uids.find(this_linked_uid) == all_existing_uids.end() // Reference to nonexistent card ) free_link_count++; } @@ -94,7 +94,7 @@ void Card::link(const Set& set, const vector& linked_cards, const String& FOR_EACH(this_linked_pair, this_linked_pairs) { String& this_linked_uid = this_linked_pair.first.get(); String& this_linked_relation = this_linked_pair.second.get(); - if (this_linked_uid == wxEmptyString) { + if (this_linked_uid.empty()) { this_linked_uid = linked_card->uid; this_linked_relation = linked_relation; written = true; @@ -124,7 +124,7 @@ void Card::link(const Set& set, const vector& linked_cards, const String& FOR_EACH(linked_pair, linked_pairs) { String& linked_uid = linked_pair.first.get(); String& linked_relation = linked_pair.second.get(); - if (linked_uid == wxEmptyString) { + if (linked_uid.empty()) { linked_uid = uid; linked_relation = selected_relation; written = true; @@ -177,26 +177,26 @@ void Card::unlink(const vector& unlinked_cards) pair Card::unlink(CardP& unlinked_card) { - String old_selected_relation = wxEmptyString; + String old_selected_relation = _(""); THIS_LINKED_PAIRS(this_linked_pairs); FOR_EACH(this_linked_pair, this_linked_pairs) { String& this_linked_uid = this_linked_pair.first.get(); String& this_linked_relation = this_linked_pair.second.get(); if (this_linked_uid == unlinked_card->uid) { old_selected_relation = this_linked_relation; - this_linked_uid = wxEmptyString; - this_linked_relation = wxEmptyString; + this_linked_uid = _(""); + this_linked_relation = _(""); } } - String old_unlinked_relation = wxEmptyString; + String old_unlinked_relation = _(""); OTHER_LINKED_PAIRS(unlinked_pairs, unlinked_card); FOR_EACH(unlinked_pair, unlinked_pairs) { String& unlinked_uid = unlinked_pair.first.get(); String& unlinked_relation = unlinked_pair.second.get(); if (unlinked_uid == uid) { old_unlinked_relation = unlinked_relation; - unlinked_uid = wxEmptyString; - unlinked_relation = wxEmptyString; + unlinked_uid = _(""); + unlinked_relation = _(""); } } return make_pair(old_selected_relation, old_unlinked_relation); @@ -204,7 +204,7 @@ pair Card::unlink(CardP& unlinked_card) void Card::copyLink(const Set& set, String old_uid, String new_uid) { // Find what relation we need to copy - String relation_copy = wxEmptyString; + String relation_copy = _(""); THIS_LINKED_PAIRS(this_linked_pairs); FOR_EACH(this_linked_pair, this_linked_pairs) { String& this_linked_uid = this_linked_pair.first.get(); @@ -215,7 +215,7 @@ void Card::copyLink(const Set& set, String old_uid, String new_uid) { } } // Nothing to copy - if (relation_copy == wxEmptyString) { + if (relation_copy.empty()) { return; } @@ -224,7 +224,7 @@ void Card::copyLink(const Set& set, String old_uid, String new_uid) { FOR_EACH(this_linked_pair, this_linked_pairs) { String& this_linked_uid = this_linked_pair.first.get(); String& this_linked_relation = this_linked_pair.second.get(); - if (this_linked_uid == wxEmptyString) { + if (this_linked_uid.empty()) { this_linked_uid = new_uid; this_linked_relation = relation_copy; written = true; diff --git a/src/data/field.cpp b/src/data/field.cpp index 0e58d043..c4805977 100644 --- a/src/data/field.cpp +++ b/src/data/field.cpp @@ -113,14 +113,9 @@ Style::Style(const FieldP& field) , visible(true) , automatic_side(AUTO_UNKNOWN) , content_dependent(false) -{ - field->styleP = this; -} +{} -Style::~Style() -{ - fieldP->styleP = nullptr; -} +Style::~Style() {} IMPLEMENT_REFLECTION(Style) { REFLECT(z_index); @@ -138,7 +133,6 @@ IMPLEMENT_REFLECTION(Style) { void init_object(const FieldP& field, StyleP& style) { if (!style) style = field->newStyle(); - field->styleP = style; } template <> StyleP read_new