]> git.lyx.org Git - lyx.git/blobdiff - src/insets/insetfloatlist.C
(Herbert): strip the extension from the graphics filename when exporting
[lyx.git] / src / insets / insetfloatlist.C
index b51064490b5b1f910fc329fa6d60943d11dcadee..cb2785b5197d4733287f9bb931d16d2538511da4 100644 (file)
@@ -6,6 +6,7 @@
 
 #include "insetfloatlist.h"
 #include "FloatList.h"
+#include "LaTeXFeatures.h"
 #include "frontends/Dialogs.h"
 #include "LyXView.h"
 #include "BufferView.h"
 #include "gettext.h"
 #include "debug.h"
 
+
+using std::ostream;
 using std::endl;
 
+
 InsetFloatList::InsetFloatList()
        : InsetCommand(InsetCommandParams())
 {
 }
 
+
 InsetFloatList::InsetFloatList(string const & type)
        : InsetCommand(InsetCommandParams())
 {
@@ -28,12 +32,11 @@ InsetFloatList::InsetFloatList(string const & type)
 }
 
 
-string const InsetFloatList::getScreenLabel(Buffer const *) const 
+string const InsetFloatList::getScreenLabel(Buffer const *) const
 {
-       string const guiName = floatList[getCmdName()]->second.name();
+       string const guiName = floatList[getCmdName()]->second.listName();
        if (!guiName.empty()) {
-               string const res = guiName + _(" List");
-               return res;
+               return _(guiName);
        }
        return _("ERROR: Nonexistent float type!");
 }
@@ -45,13 +48,13 @@ Inset::Code InsetFloatList::lyxCode() const
 }
 
 
-void InsetFloatList::write(Buffer const *, std::ostream & os) const
+void InsetFloatList::write(Buffer const *, ostream & os) const
 {
        os << "FloatList " << getCmdName() << "\n";
 }
 
 
-void InsetFloatList::read(Buffer const *, LyXLex & lex) 
+void InsetFloatList::read(Buffer const *, LyXLex & lex)
 {
        string token;
 
@@ -85,7 +88,7 @@ void InsetFloatList::edit(BufferView * bv, bool)
 }
 
 
-int InsetFloatList::latex(Buffer const *, std::ostream & os, bool, bool) const
+int InsetFloatList::latex(Buffer const *, ostream & os, bool, bool) const
 {
        FloatList::const_iterator cit = floatList[getCmdName()];
 
@@ -102,7 +105,7 @@ int InsetFloatList::latex(Buffer const *, std::ostream & os, bool, bool) const
                        }
                } else {
                        os << "\\listof{" << getCmdName() << "}{"
-                          << _("List of ") << cit->second.name() << "}\n";
+                          << cit->second.listName() << "}\n";
                }
        } else {
                os << "%%\\listof{" << getCmdName() << "}{"
@@ -112,7 +115,7 @@ int InsetFloatList::latex(Buffer const *, std::ostream & os, bool, bool) const
 }
 
 
-int InsetFloatList::ascii(Buffer const * buffer, std::ostream & os, int) const
+int InsetFloatList::ascii(Buffer const * buffer, ostream & os, int) const
 {
        os << getScreenLabel(buffer) << "\n\n";
 
@@ -130,3 +133,9 @@ int InsetFloatList::ascii(Buffer const * buffer, std::ostream & os, int) const
        os << "\n";
        return 0;
 }
+
+
+void InsetFloatList::validate(LaTeXFeatures & features) const
+{
+       features.useFloat(getCmdName());
+}