]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetGraphics.cpp
Enhancements and bugfixes to the TOCs
[lyx.git] / src / insets / InsetGraphics.cpp
index b3293ce37c8c48312a210a1bf2371e71577518b6..c20f0314abd27ca559e244a2be56d4960fa32431 100644 (file)
@@ -310,8 +310,11 @@ string InsetGraphics::createLatexOptions() const
        // stream since we might have a trailing comma that we would like to remove
        // before writing it to the output stream.
        ostringstream options;
-       if (!params().bb.empty())
-           options << "bb=" << rtrim(params().bb) << ',';
+       if (!params().bbox.empty())
+               options << "bb=" << params().bbox.xl.asLatexString() << ' '
+                       << params().bbox.yb.asLatexString() << ' '
+                       << params().bbox.xr.asLatexString() << ' '
+                       << params().bbox.yt.asLatexString() << ',';
        if (params().draft)
            options << "draft,";
        if (params().clip)
@@ -500,7 +503,7 @@ copyToDirIfNeeded(DocFileName const & file, string const & dir)
 {
        string const file_in = file.absFileName();
        string const only_path = onlyPath(file_in);
-       if (rtrim(onlyPath(file_in) , "/") == rtrim(dir, "/"))
+       if (rtrim(only_path, "/") == rtrim(dir, "/"))
                return make_pair(IDENTICAL_PATHS, FileName(file_in));
 
        string mangled = file.mangledFileName();
@@ -734,7 +737,7 @@ void InsetGraphics::latex(otexstream & os,
                        && params().filename.isReadableFile();
        string message;
        if (!file_exists) {
-               if (params().bb.empty())
+               if (params().bbox.empty())
                    message = "bb = 0 0 200 100";
                if (!params().draft) {
                        if (!message.empty())
@@ -1024,11 +1027,12 @@ void InsetGraphics::editGraphics(InsetGraphicsParams const & p) const
 }
 
 
-void InsetGraphics::addToToc(DocIterator const & cpit, bool output_active) const
+void InsetGraphics::addToToc(DocIterator const & cpit, bool output_active,
+                                                        UpdateType) const
 {
        //FIXME UNICODE
        docstring const str = from_utf8(params_.filename.onlyFileName());
-       buffer().tocBackend().toc("graphics").push_back(TocItem(cpit, 0, str, output_active));
+       buffer().tocBackend().toc("graphics")->push_back(TocItem(cpit, 0, str, output_active));
 }