]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
Fix bug: function toUtf8() returns pointer to the temporarily allocated data
authorvsr <vsr@opencascade.com>
Mon, 2 Mar 2015 08:34:36 +0000 (11:34 +0300)
committervsr <vsr@opencascade.com>
Mon, 2 Mar 2015 08:34:36 +0000 (11:34 +0300)
src/VTKViewer/VTKViewer_FramedTextActor.cxx

index a902d92a608fb7362748520bf860ea374f0994f5..21fde365c34c57930c23c4037c9ab856d0dff4ad 100644 (file)
@@ -52,7 +52,7 @@ namespace
     return QString( txt );
 #endif
   }
-  const char* toUtf8( const QString& txt )
+  std::string toUtf8( const QString& txt )
   {
 #ifdef PAL22528_UNICODE
     return txt.toUtf8().constData();
@@ -300,7 +300,7 @@ void VTKViewer_FramedTextActor::SetText(const char* theText)
   while(anIter.hasNext())
     aTrimmedStringList.append(anIter.next().trimmed());
 
-  myTextActor->SetInput(toUtf8(aTrimmedStringList.join("\n")));
+  myTextActor->SetInput(toUtf8(aTrimmedStringList.join("\n")).c_str());
   Modified();
 }