Salome HOME
Use tempfile.mkdtemp to create temporary directory
[modules/yacs.git] / src / genericgui / SceneBlocItem.cxx
index b455f2c0eba7c7217270d863a5e3f8c3475c165d..14b9f482e19154baf198a94869ce8eb88e5874c3 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2006-2019  CEA/DEN, EDF R&D
+// Copyright (C) 2006-2022  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
@@ -33,6 +33,8 @@
 
 #include <gvc.h>
 
+#include <Qtx.h> // for Localizer
+
 #include "Resource.hxx"
 
 //#define _DEVDEBUG_
@@ -70,7 +72,6 @@ void SceneBlocItem::arrangeChildNodes()
   clock_t start_t, end_t;
   start_t = clock();
 #endif //_DEVDEBUG_
-  GVC_t* aGvc = 0;
 
 
   SubjectComposedNode *scnode = dynamic_cast<SubjectComposedNode*>(getSubject());
@@ -80,14 +81,11 @@ void SceneBlocItem::arrangeChildNodes()
 
   // ---- Create a graphviz context
 
-  if(!aGvc)
-    {
-      DEBTRACE(setlocale(LC_ALL,NULL));
-      //Graphviz is sensitive to locale : set the mimimal one ("C")for numeric
-      setlocale(LC_NUMERIC, "C");
-      //aginit();
-      aGvc = gvContext();
-    }
+  // Graphviz is sensitive to locale : set the mimimal one ("C")for numeric
+  Qtx::Localizer loc;
+
+  //aginit();
+  GVC_t* aGvc = gvContext();
 
   // ---- Create a graph
 
@@ -211,7 +209,7 @@ void  SceneBlocItem::getNodesInfo(YACS::ENGINE::ComposedNode *cnode)
 
   // --- Create edges (i.e. links)
 
-  Agnode_t* aNode;
+  Agnode_t* aNode = NULL;
   for (aNode = agfstnode(_graph); aNode; aNode = agnxtnode(_graph, aNode))
   {
     string aNodeName = agnameof(aNode);