]> git.lyx.org Git - lyx.git/blobdiff - src/insets/Inset.cpp
Pure HTML output for math macros.
[lyx.git] / src / insets / Inset.cpp
index b3fdf6fd944e48d9d2addd3445f1c7c28f82a8ef..2587df3f68eb238d1f32d0eef0aced32886a764f 100644 (file)
@@ -80,7 +80,7 @@ static void build_translator()
        insetnames[NOMENCL_CODE] = InsetName("nomenclature");
        insetnames[INCLUDE_CODE] = InsetName("include");
        insetnames[GRAPHICS_CODE] = InsetName("graphics");
-       insetnames[BIBITEM_CODE] = InsetName("bibitem");
+       insetnames[BIBITEM_CODE] = InsetName("bibitem", _("Bibliography Entry"));
        insetnames[BIBTEX_CODE] = InsetName("bibtex");
        insetnames[TEXT_CODE] = InsetName("text");
        insetnames[ERT_CODE] = InsetName("ert", _("TeX Code"));
@@ -100,10 +100,10 @@ static void build_translator()
        insetnames[OPTARG_CODE] = InsetName("optarg");
        insetnames[NEWLINE_CODE] = InsetName("newline");
        insetnames[LINE_CODE] = InsetName("line");
-       insetnames[BRANCH_CODE] = InsetName("branch");
+       insetnames[BRANCH_CODE] = InsetName("branch", _("Branch"));
        insetnames[BOX_CODE] = InsetName("box", _("Box"));
        insetnames[FLEX_CODE] = InsetName("flex");
-       insetnames[SPACE_CODE] = InsetName("space");
+       insetnames[SPACE_CODE] = InsetName("space", _("Horizontal Space"));
        insetnames[VSPACE_CODE] = InsetName("vspace", _("Vertical Space"));
        insetnames[MATH_MACROARG_CODE] = InsetName("mathmacroarg");
        insetnames[LISTINGS_CODE] = InsetName("listings");
@@ -149,7 +149,7 @@ static void build_translator()
        insetnames[MATH_ROOT_CODE] = InsetName("mathroot");
        insetnames[MATH_SCRIPT_CODE] = InsetName("mathscript");
        insetnames[MATH_SIZE_CODE] = InsetName("mathsize");
-       insetnames[MATH_SPACE_CODE] = InsetName("mathspace");
+       insetnames[MATH_SPACE_CODE] = InsetName("mathspace", _("Horizontal Math Space"));
        insetnames[MATH_SPECIALCHAR_CODE] = InsetName("mathspecialchar");
        insetnames[MATH_SPLIT_CODE] = InsetName("mathsplit");
        insetnames[MATH_SQRT_CODE] = InsetName("mathsqrt");
@@ -198,12 +198,19 @@ Buffer const & Inset::buffer() const
 }
 
 
-bool Inset::isBufferValid() const
+bool Inset::isBufferLoaded() const
 {
        return buffer_ && theBufferList().isLoaded(buffer_);
 }
 
 
+bool Inset::isBufferValid() const
+{
+       return buffer_ 
+               && (isBufferLoaded() || buffer_->isClone());
+}
+
+
 docstring Inset::name() const
 {
        return from_ascii("unknown");
@@ -229,7 +236,7 @@ bool Inset::forceLTR() const
 void Inset::initView()
 {
        if (isLabeled())
-               buffer().updateLabels();
+               buffer().updateBuffer();
 }
 
 
@@ -280,7 +287,8 @@ void Inset::dispatch(Cursor & cur, FuncRequest & cmd)
 {
        if (buffer_ == 0) {
                lyxerr << "Unassigned buffer_ member in Inset::dispatch()" << std::endl;
-               lyxerr << "LyX Code: " << lyxCode() << " name: " << insetName(lyxCode()) << 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);
@@ -296,8 +304,11 @@ bool Inset::showInsetDialog(BufferView * bv) const
        case ERT_CODE:
        case FLOAT_CODE:
        case BOX_CODE:
+       case BIBITEM_CODE:
+       case BRANCH_CODE:
        case INFO_CODE:
-       //FIXME: not ready yet.
+       case MATH_SPACE_CODE:
+       case SPACE_CODE:
        case TABULAR_CODE:
        case VSPACE_CODE:
                bv->showDialog(insetName(code));