@@ -153,7 +153,7 @@ QString Disassembly::paintContent(QPainter* painter, dsint rowBase, int rowOffse
153
153
bpColor = mBreakpointColor ;
154
154
if (bpColor == mCipBackgroundColor )
155
155
bpColor = mCipColor ;
156
- painter->setPen (QPen ( bpColor) );
156
+ painter->setPen (bpColor);
157
157
}
158
158
else if (bpxtype & bp_hardware) // hardware breakpoint only
159
159
{
@@ -166,7 +166,7 @@ QString Disassembly::paintContent(QPainter* painter, dsint rowBase, int rowOffse
166
166
}
167
167
else // no breakpoint
168
168
{
169
- painter->setPen (QPen ( mCipColor ) );
169
+ painter->setPen (mCipColor );
170
170
}
171
171
}
172
172
else // bookmark
@@ -176,7 +176,7 @@ QString Disassembly::paintContent(QPainter* painter, dsint rowBase, int rowOffse
176
176
bookmarkColor = mBookmarkColor ;
177
177
if (bookmarkColor == mCipBackgroundColor )
178
178
bookmarkColor = mCipColor ;
179
- painter->setPen (QPen ( bookmarkColor) );
179
+ painter->setPen (bookmarkColor);
180
180
}
181
181
}
182
182
else // non-cip address
@@ -187,24 +187,24 @@ QString Disassembly::paintContent(QPainter* painter, dsint rowBase, int rowOffse
187
187
{
188
188
if (bpxtype == bp_none) // label only
189
189
{
190
- painter->setPen (QPen ( mLabelColor ) ); // red -> address + label text
190
+ painter->setPen (mLabelColor ); // red -> address + label text
191
191
painter->fillRect (QRect (x, y, w, h), QBrush (mLabelBackgroundColor )); // fill label background
192
192
}
193
193
else // label+breakpoint
194
194
{
195
195
if (bpxtype & bp_normal) // label + normal breakpoint
196
196
{
197
- painter->setPen (QPen ( mBreakpointColor ) );
197
+ painter->setPen (mBreakpointColor );
198
198
painter->fillRect (QRect (x, y, w, h), QBrush (mBreakpointBackgroundColor )); // fill red
199
199
}
200
200
else if (bpxtype & bp_hardware) // label + hardware breakpoint only
201
201
{
202
- painter->setPen (QPen ( mHardwareBreakpointColor ) );
202
+ painter->setPen (mHardwareBreakpointColor );
203
203
painter->fillRect (QRect (x, y, w, h), QBrush (mHardwareBreakpointBackgroundColor )); // fill ?
204
204
}
205
205
else // other cases -> do as normal
206
206
{
207
- painter->setPen (QPen ( mLabelColor ) ); // red -> address + label text
207
+ painter->setPen (mLabelColor ); // red -> address + label text
208
208
painter->fillRect (QRect (x, y, w, h), QBrush (mLabelBackgroundColor )); // fill label background
209
209
}
210
210
}
@@ -217,12 +217,12 @@ QString Disassembly::paintContent(QPainter* painter, dsint rowBase, int rowOffse
217
217
if (wIsSelected)
218
218
{
219
219
background = mSelectedAddressBackgroundColor ;
220
- painter->setPen (QPen ( mSelectedAddressColor ) ); // black address (DisassemblySelectedAddressColor)
220
+ painter->setPen (mSelectedAddressColor ); // black address (DisassemblySelectedAddressColor)
221
221
}
222
222
else
223
223
{
224
224
background = mAddressBackgroundColor ;
225
- painter->setPen (QPen ( mAddressColor ) ); // DisassemblyAddressColor
225
+ painter->setPen (mAddressColor ); // DisassemblyAddressColor
226
226
}
227
227
if (background.alpha ())
228
228
painter->fillRect (QRect (x, y, w, h), QBrush (background)); // fill background
@@ -231,12 +231,12 @@ QString Disassembly::paintContent(QPainter* painter, dsint rowBase, int rowOffse
231
231
{
232
232
if (bpxtype & bp_normal) // normal breakpoint
233
233
{
234
- painter->setPen (QPen ( mBreakpointColor ) );
234
+ painter->setPen (mBreakpointColor );
235
235
painter->fillRect (QRect (x, y, w, h), QBrush (mBreakpointBackgroundColor )); // fill red
236
236
}
237
237
else if (bpxtype & bp_hardware) // hardware breakpoint only
238
238
{
239
- painter->setPen (QPen ( mHardwareBreakpointColor ) );
239
+ painter->setPen (mHardwareBreakpointColor );
240
240
painter->fillRect (QRect (x, y, w, h), QBrush (mHardwareBreakpointBackgroundColor )); // fill red
241
241
}
242
242
else // other cases (memory breakpoint in disassembly) -> do as normal
@@ -245,12 +245,12 @@ QString Disassembly::paintContent(QPainter* painter, dsint rowBase, int rowOffse
245
245
if (wIsSelected)
246
246
{
247
247
background = mSelectedAddressBackgroundColor ;
248
- painter->setPen (QPen ( mSelectedAddressColor ) ); // black address (DisassemblySelectedAddressColor)
248
+ painter->setPen (mSelectedAddressColor ); // black address (DisassemblySelectedAddressColor)
249
249
}
250
250
else
251
251
{
252
252
background = mAddressBackgroundColor ;
253
- painter->setPen (QPen ( mAddressColor ) );
253
+ painter->setPen (mAddressColor );
254
254
}
255
255
if (background.alpha ())
256
256
painter->fillRect (QRect (x, y, w, h), QBrush (background)); // fill background
@@ -264,15 +264,15 @@ QString Disassembly::paintContent(QPainter* painter, dsint rowBase, int rowOffse
264
264
{
265
265
if (bpxtype == bp_none) // label + bookmark
266
266
{
267
- painter->setPen (QPen ( mLabelColor ) ); // red -> address + label text
267
+ painter->setPen (mLabelColor ); // red -> address + label text
268
268
painter->fillRect (QRect (x, y, w, h), QBrush (mBookmarkBackgroundColor )); // fill label background
269
269
}
270
270
else // label+breakpoint+bookmark
271
271
{
272
272
QColor color = mBookmarkBackgroundColor ;
273
273
if (!color.alpha ()) // we don't want transparent text
274
274
color = mAddressColor ;
275
- painter->setPen (QPen ( color) );
275
+ painter->setPen (color);
276
276
if (bpxtype & bp_normal) // label + bookmark + normal breakpoint
277
277
{
278
278
painter->fillRect (QRect (x, y, w, h), QBrush (mBreakpointBackgroundColor )); // fill red
@@ -287,15 +287,15 @@ QString Disassembly::paintContent(QPainter* painter, dsint rowBase, int rowOffse
287
287
{
288
288
if (bpxtype == bp_none) // bookmark only
289
289
{
290
- painter->setPen (QPen ( mBookmarkColor ) ); // black address
290
+ painter->setPen (mBookmarkColor ); // black address
291
291
painter->fillRect (QRect (x, y, w, h), QBrush (mBookmarkBackgroundColor )); // fill bookmark color
292
292
}
293
293
else // bookmark + breakpoint
294
294
{
295
295
QColor color = mBookmarkBackgroundColor ;
296
296
if (!color.alpha ()) // we don't want transparent text
297
297
color = mAddressColor ;
298
- painter->setPen (QPen ( color) );
298
+ painter->setPen (color);
299
299
if (bpxtype & bp_normal) // bookmark + normal breakpoint
300
300
{
301
301
painter->fillRect (QRect (x, y, w, h), QBrush (mBreakpointBackgroundColor )); // fill red
@@ -306,7 +306,7 @@ QString Disassembly::paintContent(QPainter* painter, dsint rowBase, int rowOffse
306
306
}
307
307
else // other cases (bookmark + memory breakpoint in disassembly) -> do as normal
308
308
{
309
- painter->setPen (QPen ( mBookmarkColor ) ); // black address
309
+ painter->setPen (mBookmarkColor ); // black address
310
310
painter->fillRect (QRect (x, y, w, h), QBrush (mBookmarkBackgroundColor )); // fill bookmark color
311
311
}
312
312
}
@@ -422,21 +422,20 @@ QString Disassembly::paintContent(QPainter* painter, dsint rowBase, int rowOffse
422
422
if (DbgGetCommentAt (rvaToVa (mInstBuffer .at (rowOffset).rva ), comment))
423
423
{
424
424
QString commentText;
425
- QColor penColor;
426
425
QColor backgroundColor;
427
426
if (comment[0 ] == ' \1 ' ) // automatic comment
428
427
{
429
- penColor = mAutoCommentColor ;
428
+ painter-> setPen ( mAutoCommentColor ) ;
430
429
backgroundColor = mAutoCommentBackgroundColor ;
431
430
commentText = QString (comment + 1 );
432
431
}
433
432
else // user comment
434
433
{
435
- penColor = mCommentColor ;
434
+ painter-> setPen ( mCommentColor ) ;
436
435
backgroundColor = mCommentBackgroundColor ;
437
436
commentText = comment;
438
437
}
439
- painter-> setPen (penColor);
438
+
440
439
int width = getCharWidth () * commentText.length () + 4 ;
441
440
if (width > w)
442
441
width = w;
0 commit comments