X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FMetricsInfo.cpp;h=92ed4a7eb3e273beb4ca44a888400e08c205be59;hb=6f7b39f84299660586b0485713d9672279ebe226;hp=809c0cec68997f7f7b81533c7715ba4ee6a5f6dd;hpb=9b1dc338b216c6c72b99f75e512ed6b0e4be90c5;p=features.git diff --git a/src/MetricsInfo.cpp b/src/MetricsInfo.cpp index 809c0cec68..92ed4a7eb3 100644 --- a/src/MetricsInfo.cpp +++ b/src/MetricsInfo.cpp @@ -33,7 +33,7 @@ namespace lyx { ///////////////////////////////////////////////////////////////////////// MetricsBase::MetricsBase(BufferView * b, FontInfo f, int w) - : bv(b), font(move(f)), fontname("mathnormal"), + : bv(b), font(std::move(f)), fontname("mathnormal"), textwidth(w), macro_nesting(0), solid_line_thickness_(1), solid_line_offset_(1), dotted_line_thickness_(1) { @@ -65,15 +65,17 @@ Changer MetricsBase::changeFontSet(string const & name) augmentFont(font, name); font.setSize(rc->old.font.size()); font.setStyle(rc->old.font.style()); - if (name != "lyxtex" + if (name == "emph") { + font.setColor(oldcolor); + if (rc->old.font.shape() != UP_SHAPE) + font.setShape(UP_SHAPE); + else + font.setShape(ITALIC_SHAPE); + } else if (name != "lyxtex" && ((isTextFont(oldname) && oldcolor != Color_foreground) || (isMathFont(oldname) && oldcolor != Color_math))) font.setColor(oldcolor); -#if __cplusplus >= 201402L return rc; -#else - return move(rc); -#endif } @@ -114,8 +116,8 @@ int MetricsBase::inPixels(Length const & len) const ///////////////////////////////////////////////////////////////////////// MetricsInfo::MetricsInfo(BufferView * bv, FontInfo font, int textwidth, - MacroContext const & mc, bool vm) - : base(bv, font, textwidth), macrocontext(mc), vmode(vm) + MacroContext const & mc, bool vm, bool tight) + : base(bv, font, textwidth), macrocontext(mc), vmode(vm), tight_insets(tight) {} @@ -126,7 +128,8 @@ MetricsInfo::MetricsInfo(BufferView * bv, FontInfo font, int textwidth, ///////////////////////////////////////////////////////////////////////// PainterInfo::PainterInfo(BufferView * bv, lyx::frontend::Painter & painter) - : pain(painter), ltr_pos(false), change(), selected(false), + : pain(painter), ltr_pos(false), change(), + selected(false), selected_left(false), selected_right(false), do_spellcheck(true), full_repaint(true), background_color(Color_background), leftx(0), rightx(0) {