From d5c4ecc548777daa7349df7a19edca8702dea19d Mon Sep 17 00:00:00 2001 From: Jean-Marc Lasgouttes Date: Fri, 1 Mar 2002 12:39:22 +0000 Subject: [PATCH] tentative fix for #177; small things git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@3624 a592a061-630c-0410-9148-cb99ea01b6c8 --- lib/ChangeLog | 9 ++++++ lib/chkconfig.ltx | 9 +++--- lib/doc/LaTeXConfig.lyx.in | 60 -------------------------------------- lib/ui/default.ui | 2 +- src/BufferView_pimpl.C | 1 - src/ChangeLog | 13 +++++++++ src/text2.C | 45 ++-------------------------- src/vspace.C | 44 ++++++++++++++++++---------- 8 files changed, 58 insertions(+), 125 deletions(-) diff --git a/lib/ChangeLog b/lib/ChangeLog index b0db0b0925..806b68d74b 100644 --- a/lib/ChangeLog +++ b/lib/ChangeLog @@ -1,3 +1,12 @@ +2002-03-01 Jean-Marc Lasgouttes + + * ui/default.ui: fix shortcut for Insert>Math>Inline formula. + + * chkconfig.ltx: do not check for graphics anymore, only graphicx. + + * doc/LaTeXConfig.lyx.in: remove info about graphics package, now + that figinset is dead. + 2002-02-19 Angus Leeming * ui/default.ui: add a show-forks item to the two File menus. diff --git a/lib/chkconfig.ltx b/lib/chkconfig.ltx index a428b4db17..6480354a69 100644 --- a/lib/chkconfig.ltx +++ b/lib/chkconfig.ltx @@ -12,7 +12,7 @@ %%% If you want to add new packages/documentclasses to be recognized, %%% read the explanation that follow and jump to the section 'Actual %%% inspection code' below. You do not need to understand the ugly -%%% LaTeX code below to help improving chklatex.ltx :-) +%%% LaTeX code below to help improving chkconfig.ltx :-) %%% %%% If you want to add the new package , all you need most of %%% the times is a two-steps work: @@ -212,7 +212,6 @@ \TestPackage{array} \TestPackage{babel} \TestPackage{color} % this one should be there if graphics.sty is there. -\TestPackage{graphicx} % this one should be there if graphics.sty is there. \TestPackage{fancyhdr} \TestPackage{floatflt} \TestPackage{setspace} @@ -229,14 +228,14 @@ % The test for the graphics package is slightly more involved... \newcommand\groption{dvips} -\TestItem{graphics}{package}{sty} +\TestItem{graphicx}{package}{sty} % Let's do some clever things to guess the default driver for the -% graphics package. The maintainer of the site might have declared it +% graphicx package. The maintainer of the site might have declared it % in the file 'graphics.cfg'. Let's hope there are no strange commands % in there... {\renewcommand\ExecuteOptions[1]{\renewcommand\groption{default}} \InputIfFileExists{graphics.cfg}{}{} - \AddPackage{graphics}} + \AddPackage{graphicx}} {\renewcommand{\groption}{none}} \message{^^J\prefix checking for graphics driver... \groption^^J} \AddVariable{graphicsdriver}{\groption} diff --git a/lib/doc/LaTeXConfig.lyx.in b/lib/doc/LaTeXConfig.lyx.in index 2b07fd21f2..0069c753cc 100644 --- a/lib/doc/LaTeXConfig.lyx.in +++ b/lib/doc/LaTeXConfig.lyx.in @@ -1277,66 +1277,6 @@ graphics package. \layout Subsection - -\begin_inset LatexCommand \label{ssec:graphics} - -\end_inset - -graphics -\layout Description - -Found: @chk_graphics@ -\layout Description - -CTAN: -\family typewriter -macros/latex/required/graphics/ -\layout Description - -Notes: The package -\family sans -graphics -\family default - is needed by LyX to insert PostScript® figures (using the older figure - inset). - You will also need the program -\family typewriter -\size normal -ghostview -\family default -\size default - to see them on screen. - The configuration script has determined that the graphics driver used by - the package should be -\family sans - -\begin_inset Quotes eld -\end_inset - -@chk_graphicsdriver@ -\begin_inset Quotes erd -\end_inset - - -\begin_inset Foot -collapsed true - -\layout Standard - -Here, a value of -\begin_inset Quotes eld -\end_inset - -default -\begin_inset Quotes erd -\end_inset - - means that your LaTeX installation provides a sensible value for this parameter. -\end_inset - -. -\layout Subsection - graphicx \layout Description diff --git a/lib/ui/default.ui b/lib/ui/default.ui index c3522a45f0..cc148b1c6b 100644 --- a/lib/ui/default.ui +++ b/lib/ui/default.ui @@ -224,7 +224,7 @@ Menuset End Menu "insert_math" - Item "Inline Formula|h" "math-mode" + Item "Inline Formula|I" "math-mode" Item "Display Formula|D" "math-display" Item "Eqnarray environment|E" "command-sequence math-mode; math-mutate eqnarray;" Item "AMS align environment|A" "command-sequence math-mode; math-mutate align;" diff --git a/src/BufferView_pimpl.C b/src/BufferView_pimpl.C index 8f3964a4d9..a90b76067a 100644 --- a/src/BufferView_pimpl.C +++ b/src/BufferView_pimpl.C @@ -1542,7 +1542,6 @@ bool BufferView::Pimpl::Dispatch(kb_action action, string const & argument) break; } - case LFUN_TABULAR_FEATURE: case LFUN_SCROLL_INSET: // this is not handled here as this funktion is only aktive // if we have a locking_inset and that one is (or contains) diff --git a/src/ChangeLog b/src/ChangeLog index d02220b7e1..0a54d70bed 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,16 @@ +2002-03-01 Jean-Marc Lasgouttes + + * vspace.C (asLatexCommand): rewrite in a slightly different form. + +2002-03-01 Martin Vermeer + + * text2.C (setCharFont): eliminate setCharFont code duplication. + +2002-03-01 Jean-Marc Lasgouttes + + * BufferView_pimpl.C (Dispatch): remove bogus handling of + LFUN_TABULAR_FEATURE (bug #177) + 2002-02-29 ;-) Angus Leeming * Makefile.am: remove figure.h diff --git a/src/text2.C b/src/text2.C index d0e6bd231e..e6cfd1f417 100644 --- a/src/text2.C +++ b/src/text2.C @@ -264,48 +264,9 @@ void LyXText::setCharFont(BufferView * bv, Paragraph * par, } } - LyXLayout const & layout = - textclasslist.Style(buf->params.textclass, - par->getLayout()); - - // Get concrete layout font to reduce against - LyXFont layoutfont; - - if (pos < beginningOfMainBody(buf, par)) - layoutfont = layout.labelfont; - else - layoutfont = layout.font; - - // Realize against environment font information - if (par->getDepth()) { - Paragraph * tp = par; - while (!layoutfont.resolved() && tp && tp->getDepth()) { - tp = tp->outerHook(); - if (tp) -#ifndef INHERIT_LANGUAGE - layoutfont.realize(textclasslist. - Style(buf->params.textclass, - tp->getLayout()).font); -#else - layoutfont.realize(textclasslist. - Style(buf->params.textclass, - tp->getLayout()).font, - buf->params.language); -#endif - } - } - -#ifndef INHERIT_LANGUAGE - layoutfont.realize(textclasslist.TextClass(buf->params.textclass).defaultfont()); -#else - layoutfont.realize(textclasslist.TextClass(buf->params.textclass).defaultfont(), - buf->params.language); -#endif - - // Now, reduce font against full layout font - font.reduce(layoutfont); - - par->setFont(pos, font); + // Plug thru to version below: + setCharFont(buf, par, pos, font); + } diff --git a/src/vspace.C b/src/vspace.C index 51a360463f..e65d4e8c21 100644 --- a/src/vspace.C +++ b/src/vspace.C @@ -427,29 +427,41 @@ string const VSpace::asLyXCommand() const string const VSpace::asLatexCommand(BufferParams const & params) const { + string ret; + switch (kind_) { - case NONE: return string(); + case NONE: + break; case DEFSKIP: - return params.getDefSkip().asLatexCommand(params); - case SMALLSKIP: return keep_ ? "\\vspace*{\\smallskipamount}" - : "\\smallskip{}"; - case MEDSKIP: return keep_ ? "\\vspace*{\\medskipamount}" - : "\\medskip{}"; - case BIGSKIP: return keep_ ? "\\vspace*{\\bigskipamount}" - : "\\bigskip{}"; - case VFILL: return keep_ ? "\\vspace*{\\fill}" - : "\\vfill{}"; - case LENGTH: return keep_ ? "\\vspace*{" + len_.asLatexString() + '}' - : "\\vspace{" + len_.asLatexString() + '}'; + ret = params.getDefSkip().asLatexCommand(params); + break; + case SMALLSKIP: + ret = keep_ ? "\\vspace*{\\smallskipamount}" + : "\\smallskip{}"; + break; + case MEDSKIP: + ret = keep_ ? "\\vspace*{\\medskipamount}" + : "\\medskip{}"; + break; + case BIGSKIP: + ret = keep_ ? "\\vspace*{\\bigskipamount}" + : "\\bigskip{}"; + break; + case VFILL: + ret = keep_ ? "\\vspace*{\\fill}" + : "\\vfill{}"; + break; + case LENGTH: + ret = keep_ ? "\\vspace*{" + len_.asLatexString() + '}' + : "\\vspace{" + len_.asLatexString() + '}'; + break; } - lyx::Assert(0); - // of course, we cannot get there, but gcc is too stupid to - // see that. *Sigh* - return string(); + return ret; } + int VSpace::inPixels(BufferView * bv) const { // Height of a normal line in pixels (zoom factor considered) -- 2.39.2