+2006-03-10 Georg Baum <Georg.Baum@post.rwth-aachen.de>
+
+ * QWorkArea.C (getClipboard): convert MAC to UNIX line endings on OSX
+ * QWorkArea.C (putClipboard): convert UNIX to MAC line endings on OSX
+
2006-02-15 Jürgen Spitzmüller <j.spitzmueller@gmx.de>
* QCitationDialog.C (up, down): get rid of the iterator.
#include <Carbon/Carbon.h>
#endif
+#ifdef Q_OS_MAC
+#include <support/lstrings.h>
+
+using lyx::support::subst;
+#endif
using std::endl;
using std::string;
QString str = QApplication::clipboard()->text();
if (str.isNull())
return string();
+#ifdef Q_OS_MAC
+ // The MAC clipboard uses \r for lineendings, and we use \n
+ return subst(fromqstr(str), '\r', '\n');
+#else
return fromqstr(str);
+#endif
}
#if QT_VERSION >= 300
QApplication::clipboard()->setSelectionMode(true);
#endif
+#ifdef Q_OS_MAC
+ // The MAC clipboard uses \r for lineendings, and we use \n
+ QApplication::clipboard()->setText(toqstr(subst(str, '\n', '\r')));
+#else
QApplication::clipboard()->setText(toqstr(str));
+#endif
}
+2006-03-10 Georg Baum <Georg.Baum@post.rwth-aachen.de>
+
+ * QWorkArea.C (getClipboard): convert MAC to UNIX line endings on OSX
+ * QWorkArea.C (putClipboard): convert UNIX to MAC line endings on OSX
+
2006-03-05 Lars Gullik Bjønnes <larsbj@lyx.org>
* add svn:ignore
#include <Carbon/Carbon.h>
#endif
+#ifdef Q_OS_MAC
+#include <support/lstrings.h>
+
+using lyx::support::subst;
+#endif
using std::endl;
using std::string;
lyxerr[Debug::ACTION] << "getClipboard: " << (const char*) str << endl;
if (str.isNull())
return string();
+#ifdef Q_OS_MAC
+ // The MAC clipboard uses \r for lineendings, and we use \n
+ return subst(fromqstr(str), '\r', '\n');
+#else
return fromqstr(str);
+#endif
}
void QWorkArea::putClipboard(string const & str) const
{
+#ifdef Q_OS_MAC
+ // The MAC clipboard uses \r for lineendings, and we use \n
+ QApplication::clipboard()->setText(toqstr(subst(str, '\n', '\r')),
+ QClipboard::Selection);
+#else
QApplication::clipboard()->setText(toqstr(str), QClipboard::Selection);
+#endif
lyxerr[Debug::ACTION] << "putClipboard: " << str << endl;
}