#include <config.h>
-#ifdef __GNUG__
-#pragma implementation
-#endif
-
#include "bufferview_funcs.h"
-#include "frontends/LyXView.h"
#include "BufferView.h"
#include "paragraph.h"
#include "lyxfont.h"
#include "language.h"
#include "gettext.h"
#include "ParagraphParameters.h"
+#include "author.h"
+#include "changes.h"
+#include "frontends/LyXView.h"
#include "frontends/Alert.h"
#include "support/lstrings.h"
+#include "insets/updatableinset.h"
+
#include "BoostFormat.h"
void emph(BufferView * bv)
// Returns the current font and depth as a message.
string const currentState(BufferView * bv)
{
+ if (!bv->available())
+ return string();
+
ostringstream state;
- if (!bv->available())
- return "";
+ LyXText * text = bv->getLyXText();
+ Buffer * buffer = bv->buffer();
+ LyXCursor const & c(text->cursor);
+
+ bool const show_change = buffer->params.tracking_changes
+ && c.pos() != c.par()->size()
+ && c.par()->lookupChange(c.pos()) != Change::UNCHANGED;
+
+ if (show_change) {
+ Change change(c.par()->lookupChangeFull(c.pos()));
+ Author const & a(bv->buffer()->authors().get(change.author));
+ state << _("Change: ") << a.name();
+ if (!a.email().empty()) {
+ state << " (" << a.email() << ")";
+ }
+ if (change.changetime)
+ state << _(" at ") << ctime(&change.changetime);
+ state << " : ";
+ }
// I think we should only show changes from the default
// font. (Asger)
- LyXText * text = bv->getLyXText();
- Buffer * buffer = bv->buffer();
LyXFont font = text->real_current_font;
LyXFont const & defaultfont =
buffer->params.getLyXTextClass().defaultfont();