diff options
author | nyamatongwe <devnull@localhost> | 2013-05-26 18:23:09 +1000 |
---|---|---|
committer | nyamatongwe <devnull@localhost> | 2013-05-26 18:23:09 +1000 |
commit | 8e023d0ca853019b90d0dcb02533eab32f7e6e79 (patch) | |
tree | 91bc7d85c68a826653417ee942177db2a857f866 /qt/ScintillaEditBase/ScintillaQt.cpp | |
parent | 0168d3feab947066c2e9cfba3140f0a24be1b5fc (diff) | |
download | scintilla-mirror-8e023d0ca853019b90d0dcb02533eab32f7e6e79.tar.gz |
Switch SelectionText to use a std::string to hold the data and to provide accessors to this data.
Add a length argument to DropAt, although previous signature still available.
Diffstat (limited to 'qt/ScintillaEditBase/ScintillaQt.cpp')
-rw-r--r-- | qt/ScintillaEditBase/ScintillaQt.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/qt/ScintillaEditBase/ScintillaQt.cpp b/qt/ScintillaEditBase/ScintillaQt.cpp index 8c6e89e60..4d0d62082 100644 --- a/qt/ScintillaEditBase/ScintillaQt.cpp +++ b/qt/ScintillaEditBase/ScintillaQt.cpp @@ -171,11 +171,11 @@ bool ScintillaQt::DragThreshold(Point ptStart, Point ptNow) static QString StringFromSelectedText(const SelectionText &selectedText) { if (selectedText.codePage == SC_CP_UTF8) { - return QString::fromUtf8(selectedText.s, selectedText.len-1); + return QString::fromUtf8(selectedText.Data(), selectedText.Length()); } else { QTextCodec *codec = QTextCodec::codecForName( CharacterSetID(selectedText.characterSet)); - return codec->toUnicode(selectedText.s, selectedText.len-1); + return codec->toUnicode(selectedText.Data(), selectedText.Length()); } } @@ -341,7 +341,7 @@ void ScintillaQt::PasteFromMode(QClipboard::Mode clipboardMode_) int len = utext.length(); std::string dest = Document::TransformLineEnds(utext, len, pdoc->eolMode); SelectionText selText; - selText.Copy(dest.c_str(), dest.length(), pdoc->dbcsCodePage, CharacterSetOfDocument(), isRectangular, false); + selText.Copy(dest, pdoc->dbcsCodePage, CharacterSetOfDocument(), isRectangular, false); UndoGroup ug(pdoc); ClearSelection(multiPasteMode == SC_MULTIPASTE_EACH); @@ -349,9 +349,9 @@ void ScintillaQt::PasteFromMode(QClipboard::Mode clipboardMode_) sel.Rectangular().Start() : sel.Range(sel.Main()).Start(); if (selText.rectangular) { - PasteRectangular(selStart, selText.s, selText.len); + PasteRectangular(selStart, selText.Data(), selText.Length()); } else { - InsertPaste(selStart, selText.s, selText.len); + InsertPaste(selStart, selText.Data(), selText.Length()); } EnsureCaretVisible(); } @@ -613,7 +613,7 @@ void ScintillaQt::StartDrag() { inDragDrop = ddDragging; dropWentOutside = true; - if (drag.len) { + if (drag.Length()) { QMimeData *mimeData = new QMimeData; QString sText = StringFromSelectedText(drag); mimeData->setText(sText); @@ -768,5 +768,5 @@ void ScintillaQt::Drop(const Point &point, const QMimeData *data, bool move) SelectionPosition movePos = SPositionFromLocation(point, false, false, UserVirtualSpace()); - DropAt(movePos, dest.c_str(), move, rectangular); + DropAt(movePos, dest.c_str(), dest.length(), move, rectangular); } |