]> git.lyx.org Git - lyx.git/commitdiff
Next attempt at correctly setting fonts in insets depending on inheritFont()
authorJuergen Spitzmueller <spitz@lyx.org>
Sun, 2 Aug 2020 08:12:19 +0000 (10:12 +0200)
committerJuergen Spitzmueller <spitz@lyx.org>
Sun, 2 Aug 2020 08:12:19 +0000 (10:12 +0200)
src/Paragraph.cpp
src/insets/InsetTabular.h

index 3c5f690b453711d578d5a2d65537dded7e7393f3..f2d97fe7c97cb9dbc60eac15e39e056391b14ec8 100644 (file)
@@ -2393,8 +2393,9 @@ void Paragraph::latex(BufferParams const & bparams,
        pos_type body_pos = beginOfBody();
        unsigned int column = 0;
 
-       // If we are inside an inset, the real outerfont is local_font
-       Font const real_outerfont = (runparams.local_font != nullptr)
+       // If we are inside an non inheritFont() inset, the real outerfont is local_font
+       Font const real_outerfont = (!inInset().inheritFont()
+                                    && runparams.local_font != nullptr)
                        ? Font(runparams.local_font->fontInfo()) : outerfont;
 
        if (body_pos > 0) {
@@ -2558,7 +2559,7 @@ void Paragraph::latex(BufferParams const & bparams,
                ++column;
 
                // Fully instantiated font
-               Font const current_font = getFont(bparams, i, real_outerfont);
+               Font const current_font = getFont(bparams, i, outerfont);
 
                Font const last_font = running_font;
                bool const in_ct_deletion = (bparams.output_changes
index de26070b7b4af4727114666c85948f183883219d..d917ab8370d085fe799a7379b595a13368f30436 100644 (file)
@@ -80,6 +80,8 @@ public:
                                  UpdateType utype, TocBackend & backend) const;
        ///
        void metrics(MetricsInfo &, Dimension &) const;
+       /// Needs to be same as InsetTabular
+       bool inheritFont() const { return false; }
 private:
        /// unimplemented
        InsetTableCell();