]> git.lyx.org Git - lyx.git/blobdiff - src/insets/Inset.cpp
Center longtable explicitly (#10690)
[lyx.git] / src / insets / Inset.cpp
index 21d54e0bc907a6b48d5de0450e96b252bf8c39ff..0257ed0c45f1c56dad489b94ccbda9811dc89e2d 100644 (file)
@@ -31,6 +31,7 @@
 #include "output_xhtml.h"
 #include "Text.h"
 #include "TextClass.h"
+#include "TocBackend.h"
 
 #include "frontends/Application.h"
 #include "frontends/Painter.h"
@@ -116,7 +117,7 @@ static void build_translator()
        insetnames[MATH_MACROARG_CODE] = InsetName("mathmacroarg");
        insetnames[LISTINGS_CODE] = InsetName("listings");
        insetnames[INFO_CODE] = InsetName("info", _("Info"));
-       insetnames[COLLAPSABLE_CODE] = InsetName("collapsable");
+       insetnames[COLLAPSIBLE_CODE] = InsetName("collapsible");
        insetnames[NEWPAGE_CODE] = InsetName("newpage");
        insetnames[SCRIPT_CODE] = InsetName("script");
        insetnames[CELL_CODE] = InsetName("tablecell");
@@ -201,7 +202,7 @@ Buffer & Inset::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_;
@@ -222,7 +223,7 @@ bool Inset::isBufferLoaded() const
 
 bool Inset::isBufferValid() const
 {
-       return buffer_ 
+       return buffer_
                && (isBufferLoaded() || buffer_->isClone());
 }
 
@@ -233,7 +234,7 @@ docstring Inset::layoutName() const
 }
 
 
-bool Inset::isFreeSpacing() const 
+bool Inset::isFreeSpacing() const
 {
        return getLayout().isFreeSpacing();
 }
@@ -297,14 +298,14 @@ InsetCode insetCode(string const & name)
 }
 
 
-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;
@@ -315,7 +316,7 @@ void Inset::dispatch(Cursor & cur, FuncRequest & cmd)
 {
        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;
@@ -413,7 +414,7 @@ bool Inset::getStatus(Cursor &, FuncRequest const & cmd,
                }
 
        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;
 
@@ -552,22 +553,6 @@ void Inset::drawMarkers(PainterInfo & pi, int x, int y) const
 }
 
 
-void Inset::drawMarkers2(PainterInfo & pi, int x, int y) const
-{
-       ColorCode pen_color = mouseHovered(pi.base.bv) || editing(pi.base.bv)?
-               Color_mathframe : Color_mathcorners;
-
-       drawMarkers(pi, x, y);
-       Dimension const dim = dimension(*pi.base.bv);
-       int const t = x + dim.width() - 1;
-       int const a = y - dim.ascent();
-       pi.pain.line(x, a + 3, x, a, pen_color);
-       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);
-}
-
-
 bool Inset::editing(BufferView const * bv) const
 {
        return bv->cursor().isInside(this);
@@ -643,7 +628,7 @@ bool Inset::resetFontEdit() const
 }
 
 
-docstring Inset::completionPrefix(Cursor const &) const 
+docstring Inset::completionPrefix(Cursor const &) const
 {
        return docstring();
 }