aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorNeil <nyamatongwe@gmail.com>2020-07-13 09:59:46 +1000
committerNeil <nyamatongwe@gmail.com>2020-07-13 09:59:46 +1000
commit1d1d8bcf373ddcda6bf50e5173ace702cf3fc95f (patch)
tree0cca5cc9181c02cc9e53b7480c972156491998da
parenta5efd9f00bd0b40d339487f6d7b39e3fa353f63b (diff)
downloadscintilla-mirror-1d1d8bcf373ddcda6bf50e5173ace702cf3fc95f.tar.gz
Backport: Minor warning fixes. 0 -> nullptr and static_cast -> dynamic_cast.
Backport of changeset 8401:add0d0fc2939.
-rw-r--r--qt/ScintillaEditBase/PlatQt.cpp6
-rw-r--r--qt/ScintillaEditBase/ScintillaEditBase.cpp2
2 files changed, 4 insertions, 4 deletions
diff --git a/qt/ScintillaEditBase/PlatQt.cpp b/qt/ScintillaEditBase/PlatQt.cpp
index 9222d5f36..c1cd42d9e 100644
--- a/qt/ScintillaEditBase/PlatQt.cpp
+++ b/qt/ScintillaEditBase/PlatQt.cpp
@@ -210,7 +210,7 @@ void SurfaceImpl::InitPixMap(int width,
if (height < 1) height = 1;
deviceOwned = true;
device = new QPixmap(width, height);
- SurfaceImpl *psurfOther = static_cast<SurfaceImpl *>(surface);
+ SurfaceImpl *psurfOther = dynamic_cast<SurfaceImpl *>(surface);
SetUnicodeMode(psurfOther->unicodeMode);
SetDBCSMode(psurfOther->codePage);
}
@@ -316,7 +316,7 @@ void SurfaceImpl::FillRectangle(PRectangle rc, ColourDesired back)
void SurfaceImpl::FillRectangle(PRectangle rc, Surface &surfacePattern)
{
// Tile pattern over rectangle
- SurfaceImpl *surface = static_cast<SurfaceImpl *>(&surfacePattern);
+ SurfaceImpl *surface = dynamic_cast<SurfaceImpl *>(&surfacePattern);
// Currently assumes 8x8 pattern
int widthPat = 8;
int heightPat = 8;
@@ -428,7 +428,7 @@ void SurfaceImpl::Ellipse(PRectangle rc,
void SurfaceImpl::Copy(PRectangle rc, Point from, Surface &surfaceSource)
{
- SurfaceImpl *source = static_cast<SurfaceImpl *>(&surfaceSource);
+ SurfaceImpl *source = dynamic_cast<SurfaceImpl *>(&surfaceSource);
QPixmap *pixmap = static_cast<QPixmap *>(source->GetPaintDevice());
GetPainter()->drawPixmap(rc.left, rc.top, *pixmap, from.x, from.y, -1, -1);
diff --git a/qt/ScintillaEditBase/ScintillaEditBase.cpp b/qt/ScintillaEditBase/ScintillaEditBase.cpp
index ccc20b18d..b1257c681 100644
--- a/qt/ScintillaEditBase/ScintillaEditBase.cpp
+++ b/qt/ScintillaEditBase/ScintillaEditBase.cpp
@@ -43,7 +43,7 @@
using namespace Scintilla;
ScintillaEditBase::ScintillaEditBase(QWidget *parent)
-: QAbstractScrollArea(parent), sqt(0), preeditPos(-1), wheelDelta(0)
+: QAbstractScrollArea(parent), sqt(nullptr), preeditPos(-1), wheelDelta(0)
{
sqt = new ScintillaQt(this);