#include "support/forkedcontr.h"
#include "support/lstrings.h"
#include "support/lyxlib.h"
-#include "support/tostr.h"
+#include "support/convert.h"
#include <boost/bind.hpp>
/// Store info on a currently executing, forked process.
-struct InProgress {
+class InProgress {
+public:
///
InProgress() : pid(0) {}
///
namespace lyx {
namespace graphics {
-struct PreviewLoader::Impl : public boost::signals::trackable {
+class PreviewLoader::Impl : public boost::signals::trackable {
+public:
///
Impl(PreviewLoader & p, Buffer const & b);
/// Stop any InProgress items still executing.
namespace {
-struct IncrementedFileName {
+class IncrementedFileName {
+public:
IncrementedFileName(string const & to_format,
string const & filename_base)
: to_format_(to_format), base_(filename_base), counter_(1)
: parent_(p), buffer_(b), font_scaling_factor_(0.0)
{
font_scaling_factor_ = 0.01 * lyxrc.dpi * lyxrc.zoom *
- lyxrc.preview_scale_factor;
+ convert<double>(lyxrc.preview_scale_factor);
lyxerr[Debug::GRAPHICS] << "The font scaling factor is "
<< font_scaling_factor_ << endl;
namespace {
-struct EraseSnippet {
+class EraseSnippet {
+public:
EraseSnippet(string const & s) : snippet_(s) {}
void operator()(InProgressProcess & process)
{
InsetIterator const end = inset_iterator_end(inset);
for (; it != end; ++it)
- if (it->lyxCode() == InsetOld::MATHMACRO_CODE)
+ if (it->lyxCode() == InsetBase::MATHMACRO_CODE)
it->latex(buffer_, os, runparams);
// All equation lables appear as "(#)" + preview.sty's rendering of
string const unique_filename(string const bufferpath)
{
static int theCounter = 0;
- string const filename = tostr(theCounter++) + "lyxpreview";
+ string const filename = convert<string>(theCounter++) + "lyxpreview";
return support::AddName(bufferpath, filename);
}