]> git.lyx.org Git - lyx.git/blobdiff - src/BufferView_pimpl.C
Some more fixes to compiler warnings.
[lyx.git] / src / BufferView_pimpl.C
index 7b0b902e541f683675f1c9420a19691e07616dc8..f5f1be2b2dadde664b78e2cc4fe440d6d73f6fd8 100644 (file)
@@ -115,7 +115,7 @@ void SetXtermCursor(Window win)
 {
        static Cursor cursor;
        static bool cursor_undefined = true;
-       if (cursor_undefined){
+       if (cursor_undefined) {
                cursor = XCreateFontCursor(fl_get_display(), XC_xterm);
                XFlush(fl_get_display());
                cursor_undefined = false;
@@ -648,8 +648,10 @@ void BufferView::Pimpl::workAreaButtonPress(int xpos, int ypos,
                selection_possible = false;
                owner_->updateLayoutChoice();
                owner_->message(inset->editMessage());
+               // IMO the inset has to be first in edit-mode and then we send the
+               // button press. (Jug 20020222)
+               inset->edit(bv_); //, xpos, ypos, button);
                inset->insetButtonPress(bv_, xpos, ypos, button);
-               inset->edit(bv_, xpos, ypos, button);
                return;
        } 
        
@@ -1169,7 +1171,7 @@ void BufferView::Pimpl::cursorPrevious(LyXText * text)
                              text->cursor.y()
                              - text->cursor.row()->baseline()
                              + text->cursor.row()->height()
-                             - workarea_.height() + 1 );
+                             - workarea_.height() + 1);
        updateScrollbar();
 }
 
@@ -1241,7 +1243,7 @@ void BufferView::Pimpl::restorePosition(unsigned int i)
                Buffer * b = bufferlist.exists(fname) ?
                        bufferlist.getBuffer(fname) :
                        bufferlist.loadLyXFile(fname); // don't ask, just load it
-               if (b != 0 ) buffer(b);
+               if (b != 0) buffer(b);
        }
 
        Paragraph * par = buffer_->getParFromID(saved_positions[i].par_id);
@@ -2972,13 +2974,13 @@ bool BufferView::Pimpl::Dispatch(kb_action action, string const & argument)
        case LFUN_CITATION_INSERT:
        {
                InsetCommandParams p;
-               p.setFromString( argument );
+               p.setFromString(argument);
 
-               InsetCitation * inset = new InsetCitation( p );
+               InsetCitation * inset = new InsetCitation(p);
                if (!insertInset(inset))
                        delete inset;
                else
-                       updateInset( inset, true );
+                       updateInset(inset, true);
        }
        break;
                    
@@ -2990,7 +2992,7 @@ bool BufferView::Pimpl::Dispatch(kb_action action, string const & argument)
                string const db       = token(argument, ' ', 0);
                string const bibstyle = token(argument, ' ', 1);
 
-               InsetCommandParams p( "BibTeX", db, bibstyle );
+               InsetCommandParams p("BibTeX", db, bibstyle);
                InsetBibtex * inset = new InsetBibtex(p);
                
                if (insertInset(inset)) {
@@ -3088,7 +3090,7 @@ bool BufferView::Pimpl::Dispatch(kb_action action, string const & argument)
        case LFUN_PARENTINSERT:
        {
                lyxerr << "arg " << argument << endl;
-               InsetCommandParams p( "lyxparent", argument );
+               InsetCommandParams p("lyxparent", argument);
                Inset * inset = new InsetParent(p, *buffer_);
                if (!insertInset(inset, "Standard"))
                        delete inset;
@@ -3428,7 +3430,7 @@ void BufferView::Pimpl::updateInset(Inset * inset, bool mark_dirty)
                } else if (bv_->theLockingInset()->updateInsetInInset(bv_, inset)) {
                        if (bv_->text->updateInset(bv_,  bv_->theLockingInset())) {
                                update();
-                               if (mark_dirty){
+                               if (mark_dirty) {
                                        buffer_->markDirty();
                                }
                                updateScrollbar();