diff --git a/src/frontends/qt2/ChangeLog b/src/frontends/qt2/ChangeLog index e1a3072666..30ffae7e76 100644 --- a/src/frontends/qt2/ChangeLog +++ b/src/frontends/qt2/ChangeLog @@ -1,3 +1,7 @@ +2006-02-15 Jürgen Spitzmüller + + * QCitationDialog.C (up, down): get rid of the iterator. + 2006-02-15 Jürgen Spitzmüller * QCitationDialog.C (up, down): fix crash due to invalidated diff --git a/src/frontends/qt2/QCitationDialog.C b/src/frontends/qt2/QCitationDialog.C index 0e9f320570..70a245e6de 100644 --- a/src/frontends/qt2/QCitationDialog.C +++ b/src/frontends/qt2/QCitationDialog.C @@ -189,9 +189,10 @@ void QCitationDialog::up() { int const sel = selectedLB->currentItem(); + BOOST_ASSERT(sel > 0); + // Move the selected key up one line - vector::iterator it = form_->citekeys.begin() + sel; - string const tmp = *it; + string const tmp = form_->citekeys[sel]; selectedLB->removeItem(sel); swap(form_->citekeys[sel - 1], form_->citekeys[sel]); @@ -209,9 +210,10 @@ void QCitationDialog::down() { int const sel = selectedLB->currentItem(); + BOOST_ASSERT(sel < (int)form_->citekeys.size()); + // Move the selected key down one line - vector::iterator it = form_->citekeys.begin() + sel; - string const tmp = *it; + string const tmp = form_->citekeys[sel]; selectedLB->removeItem(sel); swap(form_->citekeys[sel + 1], form_->citekeys[sel]); diff --git a/src/frontends/xforms/ChangeLog b/src/frontends/xforms/ChangeLog index 06b8da0f36..762f8f11a3 100644 --- a/src/frontends/xforms/ChangeLog +++ b/src/frontends/xforms/ChangeLog @@ -1,3 +1,7 @@ +2006-02-15 Jürgen Spitzmüller + + * FormCitation.C (input): get rid of the iterator. + 2006-02-15 Jürgen Spitzmüller * FormCitation.C (input): fix crash due to invalidated diff --git a/src/frontends/xforms/FormCitation.C b/src/frontends/xforms/FormCitation.C index 5664f836e8..cbf0f56700 100644 --- a/src/frontends/xforms/FormCitation.C +++ b/src/frontends/xforms/FormCitation.C @@ -381,8 +381,7 @@ ButtonPolicy::SMInput FormCitation::input(FL_OBJECT * ob, long) return ButtonPolicy::SMI_NOOP; // Move the selected key up one line - vector::iterator it = citekeys.begin() + sel - 1; - string const tmp = *it; + string const tmp = citekeys[sel - 1]; fl_delete_browser_line(dialog_->browser_cite, sel); swap(citekeys[sel - 2], citekeys[sel - 1]); @@ -398,8 +397,7 @@ ButtonPolicy::SMInput FormCitation::input(FL_OBJECT * ob, long) return ButtonPolicy::SMI_NOOP; // Move the selected key down one line - vector::iterator it = citekeys.begin() + sel - 1; - string const tmp = *it; + string const tmp = citekeys[sel - 1]; fl_delete_browser_line(dialog_->browser_cite, sel); swap(citekeys[sel], citekeys[sel - 1]);