#include "Paragraph.h"
#include "ParagraphParameters.h"
#include "ParIterator.h"
+#include "TextClass.h"
#include "insets/InsetBibitem.h"
#include "insets/InsetBranch.h"
// Now remove all out of the pars which is NOT allowed in the
// new environment and set also another font if that is required.
- // Convert newline to paragraph break in ERT inset.
- // This should not be here!
- InsetCode const code = target_inset->lyxCode();
- if (code == ERT_CODE || code == LISTINGS_CODE) {
+ // Convert newline to paragraph break in ParbreakIsNewline
+ if (target_inset->getLayout().parbreakIsNewline()
+ || pars[pit].layout().parbreak_is_newline) {
for (size_t i = 0; i != insertion.size(); ++i) {
for (pos_type j = 0; j != insertion[i].size(); ++j) {
if (insertion[i].isNewline(j)) {
// create inset for graphic
InsetGraphics * inset = new InsetGraphics(cur.buffer());
InsetGraphicsParams params;
- params.filename = support::DocFileName(filename.absFileName());
+ params.filename = support::DocFileName(filename.absFileName(), false);
inset->setParams(params);
cur.recordUndo();
cur.insert(inset);