2001-04-04 Lars Gullik Bjønnes <larsbj@birdstep.com>
+ * text2.C (SetLayout): split in NEW_INSETS and non NEW_INSETS version
+
+ * tabular.C: small reformat
+
+ * paragraph.C (GetFontSettings): split in NEW_INSETS and non
+ NEW_INSETS verison
+ (GetChar): ditto
+ (BreakParagraph): ditto
+ (SetOnlyLayout): ditto
+ (SetLayout): ditto
+
+ * lyxparagraph.h: add definitions for SetLayout and SetOnlyLayout
+ with one arg less.
+
+ * lastfiles.C: removed most using decl, add std:: where needed
+
+ * buffer.C: ws changes
+
* MenuBackend.C (class compare_format): put into anon namespace
(expand): constify label, names, action, action2
(expand):
}
sgmlOpenTag(ofs, depth, style.latexname());
- if (environment_stack.size() == depth+1)
+ if (environment_stack.size() == depth + 1)
environment_stack.push_back("!-- --");
environment_stack[depth] = style.latexname();
}
texrow.reset();
- string top_element= textclasslist.LatexnameOfClass(params.textclass);
+ string top_element = textclasslist.LatexnameOfClass(params.textclass);
if (!only_body) {
- string sgml_includedfiles=features.getIncludedFiles(fname);
+ string sgml_includedfiles = features.getIncludedFiles(fname);
ofs << "<!doctype " << top_element
<< " public \"-//OASIS//DTD DocBook V3.1//EN\"";
ofs << "<!-- DocBook file was created by " << LYX_DOCVERSION
<< "\n See http://www.lyx.org/ for more information -->\n";
- vector <string> environment_stack(10);
- vector <string> environment_inner(10);
- vector <string> command_stack(10);
+ vector<string> environment_stack(10);
+ vector<string> environment_inner(10);
+ vector<string> command_stack(10);
- bool command_flag= false;
- int command_depth= 0, command_base= 0, cmd_depth= 0;
+ bool command_flag = false;
+ int command_depth = 0;
+ int command_base = 0;
+ int cmd_depth = 0;
int depth = 0; // paragraph depth
- string item_name, command_name;
+ string item_name;
+ string command_name;
while (par) {
- string sgmlparam, c_depth, c_params;
+ string sgmlparam;
+ string c_depth;
+ string c_params;
int desc_on = 0; // description mode
LyXLayout const & style =
// environment tag closing
for (; depth > par->params.depth(); --depth) {
if (environment_inner[depth] != "!-- --") {
- item_name= "listitem";
+ item_name = "listitem";
sgmlCloseTag(ofs, command_depth + depth,
item_name);
if (environment_inner[depth] == "varlistentry")
// Write opening SGML tags.
switch (style.latextype) {
case LATEX_PARAGRAPH:
- sgmlOpenTag(ofs, depth+command_depth, style.latexname());
+ sgmlOpenTag(ofs, depth + command_depth,
+ style.latexname());
break;
case LATEX_COMMAND:
- if (depth!= 0)
+ if (depth != 0)
LinuxDocError(par, 0,
_("Error : Wrong depth for "
"LatexType Command.\n"));
sgmlparam = style.latexparam();
c_params = split(sgmlparam, c_depth,'|');
- cmd_depth= lyx::atoi(c_depth);
+ cmd_depth = lyx::atoi(c_depth);
if (command_flag) {
- if (cmd_depth<command_base) {
+ if (cmd_depth < command_base) {
for (int j = command_depth; j >= command_base; --j)
sgmlCloseTag(ofs, j, command_stack[j]);
- command_depth= command_base= cmd_depth;
+ command_depth = command_base = cmd_depth;
} else if (cmd_depth <= command_depth) {
for (int j = command_depth; j >= cmd_depth; --j)
sgmlCloseTag(ofs, j, command_stack[j]);
- command_depth= cmd_depth;
+ command_depth = cmd_depth;
} else
- command_depth= cmd_depth;
+ command_depth = cmd_depth;
} else {
command_depth = command_base = cmd_depth;
command_flag = true;
}
- if (command_stack.size() == command_depth +1)
+ if (command_stack.size() == command_depth + 1)
command_stack.push_back("");
- command_stack[command_depth]= command_name;
+ command_stack[command_depth] = command_name;
// treat label as a special case for
// more WYSIWYM handling.
}
if (environment_stack[depth] != style.latexname()) {
- if(environment_stack.size() == depth+1) {
+ if(environment_stack.size() == depth + 1) {
environment_stack.push_back("!-- --");
environment_inner.push_back("!-- --");
}
for (; depth >= 0; --depth) {
if (!environment_stack[depth].empty()) {
if (environment_inner[depth] != "!-- --") {
- item_name= "listitem";
+ item_name = "listitem";
sgmlCloseTag(ofs, command_depth + depth,
item_name);
if (environment_inner[depth] == "varlistentry")
#include "lastfiles.h"
#include "debug.h"
-using std::ifstream;
using std::getline;
-using std::ofstream;
-using std::copy;
-using std::ostream_iterator;
-using std::find;
using std::endl;
+
LastFiles::LastFiles(string const & filename, bool st, unsigned int num)
: dostat(st)
{
{
// we will not complain if we can't find filename nor will
// we issue a warning. (Lgb)
- ifstream ifs(filename.c_str());
+ std::ifstream ifs(filename.c_str());
string tmp;
FileInfo fileInfo;
void LastFiles::writeFile(string const & filename) const
{
- ofstream ofs(filename.c_str());
+ std::ofstream ofs(filename.c_str());
if (ofs) {
- copy(files.begin(), files.end(),
- ostream_iterator<string>(ofs, "\n"));
+ std::copy(files.begin(), files.end(),
+ std::ostream_iterator<string>(ofs, "\n"));
} else
lyxerr << "LyX: Warning: unable to save LastFiles: "
<< filename << endl;
void LastFiles::newFile(string const & file)
{
// If file already exist, delete it and reinsert at front.
- Files::iterator it = find(files.begin(), files.end(), file);
+ Files::iterator it = std::find(files.begin(), files.end(), file);
if (it != files.end())
files.erase(it);
files.push_front(file);
char GetAlign() const;
///
char GetDepth() const;
+#ifndef NEW_INSETS
///
void SetLayout(BufferParams const &,
LyXTextClass::LayoutList::size_type new_layout);
void SetOnlyLayout(BufferParams const &,
LyXTextClass::LayoutList::size_type new_layout);
///
- int GetFirstCounter(int i) const;
-#ifndef NEW_INSETS
- ///
size_type Last() const;
+#else
+ ///
+ void SetLayout(LyXTextClass::LayoutList::size_type new_layout);
+ ///
+ void SetOnlyLayout(LyXTextClass::LayoutList::size_type new_layout);
#endif
+ ///
+ int GetFirstCounter(int i) const;
///
void Erase(size_type pos);
/** the flag determines wether the layout should be copied
// Gets uninstantiated font setting at position.
// Optimized after profiling. (Asger)
+#ifndef NEW_INSETS
LyXFont const LyXParagraph::GetFontSettings(BufferParams const & bparams,
LyXParagraph::size_type pos) const
{
-#ifdef NEW_INSETS
- Assert(pos <= size());
-#endif
-#ifndef NEW_INSETS
if (pos < size()) {
-#endif
FontTable search_font(pos, LyXFont());
FontList::const_iterator cit = lower_bound(fontlist.begin(),
fontlist.end(),
search_font, matchFT());
if (cit != fontlist.end())
return (*cit).font();
-#ifndef NEW_INSETS
}
-#endif
-#ifndef NEW_INSETS
// > because last is the next unused position, and you can
// use it if you want
else if (pos > size()) {
} else if (pos > 0) {
return GetFontSettings(bparams, pos - 1);
}
+
+ return LyXFont(LyXFont::ALL_INHERIT, getParLanguage(bparams));
+}
#else
+LyXFont const LyXParagraph::GetFontSettings(BufferParams const & bparams,
+ LyXParagraph::size_type pos) const
+{
+ Assert(pos <= size());
+ FontTable search_font(pos, LyXFont());
+ FontList::const_iterator cit = lower_bound(fontlist.begin(),
+ fontlist.end(),
+ search_font, matchFT());
+ if (cit != fontlist.end())
+ return (*cit).font();
+
if (pos == size() && size())
return GetFontSettings(bparams, pos - 1);
-#endif
- //else
- // pos = size() = 0
+
return LyXFont(LyXFont::ALL_INHERIT, getParLanguage(bparams));
-
- //return LyXFont(LyXFont::ALL_INHERIT);
}
+#endif
// Gets uninstantiated font setting at position 0
}
+#ifndef NEW_INSETS
LyXParagraph::value_type
LyXParagraph::GetChar(LyXParagraph::size_type pos) const
{
-#ifndef NEW_INSETS
Assert(pos >= 0);
-#else
- Assert(pos <= size());
- if (!size() || pos == size()) return '\0';
-#endif
-
-#ifndef NEW_INSETS
+
if (pos < size()) {
-#endif
return text[pos];
-#ifndef NEW_INSETS
}
-#endif
-#ifndef NEW_INSETS
+
// > because last is the next unused position, and you can
// use it if you want
else if (pos > size()) {
if (next_ && next_->footnoteflag != LyXParagraph::NO_FOOTNOTE)
return NextAfterFootnote()
->GetChar(pos - text.size() - 1);
- else
- {
+ else {
lyxerr << "ERROR (LyXParagraph::GetChar const): "
"position does not exist."
<< pos << " (" << static_cast<int>(pos)
}
return '\0'; // to shut up gcc
}
-#endif
}
+#else
+LyXParagraph::value_type
+LyXParagraph::GetChar(LyXParagraph::size_type pos) const
+{
+ Assert(pos <= size());
+ if (!size() || pos == size()) return '\0';
+
+ return text[pos];
+}
+#endif
LyXParagraph::value_type
return c;
}
+
// return an string of the current word, and the end of the word in lastpos.
string const LyXParagraph::GetWord(LyXParagraph::size_type & lastpos) const
{
while (IsLetter(lastpos)) theword += GetChar(lastpos++);
return theword;
-
}
}
+#ifndef NEW_INSETS
void LyXParagraph::BreakParagraph(BufferParams const & bparams,
LyXParagraph::size_type pos,
int flag)
size_type i;
size_type j;
// create a new paragraph
-#ifndef NEW_INSETS
size_type pos_end;
size_type pos_first;
LyXParagraph * par = ParFromPos(pos);
LyXParagraph * firstpar = FirstPhysicalPar();
LyXParagraph * tmp = new LyXParagraph(par);
-#else
- //LyXParagraph * par = this;
- //LyXParagraph * firstpar = this;
- LyXParagraph * tmp = new LyXParagraph(this);
-#endif
-#ifndef NEW_INSETS
tmp->footnoteflag = footnoteflag;
tmp->footnotekind = footnotekind;
-#endif
+
// this is an idea for a more userfriendly layout handling, I will
// see what the users say
-#ifndef NEW_INSETS
// layout stays the same with latex-environments
if (flag) {
tmp->SetOnlyLayout(bparams, firstpar->layout);
tmp->SetLabelWidthString(firstpar->params.labelWidthString());
}
-#else
- // layout stays the same with latex-environments
- if (flag) {
- tmp->SetOnlyLayout(bparams, layout);
- tmp->SetLabelWidthString(params.labelWidthString());
- }
-#endif
-#ifndef NEW_INSETS
+
if (Last() > pos || !Last() || flag == 2) {
tmp->SetOnlyLayout(bparams, firstpar->layout);
tmp->params.align(firstpar->params.align());
tmp->params.depth(firstpar->params.depth());
tmp->params.noindent(firstpar->params.noindent());
-#else
- if (size() > pos || !size() || flag == 2) {
- tmp->SetOnlyLayout(bparams, layout);
- tmp->params.align(params.align());
- tmp->SetLabelWidthString(params.labelWidthString());
-
- tmp->params.lineBottom(params.lineBottom());
- params.lineBottom(false);
- tmp->params.pagebreakBottom(params.pagebreakBottom());
- params.pagebreakBottom(false);
- tmp->params.spaceBottom(params.spaceBottom());
- params.spaceBottom(VSpace(VSpace::NONE));
-
- tmp->params.depth(params.depth());
- tmp->params.noindent(params.noindent());
-#endif
+
// copy everything behind the break-position
// to the new paragraph
-#ifndef NEW_INSETS
pos_first = 0;
while (ParFromPos(pos_first) != par)
++pos_first;
par->Erase(i - pos_first);
par->fitToSize();
-#else
- size_type pos_end = text.size() - 1;
-
- for (i = j = pos; i <= pos_end; ++i) {
- CutIntoMinibuffer(bparams, i);
- if (tmp->InsertFromMinibuffer(j - pos))
- ++j;
- }
- tmp->fitToSize();
- for (i = pos_end; i >= pos; --i)
- Erase(i);
-
- fitToSize();
-#endif
}
-#ifndef NEW_INSETS
// just an idea of me
if (!pos) {
tmp->params.lineTop(firstpar->params.lineTop());
firstpar->params.depth(tmp->params.depth());
}
}
+}
#else
+void LyXParagraph::BreakParagraph(BufferParams const & bparams,
+ LyXParagraph::size_type pos,
+ int flag)
+{
+ // create a new paragraph
+ LyXParagraph * tmp = new LyXParagraph(this);
+
+ // this is an idea for a more userfriendly layout handling, I will
+ // see what the users say
+
+ // layout stays the same with latex-environments
+ if (flag) {
+ tmp->SetOnlyLayout(layout);
+ tmp->SetLabelWidthString(params.labelWidthString());
+ }
+
+ if (size() > pos || !size() || flag == 2) {
+ tmp->SetOnlyLayout(layout);
+ tmp->params.align(params.align());
+ tmp->SetLabelWidthString(params.labelWidthString());
+
+ tmp->params.lineBottom(params.lineBottom());
+ params.lineBottom(false);
+ tmp->params.pagebreakBottom(params.pagebreakBottom());
+ params.pagebreakBottom(false);
+ tmp->params.spaceBottom(params.spaceBottom());
+ params.spaceBottom(VSpace(VSpace::NONE));
+
+ tmp->params.depth(params.depth());
+ tmp->params.noindent(params.noindent());
+
+ // copy everything behind the break-position
+ // to the new paragraph
+ size_type pos_end = text.size() - 1;
+ size_type i = pos;
+ size_type j = pos;
+ for (; i <= pos_end; ++i) {
+ CutIntoMinibuffer(bparams, i);
+ if (tmp->InsertFromMinibuffer(j - pos))
+ ++j;
+ }
+ tmp->fitToSize();
+ for (i = pos_end; i >= pos; --i)
+ Erase(i);
+
+ fitToSize();
+ }
+
// just an idea of me
if (!pos) {
tmp->params.lineTop(params.lineTop());
Clear();
// layout stays the same with latex-environments
if (flag) {
- SetOnlyLayout(bparams, tmp->layout);
+ SetOnlyLayout(tmp->layout);
SetLabelWidthString(tmp->params.labelWidthString());
params.depth(tmp->params.depth());
}
}
-#endif
}
-
+#endif
+
void LyXParagraph::MakeSameLayout(LyXParagraph const * par)
{
}
+#ifndef NEW_INSETS
void LyXParagraph::SetOnlyLayout(BufferParams const & bparams,
LyXTextClass::size_type new_layout)
{
-#ifndef NEW_INSETS
LyXParagraph * par = FirstPhysicalPar();
-#else
- LyXParagraph * par = this;
-#endif
LyXParagraph * ppar = 0;
LyXParagraph * npar = 0;
-
+
par->layout = new_layout;
-
-#ifndef NO_PEXTRA
+
if (par->params.pextraType() == PEXTRA_NONE) {
-#endif
if (par->previous()) {
-#ifndef NEW_INSETS
ppar = par->previous()->FirstPhysicalPar();
-#else
- ppar = par->previous();
-#endif
while(ppar
&& ppar->previous()
&& (ppar->params.depth() > par->params.depth()))
-#ifndef NEW_INSETS
ppar = ppar->previous()->FirstPhysicalPar();
-#else
- ppar = ppar->previous();
-#endif
}
if (par->next()) {
-#ifndef NEW_INSETS
npar = par->next()->NextAfterFootnote();
-#else
- npar = par->next();
-#endif
while(npar
&& npar->next()
&& (npar->params.depth() > par->params.depth()))
-#ifndef NEW_INSETS
npar = npar->next()->NextAfterFootnote();
-#else
- 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);
}
}
+}
+#else
+void LyXParagraph::SetOnlyLayout(LyXTextClass::size_type new_layout)
+{
+#if 0
+ LyXParagraph * par = this;
+ LyXParagraph * ppar = 0;
+ LyXParagraph * npar = 0;
+
+ par->layout = new_layout;
+
+ if (par->previous()) {
+ ppar = par->previous();
+ while(ppar
+ && ppar->previous()
+ && (ppar->params.depth() > par->params.depth()))
+ ppar = ppar->previous();
+ }
+ if (par->next()) {
+ npar = par->next();
+ while(npar
+ && npar->next()
+ && (npar->params.depth() > par->params.depth()))
+ npar = npar->next();
+ }
+#else
+ layout = new_layout;
#endif
}
+#endif
+#ifndef NEW_INSETS
void LyXParagraph::SetLayout(BufferParams const & bparams,
LyXTextClass::size_type new_layout)
{
LyXParagraph
-#ifndef NEW_INSETS
* par = FirstPhysicalPar(),
-#else
- * par = this,
-#endif
* ppar = 0,
* npar = 0;
-
+
par->layout = new_layout;
par->params.labelWidthString(string());
par->params.align(LYX_ALIGN_LAYOUT);
par->params.spaceTop(VSpace(VSpace::NONE));
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();
-#else
- ppar = par->previous();
-#endif
while(ppar
&& ppar->previous()
&& (ppar->params.depth() > par->params.depth()))
-#ifndef NEW_INSETS
ppar = ppar->previous()->FirstPhysicalPar();
-#else
- ppar = ppar->previous();
-#endif
}
if (par->next()) {
-#ifndef NEW_INSETS
npar = par->next()->NextAfterFootnote();
-#else
- npar = par->next();
-#endif
while(npar
&& npar->next()
&& (npar->params.depth() > par->params.depth()))
-#ifndef NEW_INSETS
npar = npar->next()->NextAfterFootnote();
-#else
- 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
}
+#else
+void LyXParagraph::SetLayout(LyXTextClass::size_type new_layout)
+{
+ layout = new_layout;
+ params.labelWidthString(string());
+ params.align(LYX_ALIGN_LAYOUT);
+ params.spaceTop(VSpace(VSpace::NONE));
+ params.spaceBottom(VSpace(VSpace::NONE));
+ params.spacing(Spacing(Spacing::Default));
+}
+#endif
// if the layout of a paragraph contains a manual label, the beginning of the
bool LyXTabular::SetAlignSpecial(int cell, string const & special,
- LyXTabular::Feature what)
+ LyXTabular::Feature what)
{
if (what == SET_SPECIAL_MULTI)
cellinfo_of_cell(cell)->align_special = special;
}
+#ifndef NEW_INSETS
LyXParagraph * LyXText::SetLayout(BufferView * bview,
LyXCursor & cur, LyXCursor & sstart_cur,
LyXCursor & send_cur,
LyXTextClass::size_type layout)
{
-#ifndef NEW_INSETS
LyXParagraph * endpar = send_cur.par()->LastPhysicalPar()->next();
-#else
- LyXParagraph * endpar = send_cur.par()->next();
-#endif
LyXParagraph * undoendpar = endpar;
-
+
if (endpar && endpar->GetDepth()) {
while (endpar && endpar->GetDepth()) {
-#ifndef NEW_INSETS
endpar = endpar->LastPhysicalPar()->next();
-#else
- endpar = endpar->next();
-#endif
undoendpar = endpar;
}
} else if (endpar) {
endpar = endpar->next(); // because of parindents etc.
}
-
+
SetUndo(bview->buffer(), Undo::EDIT,
-#ifndef NEW_INSETS
sstart_cur.par()->ParFromPos(sstart_cur.pos())->previous_,
-#else
- sstart_cur.par()->previous(),
-#endif
undoendpar);
-
+
/* ok we have a selection. This is always between sstart_cur
* and sel_end cursor */
cur = sstart_cur;
-
+
LyXLayout const & lyxlayout =
textclasslist.Style(bview->buffer()->params.textclass, layout);
-
+
while (cur.par() != send_cur.par()) {
-#ifndef NEW_INSETS
if (cur.par()->footnoteflag == sstart_cur.par()->footnoteflag) {
-#endif
cur.par()->SetLayout(bview->buffer()->params, layout);
MakeFontEntriesLayoutSpecific(bview->buffer(), cur.par());
-#ifndef NEW_INSETS
LyXParagraph * fppar = cur.par()->FirstPhysicalPar();
-#else
- LyXParagraph * fppar = cur.par();
-#endif
fppar->params.spaceTop(lyxlayout.fill_top ?
- VSpace(VSpace::VFILL) : VSpace(VSpace::NONE));
+ VSpace(VSpace::VFILL) : VSpace(VSpace::NONE));
fppar->params.spaceBottom(lyxlayout.fill_bottom ?
- VSpace(VSpace::VFILL) : VSpace(VSpace::NONE));
+ VSpace(VSpace::VFILL) : VSpace(VSpace::NONE));
if (lyxlayout.margintype == MARGIN_MANUAL)
cur.par()->SetLabelWidthString(lyxlayout.labelstring());
if (lyxlayout.labeltype != LABEL_BIBLIO
delete fppar->bibkey;
fppar->bibkey = 0;
}
-#ifndef NEW_INSETS
}
-#endif
cur.par(cur.par()->next());
}
-#ifndef NEW_INSETS
if (cur.par()->footnoteflag == sstart_cur.par()->footnoteflag) {
-#endif
cur.par()->SetLayout(bview->buffer()->params, layout);
MakeFontEntriesLayoutSpecific(bview->buffer(), cur.par());
-#ifndef NEW_INSETS
LyXParagraph * fppar = cur.par()->FirstPhysicalPar();
+ fppar->params.spaceTop(lyxlayout.fill_top ?
+ VSpace(VSpace::VFILL) : VSpace(VSpace::NONE));
+ fppar->params.spaceBottom(lyxlayout.fill_bottom ?
+ VSpace(VSpace::VFILL) : VSpace(VSpace::NONE));
+ if (lyxlayout.margintype == MARGIN_MANUAL)
+ cur.par()->SetLabelWidthString(lyxlayout.labelstring());
+ if (lyxlayout.labeltype != LABEL_BIBLIO
+ && fppar->bibkey) {
+ delete fppar->bibkey;
+ fppar->bibkey = 0;
+ }
+ }
+ return endpar;
+}
#else
+LyXParagraph * LyXText::SetLayout(BufferView * bview,
+ LyXCursor & cur, LyXCursor & sstart_cur,
+ LyXCursor & send_cur,
+ LyXTextClass::size_type layout)
+{
+ LyXParagraph * endpar = send_cur.par()->next();
+ LyXParagraph * undoendpar = endpar;
+
+ if (endpar && endpar->GetDepth()) {
+ while (endpar && endpar->GetDepth()) {
+ endpar = endpar->next();
+ undoendpar = endpar;
+ }
+ } else if (endpar) {
+ endpar = endpar->next(); // because of parindents etc.
+ }
+
+ SetUndo(bview->buffer(), Undo::EDIT,
+ sstart_cur.par()->previous(),
+ undoendpar);
+
+ /* ok we have a selection. This is always between sstart_cur
+ * and sel_end cursor */
+ cur = sstart_cur;
+
+ LyXLayout const & lyxlayout =
+ textclasslist.Style(bview->buffer()->params.textclass, layout);
+
+ while (cur.par() != send_cur.par()) {
+ cur.par()->SetLayout(layout);
+ MakeFontEntriesLayoutSpecific(bview->buffer(), cur.par());
LyXParagraph * fppar = cur.par();
-#endif
fppar->params.spaceTop(lyxlayout.fill_top ?
- VSpace(VSpace::VFILL) : VSpace(VSpace::NONE));
+ VSpace(VSpace::VFILL)
+ : VSpace(VSpace::NONE));
fppar->params.spaceBottom(lyxlayout.fill_bottom ?
- VSpace(VSpace::VFILL) : VSpace(VSpace::NONE));
+ VSpace(VSpace::VFILL)
+ : VSpace(VSpace::NONE));
if (lyxlayout.margintype == MARGIN_MANUAL)
cur.par()->SetLabelWidthString(lyxlayout.labelstring());
if (lyxlayout.labeltype != LABEL_BIBLIO
delete fppar->bibkey;
fppar->bibkey = 0;
}
-#ifndef NEW_INSETS
+ cur.par(cur.par()->next());
+ }
+ cur.par()->SetLayout(layout);
+ MakeFontEntriesLayoutSpecific(bview->buffer(), cur.par());
+ LyXParagraph * fppar = cur.par();
+ fppar->params.spaceTop(lyxlayout.fill_top ?
+ VSpace(VSpace::VFILL) : VSpace(VSpace::NONE));
+ fppar->params.spaceBottom(lyxlayout.fill_bottom ?
+ VSpace(VSpace::VFILL) : VSpace(VSpace::NONE));
+ if (lyxlayout.margintype == MARGIN_MANUAL)
+ cur.par()->SetLabelWidthString(lyxlayout.labelstring());
+ if (lyxlayout.labeltype != LABEL_BIBLIO
+ && fppar->bibkey) {
+ delete fppar->bibkey;
+ fppar->bibkey = 0;
}
-#endif
return endpar;
}
+#endif
+
// set layout over selection and make a total rebreak of those paragraphs
void LyXText::SetLayout(BufferView * bview, LyXTextClass::size_type layout)