Salome HOME
IPAL52726: Hypotheses are missing from Object Browser after re-assignement
[modules/smesh.git] / src / SMESHGUI / SMESHGUI_Utils.cxx
index 8fd7d6db9eef3934db572f1ac590831b090d472b..e49c5e6914cb3f1f017980de51124cb0af3ae75f 100644 (file)
@@ -189,7 +189,7 @@ namespace SMESH
   }
 
   CORBA::Object_var SObjectToObject (_PTR(SObject) theSObject,
-                                     _PTR(Study)   theStudy)
+                                     _PTR(Study)   /*theStudy*/)
   {
     SalomeApp_Application* app = dynamic_cast<SalomeApp_Application*>
       (SUIT_Session::session()->activeApplication());
@@ -197,11 +197,11 @@ namespace SMESH
       _PTR(GenericAttribute) anAttr;
       if (theSObject->FindAttribute(anAttr, "AttributeIOR")) {
         _PTR(AttributeIOR) anIOR = anAttr;
-        CORBA::String_var aVal = anIOR->Value().c_str();
+        std::string aVal = anIOR->Value();
         // string_to_object() DOC: If the input string is not valid ...
         // a CORBA::SystemException is thrown.
-        if ( aVal && strlen( aVal ) > 0 )
-          return app->orb()->string_to_object(aVal);
+        if ( aVal.size() > 0 )
+          return app->orb()->string_to_object( aVal.c_str() );
       }
     }
     return CORBA::Object::_nil();
@@ -209,7 +209,7 @@ namespace SMESH
 
   CORBA::Object_var SObjectToObject (_PTR(SObject) theSObject)
   {
-    _PTR(Study) aStudy = GetActiveStudyDocument();
+    _PTR(Study) aStudy;// = GetActiveStudyDocument(); -- aStudy is not used
     return SObjectToObject(theSObject,aStudy);
   }
 
@@ -391,12 +391,12 @@ namespace SMESH
     return fromUtf8( txt.c_str() );
   }
 
-  const char* toUtf8( const QString& txt )
+  toUtf8::toUtf8( const QString& txt )
   {
 #ifdef PAL22528_UNICODE
-    return txt.toUtf8().constData();
+    assign( txt.toUtf8().constData() );
 #else
-    return txt.toLatin1().constData();
+    assign( txt.toLatin1().constData() );
 #endif
   }