From f7a529d444080390681367bab1bfbfee5df99ca7 Mon Sep 17 00:00:00 2001 From: fgerlits Date: Wed, 30 Aug 2006 16:14:49 +0000 Subject: [PATCH] minor style improvement: replaced (type) casts with dynamic_cast --- .../gLiveSupport/src/GLiveSupport.cxx | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/livesupport/src/products/gLiveSupport/src/GLiveSupport.cxx b/livesupport/src/products/gLiveSupport/src/GLiveSupport.cxx index e1a7017b0..6ec6f2717 100644 --- a/livesupport/src/products/gLiveSupport/src/GLiveSupport.cxx +++ b/livesupport/src/products/gLiveSupport/src/GLiveSupport.cxx @@ -211,7 +211,8 @@ GLiveSupport :: configure(const xmlpp::Element & element) if (nodes.size() < 1) { throw std::invalid_argument("no supportedLanguages element"); } - configSupportedLanguages(*((const xmlpp::Element*) nodes.front())); + configSupportedLanguages( + *dynamic_cast(nodes.front())); // configure the resource bundle nodes = element.get_children(LocalizedObject::getConfigElementName()); @@ -219,7 +220,7 @@ GLiveSupport :: configure(const xmlpp::Element & element) throw std::invalid_argument("no resourceBundle element"); } LocalizedConfigurable::configure( - *((const xmlpp::Element*) nodes.front())); + *dynamic_cast(nodes.front()) ); // configure the AuthenticationClientFactory nodes = element.get_children( @@ -229,7 +230,7 @@ GLiveSupport :: configure(const xmlpp::Element & element) } Ptr::Ref acf = AuthenticationClientFactory::getInstance(); - acf->configure( *((const xmlpp::Element*) nodes.front()) ); + acf->configure(*dynamic_cast(nodes.front())); authentication = acf->getAuthenticationClient(); @@ -239,7 +240,7 @@ GLiveSupport :: configure(const xmlpp::Element & element) throw std::invalid_argument("no storageClientFactory element"); } Ptr::Ref stcf = StorageClientFactory::getInstance(); - stcf->configure( *((const xmlpp::Element*) nodes.front()) ); + stcf->configure(*dynamic_cast(nodes.front())); storage = stcf->getStorageClient(); @@ -249,7 +250,8 @@ GLiveSupport :: configure(const xmlpp::Element & element) throw std::invalid_argument("no widgetFactory element"); } widgetFactory = WidgetFactory::getInstance(); - widgetFactory->configure( *((const xmlpp::Element*) nodes.front()) ); + widgetFactory->configure( + *dynamic_cast(nodes.front()) ); // configure the SchedulerClientFactory nodes = element.get_children( @@ -259,7 +261,7 @@ GLiveSupport :: configure(const xmlpp::Element & element) } Ptr::Ref schcf = SchedulerClientFactory::getInstance(); - schcf->configure( *((const xmlpp::Element*) nodes.front()) ); + schcf->configure(*dynamic_cast(nodes.front())); scheduler = schcf->getSchedulerClient(); @@ -302,7 +304,7 @@ GLiveSupport :: configure(const xmlpp::Element & element) throw std::invalid_argument("no audioPlayer element"); } apf = AudioPlayerFactory::getInstance(); - apf->configure( *((const xmlpp::Element*) nodes.front()) ); + apf->configure(*dynamic_cast(nodes.front())); outputPlayer = apf->getAudioPlayer(); outputPlayer->initialize(); @@ -319,7 +321,7 @@ GLiveSupport :: configure(const xmlpp::Element & element) throw std::invalid_argument("no audioPlayer element"); } apf = AudioPlayerFactory::getInstance(); - apf->configure( *((const xmlpp::Element*) nodes.front()) ); + apf->configure(*dynamic_cast(nodes.front())); cuePlayer = apf->getAudioPlayer(); cuePlayer->initialize(); @@ -357,7 +359,7 @@ GLiveSupport :: configure(const xmlpp::Element & element) Ptr::Ref metadataBundle = getBundle("metadataTypes"); metadataTypeContainer.reset(new MetadataTypeContainer(metadataBundle)); metadataTypeContainer->configure( - *((const xmlpp::Element*) nodes.front()) ); + *dynamic_cast(nodes.front()) ); // configure the KeyboardShortcutList nodes = element.get_children( @@ -367,7 +369,7 @@ GLiveSupport :: configure(const xmlpp::Element & element) } keyboardShortcutList.reset(new KeyboardShortcutList); keyboardShortcutList->configure( - *((const xmlpp::Element*) nodes.front()) ); + *dynamic_cast(nodes.front()) ); // save the configuration so we can modify it later // TODO: move configuration code to the OptionsContainer class?