]> git.lyx.org Git - lyx.git/blobdiff - src/graphics/PreviewLoader.C
Add more controls to the view-source dialog.
[lyx.git] / src / graphics / PreviewLoader.C
index 55e2935d659c8b2977d26e389574b8fce9e59087..0ed2ef8c0b5693b3af927f3685d0b78d0b9c3255 100644 (file)
@@ -92,7 +92,8 @@ private:
 
 
 /// Store info on a currently executing, forked process.
-struct InProgress {
+class InProgress {
+public:
        ///
        InProgress() : pid(0) {}
        ///
@@ -122,7 +123,8 @@ typedef InProgressProcesses::value_type InProgressProcess;
 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.
@@ -253,7 +255,8 @@ Buffer const & PreviewLoader::buffer() const
 
 namespace {
 
-struct IncrementedFileName {
+class IncrementedFileName {
+public:
        IncrementedFileName(string const & to_format,
                            string const & filename_base)
                : to_format_(to_format), base_(filename_base), counter_(1)
@@ -317,7 +320,7 @@ PreviewLoader::Impl::Impl(PreviewLoader & p, Buffer const & b)
        : parent_(p), buffer_(b), font_scaling_factor_(0.0)
 {
        font_scaling_factor_ = 0.01 * lyxrc.dpi * lyxrc.zoom *
-               support::strToDbl(lyxrc.preview_scale_factor);
+               convert<double>(lyxrc.preview_scale_factor);
 
        lyxerr[Debug::GRAPHICS] << "The font scaling factor is "
                                << font_scaling_factor_ << endl;
@@ -407,7 +410,8 @@ void PreviewLoader::Impl::add(string const & latex_snippet)
 
 namespace {
 
-struct EraseSnippet {
+class EraseSnippet {
+public:
        EraseSnippet(string const & s) : snippet_(s) {}
        void operator()(InProgressProcess & process)
        {
@@ -494,11 +498,12 @@ void PreviewLoader::Impl::startLoading()
        // The conversion command.
        ostringstream cs;
        cs << pconverter_->command << ' ' << pconverter_->to << ' '
-          << latexfile << ' ' << int(font_scaling_factor_) << ' '
+          << support::quoteName(latexfile) << ' '
+          << int(font_scaling_factor_) << ' '
           << lyx_gui::hexname(LColor::preview) << ' '
           << lyx_gui::hexname(LColor::background);
 
-       string const command = support::LibScriptSearch(cs.str());
+       string const command = support::libScriptSearch(cs.str());
 
        // Initiate the conversion from LaTeX to bitmap images files.
        support::Forkedcall::SignalTypePtr
@@ -587,7 +592,7 @@ void PreviewLoader::Impl::dumpPreamble(ostream & os) const
        runparams.nice = true;
        runparams.moving_arg = true;
        runparams.free_spacing = true;
-       tmp.makeLaTeXFile(os, buffer_.filePath(), runparams, true, false);
+       tmp.writeLaTeXSource(os, buffer_.filePath(), runparams, true, false);
 
        // FIXME! This is a HACK! The proper fix is to control the 'true'
        // passed to WriteStream below:
@@ -649,7 +654,7 @@ string const unique_filename(string const bufferpath)
 {
        static int theCounter = 0;
        string const filename = convert<string>(theCounter++) + "lyxpreview";
-       return support::AddName(bufferpath, filename);
+       return support::addName(bufferpath, filename);
 }