mirror of
https://github.com/JakubMelka/PDF4QT.git
synced 2025-06-05 21:59:17 +02:00
Issue #25: Remove pro/qbs, fix MSVC build
This commit is contained in:
@@ -206,7 +206,7 @@ PDFCreateLineTypeTool::PDFCreateLineTypeTool(PDFDrawWidgetProxy* proxy, PDFToolM
|
||||
addTool(m_pickTool);
|
||||
connect(m_pickTool, &PDFPickTool::pointPicked, this, &PDFCreateLineTypeTool::onPointPicked);
|
||||
|
||||
m_fillColor.setAlphaF(0.2);
|
||||
m_fillColor.setAlphaF(0.2f);
|
||||
|
||||
updateActions();
|
||||
}
|
||||
@@ -495,7 +495,7 @@ PDFCreateEllipseTool::PDFCreateEllipseTool(PDFDrawWidgetProxy* proxy, PDFToolMan
|
||||
addTool(m_pickTool);
|
||||
connect(m_pickTool, &PDFPickTool::rectanglePicked, this, &PDFCreateEllipseTool::onRectanglePicked);
|
||||
|
||||
m_fillColor.setAlphaF(0.2);
|
||||
m_fillColor.setAlphaF(0.2f);
|
||||
|
||||
updateActions();
|
||||
}
|
||||
|
@@ -1309,7 +1309,7 @@ void PDFAnnotationManager::drawWidgetAnnotationHighlight(QRectF annotationRectan
|
||||
|
||||
if (color.isValid())
|
||||
{
|
||||
color.setAlphaF(0.2);
|
||||
color.setAlphaF(0.2f);
|
||||
|
||||
// Draw annotation rectangle by highlight color
|
||||
QPainterPath highlightArea;
|
||||
@@ -2128,8 +2128,8 @@ void PDFWidgetAnnotationManager::createWidgetsForMarkupAnnotations(QWidget* pare
|
||||
|
||||
const PDFMarkupAnnotation* markupMainAnnotation = pageAnnotation.annotation->asMarkupAnnotation();
|
||||
QColor color = markupMainAnnotation->getDrawColorFromAnnotationColor(markupMainAnnotation->getColor(), 1.0);
|
||||
QColor titleColor = QColor::fromHslF(color.hueF(), color.saturationF(), 0.2, 1.0);
|
||||
QColor backgroundColor = QColor::fromHslF(color.hueF(), color.saturationF(), 0.9, 1.0);
|
||||
QColor titleColor = QColor::fromHslF(color.hueF(), color.saturationF(), 0.2f, 1.0f);
|
||||
QColor backgroundColor = QColor::fromHslF(color.hueF(), color.saturationF(), 0.9f, 1.0f);
|
||||
|
||||
QString style = "QGroupBox { "
|
||||
"border: 2px solid black; "
|
||||
|
@@ -26,6 +26,11 @@
|
||||
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
|
||||
#endif
|
||||
|
||||
#if defined(PDF4QT_COMPILER_MSVC)
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable: 4996)
|
||||
#endif
|
||||
|
||||
#include <openssl/bio.h>
|
||||
#include <openssl/rsa.h>
|
||||
#include <openssl/rsaerr.h>
|
||||
@@ -258,3 +263,7 @@ bool PDFSignatureFactory::sign(QString certificateName, QString password, QByteA
|
||||
#if defined(PDF4QT_COMPILER_MINGW) || defined(PDF4QT_COMPILER_GCC)
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
|
||||
#if defined(PDF4QT_COMPILER_MSVC)
|
||||
#pragma warning(pop)
|
||||
#endif
|
||||
|
@@ -2052,7 +2052,7 @@ std::vector<PDFColorComponent> PDFIndexedColorSpace::transformColorsToBaseColorS
|
||||
const int byteOffset = int(colorIndex * colorComponentCount);
|
||||
|
||||
// We must point into the array. Check first and last component.
|
||||
Q_ASSERT(byteOffset + colorComponentCount - 1 < m_colors.size());
|
||||
Q_ASSERT(byteOffset + colorComponentCount - 1 < static_cast<size_t>(m_colors.size()));
|
||||
|
||||
const char* bytePointer = m_colors.constData() + byteOffset;
|
||||
|
||||
|
@@ -171,7 +171,7 @@ PDFInteger PDFDocumentReader::findXrefTableOffset(const QByteArray& buffer)
|
||||
throw PDFException(tr("Start of object reference table not found."));
|
||||
}
|
||||
|
||||
Q_ASSERT(startXRefPosition + std::strlen(PDF_START_OF_XREF_MARK) < buffer.size());
|
||||
Q_ASSERT(startXRefPosition + std::strlen(PDF_START_OF_XREF_MARK) < static_cast<size_t>(buffer.size()));
|
||||
PDFLexicalAnalyzer analyzer(buffer.constData() + startXRefPosition + std::strlen(PDF_START_OF_XREF_MARK), buffer.constData() + buffer.size());
|
||||
const PDFLexicalAnalyzer::Token token = analyzer.fetch();
|
||||
if (token.type != PDFLexicalAnalyzer::TokenType::Integer)
|
||||
|
@@ -245,7 +245,7 @@ void PDFStructureTreeTextContentProcessor::finishText()
|
||||
if (trimmedText.size() < m_currentText.size())
|
||||
{
|
||||
// Fix character bounding boxes...
|
||||
if (m_characterBoundingRects.size() == m_currentText.size())
|
||||
if (m_characterBoundingRects.size() == static_cast<size_t>(m_currentText.size()))
|
||||
{
|
||||
std::vector<QRectF> boundingRects(std::next(m_characterBoundingRects.cbegin(), index), std::next(m_characterBoundingRects.cbegin(), index + trimmedText.length()));
|
||||
m_characterBoundingRects = std::move(boundingRects);
|
||||
@@ -266,7 +266,7 @@ void PDFStructureTreeTextContentProcessor::finishText()
|
||||
m_currentText = qMove(reversed);
|
||||
std::reverse(m_characterBoundingRects.begin(), m_characterBoundingRects.end());
|
||||
}
|
||||
Q_ASSERT(m_currentText.size() == m_characterBoundingRects.size() || m_characterBoundingRects.empty());
|
||||
Q_ASSERT(static_cast<size_t>(m_currentText.size()) == m_characterBoundingRects.size() || m_characterBoundingRects.empty());
|
||||
m_textSequence.emplace_back(PDFStructureTreeTextItem::createText(std::move(m_currentText), m_pageIndex, m_currentBoundingBox, std::move(m_characterBoundingRects)));
|
||||
}
|
||||
m_currentText = QString();
|
||||
|
@@ -2286,9 +2286,9 @@ void PDFPageContentElementManipulator::drawPage(QPainter* painter,
|
||||
PDFPainterStateGuard guard(painter);
|
||||
QPen pen(Qt::SolidLine);
|
||||
pen.setWidthF(2.0);
|
||||
pen.setColor(QColor::fromRgbF(0.8, 0.8, 0.1, 0.7));
|
||||
pen.setColor(QColor::fromRgbF(0.8f, 0.8f, 0.1f, 0.7f));
|
||||
QBrush brush(Qt::SolidPattern);
|
||||
brush.setColor(QColor::fromRgbF(1.0, 1.0, 0.0, 0.2));
|
||||
brush.setColor(QColor::fromRgbF(1.0f, 1.0f, 0.0f, 0.2f));
|
||||
|
||||
painter->setPen(std::move(pen));
|
||||
painter->setBrush(std::move(brush));
|
||||
|
@@ -705,7 +705,7 @@ PDFObject PDFParser::getObject()
|
||||
{
|
||||
case PDFLexicalAnalyzer::TokenType::Boolean:
|
||||
{
|
||||
Q_ASSERT(m_lookAhead1.data.typeId() == QVariant::Bool);
|
||||
Q_ASSERT(m_lookAhead1.data.typeId() == QMetaType::Bool);
|
||||
const bool value = m_lookAhead1.data.toBool();
|
||||
shift();
|
||||
return PDFObject::createBool(value);
|
||||
@@ -713,7 +713,7 @@ PDFObject PDFParser::getObject()
|
||||
|
||||
case PDFLexicalAnalyzer::TokenType::Integer:
|
||||
{
|
||||
Q_ASSERT(m_lookAhead1.data.typeId() == QVariant::LongLong);
|
||||
Q_ASSERT(m_lookAhead1.data.typeId() == QMetaType::LongLong);
|
||||
const PDFInteger value = m_lookAhead1.data.toLongLong();
|
||||
shift();
|
||||
|
||||
@@ -723,7 +723,7 @@ PDFObject PDFParser::getObject()
|
||||
m_lookAhead2.type == PDFLexicalAnalyzer::TokenType::Command &&
|
||||
m_lookAhead2.data.toByteArray() == PDF_REFERENCE_COMMAND)
|
||||
{
|
||||
Q_ASSERT(m_lookAhead1.data.typeId() == QVariant::LongLong);
|
||||
Q_ASSERT(m_lookAhead1.data.typeId() == QMetaType::LongLong);
|
||||
const PDFInteger generation = m_lookAhead1.data.toLongLong();
|
||||
shift();
|
||||
shift();
|
||||
@@ -738,7 +738,7 @@ PDFObject PDFParser::getObject()
|
||||
|
||||
case PDFLexicalAnalyzer::TokenType::Real:
|
||||
{
|
||||
Q_ASSERT(m_lookAhead1.data.typeId() == QVariant::Double);
|
||||
Q_ASSERT(m_lookAhead1.data.typeId() == QMetaType::Double);
|
||||
const PDFReal value = m_lookAhead1.data.toDouble();
|
||||
shift();
|
||||
return PDFObject::createReal(value);
|
||||
@@ -746,7 +746,7 @@ PDFObject PDFParser::getObject()
|
||||
|
||||
case PDFLexicalAnalyzer::TokenType::String:
|
||||
{
|
||||
Q_ASSERT(m_lookAhead1.data.typeId() == QVariant::ByteArray);
|
||||
Q_ASSERT(m_lookAhead1.data.typeId() == QMetaType::QByteArray);
|
||||
QByteArray array = m_lookAhead1.data.toByteArray();
|
||||
array.shrink_to_fit();
|
||||
shift();
|
||||
@@ -755,7 +755,7 @@ PDFObject PDFParser::getObject()
|
||||
|
||||
case PDFLexicalAnalyzer::TokenType::Name:
|
||||
{
|
||||
Q_ASSERT(m_lookAhead1.data.typeId() == QVariant::ByteArray);
|
||||
Q_ASSERT(m_lookAhead1.data.typeId() == QMetaType::QByteArray);
|
||||
QByteArray array = m_lookAhead1.data.toByteArray();
|
||||
array.shrink_to_fit();
|
||||
shift();
|
||||
|
@@ -31,6 +31,11 @@
|
||||
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
|
||||
#endif
|
||||
|
||||
#if defined(PDF4QT_COMPILER_MSVC)
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable: 4996)
|
||||
#endif
|
||||
|
||||
#include <openssl/rc4.h>
|
||||
#include <openssl/md5.h>
|
||||
#include <openssl/aes.h>
|
||||
@@ -2605,7 +2610,7 @@ PDFObject PDFPublicKeySecurityHandler::createEncryptionDictionaryObject() const
|
||||
factory << PDFInteger(int32_t(m_permissions));
|
||||
factory.endDictionaryItem();
|
||||
|
||||
// Jakub Melka: 131105 is mysterious value set by Adobe Acrobat Pro
|
||||
// Jakub Melka: 131105 is mysterious value set by Acrobat Pro
|
||||
// when using public key security
|
||||
factory.beginDictionaryItem("R");
|
||||
factory << PDFInteger(131105);
|
||||
@@ -2622,3 +2627,6 @@ PDFObject PDFPublicKeySecurityHandler::createEncryptionDictionaryObject() const
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
|
||||
#if defined(PDF4QT_COMPILER_MSVC)
|
||||
#pragma warning(pop)
|
||||
#endif
|
||||
|
@@ -28,6 +28,11 @@
|
||||
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
|
||||
#endif
|
||||
|
||||
#if defined(PDF4QT_COMPILER_MSVC)
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable: 4996)
|
||||
#endif
|
||||
|
||||
#include <openssl/err.h>
|
||||
#include <openssl/sha.h>
|
||||
#include <openssl/rsa.h>
|
||||
@@ -2109,3 +2114,7 @@ pdf::PDFCertificateStore::CertificateEntries pdf::PDFCertificateStore::getSystem
|
||||
#if defined(PDF4QT_COMPILER_MINGW) || defined(PDF4QT_COMPILER_GCC)
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
|
||||
#if defined(PDF4QT_COMPILER_MSVC)
|
||||
#pragma warning(pop)
|
||||
#endif
|
||||
|
@@ -1394,7 +1394,7 @@ void PDFSelectTableTool::drawPage(QPainter* painter,
|
||||
if (isTablePicked() && pageIndex == m_pageIndex)
|
||||
{
|
||||
PDFPainterStateGuard guard(painter);
|
||||
QColor color = QColor::fromRgbF(0.0, 0.0, 0.5, 0.2);
|
||||
QColor color = QColor::fromRgbF(0.0f, 0.0f, 0.5f, 0.2f);
|
||||
QRectF rectangle = pagePointToDevicePointMatrix.mapRect(m_pickedRectangle);
|
||||
|
||||
const PDFReal lineWidth = PDFWidgetUtils::scaleDPI_x(getProxy()->getWidget(), 2.0);
|
||||
|
@@ -10360,7 +10360,7 @@ void PDFXFALayoutEngine::layoutFlow(LayoutParameters& layoutParameters, bool bre
|
||||
QStringList colWidths = layoutParameters.colWidths.split(' ', Qt::SkipEmptyParts);
|
||||
for (size_t i = 0; i < columnWidths.size(); ++i)
|
||||
{
|
||||
if (i >= colWidths.size())
|
||||
if (i >= static_cast<size_t>(colWidths.size()))
|
||||
{
|
||||
break;
|
||||
}
|
||||
@@ -12134,19 +12134,19 @@ void PDFXFAEngineImpl::drawUi(const xfa::XFA_ui* ui,
|
||||
passwordEdit || signature || textEdit;
|
||||
const bool isDefaultUi = !isNonDefaultUi || defaultUi;
|
||||
|
||||
if (textEdit || (isDefaultUi && value.value.typeId() == QVariant::String))
|
||||
if (textEdit || (isDefaultUi && value.value.typeId() == QMetaType::QString))
|
||||
{
|
||||
drawUiTextEdit(textEdit, value, errors, nominalExtentArea, paragraphSettingsIndex, painter);
|
||||
}
|
||||
else if (checkButton || (isDefaultUi && value.value.typeId() == QVariant::Bool))
|
||||
else if (checkButton || (isDefaultUi && value.value.typeId() == QMetaType::Bool))
|
||||
{
|
||||
drawUiCheckButton(checkButton, value, nominalExtentArea, painter);
|
||||
}
|
||||
else if (imageEdit || (isDefaultUi && value.value.typeId() == QVariant::Image))
|
||||
else if (imageEdit || (isDefaultUi && value.value.typeId() == QMetaType::QImage))
|
||||
{
|
||||
drawUiImageEdit(imageEdit, value, errors, nominalExtentArea, painter);
|
||||
}
|
||||
else if (numericEdit || (isDefaultUi && value.value.typeId() == QVariant::Double))
|
||||
else if (numericEdit || (isDefaultUi && value.value.typeId() == QMetaType::Double))
|
||||
{
|
||||
drawUiNumericEdit(numericEdit, value, errors, nominalExtentArea, paragraphSettingsIndex, painter);
|
||||
}
|
||||
@@ -12166,9 +12166,9 @@ void PDFXFAEngineImpl::drawUi(const xfa::XFA_ui* ui,
|
||||
{
|
||||
errors << PDFRenderError(RenderErrorType::NotImplemented, PDFTranslationContext::tr("XFA: Buttons not implemented."));
|
||||
}
|
||||
else if (dateTimeEdit || (isDefaultUi && (value.value.typeId() == QVariant::DateTime ||
|
||||
value.value.typeId() == QVariant::Date ||
|
||||
value.value.typeId() == QVariant::Time)))
|
||||
else if (dateTimeEdit || (isDefaultUi && (value.value.typeId() == QMetaType::QDateTime ||
|
||||
value.value.typeId() == QMetaType::QDate ||
|
||||
value.value.typeId() == QMetaType::QTime)))
|
||||
{
|
||||
drawUiDateTimeEdit(dateTimeEdit, value, errors, nominalExtentArea, paragraphSettingsIndex, painter);
|
||||
}
|
||||
@@ -12391,15 +12391,15 @@ void PDFXFAEngineImpl::drawUiDateTimeEdit(const xfa::XFA_dateTimeEdit* dateTimeE
|
||||
|
||||
QString text;
|
||||
|
||||
if (value.value.typeId() == QVariant::DateTime)
|
||||
if (value.value.typeId() == QMetaType::QDateTime)
|
||||
{
|
||||
text = value.value.toDateTime().toString();
|
||||
}
|
||||
else if (value.value.typeId() == QVariant::Time)
|
||||
else if (value.value.typeId() == QMetaType::QTime)
|
||||
{
|
||||
text = value.value.toTime().toString();
|
||||
}
|
||||
else if (value.value.typeId() == QVariant::Date)
|
||||
else if (value.value.typeId() == QMetaType::QDate)
|
||||
{
|
||||
text = value.value.toDate().toString();
|
||||
}
|
||||
|
Reference in New Issue
Block a user