Пример #1
0
        internal static void ArrangeSharedFormulas(TParsedTokenList Data, int Row, int Col, bool FromBiff8)
        {
            Data.ResetPositionToLast();
            while (!Data.Bof())
            {
                TBaseParsedToken r = Data.LightPop();

                switch (r.GetBaseId)
                {
                case ptg.RefN:
                case ptg.AreaN:
                    Data.UnShare(Row, Col, FromBiff8);
                    break;
                }
            }
        }
Пример #2
0
        internal static bool HasExternRefs(TParsedTokenList Data)
        {
            Data.ResetPositionToLast();
            while (!Data.Bof())
            {
                TBaseParsedToken r = Data.LightPop();
                ptg id             = r.GetBaseId;
                // This check is a little simplistic because an Area3d or Ref3d might in fact refer to the same sheet. But then, the externsheet is not copied so
                // the reference will be invalid anyway. The "right" thing to do would be to convert external refs to the same sheet to external refs on the new sheet.
                if (id == ptg.Area3d || id == ptg.Ref3d || id == ptg.NameX)
                {
                    return(true);
                }
            }

            return(false);
        }
Пример #3
0
        internal static void UpdateDeletedRanges(TParsedTokenList Data, TDeletedRanges DeletedRanges)
        {
            Data.ResetPositionToLast();
            while (!Data.Bof())
            {
                TBaseParsedToken   tk = Data.LightPop();
                TBaseFunctionToken ft = tk as TBaseFunctionToken;
                if (ft != null)
                {
                    //we need to ensure we don't delete the used _xlfn. ranges. Used def fn don't need to check, because they use the name in the tokenlist.
                    if (ft.GetFunctionData().FutureInXls)
                    {
                        int NameId = DeletedRanges.Names.GetNamePos(-1, ft.GetFunctionData().FutureName);
                        if (NameId >= 0)
                        {
                            DeletedRanges.Reference(NameId);              //No need for recursion here, this name can't use anything else. Also, we don't need to update refs to this range.
                        }
                    }

                    continue;
                }

                TNameToken r = tk as TNameToken; //this includes namex
                if (r == null)
                {
                    continue;
                }
                if (r.GetBaseId == ptg.NameX && !DeletedRanges.References.IsLocalSheet(r.ExternSheet))
                {
                    return;                                                                                     //This name does not point to a name in the NAME table.
                }
                if (DeletedRanges.Update)
                {
                    UpdateRange(r, DeletedRanges);
                }
                else
                {
                    FindReferences(r, DeletedRanges);
                }
            }
        }
Пример #4
0
        internal static bool HasExternLinks(TParsedTokenList Data, TReferences References)
        {
            Data.ResetPositionToLast();
            while (!Data.Bof())
            {
                TBaseParsedToken r = Data.LightPop();
                ptg id             = r.GetBaseId;

                if (id == ptg.Area3d || id == ptg.Ref3d || id == ptg.NameX)
                {
                    if (References != null)
                    {
                        int ExternSheet = r.ExternSheet;
                        if (!References.IsLocalSheet(ExternSheet))
                        {
                            return(true);
                        }
                    }
                }
            }

            return(false);
        }