Jean-Marc Lasgouttes wrote:

>>>>>> "Georg" == Georg Baum
>>>>>> <[EMAIL PROTECTED]>
>>>>>> writes:
> 
> Georg> I was about to write 'No'. Then I tried to do it and now I
> Georg> write 'Yes' :-( That was probably the reason for the change: In
> Georg> 1.3 \lyxline is handled by the paragraph code, and now it is an
> Georg> own inset. That means that we don't have direct access to the
> Georg> current font anymore (or do we? At least I don't know how to
> Georg> get it). I'll think about that again when I have some time.
> 
> We should add this information to OutputParam (local_font) and
> probably get rid of local_language (which is contined in the font
> AFAIK).

Thanks for the hint, that was easy. The attached patch fixes the problem for
lyxline insets (which is BTW now bug 2014:
http://bugzilla.lyx.org/show_bug.cgi?id=2014).

OK to commit?

What remains to be done is to adjust the lyx2lyx conversion to retain the
size information.


Georg
Index: src/ChangeLog
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/ChangeLog,v
retrieving revision 1.2270
diff -u -p -r1.2270 ChangeLog
--- src/ChangeLog	7 Sep 2005 10:36:57 -0000	1.2270
+++ src/ChangeLog	7 Sep 2005 12:34:16 -0000
@@ -1,3 +1,8 @@
+2005-09-07  Georg Baum  <[EMAIL PROTECTED]>
+
+	* outputparams.[Ch]: store local_font instead of local_language
+	* paragraph.C (simpleTeXOnePar): adapt to the change above
+
 2005-08-03  Jean-Marc Lasgouttes  <[EMAIL PROTECTED]>
 
 	* text.C (read): remove unused variable.
Index: src/outputparams.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/outputparams.C,v
retrieving revision 1.3
diff -u -p -r1.3 outputparams.C
--- src/outputparams.C	2 Nov 2004 11:25:16 -0000	1.3
+++ src/outputparams.C	7 Sep 2005 12:18:24 -0000
@@ -16,7 +16,7 @@
 
 OutputParams::OutputParams()
 	: flavor(LATEX), nice(false), moving_arg(false),
-	  free_spacing(false), use_babel(false),
+	  local_font(0), free_spacing(false), use_babel(false),
 	  linelen(0), depth(0),
 	  exportdata(new ExportData)
 {}
Index: src/outputparams.h
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/outputparams.h,v
retrieving revision 1.13
diff -u -p -r1.13 outputparams.h
--- src/outputparams.h	7 Jul 2005 10:51:56 -0000	1.13
+++ src/outputparams.h	7 Sep 2005 12:18:24 -0000
@@ -19,7 +19,7 @@
 
 
 class ExportData;
-class Language;
+class LyXFont;
 
 
 class OutputParams {
@@ -48,19 +48,19 @@ public:
 
 	/** moving_arg == true means that the environment in which the inset
 	    is typeset is a moving argument. The inset should take care about
-	    fragile commands by preceding the latex with \protect.
+	    fragile commands by preceding the latex with \\protect.
 	*/
 	bool moving_arg;
 
 	/** intitle == true means that the environment in which the
-	    inset is typeset is part of a title (before a \maketitle).
+	    inset is typeset is part of a title (before a \\maketitle).
 	    Footnotes in such environments have moving arguments.
 	*/
 	bool intitle;
 
-	/** the language at the point where the inset is
+	/** the font at the point where the inset is
 	 */
-	Language const * local_language;
+	LyXFont const * local_font;
 
 	/** Document language babel name
 	 */
Index: src/paragraph.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/paragraph.C,v
retrieving revision 1.413
diff -u -p -r1.413 paragraph.C
--- src/paragraph.C	7 Sep 2005 10:36:58 -0000	1.413
+++ src/paragraph.C	7 Sep 2005 12:18:24 -0000
@@ -1013,7 +1007,7 @@ bool Paragraph::simpleTeXOnePar(Buffer c
 		if (output || running_change != Change::DELETED) {
 			OutputParams rp = runparams;
 			rp.free_spacing = style->free_spacing;
-			rp.local_language = font.language();
+			rp.local_font = &font;
 			rp.intitle = style->intitle;
 			pimpl_->simpleTeXSpecialChars(buf, bparams,
 						os, texrow, rp,
Index: src/insets/ChangeLog
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/ChangeLog,v
retrieving revision 1.1182
diff -u -p -r1.1182 ChangeLog
--- src/insets/ChangeLog	7 Sep 2005 10:37:02 -0000	1.1182
+++ src/insets/ChangeLog	7 Sep 2005 12:34:17 -0000
@@ -1,3 +1,8 @@
+2005-09-07  Georg Baum  <[EMAIL PROTECTED]>
+
+	* insetline.C (latex): write the size argument of \lyxline again
+	* insetquotes.C (latex): adapt to OutputParams changes
+
 2005-08-03  Jean-Marc Lasgouttes  <[EMAIL PROTECTED]>
 
 	* insettabular.C (draw): pass PainterInfro::erased_ to
Index: src/insets/insetline.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetline.C,v
retrieving revision 1.4
diff -u -p -r1.4 insetline.C
--- src/insets/insetline.C	16 Aug 2004 11:27:50 -0000	1.4
+++ src/insets/insetline.C	7 Sep 2005 12:18:35 -0000
@@ -53,16 +53,9 @@ void InsetLine::draw(PainterInfo & pi, i
 
 
 int InsetLine::latex(Buffer const &, ostream & os,
-			OutputParams const &) const
+			OutputParams const & runparams) const
 {
-	os << "\\lyxline{}";
-
-/* was:
-	os << "\\lyxline{\\"
-		 << pit->getFont(bparams, 0, outerFont(pit, paragraphs)).latexSize()
-		 << "}\\vspace{-1\\parskip}";
-*/
-
+	os << "\\lyxline{\\" << runparams.local_font->latexSize() << '}';
 	return 0;
 }
 
Index: src/insets/insetquotes.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetquotes.C,v
retrieving revision 1.121
diff -u -p -r1.121 insetquotes.C
--- src/insets/insetquotes.C	7 Jul 2005 10:51:58 -0000	1.121
+++ src/insets/insetquotes.C	7 Sep 2005 12:18:35 -0000
@@ -270,7 +270,7 @@ int InsetQuotes::latex(Buffer const &, o
 	string qstr;
 
 	if (language_ == FrenchQ && times_ == DoubleQ
-	    && prefixIs(runparams.local_language->code(), "fr")) {
+	    && prefixIs(runparams.local_font->language()->code(), "fr")) {
 		if (side_ == LeftQ)
 			qstr = "\\og "; //the spaces are important here
 		else

Reply via email to