pass_thru

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@2262 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Lars Gullik Bjønnes 2001-07-17 09:41:34 +00:00
parent 188ec04f70
commit 4ed9f14187
8 changed files with 42 additions and 3 deletions

View File

@ -1,3 +1,7 @@
2001-07-12 Kayvan A. Sylvan <kayvan@camel.internal.sylvan.com>
* layouts/literate-scrap.inc: Added PassThru tag
2001-07-13 Jean-Marc Lasgouttes <Jean-Marc.Lasgouttes@inria.fr> 2001-07-13 Jean-Marc Lasgouttes <Jean-Marc.Lasgouttes@inria.fr>
* bind/*.bind: do the same correctly for all files :) * bind/*.bind: do the same correctly for all files :)

View File

@ -22,13 +22,14 @@ Style Scrap
Align Left Align Left
AlignPossible Block,Left AlignPossible Block,Left
FreeSpacing 1 FreeSpacing 1
PassThru 1
LabelType Static LabelType Static
LabelFont LabelFont
Color magenta Color magenta
EndFont EndFont
TextFont TextFont
Latex Latex Color latex
Family Typewriter Family Typewriter
EndFont EndFont

View File

@ -9,7 +9,6 @@ src/converter.C
src/CutAndPaste.C src/CutAndPaste.C
src/debug.C src/debug.C
src/exporter.C src/exporter.C
src/ext_l10n.h
src/figure_form.C src/figure_form.C
src/figureForm.C src/figureForm.C
src/FontLoader.C src/FontLoader.C

View File

@ -59,6 +59,21 @@
* sp_form.[Ch]: removed * sp_form.[Ch]: removed
* spellchecker.[Ch]: removed * spellchecker.[Ch]: removed
2001-07-12 Kayvan A. Sylvan <kayvan@camel.internal.sylvan.com>
* 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 <larsbj@birdstep.com> 2001-07-12 Lars Gullik Bjønnes <larsbj@birdstep.com>
* trans_decl.h: remove allowed from KmodInfo * trans_decl.h: remove allowed from KmodInfo

View File

@ -70,6 +70,7 @@ enum LayoutTags {
//LT_FIRST_COUNTER, //LT_FIRST_COUNTER,
LT_FONT, LT_FONT,
LT_FREE_SPACING, LT_FREE_SPACING,
LT_PASS_THRU,
//LT_HEADINGS, //LT_HEADINGS,
LT_ITEMSEP, LT_ITEMSEP,
LT_KEEPEMPTY, LT_KEEPEMPTY,
@ -133,6 +134,7 @@ LyXLayout::LyXLayout ()
fill_bottom = false; fill_bottom = false;
newline_allowed = true; newline_allowed = true;
free_spacing = false; free_spacing = false;
pass_thru = false;
} }
@ -174,6 +176,7 @@ bool LyXLayout::Read (LyXLex & lexrc, LyXTextClass const & tclass)
{ "parindent", LT_PARINDENT }, { "parindent", LT_PARINDENT },
{ "parsep", LT_PARSEP }, { "parsep", LT_PARSEP },
{ "parskip", LT_PARSKIP }, { "parskip", LT_PARSKIP },
{ "passthru", LT_PASS_THRU },
{ "preamble", LT_PREAMBLE }, { "preamble", LT_PREAMBLE },
{ "rightmargin", LT_RIGHTMARGIN }, { "rightmargin", LT_RIGHTMARGIN },
{ "spacing", LT_SPACING }, { "spacing", LT_SPACING },
@ -392,6 +395,11 @@ bool LyXLayout::Read (LyXLex & lexrc, LyXTextClass const & tclass)
free_spacing = lexrc.GetInteger(); free_spacing = lexrc.GetInteger();
break; break;
case LT_PASS_THRU: // Allow for pass thru.
if (lexrc.next())
pass_thru = lexrc.GetInteger();
break;
case LT_SPACING: // setspace.sty case LT_SPACING: // setspace.sty
readSpacing(lexrc); readSpacing(lexrc);
break; break;

View File

@ -321,6 +321,10 @@ public:
/// ///
bool free_spacing; bool free_spacing;
///
bool pass_thru;
/** true when the fragile commands in the paragraph need to be /** true when the fragile commands in the paragraph need to be
\protect'ed. */ \protect'ed. */
bool needprotect; bool needprotect;

View File

@ -858,7 +858,10 @@ InsetFormulaBase::localDispatch(BufferView * bv, kb_action action,
default: default:
if ((action == -1 || action == LFUN_SELFINSERT) && !arg.empty()) { if ((action == -1 || action == LFUN_SELFINSERT) && !arg.empty()) {
unsigned char c = arg[0]; 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); //owner_->getIntl()->getTrans().TranslateAndInsert(c, lt);
//lyxerr << "trans: '" << c << "' int: " << int(c) << endl; //lyxerr << "trans: '" << c << "' int: " << int(c) << endl;
bv->lockedInsetStoreUndo(Undo::INSERT); bv->lockedInsetStoreUndo(Undo::INSERT);

View File

@ -208,6 +208,7 @@ void Paragraph::Pimpl::simpleTeXBlanks(std::ostream & os, TexRow & texrow,
int & column, LyXFont const & font, int & column, LyXFont const & font,
LyXLayout const & style) LyXLayout const & style)
{ {
if (style.pass_thru) return;
if (column > tex_code_break_column if (column > tex_code_break_column
&& i && i
&& getChar(i - 1) != ' ' && getChar(i - 1) != ' '
@ -266,6 +267,10 @@ void Paragraph::Pimpl::simpleTeXSpecialChars(Buffer const * buf,
int & column, int & column,
Paragraph::value_type const c) Paragraph::value_type const c)
{ {
if (style.pass_thru) {
if (c != '\0') os << c;
return;
}
// Two major modes: LaTeX or plain // Two major modes: LaTeX or plain
// Handle here those cases common to both modes // Handle here those cases common to both modes
// and then split to handle the two modes separately. // and then split to handle the two modes separately.