]> git.lyx.org Git - lyx.git/blob - src/frontends/controllers/ControlShowFile.cpp
fix scrolling bug: 3320 and 3652, maybe not perfect
[lyx.git] / src / frontends / controllers / ControlShowFile.cpp
1 /**
2  * \file ControlShowFile.cpp
3  * This file is part of LyX, the document processor.
4  * Licence details can be found in the file COPYING.
5  *
6  * \author Herbert Voß
7  *
8  * Full author contact details are available in file CREDITS.
9  */
10
11 #include <config.h>
12
13 #include "ControlShowFile.h"
14
15 #include "support/filetools.h"
16
17 using std::string;
18
19 namespace lyx {
20
21 using support::FileName;
22 using support::onlyFilename;
23
24 namespace frontend {
25
26
27 ControlShowFile::ControlShowFile(Dialog & parent)
28         : Dialog::Controller(parent)
29 {}
30
31
32 bool ControlShowFile::initialiseParams(string const & data)
33 {
34         filename_ = FileName(data);
35         return true;
36 }
37
38
39 void ControlShowFile::clearParams()
40 {
41         filename_.erase();
42 }
43
44
45 string ControlShowFile::getFileContents()
46 {
47         return support::getFileContents(filename_);
48 }
49
50
51 string ControlShowFile::getFileName()
52 {
53         return onlyFilename(filename_.absFilename());
54 }
55
56 } // namespace frontend
57 } // namespace lyx