Fix QIODevice::getChar optimization
Fix QIODevice::getChar optimization

In Text mode there would be a huge penalty on each '\r' found even if
the internal buffer was not exhausted, because we would repeatedly
remove the '\r' from the buffer and put it back it. Before following
through to the unoptimized code, anyway.

Instead, we now loop over the internal buffer until we find a suitable
character.

Reduced code duplication by having QIODevice::getChar directly call
QIODevice::read and letting compilers do their job.

Reviewed-by: Markus Goetz

igor-sfdc/qt-wk,pruiz/wkhtmltopdf-qt,igor-sfdc/qt-wk,igor-sfdc/qt-wk,pruiz/wkhtmltopdf-qt,radekp/qt,pruiz/wkhtmltopdf-qt,igor-sfdc/qt-wk,radekp/qt,pruiz/wkhtmltopdf-qt,radekp/qt,radekp/qt,igor-sfdc/qt-wk,pruiz/wkhtmltopdf-qt,radekp/qt,radekp/qt,radekp/qt,pruiz/wkhtmltopdf-qt,igor-sfdc/qt-wk,igor-sfdc/qt-wk,igor-sfdc/qt-wk,pruiz/wkhtmltopdf-qt,pruiz/wkhtmltopdf-qt,pruiz/wkhtmltopdf-qt,igor-sfdc/qt-wk,radekp/qt,radekp/qt,pruiz/wkhtmltopdf-qt,igor-sfdc/qt-wk,pruiz/wkhtmltopdf-qt,igor-sfdc/qt-wk,radekp/qt