]> git.lyx.org Git - lyx.git/blobdiff - src/BufferView2.C
redraw fix 1.
[lyx.git] / src / BufferView2.C
index fa9456ea50788a105b496d7242557021762e5155..5624b2b324c762619b9cea3f04e736728c86067a 100644 (file)
@@ -14,9 +14,9 @@
 #include "buffer.h"
 #include "lyxcursor.h"
 #include "lyxtext.h"
-#include "LyXView.h"
+#include "frontends/LyXView.h"
 #include "bufferlist.h"
-#include "lyxscreen.h"
+#include "frontends/screen.h"
 #include "LaTeX.h"
 #include "BufferView_pimpl.h"
 #include "language.h"
@@ -26,6 +26,7 @@
 #include "iterators.h"
 
 #include "frontends/Alert.h"
+#include "frontends/Dialogs.h"
 
 #include "insets/insetcommand.h" //ChangeRefs
 #include "insets/inseterror.h"
@@ -426,6 +427,8 @@ void BufferView::paste()
 
        // paste
        text->pasteSelection(this);
+       // bug 393
+       text->clearSelection();
        update(text, BufferView::SELECT|BufferView::FITCUR|BufferView::CHANGE);
 // why fake a selection only I think it should be a real one and not only
 // a painted one (Jug 20020318).
@@ -572,8 +575,8 @@ void BufferView::showLockedInsetCursor(int x, int y, int asc, int desc)
                        shape = (txt->real_current_font.isVisibleRightToLeft())
                                ? LyXScreen::REVERSED_L_SHAPE
                                : LyXScreen::L_SHAPE;
-               y += cursor.y() + theLockingInset()->insetInInsetY();
-               pimpl_->screen_->showManualCursor(text, x, y, asc, desc,
+               y += cursor.iy() + theLockingInset()->insetInInsetY();
+               screen().showManualCursor(text, x, y, asc, desc,
                                                  shape);
        }
 }
@@ -582,7 +585,7 @@ void BufferView::showLockedInsetCursor(int x, int y, int asc, int desc)
 void BufferView::hideLockedInsetCursor()
 {
        if (theLockingInset() && available()) {
-               pimpl_->screen_->hideCursor();
+               screen().hideCursor();
        }
 }
 
@@ -590,8 +593,8 @@ void BufferView::hideLockedInsetCursor()
 bool BufferView::fitLockedInsetCursor(int x, int y, int asc, int desc)
 {
        if (theLockingInset() && available()) {
-               y += text->cursor.y() + theLockingInset()->insetInInsetY();
-               if (pimpl_->screen_->fitManualCursor(text, this, x, y, asc, desc)) {
+               y += text->cursor.iy() + theLockingInset()->insetInInsetY();
+               if (screen().fitManualCursor(this, text, x, y, asc, desc)) {
                        updateScrollbar();
                        return true;
                }
@@ -608,11 +611,15 @@ int BufferView::unlockInset(UpdatableInset * inset)
                inset->insetUnlock(this);
                theLockingInset(0);
                // make sure we update the combo !
-               owner()->setLayout(getLyXText()->cursor.par()->layout());
+               owner()->setLayout(getLyXText()->cursor.par()->layout()->name());
+               // Tell the paragraph dialog that we changed paragraph
+               owner()->getDialogs()->updateParagraph();
                finishUndo();
                return 0;
        } else if (inset && theLockingInset() &&
                   theLockingInset()->unlockInsetInInset(this, inset)) {
+               // Tell the paragraph dialog that we changed paragraph
+               owner()->getDialogs()->updateParagraph();
                // owner inset has updated the layout combo
                finishUndo();
                return 0;