Beispiel #1
0
        public ListLevel GetLevel(int listID, int level)
        {
            ListData lst = _listMap[listID];

            if (level < lst.numLevels())
            {
                ListLevel lvl = lst.GetLevels()[level];
                return(lvl);
            }
            //log.log(POILogger.WARN, "Requested level " + level + " which was greater than the maximum defined (" + lst.numLevels() + ")");
            return(null);
        }
        public ListFormatOverrideLevel(byte[] buf, int offset)
        {
            _iStartAt = LittleEndian.GetInt(buf, offset);
            offset += LittleEndianConsts.INT_SIZE;
            _info = buf[offset++];
            Array.Copy(buf, offset, _reserved, 0, _reserved.Length);
            offset += _reserved.Length;

            if (_fFormatting.GetValue(_info) > 0)
            {
                _lvl = new ListLevel(buf, offset);
            }
        }
        public ListFormatOverrideLevel(byte[] buf, int offset)
        {
            _iStartAt = LittleEndian.GetInt(buf, offset);
            offset   += LittleEndianConsts.INT_SIZE;
            _info     = buf[offset++];
            Array.Copy(buf, offset, _reserved, 0, _reserved.Length);
            offset += _reserved.Length;

            if (_fFormatting.GetValue(_info) > 0)
            {
                _lvl = new ListLevel(buf, offset);
            }
        }
Beispiel #4
0
        internal ListEntry(PAPX papx, Range parent, ListTables tables)
            : base(papx, parent)
        {

            if (tables != null)
            {
                ListFormatOverride override1 = tables.GetOverride(_props.GetIlfo());
                _overrideLevel = override1.GetOverrideLevel(_props.GetIlvl());
                _level = tables.GetLevel(override1.GetLsid(), _props.GetIlvl());
            }
            else
            {
                //log.log(POILogger.WARN, "No ListTables found for ListEntry - document probably partly corrupt, and you may experience problems");
            }
        }
Beispiel #5
0
        public ListData(int listID, bool numbered)
        {
            _lsid = listID;
            _rgistd = new short[9];

            for (int x = 0; x < 9; x++)
            {
                _rgistd[x] = (short)StyleSheet.NIL_STYLE;
            }

            _levels = new ListLevel[9];

            for (int x = 0; x < _levels.Length; x++)
            {
                _levels[x] = new ListLevel(x, numbered);
            }
        }
Beispiel #6
0
        public ListData(int listID, bool numbered)
        {
            _lsid   = listID;
            _rgistd = new short[9];

            for (int x = 0; x < 9; x++)
            {
                _rgistd[x] = (short)StyleSheet.NIL_STYLE;
            }

            _levels = new ListLevel[9];

            for (int x = 0; x < _levels.Length; x++)
            {
                _levels[x] = new ListLevel(x, numbered);
            }
        }
Beispiel #7
0
        public ListTables(byte[] tableStream, int lstOffset, int lfoOffset)
        {
            // get the list data
            int length = LittleEndian.GetShort(tableStream, lstOffset);

            lstOffset += LittleEndianConsts.SHORT_SIZE;
            int levelOffset = lstOffset + (length * LIST_DATA_SIZE);

            for (int x = 0; x < length; x++)
            {
                ListData lst = new ListData(tableStream, lstOffset);
                _listMap.Add(lst.GetLsid(), lst);
                lstOffset += LIST_DATA_SIZE;

                int num = lst.numLevels();
                for (int y = 0; y < num; y++)
                {
                    ListLevel lvl = new ListLevel(tableStream, levelOffset);
                    lst.SetLevel(y, lvl);
                    levelOffset += lvl.GetSizeInBytes();
                }
            }

            // now get the list format overrides. The size is an int unlike the LST size
            length     = LittleEndian.GetInt(tableStream, lfoOffset);
            lfoOffset += LittleEndianConsts.INT_SIZE;
            int lfolvlOffset = lfoOffset + (LIST_FORMAT_OVERRIDE_SIZE * length);

            for (int x = 0; x < length; x++)
            {
                ListFormatOverride lfo = new ListFormatOverride(tableStream, lfoOffset);
                lfoOffset += LIST_FORMAT_OVERRIDE_SIZE;
                int num = lfo.numOverrides();
                for (int y = 0; y < num; y++)
                {
                    while (tableStream[lfolvlOffset] == 255)
                    {
                        lfolvlOffset++;
                    }
                    ListFormatOverrideLevel lfolvl = new ListFormatOverrideLevel(tableStream, lfolvlOffset);
                    lfo.SetOverride(y, lfolvl);
                    lfolvlOffset += lfolvl.GetSizeInBytes();
                }
                _overrideList.Add(lfo);
            }
        }
Beispiel #8
0
        public ListTables(byte[] tableStream, int lstOffset, int lfoOffset)
        {
            // get the list data
            int length = LittleEndian.GetShort(tableStream, lstOffset);
            lstOffset += LittleEndianConsts.SHORT_SIZE;
            int levelOffset = lstOffset + (length * LIST_DATA_SIZE);

            for (int x = 0; x < length; x++)
            {
                ListData lst = new ListData(tableStream, lstOffset);
                _listMap.Add(lst.GetLsid(), lst);
                lstOffset += LIST_DATA_SIZE;

                int num = lst.numLevels();
                for (int y = 0; y < num; y++)
                {
                    ListLevel lvl = new ListLevel(tableStream, levelOffset);
                    lst.SetLevel(y, lvl);
                    levelOffset += lvl.GetSizeInBytes();
                }
            }

            // now get the list format overrides. The size is an int unlike the LST size
            length = LittleEndian.GetInt(tableStream, lfoOffset);
            lfoOffset += LittleEndianConsts.INT_SIZE;
            int lfolvlOffset = lfoOffset + (LIST_FORMAT_OVERRIDE_SIZE * length);
            for (int x = 0; x < length; x++)
            {
                ListFormatOverride lfo = new ListFormatOverride(tableStream, lfoOffset);
                lfoOffset += LIST_FORMAT_OVERRIDE_SIZE;
                int num = lfo.numOverrides();
                for (int y = 0; y < num; y++)
                {
                    while (tableStream[lfolvlOffset] == 255)
                    {
                        lfolvlOffset++;
                    }
                    ListFormatOverrideLevel lfolvl = new ListFormatOverrideLevel(tableStream, lfolvlOffset);
                    lfo.SetOverride(y, lfolvl);
                    lfolvlOffset += lfolvl.GetSizeInBytes();
                }
                _overrideList.Add(lfo);
            }
        }
Beispiel #9
0
        public override bool Equals(Object obj)
        {
            if (obj == null)
            {
                return(false);
            }

            ListLevel lvl = (ListLevel)obj;

            return(_cbGrpprlChpx == lvl._cbGrpprlChpx && lvl._cbGrpprlPapx == _cbGrpprlPapx &&
                   lvl._dxaIndent == _dxaIndent && lvl._dxaSpace == _dxaSpace &&
                   Arrays.Equals(lvl._grpprlChpx, _grpprlChpx) &&
                   Arrays.Equals(lvl._grpprlPapx, _grpprlPapx) &&
                   lvl._info == _info && lvl._iStartAt == _iStartAt &&
                   lvl._ixchFollow == _ixchFollow && lvl._nfc == _nfc &&
                   Arrays.Equals(lvl._numberText, _numberText) &&
                   Arrays.Equals(lvl._rgbxchNums, _rgbxchNums) &&
                   lvl._reserved == _reserved);
        }
Beispiel #10
0
 public void SetLevel(int index, ListLevel level)
 {
     _levels[index] = level;
 }
Beispiel #11
0
 public void SetLevel(int index, ListLevel level)
 {
     _levels[index] = level;
 }