fileformat change to 294 for Pavel's PDFOptions cleanup in r20881

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20933 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Uwe Stöhr 2007-10-12 23:51:56 +00:00
parent 6c9ae9865d
commit ed43dea031
5 changed files with 43 additions and 11 deletions

View File

@ -1,17 +1,21 @@
LyX file-format changes
-----------------------
2007-10-12 Pavel Sanda <ps@twin.jikos.cz>
* Format incremented to 294: PDFOptions: add usetitle,
fix leftovers
2007-10-11 Bo Peng <ben.bob@gmail.com>
* Format incremented to 293: Add InsetInfo.
2007-10-09 Uwe Stöhr Uwe Stöhr <uwestoehr@web.de>
2007-10-09 Uwe Stöhr <uwestoehr@web.de>
* Format incremented to 292: Support for Japanese without
using CJK and inputenc. (japanese-plain)
2007-10-04 Uwe Stöhr Uwe Stöhr <uwestoehr@web.de>
2007-10-04 Uwe Stöhr <uwestoehr@web.de>
* Format incremented to 291: Support for Vietnamese.
2007-10-03 Uwe Stöhr Uwe Stöhr <uwestoehr@web.de>
2007-10-03 Uwe Stöhr <uwestoehr@web.de>
* Format incremented to 290: Add table wrap floats.
2007-10-03 Martin Vermeer <martin.vermeer@tkk.fi>

View File

@ -79,8 +79,8 @@ format_relation = [("0_06", [200], minor_versions("0.6" , 4)),
("1_2", [220], minor_versions("1.2" , 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" , 1)),
("1_6", range(277,294), minor_versions("1.6" , 0))]
("1_5", range(246,277), minor_versions("1.5" , 2)),
("1_6", range(277,295), minor_versions("1.6" , 0))] # Pavel pdfoptions
def formats_list():

View File

@ -22,7 +22,7 @@ import re
import unicodedata
import sys, os
from parser_tools import find_token, find_end_of, find_tokens
from parser_tools import find_token, find_end_of, find_tokens, get_value
####################################################################
# Private helper functions
@ -480,6 +480,34 @@ def revert_inset_info(document):
document.body[i : (j + 1)] = [type + ':' + arg]
def convert_pdf_options(document):
# Set the pdfusetitle tag, delete the pdf_store_options,
# set quotes for bookmarksopenlevel"
has_hr = get_value(document.header, "\\use_hyperref", 0, default = "0")
if has_hr == "1":
k = find_token(document.header, "\\use_hyperref", 0)
document.header.insert(k + 1, "\\pdf_pdfusetitle true")
k = find_token(document.header, "\\pdf_store_options", 0)
if k != -1:
del document.header[k]
i = find_token(document.header, "\\pdf_bookmarksopenlevel", k)
if i == -1: return
document.header[i] = document.header[i].replace('"', '')
def revert_pdf_options(document):
# reset the pdfusetitle tag, set quotes for bookmarksopenlevel"
k = find_token(document.header, "\\use_hyperref", 0)
i = find_token(document.header, "\\pdf_pdfusetitle", k)
if i != -1:
del document.header[i]
i = find_token(document.header, "\\pdf_bookmarksopenlevel", k)
if i == -1: return
values = document.header[i].split()
values[1] = ' "' + values[1] + '"'
document.header[i] = ''.join(values)
##
# Conversion hub
#
@ -501,10 +529,12 @@ convert = [[277, [fix_wrong_tables]],
[290, []],
[291, []],
[292, []],
[293, []]
[293, []],
[294, [convert_pdf_options]]
]
revert = [[292, [revert_inset_info]],
revert = [[293, [revert_pdf_options]],
[292, [revert_inset_info]],
[291, [revert_japanese, revert_japanese_encoding]],
[290, [revert_vietnamese]],
[289, [revert_wraptable]],

View File

@ -154,7 +154,7 @@ namespace fs = boost::filesystem;
namespace {
int const LYX_FORMAT = 293;
int const LYX_FORMAT = 294; //pavel pdfoptions
} // namespace anon

View File

@ -188,8 +188,6 @@ string PDFOptions::readToken(Lexer &lex, string const & token)
lex >> pagemode;
} else if (token == "\\pdf_quoted_options") {
lex >> quoted_options;
} else if (token == "\\pdf_store_options") {
//leftover from previous option; intended for later removal
} else {
return token;
}