So i was looking at Annot and realized we have a fontSize member that is 
initialized to 0 and just used to return in glib 
poppler_form_field_get_font_size

The attached patch removes the member variable and makes 
poppler_form_field_get_font_size return 0. This is obviously not the correct 
fix, but maybe it's better to commit this (maybe adding a TODO to the glib 
code) than having some code that does nothing (until someone can actually fix 
it properly?)

Cheers,
  Albert
commit ef3f279a3262302a92aa1a6a65b8a619661033a1
Author: Albert Astals Cid <[email protected]>
Date:   Fri Mar 23 16:46:09 2018 +0100

    poppler_form_field_get_font_size is broken

diff --git a/glib/poppler-form-field.cc b/glib/poppler-form-field.cc
index a6cb8209..15353639 100644
--- a/glib/poppler-form-field.cc
+++ b/glib/poppler-form-field.cc
@@ -145,7 +145,7 @@ poppler_form_field_get_font_size (PopplerFormField *field)
 {
   g_return_val_if_fail (POPPLER_IS_FORM_FIELD (field), 0);
   
-  return field->widget->getFontSize ();
+  return 0;
 }
 
 /**
diff --git a/poppler/Annot.cc b/poppler/Annot.cc
index 8c950434..415bb000 100644
--- a/poppler/Annot.cc
+++ b/poppler/Annot.cc
@@ -1202,7 +1202,6 @@ void Annot::initialize(PDFDoc *docA, Dict *dict) {
   appearBBox = nullptr;
   appearState = nullptr;
   appearBuf = nullptr;
-  fontSize = 0;
 
   appearance.setToNull();
 
diff --git a/poppler/Annot.h b/poppler/Annot.h
index e061a8c5..0d44582a 100644
--- a/poppler/Annot.h
+++ b/poppler/Annot.h
@@ -589,8 +589,6 @@ public:
   double getXMax();
   double getYMax();
 
-  double getFontSize() { return fontSize; }
-
   void setRect(PDFRectangle *rect);
   void setRect(double x1, double y1, double x2, double y2);
 
@@ -694,7 +692,6 @@ protected:
   GooString *appearBuf;
   AnnotBorder *border;          // Border, BS
   AnnotColor *color;            // C
-  double fontSize; 
   GBool ok;
 
   bool hasRef;
diff --git a/poppler/Form.cc b/poppler/Form.cc
index 76545d17..98e663be 100644
--- a/poppler/Form.cc
+++ b/poppler/Form.cc
@@ -127,10 +127,6 @@ void FormWidget::getRect(double *x1, double *y1, double *x2, double *y2) const {
     widget->getRect(x1, y1, x2, y2);
 }
 
-double FormWidget::getFontSize() const {
-  return widget ? widget->getFontSize() : 0.;
-}
-
 bool FormWidget::isReadOnly() const
 {
   return field->isReadOnly();
diff --git a/poppler/Form.h b/poppler/Form.h
index a4c59fb1..b4163303 100644
--- a/poppler/Form.h
+++ b/poppler/Form.h
@@ -108,8 +108,6 @@ public:
   void setChildNum (unsigned i) { childNum = i; }
   unsigned getChildNum () { return childNum; }
 
-  double getFontSize() const;
-
   GooString *getPartialName() const;
   void setPartialName(const GooString &name);
   GooString *getAlternateUiName() const;
_______________________________________________
poppler mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/poppler

Reply via email to