]> git.lyx.org Git - lyx.git/blobdiff - src/insets/insetgraphics.C
Make it compile when USE_BOOST_FORMAT is unset
[lyx.git] / src / insets / insetgraphics.C
index cbcd6c8d208d29bf7cdf274cdb64c8031004d644..79bb4f0a93f4bd036ed947056dba2301390f22dd 100644 (file)
@@ -92,6 +92,7 @@ TODO
 #include <boost/weak_ptr.hpp>
 #include <boost/bind.hpp>
 #include <boost/signals/trackable.hpp>
+#include "BoostFormat.h"
 
 #include <algorithm> // For the std::max
 
@@ -665,9 +666,14 @@ string const InsetGraphics::prepareFile(Buffer const * buf) const
                Systemcall one;
                one.startscript(Systemcall::Wait, command);
                if (!IsFileReadable(ChangeExtension(outfile_base, to)))
+#if USE_BOOST_FORMAT
                        Alert::alert(_("Cannot convert Image (not existing file?)"),
-                               _("No information for converting from ")
-                               + from + _(" to ") + to);
+                                    boost::io::str(boost::format(_("No information for converting from %1$s to %2$s"))
+                               % from % to));
+#else
+                       Alert::alert(_("Cannot convert Image (not existing file?)"),
+                                    _("No information for converting from ") + from + " to " + to);
+#endif
        }
 
        return RemoveExtension(temp_file);
@@ -756,7 +762,15 @@ int InsetGraphics::ascii(Buffer const *, ostream & os, int) const
        // 1. Convert file to ascii using gifscii
        // 2. Read ascii output file and add it to the output stream.
        // at least we send the filename
-       os << '<' << _("Graphic file:") << params().filename << ">\n";
+#if USE_BOOST_FORMAT
+       os << '<'
+          << boost::format(_("Graphic file: %1$s")) % params().filename
+          << ">\n";
+#else
+       os << '<'
+          << _("Graphic file: ") << params().filename
+          << ">\n";
+#endif
        return 0;
 }