summaryrefslogtreecommitdiff
path: root/configmgr/source/childaccess.cxx
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2014-01-24 17:49:17 +0100
committerStephan Bergmann <sbergman@redhat.com>2014-01-24 17:52:46 +0100
commit6935acb053dcc202a7ce72cdd0fc3a30f1161be0 (patch)
tree4a9292118cd7334872f4f778ae6125ecc34034c7 /configmgr/source/childaccess.cxx
parenta0e4c24ecf8c92f3dba91a1b2319ec816ab57016 (diff)
Replace "known-good" dynamic_casts with static_casts
...it avoids false warnings about unchecked dynamic_cast results from static code analyzers, and potentially makes the code a little faster, too. (Most of these dynamic_casts were kind of a leftover from a very early design that dispateched on Node type via dynamic_cast instead of a Node::Kind, but which was much too slow.) Change-Id: I8db08a1c35783f8ea6c51eed55b11faa2d958807
Diffstat (limited to 'configmgr/source/childaccess.cxx')
-rw-r--r--configmgr/source/childaccess.cxx12
1 files changed, 6 insertions, 6 deletions
diff --git a/configmgr/source/childaccess.cxx b/configmgr/source/childaccess.cxx
index 9e80d1bb6f5b..6071df0d5b26 100644
--- a/configmgr/source/childaccess.cxx
+++ b/configmgr/source/childaccess.cxx
@@ -215,7 +215,7 @@ void ChildAccess::setProperty(
switch (node_->kind()) {
case Node::KIND_PROPERTY:
{
- PropertyNode * prop = dynamic_cast< PropertyNode * >(node_.get());
+ PropertyNode * prop = static_cast< PropertyNode * >(node_.get());
type = prop->getStaticType();
nillable = prop->isNillable();
}
@@ -238,7 +238,7 @@ void ChildAccess::setProperty(
case Node::KIND_LOCALIZED_VALUE:
{
LocalizedPropertyNode * locprop =
- dynamic_cast< LocalizedPropertyNode * >(getParentNode().get());
+ static_cast< LocalizedPropertyNode * >(getParentNode().get());
type = locprop->getStaticType();
nillable = locprop->isNillable();
}
@@ -258,7 +258,7 @@ css::uno::Any ChildAccess::asValue() {
}
switch (node_->kind()) {
case Node::KIND_PROPERTY:
- return dynamic_cast< PropertyNode * >(node_.get())->getValue(
+ return static_cast< PropertyNode * >(node_.get())->getValue(
getComponents());
case Node::KIND_LOCALIZED_PROPERTY:
{
@@ -272,7 +272,7 @@ css::uno::Any ChildAccess::asValue() {
}
break;
case Node::KIND_LOCALIZED_VALUE:
- return dynamic_cast< LocalizedValueNode * >(node_.get())->getValue();
+ return static_cast< LocalizedValueNode * >(node_.get())->getValue();
default:
break;
}
@@ -291,11 +291,11 @@ void ChildAccess::commitChanges(bool valid, Modifications * globalModifications)
globalModifications->add(path);
switch (node_->kind()) {
case Node::KIND_PROPERTY:
- dynamic_cast< PropertyNode * >(node_.get())->setValue(
+ static_cast< PropertyNode * >(node_.get())->setValue(
Data::NO_LAYER, *changedValue_);
break;
case Node::KIND_LOCALIZED_VALUE:
- dynamic_cast< LocalizedValueNode * >(node_.get())->setValue(
+ static_cast< LocalizedValueNode * >(node_.get())->setValue(
Data::NO_LAYER, *changedValue_);
break;
default: