コード例 #1
0
        public void DeleteFootnoteMarkerInBt_ContextMenu()
        {
            IScrBook book = AddBookToMockedScripture(1, "Genesis");

            AddTitleToMockedBook(book, "Genesis");
            m_draftView.BookFilter.Add(book);
            IScrSection section = AddSectionToMockedBook(book);

            AddSectionHeadParaToSection(section, "The first section",
                                        ScrStyleNames.SectionHead);

            // Construct a parent paragraph
            IStTxtPara parentPara = AddParaToMockedSectionContent(section,
                                                                  ScrStyleNames.NormalParagraph);

            AddRunToMockedPara(parentPara, "1", ScrStyleNames.ChapterNumber);
            AddRunToMockedPara(parentPara, "1", ScrStyleNames.VerseNumber);
            AddRunToMockedPara(parentPara, "uno ", null);
            AddRunToMockedPara(parentPara, "2", ScrStyleNames.VerseNumber);
            AddRunToMockedPara(parentPara, "dos ", null);
            IStFootnote footnote1 = AddFootnote(book, parentPara, 5);

            AddParaToMockedText(footnote1, ScrStyleNames.NormalFootnoteParagraph);
            IStFootnote footnote2 = AddFootnote(book, parentPara, 10);

            AddParaToMockedText(footnote2, ScrStyleNames.NormalFootnoteParagraph);
            Assert.AreEqual(2, book.FootnotesOS.Count);

            // Construct the initial back translation
            int            wsBt  = Cache.DefaultAnalWs;
            ICmTranslation trans = AddBtToMockedParagraph(parentPara, wsBt);

            AddRunToMockedTrans(trans, wsBt, "one two", null);
            ITsStrBldr btTssBldr = trans.Translation.get_String(wsBt).GetBldr();

            TsStringUtils.InsertOrcIntoPara(footnote1.Guid, FwObjDataTypes.kodtNameGuidHot, btTssBldr, 3, 3, wsBt);
            TsStringUtils.InsertOrcIntoPara(footnote2.Guid, FwObjDataTypes.kodtNameGuidHot, btTssBldr, 8, 8, wsBt);
            trans.Translation.set_String(wsBt, btTssBldr.GetString());
            m_draftView.RefreshDisplay();

            // Delete the marker for the back translation of the first footnote. We have to make a range selection
            // because by the time the tested method is called, a range selection of any adjacent footnotes has
            // already been made.
            SelectionHelper selHelper = m_draftView.SelectRangeOfChars(0, 0, 0, 3, 4);

            m_draftView.CallDeleteFootnote();

            // Verify that both original footnotes still exist and that the first BT footnote marker is
            // deleted.
            Assert.AreEqual(2, book.FootnotesOS.Count);
            VerifyFootnote(footnote1, parentPara, 5);
            VerifyFootnote(footnote2, parentPara, 10);
            Assert.AreEqual("one two" + StringUtils.kChObject,
                            trans.Translation.get_String(wsBt).Text);
            FdoTestHelper.VerifyBtFootnote(footnote2, parentPara, wsBt, 7);
        }
コード例 #2
0
        public void InsertFootnote_InBt()
        {
            IScrBook book = AddBookToMockedScripture(1, "Genesis");

            AddTitleToMockedBook(book, "Genesis");
            m_draftView.BookFilter.Add(book);
            IScrSection section = AddSectionToMockedBook(book);

            AddSectionHeadParaToSection(section, "The first section",
                                        ScrStyleNames.SectionHead);

            // Construct a parent paragraph in the vernacular.
            IScrTxtPara parentPara = AddParaToMockedSectionContent(section, ScrStyleNames.NormalParagraph);

            AddVerse(parentPara, 1, 1, "uno");
            AddVerse(parentPara, 0, 2, "dos");
            IScrFootnote footnote1 = AddFootnote(book, parentPara, 5);

            AddParaToMockedText(footnote1, ScrStyleNames.NormalFootnoteParagraph);
            IScrFootnote footnote2 = AddFootnote(book, parentPara, 10);

            AddParaToMockedText(footnote2, ScrStyleNames.NormalFootnoteParagraph);
            Assert.AreEqual(2, book.FootnotesOS.Count);

            // Construct the initial back translation
            int            wsBt  = Cache.DefaultAnalWs;
            ICmTranslation trans = AddBtToMockedParagraph(parentPara, wsBt);

            AddRunToMockedTrans(trans, wsBt, "one two", null);
            ITsStrBldr btTssBldr = trans.Translation.get_String(wsBt).GetBldr();

            trans.Translation.set_String(wsBt, btTssBldr.GetString());
            m_draftView.RefreshDisplay();

            m_draftView.SetInsertionPoint(0, 0, 0, 3, false);             //set the IP after the word "one"
            int iBtFootnote1;

            m_draftView.TeEditingHelper.InsertFootnote(ScrStyleNames.NormalFootnoteParagraph, out iBtFootnote1);
            VerifyRequestedBTSelection(0, 0, ScrSectionTags.kflidContent, 0, 4);
            m_draftView.RefreshDisplay();

            m_draftView.SetInsertionPoint(0, 0, 0, 8, false);             // set the IP after the word "two"
            int iBtFootnote2;

            m_draftView.TeEditingHelper.InsertFootnote(ScrStyleNames.NormalFootnoteParagraph, out iBtFootnote2);
            VerifyRequestedBTSelection(0, 0, ScrSectionTags.kflidContent, 0, 9);

            // Confirm that the footnote callers were inserted in the correct locations.
            Assert.AreEqual("one" + StringUtils.kChObject + " two" + StringUtils.kChObject,
                            trans.Translation.get_String(wsBt).Text);
            FdoTestHelper.VerifyBtFootnote(footnote1, parentPara, wsBt, 3);
            FdoTestHelper.VerifyBtFootnote(footnote2, parentPara, wsBt, 8);
        }
コード例 #3
0
        public void InsertFootnote()
        {
            IScrBook book = AddBookToMockedScripture(1, "Genesis");

            AddTitleToMockedBook(book, "Genesis");
            m_draftView.BookFilter.Add(book);
            IScrSection section = AddSectionToMockedBook(book);

            // Construct a paragraph in the vernacular.
            IScrTxtPara para = AddParaToMockedSectionContent(section, ScrStyleNames.NormalParagraph);

            // Footnote goes here:   |
            AddVerse(para, 1, 1, "uno");
            // Footnote goes here:   |
            AddVerse(para, 0, 2, "dos");
            IScrFootnote footnote1 = AddFootnote(book, para, 5);

            AddParaToMockedText(footnote1, ScrStyleNames.NormalFootnoteParagraph);
            IScrFootnote footnote2 = AddFootnote(book, para, 10);

            AddParaToMockedText(footnote2, ScrStyleNames.NormalFootnoteParagraph);
            Assert.AreEqual(2, book.FootnotesOS.Count);

            // Construct the initial back translation
            AddSegmentFt(para, 1, "one", Cache.DefaultAnalWs);
            AddSegmentFt(para, 3, "two", Cache.DefaultAnalWs);
            m_draftView.RefreshDisplay();

            m_draftView.TeEditingHelper.SelectRangeOfChars(0, 0, ScrSectionTags.kflidContent, 0, 1, 3, 3,
                                                           true, false, true, VwScrollSelOpts.kssoDefault); //set the IP after the word "one"
            int iBtFootnote1;

            m_draftView.TeEditingHelper.InsertFootnote(ScrStyleNames.NormalFootnoteParagraph, out iBtFootnote1);
            Assert.AreEqual(0, iBtFootnote1);
            VerifyRequestedSegmentedBTSelection(0, 0, ScrSectionTags.kflidContent, 0, 1, 4);
            m_draftView.RefreshDisplay();

            m_draftView.TeEditingHelper.SelectRangeOfChars(0, 0, ScrSectionTags.kflidContent, 0, 3, 3, 3,
                                                           true, false, true, VwScrollSelOpts.kssoDefault); //set the IP after the word "two"
            int iBtFootnote2;

            m_draftView.TeEditingHelper.InsertFootnote(ScrStyleNames.NormalFootnoteParagraph, out iBtFootnote2);
            Assert.AreEqual(1, iBtFootnote2);
            VerifyRequestedSegmentedBTSelection(0, 0, ScrSectionTags.kflidContent, 0, 3, 4);

            // Confirm that the footnote callers were inserted in the correct locations.
            VerifySegment(para, 1, "one" + StringUtils.kChObject, Cache.DefaultAnalWs);
            VerifySegment(para, 3, "two" + StringUtils.kChObject, Cache.DefaultAnalWs);
            FdoTestHelper.VerifyFootnoteInSegmentFt(footnote1, para, 1, Cache.DefaultAnalWs, 3);
            FdoTestHelper.VerifyFootnoteInSegmentFt(footnote2, para, 3, Cache.DefaultAnalWs, 3);
        }
コード例 #4
0
        public void InsertFootnote_BeforeExistingFootnoteInBt()
        {
            IScrBook book = AddBookToMockedScripture(1, "Genesis");

            AddTitleToMockedBook(book, "Genesis");
            m_draftView.BookFilter.Add(book);
            IScrSection section = AddSectionToMockedBook(book);

            // Construct a paragraph in the vernacular.
            IScrTxtPara para = AddParaToMockedSectionContent(section, ScrStyleNames.NormalParagraph);

            AddVerse(para, 1, 1, "uno");
            // Footnote goes here:   |
            AddVerse(para, 0, 2, "dos");
            IScrFootnote footnote1 = AddFootnote(book, para, para.Contents.Length);

            AddParaToMockedText(footnote1, ScrStyleNames.CrossRefFootnoteParagraph);
            Assert.AreEqual(1, book.FootnotesOS.Count);

            // Construct the initial back translation
            int wsBt = Cache.DefaultAnalWs;

            AddSegmentFt(para, 1, "one", wsBt);
            const int kiSegmentWithFn = 3;

            AddSegmentFt(para, kiSegmentWithFn, "two", wsBt);
            ISegment   segment    = para.SegmentsOS[kiSegmentWithFn];
            ITsString  tssSegment = segment.FreeTranslation.get_String(wsBt);
            ITsStrBldr bldr       = tssSegment.GetBldr();

            TsStringUtils.InsertOrcIntoPara(footnote1.Guid, FwObjDataTypes.kodtNameGuidHot, bldr,
                                            bldr.Length, bldr.Length, wsBt);
            segment.FreeTranslation.set_String(wsBt, bldr.GetString());
            m_draftView.RefreshDisplay();

            m_draftView.TeEditingHelper.SelectRangeOfChars(0, 0, ScrSectionTags.kflidContent, 0, kiSegmentWithFn, 0, 0,
                                                           true, false, true, VwScrollSelOpts.kssoDefault); //set the IP after the cross-reference footnote

            int iDummy;

            Assert.IsNull(m_draftView.TeEditingHelper.InsertFootnote(ScrStyleNames.NormalFootnoteParagraph, out iDummy));

            // Confirm that nothing else was inserted.
            VerifySegment(para, 1, "one", wsBt);
            VerifySegment(para, kiSegmentWithFn, "two" + StringUtils.kChObject, wsBt);
            FdoTestHelper.VerifyFootnoteInSegmentFt(footnote1, para, kiSegmentWithFn, wsBt, bldr.Length - 1);
        }
コード例 #5
0
        public void InsertFootnote_AtEndBtWithLongCallers()
        {
            m_scr.FootnoteMarkerSymbol = "@#$";
            m_scr.FootnoteMarkerType   = FootnoteMarkerTypes.SymbolicFootnoteMarker;

            IScrBook book = AddBookToMockedScripture(1, "Genesis");

            AddTitleToMockedBook(book, "Genesis");
            m_draftView.BookFilter.Add(book);
            IScrSection section = AddSectionToMockedBook(book);

            AddSectionHeadParaToSection(section, "The first section",
                                        ScrStyleNames.SectionHead);

            // Construct a parent paragraph in the vernacular.
            IScrTxtPara parentPara = AddParaToMockedSectionContent(section, ScrStyleNames.NormalParagraph);

            AddVerse(parentPara, 1, 1, "uno");
            AddVerse(parentPara, 0, 2, "dos");
            IScrFootnote footnote1 = AddFootnote(book, parentPara, parentPara.Contents.Length);

            AddParaToMockedText(footnote1, ScrStyleNames.NormalFootnoteParagraph);
            Assert.AreEqual(1, book.FootnotesOS.Count);

            // Construct the initial back translation
            int            wsBt  = Cache.DefaultAnalWs;
            ICmTranslation trans = AddBtToMockedParagraph(parentPara, wsBt);

            AddRunToMockedTrans(trans, wsBt, "a", null);
            ITsStrBldr btTssBldr = trans.Translation.get_String(wsBt).GetBldr();

            TsStringUtils.InsertOrcIntoPara(footnote1.Guid, FwObjDataTypes.kodtNameGuidHot, btTssBldr,
                                            btTssBldr.Length, btTssBldr.Length, wsBt);
            trans.Translation.set_String(wsBt, btTssBldr.GetString());
            m_draftView.RefreshDisplay();

            m_draftView.SetInsertionPoint(0, 0, 0, btTssBldr.Length, false);             //set the IP after the footnote
            int iBtFootnote2;

            m_draftView.TeEditingHelper.InsertFootnote(ScrStyleNames.NormalFootnoteParagraph, out iBtFootnote2);
            m_draftView.RefreshDisplay();

            // Confirm that the footnote callers were inserted in the correct locations.
            Assert.AreEqual("a" + StringUtils.kChObject, trans.Translation.get_String(wsBt).Text);
            FdoTestHelper.VerifyBtFootnote(footnote1, parentPara, wsBt, btTssBldr.Length - 1);
        }
コード例 #6
0
        public void AddHyperlink()
        {
            ITsStrBldr strBldr = TsStrBldrClass.Create();

            FwStyleSheet mockStylesheet     = MockRepository.GenerateStub <FwStyleSheet>();
            IStStyle     mockHyperlinkStyle = MockRepository.GenerateStub <IStStyle>();

            mockHyperlinkStyle.Name = StyleServices.Hyperlink;
            mockHyperlinkStyle.Stub(x => x.InUse).Return(true);
            mockStylesheet.Stub(x => x.FindStyle(StyleServices.Hyperlink)).Return(mockHyperlinkStyle);

            Assert.IsTrue(FwEditingHelper.AddHyperlink(strBldr, Cache.DefaultAnalWs, "Click Here",
                                                       "www.google.com", mockStylesheet));
            Assert.AreEqual(1, strBldr.RunCount);
            Assert.AreEqual("Click Here", strBldr.get_RunText(0));
            ITsTextProps props = strBldr.get_Properties(0);

            FdoTestHelper.VerifyHyperlinkPropsAreCorrect(props, Cache.DefaultAnalWs, "www.google.com");
        }
コード例 #7
0
        public void InsertFootnote_WithRangeSelectionInBt()
        {
            IScrBook book = AddBookToMockedScripture(1, "Genesis");

            AddTitleToMockedBook(book, "Genesis");
            m_draftView.BookFilter.Add(book);
            IScrSection section = AddSectionToMockedBook(book);

            AddSectionHeadParaToSection(section, "The first section",
                                        ScrStyleNames.SectionHead);

            // Construct a parent paragraph in the vernacular.
            IScrTxtPara parentPara = AddParaToMockedSectionContent(section, ScrStyleNames.NormalParagraph);

            AddVerse(parentPara, 1, 1, "uno");
            AddVerse(parentPara, 0, 2, "dos");
            IScrFootnote footnote1 = AddFootnote(book, parentPara, 5);

            AddParaToMockedText(footnote1, ScrStyleNames.NormalFootnoteParagraph);
            IScrFootnote footnote2 = AddFootnote(book, parentPara, 10);

            AddParaToMockedText(footnote2, ScrStyleNames.NormalFootnoteParagraph);
            Assert.AreEqual(2, book.FootnotesOS.Count);

            // Construct the initial back translation
            int            wsBt  = Cache.DefaultAnalWs;
            ICmTranslation trans = AddBtToMockedParagraph(parentPara, wsBt);

            AddRunToMockedTrans(trans, wsBt, "one two", null);
            ITsStrBldr btTssBldr = trans.Translation.get_String(wsBt).GetBldr();

            trans.Translation.set_String(wsBt, btTssBldr.GetString());
            m_draftView.RefreshDisplay();

            m_draftView.SelectRangeOfChars(0, 0, 0, 0, 3);             // select the word "one"
            int iBtFootnote1;

            m_draftView.TeEditingHelper.InsertFootnote(ScrStyleNames.NormalFootnoteParagraph, out iBtFootnote1);
            VerifyRequestedBTSelection(0, 0, ScrSectionTags.kflidContent, 0, 4);
            m_draftView.RefreshDisplay();

            m_draftView.SelectRangeOfChars(0, 0, 0, 8, 5);             // select the word "two" -- end before anchor
            int iBtFootnote2;

            m_draftView.TeEditingHelper.InsertFootnote(ScrStyleNames.NormalFootnoteParagraph, out iBtFootnote2);
            VerifyRequestedBTSelection(0, 0, ScrSectionTags.kflidContent, 0, 9);

            // Confirm that the footnote callers were inserted in the correct locations.
            Assert.AreEqual("one" + StringUtils.kChObject + " two" + StringUtils.kChObject,
                            trans.Translation.get_String(wsBt).Text);
            FdoTestHelper.VerifyBtFootnote(footnote1, parentPara, wsBt, 3);
            FdoTestHelper.VerifyBtFootnote(footnote2, parentPara, wsBt, 8);

            // Confirm that the footnote back translations contain the text that was selected
            // when they were inserted.
            ICmTranslation transFootnote1 = ((IScrTxtPara)footnote1.ParagraphsOS[0]).GetBT();

            Assert.IsNotNull(transFootnote1);
            AssertEx.AreTsStringsEqual(DraftViewTests.GetReferencedTextFootnoteStr("one", Cache.DefaultAnalWs),
                                       transFootnote1.Translation.get_String(wsBt));
            ICmTranslation transFootnote2 = ((IScrTxtPara)footnote2.ParagraphsOS[0]).GetBT();

            Assert.IsNotNull(transFootnote2);
            AssertEx.AreTsStringsEqual(DraftViewTests.GetReferencedTextFootnoteStr("two", Cache.DefaultAnalWs),
                                       transFootnote2.Translation.get_String(wsBt));
        }
コード例 #8
0
        public void InsertFootnote_WithRangeSelectionInBt()
        {
            IScrBook book = AddBookToMockedScripture(1, "Genesis");

            AddTitleToMockedBook(book, "Genesis");
            m_draftView.BookFilter.Add(book);
            IScrSection section = AddSectionToMockedBook(book);

            // Construct a paragraph in the vernacular.
            IScrTxtPara para = AddParaToMockedSectionContent(section, ScrStyleNames.NormalParagraph);

            // Footnote goes here:   |
            AddVerse(para, 1, 1, "uno");
            // Footnote goes here:   |
            AddVerse(para, 0, 2, "dos");
            IScrFootnote footnote1 = AddFootnote(book, para, 5);

            AddParaToMockedText(footnote1, ScrStyleNames.NormalFootnoteParagraph);
            IScrFootnote footnote2     = AddFootnote(book, para, 10);
            IStTxtPara   footnote2Para = AddParaToMockedText(footnote2, ScrStyleNames.NormalFootnoteParagraph);

            // Put some text into this footnote, so there will be a segment created.
            footnote2Para.Contents = Cache.TsStrFactory.MakeString("fun stuff", Cache.DefaultVernWs);
            Assert.AreEqual(2, book.FootnotesOS.Count);

            // Construct the initial back translation
            int wsBt = Cache.DefaultAnalWs;

            AddSegmentFt(para, 1, "one", wsBt);
            AddSegmentFt(para, 3, "two", wsBt);
            m_draftView.RefreshDisplay();

            m_draftView.TeEditingHelper.SelectRangeOfChars(0, 0, ScrSectionTags.kflidContent, 0, 1, 0, 3,
                                                           true, false, true, VwScrollSelOpts.kssoDefault); // select the word "one"
            int iBtFootnote1;

            m_draftView.TeEditingHelper.InsertFootnote(ScrStyleNames.NormalFootnoteParagraph, out iBtFootnote1);
            Assert.AreEqual(0, iBtFootnote1);
            VerifyRequestedSegmentedBTSelection(0, 0, ScrSectionTags.kflidContent, 0, 1, 4);
            m_draftView.RefreshDisplay();

            m_draftView.TeEditingHelper.SelectRangeOfChars(0, 0, ScrSectionTags.kflidContent, 0, 3, 3, 0,
                                                           true, false, true, VwScrollSelOpts.kssoDefault); // select the word "two" -- end before anchor
            int iBtFootnote2;

            m_draftView.TeEditingHelper.InsertFootnote(ScrStyleNames.NormalFootnoteParagraph, out iBtFootnote2);
            VerifyRequestedSegmentedBTSelection(0, 0, ScrSectionTags.kflidContent, 0, 3, 4);
            Assert.AreEqual(1, iBtFootnote2);

            // Confirm that the footnote callers were inserted in the correct locations.
            VerifySegment(para, 1, "one" + StringUtils.kChObject, wsBt);
            VerifySegment(para, 3, "two" + StringUtils.kChObject, wsBt);
            FdoTestHelper.VerifyFootnoteInSegmentFt(footnote1, para, 1, wsBt, 3);
            FdoTestHelper.VerifyFootnoteInSegmentFt(footnote2, para, 3, wsBt, 3);

            // Confirm that the footnote back translations contain the text that was selected
            // when they were inserted.
            Assert.AreEqual(0, footnote1[0].SegmentsOS.Count,
                            "Because the vernacular footnote had no text, there is no segment, so there was no place to put the selected BT text.");
            ISegment segFootnote2 = footnote2[0].SegmentsOS[0];

            AssertEx.AreTsStringsEqual(DraftViewTests.GetReferencedTextFootnoteStr("two", wsBt),
                                       segFootnote2.FreeTranslation.get_String(wsBt));
        }
コード例 #9
0
        public void InsertFootnote_OutOfOrder()
        {
            IScrBook book = AddBookToMockedScripture(1, "Genesis");

            AddTitleToMockedBook(book, "Genesis");
            m_draftView.BookFilter.Add(book);
            IScrSection section = AddSectionToMockedBook(book);

            // Construct a paragraph in the vernacular.
            IScrTxtPara para = AddParaToMockedSectionContent(section, ScrStyleNames.NormalParagraph);

            // Footnotes go here:    a  b    c  d     e
            AddVerse(para, 1, 1, "Asi me dijo mi mama.");
            IScrFootnote footnote1 = AddFootnote(book, para, 4);

            AddParaToMockedText(footnote1, ScrStyleNames.NormalFootnoteParagraph);
            IScrFootnote footnote2 = AddFootnote(book, para, 8);

            AddParaToMockedText(footnote2, ScrStyleNames.NormalFootnoteParagraph);
            IScrFootnote footnote3 = AddFootnote(book, para, 14);

            AddParaToMockedText(footnote3, ScrStyleNames.NormalFootnoteParagraph);
            IScrFootnote footnote4 = AddFootnote(book, para, 18);

            AddParaToMockedText(footnote4, ScrStyleNames.NormalFootnoteParagraph);
            IScrFootnote footnote5 = AddFootnote(book, para, 25);

            AddParaToMockedText(footnote5, ScrStyleNames.NormalFootnoteParagraph);
            Assert.AreEqual(5, book.FootnotesOS.Count);

            // Construct the initial back translation
            // Footnotes go here:    d   e    c  b  a
            AddSegmentFt(para, 1, "My mom told me so.", Cache.DefaultAnalWs);
            m_draftView.RefreshDisplay();

            m_draftView.TeEditingHelper.SelectRangeOfChars(0, 0, ScrSectionTags.kflidContent, 0, 1, 17, 17,
                                                           true, false, true, VwScrollSelOpts.kssoDefault); //set the IP after the word "so"
            int iBtFootnote1;

            m_draftView.TeEditingHelper.InsertFootnote(ScrStyleNames.NormalFootnoteParagraph, out iBtFootnote1);
            Assert.AreEqual(0, iBtFootnote1);
            VerifyRequestedSegmentedBTSelection(0, 0, ScrSectionTags.kflidContent, 0, 1, 18);
            m_draftView.RefreshDisplay();

            m_draftView.TeEditingHelper.SelectRangeOfChars(0, 0, ScrSectionTags.kflidContent, 0, 1, 14, 14,
                                                           true, false, true, VwScrollSelOpts.kssoDefault); //set the IP after the word "me"
            int iBtFootnote2;

            m_draftView.TeEditingHelper.InsertFootnote(ScrStyleNames.NormalFootnoteParagraph, out iBtFootnote2);
            Assert.AreEqual(1, iBtFootnote2);
            VerifyRequestedSegmentedBTSelection(0, 0, ScrSectionTags.kflidContent, 0, 1, 15);
            m_draftView.RefreshDisplay();

            m_draftView.TeEditingHelper.SelectRangeOfChars(0, 0, ScrSectionTags.kflidContent, 0, 1, 11, 11,
                                                           true, false, true, VwScrollSelOpts.kssoDefault); //set the IP after the word "told"
            int iBtFootnote3;

            m_draftView.TeEditingHelper.InsertFootnote(ScrStyleNames.NormalFootnoteParagraph, out iBtFootnote3);
            Assert.AreEqual(2, iBtFootnote3);
            VerifyRequestedSegmentedBTSelection(0, 0, ScrSectionTags.kflidContent, 0, 1, 12);
            m_draftView.RefreshDisplay();

            m_draftView.TeEditingHelper.SelectRangeOfChars(0, 0, ScrSectionTags.kflidContent, 0, 1, 2, 2,
                                                           true, false, true, VwScrollSelOpts.kssoDefault); //set the IP after the word "My"
            int iBtFootnote4;

            m_draftView.TeEditingHelper.InsertFootnote(ScrStyleNames.NormalFootnoteParagraph, out iBtFootnote4);
            Assert.AreEqual(3, iBtFootnote4);
            VerifyRequestedSegmentedBTSelection(0, 0, ScrSectionTags.kflidContent, 0, 1, 3);
            m_draftView.RefreshDisplay();

            m_draftView.TeEditingHelper.SelectRangeOfChars(0, 0, ScrSectionTags.kflidContent, 0, 1, 7, 7,
                                                           true, false, true, VwScrollSelOpts.kssoDefault); //set the IP after the word "mom"
            int iBtFootnote5;

            m_draftView.TeEditingHelper.InsertFootnote(ScrStyleNames.NormalFootnoteParagraph, out iBtFootnote5);
            Assert.AreEqual(4, iBtFootnote5);
            VerifyRequestedSegmentedBTSelection(0, 0, ScrSectionTags.kflidContent, 0, 1, 8);
            m_draftView.RefreshDisplay();

            // Confirm that the footnote callers were inserted in the correct locations.
            VerifySegment(para, 1, "My" + StringUtils.kChObject + " mom" + StringUtils.kChObject + " told" +
                          StringUtils.kChObject + " me" + StringUtils.kChObject + " so" + StringUtils.kChObject + ".",
                          Cache.DefaultAnalWs);
            FdoTestHelper.VerifyFootnoteInSegmentFt(footnote1, para, 1, Cache.DefaultAnalWs, 21);
            FdoTestHelper.VerifyFootnoteInSegmentFt(footnote2, para, 1, Cache.DefaultAnalWs, 17);
            FdoTestHelper.VerifyFootnoteInSegmentFt(footnote3, para, 1, Cache.DefaultAnalWs, 13);
            FdoTestHelper.VerifyFootnoteInSegmentFt(footnote4, para, 1, Cache.DefaultAnalWs, 2);
            FdoTestHelper.VerifyFootnoteInSegmentFt(footnote5, para, 1, Cache.DefaultAnalWs, 7);
        }
コード例 #10
0
        /// <summary>Setup for FieldWorks tests.</summary>
        public override void FixtureSetup()
        {
            base.FixtureSetup();

            FdoTestHelper.SetupStaticFdoProperties();
        }
コード例 #11
0
 public void SetUp()
 {
     FdoTestHelper.SetupStaticFdoProperties();
 }