diff options
-rw-r--r-- | src-qt5/desktop-utils/lumina-pdf/PrintWidget.cpp | 4 | ||||
-rw-r--r-- | src-qt5/desktop-utils/lumina-pdf/PrintWidget.h | 5 | ||||
-rw-r--r-- | src-qt5/desktop-utils/lumina-pdf/Renderer-mupdf.cpp | 3 | ||||
-rw-r--r-- | src-qt5/desktop-utils/lumina-pdf/mainUI.cpp | 5 | ||||
-rw-r--r-- | src-qt5/desktop-utils/lumina-pdf/mainUI.h | 1 | ||||
-rw-r--r-- | src-qt5/desktop-utils/lumina-pdf/textData.h | 14 |
6 files changed, 16 insertions, 16 deletions
diff --git a/src-qt5/desktop-utils/lumina-pdf/PrintWidget.cpp b/src-qt5/desktop-utils/lumina-pdf/PrintWidget.cpp index 45353295..bece454e 100644 --- a/src-qt5/desktop-utils/lumina-pdf/PrintWidget.cpp +++ b/src-qt5/desktop-utils/lumina-pdf/PrintWidget.cpp @@ -130,9 +130,9 @@ void PrintWidget::highlightText(TextData *text) { //Creates a rectangle around the text if the text has not already been highlighted if(!text->highlighted()) { //qDebug() << "Highlighting text: " << text->text() << "At page: " << text->page(); - fz_rect rect = text->loc(); + QRect rect = text->loc(); double pageHeight = pages.at(0)->boundingRect().height(); - QRectF textRect(QPointF(rect.x0, rect.y0+(pageHeight*(text->page()-1))), QPointF(rect.x1, rect.y1 + (pageHeight*(text->page()-1)))); + QRectF textRect = rect.adjusted(0, pageHeight*(text->page()-1), 0, 0); //move the rectangle onto the right page QBrush highlightFill(QColor(255, 255, 177, 50)); QPen highlightOutline(QColor(255, 255, 100, 98)); scene->addRect(textRect, highlightOutline, highlightFill); diff --git a/src-qt5/desktop-utils/lumina-pdf/PrintWidget.h b/src-qt5/desktop-utils/lumina-pdf/PrintWidget.h index 41902330..38227e78 100644 --- a/src-qt5/desktop-utils/lumina-pdf/PrintWidget.h +++ b/src-qt5/desktop-utils/lumina-pdf/PrintWidget.h @@ -106,7 +106,7 @@ private: void setZoomMode(ZoomMode); QGraphicsScene *scene; - QMatrix rotMatrix; + QMatrix rotMatrix; int curPage, publicPageNum; ViewMode viewMode; ZoomMode zoomMode; @@ -115,8 +115,7 @@ private: bool initialized, fitting; QList<QGraphicsItem*> pages; QHash<int, QImage> *pictures; - fz_document *doc; - int degrees; + int degrees; public: PrintWidget(QWidget *parent = 0); diff --git a/src-qt5/desktop-utils/lumina-pdf/Renderer-mupdf.cpp b/src-qt5/desktop-utils/lumina-pdf/Renderer-mupdf.cpp index 15379465..279888c6 100644 --- a/src-qt5/desktop-utils/lumina-pdf/Renderer-mupdf.cpp +++ b/src-qt5/desktop-utils/lumina-pdf/Renderer-mupdf.cpp @@ -121,7 +121,8 @@ QList<TextData*> Renderer::searchDocument(QString text, bool matchCase){ int count = fz_search_page_number(CTX, DOC, i, text.toLatin1().data(), rectBuffer, 1000); //qDebug() << "Page " << i+1 << ": Count, " << count; for(int j = 0; j < count; j++) { - TextData *t = new TextData(rectBuffer[j], i+1, text); + QRect rect(rectBuffer[j].x0, rectBuffer[j].y0, rectBuffer[j].x1-rectBuffer[j].x0, rectBuffer[j].y1 - rectBuffer[j].y0); + TextData *t = new TextData(rect, i+1, text); //MuPDF search does not match case, so retrieve the exact text at the location found and determine whether or not it matches the case of the search text if the user selected to match case if(matchCase){ fz_stext_page *sPage = fz_new_stext_page_from_page_number(CTX, DOC, i, NULL); diff --git a/src-qt5/desktop-utils/lumina-pdf/mainUI.cpp b/src-qt5/desktop-utils/lumina-pdf/mainUI.cpp index 01221309..4daf8ec9 100644 --- a/src-qt5/desktop-utils/lumina-pdf/mainUI.cpp +++ b/src-qt5/desktop-utils/lumina-pdf/mainUI.cpp @@ -1,5 +1,6 @@ -//=========================================== // Lumina Desktop source code -// Copyright (c) 2017, Ken Moore +//=========================================== +// Lumina Desktop source code +// Copyright (c) 2017-2018, Ken Moore // Available under the 3-clause BSD license // See the LICENSE file for full details //=========================================== diff --git a/src-qt5/desktop-utils/lumina-pdf/mainUI.h b/src-qt5/desktop-utils/lumina-pdf/mainUI.h index 68245f16..911456aa 100644 --- a/src-qt5/desktop-utils/lumina-pdf/mainUI.h +++ b/src-qt5/desktop-utils/lumina-pdf/mainUI.h @@ -101,7 +101,6 @@ private slots: signals: void PageLoaded(int); - void sendDocument(fz_document*); protected: void keyPressEvent(QKeyEvent*); diff --git a/src-qt5/desktop-utils/lumina-pdf/textData.h b/src-qt5/desktop-utils/lumina-pdf/textData.h index aa134cbb..546920b3 100644 --- a/src-qt5/desktop-utils/lumina-pdf/textData.h +++ b/src-qt5/desktop-utils/lumina-pdf/textData.h @@ -1,28 +1,28 @@ #ifndef textData_H #define textData_H -#include <mupdf/fitz.h> +#include <QRect> class TextData { private: - fz_rect _loc; + QRect _loc; bool _highlighted=false; int _page=0; - QString _text=""; + QString _text=""; public: - TextData(fz_rect _loc, int _page, QString _text) { + TextData(QRect _loc, int _page, QString _text) { this->_loc = _loc; this->_page = _page; this->_text = _text; } - fz_rect loc() { return this->_loc; } + QRect loc() { return this->_loc; } bool highlighted() { return this->_highlighted; } int page() { return this->_page; } QString text() { return this->_text; } - - void loc(fz_rect loc) { this->_loc = loc; } + + void loc(QRect loc) { this->_loc = loc; } void highlighted(bool highlighted) { this->_highlighted = highlighted; } void page(int page) { this->_page = page; } void text(QString text) { this->_text = text; } |