Hi
I have been trying to write a simple page traverser since half a day
unsuccessfully. Here is little code:
bool blnJump = xPageCursor->jumpToNextPage();
printf ("Jump Page: %d\n", blnJump);
Reference <XTextViewCursor> xViewCursor2 (xPageCursor,
UNO_QUERY);
if (xViewCursor2 == NULL)
{
ShowMessageBox( xToolkit, m_ooxFrame,
OUString( RTL_CONSTASCII_USTRINGPARAM(
"Test App" )),
OUString( RTL_CONSTASCII_USTRINGPARAM( "
xViewCursor not found" )) );
return false;
}
Reference <XTextRange> xTextRange2 (xViewCursor2, UNO_QUERY);
Reference <XTextCursor> xModelCursor2 = xDocumentText->
createTextCursorByRange(xTextRange2);
Reference <XParagraphCursor> xPrCursor2 (xModelCursor2,
UNO_QUERY);
if (xPrCursor2 == NULL)
{
ShowMessageBox( xToolkit, m_ooxFrame,
OUString( RTL_CONSTASCII_USTRINGPARAM( "Test App" )),
OUString( RTL_CONSTASCII_USTRINGPARAM(
"xPrCursor is not found" )) );
return false;
}
int paraCount = 0;
while (xPrCursor2->gotoNextParagraph(false) )
// && xPrCursor->getText() != xPrCursor2->getText())
{
paraCount ++;
}
printf ("%d\n", paraCount );
This code has a flaw --> It gives all paras starting from the current page
till last page of document.
While I want all paras of "current page". Could somebody please help with
this? It doesnt appear to be as easy as I thought it to be.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]