1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
|
# HG changeset patch
# User Neil <nyamatongwe@gmail.com>
# Date 1492238872 -36000
# Node ID 044d2d0302639d08d3e0aa72886afcbd47fa39f8
# Parent b8379bec8e70bf09df25f01d0a78a53cf61b1827
Avoid calling virtual functions in constructors and destructors.
diff -r b8379bec8e70 -r 044d2d030263 cocoa/ScintillaCocoa.h
--- a/cocoa/ScintillaCocoa.h Sat Apr 15 15:00:28 2017 +1000
+++ b/cocoa/ScintillaCocoa.h Sat Apr 15 16:47:52 2017 +1000
@@ -128,7 +128,7 @@
void DiscardOverdraw() override;
void Redraw() override;
- void Initialise() override;
+ void Init();
void Finalise() override;
CaseFolder *CaseFolderForEncoding() override;
std::string CaseMapString(const std::string &s, int caseMapping) override;
diff -r b8379bec8e70 -r 044d2d030263 cocoa/ScintillaCocoa.mm
--- a/cocoa/ScintillaCocoa.mm Sat Apr 15 15:00:28 2017 +1000
+++ b/cocoa/ScintillaCocoa.mm Sat Apr 15 16:47:52 2017 +1000
@@ -422,7 +422,7 @@
{
timers[tr] = nil;
}
- Initialise();
+ Init();
}
//--------------------------------------------------------------------------------------------------
@@ -439,7 +439,7 @@
/**
* Core initialization of the control. Everything that needs to be set up happens here.
*/
-void ScintillaCocoa::Initialise()
+void ScintillaCocoa::Init()
{
Scintilla_LinkLexers();
diff -r b8379bec8e70 -r 044d2d030263 gtk/PlatGTK.cxx
--- a/gtk/PlatGTK.cxx Sat Apr 15 15:00:28 2017 +1000
+++ b/gtk/PlatGTK.cxx Sat Apr 15 16:47:52 2017 +1000
@@ -168,6 +168,7 @@
void Init(SurfaceID sid, WindowID wid) override;
void InitPixMap(int width, int height, Surface *surface_, WindowID wid) override;
+ void Clear();
void Release();
bool Initialised();
void PenColour(ColourDesired fore);
@@ -276,10 +277,10 @@
}
SurfaceImpl::~SurfaceImpl() {
- Release();
+ Clear();
}
-void SurfaceImpl::Release() {
+void SurfaceImpl::Clear() {
et = singleByte;
if (createdGC) {
createdGC = false;
@@ -303,6 +304,10 @@
createdGC = false;
}
+void SurfaceImpl::Release() {
+ Clear();
+}
+
bool SurfaceImpl::Initialised() {
#if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 8, 0)
if (inited && context) {
diff -r b8379bec8e70 -r 044d2d030263 gtk/ScintillaGTK.cxx
--- a/gtk/ScintillaGTK.cxx Sat Apr 15 15:00:28 2017 +1000
+++ b/gtk/ScintillaGTK.cxx Sat Apr 15 16:47:52 2017 +1000
@@ -205,7 +205,7 @@
lastWheelMouseTime.tv_sec = 0;
lastWheelMouseTime.tv_usec = 0;
- Initialise();
+ Init();
}
ScintillaGTK::~ScintillaGTK() {
@@ -549,8 +549,7 @@
}
}
-void ScintillaGTK::Initialise() {
- //Platform::DebugPrintf("ScintillaGTK::Initialise\n");
+void ScintillaGTK::Init() {
parentClass = reinterpret_cast<GtkWidgetClass *>(
g_type_class_ref(gtk_container_get_type()));
@@ -3044,7 +3043,7 @@
// Define default signal handlers for the class: Could move more
// of the signal handlers here (those that currently attached to wDraw
- // in Initialise() may require coordinate translation?)
+ // in Init() may require coordinate translation?)
object_class->dispose = Dispose;
object_class->finalize = Destroy;
diff -r b8379bec8e70 -r 044d2d030263 gtk/ScintillaGTK.h
--- a/gtk/ScintillaGTK.h Sat Apr 15 15:00:28 2017 +1000
+++ b/gtk/ScintillaGTK.h Sat Apr 15 16:47:52 2017 +1000
@@ -81,7 +81,7 @@
static ScintillaGTK *FromWidget(GtkWidget *widget);
static void ClassInit(OBJECT_CLASS* object_class, GtkWidgetClass *widget_class, GtkContainerClass *container_class);
private:
- virtual void Initialise();
+ void Init();
virtual void Finalise();
virtual bool AbandonPaint();
virtual void DisplayCursor(Window::Cursor c);
diff -r b8379bec8e70 -r 044d2d030263 qt/ScintillaEditBase/ScintillaQt.cpp
--- a/qt/ScintillaEditBase/ScintillaQt.cpp Sat Apr 15 15:00:28 2017 +1000
+++ b/qt/ScintillaEditBase/ScintillaQt.cpp Sat Apr 15 16:47:52 2017 +1000
@@ -45,7 +45,7 @@
// Buffered drawing turned off by default to avoid this.
WndProc(SCI_SETBUFFEREDDRAW, false, 0);
- Initialise();
+ Init();
for (TickReason tr = tickCaret; tr <= tickDwell; tr = static_cast<TickReason>(tr + 1)) {
timers[tr] = 0;
@@ -128,7 +128,7 @@
#endif
-void ScintillaQt::Initialise()
+void ScintillaQt::Init()
{
#if defined(Q_OS_WIN) || defined(Q_OS_MAC)
rectangularSelectionModifier = SCMOD_ALT;
diff -r b8379bec8e70 -r 044d2d030263 qt/ScintillaEditBase/ScintillaQt.h
--- a/qt/ScintillaEditBase/ScintillaQt.h Sat Apr 15 15:00:28 2017 +1000
+++ b/qt/ScintillaEditBase/ScintillaQt.h Sat Apr 15 16:47:52 2017 +1000
@@ -99,7 +99,7 @@
void SelectionChanged();
private:
- virtual void Initialise();
+ void Init();
virtual void Finalise();
virtual bool DragThreshold(Point ptStart, Point ptNow);
virtual bool ValidCodePage(int codePage) const;
diff -r b8379bec8e70 -r 044d2d030263 src/PerLine.cxx
--- a/src/PerLine.cxx Sat Apr 15 15:00:28 2017 +1000
+++ b/src/PerLine.cxx Sat Apr 15 16:47:52 2017 +1000
@@ -121,7 +121,11 @@
}
LineMarkers::~LineMarkers() {
- Init();
+ for (int line = 0; line < markers.Length(); line++) {
+ delete markers[line];
+ markers[line] = 0;
+ }
+ markers.DeleteAll();
}
void LineMarkers::Init() {
@@ -490,7 +494,10 @@
}
LineTabstops::~LineTabstops() {
- Init();
+ for (int line = 0; line < tabstops.Length(); line++) {
+ delete tabstops[line];
+ }
+ tabstops.DeleteAll();
}
void LineTabstops::Init() {
diff -r b8379bec8e70 -r 044d2d030263 src/ScintillaBase.h
--- a/src/ScintillaBase.h Sat Apr 15 15:00:28 2017 +1000
+++ b/src/ScintillaBase.h Sat Apr 15 16:47:52 2017 +1000
@@ -59,7 +59,7 @@
ScintillaBase();
virtual ~ScintillaBase();
- virtual void Initialise() = 0;
+ void Initialise() {}
virtual void Finalise();
virtual void AddCharUTF(const char *s, unsigned int len, bool treatAsDBCS=false);
diff -r b8379bec8e70 -r 044d2d030263 win32/ScintillaWin.cxx
--- a/win32/ScintillaWin.cxx Sat Apr 15 15:00:28 2017 +1000
+++ b/win32/ScintillaWin.cxx Sat Apr 15 16:47:52 2017 +1000
@@ -276,7 +276,7 @@
~ScintillaWin() override;
ScintillaWin &operator=(const ScintillaWin &);
- void Initialise() override;
+ void Init();
void Finalise() override;
#if defined(USE_D2D)
void EnsureRenderTarget(HDC hdc);
@@ -459,12 +459,12 @@
if (caret.period < 0)
caret.period = 0;
- Initialise();
+ Init();
}
ScintillaWin::~ScintillaWin() {}
-void ScintillaWin::Initialise() {
+void ScintillaWin::Init() {
// Initialize COM. If the app has already done this it will have
// no effect. If the app hasn't, we really shouldn't ask them to call
// it just so this internal feature works.
|