]> git.lyx.org Git - lyx.git/blobdiff - src/insets/RenderGraphic.cpp
Fix text frame drawing.
[lyx.git] / src / insets / RenderGraphic.cpp
index a04b7cad2ac4c5cb7e5981eacd32ddd6b4361687..ec0789957b1737e8d3e83bca262ae7ca75438380 100644 (file)
@@ -35,7 +35,6 @@ namespace lyx {
 using support::onlyFilename;
 
 using std::string;
-using std::auto_ptr;
 
 
 RenderGraphic::RenderGraphic(Inset const * inset)
@@ -56,9 +55,9 @@ RenderGraphic::RenderGraphic(RenderGraphic const & other,
 }
 
 
-auto_ptr<RenderBase> RenderGraphic::clone(Inset const * inset) const
+RenderBase * RenderGraphic::clone(Inset const * inset) const
 {
-       return auto_ptr<RenderBase>(new RenderGraphic(*this, inset));
+       return new RenderGraphic(*this, inset);
 }
 
 
@@ -153,21 +152,21 @@ bool RenderGraphic::metrics(MetricsInfo & mi, Dimension & dim) const
        } else {
                int font_width = 0;
 
-               LyXFont msgFont(mi.base.font);
-               msgFont.setFamily(LyXFont::SANS_FAMILY);
+               Font msgFont(mi.base.font);
+               msgFont.setFamily(Font::SANS_FAMILY);
 
                // FIXME UNICODE
-               docstring const justname = 
+               docstring const justname =
                        from_utf8(onlyFilename(params_.filename.absFilename()));
                if (!justname.empty()) {
-                       msgFont.setSize(LyXFont::SIZE_FOOTNOTE);
+                       msgFont.setSize(Font::SIZE_FOOTNOTE);
                        font_width = theFontMetrics(msgFont)
                                .width(justname);
                }
 
                docstring const msg = statusMessage(params_, loader_.status());
                if (!msg.empty()) {
-                       msgFont.setSize(LyXFont::SIZE_TINY);
+                       msgFont.setSize(Font::SIZE_TINY);
                        font_width = std::max(font_width,
                                theFontMetrics(msgFont).width(msg));
                }
@@ -208,12 +207,12 @@ void RenderGraphic::draw(PainterInfo & pi, int x, int y) const
                                  Color::foreground);
 
                // Print the file name.
-               LyXFont msgFont = pi.base.font;
-               msgFont.setFamily(LyXFont::SANS_FAMILY);
+               Font msgFont = pi.base.font;
+               msgFont.setFamily(Font::SANS_FAMILY);
                string const justname = onlyFilename(params_.filename.absFilename());
 
                if (!justname.empty()) {
-                       msgFont.setSize(LyXFont::SIZE_FOOTNOTE);
+                       msgFont.setSize(Font::SIZE_FOOTNOTE);
                        pi.pain.text(x + Inset::TEXT_TO_INSET_OFFSET + 6,
                                   y - theFontMetrics(msgFont).maxAscent() - 4,
                                   from_utf8(justname), msgFont);
@@ -222,7 +221,7 @@ void RenderGraphic::draw(PainterInfo & pi, int x, int y) const
                // Print the message.
                docstring const msg = statusMessage(params_, loader_.status());
                if (!msg.empty()) {
-                       msgFont.setSize(LyXFont::SIZE_TINY);
+                       msgFont.setSize(Font::SIZE_TINY);
                        pi.pain.text(x + Inset::TEXT_TO_INSET_OFFSET + 6,
                                     y - 4, msg, msgFont);
                }