Skip to content

Commit

Permalink
CID 35541: Uninitialized pointer field (UNINIT_CTOR)
Browse files Browse the repository at this point in the history
16. uninit_member: Non-static class member ui is not initialized in this
constructor nor in any functions that it calls.

2. uninit_member: Non-static class member lineStyle is not initialized
   in this constructor nor in any functions that it calls.

4. uninit_member: Non-static class member lineWidth is not initialized
   in this constructor nor in any functions that it calls.

6. uninit_member: Non-static class member startMarkerSelector is not
   initialized in this constructor nor in any functions that it calls.

8. uninit_member: Non-static class member midMarkerSelector is not
   initialized in this constructor nor in any functions that it calls.

10. uninit_member: Non-static class member endMarkerSelector is not
   initialized in this constructor nor in any functions that it calls.

12. uninit_member: Non-static class member capNJoinMenu is not
   initialized in this constructor nor in any functions that it calls.

14. uninit_member: Non-static class member spacer is not initialized
   in this constructor nor in any functions that it calls.
  • Loading branch information
hallarempt committed Sep 26, 2019
1 parent 2354e8f commit d5a62cd
Showing 1 changed file with 53 additions and 58 deletions.
111 changes: 53 additions & 58 deletions libs/ui/widgets/KoStrokeConfigWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,9 @@ class CapNJoinMenu : public QMenu
CapNJoinMenu(QWidget *parent = 0);
QSize sizeHint() const override;

KisDoubleParseUnitSpinBox *miterLimit;
QButtonGroup *capGroup;
QButtonGroup *joinGroup;
KisDoubleParseUnitSpinBox *miterLimit {0};
QButtonGroup *capGroup {0};
QButtonGroup *joinGroup {0};
};

CapNJoinMenu::CapNJoinMenu(QWidget *parent)
Expand All @@ -91,7 +91,7 @@ CapNJoinMenu::CapNJoinMenu(QWidget *parent)
QGridLayout *mainLayout = new QGridLayout();
mainLayout->setMargin(2);

// The cap group
// The cap group
capGroup = new QButtonGroup(this);
capGroup->setExclusive(true);

Expand Down Expand Up @@ -166,37 +166,32 @@ class Q_DECL_HIDDEN KoStrokeConfigWidget::Private
{
public:
Private()
: canvas(0),
active(true),
allowLocalUnitManagement(true),
fillConfigWidget(0),
selectionChangedCompressor(200, KisSignalCompressor::FIRST_ACTIVE)
: selectionChangedCompressor(200, KisSignalCompressor::FIRST_ACTIVE)
{
}

KoLineStyleSelector *lineStyle;
KisDoubleParseUnitSpinBox *lineWidth;
KoMarkerSelector *startMarkerSelector;
KoMarkerSelector *midMarkerSelector;
KoMarkerSelector *endMarkerSelector;
KoLineStyleSelector *lineStyle {0};
KisDoubleParseUnitSpinBox *lineWidth {0};
KoMarkerSelector *startMarkerSelector {0};
KoMarkerSelector *midMarkerSelector {0};
KoMarkerSelector *endMarkerSelector {0};

CapNJoinMenu *capNJoinMenu;
CapNJoinMenu *capNJoinMenu {0};

QWidget *spacer;
QWidget*spacer {0};

KoCanvasBase *canvas;
KoCanvasBase *canvas {0};

bool active;
bool allowLocalUnitManagement;
bool active {true};
bool allowLocalUnitManagement {false};

KoFillConfigWidget *fillConfigWidget;
KoFillConfigWidget *fillConfigWidget {0};
bool noSelectionTrackingMode {false};

KisAcyclicSignalConnector shapeChangedAcyclicConnector;
KisAcyclicSignalConnector resourceManagerAcyclicConnector;
KisSignalCompressor selectionChangedCompressor;


std::vector<KisAcyclicSignalConnector::Blocker> deactivationLocks;

Ui_KoStrokeConfigWidget *ui;
Expand All @@ -215,28 +210,28 @@ KoStrokeConfigWidget::KoStrokeConfigWidget(KoCanvasBase *canvas, QWidget * paren

{ // connect the canvas
d->shapeChangedAcyclicConnector.connectBackwardVoid(
canvas->selectedShapesProxy(), SIGNAL(selectionChanged()),
&d->selectionChangedCompressor, SLOT(start()));
canvas->selectedShapesProxy(), SIGNAL(selectionChanged()),
&d->selectionChangedCompressor, SLOT(start()));

d->shapeChangedAcyclicConnector.connectBackwardVoid(
canvas->selectedShapesProxy(), SIGNAL(selectionContentChanged()),
&d->selectionChangedCompressor, SLOT(start()));
canvas->selectedShapesProxy(), SIGNAL(selectionContentChanged()),
&d->selectionChangedCompressor, SLOT(start()));

connect(&d->selectionChangedCompressor, SIGNAL(timeout()), this, SLOT(selectionChanged()));

d->resourceManagerAcyclicConnector.connectBackwardResourcePair(
canvas->resourceManager(), SIGNAL(canvasResourceChanged(int,QVariant)),
this, SLOT(canvasResourceChanged(int,QVariant)));
canvas->resourceManager(), SIGNAL(canvasResourceChanged(int,QVariant)),
this, SLOT(canvasResourceChanged(int,QVariant)));

d->canvas = canvas;
}

{

d->fillConfigWidget = new KoFillConfigWidget(canvas, KoFlake::StrokeFill, true, this);
d->fillConfigWidget->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::MinimumExpanding);
d->ui->fillConfigWidgetLayout->addWidget(d->fillConfigWidget);
connect(d->fillConfigWidget, SIGNAL(sigFillChanged()), SIGNAL(sigStrokeChanged()));
d->fillConfigWidget = new KoFillConfigWidget(canvas, KoFlake::StrokeFill, true, this);
d->fillConfigWidget->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::MinimumExpanding);
d->ui->fillConfigWidgetLayout->addWidget(d->fillConfigWidget);
connect(d->fillConfigWidget, SIGNAL(sigFillChanged()), SIGNAL(sigStrokeChanged()));
}

d->ui->thicknessLabel->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
Expand Down Expand Up @@ -469,7 +464,7 @@ void KoStrokeConfigWidget::activate()
d->fillConfigWidget->activate();

if (!d->noSelectionTrackingMode) {
// selectionChanged();
// selectionChanged();
d->selectionChangedCompressor.start();
} else {
loadCurrentStrokeFillFromResourceServer();
Expand Down Expand Up @@ -505,8 +500,8 @@ void KoStrokeConfigWidget::setActive(bool active)
//------------------------

template <typename ModifyFunction>
auto applyChangeToStrokes(KoCanvasBase *canvas, ModifyFunction modifyFunction)
-> decltype(modifyFunction(KoShapeStrokeSP()), void())
auto applyChangeToStrokes(KoCanvasBase *canvas, ModifyFunction modifyFunction)
-> decltype(modifyFunction(KoShapeStrokeSP()), void())
{
KoSelection *selection = canvas->selectedShapesProxy()->selection();

Expand All @@ -524,35 +519,35 @@ template <typename ModifyFunction>
void KoStrokeConfigWidget::applyDashStyleChanges()
{
applyChangeToStrokes(
d->canvas,
[this] (KoShapeStrokeSP stroke) {
stroke->setLineStyle(lineStyle(), lineDashes());
});
d->canvas,
[this] (KoShapeStrokeSP stroke) {
stroke->setLineStyle(lineStyle(), lineDashes());
});

emit sigStrokeChanged();
}

void KoStrokeConfigWidget::applyLineWidthChanges()
{
applyChangeToStrokes(
d->canvas,
[this] (KoShapeStrokeSP stroke) {
stroke->setLineWidth(lineWidth());
});
d->canvas,
[this] (KoShapeStrokeSP stroke) {
stroke->setLineWidth(lineWidth());
});

emit sigStrokeChanged();
}

void KoStrokeConfigWidget::applyJoinCapChanges()
{
applyChangeToStrokes(
d->canvas,
[this] (KoShapeStrokeSP stroke) {
d->canvas,
[this] (KoShapeStrokeSP stroke) {

stroke->setCapStyle(static_cast<Qt::PenCapStyle>(d->capNJoinMenu->capGroup->checkedId()));
stroke->setJoinStyle(static_cast<Qt::PenJoinStyle>(d->capNJoinMenu->joinGroup->checkedId()));
stroke->setMiterLimit(miterLimit());
});
stroke->setCapStyle(static_cast<Qt::PenCapStyle>(d->capNJoinMenu->capGroup->checkedId()));
stroke->setJoinStyle(static_cast<Qt::PenJoinStyle>(d->capNJoinMenu->joinGroup->checkedId()));
stroke->setMiterLimit(miterLimit());
});

emit sigStrokeChanged();
}
Expand Down Expand Up @@ -749,16 +744,16 @@ void KoStrokeConfigWidget::selectionChanged()
// if we don't do this the internal widgets get rendered, then the tab page has to get resized to
// fill up the space, then the internal widgets have to resize yet again...causing flicker
switch(d->fillConfigWidget->selectedFillIndex()) {
case 0: // no fill
this->setMinimumHeight(130);
break;
case 1: // solid fill
this->setMinimumHeight(200);
break;
case 2: // gradient fill
this->setMinimumHeight(350);
case 3: // pattern fill
break;
case 0: // no fill
this->setMinimumHeight(130);
break;
case 1: // solid fill
this->setMinimumHeight(200);
break;
case 2: // gradient fill
this->setMinimumHeight(350);
case 3: // pattern fill
break;
}


Expand Down

0 comments on commit d5a62cd

Please sign in to comment.