3 Replies Latest reply on Aug 12, 2016 4:48 AM by Ch. Efstathios

    How to get the current line or the whole paragraph?

    Ch. Efstathios Level 1

      Hi.

       

      I am facing the following problem:

       

      Suppose that I have the following paragraphs in FrameMaker:

       

      This is a sentence. And   (simple line end)

      also there this sentence. (paragraph end)

       

      This is a sentence. And   (hard return)

      also there this sentence. (paragraph end)

       

      This is a sentence. And   (simple line end)

      also there this sentence. (hard return)

      But there is also this sentence (paragraph end)

       

      This is a sentence. And   (simple line end)

      also there this sentence. (hard return)

      also there this sentence. (hard return)

      But there is also this sentence (paragraph end)

       

      What I want is the following:

       

      Get the whole paragraph text where the insertion point of the cursor is.

       

      However, when hard line ends exist I want to change behavior.

       

      Here is the behavior for the above paragraphs:

       

      For the first paragraph example if the cursor is either in first or in second line I want to get the whole paragraph.

       

      For the second paragraph if the cursor is in the first line I want only the first line. And if it is in the second line I want only the second line.

       

      For the third paragraph if the cursor either in first or second line I want both first and second lines to be retrieved as single text. Also if the cursor is in the third line I want only the third line.

       

      For the fourth paragraph it works like the third paragraph. And if the cursor is in the third line I get only this one.

       

      Could you please provide some code with FDK in C++ to start with?

       

      It is a brain teaser.