]> git.lyx.org Git - features.git/commitdiff
Fix writer2latex quote handling (bug #8903)
authorGeorg Baum <baum@lyx.org>
Wed, 11 Dec 2013 20:54:26 +0000 (21:54 +0100)
committerGeorg Baum <baum@lyx.org>
Wed, 11 Dec 2013 20:54:26 +0000 (21:54 +0100)
writer2latex surrounds quotes by braces which we skip to avoid useless ERT.
I broke this in 25fe87e5 which made Parser::next_next_token() not recognize
that it needed to parse one more token. If we had a unit test for the Parser
class it would probably have detected that. Now we have at least a test for
the special quote.

src/tex2lyx/Parser.cpp
src/tex2lyx/test/test-insets.lyx.lyx
src/tex2lyx/test/test-insets.tex

index 23a1bf1a013e104088b33d01ec7f1f64f6cbbe08..7a9fff137265009a5b6a991e4d65c3bcd5741745 100644 (file)
@@ -319,11 +319,10 @@ Token const Parser::next_next_token()
                return dummy;
        // If tokenize_one() has not been called after the last get_token() we
        // need to tokenize two more tokens.
-       if (pos_ >= tokens_.size()) {
+       if (pos_ >= tokens_.size())
+               tokenize_one();
+       if (pos_ + 1 >= tokens_.size())
                tokenize_one();
-               if (pos_ + 1 >= tokens_.size())
-                       tokenize_one();
-       }
        return pos_ + 1 < tokens_.size() ? tokens_[pos_ + 1] : dummy;
 }
 
index f7e70f843204bf27f5efb50767479660c65a1e12..d598d406b659588f2ea78e2bdc0c40ac90878f01 100644 (file)
@@ -6635,6 +6635,14 @@ script with
 .
 \end_layout
 
+\begin_layout Standard
+latex2writer outputs quotes in braces like 
+\begin_inset Quotes ers
+\end_inset
+
+. We swallow the, but this was one broken (bug 8903).
+\end_layout
+
 \begin_layout Section
 Mathematics
 \begin_inset Index idx
index ebc7d619aa1a4766210a2322269ad68b39deb08b..ea33b6646f693bf796eec2a66da00c6410420042 100644 (file)
@@ -654,6 +654,9 @@ builtin \textasciicircum % with a comment
 A sub\textsubscript{sc\emph{ript}} and super\textsuperscript{script
 with $a^2+b^2=c^2$ math}.
 
+latex2writer outputs quotes in braces like {\textquoteright}. We swallow the,
+but this was one broken (bug 8903).
+
 
 \section{Mathematics\index{Mathematics}}