History log of /haiku/headers/private/interface/truncate_string.h
Revision Date Author Comments
# 5bc9fb9d 01-Feb-2010 Michael Lotz <mmlr@mlotz.ch>

* Replace the truncate_string() helper function with a new, simplified version.
* Remove no longer necessary support functions.
* The new version uses a single BString as input/output parameter and only
modifies that one by removing non-fitting chars and inserting the ellipsis
where appropriate, so avoids copying around bytes/chars/strings in a few
places. It uses the new Chars functions of BString so also no need for manual
multibyte handling.
* Adjusted the BFont and ServerFont usage of truncate_string() which are both
simplified by using the single BString. It avoids a lot of temprary
allocations and string copying. The char * version of BFont
GetTruncatedStrings() now uses the BString version and not the other way
around anymore which requires us to allocate temporary BString objects, it's
not worse than before though.
* This fixes a bunch of problems with the previous functions like always
prepending the ellipsis for B_TRUNCATE_BEGINNING, crashing on short enough
widths, violating the width in the B_TRUNCATE_END case when the width was
short enough, non-optimal truncation in a few cases and sometimes truncation
where none would've been needed. Also fixes #4128 which was a symptom of the
broken B_TRUNCATE_BEGINNING.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35381 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 59345e26 03-Jun-2005 Stephan Aßmus <superstippi@gmx.de>

huge cleanup, support for SetSizeLimits, support for truncating strings, numerous decorator bug fixes, Layer does not draw when view color is B_TRANSPARENT_COLOR, cleaner dispatching of mouse events to the WinBorder in RootLayer, commented the char map selection in the font server, as it seems glyph lookup by unicode index works much better with the default map

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12945 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 5bc9fb9d241a00edec39ef04479d90b61dba7995 01-Feb-2010 Michael Lotz <mmlr@mlotz.ch>

* Replace the truncate_string() helper function with a new, simplified version.
* Remove no longer necessary support functions.
* The new version uses a single BString as input/output parameter and only
modifies that one by removing non-fitting chars and inserting the ellipsis
where appropriate, so avoids copying around bytes/chars/strings in a few
places. It uses the new Chars functions of BString so also no need for manual
multibyte handling.
* Adjusted the BFont and ServerFont usage of truncate_string() which are both
simplified by using the single BString. It avoids a lot of temprary
allocations and string copying. The char * version of BFont
GetTruncatedStrings() now uses the BString version and not the other way
around anymore which requires us to allocate temporary BString objects, it's
not worse than before though.
* This fixes a bunch of problems with the previous functions like always
prepending the ellipsis for B_TRUNCATE_BEGINNING, crashing on short enough
widths, violating the width in the B_TRUNCATE_END case when the width was
short enough, non-optimal truncation in a few cases and sometimes truncation
where none would've been needed. Also fixes #4128 which was a symptom of the
broken B_TRUNCATE_BEGINNING.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35381 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 59345e264fccac812b03a49a1e4466f10133a309 03-Jun-2005 Stephan Aßmus <superstippi@gmx.de>

huge cleanup, support for SetSizeLimits, support for truncating strings, numerous decorator bug fixes, Layer does not draw when view color is B_TRANSPARENT_COLOR, cleaner dispatching of mouse events to the WinBorder in RootLayer, commented the char map selection in the font server, as it seems glyph lookup by unicode index works much better with the default map

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12945 a95241bf-73f2-0310-859d-f6bbb57e9c96