#include "output_xhtml.h"
#include "Text.h"
#include "TextClass.h"
+#include "TocBackend.h"
#include "frontends/Application.h"
#include "frontends/Painter.h"
}
+void Inset::resetBuffer()
+{
+ buffer_ = nullptr;
+}
+
+
Buffer & Inset::buffer()
{
if (!buffer_) {
<< " name: " << iname);
s << "LyX Code: " << lyxCode() << " name: " << from_ascii(iname);
LATTEST(false);
- throw ExceptionMessage(BufferException,
+ throw ExceptionMessage(BufferException,
from_ascii("Inset::buffer_ member not initialized!"), s.str());
}
return *buffer_;
bool Inset::isBufferValid() const
{
- return buffer_
+ return buffer_
&& (isBufferLoaded() || buffer_->isClone());
}
}
-bool Inset::isFreeSpacing() const
+bool Inset::isFreeSpacing() const
{
return getLayout().isFreeSpacing();
}
}
-string insetName(InsetCode c)
+string insetName(InsetCode c)
{
build_translator();
return insetnames[c].name;
}
-docstring insetDisplayName(InsetCode c)
+docstring insetDisplayName(InsetCode c)
{
build_translator();
return insetnames[c].display_name;
{
if (buffer_ == 0) {
lyxerr << "Unassigned buffer_ member in Inset::dispatch()" << std::endl;
- lyxerr << "LyX Code: " << lyxCode() << " name: "
+ lyxerr << "LyX Code: " << lyxCode() << " name: "
<< insetName(lyxCode()) << std::endl;
} else if (cur.buffer() != buffer_)
lyxerr << "cur.buffer() != buffer_ in Inset::dispatch()" << std::endl;
}
case LFUN_IN_MATHMACROTEMPLATE:
- // By default we're not in a MathMacroTemplate inset
+ // By default we're not in a InsetMathMacroTemplate inset
flag.setEnabled(false);
return true;
pi.pain.line(t, d - 3, t, d, pen_color);
pi.pain.line(x, d, x + 3, d, pen_color);
pi.pain.line(t - 3, d, t, d, pen_color);
- setPosCache(pi, x, y);
}
pi.pain.line(t, a + 3, t, a, pen_color);
pi.pain.line(x, a, x + 3, a, pen_color);
pi.pain.line(t - 3, a, t, a, pen_color);
- setPosCache(pi, x, y);
}
}
-void Inset::setPosCache(PainterInfo const & pi, int x, int y) const
-{
- //LYXERR("Inset: set position cache to " << x << " " << y);
- pi.base.bv->coordCache().insets().add(this, x, y);
-}
-
-
-void Inset::setDimCache(MetricsInfo const & mi, Dimension const & dim) const
-{
- mi.base.bv->coordCache().insets().add(this, dim);
-}
-
-
Buffer const * Inset::updateFrontend() const
{
//FIXME (Abdel 03/12/10): see bugs #6814 and #6949
}
-docstring Inset::completionPrefix(Cursor const &) const
+docstring Inset::completionPrefix(Cursor const &) const
{
return docstring();
}