2 Replies Latest reply on Jan 11, 2018 3:06 AM by juanma_manzanares

    CC 2018: how can I know that the markers "kTextChar_ZeroSpaceNoBreak" found in a "endnote story" are related with endnotes?

    juanma_manzanares

      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[i].fClassID == kEndnoteAnchorBoss) {

                      InterfacePtr<IEndnoteReferenceData> iEndnoteReferenceData(::GetDataBase(iTextModel), ownedItemList[i].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.