]> git.lyx.org Git - lyx.git/blobdiff - src/TextMetrics.cpp
Fix a crash when closing tabs
[lyx.git] / src / TextMetrics.cpp
index 57956bd335cf98512705137bf6036b78379cfb49..c31247842e054e50eef2efba11cf36764daeda46 100644 (file)
@@ -1621,8 +1621,9 @@ void TextMetrics::deleteLineForward(Cursor & cur)
 
 int TextMetrics::leftMargin(pit_type pit) const
 {
-       // the + 1 is useful when the paragraph is empty
-       return leftMargin(pit, text_->paragraphs()[pit].size() + 1);
+       // FIXME: what is the semantics? It depends on whether the
+       // paragraph is empty!
+       return leftMargin(pit, text_->paragraphs()[pit].size());
 }
 
 
@@ -1635,7 +1636,7 @@ int TextMetrics::leftMargin(pit_type const pit, pos_type const pos) const
        Paragraph const & par = pars[pit];
        LASSERT(pos >= 0, return 0);
        // We do not really care whether pos > par.size(), since we do not
-       // access the data. It can be actially useful, when querying the
+       // access the data. It can be actually useful, when querying the
        // margin without indentation (see leftMargin(pit_type).
 
        Buffer const & buffer = bv_->buffer();