}
-bool BufferView::available() const
-{
- return buffer_;
-}
-
-
Change const BufferView::getCurrentChange()
{
if (!buffer_->params().tracking_changes || !cursor_.selection())
// Launch a file browser
string initpath = lyxrc.document_path;
- if (available()) {
+ if (buffer_) {
string const trypath = buffer_->filePath();
// If directory is writeable, use this as default.
if (isDirWriteable(trypath))
/// return the Scrollbar Parameters
ScrollbarParameters const & scrollbarParameters() const;
- /// FIXME
- bool available() const;
-
/// Save the current position as bookmark i
void savePosition(unsigned int i);
/// Restore the position from bookmark i
{
lyxerr[Debug::INFO] << "Running autoSave()" << endl;
- if (view()->available()) {
+ if (view()->buffer()) {
::autoSave(view());
}
}
docstring maximize_title = lyx::from_ascii("LyX");
docstring minimize_title = lyx::from_ascii("LyX");
- if (view()->available()) {
+ if (view()->buffer()) {
string const cur_title = buffer()->fileName();
if (!cur_title.empty()) {
maximize_title += lyx::from_ascii(": ") + makeDisplayPath(cur_title, 30);
* of the cursor. Note we cannot do this inside
* dispatch() itself, because that's called recursively.
*/
-// if (buffer_view_->available())
+// if (buffer_view_->buffer())
toggleCursor();
// uneeded "redraw()" call commented out for now.
if (cursor_visible_)
return;
- if (!buffer_view_->available())
+ if (!buffer_view_->buffer())
return;
CursorShape shape = BAR_SHAPE;
{
if (!lyxview_.view())
return false;
- return lyxview_.view()->available();
+ return lyxview_.view()->buffer();
}
// should probably be moved into BufferList (Lgb)
// Perfect target for a thread...
{
- if (!bv->available())
+ if (!bv->buffer())
return;
if (bv->buffer()->isBakClean() || bv->buffer()->isReadonly()) {
// Insert ascii file (if filename is empty, prompt for one)
void insertAsciiFile(BufferView * bv, string const & f, bool asParagraph)
{
- if (!bv->available())
+ if (!bv->buffer())
return;
// FIXME: We don't know the encoding of the file
Alert::error(_("Search error"), _("Search string is empty"));
return false;
}
- return bv->available();
+ return bv->buffer();
}
bool findNextChange(BufferView * bv)
{
- if (!bv->available())
+ if (!bv->buffer())
return false;
DocIterator cur = bv->cursor();
case LFUN_CANCEL:
keyseq.reset();
meta_fake_bit = key_modifier::none;
- if (view()->available())
+ if (view()->buffer())
// cancel any selection
dispatch(FuncRequest(LFUN_MARK_OFF));
setMessage(lyx::from_utf8(N_("Cancel")));
break;
case LFUN_LYX_QUIT:
- if (view()->available()) {
+ if (view()->buffer()) {
// save cursor Position for opened files to .lyx/session
LyX::ref().session().saveFilePosition(owner->buffer()->fileName(),
boost::tie(view()->cursor().pit(), view()->cursor().pos()) );
}
}
- if (view()->available()) {
+ if (view()->buffer()) {
// Redraw screen unless explicitly told otherwise.
// This also initializes the position cache for all insets
// in (at least partially) visible top-level paragraphs.
string initpath = lyxrc.document_path;
string filename(name);
- if (view()->available()) {
+ if (view()->buffer()) {
string const trypath = owner->buffer()->filePath();
// If directory is writeable, use this as default.
if (isDirWriteable(trypath))
{
string initpath = lyxrc.document_path;
- if (view()->available()) {
+ if (view()->buffer()) {
string const trypath = owner->buffer()->filePath();
// If directory is writeable, use this as default.
if (isDirWriteable(trypath))
if (filename.empty()) {
string initpath = lyxrc.document_path;
- if (view()->available()) {
+ if (view()->buffer()) {
string const trypath = owner->buffer()->filePath();
// If directory is writeable, use this as default.
if (isDirWriteable(trypath))
if (keyseq.length() > 0 && !keyseq.deleted())
return keyseq.printOptions();
- if (!view()->available())
+ if (!view()->buffer())
return lyx::to_utf8(_("Welcome to LyX!"));
return view()->cursor().currentState();