From 6ddcfb87e4b3c4e21c4ea6b84b4162d2d7c537e8 Mon Sep 17 00:00:00 2001 From: Juergen Spitzmueller Date: Sat, 26 May 2012 16:36:24 +0200 Subject: [PATCH] Fix macro termination in IPA inset if next character uses a TIPA shortcut --- src/Paragraph.cpp | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/Paragraph.cpp b/src/Paragraph.cpp index 8b0995220c..afcf5ac57a 100644 --- a/src/Paragraph.cpp +++ b/src/Paragraph.cpp @@ -1275,8 +1275,15 @@ void Paragraph::Private::latexSpecialChar(otexstream & os, string script; pair 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 -- 2.39.2