commit b2841e957070b0b7ea506a099db5b4436196f4e0
Author: Juergen Spitzmueller <sp...@lyx.org>
Date:   Thu Aug 10 11:47:52 2017 +0200

    Require textquotedbl def with second language that has internal fontenc
    
    Since these switch locally to encodings that do not define \textquotedbl
    themselves.
---
 src/Paragraph.cpp          |    3 ++-
 src/insets/InsetQuotes.cpp |    7 ++++---
 src/insets/InsetQuotes.h   |    4 +++-
 3 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/src/Paragraph.cpp b/src/Paragraph.cpp
index 309c20c..f9684ff 100644
--- a/src/Paragraph.cpp
+++ b/src/Paragraph.cpp
@@ -1505,7 +1505,8 @@ void Paragraph::Private::validate(LaTeXFeatures & 
features) const
                if (c == 0x0022) {
                        if (features.runparams().isFullUnicode() && 
bp.useNonTeXFonts)
                                features.require("textquotedblp");
-                       else if (bp.main_font_encoding() != "T1")
+                       else if (bp.main_font_encoding() != "T1"
+                                || ((&owner_->getFontSettings(bp, 
i))->language()->internalFontEncoding()))
                                features.require("textquotedbl");
                }
                BufferEncodings::validate(c, features);
diff --git a/src/insets/InsetQuotes.cpp b/src/insets/InsetQuotes.cpp
index 8292ec9..24be900 100644
--- a/src/insets/InsetQuotes.cpp
+++ b/src/insets/InsetQuotes.cpp
@@ -603,7 +603,7 @@ docstring const 
InsetQuotesParams::getShortGuiLabel(docstring const string)
 InsetQuotes::InsetQuotes(Buffer * buf, string const & str)
        : Inset(buf),
          style_(InsetQuotesParams::EnglishQuotes), 
side_(InsetQuotesParams::OpeningQuote),
-         pass_thru_(false)
+         pass_thru_(false), internal_fontenc_(false)
 {
        if (buf) {
                global_style_ = buf->masterBuffer()->params().quotes_style;
@@ -620,7 +620,7 @@ InsetQuotes::InsetQuotes(Buffer * buf, string const & str)
 
 InsetQuotes::InsetQuotes(Buffer * buf, char_type c, 
InsetQuotesParams::QuoteLevel level,
                         string const & side, string const & style)
-       : Inset(buf), level_(level), pass_thru_(false), fontspec_(false)
+       : Inset(buf), level_(level), pass_thru_(false), fontspec_(false), 
internal_fontenc_(false)
 {
        bool dynamic = false;
        if (buf) {
@@ -976,6 +976,7 @@ void InsetQuotes::updateBuffer(ParIterator const & it, 
UpdateType /* utype*/)
        BufferParams const & bp = buffer().masterBuffer()->params();
        pass_thru_ = it.paragraph().isPassThru();
        context_lang_ = it.paragraph().getFontSettings(bp, 
it.pos()).language()->code();
+       internal_fontenc_ = it.paragraph().getFontSettings(bp, 
it.pos()).language()->internalFontEncoding();
        fontenc_ = bp.main_font_encoding();
        global_style_ = bp.quotes_style;
        fontspec_ = bp.useNonTeXFonts;
@@ -1032,7 +1033,7 @@ void InsetQuotes::validate(LaTeXFeatures & features) const
        case 0x0022: {
                if (features.runparams().isFullUnicode() && fontspec_)
                        features.require("textquotedblp");
-               else if (fontenc_ != "T1")
+               else if (fontenc_ != "T1" || internal_fontenc_)
                        features.require("textquotedbl");
                break;
        }
diff --git a/src/insets/InsetQuotes.h b/src/insets/InsetQuotes.h
index bb3d4a2..76461c9 100644
--- a/src/insets/InsetQuotes.h
+++ b/src/insets/InsetQuotes.h
@@ -191,7 +191,7 @@ private:
        InsetQuotesParams::QuoteLevel level_;
        ///
        InsetQuotesParams::QuoteStyle global_style_;
-       ///
+       /// Current font encoding
        std::string fontenc_;
        /// Code of the contextual language
        std::string context_lang_;
@@ -199,6 +199,8 @@ private:
        bool pass_thru_;
        /// Do we use fontspec?
        bool fontspec_;
+       /// Do we have an internal font encoding?
+       bool internal_fontenc_;
        ///
        friend class InsetQuotesParams;
 

Reply via email to