fix test_comment_00 for #103
authorChristopher Dunn <cdunn2001@gmail.com>
Fri, 23 Jan 2015 18:46:10 +0000 (12:46 -0600)
committerChristopher Dunn <cdunn2001@gmail.com>
Fri, 23 Jan 2015 20:28:44 +0000 (14:28 -0600)
src/lib_json/json_writer.cpp

index 467ab82..d8a3046 100644 (file)
@@ -376,6 +376,9 @@ bool StyledWriter::isMultineArray(const Value& value) {
     addChildValues_ = true;
     int lineLength = 4 + (size - 1) * 2; // '[ ' + ', '*n + ' ]'
     for (int index = 0; index < size; ++index) {
+      if (hasCommentForValue(value[index])) {
+        isMultiLine = true;
+      }
       writeValue(value[index]);
       lineLength += int(childValues_[index].length());
     }
@@ -584,6 +587,9 @@ bool StyledStreamWriter::isMultineArray(const Value& value) {
     addChildValues_ = true;
     int lineLength = 4 + (size - 1) * 2; // '[ ' + ', '*n + ' ]'
     for (int index = 0; index < size; ++index) {
+      if (hasCommentForValue(value[index])) {
+        isMultiLine = true;
+      }
       writeValue(value[index]);
       lineLength += int(childValues_[index].length());
     }