Exemple #1
0
        public override object Clone()
        {
            if (this.Doc != null)
            {
                return((object)this.Doc.Indirects.New(this.Direct));
            }
            CorePDFIndirect indirect1 = new CorePDFIndirect();

            indirect1.Direct = ((PDFDirect)this.Direct.Clone());
            return(indirect1);
        }
        internal PDFIndirect Insert(CorePDFIndirect ind)
        {
            int         num1;
            XRefEntry   entry2;
            PDFIndirect indirect1;
            XRefEntry   entry1 = ((XRefEntry)this.mDoc.mXRef[0]);

            for (num1 = ((int)entry1.offset); (num1 != 0); num1 = ((int)entry1.offset))
            {
                entry1        = ((XRefEntry)this.mDoc.mXRef[num1]);
                entry2        = ((XRefEntry)this.mDoc.mXRef[num1]);
                entry1.offset = entry2.offset;
                if (entry2.generation < 65535)
                {
                    entry2.dirty = true;
                    entry2.type  = 1;
                    XRefEntry entry3 = entry2;
                    entry2.generation = (entry3.generation + 1);
                    ((XRefEntry)this.mDoc.mXRef[0]).offset = entry2.offset;
                    ind.mId         = num1;
                    indirect1       = ind;
                    entry2.indirect = indirect1;
                    return(indirect1);
                }
            }
            entry1            = new XRefEntry();
            entry1.dirty      = true;
            entry1.type       = 1;
            entry1.generation = 0;
            entry1.offset     = ((long)-1);
            this.mDoc.mXRef.Add(entry1);
            ind.mId         = (this.mDoc.mXRef.Count - 1);
            entry1.indirect = ind;
            if (this.mDoc.mToSaveQueue != null)
            {
                this.mDoc.mToSaveQueue.Enqueue(entry1.indirect);
            }
            this.mCount += 1;
            return(entry1.indirect);
        }