Ejemplo n.º 1
0
        public void Bug47737()
        {
            XSSFWorkbook wb = XSSFTestDataSamples.OpenSampleWorkbook("47737.xlsx");

            Assert.AreEqual(2, wb.NumberOfNames);
            Assert.IsNotNull(wb.GetCalculationChain());

            XSSFName nm0 = (XSSFName)wb.GetNameAt(0);

            Assert.IsTrue(nm0.GetCTName().IsSetLocalSheetId());
            Assert.AreEqual(0u, nm0.GetCTName().localSheetId);

            XSSFName nm1 = (XSSFName)wb.GetNameAt(1);

            Assert.IsTrue(nm1.GetCTName().IsSetLocalSheetId());
            Assert.AreEqual(1u, nm1.GetCTName().localSheetId);

            wb.RemoveSheetAt(0);
            Assert.AreEqual(1, wb.NumberOfNames);
            XSSFName nm2 = (XSSFName)wb.GetNameAt(0);

            Assert.IsTrue(nm2.GetCTName().IsSetLocalSheetId());
            Assert.AreEqual(0u, nm2.GetCTName().localSheetId);
            //calculation chain is Removed as well
            Assert.IsNull(wb.GetCalculationChain());
        }
Ejemplo n.º 2
0
        /**
         * Compares this name to the specified object.
         * The result is <code>true</code> if the argument is XSSFName and the
         * underlying CTDefinedName bean Equals to the CTDefinedName representing this name
         *
         * @param   o   the object to compare this <code>XSSFName</code> against.
         * @return  <code>true</code> if the <code>XSSFName </code>are Equal;
         *          <code>false</code> otherwise.
         */

        public override bool Equals(Object o)
        {
            if (o == this)
            {
                return(true);
            }

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

            XSSFName cf = (XSSFName)o;

            return(_ctName.name == cf.GetCTName().name&& _ctName.localSheetId == cf.GetCTName().localSheetId);
        }
Ejemplo n.º 3
0
 public Name(IName name, int index, IFormulaParsingWorkbook fpBook)
 {
     _nameRecord = (XSSFName)name;
     _index      = index;
     _fpBook     = fpBook;
 }