Add literal param to InsetInclude

This is used by lstinput

File format change.

Fixes: #10544.
This commit is contained in:
Juergen Spitzmueller 2018-02-23 08:58:16 +01:00
parent ed331bedd6
commit e0a5babde7
8 changed files with 397 additions and 267 deletions

View File

@ -7,6 +7,11 @@ changes happened in particular if possible. A good example would be
----------------------- -----------------------
2018-02-23 Jürgen Spitzmüller <j.spitzmueller@gmx.de>
* format incremented to 545: Add "literal" param to inset include
This is used by the lstinput caption.
2017-06-06 Enrico Forestieri <forenr@lyx.org> 2017-06-06 Enrico Forestieri <forenr@lyx.org>
* Format incremented to 544: support for minted. * Format incremented to 544: support for minted.
The listings inset now supports also the minted package. The listings inset now supports also the minted package.

View File

@ -1,6 +1,6 @@
# This file is part of lyx2lyx # This file is part of lyx2lyx
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Copyright (C) 2002-2015 The LyX Team # Copyright (C) 2002-2018 The LyX Team
# Copyright (C) 2002-2004 Dekel Tsur <dekel@lyx.org> # Copyright (C) 2002-2004 Dekel Tsur <dekel@lyx.org>
# Copyright (C) 2002-2006 José Matos <jamatos@lyx.org> # Copyright (C) 2002-2006 José Matos <jamatos@lyx.org>
# #
@ -92,8 +92,9 @@ format_relation = [("0_06", [200], minor_versions("0.6" , 4)),
("1_6", list(range(277,346)), minor_versions("1.6" , 10)), ("1_6", list(range(277,346)), minor_versions("1.6" , 10)),
("2_0", list(range(346,414)), minor_versions("2.0" , 8)), ("2_0", list(range(346,414)), minor_versions("2.0" , 8)),
("2_1", list(range(414,475)), minor_versions("2.1" , 5)), ("2_1", list(range(414,475)), minor_versions("2.1" , 5)),
("2_2", list(range(475,509)), minor_versions("2.2" , 0)), ("2_2", list(range(475,509)), minor_versions("2.2" , 4)),
("2_3", (), minor_versions("2.3" , 0)) ("2_3", list(range(509,545)), minor_versions("2.3" , 0)),
("2_4", (), minor_versions("2.4" , 0))
] ]
#################################################################### ####################################################################

View File

@ -34,6 +34,7 @@ dist_lyx2lyx_PYTHON = \
lyx_2_1.py \ lyx_2_1.py \
lyx_2_2.py \ lyx_2_2.py \
lyx_2_3.py \ lyx_2_3.py \
lyx_2_4.py \
profiling.py \ profiling.py \
test_parser_tools.py test_parser_tools.py

105
lib/lyx2lyx/lyx_2_4.py Normal file
View File

@ -0,0 +1,105 @@
# -*- coding: utf-8 -*-
# This file is part of lyx2lyx
# Copyright (C) 2018 The LyX team
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
""" Convert files to the file format generated by lyx 2.4"""
import re, string
import unicodedata
import sys, os
# Uncomment only what you need to import, please.
from parser_tools import (find_end_of_inset, find_token)
# del_token, del_value, del_complete_lines,
# find_complete_lines, find_end_of, find_end_of_layout,
# find_re, find_substring, find_token_backwards,
# get_containing_inset, get_containing_layout, get_bool_value, get_value,
# get_quoted_value, is_in_inset, set_bool_value
# find_tokens, find_token_exact, check_token, get_option_value
#from lyx2lyx_tools import (add_to_preamble, put_cmd_in_ert, revert_font_attrs,
# insert_to_preamble, latex_length)
# get_ert, lyx2latex, lyx2verbatim, length_in_bp, convert_info_insets
# revert_flex_inset, hex2ratio, str2bool
####################################################################
# Private helper functions
###############################################################################
###
### Conversion and reversion routines
###
###############################################################################
def convert_lst_literalparam(document):
" Add param literal to include inset "
i = 0
while True:
i = find_token(document.body, '\\begin_inset CommandInset include', i)
if i == -1:
break
j = find_end_of_inset(document.body, i)
if j == -1:
document.warning("Malformed LyX document: Can't find end of command inset at line %d" % i)
i += 1
continue
while i < j and document.body[i].strip() != '':
i += 1
document.body.insert(i, "literal \"true\"")
def revert_lst_literalparam(document):
" Remove param literal from include inset "
i = 0
while True:
i = find_token(document.body, '\\begin_inset CommandInset include', i)
if i == -1:
break
j = find_end_of_inset(document.body, i)
if j == -1:
document.warning("Malformed LyX document: Can't find end of include inset at line %d" % i)
i += 1
continue
k = find_token(document.body, 'literal', i, j)
if k == -1:
i += 1
continue
del document.body[k]
##
# Conversion hub
#
supported_versions = ["2.4.0", "2.4"]
convert = [
[545, [convert_lst_literalparam]]
]
revert = [
[544, [revert_lst_literalparam]]
]
if __name__ == "__main__":
pass

View File

@ -64,6 +64,7 @@ GuiInclude::GuiInclude(GuiView & lv)
connect(previewCB, SIGNAL(clicked()), this, SLOT(change_adaptor())); connect(previewCB, SIGNAL(clicked()), this, SLOT(change_adaptor()));
connect(captionLE, SIGNAL(textChanged(const QString&)), this, SLOT(change_adaptor())); connect(captionLE, SIGNAL(textChanged(const QString&)), this, SLOT(change_adaptor()));
connect(labelLE, SIGNAL(textChanged(const QString&)), this, SLOT(change_adaptor())); connect(labelLE, SIGNAL(textChanged(const QString&)), this, SLOT(change_adaptor()));
connect(literalCB, SIGNAL(clicked()), this, SLOT(change_adaptor()));
connect(listingsED, SIGNAL(textChanged()), this, SLOT(change_adaptor())); connect(listingsED, SIGNAL(textChanged()), this, SLOT(change_adaptor()));
connect(listingsED, SIGNAL(textChanged()), this, SLOT(setListingsMsg())); connect(listingsED, SIGNAL(textChanged()), this, SLOT(setListingsMsg()));
connect(bypassCB, SIGNAL(clicked()), this, SLOT(change_adaptor())); connect(bypassCB, SIGNAL(clicked()), this, SLOT(change_adaptor()));
@ -227,6 +228,7 @@ void GuiInclude::paramsToDialog(InsetCommandParams const & icp)
string extra = getStringFromVector(pars); string extra = getStringFromVector(pars);
listingsED->setPlainText(toqstr(InsetListingsParams(extra).separatedParams())); listingsED->setPlainText(toqstr(InsetListingsParams(extra).separatedParams()));
} }
literalCB->setChecked(icp["literal"] == "true");
// Make sure that the bc is in the INITIAL state // Make sure that the bc is in the INITIAL state
if (bc().policy().buttonStatus(ButtonPolicy::OKAY)) if (bc().policy().buttonStatus(ButtonPolicy::OKAY))
@ -265,6 +267,8 @@ void GuiInclude::applyView()
else else
params_.setCmdName("verbatiminput"); params_.setCmdName("verbatiminput");
} }
params_["literal"] = literalCB->isChecked()
? from_ascii("true") : from_ascii("false");
} }

View File

@ -1,58 +1,197 @@
<ui version="4.0" > <?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>IncludeUi</class> <class>IncludeUi</class>
<widget class="QDialog" name="IncludeUi" > <widget class="QDialog" name="IncludeUi">
<property name="geometry" > <property name="geometry">
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>371</width> <width>363</width>
<height>374</height> <height>470</height>
</rect> </rect>
</property> </property>
<property name="windowTitle" > <property name="windowTitle">
<string/> <string/>
</property> </property>
<property name="sizeGripEnabled" > <property name="sizeGripEnabled">
<bool>true</bool> <bool>true</bool>
</property> </property>
<layout class="QGridLayout" > <layout class="QGridLayout" name="gridLayout_2">
<property name="margin" > <item row="0" column="0">
<number>9</number> <widget class="QLabel" name="filenameLA">
<property name="toolTip">
<string/>
</property> </property>
<property name="spacing" > <property name="text">
<string>&amp;File:</string>
</property>
<property name="buddy">
<cstring>filenameED</cstring>
</property>
</widget>
</item>
<item row="0" column="1" colspan="2">
<widget class="QLineEdit" name="filenameED">
<property name="toolTip">
<string>File name to include</string>
</property>
</widget>
</item>
<item row="0" column="4">
<widget class="QPushButton" name="browsePB">
<property name="toolTip">
<string>Select a file</string>
</property>
<property name="text">
<string>&amp;Browse...</string>
</property>
</widget>
</item>
<item row="1" column="0" colspan="2">
<widget class="QLabel" name="TextLabel1">
<property name="text">
<string>&amp;Include Type:</string>
</property>
<property name="buddy">
<cstring>typeCO</cstring>
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="QComboBox" name="typeCO">
<item>
<property name="text">
<string>Include</string>
</property>
</item>
<item>
<property name="text">
<string>Input</string>
</property>
</item>
<item>
<property name="text">
<string>Verbatim</string>
</property>
</item>
<item>
<property name="text">
<string>Program Listing</string>
</property>
</item>
</widget>
</item>
<item row="1" column="3">
<spacer>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Expanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>28</width>
<height>28</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="4">
<widget class="QPushButton" name="editPB">
<property name="toolTip">
<string>Edit the file</string>
</property>
<property name="text">
<string>&amp;Edit</string>
</property>
</widget>
</item>
<item row="2" column="0" colspan="5">
<layout class="QHBoxLayout">
<property name="spacing">
<number>6</number> <number>6</number>
</property> </property>
<item row="3" column="0" colspan="6" > <property name="leftMargin">
<widget class="QGroupBox" name="listingsGB" > <number>0</number>
<property name="sizePolicy" > </property>
<sizepolicy> <property name="topMargin">
<hsizetype>7</hsizetype> <number>0</number>
<vsizetype>7</vsizetype> </property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QCheckBox" name="visiblespaceCB">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch> <horstretch>0</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
<property name="title" > <property name="toolTip">
<string>Underline spaces in generated output</string>
</property>
<property name="text">
<string>&amp;Mark spaces in output</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="previewCB">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>Show LaTeX preview</string>
</property>
<property name="text">
<string>&amp;Show preview</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="3" column="0" colspan="5">
<widget class="QGroupBox" name="listingsGB">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="title">
<string>Listing Parameters</string> <string>Listing Parameters</string>
</property> </property>
<layout class="QGridLayout" > <layout class="QGridLayout" name="gridLayout">
<property name="margin" > <item row="1" column="1">
<number>9</number> <widget class="QLineEdit" name="labelLE"/>
</item>
<item row="1" column="0">
<widget class="QLabel" name="labelLabel">
<property name="text">
<string>&amp;Label:</string>
</property> </property>
<property name="spacing" > <property name="buddy">
<number>6</number> <cstring>labelLE</cstring>
</property> </property>
<item row="3" column="1" > </widget>
<widget class="QTextEdit" name="listingsED" > </item>
<property name="sizePolicy" > <item row="4" column="1">
<sizepolicy> <widget class="QTextEdit" name="listingsED">
<hsizetype>5</hsizetype> <property name="sizePolicy">
<vsizetype>7</vsizetype> <sizepolicy hsizetype="Preferred" vsizetype="Expanding">
<horstretch>0</horstretch> <horstretch>0</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
<property name="minimumSize" > <property name="minimumSize">
<size> <size>
<width>0</width> <width>0</width>
<height>0</height> <height>0</height>
@ -60,19 +199,69 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="4" column="0" colspan="2" > <item row="4" column="0">
<widget class="QCheckBox" name="bypassCB" > <widget class="QTextBrowser" name="listingsTB">
<property name="toolTip" > <property name="sizePolicy">
<string>Check it to enter parameters that are not recognizable by LyX</string> <sizepolicy hsizetype="Fixed" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property> </property>
<property name="text" > <property name="minimumSize">
<string>&amp;Bypass validation</string> <size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>120</width>
<height>16777215</height>
</size>
</property>
<property name="cursor" stdset="0">
<cursorShape>ArrowCursor</cursorShape>
</property>
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="acceptDrops">
<bool>true</bool>
</property>
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Plain</enum>
</property>
<property name="lineWidth">
<number>0</number>
</property>
<property name="acceptRichText">
<bool>false</bool>
</property> </property>
</widget> </widget>
</item> </item>
<item row="0" column="1" > <item row="0" column="0">
<widget class="QLineEdit" name="captionLE" > <widget class="QLabel" name="captionLabel">
<property name="minimumSize" > <property name="text">
<string>&amp;Caption:</string>
</property>
<property name="buddy">
<cstring>captionLE</cstring>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="captionLE">
<property name="minimumSize">
<size> <size>
<width>150</width> <width>150</width>
<height>0</height> <height>0</height>
@ -80,150 +269,65 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="0" column="0" > <item row="5" column="0" colspan="2">
<widget class="QLabel" name="captionLabel" > <widget class="QCheckBox" name="bypassCB">
<property name="text" > <property name="toolTip">
<string>C&amp;aption:</string> <string>Check it to enter parameters that are not recognizable by LyX</string>
</property> </property>
<property name="buddy" > <property name="text">
<cstring>captionLE</cstring> <string>&amp;Bypass validation</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="1" > <item row="3" column="0">
<widget class="QLineEdit" name="labelLE" /> <widget class="QLabel" name="label_3">
</item> <property name="text">
<item row="1" column="0" > <string>&amp;More parameters</string>
<widget class="QLabel" name="labelLabel" >
<property name="text" >
<string>La&amp;bel:</string>
</property> </property>
<property name="buddy" > <property name="buddy">
<cstring>labelLE</cstring>
</property>
</widget>
</item>
<item row="2" column="0" colspan="2" >
<widget class="QLabel" name="label_3" >
<property name="text" >
<string>Mo&amp;re parameters</string>
</property>
<property name="buddy" >
<cstring>listingsED</cstring> <cstring>listingsED</cstring>
</property> </property>
</widget> </widget>
</item> </item>
<item row="3" column="0" > <item row="2" column="1">
<widget class="QTextBrowser" name="listingsTB" > <widget class="QCheckBox" name="literalCB">
<property name="sizePolicy" > <property name="toolTip">
<sizepolicy> <string>Pass content of the `Caption' field literally to LaTeX. Check this if you want to enter LaTeX code.</string>
<hsizetype>0</hsizetype>
<vsizetype>7</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property> </property>
<property name="minimumSize" > <property name="text">
<size> <string>Li&amp;teral</string>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="maximumSize" >
<size>
<width>120</width>
<height>16777215</height>
</size>
</property>
<property name="cursor" >
<cursor>0</cursor>
</property>
<property name="focusPolicy" >
<enum>Qt::NoFocus</enum>
</property>
<property name="acceptDrops" >
<bool>true</bool>
</property>
<property name="frameShape" >
<enum>QFrame::NoFrame</enum>
</property>
<property name="frameShadow" >
<enum>QFrame::Plain</enum>
</property>
<property name="lineWidth" >
<number>0</number>
</property>
<property name="acceptRichText" >
<bool>false</bool>
</property> </property>
</widget> </widget>
</item> </item>
</layout> </layout>
</widget> </widget>
</item> </item>
<item row="2" column="0" colspan="6" > <item row="4" column="0" colspan="3">
<layout class="QHBoxLayout" > <layout class="QHBoxLayout">
<property name="margin" > <property name="spacing">
<number>0</number>
</property>
<property name="spacing" >
<number>6</number> <number>6</number>
</property> </property>
<item> <property name="leftMargin">
<widget class="QCheckBox" name="visiblespaceCB" >
<property name="sizePolicy" >
<sizepolicy>
<hsizetype>3</hsizetype>
<vsizetype>0</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip" >
<string>Underline spaces in generated output</string>
</property>
<property name="text" >
<string>&amp;Mark spaces in output</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="previewCB" >
<property name="sizePolicy" >
<sizepolicy>
<hsizetype>3</hsizetype>
<vsizetype>0</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip" >
<string>Show LaTeX preview</string>
</property>
<property name="text" >
<string>&amp;Show preview</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="4" column="0" colspan="6" >
<layout class="QHBoxLayout" >
<property name="margin" >
<number>0</number> <number>0</number>
</property> </property>
<property name="spacing" > <property name="topMargin">
<number>6</number> <number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property> </property>
<item> <item>
<spacer> <spacer>
<property name="orientation" > <property name="orientation">
<enum>Qt::Horizontal</enum> <enum>Qt::Horizontal</enum>
</property> </property>
<property name="sizeType" > <property name="sizeType">
<enum>QSizePolicy::Expanding</enum> <enum>QSizePolicy::Expanding</enum>
</property> </property>
<property name="sizeHint" > <property name="sizeHint" stdset="0">
<size> <size>
<width>20</width> <width>20</width>
<height>20</height> <height>20</height>
@ -232,120 +336,30 @@
</spacer> </spacer>
</item> </item>
<item> <item>
<widget class="QPushButton" name="okPB" > <widget class="QPushButton" name="okPB">
<property name="text" > <property name="text">
<string>&amp;OK</string> <string>&amp;OK</string>
</property> </property>
<property name="default" > <property name="autoDefault">
<bool>true</bool> <bool>true</bool>
</property> </property>
<property name="autoDefault" > <property name="default">
<bool>true</bool> <bool>true</bool>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QPushButton" name="closePB" > <widget class="QPushButton" name="closePB">
<property name="text" > <property name="text">
<string>&amp;Close</string> <string>&amp;Close</string>
</property> </property>
<property name="autoDefault" > <property name="autoDefault">
<bool>false</bool> <bool>false</bool>
</property> </property>
</widget> </widget>
</item> </item>
</layout> </layout>
</item> </item>
<item row="0" column="0" >
<widget class="QLabel" name="filenameLA" >
<property name="toolTip" >
<string/>
</property>
<property name="text" >
<string>&amp;File:</string>
</property>
<property name="buddy" >
<cstring>filenameED</cstring>
</property>
</widget>
</item>
<item row="0" column="1" colspan="4" >
<widget class="QLineEdit" name="filenameED" >
<property name="toolTip" >
<string>File name to include</string>
</property>
</widget>
</item>
<item row="1" column="0" colspan="2" >
<widget class="QLabel" name="TextLabel1" >
<property name="text" >
<string>&amp;Include Type:</string>
</property>
<property name="buddy" >
<cstring>typeCO</cstring>
</property>
</widget>
</item>
<item row="1" column="2" >
<widget class="QComboBox" name="typeCO" >
<item>
<property name="text" >
<string>Include</string>
</property>
</item>
<item>
<property name="text" >
<string>Input</string>
</property>
</item>
<item>
<property name="text" >
<string>Verbatim</string>
</property>
</item>
<item>
<property name="text" >
<string>Program Listing</string>
</property>
</item>
</widget>
</item>
<item row="1" column="3" >
<spacer>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType" >
<enum>QSizePolicy::Expanding</enum>
</property>
<property name="sizeHint" >
<size>
<width>28</width>
<height>28</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="5" >
<widget class="QPushButton" name="browsePB" >
<property name="toolTip" >
<string>Select a file</string>
</property>
<property name="text" >
<string>&amp;Browse...</string>
</property>
</widget>
</item>
<item row="1" column="5" >
<widget class="QPushButton" name="editPB" >
<property name="toolTip" >
<string>Edit the file</string>
</property>
<property name="text" >
<string>&amp;Edit</string>
</property>
</widget>
</item>
</layout> </layout>
</widget> </widget>
<tabstops> <tabstops>
@ -363,7 +377,7 @@
<tabstop>closePB</tabstop> <tabstop>closePB</tabstop>
</tabstops> </tabstops>
<includes> <includes>
<include location="local" >qt_i18n.h</include> <include location="local">qt_i18n.h</include>
</includes> </includes>
<resources/> <resources/>
<connections/> <connections/>

View File

@ -224,6 +224,7 @@ ParamInfo const & InsetInclude::findInfo(string const & /* cmdName */)
if (param_info_.empty()) { if (param_info_.empty()) {
param_info_.add("filename", ParamInfo::LATEX_REQUIRED); param_info_.add("filename", ParamInfo::LATEX_REQUIRED);
param_info_.add("lstparams", ParamInfo::LATEX_OPTIONAL); param_info_.add("lstparams", ParamInfo::LATEX_OPTIONAL);
param_info_.add("literal", ParamInfo::LYX_INTERNAL);
} }
return param_info_; return param_info_;
} }
@ -631,9 +632,8 @@ void InsetInclude::latex(otexstream & os, OutputParams const & runparams) const
language = opts[i].substr(9); language = opts[i].substr(9);
opts.erase(opts.begin() + i--); opts.erase(opts.begin() + i--);
} else if (prefixIs(opts[i], from_ascii("caption="))) { } else if (prefixIs(opts[i], from_ascii("caption="))) {
// FIXME We should use HANDLING_LATEXIFY here, caption = params().prepareCommand(runparams, opts[i].substr(8),
// but that's a file format change (see #10455). ParamInfo::HANDLING_LATEXIFY);
caption = opts[i].substr(8);
opts.erase(opts.begin() + i--); opts.erase(opts.begin() + i--);
if (!use_minted) if (!use_minted)
latexed_opts.push_back(from_ascii("caption=") + caption); latexed_opts.push_back(from_ascii("caption=") + caption);

View File

@ -32,8 +32,8 @@ extern char const * const lyx_version_info;
// Do not remove the comment below, so we get merge conflict in // Do not remove the comment below, so we get merge conflict in
// independent branches. Instead add your own. // independent branches. Instead add your own.
#define LYX_FORMAT_LYX 544 // ef: minted support #define LYX_FORMAT_LYX 545 // spitz: literal for include
#define LYX_FORMAT_TEX2LYX 544 #define LYX_FORMAT_TEX2LYX 545
#if LYX_FORMAT_TEX2LYX != LYX_FORMAT_LYX #if LYX_FORMAT_TEX2LYX != LYX_FORMAT_LYX
#ifndef _MSC_VER #ifndef _MSC_VER