]> git.lyx.org Git - lyx.git/blobdiff - src/exporter.C
fix crash after removing a table row (again due to uncorrected cursor
[lyx.git] / src / exporter.C
index f91d98385558635e551022a38ea9cc548f68a1bc..bf270b5ba7be84af449f5d8b83e1ee1fdf92ec42 100644 (file)
@@ -86,14 +86,14 @@ enum CopyStatus {
 
 /** copy file \p sourceFile to \p destFile. If \p force is false, the user
  *  will be asked before existing files are overwritten.
- *  \return 
+ *  \return
  *  - SUCCESS if this file got copied
  *  - FORCE   if subsequent calls should not ask for confirmation before
  *            overwriting files anymore.
  *  - CANCEL  if the export should be cancelled
  */
 CopyStatus copyFile(string const & sourceFile, string const & destFile,
-                   bool force)
+                   bool force)
 {
        CopyStatus ret = force ? FORCE : SUCCESS;
 
@@ -136,8 +136,6 @@ bool Exporter::Export(Buffer * buffer, string const & format,
        OutputParams runparams;
        runparams.flavor = OutputParams::LATEX;
        runparams.linelen = lyxrc.ascii_linelen;
-       ExportData exportdata;
-       runparams.exportdata = &exportdata;
        vector<string> backends = Backends(*buffer);
        if (find(backends.begin(), backends.end(), format) == backends.end()) {
                for (vector<string>::const_iterator it = backends.begin();
@@ -200,7 +198,8 @@ bool Exporter::Export(Buffer * buffer, string const & format,
                                              formats.extension(format));
                // We need to copy referenced files (e. g. included graphics
                // if format == "dvi") to the result dir.
-               vector<ExportedFile> const files = exportdata.externalFiles(format);
+               vector<ExportedFile> const files =
+                       runparams.exportdata->externalFiles(format);
                string const dest = OnlyPath(result_file);
                CopyStatus status = SUCCESS;
                for (vector<ExportedFile>::const_iterator it = files.begin();
@@ -282,8 +281,8 @@ bool operator==(ExportedFile const & f1, ExportedFile const & f2)
 
 
 void ExportData::addExternalFile(string const & format,
-                                 string const & sourceName,
-                                 string const & exportName)
+                                string const & sourceName,
+                                string const & exportName)
 {
        BOOST_ASSERT(lyx::support::AbsolutePath(sourceName));
 
@@ -297,7 +296,7 @@ void ExportData::addExternalFile(string const & format,
 
 
 void ExportData::addExternalFile(string const & format,
-                                 string const & sourceName)
+                                string const & sourceName)
 {
        addExternalFile(format, sourceName, OnlyFilename(sourceName));
 }