[poppler] 2 commits - poppler/Annot.cc poppler/Annot.h poppler/TextOutputDev.cc qt5/src

2019-07-09 Thread GitLab Mirror
 poppler/Annot.cc   |1 +
 poppler/Annot.h|1 +
 poppler/TextOutputDev.cc   |4 ++--
 qt5/src/poppler-form.cc|1 +
 qt5/src/poppler-form.h |1 +
 qt5/src/poppler-private.cc |1 +
 qt5/src/poppler-private.h  |1 +
 7 files changed, 8 insertions(+), 2 deletions(-)

New commits:
commit 2d191b49ea074cc69ba4c68a572f26c8bdb55abd
Author: Albert Astals Cid 
Date:   Wed Jul 10 01:10:22 2019 +0200

Fix mistake on 093531cd0d0878b892d92ebc56c26936e5de3712

These i should have been j too

diff --git a/poppler/TextOutputDev.cc b/poppler/TextOutputDev.cc
index e62e088c..645e38fd 100644
--- a/poppler/TextOutputDev.cc
+++ b/poppler/TextOutputDev.cc
@@ -4791,8 +4791,8 @@ void TextSelectionPainter::endPage()
 if (j != begin && sel->word->charPos[j] == sel->word->charPos[j - 1])
   continue;
 
-   out->drawChar(state, sel->word->textMat[i].m[4], 
sel->word->textMat[i].m[5], 0, 0, 0, 0,
- sel->word->charcode[i], 1, nullptr, 0);
+   out->drawChar(state, sel->word->textMat[j].m[4], 
sel->word->textMat[j].m[5], 0, 0, 0, 0,
+ sel->word->charcode[j], 1, nullptr, 0);
   }
   out->endString(state);
   delete string;
commit bf7d1b7daa7c573237884f42f28d38ce335ea49b
Author: Albert Astals Cid 
Date:   Tue Jul 9 00:04:48 2019 +0200

Update (C) of last commit

diff --git a/poppler/Annot.cc b/poppler/Annot.cc
index 005fa96e..bd3aaa5f 100644
--- a/poppler/Annot.cc
+++ b/poppler/Annot.cc
@@ -43,6 +43,7 @@
 // Copyright (C) 2018, 2019 Tobias Deiminger 
 // Copyright (C) 2018, 2019 Oliver Sander 
 // Copyright (C) 2019 Umang Malik 
+// Copyright (C) 2019 João Netto 
 //
 // To see a description of the changes please see the Changelog file that
 // came with your tarball or type make ChangeLog if you are building from git
diff --git a/poppler/Annot.h b/poppler/Annot.h
index 7b374644..1c61e701 100644
--- a/poppler/Annot.h
+++ b/poppler/Annot.h
@@ -32,6 +32,7 @@
 // Copyright (C) 2018 Oliver Sander 
 // Copyright (C) 2018 Adam Reichold 
 // Copyright (C) 2019 Umang Malik 
+// Copyright (C) 2019 João Netto 
 //
 // To see a description of the changes please see the Changelog file that
 // came with your tarball or type make ChangeLog if you are building from git
diff --git a/qt5/src/poppler-form.cc b/qt5/src/poppler-form.cc
index 111d5b09..c95a9623 100644
--- a/qt5/src/poppler-form.cc
+++ b/qt5/src/poppler-form.cc
@@ -9,6 +9,7 @@
  * Copyright (C) 2018 Klarälvdalens Datakonsult AB, a KDAB Group company, 
. Work sponsored by the LiMux project of the city of Munich
  * Copyright (C) 2018 Chinmoy Ranjan Pradhan 
  * Copyright (C) 2018 Oliver Sander 
+ * Copyright (C) 2019 João Netto 
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
diff --git a/qt5/src/poppler-form.h b/qt5/src/poppler-form.h
index ac00da26..4e356b8e 100644
--- a/qt5/src/poppler-form.h
+++ b/qt5/src/poppler-form.h
@@ -8,6 +8,7 @@
  * Copyright (C) 2018, Andre Heinecke 
  * Copyright (C) 2018, Chinmoy Ranjan Pradhan 
  * Copyright (C) 2018, Oliver Sander 
+ * Copyright (C) 2019 João Netto 
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
diff --git a/qt5/src/poppler-private.cc b/qt5/src/poppler-private.cc
index 5a8b6e79..a3fbec36 100644
--- a/qt5/src/poppler-private.cc
+++ b/qt5/src/poppler-private.cc
@@ -8,6 +8,7 @@
  * Copyright (C) 2018 Klarälvdalens Datakonsult AB, a KDAB Group company, 
. Work sponsored by the LiMux project of the city of Munich
  * Copyright (C) 2018, 2019 Adam Reichold 
  * Copyright (C) 2019 Oliver Sander 
+ * Copyright (C) 2019 João Netto 
  * Inspired on code by
  * Copyright (C) 2004 by Albert Astals Cid 
  * Copyright (C) 2004 by Enrico Ros 
diff --git a/qt5/src/poppler-private.h b/qt5/src/poppler-private.h
index 4bcd263f..de5ec041 100644
--- a/qt5/src/poppler-private.h
+++ b/qt5/src/poppler-private.h
@@ -14,6 +14,7 @@
  * Copyright (C) 2018 Klarälvdalens Datakonsult AB, a KDAB Group company, 
. Work sponsored by the LiMux project of the city of Munich
  * Copyright (C) 2018 Adam Reichold 
  * Copyright (C) 2019 Oliver Sander 
+ * Copyright (C) 2019 João Netto 
  * Inspired on code by
  * Copyright (C) 2004 by Albert Astals Cid 
  * Copyright (C) 2004 by Enrico Ros 
___
poppler mailing list
poppler@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/poppler

[poppler] qt5/src qt5/tests

2019-07-09 Thread GitLab Mirror
 qt5/src/poppler-form.cc   |   16 
 qt5/src/poppler-form.h|   12 
 qt5/tests/check_forms.cpp |   20 
 3 files changed, 48 insertions(+)

New commits:
commit 04e8309d18fa2f90ed93930e7eb689e523c7eb44
Author: João Netto 
Date:   Mon Jul 8 20:43:19 2019 -0300

Added option to set the form available to print

diff --git a/qt5/src/poppler-form.cc b/qt5/src/poppler-form.cc
index fa9c3312..111d5b09 100644
--- a/qt5/src/poppler-form.cc
+++ b/qt5/src/poppler-form.cc
@@ -207,6 +207,22 @@ void FormField::setVisible(bool value)
   m_formData->fm->getWidgetAnnotation()->setFlags(flags);
 }
 
+bool FormField::isPrintable() const
+{
+  return (m_formData->fm->getWidgetAnnotation()->getFlags() & 
Annot::flagPrint);
+}
+
+void FormField::setPrintable(bool value)
+{
+  unsigned int flags = m_formData->fm->getWidgetAnnotation()->getFlags();
+  if (value) {
+flags |= Annot::flagPrint;
+  } else {
+flags &= ~Annot::flagPrint;
+  }
+  m_formData->fm->getWidgetAnnotation()->setFlags(flags);
+}
+
 Link* FormField::activationAction() const
 {
   Link* action = nullptr;
diff --git a/qt5/src/poppler-form.h b/qt5/src/poppler-form.h
index f4c64589..ac00da26 100644
--- a/qt5/src/poppler-form.h
+++ b/qt5/src/poppler-form.h
@@ -155,6 +155,18 @@ namespace Poppler {
void setVisible(bool value);
 
/**
+ Whether this field is printable.
+ \since 0.79
+*/ 
+   bool isPrintable() const;
+
+   /**
+ Set whether this field is printable.
+ \since 0.79
+*/
+   void setPrintable(bool value);
+
+   /**
  The activation action of this form field.
 
  \note It may be null.
diff --git a/qt5/tests/check_forms.cpp b/qt5/tests/check_forms.cpp
index ec48ce91..f139ed1f 100644
--- a/qt5/tests/check_forms.cpp
+++ b/qt5/tests/check_forms.cpp
@@ -14,6 +14,7 @@ private slots:
 void testCheckbox();// Test for issue #655
 void testCheckboxIssue159();// Test for issue #159
 void testSetIcon();// Test that setIcon will always be valid.
+void testSetPrintable();
 };
 
 void TestForms::testCheckbox()
@@ -148,5 +149,24 @@ void TestForms::testSetIcon()
 QVERIFY( Poppler::FormFieldIconData::getData( anmIcon )->icon );
 }
 
+void TestForms::testSetPrintable()
+{
+QScopedPointer< Poppler::Document > 
document(Poppler::Document::load(TESTDATADIR 
"/unittestcases/form_set_icon.pdf"));
+QVERIFY( document );
+
+QScopedPointer< Poppler::Page > page(document->page(0));
+QVERIFY( page );
+
+QList forms = page->formFields();
+
+Q_FOREACH (Poppler::FormField *field, forms) {
+field->setPrintable( true );
+QCOMPARE( field->isPrintable(), true );
+
+field->setPrintable( false );
+QCOMPARE( field->isPrintable(), false );
+}
+}
+
 QTEST_GUILESS_MAIN(TestForms)
 #include "check_forms.moc"
___
poppler mailing list
poppler@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/poppler