#include "support/lyxalgo.h"
#include "support/os.h"
#include "support/Package.h"
-#include "support/Path.h"
+#include "support/PathChanger.h"
#include "support/Systemcall.h"
#include "support/textutils.h"
#include "support/types.h"
void Buffer::setFileName(FileName const & fname)
{
+ bool const changed = fname != d->filename;
d->filename = fname;
+ if (changed)
+ lyxvc().file_found_hook(fname);
setReadonly(d->filename.isReadOnly());
saveCheckSum();
updateTitles();
}
+void Buffer::makeCitationLabels() const
+{
+ Buffer const * const master = masterBuffer();
+ return d->bibinfo_.makeCitationLabels(*master);
+}
+
+
bool Buffer::citeLabelsValid() const
{
return masterBuffer()->d->cite_labels_valid_;
switch (func.action()) {
case LFUN_BUFFER_TOGGLE_READ_ONLY:
- if (lyxvc().inUse())
- lyxvc().toggleReadOnly();
+ if (lyxvc().inUse()) {
+ string log = lyxvc().toggleReadOnly();
+ if (!log.empty())
+ dr.setMessage(log);
+ }
else
setReadonly(!isReadonly());
break;
"file."), from_utf8(d->filename.absFileName())));
}
markDirty();
+ lyxvc().file_found_hook(d->filename);
str = _("Document was successfully recovered.");
} else
str = _("Document was NOT successfully recovered.");
from_utf8(d->filename.absFileName())));
}
markDirty();
+ lyxvc().file_found_hook(d->filename);
return ReadSuccess;
}
return ReadAutosaveFailure;
}
switch(layout.labeltype) {
- case LABEL_COUNTER:
- if (layout.toclevel <= bp.secnumdepth
- && (layout.latextype != LATEX_ENVIRONMENT
- || it.text()->isFirstInSequence(it.pit()))) {
- if (counters.hasCounter(layout.counter))
- counters.step(layout.counter, utype);
- par.params().labelString(par.expandLabel(layout, bp));
- } else
- par.params().labelString(docstring());
- break;
-
case LABEL_ITEMIZE: {
// At some point of time we should do something more
// clever here, like:
par.params().labelString(docstring());
break;
+ case LABEL_ABOVE:
+ case LABEL_CENTERED:
+ case LABEL_STATIC: {
+ docstring const & lcounter = layout.counter;
+ if (!lcounter.empty()) {
+ if (layout.toclevel <= bp.secnumdepth
+ && (layout.latextype != LATEX_ENVIRONMENT
+ || it.text()->isFirstInSequence(it.pit()))) {
+ if (counters.hasCounter(lcounter))
+ counters.step(lcounter, utype);
+ par.params().labelString(par.expandLabel(layout, bp));
+ } else
+ par.params().labelString(docstring());
+ } else
+ par.params().labelString(par.expandLabel(layout, bp));
+ break;
+ }
+
case LABEL_MANUAL:
- case LABEL_TOP_ENVIRONMENT:
- case LABEL_CENTERED_TOP_ENVIRONMENT:
- case LABEL_STATIC:
case LABEL_BIBLIO:
par.params().labelString(par.expandLabel(layout, bp));
- break;
}
}