Copy link to clipboard
Copied
Hi all!
I have been working in this new feature of InDesign CC 2018, endnotes, but all information is related with the "owned item" referenced by endnotes and the way to create a pointer to IEndnoteTextRangeData from IEndnoteReferenceData.
Something like that:
....
do {
Utils<ITextUtils> iTextUtils;
if (iTextUtils == nil) {
ASSERT(iTextUtils);
break;
}
OwnedItemDataList ownedItemList;
int32 primarySpan = iTextModel->GetPrimaryStoryThreadSpan() - 1;
if (primarySpan == 0) {
result = kSuccess;
break;
}
iTextUtils->CollectOwnedItems(iTextModel, 0, primarySpan, &ownedItemList);
bool16 abortLoop = kFalse;
for (int32 i = 0; i<ownedItemList.size(); i++) {
// filter for only references to endnotes
if (ownedItemList.fClassID == kEndnoteAnchorBoss) {
InterfacePtr<IEndnoteReferenceData> iEndnoteReferenceData(::GetDataBase(iTextModel), ownedItemList.fUID, UseDefaultIID());
if (!iEndnoteReferenceData)
continue;
InterfacePtr<IEndnoteTextRangeData> iEndnoteTextRangeData(iEndnoteReferenceData->QueryEndnoteReference());
if (!iEndnoteTextRangeData)
continue;
TextIndex rangeStart = iEndnoteTextRangeData->GetStartTextIndex();
}
.....
But, if I know that I am in a "endnote story":
if ( ::GetClass(iTextModell) == kEndnoteStoryBoss ){ ...}
how can I know that the markers "kTextChar_ZeroSpaceNoBreak" found in this story are related with endnotes? (here there is no "owned items" to identify start and end of endnote text range).
Thank you very much in advance for your help and hints.
Kind regards,
Juanma.
Copy link to clipboard
Copied
Endnote text range contains XML markers at start and end.
kTextChar_ZeroSpaceNoBreak is a XML marker.
Refer sdk/source/sdksamples/codesnippets/SnpManipulateTextEndnode::GetRawEndnoteTextRange().
Copy link to clipboard
Copied
Hi Norio!
First of all, thank you very much for your comments.
But I think you have not understood my question, or maybe I did not explain very well.
Yes, I know "kTextChar_ZeroSpaceNoBreak" is a XML marker, but If I am processing all elements of a story, concretly endnote story, and I find this marker, I cannot tell if it's a start or end marker of endnote, or just another type of marker.
That's my question and my problem, if there is a way to know the orgin of these makers only processing the "endnote story".
Thanks in advance for your help.
Kind regards,
Juanma.