]> git.lyx.org Git - lyx.git/blobdiff - src/BufferView.cpp
Move OS specific code to proper place. Also make sure that no other
[lyx.git] / src / BufferView.cpp
index 936dcffc9af6abe4442a3c424506bd7030a23eef..ec1f15704095df8eaa45af178939744c56f5bdf8 100644 (file)
@@ -41,7 +41,6 @@
 #include "LyXRC.h"
 #include "MetricsInfo.h"
 #include "Paragraph.h"
-#include "paragraph_funcs.h"
 #include "ParagraphParameters.h"
 #include "ParIterator.h"
 #include "Session.h"
@@ -1019,10 +1018,12 @@ bool BufferView::getStatus(FuncRequest const & cmd, FuncStatus & flag)
                break;
 
        case LFUN_DIALOG_SHOW_NEW_INSET:
+               // FIXME: this is wrong, but I do not understand the
+               // intent (JMarc)
                if (cur.inset().lyxCode() == CAPTION_CODE)
                        return cur.inset().getStatus(cur, cmd, flag);
-               flag.setEnabled(cur.inset().lyxCode() != ERT_CODE &&
-                       cur.inset().lyxCode() != LISTINGS_CODE);
+               // FIXME we should consider passthru paragraphs too.
+               flag.setEnabled(!cur.inset().getLayout().isPassThru());
                break;
 
        default:
@@ -2445,9 +2446,9 @@ void BufferView::insertPlaintextFile(FileName const & f, bool asParagraph)
        cap::replaceSelection(cur);
        buffer_.undo().recordUndo(cur);
        if (asParagraph)
-               cur.innerText()->insertStringAsParagraphs(cur, tmpstr);
+               cur.innerText()->insertStringAsParagraphs(cur, tmpstr, cur.current_font);
        else
-               cur.innerText()->insertStringAsLines(cur, tmpstr);
+               cur.innerText()->insertStringAsLines(cur, tmpstr, cur.current_font);
 
        updateMetrics();
        buffer_.changed();