From d79b1b6a48dfaf2cfe28336029baf660f6bf951d Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Fri, 15 Apr 2005 19:36:47 +0000 Subject: (format): [1178223] Don't truncate to max_width in the case of outputting balances. --- format.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/format.cc b/format.cc index 2e437cfd..bfe20998 100644 --- a/format.cc +++ b/format.cc @@ -248,6 +248,7 @@ void format_t::format(std::ostream& out_str, const details_t& details) const { for (const element_t * elem = elements; elem; elem = elem->next) { std::ostringstream out; + bool ignore_max_width = false; if (elem->align_left) out << std::left; @@ -302,6 +303,7 @@ void format_t::format(std::ostream& out_str, const details_t& details) const bal->write(out, elem->min_width, (elem->max_width > 0 ? elem->max_width : elem->min_width)); + ignore_max_width = true; break; default: assert(0); @@ -492,7 +494,8 @@ void format_t::format(std::ostream& out_str, const details_t& details) const } std::string temp = out.str(); - if (elem->max_width > 0 && elem->max_width < temp.length()) + if (! ignore_max_width && + elem->max_width > 0 && elem->max_width < temp.length()) temp.erase(elem->max_width); out_str << temp; } -- cgit v1.2.3