From 067a685263c13c2dc5623dabd5b25b434d5c7f1b Mon Sep 17 00:00:00 2001 From: Jean-Marc Lasgouttes Date: Mon, 13 Jul 2009 00:57:51 +0000 Subject: [PATCH] remove BufferParams parameter from Inset::accept/rejectChanges; adapt rest of code accordingly git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@30531 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/Paragraph.cpp | 12 +++++------- src/Paragraph.h | 4 ++-- src/Text.cpp | 6 +++--- src/insets/Inset.h | 5 ++--- src/insets/InsetTabular.cpp | 8 ++++---- src/insets/InsetTabular.h | 5 ++--- src/insets/InsetText.cpp | 8 ++++---- src/insets/InsetText.h | 5 ++--- src/paragraph_funcs.cpp | 2 +- 9 files changed, 25 insertions(+), 30 deletions(-) diff --git a/src/Paragraph.cpp b/src/Paragraph.cpp index 152a3bd72b..de6d28d7d7 100644 --- a/src/Paragraph.cpp +++ b/src/Paragraph.cpp @@ -362,8 +362,7 @@ Change const & Paragraph::lookupChange(pos_type pos) const } -void Paragraph::acceptChanges(BufferParams const & bparams, pos_type start, - pos_type end) +void Paragraph::acceptChanges(pos_type start, pos_type end) { LASSERT(start >= 0 && start <= size(), /**/); LASSERT(end > start && end <= size() + 1, /**/); @@ -373,14 +372,14 @@ void Paragraph::acceptChanges(BufferParams const & bparams, pos_type start, case Change::UNCHANGED: // accept changes in nested inset if (Inset * inset = getInset(pos)) - inset->acceptChanges(bparams); + inset->acceptChanges(); break; case Change::INSERTED: d->changes_.set(Change(Change::UNCHANGED), pos); // also accept changes in nested inset if (Inset * inset = getInset(pos)) - inset->acceptChanges(bparams); + inset->acceptChanges(); break; case Change::DELETED: @@ -398,8 +397,7 @@ void Paragraph::acceptChanges(BufferParams const & bparams, pos_type start, } -void Paragraph::rejectChanges(BufferParams const & bparams, - pos_type start, pos_type end) +void Paragraph::rejectChanges(pos_type start, pos_type end) { LASSERT(start >= 0 && start <= size(), /**/); LASSERT(end > start && end <= size() + 1, /**/); @@ -409,7 +407,7 @@ void Paragraph::rejectChanges(BufferParams const & bparams, case Change::UNCHANGED: // reject changes in nested inset if (Inset * inset = getInset(pos)) - inset->rejectChanges(bparams); + inset->rejectChanges(); break; case Change::INSERTED: diff --git a/src/Paragraph.h b/src/Paragraph.h index 2423b7492e..e1cb33e0f1 100644 --- a/src/Paragraph.h +++ b/src/Paragraph.h @@ -229,10 +229,10 @@ public: void setChange(pos_type pos, Change const & change); /// accept changes within the given range - void acceptChanges(BufferParams const & bparams, pos_type start, pos_type end); + void acceptChanges(pos_type start, pos_type end); /// reject changes within the given range - void rejectChanges(BufferParams const & bparams, pos_type start, pos_type end); + void rejectChanges(pos_type start, pos_type end); /// Paragraphs can contain "manual labels", for example, Description /// environment. The text for this user-editable label is stored in diff --git a/src/Text.cpp b/src/Text.cpp index 7cc44d9901..dd8dba4370 100644 --- a/src/Text.cpp +++ b/src/Text.cpp @@ -840,9 +840,9 @@ void Text::acceptOrRejectChanges(Cursor & cur, ChangeOp op) pos_type right = (pit == endPit ? endPos : parSize); if (op == ACCEPT) { - pars_[pit].acceptChanges(cur.buffer()->params(), left, right); + pars_[pit].acceptChanges(left, right); } else { - pars_[pit].rejectChanges(cur.buffer()->params(), left, right); + pars_[pit].rejectChanges(left, right); } } @@ -919,7 +919,7 @@ void Text::rejectChanges(BufferParams const & bparams) // (do not consider end-of-par) for (pit_type pit = 0; pit < pars_size; ++pit) { if (!pars_[pit].empty()) // prevent assertion failure - pars_[pit].rejectChanges(bparams, 0, pars_[pit].size()); + pars_[pit].rejectChanges(0, pars_[pit].size()); } // next, reject imaginary end-of-par characters diff --git a/src/insets/Inset.h b/src/insets/Inset.h index f5726bcb39..df9b40cc35 100644 --- a/src/insets/Inset.h +++ b/src/insets/Inset.h @@ -27,7 +27,6 @@ namespace lyx { class BiblioInfo; class Buffer; -class BufferParams; class BufferView; class Change; class CompletionList; @@ -487,9 +486,9 @@ public: /// set the change for the entire inset virtual void setChange(Change const &) {} /// accept the changes within the inset - virtual void acceptChanges(BufferParams const &) {}; + virtual void acceptChanges() {}; /// reject the changes within the inset - virtual void rejectChanges(BufferParams const &) {}; + virtual void rejectChanges() {}; /// virtual Dimension const dimension(BufferView const &) const; diff --git a/src/insets/InsetTabular.cpp b/src/insets/InsetTabular.cpp index d1d0287f67..05b8f199a2 100644 --- a/src/insets/InsetTabular.cpp +++ b/src/insets/InsetTabular.cpp @@ -5157,17 +5157,17 @@ void InsetTabular::setChange(Change const & change) } -void InsetTabular::acceptChanges(BufferParams const & bparams) +void InsetTabular::acceptChanges() { for (idx_type idx = 0; idx < nargs(); ++idx) - cell(idx)->acceptChanges(bparams); + cell(idx)->acceptChanges(); } -void InsetTabular::rejectChanges(BufferParams const & bparams) +void InsetTabular::rejectChanges() { for (idx_type idx = 0; idx < nargs(); ++idx) - cell(idx)->rejectChanges(bparams); + cell(idx)->rejectChanges(); } diff --git a/src/insets/InsetTabular.h b/src/insets/InsetTabular.h index 3f516e05a2..072349b9b5 100644 --- a/src/insets/InsetTabular.h +++ b/src/insets/InsetTabular.h @@ -48,7 +48,6 @@ namespace lyx { class Buffer; -class BufferParams; class BufferView; class CompletionList; class CursorSlice; @@ -805,9 +804,9 @@ public: /// set the change for the entire inset void setChange(Change const & change); /// accept the changes within the inset - void acceptChanges(BufferParams const & bparams); + void acceptChanges(); /// reject the changes within the inset - void rejectChanges(BufferParams const & bparams); + void rejectChanges(); // this should return true if we have a "normal" cell, otherwise false. // "normal" means without width set! diff --git a/src/insets/InsetText.cpp b/src/insets/InsetText.cpp index 22a95c03cc..a396041a30 100644 --- a/src/insets/InsetText.cpp +++ b/src/insets/InsetText.cpp @@ -316,15 +316,15 @@ void InsetText::setChange(Change const & change) } -void InsetText::acceptChanges(BufferParams const & bparams) +void InsetText::acceptChanges() { - text_.acceptChanges(bparams); + text_.acceptChanges(buffer().params()); } -void InsetText::rejectChanges(BufferParams const & bparams) +void InsetText::rejectChanges() { - text_.rejectChanges(bparams); + text_.rejectChanges(buffer().params()); } diff --git a/src/insets/InsetText.h b/src/insets/InsetText.h index ee3e4884b8..bcb0bfa503 100644 --- a/src/insets/InsetText.h +++ b/src/insets/InsetText.h @@ -20,7 +20,6 @@ namespace lyx { class Buffer; -class BufferParams; class BufferView; class CompletionList; class CursorSlice; @@ -115,9 +114,9 @@ public: /// set the change for the entire inset void setChange(Change const & change); /// accept the changes within the inset - void acceptChanges(BufferParams const & bparams); + void acceptChanges(); /// reject the changes within the inset - void rejectChanges(BufferParams const & bparams); + void rejectChanges(); /// append text onto the existing text void appendParagraphs(ParagraphList &); diff --git a/src/paragraph_funcs.cpp b/src/paragraph_funcs.cpp index 0d626e3d64..d299fc8cdd 100644 --- a/src/paragraph_funcs.cpp +++ b/src/paragraph_funcs.cpp @@ -354,7 +354,7 @@ void acceptChanges(ParagraphList & pars, BufferParams const & bparams) // (do not consider end-of-par) for (pit_type pit = 0; pit < pars_size; ++pit) { if (!pars[pit].empty()) // prevent assertion failure - pars[pit].acceptChanges(bparams, 0, pars[pit].size()); + pars[pit].acceptChanges(0, pars[pit].size()); } // next, accept imaginary end-of-par characters -- 2.39.5