diff options
| author | mitchell <unknown> | 2018-05-25 13:33:38 -0400 |
|---|---|---|
| committer | mitchell <unknown> | 2018-05-25 13:33:38 -0400 |
| commit | 43566e4211e18057662ff5d8c8d3996b73090d43 (patch) | |
| tree | 0b501aa992e9ccdcc36b25d10d72a51785a9a515 /qt/ScintillaEditBase | |
| parent | 7a4fd484cc8229d3518039c82d950b4fa7f673cb (diff) | |
| download | scintilla-mirror-43566e4211e18057662ff5d8c8d3996b73090d43.tar.gz | |
Backport: Modernize Platform.h (3) - update Surface to delete WidthChar, use size_t for Polygon and delete the standard copy and assignment methods.
Backport of changeset 6940:89fd29243232.
Diffstat (limited to 'qt/ScintillaEditBase')
| -rw-r--r-- | qt/ScintillaEditBase/PlatQt.cpp | 12 | ||||
| -rw-r--r-- | qt/ScintillaEditBase/PlatQt.h | 5 | ||||
| -rw-r--r-- | qt/ScintillaEditBase/ScintillaEditBase.h | 2 |
3 files changed, 8 insertions, 11 deletions
diff --git a/qt/ScintillaEditBase/PlatQt.cpp b/qt/ScintillaEditBase/PlatQt.cpp index ac8fbc9cc..26890e4b7 100644 --- a/qt/ScintillaEditBase/PlatQt.cpp +++ b/qt/ScintillaEditBase/PlatQt.cpp @@ -269,7 +269,7 @@ void SurfaceImpl::LineTo(int x_, int y_) } void SurfaceImpl::Polygon(Point *pts, - int npts, + size_t npts, ColourDesired fore, ColourDesired back) { @@ -277,11 +277,11 @@ void SurfaceImpl::Polygon(Point *pts, BrushColour(back); std::vector<QPoint> qpts(npts); - for (int i = 0; i < npts; i++) { + for (size_t i = 0; i < npts; i++) { qpts[i] = QPoint(pts[i].x, pts[i].y); } - GetPainter()->drawPolygon(&qpts[0], npts); + GetPainter()->drawPolygon(&qpts[0], static_cast<int>(npts)); } void SurfaceImpl::RectangleDraw(PRectangle rc, @@ -494,12 +494,6 @@ XYPOSITION SurfaceImpl::WidthText(Font &font, const char *s, int len) return metrics.width(string); } -XYPOSITION SurfaceImpl::WidthChar(Font &font, char ch) -{ - QFontMetricsF metrics(*FontPointer(font), device); - return metrics.width(ch); -} - XYPOSITION SurfaceImpl::Ascent(Font &font) { QFontMetricsF metrics(*FontPointer(font), device); diff --git a/qt/ScintillaEditBase/PlatQt.h b/qt/ScintillaEditBase/PlatQt.h index 653399dbc..4d762bccf 100644 --- a/qt/ScintillaEditBase/PlatQt.h +++ b/qt/ScintillaEditBase/PlatQt.h @@ -11,6 +11,8 @@ #ifndef PLATQT_H #define PLATQT_H +#include <cstddef> + #include "Platform.h" #include <QUrl> @@ -78,7 +80,7 @@ public: int DeviceHeightFont(int points) override; void MoveTo(int x_, int y_) override; void LineTo(int x_, int y_) override; - void Polygon(Point *pts, int npts, ColourDesired fore, + void Polygon(Point *pts, size_t npts, ColourDesired fore, ColourDesired back) override; void RectangleDraw(PRectangle rc, ColourDesired fore, ColourDesired back) override; @@ -103,7 +105,6 @@ public: void MeasureWidths(Font &font, const char *s, int len, XYPOSITION *positions) override; XYPOSITION WidthText(Font &font, const char *s, int len) override; - XYPOSITION WidthChar(Font &font, char ch) override; XYPOSITION Ascent(Font &font) override; XYPOSITION Descent(Font &font) override; XYPOSITION InternalLeading(Font &font) override; diff --git a/qt/ScintillaEditBase/ScintillaEditBase.h b/qt/ScintillaEditBase/ScintillaEditBase.h index 20acf3086..5ab9dc115 100644 --- a/qt/ScintillaEditBase/ScintillaEditBase.h +++ b/qt/ScintillaEditBase/ScintillaEditBase.h @@ -12,6 +12,8 @@ #ifndef SCINTILLAEDITBASE_H #define SCINTILLAEDITBASE_H +#include <cstddef> + #include "Platform.h" #include "Scintilla.h" |
