]> git.lyx.org Git - features.git/commitdiff
The fortoc argument I introduced earlier should all along have gone into
authorRichard Heck <rgheck@comcast.net>
Thu, 14 Jan 2010 22:24:43 +0000 (22:24 +0000)
committerRichard Heck <rgheck@comcast.net>
Thu, 14 Jan 2010 22:24:43 +0000 (22:24 +0000)
OutputParams. So now it is there.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33044 a592a061-630c-0410-9148-cb99ea01b6c8

src/OutputParams.cpp
src/OutputParams.h
src/Paragraph.cpp
src/Paragraph.h
src/insets/InsetIndex.cpp
src/insets/InsetTOC.cpp
src/output_xhtml.cpp

index 2e129cec186f7c811b3255ff8d588cbc93547940..09583d94c8ba25a10655bfc60a45e799654ac197 100644 (file)
@@ -30,7 +30,7 @@ OutputParams::OutputParams(Encoding const * enc)
          par_begin(0), par_end(0), isLastPar(false),
          dryrun(false), verbatim(false), 
          html_disable_captions(false), html_in_par(false),
-         html_make_pars(true), includeall(false)
+         html_make_pars(true), for_toc(false), includeall(false)
 {
        // Note: in PreviewLoader::Impl::dumpPreamble
        // OutputParams runparams(0); 
index cea089e1f1a5bb99021a76c354629746a188cdfd..2ea48be8b618f862a6a1e5b2b7cd8fe6c7524e74 100644 (file)
@@ -203,19 +203,28 @@ public:
 
        /// is this the last paragraph in the current buffer/inset?
        bool isLastPar;
+       
 
        /** whether or not do actual file copying and image conversion
         *  This mode will be used to preview the source code
         */
        bool dryrun;
+       
        /// Should we output verbatim or escape LaTeX's special chars?
        bool verbatim;
+       
        /// Should we output captions?
        bool html_disable_captions;
+       
        /// Are we already in a paragraph?
        bool html_in_par;
+       
        /// Does the present context even permit paragraphs?
        bool html_make_pars;
+       
+       /// Are we generating this material for inclusion in a TOC-like entity?
+       bool for_toc;
+       
        /// Include all children notwithstanding the use of \includeonly
        bool includeall;
 };
index b3b75f020ee63544f98390fd9e9a9d4a374b51dd..abee04a727d42c1430274040c7a4ea977a7722ee 100644 (file)
@@ -2396,7 +2396,6 @@ docstring Paragraph::simpleLyXHTMLOnePar(Buffer const & buf,
                                    XHTMLStream & xs,
                                    OutputParams const & runparams,
                                    Font const & outerfont,
-                                               bool fortoc,
                                    pos_type initial) const
 {
        docstring retval;
@@ -2407,7 +2406,7 @@ docstring Paragraph::simpleLyXHTMLOnePar(Buffer const & buf,
 
        Layout const & style = *d->layout_;
 
-       if (!fortoc) {
+       if (!runparams.for_toc) {
                // generate a magic label for this paragraph
                string const attr = "id='" + magicLabel() + "'";
                xs << CompTag("a", attr);
@@ -2448,7 +2447,8 @@ docstring Paragraph::simpleLyXHTMLOnePar(Buffer const & buf,
                        InsetCommand const * ic = inset->asInsetCommand();
                        InsetLayout const & il = inset->getLayout();
                        InsetMath const * im = inset->asInsetMath();
-                       if (!fortoc || im || il.isInToc() || (ic && ic->isInToc())) {
+                       if (!runparams.for_toc 
+                           || im || il.isInToc() || (ic && ic->isInToc())) {
                                OutputParams np = runparams;
                                if (!il.htmlisblock())
                                        np.html_in_par = true;
index 761e6e9b5dbfe8b19e764372713eca0c89cc9426..2c04b66935081170ee7207d4ccbf552f9d102724 100644 (file)
@@ -168,7 +168,6 @@ public:
                                 XHTMLStream & xs,
                                 OutputParams const & runparams,
                                 Font const & outerfont,
-         bool fortoc = false,
                                 pos_type initial = 0) const;
 
        ///
index 0c39fcb2cc30cade97c7fb2755fe8323ccd85365..68d171a54495bc3d8141564cc6b25e051f8e0b69 100644 (file)
@@ -746,7 +746,9 @@ docstring InsetPrintIndex::xhtml(XHTMLStream &, OutputParams const & op) const
                        // modify what we get back.
                        odocstringstream ent;
                        XHTMLStream entstream(ent);
-                       par.simpleLyXHTMLOnePar(buffer(), entstream, op, dummy, true);
+                       OutputParams ours = op;
+                       ours.for_toc = true;
+                       par.simpleLyXHTMLOnePar(buffer(), entstream, ours, dummy);
        
                        // these will contain XHTML versions of the main entry, etc
                        // remember that everything will already have been escaped,
index b81f6a939323071a7676e41ed60cc2dba0c57ea0..50d713a119f991d642e4a216938f1809badd2bba 100644 (file)
@@ -131,7 +131,9 @@ docstring InsetTOC::xhtml(XHTMLStream &, OutputParams const & op) const
                        xs << StartTag("div", attr.str());
                }
                string const parattr = "href='#" + par.magicLabel() + "' class='tocarrow'";
-               par.simpleLyXHTMLOnePar(buffer(), xs, op, dummy, true);
+               OutputParams ours = op;
+               ours.for_toc = true;
+               par.simpleLyXHTMLOnePar(buffer(), xs, ours, dummy);
                xs << " ";
                xs << StartTag("a", parattr);
                // FIXME XHTML 
index 0b271dc8960e705c86a23d1b7afb3c6cfcc4d242..60df83400d5622013134536f56173ce5c1368699 100644 (file)
@@ -225,7 +225,8 @@ bool XHTMLStream::closeFontTags()
        bool noFontTags = true;
        for (; it != en; ++it) {
                if (html::isFontTag(it->tag_)) {
-                       writeError("Font tag `" + it->tag_ + "' still open in closeFontTags().");
+                       writeError("Font tag `" + it->tag_ + "' still open in closeFontTags().\n"
+                               "This is likely not a problem, but you might want to check.");
                        noFontTags = false;
                }
        }
@@ -725,7 +726,7 @@ ParagraphList::const_iterator makeEnvironmentHtml(Buffer const & buf,
                                                openItemTag(xs, style);
                                }
                                par->simpleLyXHTMLOnePar(buf, xs, runparams, 
-                                       text.outerFont(distance(begin, par)), false, sep);
+                                       text.outerFont(distance(begin, par)), sep);
                                ++par;
                                // We may not want to close the tag yet, in particular,
                                // if we're not at the end...