#include "Inset.h"
+#include "buffer_funcs.h"
#include "Buffer.h"
#include "BufferParams.h"
#include "BufferView.h"
}
+void Inset::initView()
+{
+ if (isLabeled())
+ lyx::updateLabels(buffer());
+}
+
+
docstring Inset::toolTip(BufferView const &, int, int) const
{
return docstring();
/**
* This is typically used after this inset is created interactively.
* Intented purpose is to sanitize internal state with regard to current
- * Buffer.
+ * Buffer. The default implementation calls updateLabels(buffer()) is
+ * the inset is labeled.
+ *
+ * \sa isLabeled()
**/
- virtual void initView() {}
+ virtual void initView();
+ /// \return true if this inset is labeled.
+ virtual bool isLabeled() const { return false; }
/// identification as math inset
virtual InsetMath * asInsetMath() { return 0; }
**/
void initView();
///
+ bool isLabeled() const { return true; }
+ ///
void read(Lexer & lex);
///
docstring screenLabel() const;
{}
-void InsetCitation::initView()
-{
- // We need an update of the Buffer reference cache. This is achieved by
- // updateLabel().
- lyx::updateLabels(buffer());
-}
-
-
ParamInfo const & InsetCitation::findInfo(string const & /* cmdName */)
{
// standard cite does only take one argument if jurabib is
///
InsetCitation(InsetCommandParams const &);
///
- void initView();
+ bool isLabeled() const { return true; }
///
docstring screenLabel() const;
///
**/
void initView();
+ ///
+ bool isLabeled() const { return true; }
+
///
docstring screenLabel() const;
///
///
~InsetListings();
///
+ bool isLabeled() const { return true; }
+ ///
InsetCode lyxCode() const { return LISTINGS_CODE; }
/// lstinline is inlined, normal listing is displayed
DisplayType display() const;
#include "InsetRef.h"
#include "Buffer.h"
-#include "buffer_funcs.h"
#include "Cursor.h"
#include "DispatchResult.h"
#include "FuncRequest.h"
{}
-void InsetRef::initView()
-{
- // We need an update of the Buffer reference cache. This is achieved by
- // updateLabel().
- lyx::updateLabels(buffer());
-}
-
-
bool InsetRef::isCompatibleCommand(string const & s) {
//FIXME This is likely not the best way to handle this.
//But this stuff is hardcoded elsewhere already.
InsetRef(Buffer const & buffer, InsetCommandParams const &);
- /// verify label and reference.
- /**
- * Overloaded from Inset::initView.
- **/
- void initView();
+ ///
+ bool isLabeled() const { return true; }
///
docstring screenLabel() const;
///