[poppler] qt4/src

Albert Astals Cid aacid at kemper.freedesktop.org
Wed Oct 17 11:20:28 PDT 2012


 qt4/src/poppler-form.cc |   23 +++++++++++++++++++++++
 qt4/src/poppler-form.h  |   15 +++++++++++++++
 2 files changed, 38 insertions(+)

New commits:
commit 80cf43472e5913f5f64bf73cb4a8ac5a53063f2e
Author: Adam Reichold <adamreichold at myopera.com>
Date:   Wed Oct 17 08:27:13 2012 +0200

    added accessors for FormWidgetChoice::editChoice property to qt4 frontend

diff --git a/qt4/src/poppler-form.cc b/qt4/src/poppler-form.cc
index f072356..a5e5adf 100644
--- a/qt4/src/poppler-form.cc
+++ b/qt4/src/poppler-form.cc
@@ -2,6 +2,7 @@
  * Copyright (C) 2007-2008, 2011, Pino Toscano <pino at kde.org>
  * Copyright (C) 2008, 2011, 2012 Albert Astals Cid <aacid at kde.org>
  * Copyright (C) 2011 Carlos Garcia Campos <carlosgc at gnome.org>
+ * Copyright (C) 2012, Adam Reichold <adamreichold at myopera.com>
  *
  * 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
@@ -379,6 +380,28 @@ void FormFieldChoice::setCurrentChoices( const QList<int> &choice )
     fwc->select( choice.at( i ) );
 }
 
+QString FormFieldChoice::editChoice() const
+{
+  FormWidgetChoice* fwc = static_cast<FormWidgetChoice*>(m_formData->fm);
+  
+  if ( fwc->isCombo() && fwc->hasEdit() )
+    return UnicodeParsedString(fwc->getEditChoice());
+  else
+    return QString();
+}
+
+void FormFieldChoice::setEditChoice(const QString& text)
+{
+  FormWidgetChoice* fwc = static_cast<FormWidgetChoice*>(m_formData->fm);
+  
+  if ( fwc->isCombo() && fwc->hasEdit() )
+  {
+    GooString* goo = QStringToUnicodeGooString( text );
+    fwc->setEditChoice( goo );
+    delete goo;
+  }
+}
+
 Qt::Alignment FormFieldChoice::textAlignment() const
 {
   return formTextAlignment(m_formData->fm);
diff --git a/qt4/src/poppler-form.h b/qt4/src/poppler-form.h
index 9af367b..79ed393 100644
--- a/qt4/src/poppler-form.h
+++ b/qt4/src/poppler-form.h
@@ -1,6 +1,7 @@
 /* poppler-form.h: qt4 interface to poppler
  * Copyright (C) 2007-2008, Pino Toscano <pino at kde.org>
  * Copyright (C) 2008, 2011, Albert Astals Cid <aacid at kde.org>
+ * Copyright (C) 2012, Adam Reichold <adamreichold at myopera.com>
  *
  * 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
@@ -305,6 +306,20 @@ namespace Poppler {
 	  Sets the selected choices to \p choice.
 	 */
 	void setCurrentChoices( const QList<int> &choice );
+	
+	/**
+	  The text entered into an editable combo box choice field. Otherwise a null string.
+	  
+	  \since 0.22
+	*/
+	QString editChoice() const;
+	
+	/**
+	  Sets the text entered into an editable combo box choice field. Otherwise does nothing.
+	  
+	  \since 0.22
+	*/
+	void setEditChoice(const QString& text);
 
 	/**
 	  The horizontal alignment for the text of this text field.


More information about the poppler mailing list