Do not have draw:frames with duplicate names, they will be stripped when opening with LibreOffice 5.1

This commit is contained in:
nathangray 2016-05-24 13:48:41 -06:00
parent 00000dbeee
commit fccf83e36a
2 changed files with 11 additions and 2 deletions

View File

@ -1574,6 +1574,7 @@ abstract class Merge
$archive = tempnam($GLOBALS['egw_info']['server']['temp_dir'], basename($document,$ext).'-').$ext;
copy($content_url,$archive);
$content_url = 'zip://'.$archive.'#'.($content_file = 'content.xml');
$this->parse_html_styles = true;
break;
case 'application/vnd.openxmlformats-officedocument.wordprocessingml.d': // mimetypes in vfs are limited to 64 chars
$mimetype = 'application/vnd.openxmlformats-officedocument.wordprocessingml.document';

View File

@ -4,6 +4,7 @@
xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0"
xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0"
xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0"
xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0"
@ -241,6 +242,13 @@
<text:tab-stop />&#8226; <xsl:value-of select="normalize-space()" /><text:line-break />
</xsl:template>
<!-- Avoid duplicate frame names, that doesn't work after LibreOffice v5.1-->
<xsl:template match="draw:frame/@draw:name">
<xsl:attribute name="draw:name">
<xsl:value-of select="concat(., '-', generate-id())"/>
</xsl:attribute>
</xsl:template>
<xsl:template match="li">
<xsl:variable name="list_style">
<xsl:choose>