From 4ed9f14187717e72c54e1aa4832b9ea02857b793 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Lars=20Gullik=20Bj=C3=B8nnes?= Date: Tue, 17 Jul 2001 09:41:34 +0000 Subject: [PATCH] pass_thru git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@2262 a592a061-630c-0410-9148-cb99ea01b6c8 --- lib/ChangeLog | 4 ++++ lib/layouts/literate-scrap.inc | 3 ++- po/POTFILES.in | 1 - src/ChangeLog | 15 +++++++++++++++ src/layout.C | 8 ++++++++ src/layout.h | 4 ++++ src/mathed/formulabase.C | 5 ++++- src/paragraph_pimpl.C | 5 +++++ 8 files changed, 42 insertions(+), 3 deletions(-) diff --git a/lib/ChangeLog b/lib/ChangeLog index 2d998ecd2f..1d48e0a565 100644 --- a/lib/ChangeLog +++ b/lib/ChangeLog @@ -1,3 +1,7 @@ +2001-07-12 Kayvan A. Sylvan + + * layouts/literate-scrap.inc: Added PassThru tag + 2001-07-13 Jean-Marc Lasgouttes * bind/*.bind: do the same correctly for all files :) diff --git a/lib/layouts/literate-scrap.inc b/lib/layouts/literate-scrap.inc index 96ebde0abe..e7ecaac03a 100644 --- a/lib/layouts/literate-scrap.inc +++ b/lib/layouts/literate-scrap.inc @@ -22,13 +22,14 @@ Style Scrap Align Left AlignPossible Block,Left FreeSpacing 1 + PassThru 1 LabelType Static LabelFont Color magenta EndFont TextFont - Latex Latex + Color latex Family Typewriter EndFont diff --git a/po/POTFILES.in b/po/POTFILES.in index 911758d3cf..12d1d92b86 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -9,7 +9,6 @@ src/converter.C src/CutAndPaste.C src/debug.C src/exporter.C -src/ext_l10n.h src/figure_form.C src/figureForm.C src/FontLoader.C diff --git a/src/ChangeLog b/src/ChangeLog index d29299500e..fe7f8bbbbd 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -59,6 +59,21 @@ * sp_form.[Ch]: removed * spellchecker.[Ch]: removed +2001-07-12 Kayvan A. Sylvan + + * paragraph_pimpl.C (simpleTeXBlanks): Simply return if pass_thru + is set. + (simpleTeXSpecialChars): Simply print the input character without + any special translation if pass_thru is set. + + * layout.h: Added bool pass_thru to layout class for being able to + implement pass through of a paragraph for Literate Programming. + + * layout.C: add LT_PASS_THRU to LayoutTags enum. + * layout.C (LyXLayout): set pass_thru to flase in constructor. + * layout.C (Read): add "passthru" to list of layout tags and add + code to set the pass_thru boolean when it is read. + 2001-07-12 Lars Gullik Bjønnes * trans_decl.h: remove allowed from KmodInfo diff --git a/src/layout.C b/src/layout.C index 44e05f66a0..27efc567d4 100644 --- a/src/layout.C +++ b/src/layout.C @@ -70,6 +70,7 @@ enum LayoutTags { //LT_FIRST_COUNTER, LT_FONT, LT_FREE_SPACING, + LT_PASS_THRU, //LT_HEADINGS, LT_ITEMSEP, LT_KEEPEMPTY, @@ -133,6 +134,7 @@ LyXLayout::LyXLayout () fill_bottom = false; newline_allowed = true; free_spacing = false; + pass_thru = false; } @@ -174,6 +176,7 @@ bool LyXLayout::Read (LyXLex & lexrc, LyXTextClass const & tclass) { "parindent", LT_PARINDENT }, { "parsep", LT_PARSEP }, { "parskip", LT_PARSKIP }, + { "passthru", LT_PASS_THRU }, { "preamble", LT_PREAMBLE }, { "rightmargin", LT_RIGHTMARGIN }, { "spacing", LT_SPACING }, @@ -392,6 +395,11 @@ bool LyXLayout::Read (LyXLex & lexrc, LyXTextClass const & tclass) free_spacing = lexrc.GetInteger(); break; + case LT_PASS_THRU: // Allow for pass thru. + if (lexrc.next()) + pass_thru = lexrc.GetInteger(); + break; + case LT_SPACING: // setspace.sty readSpacing(lexrc); break; diff --git a/src/layout.h b/src/layout.h index 6ef20a9934..55c15a8fd5 100644 --- a/src/layout.h +++ b/src/layout.h @@ -321,6 +321,10 @@ public: /// bool free_spacing; + + /// + bool pass_thru; + /** true when the fragile commands in the paragraph need to be \protect'ed. */ bool needprotect; diff --git a/src/mathed/formulabase.C b/src/mathed/formulabase.C index 97fd2d0de3..8142bd875c 100644 --- a/src/mathed/formulabase.C +++ b/src/mathed/formulabase.C @@ -858,7 +858,10 @@ InsetFormulaBase::localDispatch(BufferView * bv, kb_action action, default: if ((action == -1 || action == LFUN_SELFINSERT) && !arg.empty()) { unsigned char c = arg[0]; - //lyxerr << "char: '" << c << "' int: " << int(c) << endl; + + lyxerr << "Action: " << action << endl; + + lyxerr << "char: '" << c << "' int: " << int(c) << endl; //owner_->getIntl()->getTrans().TranslateAndInsert(c, lt); //lyxerr << "trans: '" << c << "' int: " << int(c) << endl; bv->lockedInsetStoreUndo(Undo::INSERT); diff --git a/src/paragraph_pimpl.C b/src/paragraph_pimpl.C index 27de45d0ae..182d1165d8 100644 --- a/src/paragraph_pimpl.C +++ b/src/paragraph_pimpl.C @@ -208,6 +208,7 @@ void Paragraph::Pimpl::simpleTeXBlanks(std::ostream & os, TexRow & texrow, int & column, LyXFont const & font, LyXLayout const & style) { + if (style.pass_thru) return; if (column > tex_code_break_column && i && getChar(i - 1) != ' ' @@ -266,6 +267,10 @@ void Paragraph::Pimpl::simpleTeXSpecialChars(Buffer const * buf, int & column, Paragraph::value_type const c) { + if (style.pass_thru) { + if (c != '\0') os << c; + return; + } // Two major modes: LaTeX or plain // Handle here those cases common to both modes // and then split to handle the two modes separately. -- 2.39.2