From 7fa3f39b0de1b3f72fdc402214a6e9293723f25a Mon Sep 17 00:00:00 2001 From: Angus Leeming Date: Mon, 28 Jul 2003 23:53:36 +0000 Subject: [PATCH] Kill ChangeCitationsIfUnique; various small bits 'n' bobs. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7435 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/BufferView.C | 16 ---------------- src/BufferView.h | 2 -- src/ChangeLog | 6 ++++++ src/insets/ChangeLog | 16 ++++++++++++++-- src/insets/insetbibitem.C | 6 ------ src/insets/insetbibtex.C | 14 ++++++-------- src/insets/insetbibtex.h | 4 +--- src/insets/insetcommand.C | 2 +- 8 files changed, 28 insertions(+), 38 deletions(-) diff --git a/src/BufferView.C b/src/BufferView.C index f42d68981b..8dfbdbb964 100644 --- a/src/BufferView.C +++ b/src/BufferView.C @@ -40,7 +40,6 @@ #include "support/FileInfo.h" #include "support/filetools.h" -#include "support/lyxfunctional.h" // equal_1st_in_pair #include "support/types.h" #include "support/lyxalgo.h" // lyx_count @@ -650,21 +649,6 @@ bool BufferView::ChangeRefsIfUnique(string const & from, string const & to) } -bool BufferView::ChangeCitationsIfUnique(string const & from, string const & to) -{ - typedef pair StringPair; - - vector keys; - buffer()->fillWithBibKeys(keys); - if (count_if(keys.begin(), keys.end(), - lyx::equal_1st_in_pair(from)) - > 1) - return false; - - return ChangeInsets(InsetOld::CITE_CODE, from, to); -} - - UpdatableInset * BufferView::theLockingInset() const { // If NULL is not allowed we should put an Assert here. (Lgb) diff --git a/src/BufferView.h b/src/BufferView.h index 808166592e..60bb7c35cf 100644 --- a/src/BufferView.h +++ b/src/BufferView.h @@ -197,8 +197,6 @@ public: /// FIXME bool ChangeRefsIfUnique(string const & from, string const & to); - /// FIXME - bool ChangeCitationsIfUnique(string const & from, string const & to); /// get the contents of the window system clipboard string const getClipboard() const; diff --git a/src/ChangeLog b/src/ChangeLog index 19b6b481e2..4a82b3151a 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2003-07-29 Angus Leeming + + * BufferView.[Ch] (ChangeCitationsIfUnique): This function most + certainly does not do what it purports to do. I am doing it, and + us, a favour by killing it. + 2003-07-28 José Matos * buffer.C (readBody, do_writeFile): diff --git a/src/insets/ChangeLog b/src/insets/ChangeLog index 17bf436503..395cc22df2 100644 --- a/src/insets/ChangeLog +++ b/src/insets/ChangeLog @@ -1,3 +1,15 @@ +2003-07-29 Angus Leeming + + * insetcommand.C (localDispatch): default to + InsetOld::localDispatch. + + * insetbibitem.C (localDispatch): + * insetbibtex.C (localDispatch): remove call to + ChangeCitationsIfUnique. + + * insetbibtex.[Ch] (clone): move out of line; use copy c-tor. + + 2003-07-28 José Matos * insetext.C (read): \end_document replaces \the_end. @@ -13,10 +25,10 @@ * insettabular.C (write): remove extra space -2003-07-28 Martin Vermeer +2003-07-28 Martin Vermeer * insetnote.C: Umpf. Hope I *now* get it right :-( -2003-07-28 Martin Vermeer +2003-07-28 Martin Vermeer *insetnote.C: did the right fix to greyedout: \color instead of \textcolor. diff --git a/src/insets/insetbibitem.C b/src/insets/insetbibitem.C index ff97d43ca2..95b0f089ac 100644 --- a/src/insets/insetbibitem.C +++ b/src/insets/insetbibitem.C @@ -66,12 +66,6 @@ dispatch_result InsetBibitem::localDispatch(FuncRequest const & cmd) InsetCommandMailer::string2params(cmd.argument, p); if (p.getCmdName().empty()) return DISPATCHED; - - if (view() && p.getContents() != params().getContents()) { - view()->ChangeCitationsIfUnique(params().getContents(), - p.getContents()); - } - setParams(p); cmd.view()->updateInset(this); cmd.view()->fitCursor(); diff --git a/src/insets/insetbibtex.C b/src/insets/insetbibtex.C index ee54c840b5..f016af125c 100644 --- a/src/insets/insetbibtex.C +++ b/src/insets/insetbibtex.C @@ -48,6 +48,12 @@ InsetBibtex::~InsetBibtex() } +std::auto_ptr InsetBibtex::clone() const +{ + return std::auto_ptr(new InsetBibtex(*this)); +} + + dispatch_result InsetBibtex::localDispatch(FuncRequest const & cmd) { switch (cmd.action) { @@ -61,14 +67,7 @@ dispatch_result InsetBibtex::localDispatch(FuncRequest const & cmd) InsetCommandMailer::string2params(cmd.argument, p); if (p.getCmdName().empty()) return DISPATCHED; - - if (view() && p.getContents() != params().getContents()) { - view()->ChangeCitationsIfUnique(params().getContents(), - p.getContents()); - } - setParams(p); - cmd.view()->updateInset(this); return DISPATCHED; } @@ -160,7 +159,6 @@ int InsetBibtex::latex(Buffer const * buffer, ostream & os, vector const InsetBibtex::getFiles(Buffer const & buffer) const { - // Doesn't appear to be used (Angus, 31 July 2001) Path p(buffer.filePath()); vector vec; diff --git a/src/insets/insetbibtex.h b/src/insets/insetbibtex.h index 70939a88c1..8dfd9fbe9b 100644 --- a/src/insets/insetbibtex.h +++ b/src/insets/insetbibtex.h @@ -25,9 +25,7 @@ public: /// ~InsetBibtex(); /// - std::auto_ptr clone() const { - return std::auto_ptr(new InsetBibtex(params())); - } + std::auto_ptr clone() const; /// small wrapper for the time being virtual dispatch_result localDispatch(FuncRequest const & cmd); /// diff --git a/src/insets/insetcommand.C b/src/insets/insetcommand.C index 7f88850366..0392743e4c 100644 --- a/src/insets/insetcommand.C +++ b/src/insets/insetcommand.C @@ -114,7 +114,7 @@ dispatch_result InsetCommand::localDispatch(FuncRequest const & cmd) return localDispatch(FuncRequest(cmd.view(), LFUN_INSET_EDIT)); default: - return UNDISPATCHED; + return InsetOld::localDispatch(cmd); } }