This fix suppresses the "BROKEN:" tag on references to labels, when the reference is within an "internal" buffer, i.e., associated to an Embedded WorkArea (such as the Advanced Find&Replace Find... or Replace with... boxes).

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@31219 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Tommaso Cucinotta 2009-08-24 11:41:58 +00:00
parent 7751c6197b
commit 476fce263a

View File

@ -25,6 +25,7 @@
#include "support/docstream.h"
#include "support/gettext.h"
#include "support/lstrings.h"
#include "support/FileName.h"
using namespace lyx::support;
using namespace std;
@ -142,9 +143,19 @@ void InsetRef::updateLabels(ParIterator const & it)
}
/** \note
** If inset belongs to an Embedded WorkArea's Buffer, ref is likely
** to point to some documentBuffer's label. Don't know how to
** retrieve the corresponding documentBuffer (so as to check if the
** label exists or not), so the "BROKEN:" indication is disabled in
** Embedded WorkArea(s).
**/
void InsetRef::addToToc(DocIterator const & cpit)
{
docstring const & label = getParam("reference");
if (buffer().fileName().extension() == "internal")
return;
if (buffer().insetLabel(label))
// This InsetRef has already been taken care of in InsetLabel::addToToc().
return;