]> git.lyx.org Git - lyx.git/blobdiff - src/output_linuxdoc.C
Change to use preffered calling of Boost.Function
[lyx.git] / src / output_linuxdoc.C
index c51f2f2c63461f2488f1ffaaf568d636cad7524a..060593c0e506b756fa8f6facc38ced0628852d64 100644 (file)
@@ -23,9 +23,6 @@
 
 #include <stack>
 
-#ifdef HAVE_LOCALE
-#endif
-
 using std::ostream;
 using std::stack;
 using std::vector;
@@ -41,13 +38,13 @@ void linuxdocParagraphs(Buffer const & buf,
        string item_name;
        vector<string> environment_stack(5);
 
-       ParagraphList::iterator pit = const_cast<ParagraphList&>(paragraphs).begin();
-       ParagraphList::iterator pend = const_cast<ParagraphList&>(paragraphs).end();
+       ParagraphList::const_iterator pit = paragraphs.begin();
+       ParagraphList::const_iterator pend = paragraphs.end();
        for (; pit != pend; ++pit) {
                LyXLayout_ptr const & style = pit->layout();
                // treat <toc> as a special case for compatibility with old code
-               if (pit->isInset(0)) {
-                       InsetBase * inset = pit->getInset(0);
+               if (!pit->empty() && pit->isInset(0)) {
+                       InsetBase const * inset = pit->getInset(0);
                        if (inset->lyxCode() == InsetOld::TOC_CODE) {
                                string const temp = "toc";
                                sgml::openTag(os, depth, false, temp);
@@ -136,7 +133,7 @@ void linuxdocParagraphs(Buffer const & buf,
                }
 
                pit->simpleLinuxDocOnePar(buf, os,
-                       outerFont(pit - const_cast<ParagraphList&>(paragraphs).begin(), paragraphs),
+                       outerFont(pit - paragraphs.begin(), paragraphs),
                                          runparams, depth);
 
                os << "\n";