Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#2883 ccrystaltextbuffer + m_aLines.size()

Not Scheduled
open
nobody
GUI (476)
5
2013-03-02
2009-07-23
Matthias
No

this patch is related to "An invalid argument was encountered" Folder/File Compare - ID: 2523133
while deleteing some lines, the size of m_aLines is getting smaller.
After doing a recall or insert, this value remains on that size.
so now in case of closeing or resizing the view it can happen we try to read from a wrong (not more existing position).

Discussion

1 2 3 .. 8 > >> (Page 1 of 8)
  • Matthias
    Matthias
    2009-07-23

    checking the size of m_aLines

     
  • Kimmo Varis
    Kimmo Varis
    2009-07-23

    Explanation sounds good. But the patch does not make sense. Linearray is accessed in lots of places, it can't be that just this one function overflows. If nLine gets wrong then there for sure will be lots of other places that break,

     
  • Matthias
    Matthias
    2009-07-23

    the problem is, we have a diffarry with old content.

    after deleting lines, there will be a vaiable value of items (empty,ghost lines).
    While coloring the value is asked. protecting that is faster than, recalc all.
    Means we have to store (SaveBuffForDiff) and to reload again.

    You can easy check:
    Put a diff at the end of your files, with min 2 lines. store them.
    Now delete one line left or right, then make reize->break.

    the real problem is locationview. Only there it's asking again for m_aLines[nLine].m_dwFlags.

    after more checking I'd fould an other chance.

    Maybe you like that more.

     
  • Matthias
    Matthias
    2009-07-23

    Clear diff list

     
  • Kimmo Varis
    Kimmo Varis
    2009-07-23

    About the first patch: it is very very wrong. You can't check for invalid line index just in one function. What if the code changes later and some other function gets called? We have the bug again. And since we access line array *a lot* we can't make it slower by checking line index in every access.

    The correct fix is to prevent invalid line index from happening.

    About the second patch? Delete diffs after cut operation? Why?

     
  • Matthias
    Matthias
    2009-07-23

    from there we get the wrong value!
    It's needed for coloring the diff.
    so if we delete the diffs, the locationpane will be empty!.
    That must be done after deleting or inserting a line!
    I changed again
    For deleteing it seams tobe ok. For insert I could not find the correct position.
    The problem with inserts only happend, if user press the enter-key and inserts so a new line.

     
  • Matthias
    Matthias
    2009-07-23

    refresh locationpane

     
  • Matthias
    Matthias
    2009-07-23

    include key action del+cut

     
  • Matthias
    Matthias
    2009-07-23

    I don't know if that is the correct place to do that.
    But so it's working with mouse + keyboard.

    The second problem with insert, should be done in seperat patch, as it is a merging problem only.

     
  • Kimmo Varis
    Kimmo Varis
    2009-07-24

    This is totally wrong approach. We won't break whole WinMerge because location pane does something wrong. I'm not interested about this kind of hacks. Especially since it sounds you know the real reason too.

    If I understand correctly the location pane doesn't get synchronized after insert and delete operations? Then we need to find a way to synchronize location pane, not break everything else.

     
1 2 3 .. 8 > >> (Page 1 of 8)