]> git.lyx.org Git - lyx.git/blobdiff - src/paragraph_pimpl.C
Minor code shuffle.
[lyx.git] / src / paragraph_pimpl.C
index 56b440f618b31d3412fca212c54eab67abebfcb2..27de45d0ae55505813e54fb461c49575856579e7 100644 (file)
@@ -102,7 +102,7 @@ void Paragraph::Pimpl::insertChar(Paragraph::size_type pos,
                                                      fontlist.end(),
                                                      search_font, matchFT());
             it != fontlist.end(); ++it)
-               (*it).pos((*it).pos() + 1);
+               it->pos(it->pos() + 1);
    
        // Update the inset table.
        InsetTable search_inset(pos, 0);
@@ -110,7 +110,7 @@ void Paragraph::Pimpl::insertChar(Paragraph::size_type pos,
                                                       owner_->insetlist.end(),
                                                       search_inset, matchIT());
             it != owner_->insetlist.end(); ++it)
-               ++(*it).pos;
+               ++it->pos;
 
        owner_->setFont(pos, font);
 }
@@ -130,7 +130,7 @@ void Paragraph::Pimpl::insertInset(Paragraph::size_type pos,
        InsetList::iterator it = std::lower_bound(owner_->insetlist.begin(),
                                                  owner_->insetlist.end(),
                                                  search_inset, matchIT());
-       if (it != owner_->insetlist.end() && (*it).pos == pos) {
+       if (it != owner_->insetlist.end() && it->pos == pos) {
                lyxerr << "ERROR (Paragraph::InsertInset): "
                        "there is an inset in position: " << pos << std::endl;
        } else {
@@ -153,8 +153,8 @@ void Paragraph::Pimpl::erase(Paragraph::size_type pos)
                        std::lower_bound(owner_->insetlist.begin(),
                                         owner_->insetlist.end(),
                                         search_inset, matchIT());
-               if (it != owner_->insetlist.end() && (*it).pos == pos) {
-                       delete (*it).inset;
+               if (it != owner_->insetlist.end() && it->pos == pos) {
+                       delete it->inset;
                        owner_->insetlist.erase(it);
                }
        }
@@ -168,10 +168,10 @@ void Paragraph::Pimpl::erase(Paragraph::size_type pos)
                std::lower_bound(fontlist.begin(),
                            fontlist.end(),
                            search_font, matchFT());
-       if (it != fontlist.end() && (*it).pos() == pos &&
+       if (it != fontlist.end() && it->pos() == pos &&
            (pos == 0 || 
             (it != fontlist.begin() 
-             && (*(it - 1)).pos() == pos - 1))) {
+             && boost::prior(it)->pos() == pos - 1))) {
                // If it is a multi-character font
                // entry, we just make it smaller
                // (see update below), otherwise we
@@ -189,7 +189,7 @@ void Paragraph::Pimpl::erase(Paragraph::size_type pos)
        // Update all other entries.
        FontList::iterator fend = fontlist.end();
        for (; it != fend; ++it)
-               (*it).pos((*it).pos() - 1);
+               it->pos(it->pos() - 1);
        
        // Update the inset table.
        InsetTable search_inset(pos, 0);
@@ -199,7 +199,7 @@ void Paragraph::Pimpl::erase(Paragraph::size_type pos)
                                      lend,
                                      search_inset, matchIT());
             it != lend; ++it)
-               --(*it).pos;
+               --it->pos;
 }
 
 
@@ -546,11 +546,10 @@ Paragraph * Paragraph::Pimpl::TeXDeeper(Buffer const * buf,
 
 Paragraph * Paragraph::Pimpl::getParFromID(int id) const
 {
+       InsetList::const_iterator cit = owner_->insetlist.begin();
        InsetList::const_iterator lend = owner_->insetlist.end();
        Paragraph * result;
-       for (InsetList::const_iterator cit = owner_->insetlist.begin();
-            cit != lend; ++cit)
-       {
+       for (; cit != lend; ++cit) {
                if ((result = cit->inset->getParFromID(id)))
                        return result;
        }