Skip to content

Commit

Permalink
Issue #137: Redaction - Cannot convert '#000000' to color value
Browse files Browse the repository at this point in the history
  • Loading branch information
JakubMelka committed Dec 28, 2023
1 parent 905a9e4 commit e4875c4
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
4 changes: 2 additions & 2 deletions Pdf4QtLibCore/sources/pdfredact.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (C) 2020-2022 Jakub Melka
// Copyright (C) 2020-2023 Jakub Melka
//
// This file is part of PDF4QT.
//
Expand Down Expand Up @@ -98,7 +98,7 @@ PDFDocument PDFRedact::perform(Options options)
const PDFRedactAnnotation* redactAnnotation = dynamic_cast<const PDFRedactAnnotation*>(annotation.get());
Q_ASSERT(redactAnnotation);

redactPath.addPath(redactAnnotation->getRedactionRegion().getPath());
redactPath = redactPath.united(redactAnnotation->getRedactionRegion().getPath());
}

QTransform matrix;
Expand Down
4 changes: 2 additions & 2 deletions Pdf4QtViewer/pdfviewersettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ void PDFViewerSettings::readSettings(QSettings& settings, const pdf::PDFCMSSetti

settings.beginGroup("ViewerSettings");
m_settings.m_directory = settings.value("defaultDirectory", QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation)).toString();
m_settings.m_features = static_cast<pdf::PDFRenderer::Features>(settings.value("rendererFeatures", static_cast<int>(pdf::PDFRenderer::getDefaultFeatures())).toInt());
m_settings.m_features = static_cast<pdf::PDFRenderer::Features>(settings.value("rendererFeaturesv2", static_cast<int>(pdf::PDFRenderer::getDefaultFeatures())).toInt());
m_settings.m_rendererEngine = static_cast<pdf::RendererEngine>(settings.value("renderingEngine", static_cast<int>(pdf::RendererEngine::OpenGL)).toInt());
m_settings.m_multisampleAntialiasing = settings.value("msaa", defaultSettings.m_multisampleAntialiasing).toBool();
m_settings.m_rendererSamples = settings.value("rendererSamples", defaultSettings.m_rendererSamples).toInt();
Expand Down Expand Up @@ -118,7 +118,7 @@ void PDFViewerSettings::writeSettings(QSettings& settings)
{
settings.beginGroup("ViewerSettings");
settings.setValue("defaultDirectory", m_settings.m_directory);
settings.setValue("rendererFeatures", static_cast<int>(m_settings.m_features));
settings.setValue("rendererFeaturesv2", static_cast<int>(m_settings.m_features));
settings.setValue("renderingEngine", static_cast<int>(m_settings.m_rendererEngine));
settings.setValue("msaa", m_settings.m_multisampleAntialiasing);
settings.setValue("rendererSamples", m_settings.m_rendererSamples);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ QColor CreateRedactedDocumentDialog::getRedactColor() const

if (ui->fillRedactedAreaCheckBox->isChecked())
{
color.fromString(ui->fillRedactedAreaColorEdit->text());
color = QColor::fromString(ui->fillRedactedAreaColorEdit->text());
}

return color;
Expand Down Expand Up @@ -106,8 +106,8 @@ void CreateRedactedDocumentDialog::accept()
{
if (ui->fillRedactedAreaCheckBox->isChecked())
{
QColor color;
color.fromString(ui->fillRedactedAreaColorEdit->text());
QColor color = QColor::fromString(ui->fillRedactedAreaColorEdit->text());

if (!color.isValid())
{
QMessageBox::critical(this, tr("Error"), tr("Cannot convert '%1' to color value.").arg(ui->fillRedactedAreaColorEdit->text()));
Expand Down
1 change: 1 addition & 0 deletions RELEASES.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
CURRENT:
- Issue #137: Redaction - Cannot convert '#000000' to color value
- Issue #134: Add search bar for actions
- Issue #129: Cannot compile with lcms 2.16
- Issue #128: Create list of markup annotations
Expand Down

0 comments on commit e4875c4

Please sign in to comment.