aboutsummaryrefslogtreecommitdiffhomepage
path: root/qt/ScintillaEditBase/ScintillaQt.cpp
diff options
context:
space:
mode:
authornyamatongwe <unknown>2013-05-04 23:38:19 +1000
committernyamatongwe <unknown>2013-05-04 23:38:19 +1000
commitc37c824e3a9f0ef57c5cdd41a42834b55ed78b91 (patch)
treeb709170bd7a00a7d56ace176bf2743f8ec99085f /qt/ScintillaEditBase/ScintillaQt.cpp
parenta06f5a50adf59e79f95b73d5db5a9f8e758f8af7 (diff)
downloadscintilla-mirror-c37c824e3a9f0ef57c5cdd41a42834b55ed78b91.tar.gz
Replacing raw pointers and allocations with std::vector and std::string.
Diffstat (limited to 'qt/ScintillaEditBase/ScintillaQt.cpp')
-rw-r--r--qt/ScintillaEditBase/ScintillaQt.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/qt/ScintillaEditBase/ScintillaQt.cpp b/qt/ScintillaEditBase/ScintillaQt.cpp
index 03e3b42b3..8c6e89e60 100644
--- a/qt/ScintillaEditBase/ScintillaQt.cpp
+++ b/qt/ScintillaEditBase/ScintillaQt.cpp
@@ -339,9 +339,9 @@ void ScintillaQt::PasteFromMode(QClipboard::Mode clipboardMode_)
QString text = clipboard->text(clipboardMode_);
QByteArray utext = BytesForDocument(text);
int len = utext.length();
- char *dest = Document::TransformLineEnds(&len, utext, len, pdoc->eolMode);
+ std::string dest = Document::TransformLineEnds(utext, len, pdoc->eolMode);
SelectionText selText;
- selText.Set(dest, len, pdoc->dbcsCodePage, CharacterSetOfDocument(), isRectangular, false);
+ selText.Copy(dest.c_str(), dest.length(), pdoc->dbcsCodePage, CharacterSetOfDocument(), isRectangular, false);
UndoGroup ug(pdoc);
ClearSelection(multiPasteMode == SC_MULTIPASTE_EACH);
@@ -763,12 +763,10 @@ void ScintillaQt::Drop(const Point &point, const QMimeData *data, bool move)
bool rectangular = IsRectangularInMime(data);
QByteArray bytes = BytesForDocument(text);
int len = bytes.length();
- char *dest = Document::TransformLineEnds(&len, bytes, len, pdoc->eolMode);
+ std::string dest = Document::TransformLineEnds(bytes, len, pdoc->eolMode);
SelectionPosition movePos = SPositionFromLocation(point,
false, false, UserVirtualSpace());
- DropAt(movePos, dest, move, rectangular);
-
- delete []dest;
+ DropAt(movePos, dest.c_str(), move, rectangular);
}