]> git.lyx.org Git - lyx.git/blobdiff - src/BufferView.C
* src/frontends/qt4/QTocDialog.C (updateGui):
[lyx.git] / src / BufferView.C
index 841f3703b39631776473f13ac71a637519784468..7e084ad54836f7c737edac637fdb4838020ca745 100644 (file)
@@ -63,6 +63,7 @@
 #include "frontends/Alert.h"
 #include "frontends/FileDialog.h"
 #include "frontends/FontMetrics.h"
+#include "frontends/Selection.h"
 
 #include "graphics/Previews.h"
 
@@ -196,6 +197,7 @@ void BufferView::setBuffer(Buffer * b)
                        cursor_.resetAnchor();
                        cursor_.setCursor(buffer_->getCursor().asDocIterator(&(buffer_->inset())));
                        cursor_.setSelection();
+                       theSelection().haveSelection(cursor_.selection());
                }
        }
 
@@ -1025,14 +1027,11 @@ void BufferView::clearSelection()
 
 void BufferView::workAreaResize(int width, int height)
 {
-       // A resize is triggered whenever a window gets focus,
-       // because of the shared rows() of a buffer in multiple
-       // buffer views.
-       
        // Update from work area
        width_ = width;
        height_ = height;
 
+       // The complete text metrics will be redone.
        text_metrics_.clear();
 
        if (buffer_)
@@ -1155,8 +1154,6 @@ void BufferView::scroll(int /*lines*/)
 //
 //     scrollDocView(new_top_y);
 //
-//     // Update the scrollbar.
-//     workArea_->setScrollbarParams(t->height(), top_y(), defaultRowHeight());}
 }
 
 
@@ -1303,6 +1300,7 @@ void BufferView::putSelectionAt(DocIterator const & cur,
                        cursor_.setSelection(cursor_, -length);
                } else
                        cursor_.setSelection(cursor_, length);
+               theSelection().haveSelection(cursor_.selection());
        }
 }