fix bug 1955

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@13322 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Georg Baum 2006-03-10 14:51:28 +00:00
parent 9f2c265640
commit f02a98497d
4 changed files with 41 additions and 0 deletions

View 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.

View File

@ -35,6 +35,11 @@
#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
}

View 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

View File

@ -43,6 +43,11 @@
#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;
}