X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Finsets%2FInsetNewpage.cpp;h=e062e8bbecf583f1a8610b487c35c81bf64978fb;hb=14dbaa76083a4fdd2bd52aaf67d8da6d60557633;hp=0f718c2979a1b357bd5935171e6d826eed03c351;hpb=574931dcdb04f0b3be09dc7a2305611c5e88ed78;p=features.git diff --git a/src/insets/InsetNewpage.cpp b/src/insets/InsetNewpage.cpp index 0f718c2979..e062e8bbec 100644 --- a/src/insets/InsetNewpage.cpp +++ b/src/insets/InsetNewpage.cpp @@ -20,6 +20,7 @@ #include "MetricsInfo.h" #include "OutputParams.h" #include "output_xhtml.h" +#include "texstream.h" #include "Text.h" #include "TextMetrics.h" @@ -47,7 +48,6 @@ InsetNewpage::InsetNewpage(InsetNewpageParams const & params) void InsetNewpageParams::write(ostream & os) const { - string command; switch (kind) { case InsetNewpageParams::NEWPAGE: os << "newpage"; @@ -103,8 +103,6 @@ void InsetNewpage::metrics(MetricsInfo & mi, Dimension & dim) const dim.asc = defaultRowHeight(); dim.des = defaultRowHeight(); dim.wid = mi.base.textwidth; - // Cache the inset dimension. - setDimCache(mi, dim); } @@ -213,30 +211,32 @@ ColorCode InsetNewpage::ColorName() const } -int InsetNewpage::latex(odocstream & os, OutputParams const &) const +void InsetNewpage::latex(otexstream & os, OutputParams const & runparams) const { switch (params_.kind) { case InsetNewpageParams::NEWPAGE: - os << "\\newpage{}"; + os << "\\newpage" << termcmd; break; case InsetNewpageParams::PAGEBREAK: - os << "\\pagebreak{}"; + if (runparams.moving_arg) + os << "\\protect"; + os << "\\pagebreak" << termcmd; break; case InsetNewpageParams::CLEARPAGE: - os << "\\clearpage{}"; + os << "\\clearpage" << termcmd; break; case InsetNewpageParams::CLEARDOUBLEPAGE: - os << "\\cleardoublepage{}"; + os << "\\cleardoublepage" << termcmd; break; default: - os << "\\newpage{}"; + os << "\\newpage" << termcmd; break; } - return 0; } -int InsetNewpage::plaintext(odocstream & os, OutputParams const &) const +int InsetNewpage::plaintext(odocstringstream & os, + OutputParams const &, size_t) const { os << '\n'; return PLAINTEXT_NEWLINE; @@ -257,9 +257,9 @@ docstring InsetNewpage::xhtml(XHTMLStream & xs, OutputParams const &) const } -docstring InsetNewpage::contextMenu(BufferView const &, int, int) const +string InsetNewpage::contextMenuName() const { - return from_ascii("context-newpage"); + return "context-newpage"; }