]> git.lyx.org Git - lyx.git/blobdiff - src/output_xhtml.cpp
Fix compatibility issue with 64-bit cygwin.
[lyx.git] / src / output_xhtml.cpp
index 5130740fb743a250e556f69527e4e09c05d3586b..0a0bfd3cbe328f105941b066eaf53e0552851a7d 100644 (file)
@@ -742,35 +742,15 @@ XHTMLStream & XHTMLStream::operator<<(html::EndTag const & etag)
        // curtag is now the one we actually want.
        os_ << curtag->writeEndTag();
        tag_stack_.pop_back();
-       
+
        return *this;
 }
 
 // End code for XHTMLStream
 
 namespace {
-       
-// convenience functions
-
-inline void openTag(XHTMLStream & xs, Layout const & lay)
-{
-       xs << html::StartTag(lay.htmltag(), lay.htmlattr());
-}
-
-
-void openTag(XHTMLStream & xs, Layout const & lay, 
-             ParagraphParameters const & params)
-{
-       // FIXME Are there other things we should handle here?
-       string const align = alignmentToCSS(params.align());
-       if (align.empty()) {
-               openTag(xs, lay);
-               return;
-       }
-       string attrs = lay.htmlattr() + " style='text-align: " + align + ";'";
-       xs << html::StartTag(lay.htmltag(), attrs);
-}
 
+// convenience functions
 
 inline void openParTag(XHTMLStream & xs, Layout const & lay,
                        std::string parlabel)
@@ -851,7 +831,7 @@ ParagraphList::const_iterator findLastParagraph(
 
 
 ParagraphList::const_iterator findEndOfEnvironment(
-               ParagraphList::const_iterator const pstart,
+               ParagraphList::const_iterator const pstart,
                ParagraphList::const_iterator const & pend)
 {
        ParagraphList::const_iterator p = pstart;
@@ -864,15 +844,19 @@ ParagraphList::const_iterator findEndOfEnvironment(
                // it can happen. We pretend that it's just at lowest depth.
                if (style.latextype == LATEX_COMMAND)
                        return p;
+
                // If depth is down, we're done
                if (p->params().depth() < depth)
                        return p;
+
                // If depth is up, we're not done
                if (p->params().depth() > depth)
                        continue;
-               // Now we know we are at the same depth
-               if (style.latextype == LATEX_PARAGRAPH
-                   || style.latexname() != bstyle.latexname())
+
+               // FIXME I am not sure about the first check.
+               // Surely we *could* have different layouts that count as
+               // LATEX_PARAGRAPH, right? 
+               if (style.latextype == LATEX_PARAGRAPH || style != bstyle)
                        return p;
        }
        return pend;