[haiku-bugs] Re: [Haiku] #7772: [Patch] Deskbar Truncate String Code Cleanup

  • From: "pulkomandy" <trac@xxxxxxxxxxxx>
  • Date: Tue, 01 Nov 2011 10:47:18 -0000

#7772: [Patch] Deskbar Truncate String Code Cleanup
------------------------------------+----------------------------
   Reporter:  jscipione             |      Owner:  axeld
       Type:  enhancement           |     Status:  closed
   Priority:  normal                |  Milestone:  R1
  Component:  Applications/Deskbar  |    Version:  R1/Development
 Resolution:  invalid               |   Keywords:
 Blocked By:                        |   Blocking:
Has a Patch:  1                     |   Platform:  All
------------------------------------+----------------------------
Changes (by pulkomandy):

 * status:  new => closed
 * resolution:   => invalid


Comment:

 This is not correct :
   * Creating a BString object and copying the full label to it costs more
 than mallocing a string. So your change makes the code slower.
   * TruncateLabel does not do the same as TruncateString. It is dedicated
 to menus and may do complex stuff such as ensuring the result is not the
 same as the truncated label from another menu item in the same menu. (even
 if that may not be implemented yet).

 While the TruncateLabel function is a bit unsafe (no control on the buffer
 size), we have no way to fix it without breaking binary compatibility. So
 this will have to wait till R2...

-- 
Ticket URL: <http://dev.haiku-os.org/ticket/7772#comment:4>
Haiku <http://dev.haiku-os.org>
Haiku - the operating system.

Other related posts: