[prev in list] [next in list] [prev in thread] [next in thread] 

List:       lyx-devel
Subject:    Re: [LyX master] Fix macro termination in IPA inset if next character uses a TIPA shortcut
From:       Richard Heck <rgheck () comcast ! net>
Date:       2012-05-26 19:50:31
Message-ID: 4FC13407.1000009 () comcast ! net
[Download RAW message or body]

On 05/26/2012 10:36 AM, Juergen Spitzmueller wrote:
> The branch, master, has been updated.
>
> - Log -----------------------------------------------------------------
>
> commit 6ddcfb87e4b3c4e21c4ea6b84b4162d2d7c537e8
> Author: Juergen Spitzmueller<spitz@lyx.org>
> Date:   Sat May 26 16:36:24 2012 +0200
>
>      Fix macro termination in IPA inset if next character uses a TIPA shortcut
Is this needed for branch? If so, it looks fine to me.

rh

> diff --git a/src/Paragraph.cpp b/src/Paragraph.cpp
> index 8b09952..afcf5ac 100644
> --- a/src/Paragraph.cpp
> +++ b/src/Paragraph.cpp
> @@ -1275,8 +1275,15 @@ void Paragraph::Private::latexSpecialChar(otexstream&  os,
>   		string script;
>   		pair<docstring, bool>  latex = encoding.latexChar(c);
>   		docstring nextlatex;
> -		if (next != '\0'&&  next != META_INSET)
> +		bool nexttipas = false;
> +		string nexttipashortcut;
> +		if (next != '\0'&&  next != META_INSET) {
>   			nextlatex = encoding.latexChar(next).first;
> +			if (runparams.inIPA) {
> +				nexttipashortcut = Encodings::TIPAShortcut(next);
> +				nexttipas = !nexttipashortcut.empty();
> +			}
> +		}
>   		bool tipas = false;
>   		if (runparams.inIPA) {
>   			string const tipashortcut = Encodings::TIPAShortcut(c);
> @@ -1291,9 +1298,11 @@ void Paragraph::Private::latexSpecialChar(otexstream&  os,
>   			column += writeScriptChars(os, latex.first,
>   					running_change, encoding, i) - 1;
>   		else if (latex.second
> -			&&  !prefixIs(nextlatex, '\\')
> -			&&  !prefixIs(nextlatex, '{')
> -			&&  !prefixIs(nextlatex, '}')
> +			&&  ((!prefixIs(nextlatex, '\\')
> +			&&  !prefixIs(nextlatex, '{')
> +			&&  !prefixIs(nextlatex, '}'))
> +			     || (nexttipas
> +			&&  !prefixIs(from_ascii(nexttipashortcut), '\\')))
>   			&&  !tipas) {
>   			// Prevent eating of a following
>   			// space or command corruption by
>
> -----------------------------------------------------------------------
>
> Summary of changes:
>   src/Paragraph.cpp |   17 +++++++++++++----
>   1 files changed, 13 insertions(+), 4 deletions(-)
>
>
> hooks/post-receive

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic