]> git.lyx.org Git - lyx.git/blobdiff - src/text2.C
Rob's latest and greatest dialog tweaking.
[lyx.git] / src / text2.C
index fcd43d880e64b3667c3c87da0c9d487f0a4a3d71..075fcc6a58b0a59c3ae56c4ec6a6b96a979a1d01 100644 (file)
@@ -39,6 +39,7 @@
 #include "insets/insetspecialchar.h"
 #include "insets/insettext.h"
 #include "insets/insetfloat.h"
+#include "insets/insetwrap.h"
 
 #include "support/LAssert.h"
 #include "support/textutils.h"
@@ -129,21 +130,12 @@ LyXFont const realizeFont(LyXFont const & font,
        while (par && par_depth && !tmpfont.resolved()) {
                par = par->outerHook();
                if (par) {
-#ifndef INHERIT_LANGUAGE
                        tmpfont.realize(par->layout()->font);
-#else
-                       tmpfont.realize(tclass[par->layout()]->font,
-                                       buf->params.language);
-#endif
                        par_depth = par->getDepth();
                }
        }
 
-#ifndef INHERIT_LANGUAGE
        tmpfont.realize(tclass.defaultfont());
-#else
-       tmpfont.realize(tclass.defaultfont(), buf->params.language);
-#endif
 
        return tmpfont;
 }
@@ -173,20 +165,12 @@ LyXFont const LyXText::getFont(Buffer const * buf, Paragraph * par,
                        LyXFont f = par->getFontSettings(buf->params, pos);
                        if (par->inInset())
                                par->inInset()->getDrawFont(f);
-#ifndef INHERIT_LANGUAGE
                        return f.realize(layout->reslabelfont);
-#else
-                       return f.realize(layout.reslabelfont, buf->params.language);
-#endif
                } else {
                        LyXFont f = par->getFontSettings(buf->params, pos);
                        if (par->inInset())
                                par->inInset()->getDrawFont(f);
-#ifndef INHERIT_LANGUAGE
                        return f.realize(layout->resfont);
-#else
-                       return f.realize(layout.resfont, buf->params.language);
-#endif
                }
        }
 
@@ -203,11 +187,8 @@ LyXFont const LyXText::getFont(Buffer const * buf, Paragraph * par,
        }
 
        LyXFont tmpfont = par->getFontSettings(buf->params, pos);
-#ifndef INHERIT_LANGUAGE
        tmpfont.realize(layoutfont);
-#else
-       tmpfont.realize(layoutfont, buf->params.language);
-#endif
+
        if (par->inInset())
                par->inInset()->getDrawFont(tmpfont);
 
@@ -283,20 +264,11 @@ void LyXText::setCharFont(Buffer const * buf, Paragraph * par,
                while (!layoutfont.resolved() && tp && tp->getDepth()) {
                        tp = tp->outerHook();
                        if (tp)
-#ifndef INHERIT_LANGUAGE
                                layoutfont.realize(tp->layout()->font);
-#else
-                               layoutfont.realize(tclass[tp->layout()].font,
-                                                  buf->params.language);
-#endif
                }
        }
 
-#ifndef INHERIT_LANGUAGE
        layoutfont.realize(tclass.defaultfont());
-#else
-       layoutfont.realize(tclass.defaultfont(), buf->params.language);
-#endif
 
        // Now, reduce font against full layout font
        font.reduce(layoutfont);
@@ -575,8 +547,6 @@ void  LyXText::incDepth(BufferView * bview)
        // and sel_end cursor
        cursor = selection.start;
 
-       bool anything_changed = false;
-
        while (true) {
                // NOTE: you can't change the depth of a bibliography entry
                if (cursor.par()->layout()->labeltype != LABEL_BIBLIO) {
@@ -586,7 +556,6 @@ void  LyXText::incDepth(BufferView * bview)
                                if (cursor.par()->getDepth()
                                    < prev->getMaxDepthAfter()) {
                                        cursor.par()->params().depth(cursor.par()->getDepth() + 1);
-                                       anything_changed = true;
                                }
                        }
                }
@@ -595,16 +564,6 @@ void  LyXText::incDepth(BufferView * bview)
                cursor.par(cursor.par()->next());
        }
 
-       // if nothing changed set all depth to 0
-       if (!anything_changed) {
-               cursor = selection.start;
-               while (cursor.par() != selection.end.par()) {
-                       cursor.par()->params().depth(0);
-                       cursor.par(cursor.par()->next());
-               }
-               cursor.par()->params().depth(0);
-       }
-
        redoParagraphs(bview, selection.start, endpar);
 
        // we have to reset the selection, because the
@@ -700,12 +659,8 @@ void LyXText::setFont(BufferView * bview, LyXFont const & font, bool toggleall)
                current_font = real_current_font;
                current_font.reduce(layoutfont);
                // And resolve it completely
-#ifndef INHERIT_LANGUAGE
                real_current_font.realize(layoutfont);
-#else
-               real_current_font.realize(layoutfont,
-                                         bview->buffer()->params.language);
-#endif
+
                return;
        }
 
@@ -1361,7 +1316,8 @@ void LyXText::setCounter(Buffer const * buf, Paragraph * par) const
                        while (tmppar && tmppar->inInset()
                               // the single '=' is intended below
                               && (in = tmppar->inInset()->owner())) {
-                               if (in->lyxCode() == Inset::FLOAT_CODE) {
+                               if (in->lyxCode() == Inset::FLOAT_CODE ||
+                                   in->lyxCode() == Inset::WRAP_CODE) {
                                        isOK = true;
                                        break;
                                } else {