Beispiel #1
0
 /// <summary> A copy constructor used for copying ranges between sheets
 ///
 /// </summary>
 /// <param name="c">the range to copy from
 /// </param>
 /// <param name="s">the writable sheet
 /// </param>
 public SheetRangeImpl(SheetRangeImpl c, Sheet s)
 {
     sheet   = s;
     row1    = c.row1;
     row2    = c.row2;
     column1 = c.column1;
     column2 = c.column2;
 }
Beispiel #2
0
        /// <summary> Sees whether there are any intersections between this range and the
        /// range passed in.  This method is used internally by the WritableSheet to
        /// verify the integrity of merged cells, hyperlinks etc.  Ranges are
        /// only ever compared for the same sheet
        ///
        /// </summary>
        /// <param name="range">the range to compare against
        /// </param>
        /// <returns> TRUE if the ranges intersect, FALSE otherwise
        /// </returns>
        public virtual bool intersects(SheetRangeImpl range)
        {
            if (range == this)
            {
                return(true);
            }

            if (row2 < range.row1 || row1 > range.row2 || column2 < range.column1 || column1 > range.column2)
            {
                return(false);
            }

            return(true);
        }
Beispiel #3
0
        /// <summary> Standard equals method
        ///
        /// </summary>
        /// <param name="o">the object to compare
        /// </param>
        /// <returns> TRUE if the two objects are the same, FALSE otherwise
        /// </returns>
        public override bool Equals(System.Object o)
        {
            if (o == this)
            {
                return(true);
            }

            if (!(o is SheetRangeImpl))
            {
                return(false);
            }

            SheetRangeImpl compare = (SheetRangeImpl)o;

            return(column1 == compare.column1 && column2 == compare.column2 && row1 == compare.row1 && row2 == compare.row2);
        }