Merge remote-tracking branch 'origin/master' into YaSp 54/16154/1
Vincent COUVERT [Fri, 13 Mar 2015 10:52:47 +0000 (11:52 +0100)]
Conflicts:
scilab/configure
scilab/modules/graphic_objects/Makefile.am
scilab/modules/graphic_objects/Makefile.in
scilab/modules/graphic_objects/src/java/org/scilab/modules/graphic_objects/ObjectData.java
scilab/modules/graphic_objects/src/java/org/scilab/modules/graphic_objects/ObjectDataJNI.java
scilab/modules/graphics/src/c/getHandleProperty/get_triangles_property.c
scilab/modules/statistics/macros/st_deviation.sci
scilab/modules/xml/src/cpp/VariableScope.cpp
scilab/modules/xml/src/cpp/VariableScope.hxx
scilab/modules/xml/src/cpp/XMLDocument.cpp

Change-Id: Ic4c2565536094b03e3bbd6b14bf6954e57fe1576

20 files changed:
1  2 
scilab/bin/scilab
scilab/configure
scilab/configure.ac
scilab/modules/graphic_objects/Makefile.am
scilab/modules/graphic_objects/Makefile.in
scilab/modules/graphic_objects/src/c/graphic_objects.vcxproj
scilab/modules/graphic_objects/src/c/graphic_objects.vcxproj.filters
scilab/modules/graphic_objects/src/java/org/scilab/modules/graphic_objects/ObjectData.java
scilab/modules/graphic_objects/src/java/org/scilab/modules/graphic_objects/ObjectDataJNI.java
scilab/modules/graphic_objects/src/jni/ObjectData.i
scilab/modules/graphic_objects/src/jni/ObjectData_wrap.c
scilab/modules/graphics/sci_gateway/c/sci_fec.c
scilab/modules/graphics/src/c/BuildObjects.c
scilab/modules/graphics/src/c/getHandleProperty/get_triangles_property.c
scilab/modules/graphics/src/c/sciCall.c
scilab/modules/helptools/data/configuration/scilab_macros.txt
scilab/modules/xml/src/cpp/VariableScope.cpp
scilab/modules/xml/src/cpp/VariableScope.hxx
scilab/modules/xml/src/cpp/XMLDocument.cpp
scilab/modules/xml/src/cpp/XMLDocument.hxx

Simple merge
@@@ -14842,6 -14296,168 +14842,168 @@@ $as_echo "$as_me: WARNING: Could not fi
                  JOGL2=$PACKAGE_JAR_FILE
  
  
+     { $as_echo "$as_me:${as_lineno-$LINENO}: checking minimal version (Specification-Version 2.2) of jogl2" >&5
+ $as_echo_n "checking minimal version (Specification-Version 2.2) of jogl2... " >&6; }
+     export JARFILE=$JOGL2;
+     if test "x" == "x"; then
+     cat << \EOF > conftest.java
 -// #line 14306 "configure"
++// #line 14852 "configure"
+ import java.util.regex.Pattern;
+ import java.io.IOException;
+ import java.util.jar.JarFile;
+ public class conftest {
+     public static void main(String[] argv) {
+         String minVersion="2.2";
+         try {
+             String version = new JarFile(System.getenv("JARFILE")).getManifest().getMainAttributes().getValue("Specification-Version");
+             System.out.println(version);
+             if (compare(minVersion, version) > 0) {
+                 System.exit(-1);
+             }
+         } catch (IOException e) {
+             System.err.println(e.getMessage());
+             System.exit(1);
+         }
+     }
+     private static int compare(String v1, String v2) {
+         String s1 = normalisedVersion(v1);
+         String s2 = normalisedVersion(v2);
+         return s1.compareTo(s2);
+     }
+     private static String normalisedVersion(String version) {
+         return normalisedVersion(version, ".", 4);
+     }
+     private static String normalisedVersion(String version, String sep, int maxWidth) {
+         String[] split = Pattern.compile(sep, Pattern.LITERAL).split(version);
+         StringBuilder sb = new StringBuilder();
+         for (String s : split) {
+             sb.append(String.format("%" + maxWidth + 's', s));
+         }
+         return sb.toString();
+     }
+ }
+ EOF
+     CLASSPATH=$ac_java_classpath
+     export CLASSPATH
+     cmd="$JAVAC ${JAVAC_FLAGS} conftest.java"
+     if (echo $cmd >&5 ; eval $cmd >conftest.java.output 2>&5) ; then
+        if test ""yes"" = "no"; then
+            echo "yes" >&5
+               echo "yes"
+        else
+               cmd="$JAVA conftest"
+               if (echo $cmd >&5 ; eval $cmd >conftest.java.output 2>&5); then
+                echo "yes" >&5
+                   echo "yes"
+             else
+                 echo "configure: failed program was:" >&5
+                 cat conftest.java >&5
+                 if test -s conftest.java.output; then
+                    STDOUT=`cat conftest.java.output`
+                 fi
+                 echo "configure: CLASSPATH was $CLASSPATH" >&5
+                   as_fn_error $? "Wrong version of jogl2. Expected at least 2.2. Found $STDOUT" "$LINENO" 5
+                             fi
+         fi
+         if test -f conftest.java.output; then
+            rm conftest.java.output
+         fi
+     else
+         echo "configure: failed program was:" >&5
+         cat conftest.java >&5
+         echo "configure: CLASSPATH was $CLASSPATH" >&5
+           as_fn_error $? "Wrong version of jogl2. Expected at least 2.2. Found $STDOUT" "$LINENO" 5
+             fi
+     else
+     cat << \EOF > conftest.java
 -// #line 14383 "configure"
++// #line 14929 "configure"
+ import java.util.regex.Pattern;
+ import java.io.IOException;
+ import java.util.jar.JarFile;
+ public class conftest {
+     public static void main(String[] argv) {
+         String minVersion="2.2";
+         try {
+             String version = new JarFile(System.getenv("JARFILE")).getManifest().getMainAttributes().getValue("Specification-Version");
+             System.out.println("Specification-Version" + ": " + version);
+             if (compare(minVersion, version) != 0) {
+                 System.exit(-1);
+             }
+         } catch (IOException e) {
+             System.err.println(e.getMessage());
+             System.exit(1);
+         }
+     }
+     private static int compare(String v1, String v2) {
+         String s1 = normalisedVersion(v1);
+         String s2 = normalisedVersion(v2);
+         return s1.compareTo(s2);
+     }
+     private static String normalisedVersion(String version) {
+         return normalisedVersion(version, ".", 4);
+     }
+     private static String normalisedVersion(String version, String sep, int maxWidth) {
+         String[] split = Pattern.compile(sep, Pattern.LITERAL).split(version);
+         StringBuilder sb = new StringBuilder();
+         for (String s : split) {
+             sb.append(String.format("%" + maxWidth + 's', s));
+         }
+         return sb.toString();
+     }
+ }
+ EOF
+     CLASSPATH=$ac_java_classpath
+     export CLASSPATH
+     cmd="$JAVAC ${JAVAC_FLAGS} conftest.java"
+     if (echo $cmd >&5 ; eval $cmd >conftest.java.output 2>&5) ; then
+        if test ""yes"" = "no"; then
+            echo "yes" >&5
+               echo "yes"
+        else
+               cmd="$JAVA conftest"
+               if (echo $cmd >&5 ; eval $cmd >conftest.java.output 2>&5); then
+                echo "yes" >&5
+                   echo "yes"
+             else
+                 echo "configure: failed program was:" >&5
+                 cat conftest.java >&5
+                 if test -s conftest.java.output; then
+                    STDOUT=`cat conftest.java.output`
+                 fi
+                 echo "configure: CLASSPATH was $CLASSPATH" >&5
+                   as_fn_error $? "Wrong version of jogl2. Expected exact version Specification-Version. Found $STDOUT" "$LINENO" 5
+                             fi
+         fi
+         if test -f conftest.java.output; then
+            rm conftest.java.output
+         fi
+     else
+         echo "configure: failed program was:" >&5
+         cat conftest.java >&5
+         echo "configure: CLASSPATH was $CLASSPATH" >&5
+           as_fn_error $? "Wrong version of jogl2. Expected exact version Specification-Version. Found $STDOUT" "$LINENO" 5
+             fi
+     fi
+     unset JARFILE
                  if test "$MACOSX" = 1; then
                     echo "Check of the presence of libjogl.jnilib and libjogl_awt.jnilib disabled under Mac OS X"
                  else
@@@ -14966,7 -14582,7 +15128,7 @@@ $as_echo_n "checking gluegen2-rt... " >
              export ac_java_classpath="$jar_resolved:$ac_java_classpath"
  
      cat << \EOF > conftest.java
- // #line 14969 "configure"
 -// #line 14585 "configure"
++// #line 15131 "configure"
  import java.util.regex.Pattern;
  
  import jogamp.common.os.MachineDescriptionRuntime;
@@@ -15140,7 -14756,7 +15302,7 @@@ $as_echo_n "checking jhall... " >&6; 
              export ac_java_classpath="$jar_resolved:$ac_java_classpath"
  
      cat << \EOF > conftest.java
- // #line 15143 "configure"
 -// #line 14759 "configure"
++// #line 15305 "configure"
  import java.util.regex.Pattern;
  
  import javax.help.JHelp;
@@@ -15255,7 -14871,7 +15417,7 @@@ $as_echo_n "checking javahelp2... " >&6
              export ac_java_classpath="$jar_resolved:$ac_java_classpath"
  
      cat << \EOF > conftest.java
- // #line 15258 "configure"
 -// #line 14874 "configure"
++// #line 15420 "configure"
  import java.util.regex.Pattern;
  
  import javax.help.JHelp;
@@@ -15373,7 -14989,7 +15535,7 @@@ $as_echo_n "checking jrosetta-API... " 
              export ac_java_classpath="$jar_resolved:$ac_java_classpath"
  
      cat << \EOF > conftest.java
- // #line 15376 "configure"
 -// #line 14992 "configure"
++// #line 15538 "configure"
  import java.util.regex.Pattern;
  
  import com.artenum.rosetta.interfaces.core.ConsoleConfiguration;
@@@ -15487,7 -15103,7 +15649,7 @@@ $as_echo_n "checking jrosetta-api... " 
              export ac_java_classpath="$jar_resolved:$ac_java_classpath"
  
      cat << \EOF > conftest.java
- // #line 15490 "configure"
 -// #line 15106 "configure"
++// #line 15652 "configure"
  import java.util.regex.Pattern;
  
  import com.artenum.rosetta.interfaces.core.ConsoleConfiguration;
@@@ -15605,7 -15221,7 +15767,7 @@@ $as_echo_n "checking jrosetta-engine..
              export ac_java_classpath="$jar_resolved:$ac_java_classpath"
  
      cat << \EOF > conftest.java
- // #line 15608 "configure"
 -// #line 15224 "configure"
++// #line 15770 "configure"
  import java.util.regex.Pattern;
  
  import com.artenum.rosetta.core.action.AbstractConsoleAction;
@@@ -15711,7 -15327,7 +15873,7 @@@ $as_echo_n "checking minimal version (1
     if test "x" == "x"; then
  
      cat << \EOF > conftest.java
- // #line 15714 "configure"
 -// #line 15330 "configure"
++// #line 15876 "configure"
  import java.util.regex.Pattern;
  
  import com.artenum.rosetta.util.ConfigurationBuilder;
     else
  
      cat << \EOF > conftest.java
- // #line 15786 "configure"
 -// #line 15402 "configure"
++// #line 15948 "configure"
  import java.util.regex.Pattern;
  
  import com.artenum.rosetta.util.ConfigurationBuilder;
@@@ -15876,7 -15492,7 +16038,7 @@@ $as_echo_n "checking jeuclid-core... " 
              export ac_java_classpath="$jar_resolved:$ac_java_classpath"
  
      cat << \EOF > conftest.java
- // #line 15879 "configure"
 -// #line 15495 "configure"
++// #line 16041 "configure"
  import java.util.regex.Pattern;
  
  import net.sourceforge.jeuclid.LayoutContext;
@@@ -15995,7 -15611,7 +16157,7 @@@ $as_echo_n "checking fop... " >&6; 
              export ac_java_classpath="$jar_resolved:$ac_java_classpath"
  
      cat << \EOF > conftest.java
- // #line 15998 "configure"
 -// #line 15614 "configure"
++// #line 16160 "configure"
  import java.util.regex.Pattern;
  
  import org.apache.fop.pdf.PDFInfo;
@@@ -16119,7 -15735,7 +16281,7 @@@ $as_echo_n "checking freehep-graphics2d
              export ac_java_classpath="$jar_resolved:$ac_java_classpath"
  
      cat << \EOF > conftest.java
- // #line 16122 "configure"
 -// #line 15738 "configure"
++// #line 16284 "configure"
  import java.util.regex.Pattern;
  
  import org.freehep.graphics2d.VectorGraphics;
@@@ -16236,7 -15852,7 +16398,7 @@@ $as_echo_n "checking freehep-graphicsio
              export ac_java_classpath="$jar_resolved:$ac_java_classpath"
  
      cat << \EOF > conftest.java
- // #line 16239 "configure"
 -// #line 15855 "configure"
++// #line 16401 "configure"
  import java.util.regex.Pattern;
  
  import org.freehep.graphicsio.emf.EMFGraphics2D;
@@@ -16353,7 -15969,7 +16515,7 @@@ $as_echo_n "checking freehep-graphicsio
              export ac_java_classpath="$jar_resolved:$ac_java_classpath"
  
      cat << \EOF > conftest.java
- // #line 16356 "configure"
 -// #line 15972 "configure"
++// #line 16518 "configure"
  import java.util.regex.Pattern;
  
  import org.freehep.graphicsio.VectorGraphicsIO;
@@@ -16470,7 -16086,7 +16632,7 @@@ $as_echo_n "checking freehep-io... " >&
              export ac_java_classpath="$jar_resolved:$ac_java_classpath"
  
      cat << \EOF > conftest.java
- // #line 16473 "configure"
 -// #line 16089 "configure"
++// #line 16635 "configure"
  import java.util.regex.Pattern;
  
  import org.freehep.util.io.XMLSequence;
@@@ -16587,7 -16203,7 +16749,7 @@@ $as_echo_n "checking freehep-util... " 
              export ac_java_classpath="$jar_resolved:$ac_java_classpath"
  
      cat << \EOF > conftest.java
- // #line 16590 "configure"
 -// #line 16206 "configure"
++// #line 16752 "configure"
  import java.util.regex.Pattern;
  
  import org.freehep.util.StringUtilities;
@@@ -16705,7 -16321,7 +16867,7 @@@ $as_echo_n "checking batik-all... " >&6
              export ac_java_classpath="$jar_resolved:$ac_java_classpath"
  
      cat << \EOF > conftest.java
- // #line 16708 "configure"
 -// #line 16324 "configure"
++// #line 16870 "configure"
  import java.util.regex.Pattern;
  
  import org.apache.batik.parser.Parser;
@@@ -16822,7 -16438,7 +16984,7 @@@ $as_echo_n "checking batik... " >&6; 
              export ac_java_classpath="$jar_resolved:$ac_java_classpath"
  
      cat << \EOF > conftest.java
- // #line 16825 "configure"
 -// #line 16441 "configure"
++// #line 16987 "configure"
  import java.util.regex.Pattern;
  
  import org.apache.batik.parser.Parser;
@@@ -16929,7 -16545,7 +17091,7 @@@ $as_echo_n "checking minimal version (1
     if test "x" == "x"; then
  
      cat << \EOF > conftest.java
- // #line 16932 "configure"
 -// #line 16548 "configure"
++// #line 17094 "configure"
  import java.util.regex.Pattern;
  
  import org.apache.batik.Version;
     else
  
      cat << \EOF > conftest.java
- // #line 17004 "configure"
 -// #line 16620 "configure"
++// #line 17166 "configure"
  import java.util.regex.Pattern;
  
  import org.apache.batik.Version;
@@@ -17092,7 -16708,7 +17254,7 @@@ $as_echo_n "checking commons-io... " >&
              export ac_java_classpath="$jar_resolved:$ac_java_classpath"
  
      cat << \EOF > conftest.java
- // #line 17095 "configure"
 -// #line 16711 "configure"
++// #line 17257 "configure"
  import java.util.regex.Pattern;
  
  import org.apache.commons.io.output.CountingOutputStream;
@@@ -17209,7 -16825,7 +17371,7 @@@ $as_echo_n "checking xmlgraphics-common
              export ac_java_classpath="$jar_resolved:$ac_java_classpath"
  
      cat << \EOF > conftest.java
- // #line 17212 "configure"
 -// #line 16828 "configure"
++// #line 17374 "configure"
  import java.util.regex.Pattern;
  
  import org.apache.xmlgraphics.util.Service;
@@@ -17326,7 -16942,7 +17488,7 @@@ $as_echo_n "checking avalon-framework..
              export ac_java_classpath="$jar_resolved:$ac_java_classpath"
  
      cat << \EOF > conftest.java
- // #line 17329 "configure"
 -// #line 16945 "configure"
++// #line 17491 "configure"
  import java.util.regex.Pattern;
  
  import org.apache.avalon.framework.configuration.ConfigurationException;
@@@ -17443,7 -17059,7 +17605,7 @@@ $as_echo_n "checking xml-apis-ext... " 
              export ac_java_classpath="$jar_resolved:$ac_java_classpath"
  
      cat << \EOF > conftest.java
- // #line 17446 "configure"
 -// #line 17062 "configure"
++// #line 17608 "configure"
  import java.util.regex.Pattern;
  
  import org.w3c.dom.svg.SVGDocument;
@@@ -17560,7 -17176,7 +17722,7 @@@ $as_echo_n "checking xml-commons-apis-e
              export ac_java_classpath="$jar_resolved:$ac_java_classpath"
  
      cat << \EOF > conftest.java
- // #line 17563 "configure"
 -// #line 17179 "configure"
++// #line 17725 "configure"
  import java.util.regex.Pattern;
  
  import org.w3c.dom.svg.SVGDocument;
@@@ -17681,7 -17297,7 +17843,7 @@@ $as_echo_n "checking commons-logging..
              export ac_java_classpath="$jar_resolved:$ac_java_classpath"
  
      cat << \EOF > conftest.java
- // #line 17684 "configure"
 -// #line 17300 "configure"
++// #line 17846 "configure"
  import java.util.regex.Pattern;
  
  import org.apache.commons.logging.LogFactory;
@@@ -17798,7 -17414,7 +17960,7 @@@ $as_echo_n "checking jlatexmath... " >&
              export ac_java_classpath="$jar_resolved:$ac_java_classpath"
  
      cat << \EOF > conftest.java
- // #line 17801 "configure"
 -// #line 17417 "configure"
++// #line 17963 "configure"
  import java.util.regex.Pattern;
  
  import org.scilab.forge.jlatexmath.TeXFormula;
@@@ -17905,7 -17521,7 +18067,7 @@@ $as_echo_n "checking minimal version (1
     if test "x" == "x"; then
  
      cat << \EOF > conftest.java
- // #line 17908 "configure"
 -// #line 17524 "configure"
++// #line 18070 "configure"
  import java.util.regex.Pattern;
  
  import org.scilab.forge.jlatexmath.TeXFormula;
     else
  
      cat << \EOF > conftest.java
- // #line 17980 "configure"
 -// #line 17596 "configure"
++// #line 18142 "configure"
  import java.util.regex.Pattern;
  
  import org.scilab.forge.jlatexmath.TeXFormula;
@@@ -18068,7 -17684,7 +18230,7 @@@ $as_echo_n "checking jlatexmath-fop... 
              export ac_java_classpath="$jar_resolved:$ac_java_classpath"
  
      cat << \EOF > conftest.java
- // #line 18071 "configure"
 -// #line 17687 "configure"
++// #line 18233 "configure"
  import java.util.regex.Pattern;
  
  import org.scilab.forge.jlatexmath.fop.JLaTeXMathObj;
@@@ -18191,7 -17807,7 +18353,7 @@@ $as_echo_n "checking checkstyle... " >&
              export ac_java_classpath="$jar_resolved:$ac_java_classpath"
  
      cat << \EOF > conftest.java
- // #line 18194 "configure"
 -// #line 17810 "configure"
++// #line 18356 "configure"
  import java.util.regex.Pattern;
  
  import com.puppycrawl.tools.checkstyle.CheckStyleTask;
@@@ -18308,7 -17924,7 +18470,7 @@@ $as_echo_n "checking commons-beanutils.
              export ac_java_classpath="$jar_resolved:$ac_java_classpath"
  
      cat << \EOF > conftest.java
- // #line 18311 "configure"
 -// #line 17927 "configure"
++// #line 18473 "configure"
  import java.util.regex.Pattern;
  
  import org.apache.commons.beanutils.Converter;
@@@ -18425,7 -18041,7 +18587,7 @@@ $as_echo_n "checking antlr... " >&6; 
              export ac_java_classpath="$jar_resolved:$ac_java_classpath"
  
      cat << \EOF > conftest.java
- // #line 18428 "configure"
 -// #line 18044 "configure"
++// #line 18590 "configure"
  import java.util.regex.Pattern;
  
  import antlr.TokenStreamException;
@@@ -18542,7 -18158,7 +18704,7 @@@ $as_echo_n "checking junit4... " >&6; 
              export ac_java_classpath="$jar_resolved:$ac_java_classpath"
  
      cat << \EOF > conftest.java
- // #line 18545 "configure"
 -// #line 18161 "configure"
++// #line 18707 "configure"
  import java.util.regex.Pattern;
  
  import org.junit.Assert;
@@@ -18656,7 -18272,7 +18818,7 @@@ $as_echo_n "checking junit... " >&6; 
              export ac_java_classpath="$jar_resolved:$ac_java_classpath"
  
      cat << \EOF > conftest.java
- // #line 18659 "configure"
 -// #line 18275 "configure"
++// #line 18821 "configure"
  import java.util.regex.Pattern;
  
  import org.junit.Assert;
@@@ -18777,7 -18393,7 +18939,7 @@@ $as_echo_n "checking cobertura... " >&6
              export ac_java_classpath="$jar_resolved:$ac_java_classpath"
  
      cat << \EOF > conftest.java
- // #line 18780 "configure"
 -// #line 18396 "configure"
++// #line 18942 "configure"
  import java.util.regex.Pattern;
  
  import net.sourceforge.cobertura.merge.Main;
@@@ -18894,7 -18510,7 +19056,7 @@@ $as_echo_n "checking asm3... " >&6; 
              export ac_java_classpath="$jar_resolved:$ac_java_classpath"
  
      cat << \EOF > conftest.java
- // #line 18897 "configure"
 -// #line 18513 "configure"
++// #line 19059 "configure"
  import java.util.regex.Pattern;
  
  import org.objectweb.asm.Type;
@@@ -19008,7 -18624,7 +19170,7 @@@ $as_echo_n "checking asm... " >&6; 
              export ac_java_classpath="$jar_resolved:$ac_java_classpath"
  
      cat << \EOF > conftest.java
- // #line 19011 "configure"
 -// #line 18627 "configure"
++// #line 19173 "configure"
  import java.util.regex.Pattern;
  
  import org.objectweb.asm.Type;
@@@ -19125,7 -18741,7 +19287,7 @@@ $as_echo_n "checking ecj... " >&6; 
              export ac_java_classpath="$jar_resolved:$ac_java_classpath"
  
      cat << \EOF > conftest.java
- // #line 19128 "configure"
 -// #line 18744 "configure"
++// #line 19290 "configure"
  import java.util.regex.Pattern;
  
  import org.eclipse.jdt.core.compiler.batch.BatchCompiler;
  fi
  
  
 - if test "$with_fftw" != no; then
 -  FFTW_TRUE=
 -  FFTW_FALSE='#'
 +
 +fi
 +
 +
 +        PATH_TO_EIGEN="/usr/include/eigen3/"
 +    fi
 +fi
 +CPPFLAGS="$save_CPPFLAGS"
 +
 +CHK_EIGEN_WORLD=3
 +CHK_EIGEN_MAJOR=1
 +CHK_EIGEN_MINOR=0
 +
 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if Eigen is version $CHK_EIGEN_WORLD.$CHK_EIGEN_MAJOR.$CHK_EIGEN_MINOR or later" >&5
 +$as_echo_n "checking if Eigen is version $CHK_EIGEN_WORLD.$CHK_EIGEN_MAJOR.$CHK_EIGEN_MINOR or later... " >&6; }
 +cat > conftest.$ac_ext <<EOF
- #line 23385 "configure"
++#line 23547 "configure"
 +#include "confdefs.h"
 +
 +#include "$PATH_TO_EIGEN/Eigen/Sparse"
 +#if EIGEN_VERSION_AT_LEAST(3,1,0)
 +EIGEN_VERSION_OK
 +#endif
 +
 +EOF
 +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
 +  grep "EIGEN_VERSION_OK" >/dev/null 2>&1; then
 +  rm -rf conftest*
 +  \
 +EIGEN_VERSION_OK=1
  else
 -  FFTW_TRUE='#'
 -  FFTW_FALSE=
 +  rm -rf conftest*
 +  \
 +EIGEN_VERSION_OK=0
  fi
 +rm -f conftest*
 +
 +if test $EIGEN_VERSION_OK = 0; then
 +   as_fn_error $? "Version $CHK_EIGEN_WORLD.$CHK_EIGEN_MAJOR.$CHK_EIGEN_MINOR of Eigen expected (at least)" "$LINENO" 5
 +else
 +   { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 +$as_echo "yes" >&6; }
 +fi
 +
 +
 +
 +$as_echo "#define WITH_EIGEN /**/" >>confdefs.h
 +
 +ac_ext=c
 +ac_cpp='$CPP $CPPFLAGS'
 +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
 +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
 +ac_compiler_gnu=$ac_cv_c_compiler_gnu
 +
  
  
  
@@@ -27973,7 -27333,7 +28135,7 @@@ CPPFLAGS="$CPPFLAGS -I$CHK_TCL_INCLUDE_
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if tcl is version $CHK_TCL_MAJOR.$CHK_TCL_MINOR or later" >&5
  $as_echo_n "checking if tcl is version $CHK_TCL_MAJOR.$CHK_TCL_MINOR or later... " >&6; }
  cat > conftest.$ac_ext <<EOF
- #line 27976 "configure"
 -#line 27336 "configure"
++#line 28138 "configure"
  #include "confdefs.h"
  
  #include "$CHK_TCL_INCLUDE_PATH/$CHK_TCL_INC_NAME"
@@@ -28284,7 -27644,7 +28446,7 @@@ CPPFLAGS="$CPPFLAGS $TCL_INC_PATH -I$CH
  $as_echo_n "checking if tk is version $CHK_TK_MAJOR.$CHK_TK_MINOR or later... " >&6; }
  
  cat > conftest.$ac_ext <<EOF
- #line 28287 "configure"
 -#line 27647 "configure"
++#line 28449 "configure"
  #include "confdefs.h"
  
  #include "$CHK_TK_INCLUDE_PATH/$CHK_TK_INC_NAME"
@@@ -28873,7 -28233,7 +29035,7 @@@ $as_echo_n "checking saxon9he... " >&6
              export ac_java_classpath="$jar_resolved:$ac_java_classpath"
  
      cat << \EOF > conftest.java
- // #line 28876 "configure"
 -// #line 28236 "configure"
++// #line 29038 "configure"
  import java.util.regex.Pattern;
  
  import net.sf.saxon.Version;
@@@ -28988,7 -28348,7 +29150,7 @@@ $as_echo_n "checking saxon... " >&6; 
              export ac_java_classpath="$jar_resolved:$ac_java_classpath"
  
      cat << \EOF > conftest.java
- // #line 28991 "configure"
 -// #line 28351 "configure"
++// #line 29153 "configure"
  import java.util.regex.Pattern;
  
  import net.sf.saxon.Version;
@@@ -29104,7 -28464,7 +29266,7 @@@ $as_echo_n "checking saxon... " >&6; 
              export ac_java_classpath="$jar_resolved:$ac_java_classpath"
  
      cat << \EOF > conftest.java
- // #line 29107 "configure"
 -// #line 28467 "configure"
++// #line 29269 "configure"
  import java.util.regex.Pattern;
  
  import com.icl.saxon.Loader;
Simple merge
@@@ -30,62 -29,58 +30,62 @@@ BUILT_SOURCES =    includes/graphicObject
  #This file is also generated, but can not be listed to prevent GCJ call.
  #src/java/org/scilab/modules/graphic_objects/graphicObject/GraphicObjectProperties.java
  
 -GRAPHIC_OBJECTS_JNI_SOURCES = src/jni/CallGraphicController.cpp \
 -                              src/jni/Builder.cpp \
 -                              src/jni/CallXmlLoader.cpp
 -
 -GRAPHIC_OBJECTS_C_SOURCES = src/jni/DataLoader_wrap.c \
 -                                                      src/jni/ScilabNativeView_wrap.c \
 -                                                      src/jni/PolylineData_wrap.c \
 -                                                      src/jni/SurfaceData_wrap.c \
 -                            src/jni/ObjectData_wrap.c
 -
 -GRAPHIC_OBJECTS_CXX_SOURCES =         src/cpp/createGraphicObject.cpp \
 -                                                              src/cpp/getGraphicObjectProperty.cpp \
 -                                                              src/cpp/getConsoleIdentifier.cpp \
 -                                                              src/cpp/setGraphicObjectProperty.cpp \
 -                                                              src/cpp/deleteGraphicObject.cpp \
 -                                                              src/cpp/dataModel.cpp \
 -                                                              src/cpp/Data3D.cpp \
 -                                                              src/cpp/DataLoader.cpp \
 -                                                              src/cpp/NgonData.cpp \
 -                                                              src/cpp/NgonGeneralData.cpp \
 -                                                              src/cpp/NgonGridData.cpp \
 -                                                              src/cpp/NgonGridMatplotData.cpp \
 -                                                              src/cpp/NgonPolylineData.cpp \
 -                                                              src/cpp/MeshData.cpp \
 -                                                              src/cpp/MeshFecData.cpp \
 -                                                              src/cpp/ColorComputer.cpp \
 -                                                              src/cpp/DecompositionUtils.cpp \
 -                                                              src/cpp/Fac3DColorComputer.cpp \
 -                                                              src/cpp/Fac3DDecomposer.cpp \
 -                                                              src/cpp/NgonGridDataDecomposer.cpp \
 -                                                              src/cpp/NgonGridGrayplotDataDecomposer.cpp \
 -                                                              src/cpp/MatPlotDecomposer.cpp \
 -                                                              src/cpp/NgonGridMatplotDataDecomposer.cpp \
 -                                                              src/cpp/Plot3DDecomposer.cpp \
 -                                                              src/cpp/PolylineDecomposer.cpp \
 -                                                              src/cpp/MeshFecDataDecomposer.cpp \
 -                                                              src/cpp/Triangulator.cpp \
 -                                                              src/cpp/ScilabView.cpp \
 -                                                              src/cpp/FigureList.cpp \
 -                                                              src/cpp/HandleManagement.cpp \
 -                                                              src/cpp/AxesModel.cpp \
 -                                                              src/cpp/FigureModel.cpp \
 -                                                              src/cpp/CurrentFigure.cpp \
 -                                                              src/cpp/CurrentObject.cpp \
 -                                                              src/cpp/CurrentSubwin.cpp \
 -                                                              src/cpp/createObjectData.cpp \
 -                                                              src/cpp/pickSurface.cpp \
 -                                                              src/cpp/Texture.cpp \
 -                                                              src/cpp/NormalGenerator.cpp
 -
 -GIWS_WRAPPERS = src/jni/graphic_objects.giws.xml \
 -                src/jni/builder.giws.xml
 +GRAPHIC_OBJECTS_JNI_SOURCES = \
 +    src/jni/CallGraphicController.cpp \
 +    src/jni/Builder.cpp \
 +    src/jni/CallXmlLoader.cpp
 +
 +GRAPHIC_OBJECTS_C_SOURCES = \
 +    src/jni/DataLoader_wrap.c \
 +    src/jni/ScilabNativeView_wrap.c \
 +    src/jni/PolylineData_wrap.c \
 +    src/jni/SurfaceData_wrap.c \
 +    src/jni/ObjectData_wrap.c
 +
 +GRAPHIC_OBJECTS_CXX_SOURCES = \
 +    src/cpp/createGraphicObject.cpp \
 +    src/cpp/getGraphicObjectProperty.cpp \
 +    src/cpp/getConsoleIdentifier.cpp \
 +    src/cpp/setGraphicObjectProperty.cpp \
 +    src/cpp/deleteGraphicObject.cpp \
 +    src/cpp/dataModel.cpp \
 +    src/cpp/Data3D.cpp \
 +    src/cpp/DataLoader.cpp \
 +    src/cpp/NgonData.cpp \
 +    src/cpp/NgonGeneralData.cpp \
 +    src/cpp/NgonGridData.cpp \
 +    src/cpp/NgonGridMatplotData.cpp \
 +    src/cpp/NgonPolylineData.cpp \
-     src/cpp/TriangleMeshData.cpp \
-     src/cpp/TriangleMeshFecData.cpp \
++    src/cpp/MeshData.cpp \
++    src/cpp/MeshFecData.cpp \
 +    src/cpp/ColorComputer.cpp \
 +    src/cpp/DecompositionUtils.cpp \
 +    src/cpp/Fac3DColorComputer.cpp \
 +    src/cpp/Fac3DDecomposer.cpp \
 +    src/cpp/NgonGridDataDecomposer.cpp \
 +    src/cpp/NgonGridGrayplotDataDecomposer.cpp \
 +    src/cpp/MatPlotDecomposer.cpp \
 +    src/cpp/NgonGridMatplotDataDecomposer.cpp \
 +    src/cpp/Plot3DDecomposer.cpp \
 +    src/cpp/PolylineDecomposer.cpp \
-     src/cpp/TriangleMeshFecDataDecomposer.cpp \
++    src/cpp/MeshFecDataDecomposer.cpp \
 +    src/cpp/Triangulator.cpp \
 +    src/cpp/ScilabView.cpp \
 +    src/cpp/FigureList.cpp \
 +    src/cpp/HandleManagement.cpp \
 +    src/cpp/AxesModel.cpp \
 +    src/cpp/FigureModel.cpp \
 +    src/cpp/CurrentFigure.cpp \
 +    src/cpp/CurrentObject.cpp \
 +    src/cpp/CurrentSubwin.cpp \
 +    src/cpp/createObjectData.cpp \
 +    src/cpp/pickSurface.cpp \
 +    src/cpp/Texture.cpp \
 +    src/cpp/NormalGenerator.cpp
 +
 +GIWS_WRAPPERS = \
 +    src/jni/graphic_objects.giws.xml \
 +    src/jni/builder.giws.xml
  
  if GIWS
  BUILT_SOURCES += giws
@@@ -702,85 -692,70 +702,85 @@@ BUILT_SOURCES = includes/graphicObjects
        $(am__append_4)
  #This file is also generated, but can not be listed to prevent GCJ call.
  #src/java/org/scilab/modules/graphic_objects/graphicObject/GraphicObjectProperties.java
 -GRAPHIC_OBJECTS_JNI_SOURCES = src/jni/CallGraphicController.cpp \
 -                              src/jni/Builder.cpp \
 -                              src/jni/CallXmlLoader.cpp
 -
 -GRAPHIC_OBJECTS_C_SOURCES = src/jni/DataLoader_wrap.c \
 -                                                      src/jni/ScilabNativeView_wrap.c \
 -                                                      src/jni/PolylineData_wrap.c \
 -                                                      src/jni/SurfaceData_wrap.c \
 -                            src/jni/ObjectData_wrap.c
 -
 -GRAPHIC_OBJECTS_CXX_SOURCES = src/cpp/createGraphicObject.cpp \
 -                                                              src/cpp/getGraphicObjectProperty.cpp \
 -                                                              src/cpp/getConsoleIdentifier.cpp \
 -                                                              src/cpp/setGraphicObjectProperty.cpp \
 -                                                              src/cpp/deleteGraphicObject.cpp \
 -                                                              src/cpp/dataModel.cpp \
 -                                                              src/cpp/Data3D.cpp \
 -                                                              src/cpp/DataLoader.cpp \
 -                                                              src/cpp/NgonData.cpp \
 -                                                              src/cpp/NgonGeneralData.cpp \
 -                                                              src/cpp/NgonGridData.cpp \
 -                                                              src/cpp/NgonGridMatplotData.cpp \
 -                                                              src/cpp/NgonPolylineData.cpp \
 -                                                              src/cpp/MeshData.cpp \
 -                                                              src/cpp/MeshFecData.cpp \
 -                                                              src/cpp/ColorComputer.cpp \
 -                                                              src/cpp/DecompositionUtils.cpp \
 -                                                              src/cpp/Fac3DColorComputer.cpp \
 -                                                              src/cpp/Fac3DDecomposer.cpp \
 -                                                              src/cpp/NgonGridDataDecomposer.cpp \
 -                                                              src/cpp/NgonGridGrayplotDataDecomposer.cpp \
 -                                                              src/cpp/MatPlotDecomposer.cpp \
 -                                                              src/cpp/NgonGridMatplotDataDecomposer.cpp \
 -                                                              src/cpp/Plot3DDecomposer.cpp \
 -                                                              src/cpp/PolylineDecomposer.cpp \
 -                                                              src/cpp/MeshFecDataDecomposer.cpp \
 -                                                              src/cpp/Triangulator.cpp \
 -                                                              src/cpp/ScilabView.cpp \
 -                                                              src/cpp/FigureList.cpp \
 -                                                              src/cpp/HandleManagement.cpp \
 -                                                              src/cpp/AxesModel.cpp \
 -                                                              src/cpp/FigureModel.cpp \
 -                                                              src/cpp/CurrentFigure.cpp \
 -                                                              src/cpp/CurrentObject.cpp \
 -                                                              src/cpp/CurrentSubwin.cpp \
 -                                                              src/cpp/createObjectData.cpp \
 -                                                              src/cpp/pickSurface.cpp \
 -                                                              src/cpp/Texture.cpp \
 -                                                              src/cpp/NormalGenerator.cpp
 -
 -GIWS_WRAPPERS = src/jni/graphic_objects.giws.xml \
 -                src/jni/builder.giws.xml
 -
 -libscigraphic_objects_la_CPPFLAGS = $(JAVA_JNI_INCLUDE) \
 -                      -I$(srcdir)/includes/ \
 -                      -I$(srcdir)/src/cpp/ \
 -                      -I$(srcdir)/src/c/ \
 -                      -I$(srcdir)/src/jni/ \
 -                      -I$(top_srcdir)/modules/api_scilab/includes/ \
 -                      -I$(top_srcdir)/modules/commons/src/jni/ \
 -                      -I$(top_srcdir)/modules/core/includes/ \
 -                      -I$(top_srcdir)/modules/jvm/includes/ \
 -                      -I$(top_srcdir)/modules/localization/includes/ \
 -                      -I$(top_srcdir)/modules/output_stream/includes/
 +GRAPHIC_OBJECTS_JNI_SOURCES = \
 +    src/jni/CallGraphicController.cpp \
 +    src/jni/Builder.cpp \
 +    src/jni/CallXmlLoader.cpp
 +
 +GRAPHIC_OBJECTS_C_SOURCES = \
 +    src/jni/DataLoader_wrap.c \
 +    src/jni/ScilabNativeView_wrap.c \
 +    src/jni/PolylineData_wrap.c \
 +    src/jni/SurfaceData_wrap.c \
 +    src/jni/ObjectData_wrap.c
 +
 +GRAPHIC_OBJECTS_CXX_SOURCES = \
 +    src/cpp/createGraphicObject.cpp \
 +    src/cpp/getGraphicObjectProperty.cpp \
 +    src/cpp/getConsoleIdentifier.cpp \
 +    src/cpp/setGraphicObjectProperty.cpp \
 +    src/cpp/deleteGraphicObject.cpp \
 +    src/cpp/dataModel.cpp \
 +    src/cpp/Data3D.cpp \
 +    src/cpp/DataLoader.cpp \
 +    src/cpp/NgonData.cpp \
 +    src/cpp/NgonGeneralData.cpp \
 +    src/cpp/NgonGridData.cpp \
 +    src/cpp/NgonGridMatplotData.cpp \
 +    src/cpp/NgonPolylineData.cpp \
-     src/cpp/TriangleMeshData.cpp \
-     src/cpp/TriangleMeshFecData.cpp \
++    src/cpp/MeshData.cpp \
++    src/cpp/MeshFecData.cpp \
 +    src/cpp/ColorComputer.cpp \
 +    src/cpp/DecompositionUtils.cpp \
 +    src/cpp/Fac3DColorComputer.cpp \
 +    src/cpp/Fac3DDecomposer.cpp \
 +    src/cpp/NgonGridDataDecomposer.cpp \
 +    src/cpp/NgonGridGrayplotDataDecomposer.cpp \
 +    src/cpp/MatPlotDecomposer.cpp \
 +    src/cpp/NgonGridMatplotDataDecomposer.cpp \
 +    src/cpp/Plot3DDecomposer.cpp \
 +    src/cpp/PolylineDecomposer.cpp \
-     src/cpp/TriangleMeshFecDataDecomposer.cpp \
++    src/cpp/MeshFecDataDecomposer.cpp \
 +    src/cpp/Triangulator.cpp \
 +    src/cpp/ScilabView.cpp \
 +    src/cpp/FigureList.cpp \
 +    src/cpp/HandleManagement.cpp \
 +    src/cpp/AxesModel.cpp \
 +    src/cpp/FigureModel.cpp \
 +    src/cpp/CurrentFigure.cpp \
 +    src/cpp/CurrentObject.cpp \
 +    src/cpp/CurrentSubwin.cpp \
 +    src/cpp/createObjectData.cpp \
 +    src/cpp/pickSurface.cpp \
 +    src/cpp/Texture.cpp \
 +    src/cpp/NormalGenerator.cpp
 +
 +GIWS_WRAPPERS = \
 +    src/jni/graphic_objects.giws.xml \
 +    src/jni/builder.giws.xml
 +
 +libscigraphic_objects_la_CPPFLAGS = \
 +    -I$(srcdir)/includes/ \
 +    -I$(srcdir)/src/cpp/ \
 +    -I$(srcdir)/src/c/ \
 +    -I$(srcdir)/src/jni/ \
 +    -I$(top_srcdir)/modules/api_scilab/includes/ \
 +    -I$(top_srcdir)/modules/commons/src/jni/ \
 +    -I$(top_srcdir)/modules/core/includes/ \
 +    -I$(top_srcdir)/modules/jvm/includes/ \
 +    -I$(top_srcdir)/modules/localization/includes/ \
 +    -I$(top_srcdir)/modules/ast/includes/ast/ \
 +    -I$(top_srcdir)/modules/ast/includes/exps/ \
 +    -I$(top_srcdir)/modules/ast/includes/operations/ \
 +    -I$(top_srcdir)/modules/ast/includes/parse/ \
 +    -I$(top_srcdir)/modules/ast/includes/symbol/ \
 +    -I$(top_srcdir)/modules/ast/includes/system_env/ \
 +    -I$(top_srcdir)/modules/ast/includes/types/ \
 +    -I$(top_srcdir)/modules/ast/includes/analysis/ \
 +    -I$(top_srcdir)/modules/output_stream/includes/ \
 +    -I$(top_srcdir)/modules/string/includes/ \
 +    $(JAVA_JNI_INCLUDE) \
 +    $(AM_CPPFLAGS)
  
  
  # Without the graphic_objects module
@@@ -9,20 -9,40 +9,24 @@@
  package org.scilab.modules.graphic_objects;
  
  public class ObjectData {
 -    public static Object getChampX(int uid) {
 -        return ObjectDataJNI.getChampX(uid);
 -    }
 +  public static Object getChampX(int uid) { return ObjectDataJNI.getChampX(uid); }
  
 -    public static Object getChampY(int uid) {
 -        return ObjectDataJNI.getChampY(uid);
 -    }
 +  public static Object getChampY(int uid) { return ObjectDataJNI.getChampY(uid); }
  
 -    public static Object getArrows(int uid) {
 -        return ObjectDataJNI.getArrows(uid);
 -    }
 +  public static Object getArrows(int uid) { return ObjectDataJNI.getArrows(uid); }
  
 -    public static Object getSegsData(int uid) {
 -        return ObjectDataJNI.getSegsData(uid);
 -    }
 +  public static Object getSegsData(int uid) { return ObjectDataJNI.getSegsData(uid); }
  
-   public static Object getFecTriangles(int uid) { return ObjectDataJNI.getFecTriangles(uid); }
 -    public static Object getFecElements(int uid) {
 -        return ObjectDataJNI.getFecElements(uid);
 -    }
++  public static Object getFecElements(int uid) { return ObjectDataJNI.getFecElements(uid); }
  
 -    public static Object getFecData(int uid) {
 -        return ObjectDataJNI.getFecData(uid);
 -    }
 +  public static Object getFecData(int uid) { return ObjectDataJNI.getFecData(uid); }
  
 -    public static Object getArcUpperLeftPoint(int uid) {
 -        return ObjectDataJNI.getArcUpperLeftPoint(uid);
 -    }
 +  public static Object getArcUpperLeftPoint(int uid) { return ObjectDataJNI.getArcUpperLeftPoint(uid); }
  
 -    public static Object getArcData(int uid) {
 -        return ObjectDataJNI.getArcData(uid);
 -    }
 +  public static Object getArcData(int uid) { return ObjectDataJNI.getArcData(uid); }
  
 -    public static int getFecNumVerticesByElement(int uid) {
 -        return ObjectDataJNI.getFecNumVerticesByElement(uid);
 -    }
++  public static int getFecNumVerticesByElement(int uid) {
++    return ObjectDataJNI.getFecNumVerticesByElement(uid);
++  }
  }
@@@ -10,21 -10,22 +10,22 @@@ package org.scilab.modules.graphic_obje
  
  public class ObjectDataJNI {
  
 -    static {
 -        try {
 -            System.loadLibrary("scigraphic_objects");
 -        } catch (UnsatisfiedLinkError e) {
 -            System.err.println("Native library failed to load. \n" + e);
 -            System.exit(1);
 -        }
 +  static {
 +    try {
 +        System.loadLibrary("scigraphic_objects");
 +    } catch (UnsatisfiedLinkError e) {
 +      System.err.println("Native library failed to load. \n" + e);
 +      System.exit(1);
      }
 +  }
  
 -    public final static native Object getChampX(int jarg1);
 -    public final static native Object getChampY(int jarg1);
 -    public final static native Object getArrows(int jarg1);
 -    public final static native Object getSegsData(int jarg1);
 -    public final static native Object getFecElements(int jarg1);
 -    public final static native Object getFecData(int jarg1);
 -    public final static native Object getArcUpperLeftPoint(int jarg1);
 -    public final static native Object getArcData(int jarg1);
 -    public final static native int getFecNumVerticesByElement(int jarg1);
 +  public final static native Object getChampX(int jarg1);
 +  public final static native Object getChampY(int jarg1);
 +  public final static native Object getArrows(int jarg1);
 +  public final static native Object getSegsData(int jarg1);
-   public final static native Object getFecTriangles(int jarg1);
++  public final static native Object getFecElements(int jarg1);
 +  public final static native Object getFecData(int jarg1);
 +  public final static native Object getArcUpperLeftPoint(int jarg1);
 +  public final static native Object getArcData(int jarg1);
++  public final static native int getFecNumVerticesByElement(int jarg1);
  }
  #include "graphicObjectProperties.h"
  
  /*------------------------------------------------------------------------*/
 -int get_triangles_property(void* _pvCtx, int iObjUID)
 +void* get_triangles_property(void* _pvCtx, int iObjUID)
  {
-     double* triangles = NULL;
-     int numTriangles = 0;
-     int *piNumTriangles = &numTriangles;
+     double* elements = NULL;
+     int numElements = 0;
+     int *piNumElements = &numElements;
+     int nVertex = 0;
+     int* piNVertex = &nVertex;
  
-     getGraphicObjectProperty(iObjUID, __GO_DATA_MODEL_FEC_TRIANGLES__, jni_double_vector, (void **)&triangles);
+     getGraphicObjectProperty(iObjUID, __GO_DATA_MODEL_FEC_ELEMENTS__, jni_double_vector, (void **)&elements);
  
-     if (triangles == NULL)
+     if (elements == NULL)
      {
-         Scierror(999, _("'%s' property does not exist for this handle.\n"), "triangles");
+         Scierror(999, _("'%s' property does not exist for this handle.\n"), "elements");
 -        return -1;
 +        return NULL;
      }
  
-     getGraphicObjectProperty(iObjUID, __GO_DATA_MODEL_NUM_INDICES__, jni_int, (void**)&piNumTriangles);
-     if (piNumTriangles == NULL)
+     getGraphicObjectProperty(iObjUID, __GO_DATA_MODEL_NUM_INDICES__, jni_int, (void**)&piNumElements);
+     if (piNumElements == NULL)
      {
-         Scierror(999, _("Wrong value for '%s' property.\n"), "triangles");
+         Scierror(999, _("Wrong value for '%s' property.\n"), "elements");
 -        return -1;
 +        return NULL;
      }
  
-     return sciReturnMatrix(triangles, numTriangles , 5);
+     getGraphicObjectProperty(iObjUID, __GO_DATA_MODEL_NUM_VERTICES_BY_ELEM__, jni_int, (void**) &piNVertex);
 -    return sciReturnMatrix(_pvCtx, elements, numElements , nVertex + 2);
++    return sciReturnMatrix(elements, numElements , nVertex + 2);
  }
  /*------------------------------------------------------------------------*/
@@@ -17,9 -18,9 +18,9 @@@
  namespace org_modules_xml
  {
  xmlFreeFunc VariableScope::XMLFreeFunc = 0;
 -std::map < void *, XMLObject * >*VariableScope::mapLibXMLToXMLObject = new std::map < void *, XMLObject * >();
 -std::map < void *, XMLNodeList * >*VariableScope::mapLibXMLToXMLNodeList = new std::map < void *, XMLNodeList * >();
 -std::map < const XMLObject *, std::map < const XMLObject *, bool>*>*VariableScope::parentToChildren;
 +std::map < void *, XMLObject * > VariableScope::mapLibXMLToXMLObject = std::map < void *, XMLObject * >();
 +std::map < void *, XMLNodeList * > VariableScope::mapLibXMLToXMLNodeList = std::map < void *, XMLNodeList * >();
- std::map < const XMLObject *, std::vector < const XMLObject *>*> VariableScope::parentToChildren = std::map < const XMLObject *, std::vector < const XMLObject *>*>();
++std::map < const XMLObject *, std::map < const XMLObject *, bool>*> VariableScope::parentToChildren = std::map < const XMLObject *, std::map < const XMLObject *, bool>*>();
  
  VariableScope::VariableScope(int _initialSize)
  {
@@@ -65,17 -68,25 +66,25 @@@ int VariableScope::getVariableId(const 
  
      if (parent)
      {
-         std::map < const XMLObject *, std::vector < const XMLObject *>*>::const_iterator it = parentToChildren.find(parent);
 -        std::map < const XMLObject *, std::map < const XMLObject *, bool>*>::const_iterator it = parentToChildren->find(parent);
++        std::map < const XMLObject *, std::map < const XMLObject *, bool>*>::const_iterator it = parentToChildren.find(parent);
  
 -        if (it != parentToChildren->end())
 +        if (it != parentToChildren.end())
          {
-             it->second->push_back(&obj);
+             std::map < const XMLObject *, bool>::iterator jt = it->second->find(&obj);
+             if (jt != it->second->end())
+             {
+                 jt->second = true;
+             }
+             else
+             {
+                 it->second->insert(std::pair<const XMLObject *, bool>(&obj, true));
+             }
          }
          else
          {
-             parentToChildren[parent] = new std::vector < const XMLObject *>();
-             parentToChildren[parent]->push_back(&obj);
+             std::map < const XMLObject *, bool> * map = new std::map < const XMLObject *, bool>();
+             map->insert(std::pair<const XMLObject *, bool>(&obj, true));
 -            parentToChildren->insert(std::pair<const XMLObject *, std::map < const XMLObject *, bool>*>(parent, map));
++            parentToChildren.insert(std::pair<const XMLObject *, std::map < const XMLObject *, bool>*>(parent, map));
          }
      }
  
@@@ -174,15 -186,14 +184,14 @@@ void VariableScope::removeId(int id
  
  void VariableScope::removeDependencies(XMLObject * obj)
  {
-     std::map < const XMLObject *, std::vector < const XMLObject *>*>::const_iterator it = parentToChildren.find(obj);
 -    std::map < const XMLObject *, std::map < const XMLObject *, bool>*>::const_iterator it = parentToChildren->find(obj);
++    std::map < const XMLObject *, std::map < const XMLObject *, bool>*>::const_iterator it = parentToChildren.find(obj);
  
 -    if (it != parentToChildren->end())
 +    if (it != parentToChildren.end())
      {
-         for (unsigned int i = 0; i < it->second->size(); i++)
+         for (std::map < const XMLObject *, bool>::const_iterator i = it->second->begin(), e = it->second->end(); i != e; ++i)
          {
-             const XMLObject *child = (*(it->second))[i];
-             if (child && getVariableFromId(child->getId()) == child)
+             const XMLObject *child = i->first;
+             if (child && i->second && getVariableFromId(child->getId()) == child)
              {
                  delete child;
              }
@@@ -241,16 -252,14 +250,14 @@@ void VariableScope::_xmlFreeFunc(void *
  inline void VariableScope::removeChildFromParent(const XMLObject * child)
  {
      const XMLObject *parent = child->getXMLObjectParent();
-     std::map < const XMLObject *, std::vector < const XMLObject *>*>::const_iterator it = parentToChildren.find(parent);
 -    std::map < const XMLObject *, std::map < const XMLObject *, bool>*>::iterator i = parentToChildren->find(parent);
++    std::map < const XMLObject *, std::map < const XMLObject *, bool>*>::iterator i = parentToChildren.find(parent);
  
-     if (it != parentToChildren.end())
 -    if (i != parentToChildren->end())
++    if (i != parentToChildren.end())
      {
-         for (unsigned int i = 0; i < it->second->size(); i++)
+         std::map < const XMLObject *, bool>::iterator j = i->second->find(child);
+         if (j != i->second->end())
          {
-             if (child == (*(it->second))[i])
-             {
-                 (*(it->second))[i] = 0;
-             }
+             j->second = false;
          }
      }
  }
@@@ -37,9 -37,9 +37,9 @@@ class VariableScop
      int initialSize;
      std::stack < int >*freePlaces;
  
-     static std::map < const XMLObject *, std::vector < const XMLObject *>*> parentToChildren;
 -    static std::map < const XMLObject *, std::map < const XMLObject *, bool>*>*parentToChildren;
 -    static std::map < void *, XMLObject * >*mapLibXMLToXMLObject;
 -    static std::map < void *, XMLNodeList * >*mapLibXMLToXMLNodeList;
++    static std::map < const XMLObject *, std::map < const XMLObject *, bool>*> parentToChildren;
 +    static std::map < void *, XMLObject * > mapLibXMLToXMLObject;
 +    static std::map < void *, XMLNodeList * > mapLibXMLToXMLNodeList;
      static xmlFreeFunc XMLFreeFunc;
  
  public:
@@@ -32,42 -32,14 +32,14 @@@ extern "C
  namespace org_modules_xml
  {
  
-     std::string XMLDocument::errorBuffer;
-     std::string XMLDocument::errorXPathBuffer;
-     std::list < XMLDocument *> XMLDocument::openDocs;
 -std::string * XMLDocument::errorBuffer = 0;
 -std::string * XMLDocument::errorXPathBuffer = 0;
 -std::list < XMLDocument * >&XMLDocument::openDocs = *new std::list < XMLDocument * >();
++std::string XMLDocument::errorBuffer;
++std::string XMLDocument::errorXPathBuffer;
++std::list < XMLDocument *> XMLDocument::openDocs;
  
-     XMLDocument::XMLDocument(const char *path, bool validate, std::string * error, const char * encoding, const bool html): XMLObject()
-     {
-         char *expandedPath = expandPathVariable(const_cast<char *>(path));
-         if (expandedPath)
-         {
-             if (html)
-             {
-                 document = readHTMLDocument(const_cast<const char *>(expandedPath), encoding, error);
-             }
-             else
-             {
-                 document = readDocument(const_cast<const char *>(expandedPath), encoding, validate, error);
-             }
-             FREE(expandedPath);
-             if (document)
-             {
-                 openDocs.push_back(this);
-                 scope->registerPointers(document, this);
-             }
-         }
-         else
-         {
-             document = 0;
-             *error = std::string(gettext("Invalid file name: ")) + std::string(path);
-         }
-         id = scope->getVariableId(*this);
-         scilabType = XMLDOCUMENT;
-     }
-     XMLDocument::XMLDocument(const std::string & xmlCode, bool validate, std::string * error, const char * encoding, const bool html): XMLObject()
+ XMLDocument::XMLDocument(const char *path, bool validate, std::string * error, const char * encoding, const bool html): XMLObject()
+ {
+     char *expandedPath = expandPathVariable(const_cast<char *>(path));
+     if (expandedPath)
      {
          if (html)
          {
          if (document)
          {
              openDocs.push_back(this);
+             scope->registerPointers(document, this);
          }
-         scope->registerPointers(document, this);
-         id = scope->getVariableId(*this);
-         scilabType = XMLDOCUMENT;
      }
-     XMLDocument::XMLDocument(char *uri, char *version): XMLObject()
+     else
      {
-         char *newUri = 0;
-         char *expandedPath = 0;
-         if (!version)
-         {
-             version = const_cast < char *>("1.0");
-         }
-         document = xmlNewDoc((xmlChar *) version);
-         openDocs.push_back(this);
-         scope->registerPointers(document, this);
-         id = scope->getVariableId(*this);
-         scilabType = XMLDOCUMENT;
+         document = 0;
+         *error = std::string(gettext("Invalid file name: ")) + std::string(path);
+     }
  
-         expandedPath = expandPathVariable(const_cast < char *>(uri));
+     id = scope->getVariableId(*this);
+     scilabType = XMLDOCUMENT;
+ }
  
-         if (expandedPath)
-         {
-             newUri = (char *)xmlMalloc(sizeof(char *) * (strlen(expandedPath) + 1));
-             memcpy(newUri, expandedPath, sizeof(char) * (strlen(expandedPath) + 1));
-             document->URL = (xmlChar *) newUri;
-             FREE(expandedPath);
-         }
+ XMLDocument::XMLDocument(const std::string & xmlCode, bool validate, std::string * error, const char * encoding, const bool html): XMLObject()
+ {
+     if (html)
+     {
+         document = readHTMLDocument(xmlCode, encoding, error);
      }
-     XMLDocument::~XMLDocument()
+     else
      {
-         scope->unregisterPointer(document);
-         scope->removeId(id);
-         if (document)
-         {
-             openDocs.remove(this);
-             if (openDocs.size() == 0 && XMLValidation::getOpenValidationFiles().size() == 0)
-             {
-                 resetScope();
-             }
-             xmlFreeDoc(document);
-         }
+         document = readDocument(xmlCode, encoding, validate, error);
      }
  
-     void *XMLDocument::getRealXMLPointer() const
+     if (document)
      {
-         return static_cast < void *>(document);
+         openDocs.push_back(this);
      }
+     scope->registerPointers(document, this);
+     id = scope->getVariableId(*this);
+     scilabType = XMLDOCUMENT;
+ }
  
-     const XMLXPath *XMLDocument::makeXPathQuery(const char *query, char **namespaces, int length, const XMLElement * e, std::string * error)
+ XMLDocument::XMLDocument(char *uri, char *version): XMLObject()
+ {
+     char *newUri = 0;
+     char *expandedPath = 0;
+     if (!version)
      {
-         errorXPathBuffer.clear();
+         version = const_cast < char *>("1.0");
+     }
+     document = xmlNewDoc((xmlChar *) version);
+     openDocs.push_back(this);
+     scope->registerPointers(document, this);
+     id = scope->getVariableId(*this);
+     scilabType = XMLDOCUMENT;
  
-         xmlXPathContext *ctxt = xmlXPathNewContext(document);
+     expandedPath = expandPathVariable(const_cast < char *>(uri));
  
-         if (!ctxt)
-         {
-             errorXPathBuffer.append(gettext("Cannot create a parser context"));
-             *error = errorXPathBuffer;
-             return 0;
-         }
+     if (expandedPath)
+     {
+         newUri = (char *)xmlMalloc(sizeof(char *) * (strlen(expandedPath) + 1));
+         memcpy(newUri, expandedPath, sizeof(char) * (strlen(expandedPath) + 1));
+         document->URL = (xmlChar *) newUri;
+         FREE(expandedPath);
+     }
+ }
  
-         if (e)
+ XMLDocument::~XMLDocument()
+ {
+     scope->unregisterPointer(document);
+     scope->removeId(id);
+     if (document)
+     {
+         openDocs.remove(this);
+         if (openDocs.size() == 0 && XMLValidation::getOpenValidationFiles().size() == 0)
          {
-             ctxt->node = (xmlNode *) e->getRealXMLPointer();
+             resetScope();
          }
+         xmlFreeDoc(document);
+     }
 -    if (errorBuffer)
 -    {
 -        delete errorBuffer;
 -        errorBuffer = 0;
 -    }
 -    if (errorXPathBuffer)
 -    {
 -        delete errorXPathBuffer;
 -        errorXPathBuffer = 0;
 -    }
  
-         if (namespaces)
+ #ifdef SCILAB_DEBUG_XML
+     for (std::set<XMLObject *>::const_iterator i = XMLObject::pointers.begin(), e = XMLObject::pointers.end(); i != e; ++i)
+     {
+         XMLObject * p = *i;
+         if (p != this)
          {
-             for (int i = 0; i < length; i++)
-             {
-                 xmlXPathRegisterNs(ctxt, (const xmlChar *)namespaces[i], (const xmlChar *)namespaces[i + length]);
-             }
+             std::cout << "Stay = " << (void*)p << ":" << typeid(*p).name() << std::endl;
          }
+     }
+ #endif
+ }
  
-         xmlSetStructuredErrorFunc(ctxt, XMLDocument::errorXPathFunction);
-         xmlXPathCompExpr *expr = xmlXPathCtxtCompile(ctxt, (const xmlChar *)query);
+ void *XMLDocument::getRealXMLPointer() const
+ {
+     return static_cast < void *>(document);
+ }
  
-         if (!expr)
-         {
-             xmlSetStructuredErrorFunc(ctxt, 0);
-             xmlXPathFreeContext(ctxt);
-             *error = errorXPathBuffer;
-             return 0;
-         }
+ const XMLXPath *XMLDocument::makeXPathQuery(const char *query, char **namespaces, int length, const XMLElement * e, std::string * error)
+ {
 -    if (errorXPathBuffer)
 -    {
 -        delete errorXPathBuffer;
 -    }
 -    errorXPathBuffer = new std::string();
++    errorXPathBuffer.clear();
  
-         xmlXPathObject *xpath = xmlXPathCompiledEval(expr, ctxt);
+     xmlXPathContext *ctxt = xmlXPathNewContext(document);
  
-         xmlSetStructuredErrorFunc(ctxt, 0);
-         xmlXPathFreeContext(ctxt);
-         xmlXPathFreeCompExpr(expr);
-         if (!xpath)
+     if (!ctxt)
+     {
 -        errorXPathBuffer->append(gettext("Cannot create a parser context"));
 -        *error = *errorXPathBuffer;
++        errorXPathBuffer.append(gettext("Cannot create a parser context"));
++        *error = errorXPathBuffer;
+         return 0;
+     }
+     if (e)
+     {
+         ctxt->node = (xmlNode *) e->getRealXMLPointer();
+     }
+     if (namespaces)
+     {
+         for (int i = 0; i < length; i++)
          {
-             *error = errorXPathBuffer;
-             return 0;
+             xmlXPathRegisterNs(ctxt, (const xmlChar *)namespaces[i], (const xmlChar *)namespaces[i + length]);
          }
-         return new XMLXPath(*this, xpath);
      }
  
-     const XMLObject *XMLDocument::getXMLObjectParent() const
+     xmlSetStructuredErrorFunc(ctxt, XMLDocument::errorXPathFunction);
+     xmlXPathCompExpr *expr = xmlXPathCtxtCompile(ctxt, (const xmlChar *)query);
+     if (!expr)
      {
+         xmlSetStructuredErrorFunc(ctxt, 0);
+         xmlXPathFreeContext(ctxt);
 -        *error = *errorXPathBuffer;
++        *error = errorXPathBuffer;
          return 0;
      }
  
-     const std::string XMLDocument::toString() const
+     xmlXPathObject *xpath = xmlXPathCompiledEval(expr, ctxt);
+     xmlSetStructuredErrorFunc(ctxt, 0);
+     xmlXPathFreeContext(ctxt);
+     xmlXPathFreeCompExpr(expr);
+     if (!xpath)
      {
-         std::ostringstream oss;
 -        *error = *errorXPathBuffer;
++        *error = errorXPathBuffer;
+         return 0;
+     }
  
-         oss << "XML Document" << std::endl
-             << "url: " << getDocumentURL() << std::endl
-             << "root: " << "XML Element";
+     return new XMLXPath(*this, xpath);
+ }
  
-         return oss.str();
-     }
+ const XMLObject *XMLDocument::getXMLObjectParent() const
+ {
+     return 0;
+ }
  
-     const std::string XMLDocument::dump(bool indent) const
-     {
-         xmlChar *buffer = 0;
-         int size = 0;
-         xmlDocDumpFormatMemory(document, &buffer, &size, indent ? 1 : 0);
-         std::string str((const char *)buffer);
-         xmlFree(buffer);
+ const std::string XMLDocument::toString() const
+ {
+     std::ostringstream oss;
  
-         return str;
-     }
+     oss << "XML Document" << std::endl
+         << "url: " << getDocumentURL() << std::endl
+         << "root: " << "XML Element";
  
-     const std::string XMLDocument::dumpHTML(bool indent) const
-     {
-         xmlBuffer * buffer = xmlBufferCreate();
-         int ret;
-         int options = XML_SAVE_AS_HTML;
-         if (indent)
-         {
-             options |= XML_SAVE_FORMAT;
-         }
+     return oss.str();
+ }
  
-         xmlThrDefIndentTreeOutput(1);
-         xmlSaveCtxtPtr ctxt = xmlSaveToBuffer(buffer, 0, options);
-         ret = xmlSaveDoc(ctxt, document);
-         xmlSaveFlush(ctxt);
-         xmlSaveClose(ctxt);
+ const std::string XMLDocument::dump(bool indent) const
+ {
+     xmlChar *buffer = 0;
+     int size = 0;
+     xmlDocDumpFormatMemory(document, &buffer, &size, indent ? 1 : 0);
+     std::string str((const char *)buffer);
+     xmlFree(buffer);
  
-         std::string str((const char *)xmlBufferDetach(buffer));
-         xmlBufferFree(buffer);
+     return str;
+ }
  
-         return str;
+ const std::string XMLDocument::dumpHTML(bool indent) const
+ {
+     xmlBuffer * buffer = xmlBufferCreate();
+     int ret;
+     int options = XML_SAVE_AS_HTML;
+     if (indent)
+     {
+         options |= XML_SAVE_FORMAT;
      }
  
-     const XMLElement *XMLDocument::getRoot() const
-     {
-         xmlNode *root = xmlDocGetRootElement(document);
-         if (!root)
-         {
-             return 0;
-         }
+     xmlThrDefIndentTreeOutput(1);
+     xmlSaveCtxtPtr ctxt = xmlSaveToBuffer(buffer, 0, options);
+     ret = xmlSaveDoc(ctxt, document);
+     xmlSaveFlush(ctxt);
+     xmlSaveClose(ctxt);
  
-         XMLObject *obj = scope->getXMLObjectFromLibXMLPtr(root);
+     std::string str((const char *)xmlBufferDetach(buffer));
+     xmlBufferFree(buffer);
  
-         if (obj)
-         {
-             return static_cast < XMLElement * >(obj);
-         }
+     return str;
+ }
  
-         return new XMLElement(*this, root);
+ const XMLElement *XMLDocument::getRoot() const
+ {
+     xmlNode *root = xmlDocGetRootElement(document);
+     if (!root)
+     {
+         return 0;
      }
  
-     void XMLDocument::setRoot(const XMLElement & elem) const
+     XMLObject *obj = scope->getXMLObjectFromLibXMLPtr(root);
+     if (obj)
      {
-         xmlNode *root = xmlDocGetRootElement(document);
-         if (root != elem.getRealNode())
-         {
-             xmlNode *cpy = xmlCopyNodeList(elem.getRealNode());
-             xmlUnlinkNode(cpy);
-             xmlDocSetRootElement(document, cpy);
-         }
+         return static_cast < XMLElement * >(obj);
      }
  
-     void XMLDocument::setRoot(const std::string & xmlCode, std::string * error) const
-     {
-         XMLDocument doc = XMLDocument(xmlCode, false, error);
+     return new XMLElement(*this, root);
+ }
  
-         if (error->empty())
-         {
-             setRoot(*doc.getRoot());
-         }
+ void XMLDocument::setRoot(const XMLElement & elem) const
+ {
+     xmlNode *root = xmlDocGetRootElement(document);
+     if (root != elem.getRealNode())
+     {
+         xmlNode *cpy = xmlCopyNodeList(elem.getRealNode());
+         xmlUnlinkNode(cpy);
+         xmlDocSetRootElement(document, cpy);
      }
+ }
  
-     const char *XMLDocument::getDocumentURL() const
+ void XMLDocument::setRoot(const std::string & xmlCode, std::string * error) const
+ {
+     XMLDocument doc = XMLDocument(xmlCode, false, error);
+     if (error->empty())
      {
-         if (document->URL)
-         {
-             return (const char *)document->URL;
-         }
-         else
-         {
-             return "Undefined";
-         }
+         setRoot(*doc.getRoot());
      }
+ }
  
-     void XMLDocument::setDocumentURL(const std::string & url) const
+ const char *XMLDocument::getDocumentURL() const
+ {
+     if (document->URL)
      {
-         char *expandedPath = 0;
-         char *newURL = 0;
-         expandedPath = expandPathVariable(const_cast < char *>(url.c_str()));
-         if (expandedPath)
-         {
-             xmlFree((void *)document->URL);
-             newURL = (char *)xmlMalloc(sizeof(char *) * (strlen(expandedPath) + 1));
-             memcpy(newURL, expandedPath, sizeof(char) * (strlen(expandedPath) + 1));
-             document->URL = (xmlChar *) newURL;
-             FREE(expandedPath);
-         }
+         return (const char *)document->URL;
      }
-     const std::list < XMLDocument * >&XMLDocument::getOpenDocuments()
+     else
      {
-         return openDocs;
+         return "Undefined";
      }
+ }
  
-     void XMLDocument::closeAllDocuments()
-     {
-         int size = (int)openDocs.size();
-         XMLDocument **arr = new XMLDocument *[size];
-         int j = 0;
+ void XMLDocument::setDocumentURL(const std::string & url) const
+ {
+     char *expandedPath = 0;
+     char *newURL = 0;
+     expandedPath = expandPathVariable(const_cast < char *>(url.c_str()));
  
-         for (std::list < XMLDocument * >::iterator i = openDocs.begin(); i != openDocs.end(); i++, j++)
-         {
-             arr[j] = *i;
-         }
-         for (j = 0; j < size; j++)
-         {
-             delete arr[j];
-         }
-         delete[]arr;
+     if (expandedPath)
+     {
+         xmlFree((void *)document->URL);
+         newURL = (char *)xmlMalloc(sizeof(char *) * (strlen(expandedPath) + 1));
+         memcpy(newURL, expandedPath, sizeof(char) * (strlen(expandedPath) + 1));
+         document->URL = (xmlChar *) newURL;
+         FREE(expandedPath);
      }
+ }
  
-     xmlDoc *XMLDocument::readDocument(const char *filename, const char * encoding, bool validate, std::string * error)
-     {
-         xmlParserCtxt *ctxt = initContext(error, validate);
-         xmlDoc *doc = 0;
-         int options = XML_PARSE_NSCLEAN | XML_PARSE_NOBLANKS;
+ const std::list < XMLDocument * >&XMLDocument::getOpenDocuments()
+ {
+     return openDocs;
+ }
  
-         if (validate)
-         {
-             options |= XML_PARSE_DTDVALID;
-         }
+ void XMLDocument::closeAllDocuments()
+ {
+     int size = (int)openDocs.size();
+     XMLDocument **arr = new XMLDocument *[size];
+     int j = 0;
  
-         if (!ctxt)
-         {
-             xmlSetGenericErrorFunc(0, errorFunctionWithoutOutput);
-             return 0;
-         }
+     for (std::list < XMLDocument * >::iterator i = openDocs.begin(); i != openDocs.end(); i++, j++)
+     {
+         arr[j] = *i;
+     }
+     for (j = 0; j < size; j++)
+     {
+         delete arr[j];
+     }
+     delete[]arr;
+ }
  
-         doc = xmlCtxtReadFile(ctxt, filename, encoding, options);
-         if (!doc || !ctxt->valid)
-         {
-             *error = errorBuffer;
-         }
+ xmlDoc *XMLDocument::readDocument(const char *filename, const char * encoding, bool validate, std::string * error)
+ {
+     xmlParserCtxt *ctxt = initContext(error, validate);
+     xmlDoc *doc = 0;
+     int options = XML_PARSE_NSCLEAN | XML_PARSE_NOBLANKS;
  
-         xmlSetGenericErrorFunc(0, errorFunctionWithoutOutput);
-         xmlFreeParserCtxt(ctxt);
+     if (validate)
+     {
+         options |= XML_PARSE_DTDVALID;
+     }
  
-         return doc;
+     if (!ctxt)
+     {
+         xmlSetGenericErrorFunc(0, errorFunctionWithoutOutput);
+         return 0;
      }
  
-     xmlDoc *XMLDocument::readHTMLDocument(const char *filename, const char * encoding, std::string * error)
+     doc = xmlCtxtReadFile(ctxt, filename, encoding, options);
+     if (!doc || !ctxt->valid)
      {
-         htmlParserCtxt *ctxt = initHTMLContext(error);
-         htmlDocPtr doc = 0;
-         int options = HTML_PARSE_NOWARNING | HTML_PARSE_NOBLANKS | HTML_PARSE_COMPACT;
 -        *error = *errorBuffer;
++        *error = errorBuffer;
+     }
  
-         if (!ctxt)
-         {
-             xmlSetGenericErrorFunc(0, errorFunctionWithoutOutput);
-             return 0;
-         }
+     xmlSetGenericErrorFunc(0, errorFunctionWithoutOutput);
+     xmlFreeParserCtxt(ctxt);
  
-         doc = htmlCtxtReadFile(ctxt, filename, encoding, options);
-         if (!doc || !ctxt->valid)
-         {
-             *error = errorBuffer;
-         }
+     return doc;
+ }
  
-         xmlSetGenericErrorFunc(0, errorFunctionWithoutOutput);
-         htmlFreeParserCtxt(ctxt);
+ xmlDoc *XMLDocument::readHTMLDocument(const char *filename, const char * encoding, std::string * error)
+ {
+     htmlParserCtxt *ctxt = initHTMLContext(error);
+     htmlDocPtr doc = 0;
+     int options = HTML_PARSE_NOWARNING | HTML_PARSE_NOBLANKS | HTML_PARSE_COMPACT;
  
-         return (xmlDoc *)doc;
+     if (!ctxt)
+     {
+         xmlSetGenericErrorFunc(0, errorFunctionWithoutOutput);
+         return 0;
      }
  
-     xmlDoc *XMLDocument::readDocument(const std::string & xmlCode, const char * encoding, bool validate, std::string * error)
+     doc = htmlCtxtReadFile(ctxt, filename, encoding, options);
+     if (!doc || !ctxt->valid)
      {
-         xmlParserCtxt *ctxt = initContext(error, validate);
-         xmlDoc *doc = 0;
-         int options = XML_PARSE_NSCLEAN | XML_PARSE_NOBLANKS;
 -        *error = *errorBuffer;
++        *error = errorBuffer;
+     }
  
-         if (validate)
-         {
-             options |= XML_PARSE_DTDVALID;
-         }
+     xmlSetGenericErrorFunc(0, errorFunctionWithoutOutput);
+     htmlFreeParserCtxt(ctxt);
  
-         if (!ctxt)
-         {
-             xmlSetGenericErrorFunc(0, errorFunctionWithoutOutput);
-             return 0;
-         }
+     return (xmlDoc *)doc;
+ }
  
-         doc = xmlCtxtReadDoc(ctxt, (const xmlChar *)xmlCode.c_str(), 0, encoding, options);
-         if (!doc || !ctxt->valid)
-         {
-             *error = errorBuffer;
-         }
+ xmlDoc *XMLDocument::readDocument(const std::string & xmlCode, const char * encoding, bool validate, std::string * error)
+ {
+     xmlParserCtxt *ctxt = initContext(error, validate);
+     xmlDoc *doc = 0;
+     int options = XML_PARSE_NSCLEAN | XML_PARSE_NOBLANKS;
  
-         xmlSetGenericErrorFunc(0, errorFunctionWithoutOutput);
-         xmlFreeParserCtxt(ctxt);
+     if (validate)
+     {
+         options |= XML_PARSE_DTDVALID;
+     }
  
-         return doc;
+     if (!ctxt)
+     {
+         xmlSetGenericErrorFunc(0, errorFunctionWithoutOutput);
+         return 0;
      }
  
-     xmlDoc *XMLDocument::readHTMLDocument(const std::string & htmlCode, const char * encoding, std::string * error)
+     doc = xmlCtxtReadDoc(ctxt, (const xmlChar *)xmlCode.c_str(), 0, encoding, options);
+     if (!doc || !ctxt->valid)
      {
-         htmlParserCtxt *ctxt = initHTMLContext(error);
-         htmlDocPtr doc = 0;
-         int options = HTML_PARSE_NOWARNING | HTML_PARSE_NOBLANKS | HTML_PARSE_COMPACT;
 -        *error = *errorBuffer;
++        *error = errorBuffer;
+     }
  
-         if (!ctxt)
-         {
-             xmlSetGenericErrorFunc(0, errorFunctionWithoutOutput);
-             return 0;
-         }
+     xmlSetGenericErrorFunc(0, errorFunctionWithoutOutput);
+     xmlFreeParserCtxt(ctxt);
  
-         doc = htmlCtxtReadDoc(ctxt, (const xmlChar *)htmlCode.c_str(), 0, encoding, options);
-         if (!doc || !ctxt->valid)
-         {
-             *error = errorBuffer;
-         }
+     return doc;
+ }
  
-         xmlSetGenericErrorFunc(0, errorFunctionWithoutOutput);
-         htmlFreeParserCtxt(ctxt);
+ xmlDoc *XMLDocument::readHTMLDocument(const std::string & htmlCode, const char * encoding, std::string * error)
+ {
+     htmlParserCtxt *ctxt = initHTMLContext(error);
+     htmlDocPtr doc = 0;
+     int options = HTML_PARSE_NOWARNING | HTML_PARSE_NOBLANKS | HTML_PARSE_COMPACT;
  
-         return (xmlDoc *)doc;
+     if (!ctxt)
+     {
+         xmlSetGenericErrorFunc(0, errorFunctionWithoutOutput);
+         return 0;
      }
  
-     bool XMLDocument::saveToFile(const std::string & filename, const bool indent) const
+     doc = htmlCtxtReadDoc(ctxt, (const xmlChar *)htmlCode.c_str(), 0, encoding, options);
+     if (!doc || !ctxt->valid)
      {
-         xmlThrDefIndentTreeOutput(1);
-         return xmlSaveFormatFile(filename.c_str(), document, indent) != -1;
 -        *error = *errorBuffer;
++        *error = errorBuffer;
      }
  
-     bool XMLDocument::saveToHTMLFile(const std::string & filename, const bool indent) const
-     {
-         int ret;
-         int options = XML_SAVE_AS_HTML;
-         if (indent)
-         {
-             options |= XML_SAVE_FORMAT;
-         }
+     xmlSetGenericErrorFunc(0, errorFunctionWithoutOutput);
+     htmlFreeParserCtxt(ctxt);
  
-         xmlThrDefIndentTreeOutput(1);
-         xmlSaveCtxtPtr ctxt = xmlSaveToFilename(filename.c_str(), 0, options);
-         ret = xmlSaveDoc(ctxt, document);
-         xmlSaveFlush(ctxt);
-         xmlSaveClose(ctxt);
+     return (xmlDoc *)doc;
+ }
  
-         return ret != -1;
-     }
+ bool XMLDocument::saveToFile(const std::string & filename, const bool indent) const
+ {
+     xmlThrDefIndentTreeOutput(1);
+     return xmlSaveFormatFile(filename.c_str(), document, indent) != -1;
+ }
  
-     xmlParserCtxt *XMLDocument::initContext(std::string * error, bool validate)
+ bool XMLDocument::saveToHTMLFile(const std::string & filename, const bool indent) const
+ {
+     int ret;
+     int options = XML_SAVE_AS_HTML;
+     if (indent)
      {
-         xmlParserCtxt *ctxt;
+         options |= XML_SAVE_FORMAT;
+     }
  
-         errorBuffer.clear();
+     xmlThrDefIndentTreeOutput(1);
+     xmlSaveCtxtPtr ctxt = xmlSaveToFilename(filename.c_str(), 0, options);
+     ret = xmlSaveDoc(ctxt, document);
+     xmlSaveFlush(ctxt);
+     xmlSaveClose(ctxt);
  
-         ctxt = xmlNewParserCtxt();
-         if (!ctxt)
-         {
-             errorBuffer.append(gettext("Cannot create a parser context"));
-             *error = errorBuffer;
-             return 0;
-         }
+     return ret != -1;
+ }
  
-         if (validate)
-         {
-             ctxt->vctxt.error = (xmlValidityErrorFunc) errorFunction;
-         }
+ xmlParserCtxt *XMLDocument::initContext(std::string * error, bool validate)
+ {
+     xmlParserCtxt *ctxt;
  
-         xmlSetGenericErrorFunc(ctxt, errorFunction);
 -    if (errorBuffer)
 -    {
 -        delete errorBuffer;
 -    }
 -    errorBuffer = new std::string();
++    errorXPathBuffer.clear();
  
-         return ctxt;
+     ctxt = xmlNewParserCtxt();
+     if (!ctxt)
+     {
 -        errorBuffer->append(gettext("Cannot create a parser context"));
 -        *error = *errorBuffer;
++        errorBuffer.append(gettext("Cannot create a parser context"));
++        *error = errorBuffer;
+         return 0;
      }
  
-     htmlParserCtxt *XMLDocument::initHTMLContext(std::string * error)
+     if (validate)
      {
-         htmlParserCtxt *ctxt;
+         ctxt->vctxt.error = (xmlValidityErrorFunc) errorFunction;
+     }
  
-         errorBuffer.clear();
+     xmlSetGenericErrorFunc(ctxt, errorFunction);
  
-         ctxt = htmlNewParserCtxt();
-         if (!ctxt)
-         {
-             errorBuffer.append(gettext("Cannot create a parser context"));
-             *error = errorBuffer;
-             return 0;
-         }
+     return ctxt;
+ }
+ htmlParserCtxt *XMLDocument::initHTMLContext(std::string * error)
+ {
+     htmlParserCtxt *ctxt;
  
-         xmlSetGenericErrorFunc((xmlParserCtxt *)ctxt, errorFunction);
 -    if (errorBuffer)
 -    {
 -        delete errorBuffer;
 -    }
 -    errorBuffer = new std::string();
++    errorXPathBuffer.clear();
  
-         return ctxt;
+     ctxt = htmlNewParserCtxt();
+     if (!ctxt)
+     {
 -        errorBuffer->append(gettext("Cannot create a parser context"));
 -        *error = *errorBuffer;
++        errorBuffer.append(gettext("Cannot create a parser context"));
++        *error = errorBuffer;
+         return 0;
      }
  
-     void XMLDocument::errorFunction(void *ctx, const char *msg, ...)
-     {
-         char str[BUFFER_SIZE];
-         va_list args;
+     xmlSetGenericErrorFunc((xmlParserCtxt *)ctxt, errorFunction);
  
-         va_start(args, msg);
-         vsnprintf(str, BUFFER_SIZE, msg, args);
-         va_end(args);
-         errorBuffer.append(str);
-     }
+     return ctxt;
+ }
  
-     void XMLDocument::errorXPathFunction(void *ctx, xmlError * error)
-     {
-         errorXPathBuffer.append(error->message);
-     }
+ void XMLDocument::errorFunction(void *ctx, const char *msg, ...)
+ {
+     char str[BUFFER_SIZE];
+     va_list args;
+     va_start(args, msg);
+     vsnprintf(str, BUFFER_SIZE, msg, args);
+     va_end(args);
 -    errorBuffer->append(str);
++    errorBuffer.append(str);
  }
  
+ void XMLDocument::errorXPathFunction(void *ctx, xmlError * error)
+ {
 -    errorXPathBuffer->append(error->message);
++    errorXPathBuffer.append(error->message);
+ }
+ }