| 139 | } |
| 140 | |
| 141 | void BackwardCompatibilityManager::serialiseProperty( |
| 142 | MyGUI::xml::Element* _node, |
| 143 | std::string_view _widgetType, |
| 144 | const MyGUI::PairString& _property, |
| 145 | bool _compatibility) |
| 146 | { |
| 147 | std::string_view propertyName = _property.first; |
| 148 | |
| 149 | if (_compatibility && getDefaultVersion() != getCurrentVersion()) |
| 150 | { |
| 151 | std::string key = MyGUI::utility::toString(getCurrentVersion(), "-", propertyName); |
| 152 | |
| 153 | MyGUI::MapString::const_iterator item = mPropertyNames.find(key); |
| 154 | if (item != mPropertyNames.end()) |
| 155 | { |
| 156 | propertyName = (*item).second; |
| 157 | } |
| 158 | else |
| 159 | { |
| 160 | key = MyGUI::utility::toString(getCurrentVersion(), "-", _widgetType, "-", propertyName); |
| 161 | |
| 162 | item = mPropertyNames.find(key); |
| 163 | if (item != mPropertyNames.end()) |
| 164 | { |
| 165 | propertyName = (*item).second; |
| 166 | } |
| 167 | else |
| 168 | { |
| 169 | MYGUI_LOG(Warning, "Property key not found '" << key << "'"); |
| 170 | } |
| 171 | } |
| 172 | } |
| 173 | |
| 174 | MyGUI::xml::ElementPtr nodeProp = _node->createChild("Property"); |
| 175 | nodeProp->addAttribute("key", propertyName); |
| 176 | nodeProp->addAttribute("value", _property.second); |
| 177 | } |
| 178 | |
| 179 | const MyGUI::VectorString& BackwardCompatibilityManager::getVersions() const |
| 180 | { |
no test coverage detected