]> git.lyx.org Git - lyx.git/blobdiff - src/insets/render_preview.C
hopefully fix tex2lyx linking.
[lyx.git] / src / insets / render_preview.C
index f7ebd00a0a35767ac9cacb6ac4f40cc3645ea291..21ce5c58b68c33c273ca0ec96d8b2c679cae1818 100644 (file)
 
 #include <boost/bind.hpp>
 
-using lyx::docstring;
+
+namespace lyx {
 
 using std::string;
 using std::auto_ptr;
 
-namespace graphics = lyx::graphics;
-namespace support  = lyx::support;
-
 
 LyXRC_PreviewStatus RenderPreview::status()
 {
@@ -76,7 +74,7 @@ graphics::PreviewLoader & getPreviewLoader(Buffer const & buffer)
 }
 
 
-string const statusMessage(BufferView const * bv, string const & snippet)
+docstring const statusMessage(BufferView const * bv, string const & snippet)
 {
        BOOST_ASSERT(bv && bv->buffer());
 
@@ -98,8 +96,7 @@ string const statusMessage(BufferView const * bv, string const & snippet)
                break;
        }
 
-       // FIXME UNICODE
-       return lyx::to_utf8(message);
+       return message;
 }
 
 } // namespace anon
@@ -131,8 +128,7 @@ void RenderPreview::metrics(MetricsInfo & mi, Dimension & dim) const
                LyXFont font(mi.base.font);
                font.setFamily(LyXFont::SANS_FAMILY);
                font.setSize(LyXFont::SIZE_FOOTNOTE);
-               // FIXME UNICODE
-               docstring const stat = lyx::from_utf8(statusMessage(mi.base.bv, snippet_));
+               docstring const stat = statusMessage(mi.base.bv, snippet_);
                dim.wid = 15 + theFontMetrics(font).width(stat);
        }
 
@@ -165,8 +161,7 @@ void RenderPreview::draw(PainterInfo & pi, int x, int y) const
                font.setFamily(LyXFont::SANS_FAMILY);
                font.setSize(LyXFont::SIZE_FOOTNOTE);
 
-               // FIXME UNICODE
-               docstring const stat = lyx::from_utf8(statusMessage(pi.base.bv, snippet_));
+               docstring const stat = statusMessage(pi.base.bv, snippet_);
                pi.pain.text(x + offset + 6,
                             y - theFontMetrics(font).maxAscent() - 4,
                             stat, font);
@@ -203,7 +198,7 @@ void RenderPreview::addPreview(docstring const & latex_snippet,
 
        // FIXME UNICODE
        // We have to make sure that we call latex with the right encoding
-       snippet_ = support::trim(lyx::to_utf8(latex_snippet));
+       snippet_ = support::trim(to_utf8(latex_snippet));
        if (snippet_.empty())
                return;
 
@@ -266,3 +261,5 @@ RenderMonitoredPreview::fileChanged(slot_type const & slot)
 {
        return monitor_.connect(slot);
 }
+
+} // namespace lyx