Fix SortedField to not cause crashes when default copy-ctr is used
ClosedPublic

Authored by piggz on Jan 7 2017, 7:26 PM.

Details

Summary

Fixes crash in KexiDbReportData

Test Plan

Open kexi reports, ensure no crashes in SortedField

Diff Detail

Repository
R14 KReport
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
piggz updated this revision to Diff 9823.Jan 7 2017, 7:26 PM
piggz retitled this revision from to Fix SortedField to not cause crashes when default copy-ctr is used.
piggz updated this object.
piggz edited the test plan for this revision. (Show Details)
piggz added a reviewer: staniek.
Restricted Application added a project: KReport. · View Herald TranscriptJan 7 2017, 7:26 PM
staniek requested changes to this revision.Jan 7 2017, 8:20 PM
staniek edited edge metadata.
staniek added inline comments.
src/common/KReportData.cpp
54

Since we have KReportDataSortedFieldPrivateArgs, it's enough to white : d(new Private(*other.d)) and add a Private copy ctor:

KReportDataSortedFieldPrivateArgs((*this)) = KReportDataSortedFieldPrivateArgs(other)

(Private copy ctor to avoid coverity warnings)

69

*(other.d) -> *other.d ?

74

same here

This revision now requires changes to proceed.Jan 7 2017, 8:20 PM
piggz marked 3 inline comments as done.Jan 7 2017, 10:24 PM
piggz updated this revision to Diff 9828.Jan 7 2017, 10:25 PM
piggz edited edge metadata.
  • Implement review comments
staniek requested changes to this revision.Jan 7 2017, 10:56 PM
staniek edited edge metadata.

Thanks. Some new findings...

src/common/KReportData.h
44

missing const at the end

45

same here

This revision now requires changes to proceed.Jan 7 2017, 10:56 PM
piggz updated this revision to Diff 9830.Jan 7 2017, 11:02 PM
piggz edited edge metadata.
  • Constness
piggz marked 2 inline comments as done.Jan 7 2017, 11:02 PM
staniek accepted this revision.Jan 7 2017, 11:35 PM
staniek edited edge metadata.
This revision is now accepted and ready to land.Jan 7 2017, 11:35 PM
This revision was automatically updated to reflect the committed changes.