Page MenuHomePhabricator

propertylistmac.patch

Authored By
fangerau
Sep 17 2010, 7:08 PM
Size
1 KB
Referenced Files
None
Subscribers
None

propertylistmac.patch

Index: mitkPropertyList.cpp
===================================================================
--- mitkPropertyList.cpp (revision 25989)
+++ mitkPropertyList.cpp (working copy)
@@ -273,19 +273,43 @@
bool mitk::PropertyList::GetBoolProperty(const char* propertyKey, bool& boolValue) const
{
- return GetPropertyValue<bool>(propertyKey, boolValue);
+ BoolProperty *gp = dynamic_cast<BoolProperty*>( GetProperty(propertyKey) );
+ if ( gp != NULL )
+ {
+ boolValue = gp->GetValue();
+ return true;
+ }
+ return false;
+ // Templated Method does not work on Macs
+ //return GetPropertyValue<bool>(propertyKey, boolValue);
}
bool mitk::PropertyList::GetIntProperty(const char* propertyKey, int &intValue) const
{
- return GetPropertyValue<int>(propertyKey, intValue);
+ IntProperty *gp = dynamic_cast<IntProperty*>( GetProperty(propertyKey) );
+ if ( gp != NULL )
+ {
+ intValue = gp->GetValue();
+ return true;
+ }
+ return false;
+ // Templated Method does not work on Macs
+ //return GetPropertyValue<int>(propertyKey, intValue);
}
bool mitk::PropertyList::GetFloatProperty(const char* propertyKey, float &floatValue) const
{
- return GetPropertyValue<float>(propertyKey, floatValue);
+ FloatProperty *gp = dynamic_cast<FloatProperty*>( GetProperty(propertyKey) );
+ if ( gp != NULL )
+ {
+ floatValue = gp->GetValue();
+ return true;
+ }
+ return false;
+ // Templated Method does not work on Macs
+ //return GetPropertyValue<float>(propertyKey, floatValue);
}

File Metadata

Mime Type
text/plain
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
497
Default Alt Text
propertylistmac.patch (1 KB)

Event Timeline

patch for making propertylist run on macs