if (buffer_.isReadonly()
&& !lyxaction.funcHasFlag(act, LyXAction::ReadOnly)
&& !lyxaction.funcHasFlag(act, LyXAction::NoBuffer)) {
- flag.message(from_utf8(N_("Document is read-only")));
+ if (buffer_.hasReadonlyFlag())
+ flag.message(from_utf8(N_("Document is read-only")));
+ else
+ flag.message(from_utf8(N_("Document has been modified externally")));
flag.setEnabled(false);
return true;
}
bool BufferView::setCursorFromRow(int row)
{
- TextEntry start, end;
+ TexRow::TextEntry start, end;
tie(start,end) = buffer_.texrow().getEntriesFromRow(row);
LYXERR(Debug::LATEX,
"setCursorFromRow: for row " << row << ", TexRow has found "
}
-bool BufferView::setCursorFromEntries(TextEntry start, TextEntry end)
+bool BufferView::setCursorFromEntries(TexRow::TextEntry start,
+ TexRow::TextEntry end)
{
DocIterator dit_start, dit_end;
tie(dit_start,dit_end) =
}
// remember width for the case that sl.inset() is positioned in an RTL inset
- if (i && dit[i - 1].text()) {
- // If this Inset is inside a Text Inset, retrieve the Dimension
- // from the containing text instead of using Inset::dimension() which
- // might not be implemented.
- // FIXME (Abdel 23/09/2007): this is a bit messy because of the
- // elimination of Inset::dim_ cache. This coordOffset() method needs
- // to be rewritten in light of the new design.
- Dimension const & dim = coordCache().getInsets().dim(&sl.inset());
- lastw = dim.wid;
- } else {
- Dimension const dim = sl.inset().dimension(*this);
- lastw = dim.wid;
- }
+ lastw = sl.inset().dimension(*this).wid;
//lyxerr << "Cursor::getPos, i: "
// << i << " x: " << xx << " y: " << y << endl;
void BufferView::cursorPosAndHeight(Point & p, int & h) const
{
Cursor const & cur = cursor();
- Font const font = cur.getFont();
+ Font const font = cur.real_current_font;
frontend::FontMetrics const & fm = theFontMetrics(font);
int const asc = fm.maxAscent();
int const des = fm.maxDescent();