| 258 | propagateInheritedColorPalette(viewTransactionScope, colorPalette); |
| 259 | } |
| 260 | |
| 261 | const Ref<ColorPalette>& ViewNode::getResolvedColorPalette() const { |
| 262 | return _colorPalette; |
| 263 | } |
| 264 | |
| 265 | const Ref<View>& ViewNode::getView() const { |
| 266 | return _view; |
| 267 | } |
| 268 | |
| 269 | Ref<View> ViewNode::getViewAndDisablePooling() const { |
| 270 | if (_view != nullptr) { |
| 271 | _view->setCanBeReused(false); |
| 272 | } |
| 273 | |
| 274 | return _view; |
| 275 | } |
| 276 | |
| 277 | Value ViewNode::toPlaformRepresentation(bool wrapInPlatformReference) { |
| 278 | return _viewNodeTree->getViewManagerContext()->getViewManager().createViewNodeWrapper(strongSmallRef(this), |
| 279 | wrapInPlatformReference); |
| 280 | } |
| 281 | |
| 282 | void ViewNode::setStoredObject(const StringBox& key, const Value& value) { |
| 283 | if (value.isNullOrUndefined()) { |
| 284 | if (_storedObjects != nullptr) { |
| 285 | _storedObjects->erase(key); |
| 286 | } |
| 287 | return; |
| 288 | } |
| 289 | |
| 290 | if (_storedObjects == nullptr) { |
| 291 | _storedObjects = makeShared<ValueMap>(); |
| 292 | } |
| 293 | (*_storedObjects)[key] = value; |
| 294 | } |
| 295 | |
| 296 | Value ViewNode::getStoredObject(const StringBox& key) const { |
| 297 | if (_storedObjects == nullptr) { |
| 298 | return Value::undefined(); |
| 299 | } |
| 300 | |
| 301 | auto it = _storedObjects->find(key); |
| 302 | if (it == _storedObjects->end()) { |
| 303 | return Value::undefined(); |
| 304 | } |
| 305 | |
| 306 | return it->second; |
| 307 | } |
no test coverage detected