]> git.lyx.org Git - lyx.git/blobdiff - src/Buffer.cpp
Revert "Automatically show the review toolbar if the document has tracked changes"
[lyx.git] / src / Buffer.cpp
index 6cebf5d7f6264ac03d7db0286088c14bf4e4e872..ea04b34a619e7bb2dd559cac380a1c13e2ac1f52 100644 (file)
@@ -321,7 +321,7 @@ public:
        /// If there was an error when previewing, on the next preview we do
        /// a fresh compile (e.g. in case the user installed a package that
        /// was missing).
-       bool preview_error_;
+       bool require_fresh_start_;
 
        /// Cache the references associated to a label and their positions
        /// in the buffer.
@@ -391,10 +391,6 @@ public:
                + (with_blanks ? blank_count_ : 0);
        }
 
-       // does the buffer contain tracked changes? (if so, we automatically
-       // display the review toolbar, for instance)
-       mutable bool tracked_changes_present_;
-
        // Make sure the file monitor monitors the good file.
        void refreshFileMonitor();
 
@@ -456,10 +452,10 @@ Buffer::Impl::Impl(Buffer * owner, FileName const & file, bool readonly_,
          file_fully_loaded(false), file_format(LYX_FORMAT), need_format_backup(false),
          ignore_parent(false),  toc_backend(owner), macro_lock(false),
          checksum_(0), wa_(0),  gui_(0), undo_(*owner), bibinfo_cache_valid_(false),
-         cite_labels_valid_(false), have_bibitems_(false), preview_error_(false),
+         cite_labels_valid_(false), have_bibitems_(false), require_fresh_start_(false),
          inset(0), preview_loader_(0), cloned_buffer_(cloned_buffer),
          clone_list_(0), doing_export(false),
-         tracked_changes_present_(0), externally_modified_(false), parent_buffer(0),
+         externally_modified_(false), parent_buffer(0),
          word_count_(0), char_count_(0), blank_count_(0)
 {
        refreshFileMonitor();
@@ -489,8 +485,7 @@ Buffer::Impl::Impl(Buffer * owner, FileName const & file, bool readonly_,
        layout_position = cloned_buffer_->d->layout_position;
        preview_file_ = cloned_buffer_->d->preview_file_;
        preview_format_ = cloned_buffer_->d->preview_format_;
-       preview_error_ = cloned_buffer_->d->preview_error_;
-       tracked_changes_present_ = cloned_buffer_->d->tracked_changes_present_;
+       require_fresh_start_ = cloned_buffer_->d->require_fresh_start_;
 }
 
 
@@ -1246,9 +1241,14 @@ void Buffer::setFullyLoaded(bool value)
 }
 
 
-bool Buffer::lastPreviewError() const
+bool Buffer::freshStartRequired() const
 {
-       return d->preview_error_;
+       return d->require_fresh_start_;
+}
+
+void Buffer::requireFreshStart(bool const b) const
+{
+       d->require_fresh_start_ = b;
 }
 
 
@@ -3028,8 +3028,6 @@ void Buffer::dispatch(FuncRequest const & func, DispatchResult & dr)
                if (params().save_transient_properties)
                        undo().recordUndoBufferParams(CursorData());
                params().track_changes = !params().track_changes;
-               if (!params().track_changes)
-                       dr.forceChangesUpdate();
                break;
 
        case LFUN_CHANGES_OUTPUT:
@@ -4728,7 +4726,7 @@ Buffer::ExportStatus Buffer::preview(string const & format, bool includeall) con
        Impl * theimpl = isClone() ? d->cloned_buffer_->d : d;
        theimpl->preview_file_ = previewFile;
        theimpl->preview_format_ = format;
-       theimpl->preview_error_ = (status != ExportSuccess);
+       theimpl->require_fresh_start_ = (status != ExportSuccess);
 
        if (status != ExportSuccess)
                return status;
@@ -5027,7 +5025,6 @@ void Buffer::updateBuffer(UpdateScope scope, UpdateType utype) const
        // update all caches
        clearReferenceCache();
        updateMacros();
-       setChangesPresent(false);
 
        Buffer & cbuf = const_cast<Buffer &>(*this);
        // if we are reloading, then we could have a dangling TOC,
@@ -5068,7 +5065,6 @@ void Buffer::updateBuffer(UpdateScope scope, UpdateType utype) const
                clearReferenceCache();
                // we should not need to do this again?
                // updateMacros();
-               setChangesPresent(false);
                updateBuffer(parit, utype);
                // this will already have been done by reloadBibInfoCache();
                // d->bibinfo_cache_valid_ = true;
@@ -5350,9 +5346,6 @@ void Buffer::updateBuffer(ParIterator & parit, UpdateType utype) const
                // set the counter for this paragraph
                d->setLabel(parit, utype);
 
-               // update change-tracking flag
-               parit->addChangesToBuffer(*this);
-
                // now the insets
                for (auto const & insit : parit->insetList()) {
                        parit.pos() = insit.pos;
@@ -5614,29 +5607,6 @@ string Buffer::includedFilePath(string const & name, string const & ext) const
 }
 
 
-void Buffer::setChangesPresent(bool b) const
-{
-       d->tracked_changes_present_ = b;
-}
-
-
-bool Buffer::areChangesPresent() const
-{
-       return d->tracked_changes_present_;
-}
-
-
-void Buffer::updateChangesPresent() const
-{
-       LYXERR(Debug::CHANGES, "Buffer::updateChangesPresent");
-       setChangesPresent(false);
-       ParConstIterator it = par_iterator_begin();
-       ParConstIterator const end = par_iterator_end();
-       for (; !areChangesPresent() && it != end; ++it)
-               it->addChangesToBuffer(*this);
-}
-
-
 void Buffer::Impl::refreshFileMonitor()
 {
        if (file_monitor_ && file_monitor_->filename() == filename.absFileName()) {