]> git.lyx.org Git - features.git/commitdiff
deledelete BufferView::available() method because buffer serves the same purpose.
authorAbdelrazak Younes <younes@lyx.org>
Sat, 16 Sep 2006 14:00:13 +0000 (14:00 +0000)
committerAbdelrazak Younes <younes@lyx.org>
Sat, 16 Sep 2006 14:00:13 +0000 (14:00 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15018 a592a061-630c-0410-9148-cb99ea01b6c8

src/BufferView.C
src/BufferView.h
src/frontends/LyXView.C
src/frontends/WorkArea.C
src/frontends/controllers/Kernel.C
src/lyx_cb.C
src/lyxfind.C
src/lyxfunc.C

index 2cde9ab9f09631f2a8ff34577917fa535bd1baea..709da3c6f6caf07c73a642736753e63b8fe1a505 100644 (file)
@@ -517,12 +517,6 @@ void BufferView::setCursorFromScrollbar()
 }
 
 
-bool BufferView::available() const
-{
-       return buffer_;
-}
-
-
 Change const BufferView::getCurrentChange()
 {
        if (!buffer_->params().tracking_changes || !cursor_.selection())
@@ -1399,7 +1393,7 @@ void BufferView::menuInsertLyXFile(string const & filenm)
                // 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))
index 11c95453c216f5d4a49ff61cbf97a558fbb48b37..2f580a3263b495f33bd0ee50ea898fe802f36fc7 100644 (file)
@@ -127,9 +127,6 @@ public:
        /// 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
index 8989471f4598a6df307499951eb7dba01bdf082a..62d41ff69fa6352b2f9158572ee35941eaa62686 100644 (file)
@@ -273,7 +273,7 @@ void LyXView::autoSave()
 {
        lyxerr[Debug::INFO] << "Running autoSave()" << endl;
 
-       if (view()->available()) {
+       if (view()->buffer()) {
                ::autoSave(view());
        }
 }
@@ -318,7 +318,7 @@ void LyXView::updateWindowTitle()
        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);
index cf7eac4b07edb8f6d0aa4371792b8834191ebe9d..41c7c62e6ba52e85d2a0c60448d98211f85c6623 100644 (file)
@@ -235,7 +235,7 @@ void WorkArea::processKeySym(LyXKeySymPtr key,
         * 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.
@@ -343,7 +343,7 @@ void WorkArea::showCursor()
        if (cursor_visible_)
                return;
 
-       if (!buffer_view_->available())
+       if (!buffer_view_->buffer())
                return;
 
        CursorShape shape = BAR_SHAPE;
index 17c417f8a9e372dda7e85f709d3ffc1406c541e3..7a4ea142f69939031f1350480e6ff3bd0f19a48e 100644 (file)
@@ -51,7 +51,7 @@ bool Kernel::isBufferAvailable() const
 {
        if (!lyxview_.view())
                return false;
-       return lyxview_.view()->available();
+       return lyxview_.view()->buffer();
 }
 
 
index 3635a4a0a13cde61ad739921fa5240b205038d2c..e1af6fd8fdcfa115694fd780e37d04853f5e54bd 100644 (file)
@@ -302,7 +302,7 @@ void autoSave(BufferView * bv)
        // 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()) {
@@ -353,7 +353,7 @@ void newFile(BufferView * bv, string const & filename)
 // 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
index f2752a82f0a8a8a9611fd49d0084621cdebefa65..d18ae9b58be9f32ad9a7906c8b8850484ba12152 100644 (file)
@@ -141,7 +141,7 @@ bool searchAllowed(BufferView * bv, string const & str)
                Alert::error(_("Search error"), _("Search string is empty"));
                return false;
        }
-       return bv->available();
+       return bv->buffer();
 }
 
 
@@ -337,7 +337,7 @@ void replace(BufferView * bv, FuncRequest const & ev)
 
 bool findNextChange(BufferView * bv)
 {
-       if (!bv->available())
+       if (!bv->buffer())
                return false;
 
        DocIterator cur = bv->cursor();
index 8a61978bdbef0b61044b9a94c801080309b53911..b1aa3fb2990d953fe582adfe41182e49681a65ba 100644 (file)
@@ -775,7 +775,7 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
                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")));
@@ -998,7 +998,7 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
                        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()) );
@@ -1591,7 +1591,7 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
                }
                }
 
-               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.
@@ -1690,7 +1690,7 @@ void LyXFunc::menuNew(string const & name, bool fromTemplate)
        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))
@@ -1742,7 +1742,7 @@ void LyXFunc::open(string const & fname)
 {
        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))
@@ -1819,7 +1819,7 @@ void LyXFunc::doImport(string const & argument)
        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))
@@ -1940,7 +1940,7 @@ string const LyXFunc::viewStatusMessage()
        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();