mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-22 01:59:02 +00:00
Embedding: revert embedding options and extra_embedded_files
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@24328 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
b56a40d7eb
commit
76d272da30
@ -1,6 +1,9 @@
|
||||
LyX file-format changes
|
||||
-----------------------
|
||||
|
||||
2008-04-18 Bo Peng <ben.bob@gmail.com>
|
||||
* Format incremented to 328: Revert the support for embedding
|
||||
|
||||
2008-04-16 Uwe Stöhr <uwestoehr@web.de>
|
||||
* Format incremented to 327: support for Mexican Spanish.
|
||||
|
||||
|
@ -80,7 +80,7 @@ format_relation = [("0_06", [200], minor_versions("0.6" , 4)),
|
||||
("1_3", [221], minor_versions("1.3" , 7)),
|
||||
("1_4", range(222,246), minor_versions("1.4" , 5)),
|
||||
("1_5", range(246,277), minor_versions("1.5" , 2)),
|
||||
("1_6", range(277,328), minor_versions("1.6" , 0))] # Uwe: support for Spanish(Mexico)
|
||||
("1_6", range(277,329), minor_versions("1.6" , 0))] # Uwe: support for Spanish(Mexico)
|
||||
|
||||
|
||||
def formats_list():
|
||||
|
@ -1532,11 +1532,11 @@ def revert_widesideways(document):
|
||||
i = i + 1
|
||||
|
||||
|
||||
def revert_external_embedding(document):
|
||||
' Remove embed tag from external inset '
|
||||
def revert_inset_embedding(document, type):
|
||||
' Remove embed tag from certain type of insets'
|
||||
i = 0
|
||||
while 1:
|
||||
i = find_token(document.body, "\\begin_inset External", i)
|
||||
i = find_token(document.body, "\\begin_inset %s" % type, i)
|
||||
if i == -1:
|
||||
return
|
||||
j = find_end_of_inset(document.body, i)
|
||||
@ -1545,11 +1545,18 @@ def revert_external_embedding(document):
|
||||
i = i + 1
|
||||
continue
|
||||
k = find_token(document.body, "\tembed", i, j)
|
||||
if k == -1:
|
||||
k = find_token(document.body, "embed", i, j)
|
||||
if k != -1:
|
||||
del document.body[k]
|
||||
i = i + 1
|
||||
|
||||
|
||||
def revert_external_embedding(document):
|
||||
' Remove embed tag from external inset '
|
||||
revert_inset_embedding(document, 'External')
|
||||
|
||||
|
||||
def convert_subfig(document):
|
||||
" Convert subfigures to subfloats. "
|
||||
i = 0
|
||||
@ -1987,6 +1994,14 @@ def revert_mexican(document):
|
||||
j = j + 1
|
||||
|
||||
|
||||
def remove_embedding(document):
|
||||
' Remove embed tag from all insets'
|
||||
revert_inset_embedding(document, 'Graphics')
|
||||
revert_inset_embedding(document, 'External')
|
||||
revert_inset_embedding(document, 'CommandInset include')
|
||||
revert_inset_embedding(document, 'CommandInset bibtex')
|
||||
|
||||
|
||||
##
|
||||
# Conversion hub
|
||||
#
|
||||
@ -2042,10 +2057,12 @@ convert = [[277, [fix_wrong_tables]],
|
||||
[324, [convert_linebreaks]],
|
||||
[325, [convert_japanese_plain]],
|
||||
[326, []],
|
||||
[327, []]
|
||||
[327, []],
|
||||
[328, [remove_embedding, remove_extra_embedded_files, remove_inzip_options]],
|
||||
]
|
||||
|
||||
revert = [[326, [revert_mexican]],
|
||||
revert = [[327, []],
|
||||
[326, [revert_mexican]],
|
||||
[325, [revert_pdfpages]],
|
||||
[324, []],
|
||||
[323, [revert_linebreaks]],
|
||||
|
@ -117,7 +117,7 @@ namespace os = support::os;
|
||||
|
||||
namespace {
|
||||
|
||||
int const LYX_FORMAT = 327; // Uwe: support for Spanish(Mexico)
|
||||
int const LYX_FORMAT = 328;
|
||||
|
||||
typedef map<string, bool> DepClean;
|
||||
typedef map<docstring, pair<InsetLabel const *, Buffer::References> > RefCache;
|
||||
|
@ -845,19 +845,6 @@ void BufferParams::writeFile(ostream & os) const
|
||||
else
|
||||
os << "\\author " << Author() << "\n";
|
||||
}
|
||||
|
||||
vector<string>::const_iterator e_it = extraEmbeddedFiles().begin();
|
||||
vector<string>::const_iterator e_end = extraEmbeddedFiles().end();
|
||||
os << "\\extra_embedded_files \"";
|
||||
bool first = true;
|
||||
for (; e_it != e_end; ++e_it) {
|
||||
if (!first)
|
||||
os << ",";
|
||||
else
|
||||
first = false;
|
||||
os << *e_it;
|
||||
}
|
||||
os << "\"\n";
|
||||
}
|
||||
|
||||
|
||||
|
@ -78,7 +78,6 @@ ParamInfo const & InsetBibtex::findInfo(string const & /* cmdName */)
|
||||
if (param_info_.empty()) {
|
||||
param_info_.add("btprint", ParamInfo::LATEX_OPTIONAL);
|
||||
param_info_.add("bibfiles", ParamInfo::LATEX_REQUIRED);
|
||||
param_info_.add("embed", ParamInfo::LYX_INTERNAL);
|
||||
param_info_.add("options", ParamInfo::LYX_INTERNAL);
|
||||
}
|
||||
return param_info_;
|
||||
@ -827,7 +826,6 @@ void InsetBibtex::updateParam()
|
||||
embed += from_utf8(it->inzipName());
|
||||
}
|
||||
setParam("bibfiles", bibfiles);
|
||||
setParam("embed", embed);
|
||||
}
|
||||
|
||||
|
||||
|
@ -188,10 +188,8 @@ void InsetExternalParams::write(Buffer const & buf, ostream & os) const
|
||||
os << "External\n"
|
||||
<< "\ttemplate " << templatename() << '\n';
|
||||
|
||||
if (!filename.empty()) {
|
||||
if (!filename.empty())
|
||||
os << "\tfilename " << filename.outputFilename(buf.filePath()) << '\n';
|
||||
os << "\tembed " << (filename.embedded() ? filename.inzipName() : "\"\"") << '\n';
|
||||
}
|
||||
if (display != defaultDisplayType)
|
||||
os << "\tdisplay "
|
||||
<< external::displayTranslator().find(display)
|
||||
|
@ -137,10 +137,8 @@ bool operator!=(InsetGraphicsParams const & left,
|
||||
void InsetGraphicsParams::Write(ostream & os, Buffer const & buffer) const
|
||||
{
|
||||
// Do not write the default values
|
||||
if (!filename.empty()) {
|
||||
if (!filename.empty())
|
||||
os << "\tfilename " << filename.outputFilename(buffer.filePath()) << '\n';
|
||||
os << "\tembed " << (filename.embedded() ? filename.inzipName() : "\"\"") << '\n';
|
||||
}
|
||||
if (lyxscale != 100)
|
||||
os << "\tlyxscale " << lyxscale << '\n';
|
||||
if (display != graphics::DefaultDisplay)
|
||||
|
Loading…
Reference in New Issue
Block a user