[poppler] poppler/Form.cc poppler/Form.h

Albert Astals Cid aacid at kemper.freedesktop.org
Tue Jun 26 13:22:26 UTC 2018


 poppler/Form.cc |    8 ++++----
 poppler/Form.h  |   18 +++++++++---------
 2 files changed, 13 insertions(+), 13 deletions(-)

New commits:
commit 664d166194bc0832fd446b354630c4c7994ae4e3
Author: Albert Astals Cid <aacid at kde.org>
Date:   Tue Jun 26 15:22:13 2018 +0200

    Form: Add a few more const

diff --git a/poppler/Form.cc b/poppler/Form.cc
index 820944e8..1e60461a 100644
--- a/poppler/Form.cc
+++ b/poppler/Form.cc
@@ -330,7 +330,7 @@ void FormWidgetText::setTextFontSize(int fontSize)
   parent()->setTextFontSize(fontSize);
 }
 
-void FormWidgetText::setContent(GooString* new_content)
+void FormWidgetText::setContent(const GooString* new_content)
 {
   parent()->setContentCopy(new_content);
 }
@@ -397,7 +397,7 @@ bool FormWidgetChoice::isSelected (int i) const
   return parent()->isSelected(i);
 }
 
-void FormWidgetChoice::setEditChoice (GooString* new_content)
+void FormWidgetChoice::setEditChoice (const GooString* new_content)
 {
   if (!hasEdit()) {
     error(errInternal, -1, "FormFieldChoice::setEditChoice : trying to edit an non-editable choice\n");
@@ -1208,7 +1208,7 @@ GooString* FormFieldText::getContentCopy ()
   return new GooString(content);
 }
 
-void FormFieldText::setContentCopy (GooString* new_content)
+void FormFieldText::setContentCopy (const GooString* new_content)
 {
   delete content;
   content = nullptr;
@@ -1563,7 +1563,7 @@ void FormFieldChoice::select (int i)
   updateSelection();
 }
 
-void FormFieldChoice::setEditChoice (GooString* new_content)
+void FormFieldChoice::setEditChoice (const GooString* new_content)
 {
   delete editedChoice;
   editedChoice = nullptr;
diff --git a/poppler/Form.h b/poppler/Form.h
index 8c88c8d7..097d2ab6 100644
--- a/poppler/Form.h
+++ b/poppler/Form.h
@@ -198,8 +198,8 @@ public:
   //return a copy of the field's content (UTF16BE)
   GooString* getContentCopy();
 
-  //except a UTF16BE string
-  void setContent(GooString* new_content);
+  //expects a UTF16BE string
+  void setContent(const GooString* new_content);
 
   void updateWidgetAppearance() override;
 
@@ -243,7 +243,7 @@ public:
 
   //except a UTF16BE string
   //only work for editable combo box, set the user-entered text as the current choice
-  void setEditChoice(GooString* new_content);
+  void setEditChoice(const GooString* new_content);
 
   const GooString* getEditChoice () const;
 
@@ -311,10 +311,10 @@ public:
   GBool hasTextQuadding() const { return hasQuadding; }
   VariableTextQuadding getTextQuadding() const { return quadding; }
 
-  GooString *getPartialName() const { return partialName; }
+  const GooString *getPartialName() const { return partialName; }
   void setPartialName(const GooString &name);
-  GooString *getAlternateUiName() const { return alternateUiName; }
-  GooString *getMappingName() const { return mappingName; }
+  const GooString *getAlternateUiName() const { return alternateUiName; }
+  const GooString *getMappingName() const { return mappingName; }
   GooString *getFullyQualifiedName();
 
   FormWidget* findWidgetByRef (Ref aref);
@@ -420,7 +420,7 @@ public:
   
   const GooString* getContent () const { return content; }
   GooString* getContentCopy ();
-  void setContentCopy (GooString* new_content);
+  void setContentCopy (const GooString* new_content);
   ~FormFieldText();
 
   bool isMultiline () const { return multiline; }
@@ -484,7 +484,7 @@ public:
   void deselectAll ();
 
   //only work for editable combo box, set the user-entered text as the current choice
-  void setEditChoice(GooString* new_content);
+  void setEditChoice(const GooString* new_content);
 
   const GooString* getEditChoice () const;
 
@@ -583,7 +583,7 @@ public:
   GBool getNeedAppearances () const { return needAppearances; }
   int getNumFields() const { return numFields; }
   FormField* getRootField(int i) const { return rootFields[i]; }
-  GooString* getDefaultAppearance() const { return defaultAppearance; }
+  const GooString* getDefaultAppearance() const { return defaultAppearance; }
   VariableTextQuadding getTextQuadding() const { return quadding; }
   GfxResources* getDefaultResources() const { return defaultResources; }
   Object* getDefaultResourcesObj() { return &resDict; }


More information about the poppler mailing list