Beispiel #1
0
        /// ------------------------------------------------------------------------------------
        /// <summary>
        /// Write the first paragraph in the given footnote.  (TE allows only 1 paragraph in
        /// footnotes!)
        /// </summary>
        /// ------------------------------------------------------------------------------------
        private void ExportFootnote(ScrFootnote foot)
        {
            IStTxtPara para   = foot.ParagraphsOS[0] as IStTxtPara;
            string     sStyle = para.StyleName;

            if (String.IsNullOrEmpty(sStyle))
            {
                sStyle = "scrFootnote";
            }
            else
            {
                sStyle = m_xhtml.GetValidCssClassName(sStyle);
            }
            ITsStrBldr bldr            = foot.MakeFootnoteMarker(m_cache.DefaultVernWs);
            string     sFootnoteMarker = bldr.Text;
            ITsString  tssPara         = para.Contents.UnderlyingTsString;

            m_writer.WriteLine("<span class=\"{0}\" id=\"{1}\" title=\"{2}\">",
                               sStyle, "F" + foot.Guid.ToString().ToUpperInvariant(), sFootnoteMarker);
            m_xhtml.MapCssToLang(sStyle, LanguageCode(StringUtils.GetWsAtOffset(tssPara, 0)));
            WriteTsStringAsXml(tssPara, 4);
            m_writer.WriteLine("</span>");
            // The following class is inserted by the XSLT processing.
            m_xhtml.MapCssToLang("scrFootnoteMarker", LanguageCode(m_cache.DefaultVernWs));
        }
Beispiel #2
0
        /// ------------------------------------------------------------------------------------
        /// <summary>
        /// Display the footnote marker.
        /// </summary>
        /// <param name="vwenv">View environment</param>
        /// <param name="footnote">The footnote.</param>
        /// ------------------------------------------------------------------------------------
        private void DisplayFootnoteMarker(IVwEnv vwenv, ScrFootnote footnote)
        {
            vwenv.NoteDependency(new int[] { footnote.Hvo },
                                 new int[] { (int)StFootnote.StFootnoteTags.kflidFootnoteMarker }, 1);
            // The footnote marker is not editable.
            vwenv.set_IntProperty((int)FwTextPropType.ktptEditable,
                                  (int)FwTextPropVar.ktpvEnum,
                                  (int)TptEditable.ktptNotEditable);

            ITsStrBldr strBldr = footnote.MakeFootnoteMarker(DefaultWs);

            strBldr.Replace(strBldr.Length, strBldr.Length, " ", null);
            vwenv.AddString(strBldr.GetString());
        }