public override void Exit() { CheckDisposed(); m_dobjClipboard = null; base.Exit(); }
public void PasteMultiParasIntoFootnote() { CheckDisposed(); IScrBook book = m_scrInMemoryCache.AddBookToMockedScripture(1, "Genesis"); IScrSection section = m_scrInMemoryCache.AddSectionToMockedBook(book.Hvo); StTxtPara para = m_scrInMemoryCache.AddParaToMockedSectionContent(section.Hvo, ScrStyleNames.NormalParagraph); m_scrInMemoryCache.AddRunToMockedPara(para, "Scripture text", Cache.DefaultVernWs); StFootnote footnote1 = m_scrInMemoryCache.AddFootnote(book, para, 9, "footnote 1"); int footnote1Length = ((StTxtPara)footnote1.ParagraphsOS[0]).Contents.Length; m_hvoRoot = book.Hvo; ShowForm(DummyBasicViewVc.DisplayType.kNormal); IVwRootBox rootBox = m_basicView.RootBox; ITsStrBldr strBldr = TsStrBldrClass.Create(); strBldr.Replace(0, 0, "New heading line1", StyleUtils.CharStyleTextProps(null, 1)); strBldr.Replace(strBldr.Length, strBldr.Length, "\r\n", StyleUtils.ParaStyleTextProps(ScrStyleNames.NormalParagraph)); strBldr.Replace(strBldr.Length, strBldr.Length, "heading line2\r\nNew heading line3", StyleUtils.CharStyleTextProps(null, 1)); ILgWritingSystemFactory wsf = rootBox.DataAccess.WritingSystemFactory; ILgTsStringPlusWss tssencs = LgTsStringPlusWssClass.Create(); tssencs.set_String(wsf, strBldr.GetString()); m_dobjClipboard = LgTsDataObjectClass.Create(); m_dobjClipboard.Init(tssencs); Clipboard.SetDataObject(m_dobjClipboard, false); // Make selection at the end of the footnote rootBox.MakeSimpleSel(false, true, false, true); // Paste contents of clipboard at current selection. m_basicView.EditingHelper.PasteClipboard(true); // We expect that the footnote will only have one paragraph with the extra paragraphs // in the paragraph ignored. Assert.AreEqual(1, footnote1.ParagraphsOS.Count); Assert.AreEqual("footnote 1New heading line1", ((StTxtPara)footnote1.ParagraphsOS[0]).Contents.Text); }