]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
face lifting of the text output
authorhartmann <hartmann@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 17 Mar 2000 16:26:20 +0000 (16:26 +0000)
committerhartmann <hartmann@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 17 Mar 2000 16:26:20 +0000 (16:26 +0000)
git-svn-id: https://svn.dealii.org/trunk@2594 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/base/source/table_handler.cc

index 6b2eea8517dffce315c3c4b15a016d986aac0c27..d34fa35820ebaa6fe6aa4c267a79c660bc79fbb5 100644 (file)
@@ -215,18 +215,43 @@ void TableHandler::write_text(ostream &out) const
   for (unsigned int j=0; j<column_order.size(); ++j)
     {
       string key=column_order[j];
+      unsigned int column_string_size=0;
+
       const map<string, vector<string> >::const_iterator 
        super_iter=supercolumns.find(key);
 
-      unsigned int max_string_size=6;
-      if (super_iter!=supercolumns.end())
-       max_string_size+=8*(super_iter->second.size()-1);
+                                     
+      if (super_iter!=supercolumns.end())   // if supercolumn
+       {
+         vector<string>::const_iterator col_key=super_iter->second.begin();
+         for (;col_key!=super_iter->second.end(); ++col_key)
+           {
+             const map<string, Column>::const_iterator
+               col_iter=columns.find(*col_key);
+             if (col_iter->second.scientific &&
+                 col_iter->second.precision>1)
+               column_string_size+=16;
+             else
+               column_string_size+=8;
+           }
+       }
+      else
+       {
+         const map<string, Column>::const_iterator
+               col_iter=columns.find(key);
+         if (col_iter->second.scientific &&
+             col_iter->second.precision>1)
+           column_string_size=16;
+         else
+           column_string_size=8;
+       }
+      column_string_size-=1;
        
-      if (key.size()>max_string_size)
-       key.erase(max_string_size);
+      if (key.size()>column_string_size)
+       key.erase(column_string_size);
       
       out.setf(ios::left);
-      out << setw(max_string_size)
+      out << setw(column_string_size)
 //       << setfill('*') 
          << key.c_str() << "\t";
     }

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.