diff --git a/development/ChangeLog b/development/ChangeLog index 9798cd34cc..2df5797122 100644 --- a/development/ChangeLog +++ b/development/ChangeLog @@ -1,3 +1,7 @@ +2005-07-18 José Matos + + * FORMAT: document changed to 243. + 2005-07-16 Lars Gullik Bjønnes * tools/README.bin.example: remove reLyX stuff diff --git a/development/FORMAT b/development/FORMAT index 4fd292e82f..765461a50d 100644 --- a/development/FORMAT +++ b/development/FORMAT @@ -1,6 +1,13 @@ LyX file-format changes ----------------------- +2005-07-18 José Matos + + * format incremented to 243. + + * this change only affects the preamble, the paperpackage + option was removed and papersize is changed to default. + 2005-06-21 Jean-Marc Lasgouttes * format incremented to 242. There is no file format per diff --git a/lib/lyx2lyx/LyX.py b/lib/lyx2lyx/LyX.py index 7647dc8304..7d8016c082 100644 --- a/lib/lyx2lyx/LyX.py +++ b/lib/lyx2lyx/LyX.py @@ -46,7 +46,7 @@ format_relation = [("0_10", [210], ["0.10.7","0.10"]), ("1_1_6fix3", [218], ["1.1.6fix3","1.1.6fix4","1.1"]), ("1_2", [220], ["1.2.0","1.2.1","1.2.3","1.2.4","1.2"]), ("1_3", [221], ["1.3.0","1.3.1","1.3.2","1.3.3","1.3.4","1.3.5","1.3"]), - ("1_4", range(223,243), ["1.4.0cvs","1.4"])] + ("1_4", range(223,244), ["1.4.0cvs","1.4"])] def formats_list(): diff --git a/lib/lyx2lyx/lyx_1_4.py b/lib/lyx2lyx/lyx_1_4.py index c2039f2e48..55963cfcaa 100644 --- a/lib/lyx2lyx/lyx_1_4.py +++ b/lib/lyx2lyx/lyx_1_4.py @@ -1858,6 +1858,33 @@ def convert_french(file): file.header[i] = "\\language french" +def remove_paperpackage(file): + i = find_token(file.header, '\\paperpackage', 0) + + if i == -1: + return + + paperpackage = split(file.header[i])[1] + + if paperpackage in ("a4", "a4wide", "widemarginsa4"): + j = find_token(file.header, '\\begin_preamble', 0) + conv = {"a4":"\\usepackage{a4}","a4wide": "\\usepackage{a4wide}", + "widemarginsa4": "\\usepackage[widemargins]{a4}"} + if j == -1: + # Add preamble + j = len(file.header) - 2 + file.header[j:j]=["\\begin_preamble", + conv[paperpackage],"\\end_preamble"] + else: + file.header[j+1:j+1] = conv[paperpackage] + + del file.header[i] + + i = find_token(file.header, '\\papersize', 0) + if i != -1: + file.header[i] = "\\papersize default" + + ## # Convertion hub # @@ -1884,9 +1911,11 @@ convert = [[223, [insert_tracking_changes, add_end_header, remove_color_default, [239, [normalize_paragraph_params]], [240, [convert_output_changes]], [241, [convert_ert_paragraphs]], - [242, [convert_french]]] + [242, [convert_french]], + [243, [remove_paperpackage]]] -revert = [[241, []], +revert = [[242, []], + [241, []], [240, [revert_ert_paragraphs]], [239, [revert_output_changes]], [238, []], diff --git a/src/ChangeLog b/src/ChangeLog index dc9cbb7a98..e1f0dadee9 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,10 @@ +2005-07-18 José Matos + + * buffer.C: + * bufferparams.[Ch]: + * tex-strings.[Ch]: new file format, remove support for a4.sty, + a4wide.sty and a4widemargins. + 2005-07-17 Jean-Marc Lasgouttes * text2.C (cursorLeft): fix one of error diff --git a/src/buffer.C b/src/buffer.C index 89593a0b2b..6200281c9d 100644 --- a/src/buffer.C +++ b/src/buffer.C @@ -143,7 +143,7 @@ extern BufferList bufferlist; namespace { -int const LYX_FORMAT = 242; +int const LYX_FORMAT = 243; } // namespace anon diff --git a/src/bufferparams.C b/src/bufferparams.C index a5bd2f88e6..fbf93f12c7 100644 --- a/src/bufferparams.C +++ b/src/bufferparams.C @@ -152,27 +152,6 @@ PaperSizeTranslator const & papersizetranslator() } -// Paper packages -typedef Translator PaperPackagesTranslator; - - -PaperPackagesTranslator const init_paperpackagestranslator() -{ - PaperPackagesTranslator translator(string_paperpackages[0], PACKAGE_NONE); - translator.addPair(string_paperpackages[1], PACKAGE_A4); - translator.addPair(string_paperpackages[2], PACKAGE_A4WIDE); - translator.addPair(string_paperpackages[3], PACKAGE_WIDEMARGINSA4); - return translator; -} - - -PaperPackagesTranslator const & paperpackagestranslator() -{ - static PaperPackagesTranslator translator = init_paperpackagestranslator(); - return translator; -} - - // Paper orientation typedef Translator PaperOrientationTranslator; @@ -333,7 +312,6 @@ BufferParams::BufferParams() /* PaperLayout */ papersize = PAPER_DEFAULT; - paperpackage = PACKAGE_NONE; orientation = ORIENTATION_PORTRAIT; use_geometry = false; use_amsmath = AMS_AUTO; @@ -490,10 +468,6 @@ string const BufferParams::readToken(LyXLex & lex, string const & token) string ppsize; lex >> ppsize; papersize = papersizetranslator().find(ppsize); - } else if (token == "\\paperpackage") { - string ppackage; - lex >> ppackage; - paperpackage = paperpackagestranslator().find(ppackage); } else if (token == "\\use_geometry") { lex >> use_geometry; } else if (token == "\\use_amsmath") { @@ -639,7 +613,6 @@ void BufferParams::writeFile(ostream & os) const spacing().writeFile(os); os << "\\papersize " << string_papersize[papersize] - << "\n\\paperpackage " << string_paperpackages[paperpackage] << "\n\\use_geometry " << convert(use_geometry) << "\n\\use_amsmath " << use_amsmath << "\n\\cite_engine " << citeenginetranslator().find(cite_engine) @@ -746,7 +719,7 @@ bool BufferParams::writeLaTeX(ostream & os, LaTeXFeatures & features, (papersize == PAPER_A3) || (papersize == PAPER_CUSTOM); - if (!use_geometry && (paperpackage == PACKAGE_NONE)) { + if (!use_geometry) { switch (papersize) { case PAPER_A4: clsoptions << "a4paper,"; @@ -867,26 +840,6 @@ bool BufferParams::writeLaTeX(ostream & os, LaTeXFeatures & features, texrow.newline(); } - // At the very beginning the text parameters. - if (paperpackage != PACKAGE_NONE) { - switch (paperpackage) { - case PACKAGE_NONE: - break; - case PACKAGE_A4: - os << "\\usepackage{a4}\n"; - texrow.newline(); - break; - case PACKAGE_A4WIDE: - os << "\\usepackage{a4wide}\n"; - texrow.newline(); - break; - case PACKAGE_WIDEMARGINSA4: - os << "\\usepackage[widemargins]{a4}\n"; - texrow.newline(); - break; - } - } - if (use_geometry || nonstandard_papersize) { os << "\\usepackage{geometry}\n"; texrow.newline(); diff --git a/src/bufferparams.h b/src/bufferparams.h index 86302c5583..a42165538a 100644 --- a/src/bufferparams.h +++ b/src/bufferparams.h @@ -118,8 +118,6 @@ public: /* this are for the PaperLayout */ /// the papersize PAPER_SIZE papersize; - /// a special paperpackage .sty-file - PAPER_PACKAGES paperpackage; /// PAPER_ORIENTATION orientation; /// use custom margins diff --git a/src/frontends/gtk/ChangeLog b/src/frontends/gtk/ChangeLog index fb067cd76d..8435ca14d0 100644 --- a/src/frontends/gtk/ChangeLog +++ b/src/frontends/gtk/ChangeLog @@ -1,3 +1,8 @@ +2005-07-18 José Matos + + * GDocument.C: new file format, remove support for a4.sty, + a4wide.sty and a4widemargins. + 2005-07-16 José Matos * ghelpers.C: diff --git a/src/frontends/gtk/GDocument.C b/src/frontends/gtk/GDocument.C index 06c2d5d715..9141348ca7 100644 --- a/src/frontends/gtk/GDocument.C +++ b/src/frontends/gtk/GDocument.C @@ -347,14 +347,7 @@ void GDocument::update() comboBoxTextSet(pagestylecombo_, params.pagestyle); // *** End "Page" Page *** - // *** Begin "Margins" Page *** - int item = params.paperpackage; - if (params.use_geometry) { - item = 1; - } else if (item > 0) { - item = item + 1; - } - marginscombo_.set_active(item); + marginscombo_.set_active(0); setWidgetsFromLength( *(mtopspin_->get_adjustment()), @@ -514,7 +507,6 @@ void GDocument::apply() if (margin > 0) { margin = margin - 1; } - params.paperpackage = PAPER_PACKAGES(margin); params.topmargin = getLengthFromWidgets( *(mtopspin_->get_adjustment()), diff --git a/src/frontends/qt2/ChangeLog b/src/frontends/qt2/ChangeLog index 30a5955fcf..ef3a75a455 100644 --- a/src/frontends/qt2/ChangeLog +++ b/src/frontends/qt2/ChangeLog @@ -1,3 +1,8 @@ +2005-07-18 José Matos + + * QDocument.C: new file format, remove support for a4.sty, + a4wide.sty and a4widemargins. + 2005-07-16 José Matos * QDocumentDialog.C: diff --git a/src/frontends/qt2/QDocument.C b/src/frontends/qt2/QDocument.C index 7fa61f8689..658860e0c3 100644 --- a/src/frontends/qt2/QDocument.C +++ b/src/frontends/qt2/QDocument.C @@ -394,8 +394,6 @@ void QDocument::apply() if (margin > 0) { margin = margin - 1; } - params.paperpackage = PAPER_PACKAGES(margin); - MarginsModuleBase const * m(dialog_->marginsModule); params.leftmargin = widgetsToLength(m->innerLE, m->innerUnit); @@ -653,14 +651,8 @@ void QDocument::update_contents() MarginsModuleBase * m = dialog_->marginsModule; - int item = params.paperpackage; - if (params.use_geometry) { - item = 1; - } else if (item > 0) { - item = item + 1; - } - m->marginCO->setCurrentItem(item); - dialog_->setCustomMargins(item); + m->marginCO->setCurrentItem(0); + dialog_->setCustomMargins(0); lengthToWidgets(m->topLE, m->topUnit, params.topmargin, defaultUnit); diff --git a/src/frontends/xforms/ChangeLog b/src/frontends/xforms/ChangeLog index 503fb3e49d..badc8d1a99 100644 --- a/src/frontends/xforms/ChangeLog +++ b/src/frontends/xforms/ChangeLog @@ -1,3 +1,8 @@ +2005-07-18 José Matos + + * FormDocument.C: new file format, remove support for a4.sty, + a4wide.sty and a4widemargins. + 2005-07-16 José Matos * FormParagraphs.C: diff --git a/src/frontends/xforms/FormDocument.C b/src/frontends/xforms/FormDocument.C index b43d5cd7eb..cdda234711 100644 --- a/src/frontends/xforms/FormDocument.C +++ b/src/frontends/xforms/FormDocument.C @@ -919,9 +919,6 @@ void FormDocument::paper_apply(BufferParams & params) { params.papersize = PAPER_SIZE(fl_get_choice(paper_->choice_papersize) - 1); - params.paperpackage = - PAPER_PACKAGES(fl_get_choice(paper_->choice_paperpackage) - 1); - params.use_geometry = fl_get_button(paper_->check_use_geometry); if (fl_get_button(paper_->radio_landscape)) @@ -1231,7 +1228,6 @@ void FormDocument::paper_update(BufferParams const & params) return; fl_set_choice(paper_->choice_papersize, params.papersize + 1); - fl_set_choice(paper_->choice_paperpackage, params.paperpackage + 1); fl_set_button(paper_->check_use_geometry, params.use_geometry); int const paperchoice = fl_get_choice(paper_->choice_papersize); diff --git a/src/tex-strings.C b/src/tex-strings.C index 042533fa41..d1ca797890 100644 --- a/src/tex-strings.C +++ b/src/tex-strings.C @@ -32,11 +32,6 @@ char const * const string_papersize[] = { }; -char const * const string_paperpackages[] = { - "none", "a4", "a4wide", "widemarginsa4", "" -}; - - char const * const string_orientation[] = { "portrait", "landscape", "" }; diff --git a/src/tex-strings.h b/src/tex-strings.h index 3af6004330..8ddb332a09 100644 --- a/src/tex-strings.h +++ b/src/tex-strings.h @@ -22,8 +22,6 @@ extern char const * const string_quotes_language[]; /// extern char const * const string_papersize[]; /// -extern char const * const string_paperpackages[]; -/// extern char const * const string_orientation[]; /// extern char const * const string_footnotekinds[];