#include "lyxtext.h"
#include "undo_funcs.h"
#include "changes.h"
+#include "paragraph_funcs.h"
#include "frontends/Alert.h"
#include "frontends/Dialogs.h"
bool BufferView::removeAutoInsets()
{
// keep track of which pos and par the cursor was on
- Paragraph * cursor_par = text->cursor.par();
+ Paragraph * cursor_par = &*text->cursor.par();
Paragraph * cursor_par_prev = cursor_par ? cursor_par->previous() : 0;
Paragraph * cursor_par_next = cursor_par ? cursor_par->next() : 0;
pos_type cursor_pos = text->cursor.pos();
texrowpar = &*text->ownerParagraphs().begin();
tmppos = 0;
} else {
- texrowpar = buffer()->getParFromID(tmpid);
+ texrowpar = &*buffer()->getParFromID(tmpid);
}
if (texrowpar == 0)
texrowpar = &*text->ownerParagraphs().begin();
tmppos = 0;
} else {
- texrowpar = buffer()->getParFromID(tmpid);
+ texrowpar = &*buffer()->getParFromID(tmpid);
}
text->setCursor(texrowpar, tmppos);
}
}
-void BufferView::copyEnvironment()
-{
- if (available()) {
- text->copyEnvironmentType();
- owner()->message(_("Paragraph environment type copied"));
- }
-}
-
-
-void BufferView::pasteEnvironment()
-{
- if (available()) {
- text->pasteEnvironmentType();
- owner()->message(_("Paragraph environment type set"));
- update(text, BufferView::SELECT);
- }
-}
-
-
// these functions are for the spellchecker
WordLangTuple const BufferView::nextWord(float & value)
{
if (!theLockingInset()) {
// first check if it's the inset under the cursor we want lock
// should be most of the time
- if (text->cursor.pos() < text->cursor.par()->size()
+ if (text->cursor.pos() < text->cursor.par()->size()
&& text->cursor.par()->getChar(text->cursor.pos()) ==
Paragraph::META_INSET) {
Inset * in = text->cursor.par()->getInset(text->cursor.pos());
kind = Undo::FINISH;
setUndo(this, kind,
text->cursor.par(),
- text->cursor.par()->next());
+ boost::next(text->cursor.par()));
}
if (!t)
return 0;
- LyXCursor const & c= t->cursor;
- LyXFont const font = c.par()->getFont(buffer()->params, c.pos());
+ LyXCursor const & c = t->cursor;
+ LyXFont const font = c.par()->getFont(buffer()->params, c.pos(),
+ outerFont(c.par(), t->ownerParagraphs()));
return font.language()->encoding();
}