#include "insets/InsetSpecialChar.h"
#include "insets/InsetTabular.h"
+#include "support/convert.h"
#include "support/debug.h"
#include "support/docstream.h"
#include "support/gettext.h"
return res;
}
+
// Returns the current font and depth as a message.
docstring Text::currentState(Cursor const & cur) const
{
if (!name.empty())
text = name + ':' + text;
- return text;
+ // We need a unique label
+ docstring label = text;
+ int i = 1;
+ while (cur.buffer()->insetLabel(label)) {
+ label = text + '-' + convert<docstring>(i);
+ ++i;
+ }
+
+ return label;
}