+ (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_;
+
private:
/// So we can force access via the accessors.
mutable Buffer const * parent_buffer;
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_;
}
fn.onlyPath().absFileName() :
lyxrc.backupdir_path;
string const fform = convert<string>(d->file_format);
- string const backname = fname + "-" + fform;
+ string const backname = fname + "-lyxformat-" + fform;
FileName backup(addName(fpath, addExtension(backname, fext)));
// limit recursion, just in case
list.clear();
shared_ptr<Toc> toc = d->toc_backend.toc("label");
- TocIterator toc_it = toc->begin();
- TocIterator end = toc->end();
+ Toc::const_iterator toc_it = toc->begin();
+ Toc::const_iterator end = toc->end();
for (; toc_it != end; ++toc_it) {
if (toc_it->depth() == 0)
list.push_back(toc_it->str());
break;
case LFUN_CHANGES_TRACK:
- undo().recordUndoBufferParams(CursorData());
+ 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:
- undo().recordUndoBufferParams(CursorData());
+ if (params().save_transient_properties)
+ undo().recordUndoBufferParams(CursorData());
params().output_changes = !params().output_changes;
if (params().output_changes) {
bool dvipost = LaTeXFeatures::isAvailable("dvipost");
// update all caches
clearReferenceCache();
updateMacros();
+ setChangesPresent(false);
Buffer & cbuf = const_cast<Buffer &>(*this);
// set the counter for this paragraph
d->setLabel(parit, utype);
+ // update change-tracking flag
+ parit->addChangesToBuffer(*this);
+
// now the insets
InsetList::const_iterator iit = parit->insetList().begin();
InsetList::const_iterator end = parit->insetList().end();
from_utf8(filePath())));
}
+
+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);
+}
+
+
+
} // namespace lyx