]> git.lyx.org Git - lyx.git/commitdiff
code cosmetics to the iterator fix
authorJürgen Spitzmüller <spitz@lyx.org>
Wed, 15 Feb 2006 14:12:54 +0000 (14:12 +0000)
committerJürgen Spitzmüller <spitz@lyx.org>
Wed, 15 Feb 2006 14:12:54 +0000 (14:12 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@13242 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/qt2/ChangeLog
src/frontends/qt2/QCitationDialog.C
src/frontends/xforms/ChangeLog
src/frontends/xforms/FormCitation.C

index e1a307266613be76189b2f2bfdb45d5651463308..30ffae7e76101be730e81315b2ed5982628a93d9 100644 (file)
@@ -1,3 +1,7 @@
+2006-02-15  Jürgen Spitzmüller  <j.spitzmueller@gmx.de>
+
+       * QCitationDialog.C (up, down): get rid of the iterator.
+
 2006-02-15  Jürgen Spitzmüller  <j.spitzmueller@gmx.de>
 
        * QCitationDialog.C (up, down): fix crash due to invalidated
index 0e9f320570d14bfbb40ac925aad8bd5dda6800e1..70a245e6de9cc72deb3a96e3ccab6659062e828d 100644 (file)
@@ -189,9 +189,10 @@ void QCitationDialog::up()
 {
        int const sel = selectedLB->currentItem();
 
+       BOOST_ASSERT(sel > 0);
+
        // Move the selected key up one line
-       vector<string>::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<string>::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]);
index 06b8da0f36be4570412e2c7aab5c78a7f47cd529..762f8f11a3d54deb035867398b9ed3bcc9d90ae3 100644 (file)
@@ -1,3 +1,7 @@
+2006-02-15  Jürgen Spitzmüller  <j.spitzmueller@gmx.de>
+
+       * FormCitation.C (input): get rid of the iterator.
+
 2006-02-15  Jürgen Spitzmüller  <j.spitzmueller@gmx.de>
 
        * FormCitation.C (input): fix crash due to invalidated
index 5664f836e84774ed0195dd94cf78d345c8d5e378..cbf0f5670086b35024eaaa62c325e99aa5d26a52 100644 (file)
@@ -381,8 +381,7 @@ ButtonPolicy::SMInput FormCitation::input(FL_OBJECT * ob, long)
                        return ButtonPolicy::SMI_NOOP;
 
                // Move the selected key up one line
-               vector<string>::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<string>::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]);