]> git.lyx.org Git - features.git/commitdiff
Trying to fix #7321: add some assertions.
authorAbdelrazak Younes <younes@lyx.org>
Sun, 13 Mar 2011 16:26:57 +0000 (16:26 +0000)
committerAbdelrazak Younes <younes@lyx.org>
Sun, 13 Mar 2011 16:26:57 +0000 (16:26 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@37914 a592a061-630c-0410-9148-cb99ea01b6c8

src/BufferView.cpp
src/TextMetrics.cpp

index 8d0539428aa0a21b8243032e0d117b26b5476743..dda37ae3353b1792d266b512b6c79bc24d562a31 100644 (file)
@@ -2244,6 +2244,7 @@ TextMetrics const & BufferView::textMetrics(Text const * t) const
 
 TextMetrics & BufferView::textMetrics(Text const * t)
 {
+       LASSERT(t, /**/);
        TextMetricsCache::iterator tmc_it  = d->text_metrics_.find(t);
        if (tmc_it == d->text_metrics_.end()) {
                tmc_it = d->text_metrics_.insert(
index 7d967f37a2be7e8c31f00786563494ef2028cb1d..2a74ddd1d797ab4788bcf30a3fe2edbe0a8ba507 100644 (file)
@@ -158,6 +158,7 @@ pair<pit_type, ParagraphMetrics const *> TextMetrics::first() const
 
 pair<pit_type, ParagraphMetrics const *> TextMetrics::last() const
 {
+       LASSERT(!par_metrics_.empty(), /**/);
        ParMetricsCache::const_reverse_iterator it = par_metrics_.rbegin();
        return make_pair(it->first, &it->second);
 }