# R36298 - in /trunk/etemplate: inc/class.bo\_merge.inc.php templates/default/msoffice.xslt

**URL:** <https://help.egroupware.org/t/r36298-in-trunk-etemplate-inc-class-bo-merge-inc-php-templates-default-msoffice-xslt/49033>\
**Category:** eGW-svn\
**Created:** [August 24, 2011, 5:29pm UTC](https://help.egroupware.org/t/r36298-in-trunk-etemplate-inc-class-bo-merge-inc-php-templates-default-msoffice-xslt/49033 "2011-08-24T17:29:03Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![nathangray](https://help.egroupware.org/letter_avatar_proxy/v4/letter/n/77aa72/32.png) [@nathangray](https://help.egroupware.org/u/nathangray)\
**Post date:** [August 24, 2011, 5:29pm UTC](https://help.egroupware.org/t/r36298-in-trunk-etemplate-inc-class-bo-merge-inc-php-templates-default-msoffice-xslt/49033/1 "2011-08-24T17:29:03Z")

</div>

Author: nathangray  
New Revision: 36298

URL: [http://svn.stylite.de/viewvc/egroupware?rev=36298&view=rev](http://svn.stylite.de/viewvc/egroupware?rev=36298&view=rev)  
Log:  
Don’t fail if table has properties, support table borders in docx files

Modified:  
trunk/etemplate/inc/class.bo\_merge.inc.php  
trunk/etemplate/templates/default/msoffice.xslt

# Modified: trunk/etemplate/inc/class.bo\_merge.inc.php URL: [http://svn.stylite.de/viewvc/egroupware/trunk/etemplate/inc/class.bo\_merge.inc.php?rev=36298&r1=36297&r2=36298&view=diff](http://svn.stylite.de/viewvc/egroupware/trunk/etemplate/inc/class.bo_merge.inc.php?rev=36298&r1=36297&r2=36298&view=diff)

— trunk/etemplate/inc/class.bo\_merge.inc.php (original)  
+++ trunk/etemplate/inc/class.bo\_merge.inc.php Wed Aug 24 19:29:03 2011  
@@ -357,7 +357,7 @@  
case ‘application/vnd.oasis.opendocument.spreadsheet’:  
// It seems easier to split the parent tags here  
$replace\_tags = array(

- 

```
  			'/<(ol|ul|table)>/' => '</text:p><$1>',

```

- 

```
  			'/<(ol|ul|table)( [^>]*)?>/' => '</text:p><$1$2>',
  			'/<\/(ol|ul|table)>/' => '</$1><text:p>',
  			//'/<(li)(.*?)>(.*?)<\/\1>/' => '<$1 $2>$3</$1>',
  		);

```

@@ -378,7 +378,7 @@  
);  
// It seems easier to split the parent tags here  
$replace\_tags = array(

- 

```
  			'/<(ol|ul|table)(.*?)>/' => '</w:t></w:r></w:p><$1$2>',

```

- 

```
  			'/<(ol|ul|table)( [^>]*)?>/' => '</w:t></w:r></w:p><$1$2>',
  			'/<\/(ol|ul|table)>/' => '</$1><w:p><w:r><w:t>',
  			'/<(li)(.*?)>(.*?)<\/\1>/' => '<$1 $2>$3</$1>',

```

/\*

# Modified: trunk/etemplate/templates/default/msoffice.xslt URL: [http://svn.stylite.de/viewvc/egroupware/trunk/etemplate/templates/default/msoffice.xslt?rev=36298&r1=36297&r2=36298&view=diff](http://svn.stylite.de/viewvc/egroupware/trunk/etemplate/templates/default/msoffice.xslt?rev=36298&r1=36297&r2=36298&view=diff)

— trunk/etemplate/templates/default/msoffice.xslt (original)  
+++ trunk/etemplate/templates/default/msoffice.xslt Wed Aug 24 19:29:03 2011  
@@ -223,6 +223,15 @@  
\<w:tblPr\>  
\<w:tblW w:type=“dxa” w:w=“9972”/\>  
\<w:jc w:value=“left”/\>

- 

```
  		<xsl:if test="@border &gt; 0">

```

- 

```
  			<w:tblBorders>

```

- 

```
  				<xsl:variable name="width" select="number(@border)*2"/>

```

- 

```
  				<w:top w:color="000000" w:space="0" w:sz="{$width}" w:val="single"/>

```

- 

```
  				<w:left w:color="000000" w:space="0" w:sz="{$width}" w:val="single"/>

```

- 

```
  				<w:bottom w:color="000000" w:space="0" w:sz="{$width}" w:val="single"/>

```

- 

```
  				<w:right w:color="000000" w:space="0" w:sz="{$width}" w:val="single"/>

```

- 

```
  			</w:tblBorders>

```

- 

```
  		</xsl:if>
  	</w:tblPr>
  	<w:tblGrid>
  		<xsl:for-each select="./tr[1]/td">

```

@@ -232,7 +241,18 @@  
\<xsl:for-each select="./tr"\>  
\<w:tr\>  
\<xsl:for-each select="./td"\>

- 

```
  		<w:tc><w:p><w:r><w:t><xsl:apply-templates select="child::node()" /></w:t></w:r></w:p></w:tc>

```

- 

```
  		<w:tc>

```

- 

```
  		<xsl:if test="../../@border &gt; 0">

```

- 

```
  			<w:tcPr><w:tcBorders>

```

- 

```
  				<xsl:variable name="width" select="number(../../@border)*2"/>

```

- 

```
  				<w:top w:color="000000" w:space="0" w:sz="{$width}" w:val="single"/>

```

- 

```
  				<w:left w:color="000000" w:space="0" w:sz="{$width}" w:val="single"/>

```

- 

```
  				<w:bottom w:color="000000" w:space="0" w:sz="{$width}" w:val="single"/>

```

- 

```
  				<w:right w:color="000000" w:space="0" w:sz="{$width}" w:val="single"/>

```

- 

```
  			</w:tcBorders></w:tcPr>

```

- 

```
  		</xsl:if>

```

- 

```
  		<w:p><w:r><w:t><xsl:apply-templates select="child::node()" /></w:t></w:r></w:p>

```

- 

```
  		</w:tc>
  	</xsl:for-each>
  	</w:tr>
  </xsl:for-each>

```

* * *

EMC VNX: the world’s simplest storage, starting under $10K  
The only unified storage solution that offers unified management  
Up to 160% more powerful than alternatives and 25% more efficient.  
Guaranteed. [http://p.sf.net/sfu/emc-vnx-dev2dev](http://p.sf.net/sfu/emc-vnx-dev2dev)

* * *

eGroupWare-cvs mailing list  
[eGroupWare-cvs@lists.sourceforge.net](mailto:eGroupWare-cvs@lists.sourceforge.net)  
[https://lists.sourceforge.net/lists/listinfo/egroupware-cvs](https://lists.sourceforge.net/lists/listinfo/egroupware-cvs)
