summaryrefslogtreecommitdiff
path: root/sd/qa/unit/sdmodeltestbase.hxx
diff options
context:
space:
mode:
authorRosemary Sebastian <rosemaryseb8@gmail.com>2016-02-03 09:15:19 +0530
committerKatarina Behrens <Katarina.Behrens@cib.de>2016-02-08 13:37:21 +0000
commit33d289d53fef36b8e7c4db4a9c9ddd9c1f2edbb2 (patch)
tree9279da9a84c1440d2166b2db0fc663c8b25cbc12 /sd/qa/unit/sdmodeltestbase.hxx
parent2d5f3dcf8dca6f0eb73e7435f333fba148bf9d49 (diff)
Export and import of additional fields in Impress
These include - Author - Page Count - Page Name Export and import of slide number was already implemented. A test for the same has been added along with the tests for the newly implemented field exports. In sdmodeltestbase.hxx a new method getTextFieldFromPage has been added to reduce copy-paste code Change-Id: Icf54b91a7db4b3cccd9d0666a2706e3cc2a89d9a Reviewed-on: https://gerrit.libreoffice.org/22065 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Katarina Behrens <Katarina.Behrens@cib.de>
Diffstat (limited to 'sd/qa/unit/sdmodeltestbase.hxx')
-rw-r--r--sd/qa/unit/sdmodeltestbase.hxx19
1 files changed, 19 insertions, 0 deletions
diff --git a/sd/qa/unit/sdmodeltestbase.hxx b/sd/qa/unit/sdmodeltestbase.hxx
index 4c465470c4ef..8a280d9bd75d 100644
--- a/sd/qa/unit/sdmodeltestbase.hxx
+++ b/sd/qa/unit/sdmodeltestbase.hxx
@@ -27,6 +27,7 @@
#include <com/sun/star/drawing/XDrawPagesSupplier.hpp>
#include <drawinglayer/XShapeDumper.hxx>
+#include <com/sun/star/text/XTextField.hpp>
using namespace ::com::sun::star;
@@ -327,6 +328,24 @@ protected:
return xRun;
}
+
+ uno::Reference<text::XTextField> getTextFieldFromPage(int nRun, int nPara, int nShape, int nPage, sd::DrawDocShellRef xDocShRef)
+ {
+ // get TextShape 1 from the first page
+ uno::Reference< beans::XPropertySet > xShape( getShapeFromPage( nShape, nPage, xDocShRef ) );
+
+ // Get first paragraph
+ uno::Reference<text::XTextRange> xParagraph( getParagraphFromShape( nPara, xShape ) );
+
+ // first chunk of text
+ uno::Reference<text::XTextRange> xRun( getRunFromParagraph( nRun, xParagraph ) );
+
+ uno::Reference< beans::XPropertySet > xPropSet( xRun, uno::UNO_QUERY_THROW );
+
+ uno::Reference<text::XTextField> xField;
+ xPropSet->getPropertyValue("TextField") >>= xField;
+ return xField;
+ }
};
#endif