From d59d3eb51af11e2146ac95ec58fc5677ea35386e Mon Sep 17 00:00:00 2001 From: =?utf8?q?Lars=20Gullik=20Bj=C3=B8nnes?= Date: Tue, 18 Jul 2000 17:45:27 +0000 Subject: [PATCH] more changes to get insetfloat working + some other things. Read the ChangeLog git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@897 a592a061-630c-0410-9148-cb99ea01b6c8 --- ChangeLog | 26 +++++++++++ src/FloatList.C | 12 ++--- src/LyXAction.C | 1 + src/Variables.C | 10 ++-- src/Variables.h | 18 ++++---- src/buffer.C | 6 +++ src/commandtags.h | 1 + src/insets/insetcaption.C | 19 ++++++++ src/insets/insetcaption.h | 8 ++++ src/insets/insetfloat.C | 6 +++ src/insets/insetfloat.h | 2 + src/insets/insettext.C | 4 +- src/insets/insettext.h | 18 +++++++- src/insets/lyxinset.h | 16 ++++--- src/lyxfunc.C | 25 +++++++++- src/text2.C | 96 ++++++++++++++++++++++++++++----------- 16 files changed, 212 insertions(+), 56 deletions(-) diff --git a/ChangeLog b/ChangeLog index 108fdc6d29..ce40cad400 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,29 @@ +2000-07-18 Lars Gullik Bjønnes + + * src/insets/lyxinset.h: add caption code + + * src/insets/insetfloat.C (type): new method + + * src/insets/insetcaption.C (Write): new method + (Read): new method + (LyxCode): new method + + * src/text2.C (SetCounter): revert Jürgens code, but use his idea + to get it right together with using the FloatList. + + * src/commandtags.h: add LFUN_INSET_CAPTION + * src/lyxfunc.C (Dispatch): handle it + + * src/buffer.C (parseSingleLyXformat2Token): add code to read a + caption inset. + + * src/Variables.[Ch]: make expand take a const reference, remove + the destructor, some whitespace changes. + + * src/LyXAction.C (init): add caption-inset-insert + + * src/FloatList.C (FloatList): update the default floats a bit. + 2000-07-17 Jean-Marc Lasgouttes * src/Variables.[Ch]: new files. Intended to be used for language diff --git a/src/FloatList.C b/src/FloatList.C index 61ac278a5d..fbbfa370a0 100644 --- a/src/FloatList.C +++ b/src/FloatList.C @@ -11,20 +11,20 @@ FloatList::FloatList() // Insert the latex builtin float-types Floating table; table.type = "table"; - table.placement = ""; + table.placement = "htbp"; table.ext = "lot"; table.within = ""; - table.style = ""; - table.name = ""; + table.style = "plain"; + table.name = "Table"; table.builtin = true; list[table.type] = table; Floating figure; figure.type = "figure"; - figure.placement = ""; + figure.placement = "htbp"; figure.ext = "lof"; figure.within = ""; - figure.style = ""; - figure.name = ""; + figure.style = "plain"; + figure.name = "Figure"; figure.builtin = true; list[figure.type] = figure; // And we add algorithm too since LyX has diff --git a/src/LyXAction.C b/src/LyXAction.C index e80964dae0..5edf46727c 100644 --- a/src/LyXAction.C +++ b/src/LyXAction.C @@ -400,6 +400,7 @@ void LyXAction::init() { LFUN_INSET_FLOAT, "float-inset-insert", "", Noop }, { LFUN_INSET_LIST, "list-inset-insert", "", Noop }, { LFUN_INSET_THEOREM, "theorem-inset-insert", "", Noop }, + { LFUN_INSET_CAPTION, "caption-inset-insert", "", Noop }, { LFUN_NOACTION, "", "", Noop } }; diff --git a/src/Variables.C b/src/Variables.C index 128f5538b5..9f4a516e38 100644 --- a/src/Variables.C +++ b/src/Variables.C @@ -17,7 +17,8 @@ #include "Variables.h" #include "support/LRegex.h" -void Variables::set(string const &var, string const &val) + +void Variables::set(string const & var, string const & val) { Vars::const_iterator cit = vars_.find(var); if (cit != vars_.end()) @@ -26,7 +27,7 @@ void Variables::set(string const &var, string const &val) } -string Variables::get(string const &var) const +string Variables::get(string const & var) const { Vars::const_iterator cit = vars_.find(var); if (cit != vars_.end()) @@ -35,14 +36,17 @@ string Variables::get(string const &var) const return string(); } + bool Variables::isset(string const & var) const { Vars::const_iterator cit = vars_.find(var); return (cit != vars_.end()); } -string Variables::expand(string str) const + +string Variables::expand(string const & s) const { + string str(s); LRegex reg("\\$\\{\\(.*\\)\\}"); if (!reg.exact_match(str)) diff --git a/src/Variables.h b/src/Variables.h index 5ffce6057a..617a740785 100644 --- a/src/Variables.h +++ b/src/Variables.h @@ -20,21 +20,21 @@ #include +/// class Variables { public: - virtual ~Variables() { }; - // + /// void set(string const &, string const &); - // + /// virtual string get(string const &) const; - // + /// bool isset(string const & var) const; - // - string expand(string) const; + /// + string expand(string const &) const; private: - // - typedef std::map Vars; - // + /// + typedef std::map Vars; + /// Vars vars_; }; diff --git a/src/buffer.C b/src/buffer.C index 40889f032d..48c62c5263 100644 --- a/src/buffer.C +++ b/src/buffer.C @@ -72,6 +72,7 @@ #include "insets/insetlist.h" #include "insets/insettabular.h" #include "insets/insettheorem.h" +#include "insets/insetcaption.h" #include "support/filetools.h" #include "support/path.h" #include "LaTeX.h" @@ -896,6 +897,11 @@ Buffer::parseSingleLyXformat2Token(LyXLex & lex, LyXParagraph *& par, inset->Read(this, lex); par->InsertInset(pos, inset, font); ++pos; + } else if (tmptok == "Caption") { + Inset * inset = new InsetCaption; + inset->Read(this, lex); + par->InsertInset(pos, inset, font); + ++pos; } else if (tmptok == "GRAPHICS") { Inset * inset = new InsetGraphics; //inset->Read(this, lex); diff --git a/src/commandtags.h b/src/commandtags.h index e857e4fef4..0be43d8e75 100644 --- a/src/commandtags.h +++ b/src/commandtags.h @@ -261,6 +261,7 @@ enum kb_action { LFUN_INSET_LIST, // Lgb 20000627 LFUN_INSET_THEOREM, // Lgb 20000630 LFUN_CREATE_CITATION, // Angus 20000705 + LFUN_INSET_CAPTION, // Lgb 20000718 LFUN_LASTACTION /* this marks the end of the table */ }; diff --git a/src/insets/insetcaption.C b/src/insets/insetcaption.C index 8d89efaad5..cdc24d9fae 100644 --- a/src/insets/insetcaption.C +++ b/src/insets/insetcaption.C @@ -15,3 +15,22 @@ #endif #include "insetcaption.h" +#include "debug.h" + +void InsetCaption::Write(Buffer const * buf, ostream & os) const +{ + os << "Caption\n"; + WriteParagraphData(buf, os); +} + + + +void InsetCaption::Read(Buffer const * buf, LyXLex & lex) +{ + string token = lex.GetString(); + if (token != "Caption") { + lyxerr << "InsetCaption::Read: consistency check failed." + << endl; + } + InsetText::Read(buf, lex); +} diff --git a/src/insets/insetcaption.h b/src/insets/insetcaption.h index 328c7aa6c1..f122fc4270 100644 --- a/src/insets/insetcaption.h +++ b/src/insets/insetcaption.h @@ -23,6 +23,14 @@ */ class InsetCaption : public InsetText { public: + /// + void Write(Buffer const * buf, std::ostream & os) const; + /// + void Read(Buffer const * buf, LyXLex & lex); + /// + Inset::Code LyxCode() const { + return CAPTION_CODE; + } protected: private: }; diff --git a/src/insets/insetfloat.C b/src/insets/insetfloat.C index b4792cf16d..827e73ad2f 100644 --- a/src/insets/insetfloat.C +++ b/src/insets/insetfloat.C @@ -194,6 +194,12 @@ void InsetFloat::InsetButtonRelease(BufferView * bv, int x, int y, int button) } +string const & InsetFloat::type() const +{ + return floatType; +} + + void InsetFloat::wide(bool w) { wide_ = w; diff --git a/src/insets/insetfloat.h b/src/insets/insetfloat.h index 62e51aae9e..3fca507bb1 100644 --- a/src/insets/insetfloat.h +++ b/src/insets/insetfloat.h @@ -46,6 +46,8 @@ public: /// void InsetButtonRelease(BufferView * bv, int x, int y, int button); /// + string const & type() const; + /// void wide(bool w); /// bool wide() const; diff --git a/src/insets/insettext.C b/src/insets/insettext.C index d38d9da270..08bd8260d6 100644 --- a/src/insets/insettext.C +++ b/src/insets/insettext.C @@ -599,7 +599,9 @@ void InsetText::InsetButtonRelease(BufferView * bv, int x, int y, int button) UpdatableInset * inset = 0; if (the_locking_inset) { - the_locking_inset->InsetButtonRelease(bv, x-inset_x, y-inset_y,button); + the_locking_inset->InsetButtonRelease(bv, + x - inset_x, y - inset_y, + button); } else { if (cpar(bv)->GetChar(cpos(bv)) == LyXParagraph::META_INSET) { inset = static_cast(cpar(bv)->GetInset(cpos(bv))); diff --git a/src/insets/insettext.h b/src/insets/insettext.h index b5dab5d5f1..a848bc55d5 100644 --- a/src/insets/insettext.h +++ b/src/insets/insettext.h @@ -154,9 +154,11 @@ public: // LyXFont GetDrawFont(BufferView *, LyXParagraph *, int pos) const; /// LyXText * getLyXText(BufferView *) const; + /// void deleteLyXText(BufferView *, bool recursive=true) const; + /// void resizeLyXText(BufferView *) const; - + /// LyXParagraph * par; /// mutable UpdateCodes need_update; @@ -164,11 +166,13 @@ public: protected: /// void UpdateLocal(BufferView *, UpdateCodes, bool mark_dirty); - + /// mutable int drawTextXOffset; + /// mutable int drawTextYOffset; /// bool autoBreakRows; + /// DrawFrame drawFrame; /// LColor::color frame_color; @@ -198,13 +202,18 @@ private: string getText(int); /// bool checkAndActivateInset(BufferView * bv, bool behind); + /// bool checkAndActivateInset(BufferView * bv, int x = 0, int y = 0, int button = 0); /// int cx(BufferView *) const; + /// int cy(BufferView *) const; + /// int cpos(BufferView *) const; + /// LyXParagraph * cpar(BufferView *) const; + /// Row * crow(BufferView *) const; /// This instead of a macro @@ -217,10 +226,15 @@ private: mutable bool locked; /// mutable int insetAscent; + /// mutable int insetDescent; + /// mutable int insetWidth; + /// mutable int last_width; + /// mutable int last_height; + /// mutable int top_y; /// LyXParagraph * inset_par; diff --git a/src/insets/lyxinset.h b/src/insets/lyxinset.h index 792756a862..05a9b7586b 100644 --- a/src/insets/lyxinset.h +++ b/src/insets/lyxinset.h @@ -45,13 +45,13 @@ public: /// TOC_CODE, // do these insets really need a code? (ale) /// - LOF_CODE, + LOF_CODE, // 2 /// LOT_CODE, /// LOA_CODE, /// - QUOTE_CODE, + QUOTE_CODE, // 5 /// MARK_CODE, /// @@ -61,7 +61,7 @@ public: /// HTMLURL_CODE, /// - SEPARATOR_CODE, + SEPARATOR_CODE, // 10 /// ENDING_CODE, /// @@ -71,7 +71,7 @@ public: /// ACCENT_CODE, /// - MATH_CODE, + MATH_CODE, // 15 /// INDEX_CODE, /// @@ -81,7 +81,7 @@ public: /// PARENT_CODE, /// - BIBTEX_CODE, + BIBTEX_CODE, // 20 /// TEXT_CODE, /// @@ -91,7 +91,7 @@ public: /// MARGIN_CODE, /// - FLOAT_CODE, + FLOAT_CODE, // 25 /// MINIPAGE_CODE, /// @@ -101,7 +101,9 @@ public: /// EXTERNAL_CODE, /// - THEOREM_CODE + THEOREM_CODE, // 30 + /// + CAPTION_CODE }; /// diff --git a/src/lyxfunc.C b/src/lyxfunc.C index 164a193fb8..f3972ac900 100644 --- a/src/lyxfunc.C +++ b/src/lyxfunc.C @@ -62,6 +62,7 @@ using std::istringstream; #include "insets/insetlist.h" #include "insets/insettabular.h" #include "insets/insettheorem.h" +#include "insets/insetcaption.h" #include "mathed/formulamacro.h" #include "toolbar.h" #include "spellchecker.h" // RVDK_PATCH_5 @@ -2102,12 +2103,32 @@ string LyXFunc::Dispatch(int ac, } break; + case LFUN_INSET_CAPTION: + { + // Do we have a locking inset... + if (owner->view()->the_locking_inset) { + lyxerr << "Locking inset code: " + << owner->view()->the_locking_inset->LyxCode(); + InsetCaption * new_inset = new InsetCaption; + new_inset->setOwner(owner->view()->the_locking_inset); + new_inset->SetAutoBreakRows(true); + new_inset->SetDrawFrame(0, InsetText::LOCKED); + new_inset->SetFrameColor(0, LColor::footnoteframe); + if (owner->view()->insertInset(new_inset)) + new_inset->Edit(owner->view(), 0, 0, 0); + else + delete new_inset; + } + } + break; + case LFUN_INSET_TABULAR: { int r = 2, c = 2; if (!argument.empty()) - sscanf(argument.c_str(),"%d%d",&r,&c); - InsetTabular * new_inset = new InsetTabular(owner->buffer(),r,c); + sscanf(argument.c_str(),"%d%d", &r, &c); + InsetTabular * new_inset = + new InsetTabular(owner->buffer(), r, c); if (owner->view()->insertInset(new_inset)) new_inset->Edit(owner->view(), 0, 0, 0); else diff --git a/src/text2.C b/src/text2.C index 3e5d1479d8..d146c41191 100644 --- a/src/text2.C +++ b/src/text2.C @@ -23,6 +23,7 @@ #include "insets/insetbib.h" #include "insets/insetspecialchar.h" #include "insets/insettext.h" +#include "insets/insetfloat.h" #include "layout.h" #include "LyXView.h" #include "support/textutils.h" @@ -41,6 +42,7 @@ #include "font.h" #include "debug.h" #include "lyxrc.h" +#include "FloatList.h" //#define USE_OLD_CUT_AND_PASTE 1 @@ -179,7 +181,11 @@ LyXFont LyXText::GetFont(Buffer const * buf, LyXParagraph * par, char par_depth = par->GetDepth(); // We specialize the 95% common case: - if (par->footnoteflag == LyXParagraph::NO_FOOTNOTE && !par_depth) { + if ( +#ifndef NEW_INSETS + par->footnoteflag == LyXParagraph::NO_FOOTNOTE && +#endif + !par_depth) { if (pos >= 0){ // 95% goes here if (layout.labeltype == LABEL_MANUAL @@ -412,8 +418,7 @@ void LyXText::OpenStuff(BufferView * bview) { if (cursor.pos() == 0 && cursor.par()->bibkey){ cursor.par()->bibkey->Edit(bview, 0, 0, 0); - } - else if (cursor.pos() < cursor.par()->Last() + } else if (cursor.pos() < cursor.par()->Last() && cursor.par()->GetChar(cursor.pos()) == LyXParagraph::META_INSET && cursor.par()->GetInset(cursor.pos())->Editable()) { bview->owner()->getMiniBuffer() @@ -421,9 +426,12 @@ void LyXText::OpenStuff(BufferView * bview) if (cursor.par()->GetInset(cursor.pos())->Editable() != Inset::HIGHLY_EDITABLE) SetCursorParUndo(bview->buffer()); cursor.par()->GetInset(cursor.pos())->Edit(bview, 0, 0, 0); - } else { + } +#ifndef NEW_INSETS + else { ToggleFootnote(bview); } +#endif } @@ -553,7 +561,9 @@ LyXParagraph * LyXText::SetLayout(BufferView * bview, 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()); LyXParagraph * fppar = cur.par()->FirstPhysicalPar(); @@ -568,10 +578,14 @@ LyXParagraph * LyXText::SetLayout(BufferView * bview, 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()); LyXParagraph * fppar = cur.par()->FirstPhysicalPar(); @@ -586,7 +600,9 @@ LyXParagraph * LyXText::SetLayout(BufferView * bview, delete fppar->bibkey; fppar->bibkey = 0; } +#ifndef NEW_INSETS } +#endif return endpar; } @@ -1545,6 +1561,7 @@ char loweralphaCounter(int n) return 'a' + n - 1; } + char alphaCounter(int n) { if (n < 1 || n > 26) @@ -1553,6 +1570,7 @@ char alphaCounter(int n) return 'A' + n - 1; } + char hebrewCounter(int n) { static const char hebrew[22] = { @@ -1566,7 +1584,9 @@ char hebrewCounter(int n) return hebrew[n-1]; } -static char const * romanCounter(int n) + +static +char const * romanCounter(int n) { static char const * roman[20] = { "i", "ii", "iii", "iv", "v", @@ -1580,12 +1600,13 @@ static char const * romanCounter(int n) return roman[n-1]; } + // set the counter of a paragraph. This includes the labels void LyXText::SetCounter(Buffer const * buf, LyXParagraph * par) const { // this is only relevant for the beginning of paragraph par = par->FirstPhysicalPar(); - + LyXLayout const & layout = textclasslist.Style(buf->params.textclass, par->GetLayout()); @@ -1615,8 +1636,7 @@ void LyXText::SetCounter(Buffer const * buf, LyXParagraph * par) const } par->enumdepth = par->Previous()->FirstPhysicalPar()->enumdepth; par->itemdepth = par->Previous()->FirstPhysicalPar()->itemdepth; - } - else { + } else { for (int i = 0; i < 10; ++i) { par->setCounter(i, 0); } @@ -1661,9 +1681,11 @@ void LyXText::SetCounter(Buffer const * buf, LyXParagraph * par) const par->Previous()->GetLayout() ).labeltype == LABEL_COUNTER_ENUMI && par->enumdepth < 3 +#ifndef NEW_INSETS && !(par->Previous()->footnoteflag == LyXParagraph::NO_FOOTNOTE && par->footnoteflag == LyXParagraph::OPEN_FOOTNOTE && par->footnotekind == LyXParagraph::FOOTNOTE) +#endif && layout.labeltype != LABEL_BIBLIO) { par->enumdepth++; } @@ -1671,9 +1693,11 @@ void LyXText::SetCounter(Buffer const * buf, LyXParagraph * par) const /* Maybe we have to decrement the enumeration depth, see note above */ if (par->Previous() && par->Previous()->GetDepth() > par->GetDepth() +#ifndef NEW_INSETS && !(par->Previous()->footnoteflag == LyXParagraph::NO_FOOTNOTE && par->footnoteflag == LyXParagraph::OPEN_FOOTNOTE && par->footnotekind == LyXParagraph::FOOTNOTE) +#endif && layout.labeltype != LABEL_BIBLIO) { par->enumdepth = par->DepthHook(par->GetDepth())->enumdepth; par->setCounter(6 + par->enumdepth, @@ -1934,26 +1958,32 @@ void LyXText::SetCounter(Buffer const * buf, LyXParagraph * par) const // the caption hack: if (layout.labeltype == LABEL_SENSITIVE) { - bool isOK = (par->InInset() && par->InInset()->owner() && - (par->InInset()->owner()->LyxCode()==Inset::FLOAT_CODE)); - if ((isOK && (par->InInset()->owner()->getInsetName() == "figure")) || - (par->footnoteflag != LyXParagraph::NO_FOOTNOTE + bool isOK (par->InInset() && par->InInset()->owner() && + (par->InInset()->owner()->LyxCode() == Inset::FLOAT_CODE)); +#ifndef NEW_INSETS + if (par->footnoteflag != LyXParagraph::NO_FOOTNOTE && (par->footnotekind == LyXParagraph::FIG - || par->footnotekind == LyXParagraph::WIDE_FIG))) + || par->footnotekind == LyXParagraph::WIDE_FIG)) { s = (par->getParLanguage(buf->params)->lang() == "hebrew") ? ":øåéà" : "Figure:"; - else if ((isOK && (par->InInset()->owner()->getInsetName() == "table")) || - (par->footnoteflag != LyXParagraph::NO_FOOTNOTE + } else if (par->footnoteflag != LyXParagraph::NO_FOOTNOTE && (par->footnotekind == LyXParagraph::TAB - || par->footnotekind == LyXParagraph::WIDE_TAB))) + || par->footnotekind == LyXParagraph::WIDE_TAB)) { s = (par->getParLanguage(buf->params)->lang() == "hebrew") ? ":äìáè" : "Table:"; - else if ((isOK && (par->InInset()->owner()->getInsetName() == "algorithm")) || - (par->footnoteflag != LyXParagraph::NO_FOOTNOTE - && par->footnotekind == LyXParagraph::ALGORITHM)) + } else if (par->footnoteflag != LyXParagraph::NO_FOOTNOTE + && par->footnotekind == LyXParagraph::ALGORITHM) { s = (par->getParLanguage(buf->params)->lang() == "hebrew") ? ":íúéøåâìà" : "Algorithm:"; - else { + } +#endif + else if (isOK) { + InsetFloat * tmp = static_cast(par->InInset()->owner()); + Floating const & fl + = floatList.getType(tmp->type()); + // We should get the correct number here too. + s = fl.name + " #:"; + } else { /* par->SetLayout(0); s = layout->labelstring; */ s = (par->getParLanguage(buf->params)->lang() == "hebrew") @@ -1978,10 +2008,12 @@ void LyXText::UpdateCounters(BufferView * bview, Row * row) const if (!row) { row = firstrow; par = row->par(); - } - else { + } else { if (row->par()->next - && row->par()->next->footnoteflag != LyXParagraph::OPEN_FOOTNOTE) { +#ifndef NEW_INSETS + && row->par()->next->footnoteflag != LyXParagraph::OPEN_FOOTNOTE) +#endif + { par = row->par()->LastPhysicalPar()->Next(); } else { par = row->par()->next; @@ -2683,14 +2715,18 @@ bool LyXText::UpdateInset(BufferView * bview, Inset * inset) LyXParagraph * par = FirstParagraph(); do { +#ifndef NEW_INSETS // make sure the paragraph is open if (par->footnoteflag != LyXParagraph::CLOSED_FOOTNOTE){ +#endif pos = par->GetPositionOfInset(inset); if (pos != -1){ CheckParagraph(bview, par, pos); return true; } +#ifndef NEW_INSETS } +#endif par = par->Next(); } while (par); @@ -3341,8 +3377,7 @@ bool LyXText::TextHandleUndo(BufferView * bview, Undo * undo) else OwnerParagraph(tmppar3); tmppar3->previous = before; - } - else { + } else { if (!before) OwnerParagraph(behind); } @@ -3356,6 +3391,7 @@ bool LyXText::TextHandleUndo(BufferView * bview, Undo * undo) // Set the cursor for redoing if (before) { SetCursorIntern(bview, before->FirstSelfrowPar(), 0); +#ifndef NEW_INSETS // check wether before points to a closed float and open it if necessary if (before && before->footnoteflag == LyXParagraph::CLOSED_FOOTNOTE && before->next && before->next->footnoteflag != LyXParagraph::NO_FOOTNOTE){ @@ -3368,8 +3404,10 @@ bool LyXText::TextHandleUndo(BufferView * bview, Undo * undo) tmppar4 = tmppar4->next; } } +#endif } - + +#ifndef NEW_INSETS // open a cosed footnote at the end if necessary if (behind && behind->previous && behind->previous->footnoteflag != LyXParagraph::NO_FOOTNOTE && @@ -3379,13 +3417,18 @@ bool LyXText::TextHandleUndo(BufferView * bview, Undo * undo) behind = behind->next; } } +#endif // calculate the endpar for redoing the paragraphs. if (behind) { +#ifndef NEW_INSETS if (behind->footnoteflag != LyXParagraph::CLOSED_FOOTNOTE) +#endif endpar = behind->LastPhysicalPar()->Next(); +#ifndef NEW_INSETS else endpar = behind->NextAfterFootnote()->LastPhysicalPar()->Next(); +#endif } else endpar = behind; @@ -3640,6 +3683,7 @@ void LyXText::toggleAppendix(BufferView * bview) SetCursor(bview, cursor.par(), cursor.pos()); } + LyXParagraph * LyXText::OwnerParagraph() const { if (inset_owner) -- 2.39.2