Esempio n. 1
0
 public virtual ITEMPOSITION TrackRow(int absRow, ref POSITIONCACHE cache)
 {
     TrackRowIgnoreOffsets(absRow, ref cache);
     return cache.Position;
 }
Esempio n. 2
0
 public override sealed ITEMPOSITION TrackRow(int absRow, ref POSITIONCACHE cache)
 {
     // UNDONE_CACHE: Never got this right in the prototype, work out later.
     // May want to switch to an array of caches (one per column)
     return TrackRow(absRow);
 }
Esempio n. 3
0
            // This does not need a return value. cache.Position can always be
            // considered the return value. This does not necessarily apply to
            // TrackRows, where the position cache can apply to one level only.
            public void TrackRowIgnoreOffsets(int absRow, ref POSITIONCACHE cache)
            {
                cache.Position = TrackRowIgnoreOffsets(absRow);
                if (absRow != cache.LastAbsolute)
                {
                    if (cache.LastAbsolute != VirtualTreeConstant.NullIndex)
                    {
                        var lastParentAbsolute = cache.Position.ParentAbsolute;
                        var lastLevel = cache.Position.Level;
                        var lastParent = cache.Position.ParentNode;

                        if ((lastParentAbsolute == VirtualTreeConstant.NullIndex)
                            ||
                            (lastParentAbsolute < absRow &&
                             absRow < lastParentAbsolute + lastParent.FullCount))
                        {
                            cache.Position = lastParent.TrackRowIgnoreOffsets(absRow - lastParentAbsolute - 1);
                            // UNDONE_CACHE: Verify next two lines
                            cache.Position.Level += lastLevel;
                            cache.Position.ParentAbsolute += lastParentAbsolute + 1;
                        }
                        else
                        {
                            cache.Position = TrackRowIgnoreOffsets(absRow);
                        }
                    }
                    else
                    {
                        cache.Position = TrackRowIgnoreOffsets(absRow);
                    }
                    cache.LastAbsolute = absRow;
                }
            }