summaryrefslogtreecommitdiff
path: root/sw/qa/extras/htmlimport
diff options
context:
space:
mode:
authorMatúš Kukan <matus.kukan@collabora.com>2014-09-23 14:40:01 +0200
committerMatúš Kukan <matus.kukan@collabora.com>2014-09-23 14:41:52 +0200
commit38faee21e0b874359246e513b0a8c0af399a864d (patch)
treeb5978fb1e40408a4cbc915977f338d32f7690d67 /sw/qa/extras/htmlimport
parentd66b757083ddbb14c7bc58f4c34512185abbc60a (diff)
Do not link html images only when pasting from clipboard (bnc#580834)
Change-Id: I020c4e6ed6d468e553dedd7c91979b081d6b4725
Diffstat (limited to 'sw/qa/extras/htmlimport')
-rw-r--r--sw/qa/extras/htmlimport/data/picture.html7
-rw-r--r--sw/qa/extras/htmlimport/htmlimport.cxx13
2 files changed, 12 insertions, 8 deletions
diff --git a/sw/qa/extras/htmlimport/data/picture.html b/sw/qa/extras/htmlimport/data/picture.html
index c0b2e6cdb376..53f0c6441b13 100644
--- a/sw/qa/extras/htmlimport/data/picture.html
+++ b/sw/qa/extras/htmlimport/data/picture.html
@@ -3,17 +3,14 @@
<body>
<div>
<p>
- This document should contain only one link. (Edit -> Links...)
+ This document should contain two links. (Edit -> Links...)
</p>
<p>
- The picture below is supposed to be fully inserted into the document, not just as a link.
- <br/>
<a style="display:inline-block;" href="http://www.libreoffice.org/" title="Go to the Home of LibreOffice and the LibreOffice Community page">
<img src="../../../../../odk/docs/images/sdk_head-1.png" width="377" height="120px"/>
</a>
</p>
- This one is supposed to be inserted as a link, since the source is "http://..." URL.
- <br/>
+ <p>
<a style="display:inline-block;" href="http://www.libreoffice.org/" title="Go to the Home of LibreOffice and the LibreOffice Community page">
<img src="http://www.libreoffice.org/themes/libo/images/logo.png" width="218px" height="45px"/>
</a>
diff --git a/sw/qa/extras/htmlimport/htmlimport.cxx b/sw/qa/extras/htmlimport/htmlimport.cxx
index 592aa5335e70..1b1459fa43c3 100644
--- a/sw/qa/extras/htmlimport/htmlimport.cxx
+++ b/sw/qa/extras/htmlimport/htmlimport.cxx
@@ -29,9 +29,16 @@ DECLARE_HTMLIMPORT_TEST(testPictureImport, "picture.html")
{
SwXTextDocument* pTxtDoc = dynamic_cast<SwXTextDocument *>(mxComponent.get());
CPPUNIT_ASSERT(pTxtDoc);
- // The document contains one embeded picture and one stored as a link.
- const sfx2::LinkManager& rLinkManager = pTxtDoc->GetDocShell()->GetDoc()->GetEditShell()->GetLinkManager();
- CPPUNIT_ASSERT_EQUAL(size_t(1), rLinkManager.GetLinks().size());
+ // The document contains two pictures stored as a link.
+ sfx2::LinkManager& rLinkManager = pTxtDoc->GetDocShell()->GetDoc()->GetEditShell()->GetLinkManager();
+ CPPUNIT_ASSERT_EQUAL(size_t(2), rLinkManager.GetLinks().size());
+ rLinkManager.Remove(0,2);
+ CPPUNIT_ASSERT_EQUAL(size_t(0), rLinkManager.GetLinks().size());
+
+ // TODO: Get the data into clipboard in html format and paste
+
+ // But when pasting we don't want images to be linked.
+ CPPUNIT_ASSERT_EQUAL(size_t(0), rLinkManager.GetLinks().size());
}
DECLARE_HTMLIMPORT_TEST(testInlinedImage, "inlined_image.html")