Ejemplo n.º 1
0
        public static SectionProperties UncompressSEP(byte[] grpprl, int offset)
        {
            SectionProperties newProperties = new SectionProperties();

            SprmIterator sprmIt = new SprmIterator(grpprl, offset);

            while (sprmIt.HasNext())
            {
                SprmOperation sprm = (SprmOperation)sprmIt.Next();
                UncompressSEPOperation(newProperties, sprm);
            }

            return newProperties;
        }
Ejemplo n.º 2
0
        internal SprmOperation FindSprm(short opcode)
        {
            int operation = SprmOperation.GetOperationFromOpcode(opcode);
            int type = SprmOperation.GetTypeFromOpcode(opcode);

            SprmIterator si = new SprmIterator(_buf, 2);
            while (si.HasNext())
            {
                SprmOperation i = si.Next();
                if (i.Operation == operation && i.Type == type)
                    return i;
            }
            return null;
        }
Ejemplo n.º 3
0
        public static SectionProperties UncompressSEP(byte[] grpprl, int offset)
        {
            SectionProperties newProperties = new SectionProperties();

            SprmIterator sprmIt = new SprmIterator(grpprl, offset);

            while (sprmIt.HasNext())
            {
                SprmOperation sprm = (SprmOperation)sprmIt.Next();
                UncompressSEPOperation(newProperties, sprm);
            }

            return(newProperties);
        }
Ejemplo n.º 4
0
        public SprmOperation FindSprm(short opcode)
        {
            int operation = SprmOperation.GetOperationFromOpcode(opcode);
            int type      = SprmOperation.GetTypeFromOpcode(opcode);

            SprmIterator si = new SprmIterator(_buf, 2);

            while (si.HasNext())
            {
                SprmOperation i = si.Next();
                if (i.Operation == operation && i.Type == type)
                {
                    return(i);
                }
            }
            return(null);
        }
        public static CharacterProperties UncompressCHP(CharacterProperties parent,
                                                        byte[] grpprl,
                                                        int Offset)
        {
            CharacterProperties newProperties = null;
            newProperties = (CharacterProperties)parent.Clone();

            SprmIterator sprmIt = new SprmIterator(grpprl, Offset);

            while (sprmIt.HasNext())
            {
                SprmOperation sprm = sprmIt.Next();
                UncompressCHPOperation(parent, newProperties, sprm);
            }

            return newProperties;
        }
Ejemplo n.º 6
0
        public static CharacterProperties UncompressCHP(CharacterProperties parent,
                                                        byte[] grpprl,
                                                        int Offset)
        {
            CharacterProperties newProperties = null;

            newProperties = (CharacterProperties)parent.Clone();

            SprmIterator sprmIt = new SprmIterator(grpprl, Offset);

            while (sprmIt.HasNext())
            {
                SprmOperation sprm = sprmIt.Next();
                UncompressCHPOperation(parent, newProperties, sprm);
            }

            return(newProperties);
        }
Ejemplo n.º 7
0
        public static TableProperties UncompressTAP(SprmBuffer sprmBuffer)
        {
            TableProperties tableProperties;

            SprmOperation sprmOperation = sprmBuffer.FindSprm(unchecked ((short)0xd608));

            if (sprmOperation != null)
            {
                byte[] grpprl = sprmOperation.Grpprl;
                int    offset = sprmOperation.GrpprlOffset;
                short  itcMac = grpprl[offset];
                tableProperties = new TableProperties(itcMac);
            }
            else
            {
                //logger.log(POILogger.WARN,
                //        "Some table rows didn't specify number of columns in SPRMs");
                tableProperties = new TableProperties((short)1);
            }

            for (SprmIterator iterator = sprmBuffer.Iterator(); iterator.HasNext();)
            {
                SprmOperation sprm = iterator.Next();

                /*
                 * TAPXs are actually PAPXs so we have to make sure we are only
                 * trying to uncompress the right type of sprm.
                 */
                if (sprm.Type == SprmOperation.TYPE_TAP)
                {
                    try
                    {
                        UncompressTAPOperation(tableProperties, sprm);
                    }
                    catch (IndexOutOfRangeException ex)
                    {
                        //logger.log(POILogger.ERROR, "Unable to apply ", sprm,
                        //        ": ", ex, ex);
                    }
                }
            }
            return(tableProperties);
        }
Ejemplo n.º 8
0
        public static TableProperties UncompressTAP(byte[] grpprl,
                                                        int Offset)
        {
            TableProperties newProperties = new TableProperties();

            SprmIterator sprmIt = new SprmIterator(grpprl, Offset);

            while (sprmIt.HasNext())
            {
                SprmOperation sprm = sprmIt.Next();

                //TAPXs are actually PAPXs so we have to make sure we are only trying to
                //uncompress the right type of sprm.
                if (sprm.Type == SprmOperation.TYPE_TAP)
                {
                    UncompressTAPOperation(newProperties, sprm);
                }
            }

            return newProperties;
        }
Ejemplo n.º 9
0
        public static TableProperties UncompressTAP(byte[] grpprl,
                                                    int Offset)
        {
            TableProperties newProperties = new TableProperties();

            SprmIterator sprmIt = new SprmIterator(grpprl, Offset);

            while (sprmIt.HasNext())
            {
                SprmOperation sprm = sprmIt.Next();

                //TAPXs are actually PAPXs so we have to make sure we are only trying to
                //uncompress the right type of sprm.
                if (sprm.Type == SprmOperation.TYPE_TAP)
                {
                    UncompressTAPOperation(newProperties, sprm);
                }
            }

            return(newProperties);
        }
Ejemplo n.º 10
0
        public static ParagraphProperties UncompressPAP(ParagraphProperties parent,
                                                        byte[] grpprl,
                                                        int Offset)
        {
            ParagraphProperties newProperties = null;
            newProperties = (ParagraphProperties)parent.Clone();

            SprmIterator sprmIt = new SprmIterator(grpprl, Offset);

            while (sprmIt.HasNext())
            {
                SprmOperation sprm = sprmIt.Next();

                // PAPXs can contain table sprms if the paragraph marks the end of a
                // table row
                if (sprm.Type == SprmOperation.TYPE_PAP)
                {
                    UncompressPAPOperation(newProperties, sprm);
                }
            }

            return newProperties;
        }
Ejemplo n.º 11
0
        public static ParagraphProperties UncompressPAP(ParagraphProperties parent,
                                                        byte[] grpprl,
                                                        int Offset)
        {
            ParagraphProperties newProperties = null;

            newProperties = (ParagraphProperties)parent.Clone();

            SprmIterator sprmIt = new SprmIterator(grpprl, Offset);

            while (sprmIt.HasNext())
            {
                SprmOperation sprm = sprmIt.Next();

                // PAPXs can contain table sprms if the paragraph marks the end of a
                // table row
                if (sprm.Type == SprmOperation.TYPE_PAP)
                {
                    UncompressPAPOperation(newProperties, sprm);
                }
            }

            return(newProperties);
        }