Index: Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_console.cc
===================================================================
--- Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_console.cc	(revision 417)
+++ Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_console.cc	(revision 427)
@@ -13,46 +13,38 @@
 
 
-GWt_console::GWt_console()
-:WContainerWidget()
+GWt_console::GWt_console() : WContainerWidget()
 {
-    setObjectName("console");
+  setObjectName("console");
 
-
-    // la ligne de search
-    Wt::WContainerWidget *searchContainer = new Wt::WContainerWidget();
+  // la ligne de search
+  Wt::WContainerWidget *searchContainer = new Wt::WContainerWidget();
     
-    Wt::WLabel *label = new Wt::WLabel("Search ", searchContainer);
-    searchLineEdit_ = new Wt::WLineEdit("", searchContainer);
-    searchLineEdit_->setToolTip("clic here to search a string in the output");
+  Wt::WLabel *label = new Wt::WLabel("Search ", searchContainer);
+  searchLineEdit_ = new Wt::WLineEdit("", searchContainer);
+  searchLineEdit_->setToolTip("clic here to search a string in the output");
     
-    // le panel
-    WPanel *panelConsole = new WPanel(this);
-    panelConsole->setTitle(" output");
-
-    WScrollArea* scrollContainer = new  WScrollArea();
-    
-
-    outputCurrent_ = new WText(this);
-    outputCurrent_->setTextFormat(Wt::XHTMLText);
-    outputCurrent_->setInline(false);
-    outputCurrent_->setMaximumSize(750,400);
-
-    scrollContainer->setWidget(outputCurrent_);
-    scrollContainer->setStyleClass("scrollConsole");
-
-    Wt::WContainerWidget *panelContainer = new Wt::WContainerWidget();
-    Wt::WVBoxLayout* vContainerLayout = new Wt::WVBoxLayout();
-
-    vContainerLayout->addWidget(searchContainer);
-    vContainerLayout->addWidget(scrollContainer);
-
-
-    panelContainer->setLayout(vContainerLayout);
-    panelConsole->setCentralWidget(panelContainer);
-
-    // signals
-    searchLineEdit_->keyWentUp ().connect(this, &GWt_console::searchFilter);
+  // le panel
+  WPanel *panelConsole = new WPanel(this);
+  panelConsole->setTitle(" output");
+  
+  WScrollArea* scrollContainer = new WScrollArea();
+  
+  outputCurrent_ = new WText(this);
+  outputCurrent_->setTextFormat(Wt::XHTMLText);
+  outputCurrent_->setInline(false);
+  outputCurrent_->setMaximumSize(750,400);
+  scrollContainer->setWidget(outputCurrent_);
+  scrollContainer->setStyleClass("scrollConsole");
+  
+  Wt::WContainerWidget *panelContainer = new Wt::WContainerWidget();
+  Wt::WVBoxLayout* vContainerLayout = new Wt::WVBoxLayout();
+  vContainerLayout->addWidget(searchContainer);
+  vContainerLayout->addWidget(scrollContainer);
+  panelContainer->setLayout(vContainerLayout);
+  panelConsole->setCentralWidget(panelContainer);
+  
+  // signals
+  searchLineEdit_->keyWentUp ().connect(this,&GWt_console::searchFilter);
 }
-
 
 GWt_console::~GWt_console()
@@ -60,64 +52,63 @@
 }
 
-
 void GWt_console::searchFilter() {
-
-    std::string br = "<br />";
+  
+  std::string br = "<br />";
+  
+  std::string txt = searchLineEdit_->text().toUTF8 ();
+  if (searchLineEdit_->text() == "") {
+    outputCurrent_->setText(outputOriginal_);
+    outputCurrent_->setTextFormat(Wt::XHTMLText);
+    return;
+  }
+  
+  std::string outputStr = outputOriginal_.toUTF8();
+  std::string outputFinal = "";
+  
+  // look for lines that contains the seacrh string
+  bool end = false;
+  int nextPos = 0;
+  int nextPosTxt = 0;
+  int lineNumber = 0;
+  std::string beginStr;
+  std::string endStr;
+  
+  // loop on all lines
+  while (end == false) {
+    lineNumber++;
     
-    std::string txt = searchLineEdit_->text().toUTF8 ();
-    if (searchLineEdit_->text() == "") {
-        outputCurrent_->setText(outputOriginal_);
-        outputCurrent_->setTextFormat(Wt::XHTMLText);
-        return;
-    }
+    nextPos = outputStr.find(br);
     
-    std::string outputStr = outputOriginal_.toUTF8();
-    std::string outputFinal = "";
-    
-    // look for lines that contains the seacrh string
-    bool end = false;
-    int nextPos = 0;
-    int nextPosTxt = 0;
-    int lineNumber = 0;
-    std::string beginStr;
-    std::string endStr;
-    
-    // loop on all lines
-    while (end == false) {
-        lineNumber++;
+    // if this line contains the token
+    if (nextPos != std::string::npos) {
+      beginStr = outputStr.substr(0,nextPos);
+      endStr = outputStr.substr(nextPos+br.size());
+      outputStr = endStr;
+      
+      
+      // colorize for all token
+      bool lineEnd = false;
+      std::string colorizeTxt = "";
+      while (lineEnd == false) {
+	nextPosTxt = beginStr.find(txt);
         
-        nextPos = outputStr.find(br);
-        
-        // if this line contains the token
-        if (nextPos != std::string::npos) {
-            beginStr = outputStr.substr(0,nextPos);
-            endStr = outputStr.substr(nextPos+br.size());
-            outputStr = endStr;
-
-
-            // colorize for all token
-            bool lineEnd = false;
-            std::string colorizeTxt = "";
-            while (lineEnd == false) {
-                nextPosTxt = beginStr.find(txt);
-                
-                if (nextPosTxt != std::string::npos) {
-                    colorizeTxt += beginStr.substr(0,nextPosTxt)+
-                    std::string("<b><font style='background-color:yellow;'>")+
-                    txt+
-                    std::string("</font></b>");
-                    beginStr = beginStr.substr(nextPosTxt+txt.size());
-                    
-                } else if (colorizeTxt != "") {
-                    colorizeTxt += beginStr;
-                    lineEnd = true;
-                } else {
-                    lineEnd = true;
-                }
-            }
-            if (colorizeTxt != "") {
-                std::stringstream ss;
-                ss << lineNumber;
-                outputFinal += std::string("<font color='gray'>line ")+ss.str()+" : </font>"+colorizeTxt+br;
+	if (nextPosTxt != std::string::npos) {
+	  colorizeTxt += beginStr.substr(0,nextPosTxt)+
+	    std::string("<b><font style='background-color:yellow;'>")+
+	    txt+
+	    std::string("</font></b>");
+	  beginStr = beginStr.substr(nextPosTxt+txt.size());
+          
+	} else if (colorizeTxt != "") {
+	  colorizeTxt += beginStr;
+	  lineEnd = true;
+	} else {
+	  lineEnd = true;
+	}
+      }
+      if (colorizeTxt != "") {
+	std::stringstream ss;
+	ss << lineNumber;
+	outputFinal += std::string("<font color='gray'>line ")+ss.str()+" : </font>"+colorizeTxt+br;
             }
         } else {
@@ -133,16 +124,16 @@
 
 void GWt_console::addConsoleMessage(WString msg) {
-    
-    // changes specials caracters
-    outputOriginal_ += Wt::Utils::htmlEncode (msg.toUTF8(),  Wt::Utils::EncodeNewLines);
-
-    // apply filter, will modify outputCurrent
-    searchFilter();
-    /*
-     * Little javascript trick to make sure we scroll along with new content
-     */
-    wApp->doJavaScript(outputCurrent_->jsRef() + ".scrollTop += "
-                       + outputCurrent_->jsRef() + ".scrollHeight;");
-    
+  
+  // changes specials caracters
+  outputOriginal_ += Wt::Utils::htmlEncode (msg.toUTF8(),  Wt::Utils::EncodeNewLines);
+  
+  // apply filter, will modify outputCurrent
+  searchFilter();
+  /*
+   * Little javascript trick to make sure we scroll along with new content
+   */
+  wApp->doJavaScript(outputCurrent_->jsRef() + ".scrollTop += "
+		     + outputCurrent_->jsRef() + ".scrollHeight;");
+  
 }
 
