Remove more conversion from Scintilla

This commit is contained in:
Don Ho 2022-01-16 23:58:27 +01:00
parent 5f4c2edb2e
commit b0e19a786e
19 changed files with 84 additions and 84 deletions

View File

@ -2582,8 +2582,8 @@ bool Notepad_plus::braceMatch()
if (_pEditView->isShownIndentGuide()) if (_pEditView->isShownIndentGuide())
{ {
int columnAtCaret = int(_pEditView->execute(SCI_GETCOLUMN, braceAtCaret)); INT_PTR columnAtCaret = _pEditView->execute(SCI_GETCOLUMN, braceAtCaret);
int columnOpposite = int(_pEditView->execute(SCI_GETCOLUMN, braceOpposite)); INT_PTR columnOpposite = _pEditView->execute(SCI_GETCOLUMN, braceOpposite);
_pEditView->execute(SCI_SETHIGHLIGHTGUIDE, (columnAtCaret < columnOpposite)?columnAtCaret:columnOpposite); _pEditView->execute(SCI_SETHIGHLIGHTGUIDE, (columnAtCaret < columnOpposite)?columnAtCaret:columnOpposite);
} }
} }

View File

@ -502,7 +502,7 @@ private:
void addHotSpot(ScintillaEditView* view = NULL); void addHotSpot(ScintillaEditView* view = NULL);
void bookmarkAdd(int lineno) const { void bookmarkAdd(INT_PTR lineno) const {
if (lineno == -1) if (lineno == -1)
lineno = static_cast<int32_t>(_pEditView->getCurrentLineNumber()); lineno = static_cast<int32_t>(_pEditView->getCurrentLineNumber());
if (!bookmarkPresent(lineno)) if (!bookmarkPresent(lineno))
@ -523,7 +523,7 @@ private:
return ((state & (1 << MARK_BOOKMARK)) != 0); return ((state & (1 << MARK_BOOKMARK)) != 0);
} }
void bookmarkToggle(int lineno) const { void bookmarkToggle(INT_PTR lineno) const {
if (lineno == -1) if (lineno == -1)
lineno = static_cast<int32_t>(_pEditView->getCurrentLineNumber()); lineno = static_cast<int32_t>(_pEditView->getCurrentLineNumber());

View File

@ -589,7 +589,7 @@ BOOL Notepad_plus::notify(SCNotification *notification)
else if (notification->nmhdr.hwndFrom == _subEditView.getHSelf()) else if (notification->nmhdr.hwndFrom == _subEditView.getHSelf())
switchEditViewTo(SUB_VIEW); switchEditViewTo(SUB_VIEW);
int lineClick = int(_pEditView->execute(SCI_LINEFROMPOSITION, notification->position)); INT_PTR lineClick = _pEditView->execute(SCI_LINEFROMPOSITION, notification->position);
if (notification->margin == ScintillaEditView::_SC_MARGE_FOLDER) if (notification->margin == ScintillaEditView::_SC_MARGE_FOLDER)
{ {

View File

@ -3290,15 +3290,15 @@ void NppParameters::writeSession(const Session & session, const TCHAR *fileName)
(fileNameNode->ToElement())->SetAttribute(TEXT("originalFileLastModifTimestampHigh"), static_cast<int32_t>(viewSessionFiles[i]._originalFileLastModifTimestamp.dwHighDateTime)); (fileNameNode->ToElement())->SetAttribute(TEXT("originalFileLastModifTimestampHigh"), static_cast<int32_t>(viewSessionFiles[i]._originalFileLastModifTimestamp.dwHighDateTime));
// docMap // docMap
(fileNameNode->ToElement())->SetAttribute(TEXT("mapFirstVisibleDisplayLine"), viewSessionFiles[i]._mapPos._firstVisibleDisplayLine); (fileNameNode->ToElement())->SetAttribute(TEXT("mapFirstVisibleDisplayLine"), (int)viewSessionFiles[i]._mapPos._firstVisibleDisplayLine);
(fileNameNode->ToElement())->SetAttribute(TEXT("mapFirstVisibleDocLine"), viewSessionFiles[i]._mapPos._firstVisibleDocLine); (fileNameNode->ToElement())->SetAttribute(TEXT("mapFirstVisibleDocLine"), (int)viewSessionFiles[i]._mapPos._firstVisibleDocLine);
(fileNameNode->ToElement())->SetAttribute(TEXT("mapLastVisibleDocLine"), viewSessionFiles[i]._mapPos._lastVisibleDocLine); (fileNameNode->ToElement())->SetAttribute(TEXT("mapLastVisibleDocLine"), (int)viewSessionFiles[i]._mapPos._lastVisibleDocLine);
(fileNameNode->ToElement())->SetAttribute(TEXT("mapNbLine"), viewSessionFiles[i]._mapPos._nbLine); (fileNameNode->ToElement())->SetAttribute(TEXT("mapNbLine"), (int)viewSessionFiles[i]._mapPos._nbLine);
(fileNameNode->ToElement())->SetAttribute(TEXT("mapHigherPos"), viewSessionFiles[i]._mapPos._higherPos); (fileNameNode->ToElement())->SetAttribute(TEXT("mapHigherPos"), (int)viewSessionFiles[i]._mapPos._higherPos);
(fileNameNode->ToElement())->SetAttribute(TEXT("mapWidth"), viewSessionFiles[i]._mapPos._width); (fileNameNode->ToElement())->SetAttribute(TEXT("mapWidth"), (int)viewSessionFiles[i]._mapPos._width);
(fileNameNode->ToElement())->SetAttribute(TEXT("mapHeight"), viewSessionFiles[i]._mapPos._height); (fileNameNode->ToElement())->SetAttribute(TEXT("mapHeight"), (int)viewSessionFiles[i]._mapPos._height);
(fileNameNode->ToElement())->SetAttribute(TEXT("mapKByteInDoc"), static_cast<int>(viewSessionFiles[i]._mapPos._KByteInDoc)); (fileNameNode->ToElement())->SetAttribute(TEXT("mapKByteInDoc"), (int)viewSessionFiles[i]._mapPos._KByteInDoc);
(fileNameNode->ToElement())->SetAttribute(TEXT("mapWrapIndentMode"), viewSessionFiles[i]._mapPos._wrapIndentMode); (fileNameNode->ToElement())->SetAttribute(TEXT("mapWrapIndentMode"), (int)viewSessionFiles[i]._mapPos._wrapIndentMode);
fileNameNode->ToElement()->SetAttribute(TEXT("mapIsWrap"), viewSessionFiles[i]._mapPos._isWrap ? TEXT("yes") : TEXT("no")); fileNameNode->ToElement()->SetAttribute(TEXT("mapIsWrap"), viewSessionFiles[i]._mapPos._isWrap ? TEXT("yes") : TEXT("no"));
for (size_t j = 0, len = viewSessionFiles[i]._marks.size() ; j < len ; ++j) for (size_t j = 0, len = viewSessionFiles[i]._marks.size() ; j < len ; ++j)

View File

@ -156,24 +156,24 @@ struct Position
struct MapPosition struct MapPosition
{ {
int32_t _firstVisibleDisplayLine = -1; INT_PTR _firstVisibleDisplayLine = -1;
int32_t _firstVisibleDocLine = -1; // map INT_PTR _firstVisibleDocLine = -1; // map
int32_t _lastVisibleDocLine = -1; // map INT_PTR _lastVisibleDocLine = -1; // map
int32_t _nbLine = -1; // map INT_PTR _nbLine = -1; // map
int32_t _higherPos = -1; // map INT_PTR _higherPos = -1; // map
int32_t _width = -1; INT_PTR _width = -1;
int32_t _height = -1; INT_PTR _height = -1;
int32_t _wrapIndentMode = -1; INT_PTR _wrapIndentMode = -1;
int64_t _KByteInDoc = _maxPeekLenInKB; INT_PTR _KByteInDoc = _maxPeekLenInKB;
bool _isWrap = false; bool _isWrap = false;
bool isValid() const { return (_firstVisibleDisplayLine != -1); }; bool isValid() const { return (_firstVisibleDisplayLine != -1); };
bool canScroll() const { return (_KByteInDoc < _maxPeekLenInKB); }; // _nbCharInDoc < _maxPeekLen : Don't scroll the document for the performance issue bool canScroll() const { return (_KByteInDoc < _maxPeekLenInKB); }; // _nbCharInDoc < _maxPeekLen : Don't scroll the document for the performance issue
private: private:
int64_t _maxPeekLenInKB = 512; // 512 KB INT_PTR _maxPeekLenInKB = 512; // 512 KB
}; };

View File

@ -47,8 +47,8 @@ bool AutoCompletion::showApiComplete()
return false; return false;
// calculate entered word's length // calculate entered word's length
int curPos = int(_pEditView->execute(SCI_GETCURRENTPOS)); INT_PTR curPos = _pEditView->execute(SCI_GETCURRENTPOS);
int startPos = int(_pEditView->execute(SCI_WORDSTARTPOSITION, curPos, true)); INT_PTR startPos = _pEditView->execute(SCI_WORDSTARTPOSITION, curPos, true);
if (curPos == startPos) if (curPos == startPos)
return false; return false;
@ -160,7 +160,7 @@ void AutoCompletion::getWordArray(vector<generic_string> & wordArray, TCHAR *beg
expr += beginChars; expr += beginChars;
expr += TEXT("[^ \\t\\n\\r.,;:\"(){}=<>'+!?\\[\\]]+"); expr += TEXT("[^ \\t\\n\\r.,;:\"(){}=<>'+!?\\[\\]]+");
int docLength = int(_pEditView->execute(SCI_GETLENGTH)); size_t docLength = _pEditView->execute(SCI_GETLENGTH);
int flags = SCFIND_WORDSTART | SCFIND_MATCHCASE | SCFIND_REGEXP | SCFIND_POSIX; int flags = SCFIND_WORDSTART | SCFIND_MATCHCASE | SCFIND_REGEXP | SCFIND_POSIX;
@ -169,8 +169,8 @@ void AutoCompletion::getWordArray(vector<generic_string> & wordArray, TCHAR *beg
while (posFind >= 0) while (posFind >= 0)
{ {
int wordStart = int(_pEditView->execute(SCI_GETTARGETSTART)); INT_PTR wordStart = _pEditView->execute(SCI_GETTARGETSTART);
int wordEnd = int(_pEditView->execute(SCI_GETTARGETEND)); INT_PTR wordEnd = _pEditView->execute(SCI_GETTARGETEND);
size_t foundTextLen = wordEnd - wordStart; size_t foundTextLen = wordEnd - wordStart;
if (foundTextLen < bufSize) if (foundTextLen < bufSize)
@ -280,7 +280,7 @@ void AutoCompletion::showPathCompletion()
{ {
const size_t bufSize = MAX_PATH; const size_t bufSize = MAX_PATH;
TCHAR buf[bufSize + 1]; TCHAR buf[bufSize + 1];
const size_t currentPos = static_cast<size_t>(_pEditView->execute(SCI_GETCURRENTPOS)); const size_t currentPos = _pEditView->execute(SCI_GETCURRENTPOS);
const auto startPos = max(0, currentPos - bufSize); const auto startPos = max(0, currentPos - bufSize);
_pEditView->getGenericText(buf, bufSize + 1, startPos, currentPos); _pEditView->getGenericText(buf, bufSize + 1, startPos, currentPos);
currentLine = buf; currentLine = buf;
@ -346,9 +346,9 @@ bool AutoCompletion::showWordComplete(bool autoInsert)
{ {
// Get beginning of word and complete word // Get beginning of word and complete word
int curPos = int(_pEditView->execute(SCI_GETCURRENTPOS)); INT_PTR curPos = _pEditView->execute(SCI_GETCURRENTPOS);
int startPos = int(_pEditView->execute(SCI_WORDSTARTPOSITION, curPos, true)); INT_PTR startPos = _pEditView->execute(SCI_WORDSTARTPOSITION, curPos, true);
int endPos = int(_pEditView->execute(SCI_WORDENDPOSITION, curPos, true)); INT_PTR endPos = _pEditView->execute(SCI_WORDENDPOSITION, curPos, true);
if (curPos == startPos) if (curPos == startPos)
return false; return false;

View File

@ -1894,13 +1894,13 @@ bool FindReplaceDlg::processFindNext(const TCHAR *txt2find, const FindOption *op
stringSizeFind = Searching::convertExtendedToString(txt2find, pText, stringSizeFind); stringSizeFind = Searching::convertExtendedToString(txt2find, pText, stringSizeFind);
} }
int docLength = int((*_ppEditView)->execute(SCI_GETLENGTH)); INT_PTR docLength = (*_ppEditView)->execute(SCI_GETLENGTH);
Sci_CharacterRange cr = (*_ppEditView)->getSelection(); Sci_CharacterRange cr = (*_ppEditView)->getSelection();
//The search "zone" is relative to the selection, so search happens 'outside' //The search "zone" is relative to the selection, so search happens 'outside'
int startPosition = cr.cpMax; INT_PTR startPosition = cr.cpMax;
int endPosition = docLength; INT_PTR endPosition = docLength;
if (pOptions->_whichDirection == DIR_UP) if (pOptions->_whichDirection == DIR_UP)
@ -2038,7 +2038,7 @@ bool FindReplaceDlg::processFindNext(const TCHAR *txt2find, const FindOption *op
} }
start = posFind; start = posFind;
end = int((*_ppEditView)->execute(SCI_GETTARGETEND)); end = (*_ppEditView)->execute(SCI_GETTARGETEND);
setStatusbarMessage(TEXT(""), FSNoMessage); setStatusbarMessage(TEXT(""), FSNoMessage);
@ -3972,7 +3972,7 @@ void Finder::addSearchLine(const TCHAR *searchName)
setFinderReadOnly(false); setFinderReadOnly(false);
_scintView.addGenericText(str.c_str()); _scintView.addGenericText(str.c_str());
setFinderReadOnly(true); setFinderReadOnly(true);
_lastSearchHeaderPos = static_cast<int32_t>(_scintView.execute(SCI_GETCURRENTPOS) - 2); _lastSearchHeaderPos = _scintView.execute(SCI_GETCURRENTPOS) - 2;
_pMainFoundInfos->push_back(EmptyFoundInfo); _pMainFoundInfos->push_back(EmptyFoundInfo);
_pMainMarkings->push_back(EmptySearchResultMarking); _pMainMarkings->push_back(EmptySearchResultMarking);
@ -3987,7 +3987,7 @@ void Finder::addFileNameTitle(const TCHAR * fileName)
setFinderReadOnly(false); setFinderReadOnly(false);
_scintView.addGenericText(str.c_str()); _scintView.addGenericText(str.c_str());
setFinderReadOnly(true); setFinderReadOnly(true);
_lastFileHeaderPos = static_cast<int32_t>(_scintView.execute(SCI_GETCURRENTPOS) - 2); _lastFileHeaderPos = _scintView.execute(SCI_GETCURRENTPOS) - 2;
_pMainFoundInfos->push_back(EmptyFoundInfo); _pMainFoundInfos->push_back(EmptyFoundInfo);
_pMainMarkings->push_back(EmptySearchResultMarking); _pMainMarkings->push_back(EmptySearchResultMarking);

View File

@ -157,8 +157,8 @@ private:
ScintillaEditView _scintView; ScintillaEditView _scintView;
unsigned int _nbFoundFiles = 0; unsigned int _nbFoundFiles = 0;
int _lastFileHeaderPos = 0; INT_PTR _lastFileHeaderPos = 0;
int _lastSearchHeaderPos = 0; INT_PTR _lastSearchHeaderPos = 0;
bool _canBeVolatiled = true; bool _canBeVolatiled = true;
bool _longLinesAreWrapped = false; bool _longLinesAreWrapped = false;

View File

@ -89,7 +89,7 @@ bool FunctionCallTip::updateCalltip(int ch, bool needShown)
if (!needShown && ch != _start && ch != _param && !isVisible()) //must be already visible if (!needShown && ch != _start && ch != _param && !isVisible()) //must be already visible
return false; return false;
_curPos = static_cast<int32_t>(_pEditView->execute(SCI_GETCURRENTPOS)); _curPos = _pEditView->execute(SCI_GETCURRENTPOS);
//recalculate everything //recalculate everything
if (!getCursorFunction()) if (!getCursorFunction())
@ -130,11 +130,11 @@ void FunctionCallTip::close()
bool FunctionCallTip::getCursorFunction() bool FunctionCallTip::getCursorFunction()
{ {
auto line = _pEditView->execute(SCI_LINEFROMPOSITION, _curPos); auto line = _pEditView->execute(SCI_LINEFROMPOSITION, _curPos);
int startpos = static_cast<int32_t>(_pEditView->execute(SCI_POSITIONFROMLINE, line)); INT_PTR startpos = _pEditView->execute(SCI_POSITIONFROMLINE, line);
int endpos = static_cast<int32_t>(_pEditView->execute(SCI_GETLINEENDPOSITION, line)); INT_PTR endpos = _pEditView->execute(SCI_GETLINEENDPOSITION, line);
int len = endpos - startpos + 3; //also take CRLF in account, even if not there INT_PTR len = endpos - startpos + 3; //also take CRLF in account, even if not there
int offset = _curPos - startpos; //offset is cursor location, only stuff before cursor has influence INT_PTR offset = _curPos - startpos; //offset is cursor location, only stuff before cursor has influence
const int maxLen = 256; const INT_PTR maxLen = 256;
if ((offset < 2) || (len >= maxLen)) if ((offset < 2) || (len >= maxLen))
{ {

View File

@ -36,8 +36,8 @@ private:
ScintillaEditView * _pEditView = nullptr; //Scintilla to display calltip in ScintillaEditView * _pEditView = nullptr; //Scintilla to display calltip in
TiXmlElement * _pXmlKeyword = nullptr; //current keyword node (first one) TiXmlElement * _pXmlKeyword = nullptr; //current keyword node (first one)
int _curPos = 0; //cursor position INT_PTR _curPos = 0; //cursor position
int _startPos = 0; //display start position INT_PTR _startPos = 0; //display start position
TiXmlElement * _curFunction = nullptr; //current function element TiXmlElement * _curFunction = nullptr; //current function element
//cache some XML values n stuff //cache some XML values n stuff

View File

@ -171,20 +171,20 @@ INT_PTR CALLBACK GoToLineDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM)
void GoToLineDlg::updateLinesNumbers() const void GoToLineDlg::updateLinesNumbers() const
{ {
unsigned int current = 0; size_t current = 0;
unsigned int limit = 0; size_t limit = 0;
if (_mode == go2line) if (_mode == go2line)
{ {
current = static_cast<unsigned int>((*_ppEditView)->getCurrentLineNumber() + 1); current = (*_ppEditView)->getCurrentLineNumber() + 1;
limit = static_cast<unsigned int>((*_ppEditView)->execute(SCI_GETLINECOUNT)); limit = (*_ppEditView)->execute(SCI_GETLINECOUNT);
} }
else else
{ {
current = static_cast<unsigned int>((*_ppEditView)->execute(SCI_GETCURRENTPOS)); current = (*_ppEditView)->execute(SCI_GETCURRENTPOS);
size_t currentDocLength = (*_ppEditView)->getCurrentDocLen(); size_t currentDocLength = (*_ppEditView)->getCurrentDocLen();
limit = static_cast<unsigned int>(currentDocLength > 0 ? currentDocLength - 1 : 0); limit = (currentDocLength > 0 ? currentDocLength - 1 : 0);
} }
::SetDlgItemInt(_hSelf, ID_CURRLINE, current, FALSE); ::SetDlgItemInt(_hSelf, ID_CURRLINE, (UINT)current, FALSE);
::SetDlgItemInt(_hSelf, ID_LASTLINE, limit, FALSE); ::SetDlgItemInt(_hSelf, ID_LASTLINE, (UINT)limit, FALSE);
} }

View File

@ -406,7 +406,7 @@ size_t Printer::doPrint(bool justDoIt)
frPrint.chrg.cpMin = static_cast<Sci_PositionCR>(lengthPrinted); frPrint.chrg.cpMin = static_cast<Sci_PositionCR>(lengthPrinted);
frPrint.chrg.cpMax = static_cast<Sci_PositionCR>(lengthDoc); frPrint.chrg.cpMax = static_cast<Sci_PositionCR>(lengthDoc);
lengthPrinted = long(_pSEView->execute(SCI_FORMATRANGE, printPage, reinterpret_cast<LPARAM>(&frPrint))); lengthPrinted = _pSEView->execute(SCI_FORMATRANGE, printPage, reinterpret_cast<LPARAM>(&frPrint));
if (printPage) if (printPage)
{ {

View File

@ -3383,7 +3383,7 @@ void ScintillaEditView::hideLines()
_currentBuffer->setHideLineChanged(true, startLine-1); _currentBuffer->setHideLineChanged(true, startLine-1);
} }
bool ScintillaEditView::markerMarginClick(int lineNumber) bool ScintillaEditView::markerMarginClick(size_t lineNumber)
{ {
auto state = execute(SCI_MARKERGET, lineNumber); auto state = execute(SCI_MARKERGET, lineNumber);
bool openPresent = ((state & (1 << MARK_HIDELINESBEGIN | 1 << MARK_HIDELINESUNDERLINE)) != 0); bool openPresent = ((state & (1 << MARK_HIDELINESBEGIN | 1 << MARK_HIDELINESUNDERLINE)) != 0);

View File

@ -551,7 +551,7 @@ public:
void hideLines(); void hideLines();
bool markerMarginClick(int lineNumber); //true if it did something bool markerMarginClick(size_t lineNumber); //true if it did something
void notifyMarkers(Buffer * buf, bool isHide, size_t location, bool del); void notifyMarkers(Buffer * buf, bool isHide, size_t location, bool del);
void runMarkers(bool doHide, size_t searchStart, bool endOfDoc, bool doDelete); void runMarkers(bool doHide, size_t searchStart, bool endOfDoc, bool doDelete);

View File

@ -167,7 +167,7 @@ void DocumentMap::wrapMap(const ScintillaEditView *editView)
// update the wrap needed data // update the wrap needed data
_displayWidth = editZoneWidth; _displayWidth = editZoneWidth;
_displayZoom = static_cast<int32_t>(pEditView->execute(SCI_GETZOOM)); _displayZoom = pEditView->execute(SCI_GETZOOM);
double zr = zoomRatio[_displayZoom + 10]; double zr = zoomRatio[_displayZoom + 10];
// compute doc map width: dzw/ezw = 1/zoomRatio // compute doc map width: dzw/ezw = 1/zoomRatio
@ -183,8 +183,8 @@ void DocumentMap::wrapMap(const ScintillaEditView *editView)
if (svp._paddingLeft || svp._paddingRight) if (svp._paddingLeft || svp._paddingRight)
{ {
int paddingMapLeft = static_cast<int>(svp._paddingLeft / (editZoneWidth / docMapWidth)); INT_PTR paddingMapLeft = static_cast<INT_PTR>(svp._paddingLeft / (editZoneWidth / docMapWidth));
int paddingMapRight = static_cast<int>(svp._paddingRight / (editZoneWidth / docMapWidth)); INT_PTR paddingMapRight = static_cast<INT_PTR>(svp._paddingRight / (editZoneWidth / docMapWidth));
_pMapView->execute(SCI_SETMARGINLEFT, 0, paddingMapLeft); _pMapView->execute(SCI_SETMARGINLEFT, 0, paddingMapLeft);
_pMapView->execute(SCI_SETMARGINRIGHT, 0, paddingMapRight); _pMapView->execute(SCI_SETMARGINRIGHT, 0, paddingMapRight);
} }
@ -424,9 +424,9 @@ INT_PTR CALLBACK DocumentMap::run_dlgProc(UINT message, WPARAM wParam, LPARAM lP
{ {
int newPosY = HIWORD(lParam); int newPosY = HIWORD(lParam);
int currentCenterPosY = _vzDlg.getCurrentCenterPosY(); int currentCenterPosY = _vzDlg.getCurrentCenterPosY();
int pixelPerLine = static_cast<int32_t>(_pMapView->execute(SCI_TEXTHEIGHT, 0)); INT_PTR pixelPerLine = _pMapView->execute(SCI_TEXTHEIGHT, 0);
int jumpDistance = newPosY - currentCenterPosY; INT_PTR jumpDistance = newPosY - currentCenterPosY;
int nbLine2jump = jumpDistance/pixelPerLine; INT_PTR nbLine2jump = jumpDistance/pixelPerLine;
(*_ppEditView)->execute(SCI_LINESCROLL, 0, nbLine2jump); (*_ppEditView)->execute(SCI_LINESCROLL, 0, nbLine2jump);
scrollMap(); scrollMap();

View File

@ -148,7 +148,7 @@ private:
bool _isTemporarilyShowing = false; bool _isTemporarilyShowing = false;
// for needToRecomputeWith function // for needToRecomputeWith function
int _displayZoom = -1; INT_PTR _displayZoom = -1;
int _displayWidth = 0; INT_PTR _displayWidth = 0;
generic_string id4dockingCont = DM_NOFOCUSWHILECLICKINGCAPTION; generic_string id4dockingCont = DM_NOFOCUSWHILECLICKINGCAPTION;
}; };

View File

@ -104,12 +104,12 @@ void DocumentPeeker::scrollSnapshotWith(const MapPosition & mapPos, int textZone
// //
if (mapPos._height != -1 && _rc.bottom != _rc.top + mapPos._height) if (mapPos._height != -1 && _rc.bottom != _rc.top + mapPos._height)
{ {
_rc.bottom = _rc.top + mapPos._height; _rc.bottom = _rc.top + static_cast<LONG>(mapPos._height);
hasBeenChanged = true; hasBeenChanged = true;
} }
if (mapPos._width != -1 && _rc.right != _rc.left + mapPos._width) if (mapPos._width != -1 && _rc.right != _rc.left + mapPos._width)
{ {
_rc.right = _rc.left + mapPos._width; _rc.right = _rc.left + static_cast<LONG>(mapPos._width);
hasBeenChanged = true; hasBeenChanged = true;
} }
if (hasBeenChanged) if (hasBeenChanged)
@ -156,31 +156,31 @@ void DocumentPeeker::saveCurrentSnapshot(ScintillaEditView & editView)
MapPosition mapPos = buffer->getMapPosition(); MapPosition mapPos = buffer->getMapPosition();
// First visible document line for scrolling to this line // First visible document line for scrolling to this line
mapPos._firstVisibleDisplayLine = static_cast<int32_t>(editView.execute(SCI_GETFIRSTVISIBLELINE)); mapPos._firstVisibleDisplayLine = editView.execute(SCI_GETFIRSTVISIBLELINE);
mapPos._firstVisibleDocLine = static_cast<int32_t>(editView.execute(SCI_DOCLINEFROMVISIBLE, mapPos._firstVisibleDisplayLine)); mapPos._firstVisibleDocLine = editView.execute(SCI_DOCLINEFROMVISIBLE, mapPos._firstVisibleDisplayLine);
mapPos._nbLine = static_cast<int32_t>(editView.execute(SCI_LINESONSCREEN, mapPos._firstVisibleDisplayLine)); mapPos._nbLine = editView.execute(SCI_LINESONSCREEN, mapPos._firstVisibleDisplayLine);
mapPos._lastVisibleDocLine = static_cast<int32_t>(editView.execute(SCI_DOCLINEFROMVISIBLE, mapPos._firstVisibleDisplayLine + mapPos._nbLine)); mapPos._lastVisibleDocLine = editView.execute(SCI_DOCLINEFROMVISIBLE, mapPos._firstVisibleDisplayLine + mapPos._nbLine);
auto lineHeight = _pPeekerView->execute(SCI_TEXTHEIGHT, mapPos._firstVisibleDocLine); auto lineHeight = _pPeekerView->execute(SCI_TEXTHEIGHT, mapPos._firstVisibleDocLine);
mapPos._height = static_cast<int32_t>(mapPos._nbLine * lineHeight); mapPos._height = mapPos._nbLine * lineHeight;
// Width // Width
RECT editorRect; RECT editorRect;
editView.getClientRect(editorRect); editView.getClientRect(editorRect);
int marginWidths = 0; INT_PTR marginWidths = 0;
for (int m = 0; m < 4; ++m) for (int m = 0; m < 4; ++m)
{ {
marginWidths += static_cast<int32_t>(editView.execute(SCI_GETMARGINWIDTHN, m)); marginWidths += editView.execute(SCI_GETMARGINWIDTHN, m);
} }
double editViewWidth = editorRect.right - editorRect.left - marginWidths; double editViewWidth = editorRect.right - editorRect.left - static_cast<LONG>(marginWidths);
double editViewHeight = editorRect.bottom - editorRect.top; double editViewHeight = editorRect.bottom - editorRect.top;
mapPos._width = static_cast<int32_t>((editViewWidth / editViewHeight) * static_cast<double>(mapPos._height)); mapPos._width = static_cast<INT_PTR>((editViewWidth / editViewHeight) * static_cast<double>(mapPos._height));
mapPos._wrapIndentMode = static_cast<int32_t>(editView.execute(SCI_GETWRAPINDENTMODE)); mapPos._wrapIndentMode = editView.execute(SCI_GETWRAPINDENTMODE);
mapPos._isWrap = static_cast<int32_t>(editView.isWrap()); mapPos._isWrap = editView.isWrap();
if (editView.isWrap()) if (editView.isWrap())
{ {
mapPos._higherPos = static_cast<int32_t>(editView.execute(SCI_POSITIONFROMPOINT, 0, 0)); mapPos._higherPos = editView.execute(SCI_POSITIONFROMPOINT, 0, 0);
} }
// Length of document // Length of document

View File

@ -92,7 +92,7 @@ INT_PTR CALLBACK FindCharsInRangeDlg::run_dlgProc(UINT message, WPARAM wParam, L
case ID_FINDCHAR_NEXT: case ID_FINDCHAR_NEXT:
{ {
int currentPos = static_cast<int32_t>((*_ppEditView)->execute(SCI_GETCURRENTPOS)); INT_PTR currentPos = (*_ppEditView)->execute(SCI_GETCURRENTPOS);
unsigned char startRange = 0; unsigned char startRange = 0;
unsigned char endRange = 255; unsigned char endRange = 255;
bool direction = dirDown; bool direction = dirDown;

View File

@ -476,7 +476,7 @@ generic_string FunctionParser::parseSubLevel(size_t begin, size_t end, std::vect
foundPos = -1; foundPos = -1;
return generic_string(); return generic_string();
} }
int targetEnd = int((*ppEditView)->execute(SCI_GETTARGETEND)); INT_PTR targetEnd = (*ppEditView)->execute(SCI_GETTARGETEND);
if (dataToSearch.size() >= 2) if (dataToSearch.size() >= 2)
{ {