]> git.lyx.org Git - lyx.git/commitdiff
add comments and remove dead code from revision 19721.
authorAbdelrazak Younes <younes@lyx.org>
Wed, 22 Aug 2007 14:44:34 +0000 (14:44 +0000)
committerAbdelrazak Younes <younes@lyx.org>
Wed, 22 Aug 2007 14:44:34 +0000 (14:44 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19726 a592a061-630c-0410-9148-cb99ea01b6c8

src/BufferView.cpp

index 8a6788112bd51a031cbcacd2b6a26f815781d3e1..3e5e01f9d39ad00ec534350e59f90d897ff794a9 100644 (file)
@@ -489,27 +489,21 @@ int BufferView::workWidth() const
 
 void BufferView::updateOffsetRef()
 {
+       // No need to update offset_ref_ in this case.
        if (!need_centering_)
                return;
 
+       // We are not properly started yet, delay until resizing is
+       // done.
        if (height_ == 0)
                return;
 
        CursorSlice & bot = cursor_.bottom();
        TextMetrics & tm = text_metrics_[bot.text()];
-       pit_type const pit = bot.pit();
-       ParagraphMetrics const & pm = tm.parMetrics(pit);
-       anchor_ref_ = pit;
-       //DocIterator dit;
-       //dit.push_back(bot);
-       //dit.pos() = 0;
-
+       ParagraphMetrics const & pm = tm.parMetrics(bot.pit());
        Point p = bv_funcs::coordOffset(*this, cursor_, cursor_.boundary());
        offset_ref_ = p.y_ + pm.ascent() - height_ / 2;
 
-       lyxerr << "p.y_ " << p.y_ << "  pm.ascent() " << pm.ascent() << "  h/2 " << height_/2
-               << "  offset_ref_ " << offset_ref_ << endl;
-
        need_centering_ = false;
 }