]> git.lyx.org Git - lyx.git/blobdiff - src/buffer.C
Add margin to paragraph dialog.
[lyx.git] / src / buffer.C
index 5f579021fb14157cb2a5ff9d63916aa1f7318906..345325a8690ed139ff531761f9963cdb45bd4eb9 100644 (file)
@@ -178,8 +178,6 @@ public:
        /// name of the file the buffer is associated with.
        FileName filename;
 
-       Messages * messages;
-
        /** Set to true only when the file is fully loaded.
         *  Used to prevent the premature generation of previews
         *  and by the citation inset.
@@ -199,7 +197,7 @@ public:
 
 Buffer::Impl::Impl(Buffer & parent, FileName const & file, bool readonly_)
        : lyx_clean(true), bak_clean(true), unnamed(false), read_only(readonly_),
-         filename(file), messages(0), file_fully_loaded(false), inset(params),
+         filename(file), file_fully_loaded(false), inset(params),
          toc_backend(&parent)
 {
        inset.setAutoBreakRows(true);
@@ -594,11 +592,6 @@ bool Buffer::readString(std::string const & s)
                break;
        }
 
-       // After we have read a file, we must ensure that the buffer
-       // language is set and used in the gui.
-       // If you know of a better place to put this, please tell me. (Lgb)
-       updateDocLang(params().language);
-
        return true;
 }
 
@@ -618,11 +611,6 @@ bool Buffer::readFile(FileName const & filename)
        if (readFile(lex, filename) != success)
                return false;
 
-       // After we have read a file, we must ensure that the buffer
-       // language is set and used in the gui.
-       // If you know of a better place to put this, please tell me. (Lgb)
-       updateDocLang(params().language);
-
        return true;
 }
 
@@ -1150,8 +1138,8 @@ int Buffer::runChktex()
        busy(true);
 
        // get LaTeX-Filename
-       string const path = temppath();
-        string const name = addName(path, getLatexName());
+       FileName const path(temppath());
+       string const name = addName(path.absFilename(), getLatexName());
        string const org_path = filePath();
 
        support::Path p(path); // path to LaTeX file
@@ -1195,7 +1183,7 @@ void Buffer::validate(LaTeXFeatures & features) const
 
        // AMS Style is at document level
        if (params().use_amsmath == BufferParams::package_on
-           || tclass.provides(LyXTextClass::amsmath))
+           || tclass.provides("amsmath"))
                features.require("amsmath");
        if (params().use_esint == BufferParams::package_on)
                features.require("esint");
@@ -1385,9 +1373,6 @@ void Buffer::changeLanguage(Language const * from, Language const * to)
        BOOST_ASSERT(from);
        BOOST_ASSERT(to);
 
-       // Take care of l10n/i18n
-       updateDocLang(to);
-
        for_each(par_iterator_begin(),
                 par_iterator_end(),
                 bind(&Paragraph::changeLanguage, _1, params(), from, to));
@@ -1397,14 +1382,6 @@ void Buffer::changeLanguage(Language const * from, Language const * to)
 }
 
 
-void Buffer::updateDocLang(Language const * nlang)
-{
-       BOOST_ASSERT(nlang);
-
-       pimpl_->messages = &getMessages(nlang->code());
-}
-
-
 bool Buffer::isMultiLingual() const
 {
        ParConstIterator end = par_iterator_end();
@@ -1474,8 +1451,9 @@ Language const * Buffer::getLanguage() const
 
 docstring const Buffer::B_(string const & l10n) const
 {
-       if (pimpl_->messages) 
-               return pimpl_->messages->get(l10n);
+       Language const * lang = pimpl_->params.language;
+       if (lang)
+               return getMessages(lang->code()).get(l10n);
 
        return _(l10n);
 }