* This file is part of LyX, the document processor.
* Licence details can be found in the file COPYING.
*
- * \author Lars Gullik Bjønnes
+ * \author Lars Gullik Bjønnes
* \author Jean-Marc Lasgouttes
* \author John Levon
* \author Angus Leeming
*
- * Full author contact details are available in file CREDITS
+ * Full author contact details are available in file CREDITS.
*/
#include <config.h>
#include "bufferview_funcs.h"
#include "BufferView.h"
-#include "paragraph.h"
-#include "lyxfont.h"
#include "lyxlex.h"
-#include "lyxtext.h"
#include "buffer.h"
-#include "lyx_cb.h"
#include "language.h"
#include "gettext.h"
#include "ParagraphParameters.h"
-#include "author.h"
-#include "changes.h"
#include "frontends/LyXView.h"
#include "frontends/Alert.h"
#include "mathed/math_cursor.h"
#include "support/tostr.h"
-#include "Lsstream.h"
+#include "support/std_sstream.h"
-#include "insets/updatableinset.h"
-#include <boost/bind.hpp>
-#include <algorithm>
+#include "insets/insettext.h"
using namespace lyx::support;
namespace bv_funcs {
-
-void resizeInsets(BufferView * bv)
-{
- ParagraphList & paragraphs = bv->buffer()->paragraphs;
- /// then remove all LyXText in text-insets
- std::for_each(paragraphs.begin(), paragraphs.end(),
- boost::bind(&Paragraph::resizeInsetsLyXText, _1, bv));
-}
-
-
// Set data using font and toggle
// If successful, returns true
bool font2string(LyXFont const & font, bool toggle, string & data)
toggleAndShow(bv, font);
}
+
void lang(BufferView * bv, string const & l)
{
Language const * lang = languages.getLanguage(l);
bool const changed = text->changeDepth(type, false);
if (text->inset_owner)
- bv->updateInset();
- bv->update();
+ bv->updateInset(text->inset_owner);
return changed;
}
}
#ifdef DEVEL_VERSION
state << _(", Paragraph: ") << text->cursor.par()->id();
- state << " Inset: " <<
+ state << _(", Position: ") << text->cursor.pos();
+ RowList::iterator rit = text->cursorRow();
+ state << bformat(_(", Row b:%1$d e:%2$d"), rit->pos(), rit->end());
+ state << _(", Inset: ") <<
(text->cursor.par()->inInset() ? text->cursor.par()->inInset()->id() : -1);
#endif
return STRCONV(state.str());
}
LyXText * text = bv->getLyXText();
- // FIXME: can this happen ??
- if (!text)
- return;
-
text->toggleFree(font, toggleall);
bv->update();
if (font.language() != ignore_language ||
font.number() != LyXFont::IGNORE) {
LyXCursor & cursor = text->cursor;
- text->computeBidiTables(bv->buffer(), text->cursorRow());
+ text->computeBidiTables(text->cursor.par(), *bv->buffer(),
+ text->cursorRow());
if (cursor.boundary() !=
- text->isBoundary(bv->buffer(), *cursor.par(), cursor.pos(),
+ text->isBoundary(*bv->buffer(), *cursor.par(), cursor.pos(),
text->real_current_font))
text->setCursor(cursor.par(), cursor.pos(),
false, !cursor.boundary());
void replaceSelection(LyXText * lt)
{
if (lt->selection.set()) {
- lt->update();
lt->cutSelection(true, false);
- lt->update();
+ lt->bv()->update();
}
}