[haiku-bugs] Re: [Haiku] #11132: BTextView::GetText is broken

  • From: "waddlesplash" <trac@xxxxxxxxxxxx>
  • Date: Thu, 14 Aug 2014 20:47:16 -0000

#11132: BTextView::GetText is broken
----------------------------------+----------------------------
   Reporter:  waddlesplash        |      Owner:  axeld
       Type:  bug                 |     Status:  new
   Priority:  normal              |  Milestone:  R1
  Component:  Kits/Interface Kit  |    Version:  R1/Development
 Resolution:                      |   Keywords:
 Blocked By:                      |   Blocking:
Has a Patch:  0                   |   Platform:  All
----------------------------------+----------------------------

Comment (by waddlesplash):

 OK, first dissection:

 
[http://grok.bikemonkey.org/source/xref/haiku/src/kits/interface/TextView.cpp#GetText
 BTextView::GetText] calls
 
[http://grok.bikemonkey.org/source/xref/haiku/src/kits/interface/textview_support/TextGapBuffer.cpp#250
 the second prototype of TextGapBuffer::GetString]^1^ which does some
 simple math to figure out where to {{{memcpy}}} to/from. Meanwile,
 
[http://grok.bikemonkey.org/source/xref/haiku/src/kits/interface/textview_support/TextGapBuffer.cpp#134
 the first prototype of TextGapBuffer::GetString] also takes
 {{{fGapCount}}} and {{{fGapIndex}}} into account, and while I wasn't
 dealing with styled text here I don't think that's the case, the logic
 differences between the two don't feel right.


 '''1:''' Why do we have two prototypes of {{{TextGapBuffer::GetString}}}?
 Due to the differences listed here I think some effort should be made to
 combine the two.

--
Ticket URL: <https://dev.haiku-os.org/ticket/11132#comment:2>
Haiku <https://dev.haiku-os.org>
Haiku - the operating system.

Other related posts: