Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 34 additions & 5 deletions src/dpdfannot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,24 @@
//
// SPDX-License-Identifier: LGPL-3.0-or-later

#include "dpdfannot.h"

Check warning on line 5 in src/dpdfannot.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: "dpdfannot.h" not found.
#include <QDebug>

Check warning on line 6 in src/dpdfannot.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <QDebug> not found. Please note: Cppcheck does not need standard library headers to get proper results.

DPdfAnnot::AnnotType DPdfAnnot::type()
{
qDebug() << "Getting annotation type:" << m_type;
return m_type;
}

void DPdfAnnot::setText(QString text)
{
qDebug() << "Setting annotation text:" << text;
m_text = text;
}

QString DPdfAnnot::text()
{
qDebug() << "Getting annotation text:" << m_text;
return m_text;
}

Expand All @@ -31,6 +35,7 @@

QList<QRectF> DPdfTextAnnot::boundaries()
{
qDebug() << "Getting text annotation boundaries";
QList<QRectF> list;

list << m_rect;
Expand All @@ -40,6 +45,7 @@

void DPdfTextAnnot::setRectF(const QRectF &rectf)
{
qDebug() << "Setting text annotation rectangle:" << rectf;
m_rect = rectf;
}

Expand All @@ -55,11 +61,13 @@

QList<QRectF> DPdfSquareAnnot::boundaries()
{
qDebug() << "Getting square annotation boundaries";
return QList<QRectF>() << m_rect;
}

void DPdfSquareAnnot::setRectF(const QRectF &rectf)
{
qDebug() << "Setting square annotation rectangle:" << rectf;
m_rect = rectf;
}

Expand All @@ -80,21 +88,25 @@

void DPdfHightLightAnnot::setColor(QColor color)
{
qDebug() << "Setting highlight annotation color:" << color;
m_color = color;
}

QColor DPdfHightLightAnnot::color()
{
qDebug() << "Getting highlight annotation color:" << m_color;
return m_color;
}

void DPdfHightLightAnnot::setBoundaries(QList<QRectF> rectList)
{
qDebug() << "Setting highlight annotation boundaries, count:" << rectList.size();
m_rectList = rectList;
}

QList<QRectF> DPdfHightLightAnnot::boundaries()
{
qDebug() << "Getting highlight annotation boundaries";
return m_rectList;
}

Expand Down Expand Up @@ -134,6 +146,7 @@

QList<QRectF> DPdfLinkAnnot::boundaries()
{
qDebug() << "Getting link annotation boundaries";
QList<QRectF> list;

list << m_rect;
Expand All @@ -143,41 +156,50 @@

void DPdfLinkAnnot::setRectF(const QRectF &rect)
{
qDebug() << "Setting link annotation rectangle:" << rect;
m_rect = rect;
}

void DPdfLinkAnnot::setUrl(QString url)
{
qDebug() << "Setting link annotation URL:" << url;
m_url = url;

if (!m_url.contains("http://") && !m_url.contains("https://"))
if (!m_url.contains("http://") && !m_url.contains("https://")) {
qDebug() << "Prepending http:// to URL";
m_url.prepend("http://");
}
}

QString DPdfLinkAnnot::url() const
{
qDebug() << "Getting link annotation URL:" << m_url;
return m_url;
}

void DPdfLinkAnnot::setFilePath(QString filePath)
{
qDebug() << "Setting link annotation file path:" << filePath;
m_filePath = filePath;
}

QString DPdfLinkAnnot::filePath() const
{
qDebug() << "Getting link annotation file path:" << m_filePath;
return m_filePath;
}

void DPdfLinkAnnot::setPage(int index, float left, float top)
{
qDebug() << "Setting link annotation page properties - index:" << index << "left:" << left << "top:" << top;
m_index = index;
m_left = left;
m_top = top;
}

int DPdfLinkAnnot::pageIndex() const
{
qDebug() << "Getting link annotation page index:" << m_index;
return m_index;
}

Expand All @@ -188,20 +210,21 @@

void DPdfLinkAnnot::setLinkType(int type)
{
qDebug() << "Setting link annotation type:" << type;
m_linkType = type;
}

int DPdfLinkAnnot::linkType() const
{
qDebug() << "Getting link annotation type:" << m_linkType;
return m_linkType;
}

bool DPdfLinkAnnot::isValid() const
{
if (Goto == m_linkType)
return m_index != -1;

return true;
bool valid = (Goto == m_linkType) ? (m_index != -1) : true;
qDebug() << "Checking link annotation validity:" << valid;
return valid;
}

DPdfCIRCLEAnnot::DPdfCIRCLEAnnot()
Expand All @@ -216,16 +239,19 @@

QList<QRectF> DPdfCIRCLEAnnot::boundaries()
{
qDebug() << "Getting circle annotation boundaries";
return QList<QRectF>() << m_rect;
}

void DPdfCIRCLEAnnot::setRectF(const QRectF &rectf)
{
qDebug() << "Setting circle annotation rectangle:" << rectf;
m_rect = rectf;
}

void DPdfCIRCLEAnnot::setBoundaries(QList<QRectF> rectList)
{
qDebug() << "Setting circle annotation boundaries, count:" << rectList.size();
m_rectList = rectList;
}

Expand All @@ -241,11 +267,13 @@

QList<QRectF> DPdfUnderlineAnnot::boundaries()
{
qDebug() << "Getting underline annotation boundaries";
return QList<QRectF>() << m_rect;
}

void DPdfUnderlineAnnot::setRectF(const QRectF &rectf)
{
qDebug() << "Setting underline annotation rectangle:" << rectf;
m_rect = rectf;
}

Expand All @@ -262,5 +290,6 @@

QList<QRectF> DPdfWidgetAnnot::boundaries()
{
qDebug() << "Getting widget annotation boundaries";
return QList<QRectF>();
}
Loading