Exemple #1
0
        /**
         * Gets the section at index. The index is relative to this range.
         *
         * @param index
         *            The index of the section to Get.
         * @return The section at the specified index in this range.
         */
        public Section GetSection(int index)
        {
            InitSections();
            SEPX    sepx = _sections[index + _sectionStart];
            Section sep  = new Section(sepx, this);

            return(sep);
        }
Exemple #2
0
        public void Delete()
        {
            InitAll();

            int numSections   = _sections.Count;
            int numRuns       = _characters.Count;
            int numParagraphs = _paragraphs.Count;

            for (int x = _charStart; x < numRuns; x++)
            {
                CHPX chpx = _characters[x];
                chpx.AdjustForDelete(_start, _end - _start);
            }

            for (int x = _parStart; x < numParagraphs; x++)
            {
                PAPX papx = _paragraphs[x];
                // System.err.println("Paragraph " + x + " was " + papx.Start +
                // " -> " + papx.End);
                papx.AdjustForDelete(_start, _end - _start);
                // System.err.println("Paragraph " + x + " is now " +
                // papx.Start + " -> " + papx.End);
            }

            for (int x = _sectionStart; x < numSections; x++)
            {
                SEPX sepx = _sections[x];
                // System.err.println("Section " + x + " was " + sepx.Start +
                // " -> " + sepx.End);
                sepx.AdjustForDelete(_start, _end - _start);
                // System.err.println("Section " + x + " is now " + sepx.Start
                // + " -> " + sepx.End);
            }
            _text = _text.Remove(_start, _end - _start);
            Range parent = _parent;

            if (parent != null)
            {
                parent.AdjustForInsert(-(_end - _start));
            }
            // update the FIB.CCPText + friends field
            AdjustFIB(-(_end - _start));
        }
Exemple #3
0
 public Section(SEPX sepx, Range parent)
     : base(Math.Max(parent._start, sepx.Start), Math.Min(parent._end, sepx.End), parent)
 {
     _props = sepx.GetSectionProperties();
 }