Use the id of the form fields as id, not the name!

svn path=/trunk/KDE/kdegraphics/okular/; revision=773440
remotes/origin/KDE/4.1
Pino Toscano 18 years ago
parent 5fd6ef5d7c
commit 7eac68815b
  1. 2
      ui/pageview.cpp
  2. 8
      ui/pageviewutils.cpp
  3. 4
      ui/pageviewutils.h

@ -717,7 +717,7 @@ void PageView::notifySetup( const QVector< Okular::Page * > & pageSet, int setup
w->setFormWidgetsController( d->formWidgetsController() );
w->setVisibility( false );
w->setCanBeFilled( d->document->isAllowed( Okular::AllowFillForms ) );
item->formWidgets().insert( ff->name(), w );
item->formWidgets().insert( ff->id(), w );
hasformwidgets = true;
}
}

@ -47,7 +47,7 @@ PageViewItem::PageViewItem( const Okular::Page * page )
PageViewItem::~PageViewItem()
{
QHash<QString, FormWidgetIface*>::iterator it = m_formWidgets.begin(), itEnd = m_formWidgets.end();
QHash<int, FormWidgetIface*>::iterator it = m_formWidgets.begin(), itEnd = m_formWidgets.end();
for ( ; it != itEnd; ++it )
delete *it;
}
@ -87,7 +87,7 @@ bool PageViewItem::isVisible() const
return m_visible;
}
QHash<QString, FormWidgetIface*>& PageViewItem::formWidgets()
QHash<int, FormWidgetIface*>& PageViewItem::formWidgets()
{
return m_formWidgets;
}
@ -113,7 +113,7 @@ void PageViewItem::moveTo( int x, int y )
{
m_geometry.moveLeft( x );
m_geometry.moveTop( y );
QHash<QString, FormWidgetIface*>::iterator it = m_formWidgets.begin(), itEnd = m_formWidgets.end();
QHash<int, FormWidgetIface*>::iterator it = m_formWidgets.begin(), itEnd = m_formWidgets.end();
for ( ; it != itEnd; ++it )
{
Okular::NormalizedRect r = (*it)->rect();
@ -140,7 +140,7 @@ bool PageViewItem::setFormWidgetsVisible( bool visible )
return false;
bool somehadfocus = false;
QHash<QString, FormWidgetIface*>::iterator it = m_formWidgets.begin(), itEnd = m_formWidgets.end();
QHash<int, FormWidgetIface*>::iterator it = m_formWidgets.begin(), itEnd = m_formWidgets.end();
for ( ; it != itEnd; ++it )
{
bool hadfocus = (*it)->setVisibility( visible );

@ -46,7 +46,7 @@ class PageViewItem
int height() const;
double zoomFactor() const;
bool isVisible() const;
QHash<QString, FormWidgetIface*>& formWidgets();
QHash<int, FormWidgetIface*>& formWidgets();
void setGeometry( int x, int y, int width, int height );
void setWHZ( int w, int h, double zoom );
@ -61,7 +61,7 @@ class PageViewItem
QRect m_geometry;
bool m_visible;
bool m_formsVisible;
QHash<QString, FormWidgetIface*> m_formWidgets;
QHash<int, FormWidgetIface*> m_formWidgets;
};

Loading…
Cancel
Save