summaryrefslogtreecommitdiff
path: root/sw/qa/extras/inc
diff options
context:
space:
mode:
Diffstat (limited to 'sw/qa/extras/inc')
-rw-r--r--sw/qa/extras/inc/swmodeltestbase.hxx12
1 files changed, 12 insertions, 0 deletions
diff --git a/sw/qa/extras/inc/swmodeltestbase.hxx b/sw/qa/extras/inc/swmodeltestbase.hxx
index fc8682d39f1c..3f0fab8c8545 100644
--- a/sw/qa/extras/inc/swmodeltestbase.hxx
+++ b/sw/qa/extras/inc/swmodeltestbase.hxx
@@ -10,9 +10,11 @@
#include <com/sun/star/container/XContentEnumerationAccess.hpp>
#include <com/sun/star/frame/Desktop.hpp>
#include <com/sun/star/style/XStyleFamiliesSupplier.hpp>
+#include <com/sun/star/text/XPageCursor.hpp>
#include <com/sun/star/text/XTextDocument.hpp>
#include <com/sun/star/text/XTextRange.hpp>
#include <com/sun/star/text/XTextTable.hpp>
+#include <com/sun/star/text/XTextViewCursorSupplier.hpp>
#include <com/sun/star/table/XCell.hpp>
#include <test/bootstrapfixture.hxx>
@@ -312,6 +314,16 @@ protected:
}
}
+ /// Get page count.
+ int getPages()
+ {
+ uno::Reference<frame::XModel> xModel(mxComponent, uno::UNO_QUERY);
+ uno::Reference<text::XTextViewCursorSupplier> xTextViewCursorSupplier(xModel->getCurrentController(), uno::UNO_QUERY);
+ uno::Reference<text::XPageCursor> xCursor(xTextViewCursorSupplier->getViewCursor(), uno::UNO_QUERY);
+ xCursor->jumpToLastPage();
+ return xCursor->getPage();
+ }
+
uno::Reference<lang::XComponent> mxComponent;
xmlBufferPtr mpXmlBuffer;