#include "debug.h"
#include "iterators.h"
#include "lyxlex.h"
+#include "WordLangTuple.h"
#include "frontends/Alert.h"
#include "frontends/Dialogs.h"
}
}
- Paragraph::inset_iterator pit = par->inset_iterator_begin();
- Paragraph::inset_iterator pend = par->inset_iterator_end();
+ InsetList::iterator pit = par->insetlist.begin();
+ InsetList::iterator pend = par->insetlist.end();
+
while (pit != pend) {
- if (pit->autoDelete()) {
+ if (pit.getInset()->autoDelete()) {
removed = true;
pos_type const pos = pit.getPos();
par->erase(pos);
// We just invalidated par's inset iterators so
// we get the next valid iterator position
- pit = par->InsetIterator(pos);
+ pit = par->insetlist.insetIterator(pos);
// and ensure we have a valid end iterator.
- pend = par->inset_iterator_end();
+ pend = par->insetlist.end();
if (cursor_par == par) {
// update the saved cursor position
if (texrowpar == 0)
continue;
+ freezeUndo();
InsetError * new_inset = new InsetError(msgtxt);
text->setCursorIntern(this, texrowpar, tmppos);
text->insertInset(this, new_inset);
text->fullRebreak(this);
+ unFreezeUndo();
}
// Restore the cursor position
text->setCursorIntern(this, cursor.par(), cursor.pos());
{
if (!available())
return;
-
+
owner()->message(_("Undo"));
hideCursor();
beforeChange(text);
{
if (!available())
return;
-
+
owner()->message(_("Redo"));
hideCursor();
beforeChange(text);
}
}
// Then do a deep look of the inset and lock the right one
- Paragraph * par = buffer()->paragraph;
int const id = inset->id();
- while(par) {
- Paragraph::inset_iterator it =
- par->inset_iterator_begin();
- Paragraph::inset_iterator const end =
- par->inset_iterator_end();
+ ParagraphList::iterator pit = buffer()->paragraphs.begin();
+ ParagraphList::iterator pend = buffer()->paragraphs.end();
+ for (; pit != pend; ++pit) {
+ InsetList::iterator it = pit->insetlist.begin();
+ InsetList::iterator end = pit->insetlist.end();
for (; it != end; ++it) {
- if ((*it) == inset) {
- text->setCursorIntern(this, par, it.getPos());
+ if (it.getInset() == inset) {
+ text->setCursorIntern(this, &*pit, it.getPos());
theLockingInset(inset);
return true;
}
- if ((*it)->getInsetFromID(id)) {
- text->setCursorIntern(this, par, it.getPos());
- (*it)->edit(this);
+ if (it.getInset()->getInsetFromID(id)) {
+ text->setCursorIntern(this, &*pit, it.getPos());
+ it.getInset()->edit(this);
return theLockingInset()->lockInsetInInset(this, inset);
}
}
- par = par->next();
}
return false;
}
// make sure we update the combo !
owner()->setLayout(getLyXText()->cursor.par()->layout()->name());
// Tell the paragraph dialog that we changed paragraph
- owner()->getDialogs()->updateParagraph();
+ owner()->getDialogs().updateParagraph();
finishUndo();
return 0;
} else if (inset && theLockingInset() &&
theLockingInset()->unlockInsetInInset(this, inset)) {
// Tell the paragraph dialog that we changed paragraph
- owner()->getDialogs()->updateParagraph();
+ owner()->getDialogs().updateParagraph();
// owner inset has updated the layout combo
finishUndo();
return 0;
it != end; ++it) {
Paragraph * par = *it;
bool changed_inset = false;
- for (Paragraph::inset_iterator it2 = par->inset_iterator_begin();
- it2 != par->inset_iterator_end(); ++it2) {
- if ((*it2)->lyxCode() == code) {
- InsetCommand * inset = static_cast<InsetCommand *>(*it2);
+ for (InsetList::iterator it2 = par->insetlist.begin();
+ it2 != par->insetlist.end(); ++it2) {
+ if (it2.getInset()->lyxCode() == code) {
+ InsetCommand * inset = static_cast<InsetCommand *>(it2.getInset());
if (inset->getContents() == from) {
inset->setContents(to);
changed_inset = true;