extern string bibitemWidest(Buffer const *);
// this is a minibuffer
-static char minibuffer_char;
-static LyXFont minibuffer_font;
-static Inset * minibuffer_inset;
+
+namespace {
+
+char minibuffer_char;
+LyXFont minibuffer_font;
+Inset * minibuffer_inset;
+
+} // namespace anon
extern BufferView * current_view;
char footflag, char dth) const
{
#ifndef NEW_INSETS
- if (
- footnoteflag != LyXParagraph::NO_FOOTNOTE ||
+ if (footnoteflag != LyXParagraph::NO_FOOTNOTE ||
!previous_
- || previous_->footnoteflag == LyXParagraph::NO_FOOTNOTE
- ) {
-#endif
-
-#ifndef NEW_INSETS
+ || previous_->footnoteflag == LyXParagraph::NO_FOOTNOTE) {
// The beginning or the end of a footnote environment?
if (footflag != footnoteflag) {
footflag = footnoteflag;
}
os << "\\align " << string_align[h] << " ";
}
+#ifndef NO_PEXTRA
if (params.pextraType() != PEXTRA_NONE) {
os << "\\pextra_type " << params.pextraType();
if (params.pextraType() == PEXTRA_MINIPAGE) {
}
os << '\n';
}
+#endif
#ifndef NEW_INSETS
} else {
// Dummy layout. This means that a footnote ended.
(*cit).inset->Validate(features);
}
+#ifndef NO_PEXTRA
if (params.pextraType() == PEXTRA_INDENT)
features.LyXParagraphIndent = true;
if (params.pextraType() == PEXTRA_FLOATFLT)
features.floatflt = true;
+#endif
#ifndef NEW_INSETS
if (layout.needprotect
&& next_ && next_->footnoteflag != LyXParagraph::NO_FOOTNOTE)
features.NeedLyXFootnoteCode = true;
#endif
+#ifndef NO_PEXTRA
if (bparams.paragraph_separation == BufferParams::PARSEP_INDENT
&& params.pextraType() == LyXParagraph::PEXTRA_MINIPAGE)
features.NeedLyXMinipageIndent = true;
+#endif
#ifndef NEW_INSETS
if (footnoteflag != NO_FOOTNOTE && footnotekind == ALGORITHM)
features.algorithm = true;
}
-#ifdef NEW_INSETS
-#warning Remember to get rid of this one. (Lgb)
-#endif
+#ifndef NEW_INSETS
LyXParagraph::size_type LyXParagraph::Last() const
{
-#ifndef NEW_INSETS
if (next_ && next_->footnoteflag == LyXParagraph::CLOSED_FOOTNOTE)
return text.size() + NextAfterFootnote()->Last() + 1;
// the 1 is the symbol
// for the footnote
else
-#endif
return text.size();
}
+#endif
#ifndef NEW_INSETS
tmp->params.depth(firstpar->params.depth());
tmp->params.noindent(firstpar->params.noindent());
#else
- if (Last() > pos || !Last() || flag == 2) {
+ if (size() > pos || !size() || flag == 2) {
tmp->SetOnlyLayout(bparams, layout);
tmp->params.align(params.align());
tmp->SetLabelWidthString(params.labelWidthString());
int i = 0;
#ifndef NEW_INSETS
if (!IsDummy()) {
-#endif
while (Last()
+#else
+ while (size()
+#endif
&& (IsNewline(0) || IsLineSeparator(0))){
Erase(0);
++i;
// When can pos > Last()?
// I guess pos == Last() is possible.
- if (Last() > pos) {
+ if (size() > pos) {
// copy everything behind the break-position to the new
// paragraph
size_type pos_end = text.size() - 1;
{
// copy the next paragraph to this one
LyXParagraph * the_next = next();
-#ifndef NEW_INSETS
- LyXParagraph * firstpar = FirstPhysicalPar();
-#endif
// first the DTP-stuff
#ifndef NEW_INSETS
+ LyXParagraph * firstpar = FirstPhysicalPar();
firstpar->params.lineBottom(the_next->params.lineBottom());
firstpar->params.spaceBottom(the_next->params.spaceBottom());
firstpar->params.pagebreakBottom(the_next->params.pagebreakBottom());
+
+ size_type pos_end = the_next->text.size() - 1;
+ size_type pos_insert = Last();
#else
params.lineBottom(the_next->params.lineBottom());
params.spaceBottom(the_next->params.spaceBottom());
params.pagebreakBottom(the_next->params.pagebreakBottom());
-#endif
size_type pos_end = the_next->text.size() - 1;
- size_type pos_insert = Last();
+ size_type pos_insert = size();
+#endif
// ok, now copy the paragraph
size_type i, j;
par->layout = new_layout;
+#ifndef NO_PEXTRA
if (par->params.pextraType() == PEXTRA_NONE) {
+#endif
if (par->previous()) {
#ifndef NEW_INSETS
ppar = par->previous()->FirstPhysicalPar();
npar = npar->next();
#endif
}
+#ifndef NO_PEXTRA
if (ppar && (ppar->params.pextraType() != PEXTRA_NONE)) {
string p1 = ppar->params.pextraWidth();
string p2 = ppar->params.pextraWidthp();
p1, p2);
}
}
+#endif
}
par->params.spaceBottom(VSpace(VSpace::NONE));
par->params.spacing(Spacing(Spacing::Default));
+#ifndef NO_PEXTRA
if (par->params.pextraType() == PEXTRA_NONE) {
+#endif
if (par->previous()) {
#ifndef NEW_INSETS
ppar = par->previous()->FirstPhysicalPar();
npar = npar->next();
#endif
}
+#ifndef NO_PEXTRA
if (ppar && (ppar->params.pextraType() != PEXTRA_NONE)) {
string const p1 = ppar->params.pextraWidth();
string const p2 = ppar->params.pextraWidthp();
p1, p2);
}
}
+#endif
}
// Is this really needed ? (Dekel)
// We do not need to use to change the font for the last paragraph
// or for a command.
+#ifndef NEW_INSETS
LyXFont font = getFont(bparams, Last() - 1);
+#else
+ LyXFont font = getFont(bparams, size() - 1);
+#endif
bool is_command = textclasslist.Style(bparams.textclass,
GetLayout()).isCommand();
if (style.resfont.size() != font.size() && next_ && !is_command) {
if (par
&& (par->layout != layout
|| par->params.depth() != params.depth()
- || par->params.pextraType() != params.pextraType()))
+#ifndef NO_PEXTRA
+ || par->params.pextraType() != params.pextraType()
+#endif
+ ))
break;
default:
// we don't need it for the last paragraph!!!
further_blank_line = false;
if (params.lineBottom()) {
- os << "\\lyxline{\\" << getFont(bparams, Last() - 1).latexSize() << '}';
+#ifndef NEW_INSETS
+ os << "\\lyxline{\\" << getFont(bparams,
+ Last() - 1).latexSize() << '}';
+#else
+ os << "\\lyxline{\\" << getFont(bparams,
+ size() - 1).latexSize() << '}';
+#endif
further_blank_line = true;
}
#endif
if (textclasslist.Style(bparams.textclass,
par->layout).isEnvironment()
- || par->params.pextraType() != PEXTRA_NONE) {
+#ifndef NO_PEXTRA
+ || par->params.pextraType() != PEXTRA_NONE
+#endif
+ ) {
par = par->TeXEnvironment(buf, bparams,
os, texrow
#ifndef NEW_INSETS
#endif
)
{
+#ifndef NO_PEXTRA
bool eindent_open = false;
+#endif
#ifndef NEW_INSETS
bool foot_this_level = false;
#endif
+#ifndef NO_PEXTRA
// flags when footnotetext should be appended to file.
static bool minipage_open = false;
static int minipage_open_depth = 0;
char par_sep = bparams.paragraph_separation;
+#endif
lyxerr[Debug::LATEX] << "TeXEnvironment... " << this << endl;
#ifndef NEW_INSETS
LyXLayout const & style =
textclasslist.Style(bparams.textclass,
layout);
-
+
+#ifndef NO_PEXTRA
if (params.pextraType() == PEXTRA_INDENT) {
if (!params.pextraWidth().empty()) {
os << "\\begin{LyXParagraphIndent}{"
minipage_open = true;
minipage_open_depth = params.depth();
}
-
+#endif
#ifdef WITH_WARNINGS
#warning Define FANCY_FOOTNOTE_CODE to re-enable Allan footnote code
//I disabled it because it breaks when lists span on several
foot, foot_texrow, foot_count
#endif
);
-
+#ifndef NO_PEXTRA
if (minipage_open && par && !style.isEnvironment() &&
(par->params.pextraType() == PEXTRA_MINIPAGE) &&
par->params.pextraStartMinipage()) {
}
minipage_open = false;
}
+#endif
if (par && par->params.depth() > params.depth()) {
if (textclasslist.Style(bparams.textclass,
par->layout).isParagraph()
#endif
);
}
+#ifndef NO_PEXTRA
if (par && par->layout == layout && par->params.depth() == params.depth() &&
(par->params.pextraType() == PEXTRA_MINIPAGE) && !minipage_open) {
if (par->params.pextraHfill() && par->previous() &&
minipage_open = true;
minipage_open_depth = par->params.depth();
}
+#endif
} while (par
&& par->layout == layout
&& par->params.depth() == params.depth()
+#ifndef NO_PEXTRA
&& par->params.pextraType() == params.pextraType()
+#endif
#ifndef NEW_INSETS
&& par->footnoteflag == footnoteflag
#endif
);
if (style.isEnvironment()) {
- os << "\\end{" << style.latexname() << '}';
+ os << "\\end{" << style.latexname() << "}\n";
+
#ifndef NEW_INSETS
// maybe this should go after the minipage closes?
if (foot_this_level) {
}
#endif
}
+#ifndef NO_PEXTRA
if (minipage_open && (minipage_open_depth == params.depth()) &&
(!par || par->params.pextraStartMinipage() ||
par->params.pextraType() != PEXTRA_MINIPAGE)) {
os << '\n';
texrow.newline();
}
+#endif
lyxerr[Debug::LATEX] << "TeXEnvironment...done " << par << endl;
return par; // ale970302
}
}
#endif
+#ifndef NO_PEXTRA
void LyXParagraph::SetPExtraType(BufferParams const & bparams,
int type, string const & width,
string const & widthp)
}
}
}
+#endif
bool LyXParagraph::IsHfill(size_type pos) const