]> git.lyx.org Git - features.git/commitdiff
fix bug 1955
authorGeorg Baum <Georg.Baum@post.rwth-aachen.de>
Fri, 10 Mar 2006 14:51:28 +0000 (14:51 +0000)
committerGeorg Baum <Georg.Baum@post.rwth-aachen.de>
Fri, 10 Mar 2006 14:51:28 +0000 (14:51 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@13322 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/qt2/ChangeLog
src/frontends/qt2/QWorkArea.C
src/frontends/qt4/ChangeLog
src/frontends/qt4/QWorkArea.C

index 30ffae7e76101be730e81315b2ed5982628a93d9..8894d0e6350228aea3e4aa939e30a6b75678821d 100644 (file)
@@ -1,3 +1,8 @@
+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.
index 6fcd0b617244968b2bce353d5210192d931e0980..0dbefef5e3589bf4d4361fb77d32a0ced54aa025 100644 (file)
 #include <Carbon/Carbon.h>
 #endif
 
+#ifdef Q_OS_MAC
+#include <support/lstrings.h>
+
+using lyx::support::subst;
+#endif
 using std::endl;
 using std::string;
 
@@ -201,7 +206,12 @@ string const QWorkArea::getClipboard() const
        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
 }
 
 
@@ -210,7 +220,12 @@ void QWorkArea::putClipboard(string const & str) const
 #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
 }
 
 
index 8baa0337c13645d5982c5fc2de8ed7d8d2ccf780..0cd7e9f440924afe313dd3d2e939a7b223881492 100644 (file)
@@ -1,3 +1,8 @@
+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
index 25d220a2ef33283b0b8ba22aa2bcaa4b2bd37fce..ded221a92b72449c8fdeaaf6f60ebd8a8e1dc38c 100644 (file)
 #include <Carbon/Carbon.h>
 #endif
 
+#ifdef Q_OS_MAC
+#include <support/lstrings.h>
+
+using lyx::support::subst;
+#endif
 using std::endl;
 using std::string;
 
@@ -350,13 +355,24 @@ string const QWorkArea::getClipboard() const
        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;
 }