summaryrefslogtreecommitdiff
path: root/chart2/qa
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2014-06-18 10:05:38 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2014-06-18 10:24:54 +0200
commit860f543cdbf1d7ce8ddb3f9ad81c1c9aa41f02ed (patch)
tree0d299c43f863ad6ac6772999328a9c4e52310808 /chart2/qa
parent836454d0c1a490066f12cbe6327422ffb1065426 (diff)
chart2, sw: remaining textbox DOCX import test preparations
Ideally now all testcases handle both cases during DOCX import: - current situation, when shape with text is imported as a Writer TextFrame - future situation, when shape with text will be imported as shape with an assicated TextBox Change-Id: I5b95ff4672cecf39eb744f8557f967ade73404c0
Diffstat (limited to 'chart2/qa')
-rw-r--r--chart2/qa/extras/chart2export.cxx15
1 files changed, 14 insertions, 1 deletions
diff --git a/chart2/qa/extras/chart2export.cxx b/chart2/qa/extras/chart2export.cxx
index 21a9ece8de2e..851d67409dae 100644
--- a/chart2/qa/extras/chart2export.cxx
+++ b/chart2/qa/extras/chart2export.cxx
@@ -14,6 +14,7 @@
#include <com/sun/star/lang/XServiceName.hpp>
#include <com/sun/star/packages/zip/ZipFileAccess.hpp>
#include <com/sun/star/text/XTextDocument.hpp>
+#include <com/sun/star/text/XTextFramesSupplier.hpp>
#include <unotools/ucbstreamhelper.hxx>
#include <rtl/strbuf.hxx>
@@ -693,7 +694,19 @@ void Chart2ExportTest::testShapeFollowedByChart()
CPPUNIT_ASSERT(pXmlDoc);
OUString aValueOfFirstDocPR = getXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:r[1]/w:drawing[1]/wp:inline[1]/wp:docPr[1]", "id");
- OUString aValueOfSecondDocPR = getXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:r[2]/mc:AlternateContent[1]/mc:Choice[1]/w:drawing[1]/wp:anchor[1]/wp:docPr[1]", "id");
+ OUString aValueOfSecondDocPR;
+
+ uno::Reference<text::XTextFramesSupplier> xTextFramesSupplier(mxComponent, uno::UNO_QUERY);
+ uno::Reference<container::XIndexAccess> xIndexAccess(xTextFramesSupplier->getTextFrames(), uno::UNO_QUERY);
+ if (xIndexAccess->getCount())
+ {
+ // TODO TextBox: remove this when TextBox is enabled by default
+ // This second run is a bug, should be the first ideally
+ aValueOfSecondDocPR = getXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:r[2]/mc:AlternateContent[1]/mc:Choice[1]/w:drawing[1]/wp:anchor[1]/wp:docPr[1]", "id");
+ }
+ else
+ aValueOfSecondDocPR = getXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:r[1]/mc:AlternateContent[1]/mc:Choice[1]/w:drawing[1]/wp:anchor[1]/wp:docPr[1]", "id");
+
CPPUNIT_ASSERT( aValueOfFirstDocPR != aValueOfSecondDocPR );
}