]> git.lyx.org Git - lyx.git/blobdiff - src/buffer.C
Forgot to save changed file ;)
[lyx.git] / src / buffer.C
index 77a16b31c7d10a547cfc26089c1483527fa818cb..972698b98ef4665046fb3d23edbbb8c6efd8d962 100644 (file)
@@ -625,6 +625,10 @@ Buffer::parseSingleLyXformat2Token(LyXLex & lex, Paragraph *& par,
                        return false; // no end read yet
                }
 
+               // we have to reset the font as in the old format after a float
+               // the font was automatically reset!
+               font = LyXFont(LyXFont::ALL_INHERIT, params.language);
+
                // Here we need to check for \end_deeper and handle that
                // before we do the footnote parsing.
                // This _is_ a hack! (Lgb)
@@ -1396,10 +1400,12 @@ void Buffer::insertStringAsLines(Paragraph *& par, pos_type & pos,
        par->checkInsertChar(font);
        // insert the string, don't insert doublespace
        bool space_inserted = true;
+       bool autobreakrows = !par->inInset() ||
+               static_cast<InsetText *>(par->inInset())->getAutoBreakRows();
        for(string::const_iterator cit = str.begin();
            cit != str.end(); ++cit) {
                if (*cit == '\n') {
-                       if (par->size() || layout.keepempty) {
+                       if (autobreakrows && (par->size() || layout.keepempty)) {
                                par->breakParagraph(params, pos,
                                                    layout.isEnvironment());
                                par = par->next();
@@ -2880,13 +2886,13 @@ void reset(PAR_TAG & p1, PAR_TAG const & p2)
        p1 = static_cast<PAR_TAG>(p1 & ~p2);
 }
 
-} // namespace anon
+} // anon
 
 
 // Handle internal paragraph parsing -- layout already processed.
 void Buffer::simpleLinuxDocOnePar(ostream & os,
-                                 Paragraph * par,
-                                 Paragraph::depth_type /*depth*/)
+       Paragraph * par,
+       Paragraph::depth_type /*depth*/)
 {
        LyXLayout const & style =
                textclasslist[params.textclass][par->layout()];
@@ -3078,8 +3084,8 @@ void Buffer::simpleLinuxDocOnePar(ostream & os,
 
 
 // Print an error message.
-void Buffer::sgmlError(Paragraph * par, int pos,
-                      string const & message) const
+void Buffer::sgmlError(Paragraph * /*par*/, int /*pos*/,
+       string const & /*message*/) const
 {
 #warning This is wrong we cannot insert an inset like this!!!
        // I guess this was Jose' so I explain you more or less why this
@@ -3681,36 +3687,37 @@ Buffer::Lists const Buffer::getLists() const
 
 
 // This is also a buffer property (ale)
-vector<pair<string, string> > const Buffer::getBibkeyList()
+vector<pair<string, string> > const Buffer::getBibkeyList() const
 {
+       typedef pair<string, string> StringPair;
        /// if this is a child document and the parent is already loaded
        /// Use the parent's list instead  [ale990412]
        if (!params.parentname.empty() && bufferlist.exists(params.parentname)) {
-               Buffer * tmp = bufferlist.getBuffer(params.parentname);
+               Buffer const * tmp = bufferlist.getBuffer(params.parentname);
                if (tmp)
                        return tmp->getBibkeyList();
        }
 
-       vector<pair<string, string> > keys;
+       vector<StringPair> keys;
        Paragraph * par = paragraph;
        while (par) {
                if (par->bibkey)
-                       keys.push_back(pair<string, string>(par->bibkey->getContents(),
-                                                          par->asString(this, false)));
+                       keys.push_back(StringPair(par->bibkey->getContents(),
+                                                 par->asString(this, false)));
                par = par->next();
        }
 
        // Might be either using bibtex or a child has bibliography
        if (keys.empty()) {
-               for (inset_iterator it = inset_iterator_begin();
-                       it != inset_iterator_end(); ++it) {
+               for (inset_iterator it = inset_const_iterator_begin();
+                       it != inset_const_iterator_end(); ++it) {
                        // Search for Bibtex or Include inset
                        if ((*it)->lyxCode() == Inset::BIBTEX_CODE) {
-                               vector<pair<string,string> > tmp =
+                               vector<StringPair> tmp =
                                        static_cast<InsetBibtex*>(*it)->getKeys(this);
                                keys.insert(keys.end(), tmp.begin(), tmp.end());
                        } else if ((*it)->lyxCode() == Inset::INCLUDE_CODE) {
-                               vector<pair<string,string> > const tmp =
+                               vector<StringPair> const tmp =
                                        static_cast<InsetInclude*>(*it)->getKeys();
                                keys.insert(keys.end(), tmp.begin(), tmp.end());
                        }