Esempio n. 1
0
        public void InsertVerseNumber_AtTitle()
        {
            CheckDisposed();
            IVwRootBox rootBox = m_draftView.RootBox;

            rootBox.MakeSimpleSel(true, true, false, true);
            IVwSelection sel = m_draftView.TeEditingHelper.CurrentSelection.Selection;
            int          tag;
            int          hvoSel;

            m_draftView.TeEditingHelper.GetSelectedScrElement(out tag, out hvoSel);
            Assert.AreEqual((int)ScrBook.ScrBookTags.kflidTitle, tag,
                            "First para in view was not a Title");
            ITsString tss;
            int       ich;
            bool      fAssocPrev;
            int       hvoObj;
            int       enc;

            sel.TextSelInfo(true, out tss, out ich, out fAssocPrev, out hvoObj, out tag, out enc);
            string str = tss.Text;

            m_draftView.InsertVerseNumber();
            // may destroy or move selection? Make another one to be sure.
            rootBox.MakeSimpleSel(true, true, false, true);
            sel = m_draftView.TeEditingHelper.CurrentSelection.Selection;
            sel.TextSelInfo(true, out tss, out ich, out fAssocPrev, out hvoObj, out tag, out enc);
            string str2 = tss.Text;

            Assert.AreEqual(str, str2, "Should not have inserted verse num into title para");
        }