]> git.lyx.org Git - lyx.git/blobdiff - src/TextMetrics.cpp
more
[lyx.git] / src / TextMetrics.cpp
index 8b77123985fd4c9855ccf42968d484c94c935071..dc47b425877ecfab87d432657ddfb3a138926fc2 100644 (file)
@@ -29,6 +29,7 @@
 #include "debug.h"
 #include "FontIterator.h"
 #include "FuncRequest.h"
+#include "Layout.h"
 #include "Length.h"
 #include "LyXRC.h"
 #include "MetricsInfo.h"
@@ -1280,7 +1281,8 @@ Row const & TextMetrics::getRowNearY(int y, pit_type pit) const
        int yy = pm.position() - pm.ascent();
        BOOST_ASSERT(!pm.rows().empty());
        RowList::const_iterator rit = pm.rows().begin();
-       RowList::const_iterator const rlast = boost::prior(pm.rows().end());
+       RowList::const_iterator rlast = pm.rows().end();
+       --rlast;
        for (; rit != rlast; yy += rit->height(), ++rit)
                if (yy + rit->height() > y)
                        break;