]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/controllers/ControlPrint.C
This file is part of LyX, the document processor.
[lyx.git] / src / frontends / controllers / ControlPrint.C
index 8e5ba18f4f8a63899a957a24e445255fe959e668..cd4339cb988ca8610b2709ea6e46e69b2fb4ea24 100644 (file)
@@ -1,14 +1,11 @@
-/* This file is part of
- * ======================================================
- *
- *           LyX, The Document Processor
- *
- *          Copyright 2001 The LyX Team.
+/**
+ * \file ControlPrint.C
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
  *
- *======================================================
+ * \author Angus Leeming
  *
- * \file ControlPrint.C
- * \author Angus Leeming, a.leeming@.ac.uk
+ * Full author contact details are available in file CREDITS
  */
 
 #include <config.h>
 #endif
 
 #include "ControlPrint.h"
+
 #include "ViewBase.h"
 #include "ButtonControllerBase.h"
+
 #include "buffer.h"
-#include "frontends/LyXView.h"
-#include "PrinterParams.h"
-#include "Liason.h"
+#include "gettext.h"
 #include "helper_funcs.h"
+#include "PrinterParams.h"
+
 #include "frontends/Alert.h"
-#include "gettext.h"
-#include "BufferView.h"
+#include "frontends/Liason.h"
+
 #include "support/LAssert.h"
 
 using Liason::printBuffer;
@@ -42,12 +41,12 @@ ControlPrint::ControlPrint(LyXView & lv, Dialogs & d)
 
 void ControlPrint::apply()
 {
-       if (!lv_.view()->available())
+       if (!bufferIsAvailable())
                return;
 
        view().apply();
 
-       if (!printBuffer(lv_.buffer(), params())) {
+       if (!printBuffer(buffer(), params())) {
                Alert::alert(_("Error:"),
                           _("Unable to print"),
                           _("Check that your parameters are correct"));
@@ -65,7 +64,7 @@ PrinterParams & ControlPrint::params() const
 void ControlPrint::setParams()
 {
        if (params_) delete params_;
-       params_ = new PrinterParams(getPrinterParams(lv_.buffer()));
+       params_ = new PrinterParams(getPrinterParams(buffer()));
 
        bc().valid(); // so that the user can press Ok
 }
@@ -86,6 +85,6 @@ string const ControlPrint::Browse(string const & in_name)
        string const pattern = "*.ps";
 
        // Show the file browser dialog
-       return browseRelFile(&lv_, in_name, lv_.buffer()->filePath(),
+       return browseRelFile(&lv_, in_name, buffer()->filePath(),
                             title, pattern);
 }