summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2018-03-08 17:25:10 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2018-03-09 09:12:09 +0100
commitb288fdf89386446854debea35f8b8d013fec671d (patch)
tree2c2de8c4cf6f0c5c26c1fcc215fc7f83cea2e8c3 /sw
parentb810c84c4b56315f515b9983411957a5e51d164b (diff)
sw XHTML export: handle alt text for OLE objects
The XHTML export is now on par with the import wrt OLE objects. Change-Id: I736c1f03b0e3d8b84b8ebe08eb1b1cfa247cefbd Reviewed-on: https://gerrit.libreoffice.org/50966 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/extras/htmlexport/htmlexport.cxx6
-rw-r--r--sw/source/filter/html/htmlflywriter.cxx5
2 files changed, 6 insertions, 5 deletions
diff --git a/sw/qa/extras/htmlexport/htmlexport.cxx b/sw/qa/extras/htmlexport/htmlexport.cxx
index 2f9ff7dbbf07..c30def092451 100644
--- a/sw/qa/extras/htmlexport/htmlexport.cxx
+++ b/sw/qa/extras/htmlexport/htmlexport.cxx
@@ -390,11 +390,7 @@ DECLARE_HTMLEXPORT_ROUNDTRIP_TEST(testReqIfOleImg, "reqif-ole-img.xhtml")
// This was empty when either import or export handling was missing.
CPPUNIT_ASSERT_EQUAL(OUString("text/rtf"), getProperty<OUString>(xStream, "MediaType"));
- if (mbExported)
- // The below is not yet working for export.
- return;
-
- // Check alternate text (it was empty).
+ // Check alternate text (it was empty, for export the 'alt' attribute was used).
CPPUNIT_ASSERT_EQUAL(OUString("OLE Object"), getProperty<OUString>(xObject, "Title").trim());
}
diff --git a/sw/source/filter/html/htmlflywriter.cxx b/sw/source/filter/html/htmlflywriter.cxx
index ba9a62260543..985f8fd11977 100644
--- a/sw/source/filter/html/htmlflywriter.cxx
+++ b/sw/source/filter/html/htmlflywriter.cxx
@@ -1427,6 +1427,11 @@ Writer& OutHTML_Image( Writer& rWrt, const SwFrameFormat &rFrameFormat,
aHtml.attribute(OOO_STRING_SVTOOLS_HTML_O_usemap, "#" + aIMapName);
}
+ if ((nFrameOpts & HtmlFrmOpts::Replacement) && !rAlternateText.isEmpty())
+ // XHTML object replacement image's alternate text doesn't use the
+ // "alt" attribute.
+ aHtml.characters(rAlternateText.toUtf8());
+
aHtml.flushStack();
if( !rHTMLWrt.m_aINetFormats.empty() )