Beispiel #1
0
        public void GoToNextPara_MultiParaRangeSelection()
        {
            ShowForm(Lng.English, SimpleViewVc.DisplayType.kNormal |
                     SimpleViewVc.DisplayType.kDuplicateParagraphs);
            m_basicView.Show();
            m_basicView.RefreshDisplay();

            m_SelectionHelper = new DummySelectionHelper(null, m_basicView);

            // Make a bottom-up selection, just to be sure we're not using the anchor instead of
            // the top.
            SetSelection(0, 0, 0, 0, 2, 1, 1, false);             // Set end
            SetSelection(0, 1, 0, 0, 1, 12, 12, true);            // Set anchor
            IVwSelection vwsel = m_SelectionHelper.SetSelection(true);

            Assert.IsNotNull(vwsel, "No selection made");
            m_basicView.EditingHelper.GoToNextPara();

            // We expect that the selection will be at the start of the second paragraph in
            // the selected range.
            SelectionHelper selectionHelper = SelectionHelper.GetSelectionInfo(null, m_basicView);

            Assert.IsFalse(selectionHelper.IsRange);
            CheckSelectionHelperValues(SelectionHelper.SelLimitType.Anchor, selectionHelper, 0,
                                       0, 0, 0, false, 2, SimpleRootsiteTestsConstants.kflidDocFootnotes, 0, 0,
                                       SimpleRootsiteTestsConstants.kflidTextParas, 1, 0);
        }
Beispiel #2
0
        public void GoToNextPara_LastParaInView()
        {
            ShowForm(Lng.English, SimpleViewVc.DisplayType.kNormal |
                     SimpleViewVc.DisplayType.kDuplicateParagraphs);
            m_basicView.Show();
            m_basicView.RefreshDisplay();

            m_SelectionHelper = new DummySelectionHelper(null, m_basicView);
            SetSelection(0, 1, 1, 0, 2, 6, 0, true);
            IVwSelection vwsel = m_SelectionHelper.SetSelection(true);

            Assert.IsNotNull(vwsel, "No selection made");
            Assert.IsTrue(m_basicView.IsSelectionVisible(null), "Selection is not visible");
            m_basicView.EditingHelper.GoToNextPara();

            // We expect that the selection will be unchanged.
            SelectionHelper selectionHelper = SelectionHelper.GetSelectionInfo(null, m_basicView);

            Assert.IsTrue(selectionHelper.IsRange);
            CheckSelectionHelperValues(SelectionHelper.SelLimitType.Anchor, selectionHelper, 0,
                                       2, 6, 0, true, 2, SimpleRootsiteTestsConstants.kflidDocFootnotes, 0, 1,
                                       SimpleRootsiteTestsConstants.kflidTextParas, 1, 0);
            CheckSelectionHelperValues(SelectionHelper.SelLimitType.End, selectionHelper, 0,
                                       2, 0, 0, false, 2, SimpleRootsiteTestsConstants.kflidDocFootnotes, 0, 1,
                                       SimpleRootsiteTestsConstants.kflidTextParas, 1, 0);
        }
Beispiel #3
0
        public void GoToNextPara_NextFlid()
        {
            // Add a title to the root object
            int hvoTitle     = m_cache.MakeNewObject(SimpleRootsiteTestsConstants.kclsidStText, m_hvoRoot, SimpleRootsiteTestsConstants.kflidDocTitle, -2);
            int hvoTitlePara = m_cache.MakeNewObject(SimpleRootsiteTestsConstants.kclsidStTxtPara, hvoTitle, SimpleRootsiteTestsConstants.kflidTextParas, 0);

            m_cache.CacheStringProp(hvoTitlePara, SimpleRootsiteTestsConstants.kflidParaContents,
                                    TsStringUtils.MakeString("The First Book of the Law given by Moses", m_wsFrn));

            ShowForm(Lng.English, SimpleViewVc.DisplayType.kNormal |
                     SimpleViewVc.DisplayType.kTitle);
            m_basicView.Show();
            m_basicView.RefreshDisplay();

            // Set the IP at the beginning of the only (0th) instance of the only (0th) paragraph
            // of the only (0th) instance of the second (1th) footnote of the book we're displaying.
            m_SelectionHelper = new DummySelectionHelper(null, m_basicView);
            SetSelection(0, 1, 0, 0, 2, 0, 0, true);
            IVwSelection vwsel = m_SelectionHelper.SetSelection(true);

            Assert.IsNotNull(vwsel, "No selection made");
            Assert.IsTrue(m_basicView.IsSelectionVisible(null), "Selection is not visible");
            m_basicView.EditingHelper.GoToNextPara();

            // We expect that the selection will be at the start of the book title.
            SelectionHelper selectionHelper = SelectionHelper.GetSelectionInfo(null, m_basicView);

            Assert.IsFalse(selectionHelper.IsRange);
            CheckSelectionHelperValues(SelectionHelper.SelLimitType.Anchor, selectionHelper, 0,
                                       0, 0, 0, false, 2, SimpleRootsiteTestsConstants.kflidDocTitle, 0, 0,
                                       SimpleRootsiteTestsConstants.kflidTextParas, 0, 0);
        }
Beispiel #4
0
        public void GoToNextPara_FirstFlidInNextObject()
        {
            ShowForm(Lng.English, SimpleViewVc.DisplayType.kFootnoteDetailsSeparateParas);
            m_basicView.Show();
            m_basicView.RefreshDisplay();

            m_SelectionHelper = new DummySelectionHelper(null, m_basicView);
            SetSelection(0, 0, 0, 0, 0, 0, 0, true);
            IVwSelection vwsel = m_SelectionHelper.SetSelection(true);

            Assert.IsNotNull(vwsel, "No selection made");
            Assert.IsTrue(m_basicView.IsSelectionVisible(null), "Selection is not visible");
            m_basicView.EditingHelper.GoToNextPara();

            // We expect that the selection will be at the start of the second footnote's marker.
            SelectionHelper selectionHelper = SelectionHelper.GetSelectionInfo(null, m_basicView);

            Assert.IsFalse(selectionHelper.IsRange);
            CheckSelectionHelperValues(SelectionHelper.SelLimitType.Anchor, selectionHelper, 0,
                                       0, 0, 0, false, 1, -1, -1, -1, SimpleRootsiteTestsConstants.kflidDocFootnotes, 0, 1);
        }