]> git.lyx.org Git - lyx.git/blobdiff - src/buffer.C
Hotfix to move cursor to the right when pressing M-m g x in text mode.
[lyx.git] / src / buffer.C
index 77a16b31c7d10a547cfc26089c1483527fa818cb..d55a1b38357ba2447ee57867bbd40936bb993ea2 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