From: Richard Heck Date: Fri, 3 Dec 2010 18:01:37 +0000 (+0000) Subject: Slight re-organization. X-Git-Tag: 2.0.0~1538 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=7f5c037df37b922fd2e02e11aa5005d8e7a2561f;p=features.git Slight re-organization. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36688 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/Buffer.cpp b/src/Buffer.cpp index cf66a7def9..5ee983f301 100644 --- a/src/Buffer.cpp +++ b/src/Buffer.cpp @@ -3013,22 +3013,23 @@ void Buffer::changeRefsIfUnique(docstring const & from, docstring const & to, { //FIXME: This does not work for child documents yet. LASSERT(code == CITE_CODE, /**/); + // Check if the label 'from' appears more than once - vector labels; - string paramName; checkBibInfoCache(); + BiblioInfo const & keys = masterBibInfo(); BiblioInfo::const_iterator bit = keys.begin(); BiblioInfo::const_iterator bend = keys.end(); + vector labels; for (; bit != bend; ++bit) // FIXME UNICODE labels.push_back(bit->first); - paramName = "key"; if (count(labels.begin(), labels.end(), from) > 1) return; + string const paramName = "key"; for (InsetIterator it = inset_iterator_begin(inset()); it; ++it) { if (it->lyxCode() == code) { InsetCommand * inset = it->asInsetCommand();