]> git.lyx.org Git - lyx.git/blobdiff - src/insets/insetcaption.C
The markDirty() and fitCursor() changes
[lyx.git] / src / insets / insetcaption.C
index 39691f7d6aebd4c3ed0244f8415233f41fc9df48..af5e9d8d6ef7044d55f5d4146cf56faf47a121e1 100644 (file)
@@ -10,9 +10,6 @@
 
 #include <config.h>
 
-#ifdef __GNUG__
-#pragma implementation
-#endif
 
 #include "insetcaption.h"
 #include "frontends/Painter.h"
@@ -25,6 +22,8 @@
 #include "gettext.h"
 #include "support/lstrings.h"
 
+#include "BoostFormat.h"
+
 using std::ostream;
 using std::endl;
 
@@ -67,7 +66,7 @@ string const InsetCaption::editMessage() const
 
 
 void InsetCaption::draw(BufferView * bv, LyXFont const & f,
-                       int baseline, float & x, bool cleared) const
+                       int baseline, float & x) const
 {
        // We must draw the label, we should get the label string
        // from the enclosing float inset.
@@ -86,17 +85,23 @@ void InsetCaption::draw(BufferView * bv, LyXFont const & f,
 
        // Discover the number...
        // ...
-       string const num = "#";
+       string const num("#");
 
+#if USE_BOOST_FORMAT
        // Generate the label
-       string const label = _(fl) + " " + num + ":";
-
+       boost::format frm("%1$s %2$s:");
+       frm % _(fl) % num;
+       string const label = frm.str();
+#else
+       // Generate the label
+       string const label = _(fl) + ' ' + num + ':';
+#endif
        Painter & pain = bv->painter();
        int const w = font_metrics::width(label, f);
        pain.text(int(x), baseline, label, f);
        x += w;
 
-       InsetText::draw(bv, f, baseline, x, cleared);
+       InsetText::draw(bv, f, baseline, x);
 }