diff options
author | Neil Hodgson <nyamatongwe@gmail.com> | 2018-04-22 08:29:01 +1000 |
---|---|---|
committer | Neil Hodgson <nyamatongwe@gmail.com> | 2018-04-22 08:29:01 +1000 |
commit | dc7c28cfcf21c18f96a49f2cc0818d4f676bd301 (patch) | |
tree | 80b3dd322f359066f0b149a749ed8629a97e4184 /cocoa/ScintillaView.mm | |
parent | 23ef8619d029b9edbe0f19212a6b3954b9f79874 (diff) | |
download | scintilla-mirror-dc7c28cfcf21c18f96a49f2cc0818d4f676bd301.tar.gz |
Fix problems with 64-bit positions by using types that expand to 64-bits and
removing casts to int.
Diffstat (limited to 'cocoa/ScintillaView.mm')
-rw-r--r-- | cocoa/ScintillaView.mm | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/cocoa/ScintillaView.mm b/cocoa/ScintillaView.mm index c19c976f7..aad9b0c9a 100644 --- a/cocoa/ScintillaView.mm +++ b/cocoa/ScintillaView.mm @@ -600,7 +600,7 @@ static NSCursor *cursorFromEnum(Window::Cursor cursor) { NSRange posRangeCurrent = mOwner.backend->PositionsFromCharacters(NSMakeRange(replacementRange.location, 0)); // Note: Scintilla internally works almost always with bytes instead chars, so we need to take // this into account when determining selection ranges and such. - int lengthInserted = mOwner.backend->InsertText(newText); + ptrdiff_t lengthInserted = mOwner.backend->InsertText(newText); posRangeCurrent.length = lengthInserted; mMarkedTextRange = mOwner.backend->CharactersFromPositions(posRangeCurrent); // Mark the just inserted text. Keep the marked range for later reset. @@ -941,7 +941,7 @@ static NSCursor *cursorFromEnum(Window::Cursor cursor) { */ - (id) accessibilityValue { const sptr_t length = [mOwner message: SCI_GETLENGTH]; - return mOwner.backend->RangeTextAsString(NSMakeRange(0, static_cast<int>(length))); + return mOwner.backend->RangeTextAsString(NSMakeRange(0, length)); } //-------------------------------------------------------------------------------------------------- @@ -950,7 +950,7 @@ static NSCursor *cursorFromEnum(Window::Cursor cursor) { * NSAccessibility : Line of the caret. */ - (NSInteger) accessibilityInsertionPointLineNumber { - const int caret = static_cast<int>([mOwner message: SCI_GETCURRENTPOS]); + const Sci::Position caret = [mOwner message: SCI_GETCURRENTPOS]; const NSRange rangeCharactersCaret = mOwner.backend->CharactersFromPositions(NSMakeRange(caret, 0)); return mOwner.backend->VisibleLineForIndex(rangeCharactersCaret.location); } |