Mostly uninitialised variables and non checks for dynamic_cast
- R14:b7ee4ca8e5a1: Fixes for issues picked up by coverity
Run kreportexample and test rendering
I propose much smaller change set, using approach known from KDb/KProperty/Kexi. Thanks and sorry for not discussing earlier.
Probably it will be easier for you to apply the patch to a new branch without commiting and selectively pick line changes e.g. using git-gui.
This is not needed. This class of warnings is a false positive. If you mark them as such at coverity.com we don't need any changes and next time it won't complain. Please note that setting nullptr here is misleading.
If you want you can change initialization from Private::Private() to an initializer list:
: set(new KPropertySet), ....
not needed, false positive :/
this = nullptr not needed, false positive :/
not needed, it's properly initialized
not needed, I propose to mark as a false positive
not needed, I propose to mark all these as false positives
or 3 of them can be changed to initializers in Private()
I propose to mark false positives for members that are initialized in KReportDesigner::init() and don't initialize here.
Summing up, if we fake-initialize just to silent the Coverity here we can miss the fact that we forget to allocate an object when we change KReportDesigner::init(), it would not be noticed.
|33 ↗||(On Diff #9402)|
I propose to mark both as false positives without initializing here.
Can we avoid the underscore?
Can we skip the _?
BTW, Hmm why KReportDpiSingleton::m_dpiX/Y == 75?
both not needed, KReportDesignerItemRectBase initializes them; I propose to mark false positives
Hmm are these 4 members used?
Not needed... all false positives please
Can we skip _?
I updated this review becuase it was easier to track the needed changes here, rather than in coverity, which has a really annoying interface....i cant get the panel of issues to display properly with all issues, and the code view below!
From what I gather, 96 is most common fall-back dpi, so lets use that
Good. I do realize that removing can mean more work than adding :)
not needed, it's initialized in the ctor
Still, not needed, there's d->dpiY = KReportPrivate::dpiY(); code below
I see that m_minorSteps is used in two KReportDesignerSectionScene methods. Proposed: move it to local variable from here.
Not needed, always set in the ctor, is this even a false positive?
The c++11 way in Private() if it is only possible. Here it is.
Most known exceptions are related to creating QWidgets/QObjects where we have to do that in ctor of the regular class.