Browse Source

ERR: Use of stream format flags is hard to make portable. Manually implementing justification.

Brad King 23 years ago
parent
commit
7d1ee1d4c8
1 changed files with 6 additions and 6 deletions
  1. 6 6
      Source/cmDocumentation.cxx

+ 6 - 6
Source/cmDocumentation.cxx

@@ -229,15 +229,16 @@ void cmDocumentation::PrintUsageSection(std::ostream& os,
                                         const cmDocumentationEntry* section)
 {
   if(!section) { return; }
-  long flags = static_cast<long>(os.flags());
-  os.setf(flags | std::ios::left);
   for(const cmDocumentationEntry* op = section; op->brief; ++op)
     {
     if(op->name)
       {
-      os << "  ";
-      os.width(25);
-      os << op->name << "= " << op->brief << "\n";
+      os << "  " << op->name;
+      for(int i = static_cast<int>(strlen(op->name)); i < 25; ++i)
+        {
+        os << " ";
+        }
+      os << "= " << op->brief << "\n";
       }
     else
       {
@@ -246,7 +247,6 @@ void cmDocumentation::PrintUsageSection(std::ostream& os,
       os << "\n";
       }
     }  
-  os.setf(flags);
 }
 
 //----------------------------------------------------------------------------