Skip to main content
Participating Frequently
April 1, 2008
Question

FDK 7.1/FrameMaker 7.1 F_ApiDelete

  • April 1, 2008
  • 5 replies
  • 801 views
Hello.

I thing we have found a bug in FDK7.1 or FrameMaker 7.1.
We have a table cell in which there is a lot of Markers and Graphics anchors.

See this:

TC
|-Marker
|-Graph
|-Graph
|-Marker
.
.
.

There is aproximatelly 10 Marker element and 20 Graph elements.

Now we programattically delete all Graph element. So we use recurisve function to get all Graph element and than call on each:
F_ApiDelete(docId, elemId).

But suprised some Marker elements where deletes also.
It looks like there is a problem with elements, that are only one byte textranges.

Than we have replaced F_ApiDelete with F_ApiDeleteText and it worked.
So problem is not in our algorithm but in F_ApiDelete function.

Maybe problem is caused by invalid structure, because Graph,Marker elements are not allowed in structure.

Is this know bug?

Regards Peter
This topic has been closed for replies.

5 replies

Participating Frequently
April 23, 2008
Hello.

No Graph elements are FO_Graphic, and Markers are normal FO_Marker. But they all are in Table Cell element.

I will try to manually delete it in Structure view.
Legend
April 8, 2008
As I think more on it, you could test this theory by manually deleting the Graph elements one by one, using the Structure View. If any Marker elements get deleted, it must be because the markers are living in a Graph element text range.
Legend
April 7, 2008
Ah, you got me thinking now. Is a Graph element a paragraph-containing element? The reason I ask is that a marker has to live in some paragraph, even if it is represented structurally as a sibling to a paragraph. I'm not quite sure of the exact logic, but I do know that if you put a marker as a sibling to paragraph-containing elements, its actual text location will end up within one of those paragraphs. Therefore, if you delete the paragraph element, maybe it will force a delete of the marker element as well.

I don't know this absolutely for sure, and I don't know if this is the problem you are seeing. Just an idea, really.

Russ
Participating Frequently
April 7, 2008
Hello.<br /><br />I am absolutly sure. First of all I am traversing trought elements using FP_FirstChildElement and FP_NextSiblingElement. And element ids (F_ObjHandleT) are stored in vector<F_ObjHandleT>.<br /><br />Than I call F_ApiDelete(ids) for each item in vector.<br /><br />As i said if I replace F_ApiDelete with F_ApiDeleteText, where textrange is:<br />tr.beg = F_ApiGetTextLoc( .. loc of marker, graphic)<br />tr.end = tr.beg<br />tr.end.offset++<br /><br />It works and deletes only correct elements.
Legend
April 1, 2008
Hi Peter,

I have never known F_ApiDelete() to fail, whether or not on elements or other objects, and whether or not element structures are valid. I have used it for all these types of elements too. Are you absolutely sure your element IDs are valid? How are you obtaining them? Are you using the element tree to step through them with FP_FirstChildElement and FP_NextSiblingElement, etc.?

Russ