Table problem using FDK
Hi there
I'm having an issue with tables using the FrameMaker 8 API.I'm trying to process a document which has about 7 or 8 tables in it. Part of what I do is delete all the strings in a Frame Document and replace them with their equivalents in another language. The deletion is performed by querying the text items in a paragraph, iterating through each of them, finding the FTI_String objects, seleting them, and clearing them. However, I'm finding that the API is also deleting some of the tables in the document.
The code I use to do string deletion is :
F_TextItemsT textItems = F_ApiGetText(m_hDocument, hParagraph, -1);
int nItem = (int)textItems.len;
while (textItems.len > 0 && nItem >= 0)
{
F_TextItemT thisTextItem = textItems.val[nItem];
if (thisTextItem.dataType == FTI_String)
{
StringT string = thisTextItem.u.sdata; //get text item string
CString szText = ConvertFromStringT(string); //convert to CString (for debugger)
F_TextRangeT range;
range.beg.objId = hParagraph;
range.end.objId = hParagraph;
range.beg.offset = thisTextItem.offset; //get start,end offsets of current text item
int nTextLength = szText.GetLength();
range.end.offset = thisTextItem.offset + nTextLength;
F_ApiSetTextRange(FV_SessionId,
m_hDocument,
FP_TextSelection,
&range); // I only want to select strings, but some tables are selected too
F_ApiClear(m_hDocument, 0);
}
}
However, with some (but not all) of the tables, F_ApiSetTextRange is selecting entire tables as well, for reasons I can't understand. and deleting them.
I was wondering if it's a problem in my approach, or if it's a possible problem with the document. I did notice that it was originally authored in FrameMaker 7, but it's being parsed with the FDK8 but I'm assuming that shouldn't make a difference.
Thanks
Eric
