diff options
author | Luboš Luňák <l.lunak@suse.cz> | 2012-08-07 12:46:04 +0200 |
---|---|---|
committer | Luboš Luňák <l.lunak@suse.cz> | 2012-08-08 16:32:56 +0200 |
commit | 5b16f3e59afc46bea8385d236044bc4af15740e6 (patch) | |
tree | f6ebbf542d6f923637e6118bf4064df3926569c9 | |
parent | fc41a73a67a2bd30006a49d061d870533d49c0e8 (diff) |
make it possible to verify contents of a text run too
Change-Id: I07e6b53445fe8da6cccaadeb9bbe94c180cd6d8c
-rw-r--r-- | sw/qa/extras/swmodeltestbase.hxx | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/sw/qa/extras/swmodeltestbase.hxx b/sw/qa/extras/swmodeltestbase.hxx index b0ec46027e98..9210fa8b1d22 100644 --- a/sw/qa/extras/swmodeltestbase.hxx +++ b/sw/qa/extras/swmodeltestbase.hxx @@ -163,7 +163,7 @@ protected: } // Get paragraph (counted from 1), optionally check it contains the given text. - uno::Reference< text::XTextRange > getParagraph( int number, rtl::OUString content = OUString() ) const + uno::Reference< text::XTextRange > getParagraph( int number, OUString content = OUString() ) const { uno::Reference<text::XTextDocument> textDocument(mxComponent, uno::UNO_QUERY); uno::Reference<container::XEnumerationAccess> paraEnumAccess(textDocument->getText(), uno::UNO_QUERY); @@ -178,14 +178,16 @@ protected: return paragraph; } - /// Get run (counted from 1) of a paragraph. - uno::Reference<text::XTextRange> getRun(uno::Reference<text::XTextRange> xParagraph, int number) const + /// 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 { uno::Reference<container::XEnumerationAccess> xRunEnumAccess(xParagraph, uno::UNO_QUERY); uno::Reference<container::XEnumeration> xRunEnum = xRunEnumAccess->createEnumeration(); for (int i = 1; i < number; ++i) xRunEnum->nextElement(); uno::Reference<text::XTextRange> xRun(xRunEnum->nextElement(), uno::UNO_QUERY); + if( !content.isEmpty()) + CPPUNIT_ASSERT_EQUAL( content, xRun->getString()); return xRun; } |