X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fbuffer.C;h=f36aa069e7945b6e222e6a48f86cda9988a7a4a4;hb=3df345c9383480f68fad51feae8b9c64425c8729;hp=93ce39b729ba29ca1f34cbc2f8fa081971721181;hpb=76938908d7da15b92bad3908e71eb969c9449c0e;p=lyx.git diff --git a/src/buffer.C b/src/buffer.C index 93ce39b729..f36aa069e7 100644 --- a/src/buffer.C +++ b/src/buffer.C @@ -167,14 +167,14 @@ Buffer::~Buffer() } -string Buffer::getLatexName(bool no_path = true) const +string Buffer::getLatexName(bool no_path /* = true */) const { return ChangeExtension(MakeLatexName(filename), ".tex", no_path); } -void Buffer::setReadonly(bool flag = true) +void Buffer::setReadonly(bool flag /* = true */) { if (read_only != flag) { read_only = flag; @@ -1653,7 +1653,7 @@ void Buffer::makeLaTeXFile(string const & fname, // validate the buffer. lyxerr[Debug::LATEX] << " Validating buffer..." << endl; - LaTeXFeatures features(tclass.numLayouts()); + LaTeXFeatures features(params, tclass.numLayouts()); validate(features); lyxerr[Debug::LATEX] << " Buffer validation done." << endl; @@ -1973,13 +1973,13 @@ void Buffer::makeLaTeXFile(string const & fname, string preamble, tmppreamble; // The optional packages; - preamble = features.getPackages(params); + preamble = features.getPackages(); // this might be useful... preamble += "\n\\makeatletter\n\n"; // Some macros LyX will need - tmppreamble = features.getMacros(params); + tmppreamble = features.getMacros(); if (!tmppreamble.empty()) { preamble += "\n%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% " @@ -1988,7 +1988,7 @@ void Buffer::makeLaTeXFile(string const & fname, } // the text class specific preamble - tmppreamble = features.getTClassPreamble(params); + tmppreamble = features.getTClassPreamble(); if (!tmppreamble.empty()) { preamble += "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% " "Textclass specific LaTeX commands.\n" @@ -3721,7 +3721,7 @@ void Buffer::validate(LaTeXFeatures & features) const } if (lyxerr.debugging(Debug::LATEX)) { - features.showStruct(params); + features.showStruct(); } } @@ -3925,3 +3925,25 @@ void Buffer::Dispatch(int action, string const & argument) } // end of switch } + +void Buffer::ChangeLanguage(Language const * from, Language const * to) +{ + + LyXParagraph * par = paragraph; + while (par) { + par->ChangeLanguage(from,to); + par = par->next; + } +} + +bool Buffer::isMultiLingual() +{ + + LyXParagraph * par = paragraph; + while (par) { + if (par->isMultiLingual()) + return true; + par = par->next; + } + return false; +}