]> git.lyx.org Git - lyx.git/blobdiff - src/text3.C
Minimal fix needed to give Qt a label dialog again.
[lyx.git] / src / text3.C
index 0a0e083c8b78e75ebc6868ea045dd2a98ccd2a64..d7d588311745e93c0af9c17716cae87facd5355f 100644 (file)
@@ -31,7 +31,6 @@
 #include "frontends/Dialogs.h"
 #include "insets/insetspecialchar.h"
 #include "insets/insettext.h"
-#include "insets/insetbib.h"
 #include "insets/insetquotes.h"
 #include "insets/insetcommand.h"
 #include "undo_funcs.h"
@@ -375,12 +374,13 @@ void specialChar(LyXText * lt, BufferView * bv, InsetSpecialChar::Kind kind)
                bv->updateInset(new_inset, true);
 }
 
+
 void doInsertInset(LyXText * lt, FuncRequest const & cmd,
                   bool edit, bool pastesel)
 {
        Inset * inset = createInset(cmd);
        BufferView * bv = cmd.view();
-       
+
        if (inset) {
                bool gotsel = false;
                if (lt->selection.set()) {
@@ -396,7 +396,6 @@ void doInsertInset(LyXText * lt, FuncRequest const & cmd,
                else
                        delete inset;
        }
-
 }
 
 }
@@ -996,7 +995,7 @@ Inset::RESULT LyXText::dispatch(FuncRequest const & cmd)
 
        case LFUN_UPCASE_WORD:
                update(bv, false);
-               changeCase(bv, LyXText::text_uppercase);
+               changeCase(*bv, LyXText::text_uppercase);
                if (inset_owner)
                        bv->updateInset(inset_owner, true);
                update(bv);
@@ -1004,7 +1003,7 @@ Inset::RESULT LyXText::dispatch(FuncRequest const & cmd)
 
        case LFUN_LOWCASE_WORD:
                update(bv, false);
-               changeCase(bv, LyXText::text_lowercase);
+               changeCase(*bv, LyXText::text_lowercase);
                if (inset_owner)
                        bv->updateInset(inset_owner, true);
                update(bv);
@@ -1012,7 +1011,7 @@ Inset::RESULT LyXText::dispatch(FuncRequest const & cmd)
 
        case LFUN_CAPITALIZE_WORD:
                update(bv, false);
-               changeCase(bv, LyXText::text_capitalization);
+               changeCase(*bv, LyXText::text_capitalization);
                if (inset_owner)
                        bv->updateInset(inset_owner, true);
                update(bv);
@@ -1055,7 +1054,7 @@ Inset::RESULT LyXText::dispatch(FuncRequest const & cmd)
 
        case LFUN_BEGINNINGBUFSEL:
                if (inset_owner)
-                       return Inset::UNDISPATCHED;
+                       return UNDISPATCHED;
                update(bv, false);
                cursorTop(bv);
                finishChange(bv, true);
@@ -1063,7 +1062,7 @@ Inset::RESULT LyXText::dispatch(FuncRequest const & cmd)
 
        case LFUN_ENDBUFSEL:
                if (inset_owner)
-                       return Inset::UNDISPATCHED;
+                       return UNDISPATCHED;
                update(bv, false);
                cursorBottom(bv);
                finishChange(bv, true);
@@ -1538,7 +1537,7 @@ Inset::RESULT LyXText::dispatch(FuncRequest const & cmd)
                        } else {
                                FuncRequest cmd1(bv, LFUN_MOUSE_RELEASE, x, y, cmd.button());
                                inset_hit->localDispatch(cmd1);
-                               // IMO this is a grosshack! Inset's should be changed so that
+                               // IMO this is a gross hack! Insets should be changed so that
                                // they call the actions they have to do with the insetButtonRel.
                                // function and not in the edit(). This should be changed
                                // (Jug 20020329)
@@ -1550,17 +1549,6 @@ Inset::RESULT LyXText::dispatch(FuncRequest const & cmd)
                        break;
                }
 
-               // Maybe we want to edit a bibitem ale970302
-               if (bv->text->cursor.par()->bibkey) {
-                       bool const is_rtl =
-                               bv->text->cursor.par()->isRightToLeftPar(bv->buffer()->params);
-                       int const width =
-                               bibitemMaxWidth(bv, bv->buffer()->params.getLyXTextClass().defaultfont());
-                       if ((is_rtl && x > bv->text->workWidth(bv)-20-width) ||
-                                       (!is_rtl && x < 20 + width)) {
-                               bv->text->cursor.par()->bibkey->edit(bv, 0, 0, mouse_button::none);
-                       }
-               }
                break;
        }
 
@@ -1604,13 +1592,15 @@ Inset::RESULT LyXText::dispatch(FuncRequest const & cmd)
 
        case LFUN_HTMLURL: {
                InsetCommandParams p("htmlurl");
-               bv->owner()->getDialogs().createUrl(p.getAsString());
+               string const data = InsetCommandMailer::params2string("url", p);
+               bv->owner()->getDialogs().show("url", data, 0);
                break;
        }
 
        case LFUN_URL: {
                InsetCommandParams p("url");
-               bv->owner()->getDialogs().createUrl(p.getAsString());
+               string const data = InsetCommandMailer::params2string("url", p);
+               bv->owner()->getDialogs().show("url", data, 0);
                break;
        }
 
@@ -1621,6 +1611,7 @@ Inset::RESULT LyXText::dispatch(FuncRequest const & cmd)
        case LFUN_INSET_CAPTION:
 #endif
        case LFUN_INSERT_NOTE:
+       case LFUN_INSERT_BIBITEM:
        case LFUN_INSET_ERT:
        case LFUN_INSET_FLOAT:
        case LFUN_INSET_FOOTNOTE:
@@ -1650,8 +1641,8 @@ Inset::RESULT LyXText::dispatch(FuncRequest const & cmd)
                break;
 
        default:
-               return Inset::UNDISPATCHED;
+               return UNDISPATCHED;
        }
 
-       return Inset::DISPATCHED;
+       return DISPATCHED;
 }