summaryrefslogtreecommitdiff
path: root/sw/qa/extras/inc
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@suse.cz>2013-04-18 14:42:22 +0200
committerMiklos Vajna <vmiklos@suse.cz>2013-04-18 15:54:05 +0200
commit3d4fef85d05269e613316a7af6245f05d207d76e (patch)
tree3d33fa69ee57089ca91f34845187ead3f5aad871 /sw/qa/extras/inc
parent85f88a20b44a8c4742a6fdd6263e31cf023cfc36 (diff)
fdo#63023 incorrect RTF background color in header
Change-Id: I33f5c8a856206860ac9cdb23dd6b5222cb785bf7
Diffstat (limited to 'sw/qa/extras/inc')
-rw-r--r--sw/qa/extras/inc/swmodeltestbase.hxx18
1 files changed, 15 insertions, 3 deletions
diff --git a/sw/qa/extras/inc/swmodeltestbase.hxx b/sw/qa/extras/inc/swmodeltestbase.hxx
index 86547b8848ad..94b5d7e58e04 100644
--- a/sw/qa/extras/inc/swmodeltestbase.hxx
+++ b/sw/qa/extras/inc/swmodeltestbase.hxx
@@ -198,10 +198,16 @@ protected:
}
// Get paragraph (counted from 1), optionally check it contains the given text.
- uno::Reference<text::XTextContent> getParagraphOrTable(int number) const
+ uno::Reference<text::XTextContent> getParagraphOrTable(int number, uno::Reference<text::XText> xText = uno::Reference<text::XText>()) const
{
- uno::Reference<text::XTextDocument> textDocument(mxComponent, uno::UNO_QUERY);
- uno::Reference<container::XEnumerationAccess> paraEnumAccess(textDocument->getText(), uno::UNO_QUERY);
+ uno::Reference<container::XEnumerationAccess> paraEnumAccess;
+ if (xText.is())
+ paraEnumAccess.set(xText, uno::UNO_QUERY);
+ else
+ {
+ uno::Reference<text::XTextDocument> textDocument(mxComponent, uno::UNO_QUERY);
+ paraEnumAccess.set(textDocument->getText(), uno::UNO_QUERY);
+ }
uno::Reference<container::XEnumeration> paraEnum = paraEnumAccess->createEnumeration();
for( int i = 1;
i < number;
@@ -221,6 +227,12 @@ protected:
return xParagraph;
}
+ uno::Reference<text::XTextRange> getParagraphOfText(int number, uno::Reference<text::XText> xText) const
+ {
+ uno::Reference<text::XTextRange> const xParagraph(getParagraphOrTable(number, xText), uno::UNO_QUERY_THROW);
+ return xParagraph;
+ }
+
/// Get run (counted from 1) of a paragraph, optionally check it contains the given text.
uno::Reference<text::XTextRange> getRun(uno::Reference<text::XTextRange> xParagraph, int number, OUString content = OUString()) const
{