]> git.lyx.org Git - lyx.git/blobdiff - src/TextMetrics.cpp
* LyXAction.cpp: doxy.
[lyx.git] / src / TextMetrics.cpp
index 999308e26a6595e5ce612c47e9fc81d552e05926..3baf705c026725bcc7978197d1f92e2f658d6655 100644 (file)
@@ -129,7 +129,7 @@ TextMetrics::TextMetrics(BufferView * bv, Text * text)
        dim_.wid = max_width_;
        dim_.asc = 10;
        dim_.des = 10;
-       parMetrics(0, true);
+
        //text_->updateLabels(bv->buffer());
 }
 
@@ -187,7 +187,7 @@ int TextMetrics::parPosition(pit_type pit) const
 
 bool TextMetrics::metrics(MetricsInfo & mi, Dimension & dim, int min_width)
 {
-       LASSERT(mi.base.textwidth, /**/);
+       LASSERT(mi.base.textwidth > 0, /**/);
        max_width_ = mi.base.textwidth;
        // backup old dimension.
        Dimension const old_dim = dim_;
@@ -1850,11 +1850,11 @@ int TextMetrics::leftMargin(int max_width,
 
        case MARGIN_FIRST_DYNAMIC:
                if (layout.labeltype == LABEL_MANUAL) {
-                       if (pos >= par.beginOfBody()) {
+                       // if we are at position 0, we are never in the body
+                       if (pos > 0 && pos >= par.beginOfBody())
                                l_margin += labelfont_metrics.signedWidth(layout.leftmargin);
-                       } else {
+                       else
                                l_margin += labelfont_metrics.signedWidth(layout.labelindent);
-                       }
                } else if (pos != 0
                           // Special case to fix problems with
                           // theorems (JMarc)