]> git.lyx.org Git - lyx.git/blobdiff - src/graphics/PreviewLoader.cpp
Add context menu for outline operations. Choice of words might not be best.
[lyx.git] / src / graphics / PreviewLoader.cpp
index 32bbed0a7129ae83a1f06742df5aaaaeaafbd22c..67798581f05386db05179cf99af14ad2879be9fb 100644 (file)
 
 #include "support/convert.h"
 #include "support/debug.h"
+#include "support/FileName.h"
 #include "support/filetools.h"
 #include "support/ForkedCalls.h"
 #include "support/lstrings.h"
-#include "support/lyxlib.h"
 
 #include <boost/bind.hpp>
 
@@ -554,7 +554,14 @@ void PreviewLoader::Impl::startLoading()
 
        // we use the encoding of the buffer
        Encoding const & enc = buffer_.params().encoding();
-       odocfstream of(enc.iconvName());
+       odocfstream of;
+       try { of.reset(enc.iconvName()); }
+       catch (iconv_codecvt_facet_exception & e) {
+               LYXERR0("Caught iconv exception: " << e.what()
+                       << "\nUnable to create LaTeX file: " << latexfile);
+               return;
+       }
+
        TexRow texrow;
        OutputParams runparams(&enc);
        LaTeXFeatures features(buffer_, buffer_.params(), runparams);
@@ -701,7 +708,7 @@ void PreviewLoader::Impl::dumpPreamble(odocstream & os) const
 
        for (; it != end; ++it)
                if (it->lyxCode() == MATHMACRO_CODE)
-                       it->latex(buffer_, os, runparams);
+                       it->latex(os, runparams);
 
        // All equation labels appear as "(#)" + preview.sty's rendering of
        // the label name