X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Finsets%2FInsetBox.cpp;h=ec113744964695eaa25f40d5ad45a07e40c795cf;hb=bfddee97e191a853f0576f4fab3f095c4e9ce0de;hp=c053c5b587f0230e327e6ff63ee16d7f61e502d2;hpb=1ef605f6254ef3f3b8cec5440a2e67e6f23a707b;p=lyx.git diff --git a/src/insets/InsetBox.cpp b/src/insets/InsetBox.cpp index c053c5b587..ec11374496 100644 --- a/src/insets/InsetBox.cpp +++ b/src/insets/InsetBox.cpp @@ -102,13 +102,10 @@ InsetBox::InsetBox(Buffer * buffer, string const & label) {} -docstring InsetBox::name() const +docstring InsetBox::layoutName() const { // FIXME: UNICODE - string name = "Box"; - if (boxtranslator().find(params_.type) == Shaded) - name += ":Shaded"; - return from_ascii(name); + return from_ascii("Box:" + params_.type); } @@ -237,7 +234,7 @@ bool InsetBox::getStatus(Cursor & cur, FuncRequest const & cmd, } -int InsetBox::latex(otexstream & os, OutputParams const & runparams) const +void InsetBox::latex(otexstream & os, OutputParams const & runparams) const { BoxType btype = boxtranslator().find(params_.type); @@ -271,8 +268,10 @@ int InsetBox::latex(otexstream & os, OutputParams const & runparams) const } } - int i = 0; - os << "%\n"; + os << safebreakln; + if (runparams.lastid != -1) + os.texrow().start(runparams.lastid, runparams.lastpos); + // Adapt to column/text width correctly also if paragraphs indented: if (stdwidth) os << "\\noindent"; @@ -282,7 +281,6 @@ int InsetBox::latex(otexstream & os, OutputParams const & runparams) const break; case Framed: os << "\\begin{framed}%\n"; - i += 1; break; case Boxed: os << "\\framebox"; @@ -368,15 +366,13 @@ int InsetBox::latex(otexstream & os, OutputParams const & runparams) const } os << "%\n"; - ++i; } // end if inner_box if (btype == Shaded) { os << "\\begin{shaded}%\n"; - ++i; } - i += InsetText::latex(os, runparams); + InsetText::latex(os, runparams); if (btype == Shaded) os << "\\end{shaded}"; @@ -407,10 +403,6 @@ int InsetBox::latex(otexstream & os, OutputParams const & runparams) const // already done break; } - - i += 2; - - return i; } @@ -486,8 +478,11 @@ docstring InsetBox::xhtml(XHTMLStream & xs, OutputParams const & runparams) cons // construct attributes string attrs = "class='" + params_.type + "'"; string style; - if (!params_.width.empty()) - style += ("width: " + params_.width.asHTMLString() + "; "); + if (!params_.width.empty()) { + string w = params_.width.asHTMLString(); + if (w != "100%") + style += ("width: " + params_.width.asHTMLString() + "; "); + } // The special heights don't really mean anything for us. if (!params_.height.empty() && params_.height_special == "none") style += ("height: " + params_.height.asHTMLString() + "; ");