diff options
author | Neil <devnull@localhost> | 2014-02-10 15:04:34 +1100 |
---|---|---|
committer | Neil <devnull@localhost> | 2014-02-10 15:04:34 +1100 |
commit | ccaa21bceada0888ab7d42dc2b9ea1bd0a398051 (patch) | |
tree | 85e4fdd30229ec8fa79a821c21fc3f6d7ea4f423 /qt/ScintillaEditBase/ScintillaQt.cpp | |
parent | 8cc2588dfc02fc3d9ddd1f2c9da5e3a381f56499 (diff) | |
download | scintilla-mirror-ccaa21bceada0888ab7d42dc2b9ea1bd0a398051.tar.gz |
Fix 'possible loss of data' warnings on 64-bit Windows.
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 2e3b9a0a5..03218cf34 100644 --- a/qt/ScintillaEditBase/ScintillaQt.cpp +++ b/qt/ScintillaEditBase/ScintillaQt.cpp @@ -172,11 +172,11 @@ bool ScintillaQt::DragThreshold(Point ptStart, Point ptNow) static QString StringFromSelectedText(const SelectionText &selectedText) { if (selectedText.codePage == SC_CP_UTF8) { - return QString::fromUtf8(selectedText.Data(), selectedText.Length()); + return QString::fromUtf8(selectedText.Data(), static_cast<int>(selectedText.Length())); } else { QTextCodec *codec = QTextCodec::codecForName( CharacterSetID(selectedText.characterSet)); - return codec->toUnicode(selectedText.Data(), selectedText.Length()); + return codec->toUnicode(selectedText.Data(), static_cast<int>(selectedText.Length())); } } @@ -350,9 +350,9 @@ void ScintillaQt::PasteFromMode(QClipboard::Mode clipboardMode_) sel.Rectangular().Start() : sel.Range(sel.Main()).Start(); if (selText.rectangular) { - PasteRectangular(selStart, selText.Data(), selText.Length()); + PasteRectangular(selStart, selText.Data(), static_cast<int>(selText.Length())); } else { - InsertPaste(selStart, selText.Data(), selText.Length()); + InsertPaste(selStart, selText.Data(), static_cast<int>(selText.Length())); } EnsureCaretVisible(); } @@ -502,7 +502,7 @@ public: folded[0] = mapping[static_cast<unsigned char>(mixed[0])]; return 1; } else if (codec) { - QString su = codec->toUnicode(mixed, lenMixed); + QString su = codec->toUnicode(mixed, static_cast<int>(lenMixed)); QString suFolded = su.toCaseFolded(); QByteArray bytesFolded = codec->fromUnicode(suFolded); @@ -555,14 +555,14 @@ std::string ScintillaQt::CaseMapString(const std::string &s, int caseMapping) if (IsUnicodeMode()) { std::string retMapped(s.length() * maxExpansionCaseConversion, 0); - size_t lenMapped = CaseConvertString(&retMapped[0], retMapped.length(), s.c_str(), s.length(), + size_t lenMapped = CaseConvertString(&retMapped[0], retMapped.length(), s.c_str(), s.length(), (caseMapping == cmUpper) ? CaseConversionUpper : CaseConversionLower); retMapped.resize(lenMapped); return retMapped; } QTextCodec *codec = QTextCodec::codecForName(CharacterSetIDOfDocument()); - QString text = codec->toUnicode(s.c_str(), s.length()); + QString text = codec->toUnicode(s.c_str(), static_cast<int>(s.length())); if (caseMapping == cmUpper) { text = text.toUpper(); |