]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetGraphics.cpp
Fix text frame drawing.
[lyx.git] / src / insets / InsetGraphics.cpp
index cfb0e326bb381fe8ada9d911745b8a08a56c9f5f..247268fada8a18f50d9671242b13d739e27bdda9 100644 (file)
@@ -71,12 +71,12 @@ TODO
 #include "Mover.h"
 #include "OutputParams.h"
 #include "sgml.h"
+#include "EmbeddedFiles.h"
 
 #include "frontends/alert.h"
 
 #include "support/convert.h"
 #include "support/filetools.h"
-#include "support/lyxalgo.h" // count
 #include "support/lyxlib.h" // sum
 #include "support/lstrings.h"
 #include "support/os.h"
@@ -85,6 +85,7 @@ TODO
 #include <boost/bind.hpp>
 #include <boost/tuple/tuple.hpp>
 
+#include <algorithm>
 #include <sstream>
 
 
@@ -112,7 +113,6 @@ using support::unzippedFileName;
 
 using std::endl;
 using std::string;
-using std::auto_ptr;
 using std::istringstream;
 using std::ostream;
 using std::ostringstream;
@@ -165,9 +165,9 @@ InsetGraphics::InsetGraphics(InsetGraphics const & ig)
 }
 
 
-auto_ptr<Inset> InsetGraphics::doClone() const
+Inset * InsetGraphics::clone() const
 {
-       return auto_ptr<Inset>(new InsetGraphics(*this));
+       return new InsetGraphics(*this);
 }
 
 
@@ -181,7 +181,7 @@ void InsetGraphics::doDispatch(Cursor & cur, FuncRequest & cmd)
 {
        switch (cmd.action) {
        case LFUN_GRAPHICS_EDIT: {
-               Buffer const & buffer = *cur.bv().buffer();
+               Buffer const & buffer = cur.bv().buffer();
                InsetGraphicsParams p;
                InsetGraphicsMailer::string2params(to_utf8(cmd.argument()), buffer, p);
                editGraphics(p, buffer);
@@ -231,6 +231,14 @@ bool InsetGraphics::getStatus(Cursor & cur, FuncRequest const & cmd,
 }
 
 
+void InsetGraphics::registerEmbeddedFiles(Buffer const &,
+       EmbeddedFiles & files, ParConstIterator const & pit) const
+{
+       files.registerFile(params().filename.absFilename(), 
+               EmbeddedFile::AUTO, pit);
+}
+
+
 void InsetGraphics::edit(Cursor & cur, bool)
 {
        InsetGraphicsMailer(*this).showDialog(&cur.bv());
@@ -823,7 +831,7 @@ int InsetGraphics::latex(Buffer const & buf, odocstream & os,
        LYXERR(Debug::GRAPHICS) << "InsetGraphics::latex outputting:\n"
                                << latex_str << endl;
        // Return how many newlines we issued.
-       return int(lyx::count(latex_str.begin(), latex_str.end(),'\n'));
+       return int(std::count(latex_str.begin(), latex_str.end(),'\n'));
 }