SetupVernWsForText() private method

private SetupVernWsForText ( int wsVern ) : void
wsVern int
return void
Exemplo n.º 1
0
        private void SetupVc()
        {
            if (m_vc == null || m_hvoRoot == 0)
            {
                return;
            }
            int wsFirstPara = -1;

            wsFirstPara = GetWsOfFirstWordOfFirstTextPara();
            if (wsFirstPara == -1)
            {
                // The paragraph's first character has no valid writing system...this seems to be possible
                // when it consists entirely of a picture. Rather than crashing, presume the default.
                wsFirstPara = Cache.DefaultVernWs;
            }
            m_vc.SetupVernWsForText(wsFirstPara);
            IStText stText = Cache.ServiceLocator.GetInstance <IStTextRepository>().GetObject(m_hvoRoot);

            if (m_configurationParameters != null)
            {
                m_vc.Editable = SIL.Utils.XmlUtils.GetOptionalBooleanAttributeValue(
                    m_configurationParameters, "editable", true);
                m_vc.Editable &= !ScriptureServices.ScriptureIsResponsibleFor(stText);
            }
        }
Exemplo n.º 2
0
        private void SetupVc()
        {
            if (m_vc == null || m_hvoRoot == 0)
            {
                return;
            }
            int wsFirstPara = Cache.LangProject.ActualWs(LangProject.kwsVernInParagraph, m_hvoRoot,
                                                         (int)StText.StTextTags.kflidParagraphs);

            if (wsFirstPara == -1)
            {
                // The paragraph's first character has no valid writing system...this seems to be possible
                // when it consists entirely of a picture. Rather than crashing, presume the default.
                wsFirstPara = Cache.DefaultVernWs;
            }
            m_vc.SetupVernWsForText(wsFirstPara);
            StText stText = new StText(Cache, m_hvoRoot);

            if (m_configurationParameters != null)
            {
                m_vc.Editable = SIL.Utils.XmlUtils.GetOptionalBooleanAttributeValue(
                    m_configurationParameters, "editable", true) && !Scripture.IsResponsibleFor(stText);
            }
        }