]> git.lyx.org Git - lyx.git/blobdiff - src/LyXSendto.C
Fixed inset-text border redraw problem and hopefully recalc boostup.
[lyx.git] / src / LyXSendto.C
index 8deb0ad0367217a77ecc67753935027891f97901..881ad276eb148cc2b4a2f4fe37e04e4937652702 100644 (file)
@@ -11,8 +11,8 @@
 #include "lyx_gui_misc.h"
 #include "support/syscall.h"
 #include "gettext.h"
-//#include "lyx_cb.h"
 #include "bufferview_funcs.h"
+#include "exporter.h"
 
 extern FD_form_sendto * fd_form_sendto;
 extern BufferView * current_view;
@@ -36,7 +36,7 @@ void MenuSendto()
         fl_raise_form(fd_form_sendto->form_sendto);
     } else {  
         fl_show_form(fd_form_sendto->form_sendto,
-                     FL_PLACE_MOUSE | FL_FREE_SIZE, FL_FULLBORDER,
+                    FL_PLACE_MOUSE | FL_FREE_SIZE, FL_TRANSIENT,
                      _("Send Document to Command"));
        if (ow < 0) {
                ow = fd_form_sendto->form_sendto->w;
@@ -56,16 +56,6 @@ void SendtoApplyCB(FL_OBJECT *, long)
     if (command.empty())
         return;
     Buffer * buffer = current_view->buffer();
-    if (fl_get_button(fd_form_sendto->radio_ftype_dvi) ||
-        fl_get_button(fd_form_sendto->radio_ftype_ps)) {
-        ProhibitInput(current_view);
-        // Generate dvi file and check if there are errors in the .lyx file
-        if (MakeLaTeXOutput(buffer) > 0) {
-            AllowInput(current_view);
-            return;
-        }
-        AllowInput(current_view);
-    }
     string ftypeext;
     if (fl_get_button(fd_form_sendto->radio_ftype_lyx))
         ftypeext = ".lyx";
@@ -76,14 +66,13 @@ void SendtoApplyCB(FL_OBJECT *, long)
     else if (fl_get_button(fd_form_sendto->radio_ftype_ascii))
         ftypeext = ".txt";
     else {
-        ftypeext = ".ps_tmp";
-        if (!CreatePostscript(buffer, true)) {
-           return;
-       }
+       ftypeext = ".ps";
+       if (!Exporter::Export(buffer, "ps", true))
+               return;
     }
 
-    string fname = OnlyFilename(ChangeExtension(buffer->getLatexName(),
-                                               ftypeext));
+    string const fname = OnlyFilename(ChangeExtension(buffer->getLatexName(),
+                                                     ftypeext));
     if (!contains(command, "$$FName"))
         command = "( " + command + " ) <$$FName";
     command = subst(command, "$$FName", fname);