]> git.lyx.org Git - lyx.git/blobdiff - src/output_xhtml.cpp
return from switch
[lyx.git] / src / output_xhtml.cpp
index 037988ba69e684ef1a86ddb65fa81601e57c62e3..469b316ea4809abd3a48bcf510e00050eb2ecfe8 100644 (file)
@@ -172,6 +172,7 @@ string fontToTag(html::FontTypes type)
        case FT_DBAR:
                return "u";
        case FT_SOUT:
+       case FT_XOUT:
                return "del";
        case FT_ITALIC:
                return "i";
@@ -211,6 +212,7 @@ string fontToAttribute(html::FontTypes type)
                return "";
        case FT_DBAR:
                return "class='dline'";
+       case FT_XOUT:
        case FT_SOUT:
                return "class='strikeout'";
        case FT_WAVE:
@@ -326,7 +328,7 @@ void XHTMLStream::writeError(std::string const & s) const
 namespace {
        // an illegal tag for internal use
        static html::StartTag const parsep_tag("&LyX_parsep_tag&");
-}
+} // namespace
 
 
 bool XHTMLStream::closeFontTags()
@@ -358,7 +360,7 @@ bool XHTMLStream::closeFontTags()
 #ifdef XHTML_DEBUG
        dumpTagStack("End Close Font Tags");
 #endif
-       
+
        if (*curtag == parsep_tag)
                return true;
 
@@ -405,7 +407,7 @@ void XHTMLStream::endDivision()
 #ifdef XHTML_DEBUG
                dumpTagStack("EndDivision");
 #endif
-               
+
                return;
        }
 
@@ -868,7 +870,7 @@ ParagraphList::const_iterator makeParagraphs(Buffer const & buf,
                //
                // But there is also a special case, and we first see whether we are in it.
                // We do not want to open the paragraph tag if this paragraph contains
-               // only one item, and that item is "inline", i.e., not HTMLIsBlock (such 
+               // only one item, and that item is "inline", i.e., not HTMLIsBlock (such
                // as a branch). On the other hand, if that single item has a font change
                // applied to it, then we still do need to open the paragraph.
                //
@@ -876,7 +878,7 @@ ParagraphList::const_iterator makeParagraphs(Buffer const & buf,
                // because of branches, e.g., a branch that contains an entire new section.
                // We do not really want to wrap that whole thing in a <div>...</div>.
                bool special_case = false;
-               Inset const * specinset = par->size() == 1 ? par->getInset(0) : 0;
+               Inset const * specinset = par->size() == 1 ? par->getInset(0) : nullptr;
                if (specinset && !specinset->getLayout().htmlisblock()) {
                        Layout const & style = par->layout();
                        FontInfo const first_font = style.labeltype == LABEL_MANUAL ?
@@ -904,13 +906,13 @@ ParagraphList::const_iterator makeParagraphs(Buffer const & buf,
                        || (!open_par && runparams.html_in_par && par == pbegin && nextpar != pend);
 
                if (open_par) {
-                       // We do not issue the paragraph id if we are doing 
+                       // We do not issue the paragraph id if we are doing
                        // this for the TOC (or some similar purpose)
                        openParTag(xs, lay, par->params(),
                                   runparams.for_toc ? "" : par->magicLabel());
                }
 
-               docstring const deferred = par->simpleLyXHTMLOnePar(buf, xs, 
+               docstring const deferred = par->simpleLyXHTMLOnePar(buf, xs,
                        runparams, text.outerFont(distance(begin, par)),
                        open_par, close_par);
 
@@ -972,7 +974,7 @@ ParagraphList::const_iterator makeEnvironment(Buffer const & buf,
        xs << html::CR();
 
        // we will on occasion need to remember a layout from before.
-       Layout const * lastlay = 0;
+       Layout const * lastlay = nullptr;
 
        while (par != pend) {
                Layout const & style = par->layout();
@@ -1000,9 +1002,9 @@ ParagraphList::const_iterator makeEnvironment(Buffer const & buf,
                        // started---which we will be if the depth is the same.
                        if (par->params().depth() == origdepth) {
                                LATTEST(bstyle == style);
-                               if (lastlay != 0) {
+                               if (lastlay != nullptr) {
                                        closeItemTag(xs, *lastlay);
-                                       lastlay = 0;
+                                       lastlay = nullptr;
                                }
 
                                // this will be positive, if we want to skip the
@@ -1091,7 +1093,7 @@ ParagraphList::const_iterator makeEnvironment(Buffer const & buf,
                }
        }
 
-       if (lastlay != 0)
+       if (lastlay != nullptr)
                closeItemTag(xs, *lastlay);
        closeTag(xs, bstyle);
        xs << html::CR();
@@ -1111,24 +1113,14 @@ void makeCommand(Buffer const & buf,
                    documentClass().counters().step(style.counter, OutputUpdate);
 
        bool const make_parid = !runparams.for_toc && runparams.html_make_pars;
-       
-       if (style.labeltype == LABEL_ABOVE)
-               xs << html::StartTag("div")
-                  << pbegin->params().labelString()
-                  << html::EndTag("div");
-       else if (style.labeltype == LABEL_CENTERED)
-               xs << html::StartTag("div", "style = \"text-align: center;\"")
-                  << pbegin->params().labelString()
-                  << html::EndTag("div");
 
        openParTag(xs, style, pbegin->params(),
                   make_parid ? pbegin->magicLabel() : "");
 
        // Label around sectioning number:
        // FIXME Probably need to account for LABEL_MANUAL
-       if (style.labeltype != LABEL_NO_LABEL &&
-           style.labeltype != LABEL_ABOVE &&
-           style.labeltype != LABEL_CENTERED ) {
+       // FIXME Probably also need now to account for labels ABOVE and CENTERED.
+       if (style.labeltype != LABEL_NO_LABEL) {
                openLabelTag(xs, style);
                xs << pbegin->params().labelString();
                closeLabelTag(xs, style);
@@ -1164,9 +1156,9 @@ void xhtmlParagraphs(Text const & text,
        OutputParams ourparams = runparams;
        ParagraphList::const_iterator const pend =
                (epit == (int) paragraphs.size()) ?
-                       paragraphs.end() : paragraphs.constIterator(epit);
+                       paragraphs.end() : paragraphs.iterator_at(epit);
        while (bpit < epit) {
-               ParagraphList::const_iterator par = paragraphs.constIterator(bpit);
+               ParagraphList::const_iterator par = paragraphs.iterator_at(bpit);
                if (par->params().startOfAppendix()) {
                        // We want to reset the counter corresponding to toplevel sectioning
                        Layout const & lay =