Re: [PATCH] Fix for Bugs 3630 and 3461

2007-05-17 Thread José Matos
On Thursday 17 May 2007 00:29:20 Richard Heck wrote:
 Waiting to commit until I get the OK.

  OK.

 Richard

-- 
José Abílio


Re: [PATCH] Fix for Bugs 3630 and 3461

2007-05-17 Thread José Matos
On Thursday 17 May 2007 00:29:20 Richard Heck wrote:
> Waiting to commit until I get the OK.

  OK.

> Richard

-- 
José Abílio


[PATCH] Fix for Bugs 3630 and 3461

2007-05-16 Thread Richard Heck

Whoops. Another of those really easy fixes...and sent to the wrong list,
too. Bad day
=


The attached patch addresses these two bugs. The problem was that
Text::setFont was not updating the current font (real_current_font, etc)
when a selection (implicit or explicit) was active. This appeared with
the emphasis toolbar button but on examination affected much more.

I've tested this and see no issues with it.

Waiting to commit until I get the OK.

Richard

-- 
==
Richard G Heck, Jr
Professor of Philosophy
Brown University
http://frege.brown.edu/heck/
==
Get my public key from http://sks.keyserver.penguin.de
Hash: 0x1DE91F1E66FFBDEC
Learn how to sign your email using Thunderbird and GnuPG at:
http://dudu.dyn.2-h.org/nist/gpg-enigmail-howto



Index: Text2.cpp
===
--- Text2.cpp	(revision 18373)
+++ Text2.cpp	(working copy)
@@ -437,29 +437,29 @@
 void Text::setFont(Cursor  cur, Font const  font, bool toggleall)
 {
 	BOOST_ASSERT(this == cur.text());
-	// if there is no selection just set the current_font
-	if (!cur.selection()) {
-		// Determine basis font
-		Font layoutfont;
-		pit_type pit = cur.pit();
-		if (cur.pos()  pars_[pit].beginOfBody())
-			layoutfont = getLabelFont(cur.buffer(), pars_[pit]);
-		else
-			layoutfont = getLayoutFont(cur.buffer(), pit);
+	// Set the current_font
+	// Determine basis font
+	Font layoutfont;
+	pit_type pit = cur.pit();
+	if (cur.pos()  pars_[pit].beginOfBody())
+		layoutfont = getLabelFont(cur.buffer(), pars_[pit]);
+	else
+		layoutfont = getLayoutFont(cur.buffer(), pit);
 
-		// Update current font
-		real_current_font.update(font,
-	 cur.buffer().params().language,
-	 toggleall);
+	// Update current font
+	real_current_font.update(font,
+	cur.buffer().params().language,
+	toggleall);
 
-		// Reduce to implicit settings
-		current_font = real_current_font;
-		current_font.reduce(layoutfont);
-		// And resolve it completely
-		real_current_font.realize(layoutfont);
+	// Reduce to implicit settings
+	current_font = real_current_font;
+	current_font.reduce(layoutfont);
+	// And resolve it completely
+	real_current_font.realize(layoutfont);
 
+	// if there is no selection that's all we need to do 
+	if (!cur.selection())
 		return;
-	}
 
 	// Ok, we have a selection.
 	recordUndoSelection(cur);



[PATCH] Fix for Bugs 3630 and 3461

2007-05-16 Thread Richard Heck

Whoops. Another of those really easy fixes...and sent to the wrong list,
too. Bad day
=


The attached patch addresses these two bugs. The problem was that
Text::setFont was not updating the current font (real_current_font, etc)
when a selection (implicit or explicit) was active. This appeared with
the emphasis toolbar button but on examination affected much more.

I've tested this and see no issues with it.

Waiting to commit until I get the OK.

Richard

-- 
==
Richard G Heck, Jr
Professor of Philosophy
Brown University
http://frege.brown.edu/heck/
==
Get my public key from http://sks.keyserver.penguin.de
Hash: 0x1DE91F1E66FFBDEC
Learn how to sign your email using Thunderbird and GnuPG at:
http://dudu.dyn.2-h.org/nist/gpg-enigmail-howto



Index: Text2.cpp
===
--- Text2.cpp	(revision 18373)
+++ Text2.cpp	(working copy)
@@ -437,29 +437,29 @@
 void Text::setFont(Cursor & cur, Font const & font, bool toggleall)
 {
 	BOOST_ASSERT(this == cur.text());
-	// if there is no selection just set the current_font
-	if (!cur.selection()) {
-		// Determine basis font
-		Font layoutfont;
-		pit_type pit = cur.pit();
-		if (cur.pos() < pars_[pit].beginOfBody())
-			layoutfont = getLabelFont(cur.buffer(), pars_[pit]);
-		else
-			layoutfont = getLayoutFont(cur.buffer(), pit);
+	// Set the current_font
+	// Determine basis font
+	Font layoutfont;
+	pit_type pit = cur.pit();
+	if (cur.pos() < pars_[pit].beginOfBody())
+		layoutfont = getLabelFont(cur.buffer(), pars_[pit]);
+	else
+		layoutfont = getLayoutFont(cur.buffer(), pit);
 
-		// Update current font
-		real_current_font.update(font,
-	 cur.buffer().params().language,
-	 toggleall);
+	// Update current font
+	real_current_font.update(font,
+	cur.buffer().params().language,
+	toggleall);
 
-		// Reduce to implicit settings
-		current_font = real_current_font;
-		current_font.reduce(layoutfont);
-		// And resolve it completely
-		real_current_font.realize(layoutfont);
+	// Reduce to implicit settings
+	current_font = real_current_font;
+	current_font.reduce(layoutfont);
+	// And resolve it completely
+	real_current_font.realize(layoutfont);
 
+	// if there is no selection that's all we need to do 
+	if (!cur.selection())
 		return;
-	}
 
 	// Ok, we have a selection.
 	recordUndoSelection(cur);