X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Finsets%2FInsetBox.cpp;h=2400722fd33f829fcd17b33f75272824a8f5f6fe;hb=2e7d1199dfa7ec7b7d963c374a014f2a2227ae7c;hp=91619aa2ab0df0d94b8c65d0b7bc43abaf4f84f1;hpb=9abb7db46800e554f57e865a3e768602ffd9d6f1;p=lyx.git diff --git a/src/insets/InsetBox.cpp b/src/insets/InsetBox.cpp index 91619aa2ab..2400722fd3 100644 --- a/src/insets/InsetBox.cpp +++ b/src/insets/InsetBox.cpp @@ -15,17 +15,19 @@ #include "InsetBox.h" #include "Buffer.h" +#include "BufferParams.h" #include "BufferView.h" #include "Cursor.h" #include "DispatchResult.h" -#include "support/debug.h" #include "FuncStatus.h" #include "FuncRequest.h" #include "support/gettext.h" #include "LaTeXFeatures.h" #include "Lexer.h" #include "MetricsInfo.h" +#include "TextClass.h" +#include "support/debug.h" #include "support/Translator.h" #include @@ -85,7 +87,10 @@ BoxTranslatorLoc const & boxtranslator_loc() InsetBox::InsetBox(BufferParams const & bp, string const & label) : InsetCollapsable(bp), params_(label) -{} +{ + if (forceEmptyLayout()) + paragraphs().back().setLayout(bp.getTextClass().emptyLayout()); +} InsetBox::InsetBox(InsetBox const & in) @@ -173,7 +178,7 @@ void InsetBox::metrics(MetricsInfo & m, Dimension & dim) const } -bool InsetBox::forceDefaultParagraphs(idx_type) const +bool InsetBox::forceEmptyLayout() const { return !params_.inner_box; } @@ -239,6 +244,13 @@ bool InsetBox::getStatus(Cursor & cur, FuncRequest const & cmd, } +bool InsetBox::isMacroScope(Buffer const &) const +{ + BoxType btype = boxtranslator().find(params_.type); + return btype != Frameless || params_.inner_box; +} + + int InsetBox::latex(Buffer const & buf, odocstream & os, OutputParams const & runparams) const { @@ -269,7 +281,7 @@ int InsetBox::latex(Buffer const & buf, odocstream & os, width_string += " - 2\\fboxsep - 2\\fboxrule"/* "-\\shadowsize"*/; break; case Doublebox: - width_string += " - 2\\fboxsep - 7.5\\fboxrule - 1.0pt"; + width_string += " - 2\\fboxsep - 7.5\\fboxrule - 1pt"; break; } } @@ -395,9 +407,8 @@ int InsetBox::latex(Buffer const & buf, odocstream & os, // already done break; } - os << "%\n"; - i += 3; + i += 2; return i; }