]> git.lyx.org Git - lyx.git/blobdiff - src/bufferview_funcs.C
remove unused code
[lyx.git] / src / bufferview_funcs.C
index 768f700a9b7b180354850dd424126f8e7044d9f9..61f6a226dfe34bcd5377e0de99aa8afebddbc839 100644 (file)
@@ -15,7 +15,7 @@
 #endif
 
 #include "bufferview_funcs.h"
-#include "LyXView.h"
+#include "frontends/LyXView.h"
 #include "BufferView.h"
 #include "paragraph.h"
 #include "lyxfont.h"
@@ -25,7 +25,6 @@
 #include "language.h"
 #include "gettext.h"
 #include "ParagraphParameters.h"
-#include "lyxtextclasslist.h"
 
 #include "frontends/Alert.h"
 
@@ -159,7 +158,7 @@ string const currentState(BufferView * bv)
                Buffer * buffer = bv->buffer();
                LyXFont font = text->real_current_font;
                LyXFont const & defaultfont =
-                       textclasslist[buffer->params.textclass].defaultfont();
+                       buffer->params.getLyXTextClass().defaultfont();
                font.reduce(defaultfont);
 
                state << _("Font:") << ' '
@@ -206,34 +205,37 @@ string const currentState(BufferView * bv)
 }
 
 
-/* -------> Does the actual toggle job of the XxxCB() calls above.
+/* Does the actual toggle job of the calls above.
  * Also shows the current font state.
  */
 void toggleAndShow(BufferView * bv, LyXFont const & font, bool toggleall)
 {
-       if (bv->available()) {
-               if (bv->theLockingInset()) {
-                       bv->theLockingInset()->setFont(bv, font, toggleall);
-                       return;
-               }
-               LyXText * text = bv->getLyXText();
-               if (!text)
-                       return;
-
-               bv->hideCursor();
-               bv->update(text, BufferView::SELECT|BufferView::FITCUR);
-               text->toggleFree(bv, font, toggleall);
-               bv->update(text, BufferView::SELECT|BufferView::FITCUR|BufferView::CHANGE);
-
-               if (font.language() != ignore_language ||
-                   font.number() != LyXFont::IGNORE) {
-                       LyXCursor & cursor = text->cursor;
-                       text->computeBidiTables(bv->buffer(), cursor.row());
-                       if (cursor.boundary() !=
-                           text->isBoundary(bv->buffer(), cursor.par(), cursor.pos(),
-                                            text->real_current_font))
-                               text->setCursor(bv, cursor.par(), cursor.pos(),
-                                               false, !cursor.boundary());
-               }
+       if (!bv->available())
+               return;
+       if (bv->theLockingInset()) {
+               bv->theLockingInset()->setFont(bv, font, toggleall);
+               return;
+       }
+       LyXText * text = bv->getLyXText();
+       // FIXME: can this happen ?? 
+       if (!text)
+               return;
+
+       bv->hideCursor();
+       bv->update(text, BufferView::SELECT | BufferView::FITCUR);
+       text->toggleFree(bv, font, toggleall);
+       bv->update(text, BufferView::SELECT | BufferView::FITCUR | BufferView::CHANGE);
+
+       if (font.language() != ignore_language ||
+           font.number() != LyXFont::IGNORE) {
+               LyXCursor & cursor = text->cursor;
+               text->computeBidiTables(bv->buffer(), cursor.row());
+               if (cursor.boundary() !=
+                   text->isBoundary(bv->buffer(), cursor.par(), cursor.pos(),
+                                    text->real_current_font))
+                       text->setCursor(bv, cursor.par(), cursor.pos(),
+                                       false, !cursor.boundary());
        }
 }