PGetLineBreak

Gets the number of line breaks in the highlighted text and gets the type (e.g., text wrap, end of line, tab, soft return, or hard return) and character count since the last line break for each.


Query results

PGetLineBreak is a subclass of PListQuery. This query returns a list of information. For each line break, it returns:

short nCharCount;

Number of characters (including line breaks) since last line break (or since the beginning of selection)
short cLineBreakType;
0 for automatic text wrap around a graphic
1 for automatic text wrap at end of a line
2 for end of paragraph (hard return) or extra space between paragraphs
3 for tab
4 for soft return (Shift + Return)
5 for end of selection
Several lines selected. Be careful not to select too much text; this query can return a large amount of data, especially if the text contains numerous tabs. If your plug-in, rather than PageMaker, allocates the reply buffer but doesn't make it large enough, the query will fail.

nCharCount includes line breaks, not end of selection. If more than one type of line break occurs at the same point, PageMaker returns an nCharCount/nLineBreakType pair for each line break. However, the end of selection is not a character and is not included in nCharCount.

Layout view only. The PGetLineBreak query works only in layout view.

Extra space between paragraphs. PageMaker returns a separate nCharCount/cLineBreakType pair for extra space between paragraphs, setting nCharCount to 0 (zero) and cLineBreakType to 2. Extra space includes space added by the:

Example. The following example gets the number of line breaks in the highlighted text, the type of break, and character count since last break.

PGetLineBreak lineBrk;
lineBrk.Count();  // expected: 4
lineBrk.nCharCount;        // 1
lineBrk.cLineBreakType;    // 3 (tabs)
lineBrk++;
lineBrk.nCharCount;        // 18
lineBrk.cLineBreakType;    // 1 (automatic text wrap)
lineBrk++;
lineBrk.nCharCount;        // 21
lineBrk.cLineBreakType;    // 2 (end of para)
lineBrk++;
lineBrk.nCharCount;        // 2
lineBrk.cLineBreakType;    // 5 (end of selection, no line break


See also

The PGetLineBreakLoc and PGetTextRun queries



Copyright © 1996, Adobe Systems Incorporated. All rights reserved.

Comments or suggestions? Contact Adobe Developer Support