Пример #1
0
        private static void FindReferences(TNameToken r, TDeletedRanges DeletedRanges)
        {
            int NameId = r.NameIndex - 1;

            if (NameId < 0 || NameId >= DeletedRanges.Count)
            {
                return;
            }
            if (DeletedRanges.Referenced(NameId))
            {
                return;                                   //Avoid infinite loop if one range refers to other and vice versa.
            }
            DeletedRanges.Reference(NameId);

            //We also need to recursively find all other names referenced by this name.
            TNameRecord Name = DeletedRanges.Names[NameId];

            Name.UpdateDeletedRanges(DeletedRanges);
        }
Пример #2
0
        internal void UpdateDeletedRanges(int SheetIndex, int SheetCount, TDeletedRanges DeletedRanges)
        {
            if (Name == null)
            {
                return;
            }
            int sheet     = -1;
            int NameIndex = DeletedRanges.Names.GetNamePos(sheet, Name);

            if (NameIndex < 0)
            {
                return;
            }
            if (DeletedRanges.Update)
            {
                //Nothing to do here, as we save the name string, not position
            }
            else
            {
                TNameRecord NameRec = DeletedRanges.Names[NameIndex];
                DeletedRanges.Reference(NameIndex);
                NameRec.UpdateDeletedRanges(DeletedRanges);
            }
        }