Bug 169027

Summary: [GTK] Fix problems found by Coverity scan in WebPrintOperationGtk.cpp
Product: WebKit Reporter: Tomas Popela <tpopela>
Component: WebKitGTKAssignee: Tomas Popela <tpopela>
Status: RESOLVED FIXED    
Severity: Normal CC: bugs-noreply, cgarcia, mcatanzaro
Priority: P2    
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 104114    
Attachments:
Description Flags
Patch none

Description Tomas Popela 2017-03-01 03:37:09 PST
65. webkitgtk-2.14.5/Source/WebKit2/WebProcess/WebPage/gtk/WebPrintOperationGtk.cpp:365: member_decl: Class member declaration for "totalToPrint".
66. webkitgtk-2.14.5/Source/WebKit2/WebProcess/WebPage/gtk/WebPrintOperationGtk.cpp:306: uninit_member: Non-static class member "totalToPrint" is not initialized in this constructor nor in any functions that it calls.
67. webkitgtk-2.14.5/Source/WebKit2/WebProcess/WebPage/gtk/WebPrintOperationGtk.cpp:372: member_decl: Class member declaration for "lastPagePosition".
68. webkitgtk-2.14.5/Source/WebKit2/WebProcess/WebPage/gtk/WebPrintOperationGtk.cpp:306: uninit_member: Non-static class member "lastPagePosition" is not initialized in this constructor nor in any functions that it calls.
#   304|           firstPagePosition = printOperation->pagePosition();
#   305|           firstSheetNumber = sheetNumber;
#   306|->     }
#   307|   
#   308|       size_t collatedCopiesLeft()

and

69. webkitgtk-2.14.5/Source/WebKit2/WebProcess/WebPage/gtk/WebPrintOperationGtk.cpp:365: member_decl: Class member declaration for "totalToPrint".
70. webkitgtk-2.14.5/Source/WebKit2/WebProcess/WebPage/gtk/WebPrintOperationGtk.cpp:299: uninit_member: Non-static class member "totalToPrint" is not initialized in this constructor nor in any functions that it calls.
#   297|           if (sheetNumber * numberUp >= pages.size()) {
#   298|               isValid = false;
#   299|->             return;
#   300|           }
#   301|   

actually the totalToPrint member is not used at all -> remove it.
Comment 1 Tomas Popela 2017-03-01 03:41:35 PST
Created attachment 303058 [details]
Patch
Comment 2 Tomas Popela 2017-03-01 06:16:01 PST
Comment on attachment 303058 [details]
Patch

Clearing flags on attachment: 303058

Committed r213217: <http://trac.webkit.org/changeset/213217>
Comment 3 Tomas Popela 2017-03-01 06:16:10 PST
All reviewed patches have been landed.  Closing bug.