summaryrefslogtreecommitdiff
path: root/qt4
diff options
context:
space:
mode:
authorPino Toscano <pino@kde.org>2011-02-27 14:21:11 +0100
committerPino Toscano <pino@kde.org>2011-02-27 14:21:11 +0100
commit071966e48577c515b17a424baeae85ae4fc80a20 (patch)
tree4a74d4fb3ed1a08c93669bfd51ea9100a9fec86c /qt4
parentadc236771f11eeb4197064747836e8ed3fbfeba9 (diff)
[qt4] move textAlignment() as a private function
Diffstat (limited to 'qt4')
-rw-r--r--qt4/src/poppler-form.cc33
-rw-r--r--qt4/src/poppler-private.h25
2 files changed, 31 insertions, 27 deletions
diff --git a/qt4/src/poppler-form.cc b/qt4/src/poppler-form.cc
index f3b97b5b..b989883f 100644
--- a/qt4/src/poppler-form.cc
+++ b/qt4/src/poppler-form.cc
@@ -32,6 +32,35 @@
#include <math.h>
+namespace {
+
+Qt::Alignment formTextAlignment(Object *obj)
+{
+ Object tmp;
+ int align = 0;
+ if (obj->dictLookup("Q", &tmp)->isInt())
+ {
+ align = tmp.getInt();
+ }
+ tmp.free();
+ Qt::Alignment qtalign;
+ switch (align)
+ {
+ case 1:
+ qtalign = Qt::AlignHCenter;
+ break;
+ case 2:
+ qtalign = Qt::AlignRight;
+ break;
+ case 0:
+ default:
+ qtalign = Qt::AlignLeft;
+ }
+ return qtalign;
+}
+
+}
+
namespace Poppler {
FormField::FormField(FormFieldData &dd)
@@ -264,7 +293,7 @@ int FormFieldText::maximumLength() const
Qt::Alignment FormFieldText::textAlignment() const
{
- return m_formData->textAlignment(m_formData->fm->getObj());
+ return formTextAlignment(m_formData->fm->getObj());
}
bool FormFieldText::canBeSpellChecked() const
@@ -342,7 +371,7 @@ void FormFieldChoice::setCurrentChoices( const QList<int> &choice )
Qt::Alignment FormFieldChoice::textAlignment() const
{
- return m_formData->textAlignment(m_formData->fm->getObj());
+ return formTextAlignment(m_formData->fm->getObj());
}
bool FormFieldChoice::canBeSpellChecked() const
diff --git a/qt4/src/poppler-private.h b/qt4/src/poppler-private.h
index 6800a8b7..105b9aa3 100644
--- a/qt4/src/poppler-private.h
+++ b/qt4/src/poppler-private.h
@@ -260,31 +260,6 @@ namespace Poppler {
{
}
- Qt::Alignment textAlignment(Object *obj) const
- {
- Object tmp;
- int align = 0;
- if (obj->dictLookup("Q", &tmp)->isInt())
- {
- align = tmp.getInt();
- }
- tmp.free();
- Qt::Alignment qtalign;
- switch ( align )
- {
- case 1:
- qtalign = Qt::AlignHCenter;
- break;
- case 2:
- qtalign = Qt::AlignRight;
- break;
- case 0:
- default:
- qtalign = Qt::AlignLeft;
- }
- return qtalign;
- }
-
DocumentData *doc;
::Page *page;
::FormWidget *fm;