]> git.lyx.org Git - features.git/commitdiff
Require textquotedbl def with second language that has internal fontenc
authorJuergen Spitzmueller <spitz@lyx.org>
Thu, 10 Aug 2017 09:47:52 +0000 (11:47 +0200)
committerJuergen Spitzmueller <spitz@lyx.org>
Thu, 10 Aug 2017 09:47:52 +0000 (11:47 +0200)
Since these switch locally to encodings that do not define \textquotedbl
themselves.

src/Paragraph.cpp
src/insets/InsetQuotes.cpp
src/insets/InsetQuotes.h

index 309c20caffc442873690df490b044340bd997236..f9684ff6c61d2f05d1af4fdb3bf2f9162778299b 100644 (file)
@@ -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);
index 8292ec96c4c714e47e97803abd57cf65ed265e40..24be900cdd6283e219ec139ff5ebe986380ca22a 100644 (file)
@@ -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;
        }
index bb3d4a2ca39c59b541d7cd48141f7c572338e92f..76461c92c2563552c9abb2b796dc8a6143f394ad 100644 (file)
@@ -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;