]> git.lyx.org Git - lyx.git/blobdiff - src/insets/insetindex.C
Don't remove cell selections after fontchange.
[lyx.git] / src / insets / insetindex.C
index eccde8d07c1c9bf1f8e6549dfdfa0a6e7ab4dbc5..486aeb23111eb845002f76c2d95d5f78f60f3c40 100644 (file)
 #include "frontends/Dialogs.h"
 #include "LaTeXFeatures.h"
 #include "gettext.h"
+#include "support/LOstream.h"
+
+using std::ostream;
 
 InsetIndex::InsetIndex(InsetCommandParams const & p, bool)
        : InsetCommand(p)
 {}
 
 
-string const InsetIndex::getScreenLabel() const
+string const InsetIndex::getScreenLabel(Buffer const *) const
 {
        return _("Idx");
 }
@@ -24,7 +27,7 @@ string const InsetIndex::getScreenLabel() const
 
 void InsetIndex::edit(BufferView * bv, int, int, unsigned int)
 {
-       bv->owner()->getDialogs()->showIndex( this );
+       bv->owner()->getDialogs()->showIndex(this);
 }
 
 
@@ -34,11 +37,24 @@ void InsetIndex::edit(BufferView * bv, bool)
 }
 
 
+int InsetIndex::docbook(Buffer const *, ostream & os) const
+{
+  os << "<indexterm><primary>" << getContents() << "</primary></indexterm>";
+  return 0;
+}
+
+
+Inset::Code InsetIndex::lyxCode() const
+{
+       return Inset::INDEX_CODE;
+}
+
+
 InsetPrintIndex::InsetPrintIndex(InsetCommandParams const & p, bool)
        : InsetCommand(p)
 {}
 
-string const InsetPrintIndex::getScreenLabel() const
+string const InsetPrintIndex::getScreenLabel(Buffer const *) const
 {
        return _("Index");
 }
@@ -46,11 +62,11 @@ string const InsetPrintIndex::getScreenLabel() const
 
 void InsetPrintIndex::validate(LaTeXFeatures & features) const
 {
-       features.makeidx = true;
+       features.require("makeidx");
 }
 
 
 Inset::Code InsetPrintIndex::lyxCode() const
 {
-       return Inset::INDEX_CODE;
+       return Inset::INDEX_PRINT_CODE;
 }