]> git.lyx.org Git - lyx.git/blobdiff - src/insets/Inset.cpp
Routines for calculating numerical labels for BibTeX citations.
[lyx.git] / src / insets / Inset.cpp
index ef5c17856f4ac30e14537f6c6d7796040d0bc649..f626ca8ae448d2b4a08f12bb3442facd1205fe6f 100644 (file)
@@ -28,6 +28,7 @@
 #include "FuncRequest.h"
 #include "FuncStatus.h"
 #include "MetricsInfo.h"
+#include "output_xhtml.h"
 #include "Text.h"
 #include "TextClass.h"
 
@@ -185,7 +186,10 @@ Buffer & Inset::buffer()
 {
        if (!buffer_) {
                odocstringstream s;
-               lyxerr << "LyX Code: " << lyxCode() << " name: " << insetName(lyxCode()) << std::endl;
+               lyxerr << "Inset: " << this
+                                       << " LyX Code: " << lyxCode()
+                                       << " name: " << insetName(lyxCode())
+                                       << std::endl;
                s << "LyX Code: " << lyxCode() << " name: " << name();
                LASSERT(false, /**/);
                throw ExceptionMessage(BufferException, 
@@ -279,7 +283,11 @@ string insetName(InsetCode c)
 
 void Inset::dispatch(Cursor & cur, FuncRequest & cmd)
 {
-       LASSERT(cur.buffer() == &buffer(), return);
+       if (buffer_ == 0) {
+               lyxerr << "Unassigned buffer_ member in Inset::dispatch()" << std::endl;
+               lyxerr << "LyX Code: " << lyxCode() << " name: " << insetName(lyxCode()) << std::endl;
+       } else if (cur.buffer() != buffer_)
+               lyxerr << "cur.buffer() != buffer_ in Inset::dispatch()" << std::endl;
        cur.updateFlags(Update::Force | Update::FitCursor);
        cur.dispatched();
        doDispatch(cur, cmd);
@@ -399,12 +407,13 @@ int Inset::docbook(odocstream &, OutputParams const &) const
 }
 
 
-docstring Inset::xhtml(odocstream & od, OutputParams const &) const
+docstring Inset::xhtml(XHTMLStream & xs, OutputParams const &) const
 {
-       od << "[[Inset: " << from_ascii(insetName(lyxCode())) << "]]";
+       xs << "[[Inset: " << from_ascii(insetName(lyxCode())) << "]]";
        return docstring();
 }
 
+
 bool Inset::directWrite() const
 {
        return false;
@@ -531,7 +540,7 @@ void Inset::dump() const
 }
 
 
-ColorCode Inset::backgroundColor() const
+ColorCode Inset::backgroundColor(PainterInfo const & /*pi*/) const
 {
        return Color_none;
 }