summaryrefslogtreecommitdiff
path: root/xmloff/source/text/txtparae.cxx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2013-11-15 15:29:02 +0000
committerCaolán McNamara <caolanm@redhat.com>2013-11-15 16:04:34 +0000
commit306a39ec0d2cde09d7e75e726ce47622939733d7 (patch)
treeed8834177f75f9cf5b661d5069605faf4da0d8b9 /xmloff/source/text/txtparae.cxx
parent9db943c50519b2a36f3eb144fda7f08abe13bdb2 (diff)
Resolves: fdo#62461 put preferred image first
with fallback after. "Each child element of a frame is a different representation of the same content. The order of content elements reflects the document author's preference for rendering, with the first child element being preferred. That means that consumers should render the first child element that they support. A frame may contain multiple content elements, but shall contain at least one content element." Change-Id: If50062cad58f5b8561ad6bd8dc1a06956d2f444b
Diffstat (limited to 'xmloff/source/text/txtparae.cxx')
-rw-r--r--xmloff/source/text/txtparae.cxx44
1 files changed, 24 insertions, 20 deletions
diff --git a/xmloff/source/text/txtparae.cxx b/xmloff/source/text/txtparae.cxx
index f43673c59297..755db3501381 100644
--- a/xmloff/source/text/txtparae.cxx
+++ b/xmloff/source/text/txtparae.cxx
@@ -3097,26 +3097,6 @@ void XMLTextParagraphExport::_exportTextGraphic(
OUString sReplacementOrigURL;
rPropSet->getPropertyValue( sReplacementGraphicURL ) >>= sReplacementOrigURL;
- if(sReplacementOrigURL.getLength())
- {
- const OUString sReplacementURL(GetExport().AddEmbeddedGraphicObject( sReplacementOrigURL ));
-
- // If there is no url, then then graphic is empty
- if(sReplacementURL.getLength())
- {
- GetExport().AddAttribute(XML_NAMESPACE_XLINK, XML_HREF, sReplacementURL);
- GetExport().AddAttribute(XML_NAMESPACE_XLINK, XML_TYPE, XML_SIMPLE);
- GetExport().AddAttribute(XML_NAMESPACE_XLINK, XML_SHOW, XML_EMBED);
- GetExport().AddAttribute(XML_NAMESPACE_XLINK, XML_ACTUATE, XML_ONLOAD);
-
- // xlink:href for replacement, only written for Svg content
- SvXMLElementExport aElement(GetExport(), XML_NAMESPACE_DRAW, XML_IMAGE, sal_False, sal_True);
-
- // optional office:binary-data
- GetExport().AddEmbeddedGraphicObjectAsBase64(sReplacementURL);
- }
- }
-
// xlink:href
OUString sOrigURL;
rPropSet->getPropertyValue( sGraphicURL ) >>= sOrigURL;
@@ -3148,6 +3128,30 @@ void XMLTextParagraphExport::_exportTextGraphic(
GetExport().AddEmbeddedGraphicObjectAsBase64( sOrigURL );
}
+ //Resolves: fdo#62461 put preferred image first above, followed by
+ //fallback here
+ if (!sReplacementOrigURL.isEmpty())
+ {
+ const OUString sReplacementURL(GetExport().AddEmbeddedGraphicObject( sReplacementOrigURL ));
+
+ // If there is no url, then then graphic is empty
+ if(sReplacementURL.getLength())
+ {
+ GetExport().AddAttribute(XML_NAMESPACE_XLINK, XML_HREF, sReplacementURL);
+ GetExport().AddAttribute(XML_NAMESPACE_XLINK, XML_TYPE, XML_SIMPLE);
+ GetExport().AddAttribute(XML_NAMESPACE_XLINK, XML_SHOW, XML_EMBED);
+ GetExport().AddAttribute(XML_NAMESPACE_XLINK, XML_ACTUATE, XML_ONLOAD);
+
+ // xlink:href for replacement, only written for Svg content
+ SvXMLElementExport aElement(GetExport(), XML_NAMESPACE_DRAW, XML_IMAGE, sal_False, sal_True);
+
+ // optional office:binary-data
+ GetExport().AddEmbeddedGraphicObjectAsBase64(sReplacementURL);
+ }
+ }
+
+
+
// script:events
Reference<XEventsSupplier> xEventsSupp( rPropSet, UNO_QUERY );
GetExport().GetEventExport().Export(xEventsSupp);