X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fbuffer.C;h=77851ce8d3005b65e76321a391f650b7942c388d;hb=9dafe9b9a5cb12e19e0f3a1a9669d81dc140b0e3;hp=e888e3588ea81529d03117dfe5d4169d4a920ae8;hpb=59e18b17aec378d71ca7d8ef3e566be40c35aaf1;p=lyx.git diff --git a/src/buffer.C b/src/buffer.C index e888e3588e..77851ce8d3 100644 --- a/src/buffer.C +++ b/src/buffer.C @@ -66,7 +66,6 @@ #include "insets/insettoc.h" #include "insets/insetparent.h" #include "insets/insetspecialchar.h" -#include "insets/figinset.h" #include "insets/insettext.h" #include "insets/insetert.h" #include "insets/insetgraphics.h" @@ -299,7 +298,9 @@ std::stack ert_stack; ErtComp ert_comp; #endif +#ifdef WITH_WARNINGS #warning And _why_ is this here? (Lgb) +#endif int unknown_layouts; int unknown_tokens; @@ -406,7 +407,7 @@ void Buffer::insertErtContents(Paragraph * par, int & pos, bool set_inactive) if (!ert_comp.contents.empty()) { lyxerr[Debug::INSETS] << "ERT contents:\n'" << ert_comp.contents << "'" << endl; - Inset * inset = new InsetERT(ert_comp.contents, true); + Inset * inset = new InsetERT(params.language, ert_comp.contents, true); par->insertInset(pos++, inset, ert_comp.font); ert_comp.contents.erase(); } @@ -1530,7 +1531,7 @@ void Buffer::readInset(LyXLex & lex, Paragraph *& par, } else if (tmptok == "Note") { inset = new InsetNote; } else if (tmptok == "Include") { - InsetCommandParams p( "Include" ); + InsetCommandParams p("Include"); inset = new InsetInclude(p, *this); } else if (tmptok == "ERT") { inset = new InsetERT; @@ -2086,7 +2087,7 @@ void Buffer::makeLaTeXFile(string const & fname, // original_path is set. This is done for usual tex-file, but not // for nice-latex-file. (Matthias 250696) if (!only_body) { - if (!nice){ + if (!nice) { // code for usual, NOT nice-latex-file ofs << "\\batchmode\n"; // changed // from \nonstopmode @@ -2185,7 +2186,7 @@ void Buffer::makeLaTeXFile(string const & fname, } string strOptions(options.str().c_str()); - if (!strOptions.empty()){ + if (!strOptions.empty()) { strOptions = strip(strOptions, ','); ofs << '[' << strOptions << ']'; } @@ -2692,7 +2693,7 @@ void Buffer::makeLinuxDocFile(string const & fname, bool nice, bool body_only) if (par->isInset(0)) { Inset * inset = par->getInset(0); Inset::Code lyx_code = inset->lyxCode(); - if (lyx_code == Inset::TOC_CODE){ + if (lyx_code == Inset::TOC_CODE) { string const temp = "toc"; sgmlOpenTag(ofs, depth, temp); @@ -2728,7 +2729,7 @@ void Buffer::makeLinuxDocFile(string const & fname, bool nice, bool body_only) _("Error : Wrong depth for" " LatexType Command.\n")); - if (!environment_stack[depth].empty()){ + if (!environment_stack[depth].empty()) { sgmlCloseTag(ofs, depth, environment_stack[depth]); ofs << "

"; @@ -2861,7 +2862,7 @@ void operator|=(PAR_TAG & p1, PAR_TAG const & p2) inline void reset(PAR_TAG & p1, PAR_TAG const & p2) { - p1 = static_cast( p1 & ~p2); + p1 = static_cast(p1 & ~p2); } } // namespace anon @@ -2986,7 +2987,7 @@ void Buffer::simpleLinuxDocOnePar(ostream & os, } list < PAR_TAG > temp; - while (!tag_state.empty() && tag_close ) { + while (!tag_state.empty() && tag_close) { PAR_TAG k = tag_state.top(); tag_state.pop(); os << ""; @@ -3227,7 +3228,7 @@ void Buffer::makeDocBookFile(string const & fname, bool nice, bool only_body) if (par->isInset(0)) { Inset * inset = par->getInset(0); Inset::Code lyx_code = inset->lyxCode(); - if (lyx_code == Inset::LABEL_CODE){ + if (lyx_code == Inset::LABEL_CODE) { command_name += " id=\""; command_name += (static_cast(inset))->getContents(); command_name += "\""; @@ -3251,7 +3252,7 @@ void Buffer::makeDocBookFile(string const & fname, bool nice, bool only_body) } if (environment_stack[depth] != style.latexname()) { - if(environment_stack.size() == depth + 1) { + if (environment_stack.size() == depth + 1) { environment_stack.push_back("!-- --"); environment_inner.push_back("!-- --"); } @@ -3274,7 +3275,7 @@ void Buffer::makeDocBookFile(string const & fname, bool nice, bool only_body) if (style.latextype == LATEX_ENVIRONMENT) { if (!style.latexparam().empty()) { - if(style.latexparam() == "CDATA") + if (style.latexparam() == "CDATA") ofs << ""; else sgmlCloseTag(ofs, depth + command_depth, @@ -3398,18 +3399,23 @@ void Buffer::simpleDocBookOnePar(ostream & os, if (font.emph() == LyXFont::ON) { os << ""; emph_flag = true; - }else if(i) { + } else if (i) { os << ""; emph_flag = false; } } - if ( par->isInset(i) ) { + if (par->isInset(i)) { Inset * inset = par->getInset(i); // don't print the inset in position 0 if desc_on == 3 (label) - if ( i || desc_on != 3) + if ( i || desc_on != 3) { + if(style.latexparam() == "CDATA") + os << "]]>"; inset->docbook(this, os); + if(style.latexparam() == "CDATA") + os << "getChar(i); string sgml_string; @@ -3417,7 +3423,7 @@ void Buffer::simpleDocBookOnePar(ostream & os, if (style.pass_thru) { os << c; - } else if(style.free_spacing || par->isFreeSpacing() || c != ' ') { + } else if (style.free_spacing || par->isFreeSpacing() || c != ' ') { os << sgml_string; } else if (desc_on ==1) { ++char_line_count; @@ -3439,7 +3445,7 @@ void Buffer::simpleDocBookOnePar(ostream & os, // not closed... os << ""; } - if(style.free_spacing) os << '\n'; + if (style.free_spacing) os << '\n'; } @@ -3484,7 +3490,7 @@ int Buffer::runChktex() // if we removed error insets before we ran chktex or if we inserted // error insets after we ran chktex, this must be run: - if (removedErrorInsets || res){ + if (removedErrorInsets || res) { users->redraw(); users->fitCursor(); }