summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorJustin Luth <justin.luth@collabora.com>2019-08-07 15:51:07 +0300
committerJustin Luth <justin_luth@sil.org>2019-08-13 06:35:03 +0200
commit75b10a6c36267c30ae01c850b2a2f9ee99b74e43 (patch)
tree0e38739a1e2bfd8b03aa3acd94d39077540f06b3 /sw
parentc8e64ea4fd0122dad9d4f06bacffd1c179e753f8 (diff)
tdf#114854 writerfilter: EditEng URLs import different from SW URLs
The only example I found was comments (aka annotations/postits). No other unit tests had a URL in a draw component. Change-Id: Iad5c285090d646c495cd2a7b19e076d9e50fb58d Reviewed-on: https://gerrit.libreoffice.org/77108 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org>
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport4.cxx14
1 files changed, 11 insertions, 3 deletions
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx
index 140c90723a1a..ddc71edc6861 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx
@@ -14,6 +14,7 @@
#include <com/sun/star/drawing/FillStyle.hpp>
#include <com/sun/star/drawing/XControlShape.hpp>
#include <com/sun/star/text/RelOrientation.hpp>
+#include <com/sun/star/text/XTextField.hpp>
#include <com/sun/star/text/XTextTable.hpp>
#include <com/sun/star/text/XTextViewCursorSupplier.hpp>
#include <com/sun/star/text/XTextColumns.hpp>
@@ -811,9 +812,16 @@ DECLARE_OOXMLEXPORT_TEST(testParagraphWithComments, "paragraphWithComments.docx"
DECLARE_OOXMLEXPORT_TEST(testTdf104707_urlComment, "tdf104707_urlComment.odt")
{
- xmlDocPtr pXmlComm = parseExport("word/comments.xml");
- CPPUNIT_ASSERT(pXmlComm);
- CPPUNIT_ASSERT_EQUAL( OUString("https://bugs.documentfoundation.org/show_bug.cgi?id=104707"), getXPathContent(pXmlComm,"/w:comments/w:comment/w:p/w:hyperlink/w:r/w:t") );
+ uno::Reference<text::XTextFieldsSupplier> xTextFieldsSupplier(mxComponent, uno::UNO_QUERY);
+ uno::Reference<container::XEnumerationAccess> xFieldsAccess(xTextFieldsSupplier->getTextFields());
+ uno::Reference<container::XEnumeration> xFields(xFieldsAccess->createEnumeration());
+ auto aField1 = xFields->nextElement();
+ // the comment/annotation/postit text
+ auto xText = getProperty< uno::Reference<text::XText> >(aField1, "TextRange");
+ // the hyperlink within the comment text
+ auto xURLField = getProperty< uno::Reference<text::XTextField> >(xText, "TextField");
+ auto aURL = getProperty< OUString >(xURLField, "URL");
+ CPPUNIT_ASSERT_EQUAL(OUString("https://bugs.documentfoundation.org/show_bug.cgi?id=104707"), aURL);
}
DECLARE_OOXMLEXPORT_TEST(testOLEObjectinHeader, "2129393649.docx")