From c44d8d59123c95f57fa437c1a3d475a7cf11612c Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Tue, 12 Jun 2012 11:34:48 +0200 Subject: [PATCH] Even more bugfixes. --- base/variant.cpp | 9 +++++++++ components/configrpc/configrpccomponent.cpp | 4 ++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/base/variant.cpp b/base/variant.cpp index 914bfdb14..f1956d416 100644 --- a/base/variant.cpp +++ b/base/variant.cpp @@ -38,6 +38,15 @@ void Variant::Convert(VariantType newType) const return; } + if (m_Type == VariantInteger && newType == VariantString) { + stringstream sbuf; + sbuf << m_IntegerValue; + m_StringValue = sbuf.str(); + m_Type = VariantString; + + return; + } + // TODO: convert variant data throw runtime_error("Invalid variant conversion."); } diff --git a/components/configrpc/configrpccomponent.cpp b/components/configrpc/configrpccomponent.cpp index 01190acaf..6e5b02a7a 100644 --- a/components/configrpc/configrpccomponent.cpp +++ b/components/configrpc/configrpccomponent.cpp @@ -128,7 +128,7 @@ int ConfigRpcComponent::FetchObjectsHandler(const NewRequestEventArgs& ea) int ConfigRpcComponent::LocalObjectCommittedHandler(const ObjectSetEventArgs& ea) { - ConfigObject::Ptr object = static_pointer_cast(ea.Source); + ConfigObject::Ptr object = ea.Target; if (!ShouldReplicateObject(object)) return 0; @@ -141,7 +141,7 @@ int ConfigRpcComponent::LocalObjectCommittedHandler(const ObjectSetEventArgs& ea) { - ConfigObject::Ptr object = static_pointer_cast(ea.Source); + ConfigObject::Ptr object = ea.Target; if (!ShouldReplicateObject(object)) return 0; -- 2.50.1