]> git.lyx.org Git - features.git/commitdiff
remove the hardcoded bibkey from the paragraph
authorAndré Pönitz <poenitz@gmx.net>
Mon, 17 Feb 2003 15:16:14 +0000 (15:16 +0000)
committerAndré Pönitz <poenitz@gmx.net>
Mon, 17 Feb 2003 15:16:14 +0000 (15:16 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@6186 a592a061-630c-0410-9148-cb99ea01b6c8

27 files changed:
lib/ChangeLog
lib/layouts/amsdefs.inc
lib/layouts/cl2emult.layout
lib/layouts/egs.layout
lib/layouts/llncs.layout
lib/layouts/siamltex.layout
lib/layouts/stdlists.inc
lib/layouts/stdstruct.inc
lib/layouts/svjour.inc
lib/ui/default.ui
src/ChangeLog
src/LyXAction.C
src/buffer.C
src/commandtags.h
src/factory.C
src/insets/ChangeLog
src/insets/insetbib.C
src/insets/insetbib.h
src/layout.h
src/lyxlayout.C
src/lyxlayout.h
src/paragraph.C
src/paragraph.h
src/paragraph_funcs.C
src/text.C
src/text2.C
src/text3.C

index f7f99f27bef657bb6a5ea95d5146375033a64b4f..fd25104fab379b3776cd0793bcad8ff2e554ebb0 100644 (file)
@@ -1,3 +1,8 @@
+
+2003-02-17  André Pönitz <poenitz@gmx.net>
+
+       * lauouts/*: Item_Environment -> Bib_Environment for Bibligraphy
+
 2003-02-14  Jean-Marc Lasgouttes  <lasgouttes@freesurf.fr>
 
        * chkconfig.ltx: information is in LaTeXConfig.lyx, not
index 9016a21138d3b1980b1be782eca50bec43a89590..2ac633f12e591f2957a8dec084cf4db05fd33ee4 100644 (file)
@@ -337,7 +337,7 @@ End
 # Bibliography style definition
 Style Bibliography
   Margin               First_Dynamic
-  LatexType            Item_Environment
+  LatexType            Bib_Environment
   LatexName            thebibliography
   NextNoIndent         1
   LeftMargin           MM
index f19d10cb66dbc68a6ee4de91136bb3f3a835440c..098f786918e4bc5c7a665f4e5fc719cf4b2a230e 100644 (file)
@@ -104,7 +104,7 @@ End
 # Bibliography style definition
 Style Bibliography
   Margin                First_Dynamic
-  LatexType             Item_Environment
+  LatexType             Bib_Environment
   LatexName             thebibliography
   NextNoIndent          1
   LeftMargin            MM
index 3b85cec3d0e38e71a0c049ae19f2eb3ebf19f239..ab3e72fa8aed69210d34e11124f8c296c8c1d063 100644 (file)
@@ -642,7 +642,7 @@ End
 # Bibliography style definition
 Style Bibliography
   Margin               First_Dynamic
-  LatexType            Item_Environment
+  LatexType            Bib_Environment
   LatexName            thebibliography
   NextNoIndent         1
   LeftMargin           MM
index 098a5a7cffd02453df34f27f7e61ab0a33b35968..cc3255f33828aec329f7cf2d4ae4fadcb775b29f 100644 (file)
@@ -288,7 +288,7 @@ End
 # Bibliography style definition
 Style Bibliography
   Margin               First_Dynamic
-  LatexType            Item_Environment
+  LatexType            Bib_Environment
   LatexName            thebibliography
   NextNoIndent         1
   LeftMargin           MM
index cdc570444af537f5d9c2016ae379fcef14c51938..902dd147d61a0dd8067723c60d88d629438d870c 100644 (file)
@@ -170,7 +170,7 @@ End
 
 Style Bibliography
   Margin         Dynamic
-  LatexType      Item_Environment
+  LatexType      Bib_Environment
   LatexName      thebibliography
   NextNoIndent   0
   LeftMargin     M
index bac13bf5a46b62b02805d6111ae5f79e233967ab..1ec9ac8caf9ea681185900827b1ac6a71cbf17ac 100644 (file)
@@ -93,3 +93,22 @@ Style List
   EndPreamble
 
 End
+
+
+
+Style Bibliography
+  Margin               Static
+  LatexType            Bib_Environment
+  LatexName            thebibliography
+  NextNoIndent         1
+  LeftMargin           MMN
+  LabelSep             xx
+  ParSkip              0.0
+  ItemSep              0.2
+  TopSep               0.7
+  BottomSep            0.7
+  ParSep               0.3
+  Align                        Block
+  AlignPossible                Block, Left
+  LabelType            Counter_EnumI
+End
index 864af1efa82a6db23319c4dd2f8ee52173152e88..e3e8775a4462f77dce401092a245d2c293d18b36 100644 (file)
@@ -42,7 +42,7 @@ End
 # Bibliography style definition
 Style Bibliography
   Margin               First_Dynamic
-  LatexType            Item_Environment
+  LatexType            Bib_Environment
   LatexName            thebibliography
   NextNoIndent         1
   LeftMargin           MM
index aaf61738a41c15c4d282b1f16849b4af1210c532..aca732ed067c05a023852a749b9f0d4bd6735d51 100644 (file)
@@ -352,7 +352,7 @@ End
 # Bibliography style definition
 Style Bibliography
   Margin               First_Dynamic
-  LatexType            Item_Environment
+  LatexType            Bib_Environment
   LatexName            thebibliography
   NextNoIndent         1
   LeftMargin           MM
index 82bd51400376fc62663b2233ce651fec68b68fb6..35c4e0ac701277e3f6cdb1bd92ef994e640f4362 100644 (file)
@@ -201,6 +201,7 @@ Menuset
        Item "Footnote|F" "footnote-insert"
        Item "Marginal Note|M" "marginalnote-insert"
        Item "Short Title" "optional-insert"
+       Item "Bibliography Key" "bibkey-insert"
        Item "Index Entry...|I" "index-insert"
        Item "URL...|U" "url-insert"
        Item "Note|N" "note-insert"
index 5da311d596888b5f428f8a0334bcb9b418f2239e..acf1324d92b4f3ca055122889d68574cb5cfae9d 100644 (file)
@@ -1,7 +1,23 @@
+
+2003-02-17 André Pönitz <poenitz@gmx.net>
+       
+       * LyXAction.C:
+       * commandtags.h: new LFUN_INSERT_BIBKEY
+
+       * layout.h:
+       * lyxlayout.C:
+       * buffer.C:
+       * factory.C:
+       * text.C:
+       * text2.C:
+       * text3.C:
+       * paragraph.[Ch]:
+       * paragraph_func.C: remove special bibkey handling
+
 2003-02-17  John Levon  <levon@movementarian.org>
 
        * text.C (Delete): fix case where delete at the end of
-          the very first paragraph would not merge the pars
+         the very first paragraph would not merge the pars
 
 2003-02-17  John Levon  <levon@movementarian.org>
 
 
 2002-10-11 André Pönitz <poenitz@gmx.net>
 
-       * lytext.h: make some functions public to allow access
+       * lyxtext.h: make some functions public to allow access
        from inset/lyxtext for handling LFUN_PRIOR/NEXT
 
 2002-10-09  Jean-Marc Lasgouttes  <Jean-Marc.Lasgouttes@inria.fr>
index 2803a45457f3078dee35e1cd4155b7695e5fbd94..47b279a57e909e107702c5080408bf5f3aff15c2 100644 (file)
@@ -245,6 +245,8 @@ void LyXAction::init()
                  Noop },
                { LFUN_INSET_OPTARG, "optional-insert", N_("Insert Optional Argument"),
                  Noop },
+               { LFUN_INSERT_BIBKEY, "bibkey-insert", N_("Insert Bibliography Key"),
+                 Noop },
                { LFUN_LANGUAGE, "language", N_("Change language"), Noop },
                { LFUN_LATEX_LOG, "latex-view-log", N_("View LaTeX log"),
                  ReadOnly },
index 90c08043cabba0dd3c248f4ddd5af769c3eb1876..53113abb48d4b251053526eee8bbe439faee4e9a 100644 (file)
@@ -956,6 +956,12 @@ Buffer::parseSingleLyXformat2Token(LyXLex & lex, Paragraph *& par,
                inset->read(this, lex);
                par->insertInset(pos, inset, font, current_change);
                ++pos;
+       } else if (token == "\\bibitem") {  // ale970302
+               InsetCommandParams p("bibitem", "dummy");
+               InsetBibKey * inset = new InsetBibKey(p);
+               inset->read(this, lex);
+               par->insertInset(pos, inset, font, current_change);
+               ++pos;
        } else if (token == "\\hfill") {
                par->insertChar(pos, Paragraph::META_HFILL, font, current_change);
                ++pos;
@@ -980,12 +986,6 @@ Buffer::parseSingleLyXformat2Token(LyXLex & lex, Paragraph *& par,
                istr >> aid;
                istr >> ct;
                current_change = Change(Change::DELETED, author_ids[aid], ct);
-       } else if (token == "\\bibitem") {  // ale970302
-               if (!par->bibkey) {
-                       InsetCommandParams p("bibitem", "dummy");
-                       par->bibkey = new InsetBibKey(p);
-               }
-               par->bibkey->read(this, lex);
        } else if (token == "\\the_end") {
                the_end_read = true;
        } else {
@@ -2034,6 +2034,7 @@ void Buffer::makeLinuxDocFile(string const & fname, bool nice, bool body_only)
 
                case LATEX_ENVIRONMENT:
                case LATEX_ITEM_ENVIRONMENT:
+               case LATEX_BIB_ENVIRONMENT:
                {
                        string const & latexname = style->latexname();
 
@@ -2088,6 +2089,7 @@ void Buffer::makeLinuxDocFile(string const & fname, bool nice, bool body_only)
                        break;
                case LATEX_ENVIRONMENT:
                case LATEX_ITEM_ENVIRONMENT:
+               case LATEX_BIB_ENVIRONMENT:
                        if (style->latexparam() == "CDATA")
                                ofs << "]]>";
                        break;
@@ -2885,9 +2887,10 @@ vector<pair<string, string> > const Buffer::getBibkeyList() const
        ParagraphList::iterator pit = paragraphs.begin();
        ParagraphList::iterator pend = paragraphs.end();
        for (; pit != pend; ++pit) {
-               if (pit->bibkey) {
-                       string const key = pit->bibkey->getContents();
-                       string const opt = pit->bibkey->getOptions();
+               InsetBibKey * bib = pit->bibkey();
+               if (bib) {
+                       string const key = bib->getContents();
+                       string const opt = bib->getOptions();
                        string const ref = pit->asString(this, false);
                        string const info = opt + "TheBibliographyRef" + ref;
 
index 6fd422aee01d73a1fdbc3ba7296533dfa8811b10..7ccc3ac88978caa7a0a91fc6516d49f182f2d40c 100644 (file)
@@ -296,6 +296,7 @@ enum kb_action {
        LFUN_REJECT_CHANGE,             // Levon 20021016
        LFUN_ACCEPT_ALL_CHANGES,        // Levon 20021016
        LFUN_REJECT_ALL_CHANGES,        // Levon 20021016
+       LFUN_INSERT_BIBKEY,             // André 14 Feb 2003
        LFUN_LASTACTION  /* this marks the end of the table */
 };
 
index 3509bc8150b612b3d2ce56836ecfd2f538778f7f..601f72684cffd60f90b9aa7eaad54360137e3fe9 100644 (file)
@@ -18,6 +18,7 @@
 #include "BufferView.h"
 #include "lyxtext.h"
 
+#include "insets/insetbib.h"
 #include "insets/insetcaption.h"
 #include "insets/insetert.h"
 #include "insets/insetexternal.h"
@@ -70,6 +71,9 @@ Inset * createInset(FuncRequest const & cmd)
                case LFUN_INSET_OPTARG:
                        return new InsetOptArg(params);
 
+               case LFUN_INSERT_BIBKEY:
+                       return new InsetBibKey(InsetCommandParams("bibkey"));
+
                case LFUN_INSET_FLOAT:
                        // check if the float type exists
                        if (params.getLyXTextClass().floats().typeExist(cmd.argument))
index f66d33b73e04e144cfbfe83df2f0d1ac8dac4be5..2d76fbb2aaf28bc39ea2fe511f7907c86c4eb7a5 100644 (file)
@@ -1,3 +1,8 @@
+
+2003-02-17 André Pönitz <poenitz@gmx.net>
+       
+       * insetbib.[Ch]: Adjust access to bibkeys
+
 2003-02-14  Jean-Marc Lasgouttes  <lasgouttes@freesurf.fr>
 
        * insetquotes.C (dispString): remove use of acute accent for "'"
index 77ec9d52f609ab35c6690a6b55373dbf4d7f82b0..e77956c59bed710e820b83e2d856a7fc4b325801 100644 (file)
@@ -76,11 +76,9 @@ void InsetBibKey::setCounter(int c)
 // of time cause LyX3 won't use lyxlex anyway.  (ale)
 void InsetBibKey::write(Buffer const *, ostream & os) const
 {
-       os << "\\bibitem ";
-       if (! getOptions().empty()) {
-               os << '['
-                  << getOptions() << ']';
-       }
+       os << "\n\\layout Bibliography\n\\bibitem ";
+       if (! getOptions().empty())
+               os << '[' << getOptions() << ']';
        os << '{'
           << getContents() << "}\n";
 }
@@ -336,8 +334,8 @@ int bibitemMaxWidth(BufferView * bv, LyXFont const & font)
        ParagraphList::iterator it = bv->buffer()->paragraphs.begin();
        ParagraphList::iterator end = bv->buffer()->paragraphs.end();
        for (; it != end; ++it) {
-               if (it->bibkey) {
-                       int const wx = it->bibkey->width(bv, font);
+               if (it->bibkey()) {
+                       int const wx = it->bibkey()->width(bv, font);
                        if (wx > w)
                                w = wx;
                }
@@ -358,13 +356,13 @@ string const bibitemWidest(Buffer const * buffer)
        ParagraphList::iterator it = buffer->paragraphs.begin();
        ParagraphList::iterator end = buffer->paragraphs.end();
        for (; it != end; ++it) {
-               if (it->bibkey) {
+               if (it->bibkey()) {
                        int const wx =
-                               font_metrics::width(it->bibkey->getBibLabel(),
+                               font_metrics::width(it->bibkey()->getBibLabel(),
                                                    font);
                        if (wx > w) {
                                w = wx;
-                               bkey = it->bibkey;
+                               bkey = it->bibkey();
                        }
                }
        }
index 5c4b92ed9933c4b1adefea3d0dac39135b9a7ead..d037e829a4100257110973ecb76c66cda18cbbef 100644 (file)
@@ -46,9 +46,11 @@ public:
        ///
        EDITABLE editable() const { return IS_EDITABLE; }
        /// A user can't neither insert nor delete this inset
-       bool deletable() const {
-               return false;
-       }
+       //bool deletable() const {
+       //      return false;
+       //}
+       /// keep .lyx format compatible
+       bool directWrite() const { return true; }
        ///
        void setCounter(int);
        ///
index 637a059a6164e2ecedc10a918544b9f32f9bfbcc..82ca677af39227e9107cc8e248782259df7fa9ce 100644 (file)
@@ -76,6 +76,8 @@ enum LYX_LATEX_TYPES {
        ///
        LATEX_ITEM_ENVIRONMENT,
        ///
+       LATEX_BIB_ENVIRONMENT,
+       ///
        LATEX_LIST_ENVIRONMENT
 };
 
index 6533fe3051d59c0ee66fa45e439c1ad018a42913..80e280b1577011124ebe46152a99a0d3602c5836 100644 (file)
@@ -680,6 +680,7 @@ void LyXLayout::readMargin(LyXLex & lexrc)
 void LyXLayout::readLatexType(LyXLex & lexrc)
 {
        keyword_item latexTypeTags[] = {
+               { "bib_environment",  LATEX_BIB_ENVIRONMENT },
                { "command",          LATEX_COMMAND },
                { "environment",      LATEX_ENVIRONMENT },
                { "item_environment", LATEX_ITEM_ENVIRONMENT },
@@ -697,6 +698,7 @@ void LyXLayout::readLatexType(LyXLex & lexrc)
        case LATEX_COMMAND:
        case LATEX_ENVIRONMENT:
        case LATEX_ITEM_ENVIRONMENT:
+       case LATEX_BIB_ENVIRONMENT:
        case LATEX_LIST_ENVIRONMENT:
                latextype = static_cast<LYX_LATEX_TYPES>(le);
                break;
index 7e1f10b8080bca3c4d0fc1d33f0c3bae4c468477..1aafb4a11476ecbbe641f1d60faced8ab5b493c8 100644 (file)
@@ -177,6 +177,7 @@ public:
        ///
        bool isEnvironment() const {
                return (latextype == LATEX_ENVIRONMENT
+                       || latextype == LATEX_BIB_ENVIRONMENT
                        || latextype == LATEX_ITEM_ENVIRONMENT
                        || latextype == LATEX_LIST_ENVIRONMENT);
        }
index 4e99c7318589bc58749bf4cc73c98868ab78324a..0a082a5eb2fcb32c9ea922bff8d5e3bb0ce4a07d 100644 (file)
@@ -78,7 +78,6 @@ Paragraph::Paragraph()
 #endif
        enumdepth = 0;
        itemdepth = 0;
-       bibkey = 0; // ale970302
        params().clear();
 }
 
@@ -99,7 +98,6 @@ Paragraph::Paragraph(Paragraph * par)
        previous_->next_ = this;
        // end
 
-       bibkey = 0; // ale970302
        params().clear();
 }
 #endif
@@ -118,14 +116,6 @@ Paragraph::Paragraph(Paragraph const & lp, bool same_ids)
        // follow footnotes
        layout_ = lp.layout();
 
-       // ale970302
-       if (lp.bibkey) {
-               bibkey = static_cast<InsetBibKey *>
-                       (lp.bibkey->clone(*current_view->buffer()));
-       } else {
-               bibkey = 0;
-       }
-
        // copy everything behind the break-position to the new paragraph
        insetlist = lp.insetlist;
        InsetList::iterator it = insetlist.begin();
@@ -149,9 +139,6 @@ Paragraph::~Paragraph()
                next_->previous_ = previous_;
 #endif
 
-       // ale970302
-       delete bibkey;
-
        delete pimpl_;
        //
        //lyxerr << "Paragraph::paragraph_id = "
@@ -234,10 +221,6 @@ void Paragraph::write(Buffer const * buf, ostream & os,
                os << "\\align " << string_align[h] << ' ';
        }
 
-       // bibitem  ale970302
-       if (bibkey)
-               bibkey->write(buf, os);
-
        LyXFont font1(LyXFont::ALL_INHERIT, bparams.language);
 
        Change running_change = Change(Change::UNCHANGED);
@@ -952,17 +935,21 @@ int Paragraph::getPositionOfInset(Inset const * inset) const
        // Find the entry.
        InsetList::iterator it = insetlist.begin();
        InsetList::iterator end = insetlist.end();
-       for (; it != end; ++it) {
-               if (it.getInset() == inset) {
+       for (; it != end; ++it)
+               if (it.getInset() == inset) 
                        return it.getPos();
-               }
-       }
-       if (inset == bibkey)
-               return 0;
-
        return -1;
 }
 
+
+InsetBibKey * Paragraph::bibkey()
+{
+       InsetList::iterator it = insetlist.begin();
+       if (it != insetlist.end() && it.getInset()->lyxCode() == Inset::BIBTEX_CODE)
+               return static_cast<InsetBibKey *>(it.getInset()); 
+       return 0;
+}
+
 namespace {
 
 InsetOptArg * optArgInset(Paragraph const & par)
@@ -1079,27 +1066,24 @@ Paragraph * Paragraph::TeXOnePar(Buffer const * buf,
 
        switch (style->latextype) {
        case LATEX_COMMAND:
-               os << '\\'
-                  << style->latexname();
+               os << '\\' << style->latexname();
 
                // Separate handling of optional argument inset.
                if (style->optionalargs == 1) {
                        InsetOptArg * it = optArgInset(*this);
-                       if (it != 0)
+                       if (it)
                                it->latexOptional(buf, os, false, false);
                }
                else
                        os << style->latexparam();
                break;
        case LATEX_ITEM_ENVIRONMENT:
-               if (bibkey) {
-                       bibkey->latex(buf, os, false, false);
-               } else
-                       os << "\\item ";
-               break;
        case LATEX_LIST_ENVIRONMENT:
                os << "\\item ";
                break;
+       case LATEX_BIB_ENVIRONMENT:
+               // ignore this, the inset will write itself
+               break;
        default:
                break;
        }
index 7b749821c569f5b4d25318fb41792cbaed5bc58b..75e8097f32932419ae7eb55dcfffff8e2d8e2bb5 100644 (file)
@@ -151,7 +151,7 @@ public:
        char itemdepth;
 
        ///
-       InsetBibKey * bibkey;  // ale970302
+       InsetBibKey * bibkey();  // ale970302
 
 #ifndef NO_NEXT
        ///
index 18e6855c76fc1ac308fc87834bbd43ee2c4d2b72..d9a2a41835d304f0d44c774281ce2e3e313135dc 100644 (file)
@@ -97,9 +97,6 @@ void breakParagraph(BufferParams const & bparams,
        tmp->params().lineTop(par->params().lineTop());
        tmp->params().pagebreakTop(par->params().pagebreakTop());
        tmp->params().spaceTop(par->params().spaceTop());
-       tmp->bibkey = par->bibkey;
-
-       par->bibkey = 0;
        par->params().clear();
 
        par->layout(bparams.getLyXTextClass().defaultLayout());
index 4113ae75acaf05fc18d055dbcf4bf115ffd53277..b8dae41293e72e72b67c821264cf3e036cdd0aee 100644 (file)
@@ -3455,19 +3455,6 @@ void LyXText::paintFirstRow(DrawRowParams & p)
                                  str, font);
                }
        }
-
-       if (layout->labeltype == LABEL_BIBLIO && par->bibkey) {
-               LyXFont font = getLayoutFont(buffer, par);
-               float x;
-               if (is_rtl) {
-                       x = ww - leftMargin(p.bv, p.row)
-                               + font_metrics::width(layout->labelsep, font);
-               } else {
-                       x = p.x - font_metrics::width(layout->labelsep, font)
-                               - par->bibkey->width(p.bv, font);
-               }
-               par->bibkey->draw(p.bv, font, p.yo + p.row->baseline(), x, p.cleared);
-       }
 }
 
 
index e6b21acb191910541f43181ddd60cdc45b0aa769..50030c4d5281374a79a68aa19598a7869093a108 100644 (file)
@@ -368,14 +368,11 @@ void LyXText::insertParagraph(BufferView * bview, Paragraph * par,
 
 Inset * LyXText::getInset() const
 {
-       Inset * inset = 0;
-       if (cursor.pos() == 0 && cursor.par()->bibkey) {
-               inset = cursor.par()->bibkey;
-       } else if (cursor.pos() < cursor.par()->size()
+       if (cursor.pos() < cursor.par()->size()
                   && cursor.par()->isInset(cursor.pos())) {
-               inset = cursor.par()->getInset(cursor.pos());
+               return cursor.par()->getInset(cursor.pos());
        }
-       return inset;
+       return 0;
 }
 
 
@@ -471,11 +468,6 @@ Paragraph * LyXText::setLayout(BufferView * bview,
                                            : VSpace(VSpace::NONE));
                if (lyxlayout->margintype == MARGIN_MANUAL)
                        par->setLabelWidthString(lyxlayout->labelstring());
-               if (lyxlayout->labeltype != LABEL_BIBLIO
-                   && fppar->bibkey) {
-                       delete fppar->bibkey;
-                       fppar->bibkey = 0;
-               }
                cur.par(par);
                par = par->next();
        } while (par != epar);
@@ -1271,13 +1263,15 @@ void LyXText::setCounter(Buffer const * buf, Paragraph * par) const
        } else if (layout->labeltype == LABEL_BIBLIO) {// ale970302
                textclass.counters().step("bibitem");
                int number = textclass.counters().value("bibitem");
-               if (!par->bibkey) {
-                       InsetCommandParams p("bibitem");
-                       par->bibkey = new InsetBibKey(p);
+               //if (!par->bibkey()) {
+               if (par->bibkey()) {
+                       par->bibkey()->setCounter(number);
+                       par->params().labelString(layout->labelstring());
                }
-               par->bibkey->setCounter(number);
-               par->params().labelString(layout->labelstring());
-
+               // else {
+               //      InsetCommandParams p("bibitem");
+               //      par->bibkey() = new InsetBibKey(p);
+               //}
                // In biblio should't be following counters but...
        } else {
                string s = layout->labelstring();
index 0a0e083c8b78e75ebc6868ea045dd2a98ccd2a64..5dacb94186039d614e0cf6f8c0f7bc7546a25b63 100644 (file)
@@ -1538,7 +1538,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 +1550,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;
        }
 
@@ -1621,6 +1610,7 @@ Inset::RESULT LyXText::dispatch(FuncRequest const & cmd)
        case LFUN_INSET_CAPTION:
 #endif
        case LFUN_INSERT_NOTE:
+       case LFUN_INSERT_BIBKEY:
        case LFUN_INSET_ERT:
        case LFUN_INSET_FLOAT:
        case LFUN_INSET_FOOTNOTE: