Commit 3435eb6d authored by Albert Astals Cid's avatar Albert Astals Cid

Convert m_formWidgets from hash to set

We don't use the key for anything
parent 5413d38d
......@@ -1016,7 +1016,7 @@ void PageView::notifySetup( const QVector< Okular::Page * > & pageSet, int setup
w->setFormWidgetsController( d->formWidgetsController() );
w->setVisibility( false );
w->setCanBeFilled( allowfillforms );
item->formWidgets().insert( ff->id(), w );
item->formWidgets().insert( w );
hasformwidgets = true;
}
}
......
......@@ -51,9 +51,7 @@ PageViewItem::PageViewItem( const Okular::Page * page )
PageViewItem::~PageViewItem()
{
QHash<int, FormWidgetIface*>::iterator it = m_formWidgets.begin(), itEnd = m_formWidgets.end();
for ( ; it != itEnd; ++it )
delete *it;
qDeleteAll( m_formWidgets );
qDeleteAll( m_videoWidgets );
}
......@@ -122,7 +120,7 @@ bool PageViewItem::isVisible() const
return m_visible;
}
QHash<int, FormWidgetIface*>& PageViewItem::formWidgets()
QSet<FormWidgetIface*>& PageViewItem::formWidgets()
{
return m_formWidgets;
}
......@@ -163,7 +161,7 @@ void PageViewItem::moveTo( int x, int y )
m_croppedGeometry.moveTop( y );
m_uncroppedGeometry.moveLeft( qRound( x - m_crop.left * m_uncroppedGeometry.width() ) );
m_uncroppedGeometry.moveTop( qRound( y - m_crop.top * m_uncroppedGeometry.height() ) );
QHash<int, FormWidgetIface*>::iterator it = m_formWidgets.begin(), itEnd = m_formWidgets.end();
QSet<FormWidgetIface*>::iterator it = m_formWidgets.begin(), itEnd = m_formWidgets.end();
for ( ; it != itEnd; ++it )
{
Okular::NormalizedRect r = (*it)->rect();
......@@ -200,7 +198,7 @@ bool PageViewItem::setFormWidgetsVisible( bool visible )
return false;
bool somehadfocus = false;
QHash<int, FormWidgetIface*>::iterator it = m_formWidgets.begin(), itEnd = m_formWidgets.end();
QSet<FormWidgetIface*>::iterator it = m_formWidgets.begin(), itEnd = m_formWidgets.end();
for ( ; it != itEnd; ++it )
{
bool hadfocus = (*it)->setVisibility( visible && (*it)->formField()->isVisible() );
......
......@@ -47,7 +47,7 @@ class PageViewItem
int pageNumber() const;
double zoomFactor() const;
bool isVisible() const;
QHash<int, FormWidgetIface*>& formWidgets();
QSet<FormWidgetIface*>& formWidgets();
QHash< Okular::Movie *, VideoWidget * >& videoWidgets();
/* The page is cropped as follows: */
......@@ -87,7 +87,7 @@ class PageViewItem
QRect m_croppedGeometry;
QRect m_uncroppedGeometry;
Okular::NormalizedRect m_crop;
QHash<int, FormWidgetIface*> m_formWidgets;
QSet<FormWidgetIface*> m_formWidgets;
QHash< Okular::Movie *, VideoWidget * > m_videoWidgets;
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment