gc.setClipping(paintX, paintY, clientArea.width, paragraphBottom - paintY);
int height = paragraphBottom - paintY; gc.setClipping(paintX, paintY, clientArea.width, height);
	void print() {		Color background = gc.getBackground();		Color foreground = gc.getForeground();		int paintY = clientArea.y;		int paintX = clientArea.x;		int page = startPage;		int pageBottom = clientArea.y + clientArea.height;		int orientation =  gc.getStyle() & (SWT.RIGHT_TO_LEFT | SWT.LEFT_TO_RIGHT);						for (int i = startLine; i <= endLine && page <= endPage; i++) {			if (paintY == clientArea.y) {				printer.startPage();				printDecoration(page, true);			}			TextLayout layout = printerRenderer.getTextLayout(i, orientation, clientArea.width, lineSpacing);			Color lineBackground = printerRenderer.getLineBackground(i, background);			int paragraphBottom = paintY + layout.getBounds().height; 			if (paragraphBottom <= pageBottom) {				//normal case, the whole paragraph fits in the current page				printLine(paintX, paintY, gc, foreground, lineBackground, layout);				paintY = paragraphBottom;			} else {				int lineCount = layout.getLineCount();				while (paragraphBottom > pageBottom && lineCount > 0) {					lineCount--;					paragraphBottom -= layout.getLineBounds(lineCount).height + layout.getSpacing();				}				if (lineCount == 0) {					//the whole paragraph goes to the next page					printDecoration(page, false);					printer.endPage();					page++;					if (page <= endPage) {						printer.startPage();						printDecoration(page, true);						paintY = clientArea.y;						printLine(paintX, paintY, gc, foreground, lineBackground, layout);						paintY += layout.getBounds().height;					}				} else {					//draw paragraph top in the current page and paragraph bottom in the next					gc.setClipping(paintX, paintY, clientArea.width, paragraphBottom - paintY);					printLine(paintX, paintY, gc, foreground, lineBackground, layout);					printDecoration(page, false);					printer.endPage();										page++;					if (page <= endPage) {						printer.startPage();						printDecoration(page, true);						paintY = clientArea.y;						int height = layout.getBounds().height - paragraphBottom;						gc.setClipping(paintX, paintY, clientArea.width, height);						printLine(paintX, paintY, gc, foreground, lineBackground, layout);						paintY += height;					}					gc.setClipping((Rectangle)null);				}			}			printerRenderer.disposeTextLayout(layout);		}		if (paintY > clientArea.y) {			// close partial page			printDecoration(page, false);			printer.endPage();		}	}