]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetCounter.cpp
New DocBook support
[lyx.git] / src / insets / InsetCounter.cpp
index 5706f2619b93889bdee0bd21cea3846546984776..015d458e62f417b6999760767a734500693c0c23 100644 (file)
@@ -17,7 +17,7 @@
 #include "LaTeXFeatures.h"
 #include "OutputParams.h"
 #include "output_xhtml.h"
-#include "sgml.h"
+#include "xml.h"
 #include "texstream.h"
 #include "TextClass.h"
 
@@ -184,17 +184,16 @@ void InsetCounter::trackCounters(string const & cmd) const
        }
 }
 
-int InsetCounter::docbook(odocstream &, OutputParams const &) const
+void InsetCounter::docbook(odocstream &, OutputParams const &) const
 {
        // Here, we need to track counter values ourselves,
        // since unlike in the LaTeX case, there is no external
        // mechanism for doing that.
        trackCounters(getCmdName());
-       return 0;
 }
 
 
-docstring InsetCounter::xhtml(XHTMLStream &, OutputParams const &) const
+docstring InsetCounter::xhtml(XMLStream &, OutputParams const &) const
 {
        // Here, we need to track counter values ourselves,
        // since unlike in the LaTeX case, there is no external
@@ -217,27 +216,28 @@ void InsetCounter::updateBuffer(ParIterator const &, UpdateType, bool const)
        LASSERT(!label.empty(), return);
        docstring const tlabel = translateIfPossible(from_ascii(label));
 
+       docstring guiname = translateIfPossible(cnts.guiName(cntr));
        if (cmd == "set") {
                docstring const & val = getParam("value");
                cnts.set(cntr, convert<int>(val));
-               screen_label_ = bformat(_("Counter: Set %1$s"), cntr);
+               screen_label_ = bformat(_("Counter: Set %1$s"), guiname);
                tooltip_ = bformat(_("Set value of counter %1$s to %2$s"), cntr, val);
        } else if (cmd == "addto") {
                docstring const & val = getParam("value");
                cnts.addto(cntr, convert<int>(val));
-               screen_label_ = bformat(_("Counter: Add to %1$s"), cntr);
+               screen_label_ = bformat(_("Counter: Add to %1$s"), guiname);
                tooltip_ = bformat(_("Add %1$s to value of counter %2$s"), val, cntr);
        } else if (cmd == "reset") {
                cnts.reset(cntr);               
-               screen_label_ = bformat(_("Counter: Reset %1$s"), cntr);
+               screen_label_ = bformat(_("Counter: Reset %1$s"), guiname);
                tooltip_ = bformat(_("Reset value of counter %1$s"), cntr);
        } else if (cmd == "save") {
                cnts.saveValue(cntr);
-               screen_label_ = bformat(_("Counter: Save %1$s"), cntr);
+               screen_label_ = bformat(_("Counter: Save %1$s"), guiname);
                tooltip_ = bformat(_("Save value of counter %1$s"), cntr);
        } else if (cmd == "restore") {
                cnts.restoreValue(cntr);
-               screen_label_ = bformat(_("Counter: Restore %1$s"), cntr);
+               screen_label_ = bformat(_("Counter: Restore %1$s"), guiname);
                tooltip_ = bformat(_("Restore value of counter %1$s"), cntr);
        }
 }