From bf6b9d1e189a13789308944d4d60f3ec994627b4 Mon Sep 17 00:00:00 2001 From: Jean-Marc Lasgouttes Date: Thu, 1 Mar 2001 15:57:10 +0000 Subject: [PATCH] some source cleanup from John git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@1654 a592a061-630c-0410-9148-cb99ea01b6c8 --- lib/ChangeLog | 4 + lib/templates/g-brief-de.lyx | 2 +- src/ChangeLog | 19 +++++ src/buffer.C | 14 +-- src/intl.C | 7 +- src/language.C | 5 -- src/lyx_gui.C | 1 - src/lyx_gui_misc.C | 34 -------- src/lyx_main.C | 2 + src/paragraph.C | 12 +-- src/stl_string_fwd.h | 4 + src/tabular.C | 161 ----------------------------------- src/tabular.h | 9 -- 13 files changed, 35 insertions(+), 239 deletions(-) diff --git a/lib/ChangeLog b/lib/ChangeLog index 5c22bc936e..d805662ac7 100644 --- a/lib/ChangeLog +++ b/lib/ChangeLog @@ -1,3 +1,7 @@ +2001-03-01 Jean-Marc Lasgouttes + + * templates/g-brief-de.lyx: fix typo. + 2001-02-16 John Levon * reLyX/Makefile.am: fix uninstall diff --git a/lib/templates/g-brief-de.lyx b/lib/templates/g-brief-de.lyx index d286a8d284..083cb1abf6 100644 --- a/lib/templates/g-brief-de.lyx +++ b/lib/templates/g-brief-de.lyx @@ -103,7 +103,7 @@ today Sehr geehrter Herr Beispiel, \layout Gruss -Mit freunlichen Grüßen, +Mit freundlichen Grüßen, \layout Brieftext seit der siebten Mieterhöhung im laufenden Jahr konnte ich keinen Zahlungseingan diff --git a/src/ChangeLog b/src/ChangeLog index a2eb005099..eb20f0c317 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,24 @@ +2001-02-23 John Levon + + * lyx_main.C: add ISO_Left_Tab as bind synonym for Tab + + * stl_string_fwd.h: add comment + + * lyx_gui_misc.C: killed ALWAYS_CLOSE_MATH_PANELS + + * tabular.h: + * tabular.C: remove unused DocBook methods + + * intl.C: + * language.C: + * paragraph.C: + * buffer.C: + killed DO_USE_DEFAULT_LANGUAGE + 2001-03-01 Jean-Marc Lasgouttes + * lyx_gui.C: do not include language.h. + * bufferview_funcs.C (ToggleAndShow): do not provide optional arguments in function implementation. diff --git a/src/buffer.C b/src/buffer.C index 053bd43b41..3fb4f234a3 100644 --- a/src/buffer.C +++ b/src/buffer.C @@ -1678,9 +1678,6 @@ void Buffer::makeLaTeXFile(string const & fname, features.UsedLanguages.insert(default_language); if (lyxrc.language_use_babel || -#ifdef DO_USE_DEFAULT_LANGUAGE - params.language->lang() != "default" || -#endif params.language->lang() != lyxrc.default_language || !features.UsedLanguages.empty()) { use_babel = true; @@ -2001,11 +1998,8 @@ void Buffer::makeLaTeXFile(string const & fname, texrow.newline(); } // only_body lyxerr.debug() << "preamble finished, now the body." << endl; -#ifdef DO_USE_DEFAULT_LANGUAGE - if (!lyxrc.language_auto_begin && params.language->lang() != "default") { -#else + if (!lyxrc.language_auto_begin) { -#endif ofs << subst(lyxrc.language_command_begin, "$$lang", params.language->babel()) << endl; @@ -2018,11 +2012,7 @@ void Buffer::makeLaTeXFile(string const & fname, ofs << endl; texrow.newline(); -#ifdef DO_USE_DEFAULT_LANGUAGE - if (!lyxrc.language_auto_end && params.language->lang() != "default") { -#else - if (!lyxrc.language_auto_end) { -#endif + if (!lyxrc.language_auto_end) { ofs << subst(lyxrc.language_command_end, "$$lang", params.language->babel()) << endl; diff --git a/src/intl.C b/src/intl.C index 8914168626..b50580712e 100644 --- a/src/intl.C +++ b/src/intl.C @@ -289,12 +289,7 @@ void Intl::InitKeyMapper(bool on) fl_end_form(); int n = 0; - // Default is not in the language map -#ifdef DO_USE_DEFAULT_LANGUAGE - Language->addto("default"); - Language2->addto("default"); - ++n; -#endif + for (Languages::const_iterator cit = languages.begin(); cit != languages.end(); ++cit) { Language->addto((*cit).second.lang()); diff --git a/src/language.C b/src/language.C index 6d58ee29cc..bc45d9e311 100644 --- a/src/language.C +++ b/src/language.C @@ -76,11 +76,6 @@ void Languages::read(string const & filename) encoding, code, latex_options); } -#ifdef DO_USE_DEFAULT_LANGUAGE - languagelist["default"] = Language("default", "default", - N_("Document wide language"), - false, &iso8859_1, ""); -#endif default_language = getLanguage(lyxrc.default_language); if (!default_language) { lyxerr << "Default language \"" << lyxrc.default_language diff --git a/src/lyx_gui.C b/src/lyx_gui.C index 806372c37f..cb58a866ea 100644 --- a/src/lyx_gui.C +++ b/src/lyx_gui.C @@ -38,7 +38,6 @@ #include "lyxlookup.h" #endif #include "bufferlist.h" -#include "language.h" #include "ColorHandler.h" #include "frontends/Dialogs.h" #include "frontends/GUIRunTime.h" diff --git a/src/lyx_gui_misc.C b/src/lyx_gui_misc.C index 539a3b1d56..091a11ee54 100644 --- a/src/lyx_gui_misc.C +++ b/src/lyx_gui_misc.C @@ -151,7 +151,6 @@ void updateAllVisibleBufferRelatedDialogs(bool) { if (current_view->buffer() && current_view->buffer()->isReadonly()) { // a little crude perhaps but it works. ARRae -#ifndef ALWAYS_CLOSE_MATH_PANELS // The math popups should be closed only if we switch // to a readonly buffer if (fd_panel) { @@ -179,40 +178,7 @@ void updateAllVisibleBufferRelatedDialogs(bool) fl_hide_form(fd_matrix->matrix); } } -#endif } - - // We have either changed buffers or changed the readonly status - // so the safest thing to do is hide all inset popups that - // are editting insets from the previous buffer or aren't - // allowed in readonly docs. -#ifdef ALWAYS_CLOSE_MATH_PANELS - if (fd_panel) { - if (fd_panel->panel->visible) { - fl_hide_form(fd_panel->panel); - } - } - if (fd_delim) { - if (fd_delim->delim->visible) { - fl_hide_form(fd_delim->delim); - } - } - if (fd_deco) { - if (fd_deco->deco->visible) { - fl_hide_form(fd_deco->deco); - } - } - if (fd_space) { - if (fd_space->space->visible) { - fl_hide_form(fd_space->space); - } - } - if (fd_matrix) { - if (fd_matrix->matrix->visible) { - fl_hide_form(fd_matrix->matrix); - } - } -#endif HideFiguresPopups(); } diff --git a/src/lyx_main.C b/src/lyx_main.C index b39866318f..0a02da911d 100644 --- a/src/lyx_main.C +++ b/src/lyx_main.C @@ -467,6 +467,7 @@ void LyX::defaultKeyBindings(kb_keymap * kbmap) kbmap->bind("Down", LFUN_DOWN); kbmap->bind("Tab", LFUN_TAB); + kbmap->bind("ISO_Left_Tab", LFUN_TAB); // jbl 2001-23-02 kbmap->bind("Home", LFUN_HOME); kbmap->bind("End", LFUN_END); @@ -505,6 +506,7 @@ void LyX::defaultKeyBindings(kb_keymap * kbmap) kbmap->bind("C-Tab", LFUN_TABINSERT); // ale970515 kbmap->bind("S-Tab", LFUN_SHIFT_TAB); // jug20000522 + kbmap->bind("S-ISO_Left_Tab", LFUN_SHIFT_TAB); // jbl 2001-23-02 } diff --git a/src/paragraph.C b/src/paragraph.C index ad157534de..a17825476c 100644 --- a/src/paragraph.C +++ b/src/paragraph.C @@ -3923,17 +3923,9 @@ LyXParagraph::getParLanguage(BufferParams const & bparams) const return FirstPhysicalPar()->getParLanguage(bparams); else #endif - if (size() > 0) { -#ifdef DO_USE_DEFAULT_LANGUAGE - Language const * lang = GetFirstFontSettings().language(); - - if (lang->lang() == "default") - return bparams.language; - return lang; -#else + if (size() > 0) return GetFirstFontSettings().language(); -#endif - } else if (previous) + else if (previous) return previous->getParLanguage(bparams); else return bparams.language; diff --git a/src/stl_string_fwd.h b/src/stl_string_fwd.h index f27ab3ab30..7b27436cc3 100644 --- a/src/stl_string_fwd.h +++ b/src/stl_string_fwd.h @@ -12,6 +12,10 @@ #ifndef LYX_STL_STRING_FWD_H #define LYX_STL_STRING_FWD_H +/* + * This file exists to appease STLPort when using included lyxstring. + * It won't be around forever ... + */ #ifndef USE_INCLUDED_STRING // include the real stl_string_fwd.h diff --git a/src/tabular.C b/src/tabular.C index dd2b168ee9..5744600ad5 100644 --- a/src/tabular.C +++ b/src/tabular.C @@ -1566,167 +1566,6 @@ void LyXTabular::OldFormatRead(LyXLex & lex, string const & fl) } -string const LyXTabular::GetDocBookAlign(int cell, bool isColumn) const -{ - int const i = isColumn ? cell : column_of_cell(cell); - - if (!isColumn && IsMultiColumn(cell)) { - if (!cellinfo_of_cell(cell)->align_special.empty()) { - return cellinfo_of_cell(cell)->align_special; - } else { - switch (GetAlignment(cell)) { - case LYX_ALIGN_LEFT: - return "left"; - case LYX_ALIGN_RIGHT: - return "right"; - default: - return "center"; - } - } - } else { - if (!column_info[i].align_special.empty()) { - return column_info[i].align_special; - } -#ifdef IGNORE_THIS_FOR_NOW - else if (!column_info[i].p_width.empty()) { - file += "p{"; - file += column_info[i].p_width; - file += '}'; - } -#endif - else { - switch (column_info[i].alignment) { - case LYX_ALIGN_LEFT: - return "left"; - case LYX_ALIGN_RIGHT: - return "right"; - default: - return "center"; - } - } - } -} - - -// cell <0 will tex the preamble -// returns the number of printed newlines -int LyXTabular::DocBookEndOfCell(ostream & os, int cell, int & depth) const -{ - int ret = 0; - if (IsLastCell(cell)) { - os << newlineAndDepth(--depth) - << "" - << newlineAndDepth(--depth) - << "" - << newlineAndDepth(--depth) - << "" - << newlineAndDepth(--depth); - if (is_long_tabular) - os << ""; - else - os << "" - << newlineAndDepth(--depth); - ret += 4; - } else { - if (cell < 0) { - // preamble - if (is_long_tabular) - os << "" - << newlineAndDepth(++depth); - ++ret; - for (int i = 0; i < columns_; ++i) { - os << "" - << newlineAndDepth(depth); - ++ret; -#ifdef NOT_HANDLED_YET_AS_I_DONT_KNOW_HOW - if (column_info[i].left_line) - os << '|'; -#endif - } - os << "" - << newlineAndDepth(++depth) - << "" - << newlineAndDepth(++depth) - << "" - << newlineAndDepth(++depth); - ret += 3; - } else { - if (IsLastCellInRow(cell)) { - os << newlineAndDepth(--depth) - << "" - << newlineAndDepth(--depth) - << "" - << newlineAndDepth(depth) - << "" - << newlineAndDepth(++depth) - << "" - << newlineAndDepth(++depth); - ret += 4; - } else { - os << newlineAndDepth(--depth) - << "" - << newlineAndDepth(depth) - << "" - << newlineAndDepth(++depth); - ret += 3; - } - } - } - return ret; -} - - bool LyXTabular::IsMultiColumn(int cell, bool real) const { return ((!real || (column_of_cell(cell) != right_column_of_cell(cell))) && diff --git a/src/tabular.h b/src/tabular.h index 78db842465..b95a38d280 100644 --- a/src/tabular.h +++ b/src/tabular.h @@ -292,15 +292,6 @@ public: int column, std::vector const &) const; /// int Ascii(Buffer const *, std::ostream &) const; - /// - int DocBookEndOfCell(std::ostream &, int cell, int & depth) const; -#if 0 - /// - int RoffEndOfCell(std::ostream &, int cell); -#endif - /// - string const GetDocBookAlign(int cell, bool isColumn = false) const; - /// bool IsMultiColumn(int cell, bool real = false) const; ///