[zypp-commit] r10223 - /trunk/zypper/src/zypper-tabulator.cc
Author: jkupec Date: Mon May 26 14:31:49 2008 New Revision: 10223 URL: http://svn.opensuse.org/viewcvs/zypp?rev=10223&view=rev Log: - fixed layout of tables when the text contains special characters (bnc #393723) Modified: trunk/zypper/src/zypper-tabulator.cc Modified: trunk/zypper/src/zypper-tabulator.cc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/zypper-tabulator.cc?rev=10223&r1=10222&r2=10223&view=diff ============================================================================== --- trunk/zypper/src/zypper-tabulator.cc (original) +++ trunk/zypper/src/zypper-tabulator.cc Mon May 26 14:31:49 2008 @@ -95,6 +95,7 @@ TableStyle st) const { const char * vline = lines[st][0]; + unsigned int ssize = 0; // string size in columns bool seen_first = false; container::const_iterator i = _columns.begin (), @@ -111,12 +112,13 @@ // stream.width (widths[c]); // that does not work with multibyte chars const string & s = *i; - if (s.size() > widths[c]) - stream << (s.substr(0, widths[c] - 2) + "->"); + ssize = string_to_columns (s); + if (ssize > widths[c]) + stream << (s.substr(0, widths[c] - 2) + "->"); //! \todo FIXME cut at the correct place else { stream << s; - stream.width (widths[c] - string_to_columns (s)); + stream.width (widths[c] - ssize); } stream << ""; } -- To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org For additional commands, e-mail: zypp-commit+help@opensuse.org
participants (1)
-
jkupec@svn.opensuse.org