/**
* Applies the properties of the Anchor to a Chunk.
* @param chunk the Chunk (part of the Anchor)
* @param notGotoOK if true, this chunk will determine the local destination
* @param localDestination true if the chunk is a local goto and the reference a local destination
* @return the value of notGotoOK or false, if a previous Chunk was used to determine the local destination
*/
virtual protected bool ApplyAnchor(Chunk chunk, bool notGotoOK, bool localDestination)
{
if (name != null && notGotoOK && !chunk.IsEmpty())
{
chunk.SetLocalDestination(name);
notGotoOK = false;
}
if (localDestination)
{
chunk.SetLocalGoto(reference.Substring(1));
}
else if (reference != null)
{
chunk.SetAnchor(reference);
}
return(notGotoOK);
}