From d585d64718941d54b004daa0ece491783ef78ad8 Mon Sep 17 00:00:00 2001 From: ZackaryWelch Date: Sat, 17 Mar 2018 17:39:09 -0400 Subject: Replaced tabs with spaces and removed some unneeded comments --- .../desktop-utils/lumina-pdf/Renderer-poppler.cpp | 54 +++++++++++----------- 1 file changed, 27 insertions(+), 27 deletions(-) (limited to 'src-qt5/desktop-utils/lumina-pdf/Renderer-poppler.cpp') diff --git a/src-qt5/desktop-utils/lumina-pdf/Renderer-poppler.cpp b/src-qt5/desktop-utils/lumina-pdf/Renderer-poppler.cpp index 9ad29eba..e37d715d 100644 --- a/src-qt5/desktop-utils/lumina-pdf/Renderer-poppler.cpp +++ b/src-qt5/desktop-utils/lumina-pdf/Renderer-poppler.cpp @@ -12,8 +12,8 @@ Renderer::Renderer(){ } Renderer::~Renderer(){ - //qDeleteAll(loadingHash); - loadingHash.clear(); + //qDeleteAll(loadingHash); + loadingHash.clear(); } bool Renderer::loadMultiThread(){ return true; } @@ -30,13 +30,13 @@ bool Renderer::loadDocument(QString path, QString password){ DOC=0; needpass = false; pnum=0; - docpath = path; + docpath = path; } //Load the Document (if needed); if(DOC==0){ //qDebug() << "Loading Document"; DOC = Poppler::Document::load(path); - docpath = path; + docpath = path; } if(DOC==0){ @@ -73,45 +73,45 @@ void Renderer::cleanup() {} void Renderer::renderPage(int pagenum, QSize DPI){ //qDebug() << "Render Page:" << pagenum << DPI; if(DOC!=0){ - Poppler::Page *PAGE = DOC->page(pagenum); - QImage img; - if(PAGE!=0){ - //qDebug() << "Render Page:" << pagenum; - img = PAGE->renderToImage(DPI.width(),DPI.height()); - loadingHash.insert(pagenum, img); - //qDebug() << "Image after creation:" << img.isNull(); - delete PAGE; - } - //qDebug() << "Done Render Page:" << pagenum << img.size(); - }else{ - loadingHash.insert(pagenum, QImage()); - } - emit PageLoaded(pagenum); + Poppler::Page *PAGE = DOC->page(pagenum); + QImage img; + if(PAGE!=0){ + //qDebug() << "Render Page:" << pagenum; + img = PAGE->renderToImage(DPI.width(),DPI.height()); + loadingHash.insert(pagenum, img); + //qDebug() << "Image after creation:" << img.isNull(); + delete PAGE; + } + //qDebug() << "Done Render Page:" << pagenum << img.size(); + }else{ + loadingHash.insert(pagenum, QImage()); + } + emit PageLoaded(pagenum); } QList Renderer::searchDocument(QString text, bool matchCase){ QList results; for(int i = 0; i < pnum; i++) { - QList textList = DOC->page(i)->textList(); + QList textList = DOC->page(i)->textList(); for(int j = 0; j < textList.size(); j++) { - if(textList[j]->text().contains(text, - (matchCase) ? Qt::CaseSensitive : Qt::CaseInsensitive)) { - TextData *t = new TextData(textList[j]->boundingBox(), i+1, text); - results.append(t); - } + if(textList[j]->text().contains(text, + (matchCase) ? Qt::CaseSensitive : Qt::CaseInsensitive)) { + TextData *t = new TextData(textList[j]->boundingBox(), i+1, text); + results.append(t); + } } } return results; } QImage Renderer::imageHash(int pagenum) { - return loadingHash[pagenum]; + return loadingHash[pagenum]; } int Renderer::hashSize() { - return loadingHash.keys().length(); + return loadingHash.keys().length(); } void Renderer::clearHash() { - loadingHash.clear(); + loadingHash.clear(); } -- cgit