diff options
| author | nyamatongwe <unknown> | 2013-05-26 18:23:09 +1000 | 
|---|---|---|
| committer | nyamatongwe <unknown> | 2013-05-26 18:23:09 +1000 | 
| commit | 25ff1ad0d0811ba9167580bcc6d3587f75efae3f (patch) | |
| tree | 28bdb8a91e1c752bfa50505015b82472f5fcf5a2 /qt/ScintillaEditBase/ScintillaQt.cpp | |
| parent | 501509cbec9a2746f84416a0cbe715bc7a504474 (diff) | |
| download | scintilla-mirror-25ff1ad0d0811ba9167580bcc6d3587f75efae3f.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);  }  | 
