#include <config.h>
#include "GuiSelection.h"
+
#include "qt_helpers.h"
-#include "debug.h"
+#include "support/debug.h"
+#include "support/lstrings.h"
#include <QApplication>
#include <QClipboard>
#include <QString>
-#include "support/lstrings.h"
-using lyx::support::internalLineEnding;
-using lyx::support::externalLineEnding;
-
-using std::endl;
namespace lyx {
namespace frontend {
+using support::internalLineEnding;
+using support::externalLineEnding;
+
+
GuiSelection::GuiSelection()
: selection_supported_(qApp->clipboard()->supportsSelection())
{
- connect(qApp->clipboard(), SIGNAL(dataChanged()),
+ connect(qApp->clipboard(), SIGNAL(selectionChanged()),
this, SLOT(on_dataChanged()));
// initialize clipboard status.
on_dataChanged();
{
QString const str = qApp->clipboard()->text(QClipboard::Selection)
.normalized(QString::NormalizationForm_C);
- LYXERR(Debug::ACTION) << "GuiSelection::get: " << fromqstr(str)
- << endl;
+ LYXERR(Debug::ACTION, "GuiSelection::get: " << str);
if (str.isNull())
return docstring();
void GuiSelection::put(docstring const & str)
{
- LYXERR(Debug::ACTION) << "GuiSelection::put: " << to_utf8(str) << endl;
+ LYXERR(Debug::ACTION, "GuiSelection::put: " << to_utf8(str));
qApp->clipboard()->setText(toqstr(externalLineEnding(str)),
QClipboard::Selection);
if (!selection_supported_)
return true;
+ LYXERR(Debug::ACTION, "GuiSelection::empty: " << text_selection_empty_);
+
return text_selection_empty_;
}